@epam/ai-dial-ui-kit 0.3.0-rc.6 → 0.3.0-rc.7

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("classnames"),N=require("@tabler/icons-react"),f=require("react"),h=require("@floating-ui/react"),ke=require("react-dom");function De(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const L=De(f),$=({errorText:s})=>s&&e.jsx("span",{className:"text-error dial-tiny mt-1",children:s}),z=({fieldTitle:s,htmlFor:t,optional:n,optionalText:r,cssClass:a})=>s?e.jsxs("label",{className:l("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:t,children:[e.jsx("span",{className:"min-h-4",children:s}),n&&e.jsx("span",{className:"ml-1",children:r??"(Optional)"})]}):null,F=({icon:s,className:t})=>s?e.jsx("span",{className:l("flex-shrink-0",t),children:s}):null;var S=(s=>(s.Primary="primary",s.Secondary="secondary",s.Tertiary="tertiary",s.Danger="danger",s))(S||{});const Ie={[S.Primary]:"dial-primary-button",[S.Secondary]:"dial-secondary-button",[S.Tertiary]:"dial-tertiary-button",[S.Danger]:"dial-danger-button"},M=({title:s,variant:t,cssClass:n,textCssClass:r,ref:a,onClick:o,disable:c,iconAfter:u,iconBefore:d,hideTitleOnMobile:i,ariaLabel:x})=>{const p=l("dial-small-semi",u?"mr-2":"",d?"ml-2":"",i?"hidden sm:inline":"inline",r),j=l(t&&Ie[t],n,"focus-visible:outline outline-offset-0");return e.jsxs("button",{ref:a,type:"button",className:j,onClick:g=>o?.(g),disabled:c,"aria-label":s||x,children:[e.jsx(F,{icon:d}),s&&e.jsx("span",{className:p,children:s}),e.jsx(F,{icon:u})]})};var W=(s=>(s.Info="info",s.Success="success",s.Warning="warning",s.Error="error",s))(W||{});const Se={info:e.jsx(N.IconInfoCircle,{size:24,stroke:2}),error:e.jsx(N.IconAlertCircle,{size:24,stroke:2}),warning:e.jsx(N.IconAlertTriangle,{size:24,stroke:2}),success:e.jsx(N.IconCircleCheck,{size:24,stroke:2})},Re={[W.Info]:"bg-info border-info text-info",[W.Success]:"bg-success border-success text-success",[W.Warning]:"bg-warning border-warning text-warning",[W.Error]:"bg-error border-error text-error"},Fe="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Ee=({variant:s=W.Info,message:t,cssClass:n,closable:r=!1,onClose:a})=>e.jsxs("div",{role:"alert",className:l(Fe,Re[s],n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{icon:Se[s]}),e.jsx("div",{className:"text-primary",children:t})]}),r&&e.jsx(M,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:e.jsx(N.IconX,{size:16}),onClick:o=>a?.(o)})]}),Le="flex items-center justify-center text-secondary",Pe="shrink-0 grow-0 basis-auto animate-spin-steps",Te=s=>L.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),re=({size:s=18,cssClass:t,iconClass:n,fullWidth:r=!0,ariaLabel:a="Loading"})=>e.jsx("div",{role:"status","aria-label":a,className:l({[Le]:!0,"w-full h-full":r,[t||""]:!!t}),children:e.jsx(F,{icon:e.jsx(Te,{width:s,height:s,className:l(Pe,n),role:"img"})})}),Ae=7,Me=2,ae=f.createContext(null),oe=()=>{const s=f.useContext(ae);if(s==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return s},Oe=({initialOpen:s=!1,placement:t="bottom",isTriggerClickable:n=!1,open:r,onOpenChange:a}={})=>{const[o,c]=f.useState(s),u=f.useRef(null),d=r??o,i=a??c,x=h.useFloating({placement:t,open:d,onOpenChange:i,whileElementsMounted:h.autoUpdate,middleware:[h.offset(Ae+Me),h.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),h.shift({padding:5}),h.arrow({element:u})]}),p=h.useHover(x.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:500,close:0}}),j=h.useFocus(x.context,{enabled:r==null}),g=h.useDismiss(x.context),v=h.useRole(x.context,{role:"tooltip"}),y=h.useInteractions([p,j,g,v]);return f.useMemo(()=>({open:d,setOpen:i,arrowRef:u,...y,...x}),[d,i,y,x])},Ve=({children:s,...t})=>{const n=Oe(t);return e.jsx(ae.Provider,{value:n,children:s})},Be=f.forwardRef(function({style:t,...n},r){const a=oe(),o=h.useMergeRefs([a.refs.setFloating,r]);return a.open?e.jsx(h.FloatingPortal,{id:"tooltip-portal",children:e.jsxs("div",{ref:o,style:{...a.floatingStyles,...t},...a.getFloatingProps(n),className:l("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(n).className),children:[n.children,e.jsx(h.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),We=f.forwardRef(function({children:t,asChild:n=!1,...r},a){const o=oe(),u=t&&typeof t=="object"&&"ref"in t&&t.ref!==void 0?t.ref:void 0,d=h.useMergeRefs([o.refs.setReference,a,u]);return n&&f.isValidElement(t)?f.cloneElement(t,o.getReferenceProps({ref:d,...r,...t.props})):e.jsx("span",{ref:d,...o.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-left",children:t})}),V=({hideTooltip:s,tooltip:t,children:n,triggerClassName:r,contentClassName:a,...o})=>e.jsxs(Ve,{...o,children:[e.jsx(We,{className:l(r,"truncate"),children:n}),e.jsx(Be,{className:l("text-primary",a,"max-w-[300px]",(s||!t)&&"hidden"),children:t})]}),_=18,G={size:_,stroke:2},ze=({label:s,id:t,checked:n,indeterminate:r,disabled:a,ariaLabel:o,onChange:c})=>{const u=f.useCallback(p=>{c?.(p.target.checked,t)},[c,t]),d=l("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${n||r?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":""),i=l("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":""),x=()=>r?e.jsx(N.IconMinus,{className:i,...G}):n?e.jsx(N.IconCheck,{className:i,...G}):null;return e.jsxs("label",{className:d,htmlFor:t,children:[x(),s&&e.jsx(V,{tooltip:s,triggerClassName:"flex-1 min-w-0",children:e.jsx("p",{className:"text-primary w-full truncate",children:s})}),e.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:n,"aria-checked":r?"mixed":n,"aria-disabled":a||void 0,"aria-label":s?void 0:o,className:"invisible w-0 h-0"})]})};var R=(s=>(s.VALID="valid",s.ERROR="error",s))(R||{});const He=(s,t)=>{if(t===s.id)switch(s.status){case R.VALID:return"border-accent-secondary text-primary";case R.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(s.status){case R.VALID:return"border-primary text-white";case R.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},_e=(s,t)=>{if(t===s.id)switch(s.status){case R.VALID:return"bg-accent-secondary";case R.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(s.status){case R.VALID:return"bg-accent-secondary";case R.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Ge=({step:s,index:t,currentStep:n,onChangeStep:r})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",c=()=>n===s.id&&s.status===R.ERROR?e.jsx(N.IconExclamationCircle,{stroke:2,size:16}):n!==s.id&&s.status===R.VALID?e.jsx(N.IconCheck,{stroke:2,size:16}):t+1;return e.jsxs("button",{className:l(a,He(s,n)),onClick:()=>r(s.id),children:[e.jsx("span",{className:l(o,_e(s,n)),children:c()}),e.jsx("span",{children:s.name})]})},$e=({steps:s,currentStep:t,onChangeStep:n})=>{const r=a=>{const o=s.findIndex(u=>u.id===t),c=s.findIndex(u=>u.id===a);(a!==t&&s[o].status===R.VALID||c<o)&&n(a)};return e.jsx("div",{id:"steps",className:"flex gap-x-3",children:s.map((a,o)=>e.jsx(Ge,{currentStep:t,onChangeStep:r,step:a,index:o},a.id))})},le=({name:s,value:t,title:n,description:r,checked:a=!1,inputId:o,cssClass:c,labelCssClass:u,disabled:d,onChange:i,descriptionCssClass:x})=>{const p=`${o}-desc`,j=l("dial-small cursor-pointer",d?"text-secondary":"text-primary",u),g=l("cursor-pointer dial-input-radio",n&&"mr-2",c),v=l("flex flex-col",!!r&&"mb-2"),y=l("dial-tiny mt-2 ml-[26px] text-secondary",x),D=k=>{d||k.target.checked&&i?.(t)};return e.jsxs("div",{className:v,children:[e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"radio",id:o,name:s,value:t,checked:a,disabled:d,"aria-describedby":a&&r?p:void 0,className:g,onChange:D}),n?e.jsx("label",{className:j,htmlFor:o,children:n}):null]}),a&&r&&e.jsx("div",{id:p,className:y,children:r})]})};var K=(s=>(s.Row="Row",s.Column="Column",s))(K||{});const qe="flex flex-col gap-2",Ke="flex",Ue="pb-1 mt-2",Xe={[K.Column]:"flex-col gap-y-3",[K.Row]:"flex-row gap-x-6"},ie=({fieldTitle:s,radioCssClass:t,labelCssClass:n,disabled:r,elementId:a,radioButtons:o,activeRadioButton:c,orientation:u,onChange:d})=>e.jsxs("div",{className:qe,children:[s&&e.jsx(z,{fieldTitle:s,htmlFor:a}),e.jsx("div",{role:"radiogroup","aria-label":s,"aria-disabled":r||void 0,className:l(Ke,Xe[u]),children:o.map(i=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(le,{name:a,value:i.id,inputId:i.id,disabled:r,cssClass:t,labelCssClass:n,title:i.name,checked:i.id===c,onChange:()=>d(i.id)}),i.id===c&&i.content?e.jsx("div",{className:Ue,children:i.content}):null]},i.id))})]}),Ze=({icon:s,title:t,description:n})=>e.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[s||e.jsx(N.IconClipboardX,{width:60,height:60}),e.jsx("span",{className:"small mt-2 text-primary",children:t}),n&&e.jsx("span",{className:"mt-1 text-primary",children:n})]}),Qe=60,Ye=({containerCssClass:s,children:t,width:n,title:r,iconSize:a=_,titleCssClass:o,additionalButtons:c})=>{const[u,d]=f.useState(n),[i,x]=f.useState(!0),p=l(["transform rotate-180 [writing-mode:tb-rl]",i&&"hidden",o]),j=l(["flex flex-row gap-2 cursor-pointer text-secondary",i?"justify-end":"justify-center"]),g=()=>{d(i?Qe:n),x(!i)};return e.jsxs("div",{className:l(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",s]),style:{width:`${u}px`},children:[e.jsx("div",{className:l(["flex-1 min-h-0 overflow-auto",!i&&"hidden"]),children:t}),e.jsx("div",{className:p,children:r}),e.jsxs("div",{className:j,children:[i&&c,e.jsx(M,{cssClass:"hover:text-icon-accent-primary",onClick:g,iconBefore:i?e.jsx(N.IconChevronsLeft,{size:a,stroke:G.stroke}):e.jsx(N.IconChevronsRight,{size:a,stroke:G.stroke})})]})]})},Je=({label:s,text:t,children:n,postfix:r})=>e.jsxs("div",{className:l("flex flex-col",n?"":"max-w-[200px]"),children:[e.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:s}),n||e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx(V,{triggerClassName:"text-primary",tooltip:t,children:t}),r||null]})]});var Y=(s=>(s.Default="default",s))(Y||{});const es={[Y.Default]:"border-icon-secondary bg-layer-3"},ce=({tag:s,cssClass:t,remove:n,variant:r=Y.Default})=>{const a=es[r],o=l("flex items-center gap-1 dial-tiny border rounded p-1 h-[22px] text-primary",t,a);return e.jsxs("div",{className:o,children:[e.jsx("span",{children:s}),n&&e.jsx(M,{iconAfter:e.jsx(N.IconX,{size:16}),onClick:n})]},s)},J=({ariaLabel:s,cssClass:t,size:n=24,onClose:r})=>e.jsx(M,{ariaLabel:s,cssClass:l("text-secondary hover:text-accent-primary",t),onClick:r,iconBefore:e.jsx(N.IconX,{size:n})}),de=({value:s,textareaId:t,placeholder:n,cssClass:r="",disabled:a,invalid:o,readonly:c,onChange:u})=>e.jsx(V,{tooltip:s,triggerClassName:"flex",children:e.jsx("textarea",{id:t,placeholder:n,value:s||"",disabled:a,className:l("dial-textarea dial-input px-3 py-2",o?"dial-input-error":"",a&&"dial-input-disable",c&&"dial-input-readonly",r),onChange:d=>!c&&u?.(d.currentTarget.value)})}),ss=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ts=(s,t,n,r)=>{if((t==="number"||n!==void 0||r!==void 0)&&!ss.includes(s.key)&&!(s.key==="-"&&s.currentTarget.selectionStart===0&&(n===void 0||n<0))&&!(s.key==="."&&t==="number"&&!s.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(s.key)){s.preventDefault();return}if(n!==void 0||r!==void 0){const o=s.currentTarget.value,c=s.currentTarget.selectionStart||0,u=o.slice(0,c)+s.key+o.slice(c),d=parseFloat(u);if(!isNaN(d)){if(n!==void 0&&d<n){s.preventDefault();return}if(r!==void 0&&d>r){s.preventDefault();return}}}}},U=({iconBefore:s,iconAfter:t,hideBorder:n,value:r,elementId:a,placeholder:o="",cssClass:c="",containerCssClass:u,tooltipTriggerClassName:d,type:i="text",disabled:x,readonly:p,invalid:j,onChange:g,min:v,max:y,prefix:D,suffix:k,textBeforeInput:b,textAfterInput:C})=>{const w=E=>E.target.blur(),P=i==="number"||v!==void 0||y!==void 0,B=E=>{ts(E,i,v,y)},A=E=>{const I=E.currentTarget.value;if(P&&I!==""){const H=parseFloat(I);if(isNaN(H)&&I!=="-"&&I!=="."||!isNaN(H)&&(v!==void 0&&H<v||y!==void 0&&H>y))return}g?.(I)};return e.jsxs("div",{className:l("dial-input-field flex flex-row items-center justify-between py-2",n?"dial-input-no-border":"dial-input",j&&"dial-input-error",x&&"dial-input-disable",p&&"dial-input-readonly",!b&&"pl-3",!C&&"pr-3",u),children:[b&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),D&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",D]}),e.jsx(F,{icon:s}),e.jsx(V,{tooltip:r,triggerClassName:l(d,"flex-1"),children:e.jsx("input",{type:i,autoComplete:"off",id:a,placeholder:o,value:r??"",disabled:x,className:l("border-0 bg-transparent",c),onChange:E=>!p&&A?.(E),onKeyDown:B,onWheel:w,min:v,max:y})}),e.jsx(F,{icon:t}),k&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",k]}),C&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:C,disabled:!0,elementId:C+"textAfter"})})]})},ns=/^0+\.(\d+)?$/,rs=/^0+/,ue=({fieldTitle:s,errorText:t,optional:n,elementCssClass:r,elementContainerCssClass:a,elementId:o,containerCssClass:c,readonly:u,defaultEmptyText:d,min:i,max:x,...p})=>e.jsxs("div",{className:l("flex flex-col",c),children:[e.jsx(z,{fieldTitle:s,optional:n,htmlFor:o}),u?e.jsx("span",{children:p.value||(d??"None")}):e.jsxs(e.Fragment,{children:[e.jsx(U,{elementId:o,cssClass:r,containerCssClass:a,invalid:t!=null,min:i,max:x,...p}),e.jsx($,{errorText:t})]})]}),as=({onChange:s,value:t,min:n,max:r,...a})=>{const o=c=>String(c)?.match(ns)?String(c)?.replace(rs,"0"):Number(c);return e.jsx(ue,{type:"number",onChange:c=>s?.(o(c)),value:t,min:n,max:r,...a})},os=({onChange:s,...t})=>e.jsx(ue,{type:"text",onChange:n=>s?.(n),...t}),ls=({fieldTitle:s,optional:t,elementId:n,elementCssClass:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,optional:t,htmlFor:n}),e.jsx(de,{textareaId:n,cssClass:r,...o}),e.jsx($,{errorText:a})]}),is=({title:s,switchId:t,isOn:n=!1,disabled:r,onChange:a})=>{const o=l("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",n?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?n?"bg-controls-disable":"bg-layer-4":n?"bg-accent-primary":"bg-layer-4"),c=f.useCallback(u=>{u.stopPropagation(),a?.(!n)},[a,n]);return e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"checkbox",onChange:c,id:t,disabled:r,className:"invisible w-0 h-0",checked:n}),e.jsx("label",{htmlFor:t,className:o,children:e.jsx("span",{className:l("size-3 rounded-full",r?n?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),s&&e.jsx("span",{className:"pl-2 dial-small text-primary",children:s})]})};var O=(s=>(s.Sm="sm",s.Md="md",s.Lg="lg",s))(O||{});const cs="z-[52] flex items-center justify-center bg-blackout md:p-4",ds="divide-tertiary divide-y",us="flex flex-row justify-between py-4 px-6 items-center",xs={[O.Sm]:"dial-sm-popup",[O.Md]:"dial-md-popup",[O.Lg]:"dial-lg-popup"},ee=({open:s=!1,title:t,portalId:n,cssClass:r,overlayClass:a,headingClass:o,dividers:c=!0,children:u,footer:d,onClose:i,size:x=O.Md})=>{const{refs:p,context:j}=h.useFloating({open:s,onOpenChange:b=>{b||i?.(null)}}),g=h.useRole(j,{role:"dialog"}),v=h.useDismiss(j,{outsidePress:!0}),{getFloatingProps:y}=h.useInteractions([g,v]);if(!s)return null;const D=typeof t=="string"?"dial-popup-heading":void 0,k=b=>b?typeof b=="string"?e.jsx("h3",{id:D,className:l("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",o),children:e.jsx(V,{tooltip:b,children:b})}):b:e.jsx("span",{});return e.jsx(h.FloatingPortal,{id:n,children:e.jsx(h.FloatingOverlay,{className:l(cs,a),children:e.jsx(h.FloatingFocusManager,{context:j,children:e.jsxs("div",{ref:p.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":D,className:l("dial-popup",xs[x],c&&ds,r),children:[e.jsxs("div",{className:us,children:[k(t),e.jsx(J,{ariaLabel:"Close dialog",onClose:b=>i?.(b)})]}),e.jsx("div",{className:"flex-grow overflow-auto",children:u}),d]})})})})};var X=(s=>(s.Info="info",s.Danger="danger",s))(X||{});const ps="flex justify-end gap-2 px-6 py-4",fs="text-secondary dial-small-150 px-6 py-4",ms="Cancel",te={[X.Info]:{confirmVariant:S.Primary,cancelVariant:S.Secondary},[X.Danger]:{container:"border-t-4 border-error",confirmVariant:S.Danger,cancelVariant:S.Secondary}},hs=({title:s,description:t,descriptionCssClass:n,open:r=!1,confirmLabel:a,cancelLabel:o=ms,isLoading:c=!1,disableConfirmButton:u=!1,cssClass:d,confirmClassName:i,onClose:x,onConfirm:p,onCancel:j,children:g,dividers:v=!1,variant:y=X.Info,size:D=O.Sm})=>{const k=c?null:e.jsxs("div",{className:ps,children:[e.jsx(M,{variant:S.Secondary,title:o,onClick:()=>j?j():x?.()}),e.jsx(M,{variant:te[y].confirmVariant,cssClass:i,title:a,disable:u,onClick:()=>p()})]}),b=f.useCallback(()=>c?e.jsx("div",{className:"px-6 py-4 h-[120px]",children:e.jsx(re,{size:50})}):g??(t?e.jsx("div",{className:l(fs,n),children:t}):null),[g,t,c,n]);return e.jsx(ee,{open:r,title:s,cssClass:l(te[y].container,d),dividers:v,onClose:()=>x?.(),footer:k,size:D,children:b()})},se=({selectedItems:s,listCssClass:t,listElementCssClass:n})=>!!s?.length&&e.jsx("ul",{className:l("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:s?.map(r=>e.jsx("li",{className:l(["tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",n]),children:e.jsx(V,{tooltip:r,children:e.jsx("button",{"aria-label":"autocomplete-action",type:"button",className:"truncate w-full",children:r})})},r))}),ne=s=>L.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),xe=({children:s,open:t,disabled:n=!1,selectedValue:r,valueCssClasses:a,inputCssClasses:o,onOpen:c,elementId:u,errorText:d,emptyValueText:i})=>{const x=Array.isArray(r)&&r.length>0,p=typeof r=="string"&&!!r.trim(),j=x||p?r:i,g=n?void 0:c,v=()=>e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"w-full",onClick:g,"aria-label":"open-popup",id:u,children:e.jsxs("div",{className:l("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",o,n&&"dial-input-disable",d&&"dial-input-error"),children:[e.jsx(V,{tooltip:String(j),children:e.jsx("span",{className:a,children:j})}),!n&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx(F,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})}),d&&e.jsx($,{errorText:d})]}),y=()=>e.jsx("div",{className:"w-full",onClick:g,children:e.jsxs("div",{className:l("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",n&&"dial-input-disable"),children:[e.jsx(se,{selectedItems:j}),!n&&e.jsx("div",{className:"ml-1",children:e.jsx(F,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})});return e.jsxs(e.Fragment,{children:[x?y():v(),t&&ke.createPortal(s,document.body)]})},gs=({fieldTitle:s,htmlFor:t,disabled:n,selectedValue:r,radioButtons:a,customInputValue:o,valueCssClasses:c,inputCssClasses:u,emptyValueText:d,onClose:i,title:x,portalId:p,onApply:j,cancelButtonTitle:g="Cancel",applyButtonTitle:v="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:k,id:b,size:C=O.Md})=>{const[w,P]=f.useState(!1),B=f.useCallback(()=>{n||P(!0)},[n]),A=f.useCallback(()=>{P(!1),i?.()},[i]),E=f.useCallback(()=>{j(),A()},[j,A]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,htmlFor:t}),e.jsx(xe,{disabled:n,open:w,selectedValue:o??a.find(I=>I.id===r)?.name,valueCssClasses:c,inputCssClasses:l(u,"py-2","px-3"),emptyValueText:d,onOpen:B,children:e.jsx(ee,{open:w,onClose:A,title:x,portalId:p,size:C,footer:e.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[e.jsx(M,{variant:S.Secondary,title:g,onClick:A}),e.jsx(M,{variant:S.Primary,title:v,onClick:E,disable:!y})]}),children:e.jsx("div",{className:"px-6 py-4",children:e.jsx(ie,{radioButtons:a,labelCssClass:"dial-small",activeRadioButton:D,onChange:k,elementId:b,orientation:K.Column})})})})]})},js=({onClick:s})=>e.jsx(N.IconEyeOff,{...G,className:"text-primary",onClick:s}),Cs=({onClick:s})=>e.jsx(N.IconEye,{...G,className:"text-primary",onClick:s}),pe=({...s})=>{const[t,n]=f.useState(!1),r=f.useCallback(a=>{n(a)},[]);return e.jsx(U,{type:t?"text":"password",...s,iconAfter:t?e.jsx(js,{onClick:()=>r(!1)}):e.jsx(Cs,{onClick:()=>r(!0)})})},ys=({fieldTitle:s,optional:t,elementCssClass:n,elementId:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,optional:t,htmlFor:r}),e.jsx(pe,{cssClass:n,elementId:r,invalid:!!a,...o}),e.jsx($,{errorText:a})]});var Z=(s=>(s.Small="small",s.Base="base",s))(Z||{});const bs={[Z.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[Z.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},vs=({elementId:s,value:t,placeholder:n,disabled:r,readonly:a,invalid:o,cssClass:c,containerCssClass:u,onChange:d,size:i=Z.Base})=>{const[x,p]=f.useState(t||"");f.useEffect(()=>{p(t||"")},[t]);const j=f.useCallback(y=>{p(y),d?.(y)},[d]),g=bs[i],v=f.useCallback(()=>{j("")},[j]);return e.jsxs("div",{className:l("dial-input flex flex-row items-center justify-between",o&&"dial-input-error",r&&"dial-input-disable",a&&"dial-input-readonly",g.containerClass,u),children:[e.jsx(F,{className:l(r?"text-secondary":"text-primary"),icon:e.jsx(N.IconSearch,{size:g.iconSize,stroke:g.iconStroke})}),e.jsx("input",{id:s,type:"text",autoComplete:"off",placeholder:n,value:x??"",disabled:r,readOnly:a,className:l("border-0 bg-transparent w-full",c,g.textClass),onChange:y=>!a&&j(y.currentTarget.value)}),x&&!a&&!r&&e.jsx(F,{className:"text-primary cursor-pointer",icon:e.jsx(N.IconX,{size:g.iconSize,stroke:g.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},ws=({placeholder:s="",selectedItems:t=[],updateSelected:n,listCssClass:r,listElementCssClass:a,containerCssClass:o,inputCssClass:c})=>{const[u,d]=f.useState(""),i=f.useCallback(p=>{p.key==="Enter"&&(n([...t,p.currentTarget.value]),d("")),(p.key==="Backspace"||p.key==="Delete")&&t.length&&!u&&n(t.slice(0,-1))},[t,n,u]),x=f.useCallback(p=>{d(p.target.value)},[d]);return e.jsxs("div",{className:l(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[e.jsx(se,{selectedItems:t,listCssClass:r,listElementCssClass:a}),e.jsx("input",{type:"text",value:u,className:l(["border-0 bg-transparent p-0",c]),placeholder:t?.length?"":s,onKeyDown:i,onChange:x})]})},Ns=({initialTags:s=[],fieldTitle:t,optional:n,elementId:r,placeholder:a,errorText:o,invalid:c,disabled:u,onChange:d})=>{const i=f.useRef(null),[x,p]=f.useState(s),[j,g]=f.useState(""),[v,y]=f.useState(!1),D=C=>{const w=C.trim().replace(/,$/,"");if(w&&!x.includes(w)){const P=[w,...x];p(P),d?.(P)}},k=C=>{(C.key===","||C.key==="Enter")&&(C.preventDefault(),D(j),g(""))},b=C=>{const w=x.filter((P,B)=>B!==C);p(w),d?.(w)};return f.useEffect(()=>{const C=new ResizeObserver(()=>{if(i.current){const w=i.current.scrollHeight>i.current.clientHeight+10;y(w)}});return i.current&&C.observe(i.current),()=>C.disconnect()},[x]),e.jsxs("div",{className:l("flex flex-col w-full"),children:[e.jsx(z,{fieldTitle:t,optional:n,htmlFor:r}),e.jsx("div",{className:l("dial-input min-h-[38px] p-[6px]",c&&"dial-input-error",u&&"dial-input-disable"),children:e.jsxs("div",{ref:i,className:l("flex flex-wrap gap-2 items-center",v?"flex-col-reverse":"flex-row"),children:[x.map((C,w)=>e.jsx(ce,{tag:C,remove:u?void 0:()=>b(w)},C+w)),e.jsx("input",{type:"text",value:j,onChange:C=>g(C.target.value),onKeyDown:k,className:l("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:a,disabled:u})]})}),e.jsx($,{errorText:o})]})};var fe=(s=>(s.Dropdown="dropdown",s.Menu="menu",s))(fe||{}),q=(s=>(s.Click="click",s.Hover="hover",s.ContextMenu="contextMenu",s))(q||{}),me=(s=>(s.Item="item",s.Divider="divider",s))(me||{});const ks=l("inline-flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Ds=l("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Is=l("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Ss="opacity-75 !cursor-not-allowed",Rs="text-error",Fs="my-1 border-t border-hover",Q=8,Es=({children:s,menu:t,renderOverlay:n,trigger:r=[q.Click],placement:a,disabled:o=!1,open:c,defaultOpen:u=!1,onOpenChange:d,closable:i=!1,onClose:x,cssClass:p,listClassName:j,outsidePressIgnoreRef:g,outsideClosable:v=!0})=>{const[y,D]=f.useState(u),k=c!==void 0,b=k?!!c:y,C=f.useCallback(m=>{k||D(m),d?.(m)},[k,d]),w=f.useId(),P=m=>m?"clientWidth"in m?m.clientWidth:m.getBoundingClientRect?.()?.width??0:0,B=a===void 0,{refs:A,floatingStyles:E,context:I}=h.useFloating({placement:a,open:b,onOpenChange:C,whileElementsMounted:h.autoUpdate,middleware:[h.offset({mainAxis:Q,crossAxis:0}),B?h.autoPlacement({alignment:"start",crossAxis:!0,padding:Q}):h.flip({padding:Q}),h.shift({padding:Q}),h.size({apply({availableWidth:m,elements:T}){const Ne=P(T.reference);T.floating.style.setProperty("--reference-width",`${Ne}px`),T.floating.style.maxWidth=`${m}px`}})]}),H=h.useClick(I,{enabled:r.includes(q.Click)&&!o}),he=h.useHover(I,{enabled:r.includes(q.Hover)&&!o,move:!1,restMs:40,delay:{open:80,close:80}}),ge=h.useDismiss(I,{bubbles:!0,referencePress:!1,outsidePress:m=>{if(!v)return!1;const T=m.target;return!(g?.current&&T instanceof Node&&g.current.contains(T))}}),je=h.useRole(I,{role:"menu"}),{getReferenceProps:Ce,getFloatingProps:ye}=h.useInteractions([H,he,ge,je]),be=m=>{!r.includes(q.ContextMenu)||o||(m.preventDefault(),C(!0))};f.useEffect(()=>{o&&b&&C(!1)},[o,b,C]);const ve=m=>T=>{m.disabled||(m.onClick?.({key:m.key,domEvent:T}),t?.onClick?.({key:m.key,domEvent:T}),C(!1))},we=n?n():t&&e.jsx("div",{role:"none",className:"py-1",children:t.items.map(m=>m.type===me.Divider?e.jsx("div",{role:"separator",className:Fs},m.key):e.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!m.disabled,className:l(Is,m.disabled&&Ss,m.danger&&Rs),disabled:m.disabled,onClick:ve(m),children:[m.icon&&e.jsx("span",{className:l(m.danger&&"text-error",m.disabled&&"text-secondary"),children:e.jsx(F,{icon:m.icon})}),e.jsx("span",{className:l("flex-1 truncate text-left",m.danger&&"text-error",m.disabled&&"text-secondary"),children:m.label})]},m.key))});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:A.setReference,className:l(ks,o&&"!cursor-not-allowed opacity-75",p),"aria-haspopup":"menu","aria-expanded":b,"aria-controls":w,onContextMenu:be,...Ce(),children:s}),b&&e.jsx(h.FloatingPortal,{children:e.jsx(h.FloatingFocusManager,{context:I,modal:!1,initialFocus:-1,returnFocus:!0,children:e.jsxs("div",{id:w,ref:A.setFloating,style:E,className:l(Ds,j),...ye(),children:[i&&e.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:e.jsx(J,{ariaLabel:"Close dropdown",onClose:m=>{x?.(m),C(!1)}})}),we]})})})]})};exports.AlertVariant=W;exports.ButtonVariant=S;exports.ConfirmationPopupVariant=X;exports.DialAlert=Ee;exports.DialAutocompleteInput=ws;exports.DialAutocompleteInputValue=se;exports.DialButton=M;exports.DialCheckbox=ze;exports.DialCloseButton=J;exports.DialCollapsibleSidebar=Ye;exports.DialConfirmationPopup=hs;exports.DialDropdown=Es;exports.DialErrorText=$;exports.DialFieldLabel=z;exports.DialIcon=F;exports.DialInput=U;exports.DialInputPopup=xe;exports.DialLabelledText=Je;exports.DialLoader=re;exports.DialNoDataContent=Ze;exports.DialNumberInputField=as;exports.DialPasswordInput=pe;exports.DialPasswordInputField=ys;exports.DialPopup=ee;exports.DialRadioButton=le;exports.DialRadioGroup=ie;exports.DialRadioGroupPopupField=gs;exports.DialSearch=vs;exports.DialSteps=$e;exports.DialSwitch=is;exports.DialTag=ce;exports.DialTagInput=Ns;exports.DialTextAreaField=ls;exports.DialTextInputField=os;exports.DialTextarea=de;exports.DialTooltip=V;exports.DropdownType=fe;exports.PopupSize=O;exports.RadioGroupOrientation=K;exports.SearchSize=Z;exports.StepStatus=R;exports.TagVariant=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("classnames"),E=require("@tabler/icons-react"),C=require("react"),N=require("@floating-ui/react"),xr=require("react-dom");function gr(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const $=gr(C),le=({errorText:e})=>e&&r.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),te=({fieldTitle:e,htmlFor:o,optional:t,optionalText:s,cssClass:n})=>e?r.jsxs("label",{className:m("dial-tiny text-secondary",n,!n?.includes("mb")&&"mb-2"),htmlFor:o,children:[r.jsx("span",{className:"min-h-4",children:e}),t&&r.jsx("span",{className:"ml-1",children:s??"(Optional)"})]}):null,_=({icon:e,className:o})=>e?r.jsx("span",{className:m("flex-shrink-0",o),children:e}):null;var B=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e.Danger="danger",e))(B||{});const br={[B.Primary]:"dial-primary-button",[B.Secondary]:"dial-secondary-button",[B.Tertiary]:"dial-tertiary-button",[B.Danger]:"dial-danger-button"},X=({title:e,variant:o,cssClass:t,textCssClass:s,ref:n,onClick:a,disable:l,iconAfter:c,iconBefore:i,hideTitleOnMobile:d,ariaLabel:f})=>{const b=m("dial-small-semi",c?"mr-2":"",i?"ml-2":"",d?"hidden sm:inline":"inline",s),v=m(o&&br[o],t,"focus-visible:outline outline-offset-0");return r.jsxs("button",{ref:n,type:"button",className:v,onClick:y=>a?.(y),disabled:l,"aria-label":e||f,children:[r.jsx(_,{icon:i}),e&&r.jsx("span",{className:b,children:e}),r.jsx(_,{icon:c})]})};var re=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(re||{});const hr={info:r.jsx(E.IconInfoCircle,{size:24,stroke:2}),error:r.jsx(E.IconAlertCircle,{size:24,stroke:2}),warning:r.jsx(E.IconAlertTriangle,{size:24,stroke:2}),success:r.jsx(E.IconCircleCheck,{size:24,stroke:2})},yr={[re.Info]:"bg-info border-info text-info",[re.Success]:"bg-success border-success text-success",[re.Warning]:"bg-warning border-warning text-warning",[re.Error]:"bg-error border-error text-error"},wr="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",kr=({variant:e=re.Info,message:o,cssClass:t,closable:s=!1,onClose:n})=>r.jsxs("div",{role:"alert",className:m(wr,yr[e],t),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(_,{icon:hr[e]}),r.jsx("div",{className:"text-primary",children:o})]}),s&&r.jsx(X,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:r.jsx(E.IconX,{size:16}),onClick:a=>n?.(a)})]}),vr="flex items-center justify-center text-secondary",Cr="shrink-0 grow-0 basis-auto animate-spin-steps",jr=e=>$.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),Ke=({size:e=18,cssClass:o,iconClass:t,fullWidth:s=!0,ariaLabel:n="Loading"})=>r.jsx("div",{role:"status","aria-label":n,className:m({[vr]:!0,"w-full h-full":s,[o||""]:!!o}),children:r.jsx(_,{icon:r.jsx(jr,{width:e,height:e,className:m(Cr,t),role:"img"})})}),Nr=7,Dr=2,Xe=C.createContext(null),Ze=()=>{const e=C.useContext(Xe);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Ir=({initialOpen:e=!1,placement:o="bottom",isTriggerClickable:t=!1,open:s,onOpenChange:n}={})=>{const[a,l]=C.useState(e),c=C.useRef(null),i=s??a,d=n??l,f=N.useFloating({placement:o,open:i,onOpenChange:d,whileElementsMounted:N.autoUpdate,middleware:[N.offset(Nr+Dr),N.flip({crossAxis:o.includes("-"),fallbackAxisSideDirection:"start",padding:5}),N.shift({padding:5}),N.arrow({element:c})]}),b=N.useHover(f.context,{move:!1,enabled:s==null,mouseOnly:t,delay:{open:500,close:0}}),v=N.useFocus(f.context,{enabled:s==null}),y=N.useDismiss(f.context),j=N.useRole(f.context,{role:"tooltip"}),h=N.useInteractions([b,v,y,j]);return C.useMemo(()=>({open:i,setOpen:d,arrowRef:c,...h,...f}),[i,d,h,f])},Sr=({children:e,...o})=>{const t=Ir(o);return r.jsx(Xe.Provider,{value:t,children:e})},Rr=C.forwardRef(function({style:o,...t},s){const n=Ze(),a=N.useMergeRefs([n.refs.setFloating,s]);return n.open?r.jsx(N.FloatingPortal,{id:"tooltip-portal",children:r.jsxs("div",{ref:a,style:{...n.floatingStyles,...o},...n.getFloatingProps(t),className:m("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",n.getFloatingProps(t).className),children:[t.children,r.jsx(N.FloatingArrow,{ref:n.arrowRef,context:n.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),zr=C.forwardRef(function({children:o,asChild:t=!1,...s},n){const a=Ze(),c=o&&typeof o=="object"&&"ref"in o&&o.ref!==void 0?o.ref:void 0,i=N.useMergeRefs([a.refs.setReference,n,c]);return t&&C.isValidElement(o)?C.cloneElement(o,a.getReferenceProps({ref:i,...s,...o.props})):r.jsx("span",{ref:i,...a.getReferenceProps(s),className:s.className??"dial-tooltip-trigger text-left",children:o})}),Y=({hideTooltip:e,tooltip:o,children:t,triggerClassName:s,contentClassName:n,...a})=>r.jsxs(Sr,{...a,children:[r.jsx(zr,{className:m(s,"truncate"),children:t}),r.jsx(Rr,{className:m("text-primary",n,"max-w-[300px]",(e||!o)&&"hidden"),children:o})]}),ne=18,ae={size:ne,stroke:2},Mr=({label:e,id:o,checked:t,indeterminate:s,disabled:n,ariaLabel:a,onChange:l})=>{const c=C.useCallback(b=>{l?.(b.target.checked,o)},[l,o]),i=m("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${t||s?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,n?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":""),d=m("mr-2 border rounded",n?"bg-layer-4 border-icon-secondary":""),f=()=>s?r.jsx(E.IconMinus,{className:d,...ae}):t?r.jsx(E.IconCheck,{className:d,...ae}):null;return r.jsxs("label",{className:i,htmlFor:o,children:[f(),e&&r.jsx(Y,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:r.jsx("p",{className:"text-primary w-full truncate",children:e})}),r.jsx("input",{type:"checkbox",role:"checkbox",name:o,onChange:c,id:o,checked:t,"aria-checked":s?"mixed":t,"aria-disabled":n||void 0,"aria-label":e?void 0:a,className:"invisible w-0 h-0"})]})};var W=(e=>(e.VALID="valid",e.ERROR="error",e))(W||{});const Pr=(e,o)=>{if(o===e.id)switch(e.status){case W.VALID:return"border-accent-secondary text-primary";case W.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case W.VALID:return"border-primary text-white";case W.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},Ar=(e,o)=>{if(o===e.id)switch(e.status){case W.VALID:return"bg-accent-secondary";case W.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case W.VALID:return"bg-accent-secondary";case W.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Er=({step:e,index:o,currentStep:t,onChangeStep:s})=>{const n="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",a="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",l=()=>t===e.id&&e.status===W.ERROR?r.jsx(E.IconExclamationCircle,{stroke:2,size:16}):t!==e.id&&e.status===W.VALID?r.jsx(E.IconCheck,{stroke:2,size:16}):o+1;return r.jsxs("button",{className:m(n,Pr(e,t)),onClick:()=>s(e.id),children:[r.jsx("span",{className:m(a,Ar(e,t)),children:l()}),r.jsx("span",{children:e.name})]})},Tr=({steps:e,currentStep:o,onChangeStep:t})=>{const s=n=>{const a=e.findIndex(c=>c.id===o),l=e.findIndex(c=>c.id===n);(n!==o&&e[a].status===W.VALID||l<a)&&t(n)};return r.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((n,a)=>r.jsx(Er,{currentStep:o,onChangeStep:s,step:n,index:a},n.id))})},Je=({name:e,value:o,title:t,description:s,checked:n=!1,inputId:a,cssClass:l,labelCssClass:c,disabled:i,onChange:d,descriptionCssClass:f})=>{const b=`${a}-desc`,v=m("dial-small cursor-pointer",i?"text-secondary":"text-primary",c),y=m("cursor-pointer dial-input-radio",t&&"mr-2",l),j=m("flex flex-col",!!s&&"mb-2"),h=m("dial-tiny mt-2 ml-[26px] text-secondary",f),M=R=>{i||R.target.checked&&d?.(o)};return r.jsxs("div",{className:j,children:[r.jsxs("div",{className:"flex flex-row items-center",children:[r.jsx("input",{type:"radio",id:a,name:e,value:o,checked:n,disabled:i,"aria-describedby":n&&s?b:void 0,className:y,onChange:M}),t?r.jsx("label",{className:v,htmlFor:a,children:t}):null]}),n&&s&&r.jsx("div",{id:b,className:h,children:s})]})};var me=(e=>(e.Row="Row",e.Column="Column",e))(me||{});const Lr="flex flex-col gap-2",Fr="flex",Or="pb-1 mt-2",Vr={[me.Column]:"flex-col gap-y-3",[me.Row]:"flex-row gap-x-6"},Qe=({fieldTitle:e,radioCssClass:o,labelCssClass:t,disabled:s,elementId:n,radioButtons:a,activeRadioButton:l,orientation:c,onChange:i})=>r.jsxs("div",{className:Lr,children:[e&&r.jsx(te,{fieldTitle:e,htmlFor:n}),r.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":s||void 0,className:m(Fr,Vr[c]),children:a.map(d=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(Je,{name:n,value:d.id,inputId:d.id,disabled:s,cssClass:o,labelCssClass:t,title:d.name,checked:d.id===l,onChange:()=>i(d.id)}),d.id===l&&d.content?r.jsx("div",{className:Or,children:d.content}):null]},d.id))})]}),Gr=({icon:e,title:o,description:t})=>r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[e||r.jsx(E.IconClipboardX,{width:60,height:60}),r.jsx("span",{className:"small mt-2 text-primary",children:o}),t&&r.jsx("span",{className:"mt-1 text-primary",children:t})]}),Br=60,Wr=({containerCssClass:e,children:o,width:t,title:s,iconSize:n=ne,titleCssClass:a,additionalButtons:l})=>{const[c,i]=C.useState(t),[d,f]=C.useState(!0),b=m(["transform rotate-180 [writing-mode:tb-rl]",d&&"hidden",a]),v=m(["flex flex-row gap-2 cursor-pointer text-secondary",d?"justify-end":"justify-center"]),y=()=>{i(d?Br:t),f(!d)};return r.jsxs("div",{className:m(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",e]),style:{width:`${c}px`},children:[r.jsx("div",{className:m(["flex-1 min-h-0 overflow-auto",!d&&"hidden"]),children:o}),r.jsx("div",{className:b,children:s}),r.jsxs("div",{className:v,children:[d&&l,r.jsx(X,{cssClass:"hover:text-icon-accent-primary",onClick:y,iconBefore:d?r.jsx(E.IconChevronsLeft,{size:n,stroke:ae.stroke}):r.jsx(E.IconChevronsRight,{size:n,stroke:ae.stroke})})]})]})},_r=({label:e,text:o,children:t,postfix:s})=>r.jsxs("div",{className:m("flex flex-col",t?"":"max-w-[200px]"),children:[r.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:e}),t||r.jsxs("div",{className:"flex flex-row items-center",children:[r.jsx(Y,{triggerClassName:"text-primary",tooltip:o,children:o}),s||null]})]});var Ie=(e=>(e.Default="default",e))(Ie||{});const Te="-",Hr=e=>{const o=Ur(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{const c=l.split(Te);return c[0]===""&&c.length!==1&&c.shift(),Ye(c,o)||$r(l)},getConflictingClassGroupIds:(l,c)=>{const i=t[l]||[];return c&&s[l]?[...i,...s[l]]:i}}},Ye=(e,o)=>{if(e.length===0)return o.classGroupId;const t=e[0],s=o.nextPart.get(t),n=s?Ye(e.slice(1),s):void 0;if(n)return n;if(o.validators.length===0)return;const a=e.join(Te);return o.validators.find(({validator:l})=>l(a))?.classGroupId},We=/^\[(.+)\]$/,$r=e=>{if(We.test(e)){const o=We.exec(e)[1],t=o?.substring(0,o.indexOf(":"));if(t)return"arbitrary.."+t}},Ur=e=>{const{theme:o,classGroups:t}=e,s={nextPart:new Map,validators:[]};for(const n in t)Pe(t[n],s,n,o);return s},Pe=(e,o,t,s)=>{e.forEach(n=>{if(typeof n=="string"){const a=n===""?o:_e(o,n);a.classGroupId=t;return}if(typeof n=="function"){if(qr(n)){Pe(n(s),o,t,s);return}o.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([a,l])=>{Pe(l,_e(o,a),t,s)})})},_e=(e,o)=>{let t=e;return o.split(Te).forEach(s=>{t.nextPart.has(s)||t.nextPart.set(s,{nextPart:new Map,validators:[]}),t=t.nextPart.get(s)}),t},qr=e=>e.isThemeGetter,Kr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let o=0,t=new Map,s=new Map;const n=(a,l)=>{t.set(a,l),o++,o>e&&(o=0,s=t,t=new Map)};return{get(a){let l=t.get(a);if(l!==void 0)return l;if((l=s.get(a))!==void 0)return n(a,l),l},set(a,l){t.has(a)?t.set(a,l):n(a,l)}}},Ae="!",Ee=":",Xr=Ee.length,Zr=e=>{const{prefix:o,experimentalParseClassName:t}=e;let s=n=>{const a=[];let l=0,c=0,i=0,d;for(let j=0;j<n.length;j++){let h=n[j];if(l===0&&c===0){if(h===Ee){a.push(n.slice(i,j)),i=j+Xr;continue}if(h==="/"){d=j;continue}}h==="["?l++:h==="]"?l--:h==="("?c++:h===")"&&c--}const f=a.length===0?n:n.substring(i),b=Jr(f),v=b!==f,y=d&&d>i?d-i:void 0;return{modifiers:a,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:y}};if(o){const n=o+Ee,a=s;s=l=>l.startsWith(n)?a(l.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(t){const n=s;s=a=>t({className:a,parseClassName:n})}return s},Jr=e=>e.endsWith(Ae)?e.substring(0,e.length-1):e.startsWith(Ae)?e.substring(1):e,Qr=e=>{const o=Object.fromEntries(e.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(l=>{l[0]==="["||o[l]?(n.push(...a.sort(),l),a=[]):a.push(l)}),n.push(...a.sort()),n}},Yr=e=>({cache:Kr(e.cacheSize),parseClassName:Zr(e),sortModifiers:Qr(e),...Hr(e)}),et=/\s+/,rt=(e,o)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=o,l=[],c=e.trim().split(et);let i="";for(let d=c.length-1;d>=0;d-=1){const f=c[d],{isExternal:b,modifiers:v,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:h}=t(f);if(b){i=f+(i.length>0?" "+i:i);continue}let M=!!h,R=s(M?j.substring(0,h):j);if(!R){if(!M){i=f+(i.length>0?" "+i:i);continue}if(R=s(j),!R){i=f+(i.length>0?" "+i:i);continue}M=!1}const I=a(v).join(":"),D=y?I+Ae:I,S=D+R;if(l.includes(S))continue;l.push(S);const T=n(R,M);for(let L=0;L<T.length;++L){const F=T[L];l.push(D+F)}i=f+(i.length>0?" "+i:i)}return i};function tt(){let e=0,o,t,s="";for(;e<arguments.length;)(o=arguments[e++])&&(t=er(o))&&(s&&(s+=" "),s+=t);return s}const er=e=>{if(typeof e=="string")return e;let o,t="";for(let s=0;s<e.length;s++)e[s]&&(o=er(e[s]))&&(t&&(t+=" "),t+=o);return t};function ot(e,...o){let t,s,n,a=l;function l(i){const d=o.reduce((f,b)=>b(f),e());return t=Yr(d),s=t.cache.get,n=t.cache.set,a=c,c(i)}function c(i){const d=s(i);if(d)return d;const f=rt(i,t);return n(i,f),f}return function(){return a(tt.apply(null,arguments))}}const P=e=>{const o=t=>t[e]||[];return o.isThemeGetter=!0,o},rr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,st=/^\d+\/\d+$/,nt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,at=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,it=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ct=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,se=e=>st.test(e),k=e=>!!e&&!Number.isNaN(Number(e)),J=e=>!!e&&Number.isInteger(Number(e)),ze=e=>e.endsWith("%")&&k(e.slice(0,-1)),K=e=>nt.test(e),dt=()=>!0,ut=e=>at.test(e)&&!lt.test(e),or=()=>!1,pt=e=>it.test(e),mt=e=>ct.test(e),ft=e=>!u(e)&&!p(e),xt=e=>ie(e,ar,or),u=e=>rr.test(e),ee=e=>ie(e,lr,ut),Me=e=>ie(e,wt,k),He=e=>ie(e,sr,or),gt=e=>ie(e,nr,mt),je=e=>ie(e,ir,pt),p=e=>tr.test(e),ue=e=>ce(e,lr),bt=e=>ce(e,kt),$e=e=>ce(e,sr),ht=e=>ce(e,ar),yt=e=>ce(e,nr),Ne=e=>ce(e,ir,!0),ie=(e,o,t)=>{const s=rr.exec(e);return s?s[1]?o(s[1]):t(s[2]):!1},ce=(e,o,t=!1)=>{const s=tr.exec(e);return s?s[1]?o(s[1]):t:!1},sr=e=>e==="position"||e==="percentage",nr=e=>e==="image"||e==="url",ar=e=>e==="length"||e==="size"||e==="bg-size",lr=e=>e==="length",wt=e=>e==="number",kt=e=>e==="family-name",ir=e=>e==="shadow",vt=()=>{const e=P("color"),o=P("font"),t=P("text"),s=P("font-weight"),n=P("tracking"),a=P("leading"),l=P("breakpoint"),c=P("container"),i=P("spacing"),d=P("radius"),f=P("shadow"),b=P("inset-shadow"),v=P("text-shadow"),y=P("drop-shadow"),j=P("blur"),h=P("perspective"),M=P("aspect"),R=P("ease"),I=P("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...S(),p,u],L=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],x=()=>[p,u,i],z=()=>[se,"full","auto",...x()],U=()=>[J,"none","subgrid",p,u],be=()=>["auto",{span:["full",J,p,u]},J,p,u],oe=()=>[J,"auto",p,u],he=()=>["auto","min","max","fr",p,u],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...x()],q=()=>[se,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],g=()=>[e,p,u],w=()=>[...S(),$e,He,{position:[p,u]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",ht,xt,{size:[p,u]}],Se=()=>[ze,ue,ee],O=()=>["","none","full",d,p,u],G=()=>["",k,ue,ee],we=()=>["solid","dashed","dotted","double"],Ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[k,ze,$e,He],Be=()=>["","none",j,p,u],ke=()=>["none",k,p,u],ve=()=>["none",k,p,u],Re=()=>[k,p,u],Ce=()=>[se,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[K],breakpoint:[K],color:[dt],container:[K],"drop-shadow":[K],ease:["in","out","in-out"],font:[ft],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[K],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[K],shadow:[K],spacing:["px",k],text:[K],"text-shadow":[K],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",se,u,p,M]}],container:["container"],columns:[{columns:[k,u,p,c]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[J,"auto",p,u]}],basis:[{basis:[se,"full","auto",c,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[k,se,"auto","initial","none",u]}],grow:[{grow:["",k,p,u]}],shrink:[{shrink:["",k,p,u]}],order:[{order:[J,"first","last","none",p,u]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:be()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:be()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",t,ue,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,p,Me]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ze,u]}],"font-family":[{font:[bt,u,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,p,u]}],"line-clamp":[{"line-clamp":[k,"none",p,Me]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",p,u]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",p,u]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:g()}],"text-color":[{text:g()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[k,"from-font","auto",p,ee]}],"text-decoration-color":[{decoration:g()}],"underline-offset":[{"underline-offset":[k,"auto",p,u]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",p,u]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",p,u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:w()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},J,p,u],radial:["",p,u],conic:[J,p,u]},yt,gt]}],"bg-color":[{bg:g()}],"gradient-from-pos":[{from:Se()}],"gradient-via-pos":[{via:Se()}],"gradient-to-pos":[{to:Se()}],"gradient-from":[{from:g()}],"gradient-via":[{via:g()}],"gradient-to":[{to:g()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:g()}],"border-color-x":[{"border-x":g()}],"border-color-y":[{"border-y":g()}],"border-color-s":[{"border-s":g()}],"border-color-e":[{"border-e":g()}],"border-color-t":[{"border-t":g()}],"border-color-r":[{"border-r":g()}],"border-color-b":[{"border-b":g()}],"border-color-l":[{"border-l":g()}],"divide-color":[{divide:g()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[k,p,u]}],"outline-w":[{outline:["",k,ue,ee]}],"outline-color":[{outline:g()}],shadow:[{shadow:["","none",f,Ne,je]}],"shadow-color":[{shadow:g()}],"inset-shadow":[{"inset-shadow":["none",b,Ne,je]}],"inset-shadow-color":[{"inset-shadow":g()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:g()}],"ring-offset-w":[{"ring-offset":[k,ee]}],"ring-offset-color":[{"ring-offset":g()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":g()}],"text-shadow":[{"text-shadow":["none",v,Ne,je]}],"text-shadow-color":[{"text-shadow":g()}],opacity:[{opacity:[k,p,u]}],"mix-blend":[{"mix-blend":[...Ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[k]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":g()}],"mask-image-linear-to-color":[{"mask-linear-to":g()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":g()}],"mask-image-t-to-color":[{"mask-t-to":g()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":g()}],"mask-image-r-to-color":[{"mask-r-to":g()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":g()}],"mask-image-b-to-color":[{"mask-b-to":g()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":g()}],"mask-image-l-to-color":[{"mask-l-to":g()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":g()}],"mask-image-x-to-color":[{"mask-x-to":g()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":g()}],"mask-image-y-to-color":[{"mask-y-to":g()}],"mask-image-radial":[{"mask-radial":[p,u]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":g()}],"mask-image-radial-to-color":[{"mask-radial-to":g()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[k]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":g()}],"mask-image-conic-to-color":[{"mask-conic-to":g()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:w()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",p,u]}],filter:[{filter:["","none",p,u]}],blur:[{blur:Be()}],brightness:[{brightness:[k,p,u]}],contrast:[{contrast:[k,p,u]}],"drop-shadow":[{"drop-shadow":["","none",y,Ne,je]}],"drop-shadow-color":[{"drop-shadow":g()}],grayscale:[{grayscale:["",k,p,u]}],"hue-rotate":[{"hue-rotate":[k,p,u]}],invert:[{invert:["",k,p,u]}],saturate:[{saturate:[k,p,u]}],sepia:[{sepia:["",k,p,u]}],"backdrop-filter":[{"backdrop-filter":["","none",p,u]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[k,p,u]}],"backdrop-contrast":[{"backdrop-contrast":[k,p,u]}],"backdrop-grayscale":[{"backdrop-grayscale":["",k,p,u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k,p,u]}],"backdrop-invert":[{"backdrop-invert":["",k,p,u]}],"backdrop-opacity":[{"backdrop-opacity":[k,p,u]}],"backdrop-saturate":[{"backdrop-saturate":[k,p,u]}],"backdrop-sepia":[{"backdrop-sepia":["",k,p,u]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",p,u]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[k,"initial",p,u]}],ease:[{ease:["linear","initial",R,p,u]}],delay:[{delay:[k,p,u]}],animate:[{animate:["none",I,p,u]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,p,u]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[p,u,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:g()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:g()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",p,u]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",p,u]}],fill:[{fill:["none",...g()]}],"stroke-w":[{stroke:[k,ue,ee,Me]}],stroke:[{stroke:["none",...g()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ct=ot(vt),jt={[Ie.Default]:"border-icon-secondary bg-layer-3"},Le=({tag:e,cssClass:o,remove:t,variant:s=Ie.Default,iconBefore:n})=>{const a=jt[s],l=Ct(m("flex items-center gap-1 dial-tiny border rounded p-1 h-[22px] text-primary",a,o));return r.jsxs("div",{className:l,children:[r.jsx(_,{icon:n}),r.jsx("span",{children:e}),t&&r.jsx(X,{iconAfter:r.jsx(E.IconX,{size:16}),onClick:t})]},e)},Fe=({ariaLabel:e,cssClass:o,size:t=24,onClose:s})=>r.jsx(X,{ariaLabel:e,cssClass:m("text-secondary hover:text-accent-primary",o),onClick:s,iconBefore:r.jsx(E.IconX,{size:t})}),cr=({value:e,textareaId:o,placeholder:t,cssClass:s="",disabled:n,invalid:a,readonly:l,onChange:c})=>r.jsx(Y,{tooltip:e,triggerClassName:"flex",children:r.jsx("textarea",{id:o,placeholder:t,value:e||"",disabled:n,className:m("dial-textarea dial-input px-3 py-2",a?"dial-input-error":"",n&&"dial-input-disable",l&&"dial-input-readonly",s),onChange:i=>!l&&c?.(i.currentTarget.value)})}),Nt=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],Dt=(e,o,t,s)=>{if((o==="number"||t!==void 0||s!==void 0)&&!Nt.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&o==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||s!==void 0){const a=e.currentTarget.value,l=e.currentTarget.selectionStart||0,c=a.slice(0,l)+e.key+a.slice(l),i=parseFloat(c);if(!isNaN(i)){if(t!==void 0&&i<t){e.preventDefault();return}if(s!==void 0&&i>s){e.preventDefault();return}}}}},fe=({iconBefore:e,iconAfter:o,hideBorder:t,value:s,elementId:n,placeholder:a="",cssClass:l="",containerCssClass:c,tooltipTriggerClassName:i,type:d="text",disabled:f,readonly:b,invalid:v,onChange:y,min:j,max:h,prefix:M,suffix:R,textBeforeInput:I,textAfterInput:D})=>{const S=x=>x.target.blur(),T=d==="number"||j!==void 0||h!==void 0,L=x=>{Dt(x,d,j,h)},F=x=>{const z=x.currentTarget.value;if(T&&z!==""){const U=parseFloat(z);if(isNaN(U)&&z!=="-"&&z!=="."||!isNaN(U)&&(j!==void 0&&U<j||h!==void 0&&U>h))return}y?.(z)};return r.jsxs("div",{className:m("dial-input-field flex flex-row items-center justify-between py-2",t?"dial-input-no-border":"dial-input",v&&"dial-input-error",f&&"dial-input-disable",b&&"dial-input-readonly",!I&&"pl-3",!D&&"pr-3",c),children:[I&&r.jsx("div",{children:r.jsx(fe,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:I,disabled:!0,elementId:I+"textBefore"})}),M&&r.jsxs("p",{className:"text-secondary dial-small",children:[" ",M]}),r.jsx(_,{icon:e}),r.jsx(Y,{tooltip:s,triggerClassName:m(i,"flex-1"),children:r.jsx("input",{type:d,autoComplete:"off",id:n,placeholder:a,value:s??"",disabled:f,className:m("border-0 bg-transparent",l),onChange:x=>!b&&F?.(x),onKeyDown:L,onWheel:S,min:j,max:h})}),r.jsx(_,{icon:o}),R&&r.jsxs("p",{className:"text-secondary dial-small",children:[" ",R]}),D&&r.jsx("div",{children:r.jsx(fe,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:D,disabled:!0,elementId:D+"textAfter"})})]})},It=/^0+\.(\d+)?$/,St=/^0+/,dr=({fieldTitle:e,errorText:o,optional:t,elementCssClass:s,elementContainerCssClass:n,elementId:a,containerCssClass:l,readonly:c,defaultEmptyText:i,min:d,max:f,...b})=>r.jsxs("div",{className:m("flex flex-col",l),children:[r.jsx(te,{fieldTitle:e,optional:t,htmlFor:a}),c?r.jsx("span",{children:b.value||(i??"None")}):r.jsxs(r.Fragment,{children:[r.jsx(fe,{elementId:a,cssClass:s,containerCssClass:n,invalid:o!=null,min:d,max:f,...b}),r.jsx(le,{errorText:o})]})]}),Rt=({onChange:e,value:o,min:t,max:s,...n})=>{const a=l=>String(l)?.match(It)?String(l)?.replace(St,"0"):Number(l);return r.jsx(dr,{type:"number",onChange:l=>e?.(a(l)),value:o,min:t,max:s,...n})},zt=({onChange:e,...o})=>r.jsx(dr,{type:"text",onChange:t=>e?.(t),...o}),Mt=({fieldTitle:e,optional:o,elementId:t,elementCssClass:s,errorText:n,...a})=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(te,{fieldTitle:e,optional:o,htmlFor:t}),r.jsx(cr,{textareaId:t,cssClass:s,...a}),r.jsx(le,{errorText:n})]}),Pt=({title:e,switchId:o,isOn:t=!1,disabled:s,onChange:n})=>{const a=m("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",s?"pointer-events-none":"",s?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),l=C.useCallback(c=>{c.stopPropagation(),n?.(!t)},[n,t]);return r.jsxs("div",{className:"flex flex-row items-center",children:[r.jsx("input",{type:"checkbox",onChange:l,id:o,disabled:s,className:"invisible w-0 h-0",checked:t}),r.jsx("label",{htmlFor:o,className:a,children:r.jsx("span",{className:m("size-3 rounded-full",s?t?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&r.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};var Q=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Q||{});const At="z-[52] flex items-center justify-center bg-blackout md:p-4",Et="divide-tertiary divide-y",Tt="flex flex-row justify-between py-4 px-6 items-center",Lt={[Q.Sm]:"dial-sm-popup",[Q.Md]:"dial-md-popup",[Q.Lg]:"dial-lg-popup"},Oe=({open:e=!1,title:o,portalId:t,cssClass:s,overlayClass:n,headingClass:a,dividers:l=!0,children:c,footer:i,onClose:d,size:f=Q.Md})=>{const{refs:b,context:v}=N.useFloating({open:e,onOpenChange:I=>{I||d?.(null)}}),y=N.useRole(v,{role:"dialog"}),j=N.useDismiss(v,{outsidePress:!0}),{getFloatingProps:h}=N.useInteractions([y,j]);if(!e)return null;const M=typeof o=="string"?"dial-popup-heading":void 0,R=I=>I?typeof I=="string"?r.jsx("h3",{id:M,className:m("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",a),children:r.jsx(Y,{tooltip:I,children:I})}):I:r.jsx("span",{});return r.jsx(N.FloatingPortal,{id:t,children:r.jsx(N.FloatingOverlay,{className:m(At,n),children:r.jsx(N.FloatingFocusManager,{context:v,children:r.jsxs("div",{ref:b.setFloating,...h(),role:"dialog","aria-modal":"true","aria-labelledby":M,className:m("dial-popup",Lt[f],l&&Et,s),children:[r.jsxs("div",{className:Tt,children:[R(o),r.jsx(Fe,{ariaLabel:"Close dialog",onClose:I=>d?.(I)})]}),r.jsx("div",{className:"flex-grow overflow-auto",children:c}),i]})})})})};var xe=(e=>(e.Info="info",e.Danger="danger",e))(xe||{});const Ft="flex justify-end gap-2 px-6 py-4",Ot="text-secondary dial-small-150 px-6 py-4",Vt="Cancel",Ue={[xe.Info]:{confirmVariant:B.Primary,cancelVariant:B.Secondary},[xe.Danger]:{container:"border-t-4 border-error",confirmVariant:B.Danger,cancelVariant:B.Secondary}},Gt=({title:e,description:o,descriptionCssClass:t,open:s=!1,confirmLabel:n,cancelLabel:a=Vt,isLoading:l=!1,disableConfirmButton:c=!1,cssClass:i,confirmClassName:d,onClose:f,onConfirm:b,onCancel:v,children:y,dividers:j=!1,variant:h=xe.Info,size:M=Q.Sm})=>{const R=l?null:r.jsxs("div",{className:Ft,children:[r.jsx(X,{variant:B.Secondary,title:a,onClick:()=>v?v():f?.()}),r.jsx(X,{variant:Ue[h].confirmVariant,cssClass:d,title:n,disable:c,onClick:()=>b()})]}),I=C.useCallback(()=>l?r.jsx("div",{className:"px-6 py-4 h-[120px]",children:r.jsx(Ke,{size:50})}):y??(o?r.jsx("div",{className:m(Ot,t),children:o}):null),[y,o,l,t]);return r.jsx(Oe,{open:s,title:e,cssClass:m(Ue[h].container,i),dividers:j,onClose:()=>f?.(),footer:R,size:M,children:I()})},Ve=({selectedItems:e,listCssClass:o,listElementCssClass:t})=>!!e?.length&&r.jsx("ul",{className:m("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",o),children:e?.map(s=>r.jsx("li",{children:r.jsx(Y,{tooltip:s,children:r.jsx(Le,{tag:s,cssClass:m([t])})})},s))}),qe=e=>$.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),ur=({children:e,open:o,disabled:t=!1,selectedValue:s,valueCssClasses:n,inputCssClasses:a,onOpen:l,elementId:c,errorText:i,emptyValueText:d})=>{const f=Array.isArray(s)&&s.length>0,b=typeof s=="string"&&!!s.trim(),v=f||b?s:d,y=t?void 0:l,j=()=>r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"w-full",onClick:y,"aria-label":"open-popup",id:c,children:r.jsxs("div",{className:m("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",a,t&&"dial-input-disable",i&&"dial-input-error"),children:[r.jsx(Y,{tooltip:String(v),children:r.jsx("span",{className:n,children:v})}),!t&&r.jsx("div",{className:"flex-shrink-0",children:r.jsx(_,{icon:r.jsx(qe,{role:"img",width:ne,height:ne})})})]})}),i&&r.jsx(le,{errorText:i})]}),h=()=>r.jsx("div",{className:"w-full",onClick:y,children:r.jsxs("div",{className:m("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",t&&"dial-input-disable"),children:[r.jsx(Ve,{selectedItems:v}),!t&&r.jsx("div",{className:"ml-1",children:r.jsx(_,{icon:r.jsx(qe,{role:"img",width:ne,height:ne})})})]})});return r.jsxs(r.Fragment,{children:[f?h():j(),o&&xr.createPortal(e,document.body)]})},Bt=({fieldTitle:e,htmlFor:o,disabled:t,selectedValue:s,radioButtons:n,customInputValue:a,valueCssClasses:l,inputCssClasses:c,emptyValueText:i,onClose:d,title:f,portalId:b,onApply:v,cancelButtonTitle:y="Cancel",applyButtonTitle:j="Apply",isValid:h,selectedRadioValue:M,onChangeRadioField:R,id:I,size:D=Q.Md})=>{const[S,T]=C.useState(!1),L=C.useCallback(()=>{t||T(!0)},[t]),F=C.useCallback(()=>{T(!1),d?.()},[d]),x=C.useCallback(()=>{v(),F()},[v,F]);return r.jsxs("div",{className:"flex flex-col",children:[r.jsx(te,{fieldTitle:e,htmlFor:o}),r.jsx(ur,{disabled:t,open:S,selectedValue:a??n.find(z=>z.id===s)?.name,valueCssClasses:l,inputCssClasses:m(c,"py-2","px-3"),emptyValueText:i,onOpen:L,children:r.jsx(Oe,{open:S,onClose:F,title:f,portalId:b,size:D,footer:r.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[r.jsx(X,{variant:B.Secondary,title:y,onClick:F}),r.jsx(X,{variant:B.Primary,title:j,onClick:x,disable:!h})]}),children:r.jsx("div",{className:"px-6 py-4",children:r.jsx(Qe,{radioButtons:n,labelCssClass:"dial-small",activeRadioButton:M,onChange:R,elementId:I,orientation:me.Column})})})})]})},Wt=({onClick:e})=>r.jsx(E.IconEyeOff,{...ae,className:"text-primary",onClick:e}),_t=({onClick:e})=>r.jsx(E.IconEye,{...ae,className:"text-primary",onClick:e}),pr=({...e})=>{const[o,t]=C.useState(!1),s=C.useCallback(n=>{t(n)},[]);return r.jsx(fe,{type:o?"text":"password",...e,iconAfter:o?r.jsx(Wt,{onClick:()=>s(!1)}):r.jsx(_t,{onClick:()=>s(!0)})})},Ht=({fieldTitle:e,optional:o,elementCssClass:t,elementId:s,errorText:n,...a})=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(te,{fieldTitle:e,optional:o,htmlFor:s}),r.jsx(pr,{cssClass:t,elementId:s,invalid:!!n,...a}),r.jsx(le,{errorText:n})]});var ge=(e=>(e.Small="small",e.Base="base",e))(ge||{});const $t={[ge.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[ge.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},Ut=({elementId:e,value:o,placeholder:t,disabled:s,readonly:n,invalid:a,cssClass:l,containerCssClass:c,onChange:i,size:d=ge.Base})=>{const[f,b]=C.useState(o||"");C.useEffect(()=>{b(o||"")},[o]);const v=C.useCallback(h=>{b(h),i?.(h)},[i]),y=$t[d],j=C.useCallback(()=>{v("")},[v]);return r.jsxs("div",{className:m("dial-input flex flex-row items-center justify-between",a&&"dial-input-error",s&&"dial-input-disable",n&&"dial-input-readonly",y.containerClass,c),children:[r.jsx(_,{className:m(s?"text-secondary":"text-primary"),icon:r.jsx(E.IconSearch,{size:y.iconSize,stroke:y.iconStroke})}),r.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:t,value:f??"",disabled:s,readOnly:n,className:m("border-0 bg-transparent w-full",l,y.textClass),onChange:h=>!n&&v(h.currentTarget.value)}),f&&!n&&!s&&r.jsx(_,{className:"text-primary cursor-pointer",icon:r.jsx(E.IconX,{size:y.iconSize,stroke:y.iconStroke,onClick:j,"aria-label":"Clear search",role:"button"})})]})},qt=({placeholder:e="",selectedItems:o=[],updateSelected:t,listCssClass:s,listElementCssClass:n,containerCssClass:a,inputCssClass:l})=>{const[c,i]=C.useState(""),d=C.useCallback(b=>{b.key==="Enter"&&(t([...o,b.currentTarget.value]),i("")),(b.key==="Backspace"||b.key==="Delete")&&o.length&&!c&&t(o.slice(0,-1))},[o,t,c]),f=C.useCallback(b=>{i(b.target.value)},[i]);return r.jsxs("div",{className:m(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",a]),children:[r.jsx(Ve,{selectedItems:o,listCssClass:s,listElementCssClass:n}),r.jsx("input",{type:"text",value:c,className:m(["border-0 bg-transparent p-0",l]),placeholder:o?.length?"":e,onKeyDown:d,onChange:f})]})},Kt=({initialTags:e=[],fieldTitle:o,optional:t,elementId:s,placeholder:n,errorText:a,invalid:l,disabled:c,onChange:i})=>{const d=C.useRef(null),[f,b]=C.useState(e),[v,y]=C.useState(""),[j,h]=C.useState(!1),M=D=>{const S=D.trim().replace(/,$/,"");if(S&&!f.includes(S)){const T=[S,...f];b(T),i?.(T)}},R=D=>{(D.key===","||D.key==="Enter")&&(D.preventDefault(),M(v),y(""))},I=D=>{const S=f.filter((T,L)=>L!==D);b(S),i?.(S)};return C.useEffect(()=>{const D=new ResizeObserver(()=>{if(d.current){const S=d.current.scrollHeight>d.current.clientHeight+10;h(S)}});return d.current&&D.observe(d.current),()=>D.disconnect()},[f]),r.jsxs("div",{className:m("flex flex-col w-full"),children:[r.jsx(te,{fieldTitle:o,optional:t,htmlFor:s}),r.jsx("div",{className:m("dial-input min-h-[38px] p-[6px]",l&&"dial-input-error",c&&"dial-input-disable"),children:r.jsxs("div",{ref:d,className:m("flex flex-wrap gap-2 items-center",j?"flex-col-reverse":"flex-row"),children:[f.map((D,S)=>r.jsx(Le,{tag:D,remove:c?void 0:()=>I(S)},D+S)),r.jsx("input",{type:"text",value:v,onChange:D=>y(D.target.value),onKeyDown:R,className:m("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:n,disabled:c})]})}),r.jsx(le,{errorText:a})]})};var mr=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(mr||{}),pe=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(pe||{}),fr=(e=>(e.Item="item",e.Divider="divider",e))(fr||{});const Xt=m("inline-flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Zt=m("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Jt=m("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Qt="opacity-75 !cursor-not-allowed",Yt="text-error",eo="my-1 border-t border-hover",De=8,ro=({children:e,menu:o,renderOverlay:t,trigger:s=[pe.Click],placement:n,disabled:a=!1,open:l,defaultOpen:c=!1,onOpenChange:i,closable:d=!1,onClose:f,cssClass:b,listClassName:v,outsidePressIgnoreRef:y,outsideClosable:j=!0})=>{const[h,M]=C.useState(c),R=l!==void 0,I=R?!!l:h,D=C.useCallback(w=>{R||M(w),i?.(w)},[R,i]),S=C.useId(),T=w=>w?"clientWidth"in w?w.clientWidth:w.getBoundingClientRect?.()?.width??0:0,L=n===void 0,{refs:F,floatingStyles:x,context:z}=N.useFloating({placement:n,open:I,onOpenChange:D,whileElementsMounted:N.autoUpdate,middleware:[N.offset({mainAxis:De,crossAxis:0}),L?N.autoPlacement({alignment:"start",crossAxis:!0,padding:De}):N.flip({padding:De}),N.shift({padding:De}),N.size({apply({availableWidth:w,elements:V}){const ye=T(V.reference);V.floating.style.setProperty("--reference-width",`${ye}px`),V.floating.style.maxWidth=`${w}px`}})]}),U=N.useClick(z,{enabled:s.includes(pe.Click)&&!a}),be=N.useHover(z,{enabled:s.includes(pe.Hover)&&!a,move:!1,restMs:40,delay:{open:80,close:80}}),oe=N.useDismiss(z,{bubbles:!0,referencePress:!1,outsidePress:w=>{if(!j)return!1;const V=w.target;return!(y?.current&&V instanceof Node&&y.current.contains(V))}}),he=N.useRole(z,{role:"menu"}),{getReferenceProps:de,getFloatingProps:Z}=N.useInteractions([U,be,oe,he]),H=w=>{!s.includes(pe.ContextMenu)||a||(w.preventDefault(),D(!0))};C.useEffect(()=>{a&&I&&D(!1)},[a,I,D]);const q=w=>V=>{w.disabled||(w.onClick?.({key:w.key,domEvent:V}),o?.onClick?.({key:w.key,domEvent:V}),D(!1))},g=t?t():o&&r.jsx("div",{role:"none",className:"py-1",children:o.items.map(w=>w.type===fr.Divider?r.jsx("div",{role:"separator",className:eo},w.key):r.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!w.disabled,className:m(Jt,w.disabled&&Qt,w.danger&&Yt),disabled:w.disabled,onClick:q(w),children:[w.icon&&r.jsx("span",{className:m(w.danger&&"text-error",w.disabled&&"text-secondary"),children:r.jsx(_,{icon:w.icon})}),r.jsx("span",{className:m("flex-1 truncate text-left",w.danger&&"text-error",w.disabled&&"text-secondary"),children:w.label})]},w.key))});return r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:F.setReference,className:m(Xt,a&&"!cursor-not-allowed opacity-75",b),"aria-haspopup":"menu","aria-expanded":I,"aria-controls":S,onContextMenu:H,...de(),children:e}),I&&r.jsx(N.FloatingPortal,{children:r.jsx(N.FloatingFocusManager,{context:z,modal:!1,initialFocus:-1,returnFocus:!0,children:r.jsxs("div",{id:S,ref:F.setFloating,style:x,className:m(Zt,v),...Z(),children:[d&&r.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:r.jsx(Fe,{ariaLabel:"Close dropdown",onClose:w=>{f?.(w),D(!1)}})}),g]})})})]})};exports.AlertVariant=re;exports.ButtonVariant=B;exports.ConfirmationPopupVariant=xe;exports.DialAlert=kr;exports.DialAutocompleteInput=qt;exports.DialAutocompleteInputValue=Ve;exports.DialButton=X;exports.DialCheckbox=Mr;exports.DialCloseButton=Fe;exports.DialCollapsibleSidebar=Wr;exports.DialConfirmationPopup=Gt;exports.DialDropdown=ro;exports.DialErrorText=le;exports.DialFieldLabel=te;exports.DialIcon=_;exports.DialInput=fe;exports.DialInputPopup=ur;exports.DialLabelledText=_r;exports.DialLoader=Ke;exports.DialNoDataContent=Gr;exports.DialNumberInputField=Rt;exports.DialPasswordInput=pr;exports.DialPasswordInputField=Ht;exports.DialPopup=Oe;exports.DialRadioButton=Je;exports.DialRadioGroup=Qe;exports.DialRadioGroupPopupField=Bt;exports.DialSearch=Ut;exports.DialSteps=Tr;exports.DialSwitch=Pt;exports.DialTag=Le;exports.DialTagInput=Kt;exports.DialTextAreaField=Mt;exports.DialTextInputField=zt;exports.DialTextarea=cr;exports.DialTooltip=Y;exports.DropdownType=mr;exports.PopupSize=Q;exports.RadioGroupOrientation=me;exports.SearchSize=ge;exports.StepStatus=W;exports.TagVariant=Ie;