@epam/ai-dial-ui-kit 0.16.0-dev.66 → 0.16.0-dev.68

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-6jyIN-OC.cjs"),F=require("@tabler/icons-react"),P=require("@floating-ui/react"),m=require("react"),te=require("classnames"),gn=require("./editors.cjs"),Ua=require("react-dom");function Za(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=Za(m),zr=({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(zr,{...e,variant:c.CaptionType.Error}),xs={[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]:{}},xn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=xs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),xs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},qa=7,Ya=2,bn=m.createContext(null),vn=()=>{const e=m.useContext(bn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Xa=({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,p=P.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:P.autoUpdate,middleware:[P.offset(qa+Ya),P.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),P.shift({padding:5}),P.arrow({element:l})]}),h=P.useHover(p.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),x=P.useFocus(p.context,{enabled:n==null}),g=P.useDismiss(p.context),y=P.useRole(p.context,{role:"tooltip"}),v=P.useInteractions([h,x,g,y]);return m.useEffect(()=>{if(!d)return;const b=p.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,p.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...p}),[d,u,v,p])},Fr=({children:e,...t})=>{const r=Xa(t);return s.jsx(bn.Provider,{value:r,children:e})},Hr=({style:e,...t})=>{const r=vn(),n=c.useHasHover(),a=m.useRef(null),o=P.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(P.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(P.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},$r=({children:e,asChild:t=!1,...r})=>{const n=vn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=P.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(Fr,{...o,children:[s.jsx($r,{className:te(n,"truncate"),children:r}),s.jsx(Hr,{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&&xn(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},Qa="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",Ja=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:Qa,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},Kr=({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(Ja,{caption:n})]}):null,eo=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:p})=>{const h=n!==void 0,[x,g]=m.useState(a),y=i?!0:h?n:x,v=m.useId(),b=()=>{if(o)return;const C=!y;h||g(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",p),children:r})]})},to="flex items-center justify-center text-secondary",ro="shrink-0 grow-0 basis-auto animate-spin-steps",so=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"})),no=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:te({[to]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(so,{width:e,height:e,className:te(ro,r),role:"img","aria-label":a})})}),Ve=({size:e=40,className:t,fullWidth:r=!1,fullScreen:n=!1,ariaLabel:a="Loading",focusRef:o})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},{"fixed inset-0 z-popup bg-layer-base":n},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{ref:o,tabIndex:o?-1:void 0,role:"img","aria-label":a,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 ao={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},yn=({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 p=m.useId(),h=i??p,x=!!n?.label,g=x?n?.id??`${h}-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:h,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":g,"aria-label":c.resolveAccessibleName(d,x?void 0:ao[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!x&&!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!x&&!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:g}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),I]})},oo=({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})]}),io=({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:p,...h})=>{const x=te(d?"hidden sm:inline":"inline",o),g=f.mergeClasses(t&&xn(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",{...h,type:u,className:g,"aria-label":typeof e=="string"&&e||h["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:x,children:e}),s.jsx(c.DialIcon,{icon:i})]});return p?s.jsx(qe,{...p,children:y}):y},lo="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),[p,h]=m.useState(""),x=m.useCallback(()=>{const b=l.current;b&&(h(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),g=m.useCallback(()=>c.scheduleMeasure(x),[x]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,x)},[x]),m.useEffect(()=>{g()},[e,g]);const y=m.useMemo(()=>typeof e=="string"?e:p,[p,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Fr,{...i,children:[s.jsx($r,{asChild:!0,onMouseEnter:g,onFocusCapture:g,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:g,onFocus:g,ref:l,children:e})}),s.jsx(Hr,{className:f.mergeClasses(lo,r,!v&&"hidden"),children:v})]})},co=({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 uo=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:p,className:h,...x})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const g=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",h);if(i!==Ee.Default){const w=f.mergeClasses(g,i===Ee.Circular&&"rounded-full",i===Ee.Rectangular&&"rounded",i===Ee.Text&&"rounded",!!u&&"relative"),T={};return l&&(T.width=typeof l=="number"?`${l}px`:l),d&&(T.height=typeof d=="number"?`${d}px`:d),p&&(T.backgroundColor=p),s.jsx("div",{className:w,style:T,...x,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:{},N=uo(C.size),j=C.shape??Wt.Circle,E=I.width??"38%",A=S.rows??3,L=S.width,D=w=>L?Array.isArray(L)?L[w]??"100%":L:w===A-1?"61%":"100%";return s.jsxs("div",{...x,className:f.mergeClasses("flex gap-4",!!u&&"relative",h,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(g,j===Wt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:N,height:N,...p&&{backgroundColor:p}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:E,...p&&{backgroundColor:p}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((w,T)=>s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:D(T),...p&&{backgroundColor:p}}},T))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},fo=te("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),po=te("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Er=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),Lr="opacity-75 !cursor-not-allowed",Cn="text-error",ho="my-1 border-t border-hover border-secondary",st=4,mo=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),go=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),xo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),bo=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),In=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),vo=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),yo=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),Co=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),Sn=go(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Nn=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(Sn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),Io=({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=>p=>{u.disabled||(u.onClick?.({key:u.key,domEvent:p}),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(Er,e.disabled&&Lr,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:mo})]}),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(Er,u.disabled&&Lr,u.danger&&Cn,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))})})]})},So=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:p=!1,onOpenChange:h,closable:x=!1,onClose:g,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:S=!0,allowedPlacements:N,anchorToMouse:j=!1,matchReferenceWidth:E=!0,maxDropdownHeight:A})=>{const[L,D]=m.useState(p),w=u!==void 0,T=w?!!u:L,_=m.useRef(null),B=m.useCallback(O=>{w||D(O),h?.(O)},[w,h]),k=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:G}=P.useFloating({placement:l,open:T,onOpenChange:B,whileElementsMounted:P.autoUpdate,middleware:[P.offset({mainAxis:st,crossAxis:0}),R?P.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:N}):P.flip({padding:st}),P.shift({padding:st}),P.size({padding:st,apply({availableWidth:O,availableHeight:U,elements:de}){const ae=de.floating,ge=So(de.reference);ae.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ae.style.setProperty("--reference-width",E?`${Math.round(ge)}px`:"0px"),E?ae.style.minWidth=`${Math.round(ge)}px`:ae.style.removeProperty("min-width"),ae.style.maxWidth=`${Math.floor(O)}px`;const Qe=Math.floor(U);ae.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),V=P.useClick(G,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),Z=P.useHover(G,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),se=P.useDismiss(G,{bubbles:!0,referencePress:!1,outsidePress:O=>{if(!S)return!1;const U=O.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),re=P.useRole(G,{role:"menu"}),{getReferenceProps:le,getFloatingProps:W}=P.useInteractions([V,Z,se,re]),K=m.useCallback((O,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:O,y:U,top:U,left:O,right:O,bottom:U})})},[M]),Y=m.useCallback(O=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(O.preventDefault(),j&&(K(O.clientX,O.clientY),_.current=document.elementFromPoint(O.clientX,O.clientY)),B(!0))},[j,d,B,K,i]),ee=m.useCallback(O=>{!j||d||(i.includes(c.DropdownTrigger.ContextMenu)&&T&&B(!1),K(O.clientX,O.clientY),_.current=document.elementFromPoint(O.clientX,O.clientY))},[j,d,K,T,i,B]);m.useEffect(()=>{d&&T&&B(!1)},[d,T,B]);const ne=m.useCallback(O=>U=>{O.disabled||(O.onClick?.({key:O.key,domEvent:U}),r?.({key:O.key,domEvent:U}),B(!1))},[r,B]),pe=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(O=>O.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(ho,b)},O.key):O.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",O.className),children:O.label},O.key):O.children?.length?s.jsx(Io,{item:O,onRootClose:()=>B(!1)},O.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!O.disabled,className:te(Er,O.disabled&&Lr,O.danger&&Cn,O.className),disabled:O.disabled,onClick:ne(O),children:[O.icon&&s.jsx("span",{className:te(O.danger&&"text-error",O.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:O.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",O.danger&&"text-error",O.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:O.label})]},O.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[ne,t,a,n,o,B,v,b]),ve=le({onContextMenu:Y,onMouseDown:ee});return m.useEffect(()=>{if(!T)return;const O=M.reference.current;let U=null;if(O instanceof Element?U=O:_.current instanceof Element&&(U=_.current),!U)return;const de=new IntersectionObserver(([ae])=>{ae.isIntersecting||B(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[T,M.reference,B]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:te(fo,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":T,"aria-controls":k,...ve,children:e}),T&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:k,ref:M.setFloating,style:H,className:te(po,!E&&"w-max",C),...W(),children:[x&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(Nn,{ariaLabel:"Close dropdown",onClose:O=>{g?.(O),B(!1)}})}),pe]})})})]})};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}),p=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:p,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})})]})},No=()=>{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},jo=12,wo=({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:p,inlineContainerClassName:h,inlineTabClassName:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(!1),[C,I]=m.useState(!1),S=No(),N=S===c.ScreenType.Mobile||i===Ut.Tablet&&S===c.ScreenType.Tablet,j=a===Ge.Horizontal,E=m.useRef(null),A=m.useRef(null),L=m.useRef(null),D=e.find(k=>k.id===t),w=m.useMemo(()=>f.mergeClasses("flex gap-2",j?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[j]),T=m.useCallback(()=>{const k=A.current;k&&I(k.scrollWidth>k.clientWidth)},[]),_=m.useCallback(()=>{const k=L.current,R=A.current;if(!k||!R)return;const M=k.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const G=jo;let V=R.scrollLeft;if(M.left<H.left+G)V-=H.left+G-M.left;else if(M.right>H.right-G)V+=M.right-(H.right-G);else return;const Z=Math.max(0,R.scrollWidth-R.clientWidth);V=Math.max(0,Math.min(V,Z)),V!==R.scrollLeft&&R.scrollTo({left:V,behavior:"smooth"})},[]),B=m.useCallback(k=>{r(k),k===t&&_()},[r,t,_]);return m.useEffect(()=>{T();const k=new ResizeObserver(()=>T()),R=A.current;return R&&k.observe(R),()=>k.disconnect()},[e,T]),m.useEffect(()=>{_()},[t,_]),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",h),children:e.map(k=>s.jsx(gt,{tab:k,active:t===k.id,view:Ue.Inline,onClick:B,className:x},k.id))}):N?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:g,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(k=>s.jsx(gt,{tab:k,active:k.id===t,onClick:R=>{B(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},k.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:D,active:!0,onClick:B,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",g&&"rotate-180")})]})})}):s.jsxs("div",{ref:E,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:w,children:e.map(k=>s.jsx("div",{ref:t===k.id?L:void 0,className:"w-full",children:s.jsx(gt,{tab:k,active:t===k.id,onClick:B,horizontal:j,className:f.mergeClasses("w-full",p)})},k.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(k=>s.jsx(gt,{tab:k,active:k.id===t,onClick:R=>{B(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},k.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)})})})]})},jn="w-full overflow-hidden",wn="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",gr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Ar="flex flex-1 items-center gap-1 min-w-0 transition-colors",Do="text-secondary hover:text-accent-primary",Dn="text-primary cursor-default",Vr="flex-none inline-flex items-center leading-none text-secondary",To="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Tn=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=Tn,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:p,...h})=>{const x=async I=>{if(p&&!a&&!await p()){I.preventDefault();return}r&&r(I)},g=a?gr.last:o?gr.first:gr.middle,y=f.mergeClasses(Zt,g,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Ar,Do):f.mergeClasses(Ar,Dn,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",{...h,className:y,"aria-label":h["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:x,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:Vr,"aria-label":"separator",children:i})]})},Eo=({pathItems:e,separator:t=Tn,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(p=>{const h=p.props,{labelClassName:x,isLast:g,separator:y,...v}=h;return v}),[e,a]),d=m.useCallback(async p=>{const h=parseInt(p.key,10),x=l[h];if(i&&!await i()){p.domEvent.preventDefault();return}x.onClick?x.onClick(p.domEvent):x.href&&(window.location.href=x.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 p=l.at(0),h=l.slice(1,-2),x=l.at(-2),g=l.at(-1);if(!p||!x||!g)return null;const y=h.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,{...p,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:To,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Vr,children:t})]}),m.createElement(xt,{...x,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...g,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(jn,n),children:s.jsx("ol",{className:wn,children:u})})},Wr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),En=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Gr=Wr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),Ln=Wr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),An=Wr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),Lo=En(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Ao=En(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),_n=({iconClassName:e,label:t,...r})=>t?s.jsx(An,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(In,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),_o="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",Oo=({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(_o,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),ko=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Ro=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!ko.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}}}}},On=({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(Kr,{...e,htmlFor:n}),s.jsx(kn,{id:n,...o}),s.jsx(Fe,{text:t}),!t&&s.jsx(zr,{text:r})]}),kn=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:p,tooltipText:h,min:x,onChange:g,max:y,inputButtonProps:v,...b})=>{const C=m.useRef(null),I=P.useMergeRefs([u,C]),S=d==="number"||x!==void 0||y!==void 0;m.useEffect(()=>{const A=C.current;if(!A||!S||t)return;const L=D=>{D.preventDefault()};return A.addEventListener("wheel",L,{passive:!1}),()=>{A.removeEventListener("wheel",L)}},[t,S,d]);const N=A=>{Ro(A,d,x,y)},j=A=>{const L=A.currentTarget.value;if(S&&L!==""){const D=parseFloat(L);if(isNaN(D)&&L!=="-"&&L!=="."||!isNaN(D)&&(x!==void 0&&D<+x||y!==void 0&&D>+y))return}g?.(L||void 0)},E=()=>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(kn,{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:p??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:j,onKeyDown:N,min:x,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(Oo,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:h||p,children:E()}):E()},Rn=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 bs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),vs=function(){return Math.random().toString(36).substring(7).split("").join(".")},ys={INIT:"@@redux/INIT"+vs(),REPLACE:"@@redux/REPLACE"+vs()};function Mo(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 Po(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(Fo(e))return"date";if(zo(e))return"error";var r=Bo(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 Bo(e){return typeof e.constructor=="function"?e.constructor.name:null}function zo(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Fo(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=Po(e)),t}function Mn(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(Mn)(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 p(){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 h(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 x(v){if(!Mo(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 g(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,x({type:ys.REPLACE})}function y(){var v,b=h;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(p())}S();var N=b(S);return{unsubscribe:N}}},v[bs]=function(){return this},v}return x({type:ys.INIT}),n={dispatch:x,subscribe:h,getState:p,replaceReducer:g},n[bs]=y,n}function q(e,t,...r){if(Ho()&&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 Ho(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function $o(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Ko(e,t){return e.filter(r=>r!==t)}function Pn(e){return typeof e=="object"}function Vo(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 Wo(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Ur="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Zr="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function Cs(e,t){return{type:Ur,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Go={type:Ur,payload:{clientOffset:null,sourceClientOffset:null}};function Uo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(Cs(o)),Zo(r,l,d);const u=Xo(r,l);if(u==null){e.dispatch(Go);return}let p=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");qo(i),p=i(u)}e.dispatch(Cs(o,p));const x=d.getSource(u).beginDrag(l,u);if(x==null)return;Yo(x),d.pinSource(u);const g=d.getSourceType(u);return{type:tr,payload:{itemType:g,item:x,sourceId:u,clientOffset:o||null,sourceClientOffset:p||null,isSourcePublic:!!a}}}}function Zo(e,t,r){q(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){q(r.getSource(n),"Expected sourceIds to be registered.")})}function qo(e){q(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Yo(e){q(Pn(e),"Item must be an object.")}function Xo(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 Qo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jo(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){Qo(e,a,r[a])})}return e}function ei(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();ti(n),ni(n).forEach((i,l)=>{const d=ri(i,l,a,n),u={type:sr,payload:{dropResult:Jo({},r,d)}};e.dispatch(u)})}}function ti(e){q(e.isDragging(),"Cannot call drop while not dragging."),q(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ri(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return si(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function si(e){q(typeof e>"u"||Pn(e),"Drop result must either be an object or undefined.")}function ni(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ai(e){return function(){const r=e.getMonitor(),n=e.getRegistry();oi(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function oi(e){q(e.isDragging(),"Cannot call endDrag while not dragging.")}function _r(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ii(e){return function(r,{clientOffset:n}={}){li(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return di(a,i,l),ci(a,o,i),ui(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function li(e){q(Array.isArray(e),"Expected targetIds to be an array.")}function ci(e,t,r){q(t.isDragging(),"Cannot call hover while not dragging."),q(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];q(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);q(o,"Expected targetIds to be registered.")}}function di(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);_r(o,r)||e.splice(n,1)}}function ui(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function fi(e){return function(){if(e.getMonitor().isDragging())return{type:Zr}}}function pi(e){return{beginDrag:Uo(e),publishDragSource:fi(e),hover:ii(e),drop:ei(e),endDrag:ai(e)}}class hi{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=pi(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 mi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Bn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Bn(mi(t,n),r)}function xi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Bn(t,r)}const vt=[],qr=[];vt.__IS_NONE__=!0;qr.__IS_ALL__=!0;function bi(e,t){return e===vt?!1:e===qr||typeof t>"u"?!0:Wo(t,e).length>0}class vi{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;q(typeof t=="function","listener must be a function."),q(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&&!bi(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){q(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 q(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(q(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 _r(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(q(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&&!_r(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 gi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return xi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Is=typeof global<"u"?global:self,zn=Is.MutationObserver||Is.WebKitMutationObserver;function Fn(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function yi(e){let t=1;const r=new zn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Ci=typeof zn=="function"?yi:Fn;class Ii{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=Ci(this.flush),this.requestErrorThrow=Fn(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Si{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 Ni{create(t){const r=this.freeTasks,n=r.length?r.pop():new Si(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Hn=new Ii,ji=new Ni(Hn.registerPendingError);function wi(e){Hn.enqueueTask(ji.create(e))}const Yr="dnd-core/ADD_SOURCE",Xr="dnd-core/ADD_TARGET",Qr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function Di(e){return{type:Yr,payload:{sourceId:e}}}function Ti(e){return{type:Xr,payload:{targetId:e}}}function Ei(e){return{type:Qr,payload:{sourceId:e}}}function Li(e){return{type:ar,payload:{targetId:e}}}function Ai(e){q(typeof e.canDrag=="function","Expected canDrag to be a function."),q(typeof e.beginDrag=="function","Expected beginDrag to be a function."),q(typeof e.endDrag=="function","Expected endDrag to be a function.")}function _i(e){q(typeof e.canDrop=="function","Expected canDrop to be a function."),q(typeof e.hover=="function","Expected hover to be a function."),q(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}q(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 Oi=0;function ki(){return Oi++}function Ri(e){const t=ki().toString();switch(e){case Ie.SOURCE:return`S${t}`;case Ie.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ss(e){switch(e[0]){case"S":return Ie.SOURCE;case"T":return Ie.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ns(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 Mi{addSource(t,r){Or(t),Ai(r);const n=this.addHandler(Ie.SOURCE,t,r);return this.store.dispatch(Di(n)),n}addTarget(t,r){Or(t,!0),_i(r);const n=this.addHandler(Ie.TARGET,t,r);return this.store.dispatch(Ti(n)),n}containsHandler(t){return Ns(this.dragSources,t)||Ns(this.dropTargets,t)}getSource(t,r=!1){return q(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return q(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ss(t)===Ie.SOURCE}isTargetId(t){return Ss(t)===Ie.TARGET}removeSource(t){q(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ei(t)),wi(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){q(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Li(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);q(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){q(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=Ri(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 Pi=(e,t)=>e===t;function Bi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function zi(e,t,r=Pi){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 Fi(e=vt,t){switch(t.type){case rr:break;case Yr:case Xr:case ar:case Qr:return vt;case tr:case Zr:case nr:case sr:default:return qr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Vo(r,n);if(!(a.length>0||!zi(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 Hi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),n.forEach(function(a){Hi(e,a,r[a])})}return e}const js={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ki(e=js,t){const{payload:r}=t;switch(t.type){case Ur:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Bi(e.clientOffset,r.clientOffset)?e:$i({},e,{clientOffset:r.clientOffset});case nr:case sr:return js;default:return e}}function Vi(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){Vi(e,a,r[a])})}return e}const Wi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Gi(e=Wi,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 Zr: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:Ko(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 Ui(e=0,t){switch(t.type){case Yr:case Xr:return e+1;case Qr:case ar:return e-1;default:return e}}function Zi(e=0){return e+1}function qi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yi(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){qi(e,a,r[a])})}return e}function Xi(e={},t){return{dirtyHandlerIds:Fi(e.dirtyHandlerIds,{type:t.type,payload:Yi({},t.payload,{prevTargetIds:$o(e,"dragOperation.targetIds",[])})}),dragOffset:Ki(e.dragOffset,t),refCount:Ui(e.refCount,t),dragOperation:Gi(e.dragOperation,t),stateId:Zi(e.stateId)}}function Qi(e,t=void 0,r={},n=!1){const a=Ji(n),o=new vi(a,new Mi(a)),i=new hi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function Ji(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Mn(Xi,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function el(e,t){if(e==null)return{};var r=tl(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 tl(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 rl=m.memo(function(t){var{children:r}=t,n=el(t,["children"]);const[a,o]=sl(n);return m.useEffect(()=>{if(o){const i=$n();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(Rn.Provider,{value:a,children:r})});function sl(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=nl(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function nl(e,t=$n(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:Qi(e,t,r,n)}),a[Kt]}function $n(){return typeof global<"u"?global:window}function al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,Ds;function ol(){return Ds||(Ds=1,xr=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}),xr}var il=ol();const ll=al(il),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function cl(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);ll(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function dl(e,t,r){const[n,a]=cl(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function ul(e,t,r){return dl(t,e||(()=>({})),()=>r.reconnect())}function fl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let br=!1;class pl{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;q(!br,"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 br=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{br=!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 hl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function ml(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 p=e[u],h=t[u];if(a=void 0,a===!1||a===void 0&&p!==h)return!1}return!0}function gl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xl(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 bl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return xl(n),yl(n,r?o=>e(o,r):e)}}function vl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=bl(n);t[r]=()=>a}}),t}function Ts(e,t){typeof e=="function"?e(t):e.current=t}function yl(e,t){const r=e.ref;return q(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=>{Ts(r,n),Ts(t,n)}}):m.cloneElement(e,{ref:t})}class Cl{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!ml(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=vl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,gl(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 Jr(){const{dragDropManager:e}=m.useContext(Rn);return q(e!=null,"Expected drag drop context"),e}function Il(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function Sl(e){const t=Jr(),r=m.useMemo(()=>new Cl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function Nl(){const e=Jr();return m.useMemo(()=>new pl(e),[e])}function jl(e){const{accept:t}=e;return m.useMemo(()=>(q(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class wl{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 Dl(e,t){const r=m.useMemo(()=>new wl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function Tl(e,t,r){const n=Jr(),a=Dl(e,t),o=jl(e);or(function(){const[l,d]=hl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Kn(e,t){const r=fl(e,t),n=Nl(),a=Sl(r.options);return Tl(r,n,a),[ul(r.collect,n,a),Il(a)]}function Vn(e){let t=null;return()=>(t==null&&(t=e()),t)}function El(e,t){return e.filter(r=>r!==t)}function Ll(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 Al{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=Ll(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=El(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class _l{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__",Wn="__NATIVE_URL__",Gn="__NATIVE_TEXT__",Un="__NATIVE_HTML__",Es=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:Un,TEXT:Gn,URL:Wn},Symbol.toStringTag,{value:"Module"}));function vr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const kr={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[Un]:{exposeProperties:{html:(e,t)=>vr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Wn]:{exposeProperties:{urls:(e,t)=>vr(e,t,"").split(`
2
- `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Gn]:{exposeProperties:{text:(e,t)=>vr(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Ol(e,t){const r=kr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new _l(r);return n.loadDataTransfer(t),n}function yr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(kr).filter(r=>{const n=kr[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const kl=Vn(()=>/firefox/i.test(navigator.userAgent)),Zn=Vn(()=>!!window.safari);class Ls{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,p;for(;d<=u;){p=Math.floor(.5*(d+u));const g=r[p];if(g<t)d=p+1;else if(g>t)u=p-1;else return n[p]}l=Math.max(0,u);const h=t-r[l],x=h*h;return n[l]+a[l]*h+o[l]*x+i[l]*h*x}constructor(t,r){const{length:n}=t,a=[];for(let g=0;g<n;g++)a.push(g);a.sort((g,y)=>t[g]<t[y]?-1:1);const o=[],i=[];let l,d;for(let g=0;g<n-1;g++)l=t[g+1]-t[g],d=r[g+1]-r[g],o.push(l),i.push(d/l);const u=[i[0]];for(let g=0;g<o.length-1;g++){const y=i[g],v=i[g+1];if(y*v<=0)u.push(0);else{l=o[g];const b=o[g+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const p=[],h=[];let x;for(let g=0;g<u.length-1;g++){x=i[g];const y=u[g],v=1/o[g],b=y+u[g+1]-x-x;p.push((x-y-b)*v),h.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=p,this.c3s=h}}const Rl=1;function qn(e){const t=e.nodeType===Rl?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 Ml(e){var t;return e.nodeName==="IMG"&&(kl()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Pl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Zn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Bl(e,t,r,n,a){const o=Ml(t),l=qn(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:p}=e,{anchorX:h,anchorY:x}=n,{dragPreviewWidth:g,dragPreviewHeight:y}=Pl(o,t,u,p),v=()=>{let E=new Ls([0,.5,1],[d.y,d.y/p*y,d.y+y-p]).interpolate(x);return Zn()&&o&&(E+=(window.devicePixelRatio-1)*y),E},b=()=>new Ls([0,.5,1],[d.x,d.x/u*g,d.x+g-u]).interpolate(h),{offsetX:C,offsetY:I}=a,S=C===0||C,N=I===0||I;return{x:S?C:b(),y:N?I:v()}}class zl{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 Fl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function As(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){Fl(e,a,r[a])})}return e}class Hl{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 As({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 As({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Es).some(r=>Es[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Ol(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&&qn(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=yr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const p=this.monitor.getSourceId(),h=this.sourceNodes.get(p),x=this.sourcePreviewNodes.get(p)||h;if(x){const{anchorX:g,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=Bl(h,x,i,{anchorX:g,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(x,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=yr(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 yr(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 zl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Al(this.isNodeInDocument)}}const $l=function(t,r,n){return new Hl(t,r,n)},Kl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h})=>{const x=m.useRef(null),g=m.useRef(null),[y,v]=m.useState([]),[b,C]=m.useState(!1),[I,S]=m.useState(!1),N=m.useCallback(M=>{const H=M.target.files;if(H&&H.length>0){const G=Array.from(H),V=p?.(G),Z=h?.(G);V?C(!0):Z?S(!0):e(G)}},[p,h,e]),j=m.useCallback(M=>o&&M?.length>o,[o]),E=m.useMemo(()=>b||I||j(y),[b,I,j,y]),A=()=>{v([]),C(!1),S(!1)},L=m.useMemo(()=>b?s.jsx(Fe,{text:l}):I?s.jsx(Fe,{text:u}):j(y)?s.jsx(Fe,{text:d}):null,[d,l,u,y,j,b,I]);m.useEffect(()=>{A()},[a]);const[{isOver:D,canDrop:w},T]=Kn(()=>({accept:[ir],drop(M){const H=M.files,G=p?.(H)??!1,V=h?.(H)??!1,Z=j?.(H)??!1;if(C(G),S(V),G||V||Z){v(H);return}e(H),A()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,p,h,j]),_=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),g.current?.click())},B=M=>{M?.preventDefault();const H=Array.from(M.dataTransfer?.items??[]);C(!!p?.(H)),S(!!h?.(H)),v(H)},k=M=>{M.target===M.currentTarget&&A()},R=te("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!w&&!E&&"border-primary",w&&(D?"border-accent-primary":"border-hover"),E&&"border-error");return T(x),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:x,onDragOver:B,onDragLeave:k,children:[s.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:_,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(Gr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>g.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:g,hidden:!0,accept:a,onChange:N})]}),s.jsx(s.Fragment,{children:L})]})},Vl=({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(On,{...r,iconBefore:a(),containerClassName:te("h-[40px] p-0",n&&"h-[60px]"),className:te("rounded-r-none border-r-0",n&&"text-error",t)})},Wl=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=m.useRef(null),[p,h]=m.useState(!1),[x,g]=m.useState(!1),[y,v]=m.useState(0),b=m.useCallback(()=>{h(!1),g(!1),v(0)},[]),C=m.useCallback(D=>!!(o&&t.length+D.length>o),[o,t.length]),I=p||x,[{isOver:S,canDrop:N},j]=Kn(()=>({accept:[ir],drop(D){const w=D.files,T=[...t,...w],_=n?.(w)??!1,B=a?.(w)??!1,k=C?.(w)??!1;if(h(_),g(B),_||B||k){v(w.length);return}r(T),b()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[t,r,n,a,C,b]),E=D=>{D.preventDefault();const w=Array.from(D.dataTransfer?.items??[]);h(!!n?.(w)),g(!1),v(w.length)},A=D=>{D.target===D.currentTarget&&b()};j(u);const L=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:E,onDragLeave:A,className:te("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!L&&(N&&S?"border-accent-primary":"border-primary"),(I||L)&&"border-error"),children:e}),p&&s.jsx(Fe,{text:i}),x&&s.jsx(Fe,{text:l}),!p&&!x&&L&&s.jsx(Fe,{text:d})]})},Yn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x}=e,g=m.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=m.useCallback(b=>s.jsx(_n,{"aria-label":l,onClick:C=>g(C,b)}),[l,g]),v=m.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx(Vl,{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(rl,{backend:$l,children:!t||t.length===0?s.jsx(Kl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Wl,{existingFiles:t,onDrop:a,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx(Fe,{text:u})]})})},Gl=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,multiple:h=!0,acceptTypes:x,deleteAllButtonLabel:g,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=m.useRef(null),I=()=>C.current?.click(),S=()=>{e([])},N=m.useCallback(L=>L?.some(D=>!(x==="/"||x?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[x]),j=m.useCallback(L=>{if(!o)return!1;const D=o*(1024*1024);return L?.some(w=>{const T=w.size;return!!T&&T>D})},[o]),E=m.useCallback(L=>{if(!i||!h)return!1;const D=i*1024*1024;return L.reduce((T,_)=>T+_.size,0)>D},[i,h]),A=m.useCallback(L=>{const D=L.target.files;if(D&&D.length>0){const w=Array.from(D),T=N(w),_=j(w);!T&&!_&&e([...n||[],...w])}},[N,j,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(Kr,{label:`${t}: ${h?n?.length||0:""}`,htmlFor:r}),h&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(Ln,{label:g,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:S}),(a?a>n?.length:!0)&&s.jsx(Gr,{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:h,ref:C,hidden:!0,accept:x,onChange:A}),s.jsx(Yn,{files:n,onChange:e,acceptTypes:x,maxFilesCount:a,multiple:h,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,getIsFileFormatError:N,getIsFileSizeError:j,getIsMultiFilesSizeError:E,...b})]})};var _e=(e=>(e.Row="Row",e.Column="Column",e))(_e||{}),We=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(We||{}),it=(e=>(e.Info="info",e.Danger="danger",e))(it||{}),Xn=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Xn||{}),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 es="data-editable-container",Ul={[es]:""};function Zl({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[p,h]=m.useState(e),[x,g]=m.useState(!1),[y,v]=m.useState(""),b=m.useRef(null),C=m.useRef(!1),I=m.useRef(!1),S=m.useCallback((D=!1,w="")=>{g(D),v(w)},[]),N=m.useCallback(D=>{if(!o)return S(),!0;const w=o(D);return w?w.startsWith(`${X.Warning}__`)?(S(!1,w),!0):(S(!0,w),!1):(S(),!0)},[o,S]),j=m.useCallback(D=>{const w=D??"";h(w),N(w)},[N]),E=m.useCallback(D=>{r&&!C.current&&!n?d?.(D):!r&&t&&i?.(D),C.current=!1},[i,d,r,t,n]),A=m.useCallback(()=>{a&&h(e),r?u?.():l?.(),C.current=!0,S()},[e,l,a,S,u,r]),L=m.useCallback(()=>{if(!I.current){if(I.current=!0,N(p)){E(p);return}!r&&N(e)?(h(e),S(),E(e)):A()}},[N,p,e,E,A,S,r]);return m.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,h(e),S(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,S]),m.useEffect(()=>{const D=b.current;if(!t&&!r||!D)return;const w=T=>{T.key==="Enter"?(T.preventDefault(),b.current?.blur()):T.key==="Escape"&&(T.preventDefault(),A())};return D.addEventListener("keydown",w),()=>D.removeEventListener("keydown",w)},[t,r,A]),m.useEffect(()=>{if(!t&&!r||n)return;const D=b.current;if(!D)return;const w=B=>B?(D.closest(`[${es}]`)??D).contains(B):!1,T=B=>{w(B.target)||L()},_=B=>{w(B.relatedTarget)||L()};return document.addEventListener("pointerdown",T,!0),D.addEventListener("blur",_),()=>{document.removeEventListener("pointerdown",T,!0),D.removeEventListener("blur",_)}},[t,r,n,L]),{inputRef:b,value:p,onChange:j,invalid:x,invalidMessage:y}}var be=(e=>(e.VALID="valid",e.ERROR="error",e))(be||{}),ze=(e=>(e.ITEM="item",e.FOLDER="folder",e))(ze||{}),ts=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(ts||{}),Qn=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(Qn||{});const ql="application/octet-stream";function Yl(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=Cr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",p=Xl(d.nodeType),h=p===ze.FOLDER,x=Cr(u,h);let g;return d.parentPath===null||d.parentPath===void 0?g=a:d.parentPath===""?g="":g=Cr(d.parentPath,!0),{...d,originalPath:u,path:x,parentPath:g,nodeType:p}}),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:Ql(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=Jl(d.name),u.contentType=d.contentType||ql,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||""),p=d.path.slice(0,u),h=i.get(p);h&&h.nodeType===ze.FOLDER?(h.items=h.items||[],h.items.push(d)):l.push(d)}}),l}function Cr(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 Xl(e){return e.toUpperCase()==="FOLDER"?ze.FOLDER:ze.ITEM}function Ql(e){if(!e)return;const t=e.toUpperCase();return Object.values(ts).find(n=>n.toUpperCase()===t)}function Jl(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function ec(e,t="Prompts",r="prompts/public/",n="root"){const a=Yl(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:ze.FOLDER,folderId:n,items:a}]}const Jn=({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}},ea=':;,=/{}%&\\"',rs=`(\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("./icon-4D9xu6E_.cjs"),c=require("./DateCellRenderer-DMq0adkA.cjs"),F=require("@tabler/icons-react"),P=require("@floating-ui/react"),m=require("react"),te=require("classnames"),bn=require("./editors.cjs"),qa=require("react-dom");function Ya(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 Pe=Ya(m),zr=({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,He=({...e})=>s.jsx(zr,{...e,variant:c.CaptionType.Error}),xs={[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]:{}},vn=(e=c.ButtonVariant.Primary,t=c.ButtonAppearance.Solid)=>{const r=xs[e]?.[t];return r||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${t}. Using default primary solid button styles.`),xs[c.ButtonVariant.Primary][c.ButtonAppearance.Solid])},Xa=7,Qa=2,yn=m.createContext(null),Cn=()=>{const e=m.useContext(yn);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ja=({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,p=P.useFloating({placement:t,open:d,onOpenChange:u,whileElementsMounted:P.autoUpdate,middleware:[P.offset(Xa+Qa),P.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),P.shift({padding:5}),P.arrow({element:l})]}),h=P.useHover(p.context,{move:!1,enabled:n==null,mouseOnly:r,delay:{open:500,close:0}}),x=P.useFocus(p.context,{enabled:n==null}),g=P.useDismiss(p.context),y=P.useRole(p.context,{role:"tooltip"}),v=P.useInteractions([h,x,g,y]);return m.useEffect(()=>{if(!d)return;const b=p.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,p.refs.reference,u]),m.useMemo(()=>({open:d,setOpen:u,arrowRef:l,...v,...p}),[d,u,v,p])},Fr=({children:e,...t})=>{const r=Ja(t);return s.jsx(yn.Provider,{value:r,children:e})},Hr=({style:e,...t})=>{const r=Cn(),n=c.useHasHover(),a=m.useRef(null),o=P.useMergeRefs([r.refs.setFloating,a]);return!r.open||!n?null:s.jsx(P.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(P.FloatingArrow,{ref:r.arrowRef,context:r.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},$r=({children:e,asChild:t=!1,...r})=>{const n=Cn(),a=t&&m.isValidElement(e),o=a?e.props?.ref:null,i=P.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(Fr,{...o,children:[s.jsx($r,{className:te(n,"truncate"),children:r}),s.jsx(Hr,{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&&vn(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},eo="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",to=({caption:e,onClick:t})=>{if(!e)return null;const r=s.jsx(Tt,{"aria-label":e,className:eo,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},Kr=({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(to,{caption:n})]}):null,ro=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,onToggle:l,className:d,headerClassName:u,contentClassName:p})=>{const h=n!==void 0,[x,g]=m.useState(a),y=i?!0:h?n:x,v=m.useId(),b=()=>{if(o)return;const C=!y;h||g(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",p),children:r})]})},so="flex items-center justify-center text-secondary",no="shrink-0 grow-0 basis-auto animate-spin-steps",ao=e=>Pe.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Pe.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Pe.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),oo=({size:e=18,className:t,iconClassName:r,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status",className:te({[so]:!0,"size-full":n,[t||""]:!!t}),children:s.jsx(c.DialIcon,{icon:s.jsx(ao,{width:e,height:e,className:te(no,r),role:"img","aria-label":a})})}),We=({size:e=40,className:t,fullWidth:r=!1,fullScreen:n=!1,ariaLabel:a="Loading",focusRef:o})=>s.jsx("div",{role:"status",className:f.mergeClasses("flex items-center justify-center",{"size-full":r},{"fixed inset-0 z-popup bg-layer-base":n},t,c.DIAL_KIT_CLASS.spinner),children:s.jsx("div",{ref:o,tabIndex:o?-1:void 0,role:"img","aria-label":a,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 io={[Ct.Progressbar]:"Progress",[Ct.Meter]:"Meter"},In=({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 p=m.useId(),h=i??p,x=!!n?.label,g=x?n?.id??`${h}-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:h,role:o,"aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":y,"aria-labelledby":g,"aria-label":c.resolveAccessibleName(d,x?void 0:io[o]),className:f.mergeClasses("w-full overflow-hidden rounded-full bg-control-disable-primary",r===c.ElementSize.Small?"h-1":"h-2",l,!x&&!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!x&&!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:g}),a&&s.jsx("span",{className:"dial-tiny-text text-secondary ml-auto shrink-0",children:a})]}),I]})},lo=({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})]}),co=({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:p,...h})=>{const x=te(d?"hidden sm:inline":"inline",o),g=f.mergeClasses(t&&vn(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",{...h,type:u,className:g,"aria-label":typeof e=="string"&&e||h["aria-label"],children:[s.jsx(c.DialIcon,{icon:l}),e&&s.jsx("span",{className:x,children:e}),s.jsx(c.DialIcon,{icon:i})]});return p?s.jsx(qe,{...p,children:y}):y},uo="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),[p,h]=m.useState(""),x=m.useCallback(()=>{const b=l.current;b&&(h(b.textContent??""),u(b.scrollWidth>b.clientWidth))},[]),g=m.useCallback(()=>c.scheduleMeasure(x),[x]);m.useEffect(()=>{const b=l.current;if(b)return c.observeElementSize(b,x)},[x]),m.useEffect(()=>{g()},[e,g]);const y=m.useMemo(()=>typeof e=="string"?e:p,[p,e]),v=m.useMemo(()=>n?"":o||(d?y:""),[o,y,n,d]);return s.jsxs(Fr,{...i,children:[s.jsx($r,{asChild:!0,onMouseEnter:g,onFocusCapture:g,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:g,onFocus:g,ref:l,children:e})}),s.jsx(Hr,{className:f.mergeClasses(uo,r,!v&&"hidden"),children:v})]})},fo=({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 Le=(e=>(e.Default="default",e.Text="text",e.Circular="circular",e.Rectangular="rectangular",e))(Le||{}),bt=(e=>(e.Small="small",e.Default="default",e.Large="large",e))(bt||{}),Wt=(e=>(e.Circle="circle",e.Square="square",e))(Wt||{});const po=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=Le.Default,width:l,height:d,overlay:u,color:p,className:h,...x})=>{if(!a&&o)return s.jsx(s.Fragment,{children:o});const g=f.mergeClasses("bg-layer-raised",e&&"animate-pulse",h);if(i!==Le.Default){const w=f.mergeClasses(g,i===Le.Circular&&"rounded-full",i===Le.Rectangular&&"rounded",i===Le.Text&&"rounded",!!u&&"relative"),T={};return l&&(T.width=typeof l=="number"?`${l}px`:l),d&&(T.height=typeof d=="number"?`${d}px`:d),p&&(T.backgroundColor=p),s.jsx("div",{className:w,style:T,...x,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:{},N=po(C.size),j=C.shape??Wt.Circle,E=I.width??"38%",A=S.rows??3,L=S.width,D=w=>L?Array.isArray(L)?L[w]??"100%":L:w===A-1?"61%":"100%";return s.jsxs("div",{...x,className:f.mergeClasses("flex gap-4",!!u&&"relative",h,c.DIAL_KIT_CLASS.skeleton),children:[y&&s.jsx("div",{className:f.mergeClasses(g,j===Wt.Circle?"rounded-full":"rounded","flex-shrink-0"),style:{width:N,height:N,...p&&{backgroundColor:p}}}),s.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[v&&s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:E,...p&&{backgroundColor:p}}}),b&&s.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:A}).map((w,T)=>s.jsx("div",{className:f.mergeClasses(g,"h-4 rounded"),style:{width:D(T),...p&&{backgroundColor:p}}},T))})]}),u&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u})]})},ho=te("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),mo=te("z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-hidden"),Er=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),Lr="opacity-75 !cursor-not-allowed",Sn="text-error",go="my-1 border-t border-hover border-secondary",st=4,xo=s.jsx(F.IconChevronRight,{size:14}),ct=(e,t)=>({appearance:n,...a})=>s.jsx(Tt,{...a,variant:e,appearance:n||t}),bo=(e,t)=>({variant:n,...a})=>s.jsx(Tt,{...a,variant:n||t,appearance:e}),vo=ct(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),yo=ct(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),Nn=ct(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),Co=ct(c.ButtonVariant.Secondary,c.ButtonAppearance.Ghost),Io=ct(c.ButtonVariant.Tertiary,c.ButtonAppearance.Ghost),So=ct(c.ButtonVariant.Success,c.ButtonAppearance.Ghost),jn=bo(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),wn=({ariaLabel:e,className:t,size:r=24,onClose:n,...a})=>s.jsx(jn,{"aria-label":e,className:f.mergeClasses(t,"w-auto h-auto"),onClick:n,icon:s.jsx(F.IconX,{size:r}),...a}),No=({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=>p=>{u.disabled||(u.onClick?.({key:u.key,domEvent:p}),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(Er,e.disabled&&Lr,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:xo})]}),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(Er,u.disabled&&Lr,u.danger&&Sn,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))})})]})},jo=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:p=!1,onOpenChange:h,closable:x=!1,onClose:g,className:y,overlayContentClassName:v,separatorClassName:b,listClassName:C,outsidePressIgnoreRef:I,outsideClosable:S=!0,allowedPlacements:N,anchorToMouse:j=!1,matchReferenceWidth:E=!0,maxDropdownHeight:A})=>{const[L,D]=m.useState(p),w=u!==void 0,T=w?!!u:L,_=m.useRef(null),B=m.useCallback(O=>{w||D(O),h?.(O)},[w,h]),k=m.useId(),R=l===void 0,{refs:M,floatingStyles:H,context:G}=P.useFloating({placement:l,open:T,onOpenChange:B,whileElementsMounted:P.autoUpdate,middleware:[P.offset({mainAxis:st,crossAxis:0}),R?P.autoPlacement({alignment:"start",crossAxis:!0,padding:st,allowedPlacements:N}):P.flip({padding:st}),P.shift({padding:st}),P.size({padding:st,apply({availableWidth:O,availableHeight:U,elements:de}){const ae=de.floating,xe=jo(de.reference);ae.style.setProperty("--fui-available-height",`${Math.floor(U)}px`),ae.style.setProperty("--reference-width",E?`${Math.round(xe)}px`:"0px"),E?ae.style.minWidth=`${Math.round(xe)}px`:ae.style.removeProperty("min-width"),ae.style.maxWidth=`${Math.floor(O)}px`;const Qe=Math.floor(U);ae.style.maxHeight=`${A?Math.min(Qe,A):Qe}px`}})]}),V=P.useClick(G,{enabled:i.includes(c.DropdownTrigger.Click)&&!d}),Z=P.useHover(G,{enabled:i.includes(c.DropdownTrigger.Hover)&&!d,move:!1,restMs:40,delay:{open:80,close:80}}),se=P.useDismiss(G,{bubbles:!0,referencePress:!1,outsidePress:O=>{if(!S)return!1;const U=O.target;return!(I?.current&&U instanceof Node&&I.current.contains(U))}}),re=P.useRole(G,{role:"menu"}),{getReferenceProps:le,getFloatingProps:W}=P.useInteractions([V,Z,se,re]),K=m.useCallback((O,U)=>{M.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:O,y:U,top:U,left:O,right:O,bottom:U})})},[M]),Y=m.useCallback(O=>{!i.includes(c.DropdownTrigger.ContextMenu)||d||(O.preventDefault(),j&&(K(O.clientX,O.clientY),_.current=document.elementFromPoint(O.clientX,O.clientY)),B(!0))},[j,d,B,K,i]),ee=m.useCallback(O=>{!j||d||(i.includes(c.DropdownTrigger.ContextMenu)&&T&&B(!1),K(O.clientX,O.clientY),_.current=document.elementFromPoint(O.clientX,O.clientY))},[j,d,K,T,i,B]);m.useEffect(()=>{d&&T&&B(!1)},[d,T,B]);const ne=m.useCallback(O=>U=>{O.disabled||(O.onClick?.({key:O.key,domEvent:U}),r?.({key:O.key,domEvent:U}),B(!1))},[r,B]),he=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(O=>O.type===c.DropdownItemType.Divider?s.jsx("div",{role:"separator",className:f.mergeClasses(go,b)},O.key):O.type===c.DropdownItemType.PlainText?s.jsx("div",{className:f.mergeClasses("px-3 py-2 text-secondary dial-caption-text",O.className),children:O.label},O.key):O.children?.length?s.jsx(No,{item:O,onRootClose:()=>B(!1)},O.key):s.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!O.disabled,className:te(Er,O.disabled&&Lr,O.danger&&Sn,O.className),disabled:O.disabled,onClick:ne(O),children:[O.icon&&s.jsx("span",{className:te(O.danger&&"text-error",O.disabled&&"text-secondary"),children:s.jsx(c.DialIcon,{icon:O.icon})}),s.jsx("span",{className:te("flex-1 truncate text-start",O.danger&&"text-error",O.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:O.label})]},O.key))}),a&&s.jsx(s.Fragment,{children:typeof a=="function"?a():a})]}):null,[ne,t,a,n,o,B,v,b]),ye=le({onContextMenu:Y,onMouseDown:ee});return m.useEffect(()=>{if(!T)return;const O=M.reference.current;let U=null;if(O instanceof Element?U=O:_.current instanceof Element&&(U=_.current),!U)return;const de=new IntersectionObserver(([ae])=>{ae.isIntersecting||B(!1)},{root:null,threshold:0});return de.observe(U),()=>de.disconnect()},[T,M.reference,B]),s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:M.setReference,className:te(ho,d&&"!cursor-not-allowed opacity-75",y),"aria-haspopup":"menu","aria-expanded":T,"aria-controls":k,...ye,children:e}),T&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsxs("div",{id:k,ref:M.setFloating,style:H,className:te(mo,!E&&"w-max",C),...W(),children:[x&&s.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:s.jsx(wn,{ariaLabel:"Close dropdown",onClose:O=>{g?.(O),B(!1)}})}),he]})})})]})};var Ue=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Ue||{}),ot=(e=>(e.Error="error",e.Warning="warning",e))(ot||{}),Ze=(e=>(e.Default="default",e.Inline="inline",e))(Ze||{}),Ut=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(Ut||{});const gt=({tab:e,active:t,invalid:r,className:n,horizontal:a,view:o=Ze.Default,onClick:i})=>{const l=o===Ze.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}),p=f.mergeClasses(l?u:d,n);return s.jsxs("button",{role:"tab","aria-selected":t,className:p,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})})]})},wo=()=>{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},Do=12,To=({tabs:e,activeTab:t,onClick:r,className:n,orientation:a=Ue.Horizontal,view:o=Ze.Default,screenThreshold:i=Ut.Tablet,smallScreenContainerClassName:l,smallScreenDropdownItemClassName:d,desktopDropdownClassName:u,desktopTabClassName:p,inlineContainerClassName:h,inlineTabClassName:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(!1),[C,I]=m.useState(!1),S=wo(),N=S===c.ScreenType.Mobile||i===Ut.Tablet&&S===c.ScreenType.Tablet,j=a===Ue.Horizontal,E=m.useRef(null),A=m.useRef(null),L=m.useRef(null),D=e.find(k=>k.id===t),w=m.useMemo(()=>f.mergeClasses("flex gap-2",j?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[j]),T=m.useCallback(()=>{const k=A.current;k&&I(k.scrollWidth>k.clientWidth)},[]),_=m.useCallback(()=>{const k=L.current,R=A.current;if(!k||!R)return;const M=k.getBoundingClientRect(),H=R.getBoundingClientRect();if(M.width===0||H.width===0)return;const G=Do;let V=R.scrollLeft;if(M.left<H.left+G)V-=H.left+G-M.left;else if(M.right>H.right-G)V+=M.right-(H.right-G);else return;const Z=Math.max(0,R.scrollWidth-R.clientWidth);V=Math.max(0,Math.min(V,Z)),V!==R.scrollLeft&&R.scrollTo({left:V,behavior:"smooth"})},[]),B=m.useCallback(k=>{r(k),k===t&&_()},[r,t,_]);return m.useEffect(()=>{T();const k=new ResizeObserver(()=>T()),R=A.current;return R&&k.observe(R),()=>k.disconnect()},[e,T]),m.useEffect(()=>{_()},[t,_]),o===Ze.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",h),children:e.map(k=>s.jsx(gt,{tab:k,active:t===k.id,view:Ze.Inline,onClick:B,className:x},k.id))}):N?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:g,onOpenChange:y,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(k=>s.jsx(gt,{tab:k,active:k.id===t,onClick:R=>{B(R),y(!1)},className:f.mergeClasses("w-full rounded-none h-11 items-center px-6",d)},k.id)),children:s.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[s.jsx(gt,{tab:D,active:!0,onClick:B,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",g&&"rotate-180")})]})})}):s.jsxs("div",{ref:E,className:f.mergeClasses("flex items-center",n),children:[s.jsx("div",{ref:A,role:"tablist",className:w,children:e.map(k=>s.jsx("div",{ref:t===k.id?L:void 0,className:"w-full",children:s.jsx(gt,{tab:k,active:t===k.id,onClick:B,horizontal:j,className:f.mergeClasses("w-full",p)})},k.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(k=>s.jsx(gt,{tab:k,active:k.id===t,onClick:R=>{B(R),b(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},k.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)})})})]})},Dn="w-full overflow-hidden",Tn="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",gr={first:"shrink-0",middle:"shrink min-w-0 max-w-[30%]",last:"shrink min-w-0 max-w-[51%]"},Ar="flex flex-1 items-center gap-1 min-w-0 transition-colors",Eo="text-secondary hover:text-accent-primary",En="text-primary cursor-default",Vr="flex-none inline-flex items-center leading-none text-secondary",Lo="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",Ln=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=Ln,className:l,iconBefore:d,labelClassName:u,onBeforeNavigate:p,...h})=>{const x=async I=>{if(p&&!a&&!await p()){I.preventDefault();return}r&&r(I)},g=a?gr.last:o?gr.first:gr.middle,y=f.mergeClasses(Zt,g,l),v=(!!t||!!r)&&!a&&!n,b=v?f.mergeClasses(Ar,Eo):f.mergeClasses(Ar,En,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",{...h,className:y,"aria-label":h["aria-label"]||"breadcrumb-item",children:[v?s.jsxs("a",{href:t,onClick:x,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:Vr,"aria-label":"separator",children:i})]})},Ao=({pathItems:e,separator:t=Ln,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(p=>{const h=p.props,{labelClassName:x,isLast:g,separator:y,...v}=h;return v}),[e,a]),d=m.useCallback(async p=>{const h=parseInt(p.key,10),x=l[h];if(i&&!await i()){p.domEvent.preventDefault();return}x.onClick?x.onClick(p.domEvent):x.href&&(window.location.href=x.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 p=l.at(0),h=l.slice(1,-2),x=l.at(-2),g=l.at(-1);if(!p||!x||!g)return null;const y=h.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,{...p,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:Lo,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM})})}),s.jsx("span",{className:Vr,children:t})]}),m.createElement(xt,{...x,key:`item-${l.length-2}`,separator:t,labelClassName:o,onBeforeNavigate:i}),m.createElement(xt,{...g,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(Dn,n),children:s.jsx("ol",{className:Tn,children:u})})},Wr=(e,t)=>({appearance:n,...a})=>s.jsx(Et,{...a,variant:e,appearance:n||t}),An=(e,t)=>({variant:n,...a})=>s.jsx(Et,{...a,variant:n||t,appearance:e}),Gr=Wr(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),_n=Wr(c.ButtonVariant.Neutral,c.ButtonAppearance.Outlined),On=Wr(c.ButtonVariant.Danger,c.ButtonAppearance.Outlined),_o=An(c.ButtonAppearance.Link,c.ButtonVariant.Primary),Oo=An(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),kn=({iconClassName:e,label:t,...r})=>t?s.jsx(On,{...r,label:t,appearance:c.ButtonAppearance.Ghost,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}):s.jsx(Nn,{...r,appearance:c.ButtonAppearance.Ghost,icon:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS,className:e||""})}),ko="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",Ro=({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(ko,n===c.ElementSize.Small&&"p-1",a),icon:e,onClick:t,disabled:r,size:n})}),Mo=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Po=(e,t,r,n)=>{if((t==="number"||r!==void 0||n!==void 0)&&!Mo.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}}}}},Rn=({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(Kr,{...e,htmlFor:n}),s.jsx(Mn,{id:n,...o}),s.jsx(He,{text:t}),!t&&s.jsx(zr,{text:r})]}),Mn=({invalid:e,disabled:t,prefix:r,className:n,postfix:a,iconBefore:o,iconAfter:i,wrapperClassName:l,type:d,inputRef:u,value:p,tooltipText:h,min:x,onChange:g,max:y,inputButtonProps:v,...b})=>{const C=m.useRef(null),I=P.useMergeRefs([u,C]),S=d==="number"||x!==void 0||y!==void 0;m.useEffect(()=>{const A=C.current;if(!A||!S||t)return;const L=D=>{D.preventDefault()};return A.addEventListener("wheel",L,{passive:!1}),()=>{A.removeEventListener("wheel",L)}},[t,S,d]);const N=A=>{Po(A,d,x,y)},j=A=>{const L=A.currentTarget.value;if(S&&L!==""){const D=parseFloat(L);if(isNaN(D)&&L!=="-"&&L!=="."||!isNaN(D)&&(x!==void 0&&D<+x||y!==void 0&&D>+y))return}g?.(L||void 0)},E=()=>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(Mn,{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:p??"",className:f.mergeClasses("border-0 bg-transparent w-full truncate",t&&"cursor-not-allowed",n),onChange:j,onKeyDown:N,min:x,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(Ro,{...v,disabled:t})]});return t&&d!=="password"?s.jsx(qe,{tooltip:h||p,children:E()}):E()},Pn=m.createContext({dragDropManager:void 0});function Ce(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var bs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),vs=function(){return Math.random().toString(36).substring(7).split("").join(".")},ys={INIT:"@@redux/INIT"+vs(),REPLACE:"@@redux/REPLACE"+vs()};function Bo(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 zo(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($o(e))return"date";if(Ho(e))return"error";var r=Fo(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 Fo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ho(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $o(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=zo(e)),t}function Bn(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"?Ce(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(1):"Expected the enhancer to be a function. Instead, received: '"+Je(r)+"'");return r(Bn)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(2):"Expected the root reducer to be a function. Instead, received: '"+Je(e)+"'");var a=e,o=t,i=[],l=i,d=!1;function u(){l===i&&(l=i.slice())}function p(){if(d)throw new Error(process.env.NODE_ENV==="production"?Ce(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(4):"Expected the listener to be a function. Instead, received: '"+Je(v)+"'");if(d)throw new Error(process.env.NODE_ENV==="production"?Ce(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return u(),l.push(v),function(){if(b){if(d)throw new Error(process.env.NODE_ENV==="production"?Ce(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,u();var I=l.indexOf(v);l.splice(I,1),i=null}}}function x(v){if(!Bo(v))throw new Error(process.env.NODE_ENV==="production"?Ce(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"?Ce(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"?Ce(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 g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ce(10):"Expected the nextReducer to be a function. Instead, received: '"+Je(v));a=v,x({type:ys.REPLACE})}function y(){var v,b=h;return v={subscribe:function(I){if(typeof I!="object"||I===null)throw new Error(process.env.NODE_ENV==="production"?Ce(11):"Expected the observer to be an object. Instead, received: '"+Je(I)+"'");function S(){I.next&&I.next(p())}S();var N=b(S);return{unsubscribe:N}}},v[bs]=function(){return this},v}return x({type:ys.INIT}),n={dispatch:x,subscribe:h,getState:p,replaceReducer:g},n[bs]=y,n}function q(e,t,...r){if(Ko()&&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 Ko(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function Vo(e,t,r){return t.split(".").reduce((n,a)=>n&&n[a]?n[a]:r||null,e)}function Wo(e,t){return e.filter(r=>r!==t)}function zn(e){return typeof e=="object"}function Go(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 Uo(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Ur="dnd-core/INIT_COORDS",tr="dnd-core/BEGIN_DRAG",Zr="dnd-core/PUBLISH_DRAG_SOURCE",rr="dnd-core/HOVER",sr="dnd-core/DROP",nr="dnd-core/END_DRAG";function Cs(e,t){return{type:Ur,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const Zo={type:Ur,payload:{clientOffset:null,sourceClientOffset:null}};function qo(e){return function(r=[],n={publishSource:!0}){const{publishSource:a=!0,clientOffset:o,getSourceClientOffset:i}=n,l=e.getMonitor(),d=e.getRegistry();e.dispatch(Cs(o)),Yo(r,l,d);const u=Jo(r,l);if(u==null){e.dispatch(Zo);return}let p=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");Xo(i),p=i(u)}e.dispatch(Cs(o,p));const x=d.getSource(u).beginDrag(l,u);if(x==null)return;Qo(x),d.pinSource(u);const g=d.getSourceType(u);return{type:tr,payload:{itemType:g,item:x,sourceId:u,clientOffset:o||null,sourceClientOffset:p||null,isSourcePublic:!!a}}}}function Yo(e,t,r){q(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){q(r.getSource(n),"Expected sourceIds to be registered.")})}function Xo(e){q(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Qo(e){q(zn(e),"Item must be an object.")}function Jo(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 ei(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ti(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){ei(e,a,r[a])})}return e}function ri(e){return function(r={}){const n=e.getMonitor(),a=e.getRegistry();si(n),oi(n).forEach((i,l)=>{const d=ni(i,l,a,n),u={type:sr,payload:{dropResult:ti({},r,d)}};e.dispatch(u)})}}function si(e){q(e.isDragging(),"Cannot call drop while not dragging."),q(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function ni(e,t,r,n){const a=r.getTarget(e);let o=a?a.drop(n,e):void 0;return ai(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function ai(e){q(typeof e>"u"||zn(e),"Drop result must either be an object or undefined.")}function oi(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ii(e){return function(){const r=e.getMonitor(),n=e.getRegistry();li(r);const a=r.getSourceId();return a!=null&&(n.getSource(a,!0).endDrag(r,a),n.unpinSource()),{type:nr}}}function li(e){q(e.isDragging(),"Cannot call endDrag while not dragging.")}function _r(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function ci(e){return function(r,{clientOffset:n}={}){di(r);const a=r.slice(0),o=e.getMonitor(),i=e.getRegistry(),l=o.getItemType();return fi(a,i,l),ui(a,o,i),pi(a,o,i),{type:rr,payload:{targetIds:a,clientOffset:n||null}}}}function di(e){q(Array.isArray(e),"Expected targetIds to be an array.")}function ui(e,t,r){q(t.isDragging(),"Cannot call hover while not dragging."),q(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){const a=e[n];q(e.lastIndexOf(a)===n,"Expected targetIds to be unique in the passed array.");const o=r.getTarget(a);q(o,"Expected targetIds to be registered.")}}function fi(e,t,r){for(let n=e.length-1;n>=0;n--){const a=e[n],o=t.getTargetType(a);_r(o,r)||e.splice(n,1)}}function pi(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function hi(e){return function(){if(e.getMonitor().isDragging())return{type:Zr}}}function mi(e){return{beginDrag:qo(e),publishDragSource:hi(e),hover:ci(e),drop:ri(e),endDrag:ii(e)}}class gi{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=mi(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 xi(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Fn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bi(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Fn(xi(t,n),r)}function vi(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Fn(t,r)}const vt=[],qr=[];vt.__IS_NONE__=!0;qr.__IS_ALL__=!0;function yi(e,t){return e===vt?!1:e===qr||typeof t>"u"?!0:Uo(t,e).length>0}class Ci{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;q(typeof t=="function","listener must be a function."),q(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&&!yi(i.dirtyHandlerIds,n)||t()}finally{a=l}};return this.store.subscribe(o)}subscribeToOffsetChange(t){q(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 q(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(q(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 _r(n,a)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(q(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&&!_r(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 bi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return vi(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const Is=typeof global<"u"?global:self,Hn=Is.MutationObserver||Is.WebKitMutationObserver;function $n(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function Ii(e){let t=1;const r=new Hn(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Si=typeof Hn=="function"?Ii:$n;class Ni{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=Si(this.flush),this.requestErrorThrow=$n(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class ji{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 wi{create(t){const r=this.freeTasks,n=r.length?r.pop():new ji(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const Kn=new Ni,Di=new wi(Kn.registerPendingError);function Ti(e){Kn.enqueueTask(Di.create(e))}const Yr="dnd-core/ADD_SOURCE",Xr="dnd-core/ADD_TARGET",Qr="dnd-core/REMOVE_SOURCE",ar="dnd-core/REMOVE_TARGET";function Ei(e){return{type:Yr,payload:{sourceId:e}}}function Li(e){return{type:Xr,payload:{targetId:e}}}function Ai(e){return{type:Qr,payload:{sourceId:e}}}function _i(e){return{type:ar,payload:{targetId:e}}}function Oi(e){q(typeof e.canDrag=="function","Expected canDrag to be a function."),q(typeof e.beginDrag=="function","Expected beginDrag to be a function."),q(typeof e.endDrag=="function","Expected endDrag to be a function.")}function ki(e){q(typeof e.canDrop=="function","Expected canDrop to be a function."),q(typeof e.hover=="function","Expected hover to be a function."),q(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}q(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 Se;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Se||(Se={}));let Ri=0;function Mi(){return Ri++}function Pi(e){const t=Mi().toString();switch(e){case Se.SOURCE:return`S${t}`;case Se.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Ss(e){switch(e[0]){case"S":return Se.SOURCE;case"T":return Se.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ns(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 Bi{addSource(t,r){Or(t),Oi(r);const n=this.addHandler(Se.SOURCE,t,r);return this.store.dispatch(Ei(n)),n}addTarget(t,r){Or(t,!0),ki(r);const n=this.addHandler(Se.TARGET,t,r);return this.store.dispatch(Li(n)),n}containsHandler(t){return Ns(this.dragSources,t)||Ns(this.dropTargets,t)}getSource(t,r=!1){return q(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return q(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return q(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Ss(t)===Se.SOURCE}isTargetId(t){return Ss(t)===Se.TARGET}removeSource(t){q(this.getSource(t),"Expected an existing source."),this.store.dispatch(Ai(t)),Ti(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){q(this.getTarget(t),"Expected an existing target."),this.store.dispatch(_i(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);q(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){q(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const a=Pi(t);return this.types.set(a,r),t===Se.SOURCE?this.dragSources.set(a,n):t===Se.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 zi=(e,t)=>e===t;function Fi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Hi(e,t,r=zi){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 $i(e=vt,t){switch(t.type){case rr:break;case Yr:case Xr:case ar:case Qr:return vt;case tr:case Zr:case nr:case sr:default:return qr}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,a=Go(r,n);if(!(a.length>0||!Hi(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 Ki(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vi(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){Ki(e,a,r[a])})}return e}const js={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Wi(e=js,t){const{payload:r}=t;switch(t.type){case Ur:case tr:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case rr:return Fi(e.clientOffset,r.clientOffset)?e:Vi({},e,{clientOffset:r.clientOffset});case nr:case sr:return js;default:return e}}function Gi(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){Gi(e,a,r[a])})}return e}const Ui={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Zi(e=Ui,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 Zr: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:Wo(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 qi(e=0,t){switch(t.type){case Yr:case Xr:return e+1;case Qr:case ar:return e-1;default:return e}}function Yi(e=0){return e+1}function Xi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qi(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){Xi(e,a,r[a])})}return e}function Ji(e={},t){return{dirtyHandlerIds:$i(e.dirtyHandlerIds,{type:t.type,payload:Qi({},t.payload,{prevTargetIds:Vo(e,"dragOperation.targetIds",[])})}),dragOffset:Wi(e.dragOffset,t),refCount:qi(e.refCount,t),dragOperation:Zi(e.dragOperation,t),stateId:Yi(e.stateId)}}function el(e,t=void 0,r={},n=!1){const a=tl(n),o=new Ci(a,new Bi(a)),i=new gi(a,o),l=e(i,t,r);return i.receiveBackend(l),i}function tl(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Bn(Ji,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function rl(e,t){if(e==null)return{};var r=sl(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 sl(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 nl=m.memo(function(t){var{children:r}=t,n=rl(t,["children"]);const[a,o]=al(n);return m.useEffect(()=>{if(o){const i=Vn();return++ws,()=>{--ws===0&&(i[Kt]=null)}}},[]),s.jsx(Pn.Provider,{value:a,children:r})});function al(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=ol(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function ol(e,t=Vn(),r,n){const a=t;return a[Kt]||(a[Kt]={dragDropManager:el(e,t,r,n)}),a[Kt]}function Vn(){return typeof global<"u"?global:window}function il(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,Ds;function ll(){return Ds||(Ds=1,xr=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}),xr}var cl=ll();const dl=il(cl),or=typeof window<"u"?m.useLayoutEffect:m.useEffect;function ul(e,t,r){const[n,a]=m.useState(()=>t(e)),o=m.useCallback(()=>{const i=t(e);dl(n,i)||(a(i),r&&r())},[n,e,r]);return or(o),[n,o]}function fl(e,t,r){const[n,a]=ul(e,t,r);return or(function(){const i=e.getHandlerId();if(i!=null)return e.subscribeToStateChange(a,{handlerIds:[i]})},[e,a]),n}function pl(e,t,r){return fl(t,e||(()=>({})),()=>r.reconnect())}function hl(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),m.useMemo(()=>typeof e=="function"?e():e,r)}let br=!1;class ml{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;q(!br,"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 br=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{br=!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 gl(e,t,r){const n=r.getRegistry(),a=n.addTarget(e,t);return[a,()=>n.removeTarget(a)]}function xl(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 p=e[u],h=t[u];if(a=void 0,a===!1||a===void 0&&p!==h)return!1}return!0}function bl(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function vl(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 yl(e){return(t=null,r=null)=>{if(!m.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return vl(n),Il(n,r?o=>e(o,r):e)}}function Cl(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const a=yl(n);t[r]=()=>a}}),t}function Ts(e,t){typeof e=="function"?e(t):e.current=t}function Il(e,t){const r=e.ref;return q(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=>{Ts(r,n),Ts(t,n)}}):m.cloneElement(e,{ref:t})}class Sl{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!xl(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=Cl({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,bl(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 Jr(){const{dragDropManager:e}=m.useContext(Pn);return q(e!=null,"Expected drag drop context"),e}function Nl(e){return m.useMemo(()=>e.hooks.dropTarget(),[e])}function jl(e){const t=Jr(),r=m.useMemo(()=>new Sl(t.getBackend()),[t]);return or(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function wl(){const e=Jr();return m.useMemo(()=>new ml(e),[e])}function Dl(e){const{accept:t}=e;return m.useMemo(()=>(q(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class Tl{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 El(e,t){const r=m.useMemo(()=>new Tl(e,t),[t]);return m.useEffect(()=>{r.spec=e},[e]),r}function Ll(e,t,r){const n=Jr(),a=El(e,t),o=Dl(e);or(function(){const[l,d]=gl(o,a,n);return t.receiveHandlerId(l),r.receiveHandlerId(l),d},[n,t,a,r,o.map(i=>i.toString()).join("|")])}function Wn(e,t){const r=hl(e,t),n=wl(),a=jl(r.options);return Ll(r,n,a),[pl(r.collect,n,a),Nl(a)]}function Gn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Al(e,t){return e.filter(r=>r!==t)}function _l(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 Ol{enter(t){const r=this.entered.length,n=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(t));return this.entered=_l(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Al(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class kl{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__",Un="__NATIVE_URL__",Zn="__NATIVE_TEXT__",qn="__NATIVE_HTML__",Es=Object.freeze(Object.defineProperty({__proto__:null,FILE:ir,HTML:qn,TEXT:Zn,URL:Un},Symbol.toStringTag,{value:"Module"}));function vr(e,t,r){const n=t.reduce((a,o)=>a||e.getData(o),"");return n??r}const kr={[ir]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[qn]:{exposeProperties:{html:(e,t)=>vr(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Un]:{exposeProperties:{urls:(e,t)=>vr(e,t,"").split(`
2
+ `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Zn]:{exposeProperties:{text:(e,t)=>vr(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Rl(e,t){const r=kr[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new kl(r);return n.loadDataTransfer(t),n}function yr(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(kr).filter(r=>{const n=kr[r];return n?.matchesTypes?n.matchesTypes.some(a=>t.indexOf(a)>-1):!1})[0]||null}const Ml=Gn(()=>/firefox/i.test(navigator.userAgent)),Yn=Gn(()=>!!window.safari);class Ls{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,p;for(;d<=u;){p=Math.floor(.5*(d+u));const g=r[p];if(g<t)d=p+1;else if(g>t)u=p-1;else return n[p]}l=Math.max(0,u);const h=t-r[l],x=h*h;return n[l]+a[l]*h+o[l]*x+i[l]*h*x}constructor(t,r){const{length:n}=t,a=[];for(let g=0;g<n;g++)a.push(g);a.sort((g,y)=>t[g]<t[y]?-1:1);const o=[],i=[];let l,d;for(let g=0;g<n-1;g++)l=t[g+1]-t[g],d=r[g+1]-r[g],o.push(l),i.push(d/l);const u=[i[0]];for(let g=0;g<o.length-1;g++){const y=i[g],v=i[g+1];if(y*v<=0)u.push(0);else{l=o[g];const b=o[g+1],C=l+b;u.push(3*C/((C+b)/y+(C+l)/v))}}u.push(i[i.length-1]);const p=[],h=[];let x;for(let g=0;g<u.length-1;g++){x=i[g];const y=u[g],v=1/o[g],b=y+u[g+1]-x-x;p.push((x-y-b)*v),h.push(b*v*v)}this.xs=t,this.ys=r,this.c1s=u,this.c2s=p,this.c3s=h}}const Pl=1;function Xn(e){const t=e.nodeType===Pl?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 Bl(e){var t;return e.nodeName==="IMG"&&(Ml()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function zl(e,t,r,n){let a=e?t.width:r,o=e?t.height:n;return Yn()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function Fl(e,t,r,n,a){const o=Bl(t),l=Xn(o?e:t),d={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:p}=e,{anchorX:h,anchorY:x}=n,{dragPreviewWidth:g,dragPreviewHeight:y}=zl(o,t,u,p),v=()=>{let E=new Ls([0,.5,1],[d.y,d.y/p*y,d.y+y-p]).interpolate(x);return Yn()&&o&&(E+=(window.devicePixelRatio-1)*y),E},b=()=>new Ls([0,.5,1],[d.x,d.x/u*g,d.x+g-u]).interpolate(h),{offsetX:C,offsetY:I}=a,S=C===0||C,N=I===0||I;return{x:S?C:b(),y:N?I:v()}}class Hl{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 $l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function As(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){$l(e,a,r[a])})}return e}class Kl{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 As({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 As({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Es).some(r=>Es[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Rl(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&&Xn(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=yr(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const p=this.monitor.getSourceId(),h=this.sourceNodes.get(p),x=this.sourcePreviewNodes.get(p)||h;if(x){const{anchorX:g,anchorY:y,offsetX:v,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),S=Fl(h,x,i,{anchorX:g,anchorY:y},{offsetX:v,offsetY:b});l.setDragImage(x,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=yr(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 yr(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 Hl(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ol(this.isNodeInDocument)}}const Vl=function(t,r,n){return new Kl(t,r,n)},Wl=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:r,emptyButtonLabel:n,acceptTypes:a,maxFilesCount:o,multiple:i,fileFormatError:l,fileCountError:d,fileSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h})=>{const x=m.useRef(null),g=m.useRef(null),[y,v]=m.useState([]),[b,C]=m.useState(!1),[I,S]=m.useState(!1),N=m.useCallback(M=>{const H=M.target.files;if(H&&H.length>0){const G=Array.from(H),V=p?.(G),Z=h?.(G);V?C(!0):Z?S(!0):e(G)}},[p,h,e]),j=m.useCallback(M=>o&&M?.length>o,[o]),E=m.useMemo(()=>b||I||j(y),[b,I,j,y]),A=()=>{v([]),C(!1),S(!1)},L=m.useMemo(()=>b?s.jsx(He,{text:l}):I?s.jsx(He,{text:u}):j(y)?s.jsx(He,{text:d}):null,[d,l,u,y,j,b,I]);m.useEffect(()=>{A()},[a]);const[{isOver:D,canDrop:w},T]=Wn(()=>({accept:[ir],drop(M){const H=M.files,G=p?.(H)??!1,V=h?.(H)??!1,Z=j?.(H)??!1;if(C(G),S(V),G||V||Z){v(H);return}e(H),A()},collect:M=>({isOver:M.isOver(),canDrop:M.canDrop()})}),[e,p,h,j]),_=M=>{(M.key==="Enter"||M.key==="Space")&&(M.preventDefault(),g.current?.click())},B=M=>{M?.preventDefault();const H=Array.from(M.dataTransfer?.items??[]);C(!!p?.(H)),S(!!h?.(H)),v(H)},k=M=>{M.target===M.currentTarget&&A()},R=te("border border-dashed rounded size-full cursor-pointer relative hover:border-hover",!w&&!E&&"border-primary",w&&(D?"border-accent-primary":"border-hover"),E&&"border-error");return T(x),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:R,ref:x,onDragOver:B,onDragLeave:k,children:[s.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:_,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(Gr,{appearance:c.ButtonAppearance.Ghost,label:n,onClick:()=>g.current?.click()})]}),s.jsx("input",{multiple:i,id:"file",type:"file",ref:g,hidden:!0,accept:a,onChange:N})]}),s.jsx(s.Fragment,{children:L})]})},Gl=({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(Rn,{...r,iconBefore:a(),containerClassName:te("h-[40px] p-0",n&&"h-[60px]"),className:te("rounded-r-none border-r-0",n&&"text-error",t)})},Ul=({children:e,existingFiles:t,onDrop:r,getIsFileFormatError:n,getIsFileSizeError:a,maxFilesCount:o,fileFormatError:i,fileSizeError:l,fileCountError:d})=>{const u=m.useRef(null),[p,h]=m.useState(!1),[x,g]=m.useState(!1),[y,v]=m.useState(0),b=m.useCallback(()=>{h(!1),g(!1),v(0)},[]),C=m.useCallback(D=>!!(o&&t.length+D.length>o),[o,t.length]),I=p||x,[{isOver:S,canDrop:N},j]=Wn(()=>({accept:[ir],drop(D){const w=D.files,T=[...t,...w],_=n?.(w)??!1,B=a?.(w)??!1,k=C?.(w)??!1;if(h(_),g(B),_||B||k){v(w.length);return}r(T),b()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[t,r,n,a,C,b]),E=D=>{D.preventDefault();const w=Array.from(D.dataTransfer?.items??[]);h(!!n?.(w)),g(!1),v(w.length)},A=D=>{D.target===D.currentTarget&&b()};j(u);const L=C(Array.from({length:y}));return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{ref:u,onDragOver:E,onDragLeave:A,className:te("flex-1 min-h-0 border border-solid rounded p-2 overflow-y-auto",!I&&!L&&(N&&S?"border-accent-primary":"border-primary"),(I||L)&&"border-error"),children:e}),p&&s.jsx(He,{text:i}),x&&s.jsx(He,{text:l}),!p&&!x&&L&&s.jsx(He,{text:d})]})},Qn=e=>{const{files:t,iconBeforeInput:r,dynamicIcon:n,onChange:a,isInvalid:o,errorText:i,removeButtonAriaLabel:l,getIsMultiFilesSizeError:d,multiFilesSizeError:u,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x}=e,g=m.useCallback((b,C)=>{b.stopPropagation(),a(t?.filter(I=>I.name!==C)||[])},[a,t]),y=m.useCallback(b=>s.jsx(kn,{"aria-label":l,onClick:C=>g(C,b)}),[l,g]),v=m.useMemo(()=>s.jsx("div",{className:"flex flex-col gap-y-1",children:t?.map((b,C)=>s.jsx(Gl,{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(nl,{backend:Vl,children:!t||t.length===0?s.jsx(Wl,{...e,onChange:a}):s.jsxs(s.Fragment,{children:[s.jsx(Ul,{existingFiles:t,onDrop:a,getIsFileFormatError:p,getIsFileSizeError:h,maxFilesCount:x,fileFormatError:e.fileFormatError,fileSizeError:e.fileSizeError,fileCountError:e.fileCountError,children:v}),d?.(t)&&s.jsx(He,{text:u})]})})},Zl=({onChange:e,fieldTitle:t,elementId:r,files:n,maxFilesCount:a,maxFileSize:o,maxMultiFilesSize:i,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,multiple:h=!0,acceptTypes:x,deleteAllButtonLabel:g,addButtonLabel:y,additionalActionButtons:v,...b})=>{const C=m.useRef(null),I=()=>C.current?.click(),S=()=>{e([])},N=m.useCallback(L=>L?.some(D=>!(x==="/"||x?.toLowerCase()?.includes(D?.type?.toLowerCase()))),[x]),j=m.useCallback(L=>{if(!o)return!1;const D=o*(1024*1024);return L?.some(w=>{const T=w.size;return!!T&&T>D})},[o]),E=m.useCallback(L=>{if(!i||!h)return!1;const D=i*1024*1024;return L.reduce((T,_)=>T+_.size,0)>D},[i,h]),A=m.useCallback(L=>{const D=L.target.files;if(D&&D.length>0){const w=Array.from(D),T=N(w),_=j(w);!T&&!_&&e([...n||[],...w])}},[N,j,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(Kr,{label:`${t}: ${h?n?.length||0:""}`,htmlFor:r}),h&&!!n?.length&&s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(_n,{label:g,iconBefore:s.jsx(F.IconTrashX,{...f.BASE_ICON_PROPS}),onClick:S}),(a?a>n?.length:!0)&&s.jsx(Gr,{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:h,ref:C,hidden:!0,accept:x,onChange:A}),s.jsx(Qn,{files:n,onChange:e,acceptTypes:x,maxFilesCount:a,multiple:h,fileFormatError:l,fileCountError:d,fileSizeError:u,multiFilesSizeError:p,getIsFileFormatError:N,getIsFileSizeError:j,getIsMultiFilesSizeError:E,...b})]})};var Oe=(e=>(e.Row="Row",e.Column="Column",e))(Oe||{}),Ge=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Ge||{}),it=(e=>(e.Info="info",e.Danger="danger",e))(it||{}),Jn=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Jn||{}),_e=(e=>(e.File="file",e.Folder="folder",e))(_e||{}),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 es="data-editable-container",ql={[es]:""};function Yl({value:e,isEditing:t,isCreating:r,isLoading:n=!1,restoreOnCancel:a=!0,onValidate:o,onSave:i,onCancel:l,onCreateFolderSave:d,onCreateFolderCancel:u}){const[p,h]=m.useState(e),[x,g]=m.useState(!1),[y,v]=m.useState(""),b=m.useRef(null),C=m.useRef(!1),I=m.useRef(!1),S=m.useCallback((D=!1,w="")=>{g(D),v(w)},[]),N=m.useCallback(D=>{if(!o)return S(),!0;const w=o(D);return w?w.startsWith(`${X.Warning}__`)?(S(!1,w),!0):(S(!0,w),!1):(S(),!0)},[o,S]),j=m.useCallback(D=>{const w=D??"";h(w),N(w)},[N]),E=m.useCallback(D=>{r&&!C.current&&!n?d?.(D):!r&&t&&i?.(D),C.current=!1},[i,d,r,t,n]),A=m.useCallback(()=>{a&&h(e),r?u?.():l?.(),C.current=!0,S()},[e,l,a,S,u,r]),L=m.useCallback(()=>{if(!I.current){if(I.current=!0,N(p)){E(p);return}!r&&N(e)?(h(e),S(),E(e)):A()}},[N,p,e,E,A,S,r]);return m.useEffect(()=>{!t&&!r||(C.current=!1,I.current=!1,h(e),S(),requestAnimationFrame(()=>{b.current?.focus(),b.current?.select()}))},[t,r,e,S]),m.useEffect(()=>{const D=b.current;if(!t&&!r||!D)return;const w=T=>{T.key==="Enter"?(T.preventDefault(),b.current?.blur()):T.key==="Escape"&&(T.preventDefault(),A())};return D.addEventListener("keydown",w),()=>D.removeEventListener("keydown",w)},[t,r,A]),m.useEffect(()=>{if(!t&&!r||n)return;const D=b.current;if(!D)return;const w=B=>B?(D.closest(`[${es}]`)??D).contains(B):!1,T=B=>{w(B.target)||L()},_=B=>{w(B.relatedTarget)||L()};return document.addEventListener("pointerdown",T,!0),D.addEventListener("blur",_),()=>{document.removeEventListener("pointerdown",T,!0),D.removeEventListener("blur",_)}},[t,r,n,L]),{inputRef:b,value:p,onChange:j,invalid:x,invalidMessage:y}}var ve=(e=>(e.VALID="valid",e.ERROR="error",e))(ve||{}),Fe=(e=>(e.ITEM="item",e.FOLDER="folder",e))(Fe||{}),ts=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(ts||{}),ea=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(ea||{});const Xl="application/octet-stream";function Ql(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=Cr(n,!0),o=e.filter(d=>d!==r).map(d=>{const u=d.path||d.url||"",p=Jl(d.nodeType),h=p===Fe.FOLDER,x=Cr(u,h);let g;return d.parentPath===null||d.parentPath===void 0?g=a:d.parentPath===""?g="":g=Cr(d.parentPath,!0),{...d,originalPath:u,path:x,parentPath:g,nodeType:p}}),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:ec(d.resourceType),folderId:t,updatedAt:d.updatedAt?new Date(d.updatedAt).toISOString():new Date().toISOString(),items:d.nodeType===Fe.FOLDER?[]:void 0};d.nodeType===Fe.ITEM&&(u.extension=tc(d.name),u.contentType=d.contentType||Xl,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||""),p=d.path.slice(0,u),h=i.get(p);h&&h.nodeType===Fe.FOLDER?(h.items=h.items||[],h.items.push(d)):l.push(d)}}),l}function Cr(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 Jl(e){return e.toUpperCase()==="FOLDER"?Fe.FOLDER:Fe.ITEM}function ec(e){if(!e)return;const t=e.toUpperCase();return Object.values(ts).find(n=>n.toUpperCase()===t)}function tc(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}function rc(e,t="Prompts",r="prompts/public/",n="root"){const a=Ql(e,n);return[{id:n,name:t,path:r,parentPath:"",nodeType:Fe.FOLDER,folderId:n,items:a}]}const ta=({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}},ra=':;,=/{}%&\\"',rs=`(\r
3
3
  |
4
- |\r| )|[\0-]`,tc=`[${ea.replace(/\\/g,"\\\\")}]`,rc=new RegExp(`${tc}|${rs}`),sc=new RegExp(rs);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 nc={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 _s(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 p of a)o=o?.[p];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=_s(i,Q(l,t,r+1));n=_s(i,o)}return n}function ta(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 ss=e=>`"${e}" is required`;function ra(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(p=>p.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,p=e?.[u];if(p&&i.discriminator.mapping[p]){const h={$ref:i.discriminator.mapping[p]},x=Q(h,r);return Be(e,x,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 p=Be(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...p)}return o}if(!Ye(i))return o;const l=i.required??[],d=e;for(const u of l){const p=i.properties?.[u];if(p&&Q(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d?.[u];if(dr(x)){const g=p?.title??Yt(u);o.push({path:h,message:ss(g)})}}if(d&&i.properties)for(const[u,p]of Object.entries(i.properties)){if(Q(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d[u];if(x!=null){const g=Be(x,p,r,h,a+1);o.push(...g)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[p,h]of Object.entries(d)){const x=n?`${n}.${p}`:p,g=Be(h,u,r,x,a+1);o.push(...g)}}return o}function ns(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 ac(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 oc(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 sa(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 ic=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function lc(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 cc={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function dc(e){return cc[e]}const na=m.createContext(null),ke=()=>{const e=m.useContext(na);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))},aa=({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 oa="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",uc={[Se.Outlined]:"dial-tiny-text",[Se.Selectable]:"dial-tiny-text",[Se.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},ia={[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"}},la="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",ca="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:p,onKeyDown:h,...x})=>{const g=r===Se.Selectable,y=!!u&&!a,v=o&&!!p&&!a,b=g&&n,C=I=>{h?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...x,role:y?"button":x.role,tabIndex:y?0:x.tabIndex,"aria-disabled":a||void 0,"aria-pressed":g&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(oa,b?"dial-tiny-semi-text":uc[r],ia[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[la,ca],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(),p?.(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)})}),fc=8,pc=e=>e.stopPropagation(),hc=e=>{e.key!=="Escape"&&e.stopPropagation()},mc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=m.useRef(null),a=m.useRef(null),[o,i]=m.useState(null),l=m.useCallback(()=>{const h=n.current,x=a.current;if(!h||!x)return;const g=Array.from(x.children,v=>v.offsetWidth),y=g.pop()??0;i(aa({tagWidths:g,overflowChipWidth:y,availableWidth:h.clientWidth,gap:fc}))},[]);m.useLayoutEffect(()=>{l()},[l,e,t]),m.useLayoutEffect(()=>{const h=n.current;return h?c.observeElementSize(h,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),p=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"}),p.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:pc,onKeyDown:hc,children:s.jsx(yt,{options:e,selectedValues:p,handleRemoveTag:r})}),children:s.jsx(Le,{label:`+${p.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${p.length} more selected: ${p.map(h=>e.find(x=>x.value===h)?.label??h).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")})]})]})},gc=f.mergeClasses("w-full flex flex-col"),xc=c.overlayItemClassName,bc="!max-w-[var(--reference-width)]",vc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),yc=c.overlayGap,Cc=c.overlaySubMenuListClassName,Ic=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Sc="text-secondary transition-transform",Nc=8,jc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),wc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Dc=({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:p}=c.useSubMenuFloating(yc,"listbox",!!e.disabled),h=e.children?.some(g=>t.includes(g.value)),x=s.jsx(c.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!h,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Ic,...u()});return s.jsxs(P.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:x}):x,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:p,role:"listbox",surfaceClassName:Cc,children:e.children.map(g=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(g.value),"aria-disabled":!!g.disabled,disabled:g.disabled,mark:r,selected:t.includes(g.value),ellipsisLabel:!0,icon:g.icon,label:g.labelNode??g.label,rightControl:g.rightControl,onClick:()=>!g.disabled&&n(g.value)});return s.jsx(m.Fragment,{children:g.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:g.interactiveTooltip.placement,content:g.interactiveTooltip.content,contentClassName:g.interactiveTooltip.contentClassName,children:y}):y},g.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:p,caption:h,ariaLabel:x,ariaDescribedBy:g,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:S="Select all",collapseTagOverflow:N=!1,selectedOptionMark:j=c.MenuItemMark.Tint,emptyStateTitle:E="No options available",emptyStateDescription:A,emptyStateIcon:L,disabled:D=!1,className:w,fieldClassName:T,listClassName:_,closable:B=!1,header:k,footer:R,onClose:M,onChange:H,dismissRef:G,onFooterClick:V,open:Z,onOpenChange:se,onSearchQueryChange:re,customMultiSelectTagsRenderer:le})=>{const W=m.useId(),K=r||W,Y=`list-${K}`,ee=p?`${K}-error`:void 0,ne=!p&&h?`${K}-caption`:void 0,pe=o===c.ElementSize.Small,[ve,O]=m.useState(!1),U=Z!==void 0,de=U?!!Z:ve,ae=m.useCallback(z=>{U||O(z),se?.(z)},[U,se]),[ge,Qe]=m.useState(""),ft=m.useCallback(z=>{z!==ge&&(Qe(z||""),re?.(z||""))},[re,ge]),pt=n!==void 0,[J,ce]=m.useState(a),me=pt?n:J,ue=m.useMemo(()=>t?Array.isArray(me)?me:[]:typeof me=="string"?[me]:[],[me,t]),Lt=m.useMemo(()=>{const z=ge.trim().toLowerCase();return z?e.filter(oe=>oe.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]),fr=m.useCallback(z=>{if(t){const oe=new Set(ue);oe.has(z)?oe.delete(z):oe.add(z),Re(Array.from(oe));return}Re(z),ae(!1)},[t,Re,ae,ue]),At=m.useCallback((z,oe)=>{if(z.stopPropagation(),!t){Re("");return}const kt=ue.filter(Ga=>Ga!==oe);Re(kt)},[t,ue,Re]),De=m.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),pr=m.useMemo(()=>De.filter(z=>ue.includes(z.value)).length,[De,ue]),{allSelectedInFiltered:hr,someSelectedInFiltered:Ba}=m.useMemo(()=>{const z=De.length>0&&pr===De.length;return{allSelectedInFiltered:z,someSelectedInFiltered:pr>0&&!z}},[De,pr]),za=m.useCallback(()=>{if(!(!t||De.length===0))if(hr){const z=new Set(De.map(oe=>oe.value));Re(ue.filter(oe=>!z.has(oe)))}else{const z=new Set(ue);De.forEach(oe=>z.add(oe.value)),Re(Array.from(z))}},[hr,t,De,ue,Re]),_t=ue.length>0,Ot=!t&&_t?ue[0]:void 0,Ne=m.useMemo(()=>Ot?e.find(z=>z.value===Ot)??e.flatMap(z=>z.children??[]).find(z=>z.value===Ot):void 0,[e,Ot]),ht=Ne?i?`${i} ${Ne.label}`:Ne.label:void 0,Fa=c.useIsMobileScreen(),mr=t&&N&&!le&&!Fa,mt=m.useMemo(()=>t?_t?mr?s.jsx(mc,{options:e,selectedValues:ue,handleRemoveTag:At}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:le?.(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})]}),[mr,le,At,_t,t,e,ht,ue,Ne]),Ha=t||mt?"":ht||(l&&n?l:""),$a=typeof u?.label=="string"?u.label:void 0,Ka=mt?[c.resolveAccessibleName(x,$a),t?ue.map(z=>e.find(oe=>oe.value===z)?.label??z).join(", "):ht].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(x);m.useImperativeHandle(G,()=>({dismiss:()=>{ae(!1)}}));const Va=m.useCallback(z=>{D||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ae(!0))},[D,de,ae]),Wa=()=>s.jsxs("div",{id:Y,role:"listbox","aria-multiselectable":t||void 0,className:gc,children:[k&&s.jsx(s.Fragment,{children:typeof k=="function"?k():k}),(y||B)&&(e.length>Nc||!!ge)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${K}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ft(z),value:ge,iconBefore:jc,containerClassName:"w-full"}),B&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:wc,onClick:z=>{M?.(z),ae(!1)}})]}),t&&C&&De.length>0&&s.jsx("div",{className:f.mergeClasses(xc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${K}-selectAll`,labelProps:{label:S},isSelected:hr,isIndeterminate:Ba,onChange:za})}),s.jsx("div",{role:"none",className:vc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:L,title:E,description:A})}):Lt.map(z=>{const oe=ue.includes(z.value);if(z.children?.length)return s.jsx(Dc,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:j,onSelect:fr},z.value);const kt=t?s.jsx(c.MenuItem,{id:`${K}-${z.value}`,role:"option","aria-selected":oe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:oe,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>fr(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:j,selected:oe,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&fr(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=>{V?.(z),V&&ae(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",w,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:K}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ae,disabled:D,closable:B,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(bc,_),className:"w-full",renderOverlay:Wa,children:s.jsx(c.Input,{id:K,size:o,disabled:D,invalid:I,value:Ha,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:Ne?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:pe?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(Sc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":Y,"aria-autocomplete":"none","aria-label":Ka,"aria-describedby":[g,ee,ne].filter(Boolean).join(" ")||void 0,"aria-invalid":p||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!D&&"cursor-pointer",t&&_t&&!mr&&["!h-auto flex-wrap py-2",pe?"min-h-[24px]":"min-h-[40px]"],T),className:f.mergeClasses("cursor-pointer",mt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Va,children:mt})}),s.jsx(c.ErrorText,{id:ee,text:p}),!p&&s.jsx(c.CaptionText,{id:ne,text:h})]})]})},Os={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},Tc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=e.anyOf??[],p=ac(t,u,i),h=u[p],x=!h||Q(h,i).type===$.Null,g=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:ra(y,i)})),value:String(p),disabled:d,onChange:y=>g(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!x&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ke,{schema:h,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:p,target:h,rel:x,disabled:g,...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,N=p!==void 0?s.jsx("a",{...S,href:g?void 0:p,target:h,rel:x??(h==="_blank"?"noopener noreferrer":void 0),"aria-disabled":g||void 0,tabIndex:g?-1:S.tabIndex,onClick:g?void 0:S.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(g,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:N}):N},as=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),os=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),is=as(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),ur=as(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Ec=as(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)"},Lc=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Ac=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=Lc,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}})},_c=os(c.ButtonAppearance.Link,c.ButtonVariant.Primary),ls=os(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Oc=os(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,p]=m.useState(l),h=m.useId(),x=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",x?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",x?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?h:void 0,onClick:()=>p(g=>!g),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",x?"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:h,className:f.mergeClasses("border-t border-tertiary",x?"p-4":"p-3"),children:o})]})},kc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=ke(),[u,p]=m.useState(),h=Array.isArray(t)?t:[],x=e.items;if(!x)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const g=Q(x,o),y=g.discriminator,v=y?Object.keys(y.mapping).map(N=>({value:N,label:N})):[],b=u??v[0]?.value,C=()=>{let N;if(y&&b){const j=Q({$ref:y.mapping[b]},o);N={...He(j,o)??{},[y.propertyName]:b}}else N=He(g,o)??sa(g);r([...h,N])},I=N=>{r(h.filter((j,E)=>E!==N))},S=(N,j)=>{r(h.map((E,A)=>A===N?j:E))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),h.map((N,j)=>{const E=oc(N,y?.propertyName,j),A=Be(N,g,o,`${n.join(".")}[${j}]`);return s.jsx(Nt,{title:E,level:a,summary:ns(N,g,o),errorCount:A.length,onRemove:l?void 0:()=>I(j),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${E}`,children:s.jsx(Ke,{schema:x,value:N,onChange:L=>S(j,L),path:[...n,String(j)],level:a+1,ariaLabel:E})},j)}),!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:N=>p(typeof N=="string"?N:N[0]),className:"max-w-[280px] flex-1"}),s.jsx(ls,{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 cs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(cs||{});const ks={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Rc=e=>typeof e=="boolean"?ks[e?"both":"none"]:ks[e],da=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":p,"aria-invalid":h,...x})=>{const g=m.useId(),y=d??g,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",x.disabled&&"dial-kit-input-disable",Rc(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":[p,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":h??(n||u?!0:void 0),...x}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},Rs=e=>{try{return JSON.parse(e),!0}catch{return!1}},ds=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=ke(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!Rs(i),u=p=>{l(p),Rs(p)&&t(JSON.parse(p))};return s.jsx(da,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:cs.Vertical,className:"font-mono !whitespace-pre"})},Mc=/^0+\.(\d+)?$/,Pc=/^0+/,Bc=[".","-","+","e","E"],Ms=e=>!e||e==="-"?e:String(e).match(Mc)?String(e).replace(Pc,"0"):Number(e),us=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Bc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const p=u.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(u.preventDefault(),h)){const x=u.currentTarget,g=x.selectionStart??0,y=x.selectionEnd??0,v=x.value.slice(0,g)+h+x.value.slice(y);t?.(Ms(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?.(Ms(u)),onKeyDown:l,onPaste:d})},ua=({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(p=>!p)}):void 0})},zc="flex flex-col gap-2",Fc="flex",Hc="mt-2 ml-[26px]",$c={[_e.Column]:"flex-col gap-y-3",[_e.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},jt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=_e.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:p,className:h,optionsClassName:x,radioClassName:g,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,N=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(zc,h,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":N?C:void 0,"aria-label":N?void 0:c.resolveAccessibleName(p),"aria-describedby":[I,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses(Fc,$c[o],x),children:e.map(j=>{const E=j.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${j.value}`,name:n??b,value:j.value,labelProps:j.label==null?void 0:{label:j.label},"aria-label":j["aria-label"],caption:j.caption,isSelected:E,disabled:l||j.disabled,onChange:r,className:g}),E&&j.content?s.jsx("div",{className:f.mergeClasses(Hc,y),children:j.content}):null]},j.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:S,text:u})]})},fa=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=m.useId(),u=e??d,p=o?`${u}-caption`:void 0,h=m.useCallback(x=>{a?.(x.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:h,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":p,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:p,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Ps=e=>typeof e=="string"?e:e[0],Ir=e=>e!=null?String(e):"",Kc=e=>e!==void 0?Number(e):void 0,pa=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:p}=ke(),h=e.const!==void 0,x=Array.isArray(e.enum)?e.enum:[],g=x.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=p?.[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(Ps(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(h)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(g&&e.enumDisplay===lr.Radio)return s.jsx(jt,{id:a,ariaLabel:o,items:x.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,orientation:e.enumOrientation===cr.Row?_e.Row:_e.Column,disabled:d,onChange:v=>r(v)});if(g)return s.jsx($e,{id:a,ariaLabel:o,ariaDescribedBy:i,options:x.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Ps(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(fa,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(us,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:Ir(t),invalid:n,disabled:d,onChange:v=>r(Kc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(ua,{id:a,"aria-label":o,"aria-describedby":i,value:Ir(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:Ir(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Bs=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),ha=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),Vc={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},zs=e=>typeof e=="string"?e:e[0],Wc=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:p=!1,inputClassName:h,defaultExpanded:x=!0,touchedPaths:g,markTouched:y,skipUntouched:v}=ke(),[b,C]=m.useState(e.key),[I,S]=m.useState(()=>lc(e.value)),N=ha(t),j=r&&(I===$.Object||I===$.Array),E=r&&I===$.Null,A=r&&I===$.Boolean,L=N||j,D=[...i,e.id,"key"].join("."),w=St(D,g,v)&&e.key==="",T=e.key||u.valueColumnHeader,_=V=>{a(dc(V)),S(V)},B=m.useMemo(()=>ic.map(V=>({value:V,label:u[Vc[V]]})),[u]),k=m.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>E?s.jsx(c.Input,{"aria-label":T,value:"null",disabled:!0}):A?s.jsx($e,{ariaLabel:T,options:k,value:e.value?"true":"false",disabled:p,onChange:V=>{const Z=zs(V);Z&&a(Z==="true")}}):s.jsx(pa,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:T}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:L?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:p,invalid:w,error:w?`${u.keyColumnHeader} is required`:void 0,onChange:V=>C(V??""),onBlur:()=>{y?.(D),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:h})}),!L&&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:B,value:I,disabled:p,onChange:V=>{const Z=zs(V);Z&&_(Z)}})})}),!p&&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(!L)return M;if(j)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(ds,{value:e.value,onChange:a,ariaLabel:T},I)]});const H=[...i,e.key],G=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:ns(e.value,t,d),errorCount:G.length+(w?1:0),defaultExpanded:x,children:s.jsx(Ke,{schema:t,value:e.value,onChange:a,path:H,level:l+1,ariaLabel:T})})]})},Gc=({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},p=ha(u),[h,x]=m.useState(()=>Object.entries(t??{}).map(([b,C])=>Bs(b,C))),g=b=>{x(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>g(h.map((I,S)=>S===b?{...I,...C}:I)),v=()=>{const b=p?He(u,o)??sa(u):"";x(C=>[...C,Bs("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),h.length>0&&!p&&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})]}),h.map((b,C)=>s.jsx(Wc,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>g(h.filter((I,S)=>S!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(ls,{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})})]})},Rr=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=ke(),l=Q(e,o),d=ta(Object.entries(l.properties??{}).filter(([,h])=>!Q(h,o).isHidden)),u=l.required??[],p=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(([h,x])=>{const g=Q(x,o);return s.jsx(ma,{schema:x,value:p[h],onChange:y=>r({...p,[h]:y}),path:[...n,h],level:a,required:u.includes(h),label:g.title??x.title??Yt(h)},h)})})},Fs=e=>typeof e=="string"?e:e[0],Uc=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Zc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=ke(),u=m.useId(),p=o??l.selectTypePlaceholder,h=e.discriminatorDisplay===lr.Radio,x=e.discriminator;if(x){const I=x.propertyName,S=x.mapping,N=L=>Q({$ref:S[L]},i),j=typeof t=="object"&&t!==null?t[I]:void 0,E=j?N(j):void 0,A=L=>{const D=He(N(L),i)??{};r({...D,[I]:L})};if(h){const L=e.discriminatorOrientation===cr.Row,D=T=>s.jsx(Rr,{schema:Uc(T,I),value:t,onChange:r,path:n,level:a}),w=s.jsx(jt,{id:u,ariaLabel:p,value:j,onChange:A,disabled:d,orientation:L?_e.Row:_e.Column,items:Object.keys(S).map(T=>{const _=N(T);return{value:T,label:_.title??T,content:L?void 0:D(_)}})});return L?s.jsxs("div",{className:"flex flex-col gap-3",children:[w,E&&D(E)]}):w}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx($e,{ariaLabel:p,options:Object.keys(S).map(L=>({value:L,label:L})),value:j,placeholder:l.selectTypePlaceholder,disabled:d,onChange:L=>{const D=Fs(L);D&&A(D)},className:"max-w-[280px]"}),E&&s.jsx("div",{className:"pl-3",children:s.jsx(Rr,{schema:E,value:t,onChange:r,path:n,level:a})})]})}const g=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=g.findIndex(S=>Q(S,i).required?.every(N=>N in t));return I>=0?I:0})(),b=g[v],C=I=>{const S=He(Q(g[I],i),i);r(S??null)};return h?s.jsx(jt,{id:u,ariaLabel:p,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:g.map((I,S)=>({value:String(S),label:ra(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:p,options:g.map((I,S)=>({value:String(S),label:Q(I,i).title??`Option ${S+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(Fs(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 p=m.useId(),{rootSchema:h,renderField:x,markTouched:g,touchedPaths:y,skipUntouched:v}=ke(),b=Q(e,h),C=n.join("."),I=j=>{g?.(C),r(j)},S={schema:b,value:t,onChange:I,path:n,level:a};let N;if(b.oneOf)N=s.jsx(Zc,{...S,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)N=s.jsx(Tc,{...S,ariaLabel:d});else if(Ye(b)){const j=b.additionalProperties!=null&&b.additionalProperties!==!1,E=!b.properties||Object.keys(b.properties).length===0;j&&E?N=s.jsx(Gc,{...S}):E&&b.additionalProperties!==!1?N=s.jsx(ds,{value:t,onChange:I,id:l,ariaLabel:d}):N=s.jsx(Rr,{...S})}else if(b.type===$.Array)N=s.jsx(kc,{...S});else{const j=St(C,y,v)&&!!o&&dr(t),E=!i&&j?ss(b.title??d??"Field"):void 0;N=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(pa,{schema:b,value:t,onChange:I,invalid:j,id:l,ariaLabel:d,ariaDescribedBy:E?p:u}),s.jsx(c.ErrorText,{id:p,text:E})]})}return x?x(n,b,N):N},ma=({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:p,skipUntouched:h}=ke(),x=Q(e,d),g=n.join(".");if(Ye(x)||x.type===$.Array){const v=Be(t,x,d,g),b=i??x.title??n[n.length-1]??"Section";return s.jsx(Nt,{title:b,description:x.description,level:a,summary:ns(t,x,d),errorCount:St(g,p,h,!0)?v.length:0,defaultExpanded:u,children:s.jsx(Ke,{schema:x,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=St(g,p,h)&&o&&dr(t)?ss(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:x.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Ke,{schema:x,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})]})]})},Hs="dial-small-semi-text text-primary",qc=({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:p,renderField:h,skipUntouched:x=!1,acceptableResourceTypes:g})=>{const y=m.useMemo(()=>({...nc,...r}),[r]),v=m.useMemo(()=>t||(He(e,e)??{}),[]),[b,C]=m.useState(v),[I,S]=m.useState(()=>new Set),N=m.useCallback(w=>{S(T=>T.has(w)?T:new Set([...T,w]))},[]);m.useEffect(()=>{p?.(v)},[]);const j=(w,T)=>{const _={...b,[w]:T};C(_),d?.(_),u?.(w,T)},E=new Set(Object.keys(e.properties??{})),A=Object.keys(b).filter(w=>!E.has(w)),L=ta(Object.entries(e.properties??{}).filter(([,w])=>!Q(w,e).isHidden)),D=e.required??[];return s.jsx(na.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:g,renderField:h,touchedPaths:I,markTouched:N,skipUntouched:x},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[L.map(([w,T])=>{const _=Q(T,e),B=_.title??T.title??Yt(w),k=D.includes(w),R=b[w],M=V=>j(w,V);if(l===nt.Flat)return s.jsx(ma,{schema:T,value:R,onChange:M,path:[w],level:0,required:k,label:B},w);if(l===nt.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Hs,children:B}),s.jsx(Ke,{schema:T,value:R,onChange:M,path:[w],level:0,required:k,ariaLabel:B})]},w);const H=Be(R,_,e,w),G=k&&dr(R)?Math.max(H.length,1):H.length;return s.jsx(Nt,{title:B,description:_.description,level:0,defaultExpanded:o,errorCount:St(w,I,x,!0)?G:0,children:s.jsx(Ke,{schema:T,value:R,onChange:M,path:[w],level:1,required:k,ariaLabel:B})},w)}),A.map(w=>{const T=Yt(w),_=s.jsx(ds,{value:b[w],onChange:B=>j(w,B),ariaLabel:T});return l===nt.Sections?s.jsx(Nt,{title:T,level:0,defaultExpanded:o,children:_},w):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Hs,children:T}),_]},w)})]})})},Yc=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})}),Xc={[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"},Qc="bg-layer-sunken text-primary",Jc={[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"},ed={[X.Info]:"status",[X.Success]:"status",[X.Warning]:"alert",[X.Error]:"alert",[X.Loading]:"status",[X.General]:"status"},td="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",fs=({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,closeAriaLabel:p="Close notification",onClose:h,children:x,textClassName:g,...y})=>{const v=m.useMemo(()=>Yc({size:l,stroke:d})[e],[e,l,d]),b=r===qt.Neutral,C=g??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:ed[e],...y,className:f.mergeClasses(td,b?Qc:Xc[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",b&&Jc[e]),children:s.jsx(c.DialIcon,{icon:v})}),n?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",C),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}),x,u&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:p,onClose:I=>h?.(I)})]})},rd=({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(fs,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(fs,{...a,variant:n||t,type:e}),sd=dt(X.Error,fe.Toast),nd=dt(X.Info,fe.Toast),ad=dt(X.Success,fe.Toast),od=dt(X.Warning,fe.Toast),id=dt(X.Loading,fe.Toast),ld=dt(X.General,fe.Toast),cd=ut(fe.SectionMessage,X.Error),dd=ut(fe.SectionMessage,X.Info),ud=ut(fe.SectionMessage,X.Success),fd=ut(fe.SectionMessage,X.Warning),pd=ut(fe.SectionMessage,X.Loading),hd=ut(fe.SectionMessage,X.General);var xe=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(xe||{});const md="en-GB",gd={[xe.Date]:"Select date",[xe.DateTime]:"Select date and time",[xe.Time]:"--:--",[xe.Weekday]:"Select day"},ga="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",xa="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",ba="!border-error",xd="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",bd="z-floating rounded-lg bg-layer-raised p-2 shadow-md",vd="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",yd="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",Cd="bg-control-accent text-control-permanent",Id="text-accent dial-small-semi-text",Sd="text-control-disable-primary",va="text-secondary",Nd=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:va}),$s={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"})},jd=(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})},Ks=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Vs=(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},wd=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Ws=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Dd=(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")}`,Gs=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},Td=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Ed=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}`},ya=5,Ca=e=>e.charAt(0).toUpperCase()+e.slice(1),Ld=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ya+r));return Ca(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Ad=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,ya+r));return{value:String(r+1),label:Ca(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),_d=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Od=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),kd="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",Rd="bg-control-accent text-control-permanent hover:bg-control-accent",Us=({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),p={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];p&&(l.preventDefault(),p.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(kd,l===r&&Rd),onClick:()=>n(l),children:l},l))})},Md=({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(Us,{label:"Hours",options:_d,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Us,{label:"Minutes",options:Od,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},Pd=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,describedBy:d,panelLabel:u})=>{const p=c.useThemeScope(),[h,x]=m.useState(!1),g=P.useFloatingNodeId(),{refs:y,floatingStyles:v,context:b}=P.useFloating({nodeId:g,open:h,onOpenChange:E=>x(t?!1:E),placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(8),P.flip({padding:8}),P.shift({padding:8})]}),C=P.useClick(b,{enabled:!t}),I=P.useDismiss(b),S=P.useRole(b,{role:"dialog"}),{getReferenceProps:N,getFloatingProps:j}=P.useInteractions([C,I,S]);return s.jsxs(P.FloatingNode,{id:g,children:[s.jsx("div",{id:e,ref:y.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,"aria-describedby":d,tabIndex:t?-1:0,className:f.mergeClasses(ga,"focus-visible:outline focus-visible:outline-focus",r&&ba,t&&xa,o),...N(),children:n}),h&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:b,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:y.setFloating,style:v,"aria-label":u,className:f.mergeClasses(xd,p,a),...j(),children:i(()=>x(!1))})})})]})},Zs=e=>s.jsx(P.FloatingTree,{children:s.jsx(Pd,{...e})}),qs=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,describedBy:d,placeholder:u="--:--",timezoneLabel:p,timezoneLabelClassName:h,picker:x=!1,pickerButtonClassName:g})=>{const[y,v]=m.useState(t),[b,C]=m.useState(!1),I=c.useThemeScope(),S=P.useFloatingNodeId(),{refs:N,floatingStyles:j,context:E}=P.useFloating({nodeId:S,open:b,onOpenChange:T=>C(a?!1:T),placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(8),P.flip({padding:8}),P.shift({padding:8})]}),A=P.useDismiss(E),L=P.useRole(E,{role:"dialog"}),{getFloatingProps:D}=P.useInteractions([A,L]);m.useEffect(()=>{v(t)},[t]);const w=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,"aria-describedby":d,"aria-invalid":o||void 0,placeholder:u,disabled:a,value:y,onChange:T=>{const _=Ed(T.target.value);v(_),Td(_)&&r(_)},onBlur:n,className:f.mergeClasses(ga,o&&ba,a&&xa,x&&"pe-12",i)});return!p&&!x?w:s.jsxs("div",{ref:x?N.setReference:void 0,className:"relative w-full",children:[w,p&&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",x&&"end-12",h),children:p}),x&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":b,disabled:a,className:f.mergeClasses(vd,g),onClick:()=>C(T=>!T),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),b&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:E,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:N.setFloating,style:j,"aria-label":"Choose time",className:f.mergeClasses(bd,I),...D(),children:s.jsx(Md,{value:y,onSelect:(T,_)=>{v(T),r(T),_&&C(!1)}})})})})]})]})},Bd=({mode:e=xe.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,ariaDescribedBy:d,id:u,className:p,minDate:h,maxDate:x,locale:g=md,fieldClassName:y,showTimezone:v=!1,showTimePicker:b=!0,renderTimeField:C,pickerButtonClassName:I})=>{const S=o??gd[e],N=t instanceof Date?t:null,j=m.useId(),E=u??j,A=a?.id??`${E}-label`,L=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,w=L?`${A} ${E}`:void 0,T=a?s.jsx(c.Label,{...a,id:A,htmlFor:E}):null,[_,B]=m.useState(()=>N??new Date),k=m.useMemo(()=>new Date,[]),R=m.useMemo(()=>v?Jn({locale:g}):null,[v,g]),M=m.useMemo(()=>Ld(g),[g]),H=m.useMemo(()=>Ad(g),[g]),G=m.useMemo(()=>jd(_.getFullYear(),_.getMonth()),[_]),V=W=>{B(K=>new Date(K.getFullYear(),K.getMonth()+W,1))},Z=(W,K)=>{if(Vs(W,h,x))return;const Y=e===xe.DateTime&&N?Gs(W,Mt(N)):W;r?.(Y),e===xe.Date&&K()},se=N?Mt(N):"",re=W=>{r?.(Gs(N??new Date,W))},le=()=>N?e===xe.DateTime?`${Ws(N,g)}, ${Mt(N)}`:Ws(N,g):S;if(e===xe.Time){const W=typeof t=="string"?t:N?Mt(N):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(qs,{id:E,value:W,onChange:K=>r?.(K),onBlur:n,disabled:i,invalid:l,describedBy:d,placeholder:S,className:y,timezoneLabel:R,picker:b,pickerButtonClassName:I})]})}if(e===xe.Weekday){const W=typeof t=="string"?t:void 0,K=H.find(Y=>Y.value===W);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{id:E,disabled:i,invalid:l,labelledBy:w,describedBy:d,panelLabel:D??S,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!K&&"text-secondary"),children:K?.label??S}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:va})]}),panel:Y=>s.jsx("div",{role:"listbox","aria-label":D??S,className:"flex flex-col gap-0.5",children:H.map(ee=>s.jsx("button",{type:"button",role:"option","aria-selected":ee.value===W,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",ee.value===W&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(ee.value),Y()},children:ee.label},ee.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{id:E,disabled:i,invalid:l,labelledBy:w,describedBy:d,panelLabel:D??S,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!N&&"text-secondary"),children:le()}),Nd]}),panel:W=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:$s.prev,size:c.ElementSize.Small,onClick:()=>V(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:wd(_,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:$s.next,size:c.ElementSize.Small,onClick:()=>V(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(K=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:K},K)),G.map(K=>{const Y=K.getMonth()!==_.getMonth(),ee=Ks(K,N),ne=Ks(K,k),pe=Vs(K,h,x);return s.jsx("button",{type:"button",disabled:pe,"aria-label":Dd(K,g),"aria-pressed":ee,"aria-current":ne?"date":void 0,className:f.mergeClasses(yd,Y&&Sd,ne&&!ee&&Id,ee&&Cd,pe&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>Z(K,W),children:K.getDate()},K.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"}),C?C({value:se,onChange:re,onBlur:n,disabled:i,invalid:l,ariaLabel:"Time",timezoneLabel:R}):s.jsx(qs,{ariaLabel:"Time",value:se,onChange:re,onBlur:n,className:f.mergeClasses(!R&&"w-[120px]","px-3 py-1.5"),timezoneLabel:R,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},zd=3,Fd=({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),p=m.useRef(!1),h=m.useRef(0),x=m.useCallback(D=>{p.current=D,u(D)},[]),g=m.useCallback(()=>{const D=o.current;if(!D)return;if(p.current){D.clientWidth>=h.current&&x(!1);return}const w=i.current,T=l.current;if(!w||!T)return;const _=w.scrollWidth-w.clientWidth,B=parseFloat(getComputedStyle(T).minWidth)||0,k=T.clientWidth<=B+1;_>0&&k&&(h.current=D.clientWidth+_,x(!0))},[x]);m.useEffect(()=>{const D=o.current;if(D)return c.observeElementSize(D,g)},[g]);const y=e.join("\0");m.useEffect(()=>{x(!1),c.scheduleMeasure(g)},[y,g,x]),m.useEffect(()=>{d||c.scheduleMeasure(g)},[d,g]);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:Vr,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,N=e.length>zd||d,j=e.slice(1,d?I:I-1),E=D=>{const w=D===I,T=D===S;let _=e[D];return w&&(_=s.jsx("span",{className:r,children:e[D]})),s.jsxs("li",{className:f.mergeClasses(Zt,w&&"min-w-0",T&&"shrink-[1000]",!w&&!T&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Ar,Dn,"pointer-events-none opacity-75",T&&"min-w-auto"),"aria-current":w?"page":void 0,"aria-disabled":"true",children:[D===0&&v,s.jsx("span",{ref:w&&i||T&&l||void 0,className:f.mergeClasses("truncate",w&&"min-w-0 flex-1",T&&"min-w-[2ch]",C),children:_})]}),!w&&b]},`item-${D}`)},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:j.join(", ")})]}),b]},"ellipsis"),L=[];return N?(L.push(E(0),A()),d||L.push(E(I-1)),L.push(E(I))):e.forEach((D,w)=>L.push(E(w))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(jn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:wn,children:L})})};var Ze=(e=>(e.Small="small",e.Heading="heading",e))(Ze||{});const Hd="w-full overflow-hidden",$d="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Ys="flex min-w-0 items-center gap-2",Xs={[Ze.Small]:"dial-small-text",[Ze.Heading]:"dial-h2-text"},Kd={[Ze.Small]:"dial-small-semi-text",[Ze.Heading]:"dial-h2-text"},Vd={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},Wd="flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors",Gd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",Ud="cursor-default text-primary",Zd="cursor-default text-secondary",Qs="inline-flex flex-none items-center leading-none text-secondary",qd="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",Yd=3,Xd=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]"}),Jd=({items:e,maxVisibleItems:t=Xd,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,Yd),u=m.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),p=m.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),h=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 x=e.slice(u.length+1),g=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),S=f.mergeClasses(Wd,I?Gd:C?f.mergeClasses(Ud,Kd[r]):Zd,l,c.DIAL_KIT_CLASS.breadcrumbsItem),N=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(Ys,Xs[r],Vd[C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:S,children:N}):s.jsx("button",{type:"button",onClick:y.onClick,className:S,children:N}):s.jsx("span",{className:S,"aria-current":C?"page":void 0,children:N}),!C&&s.jsx("span",{className:Qs,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Hd,i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:$d,children:[g(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(Ys,Xs[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:p,onItemClick:h,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:qd,children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:Qs,"aria-hidden":"true",children:n})]}),x.map((y,v)=>g(y,{index:e.length-x.length+v,isFirst:!1,isCurrent:v===x.length-1}))]})})},eu=({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},tu=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")}),ru=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>tu(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})})})},Ia=({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")})]})},su=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:p,triggerClassName:h,triggerLabelClassName:x,open:g,onOpenChange:y})=>{const[v,b]=m.useState(!1),C=g!==void 0,I=C?g:v,S=m.useCallback(w=>{C||b(w),y?.(w)},[C,y]),[N,j]=m.useState(r??e[0]?.key),E=t!==void 0,A=E?t:N,L=m.useMemo(()=>{const w=e.find(T=>T.key===A);return w?.label?String(w.label):""},[e,A]),D=m.useCallback(({key:w})=>{const T=e.find(_=>_.key===w);T&&(E||j(w),n?.(T))},[e,E,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?g:void 0,onOpenChange:S,onItemClick:D,children:s.jsx(Ia,{label:L,size:a,isOpen:I,disabled:o,"aria-label":p,className:h,labelClassName:x})})},nu={[be.VALID]:"Completed",[be.ERROR]:"Error"},au=(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",ou=(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",iu=({steps:e,currentStep:t,onChangeStep:r,statusLabels:n,ariaLabel:a,className:o})=>{const i=l=>{if(l===t)return;const d=e.findIndex(h=>h.id===t),u=e.findIndex(h=>h.id===l);(e.slice(0,u).every(h=>h.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,p=l.status?n?.[l.status]??nu[l.status]:void 0;let h=d+1;return u&&l.status===be.ERROR?h=s.jsx(F.IconExclamationCircle,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):!u&&l.status===be.VALID&&(h=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,disabled:l.disabled,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",au(l,u),"disabled:cursor-not-allowed disabled:text-control-disable-primary"),children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("me-2 flex size-[22px] shrink-0 items-center justify-center rounded-full",ou(l,u)),children:h}),s.jsx("span",{children:l.name}),p&&s.jsx("span",{className:"sr-only",children:p})]})},l.id)})})};var Oe=(e=>(e.Outlined="outlined",e.Filled="filled",e))(Oe||{}),je=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(je||{});const lu={[je.Blue]:"bg-blue text-blue",[je.Green]:"bg-green-2 text-green-1",[je.Violet]:"bg-violet-2 text-violet-1",[je.Indigo]:"bg-violet-1 text-violet-2",[je.Brown]:"bg-brown text-brown-2",[je.Red]:"bg-red text-red"},cu={[Oe.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[Oe.Filled]:"rounded-full"},du={[Oe.Outlined]:"dial-tiny-text",[Oe.Filled]:"dial-caption-lead-semi-text"},ps=({label:e,variant:t=Oe.Outlined,color:r=je.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",cu[t],t===Oe.Filled&&lu[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??du[t],children:e})]});var wt=(e=>(e.Default="default",e.Compact="compact",e))(wt||{});const uu={[wt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",compareDividerCell:"h-10",showDescription:!0},[wt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",compareDividerCell:"h-6",showDescription:!1}},fu=({title:e,value:t,description:r,variant:n=wt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:p})=>{const h=uu[n],x=d!==void 0?d:(l??0)>=0,g=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",h.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:h.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",x?"bg-success text-success":"bg-error text-error"),children:g})]}):s.jsx("span",{className:h.title,children:e}),a?s.jsx(ps,{label:"Error",variant:Oe.Filled,color:je.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-start"}):p?s.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-3 gap-y-0.5",children:[s.jsx(c.EllipsisTooltip,{text:p[0].title,className:"col-start-1 dial-tiny-text text-secondary"}),s.jsx(c.EllipsisTooltip,{text:p[1].title,className:"col-start-3 dial-tiny-text text-secondary"}),s.jsx("span",{className:f.mergeClasses("col-start-1 min-w-0",h.value),children:p[0].value}),s.jsx("div",{"aria-hidden":"true",className:f.mergeClasses("col-start-2 flex items-center self-start",h.compareDividerCell),children:s.jsx("div",{className:"h-4 w-px bg-controls-disable-accent"})}),s.jsx("span",{className:f.mergeClasses("col-start-3 min-w-0",h.value),children:p[1].value})]}):s.jsx("span",{className:h.value,children:t}),!a&&!o&&h.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"mt-auto dial-tiny-text text-secondary",children:r})]})},hs=[{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"}],pu=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),hu=(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=hs,className:l,titleClassName:d,valueClassName:u,inline:p,ariaLabel:h})=>{const x=e==null,g=!!(r||n||!x),y=pu(x?0:e,t),v=hu(y,i),b=o??(x?"—":e),C=h??(typeof a=="string"?a:void 0),I=r||n,S=r?s.jsx(ps,{label:"Error",variant:Oe.Filled,color:je.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",p?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),N=g?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",p?"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,j=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return p?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:j}),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:N}),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:[j,S]}),N]})};var Qt=(e=>(e.Start="start",e.End="end",e))(Qt||{});const Sa=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Qt.End,className:p,headerClassName:h,contentClassName:x})=>{const g=n!==void 0,[y,v]=m.useState(a),b=i?!0:g?n:y,C=m.useId(),I=`accordion-header-${C}`,S=`accordion-content-${C}`,N=()=>{if(o)return;const D=!b;g||v(D),d?.(D)},j=u===Qt.Start,E=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:[j&&E,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]}),!j&&E]}),L=j?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",p,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",L,h),children:A}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":S,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:N,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",L,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",h),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",x),children:r})})})})]})},mu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:p,onBarClick:h,inline:x,barTitleClassName:g,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),S=x?f.mergeClasses("text-secondary",g):g,N=o?"dial-tiny-text text-secondary":void 0,j=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,E=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],A="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",L="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",h&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(Sa,{title:j,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":x?"gap-2":"gap-3"),children:p?s.jsx(Ve,{size:18,fullWidth:!1,className:"self-center"}):a?E.map(w=>{const T=w in n?n[w]:null,_=w in a?a[w]:null,k=typeof T=="number"&&typeof _=="number"?parseFloat((_-T).toFixed(3)):null,R=k!=null&&k!==0,M=R&&k>0,H=R?M?`+${k}`:String(k):null,G=b?.[w],V=s.jsx("span",{className:"dial-small-text text-secondary",children:w}),Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[G?s.jsx(c.Tooltip,{tooltip:G,children:V}):V,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:D,children:[s.jsx(Vt,{title:o?.[0],value:T,maxValue:i,colorMap:l,inline:x,titleClassName:N,ariaLabel:w}),s.jsx(Vt,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:x,titleClassName:N,ariaLabel:`${w} compare`})]})]});return h?s.jsx("button",{type:"button",onClick:()=>h(w,T),className:f.mergeClasses(L,A),children:Z},w):s.jsx("div",{className:L,children:Z},w)}):I.map(([w,T])=>{const _=s.jsx(Vt,{title:w,value:T,maxValue:i,colorMap:l,inline:x,titleClassName:S,valueClassName:y,className:v}),B=h?s.jsx("button",{type:"button",onClick:()=>h(w,T),className:A,children:_}):_,k=b?.[w];return k?s.jsx(c.Tooltip,{tooltip:k,triggerClassName:"flex flex-col",children:B},w):s.jsx(m.Fragment,{children:B},w)})})})},gu="#FF4E50",xu=(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},Js=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=xu(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:gu,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]},Na=e=>e<=0?2:e%2===0?e:e+1,bu=e=>{const t=Na(e);return[t,t/2,0]},Sr=e=>`${Math.round(e*100)/100}`,ja=(e,t)=>e===t?Sr(e):`${Sr(e)}-${Sr(t)}`,Nr=128,vu=(e,t)=>{const r=ja(e,t);return e===t?`scored ${r}`:`scored between ${r}`},en=(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:vu(a.from,a.to)})]}),yu=({title:e,values:t,colorMap:r=hs,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const p=Js(t,r),h=l?Js(l,r):void 0,x=t.length,g=l?.length??0,y=Math.max(x,g),v=Na(y),b=bu(y),C=j=>j.map(E=>({...E,ratio:v>0?E.count/v:0})),I=C(p),S=h?C(h):void 0,N=(j,E,A,L)=>{if(j.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:`${j.ratio*100}%`}})});const D=L?{backgroundImage:`repeating-linear-gradient(135deg, ${j.color} 0px, ${j.color} 1px, transparent 1px, transparent 4px)`,borderColor:j.color}:{backgroundColor:j.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:E,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:`${j.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:j.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:Nr},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:Nr},children:b.map((j,E)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${E/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:j},j))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((j,E)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${E/(b.length-1)*100}%`}},j)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Nr},children:S?I.map((j,E)=>{const A=S[E],L=`${j.count} out of ${x} ${n}`,D=`${A.count} out of ${g} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[N(j,en(d,j.count,x,n,j),L,!0),N(A,en(u,A.count,g,n,A),D,!1)]},E)}):I.map((j,E)=>{const A=`${j.count} out of ${x} ${n}`;return j.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:`${j.ratio*100}%`}})},E):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:`${j.ratio*100}%`,backgroundColor:j.color},children:a&&j.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:j.count})})},E)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((j,E)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:ja(j.from,j.to)},E))})]})]})},Cu=({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]})]})},Iu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",Su="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",Nu="flex flex-row items-center justify-between px-6 py-4",ju="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",wu="border-b border-tertiary",Du="flex flex-row items-center gap-2 px-6 py-4",Tu="border-t border-tertiary",jr="flex shrink-0 flex-row items-center gap-2",Eu="ml-auto mobile:flex-1",Jt="mobile:flex-1",Lu={[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]"},ms=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:p,footer:h,footerClassName:x,onClose:g,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:S,additionalButtonsOnLeft:N=!1,footerDivider:j=!1,size:E=We.Md,hideClose:A=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:D=!0,preventKeyboardOnOpen:w=!1})=>{const T=c.useThemeScope(),_=m.useRef(null),B=m.useId(),{refs:k,context:R}=P.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),M=P.useRole(R,{role:"dialog"}),H=P.useDismiss(R,{outsidePress:D}),{getFloatingProps:G}=P.useInteractions([M,H]);if(!e)return null;const V=typeof t=="string"?`popup-heading-${B}`:void 0,Z=W=>W?typeof W=="string"?s.jsx("h2",{id:V,className:f.mergeClasses(ju,l),children:s.jsx(c.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:s.jsx("span",{}),se=A?null:s.jsx(c.CloseButton,{ariaLabel:L,onClose:W=>g?.(W)}),re=(W,K=[],Y)=>K.map(({variant:ee=c.ButtonVariant.Neutral,className:ne,...pe},ve)=>s.jsx(Xe,{variant:ee,className:f.mergeClasses(Y,ne),...pe},`${W}-${ve}`)),le=()=>{if(h!==void 0)return h;if(!I?.length&&!S?.length)return null;const W=re("additional",S,N?void 0:Jt);return s.jsxs("div",{className:f.mergeClasses(Du,j&&Tu,x),children:[N&&W.length>0&&s.jsx("div",{className:jr,children:W}),s.jsxs("div",{className:f.mergeClasses(jr,Eu),children:[!N&&W,re("main",I,Jt)]})]})};return s.jsx(P.FloatingPortal,{id:n,children:s.jsx(P.FloatingOverlay,{style:i,className:f.mergeClasses(Iu,T,o),children:s.jsx(P.FloatingFocusManager,{context:R,initialFocus:w?_:k.floating,children:s.jsxs("div",{ref:k.setFloating,...G(),role:"dialog","aria-modal":"true","aria-labelledby":V,"aria-label":V?void 0:r,className:f.mergeClasses(Su,Lu[E],a,c.DIAL_KIT_CLASS.popup),children:[w&&s.jsx("div",{ref:_,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(Nu,C&&wu,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"})}),Z(t),b?s.jsxs("div",{className:jr,children:[b,se]}):se]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:p}),le()]})})})})},Au="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",_u="text-secondary dial-small-paragraph-text px-6 pb-4",Ou="px-6 py-4 h-[120px]",ku="Cancel",Ru="Ok",tn={[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=Ru,cancelLabel:o=ku,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:p,onConfirm:h,onCancel:x,children:g,variant:y=it.Info,size:v=We.Sm,footer:b,hideClose:C,...I})=>{const S=i?null:s.jsxs("div",{className:Au,children:[s.jsx(ur,{className:Jt,label:o,onClick:()=>x?x():p?.()}),s.jsx(Xe,{variant:tn[y].confirm.variant,appearance:tn[y].confirm.appearance,className:f.mergeClasses(Jt,u),label:a,disabled:l,onClick:h})]}),N=m.useCallback(()=>i?s.jsx("div",{className:Ou,children:s.jsx(Ve,{size:40})}):g??(t?s.jsx("div",{className:f.mergeClasses(_u,r),children:t}):null),[g,t,i,r]);return s.jsx(ms,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>p?.(),footer:b??S,size:v,hideClose:C??(!i&&b===void 0),children:N()})},Mu="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",Pu="min-w-0 flex-1 truncate text-primary",Bu="min-w-0 flex-1 truncate text-secondary",zu="shrink-0 text-secondary",Fu="px-6 pb-4",Hu="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",$u="Cancel",Ku="Apply",Vu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:p,onClose:h,isValid:x=!0,applyButtonLabel:g=Ku,cancelButtonLabel:y=$u,size:v=We.Md,portalId:b,disabled:C,invalid:I,error:S,caption:N,ariaLabel:j,className:E,fieldClassName:A})=>{const L=m.useId(),D=o??L,w=`${D}-label`,T=`${D}-value`,_=S?`${D}-error`:void 0,B=!S&&N?`${D}-caption`:void 0,[k,R]=m.useState(!1),M=d!==void 0,[H,G]=m.useState(t),V=M?d:H,Z=m.useCallback(()=>{C||(M||G(t),R(!0))},[C,M,t]),se=m.useCallback(()=>{R(!1),h?.()},[h]),re=m.useCallback(()=>{p?.(),se()},[p,se]),le=m.useCallback(()=>{a(V),se()},[a,V,se]),W=m.useCallback(O=>{M||G(O),u?.(O)},[M,u]),K=c.resolveAccessibleName(i?.label),Y=K?void 0:c.resolveAccessibleName(j),ee=K?w:Y&&`${D}-name`,ne=c.resolveAccessibleName(n),pe=e.find(O=>O.value===t)?.label,ve=r??pe;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",E,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:w,htmlFor:D}),s.jsxs("div",{className:"flex flex-col gap-1",children:[Y&&s.jsx("span",{id:ee,className:"sr-only",children:Y}),s.jsxs("button",{type:"button",id:D,disabled:C,"aria-haspopup":"dialog","aria-expanded":k,"aria-labelledby":ee?`${ee} ${T}`:void 0,"aria-describedby":[_,B].filter(Boolean).join(" ")||void 0,onClick:Z,className:f.mergeClasses(Mu,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:T,className:ve==null?Bu:Pu,children:ve??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:zu})]}),s.jsx(c.ErrorText,{id:_,text:S}),!S&&s.jsx(c.CaptionText,{id:B,text:N})]}),s.jsx(ms,{open:k,header:n,ariaLabel:ne?void 0:K,portalId:b,size:v,onClose:re,footer:s.jsxs("div",{className:Hu,children:[s.jsx(ur,{label:y,onClick:re}),s.jsx(is,{label:g,disabled:!x,onClick:le})]}),children:s.jsx("div",{className:Fu,children:s.jsx(jt,{id:`${D}-options`,items:e,value:V,onChange:W,orientation:_e.Column,ariaLabel:K??ne})})})]})},Wu=({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(h=>{a?.(h),n?.(!r)},[a,n,r]),p=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:p}):p},Gu={default:"dial-tiny-text",selected:"dial-tiny-semi-text"},Uu={default:"cursor-not-allowed text-control-disable-primary",selected:"cursor-not-allowed bg-control-disable-primary text-control-disable-primary"},Zu=({label:e,icon:t,isSelected:r=!1,onToggle:n,onClick:a,disabled:o=!1,className:i,title:l,...d})=>{const u=m.useCallback(h=>{a?.(h),!h.defaultPrevented&&n?.(!r)},[a,n,r]),p=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(oa,Gu[p],o?Uu[p]:[ia[Se.Selectable][p],la,ca],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})]})},qu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Yu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Xu="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",Ju="bg-transparent text-secondary",ef="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",tf="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",rf="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",sf="cursor-not-allowed bg-transparent text-control-disable-primary",nf=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=m.useRef({}),d=e.find(h=>h.value===t),u=d&&!d.disabled?d.value:e.find(h=>!h.disabled)?.value,p=m.useCallback(h=>{if(n||!qu.includes(h.key))return;const x=e.filter(C=>!C.disabled);if(x.length===0)return;const g=Math.max(x.findIndex(C=>C.value===t),0),y=x.length-1;let v=g;switch(h.key){case"ArrowRight":case"ArrowDown":v=g===y?0:g+1;break;case"ArrowLeft":case"ArrowUp":v=g===0?y:g-1;break;case"Home":v=0;break;case"End":v=y;break}h.preventDefault();const b=x[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:p,className:f.mergeClasses(Yu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(h=>{const x=h.value===t,g=n||h.disabled;return s.jsxs("button",{ref:y=>{l.current[h.value]=y},type:"button",role:"radio","aria-checked":x,"aria-label":c.resolveAccessibleName(h["aria-label"],typeof h.label=="string"?h.label:void 0),tabIndex:h.value===u?0:-1,disabled:g,onClick:()=>r(h.value),className:f.mergeClasses(Xu,x?Qu:Ju,g?x?rf:sf:x?ef:tf,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[h.icon,h.label]},h.value)})})},af={[ot.Error]:"Error",[ot.Warning]:"Warning"},of={[Ge.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ge.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},lf=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ge.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const p=m.useRef({}),h=m.useId(),x=n===Ge.Vertical,g=e.find(C=>C.id===t),y=g&&!g.disabled?g.id:e.find(C=>!C.disabled)?.id,v=m.useCallback(C=>{const{next:I,previous:S}=of[n];if(![I,S,"Home","End"].includes(C.key)||e.length===0)return;const N=e.filter(D=>!D.disabled);if(N.length===0)return;const j=Math.max(N.findIndex(D=>D.id===t),0),E=N.length-1;let A=j;C.key===I?A=j===E?0:j+1:C.key===S?A=j===0?E:j-1:C.key==="Home"?A=0:A=E,C.preventDefault();const L=N[A];p.current[L.id]?.focus(),L.id!==t&&r(L.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":x?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?h:void 0,onKeyDown:v,className:f.mergeClasses(x?"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:N=>{p.current[C.id]=N},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",x?["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&&(x?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(x?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(x&&!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",x&&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??af[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",x&&"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",x?"px-4":"px-3"),children:s.jsx("span",{id:h,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},cf="flex flex-nowrap items-center gap-1",df="min-w-max flex-1 justify-center",uf=({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(cf,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&&df,o)},d.value))}),Mr=(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})},ff=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:p,ariaLabel:h,className:x})=>{const g=m.useId(),y=p??`file-dropzone-${g}`,v=d?`${y}-error`:void 0,[b,C]=m.useState(!1),I=m.useRef(0),S=m.useCallback(w=>{if(w.length===0)return;const T=i?w:w.slice(0,1),_=T.filter(k=>Mr(k,o)),B=T.filter(k=>!Mr(k,o));B.length>0&&a?.(B),_.length>0&&n(_)},[o,i,n,a]),N=m.useCallback(w=>{S(Array.from(w.target.files??[])),w.target.value=""},[S]),j=m.useCallback(()=>{I.current=0,C(!1)},[]),E=m.useCallback(w=>{l||(w.preventDefault(),I.current+=1,C(!0))},[l]),A=m.useCallback(w=>{l||(w.preventDefault(),w.dataTransfer.dropEffect="copy")},[l]),L=m.useCallback(()=>{l||(I.current-=1,I.current<=0&&j())},[l,j]),D=m.useCallback(w=>{w.preventDefault(),!l&&(j(),S(Array.from(w.dataTransfer?.files??[])))},[l,j,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:N,"aria-label":c.resolveAccessibleName(typeof t!="string"?h:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:E,onDragOver:A,onDragLeave:L,onDrop:D,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",x,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})]})},Da=({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 pf={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"]},hf=new Map(Object.entries(pf).flatMap(([e,t])=>t.map(r=>[r,e]))),mf=e=>hf.get(e)??"other",rn="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)"},gf="#1B212D",xf={[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:gf}},[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}},bf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=xf[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:rn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:rn}),!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})]})})]})},vf=({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)"})]})})]})},yf=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Cf=(e,t)=>e===Ae.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",If=(e,t,r)=>e===Ae.Folder?s.jsx(vf,{size:r}):s.jsx(bf,{size:r,kind:mf(t)}),gs=({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:p,sharedIndicatorTooltip:h})=>{if(e!==Ae.File&&e!==Ae.Folder)return null;const x=e===Ae.File?yf(t,r):"",g=Cf(e,x),y=d??(n?`${g}, shared`:g),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}):If(e,x,o),n&&s.jsx(Da,{tooltip:h,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",p)})]})},Ta=({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:p,nameClassName:h,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,sharedLabel:y="Shared",hideTooltip:v=!1,tooltipContent:b})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",p,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(gs,{name:e,type:t,fileExtension:r,shared:a,loading:o,loadingLabel:i,size:l,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,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",h),text:e,hideTooltip:v,customTooltipContent:b}),a&&s.jsx("span",{className:"sr-only",children:y}),d]})]}),Sf=({className:e,...t})=>s.jsx(Ta,{...t,type:Ae.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),Nf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:p,headerClassName:h,style:x,overlayStyle:g,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${m.useId()}`,{refs:S,context:N}=P.useFloating({open:e,onOpenChange:L=>{L||t()}}),j=P.useRole(N,{role:"dialog"}),E=P.useDismiss(N,{outsidePress:l}),{getFloatingProps:A}=P.useInteractions([j,E]);return e?s.jsx(P.FloatingPortal,{id:b,children:s.jsx(P.FloatingOverlay,{lockScroll:!0,style:g,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,p,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(P.FloatingFocusManager,{context:N,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:x,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",h),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 Ea={[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"}},jf=e=>{const t=Object.values(Ea);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},sn=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",La=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(sn(t[0])+sn(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},wf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},Aa=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=lt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:p})=>{const[h,x]=m.useState(),g=!!r&&h!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",wf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(g)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{x(r),p?.(I)}});const{background:b,foreground:C}=i??jf(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??La(e)})})};var he=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(he||{});const Df={[he.Model]:"Model",[he.Agent]:"Agent",[he.Toolset]:"Toolset",[he.Skill]:"Skill",[he.Prompt]:"Prompt"},nn={[he.Model]:"text-blue",[he.Agent]:"text-green-1",[he.Toolset]:"text-brown-2",[he.Skill]:"text-violet-1",[he.Prompt]:"text-violet-2"},Tf={[he.Model]:"bg-blue",[he.Agent]:"bg-green-2",[he.Toolset]:"bg-brown",[he.Skill]:"bg-violet-2",[he.Prompt]:"bg-violet-1"},Ef=["h1","h2","h3","h4","h5","h6"],Lf=e=>Ef[Math.min(6,Math.max(1,Math.round(e)))-1],_a=({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:p,nameClassName:h="dial-h3-text",typeClassName:x="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=Lf(i),C=a&&!!e.isFeatured,I=u!=null||C,S=n?e.version:void 0,N=r?t?.type??Df[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",p,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(Aa,{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||N)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[N&&s.jsx("span",{className:f.mergeClasses("uppercase",x,nn[e.type]),children:N}),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",Tf[e.type],nn[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",h),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",g),text:S})]}),d!=null&&d]})]})},wr="bg-control-neutral-active",Af=({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})]})]}),_f=({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:p})=>{const h=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,x=()=>e?r?s.jsx(Af,{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}),h]}):s.jsx(_a,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:h}):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",p,c.DIAL_KIT_CLASS.selectedEntityCard),children:x()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Of=({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:p=!1,closeOnOutsideClick:h=!0,children:x,className:g,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:S,portalId:N})=>{const j=c.useThemeScope(),E=`side-drawer-title-${m.useId()}`,A=typeof r=="string",{refs:L,context:D}=P.useFloating({open:e,onOpenChange:k=>{k||t()}}),w=P.useRole(D,{role:"dialog"}),T=P.useDismiss(D,{outsidePress:h}),{getFloatingProps:_}=P.useInteractions([w,T]),B=r!=null||o!=null||!p;return s.jsx(P.FloatingPortal,{id:N,children:s.jsx(P.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",j,y),children:s.jsx(P.FloatingFocusManager,{context:D,disabled:!e,initialFocus:L.floating,children:s.jsxs("div",{ref:L.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":A?E: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",g,c.DIAL_KIT_CLASS.sideDrawer),children:[B&&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:E,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,!p&&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:x})]})})})})},kf=4,Rf=24,an=e=>parseFloat(e)||0,Mf=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},Pf=()=>{},Bf=({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:p=!1,collapseTagOverflow:h=!1,ariaLabel:x,tagListLabel:g="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=m.useId(),S=e||I,N=n===c.ElementSize.Small,j=m.useRef(null),E=m.useRef([]),A=m.useRef(null),L=t!==void 0,[D,w]=m.useState(r??[]),T=L?t:D,_=T.length,[B,k]=m.useState(""),[R,M]=m.useState(_),H=!p&&!u,G=m.useCallback(O=>{L||w(O),C?.(O)},[L,C]),V=m.useCallback(O=>U=>{E.current[O]=U},[]),Z=m.useCallback(()=>{const O=j.current;if(!O||O.clientWidth===0){M(T.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(O);M(aa({availableWidth:O.clientWidth-an(U)-an(de)-(p?0:Rf),tagWidths:T.map((ae,ge)=>E.current[ge]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:kf}))},[p,T]);m.useEffect(()=>{if(!h){M(_);return}const O=j.current;if(!O)return;const U=new ResizeObserver(()=>Z());return U.observe(O),Z(),()=>U.disconnect()},[h,Z,_]);const se=f.mergeClasses(h?"shrink-0":"min-w-0",b),re=O=>{const U=Mf(O.trim()).trim();!U||T.includes(U)||G([...T,U])},le=O=>{G(T.filter(U=>U!==O))},W=()=>{re(B),k("")},K=O=>{if(H){if(O.key==="Enter"||O.key===","){O.preventDefault(),W();return}O.key==="Backspace"&&!B&&_>0&&(O.preventDefault(),G(T.slice(0,-1)))}},Y=()=>{H&&B.trim()&&W()},ee=h?T.slice(0,R):T,ne=h?T.slice(R):[],pe=ne.join(", "),ve=_>0&&s.jsxs("span",{role:"list","aria-label":g,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",h?"flex-nowrap":"flex-wrap"),children:[ee.map(O=>s.jsx(Le,{role:"listitem",label:O,className:se,disabled:u,closable:H,onRemove:H?()=>le(O):void 0},O)),ne.length>0&&s.jsx(Le,{role:"listitem",label:`+${ne.length}`,"aria-label":pe,title:pe,className:f.mergeClasses("shrink-0",b),disabled:u}),h&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[T.map((O,U)=>s.jsx("span",{ref:V(U),className:"inline-flex",children:s.jsx(Le,{label:O,className:b,disabled:u,closable:H,onRemove:H?Pf:void 0})},O)),s.jsx("span",{ref:A,className:"inline-flex",children:s.jsx(Le,{label:`+${_}`,className:b})})]})]});return s.jsx(c.Input,{id:S,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:p,value:B,placeholder:_>0?void 0:o,"aria-label":x,wrapperRef:j,onChange:O=>k(O??""),onKeyDown:K,onBlur:Y,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(_>0&&["!h-auto",N?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",h?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",h?"min-w-[24px]":"min-w-[100px]",p&&"cursor-default"),children:ve})},zf=(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))},Ff=5,Hf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=Ff,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:p,invalid:h=!1,disabled:x=!1,readOnly:g=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:S,listClassName:N,onChange:j})=>{const E=m.useId(),A=e||E,L=`${A}-listbox`,D=c.useThemeScope(),w=i===c.ElementSize.Small,T=t!==void 0,[_,B]=m.useState(r??[]),k=T?t:_,R=k.length>0,M=!g&&!x,[H,G]=m.useState(""),[V,Z]=m.useState(!1),[se,re]=m.useState(0),le=!H.trim(),W=m.useMemo(()=>zf(n,H,k,o&&le?n.length:a),[H,le,a,o,n,k]),K=V&&M&&W.length>0,Y=Math.min(se,W.length-1),ee=K&&Y>=0,ne=J=>`${L}-option-${J}`,{refs:pe,floatingStyles:ve}=P.useFloating({open:K,placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(c.overlayGap),P.flip({padding:c.overlayGap}),P.size({padding:c.overlayGap,apply({rects:J,availableHeight:ce,elements:me}){me.floating.style.width=`${Math.round(J.reference.width)}px`,me.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),O=m.useCallback(J=>{T||B(J),j?.(J)},[T,j]),U=()=>{Z(!1),re(0)},de=()=>{!o||!M||(Z(!0),re(le?-1:0))},ae=J=>{const ce=J.trim();ce&&!k.includes(ce)&&O([...k,ce]),G(""),o?re(-1):U()},ge=J=>O(k.filter(ce=>ce!==J)),Qe=J=>{const ce=J??"",me=!!ce.trim();G(ce),Z(me||o),re(me?0:-1)},ft=J=>{if(M)switch(J.key){case"ArrowDown":case"ArrowUp":{if(J.preventDefault(),!K){Z(!0),re(0);return}const ce=J.key==="ArrowDown"?1:-1,me=Y<0?Math.min(-ce,0):Y;re((me+ce+W.length)%W.length);return}case"Enter":case",":J.preventDefault(),ae(ee?W[Y].value:H);return;case"Escape":K&&J.preventDefault(),U();return;case"Backspace":!H&&R&&(J.preventDefault(),O(k.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":K,"aria-controls":L,"aria-activedescendant":ee?ne(Y):void 0,"aria-invalid":h||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:p,invalid:h,disabled:x,readOnly:g,value:H,placeholder:R?void 0:d,wrapperRef:pe.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",w?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:k.map(J=>s.jsx(Le,{role:"listitem",label:J,className:f.mergeClasses(Xt,"min-w-0",S),disabled:x,closable:M,removeLabel:b?.(J),onRemove:M?()=>ge(J):void 0},J))})}),s.jsx(P.FloatingPortal,{children:s.jsx("div",{ref:pe.setFloating,id:L,role:"listbox","aria-label":v,hidden:!K,style:ve,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!K&&"hidden",D,N),children:K&&W.map((J,ce)=>{const me=ce===Y;return s.jsx(c.MenuItem,{id:ne(ce),role:"option","aria-selected":me,tabIndex:-1,label:J.label,description:J.description,mark:c.MenuItemMark.Tint,selected:me,onMouseDown:pt,onMouseEnter:()=>re(ce),onClick:()=>ae(J.value)},J.value)})})})]})},$f=(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,Kf=(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)))},Vf=12,on=e=>`calc(${e}% + ${(.5-e/100)*Vf}px)`,Wf=(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)]",Gf=({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:p=!1,showTicks:h=!1,leftContent:x,rightContent:g,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:S,trackClassName:N,fillClassName:j,className:E,...A})=>{const L=m.useId(),D=e??L,w=b&&!C?`${D}-caption`:void 0,T=C?`${D}-error`:void 0,_=n-r,B=_>0?Math.min(100,Math.max(0,(t-r)/_*100)):0,k=on(B),R=h&&!o?$f(_,a):[],M=p&&!o,H=x!=null,G=y||g!=null,V=Oa(a),[Z,se]=m.useState(null),re=d?d(t):t.toFixed(V),le=m.useCallback(Y=>{I?.(Number(Y.target.value))},[I]),W=m.useCallback(Y=>{const ee=Y==null?"":String(Y);se(ee);const ne=Number(ee);ee!==""&&Number.isFinite(ne)&&I?.(Kf(ne,r,n,a))},[n,r,I,a]),K=m.useCallback(()=>se(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:D}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:re})]}),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",Wf(H,G),M&&"mt-2"),children:[H&&s.jsx("div",{className:"flex items-center",children:x}),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",N)}),R.map(Y=>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:on(Y)}},Y)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",j),style:{width:k}}),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:k},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:re}),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:D,value:t,min:r,max:n,step:a,disabled:o,onChange:le,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?A["aria-label"]:void 0),"aria-valuetext":d?re:void 0,"aria-describedby":T??w,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",E)})]}),G&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(us,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:Z??t.toFixed(V),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:W,onBlur:K}):g}),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:T,text:C}),!C&&s.jsx(c.CaptionText,{id:w,text:b})]})]})},Uf=48,Zf=({children:e,title:t,width:r=280,collapsedWidth:n=Uf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:p="Expand sidebar",className:h,titleClassName:x,contentClassName:g,footerClassName:y})=>{const v=a!==void 0,[b,C]=m.useState(o),I=v?a:b,S=`collapsible-sidebar-content-${m.useId()}`,N=I?u:p,j=E=>{const A=!I;v||C(A),i?.(A,E)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",h,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",g),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",x),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:j,"aria-label":N,"aria-expanded":I,"aria-controls":S,tooltipProps:{tooltip:N},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)},ln={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},cn={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Bt={width:"20px",height:"20px",position:"absolute",zIndex:1},qf={top:ie(ie({},ln),{top:"-5px"}),right:ie(ie({},cn),{left:void 0,right:"-5px"}),bottom:ie(ie({},ln),{top:void 0,bottom:"-5px"}),left:ie(ie({},cn),{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"})},Yf=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"},qf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Xf=(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)},dn=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)},Jf=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},un=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},Dr=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},ep=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)}},tp=function(e){return Array.isArray(e)?e:[e,e]},rp=["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"],fn="__resizable_base__",sp=(function(e){Xf(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(fn):u.className+=fn,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(),p=Number(r.state[l].toString().replace("px","")),h=p/u[l]*100;return"".concat(h,"%")}return Dr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?Dr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?Dr(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 p=this.parentNode;p&&(d=i?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:p.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=tp(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,p=d.original,h=this.props,x=h.lockAspectRatio,g=h.lockAspectRatioExtraHeight,y=h.lockAspectRatioExtraWidth,v=p.width,b=p.height,C=g||0,I=y||0;return rt("right",u)&&(v=p.width+(r-p.x)*i/a,x&&(b=(v-I)/this.ratio+C)),rt("left",u)&&(v=p.width-(r-p.x)*i/a,x&&(b=(v-I)/this.ratio+C)),rt("bottom",u)&&(b=p.height+(n-p.y)*l/a,x&&(v=(b-C)*this.ratio+I)),rt("top",u)&&(b=p.height-(n-p.y)*l/a,x&&(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,p=typeof o.width>"u"?10:o.width,h=typeof a.width>"u"||a.width<0?r:a.width,x=typeof o.height>"u"?10:o.height,g=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(x-y)*this.ratio+v,C=(g-y)*this.ratio+v,I=(p-v)/this.ratio+y,S=(h-v)/this.ratio+y,N=Math.max(p,b),j=Math.min(h,C),E=Math.max(x,I),A=Math.min(g,S);r=zt(r,N,j),n=zt(n,E,A)}else r=zt(r,p,h),n=zt(n,x,g);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,p=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=p*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&Jf(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 p=this.window.getComputedStyle(u).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={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(h)}},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,p=Ft(r)?r.touches[0].clientY:r.clientY,h=this.state,x=h.direction,g=h.original,y=h.width,v=h.height,b=this.getParentSize(),C=ep(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,p),S=I.newHeight,N=I.newWidth,j=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(N=un(N,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=un(S,this.props.snap.y,this.props.snapGap));var E=this.calculateNewSizeFromAspectRatio(N,S,{width:j.maxWidth,height:j.maxHeight},{width:l,height:d});if(N=E.newWidth,S=E.newHeight,this.props.grid){var A=dn(N,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),L=dn(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,w=D===0||Math.abs(A-N)<=D?A:N,T=D===0||Math.abs(L-S)<=D?L:S;N=w,S=T}var _={width:N-g.width,height:S-g.height};if(this.delta=_,y&&typeof y=="string"){if(y.endsWith("%")){var B=N/b.width*100;N="".concat(B,"%")}else if(y.endsWith("vw")){var k=N/this.window.innerWidth*100;N="".concat(k,"vw")}else if(y.endsWith("vh")){var R=N/this.window.innerHeight*100;N="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var B=S/b.height*100;S="".concat(B,"%")}else if(v.endsWith("vw")){var k=S/this.window.innerWidth*100;S="".concat(k,"vw")}else if(v.endsWith("vh")){var R=S/this.window.innerHeight*100;S="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(N,"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,G=this.state.height!==M.height,V=this.state.flexBasis!==M.flexBasis,Z=H||G||V;Z&&Ua.flushSync(function(){n.setState(M)}),this.props.onResize&&Z&&this.props.onResize(r,x,this.resizable,_)}},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 p=Object.keys(a).map(function(h){return a[h]!==!1?s.jsx(Yf,{direction:h,onResizeStart:r.onResizeStart,replaceStyles:o&&o[h],className:i&&i[h],children:u&&u[h]?u[h]:null},h):null});return s.jsx("div",{className:d,style:l,children:p})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return rp.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 np=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const p=e===It.Left,h=p?F.IconChevronLeft:F.IconChevronRight,x=g=>{let y;switch(g.key){case"ArrowLeft":y=r+(p?o:-o);break;case"ArrowRight":y=r+(p?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}g.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:x,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(h,{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",p?"right-full":"left-full")})})},ap=16,ka=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=It.Right,keyboardStep:d=ap,ariaLabel:u="Resize panel",className:p,resizeHandlerClassName:h,resizeHandler:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(a??t),C=n!==void 0,I=C?n:v,S=m.useRef(null),N=m.useCallback(()=>{y(!0)},[]),j=m.useCallback(()=>{y(!1);const L=S.current?.resizable?.getBoundingClientRect(),D=L?Math.round(L.width):t;C||b(D),o?.(D)},[o,C,t]),E=m.useCallback(L=>{const D=Math.min(r,Math.max(t,L));D!==I&&(C||(b(D),S.current?.updateSize({width:D,height:"100%"})),i?.(D),o?.(D))},[r,t,I,C,i,o]),A=m.useMemo(()=>{const L=l===It.Left,D=s.jsx(np,{side:l,isResizing:g,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:E,customHandler:x,handlerClassName:h});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:L,right:!L},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:L?D:void 0,right:L?void 0:D},onResizeStart:N,onResize:(w,T,_)=>{i?.(Math.round(_.offsetWidth))},onResizeStop:j}},[l,C,I,t,r,d,u,E,x,h,g,N,j,i]);return s.jsx(sp,{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",p,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},op=16,ip=1e3,lp=4,Tr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",cp=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=op,className:d})=>{const[u,p]=m.useState(!1),[h,x]=m.useState(!1),[g,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),N=m.useRef(void 0);m.useEffect(()=>()=>{clearTimeout(S.current),N.current!=null&&cancelAnimationFrame(N.current)},[]);const j=m.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),E=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(()=>x(!0),ip)},L=R=>{E(R),A(R)},D=()=>{y(!1),clearTimeout(S.current),x(!1)},w=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},p(!0))},T=R=>{E(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>lp&&(x(!1),A(R));return}const H=Tr(v.current)?-1:1,G=j(M.width+(R.clientX-M.x)*H);N.current!=null&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame(()=>a(G))},_=R=>{I.current!=null&&(I.current=null,p(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},B=R=>{const M=Tr(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(j(H))},k=()=>{n!=null&&a(j(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",g&&"dial-resize-handle-cursor-ready",h&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:L,onPointerLeave:D,onPointerDown:w,onPointerMove:T,onPointerUp:_,onPointerCancel:_,onKeyDown:B,onDoubleClick:k,children:s.jsx(c.Tooltip,{tooltip:i,open:h&&!u,placement:Tr(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})})})})},dp=({enabled:e=!0,children:t,...r})=>e?s.jsx(ka,{...r,children:t}):t,Ra=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i,announce:l})=>{const d=m.useId(),u=s.jsxs("section",{"aria-labelledby":d,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:d,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})]});return l==null?u:s.jsx(c.LiveRegion,{politeness:l,className:"size-full",children:u})};class up extends m.Component{state={hasError:!1};static getDerivedStateFromError=()=>({hasError:!0});componentDidCatch(t,r){this.props.onCatch(t,r)}render(){return this.state.hasError?null:this.props.children}}const fp=s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE}),pp=(e=[],t=[])=>e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n])),hp=({children:e,title:t,description:r,actionLabel:n,onReset:a,resetKeys:o,onError:i,icon:l=fp,className:d})=>{const[u,p]=m.useState(!1),h=m.useRef(o);m.useEffect(()=>{u&&pp(h.current,o)&&p(!1),h.current=o},[u,o]);const x=(y,v)=>{p(!0),i?.(y,v)},g=()=>{if(!a){window.location.reload();return}a(),p(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(c.LiveRegion,{politeness:c.LiveRegionPoliteness.Assertive,visuallyHidden:!0,children:u&&t}),u?s.jsx(Ra,{icon:l,title:t,description:r,className:d,action:s.jsx(is,{autoFocus:!0,label:n,onClick:g})}):s.jsx(up,{onCatch:x,children:e})]})},pn=({src:e,className:t})=>{const[r,n]=m.useState();return r===e?null:s.jsx("img",{src:e,alt:"","aria-hidden":"true",className:t,onError:()=>n(e)})},mp=({title:e,description:t,logoSrc:r,providers:n=[],providersLabel:a,children:o,titleRef:i,className:l})=>{const d=m.useId();return s.jsxs("section",{"aria-labelledby":d,className:f.mergeClasses("relative flex size-full items-center justify-center overflow-hidden bg-layer-sunken mobile:items-start mobile:bg-layer-raised mobile:px-6",l,c.DIAL_KIT_CLASS.loginScreen),children:[s.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[s.jsx("div",{className:"absolute -start-1/4 -bottom-1/3 size-[80vmax] rounded-full bg-radial from-gradient-2 to-transparent to-70% opacity-20 blur-3xl"}),s.jsx("div",{className:"absolute -end-1/4 -top-1/3 size-[80vmax] rounded-full bg-radial from-gradient-1 to-transparent to-70% opacity-20 blur-3xl"})]}),s.jsxs("div",{className:"relative mx-6 my-8 flex flex-col items-center gap-12 rounded-xl bg-layer-raised p-16 mobile:mx-0 mobile:mt-10 mobile:w-full mobile:rounded-none mobile:bg-transparent mobile:p-0",children:[r&&s.jsx(pn,{src:r,className:"size-8 shrink-0 object-contain"}),s.jsxs("div",{className:"flex w-full flex-col items-center gap-8 mobile:gap-6",children:[s.jsx("h1",{id:d,ref:i,tabIndex:-1,className:"dial-display2-text text-center text-primary",children:e}),s.jsxs("div",{className:"flex w-full flex-col items-center gap-5 desktop:w-100",children:[o,n.length>0&&s.jsxs(s.Fragment,{children:[t!=null&&s.jsx("p",{className:"dial-body-text text-center text-primary",children:t}),s.jsx("ul",{"aria-label":a,className:"m-0 flex w-full list-none flex-col gap-3 p-0",children:n.map(u=>s.jsx("li",{children:s.jsx(ur,{href:u.href,label:u.label,iconBefore:u.iconSrc?s.jsx(pn,{src:u.iconSrc,className:"size-5 shrink-0"}):void 0,className:"w-full"})},u.id))})]})]})]})]})]})};var at=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(at||{});const gp={[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"}},xp=({title:e,action:t,description:r,variant:n=at.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const p=m.useId(),h=gp[n],x=`h${a}`;return s.jsxs("section",{"aria-labelledby":p,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",h.header),children:[s.jsx(x,{id:p,className:f.mergeClasses("min-w-0 text-primary",h.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",h.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var we=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(we||{});const Ma=8e3,Dt="flex size-7 shrink-0 items-center justify-center",Pa={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"},bp=({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})]})]})},hn=({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})})})},Pr=2,Br=(f.DIAL_ICON_SIZE.SM-Pr)/2,mn=2*Math.PI*Br,vp=({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:Br,fill:"none",strokeWidth:Pr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Br,fill:"none",strokeWidth:Pr,strokeLinecap:"round",strokeDasharray:mn,strokeDashoffset:mn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},yp=({item:e,labels:t,onCancel:r})=>{const n=e.status===we.Canceled,a=f.mergeClasses("pointer-events-none col-start-1 row-start-1 transition-opacity",r&&"group-focus-within:opacity-0 group-hover:opacity-0");return s.jsxs("div",{className:"group flex items-center gap-2 px-4 py-2",children:[s.jsx(gs,{type:Ae.File,name:e.name,size:f.DIAL_ICON_SIZE.MD,className:f.mergeClasses(n&&"opacity-50"),decorative:!0}),s.jsx(c.EllipsisTooltip,{text:e.name,className:f.mergeClasses("dial-small-text",n?"text-secondary":"text-primary")}),e.status===we.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(vp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(Ve,{size:f.DIAL_ICON_SIZE.SM,ariaLabel:t.itemProgressAriaLabel(e.name),className:a}),r&&s.jsx(c.GhostIconButton,{"aria-label":t.cancelItemAriaLabel(e.name),size:c.ElementSize.Small,icon:s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,className:"text-secondary","aria-hidden":!0}),onClick:()=>r(e.id),className:"col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"})]}),e.status===we.Success&&s.jsx("span",{className: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===we.Warning&&s.jsx(hn,{message:e.message||t.warningMessage,isError:!1}),e.status===we.Failed&&s.jsx(hn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Cp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===we.InProgress?0:100)),0)/e.length),Ip=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,Sp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=Ma,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[p,h]=m.useState(!1),x=m.useId(),g={...Pa,...a},y=t.filter(j=>j.status===we.InProgress).length,v=y>0,b=t.some(j=>j.status===we.Failed),C=t.length>0&&t.every(j=>j.status===we.Success),I=m.useCallback(()=>{v?h(!0):r()},[v,r]),S=m.useCallback(()=>{h(!1),r()},[r]),N=m.useCallback(()=>{u(j=>!j)},[]);return m.useEffect(()=>{if(!C||o<=0)return;const j=setTimeout(r,o);return()=>clearTimeout(j)},[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(bp,{title:e,isCollapsed:d,itemsId:x,labels:g,onToggleCollapse:N,onClose:I}),d&&v&&s.jsx(yn,{value:Cp(t),size:c.ElementSize.Small,"aria-label":g.queueProgressAriaLabel,"aria-valuetext":g.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:x,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(j=>s.jsx(yp,{item:j,labels:g,onCancel:n},j.id))}),s.jsx(wa,{open:p,header:g.closeConfirmHeader,description:Ip(b,g),confirmLabel:g.closeConfirmLabel,cancelLabel:g.closeCancelLabel,variant:it.Danger,onConfirm:S,onClose:()=>h(!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=gn.EditorThemes;exports.LazyMarkdownEditor=gn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Ea;exports.Accordion=Sa;exports.AccordionCaretPosition=Qt;exports.AnalyticsBar=Vt;exports.AnalyticsBarGroup=mu;exports.AnalyticsCard=fu;exports.AnalyticsCardVariant=wt;exports.AnalyticsHistogram=yu;exports.AutocompleteTagInput=Hf;exports.Avatar=Aa;exports.AvatarColor=Pe;exports.AvatarShape=lt;exports.Badge=ps;exports.BadgeColor=je;exports.BadgeVariant=Oe;exports.BottomSheet=Nf;exports.Breadcrumbs=Jd;exports.BreadcrumbsSize=Ze;exports.Button=Xe;exports.ButtonDropdown=ru;exports.Calendar=Bd;exports.CalendarMode=xe;exports.CardShell=rd;exports.CollapsibleSidebar=Zf;exports.ConditionalResizableContainer=dp;exports.ConfirmationPopup=wa;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=hs;exports.DEFAULT_TRANSFER_QUEUE_LABELS=Pa;exports.DangerButton=Ec;exports.DialAccordion=eo;exports.DialBreadcrumb=Eo;exports.DialBreadcrumbItem=xt;exports.DialButton=Et;exports.DialCaptionText=zr;exports.DialCloseButton=Nn;exports.DialDangerButton=An;exports.DialDangerIconButton=In;exports.DialDropdown=Gt;exports.DialEllipsisTooltip=er;exports.DialErrorText=Fe;exports.DialFileNodeType=ze;exports.DialFilePermission=Qn;exports.DialFileResourceType=ts;exports.DialGhostButton=Ao;exports.DialGhostIconButton=Sn;exports.DialIconButton=Tt;exports.DialInput=On;exports.DialItemType=Ae;exports.DialLabel=Kr;exports.DialLabelledText=io;exports.DialLinkButton=Lo;exports.DialLoadFileArea=Yn;exports.DialLoadFileAreaField=Gl;exports.DialLoader=no;exports.DialNeutralButton=Ln;exports.DialNeutralIconButton=bo;exports.DialNoDataContent=oo;exports.DialPrimaryButton=Gr;exports.DialPrimaryIconButton=xo;exports.DialRemoveButton=_n;exports.DialSecondaryIconButton=vo;exports.DialSuccessIconButton=Co;exports.DialTabs=wo;exports.DialTag=co;exports.DialTertiaryIconButton=yo;exports.DialTooltip=qe;exports.DialTooltipContainer=Fr;exports.DialTooltipContent=Hr;exports.DialTooltipTrigger=$r;exports.EDITABLE_CONTAINER_ATTRIBUTE=es;exports.EntityIdentity=_a;exports.EntityType=he;exports.ErrorBoundary=hp;exports.ErrorMessageNotification=cd;exports.ErrorToastNotification=sd;exports.FabButton=eu;exports.FileDropzone=ff;exports.FileIcon=gs;exports.FileName=Ta;exports.FilterChips=uf;exports.FlexibleActionsDirection=Xn;exports.FolderName=Sf;exports.FolderPath=Fd;exports.FormSection=xp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=hd;exports.GeneralToastNotification=ld;exports.GhostButton=ls;exports.InfoMessageNotification=dd;exports.InfoToastNotification=nd;exports.InlineSelect=su;exports.InlineSelectTrigger=Ia;exports.JsonSchemaType=$;exports.LabelledText=Cu;exports.LinkButton=_c;exports.LoadingMessageNotification=pd;exports.LoadingToastNotification=id;exports.LoginScreen=mp;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=rs;exports.NOT_ALLOWED_SPACES_REGEXP=sc;exports.NOT_ALLOWED_SYMBOLS=ea;exports.NOT_ALLOWED_SYMBOLS_REGEXP=rc;exports.NeutralButton=ur;exports.Notification=fs;exports.NotificationSurface=qt;exports.NotificationType=fe;exports.NotificationVariant=X;exports.NumberInput=us;exports.OutlinedButton=Oc;exports.PasswordInput=ua;exports.Popup=ms;exports.PopupSize=We;exports.PrimaryButton=is;exports.ProgressBar=yn;exports.ProgressBarRole=Ct;exports.RadioGroup=jt;exports.RadioGroupOrientation=_e;exports.RadioGroupPopupField=Vu;exports.ResizableContainer=ka;exports.ResizableContainerSide=It;exports.ResizeHandle=cp;exports.SchemaDisplayMode=lr;exports.SchemaOrientation=cr;exports.SchemaRenderer=qc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Ut;exports.SegmentedControl=nf;exports.Select=$e;exports.SelectedEntityCard=_f;exports.SharedEntityIndicator=Da;exports.SideDrawer=Of;exports.Skeleton=$t;exports.SkeletonAvatarShape=Wt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Ee;exports.Slider=Gf;exports.Spinner=Ve;exports.StarterButton=Ac;exports.StateScreen=Ra;exports.StepStatus=be;exports.Steps=iu;exports.SuccessMessageNotification=ud;exports.SuccessToastNotification=ad;exports.Switch=fa;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Ma;exports.TabOrientation=Ge;exports.TabStatus=ot;exports.TabView=Ue;exports.Tabs=lf;exports.Tag=Le;exports.TagAppearance=Se;exports.TagInput=Bf;exports.Textarea=da;exports.TextareaResize=cs;exports.ToggleChip=Zu;exports.ToggleIconButton=Wu;exports.TransferQueue=Sp;exports.TransferQueueItemStatus=we;exports.WarningMessageNotification=fd;exports.WarningToastNotification=od;exports.editableContainerProps=Ul;exports.extractInitials=La;exports.getTimezoneLabel=Jn;exports.matchesAccept=Mr;exports.useEditableItem=Zl;exports.wrapInRootFolder=ec;
4
+ |\r| )|[\0-]`,sc=`[${ra.replace(/\\/g,"\\\\")}]`,nc=new RegExp(`${sc}|${rs}`),ac=new RegExp(rs);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 oc={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 _s(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 p of a)o=o?.[p];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=_s(i,Q(l,t,r+1));n=_s(i,o)}return n}function sa(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 ss=e=>`"${e}" is required`;function na(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 $e(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{...$e(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=$e(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 ze(e,t,r,n="",a=0){if(a>15)return[];const o=[],i=Q(t,r);if(i.anyOf){const u=i.anyOf.filter(p=>p.type!==$.Null);return e!=null&&u.length===1?ze(e,u[0],r,n,a+1):o}if(i.oneOf&&i.discriminator){const u=i.discriminator.propertyName,p=e?.[u];if(p&&i.discriminator.mapping[p]){const h={$ref:i.discriminator.mapping[p]},x=Q(h,r);return ze(e,x,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 p=ze(e[u],i.items,r,`${n}[${u}]`,a+1);o.push(...p)}return o}if(!Ye(i))return o;const l=i.required??[],d=e;for(const u of l){const p=i.properties?.[u];if(p&&Q(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d?.[u];if(dr(x)){const g=p?.title??Yt(u);o.push({path:h,message:ss(g)})}}if(d&&i.properties)for(const[u,p]of Object.entries(i.properties)){if(Q(p,r).isHidden)continue;const h=n?`${n}.${u}`:u,x=d[u];if(x!=null){const g=ze(x,p,r,h,a+1);o.push(...g)}}if(d&&i.additionalProperties!=null&&i.additionalProperties!==!1&&typeof i.additionalProperties=="object"){const u=i.additionalProperties;for(const[p,h]of Object.entries(d)){const x=n?`${n}.${p}`:p,g=ze(h,u,r,x,a+1);o.push(...g)}}return o}function ns(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 ic(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 lc(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 aa(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 cc=[$.String,$.Number,$.Boolean,$.Null,$.Object,$.Array];function dc(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 uc={[$.String]:"",[$.Number]:0,[$.Boolean]:!1,[$.Null]:null,[$.Object]:{},[$.Array]:[]};function fc(e){return uc[e]}const oa=m.createContext(null),Re=()=>{const e=m.useContext(oa);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))},ia=({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 Ne=(e=>(e.Outlined="outlined",e.Selectable="selectable",e.Bordered="bordered",e))(Ne||{});const la="inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3",pc={[Ne.Outlined]:"dial-tiny-text",[Ne.Selectable]:"dial-tiny-text",[Ne.Bordered]:"h-[24px] rounded-md border px-2 dial-small-text"},ca={[Ne.Outlined]:{default:"bg-layer-raised text-primary",selected:"bg-control-accent-alpha text-primary"},[Ne.Selectable]:{default:"text-secondary",selected:"bg-control-accent-alpha text-primary"},[Ne.Bordered]:{default:"border-tertiary bg-layer-sunken text-primary",selected:"border-accent bg-control-accent-alpha text-primary"}},da="cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus",ua="hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",Ae=({label:e,icon:t,appearance:r=Ne.Outlined,selected:n=!1,disabled:a=!1,closable:o=!1,removeLabel:i,className:l,title:d,onClick:u,onRemove:p,onKeyDown:h,...x})=>{const g=r===Ne.Selectable,y=!!u&&!a,v=o&&!!p&&!a,b=g&&n,C=I=>{h?.(I),!(!y||I.defaultPrevented)&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.currentTarget.click())};return s.jsxs("span",{...x,role:y?"button":x.role,tabIndex:y?0:x.tabIndex,"aria-disabled":a||void 0,"aria-pressed":g&&y?n:void 0,onClick:a?void 0:u,onKeyDown:C,className:f.mergeClasses(la,b?"dial-tiny-semi-text":pc[r],ca[r][n?"selected":"default"],a&&"cursor-not-allowed",y&&[da,ua],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(),p?.(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(Ae,{label:o?.label??a,closable:!!r,onRemove:i=>r?.(i,a),icon:o?.icon,className:f.mergeClasses(Xt,n)},a)})}),hc=8,mc=e=>e.stopPropagation(),gc=e=>{e.key!=="Escape"&&e.stopPropagation()},xc=({options:e,selectedValues:t,handleRemoveTag:r})=>{const n=m.useRef(null),a=m.useRef(null),[o,i]=m.useState(null),l=m.useCallback(()=>{const h=n.current,x=a.current;if(!h||!x)return;const g=Array.from(x.children,v=>v.offsetWidth),y=g.pop()??0;i(ia({tagWidths:g,overflowChipWidth:y,availableWidth:h.clientWidth,gap:hc}))},[]);m.useLayoutEffect(()=>{l()},[l,e,t]),m.useLayoutEffect(()=>{const h=n.current;return h?c.observeElementSize(h,l):void 0},[l]);const d=o??t.length,u=t.slice(0,d),p=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"}),p.length>0&&s.jsx(c.InteractiveTooltip,{asChild:!0,placement:c.TooltipPlacement.Bottom,content:s.jsx("div",{className:"flex flex-wrap gap-2",onClick:mc,onKeyDown:gc,children:s.jsx(yt,{options:e,selectedValues:p,handleRemoveTag:r})}),children:s.jsx(Ae,{label:`+${p.length}`,role:"button",tabIndex:0,"aria-haspopup":"true","aria-label":`${p.length} more selected: ${p.map(h=>e.find(x=>x.value===h)?.label??h).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(Ae,{label:`+${t.length}`,className:f.mergeClasses(Xt,"shrink-0")})]})]})},bc=f.mergeClasses("w-full flex flex-col"),vc=c.overlayItemClassName,yc="!max-w-[var(--reference-width)]",Cc=f.mergeClasses("max-h-[344px] overflow-y-auto py-1",c.overlayListClassName),Ic=c.overlayGap,Sc=c.overlaySubMenuListClassName,Nc=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),jc="text-secondary transition-transform",wc=8,Dc=s.jsx(F.IconSearch,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Tc=s.jsx(F.IconX,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Ec=({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:p}=c.useSubMenuFloating(Ic,"listbox",!!e.disabled),h=e.children?.some(g=>t.includes(g.value)),x=s.jsx(c.MenuItem,{ref:i.setReference,role:"option","aria-haspopup":"listbox","aria-expanded":a,"aria-selected":!!h,"aria-disabled":!!e.disabled,disabled:e.disabled,ellipsisLabel:!0,icon:e.icon,label:e.labelNode??e.label,trailing:Nc,...u()});return s.jsxs(P.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:x}):x,a&&s.jsx(c.SubMenuPanel,{refs:i,floatingStyles:l,context:d,getFloatingProps:p,role:"listbox",surfaceClassName:Sc,children:e.children.map(g=>{const y=s.jsx(c.MenuItem,{role:"option","aria-selected":t.includes(g.value),"aria-disabled":!!g.disabled,disabled:g.disabled,mark:r,selected:t.includes(g.value),ellipsisLabel:!0,icon:g.icon,label:g.labelNode??g.label,rightControl:g.rightControl,onClick:()=>!g.disabled&&n(g.value)});return s.jsx(m.Fragment,{children:g.interactiveTooltip?s.jsx(c.InteractiveTooltip,{asChild:!0,placement:g.interactiveTooltip.placement,content:g.interactiveTooltip.content,contentClassName:g.interactiveTooltip.contentClassName,children:y}):y},g.value)})})]})},Ke=({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:p,caption:h,ariaLabel:x,ariaDescribedBy:g,searchable:y=!1,searchSize:v=c.ElementSize.Standard,searchPlaceholder:b,selectAll:C=!1,invalid:I,selectAllLabel:S="Select all",collapseTagOverflow:N=!1,selectedOptionMark:j=c.MenuItemMark.Tint,emptyStateTitle:E="No options available",emptyStateDescription:A,emptyStateIcon:L,disabled:D=!1,className:w,fieldClassName:T,listClassName:_,closable:B=!1,header:k,footer:R,onClose:M,onChange:H,dismissRef:G,onFooterClick:V,open:Z,onOpenChange:se,onSearchQueryChange:re,customMultiSelectTagsRenderer:le})=>{const W=m.useId(),K=r||W,Y=`list-${K}`,ee=p?`${K}-error`:void 0,ne=!p&&h?`${K}-caption`:void 0,he=o===c.ElementSize.Small,[ye,O]=m.useState(!1),U=Z!==void 0,de=U?!!Z:ye,ae=m.useCallback(z=>{U||O(z),se?.(z)},[U,se]),[xe,Qe]=m.useState(""),ft=m.useCallback(z=>{z!==xe&&(Qe(z||""),re?.(z||""))},[re,xe]),pt=n!==void 0,[J,ce]=m.useState(a),ge=pt?n:J,ue=m.useMemo(()=>t?Array.isArray(ge)?ge:[]:typeof ge=="string"?[ge]:[],[ge,t]),Lt=m.useMemo(()=>{const z=xe.trim().toLowerCase();return z?e.filter(oe=>oe.label.toLowerCase().includes(z)):e},[e,xe]);m.useEffect(()=>{de||ft("")},[de,ft]);const Me=m.useCallback(z=>{pt||ce(z),H?.(z)},[pt,H]),fr=m.useCallback(z=>{if(t){const oe=new Set(ue);oe.has(z)?oe.delete(z):oe.add(z),Me(Array.from(oe));return}Me(z),ae(!1)},[t,Me,ae,ue]),At=m.useCallback((z,oe)=>{if(z.stopPropagation(),!t){Me("");return}const kt=ue.filter(Za=>Za!==oe);Me(kt)},[t,ue,Me]),Te=m.useMemo(()=>Lt.filter(z=>!z.disabled),[Lt]),pr=m.useMemo(()=>Te.filter(z=>ue.includes(z.value)).length,[Te,ue]),{allSelectedInFiltered:hr,someSelectedInFiltered:Fa}=m.useMemo(()=>{const z=Te.length>0&&pr===Te.length;return{allSelectedInFiltered:z,someSelectedInFiltered:pr>0&&!z}},[Te,pr]),Ha=m.useCallback(()=>{if(!(!t||Te.length===0))if(hr){const z=new Set(Te.map(oe=>oe.value));Me(ue.filter(oe=>!z.has(oe)))}else{const z=new Set(ue);Te.forEach(oe=>z.add(oe.value)),Me(Array.from(z))}},[hr,t,Te,ue,Me]),_t=ue.length>0,Ot=!t&&_t?ue[0]:void 0,je=m.useMemo(()=>Ot?e.find(z=>z.value===Ot)??e.flatMap(z=>z.children??[]).find(z=>z.value===Ot):void 0,[e,Ot]),ht=je?i?`${i} ${je.label}`:je.label:void 0,$a=c.useIsMobileScreen(),mr=t&&N&&!le&&!$a,mt=m.useMemo(()=>t?_t?mr?s.jsx(xc,{options:e,selectedValues:ue,handleRemoveTag:At}):s.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:le?.(e,ue,At)??s.jsx(yt,{options:e,selectedValues:ue,handleRemoveTag:At})}):null:!je||!je.labelNode&&!je.description?null:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx(c.EllipsisTooltip,{text:je.labelNode??ht}),je.description&&s.jsx("span",{className:"truncate text-secondary dial-tiny-text",children:je.description})]}),[mr,le,At,_t,t,e,ht,ue,je]),Ka=t||mt?"":ht||(l&&n?l:""),Va=typeof u?.label=="string"?u.label:void 0,Wa=mt?[c.resolveAccessibleName(x,Va),t?ue.map(z=>e.find(oe=>oe.value===z)?.label??z).join(", "):ht].filter(Boolean).join(", ")||void 0:c.resolveAccessibleName(x);m.useImperativeHandle(G,()=>({dismiss:()=>{ae(!1)}}));const Ga=m.useCallback(z=>{D||(z.key==="ArrowDown"||z.key==="ArrowUp")&&(z.preventDefault(),de||ae(!0))},[D,de,ae]),Ua=()=>s.jsxs("div",{id:Y,role:"listbox","aria-multiselectable":t||void 0,className:bc,children:[k&&s.jsx(s.Fragment,{children:typeof k=="function"?k():k}),(y||B)&&(e.length>wc||!!xe)&&s.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[y&&s.jsx(c.Input,{id:`search-${K}`,size:v,placeholder:b,"aria-label":b||"Search options",onChange:z=>ft(z),value:xe,iconBefore:Dc,containerClassName:"w-full"}),B&&s.jsx(c.GhostIconButton,{"aria-label":"Close select",className:"shrink-0",size:c.ElementSize.Small,icon:Tc,onClick:z=>{M?.(z),ae(!1)}})]}),t&&C&&Te.length>0&&s.jsx("div",{className:f.mergeClasses(vc,"mt-2"),children:s.jsx(c.Checkbox,{id:`${K}-selectAll`,labelProps:{label:S},isSelected:hr,isIndeterminate:Fa,onChange:Ha})}),s.jsx("div",{role:"none",className:Cc,children:Lt.length===0?s.jsx("div",{className:"px-2 py-3",children:s.jsx(c.NoDataContent,{icon:L,title:E,description:A})}):Lt.map(z=>{const oe=ue.includes(z.value);if(z.children?.length)return s.jsx(Ec,{opt:z,selectedValues:ue,mark:t?c.MenuItemMark.Checkbox:j,onSelect:fr},z.value);const kt=t?s.jsx(c.MenuItem,{id:`${K}-${z.value}`,role:"option","aria-selected":oe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:c.MenuItemMark.Checkbox,selected:oe,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>fr(z.value)}):s.jsx(c.MenuItem,{role:"option","aria-selected":oe,"aria-disabled":!!z.disabled,disabled:z.disabled,mark:j,selected:oe,ellipsisLabel:!0,icon:z.icon,label:z.labelNode??z.label,description:z.description,rightControl:z.rightControl,onClick:()=>!z.disabled&&fr(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=>{V?.(z),V&&ae(!1)},children:typeof R=="function"?R():R})]});return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",w,c.DIAL_KIT_CLASS.select),children:[u&&s.jsx(c.Label,{...u,htmlFor:K}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(c.Dropdown,{open:de,onOpenChange:ae,disabled:D,closable:B,onClose:M,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],listClassName:f.mergeClasses(yc,_),className:"w-full",renderOverlay:Ua,children:s.jsx(c.Input,{id:K,size:o,disabled:D,invalid:I,value:Ka,placeholder:mt?void 0:d,readOnly:!0,iconBefore:t?void 0:je?.icon,iconAfter:s.jsx(F.IconChevronDown,{size:he?f.DIAL_ICON_SIZE.SM:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:f.mergeClasses(jc,de&&"rotate-180")}),role:"combobox","aria-haspopup":"listbox","aria-expanded":de,"aria-controls":Y,"aria-autocomplete":"none","aria-label":Wa,"aria-describedby":[g,ee,ne].filter(Boolean).join(" ")||void 0,"aria-invalid":p||I?!0:void 0,containerClassName:"w-full",wrapperClassName:f.mergeClasses(!D&&"cursor-pointer",t&&_t&&!mr&&["!h-auto flex-wrap py-2",he?"min-h-[24px]":"min-h-[40px]"],T),className:f.mergeClasses("cursor-pointer",mt&&"w-0 min-w-0 flex-none p-0"),onKeyDown:Ga,children:mt})}),s.jsx(c.ErrorText,{id:ee,text:p}),!p&&s.jsx(c.CaptionText,{id:ne,text:h})]})]})},Os={[$.Array]:[],[$.String]:"",[$.Boolean]:!1,[$.Integer]:0,[$.Number]:0},Lc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=e.anyOf??[],p=ic(t,u,i),h=u[p],x=!h||Q(h,i).type===$.Null,g=y=>{const v=Q(u[y],i);if(v.type===$.Null){r(null);return}const b=$e(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(Ke,{ariaLabel:o??l.selectTypePlaceholder,options:u.map((y,v)=>({value:String(v),label:na(y,i)})),value:String(p),disabled:d,onChange:y=>g(Number(typeof y=="string"?y:y[0])),className:"max-w-[280px]"}),!x&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ve,{schema:h,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:p,target:h,rel:x,disabled:g,...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,N=p!==void 0?s.jsx("a",{...S,href:g?void 0:p,target:h,rel:x??(h==="_blank"?"noopener noreferrer":void 0),"aria-disabled":g||void 0,tabIndex:g?-1:S.tabIndex,onClick:g?void 0:S.onClick,className:v,"aria-label":C,children:I}):s.jsx("button",{...y,...c.getDisabledButtonProps(g,u,y.onClick),type:d,className:v,"aria-label":C,children:I});return u?s.jsx(c.Tooltip,{asChild:!0,...u,children:N}):N},as=(e,t)=>({appearance:n,...a})=>s.jsx(Xe,{...a,variant:e,appearance:n||t}),os=(e,t)=>({variant:n,...a})=>s.jsx(Xe,{...a,variant:n||t,appearance:e}),is=as(c.ButtonVariant.Primary,c.ButtonAppearance.Solid),ur=as(c.ButtonVariant.Neutral,c.ButtonAppearance.Solid),Ac=as(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)"},_c=s.jsx(F.IconSparkles,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":!0}),Oc=({appearance:e=c.ButtonAppearance.Outlined,iconBefore:t=_c,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}})},kc=os(c.ButtonAppearance.Link,c.ButtonVariant.Primary),ls=os(c.ButtonAppearance.Ghost,c.ButtonVariant.Primary),Rc=os(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,p]=m.useState(l),h=m.useId(),x=a===0;return s.jsxs("div",{className:f.mergeClasses("flex flex-col border border-tertiary",x?"rounded-xl bg-layer-raised":"rounded-lg",c.DIAL_KIT_CLASS.schemaRendererSection),children:[s.jsxs("div",{className:f.mergeClasses("flex items-center gap-2",x?"px-4 py-3":"px-3 py-2"),children:[s.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":u?h:void 0,onClick:()=>p(g=>!g),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",x?"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:h,className:f.mergeClasses("border-t border-tertiary",x?"p-4":"p-3"),children:o})]})},Mc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1,defaultExpanded:d=!0}=Re(),[u,p]=m.useState(),h=Array.isArray(t)?t:[],x=e.items;if(!x)return s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemSchema});const g=Q(x,o),y=g.discriminator,v=y?Object.keys(y.mapping).map(N=>({value:N,label:N})):[],b=u??v[0]?.value,C=()=>{let N;if(y&&b){const j=Q({$ref:y.mapping[b]},o);N={...$e(j,o)??{},[y.propertyName]:b}}else N=$e(g,o)??aa(g);r([...h,N])},I=N=>{r(h.filter((j,E)=>E!==N))},S=(N,j)=>{r(h.map((E,A)=>A===N?j:E))};return s.jsxs("div",{className:"flex flex-col gap-3",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noItemsYet}),h.map((N,j)=>{const E=lc(N,y?.propertyName,j),A=ze(N,g,o,`${n.join(".")}[${j}]`);return s.jsx(Nt,{title:E,level:a,summary:ns(N,g,o),errorCount:A.length,onRemove:l?void 0:()=>I(j),defaultExpanded:d,removeItemAriaLabel:`${i.removeItemAriaLabel}: ${E}`,children:s.jsx(Ve,{schema:x,value:N,onChange:L=>S(j,L),path:[...n,String(j)],level:a+1,ariaLabel:E})},j)}),!l&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[v.length>0&&s.jsx(Ke,{ariaLabel:i.selectTypeToAdd,options:v,value:b,placeholder:i.selectTypeToAdd,onChange:N=>p(typeof N=="string"?N:N[0]),className:"max-w-[280px] flex-1"}),s.jsx(ls,{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 cs=(e=>(e.None="none",e.Both="both",e.Horizontal="horizontal",e.Vertical="vertical",e))(cs||{});const ks={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},Pc=e=>typeof e=="boolean"?ks[e?"both":"none"]:ks[e],fa=({className:e="",value:t,onChange:r,error:n,containerClassName:a,resize:o=!1,labelProps:i,caption:l,id:d,invalid:u,"aria-describedby":p,"aria-invalid":h,...x})=>{const g=m.useId(),y=d??g,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",x.disabled&&"dial-kit-input-disable",Pc(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":[p,v,b].filter(Boolean).join(" ")||void 0,"aria-invalid":h??(n||u?!0:void 0),...x}),s.jsx(c.ErrorText,{id:v,text:n}),!n&&s.jsx(c.CaptionText,{id:b,text:l})]})]})},Rs=e=>{try{return JSON.parse(e),!0}catch{return!1}},ds=({value:e,onChange:t,id:r,ariaLabel:n})=>{const{readonly:a,texts:o}=Re(),[i,l]=m.useState(()=>JSON.stringify(e,null,2)??""),d=!Rs(i),u=p=>{l(p),Rs(p)&&t(JSON.parse(p))};return s.jsx(fa,{id:r,"aria-label":n,value:i,onChange:u,readOnly:a,invalid:d,error:d?o.invalidJsonError:void 0,spellCheck:!1,rows:10,resize:cs.Vertical,className:"font-mono !whitespace-pre"})},Bc=/^0+\.(\d+)?$/,zc=/^0+/,Fc=[".","-","+","e","E"],Ms=e=>!e||e==="-"?e:String(e).match(Bc)?String(e).replace(zc,"0"):Number(e),us=({integer:e,onChange:t,min:r,max:n,onKeyDown:a,onPaste:o,...i})=>{const l=u=>{if(e&&Fc.includes(u.key)){u.preventDefault();return}c.handleKeyDown(u,"number",r,n),a?.(u)},d=u=>{if(e){const p=u.clipboardData.getData("text"),h=p.replace(/\D/g,"");if(h!==p&&(u.preventDefault(),h)){const x=u.currentTarget,g=x.selectionStart??0,y=x.selectionEnd??0,v=x.value.slice(0,g)+h+x.value.slice(y);t?.(Ms(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?.(Ms(u)),onKeyDown:l,onPaste:d})},pa=({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(p=>!p)}):void 0})},Hc="flex flex-col gap-2",$c="flex",Kc="mt-2 ml-[26px]",Vc={[Oe.Column]:"flex-col gap-y-3",[Oe.Row]:"flex-row flex-wrap gap-x-4 gap-y-3"},jt=({items:e,value:t,onChange:r,name:n,id:a,orientation:o=Oe.Column,labelProps:i,disabled:l,error:d,caption:u,ariaLabel:p,className:h,optionsClassName:x,radioClassName:g,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,N=c.resolveAccessibleName(i?.label);return s.jsxs("div",{className:f.mergeClasses(Hc,h,c.DIAL_KIT_CLASS.radioGroup),children:[i&&s.jsx(c.Label,{...i,id:C}),s.jsx("div",{role:"radiogroup","aria-labelledby":N?C:void 0,"aria-label":N?void 0:c.resolveAccessibleName(p),"aria-describedby":[I,S].filter(Boolean).join(" ")||void 0,"aria-disabled":l||void 0,className:f.mergeClasses($c,Vc[o],x),children:e.map(j=>{const E=j.value===t;return s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(c.Radio,{id:`${b}-${j.value}`,name:n??b,value:j.value,labelProps:j.label==null?void 0:{label:j.label},"aria-label":j["aria-label"],caption:j.caption,isSelected:E,disabled:l||j.disabled,onChange:r,className:g}),E&&j.content?s.jsx("div",{className:f.mergeClasses(Kc,y),children:j.content}):null]},j.value)})}),s.jsx(c.ErrorText,{id:I,text:d}),!d&&s.jsx(c.CaptionText,{id:S,text:u})]})},ha=({id:e,labelProps:t,isOn:r=!1,disabled:n,onChange:a,caption:o,className:i,...l})=>{const d=m.useId(),u=e??d,p=o?`${u}-caption`:void 0,h=m.useCallback(x=>{a?.(x.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:h,"aria-label":c.resolveAccessibleName(typeof t?.label!="string"?l["aria-label"]:void 0),"aria-describedby":p,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:p,className:"dial-tiny-text text-secondary ml-[44px]",children:o})]})},Ps=e=>typeof e=="string"?e:e[0],Ir=e=>e!=null?String(e):"",Wc=e=>e!==void 0?Number(e):void 0,ma=({schema:e,value:t,onChange:r,invalid:n,id:a,ariaLabel:o,ariaDescribedBy:i})=>{const{texts:l,readonly:d=!1,inputClassName:u,acceptableResourceTypes:p}=Re(),h=e.const!==void 0,x=Array.isArray(e.enum)?e.enum:[],g=x.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=p?.[b];return Array.isArray(C)?C.map(I=>{const S=String(I);return{value:S,label:S}}):[]});return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:v,value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:b=>r(Ps(b)),placeholder:l.enumSelectPlaceholder,className:u})}if(h)return s.jsx(c.Input,{id:a,"aria-label":o,value:String(e.const??""),disabled:!0,containerClassName:u});if(g&&e.enumDisplay===lr.Radio)return s.jsx(jt,{id:a,ariaLabel:o,items:x.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(g)return s.jsx(Ke,{id:a,ariaLabel:o,ariaDescribedBy:i,options:x.map(v=>({value:String(v),label:String(v)})),value:t!=null?String(t):void 0,invalid:n,disabled:d,onChange:v=>r(Ps(v)),placeholder:l.enumSelectPlaceholder,className:u});switch(e.type){case $.Boolean:return s.jsx(ha,{id:a,"aria-label":o,isOn:!!t,disabled:d,onChange:v=>r(v)});case $.Integer:case $.Number:return s.jsx(us,{id:a,"aria-label":o,"aria-describedby":i,integer:e.type===$.Integer,value:Ir(t),invalid:n,disabled:d,onChange:v=>r(Wc(v)),placeholder:e.type===$.Integer?l.integerInputPlaceholder:l.numberInputPlaceholder,containerClassName:u});default:return e.isProtected?s.jsx(pa,{id:a,"aria-label":o,"aria-describedby":i,value:Ir(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:Ir(t),invalid:n,disabled:d,onChange:v=>r(v??void 0),placeholder:l.stringInputPlaceholder,containerClassName:u})}},Bs=(e,t)=>({id:Math.random().toString(36).slice(2),key:e,value:t}),ga=e=>!!(e.oneOf||e.anyOf||e.type===$.Array||Ye(e)),Gc={[$.String]:"entryTypeString",[$.Number]:"entryTypeNumber",[$.Boolean]:"entryTypeBoolean",[$.Null]:"entryTypeNull",[$.Object]:"entryTypeObject",[$.Array]:"entryTypeArray"},zs=e=>typeof e=="string"?e:e[0],Uc=({pair:e,valueSchema:t,isUnschematizedValue:r,onKeyChange:n,onValueChange:a,onRemove:o,path:i,level:l})=>{const{rootSchema:d,texts:u,readonly:p=!1,inputClassName:h,defaultExpanded:x=!0,touchedPaths:g,markTouched:y,skipUntouched:v}=Re(),[b,C]=m.useState(e.key),[I,S]=m.useState(()=>dc(e.value)),N=ga(t),j=r&&(I===$.Object||I===$.Array),E=r&&I===$.Null,A=r&&I===$.Boolean,L=N||j,D=[...i,e.id,"key"].join("."),w=St(D,g,v)&&e.key==="",T=e.key||u.valueColumnHeader,_=V=>{a(fc(V)),S(V)},B=m.useMemo(()=>cc.map(V=>({value:V,label:u[Gc[V]]})),[u]),k=m.useMemo(()=>[{value:"true",label:u.booleanTrueOption},{value:"false",label:u.booleanFalseOption}],[u]),R=()=>E?s.jsx(c.Input,{"aria-label":T,value:"null",disabled:!0}):A?s.jsx(Ke,{ariaLabel:T,options:k,value:e.value?"true":"false",disabled:p,onChange:V=>{const Z=zs(V);Z&&a(Z==="true")}}):s.jsx(ma,{schema:r?{type:I}:t,value:e.value,onChange:a,ariaLabel:T}),M=s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:L?"min-w-0 flex-1":"w-2/5 min-w-0",children:s.jsx(c.Input,{"aria-label":u.keyColumnHeader,value:b,disabled:p,invalid:w,error:w?`${u.keyColumnHeader} is required`:void 0,onChange:V=>C(V??""),onBlur:()=>{y?.(D),b!==e.key&&n(b)},placeholder:u.keyInputPlaceholder,containerClassName:h})}),!L&&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(Ke,{ariaLabel:u.typeColumnHeader,options:B,value:I,disabled:p,onChange:V=>{const Z=zs(V);Z&&_(Z)}})})}),!p&&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(!L)return M;if(j)return s.jsxs("div",{className:"flex flex-col gap-2",children:[M,s.jsx(ds,{value:e.value,onChange:a,ariaLabel:T},I)]});const H=[...i,e.key],G=ze(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:ns(e.value,t,d),errorCount:G.length+(w?1:0),defaultExpanded:x,children:s.jsx(Ve,{schema:t,value:e.value,onChange:a,path:H,level:l+1,ariaLabel:T})})]})},Zc=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i,readonly:l=!1}=Re(),d=e.additionalProperties===!0||e.additionalProperties==null,u=!d&&typeof e.additionalProperties=="object"?Q(e.additionalProperties,o):{type:$.String},p=ga(u),[h,x]=m.useState(()=>Object.entries(t??{}).map(([b,C])=>Bs(b,C))),g=b=>{x(b),r(Object.fromEntries(b.filter(C=>C.key!=="").map(C=>[C.key,C.value])))},y=(b,C)=>g(h.map((I,S)=>S===b?{...I,...C}:I)),v=()=>{const b=p?$e(u,o)??aa(u):"";x(C=>[...C,Bs("",b)])};return s.jsxs("div",{className:"flex flex-col gap-2",children:[h.length===0&&s.jsx("p",{className:"dial-small-text text-secondary",children:i.noFieldsYet}),h.length>0&&!p&&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})]}),h.map((b,C)=>s.jsx(Uc,{pair:b,valueSchema:u,isUnschematizedValue:d,onKeyChange:I=>y(C,{key:I}),onValueChange:I=>y(C,{value:I}),onRemove:()=>g(h.filter((I,S)=>S!==C)),path:n,level:a},b.id)),!l&&s.jsx("div",{className:"pt-1",children:s.jsx(ls,{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})})]})},Rr=({schema:e,value:t,onChange:r,path:n,level:a})=>{const{rootSchema:o,texts:i}=Re(),l=Q(e,o),d=sa(Object.entries(l.properties??{}).filter(([,h])=>!Q(h,o).isHidden)),u=l.required??[],p=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(([h,x])=>{const g=Q(x,o);return s.jsx(xa,{schema:x,value:p[h],onChange:y=>r({...p,[h]:y}),path:[...n,h],level:a,required:u.includes(h),label:g.title??x.title??Yt(h)},h)})})},Fs=e=>typeof e=="string"?e:e[0],qc=(e,t)=>{const{[t]:r,...n}=e.properties??{};return{...e,properties:n}},Yc=({schema:e,value:t,onChange:r,path:n,level:a,ariaLabel:o})=>{const{rootSchema:i,texts:l,readonly:d=!1}=Re(),u=m.useId(),p=o??l.selectTypePlaceholder,h=e.discriminatorDisplay===lr.Radio,x=e.discriminator;if(x){const I=x.propertyName,S=x.mapping,N=L=>Q({$ref:S[L]},i),j=typeof t=="object"&&t!==null?t[I]:void 0,E=j?N(j):void 0,A=L=>{const D=$e(N(L),i)??{};r({...D,[I]:L})};if(h){const L=e.discriminatorOrientation===cr.Row,D=T=>s.jsx(Rr,{schema:qc(T,I),value:t,onChange:r,path:n,level:a}),w=s.jsx(jt,{id:u,ariaLabel:p,value:j,onChange:A,disabled:d,orientation:L?Oe.Row:Oe.Column,items:Object.keys(S).map(T=>{const _=N(T);return{value:T,label:_.title??T,content:L?void 0:D(_)}})});return L?s.jsxs("div",{className:"flex flex-col gap-3",children:[w,E&&D(E)]}):w}return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Ke,{ariaLabel:p,options:Object.keys(S).map(L=>({value:L,label:L})),value:j,placeholder:l.selectTypePlaceholder,disabled:d,onChange:L=>{const D=Fs(L);D&&A(D)},className:"max-w-[280px]"}),E&&s.jsx("div",{className:"pl-3",children:s.jsx(Rr,{schema:E,value:t,onChange:r,path:n,level:a})})]})}const g=e.oneOf??[],v=(()=>{if(typeof t!="object"||t===null||Array.isArray(t))return 0;const I=g.findIndex(S=>Q(S,i).required?.every(N=>N in t));return I>=0?I:0})(),b=g[v],C=I=>{const S=$e(Q(g[I],i),i);r(S??null)};return h?s.jsx(jt,{id:u,ariaLabel:p,value:String(v),onChange:I=>C(Number(I)),disabled:d,items:g.map((I,S)=>({value:String(S),label:na(I,i)??`Option ${S+1}`,content:s.jsx(Ve,{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(Ke,{ariaLabel:p,options:g.map((I,S)=>({value:String(S),label:Q(I,i).title??`Option ${S+1}`})),value:String(v),disabled:d,onChange:I=>C(Number(Fs(I))),className:"max-w-[280px]"}),b&&s.jsx("div",{className:"border-l-2 border-tertiary pl-3",children:s.jsx(Ve,{schema:b,value:t,onChange:r,path:n,level:a,ariaLabel:o})})]})},Ve=({schema:e,value:t,onChange:r,path:n,level:a,required:o,suppressInlineError:i=!1,fieldId:l,ariaLabel:d,ariaDescribedBy:u})=>{const p=m.useId(),{rootSchema:h,renderField:x,markTouched:g,touchedPaths:y,skipUntouched:v}=Re(),b=Q(e,h),C=n.join("."),I=j=>{g?.(C),r(j)},S={schema:b,value:t,onChange:I,path:n,level:a};let N;if(b.oneOf)N=s.jsx(Yc,{...S,ariaLabel:d});else if(b.anyOf&&b.type!==$.Object)N=s.jsx(Lc,{...S,ariaLabel:d});else if(Ye(b)){const j=b.additionalProperties!=null&&b.additionalProperties!==!1,E=!b.properties||Object.keys(b.properties).length===0;j&&E?N=s.jsx(Zc,{...S}):E&&b.additionalProperties!==!1?N=s.jsx(ds,{value:t,onChange:I,id:l,ariaLabel:d}):N=s.jsx(Rr,{...S})}else if(b.type===$.Array)N=s.jsx(Mc,{...S});else{const j=St(C,y,v)&&!!o&&dr(t),E=!i&&j?ss(b.title??d??"Field"):void 0;N=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ma,{schema:b,value:t,onChange:I,invalid:j,id:l,ariaLabel:d,ariaDescribedBy:E?p:u}),s.jsx(c.ErrorText,{id:p,text:E})]})}return x?x(n,b,N):N},xa=({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:p,skipUntouched:h}=Re(),x=Q(e,d),g=n.join(".");if(Ye(x)||x.type===$.Array){const v=ze(t,x,d,g),b=i??x.title??n[n.length-1]??"Section";return s.jsx(Nt,{title:b,description:x.description,level:a,summary:ns(t,x,d),errorCount:St(g,p,h,!0)?v.length:0,defaultExpanded:u,children:s.jsx(Ve,{schema:x,value:t,onChange:r,path:n,level:a+1,required:o,ariaLabel:b})})}const y=St(g,p,h)&&o&&dr(t)?ss(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:x.description}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Ve,{schema:x,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})]})]})},Hs="dial-small-semi-text text-primary",Xc=({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:p,renderField:h,skipUntouched:x=!1,acceptableResourceTypes:g})=>{const y=m.useMemo(()=>({...oc,...r}),[r]),v=m.useMemo(()=>t||($e(e,e)??{}),[]),[b,C]=m.useState(v),[I,S]=m.useState(()=>new Set),N=m.useCallback(w=>{S(T=>T.has(w)?T:new Set([...T,w]))},[]);m.useEffect(()=>{p?.(v)},[]);const j=(w,T)=>{const _={...b,[w]:T};C(_),d?.(_),u?.(w,T)},E=new Set(Object.keys(e.properties??{})),A=Object.keys(b).filter(w=>!E.has(w)),L=sa(Object.entries(e.properties??{}).filter(([,w])=>!Q(w,e).isHidden)),D=e.required??[];return s.jsx(oa.Provider,{value:{rootSchema:e,texts:y,readonly:a,defaultExpanded:o,inputClassName:i,acceptableResourceTypes:g,renderField:h,touchedPaths:I,markTouched:N,skipUntouched:x},children:s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-4",n,c.DIAL_KIT_CLASS.schemaRenderer),children:[L.map(([w,T])=>{const _=Q(T,e),B=_.title??T.title??Yt(w),k=D.includes(w),R=b[w],M=V=>j(w,V);if(l===nt.Flat)return s.jsx(xa,{schema:T,value:R,onChange:M,path:[w],level:0,required:k,label:B},w);if(l===nt.FlatSections)return s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Hs,children:B}),s.jsx(Ve,{schema:T,value:R,onChange:M,path:[w],level:0,required:k,ariaLabel:B})]},w);const H=ze(R,_,e,w),G=k&&dr(R)?Math.max(H.length,1):H.length;return s.jsx(Nt,{title:B,description:_.description,level:0,defaultExpanded:o,errorCount:St(w,I,x,!0)?G:0,children:s.jsx(Ve,{schema:T,value:R,onChange:M,path:[w],level:1,required:k,ariaLabel:B})},w)}),A.map(w=>{const T=Yt(w),_=s.jsx(ds,{value:b[w],onChange:B=>j(w,B),ariaLabel:T});return l===nt.Sections?s.jsx(Nt,{title:T,level:0,defaultExpanded:o,children:_},w):s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx("h2",{className:Hs,children:T}),_]},w)})]})})},Qc=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(We,{size:e.size}),general:s.jsx(F.IconCheck,{size:e.size,stroke:e.stroke})}),Jc={[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"},ed="bg-layer-sunken text-primary",td={[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"},rd={[X.Info]:"status",[X.Success]:"status",[X.Warning]:"alert",[X.Error]:"alert",[X.Loading]:"status",[X.General]:"status"},sd="items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent",fs=({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,closeAriaLabel:p="Close notification",onClose:h,children:x,textClassName:g,...y})=>{const v=m.useMemo(()=>Qc({size:l,stroke:d})[e],[e,l,d]),b=r===qt.Neutral,C=g??(t===fe.SectionMessage?"flex-row flex-wrap items-baseline gap-x-1":"flex-col");return s.jsxs("div",{role:rd[e],...y,className:f.mergeClasses(sd,b?ed:Jc[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",b&&td[e]),children:s.jsx(c.DialIcon,{icon:v})}),n?s.jsxs("div",{className:f.mergeClasses("flex min-w-0 text-primary break-words",C),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}),x,u&&s.jsx(c.CloseButton,{className:"shrink-0 self-start",ariaLabel:p,onClose:I=>h?.(I)})]})},nd=({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(fs,{...a,variant:e,type:n||t}),ut=(e,t)=>({variant:n,...a})=>s.jsx(fs,{...a,variant:n||t,type:e}),ad=dt(X.Error,fe.Toast),od=dt(X.Info,fe.Toast),id=dt(X.Success,fe.Toast),ld=dt(X.Warning,fe.Toast),cd=dt(X.Loading,fe.Toast),dd=dt(X.General,fe.Toast),ud=ut(fe.SectionMessage,X.Error),fd=ut(fe.SectionMessage,X.Info),pd=ut(fe.SectionMessage,X.Success),hd=ut(fe.SectionMessage,X.Warning),md=ut(fe.SectionMessage,X.Loading),gd=ut(fe.SectionMessage,X.General);var be=(e=>(e.Date="date",e.DateTime="datetime",e.Time="time",e.Weekday="weekday",e))(be||{});const xd="en-GB",bd={[be.Date]:"Select date",[be.DateTime]:"Select date and time",[be.Time]:"--:--",[be.Weekday]:"Select day"},ba="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",va="!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent",ya="!border-error",vd="z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md",yd="z-floating rounded-lg bg-layer-raised p-2 shadow-md",Cd="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",Id="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",Sd="bg-control-accent text-control-permanent",Nd="text-accent dial-small-semi-text",jd="text-control-disable-primary",Ca="text-secondary",wd=s.jsx(F.IconCalendar,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Ca}),$s={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"})},Dd=(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})},Ks=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Vs=(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},Td=(e,t)=>e.toLocaleDateString(t,{month:"long",year:"numeric"}),Ws=(e,t)=>e.toLocaleDateString(t,{day:"numeric",month:"short",year:"numeric"}),Ed=(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")}`,Gs=(e,t)=>{const[r,n]=t.split(":").map(Number),a=new Date(e);return a.setHours(r||0,n||0,0,0),a},Ld=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Ad=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}`},Ia=5,Sa=e=>e.charAt(0).toUpperCase()+e.slice(1),_d=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,Ia+r));return Sa(n.toLocaleDateString(e,{weekday:"short",timeZone:"UTC"}))}),Od=e=>Array.from({length:7},(t,r)=>{const n=new Date(Date.UTC(1970,0,Ia+r));return{value:String(r+1),label:Sa(n.toLocaleDateString(e,{weekday:"long",timeZone:"UTC"}))}}),kd=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),Rd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Md="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",Pd="bg-control-accent text-control-permanent hover:bg-control-accent",Us=({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),p={ArrowDown:d[u+1],ArrowUp:d[u-1],Home:d[0],End:d[d.length-1]}[l.key];p&&(l.preventDefault(),p.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(Md,l===r&&Pd),onClick:()=>n(l),children:l},l))})},Bd=({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(Us,{label:"Hours",options:kd,selected:r,onSelect:a=>t(`${a}:${n??"00"}`,!1)}),s.jsx(Us,{label:"Minutes",options:Rd,selected:n,onSelect:a=>t(`${r??"00"}:${a}`,!0)})]})},zd=({id:e,disabled:t,invalid:r,trigger:n,panelClassName:a,fieldClassName:o,panel:i,labelledBy:l,describedBy:d,panelLabel:u})=>{const p=c.useThemeScope(),[h,x]=m.useState(!1),g=P.useFloatingNodeId(),{refs:y,floatingStyles:v,context:b}=P.useFloating({nodeId:g,open:h,onOpenChange:E=>x(t?!1:E),placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(8),P.flip({padding:8}),P.shift({padding:8})]}),C=P.useClick(b,{enabled:!t}),I=P.useDismiss(b),S=P.useRole(b,{role:"dialog"}),{getReferenceProps:N,getFloatingProps:j}=P.useInteractions([C,I,S]);return s.jsxs(P.FloatingNode,{id:g,children:[s.jsx("div",{id:e,ref:y.setReference,role:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-disabled":t,"aria-labelledby":l,"aria-describedby":d,tabIndex:t?-1:0,className:f.mergeClasses(ba,"focus-visible:outline focus-visible:outline-focus",r&&ya,t&&va,o),...N(),children:n}),h&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:b,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:y.setFloating,style:v,"aria-label":u,className:f.mergeClasses(vd,p,a),...j(),children:i(()=>x(!1))})})})]})},Zs=e=>s.jsx(P.FloatingTree,{children:s.jsx(zd,{...e})}),qs=({id:e,value:t,onChange:r,onBlur:n,disabled:a,invalid:o,className:i,ariaLabel:l,describedBy:d,placeholder:u="--:--",timezoneLabel:p,timezoneLabelClassName:h,picker:x=!1,pickerButtonClassName:g})=>{const[y,v]=m.useState(t),[b,C]=m.useState(!1),I=c.useThemeScope(),S=P.useFloatingNodeId(),{refs:N,floatingStyles:j,context:E}=P.useFloating({nodeId:S,open:b,onOpenChange:T=>C(a?!1:T),placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(8),P.flip({padding:8}),P.shift({padding:8})]}),A=P.useDismiss(E),L=P.useRole(E,{role:"dialog"}),{getFloatingProps:D}=P.useInteractions([A,L]);m.useEffect(()=>{v(t)},[t]);const w=s.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off","aria-label":l,"aria-describedby":d,"aria-invalid":o||void 0,placeholder:u,disabled:a,value:y,onChange:T=>{const _=Ad(T.target.value);v(_),Ld(_)&&r(_)},onBlur:n,className:f.mergeClasses(ba,o&&ya,a&&va,x&&"pe-12",i)});return!p&&!x?w:s.jsxs("div",{ref:x?N.setReference:void 0,className:"relative w-full",children:[w,p&&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",x&&"end-12",h),children:p}),x&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","aria-label":"Choose time","aria-haspopup":"dialog","aria-expanded":b,disabled:a,className:f.mergeClasses(Cd,g),onClick:()=>C(T=>!T),children:s.jsx(F.IconClock,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),b&&s.jsx(P.FloatingPortal,{children:s.jsx(P.FloatingFocusManager,{context:E,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:N.setFloating,style:j,"aria-label":"Choose time",className:f.mergeClasses(yd,I),...D(),children:s.jsx(Bd,{value:y,onSelect:(T,_)=>{v(T),r(T),_&&C(!1)}})})})})]})]})},Fd=({mode:e=be.Date,value:t,onChange:r,onBlur:n,labelProps:a,placeholder:o,disabled:i=!1,invalid:l=!1,ariaDescribedBy:d,id:u,className:p,minDate:h,maxDate:x,locale:g=xd,fieldClassName:y,showTimezone:v=!1,showTimePicker:b=!0,renderTimeField:C,pickerButtonClassName:I})=>{const S=o??bd[e],N=t instanceof Date?t:null,j=m.useId(),E=u??j,A=a?.id??`${E}-label`,L=!!a?.label,D=typeof a?.label=="string"?a.label:void 0,w=L?`${A} ${E}`:void 0,T=a?s.jsx(c.Label,{...a,id:A,htmlFor:E}):null,[_,B]=m.useState(()=>N??new Date),k=m.useMemo(()=>new Date,[]),R=m.useMemo(()=>v?ta({locale:g}):null,[v,g]),M=m.useMemo(()=>_d(g),[g]),H=m.useMemo(()=>Od(g),[g]),G=m.useMemo(()=>Dd(_.getFullYear(),_.getMonth()),[_]),V=W=>{B(K=>new Date(K.getFullYear(),K.getMonth()+W,1))},Z=(W,K)=>{if(Vs(W,h,x))return;const Y=e===be.DateTime&&N?Gs(W,Mt(N)):W;r?.(Y),e===be.Date&&K()},se=N?Mt(N):"",re=W=>{r?.(Gs(N??new Date,W))},le=()=>N?e===be.DateTime?`${Ws(N,g)}, ${Mt(N)}`:Ws(N,g):S;if(e===be.Time){const W=typeof t=="string"?t:N?Mt(N):"";return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(qs,{id:E,value:W,onChange:K=>r?.(K),onBlur:n,disabled:i,invalid:l,describedBy:d,placeholder:S,className:y,timezoneLabel:R,picker:b,pickerButtonClassName:I})]})}if(e===be.Weekday){const W=typeof t=="string"?t:void 0,K=H.find(Y=>Y.value===W);return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{id:E,disabled:i,invalid:l,labelledBy:w,describedBy:d,panelLabel:D??S,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!K&&"text-secondary"),children:K?.label??S}),s.jsx(F.IconChevronDown,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Ca})]}),panel:Y=>s.jsx("div",{role:"listbox","aria-label":D??S,className:"flex flex-col gap-0.5",children:H.map(ee=>s.jsx("button",{type:"button",role:"option","aria-selected":ee.value===W,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",ee.value===W&&"bg-control-accent-alpha-hover"),onClick:()=>{r?.(ee.value),Y()},children:ee.label},ee.value))})})]})}return s.jsxs("div",{className:f.mergeClasses("flex flex-col gap-y-3",p,c.DIAL_KIT_CLASS.calendar),children:[T,s.jsx(Zs,{id:E,disabled:i,invalid:l,labelledBy:w,describedBy:d,panelLabel:D??S,fieldClassName:y,trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:f.mergeClasses("truncate",!N&&"text-secondary"),children:le()}),wd]}),panel:W=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(c.StaticIconButton,{"aria-label":"Previous month",icon:$s.prev,size:c.ElementSize.Small,onClick:()=>V(-1)}),s.jsx("div",{className:"dial-small-semi-text text-primary","aria-live":"polite",children:Td(_,g)}),s.jsx(c.StaticIconButton,{"aria-label":"Next month",icon:$s.next,size:c.ElementSize.Small,onClick:()=>V(1)})]}),s.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center",children:[M.map(K=>s.jsx("div",{"aria-hidden":"true",className:"dial-tiny-text py-1 text-secondary",children:K},K)),G.map(K=>{const Y=K.getMonth()!==_.getMonth(),ee=Ks(K,N),ne=Ks(K,k),he=Vs(K,h,x);return s.jsx("button",{type:"button",disabled:he,"aria-label":Ed(K,g),"aria-pressed":ee,"aria-current":ne?"date":void 0,className:f.mergeClasses(Id,Y&&jd,ne&&!ee&&Nd,ee&&Sd,he&&"cursor-not-allowed opacity-40 hover:bg-transparent"),onClick:()=>Z(K,W),children:K.getDate()},K.toISOString())})]}),e===be.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"}),C?C({value:se,onChange:re,onBlur:n,disabled:i,invalid:l,ariaLabel:"Time",timezoneLabel:R}):s.jsx(qs,{ariaLabel:"Time",value:se,onChange:re,onBlur:n,className:f.mergeClasses(!R&&"w-[120px]","px-3 py-1.5"),timezoneLabel:R,timezoneLabelClassName:"end-3 max-w-[60%]"})]})]})})]})},Hd=3,$d=({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),p=m.useRef(!1),h=m.useRef(0),x=m.useCallback(D=>{p.current=D,u(D)},[]),g=m.useCallback(()=>{const D=o.current;if(!D)return;if(p.current){D.clientWidth>=h.current&&x(!1);return}const w=i.current,T=l.current;if(!w||!T)return;const _=w.scrollWidth-w.clientWidth,B=parseFloat(getComputedStyle(T).minWidth)||0,k=T.clientWidth<=B+1;_>0&&k&&(h.current=D.clientWidth+_,x(!0))},[x]);m.useEffect(()=>{const D=o.current;if(D)return c.observeElementSize(D,g)},[g]);const y=e.join("\0");m.useEffect(()=>{x(!1),c.scheduleMeasure(g)},[y,g,x]),m.useEffect(()=>{d||c.scheduleMeasure(g)},[d,g]);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:Vr,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,N=e.length>Hd||d,j=e.slice(1,d?I:I-1),E=D=>{const w=D===I,T=D===S;let _=e[D];return w&&(_=s.jsx("span",{className:r,children:e[D]})),s.jsxs("li",{className:f.mergeClasses(Zt,w&&"min-w-0",T&&"shrink-[1000]",!w&&!T&&"shrink-0"),children:[s.jsxs("span",{className:f.mergeClasses(Ar,En,"pointer-events-none opacity-75",T&&"min-w-auto"),"aria-current":w?"page":void 0,"aria-disabled":"true",children:[D===0&&v,s.jsx("span",{ref:w&&i||T&&l||void 0,className:f.mergeClasses("truncate",w&&"min-w-0 flex-1",T&&"min-w-[2ch]",C),children:_})]}),!w&&b]},`item-${D}`)},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:j.join(", ")})]}),b]},"ellipsis"),L=[];return N?(L.push(E(0),A()),d||L.push(E(I-1)),L.push(E(I))):e.forEach((D,w)=>L.push(E(w))),s.jsx("nav",{ref:o,"aria-label":a,className:f.mergeClasses(Dn,n,c.DIAL_KIT_CLASS.folderPath),children:s.jsx("ol",{className:Tn,children:L})})};var pe=(e=>(e.Small="small",e.Tiny="tiny",e.Heading="heading",e))(pe||{});const Kd={[pe.Small]:"w-full overflow-hidden",[pe.Tiny]:"w-full",[pe.Heading]:"w-full overflow-hidden"},Vd="flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap",Ys="flex min-w-0 items-center gap-2",Xs={[pe.Small]:"dial-small-text",[pe.Tiny]:"dial-tiny-text",[pe.Heading]:"dial-h2-text"},Wd={[pe.Small]:"dial-small-semi-text",[pe.Tiny]:"dial-tiny-semi-text",[pe.Heading]:"dial-h2-text"},Qs={first:"shrink-0",middle:"min-w-0 max-w-[30%] shrink",last:"min-w-0 max-w-[51%] shrink"},Gd={[pe.Small]:Qs,[pe.Tiny]:{first:"shrink-0",middle:"min-w-12 shrink-[1000]",last:"min-w-0 shrink"},[pe.Heading]:Qs},Js={[pe.Small]:"rounded-xs focus-visible:outline-offset-2",[pe.Tiny]:"rounded focus-visible:outline-offset-1",[pe.Heading]:"rounded-xs focus-visible:outline-offset-2"},Ud="flex min-w-0 flex-1 items-center gap-1 transition-colors",Zd="text-secondary hover:text-accent focus-visible:outline focus-visible:outline-focus",qd="cursor-default text-primary",Yd="cursor-default text-secondary",en="inline-flex flex-none items-center leading-none text-secondary",Xd="dial-kit-minimum-target flex shrink-0 items-center text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-focus",Qd=3,Jd=4,eu=s.jsx(F.IconChevronRight,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:"rtl:scale-x-[-1]"}),tu=({items:e,maxVisibleItems:t=Jd,size:r=pe.Small,separator:n=eu,ariaLabel:a="Breadcrumb",overflowAriaLabel:o="Show hidden path segments",className:i,itemClassName:l})=>{const d=Math.max(t,Qd),u=m.useMemo(()=>e.length>d?e.slice(1,-(d-2)):[],[e,d]),p=m.useMemo(()=>u.map((y,v)=>({key:String(v),label:y.label,icon:y.icon})),[u]),h=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 x=e.slice(u.length+1),g=(y,{index:v,isFirst:b,isCurrent:C})=>{const I=!C&&(!!y.href||!!y.onClick),S=f.mergeClasses(Ud,Js[r],I?Zd:C?f.mergeClasses(qd,Wd[r]):Yd,l,c.DIAL_KIT_CLASS.breadcrumbsItem),N=s.jsxs(s.Fragment,{children:[y.icon,s.jsx(c.EllipsisTooltip,{text:y.label})]});return s.jsxs("li",{className:f.mergeClasses(Ys,Xs[r],Gd[r][C?"last":b?"first":"middle"]),children:[I?y.href?s.jsx("a",{href:y.href,onClick:y.onClick,className:S,children:N}):s.jsx("button",{type:"button",onClick:y.onClick,className:S,children:N}):s.jsx("span",{className:S,"aria-current":C?"page":void 0,children:N}),!C&&s.jsx("span",{className:en,"aria-hidden":"true",children:n})]},`segment-${v}`)};return s.jsx("nav",{"aria-label":a,className:f.mergeClasses(Kd[r],i,c.DIAL_KIT_CLASS.breadcrumbs),children:s.jsxs("ol",{className:Vd,children:[g(e[0],{index:0,isFirst:!0,isCurrent:e.length===1}),u.length>0&&s.jsxs("li",{className:f.mergeClasses(Ys,Xs[r],"shrink-0"),children:[s.jsx(c.Dropdown,{items:p,onItemClick:h,placement:"bottom-start",matchReferenceWidth:!1,children:s.jsx("button",{type:"button","aria-label":o,className:f.mergeClasses(Xd,Js[r]),children:s.jsx(F.IconDots,{size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})})}),s.jsx("span",{className:en,"aria-hidden":"true",children:n})]}),x.map((y,v)=>g(y,{index:e.length-x.length+v,isFirst:!1,isCurrent:v===x.length-1}))]})})},ru=({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},su=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")}),nu=({variant:e,appearance:t,items:r,dropdownProps:n,...a})=>{const[o,i]=m.useState(!1),l=m.useMemo(()=>su(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})})})},Na=({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")})]})},au=({items:e,selectedKey:t,defaultSelectedKey:r,onSelect:n,size:a,disabled:o,placement:i="bottom-end",matchReferenceWidth:l=!1,listClassName:d,listStyle:u,ariaLabel:p,triggerClassName:h,triggerLabelClassName:x,open:g,onOpenChange:y})=>{const[v,b]=m.useState(!1),C=g!==void 0,I=C?g:v,S=m.useCallback(w=>{C||b(w),y?.(w)},[C,y]),[N,j]=m.useState(r??e[0]?.key),E=t!==void 0,A=E?t:N,L=m.useMemo(()=>{const w=e.find(T=>T.key===A);return w?.label?String(w.label):""},[e,A]),D=m.useCallback(({key:w})=>{const T=e.find(_=>_.key===w);T&&(E||j(w),n?.(T))},[e,E,n]);return s.jsx(c.Dropdown,{items:e,placement:i,matchReferenceWidth:l,listClassName:d,listStyle:u,disabled:o,open:C?g:void 0,onOpenChange:S,onItemClick:D,children:s.jsx(Na,{label:L,size:a,isOpen:I,disabled:o,"aria-label":p,className:h,labelClassName:x})})},ou={[ve.VALID]:"Completed",[ve.ERROR]:"Error"},iu=(e,t)=>e.status===ve.ERROR?t?"border-error text-primary":"border-error text-error":t?e.status===ve.VALID?"border-success text-primary":"border-accent text-primary":e.status===ve.VALID?"border-primary text-primary":"border-primary text-secondary",lu=(e,t)=>e.status===ve.ERROR?"bg-control-error text-control-permanent":e.status===ve.VALID&&!t?"bg-success text-success":t?e.status===ve.VALID?"bg-success text-success":"bg-control-accent text-control-permanent":"bg-layer-sunken text-secondary",cu=({steps:e,currentStep:t,onChangeStep:r,statusLabels:n,ariaLabel:a,className:o})=>{const i=l=>{if(l===t)return;const d=e.findIndex(h=>h.id===t),u=e.findIndex(h=>h.id===l);(e.slice(0,u).every(h=>h.status===ve.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,p=l.status?n?.[l.status]??ou[l.status]:void 0;let h=d+1;return u&&l.status===ve.ERROR?h=s.jsx(F.IconExclamationCircle,{"aria-hidden":"true",size:f.DIAL_ICON_SIZE.SM,stroke:f.DIAL_KIT_ICON_STROKE}):!u&&l.status===ve.VALID&&(h=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,disabled:l.disabled,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",iu(l,u),"disabled:cursor-not-allowed disabled:text-control-disable-primary"),children:[s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("me-2 flex size-[22px] shrink-0 items-center justify-center rounded-full",lu(l,u)),children:h}),s.jsx("span",{children:l.name}),p&&s.jsx("span",{className:"sr-only",children:p})]})},l.id)})})};var ke=(e=>(e.Outlined="outlined",e.Filled="filled",e))(ke||{}),we=(e=>(e.Blue="blue",e.Green="green",e.Violet="violet",e.Indigo="indigo",e.Brown="brown",e.Red="red",e))(we||{});const du={[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"},uu={[ke.Outlined]:"rounded-md border border-tertiary bg-layer-sunken text-secondary",[ke.Filled]:"rounded-full"},fu={[ke.Outlined]:"dial-tiny-text",[ke.Filled]:"dial-caption-lead-semi-text"},ps=({label:e,variant:t=ke.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",uu[t],t===ke.Filled&&du[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??fu[t],children:e})]});var wt=(e=>(e.Default="default",e.Compact="compact",e))(wt||{});const pu={[wt.Default]:{container:"bg-layer-3",title:"dial-small-text text-secondary",value:"dial-display2-text text-primary",compareDividerCell:"h-10",showDescription:!0},[wt.Compact]:{container:"bg-layer-2",title:"dial-tiny-text text-secondary",value:"dial-body-semi-text text-primary",compareDividerCell:"h-6",showDescription:!1}},hu=({title:e,value:t,description:r,variant:n=wt.Default,error:a,isLoading:o,className:i,delta:l,deltaPositive:d,deltaUnit:u,compareValues:p})=>{const h=pu[n],x=d!==void 0?d:(l??0)>=0,g=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",h.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:h.title,children:e}),s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-[120px] border border-transparent px-2",x?"bg-success text-success":"bg-error text-error"),children:g})]}):s.jsx("span",{className:h.title,children:e}),a?s.jsx(ps,{label:"Error",variant:ke.Filled,color:we.Red,textClassName:"dial-tiny-semi-text",className:"self-start"}):o?s.jsx(We,{size:18,fullWidth:!1,className:"self-start"}):p?s.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-3 gap-y-0.5",children:[s.jsx(c.EllipsisTooltip,{text:p[0].title,className:"col-start-1 dial-tiny-text text-secondary"}),s.jsx(c.EllipsisTooltip,{text:p[1].title,className:"col-start-3 dial-tiny-text text-secondary"}),s.jsx("span",{className:f.mergeClasses("col-start-1 min-w-0",h.value),children:p[0].value}),s.jsx("div",{"aria-hidden":"true",className:f.mergeClasses("col-start-2 flex items-center self-start",h.compareDividerCell),children:s.jsx("div",{className:"h-4 w-px bg-controls-disable-accent"})}),s.jsx("span",{className:f.mergeClasses("col-start-3 min-w-0",h.value),children:p[1].value})]}):s.jsx("span",{className:h.value,children:t}),!a&&!o&&h.showDescription&&r!=null&&r!==!1&&s.jsx("span",{className:"mt-auto dial-tiny-text text-secondary",children:r})]})},hs=[{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"}],mu=(e,t)=>t<=0?0:Math.min(Math.max(e/t,0),1),gu=(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=hs,className:l,titleClassName:d,valueClassName:u,inline:p,ariaLabel:h})=>{const x=e==null,g=!!(r||n||!x),y=mu(x?0:e,t),v=gu(y,i),b=o??(x?"—":e),C=h??(typeof a=="string"?a:void 0),I=r||n,S=r?s.jsx(ps,{label:"Error",variant:ke.Filled,color:we.Red,textClassName:"dial-tiny-semi-text"}):n?s.jsx(We,{size:18,fullWidth:!1}):s.jsx("span",{className:f.mergeClasses("shrink-0 tabular-nums text-end",p?"dial-small-text min-w-[5ch] text-primary":"dial-small-semi-text text-primary",u),children:b}),N=g?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",p?"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,j=s.jsx("span",{className:f.mergeClasses("dial-small-text text-primary",d),children:a});return p?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:j}),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:N}),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:[j,S]}),N]})};var Qt=(e=>(e.Start="start",e.End="end",e))(Qt||{});const ja=({title:e,description:t,children:r,expanded:n,defaultExpanded:a=!1,disabled:o,nonCollapsible:i,ariaLabel:l,onToggle:d,caretPosition:u=Qt.End,className:p,headerClassName:h,contentClassName:x})=>{const g=n!==void 0,[y,v]=m.useState(a),b=i?!0:g?n:y,C=m.useId(),I=`accordion-header-${C}`,S=`accordion-content-${C}`,N=()=>{if(o)return;const D=!b;g||v(D),d?.(D)},j=u===Qt.Start,E=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:[j&&E,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]}),!j&&E]}),L=j?"justify-start gap-2":"justify-between";return s.jsxs("div",{className:f.mergeClasses("flex flex-col py-3 overflow-hidden bg-transparent",p,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",L,h),children:A}):s.jsx("button",{id:I,type:"button","aria-expanded":b,"aria-controls":S,"aria-label":c.resolveAccessibleName(l),disabled:o,onClick:N,className:f.mergeClasses("flex w-full px-4 rounded-xl items-center dial-tiny-text",L,o?"cursor-not-allowed opacity-75":"cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus",h),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",x),children:r})})})})]})},xu=({title:e,titleTooltip:t,description:r,data:n,compareData:a,compareLabels:o,maxValue:i,colorMap:l,defaultExpanded:d=!0,nonCollapsible:u,isLoading:p,onBarClick:h,inline:x,barTitleClassName:g,barValueClassName:y,barClassName:v,barDescriptions:b,className:C})=>{const I=Object.entries(n),S=x?f.mergeClasses("text-secondary",g):g,N=o?"dial-tiny-text text-secondary":void 0,j=t?s.jsx(c.Tooltip,{tooltip:t,children:e}):e,E=a?[...new Set([...Object.keys(n),...Object.keys(a)])]:[],A="cursor-pointer rounded-xs text-left focus-visible:outline focus-visible:outline-focus",L="group flex flex-col gap-1.5",D=f.mergeClasses("flex flex-col gap-1.5 pl-2",h&&"group-hover:bg-accent-primary-alpha group-focus-visible:bg-accent-primary-alpha",v);return s.jsx(ja,{title:j,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":x?"gap-2":"gap-3"),children:p?s.jsx(We,{size:18,fullWidth:!1,className:"self-center"}):a?E.map(w=>{const T=w in n?n[w]:null,_=w in a?a[w]:null,k=typeof T=="number"&&typeof _=="number"?parseFloat((_-T).toFixed(3)):null,R=k!=null&&k!==0,M=R&&k>0,H=R?M?`+${k}`:String(k):null,G=b?.[w],V=s.jsx("span",{className:"dial-small-text text-secondary",children:w}),Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[G?s.jsx(c.Tooltip,{tooltip:G,children:V}):V,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:D,children:[s.jsx(Vt,{title:o?.[0],value:T,maxValue:i,colorMap:l,inline:x,titleClassName:N,ariaLabel:w}),s.jsx(Vt,{title:o?.[1],value:_,maxValue:i,colorMap:l,inline:x,titleClassName:N,ariaLabel:`${w} compare`})]})]});return h?s.jsx("button",{type:"button",onClick:()=>h(w,T),className:f.mergeClasses(L,A),children:Z},w):s.jsx("div",{className:L,children:Z},w)}):I.map(([w,T])=>{const _=s.jsx(Vt,{title:w,value:T,maxValue:i,colorMap:l,inline:x,titleClassName:S,valueClassName:y,className:v}),B=h?s.jsx("button",{type:"button",onClick:()=>h(w,T),className:A,children:_}):_,k=b?.[w];return k?s.jsx(c.Tooltip,{tooltip:k,triggerClassName:"flex flex-col",children:B},w):s.jsx(m.Fragment,{children:B},w)})})})},bu="#FF4E50",vu=(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},tn=(e,t)=>{const r=t.map(()=>0);let n=0;e.forEach(d=>{if(d<=0){n+=1;return}const u=vu(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:bu,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]},wa=e=>e<=0?2:e%2===0?e:e+1,yu=e=>{const t=wa(e);return[t,t/2,0]},Sr=e=>`${Math.round(e*100)/100}`,Da=(e,t)=>e===t?Sr(e):`${Sr(e)}-${Sr(t)}`,Nr=128,Cu=(e,t)=>{const r=Da(e,t);return e===t?`scored ${r}`:`scored between ${r}`},rn=(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:Cu(a.from,a.to)})]}),Iu=({title:e,values:t,colorMap:r=hs,valueTitle:n="values",showCount:a,isLoading:o,className:i,compareValues:l,valueSetLabel:d,compareValueSetLabel:u})=>{const p=tn(t,r),h=l?tn(l,r):void 0,x=t.length,g=l?.length??0,y=Math.max(x,g),v=wa(y),b=yu(y),C=j=>j.map(E=>({...E,ratio:v>0?E.count/v:0})),I=C(p),S=h?C(h):void 0,N=(j,E,A,L)=>{if(j.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:`${j.ratio*100}%`}})});const D=L?{backgroundImage:`repeating-linear-gradient(135deg, ${j.color} 0px, ${j.color} 1px, transparent 1px, transparent 4px)`,borderColor:j.color}:{backgroundColor:j.color};return s.jsx(c.Tooltip,{placement:c.TooltipPlacement.Bottom,tooltip:E,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:`${j.ratio*100}%`,...D},children:a&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:j.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:Nr},children:s.jsx(We,{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:Nr},children:b.map((j,E)=>s.jsx("span",{className:"dial-tiny-text absolute right-0 whitespace-nowrap text-secondary",style:{top:`${E/(b.length-1)*100}%`,transform:"translateY(-50%)"},children:j},j))}),s.jsxs("div",{className:"relative min-w-0",children:[b.map((j,E)=>s.jsx("div",{"data-histogram-grid":!0,className:"pointer-events-none absolute inset-x-0 border-t border-primary",style:{top:`${E/(b.length-1)*100}%`}},j)),s.jsx("div",{className:"relative flex items-end gap-1",style:{height:Nr},children:S?I.map((j,E)=>{const A=S[E],L=`${j.count} out of ${x} ${n}`,D=`${A.count} out of ${g} ${n}`;return s.jsxs("div",{className:"flex h-full flex-1 items-end",children:[N(j,rn(d,j.count,x,n,j),L,!0),N(A,rn(u,A.count,g,n,A),D,!1)]},E)}):I.map((j,E)=>{const A=`${j.count} out of ${x} ${n}`;return j.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:`${j.ratio*100}%`}})},E):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:`${j.ratio*100}%`,backgroundColor:j.color},children:a&&j.count>0&&s.jsx("span",{className:"dial-tiny-semi-text text-primary",children:j.count})})},E)})})]}),s.jsx("div",{}),s.jsx("div",{"data-histogram-x-axis":!0,className:"flex gap-1",children:I.map((j,E)=>s.jsx("span",{className:"dial-caption-text flex-1 text-center text-secondary",children:Da(j.from,j.to)},E))})]})]})},Su=({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]})]})},Nu="z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6",ju="relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto",wu="flex flex-row items-center justify-between px-6 py-4",Du="flex-1 min-w-0 mr-3 truncate dial-h2-text text-primary",Tu="border-b border-tertiary",Eu="flex flex-row items-center gap-2 px-6 py-4",Lu="border-t border-tertiary",jr="flex shrink-0 flex-row items-center gap-2",Au="ml-auto mobile:flex-1",Jt="mobile:flex-1",_u={[Ge.Sm]:"max-w-full md:max-w-[400px]",[Ge.Md]:"max-w-full md:max-w-[800px]",[Ge.Lg]:"max-w-full md:max-w-[1200px]"},ms=({open:e=!1,header:t,ariaLabel:r,portalId:n,className:a,overlayClassName:o,overlayStyle:i,titleClassName:l,headerClassName:d,bodyClassName:u,children:p,footer:h,footerClassName:x,onClose:g,onBack:y,backAriaLabel:v="Back",headerActions:b,headerDivider:C=!1,mainButtons:I,additionalButtons:S,additionalButtonsOnLeft:N=!1,footerDivider:j=!1,size:E=Ge.Md,hideClose:A=!1,closeAriaLabel:L="Close dialog",closeOnOutsideClick:D=!0,preventKeyboardOnOpen:w=!1})=>{const T=c.useThemeScope(),_=m.useRef(null),B=m.useId(),{refs:k,context:R}=P.useFloating({open:e,onOpenChange:W=>{W||g?.(null)}}),M=P.useRole(R,{role:"dialog"}),H=P.useDismiss(R,{outsidePress:D}),{getFloatingProps:G}=P.useInteractions([M,H]);if(!e)return null;const V=typeof t=="string"?`popup-heading-${B}`:void 0,Z=W=>W?typeof W=="string"?s.jsx("h2",{id:V,className:f.mergeClasses(Du,l),children:s.jsx(c.Tooltip,{tooltip:W,triggerClassName:"truncate",children:W})}):W:s.jsx("span",{}),se=A?null:s.jsx(c.CloseButton,{ariaLabel:L,onClose:W=>g?.(W)}),re=(W,K=[],Y)=>K.map(({variant:ee=c.ButtonVariant.Neutral,className:ne,...he},ye)=>s.jsx(Xe,{variant:ee,className:f.mergeClasses(Y,ne),...he},`${W}-${ye}`)),le=()=>{if(h!==void 0)return h;if(!I?.length&&!S?.length)return null;const W=re("additional",S,N?void 0:Jt);return s.jsxs("div",{className:f.mergeClasses(Eu,j&&Lu,x),children:[N&&W.length>0&&s.jsx("div",{className:jr,children:W}),s.jsxs("div",{className:f.mergeClasses(jr,Au),children:[!N&&W,re("main",I,Jt)]})]})};return s.jsx(P.FloatingPortal,{id:n,children:s.jsx(P.FloatingOverlay,{style:i,className:f.mergeClasses(Nu,T,o),children:s.jsx(P.FloatingFocusManager,{context:R,initialFocus:w?_:k.floating,children:s.jsxs("div",{ref:k.setFloating,...G(),role:"dialog","aria-modal":"true","aria-labelledby":V,"aria-label":V?void 0:r,className:f.mergeClasses(ju,_u[E],a,c.DIAL_KIT_CLASS.popup),children:[w&&s.jsx("div",{ref:_,tabIndex:-1,"aria-hidden":!0,className:"absolute size-px -m-px overflow-hidden opacity-0 pointer-events-none"}),s.jsxs("div",{className:f.mergeClasses(wu,C&&Tu,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"})}),Z(t),b?s.jsxs("div",{className:jr,children:[b,se]}):se]}),s.jsx("div",{className:f.mergeClasses("grow overflow-auto",u),children:p}),le()]})})})})},Ou="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",ku="text-secondary dial-small-paragraph-text px-6 pb-4",Ru="px-6 py-4 h-[120px]",Mu="Cancel",Pu="Ok",sn={[it.Info]:{confirm:{variant:c.ButtonVariant.Primary,appearance:c.ButtonAppearance.Solid}},[it.Danger]:{confirm:{variant:c.ButtonVariant.Danger,appearance:c.ButtonAppearance.Solid}}},Ta=({header:e,description:t,descriptionClassName:r,open:n=!1,confirmLabel:a=Pu,cancelLabel:o=Mu,isLoading:i=!1,disableConfirmButton:l=!1,className:d,confirmClassName:u,onClose:p,onConfirm:h,onCancel:x,children:g,variant:y=it.Info,size:v=Ge.Sm,footer:b,hideClose:C,...I})=>{const S=i?null:s.jsxs("div",{className:Ou,children:[s.jsx(ur,{className:Jt,label:o,onClick:()=>x?x():p?.()}),s.jsx(Xe,{variant:sn[y].confirm.variant,appearance:sn[y].confirm.appearance,className:f.mergeClasses(Jt,u),label:a,disabled:l,onClick:h})]}),N=m.useCallback(()=>i?s.jsx("div",{className:Ru,children:s.jsx(We,{size:40})}):g??(t?s.jsx("div",{className:f.mergeClasses(ku,r),children:t}):null),[g,t,i,r]);return s.jsx(ms,{...I,open:n,header:e,className:f.mergeClasses(d,c.DIAL_KIT_CLASS.confirmationPopup),onClose:()=>p?.(),footer:b??S,size:v,hideClose:C??(!i&&b===void 0),children:N()})},Bu="dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left",zu="min-w-0 flex-1 truncate text-primary",Fu="min-w-0 flex-1 truncate text-secondary",Hu="shrink-0 text-secondary",$u="px-6 pb-4",Ku="flex justify-end gap-2 px-6 py-4 border-t border-tertiary",Vu="Cancel",Wu="Apply",Gu=({items:e,value:t,customValue:r,header:n,onApply:a,id:o,labelProps:i,placeholder:l,selectedValue:d,onSelectionChange:u,onCancel:p,onClose:h,isValid:x=!0,applyButtonLabel:g=Wu,cancelButtonLabel:y=Vu,size:v=Ge.Md,portalId:b,disabled:C,invalid:I,error:S,caption:N,ariaLabel:j,className:E,fieldClassName:A})=>{const L=m.useId(),D=o??L,w=`${D}-label`,T=`${D}-value`,_=S?`${D}-error`:void 0,B=!S&&N?`${D}-caption`:void 0,[k,R]=m.useState(!1),M=d!==void 0,[H,G]=m.useState(t),V=M?d:H,Z=m.useCallback(()=>{C||(M||G(t),R(!0))},[C,M,t]),se=m.useCallback(()=>{R(!1),h?.()},[h]),re=m.useCallback(()=>{p?.(),se()},[p,se]),le=m.useCallback(()=>{a(V),se()},[a,V,se]),W=m.useCallback(O=>{M||G(O),u?.(O)},[M,u]),K=c.resolveAccessibleName(i?.label),Y=K?void 0:c.resolveAccessibleName(j),ee=K?w:Y&&`${D}-name`,ne=c.resolveAccessibleName(n),he=e.find(O=>O.value===t)?.label,ye=r??he;return s.jsxs("div",{className:f.mergeClasses("flex w-full flex-col gap-2",E,c.DIAL_KIT_CLASS.radioGroupPopupField),children:[i&&s.jsx(c.Label,{...i,id:w,htmlFor:D}),s.jsxs("div",{className:"flex flex-col gap-1",children:[Y&&s.jsx("span",{id:ee,className:"sr-only",children:Y}),s.jsxs("button",{type:"button",id:D,disabled:C,"aria-haspopup":"dialog","aria-expanded":k,"aria-labelledby":ee?`${ee} ${T}`:void 0,"aria-describedby":[_,B].filter(Boolean).join(" ")||void 0,onClick:Z,className:f.mergeClasses(Bu,I&&"dial-kit-input-error",C&&"dial-kit-input-disable",A),children:[s.jsx("span",{id:T,className:ye==null?Fu:zu,children:ye??l}),s.jsx(F.IconMaximize,{size:f.DIAL_ICON_SIZE.MD,stroke:f.DIAL_KIT_ICON_STROKE,"aria-hidden":"true",className:Hu})]}),s.jsx(c.ErrorText,{id:_,text:S}),!S&&s.jsx(c.CaptionText,{id:B,text:N})]}),s.jsx(ms,{open:k,header:n,ariaLabel:ne?void 0:K,portalId:b,size:v,onClose:re,footer:s.jsxs("div",{className:Ku,children:[s.jsx(ur,{label:y,onClick:re}),s.jsx(is,{label:g,disabled:!x,onClick:le})]}),children:s.jsx("div",{className:$u,children:s.jsx(jt,{id:`${D}-options`,items:e,value:V,onChange:W,orientation:Oe.Column,ariaLabel:K??ne})})})]})},Uu=({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(h=>{a?.(h),n?.(!r)},[a,n,r]),p=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:p}):p},Zu={default:"dial-tiny-text",selected:"dial-tiny-semi-text"},qu={default:"cursor-not-allowed text-control-disable-primary",selected:"cursor-not-allowed bg-control-disable-primary text-control-disable-primary"},Yu=({label:e,icon:t,isSelected:r=!1,onToggle:n,onClick:a,disabled:o=!1,className:i,title:l,...d})=>{const u=m.useCallback(h=>{a?.(h),!h.defaultPrevented&&n?.(!r)},[a,n,r]),p=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(la,Zu[p],o?qu[p]:[ca[Ne.Selectable][p],da,ua],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})]})},Xu=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"],Qu="inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]",Ju="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",ef="bg-layer-raised text-accent shadow-xs",tf="bg-transparent text-secondary",rf="cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active",sf="cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active",nf="cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none",af="cursor-not-allowed bg-transparent text-control-disable-primary",of=({items:e,value:t,onChange:r,disabled:n,className:a,segmentClassName:o,"aria-label":i})=>{const l=m.useRef({}),d=e.find(h=>h.value===t),u=d&&!d.disabled?d.value:e.find(h=>!h.disabled)?.value,p=m.useCallback(h=>{if(n||!Xu.includes(h.key))return;const x=e.filter(C=>!C.disabled);if(x.length===0)return;const g=Math.max(x.findIndex(C=>C.value===t),0),y=x.length-1;let v=g;switch(h.key){case"ArrowRight":case"ArrowDown":v=g===y?0:g+1;break;case"ArrowLeft":case"ArrowUp":v=g===0?y:g-1;break;case"Home":v=0;break;case"End":v=y;break}h.preventDefault();const b=x[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:p,className:f.mergeClasses(Qu,a,c.DIAL_KIT_CLASS.segmentedControl),children:e.map(h=>{const x=h.value===t,g=n||h.disabled;return s.jsxs("button",{ref:y=>{l.current[h.value]=y},type:"button",role:"radio","aria-checked":x,"aria-label":c.resolveAccessibleName(h["aria-label"],typeof h.label=="string"?h.label:void 0),tabIndex:h.value===u?0:-1,disabled:g,onClick:()=>r(h.value),className:f.mergeClasses(Ju,x?ef:tf,g?x?nf:af:x?rf:sf,o,c.DIAL_KIT_CLASS.segmentedControlItem),children:[h.icon,h.label]},h.value)})})},lf={[ot.Error]:"Error",[ot.Warning]:"Warning"},cf={[Ue.Horizontal]:{next:"ArrowRight",previous:"ArrowLeft"},[Ue.Vertical]:{next:"ArrowDown",previous:"ArrowUp"}},df=({tabs:e,activeTabId:t,onTabChange:r,orientation:n=Ue.Horizontal,sectionLabel:a,ariaLabel:o,className:i,tabListClassName:l,tabClassName:d,sectionLabelClassName:u})=>{const p=m.useRef({}),h=m.useId(),x=n===Ue.Vertical,g=e.find(C=>C.id===t),y=g&&!g.disabled?g.id:e.find(C=>!C.disabled)?.id,v=m.useCallback(C=>{const{next:I,previous:S}=cf[n];if(![I,S,"Home","End"].includes(C.key)||e.length===0)return;const N=e.filter(D=>!D.disabled);if(N.length===0)return;const j=Math.max(N.findIndex(D=>D.id===t),0),E=N.length-1;let A=j;C.key===I?A=j===E?0:j+1:C.key===S?A=j===0?E:j-1:C.key==="Home"?A=0:A=E,C.preventDefault();const L=N[A];p.current[L.id]?.focus(),L.id!==t&&r(L.id)},[e,t,r,n]),b=s.jsx("div",{role:"tablist","aria-orientation":x?"vertical":void 0,"aria-label":o,"aria-labelledby":!o&&a?h:void 0,onKeyDown:v,className:f.mergeClasses(x?"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:N=>{p.current[C.id]=N},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",x?["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&&(x?"cursor-not-allowed text-control-disable-primary":"cursor-not-allowed border-control-disable-primary text-control-disable-primary"),!S&&(x?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(x&&!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",x&&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??lf[C.status]})]}),C.count!=null&&s.jsx("span",{className:f.mergeClasses("dial-tiny-semi-text rounded-full px-1.5 py-0.5",x&&"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",x?"px-4":"px-3"),children:s.jsx("span",{id:h,className:f.mergeClasses("dial-h1-text text-primary",u,c.DIAL_KIT_CLASS.tabsSectionLabel),children:a})}),b]}):b},uf="flex flex-nowrap items-center gap-1",ff="min-w-max flex-1 justify-center",pf=({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(uf,a,c.DIAL_KIT_CLASS.filterChips),children:e.map(d=>s.jsx(Ae,{label:d.label,icon:d.icon,appearance:Ne.Selectable,selected:d.value===t,onClick:()=>r(d.value),className:f.mergeClasses(n&&ff,o)},d.value))}),Mr=(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})},hf=({labelProps:e,label:t,description:r,onChange:n,onReject:a,accept:o,multiple:i=!1,disabled:l=!1,errorText:d,icon:u,id:p,ariaLabel:h,className:x})=>{const g=m.useId(),y=p??`file-dropzone-${g}`,v=d?`${y}-error`:void 0,[b,C]=m.useState(!1),I=m.useRef(0),S=m.useCallback(w=>{if(w.length===0)return;const T=i?w:w.slice(0,1),_=T.filter(k=>Mr(k,o)),B=T.filter(k=>!Mr(k,o));B.length>0&&a?.(B),_.length>0&&n(_)},[o,i,n,a]),N=m.useCallback(w=>{S(Array.from(w.target.files??[])),w.target.value=""},[S]),j=m.useCallback(()=>{I.current=0,C(!1)},[]),E=m.useCallback(w=>{l||(w.preventDefault(),I.current+=1,C(!0))},[l]),A=m.useCallback(w=>{l||(w.preventDefault(),w.dataTransfer.dropEffect="copy")},[l]),L=m.useCallback(()=>{l||(I.current-=1,I.current<=0&&j())},[l,j]),D=m.useCallback(w=>{w.preventDefault(),!l&&(j(),S(Array.from(w.dataTransfer?.files??[])))},[l,j,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:N,"aria-label":c.resolveAccessibleName(typeof t!="string"?h:void 0),"aria-describedby":v,"aria-invalid":d?!0:void 0,className:"peer sr-only"}),s.jsxs("label",{htmlFor:y,onDragEnter:E,onDragOver:A,onDragLeave:L,onDrop:D,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",x,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})]})},Ea=({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 Ie=(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))(Ie||{});const mf={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"]},gf=new Map(Object.entries(mf).flatMap(([e,t])=>t.map(r=>[r,e]))),xf=e=>gf.get(e)??"other",nn="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)"},bf="#1B212D",vf={[Ie.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},[Ie.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:bf}},[Ie.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)"}},[Ie.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)"}},[Ie.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)"}},[Ie.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},[Ie.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},[Ie.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)"}},[Ie.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)"}},[Ie.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)"},[Ie.Other]:{path:"M6.80005 8H13.2M6.80005 10.2222H13.2M6.80005 12.4444H13.2",sheet:Pt}},yf=({size:e,kind:t})=>{const r=`dial-kit-file-gradient-${m.useId().replace(/[^\w-]/g,"")}`,{path:n,fillPath:a,sheet:o}=vf[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:nn,strokeWidth:"0.7",strokeLinecap:"round",strokeLinejoin:"round"}),a&&s.jsx("path",{d:a,fill:nn}),!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})]})})]})},Cf=({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)"})]})})]})},If=(e,t)=>(t??(e.includes(".")?e.split(".").pop():"")??"").trim().replace(/^\./,"").toLowerCase(),Sf=(e,t)=>e===_e.Folder?"Folder":t?`${t.toUpperCase()} file`:"File",Nf=(e,t,r)=>e===_e.Folder?s.jsx(Cf,{size:r}):s.jsx(yf,{size:r,kind:xf(t)}),gs=({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:p,sharedIndicatorTooltip:h})=>{if(e!==_e.File&&e!==_e.Folder)return null;const x=e===_e.File?If(t,r):"",g=Sf(e,x),y=d??(n?`${g}, shared`:g),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(We,{size:o,ariaLabel:u}):Nf(e,x,o),n&&s.jsx(Ea,{tooltip:h,className:f.mergeClasses("absolute -bottom-0.5 -left-0.5",p)})]})},La=({name:e,type:t=_e.File,fileExtension:r,icon:n,shared:a=!1,loading:o=!1,loadingLabel:i,iconSize:l,details:d,isInvalidName:u=!1,className:p,nameClassName:h,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,sharedLabel:y="Shared",hideTooltip:v=!1,tooltipContent:b})=>s.jsxs("div",{className:f.mergeClasses("flex w-full min-w-0 items-center gap-2",p,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(gs,{name:e,type:t,fileExtension:r,shared:a,loading:o,loadingLabel:i,size:l,sharedIndicatorClassName:x,sharedIndicatorTooltip:g,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",h),text:e,hideTooltip:v,customTooltipContent:b}),a&&s.jsx("span",{className:"sr-only",children:y}),d]})]}),jf=({className:e,...t})=>s.jsx(La,{...t,type:_e.Folder,className:f.mergeClasses(e,c.DIAL_KIT_CLASS.folderName)}),wf=({open:e,onClose:t,title:r,ariaLabel:n,onBack:a,backAriaLabel:o="Back",closeAriaLabel:i="Close",closeOnOutsideClick:l=!0,children:d,className:u,overlayClassName:p,headerClassName:h,style:x,overlayStyle:g,bodyClassName:y,titleClassName:v,portalId:b})=>{const C=c.useThemeScope(),I=`bottom-sheet-title-${m.useId()}`,{refs:S,context:N}=P.useFloating({open:e,onOpenChange:L=>{L||t()}}),j=P.useRole(N,{role:"dialog"}),E=P.useDismiss(N,{outsidePress:l}),{getFloatingProps:A}=P.useInteractions([j,E]);return e?s.jsx(P.FloatingPortal,{id:b,children:s.jsx(P.FloatingOverlay,{lockScroll:!0,style:g,className:f.mergeClasses("z-popup flex items-end bg-backdrop",C,p,c.DIAL_KIT_CLASS.bottomSheetOverlay),children:s.jsx(P.FloatingFocusManager,{context:N,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:x,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",h),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||{}),Be=(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))(Be||{});const Aa={[Be.Green1]:{background:"bg-green-1",foreground:"text-green-2"},[Be.Violet2]:{background:"bg-violet-2",foreground:"text-violet-1"},[Be.Brown]:{background:"bg-brown",foreground:"text-brown-2"},[Be.Red]:{background:"bg-red",foreground:"text-red"},[Be.Green2]:{background:"bg-green-2",foreground:"text-green-3"},[Be.Blue]:{background:"bg-blue",foreground:"text-accent"},[Be.Violet1]:{background:"bg-violet-1",foreground:"text-violet-2"}},Df=e=>{const t=Object.values(Aa);let r=0;for(let n=0;n<e.length;n++)r+=e.charCodeAt(n);return t[r%t.length]},an=e=>e.match(new RegExp("\\p{L}","u"))?.[0]??"",_a=e=>{const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length>=2?(an(t[0])+an(t[1])).toUpperCase()||"?":t[0].replace(/[^\p{L}]/gu,"").slice(0,2).toUpperCase()||"?"},Tf={[lt.Circle]:"rounded-full",[lt.Square]:"rounded-md"},Oa=({name:e,initials:t,src:r,alt:n="",size:a=32,shape:o=lt.Circle,color:i,className:l,textClassName:d,imageClassName:u,onImageError:p})=>{const[h,x]=m.useState(),g=!!r&&h!==r,y=n!=="",v=I=>f.mergeClasses("inline-flex shrink-0 select-none items-center justify-center overflow-hidden",Tf[o],I,l,c.DIAL_KIT_CLASS.avatar);if(g)return s.jsx("img",{src:r,alt:n,width:a,height:a,className:f.mergeClasses(v(u),"object-cover"),onError:I=>{x(r),p?.(I)}});const{background:b,foreground:C}=i??Df(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??_a(e)})})};var me=(e=>(e.Model="model",e.Agent="agent",e.Toolset="toolset",e.Skill="skill",e.Prompt="prompt",e))(me||{});const Ef={[me.Model]:"Model",[me.Agent]:"Agent",[me.Toolset]:"Toolset",[me.Skill]:"Skill",[me.Prompt]:"Prompt"},on={[me.Model]:"text-blue",[me.Agent]:"text-green-1",[me.Toolset]:"text-brown-2",[me.Skill]:"text-violet-1",[me.Prompt]:"text-violet-2"},Lf={[me.Model]:"bg-blue",[me.Agent]:"bg-green-2",[me.Toolset]:"bg-brown",[me.Skill]:"bg-violet-2",[me.Prompt]:"bg-violet-1"},Af=["h1","h2","h3","h4","h5","h6"],_f=e=>Af[Math.min(6,Math.max(1,Math.round(e)))-1],ka=({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:p,nameClassName:h="dial-h3-text",typeClassName:x="dial-caption-lead-semi-text",versionClassName:g="dial-tiny-text",iconClassName:y,featuredChipClassName:v})=>{const b=_f(i),C=a&&!!e.isFeatured,I=u!=null||C,S=n?e.version:void 0,N=r?t?.type??Ef[e.type]:void 0;return s.jsxs("div",{className:f.mergeClasses("flex items-start gap-2",p,c.DIAL_KIT_CLASS.entityIdentity),children:[s.jsx(Oa,{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||N)&&s.jsxs("div",{className:"relative flex items-center justify-between",children:[N&&s.jsx("span",{className:f.mergeClasses("uppercase",x,on[e.type]),children:N}),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",Lf[e.type],on[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",h),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",g),text:S})]}),d!=null&&d]})]})},wr="bg-control-neutral-active",Of=({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:Le.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:Le.Text,width:"30%",height:12,className:wr}),s.jsx($t,{variant:Le.Text,width:"60%",height:16,className:wr})]})]}),kf=({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:p})=>{const h=o!=null?s.jsx("span",{className:"dial-caption-text text-secondary",children:o}):void 0,x=()=>e?r?s.jsx(Of,{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}),h]}):s.jsx(ka,{item:t,labels:{type:i?.type},hasFeaturedTag:!1,iconSize:d,headingLevel:u,nameClassName:"dial-body-semi-text",showType:l,footer:h}):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",p,c.DIAL_KIT_CLASS.selectedEntityCard),children:x()}),s.jsx(c.ErrorText,{text:a,className:"mt-1 block"})]})},Rf=({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:p=!1,closeOnOutsideClick:h=!0,children:x,className:g,overlayClassName:y,headerClassName:v,style:b,overlayStyle:C,bodyClassName:I,titleClassName:S,portalId:N})=>{const j=c.useThemeScope(),E=`side-drawer-title-${m.useId()}`,A=typeof r=="string",{refs:L,context:D}=P.useFloating({open:e,onOpenChange:k=>{k||t()}}),w=P.useRole(D,{role:"dialog"}),T=P.useDismiss(D,{outsidePress:h}),{getFloatingProps:_}=P.useInteractions([w,T]),B=r!=null||o!=null||!p;return s.jsx(P.FloatingPortal,{id:N,children:s.jsx(P.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",j,y),children:s.jsx(P.FloatingFocusManager,{context:D,disabled:!e,initialFocus:L.floating,children:s.jsxs("div",{ref:L.setFloating,..._(),role:"dialog","aria-modal":"true","aria-labelledby":A?E: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",g,c.DIAL_KIT_CLASS.sideDrawer),children:[B&&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:E,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,!p&&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:x})]})})})})},Mf=4,Pf=24,ln=e=>parseFloat(e)||0,Bf=e=>{let t=e.length;for(;t>0&&e[t-1]===",";)t--;return e.slice(0,t)},zf=()=>{},Ff=({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:p=!1,collapseTagOverflow:h=!1,ariaLabel:x,tagListLabel:g="Tags",className:y,fieldClassName:v,tagClassName:b,onChange:C})=>{const I=m.useId(),S=e||I,N=n===c.ElementSize.Small,j=m.useRef(null),E=m.useRef([]),A=m.useRef(null),L=t!==void 0,[D,w]=m.useState(r??[]),T=L?t:D,_=T.length,[B,k]=m.useState(""),[R,M]=m.useState(_),H=!p&&!u,G=m.useCallback(O=>{L||w(O),C?.(O)},[L,C]),V=m.useCallback(O=>U=>{E.current[O]=U},[]),Z=m.useCallback(()=>{const O=j.current;if(!O||O.clientWidth===0){M(T.length);return}const{paddingLeft:U,paddingRight:de}=getComputedStyle(O);M(ia({availableWidth:O.clientWidth-ln(U)-ln(de)-(p?0:Pf),tagWidths:T.map((ae,xe)=>E.current[xe]?.offsetWidth??0),overflowChipWidth:A.current?.offsetWidth??0,gap:Mf}))},[p,T]);m.useEffect(()=>{if(!h){M(_);return}const O=j.current;if(!O)return;const U=new ResizeObserver(()=>Z());return U.observe(O),Z(),()=>U.disconnect()},[h,Z,_]);const se=f.mergeClasses(h?"shrink-0":"min-w-0",b),re=O=>{const U=Bf(O.trim()).trim();!U||T.includes(U)||G([...T,U])},le=O=>{G(T.filter(U=>U!==O))},W=()=>{re(B),k("")},K=O=>{if(H){if(O.key==="Enter"||O.key===","){O.preventDefault(),W();return}O.key==="Backspace"&&!B&&_>0&&(O.preventDefault(),G(T.slice(0,-1)))}},Y=()=>{H&&B.trim()&&W()},ee=h?T.slice(0,R):T,ne=h?T.slice(R):[],he=ne.join(", "),ye=_>0&&s.jsxs("span",{role:"list","aria-label":g,className:f.mergeClasses("relative flex min-w-0 items-center gap-1",h?"flex-nowrap":"flex-wrap"),children:[ee.map(O=>s.jsx(Ae,{role:"listitem",label:O,className:se,disabled:u,closable:H,onRemove:H?()=>le(O):void 0},O)),ne.length>0&&s.jsx(Ae,{role:"listitem",label:`+${ne.length}`,"aria-label":he,title:he,className:f.mergeClasses("shrink-0",b),disabled:u}),h&&s.jsxs("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 overflow-hidden whitespace-nowrap",children:[T.map((O,U)=>s.jsx("span",{ref:V(U),className:"inline-flex",children:s.jsx(Ae,{label:O,className:b,disabled:u,closable:H,onRemove:H?zf:void 0})},O)),s.jsx("span",{ref:A,className:"inline-flex",children:s.jsx(Ae,{label:`+${_}`,className:b})})]})]});return s.jsx(c.Input,{id:S,size:n,labelProps:a,caption:i,error:l,invalid:d,disabled:u,readOnly:p,value:B,placeholder:_>0?void 0:o,"aria-label":x,wrapperRef:j,onChange:O=>k(O??""),onKeyDown:K,onBlur:Y,containerClassName:f.mergeClasses("w-full",y),wrapperClassName:f.mergeClasses(_>0&&["!h-auto",N?"min-h-[24px] py-0.5":"min-h-[40px] py-[3px]",h?"flex-nowrap overflow-hidden":"flex-wrap"],v,c.DIAL_KIT_CLASS.tagInput),className:f.mergeClasses("w-auto flex-1",h?"min-w-[24px]":"min-w-[100px]",p&&"cursor-default"),children:ye})},Hf=(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))},$f=5,Kf=({id:e,value:t,defaultValue:r,suggestions:n,maxSuggestions:a=$f,openOnFocus:o=!1,size:i=c.ElementSize.Standard,labelProps:l,placeholder:d,caption:u,error:p,invalid:h=!1,disabled:x=!1,readOnly:g=!1,ariaLabel:y,tagListLabel:v="Tags",getRemoveTagLabel:b,className:C,fieldClassName:I,tagClassName:S,listClassName:N,onChange:j})=>{const E=m.useId(),A=e||E,L=`${A}-listbox`,D=c.useThemeScope(),w=i===c.ElementSize.Small,T=t!==void 0,[_,B]=m.useState(r??[]),k=T?t:_,R=k.length>0,M=!g&&!x,[H,G]=m.useState(""),[V,Z]=m.useState(!1),[se,re]=m.useState(0),le=!H.trim(),W=m.useMemo(()=>Hf(n,H,k,o&&le?n.length:a),[H,le,a,o,n,k]),K=V&&M&&W.length>0,Y=Math.min(se,W.length-1),ee=K&&Y>=0,ne=J=>`${L}-option-${J}`,{refs:he,floatingStyles:ye}=P.useFloating({open:K,placement:"bottom-start",whileElementsMounted:P.autoUpdate,middleware:[P.offset(c.overlayGap),P.flip({padding:c.overlayGap}),P.size({padding:c.overlayGap,apply({rects:J,availableHeight:ce,elements:ge}){ge.floating.style.width=`${Math.round(J.reference.width)}px`,ge.floating.style.maxHeight=`${Math.floor(ce)}px`}})]}),O=m.useCallback(J=>{T||B(J),j?.(J)},[T,j]),U=()=>{Z(!1),re(0)},de=()=>{!o||!M||(Z(!0),re(le?-1:0))},ae=J=>{const ce=J.trim();ce&&!k.includes(ce)&&O([...k,ce]),G(""),o?re(-1):U()},xe=J=>O(k.filter(ce=>ce!==J)),Qe=J=>{const ce=J??"",ge=!!ce.trim();G(ce),Z(ge||o),re(ge?0:-1)},ft=J=>{if(M)switch(J.key){case"ArrowDown":case"ArrowUp":{if(J.preventDefault(),!K){Z(!0),re(0);return}const ce=J.key==="ArrowDown"?1:-1,ge=Y<0?Math.min(-ce,0):Y;re((ge+ce+W.length)%W.length);return}case"Enter":case",":J.preventDefault(),ae(ee?W[Y].value:H);return;case"Escape":K&&J.preventDefault(),U();return;case"Backspace":!H&&R&&(J.preventDefault(),O(k.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":K,"aria-controls":L,"aria-activedescendant":ee?ne(Y):void 0,"aria-invalid":h||void 0,"aria-label":y,size:i,labelProps:l,caption:u,error:p,invalid:h,disabled:x,readOnly:g,value:H,placeholder:R?void 0:d,wrapperRef:he.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",w?"min-h-[24px]":"min-h-[40px]"],I,c.DIAL_KIT_CLASS.autocompleteTagInput),className:f.mergeClasses("w-auto min-w-[100px] flex-1",g&&"cursor-default"),children:R&&s.jsx("span",{role:"list","aria-label":v,className:"flex min-w-0 flex-wrap items-center gap-1",children:k.map(J=>s.jsx(Ae,{role:"listitem",label:J,className:f.mergeClasses(Xt,"min-w-0",S),disabled:x,closable:M,removeLabel:b?.(J),onRemove:M?()=>xe(J):void 0},J))})}),s.jsx(P.FloatingPortal,{children:s.jsx("div",{ref:he.setFloating,id:L,role:"listbox","aria-label":v,hidden:!K,style:ye,className:f.mergeClasses("z-floating overflow-y-auto",c.overlaySurfaceClassName,c.overlayListClassName,!K&&"hidden",D,N),children:K&&W.map((J,ce)=>{const ge=ce===Y;return s.jsx(c.MenuItem,{id:ne(ce),role:"option","aria-selected":ge,tabIndex:-1,label:J.label,description:J.description,mark:c.MenuItemMark.Tint,selected:ge,onMouseDown:pt,onMouseEnter:()=>re(ce),onClick:()=>ae(J.value)},J.value)})})})]})},Vf=(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)},Ra=e=>(e.toString().split(".")[1]??"").length,Wf=(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(Ra(n)))},Gf=12,cn=e=>`calc(${e}% + ${(.5-e/100)*Gf}px)`,Uf=(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)]",Zf=({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:p=!1,showTicks:h=!1,leftContent:x,rightContent:g,showValueInput:y=!1,valueInputAriaLabel:v,caption:b,error:C,onChange:I,containerClassName:S,trackClassName:N,fillClassName:j,className:E,...A})=>{const L=m.useId(),D=e??L,w=b&&!C?`${D}-caption`:void 0,T=C?`${D}-error`:void 0,_=n-r,B=_>0?Math.min(100,Math.max(0,(t-r)/_*100)):0,k=cn(B),R=h&&!o?Vf(_,a):[],M=p&&!o,H=x!=null,G=y||g!=null,V=Ra(a),[Z,se]=m.useState(null),re=d?d(t):t.toFixed(V),le=m.useCallback(Y=>{I?.(Number(Y.target.value))},[I]),W=m.useCallback(Y=>{const ee=Y==null?"":String(Y);se(ee);const ne=Number(ee);ee!==""&&Number.isFinite(ne)&&I?.(Wf(ne,r,n,a))},[n,r,I,a]),K=m.useCallback(()=>se(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:D}),u&&s.jsx("span",{"aria-hidden":"true",className:f.mergeClasses("dial-small-text ml-auto",o?"text-control-disable-primary":"text-primary"),children:re})]}),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",Uf(H,G),M&&"mt-2"),children:[H&&s.jsx("div",{className:"flex items-center",children:x}),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",N)}),R.map(Y=>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:cn(Y)}},Y)),s.jsx("div",{className:f.mergeClasses("pointer-events-none absolute left-0 h-1 rounded-full",o?"bg-control-disable-secondary":"bg-control-accent",j),style:{width:k}}),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:k},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:re}),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:D,value:t,min:r,max:n,step:a,disabled:o,onChange:le,"aria-label":c.resolveAccessibleName(typeof i?.label!="string"?A["aria-label"]:void 0),"aria-valuetext":d?re:void 0,"aria-describedby":T??w,className:f.mergeClasses("dial-kit-slider absolute inset-0 h-full w-full",E)})]}),G&&s.jsx("div",{className:"flex items-center",children:y?s.jsx(us,{"aria-label":c.resolveAccessibleName(v??(typeof i?.label=="string"?i.label:void 0)),value:Z??t.toFixed(V),min:r,max:n,step:a,disabled:o,size:c.ElementSize.Small,containerClassName:"w-12",className:"text-center",onChange:W,onBlur:K}):g}),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:T,text:C}),!C&&s.jsx(c.CaptionText,{id:w,text:b})]})]})},qf=48,Yf=({children:e,title:t,width:r=280,collapsedWidth:n=qf,isOpened:a,defaultOpened:o=!0,onToggle:i,additionalButtons:l,ariaLabel:d="Sidebar",collapseLabel:u="Collapse sidebar",expandLabel:p="Expand sidebar",className:h,titleClassName:x,contentClassName:g,footerClassName:y})=>{const v=a!==void 0,[b,C]=m.useState(o),I=v?a:b,S=`collapsible-sidebar-content-${m.useId()}`,N=I?u:p,j=E=>{const A=!I;v||C(A),i?.(A,E)};return s.jsxs("aside",{"aria-label":d,style:{width:`${I?r:n}px`},className:f.mergeClasses("flex flex-col justify-between",h,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",g),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",x),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:j,"aria-label":N,"aria-expanded":I,"aria-controls":S,tooltipProps:{tooltip:N},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)},dn={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},un={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Bt={width:"20px",height:"20px",position:"absolute",zIndex:1},Xf={top:ie(ie({},dn),{top:"-5px"}),right:ie(ie({},un),{left:void 0,right:"-5px"}),bottom:ie(ie({},dn),{top:void 0,bottom:"-5px"}),left:ie(ie({},un),{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"})},Qf=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"},Xf[r]),a??{})},[a,r]);return s.jsx("div",{className:o||void 0,style:d,onMouseDown:i,onTouchStart:l,children:n})}),Jf=(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)}})(),Ee=function(){return Ee=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},Ee.apply(this,arguments)},ep={width:"auto",height:"auto"},zt=function(e,t,r){return Math.max(Math.min(e,r),t)},fn=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)},tp=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},pn=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},Dr=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},rp=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)}},sp=function(e){return Array.isArray(e)?e:[e,e]},np=["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"],hn="__resizable_base__",ap=(function(e){Jf(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(hn):u.className+=hn,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||ep},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(),p=Number(r.state[l].toString().replace("px","")),h=p/u[l]*100;return"".concat(h,"%")}return Dr(r.state[l])},o=n&&typeof n.width<"u"&&!this.state.isResizing?Dr(n.width):a("width"),i=n&&typeof n.height<"u"&&!this.state.isResizing?Dr(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 p=this.parentNode;p&&(d=i?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:p.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=sp(this.props.resizeRatio||1),i=o[0],l=o[1],d=this.state,u=d.direction,p=d.original,h=this.props,x=h.lockAspectRatio,g=h.lockAspectRatioExtraHeight,y=h.lockAspectRatioExtraWidth,v=p.width,b=p.height,C=g||0,I=y||0;return rt("right",u)&&(v=p.width+(r-p.x)*i/a,x&&(b=(v-I)/this.ratio+C)),rt("left",u)&&(v=p.width-(r-p.x)*i/a,x&&(b=(v-I)/this.ratio+C)),rt("bottom",u)&&(b=p.height+(n-p.y)*l/a,x&&(v=(b-C)*this.ratio+I)),rt("top",u)&&(b=p.height-(n-p.y)*l/a,x&&(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,p=typeof o.width>"u"?10:o.width,h=typeof a.width>"u"||a.width<0?r:a.width,x=typeof o.height>"u"?10:o.height,g=typeof a.height>"u"||a.height<0?n:a.height,y=d||0,v=u||0;if(l){var b=(x-y)*this.ratio+v,C=(g-y)*this.ratio+v,I=(p-v)/this.ratio+y,S=(h-v)/this.ratio+y,N=Math.max(p,b),j=Math.min(h,C),E=Math.max(x,I),A=Math.min(g,S);r=zt(r,N,j),n=zt(n,E,A)}else r=zt(r,p,h),n=zt(n,x,g);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,p=i.bottom;this.resizableLeft=l*r,this.resizableRight=u*r,this.resizableTop=d*r,this.resizableBottom=p*r}},t.prototype.onResizeStart=function(r,n){if(!(!this.resizable||!this.window)){var a=0,o=0;if(r.nativeEvent&&tp(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 p=this.window.getComputedStyle(u).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",l=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:a,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ee(Ee({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(r.target).cursor||"auto"}),direction:n,flexBasis:l};this.setState(h)}},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,p=Ft(r)?r.touches[0].clientY:r.clientY,h=this.state,x=h.direction,g=h.original,y=h.width,v=h.height,b=this.getParentSize(),C=rp(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,p),S=I.newHeight,N=I.newWidth,j=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(N=pn(N,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(S=pn(S,this.props.snap.y,this.props.snapGap));var E=this.calculateNewSizeFromAspectRatio(N,S,{width:j.maxWidth,height:j.maxHeight},{width:l,height:d});if(N=E.newWidth,S=E.newHeight,this.props.grid){var A=fn(N,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),L=fn(S,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),D=this.props.snapGap||0,w=D===0||Math.abs(A-N)<=D?A:N,T=D===0||Math.abs(L-S)<=D?L:S;N=w,S=T}var _={width:N-g.width,height:S-g.height};if(this.delta=_,y&&typeof y=="string"){if(y.endsWith("%")){var B=N/b.width*100;N="".concat(B,"%")}else if(y.endsWith("vw")){var k=N/this.window.innerWidth*100;N="".concat(k,"vw")}else if(y.endsWith("vh")){var R=N/this.window.innerHeight*100;N="".concat(R,"vh")}}if(v&&typeof v=="string"){if(v.endsWith("%")){var B=S/b.height*100;S="".concat(B,"%")}else if(v.endsWith("vw")){var k=S/this.window.innerWidth*100;S="".concat(k,"vw")}else if(v.endsWith("vh")){var R=S/this.window.innerHeight*100;S="".concat(R,"vh")}}var M={width:this.createSizeForCssProperty(N,"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,G=this.state.height!==M.height,V=this.state.flexBasis!==M.flexBasis,Z=H||G||V;Z&&qa.flushSync(function(){n.setState(M)}),this.props.onResize&&Z&&this.props.onResize(r,x,this.resizable,_)}},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:Ee(Ee({},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 p=Object.keys(a).map(function(h){return a[h]!==!1?s.jsx(Qf,{direction:h,onResizeStart:r.onResizeStart,replaceStyles:o&&o[h],className:i&&i[h],children:u&&u[h]?u[h]:null},h):null});return s.jsx("div",{className:d,style:l,children:p})},t.prototype.render=function(){var r=this,n=Object.keys(this.props).reduce(function(i,l){return np.indexOf(l)!==-1||(i[l]=r.props[l]),i},{}),a=Ee(Ee(Ee({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,Ee({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 op=({side:e,isResizing:t,width:r,minWidth:n,maxWidth:a,step:o,ariaLabel:i,onWidthChange:l,customHandler:d,handlerClassName:u})=>{const p=e===It.Left,h=p?F.IconChevronLeft:F.IconChevronRight,x=g=>{let y;switch(g.key){case"ArrowLeft":y=r+(p?o:-o);break;case"ArrowRight":y=r+(p?-o:o);break;case"Home":y=n;break;case"End":y=a;break;default:return}g.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:x,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(h,{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",p?"right-full":"left-full")})})},ip=16,Ma=({children:e,minWidth:t,maxWidth:r,width:n,defaultWidth:a,onResizeStop:o,onResize:i,side:l=It.Right,keyboardStep:d=ip,ariaLabel:u="Resize panel",className:p,resizeHandlerClassName:h,resizeHandler:x})=>{const[g,y]=m.useState(!1),[v,b]=m.useState(a??t),C=n!==void 0,I=C?n:v,S=m.useRef(null),N=m.useCallback(()=>{y(!0)},[]),j=m.useCallback(()=>{y(!1);const L=S.current?.resizable?.getBoundingClientRect(),D=L?Math.round(L.width):t;C||b(D),o?.(D)},[o,C,t]),E=m.useCallback(L=>{const D=Math.min(r,Math.max(t,L));D!==I&&(C||(b(D),S.current?.updateSize({width:D,height:"100%"})),i?.(D),o?.(D))},[r,t,I,C,i,o]),A=m.useMemo(()=>{const L=l===It.Left,D=s.jsx(op,{side:l,isResizing:g,width:I,minWidth:t,maxWidth:r,step:d,ariaLabel:u,onWidthChange:E,customHandler:x,handlerClassName:h});return{size:C?{width:I,height:"100%"}:void 0,defaultSize:C?void 0:{width:I,height:"100%"},minWidth:t,maxWidth:r,enable:{left:L,right:!L},handleClasses:{right:"group",left:"group"},handleStyles:{right:{right:"-8px",zIndex:10},left:{left:0,zIndex:10}},handleComponent:{left:L?D:void 0,right:L?void 0:D},onResizeStart:N,onResize:(w,T,_)=>{i?.(Math.round(_.offsetWidth))},onResizeStop:j}},[l,C,I,t,r,d,u,E,x,h,g,N,j,i]);return s.jsx(ap,{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",p,c.DIAL_KIT_CLASS.resizableContainer),children:e})})},lp=16,cp=1e3,dp=4,Tr=e=>e==null?!1:(e.closest("[dir]")?.getAttribute("dir")??e.ownerDocument.defaultView?.getComputedStyle(e).direction)==="rtl",up=({width:e,minWidth:t,maxWidth:r,defaultWidth:n,onWidthChange:a,label:o,tooltip:i,keyboardStep:l=lp,className:d})=>{const[u,p]=m.useState(!1),[h,x]=m.useState(!1),[g,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),N=m.useRef(void 0);m.useEffect(()=>()=>{clearTimeout(S.current),N.current!=null&&cancelAnimationFrame(N.current)},[]);const j=m.useCallback(R=>{const M=Number.isFinite(R)?R:t;return Math.round(Math.min(r,Math.max(t,M)))},[r,t]),E=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(()=>x(!0),cp)},L=R=>{E(R),A(R)},D=()=>{y(!1),clearTimeout(S.current),x(!1)},w=R=>{R.button===0&&(R.currentTarget.setPointerCapture(R.pointerId),I.current={x:R.clientX,width:e},p(!0))},T=R=>{E(R);const M=I.current;if(M==null){Math.hypot(R.clientX-C.current.x,R.clientY-C.current.y)>dp&&(x(!1),A(R));return}const H=Tr(v.current)?-1:1,G=j(M.width+(R.clientX-M.x)*H);N.current!=null&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame(()=>a(G))},_=R=>{I.current!=null&&(I.current=null,p(!1),R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},B=R=>{const M=Tr(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(j(H))},k=()=>{n!=null&&a(j(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",g&&"dial-resize-handle-cursor-ready",h&&"dial-resize-handle-hover",u&&"dial-resize-handle-dragging",d,c.DIAL_KIT_CLASS.resizeHandle),onPointerEnter:L,onPointerLeave:D,onPointerDown:w,onPointerMove:T,onPointerUp:_,onPointerCancel:_,onKeyDown:B,onDoubleClick:k,children:s.jsx(c.Tooltip,{tooltip:i,open:h&&!u,placement:Tr(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})})})})},fp=({enabled:e=!0,children:t,...r})=>e?s.jsx(Ma,{...r,children:t}):t,Pa=({title:e,description:t,icon:r,action:n,className:a,titleClassName:o,descriptionClassName:i,announce:l})=>{const d=m.useId(),u=s.jsxs("section",{"aria-labelledby":d,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:d,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})]});return l==null?u:s.jsx(c.LiveRegion,{politeness:l,className:"size-full",children:u})};class pp extends m.Component{state={hasError:!1};static getDerivedStateFromError=()=>({hasError:!0});componentDidCatch(t,r){this.props.onCatch(t,r)}render(){return this.state.hasError?null:this.props.children}}const hp=s.jsx(F.IconAlertTriangle,{size:f.DIAL_ICON_SIZE.LG,stroke:f.DIAL_KIT_ICON_STROKE}),mp=(e=[],t=[])=>e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n])),gp=({children:e,title:t,description:r,actionLabel:n,onReset:a,resetKeys:o,onError:i,icon:l=hp,className:d})=>{const[u,p]=m.useState(!1),h=m.useRef(o);m.useEffect(()=>{u&&mp(h.current,o)&&p(!1),h.current=o},[u,o]);const x=(y,v)=>{p(!0),i?.(y,v)},g=()=>{if(!a){window.location.reload();return}a(),p(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(c.LiveRegion,{politeness:c.LiveRegionPoliteness.Assertive,visuallyHidden:!0,children:u&&t}),u?s.jsx(Pa,{icon:l,title:t,description:r,className:d,action:s.jsx(is,{autoFocus:!0,label:n,onClick:g})}):s.jsx(pp,{onCatch:x,children:e})]})},mn=({src:e,className:t})=>{const[r,n]=m.useState();return r===e?null:s.jsx("img",{src:e,alt:"","aria-hidden":"true",className:t,onError:()=>n(e)})},xp=({title:e,description:t,logoSrc:r,providers:n=[],providersLabel:a,children:o,titleRef:i,className:l})=>{const d=m.useId();return s.jsxs("section",{"aria-labelledby":d,className:f.mergeClasses("relative flex size-full items-center justify-center overflow-hidden bg-layer-sunken mobile:items-start mobile:bg-layer-raised mobile:px-6",l,c.DIAL_KIT_CLASS.loginScreen),children:[s.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[s.jsx("div",{className:"absolute -start-1/4 -bottom-1/3 size-[80vmax] rounded-full bg-radial from-gradient-2 to-transparent to-70% opacity-20 blur-3xl"}),s.jsx("div",{className:"absolute -end-1/4 -top-1/3 size-[80vmax] rounded-full bg-radial from-gradient-1 to-transparent to-70% opacity-20 blur-3xl"})]}),s.jsxs("div",{className:"relative mx-6 my-8 flex flex-col items-center gap-12 rounded-xl bg-layer-raised p-16 mobile:mx-0 mobile:mt-10 mobile:w-full mobile:rounded-none mobile:bg-transparent mobile:p-0",children:[r&&s.jsx(mn,{src:r,className:"size-8 shrink-0 object-contain"}),s.jsxs("div",{className:"flex w-full flex-col items-center gap-8 mobile:gap-6",children:[s.jsx("h1",{id:d,ref:i,tabIndex:-1,className:"dial-display2-text text-center text-primary",children:e}),s.jsxs("div",{className:"flex w-full flex-col items-center gap-5 desktop:w-100",children:[o,n.length>0&&s.jsxs(s.Fragment,{children:[t!=null&&s.jsx("p",{className:"dial-body-text text-center text-primary",children:t}),s.jsx("ul",{"aria-label":a,className:"m-0 flex w-full list-none flex-col gap-3 p-0",children:n.map(u=>s.jsx("li",{children:s.jsx(ur,{href:u.href,label:u.label,iconBefore:u.iconSrc?s.jsx(mn,{src:u.iconSrc,className:"size-5 shrink-0"}):void 0,className:"w-full"})},u.id))})]})]})]})]})]})};var at=(e=>(e.Row="row",e.Caption="caption",e.Setting="setting",e))(at||{});const bp={[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"}},vp=({title:e,action:t,description:r,variant:n=at.Row,headingLevel:a=3,children:o,className:i,titleClassName:l,descriptionClassName:d,contentClassName:u})=>{const p=m.useId(),h=bp[n],x=`h${a}`;return s.jsxs("section",{"aria-labelledby":p,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",h.header),children:[s.jsx(x,{id:p,className:f.mergeClasses("min-w-0 text-primary",h.title,l),children:e}),t!=null&&s.jsx("div",{className:"shrink-0",children:t})]}),r!=null&&s.jsx("p",{className:f.mergeClasses("text-secondary",h.description,d),children:r}),o!=null&&s.jsx("div",{className:f.mergeClasses("relative",u),children:o})]})};var De=(e=>(e.InProgress="inProgress",e.Success="success",e.Warning="warning",e.Failed="failed",e.Canceled="canceled",e))(De||{});const Ba=8e3,Dt="flex size-7 shrink-0 items-center justify-center",za={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"},yp=({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})]})]})},gn=({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})})})},Pr=2,Br=(f.DIAL_ICON_SIZE.SM-Pr)/2,xn=2*Math.PI*Br,Cp=({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:Br,fill:"none",strokeWidth:Pr,className:"stroke-(--stroke-secondary,#d1dbea)"}),s.jsx("circle",{cx:a,cy:a,r:Br,fill:"none",strokeWidth:Pr,strokeLinecap:"round",strokeDasharray:xn,strokeDashoffset:xn*(1-n/100),className:"stroke-(--stroke-accent,#1d4ed8) transition-[stroke-dashoffset] duration-200 motion-reduce:transition-none"})]})})},Ip=({item:e,labels:t,onCancel:r})=>{const n=e.status===De.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(gs,{type:_e.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===De.InProgress&&s.jsxs("div",{className:f.mergeClasses(Dt,"grid"),children:[typeof e.percent=="number"?s.jsx(Cp,{percent:e.percent,label:t.itemProgressAriaLabel(e.name),className:a}):s.jsx(We,{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===De.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===De.Warning&&s.jsx(gn,{message:e.message||t.warningMessage,isError:!1}),e.status===De.Failed&&s.jsx(gn,{message:e.message||t.failedMessage,isError:!0}),n&&s.jsx("span",{className:"dial-small-text shrink-0 text-secondary",children:t.canceledLabel})]})},Sp=e=>Math.round(e.reduce((t,r)=>t+(r.percent??(r.status===De.InProgress?0:100)),0)/e.length),Np=(e,t)=>e?t.closeConfirmDescriptionMixed:t.closeConfirmDescriptionInProgress,jp=({title:e,items:t,onClose:r,onCancelItem:n,labels:a,autoCloseDelay:o=Ba,className:i,bodyClassName:l})=>{const[d,u]=m.useState(!1),[p,h]=m.useState(!1),x=m.useId(),g={...za,...a},y=t.filter(j=>j.status===De.InProgress).length,v=y>0,b=t.some(j=>j.status===De.Failed),C=t.length>0&&t.every(j=>j.status===De.Success),I=m.useCallback(()=>{v?h(!0):r()},[v,r]),S=m.useCallback(()=>{h(!1),r()},[r]),N=m.useCallback(()=>{u(j=>!j)},[]);return m.useEffect(()=>{if(!C||o<=0)return;const j=setTimeout(r,o);return()=>clearTimeout(j)},[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(yp,{title:e,isCollapsed:d,itemsId:x,labels:g,onToggleCollapse:N,onClose:I}),d&&v&&s.jsx(In,{value:Sp(t),size:c.ElementSize.Small,"aria-label":g.queueProgressAriaLabel,"aria-valuetext":g.queueProgressValueText(t.length-y,t.length)}),!d&&s.jsx("div",{id:x,className:f.mergeClasses("flex max-h-[40vh] flex-col overflow-y-auto py-1",l),children:t.map(j=>s.jsx(Ip,{item:j,labels:g,onCancel:n},j.id))}),s.jsx(Ta,{open:p,header:g.closeConfirmHeader,description:Np(b,g),confirmLabel:g.closeConfirmLabel,cancelLabel:g.closeCancelLabel,variant:it.Danger,onConfirm:S,onClose:()=>h(!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=bn.EditorThemes;exports.LazyMarkdownEditor=bn.LazyMarkdownEditor;exports.AVATAR_PALETTE=Aa;exports.Accordion=ja;exports.AccordionCaretPosition=Qt;exports.AnalyticsBar=Vt;exports.AnalyticsBarGroup=xu;exports.AnalyticsCard=hu;exports.AnalyticsCardVariant=wt;exports.AnalyticsHistogram=Iu;exports.AutocompleteTagInput=Kf;exports.Avatar=Oa;exports.AvatarColor=Be;exports.AvatarShape=lt;exports.Badge=ps;exports.BadgeColor=we;exports.BadgeVariant=ke;exports.BottomSheet=wf;exports.Breadcrumbs=tu;exports.BreadcrumbsSize=pe;exports.Button=Xe;exports.ButtonDropdown=nu;exports.Calendar=Fd;exports.CalendarMode=be;exports.CardShell=nd;exports.CollapsibleSidebar=Yf;exports.ConditionalResizableContainer=fp;exports.ConfirmationPopup=Ta;exports.ConfirmationPopupVariant=it;exports.DEFAULT_ANALYTICS_BAR_COLOR_MAP=hs;exports.DEFAULT_TRANSFER_QUEUE_LABELS=za;exports.DangerButton=Ac;exports.DialAccordion=ro;exports.DialBreadcrumb=Ao;exports.DialBreadcrumbItem=xt;exports.DialButton=Et;exports.DialCaptionText=zr;exports.DialCloseButton=wn;exports.DialDangerButton=On;exports.DialDangerIconButton=Nn;exports.DialDropdown=Gt;exports.DialEllipsisTooltip=er;exports.DialErrorText=He;exports.DialFileNodeType=Fe;exports.DialFilePermission=ea;exports.DialFileResourceType=ts;exports.DialGhostButton=Oo;exports.DialGhostIconButton=jn;exports.DialIconButton=Tt;exports.DialInput=Rn;exports.DialItemType=_e;exports.DialLabel=Kr;exports.DialLabelledText=co;exports.DialLinkButton=_o;exports.DialLoadFileArea=Qn;exports.DialLoadFileAreaField=Zl;exports.DialLoader=oo;exports.DialNeutralButton=_n;exports.DialNeutralIconButton=yo;exports.DialNoDataContent=lo;exports.DialPrimaryButton=Gr;exports.DialPrimaryIconButton=vo;exports.DialRemoveButton=kn;exports.DialSecondaryIconButton=Co;exports.DialSuccessIconButton=So;exports.DialTabs=To;exports.DialTag=fo;exports.DialTertiaryIconButton=Io;exports.DialTooltip=qe;exports.DialTooltipContainer=Fr;exports.DialTooltipContent=Hr;exports.DialTooltipTrigger=$r;exports.EDITABLE_CONTAINER_ATTRIBUTE=es;exports.EntityIdentity=ka;exports.EntityType=me;exports.ErrorBoundary=gp;exports.ErrorMessageNotification=ud;exports.ErrorToastNotification=ad;exports.FabButton=ru;exports.FileDropzone=hf;exports.FileIcon=gs;exports.FileName=La;exports.FilterChips=pf;exports.FlexibleActionsDirection=Jn;exports.FolderName=jf;exports.FolderPath=$d;exports.FormSection=vp;exports.FormSectionVariant=at;exports.GeneralMessageNotification=gd;exports.GeneralToastNotification=dd;exports.GhostButton=ls;exports.InfoMessageNotification=fd;exports.InfoToastNotification=od;exports.InlineSelect=au;exports.InlineSelectTrigger=Na;exports.JsonSchemaType=$;exports.LabelledText=Su;exports.LinkButton=kc;exports.LoadingMessageNotification=md;exports.LoadingToastNotification=cd;exports.LoginScreen=xp;exports.MultiSelectTags=yt;exports.NOT_ALLOWED_SPACES=rs;exports.NOT_ALLOWED_SPACES_REGEXP=ac;exports.NOT_ALLOWED_SYMBOLS=ra;exports.NOT_ALLOWED_SYMBOLS_REGEXP=nc;exports.NeutralButton=ur;exports.Notification=fs;exports.NotificationSurface=qt;exports.NotificationType=fe;exports.NotificationVariant=X;exports.NumberInput=us;exports.OutlinedButton=Rc;exports.PasswordInput=pa;exports.Popup=ms;exports.PopupSize=Ge;exports.PrimaryButton=is;exports.ProgressBar=In;exports.ProgressBarRole=Ct;exports.RadioGroup=jt;exports.RadioGroupOrientation=Oe;exports.RadioGroupPopupField=Gu;exports.ResizableContainer=Ma;exports.ResizableContainerSide=It;exports.ResizeHandle=up;exports.SchemaDisplayMode=lr;exports.SchemaOrientation=cr;exports.SchemaRenderer=Xc;exports.SchemaRendererVariant=nt;exports.ScreenResolution=Ut;exports.SegmentedControl=of;exports.Select=Ke;exports.SelectedEntityCard=kf;exports.SharedEntityIndicator=Ea;exports.SideDrawer=Rf;exports.Skeleton=$t;exports.SkeletonAvatarShape=Wt;exports.SkeletonAvatarSize=bt;exports.SkeletonVariant=Le;exports.Slider=Zf;exports.Spinner=We;exports.StarterButton=Oc;exports.StateScreen=Pa;exports.StepStatus=ve;exports.Steps=cu;exports.SuccessMessageNotification=pd;exports.SuccessToastNotification=id;exports.Switch=ha;exports.TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS=Ba;exports.TabOrientation=Ue;exports.TabStatus=ot;exports.TabView=Ze;exports.Tabs=df;exports.Tag=Ae;exports.TagAppearance=Ne;exports.TagInput=Ff;exports.Textarea=fa;exports.TextareaResize=cs;exports.ToggleChip=Yu;exports.ToggleIconButton=Uu;exports.TransferQueue=jp;exports.TransferQueueItemStatus=De;exports.WarningMessageNotification=hd;exports.WarningToastNotification=ld;exports.editableContainerProps=ql;exports.extractInitials=_a;exports.getTimezoneLabel=ta;exports.matchesAccept=Mr;exports.useEditableItem=Yl;exports.wrapInRootFolder=rc;