@npm-questionpro/wick-ui-lib 1.22.0 → 1.24.0

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.
Files changed (40) hide show
  1. package/dist/src/components/contentEditor/WuContentEditor.d.ts +5 -0
  2. package/dist/src/components/contentEditor/extentions/Alignment.d.ts +2 -0
  3. package/dist/src/components/contentEditor/extentions/BgColor.d.ts +1 -0
  4. package/dist/src/components/contentEditor/extentions/Block.d.ts +2 -0
  5. package/dist/src/components/contentEditor/extentions/Blockquote.d.ts +1 -0
  6. package/dist/src/components/contentEditor/extentions/Bold.d.ts +2 -0
  7. package/dist/src/components/contentEditor/extentions/ClearFormat.d.ts +1 -0
  8. package/dist/src/components/contentEditor/extentions/CodeLine.d.ts +1 -0
  9. package/dist/src/components/contentEditor/extentions/EmbedImage.d.ts +2 -0
  10. package/dist/src/components/contentEditor/extentions/EmbedLink.d.ts +2 -0
  11. package/dist/src/components/contentEditor/extentions/EmbedTable.d.ts +1 -0
  12. package/dist/src/components/contentEditor/extentions/Family.d.ts +2 -0
  13. package/dist/src/components/contentEditor/extentions/Italic.d.ts +2 -0
  14. package/dist/src/components/contentEditor/extentions/List.d.ts +2 -0
  15. package/dist/src/components/contentEditor/extentions/Size.d.ts +2 -0
  16. package/dist/src/components/contentEditor/extentions/Strikethrough.d.ts +2 -0
  17. package/dist/src/components/contentEditor/extentions/Subscript.d.ts +1 -0
  18. package/dist/src/components/contentEditor/extentions/Superscript.d.ts +1 -0
  19. package/dist/src/components/contentEditor/extentions/TextColor.d.ts +1 -0
  20. package/dist/src/components/contentEditor/extentions/Underline.d.ts +2 -0
  21. package/dist/src/components/contentEditor/ui/Toolbar.d.ts +24 -0
  22. package/dist/src/components/drilldown/WuDrilldown.d.ts +22 -12
  23. package/dist/src/components/drilldown/WuDrilldownTitles.d.ts +12 -0
  24. package/dist/style.css +1 -1
  25. package/dist/wick-ui-lib/es/index.js +9127 -5417
  26. package/dist/wick-ui-lib/umd/index.js +16 -8
  27. package/package.json +3 -3
  28. package/dist/src/components/contentEditor/extentions/fontFamily.d.ts +0 -2
  29. package/dist/src/components/contentEditor/extentions/fontSize.d.ts +0 -1
  30. package/dist/src/components/contentEditor/extentions/formatAlignment.d.ts +0 -2
  31. package/dist/src/components/contentEditor/extentions/formatClear.d.ts +0 -1
  32. package/dist/src/components/contentEditor/extentions/formatCode.d.ts +0 -1
  33. package/dist/src/components/contentEditor/extentions/formatColor.d.ts +0 -1
  34. package/dist/src/components/contentEditor/extentions/formatList.d.ts +0 -2
  35. package/dist/src/components/contentEditor/extentions/formatScript.d.ts +0 -1
  36. package/dist/src/components/contentEditor/extentions/formatStyle.d.ts +0 -2
  37. package/dist/src/components/contentEditor/extentions/formatText.d.ts +0 -2
  38. package/dist/src/components/contentEditor/extentions/image.d.ts +0 -2
  39. package/dist/src/components/contentEditor/extentions/link.d.ts +0 -2
  40. package/dist/src/components/contentEditor/extentions/table.d.ts +0 -1
@@ -1,12 +1,20 @@
1
- (function(v,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch"),require("react-transition-group"),require("@tiptap/react"),require("@tiptap/extension-list"),require("@tiptap/extension-subscript"),require("@tiptap/extension-superscript"),require("@tiptap/extension-table"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/starter-kit"),require("@tiptap/extension-image")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","react-dom","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch","react-transition-group","@tiptap/react","@tiptap/extension-list","@tiptap/extension-subscript","@tiptap/extension-superscript","@tiptap/extension-table","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/starter-kit","@tiptap/extension-image"],r):(v=typeof globalThis<"u"?globalThis:v||self,r(v["wick-ui-lib"]={},v["react/jsx-runtime"],v.RadixUIAccordion,v.React,v.clsx,v.tailwindMerge,v.RadixUIAvatar,v.RadixUISlot,v.ClassVarianceAuthority,v.RadixUILabel,v.RadixUITooltip,v.dateFns,v.RadixUIPopover,v.ReactDayPicker,v.RadixUICheckbox,v.cmdk,v.ReactVirtuoso,v.RadixUIDropdownMenu,v.RadixUIDialog,v.RadixUIScrollArea,v.RadixUIRadioGroup,v.RadixUISeparator,v.ReactDOM,v.RadixUIToggleGroup,v.RadixUIToggle,v.RadixUITabs,v.TanstackReactTable,v.RadixUIToast,v.RadixUISwitch,v.ReactTransitionGroup,v.TipTapReact,v.TipTapExtensionList,v.TipTapExtensionSubscript,v.TipTapExtensionSuperscript,v.TipTapExtensionTable,v.TipTapExtensionTextAlign,v.TipTapExtensionTextStyle,v.TipTapStarterKit,v.TipTapExtensionImage))})(this,(function(v,r,Je,f,xn,vn,yn,Xe,Se,Nn,dr,j,wt,ha,Cn,fe,Sn,ft,ba,En,Tn,kn,In,An,Dn,Mn,_e,_n,Fn,Pt,ge,ga,Ln,Wn,Pn,On,Ze,Bn,qn){"use strict";var xd=Object.defineProperty;var vd=(v,r,Je)=>r in v?xd(v,r,{enumerable:!0,configurable:!0,writable:!0,value:Je}):v[r]=Je;var Wt=(v,r,Je)=>vd(v,typeof r!="symbol"?r+"":r,Je);function ce(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const Ve=ce(Je),g=ce(f),Qe=ce(yn),ma=ce(Nn),pt=ce(dr),ht=ce(wt),wr=ce(Cn),R=ce(ft),X=ce(ba),He=ce(En),bt=ce(Tn),xa=ce(kn),zn=ce(In),Ot=ce(An),va=ce(Dn),$e=ce(Mn),me=ce(_n),fr=ce(Fn),Vn=vn.extendTailwindMerge({prefix:"wu-"});function c(...e){return Vn(xn.clsx(e))}const pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Bt(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function gt(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Hn=e=>e?/\S+@questionpro\.com/.test(e):!1,ya=Ve.Root,hr=g.forwardRef(({className:e,...t},a)=>r.jsx(Ve.Item,{ref:a,className:c("wu-border-b",e),...t}));hr.displayName="AccordionItem";const br=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx(Ve.Header,{className:"wu-flex",children:r.jsxs(Ve.Trigger,{ref:s,className:c("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...a,children:[t,r.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));br.displayName=Ve.Trigger.displayName;const gr=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx(Ve.Content,{ref:s,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...a,children:r.jsx("div",{className:c("wu-pb-4 wu-pt-0",e),children:t})}));gr.displayName=Ve.Content.displayName;const $n=e=>{const{items:t,className:a,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:o=[],value:n,onValueChange:u}=e;return r.jsx(ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,children:t.map(({value:l,Summary:i,Details:d,className:w})=>r.jsxs(hr,{value:l,dir:s,className:c(a,w),children:[r.jsx(br,{dir:s,className:"wu-accordion-summary",children:i}),r.jsx(gr,{dir:s,className:"wu-accordion-details",children:d})]},l))})}else{const{defaultValue:o,value:n,onValueChange:u}=e;return r.jsx(ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,collapsible:!0,children:t.map(({value:l,Summary:i,Details:d,className:w})=>r.jsxs(hr,{value:l,dir:s,className:c(a,w),children:[r.jsx(br,{dir:s,className:"wu-accordion-summary",children:i}),r.jsx(gr,{dir:s,className:"wu-accordion-details",children:d})]},l))})}},Na=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Root,{ref:a,className:c("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Na.displayName=Qe.Root.displayName;const Ca=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Image,{ref:a,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));Ca.displayName=Qe.Image.displayName;const Sa=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Fallback,{ref:a,className:c("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Sa.displayName=Qe.Fallback.displayName;function mr(e,t){f.useEffect(()=>{const a=s=>{Array.isArray(e)&&e.some(o=>!o.current||o.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[e,t])}const xr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ea=({dir:e,Trigger:t,triggerClassName:a,DropdownContent:s,isAllowActiveStyle:o})=>{const[n,u]=f.useState(!1),l=f.useRef(null),i=f.useRef(null);mr([l,i],()=>u(!1));const d=()=>{u(!n)};return r.jsx(r.Fragment,{children:r.jsx("div",{className:xr.dropdownContainer,children:r.jsx("ul",{children:r.jsxs("li",{className:c("wu-flex wu-relative",n&&xr.open),children:[r.jsx("button",{className:c("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",a,o&&n&&"wu-bg-white wu-text-blue-switcher"),onClick:w=>{w.preventDefault(),d()},ref:i,"aria-label":"dropdown-trigger",children:t}),r.jsx("div",{className:c(xr.dropdownMenu,{open:n},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:l,"aria-label":"user-menu",children:s})]})})})})},vr=Se.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded-sm","wu-whitespace-nowrap wu-leading-4 wu-text-sm wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px]","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Re=g.forwardRef(({className:e,variant:t,size:a,color:s,asChild:o=!1,...n},u)=>{const l=o?Xe.Slot:"button";return r.jsx(l,{className:c(vr({size:a,color:s,variant:t,className:e})),ref:u,...n})});Re.displayName="Button";const et=f.forwardRef((e,t)=>Un(e,t)),Un=(e,t)=>{const{size:a="md",color:s="#1B87E6",variant:o="dots",...n}=e,u=c("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let l="7px";a==="sm"?l="7px":a==="md"?l="12px":a==="lg"?l="18px":typeof a=="string"&&(l=a);const i={backgroundColor:s,width:l,height:l},d=r.jsxs("div",{...n,ref:t,className:c("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[r.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:l,height:l,borderTopColor:s}}),e.message&&r.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),w=r.jsxs("div",{...n,ref:t,className:c("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[r.jsxs("ul",{className:u,style:{fontSize:l},role:"loader",children:[r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&r.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return r.jsx(r.Fragment,{children:o==="spinner"?d:w})};et.displayName="WuLoader";const le=f.forwardRef(({disabled:e,loading:t,variant:a="primary",size:s="md",Icon:o,iconPosition:n="left",children:u,floating:l,className:i,color:d="primary",selected:w,...p},b)=>{const h={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return r.jsxs(Re,{...p,disabled:e,variant:a,size:s,className:c(l&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",n==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",w&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",i),color:d,style:{backgroundColor:t?h[d]:"",...p.style},ref:b,children:[!t&&o&&r.jsx(r.Fragment,{children:o}),t&&r.jsx(et,{color:"#fff",size:"sm"}),!t&&u]})});le.displayName="WuButton";const jn=({onLogout:e,DataCenter:t})=>r.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[r.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),r.jsx(le,{variant:"outline",size:"sm",Icon:r.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Gn=({user:e,dir:t})=>{const a=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[r.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),r.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:r.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:r.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return r.jsxs(r.Fragment,{children:[r.jsx("ul",{children:a.map(({title:s,url:o,icon:n,node:u},l)=>r.jsx("li",{className:l<a.length-1?"wu-border-b wu-border-gray-subtle":"",children:r.jsxs("a",{href:o,className:c("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[r.jsx("span",{className:c(n,"wu-w-12 wu-text-center")}),r.jsx("span",{children:s})]}),u]})},l))}),r.jsx("hr",{className:"wu-border-gray-subtle"})]})},Yn=({settings:e,dir:t})=>r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"wu-border-gray-subtle"}),r.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[r.jsx("span",{className:c("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),r.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(a=>r.jsx("li",{tabIndex:-1,dir:t,children:r.jsx("a",{href:a.url,className:c("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:a.title})},a.title))})]}),r.jsx("hr",{className:"wu-border-gray-subtle"})]}),Kn=({user:e,dir:t})=>{var a,s,o,n,u,l,i,d,w;return r.jsxs("section",{className:c("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:r.jsx("span",{className:"wu-text-base wm-person"})}),r.jsxs("div",{className:c("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[r.jsx("p",{children:(a=e==null?void 0:e.profile)==null?void 0:a.title}),r.jsxs("a",{href:(s=e==null?void 0:e.license)==null?void 0:s.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[r.jsx("p",{children:(o=e==null?void 0:e.profile)==null?void 0:o.subtitle}),r.jsx("p",{className:"wu-font-light",children:(n=e==null?void 0:e.profile)==null?void 0:n.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[r.jsx("a",{href:(u=e==null?void 0:e.license)==null?void 0:u.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[r.jsx("p",{className:"wu-font-normal",children:(l=e==null?void 0:e.license)==null?void 0:l.subtitle}),r.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[r.jsx("p",{className:"wu-font-normal",children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),r.jsx("p",{children:(w=e==null?void 0:e.license)==null?void 0:w.expiryDate})]})]})]})]})},Ta=({user:e,onLogout:t,dir:a,DataCenter:s})=>{var o,n;return e?r.jsx(Ea,{Trigger:r.jsxs(Na,{className:c("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[r.jsx(Ca,{className:"hover:wu-opacity-80",src:(o=e==null?void 0:e.profile)==null?void 0:o.profilePicture,alt:"User"}),r.jsx(Sa,{children:(n=e==null?void 0:e.profile)==null?void 0:n.initials})]}),dir:a,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:r.jsxs("div",{className:c("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:a,children:[r.jsx(Kn,{user:e,dir:a}),(e==null?void 0:e.settings)&&e.settings.length>0&&r.jsx(Yn,{settings:e.settings,dir:a}),r.jsx(Gn,{user:e,dir:a}),r.jsx(jn,{onLogout:t,DataCenter:s})]})}):null},ka=({menuList:e,dir:t})=>{const a=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return r.jsx(Ea,{dir:t,Trigger:r.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:r.jsx("ul",{children:(e||a).map((s,o)=>r.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:s.target==="window"?r.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>pr(s.link),onKeyDown:n=>{n.key==="Enter"&&pr(s.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
2
- focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer`,children:r.jsx(Ia,{item:s,dir:t})}):r.jsx("a",{href:s.link,target:"_blank",className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[0.04] focus-visible:wu-border-none
1
+ (function(T,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch"),require("@tiptap/react"),require("@tiptap/extension-list"),require("@tiptap/extension-subscript"),require("@tiptap/extension-superscript"),require("@tiptap/extension-table"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/starter-kit"),require("@tiptap/extension-image")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","react-dom","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch","@tiptap/react","@tiptap/extension-list","@tiptap/extension-subscript","@tiptap/extension-superscript","@tiptap/extension-table","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/starter-kit","@tiptap/extension-image"],a):(T=typeof globalThis<"u"?globalThis:T||self,a(T["wick-ui-lib"]={},T["react/jsx-runtime"],T.RadixUIAccordion,T.React,T.clsx,T.tailwindMerge,T.RadixUIAvatar,T.RadixUISlot,T.ClassVarianceAuthority,T.RadixUILabel,T.RadixUITooltip,T.dateFns,T.RadixUIPopover,T.ReactDayPicker,T.RadixUICheckbox,T.cmdk,T.ReactVirtuoso,T.RadixUIDropdownMenu,T.RadixUIDialog,T.RadixUIScrollArea,T.RadixUIRadioGroup,T.RadixUISeparator,T.ReactDOM,T.RadixUIToggleGroup,T.RadixUIToggle,T.RadixUITabs,T.TanstackReactTable,T.RadixUIToast,T.RadixUISwitch,T.TipTapReact,T.TipTapExtensionList,T.TipTapExtensionSubscript,T.TipTapExtensionSuperscript,T.TipTapExtensionTable,T.TipTapExtensionTextAlign,T.TipTapExtensionTextStyle,T.TipTapStarterKit,T.TipTapExtensionImage))})(this,(function(T,a,wt,p,wc,fc,pc,ft,Me,hc,dr,K,Bt,fa,mc,ye,gc,zt,pa,bc,yc,xc,vc,Nc,Sc,Cc,Be,Tc,Ec,we,ha,Ac,kc,Mc,Ic,pt,Dc,Pc){"use strict";var dy=Object.defineProperty;var wy=(T,a,wt)=>a in T?dy(T,a,{enumerable:!0,configurable:!0,writable:!0,value:wt}):T[a]=wt;var yn=(T,a,wt)=>wy(T,typeof a!="symbol"?a+"":a,wt);function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Je=pe(wt),v=pe(p),ht=pe(pc),ma=pe(hc),qt=pe(dr),$t=pe(Bt),wr=pe(mc),te=pe(zt),Q=pe(pa),Qe=pe(bc),Ht=pe(yc),ga=pe(xc),Fc=pe(vc),xn=pe(Nc),ba=pe(Sc),Re=pe(Cc),Se=pe(Tc),fr=pe(Ec),Vc=fc.extendTailwindMerge({prefix:"wu-"});function f(...e){return Vc(wc.clsx(e))}const pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function vn(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ut(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Lc=e=>e?/\S+@questionpro\.com/.test(e):!1,ya=Je.Root,hr=v.forwardRef(({className:e,...t},n)=>a.jsx(Je.Item,{ref:n,className:f("wu-border-b",e),...t}));hr.displayName="AccordionItem";const mr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Header,{className:"wu-flex",children:a.jsxs(Je.Trigger,{ref:r,className:f("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));mr.displayName=Je.Trigger.displayName;const gr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Je.Content,{ref:r,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...n,children:a.jsx("div",{className:f("wu-pb-4 wu-pt-0",e),children:t})}));gr.displayName=Je.Content.displayName;const _c=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:c,className:d})=>a.jsxs(hr,{value:u,dir:r,className:f(n,d),children:[a.jsx(mr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(gr,{dir:r,className:"wu-accordion-details",children:c})]},u))})}},xa=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Root,{ref:n,className:f("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));xa.displayName=ht.Root.displayName;const va=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Image,{ref:n,className:f("wu-aspect-square wu-h-full wu-w-full",e),...t}));va.displayName=ht.Image.displayName;const Na=v.forwardRef(({className:e,...t},n)=>a.jsx(ht.Fallback,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Na.displayName=ht.Fallback.displayName;function br(e,t){p.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const yr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Sa=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=p.useState(!1),u=p.useRef(null),l=p.useRef(null);br([u,l],()=>i(!1));const c=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:yr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:f("wu-flex wu-relative",o&&yr.open),children:[a.jsx("button",{className:f("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:d=>{d.preventDefault(),c()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:f(yr.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:r})]})})})})},xr=Me.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded-sm","wu-whitespace-nowrap wu-leading-4 wu-text-sm wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px]","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),mt=v.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?ft.Slot:"button";return a.jsx(u,{className:f(xr({size:n,color:r,variant:t,className:e})),ref:i,...o})});mt.displayName="Button";const gt=p.forwardRef((e,t)=>Oc(e,t)),Oc=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=f("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},c=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:f("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:i,style:{fontSize:u},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:s==="spinner"?c:d})};gt.displayName="WuLoader";const ce=p.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:c="primary",selected:d,...w},h)=>{const m={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(mt,{...w,disabled:e,variant:n,size:r,className:f(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",d&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",l),color:c,style:{backgroundColor:t?m[c]:"",...w.style},ref:h,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(gt,{color:"#fff",size:"sm"}),!t&&i]})});ce.displayName="WuButton";const Wc=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(ce,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Bc=({user:e,dir:t})=>{const n=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:f("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:f(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},zc=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:f("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:f("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),qc=({user:e,dir:t})=>{var n,r,s,o,i,u,l,c,d;return a.jsxs("section",{className:f("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:f("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(u=e==null?void 0:e.license)==null?void 0:u.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(l=e==null?void 0:e.license)==null?void 0:l.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),a.jsx("p",{children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDate})]})]})]})]})},Ca=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Sa,{Trigger:a.jsxs(xa,{className:f("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[a.jsx(va,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(Na,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:f("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:n,children:[a.jsx(qc,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(zc,{settings:e.settings,dir:n}),a.jsx(Bc,{user:e,dir:n}),a.jsx(Wc,{onLogout:t,DataCenter:r})]})}):null},Ta=({menuList:e,dir:t})=>{const n=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return a.jsx(Sa,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>pr(r.link),onKeyDown:o=>{o.key==="Enter"&&pr(r.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
2
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer`,children:a.jsx(Ea,{item:r,dir:t})}):a.jsx("a",{href:r.link,target:"_blank",className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[0.04] focus-visible:wu-border-none
3
3
  focus-visible:wu-bg-black
4
- focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:r.jsx(Ia,{item:s,dir:t})})},o))})})},Ia=({item:e,dir:t})=>r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:r.jsx("span",{className:c("wu-text-xl wu-text-gray-lead",e.icon)})}),r.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),Jn=e=>{const[t,a]=f.useState(()=>window.innerWidth<=e);return f.useEffect(()=>{const s=()=>{a(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function Xn({productCategories:e,openCategory:t,setOpenCategory:a}){const s=(l,i)=>{const d=i[l];if(d){d.focus();const w=e[l]||null;a(w)}},o=(l,i,d,w)=>{l.preventDefault();const p=d==="down"?i+1:i-1;s(p,w)},n=(l,i,d,w)=>{t!=null&&t.products&&t.products[t.products.length-1].name===w&&(l.preventDefault(),s(i+1,d))},u=(l,i)=>{l.preventDefault();const d=e[i]===t?null:e[i];a(d)};return function(i,d,w){const p=document.querySelectorAll("[data-product-category]"),{key:b}=i;switch(b){case"ArrowDown":o(i,d,"down",p);break;case"ArrowUp":o(i,d,"up",p);break;case"Tab":n(i,d,p,w);break;case"Enter":case" ":u(i,d);break}}}const Zn=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},u=e.as||"div";return r.jsx(u,{...o,className:c(n[t],a),children:s})},Qn=e=>{const{size:t="xl",className:a,children:s,...o}=e,n={sm:"h4",md:"h3",lg:"h2",xl:"h1"},u={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},l=n[t];return r.jsx(l,{...o,className:c(u[t],a),children:s})},Rn=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},u=e.as||"div";return r.jsx(u,{...o,className:c(n[t],a),children:s})},eu=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={md:"wu-text-display-2",lg:"wu-text-display-1"},u=e.as||"h1";return r.jsx(u,{...o,className:c(n[t],a),children:s})},ue=e=>{const{icon:t,className:a,...s}=e;return r.jsx("span",{...s,className:c(t,a),role:"presentation","aria-label":t})},tu=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:a,isDropdownOpen:s,activeProductName:o,dir:n="ltr",homeLink:u="/"})=>r.jsxs("button",{ref:e,type:"button",className:c("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:l=>{s&&l.key==="ArrowDown"&&a(l,-1)},"aria-label":"product-switcher",children:[r.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:u,children:r.jsx(ue,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),o,r.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",n==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ee={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},ru=({category:e,dir:t="ltr",openCategory:a})=>{const s=e.active?"#c5cce0":"#f0c36a",o=(a==null?void 0:a.name)===e.name,n=c("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",o&&"wu-hidden","wu-relative wu-top-[5px]"),u=c("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",o&&"wu-hidden","wu-relative wu-top-1");return r.jsxs("div",{className:c("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[r.jsx("div",{className:ee.productCategoryBorderTop,style:{backgroundColor:s}}),r.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[r.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:r.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),r.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?r.jsx("span",{className:n}):r.jsx("span",{className:u})]})},au={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},su=({product:e,currentProduct:t,activeProductName:a,dir:s,focusItem:o,setFocusItem:n})=>{const[u,l]=f.useState(e.name===t),i=e.name===a,d=e.name===t,w=!e.active,p="#1b3380",b="#c5cce0",h="#ffcf70",x=c("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",d&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",u&&"wu-font-normal",e.active&&u&&"wu-text-blue-q"),m=c("wu-text-blue-p wu-text-base",d&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&u&&"wu-text-blue-q"),C=u||o===e.name||i?p:b;return r.jsxs("li",{className:c(ee.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||u)&&ee.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",o===e.name&&ee.activeProduct,"wu-product-item"),onMouseOver:()=>l(!0),onMouseOut:()=>l(!1),"aria-label":e.name,"aria-disabled":w,dir:s,onKeyDown:E=>{if(E.key==="Enter"){E.preventDefault();const y=E.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{n(e.name)},onBlur:()=>n(""),children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:w?h:C}}),r.jsxs("a",{className:c(ee.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[r.jsx("span",{className:c(m,au[e.icon||""]),"aria-hidden":!0}),r.jsx("span",{className:c(x),children:e.name})]})]},e.name)},ou=({category:e,currentProduct:t,activeProductName:a,dir:s="ltr",focusItem:o,setFocusItem:n,borderColorLocked:u="#f5a300"})=>{const{products:l=[],active:i}=e,d=f.useMemo(()=>l.filter(x=>x.active).sort((x,m)=>(x.order||100)-(m.order||100)),[l]),w=f.useMemo(()=>l.filter(x=>!x.active),[l]),[p,b]=f.useState(u),h=x=>x.map((m,C)=>r.jsx(su,{product:m,currentProduct:t,activeProductName:a,dir:s,focusItem:o,setFocusItem:n},C));return i?r.jsxs(r.Fragment,{children:[h(d),w.length>0&&r.jsxs("li",{className:c(ee.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>b("#f5a300"),onMouseOut:()=>b(u),"aria-label":"Upgrade to unlock",children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),r.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:c(ee.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[r.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),r.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",r.jsx("br",{})," unlock"]})]})]}),h(w)]}):r.jsxs("li",{className:c(ee.productListItem,ee.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",o==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>n("learn"),onBlur:()=>n(""),"aria-label":"Learn More",children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:u}}),r.jsx("a",{className:ee.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:r.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Aa=({dropdownRef:e,dir:t,isDropdownOpen:a,productCategories:s,openCategory:o,setOpenCategory:n,handleKeyDown:u,expandAll:l,activeProductName:i,focusItem:d,setFocusItem:w})=>{const p="#ffcf70",[b,h]=f.useState(window.innerWidth>768);return f.useEffect(()=>{const x=()=>{h(window.innerWidth>375)};return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),r.jsx("ul",{className:c(ee.productDropdownMenu,a&&ee.productDropdownMenuOpen,t==="rtl"&&ee.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":a?"open":"closed",children:s.map((x,m)=>r.jsxs("li",{className:c(ee.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",o===x&&ee.open,l&&ee.open),onMouseEnter:()=>b&&n(x),onMouseLeave:()=>b&&n(null),"aria-label":x.name,dir:t,onKeyDown:C=>u(C,m),tabIndex:0,"data-product-category":!0,children:[r.jsx(ru,{category:x,dir:t,openCategory:o}),r.jsx("ul",{className:c(ee.productList,t==="rtl"&&ee.rtlProductList),dir:t,children:r.jsx(ou,{category:x,dir:t,activeProductName:i,currentProduct:x.name,focusItem:d,setFocusItem:w,borderColorLocked:p})})]},x.name))})},nu=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:a,activeProductBgColor:s,activeProductName:o,dir:n,smallScreenButtonRef:u,handleDropdownToggle:l,handleKeyDown:i})=>r.jsx("div",{className:c("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?n==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":n==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?a.hover:s},children:r.jsxs("button",{ref:u,type:"button",className:c("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":n==="rtl"?"wu-hidden":"wu-flex"),onClick:l,onKeyDown:d=>{t&&d.key==="ArrowDown"&&i(d,-1)},"aria-label":"small-screen-product-btn",children:[o,r.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),uu=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:a,setIsProductButtonShow:s,setDropdownOpen:o})=>{const n=()=>{s(u=>!u),t&&o(!1)};return r.jsxs("button",{className:c("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:n,ref:a,"aria-label":"menu-toggle-btn",children:[r.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),r.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),r.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Da=({productCategories:e,activeProductName:t,activeProductColor:a={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:o,expandAll:n})=>{const u=f.useRef(null),l=f.useRef(null),i=f.useRef(null),d=f.useRef(null),[w,p]=f.useState(!1),[b,h]=f.useState(null),[x,m]=f.useState(a.base),[C,E]=f.useState(""),[y,S]=f.useState(!1),N=Jn(768);mr([l,u],()=>{p(!1),h(null)}),mr([i,d,l],()=>{S(!1),p(!1),h(null)}),f.useEffect(()=>{const T=D=>{D.key==="Escape"&&p(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[w]),f.useEffect(()=>m(a.base),[a.base]);const k=T=>{T.preventDefault(),T.stopPropagation(),p(D=>{const F=!D;return F||h(null),F})},A=(T,D)=>{Xn({productCategories:e,openCategory:b,setOpenCategory:h})(T,D,C)};return r.jsx("div",{className:c("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:N?r.jsxs("div",{className:"wu-relative wu-flex",children:[r.jsx(uu,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:d,setDropdownOpen:p,setIsProductButtonShow:S}),r.jsx(nu,{isProductButtonShow:y,isDropdownOpen:w,activeProductColor:a,activeProductBgColor:x,activeProductName:t,handleDropdownToggle:k,smallScreenButtonRef:i,handleKeyDown:A,dir:s}),r.jsx("div",{className:c("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:r.jsx(Aa,{activeProductName:t,focusItem:C,setFocusItem:E,handleKeyDown:A,isDropdownOpen:w,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:n,dir:s})})]}):r.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:w?a.hover:x},onMouseOver:()=>m(a.hover),onMouseOut:()=>m(a.base),children:[r.jsx(tu,{activeProductName:t,dir:s,homeLink:o,buttonRef:u,handleDropdownToggle:k,handleKeyDown:A,isDropdownOpen:w}),r.jsx(Aa,{activeProductName:t,focusItem:C,setFocusItem:E,handleKeyDown:A,isDropdownOpen:w,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:n,dir:s})]})})},Ma=({children:e,dir:t,className:a})=>r.jsx("section",{className:c("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",a),children:r.jsx("div",{className:"wu-grow",children:e})}),yr=g.forwardRef(({className:e,type:t,...a},s)=>r.jsx("input",{type:t,className:c("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:s,...a}));yr.displayName="Input";const lu=e=>{const{message:t,className:a,...s}=e;return r.jsx("p",{...s,className:c("wu-text-sub-3 wu-break-words wu-font-light",a),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},iu=e=>{var l,i;const{inputRef:t,maxLength:a=50,className:s,...o}=e,[n,u]=f.useState(!1);return f.useEffect(()=>{var d;(((d=t==null?void 0:t.current)==null?void 0:d.value.length)||0)>.75*a?u(!0):u(!1)},[(l=t==null?void 0:t.current)==null?void 0:l.value,a]),r.jsx("p",{...o,className:c("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...o.style},children:n&&`${(i=t==null?void 0:t.current)==null?void 0:i.value.length}/${a}`})},cu=Se.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),qt=g.forwardRef(({className:e,...t},a)=>r.jsx(ma.Root,{ref:a,className:c(cu(),e),...t}));qt.displayName=ma.Root.displayName;const xe=e=>r.jsx(qt,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),du=({Label:e,Error:t,Hint:a,Input:s,labelPosition:o="top",dir:n="ltr",className:u,...l})=>{const d=c("wu-flex",o==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",u),w=c("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),p=c("wu-absolute -wu-bottom-5",n==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),b=c("wu-absolute -wu-bottom-5",n==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return r.jsxs("div",{className:d,dir:n,...l,children:[e,r.jsxs("div",{className:w,children:[s,a&&r.jsx("div",{className:p,children:a}),t&&r.jsx("div",{className:b,children:t})]})]})},ve=f.forwardRef((e,t)=>{const{Label:a,labelPosition:s="top",Icon:o,iconPosition:n,type:u,value:l,variant:i="flat",readonly:d,id:w=Bt(),...p}=e,b=gt(s),h=o?n!=="right"?"wu-pl-8":"wu-pr-8":"",[x,m]=f.useState(!1),C=()=>{m(y=>!y)},E=y=>{p.onChange&&p.onChange(y)};return r.jsx(r.Fragment,{children:u==="submit"?r.jsx(le,{type:"submit",className:p.className,id:w,children:a||"Submit"}):r.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:r.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative",b,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[o&&n!=="right"&&r.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:o}),r.jsx(yr,{...p,className:c("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",h,p.className),type:x?"text":u,ref:t,readOnly:d,onChange:p.onChange&&E,value:l,id:w}),o&&n==="right"&&r.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:o}),u==="password"&&r.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:C,children:r.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:x?r.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):r.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),a&&r.jsx(xe,{htmlFor:w,className:"wu-flex-none wu-w-fit wu-input-label",children:a})]})})})});ve.displayName="WuInput";const wu=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:a=!0,onSearch:s,...o})=>{const[n,u]=f.useState(a);return f.useEffect(()=>{u(a)},[a]),r.jsx(ve,{...o,placeholder:t,onChange:l=>s(l.target.value),className:c("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",n?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:r.jsx(ue,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",n&&"wu-text-white"),onClick:()=>u(l=>!l)})})},_a=pt.Provider,Fa=pt.Root,La=pt.Trigger,Nr=g.forwardRef(({className:e,sideOffset:t=4,...a},s)=>r.jsx(pt.Content,{ref:s,sideOffset:t,className:c("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...a}));Nr.displayName=pt.Content.displayName;const zt=f.forwardRef(({content:e,position:t,positionOffset:a,duration:s,children:o,className:n,showArrow:u=!1,open:l,onOpenChange:i,...d},w)=>r.jsx(_a,{delayDuration:s||200,children:r.jsxs(Fa,{open:l,onOpenChange:i,children:[r.jsx(La,{asChild:!0,children:r.jsx("span",{ref:w,children:o})}),r.jsx(dr.Portal,{children:e&&r.jsxs(Nr,{...d,side:t||"top",sideOffset:a||0,className:c("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",n),children:[e,u&&r.jsx(dr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));zt.displayName="WuTooltip";const fu=({label:e,className:t})=>{const a=f.useRef(null),[s,o]=f.useState(!1);return f.useEffect(()=>{const n=a.current;if(n){const u=n.clientWidth,l=n.scrollWidth,i=l/e.length,d=e.length*i;o(d>u||l>u)}},[e]),r.jsx("p",{ref:a,className:c("wu-w-full wu-truncate",t),children:s?r.jsx(zt,{content:e,positionOffset:8,children:e}):e})},pu=e=>{var p;const{productName:t,categories:a=[],user:s,children:o,onLogout:n,homeLink:u=window.location.origin,brandColor:l,dir:i="ltr",expandAll:d,DataCenter:w}=e;return r.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:r.jsxs("header",{className:c("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Hn((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&r.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),r.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:r.jsx(Da,{productCategories:a,activeProductName:t,activeProductColor:l,dir:i,homeLink:u,expandAll:d})}),r.jsx(Ma,{dir:i,children:o}),r.jsxs("section",{className:c("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[r.jsx(ka,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&r.jsx(Ta,{user:s,onLogout:n,dir:i,DataCenter:w})]})]})})},Fe=ht.Root,Ue=ht.Trigger,Ee=g.forwardRef(({className:e,align:t="center",sideOffset:a=4,...s},o)=>r.jsx(ht.Portal,{children:r.jsx(ht.Content,{ref:o,align:t,sideOffset:a,className:c("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...s})}));Ee.displayName=ht.Content.displayName;function Wa({className:e,classNames:t,dir:a="ltr",...s}){const o=ha.getDefaultClassNames();return r.jsx(ha.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:c("wu-p-3",e),classNames:{root:c(o.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:c("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:c(o.month_caption,"wu-mb-5"),months:c(o.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:c(o.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:c(o.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:c(o.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:c(o.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:c(o.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:c(o.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:c("rm",o.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:c(o.range_end,"wu-rounded-none"),range_start:c(o.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:c(o.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:c(o.button_next,vr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(o.button_previous,vr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:c(o.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",a==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:c(o.chevron,"!wu-text-red-500"),outside:c(o.outside,"wu-invisible"),disabled:c(o.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>r.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Wa.displayName="Calendar";const Cr=e=>r.jsx(Wa,{...e}),Pa=e=>{const{handleDateChange:t,disabled:a,onReset:s,showResetButton:o}=e;return r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[o&&r.jsx(le,{variant:"secondary",onClick:s,Icon:r.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{onClick:t,disabled:a,className:"wu-date-picker-apply",children:"Apply"})})]})},Sr=({formattedString:e,dir:t,placeholder:a="Select Date",className:s,variant:o="primary",color:n,CustomTrigger:u,...l})=>r.jsx(wt.PopoverTrigger,{asChild:!u,dir:t,children:u?r.jsx(r.Fragment,{children:u(e)}):r.jsx(le,{...l,className:c("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",o==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:r.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||a})}),Oa=(e,t,a,s)=>{const o=j.startOfDay(e).getTime();return!!(t||a&&o<j.startOfDay(a).getTime()||s&&o>j.startOfDay(s).getTime())},Vt=e=>e?typeof e=="string"?new Date(e):e:new Date,Er="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",hu=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],bu=({formatString:e="yyyy-MM-dd",value:t,onChange:a,disabled:s,minDate:o=j.sub(new Date,{years:5}),maxDate:n=j.add(new Date,{years:1}),dir:u="ltr",Label:l,labelPosition:i="top",onReset:d,showResetButton:w=!1,placeholder:p="Select Date",CustomTrigger:b,...h})=>{const[x,m]=f.useState(),[C,E]=f.useState(""),y=f.useCallback(()=>{const N=Vt(x);E(j.format(N,e)),a&&a(x)},[x,e,a]),S=f.useCallback(()=>{d?d():(m(void 0),E(""),a&&a(void 0))},[a,d]);return f.useEffect(()=>{const N=Vt(t);m(N),E(j.format(N,e))},[t,e]),r.jsxs(xe,{className:c("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[l,r.jsxs(Fe,{children:[r.jsx(Sr,{formattedString:C,dir:u,placeholder:p,CustomTrigger:b,...h}),r.jsx(Ee,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:u,children:r.jsx(Cr,{dir:u,mode:"single",captionLayout:"dropdown",selected:x,onSelect:m,disabled:N=>Oa(N,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:x,className:c("wu-border wu-border-blue-p wu-date-picker"),footer:r.jsx(Pa,{handleDateChange:y,disabled:s,onReset:S,showResetButton:w})})})]})]})},Ba="yyyy-MM-dd",gu=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],mu=({current:e,onSelect:t,presetRanges:a=hu})=>{const[s,o]=f.useState(),[n,u]=f.useState(!1),[l,i]=f.useState(""),[d,w]=f.useState(""),[p,b]=f.useState(!1),h=f.useMemo(()=>a.map(y=>y.value),[a]),x=c("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),m=f.useCallback(y=>{if(y===void 0){o(void 0),u(!0);return}const S=Number(y)-1;o(S),u(!1),t({from:j.sub(new Date,{days:S}),to:new Date})},[t]),C=f.useCallback((y,S)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Er).test(y))return!1;const k=new Date(S==="start"?y:e.from),A=new Date(S==="end"?y:e.to);return j.isBefore(A,k)?(b(!0),!1):(b(!1),!(j.isSameDay(k,e.from)&&j.isSameDay(A,e.to)))},[e]),E=f.useCallback((y,S)=>{if((S==="start"?i:w)(y),C(y,S)){const k={from:e==null?void 0:e.from,to:e==null?void 0:e.to};S==="start"&&(k.from=new Date(y)),S==="end"&&(k.to=new Date(y)),t(k)}},[e,t,C]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&j.isValid(e.to)&&j.isValid(e.from)){i(j.format(e.from,Ba)),w(j.format(e.to,Ba));const y=j.differenceInCalendarDays(e.to,e.from);j.isToday(e.to)&&h.includes(y+1)?(o(y),u(!1)):(o(void 0),u(!0))}},[e,h]),r.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[r.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:gu.map(({label:y,value:S})=>r.jsx(Re,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:S!==1,children:y},S))}),r.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[a.map(({label:y,value:S})=>r.jsx("li",{children:r.jsx("button",{className:c(x,s===S-1&&"wu-bg-blue-p/10"),onClick:()=>m(S),children:y})},S)),r.jsx("li",{children:r.jsx("button",{className:c(x,n&&"wu-bg-blue-p/10"),onClick:()=>m(),children:"Custom Range"})})]}),r.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[r.jsx(ve,{placeholder:"Start Date",pattern:Er,value:l,onChange:y=>E(y.target.value,"start"),"aria-label":"Start Date"}),r.jsx(ve,{placeholder:"End Date",pattern:Er,value:d,onChange:y=>E(y.target.value,"end"),"aria-label":"End Date"}),p?r.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):r.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},xu=({formatString:e="yyyy/MM/dd",value:t,onChange:a,disabled:s,minDate:o=j.sub(new Date,{years:5}),maxDate:n=j.add(new Date,{years:1}),dir:u="ltr",minDateToSelect:l,maxDateToSelect:i,presetRanges:d,Label:w,labelPosition:p="top",onReset:b,showResetButton:h=!0,placeholder:x="Select Date Range",CustomTrigger:m,...C})=>{const[E,y]=f.useState(t),[S,N]=f.useState(t),[k,A]=f.useState(""),T=f.useCallback(()=>{if(S){const W=S.from,_=S.to;y({from:W,to:_}),A(`${j.format(W,e)} - ${j.format(_,e)}`),a&&a({from:W,to:_})}},[S,e,a]),D=f.useCallback(()=>{N(E)},[E]),F=f.useCallback(()=>{b?b():(y(void 0),N(void 0),A(""),a&&a(void 0))},[b,a]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const W=Vt(t.from),_=Vt(t.to);y(t),N(t),A(`${j.format(W,e)} - ${j.format(_,e)}`)}else y(void 0),N({to:new Date,from:new Date})},[t,e]),r.jsxs(xe,{className:c("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[w,r.jsxs(Fe,{onOpenChange:W=>!W&&D(),children:[r.jsx(Sr,{formattedString:k,dir:u,placeholder:x,CustomTrigger:m,...C}),r.jsxs(Ee,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:u,children:[r.jsx(mu,{current:S,onSelect:N,presetRanges:d}),r.jsx(Cr,{dir:u,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:N,disabled:W=>Oa(W,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:E==null?void 0:E.from,className:c("wu-shadow-none wu-date-range-picker"),min:l,max:i,footer:r.jsx(Pa,{handleDateChange:T,disabled:s,onReset:F,showResetButton:h})})]})]})]})},qa=f.forwardRef((e,t)=>{const{className:a,rounded:s,...o}=e;return r.jsx("div",{className:c("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",s?"wu-rounded-lg":"wu-rounded-sm",a),ref:t,...o})});qa.displayName="WuCard";const za=f.forwardRef((e,t)=>{const{className:a,...s}=e;return r.jsx("div",{ref:t,...s,className:c("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",a)})});za.displayName="WuCardHeader";const Va=f.forwardRef((e,t)=>{const{className:a,...s}=e;return r.jsx("div",{ref:t,...s,className:c("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",a)})});Va.displayName="WuCardHeader";const Ha=g.forwardRef(({className:e,partial:t,...a},s)=>r.jsx(wr.Root,{ref:s,className:c("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...a,children:r.jsxs(wr.Indicator,{className:c("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&r.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&r.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Ha.displayName=wr.Root.displayName;const Ce=f.forwardRef((e,t)=>{const{disabled:a,checked:s,Label:o,labelPosition:n="right",className:u,id:l=Bt(),partial:i,onChange:d,required:w,readonly:p,...b}=e;return f.useEffect(()=>{b.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[b.defaultChecked,s]),r.jsxs("div",{className:vu({labelPosition:n,className:"wu-checkbox-container"}),dir:b.dir,children:[r.jsx(Ha,{id:l,...b,partial:i,checked:s,disabled:a||p,onCheckedChange:d,className:c("wu-peer wu-checkbox",u),required:w,ref:t}),o&&r.jsx(xe,{htmlFor:l,className:"wu-w-full wu-checkbox-label",children:o})]})}),vu=Se.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});Ce.displayName="WuCheckbox";const yu=e=>{const{className:t,children:a,...s}=e;return r.jsx("span",{...s,className:c("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:a})},Tr=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command,{ref:a,className:c("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));Tr.displayName=fe.Command.displayName;const $a=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:r.jsx(fe.Command.Input,{ref:a,className:c("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));$a.displayName=fe.Command.Input.displayName;const kr=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.List,{ref:a,className:c("",e),...t}));kr.displayName=fe.Command.List.displayName;const Ir=g.forwardRef((e,t)=>r.jsx(fe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));Ir.displayName=fe.Command.Empty.displayName;const mt=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Group,{ref:a,className:c("",e),...t}));mt.displayName=fe.Command.Group.displayName;const Ua=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Separator,{ref:a,className:c("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Ua.displayName=fe.Command.Separator.displayName;const xt=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Item,{ref:a,className:c("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));xt.displayName=fe.Command.Item.displayName;const tt=f.forwardRef(({containerHeight:e=400,list:t,callback:a,dir:s,className:o,style:n},u)=>r.jsx(Sn.Virtuoso,{ref:u,dir:s,className:o,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...n},data:t,itemContent:(l,i)=>a(l,i)}));tt.displayName="WuVirtualScroll";const Nu=({tags:e,triggerRef:t})=>{const[a,s]=f.useState([]),[o,n]=f.useState([]),u=f.useMemo(()=>r.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:o.map((i,d)=>r.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},d))}),[o]),l=i=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=i,document.body.appendChild(d);const w=d.offsetWidth;return document.body.removeChild(d),w+8};return f.useEffect(()=>{const i=()=>{if(t.current){const b=t.current.offsetWidth-20-36;let h=0;const x=[],m=[];e.forEach(C=>{const E=l(C);h+E+8<b?(x.push(C),h+=E+8):m.push(C)}),s(x),n(m)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,t]),r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[a.map((i,d)=>r.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},d)),o.length>0&&r.jsx(zt,{content:u,className:"wu-z-[51] wu-text-left",children:r.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",o.length]})})]})},Cu=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:a,variant:s="flat",dir:o="ltr",accessorKey:n,multiple:u,id:l,disabled:i,selectAll:d,isCheckedAll:w,className:p,...b})=>{const[h,x]=f.useState([]),m=f.useRef(null);f.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){x([]);return}if(u){const E=a;x(E==null?void 0:E.map(y=>y[n.label]));return}else x([a[n.label]])},[a]);const C=()=>{var E;return h.length?w&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?r.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?r.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((E=m.current)==null?void 0:E.offsetWidth)||0)-32}px`},children:h.join(", ")}):r.jsx(Nu,{tags:h,triggerRef:m}):r.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return r.jsx(Ue,{dir:o,asChild:!0,id:l,disabled:i,children:r.jsxs("button",{...b,ref:m,disabled:i,className:c("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",p),children:[C(),r.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ar=R.Root,Dr=R.Trigger,ja=R.Group,Su=R.Portal,Eu=R.Sub,Tu=R.RadioGroup,Ga=g.forwardRef(({className:e,inset:t,children:a,position:s,...o},n)=>r.jsxs(R.SubTrigger,{ref:n,className:c("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...o,children:[s==="left"&&r.jsx("span",{className:c("wm-chevron-right",o.dir==="rtl"&&"ml-2")}),a,s!=="left"&&r.jsx("span",{className:c("wu-text-base wu-leading-4",o.dir==="rtl"&&"wu-mr-auto wm-chevron-left",o.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ga.displayName=R.SubTrigger.displayName;const Ya=g.forwardRef(({className:e,...t},a)=>r.jsx(R.SubContent,{ref:a,className:c("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));Ya.displayName=R.SubContent.displayName;const Ht=g.forwardRef(({className:e,sideOffset:t=4,...a},s)=>r.jsx(R.Portal,{children:r.jsx(R.Content,{ref:s,sideOffset:t,className:c("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...a})}));Ht.displayName=R.Content.displayName;const vt=g.forwardRef(({className:e,inset:t,...a},s)=>r.jsx(R.Item,{ref:s,className:c("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...a}));vt.displayName=R.Item.displayName;const Ka=g.forwardRef(({className:e,children:t,checked:a,dir:s,...o},n)=>r.jsxs(R.CheckboxItem,{ref:n,className:c("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:a,...o,children:[r.jsx("span",{className:c("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:r.jsx(R.ItemIndicator,{children:r.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ka.displayName=R.CheckboxItem.displayName;const Ja=g.forwardRef(({className:e,children:t,...a},s)=>r.jsxs(R.RadioItem,{ref:s,className:c("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...a,children:[r.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:r.jsx(R.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:r.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ja.displayName=R.RadioItem.displayName;const yt=g.forwardRef(({className:e,inset:t,...a},s)=>r.jsx(R.Label,{ref:s,className:c("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...a}));yt.displayName=R.Label.displayName;const $t=g.forwardRef(({className:e,...t},a)=>r.jsx(R.Separator,{ref:a,className:c("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));$t.displayName=R.Separator.displayName;const Xa=({option:e,value:t,multiple:a=!1,onSelect:s,accessorKey:o,dir:n})=>{const[u,l]=f.useState(a?[]:"");f.useEffect(()=>{t&&l(a?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,a]);const i=a?u.includes(JSON.stringify(e[o.value])):u===JSON.stringify(e[o.value]),d=()=>{e.disabled||s(e)};return r.jsxs(xt,{onSelect:d,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:n,children:[a&&r.jsx(Ce,{checked:i}),r.jsx(ku,{option:e,accessorKey:o})]})},ku=({option:e,accessorKey:t})=>{const a=e[t.label];return r.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,a,e.isAdmin&&r.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Za=e=>{const{option:t,selectAll:a,handleSelectAll:s,isCheckedAll:o,isPartialSelected:n,...u}=e;switch("type"in t?t.type:"option"){case"all":return r.jsxs(xt,{onSelect:s,className:c("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:u.dir,children:[r.jsx(Ce,{checked:o||n,partial:n,"data-partial":n,"aria-label":(a==null?void 0:a.label)||"Select All"}),r.jsx("span",{"aria-hidden":!0,children:(a==null?void 0:a.label)||"Select All"})]});case"group":return r.jsxs(mt,{children:[r.jsx(yt,{children:t.label}),t.options.map((i,d)=>f.createElement(Xa,{...u,option:i,key:d}))]});case"divider":return r.jsx(Ua,{className:"wu-mx-4"});default:return r.jsx(Xa,{...u,option:t})}},Iu=e=>{const t=[],a=[],s=[],o=[];return e.forEach(n=>{n.type==="group"?(t.push(n),s.push(...n.options),o.push(...n.options.filter(u=>!u.disabled))):n.type==="divider"?a.push(n):s.push(n),n!=null&&n.disabled||o.push(n)}),{groups:t,dividers:a,allOptions:s,enabledOptions:o}},Au=f.memo(ve),Du=({data:e,accessorKey:t,value:a,defaultValue:s,Header:o,virtualizedThreshold:n=100,isEllipse:u,placeholder:l,variant:i,dir:d,onSelect:w,Label:p,maxHeight:b=420,multiple:h=!1,hasGroup:x=!1,selectAll:m,id:C,disabled:E,labelPosition:y="top",className:S,onScroll:N,maxContentWidth:k,enableSearch:A=!0,noDataContent:T,...D})=>{const[F,W]=f.useState(""),[_,z]=f.useState(),[P,G]=f.useState(!1),[q,oe]=f.useState(!1),[M,H]=f.useState(!1),U=f.useRef(null),{allOptions:O,enabledOptions:ae}=f.useMemo(()=>x||m&&!m.includeDisabled?Iu(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,x]),te=f.useMemo(()=>{if(!F)return e;const L=F.toLowerCase();return O.filter(Z=>Z[t.label].toLowerCase().includes(L))},[F,O,e,t.label]),pe=f.useMemo(()=>h&&m!=null&&m.enable&&!F&&te.length>0?[{type:"all"},...te]:te,[te,F,h]),We=f.useCallback(L=>{const Z=L[t.value];h?z(B=>{const we=B||[],be=we.some(de=>de[t.value]===Z)?we.filter(de=>de[t.value]!==Z):[...we,L];return w==null||w(be),be}):(G(!1),z(L),w==null||w(L))},[h,t.value,w]),$=f.useCallback(L=>W(L.target.value),[]),I=f.useCallback(()=>W(""),[]);f.useEffect(()=>{if(a!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else a!==void 0?z(a):s!==void 0&&z(s)},[a,s]),f.useEffect(()=>{if(!h)return;const L=m!=null&&m.includeDisabled?(_==null?void 0:_.length)===O.length:(_==null?void 0:_.length)===ae.length;oe(L);const Z=(_==null?void 0:_.length)>0&&!L;H(Z)},[_,m]);const V=f.useCallback(()=>{const L=q?[]:m!=null&&m.includeDisabled?O:ae;z(L),w==null||w(L)},[q,h,O,ae,w,m]),K=gt(y);return r.jsxs("div",{className:c(K,"wu-flex wu-combobox-container"),ref:U,children:[r.jsxs(Fe,{onOpenChange:L=>{L&&I(),G(L)},open:P,modal:!0,children:[r.jsx(Cu,{selectedOptions:_,accessorKey:t,isEllipse:u,placeholder:l,variant:i,dir:d,multiple:h,disabled:E,selectAll:m,isCheckedAll:q,className:S,id:C,...D}),r.jsx(Ee,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:k},children:r.jsxs(Tr,{id:C,children:[A&&r.jsx("div",{className:"wu-m-2",children:r.jsx(Au,{placeholder:"Search...",Icon:r.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:$,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),o,r.jsxs(kr,{children:[r.jsx(Ir,{children:T||"No results found."}),pe.length>=n?r.jsx(tt,{className:"wu-combobox-list",containerHeight:b,list:pe,callback:(L,Z)=>r.jsx(Za,{option:Z,value:_,onSelect:We,multiple:h,accessorKey:t,dir:d,selectAll:m,handleSelectAll:V,isCheckedAll:q,isPartialSelected:M},L),dir:d}):r.jsx("div",{style:{height:"fit-content",maxHeight:b,overflow:"auto"},className:"wu-combobox-list",onScroll:N,children:pe.map((L,Z)=>r.jsx(Za,{option:L,value:_,onSelect:We,multiple:h,accessorKey:t,dir:d,selectAll:m,handleSelectAll:V,isCheckedAll:q,isPartialSelected:M},Z))})]})]})})]}),p&&r.jsx(xe,{htmlFor:C,className:"wu-combobox-label",children:p})]})},Mu=e=>{const{textToCopy:t,notificationText:a,...s}=e,[o,n]=f.useState(!1),u=async()=>{if(t)try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return r.jsxs(le,{...s,onClick:u,variant:"iconOnly",className:c("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[a&&r.jsx("span",{className:c("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",o?"wu-block":"wu-hidden"),children:a}),r.jsx(ue,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Qa=X.Root,_u=X.Trigger,Fu=X.Close,Lu=X.Portal,Ra=g.forwardRef(({className:e,...t},a)=>r.jsx(X.Overlay,{className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:a}));Ra.displayName=X.Overlay.displayName;const Wu=Se.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),Mr=g.forwardRef(({side:e="right",className:t,children:a,hideCloseButton:s,overlayClassName:o,closeButtonClassName:n,...u},l)=>r.jsxs(Lu,{children:[r.jsx(Ra,{className:o}),r.jsxs(X.Content,{ref:l,className:c(Wu({side:e}),t),...u,children:[a,!s&&r.jsx(X.Close,{"aria-label":"close",asChild:!0,children:r.jsxs(Re,{variant:"iconOnly",className:c("wu-absolute wu-right-4 wu-top-4",n),children:[r.jsx("span",{className:"wm-close"}),r.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Mr.displayName=X.Content.displayName;const es=g.forwardRef(({className:e,...t},a)=>r.jsx(X.Title,{ref:a,className:c("wu-text-lg wu-font-semibold",e),...t}));es.displayName=X.Title.displayName;const Pu=g.forwardRef(({className:e,...t},a)=>r.jsx(X.Description,{ref:a,className:c("wu-text-sm",e),...t}));Pu.displayName=X.Description.displayName;const Ou=e=>t=>{e&&t.preventDefault()},Bu=e=>{const{Trigger:t,children:a,hideCloseButton:s,className:o,side:n="left",open:u,onOpenChange:l,preventClickOutside:i,overlayClassName:d,closeButtonClassName:w,...p}=e;return r.jsxs(Qa,{open:u,onOpenChange:l,children:[r.jsx(_u,{asChild:!0,children:t}),r.jsxs(Mr,{onInteractOutside:Ou(i),side:n,className:c("wu-bg-white wu-text-gray-lead wu-px-0",o),hideCloseButton:s,overlayClassName:d,closeButtonClassName:w,...p,children:[r.jsx("div",{className:"wu-hidden",children:r.jsx(es,{})}),a]})]})},qu=({children:e,...t})=>r.jsx(Fu,{...t,children:e}),ts=({className:e,isLoading:t,loadingText:a,children:s,...o})=>r.jsxs("footer",{className:c("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...o,children:[r.jsx("div",{className:"wu-flex-1",children:s}),t&&r.jsx(et,{size:"16px",variant:"spinner",color:"#a3a3a3",message:a})]});ts.displayName="WuFooter";const rs=f.forwardRef((e,t)=>{const{size:a="sm",idOrSlugOrUrl:s,variant:o="primary",...n}=e,u=a==="sm"?16:18,l=s.includes("http")?s:`/help/${s}.html`,i=o==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return r.jsx("button",{...n,ref:t,onClick:()=>pr(l),children:r.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${u}px]`,i,n.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});rs.displayName="WuHelpButton";const qe=(e,t)=>`wu-listbox-${e}`;function zu(e){const{option:t,accessorKey:a,onSelect:s,multiple:o,dir:n,GroupLabel:u,Item:l,isSelected:i,...d}=e,w=a.group&&Array.isArray(t[a.group]),p=({item:b,className:h})=>f.createElement(xt,{...d,key:JSON.stringify(b),onSelect:()=>s==null?void 0:s(b),value:t[a.value],className:c("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(i!=null&&i(b))&&!o&&"wu-bg-blue-p/10",n==="rtl"&&"wu-justify-end",h,qe("item")),disabled:b.disabled},o&&r.jsx(Ce,{checked:i==null?void 0:i(b)}),l?l({value:b,isSelected:i==null?void 0:i(b)}):r.jsx(r.Fragment,{children:b[a.label]}));if(w){const b=t[a.group],h=typeof u=="string"?t[u]:u==null?void 0:u(t);return r.jsx(mt,{heading:h,children:b==null?void 0:b.map(x=>r.jsx(p,{item:x,className:"wu-pl-6"},JSON.stringify(x)))})}return r.jsx(p,{item:t})}const Vu=f.memo(zu),Hu=e=>{const{className:t,...a}=e;return r.jsxs("div",{className:"wu-relative",children:[r.jsx(ue,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),r.jsx($a,{...a,"aria-label":"Search",className:c("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",qe("input"),t)})]})},$u=e=>{const{label:t,onSelectAll:a,data:s,value:o}=e,[n,u]=f.useState(!1),[l,i]=f.useState(!1);return f.useEffect(()=>{!o||!s||(u(o.length>0),i(o.length>0&&o.length<s.length))},[s,o]),r.jsxs(xt,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>a==null?void 0:a(!n),children:[r.jsx(Ce,{checked:n,partial:l}),t||"Select All"]})},Uu=e=>{const{CustomTrigger:t,disabled:a,value:s,placeholder:o,accessorKey:n,Chip:u,handleUnselect:l,variant:i,dir:d,className:w,...p}=e,[b,h]=f.useState(),x=f.useRef(null);return f.useEffect(()=>{if(!s){h(null);return}h(Array.isArray(s)?u?s.map((C,E)=>u({value:C,unselect:l,key:E})):s.map(C=>C[n.label]).join(", "):u?u({value:s,unselect:l}):s[n.label])},[s,u,n.label,h]),r.jsx(Ue,{asChild:!0,id:e.id,disabled:a,ref:x,children:(t==null?void 0:t(s))||r.jsxs("button",{...p,className:c("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",w,qe("trigger")),children:[r.jsx("div",{className:c("wu-truncate",u&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||o}),r.jsx(ue,{icon:"wm-arrow-drop-down",className:c("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",qe("drop-icon"))})]})})},as=(e,t,a)=>{const s=String(e[a.label]??"").toLowerCase(),o=String(e[a.value]??"").toLowerCase();return s.includes(t)||o.includes(t)},ju=(e,t,a)=>{const s=t.trim();if(s==="")return e;const o=s.toLowerCase(),n=[];for(const u of e){const l=a.group,i=l?u[l]:void 0;if(Array.isArray(i)){const d=i.filter(w=>as(w,o,a));d.length>0&&n.push({...u,[l]:d})}else as(u,o,a)&&n.push(u)}return n},Gu=e=>{const{data:t,accessorKey:a,value:s,Item:o,Label:n,GroupLabel:u,CustomHeader:l,CustomTrigger:i,NoDataContent:d,Chip:w,onSelect:p,onScroll:b,disabled:h,multiple:x,searchable:m,selectAll:C,virtualizedThreshold:E=100,id:y,dir:S,className:N,listClass:k,placeholder:A="Select items...",variant:T,labelPosition:D="top",maxContentWidth:F,maxContentHeight:W,modal:_,...z}=e,[P,G]=f.useState(!1),[q,oe]=f.useState(""),[M,H]=f.useState(s),U=f.useMemo(()=>a,[a]),O=f.useMemo(()=>{if(!m||!q)return t;const $=q.toLowerCase().trim();return ju(t,$,a)},[t,q,a.label,m]),ae=$=>{x?H(I=>{const V=$[a.value],K=Array.isArray(I)?I:[],Z=K.some(B=>B[a.value]===V)?K.filter(B=>B[a.value]!==V):[...K,$];return p&&p(Z),Z}):(H($),p&&p($),G(!1))},te=f.useCallback($=>{const I=$?t:[];H(I),C!=null&&C.onSelectAll&&C.onSelectAll($),p&&p(I)},[t,C,p]),pe=$=>Array.isArray(M)?M.some(I=>I[a.value]===$[a.value]):(M==null?void 0:M[a.value])===$[a.value];f.useEffect(()=>{H(s)},[s]);const We=$=>{const I=V=>r.jsx(Vu,{option:V,accessorKey:U,multiple:x,onSelect:K=>ae(K),dir:S,GroupLabel:u,Item:o,isSelected:K=>pe(K)},JSON.stringify(V));return $.length>E?r.jsx(tt,{list:$,callback:(V,K)=>I(K),dir:S}):$.map(I)};return r.jsxs("div",{className:c("wu-flex wu-text-sm wu-gap-2",D==="top"&&"wu-flex-col wu-gap-1",D==="left"&&"wu-flex-row",D==="right"&&"wu-flex-row-reverse",qe("container")),dir:S,children:[n&&r.jsx(xe,{htmlFor:y,className:qe("label"),children:n}),r.jsxs(Fe,{open:P,onOpenChange:$=>{G($),$||setTimeout(()=>{oe("")},100)},modal:_,children:[r.jsx(Uu,{CustomTrigger:i,disabled:h,value:M,accessorKey:a,placeholder:A,Chip:w,className:N,handleUnselect:ae,variant:T,id:y,dir:S,...z}),r.jsx(Ee,{className:c("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",qe("content")),align:"start",sideOffset:-1,style:{maxWidth:F},children:r.jsxs(Tr,{id:e.id,shouldFilter:!1,children:[m&&r.jsx(Hu,{value:q,onValueChange:oe}),l,r.jsxs(kr,{className:c("wu-overflow-y-auto",qe("list"),k),onScroll:b,style:{maxHeight:W||"420px"},children:[r.jsx(Ir,{children:d||"No results found."}),r.jsx(mt,{children:x&&(C==null?void 0:C.enabled)&&!q&&r.jsx($u,{data:t,value:M,onSelectAll:te,label:C.label})}),r.jsx(mt,{children:We(O)})]})]})})]})]})},Yu=e=>{const{checked:t,onSelect:a,children:s,disabled:o,preventCloseOnSelect:n}=e;return r.jsx(Ka,{disabled:o,checked:t,onCheckedChange:a,onSelect:u=>n&&u.preventDefault(),children:s})},_r=e=>{const{children:t,className:a,Icon:s,iconPosition:o="left",disabled:n,onSelect:u,preventCloseOnSelect:l}=e,i=c("wu-flex wu-items-center wu-gap-2",s&&(o==="left"?"":"wu-justify-between wu-flex-row-reverse"),a),d=w=>{u&&u(w),l&&w.preventDefault()};return r.jsxs(vt,{onSelect:d,disabled:n,className:i,children:[s&&r.jsx("div",{className:"wu-text-base",children:s}),t]})},Ku=e=>{const{children:t,Label:a,...s}=e;return r.jsxs(ja,{...s,children:[r.jsx(yt,{children:a||e.label}),t]})},Ju=e=>{const{options:t,value:a,onSelect:s}=e;return r.jsx(Tu,{value:a,onValueChange:s,children:t.map(o=>r.jsx(Ja,{value:o.value,disabled:o.disabled,children:o.Label||o.label},o.value))})},Xu=e=>{const{className:t,...a}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return r.jsx($t,{...a,className:s})},rt=g.forwardRef(({className:e,children:t,thumbColor:a,railColor:s,...o},n)=>r.jsxs(He.Root,{ref:n,className:c("wu-relative wu-overflow-hidden",e),children:[r.jsx(He.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...o,children:t}),r.jsx(Fr,{thumbColor:a,railColor:s}),r.jsx(He.Corner,{})]}));rt.displayName=He.Root.displayName;const Fr=g.forwardRef(({className:e,orientation:t="vertical",thumbColor:a="#d4d4d4",railColor:s="#eeeeee",...o},n)=>r.jsx(He.ScrollAreaScrollbar,{ref:n,orientation:t,className:c("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:s},...o,children:r.jsx(He.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:a}})}));Fr.displayName=He.ScrollAreaScrollbar.displayName;const Zu=e=>{const{children:t,label:a,Label:s,open:o,onOpenChange:n,height:u,dir:l,...i}=e;return r.jsxs(Eu,{...i,open:o,onOpenChange:n,children:[r.jsx(Ga,{dir:l,children:s||a}),r.jsx(Su,{children:r.jsx(Ya,{onInteractOutside:d=>d.preventDefault(),children:r.jsx(rt,{className:"wu-h-fit",style:{height:u},dir:l,children:t})})})]})},Qu="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",ss=e=>{const{children:t,menuTitle:a,MenuTitle:s,variant:o="flat",name:n,open:u,onOpenChange:l,height:i,preventCloseOnClickOutside:d,dir:w,Trigger:p,align:b="start",sideOffset:h=0,side:x="bottom",alignOffset:m,className:C,disabled:E,...y}=e;return r.jsxs(Ar,{...y,open:u,onOpenChange:l,dir:w,children:[r.jsx(Dr,{asChild:!0,dir:w,disabled:E,className:c("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:p??Ru(o,n,E)}),r.jsx(Ht,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",C,"wu-menu-content"),align:b,sideOffset:h,side:x,alignOffset:m,onInteractOutside:S=>d&&S.preventDefault(),children:r.jsxs(rt,{className:"h-fit",style:{height:i},dir:w,children:[(a||s)&&r.jsxs(r.Fragment,{children:[r.jsx(yt,{dir:w,className:"wu-menu-title",children:s||a}),r.jsx($t,{className:"wu-mt-0 wu-menu-separator",dir:w})]}),t??r.jsx("p",{children:"Menu Is Empty"})]})})]})},Ru=(e,t,a)=>{const s=c(Qu,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return r.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[r.jsx("span",{children:t??"Menu"}),r.jsx("span",{className:c("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",a&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lr=f.forwardRef(({showMenu:e=!1,className:t,color:a="#1B3380",...s},o)=>{const n=c("wu-w-full wu-border wu-transition-all wu-duration-300");return r.jsxs("div",{...s,className:c("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:o,"aria-label":"menu-icon",children:[r.jsx("div",{className:`${n} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:a}}),r.jsx("div",{className:`${n} ${e?"wu-opacity-0":""}`,style:{borderColor:a}}),r.jsx("div",{className:`${n} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:a}})]})});Lr.displayName="WuMenuIcon";const os={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},ns=X.Root,us=X.Trigger,el=X.Portal,tl=X.Close,ls=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Overlay,{ref:a,className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",os.overlay,e),...t}));ls.displayName=X.Overlay.displayName;const Wr=f.forwardRef(({className:e,children:t,hideCloseButton:a,isStackedCard:s,...o},n)=>r.jsxs(el,{children:[r.jsx(ls,{className:s?"wu-bg-transparent":""}),r.jsxs(X.Content,{ref:n,className:c("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",os.content,e),...o,children:[t,!a&&r.jsx(X.Close,{"aria-label":"close",asChild:!0,children:r.jsxs(Re,{variant:"iconOnly",className:c("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wuexp:wu-top-3 wuexp:wu-right-4 wuexp:wu-p-1.5","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[r.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),r.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Wr.displayName=X.Content.displayName;const Pr=({className:e,...t})=>r.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Pr.displayName="DialogHeader";const is=({className:e,...t})=>r.jsx("div",{className:c("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});is.displayName="DialogFooter";const at=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Title,{ref:a,className:c("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));at.displayName=X.Title.displayName;const rl=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Description,{ref:a,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));rl.displayName=X.Description.displayName;const al={gradientBackground:"_gradientBackground_1bbet_1"},cs=e=>{const{colors:t,size:a=.55,children:s,className:o,strokeWidth:n,centerOffset:u={x:0,y:0},...l}=e,i=f.useRef(null);return f.useEffect(()=>{const d=i.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*a}px`),d.style.setProperty("--height",`${d.offsetHeight*a}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${n||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const b=h=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const x=d.getBoundingClientRect();let m=h.clientX-x.left,C=h.clientY-x.top;m=Math.max(0,Math.min(m+u.x,x.width)),C=Math.max(0,Math.min(C+u.y,x.height));const E=`radial-gradient(
5
- var(--width) var(--height) ellipse at ${m}px ${C}px,
4
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:a.jsx(Ea,{item:r,dir:t})})},s))})})},Ea=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:f("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),$c=e=>{const[t,n]=p.useState(()=>window.innerWidth<=e);return p.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Hc({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const c=l[u];if(c){c.focus();const d=e[u]||null;n(d)}},s=(u,l,c,d)=>{u.preventDefault();const w=c==="down"?l+1:l-1;r(w,d)},o=(u,l,c,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(u.preventDefault(),r(l+1,c))},i=(u,l)=>{u.preventDefault();const c=e[l]===t?null:e[l];n(c)};return function(l,c,d){const w=document.querySelectorAll("[data-product-category]"),{key:h}=l;switch(h){case"ArrowDown":s(l,c,"down",w);break;case"ArrowUp":s(l,c,"up",w);break;case"Tab":o(l,c,w,d);break;case"Enter":case" ":i(l,c);break}}}const Uc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},jc=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:f(i[t],n),children:r})},Gc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:f(o[t],n),children:r})},Kc=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:f(o[t],n),children:r})},re=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:f(t,n),role:"presentation","aria-label":t})},Yc=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:f("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:u=>{r&&u.key==="ArrowDown"&&n(u,-1)},"aria-label":"product-switcher",children:[a.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(re,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),se={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},Xc=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=f("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=f("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:f("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[a.jsx("div",{className:se.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},Zc={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},Jc=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=p.useState(e.name===t),l=e.name===n,c=e.name===t,d=!e.active,w="#1b3380",h="#c5cce0",m="#ffcf70",b=f("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),g=f("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),x=i||s===e.name||l?w:h;return a.jsxs("li",{className:f(se.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&se.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&se.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":d,dir:r,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:d?m:x}}),a.jsxs("a",{className:f(se.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:f(g,Zc[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:f(b),children:e.name})]})]},e.name)},Qc=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,c=p.useMemo(()=>u.filter(b=>b.active).sort((b,g)=>(b.order||100)-(g.order||100)),[u]),d=p.useMemo(()=>u.filter(b=>!b.active),[u]),[w,h]=p.useState(i),m=b=>b.map((g,x)=>a.jsx(Jc,{product:g,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},x));return l?a.jsxs(a.Fragment,{children:[m(c),d.length>0&&a.jsxs("li",{className:f(se.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:f(se.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),m(d)]}):a.jsxs("li",{className:f(se.productListItem,se.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:f(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:se.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Aa=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:c,setFocusItem:d})=>{const w="#ffcf70",[h,m]=p.useState(window.innerWidth>768);return p.useEffect(()=>{const b=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),a.jsx("ul",{className:f(se.productDropdownMenu,n&&se.productDropdownMenuOpen,t==="rtl"&&se.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((b,g)=>a.jsxs("li",{className:f(se.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===b&&se.open,u&&se.open),onMouseEnter:()=>h&&o(b),onMouseLeave:()=>h&&o(null),"aria-label":b.name,dir:t,onKeyDown:x=>i(x,g),tabIndex:0,"data-product-category":!0,children:[a.jsx(Xc,{category:b,dir:t,openCategory:s}),a.jsx("ul",{className:f(se.productList,t==="rtl"&&se.rtlProductList),dir:t,children:a.jsx(Qc,{category:b,dir:t,activeProductName:l,currentProduct:b.name,focusItem:c,setFocusItem:d,borderColorLocked:w})})]},b.name))})},Rc=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:f("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:f("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:c=>{t&&c.key==="ArrowDown"&&l(c,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:f("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),ed=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:f("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"aria-label":"menu-toggle-btn",children:[a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},ka=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),c=p.useRef(null),[d,w]=p.useState(!1),[h,m]=p.useState(null),[b,g]=p.useState(n.base),[x,S]=p.useState(""),[y,N]=p.useState(!1),C=$c(768);br([u,i],()=>{w(!1),m(null)}),br([l,c,u],()=>{N(!1),w(!1),m(null)}),p.useEffect(()=>{const A=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[d]),p.useEffect(()=>g(n.base),[n.base]);const E=A=>{A.preventDefault(),A.stopPropagation(),w(k=>{const D=!k;return D||m(null),D})},M=(A,k)=>{Hc({productCategories:e,openCategory:h,setOpenCategory:m})(A,k,x)};return a.jsx("div",{className:f("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:C?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(ed,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:w,setIsProductButtonShow:N}),a.jsx(Rc,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:n,activeProductBgColor:b,activeProductName:t,handleDropdownToggle:E,smallScreenButtonRef:l,handleKeyDown:M,dir:r}),a.jsx("div",{className:f("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:d?n.hover:b},onMouseOver:()=>g(n.hover),onMouseOut:()=>g(n.base),children:[a.jsx(Yc,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:E,handleKeyDown:M,isDropdownOpen:d}),a.jsx(Aa,{activeProductName:t,focusItem:x,setFocusItem:S,handleKeyDown:M,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:u,expandAll:o,dir:r})]})})},Ma=({children:e,dir:t,className:n})=>a.jsx("section",{className:f("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",n),children:a.jsx("div",{className:"wu-grow",children:e})}),vr=v.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:f("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));vr.displayName="Input";const td=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:f("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},nd=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=p.useState(!1);return p.useEffect(()=>{var c;(((c=t==null?void 0:t.current)==null?void 0:c.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:f("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},rd=Me.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),Nn=v.forwardRef(({className:e,...t},n)=>a.jsx(ma.Root,{ref:n,className:f(rd(),e),...t}));Nn.displayName=ma.Root.displayName;const Ce=e=>a.jsx(Nn,{...e,className:f("wu-text-gray-lead wu-leading-6",e.className)}),sd=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const c=f("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),d=f("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=f("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:c,dir:o,...u,children:[e,a.jsxs("div",{className:d,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:h,children:t})]})]})},Te=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="top",Icon:s,iconPosition:o,type:i,value:u,variant:l="flat",readonly:c,id:d=vn(),...w}=e,h=Ut(r),m=s?o!=="right"?"wu-pl-8":"wu-pr-8":"",[b,g]=p.useState(!1),x=()=>{g(y=>!y)},S=y=>{w.onChange&&w.onChange(y)};return a.jsx(a.Fragment,{children:i==="submit"?a.jsx(ce,{type:"submit",className:w.className,id:d,children:n||"Submit"}):a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:w.dir,children:a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative",h,(r==="right"||r==="left")&&"wu-items-center","wu-input-wrapper"),children:[s&&o!=="right"&&a.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),a.jsx(vr,{...w,className:f("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",m,w.className),type:b?"text":i,ref:t,readOnly:c,onChange:w.onChange&&S,value:u,id:d}),s&&o==="right"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:s}),i==="password"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:x,children:a.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:b?a.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):a.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),n&&a.jsx(Ce,{htmlFor:d,className:"wu-flex-none wu-w-fit wu-input-label",children:n})]})})})});Te.displayName="WuInput";const ad=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=p.useState(n);return p.useEffect(()=>{i(n)},[n]),a.jsx(Te,{...s,placeholder:t,onChange:u=>r(u.target.value),className:f("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:a.jsx(re,{"data-testid":"search-icon",icon:"wm-search",className:f("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)})})},Ia=qt.Provider,Da=qt.Root,Pa=qt.Trigger,Nr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(qt.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...n}));Nr.displayName=qt.Content.displayName;const Sn=p.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,...c},d)=>a.jsx(Ia,{delayDuration:r||200,children:a.jsxs(Da,{open:u,onOpenChange:l,children:[a.jsx(Pa,{asChild:!0,children:a.jsx("span",{ref:d,children:s})}),a.jsx(dr.Portal,{children:e&&a.jsxs(Nr,{...c,side:t||"top",sideOffset:n||0,className:f("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(dr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Sn.displayName="WuTooltip";const od=({label:e,className:t})=>{const n=p.useRef(null),[r,s]=p.useState(!1);return p.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,c=e.length*l;s(c>i||u>i)}},[e]),a.jsx("p",{ref:n,className:f("wu-w-full wu-truncate",t),children:r?a.jsx(Sn,{content:e,positionOffset:8,children:e}):e})},id=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:c,DataCenter:d}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:f("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Lc((w=r==null?void 0:r.profile)==null?void 0:w.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(ka,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:c})}),a.jsx(Ma,{dir:l,children:s}),a.jsxs("section",{className:f("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(Ta,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Ca,{user:r,onLogout:o,dir:l,DataCenter:d})]})]})})},ze=$t.Root,et=$t.Trigger,Ie=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx($t.Portal,{children:a.jsx($t.Content,{ref:s,align:t,sideOffset:n,className:f("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));Ie.displayName=$t.Content.displayName;function Fa({className:e,classNames:t,dir:n="ltr",...r}){const s=fa.getDefaultClassNames();return a.jsx(fa.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:f("wu-p-3",e),classNames:{root:f(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:f("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:f(s.month_caption,"wu-mb-5"),months:f(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:f(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:f(s.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:f(s.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:f(s.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:f(s.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:f(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:f("rm",s.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:f(s.range_end,"wu-rounded-none"),range_start:f(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:f(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:f(s.button_next,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:f(s.button_previous,xr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:f(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:f(s.chevron,"!wu-text-red-500"),outside:f(s.outside,"wu-invisible"),disabled:f(s.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...r})}Fa.displayName="Calendar";const Sr=e=>a.jsx(Fa,{...e}),Va=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[s&&a.jsx(ce,{variant:"secondary",onClick:r,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Cr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(Bt.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(ce,{...u,className:f("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),La=(e,t,n,r)=>{const s=K.startOfDay(e).getTime();return!!(t||n&&s<K.startOfDay(n).getTime()||r&&s>K.startOfDay(r).getTime())},Cn=e=>e?typeof e=="string"?new Date(e):e:new Date,Tr="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",ud=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ld=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:c,showResetButton:d=!1,placeholder:w="Select Date",CustomTrigger:h,...m})=>{const[b,g]=p.useState(),[x,S]=p.useState(""),y=p.useCallback(()=>{const C=Cn(b);S(K.format(C,e)),n&&n(b)},[b,e,n]),N=p.useCallback(()=>{c?c():(g(void 0),S(""),n&&n(void 0))},[n,c]);return p.useEffect(()=>{const C=Cn(t);g(C),S(K.format(C,e))},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(ze,{children:[a.jsx(Cr,{formattedString:x,dir:i,placeholder:w,CustomTrigger:h,...m}),a.jsx(Ie,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(Sr,{dir:i,mode:"single",captionLayout:"dropdown",selected:b,onSelect:g,disabled:C=>La(C,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:b,className:f("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(Va,{handleDateChange:y,disabled:r,onReset:N,showResetButton:d})})})]})]})},_a="yyyy-MM-dd",cd=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],dd=({current:e,onSelect:t,presetRanges:n=ud})=>{const[r,s]=p.useState(),[o,i]=p.useState(!1),[u,l]=p.useState(""),[c,d]=p.useState(""),[w,h]=p.useState(!1),m=p.useMemo(()=>n.map(y=>y.value),[n]),b=f("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),g=p.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const N=Number(y)-1;s(N),i(!1),t({from:K.sub(new Date,{days:N}),to:new Date})},[t]),x=p.useCallback((y,N)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Tr).test(y))return!1;const E=new Date(N==="start"?y:e.from),M=new Date(N==="end"?y:e.to);return K.isBefore(M,E)?(h(!0),!1):(h(!1),!(K.isSameDay(E,e.from)&&K.isSameDay(M,e.to)))},[e]),S=p.useCallback((y,N)=>{if((N==="start"?l:d)(y),x(y,N)){const E={from:e==null?void 0:e.from,to:e==null?void 0:e.to};N==="start"&&(E.from=new Date(y)),N==="end"&&(E.to=new Date(y)),t(E)}},[e,t,x]);return p.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&K.isValid(e.to)&&K.isValid(e.from)){l(K.format(e.from,_a)),d(K.format(e.to,_a));const y=K.differenceInCalendarDays(e.to,e.from);K.isToday(e.to)&&m.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,m]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:cd.map(({label:y,value:N})=>a.jsx(mt,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:N!==1,children:y},N))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:N})=>a.jsx("li",{children:a.jsx("button",{className:f(b,r===N-1&&"wu-bg-blue-p/10"),onClick:()=>g(N),children:y})},N)),a.jsx("li",{children:a.jsx("button",{className:f(b,o&&"wu-bg-blue-p/10"),onClick:()=>g(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Te,{placeholder:"Start Date",pattern:Tr,value:u,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Te,{placeholder:"End Date",pattern:Tr,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},wd=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:r,minDate:s=K.sub(new Date,{years:5}),maxDate:o=K.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:c,Label:d,labelPosition:w="top",onReset:h,showResetButton:m=!0,placeholder:b="Select Date Range",CustomTrigger:g,...x})=>{const[S,y]=p.useState(t),[N,C]=p.useState(t),[E,M]=p.useState(""),A=p.useCallback(()=>{if(N){const F=N.from,V=N.to;y({from:F,to:V}),M(`${K.format(F,e)} - ${K.format(V,e)}`),n&&n({from:F,to:V})}},[N,e,n]),k=p.useCallback(()=>{C(S)},[S]),D=p.useCallback(()=>{h?h():(y(void 0),C(void 0),M(""),n&&n(void 0))},[h,n]);return p.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const F=Cn(t.from),V=Cn(t.to);y(t),C(t),M(`${K.format(F,e)} - ${K.format(V,e)}`)}else y(void 0),C({to:new Date,from:new Date})},[t,e]),a.jsxs(Ce,{className:f("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[d,a.jsxs(ze,{onOpenChange:F=>!F&&k(),children:[a.jsx(Cr,{formattedString:E,dir:i,placeholder:b,CustomTrigger:g,...x}),a.jsxs(Ie,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:i,children:[a.jsx(dd,{current:N,onSelect:C,presetRanges:c}),a.jsx(Sr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:N,onSelect:C,disabled:F=>La(F,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:S==null?void 0:S.from,className:f("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(Va,{handleDateChange:A,disabled:r,onReset:D,showResetButton:m})})]})]})]})},Oa=p.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:f("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});Oa.displayName="WuCard";const Wa=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Wa.displayName="WuCardHeader";const Ba=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:f("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Ba.displayName="WuCardHeader";const za=v.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(wr.Root,{ref:r,className:f("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(wr.Indicator,{className:f("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));za.displayName=wr.Root.displayName;const Ae=p.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=vn(),partial:l,onChange:c,required:d,readonly:w,...h}=e;return p.useEffect(()=>{h.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,r]),a.jsxs("div",{className:fd({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[a.jsx(za,{id:u,...h,partial:l,checked:r,disabled:n||w,onCheckedChange:c,className:f("wu-peer wu-checkbox",i),required:d,ref:t}),s&&a.jsx(Ce,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),fd=Me.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});Ae.displayName="WuCheckbox";const pd=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:f("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},Er=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command,{ref:n,className:f("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));Er.displayName=ye.Command.displayName;const qa=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(ye.Command.Input,{ref:n,className:f("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));qa.displayName=ye.Command.Input.displayName;const Ar=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.List,{ref:n,className:f("",e),...t}));Ar.displayName=ye.Command.List.displayName;const kr=v.forwardRef((e,t)=>a.jsx(ye.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));kr.displayName=ye.Command.Empty.displayName;const jt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Group,{ref:n,className:f("",e),...t}));jt.displayName=ye.Command.Group.displayName;const $a=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Separator,{ref:n,className:f("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));$a.displayName=ye.Command.Separator.displayName;const Gt=v.forwardRef(({className:e,...t},n)=>a.jsx(ye.Command.Item,{ref:n,className:f("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));Gt.displayName=ye.Command.Item.displayName;const bt=p.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(gc.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));bt.displayName="WuVirtualScroll";const hd=({tags:e,triggerRef:t})=>{const[n,r]=p.useState([]),[s,o]=p.useState([]),i=p.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,c)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},c))}),[s]),u=l=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=l,document.body.appendChild(c);const d=c.offsetWidth;return document.body.removeChild(c),d+8};return p.useEffect(()=>{const l=()=>{if(t.current){const h=t.current.offsetWidth-20-36;let m=0;const b=[],g=[];e.forEach(x=>{const S=u(x);m+S+8<h?(b.push(x),m+=S+8):g.push(x)}),r(b),o(g)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,c)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},c)),s.length>0&&a.jsx(Sn,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},md=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,className:w,...h})=>{const[m,b]=p.useState([]),g=p.useRef(null);p.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){b([]);return}if(i){const S=n;b(S==null?void 0:S.map(y=>y[o.label]));return}else b([n[o.label]])},[n]);const x=()=>{var S;return m.length?d&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=g.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):a.jsx(hd,{tags:m,triggerRef:g}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(et,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...h,ref:g,disabled:l,className:f("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[x(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Mr=te.Root,Ir=te.Trigger,Ha=te.Group,gd=te.Portal,bd=te.Sub,yd=te.RadioGroup,Ua=v.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(te.SubTrigger,{ref:o,className:f("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:f("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:f("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ua.displayName=te.SubTrigger.displayName;const ja=v.forwardRef(({className:e,...t},n)=>a.jsx(te.SubContent,{ref:n,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));ja.displayName=te.SubContent.displayName;const Tn=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(te.Portal,{children:a.jsx(te.Content,{ref:r,sideOffset:t,className:f("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));Tn.displayName=te.Content.displayName;const Kt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Item,{ref:r,className:f("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Kt.displayName=te.Item.displayName;const Ga=v.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(te.CheckboxItem,{ref:o,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:f("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(te.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ga.displayName=te.CheckboxItem.displayName;const Ka=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(te.RadioItem,{ref:r,className:f("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(te.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ka.displayName=te.RadioItem.displayName;const Yt=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(te.Label,{ref:r,className:f("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));Yt.displayName=te.Label.displayName;const En=v.forwardRef(({className:e,...t},n)=>a.jsx(te.Separator,{ref:n,className:f("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));En.displayName=te.Separator.displayName;const Ya=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=()=>{e.disabled||r(e)};return a.jsxs(Gt,{onSelect:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(xd,{option:e,accessorKey:s})]})},xd=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Xa=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Gt,{onSelect:r,className:f("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(Ae,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(jt,{children:[a.jsx(Yt,{children:t.label}),t.options.map((l,c)=>p.createElement(Ya,{...i,option:l,key:c}))]});case"divider":return a.jsx($a,{className:"wu-mx-4"});default:return a.jsx(Ya,{...i,option:t})}},vd=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Nd=p.memo(Te),Sd=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:c,onSelect:d,Label:w,maxHeight:h=420,multiple:m=!1,hasGroup:b=!1,selectAll:g,id:x,disabled:S,labelPosition:y="top",className:N,onScroll:C,maxContentWidth:E,enableSearch:M=!0,noDataContent:A,...k})=>{const[D,F]=p.useState(""),[V,$]=p.useState(),[W,G]=p.useState(!1),[q,ue]=p.useState(!1),[I,_]=p.useState(!1),z=p.useRef(null),{allOptions:B,enabledOptions:ne}=p.useMemo(()=>b||g&&!g.includeDisabled?vd(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,b]),ae=p.useMemo(()=>{if(!D)return e;const O=D.toLowerCase();return B.filter(R=>R[t.label].toLowerCase().includes(O))},[D,B,e,t.label]),xe=p.useMemo(()=>m&&g!=null&&g.enable&&!D&&ae.length>0?[{type:"all"},...ae]:ae,[ae,D,m]),He=p.useCallback(O=>{const R=O[t.value];m?$(H=>{const be=H||[],Ne=be.some(me=>me[t.value]===R)?be.filter(me=>me[t.value]!==R):[...be,O];return d==null||d(Ne),Ne}):(G(!1),$(O),d==null||d(O))},[m,t.value,d]),j=p.useCallback(O=>F(O.target.value),[]),P=p.useCallback(()=>F(""),[]);p.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?$(n):r!==void 0&&$(r)},[n,r]),p.useEffect(()=>{if(!m)return;const O=g!=null&&g.includeDisabled?(V==null?void 0:V.length)===B.length:(V==null?void 0:V.length)===ne.length;ue(O);const R=(V==null?void 0:V.length)>0&&!O;_(R)},[V,g]);const U=p.useCallback(()=>{const O=q?[]:g!=null&&g.includeDisabled?B:ne;$(O),d==null||d(O)},[q,m,B,ne,d,g]),Z=Ut(y);return a.jsxs("div",{className:f(Z,"wu-flex wu-combobox-container"),ref:z,children:[a.jsxs(ze,{onOpenChange:O=>{O&&P(),G(O)},open:W,modal:!0,children:[a.jsx(md,{selectedOptions:V,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:c,multiple:m,disabled:S,selectAll:g,isCheckedAll:q,className:N,id:x,...k}),a.jsx(Ie,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:E},children:a.jsxs(Er,{id:x,children:[M&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Nd,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:j,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),s,a.jsxs(Ar,{children:[a.jsx(kr,{children:A||"No results found."}),xe.length>=o?a.jsx(bt,{className:"wu-combobox-list",containerHeight:h,list:xe,callback:(O,R)=>a.jsx(Xa,{option:R,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},O),dir:c}):a.jsx("div",{style:{height:"fit-content",maxHeight:h,overflow:"auto"},className:"wu-combobox-list",onScroll:C,children:xe.map((O,R)=>a.jsx(Xa,{option:O,value:V,onSelect:He,multiple:m,accessorKey:t,dir:c,selectAll:g,handleSelectAll:U,isCheckedAll:q,isPartialSelected:I},R))})]})]})})]}),w&&a.jsx(Ce,{htmlFor:x,className:"wu-combobox-label",children:w})]})},Cd=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=p.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(ce,{...r,onClick:i,variant:"iconOnly",className:f("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:f("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(re,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Za=Q.Root,Td=Q.Trigger,Ed=Q.Close,Ad=Q.Portal,Ja=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));Ja.displayName=Q.Overlay.displayName;const kd=Me.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),Dr=v.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(Ad,{children:[a.jsx(Ja,{className:s}),a.jsxs(Q.Content,{ref:u,className:f(kd({side:e}),t),...i,children:[n,!r&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Dr.displayName=Q.Content.displayName;const Qa=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-semibold",e),...t}));Qa.displayName=Q.Title.displayName;const Md=v.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm",e),...t}));Md.displayName=Q.Description.displayName;const Id=e=>t=>{e&&t.preventDefault()},Dd=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:c,closeButtonClassName:d,...w}=e;return a.jsxs(Za,{open:i,onOpenChange:u,children:[a.jsx(Td,{asChild:!0,children:t}),a.jsxs(Dr,{onInteractOutside:Id(l),side:o,className:f("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:c,closeButtonClassName:d,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(Qa,{})}),n]})]})},Pd=({children:e,...t})=>a.jsx(Ed,{...t,children:e}),Ra=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(gt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});Ra.displayName="WuFooter";const eo=p.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>pr(u),children:a.jsx("span",{className:f("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});eo.displayName="WuHelpButton";const Ke=(e,t)=>`wu-listbox-${e}`;function Fd(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...c}=e,d=n.group&&Array.isArray(t[n.group]),w=({item:h,className:m})=>p.createElement(Gt,{...c,key:JSON.stringify(h),onSelect:()=>r==null?void 0:r(h),value:t[n.value],className:f("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(l!=null&&l(h))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,Ke("item")),disabled:h.disabled},s&&a.jsx(Ae,{checked:l==null?void 0:l(h)}),u?u({value:h,isSelected:l==null?void 0:l(h)}):a.jsx(a.Fragment,{children:h[n.label]}));if(d){const h=t[n.group],m=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(jt,{heading:m,children:h==null?void 0:h.map(b=>a.jsx(w,{item:b,className:"wu-pl-6"},JSON.stringify(b)))})}return a.jsx(w,{item:t})}const Vd=p.memo(Fd),Ld=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(re,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(qa,{...n,"aria-label":"Search",className:f("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",Ke("input"),t)})]})},_d=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=p.useState(!1),[u,l]=p.useState(!1);return p.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(Gt,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(Ae,{checked:o,partial:u}),t||"Select All"]})},Od=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:c,className:d,...w}=e,[h,m]=p.useState(),b=p.useRef(null);return p.useEffect(()=>{if(!r){m(null);return}m(Array.isArray(r)?i?r.map((x,S)=>i({value:x,unselect:u,key:S})):r.map(x=>x[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,m]),a.jsx(et,{asChild:!0,id:e.id,disabled:n,ref:b,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:f("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",d,Ke("trigger")),children:[a.jsx("div",{className:f("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||s}),a.jsx(re,{icon:"wm-arrow-drop-down",className:f("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",Ke("drop-icon"))})]})})},to=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Wd=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const c=l.filter(d=>to(d,s,n));c.length>0&&o.push({...i,[u]:c})}else to(i,s,n)&&o.push(i)}return o},Bd=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:c,Chip:d,onSelect:w,onScroll:h,disabled:m,multiple:b,searchable:g,selectAll:x,virtualizedThreshold:S=100,id:y,dir:N,className:C,listClass:E,placeholder:M="Select items...",variant:A,labelPosition:k="top",maxContentWidth:D,maxContentHeight:F,modal:V,...$}=e,[W,G]=p.useState(!1),[q,ue]=p.useState(""),[I,_]=p.useState(r),z=p.useMemo(()=>n,[n]),B=p.useMemo(()=>{if(!g||!q)return t;const j=q.toLowerCase().trim();return Wd(t,j,n)},[t,q,n.label,g]),ne=j=>{b?_(P=>{const U=j[n.value],Z=Array.isArray(P)?P:[],R=Z.some(H=>H[n.value]===U)?Z.filter(H=>H[n.value]!==U):[...Z,j];return w&&w(R),R}):(_(j),w&&w(j),G(!1))},ae=p.useCallback(j=>{const P=j?t:[];_(P),x!=null&&x.onSelectAll&&x.onSelectAll(j),w&&w(P)},[t,x,w]),xe=j=>Array.isArray(I)?I.some(P=>P[n.value]===j[n.value]):(I==null?void 0:I[n.value])===j[n.value];p.useEffect(()=>{_(r)},[r]);const He=j=>{const P=U=>a.jsx(Vd,{option:U,accessorKey:z,multiple:b,onSelect:Z=>ne(Z),dir:N,GroupLabel:i,Item:s,isSelected:Z=>xe(Z)},JSON.stringify(U));return j.length>S?a.jsx(bt,{list:j,callback:(U,Z)=>P(Z),dir:N}):j.map(P)};return a.jsxs("div",{className:f("wu-flex wu-text-sm wu-gap-2",k==="top"&&"wu-flex-col wu-gap-1",k==="left"&&"wu-flex-row",k==="right"&&"wu-flex-row-reverse",Ke("container")),dir:N,children:[o&&a.jsx(Ce,{htmlFor:y,className:Ke("label"),children:o}),a.jsxs(ze,{open:W,onOpenChange:j=>{G(j),j||setTimeout(()=>{ue("")},100)},modal:V,children:[a.jsx(Od,{CustomTrigger:l,disabled:m,value:I,accessorKey:n,placeholder:M,Chip:d,className:C,handleUnselect:ne,variant:A,id:y,dir:N,...$}),a.jsx(Ie,{className:f("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",Ke("content")),align:"start",sideOffset:-1,style:{maxWidth:D},children:a.jsxs(Er,{id:e.id,shouldFilter:!1,children:[g&&a.jsx(Ld,{value:q,onValueChange:ue}),u,a.jsxs(Ar,{className:f("wu-overflow-y-auto",Ke("list"),E),onScroll:h,style:{maxHeight:F||"420px"},children:[a.jsx(kr,{children:c||"No results found."}),a.jsx(jt,{children:b&&(x==null?void 0:x.enabled)&&!q&&a.jsx(_d,{data:t,value:I,onSelectAll:ae,label:x.label})}),a.jsx(jt,{children:He(B)})]})]})})]})]})},zd=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Ga,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},An=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=f("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),c=d=>{i&&i(d),u&&d.preventDefault()};return a.jsxs(Kt,{onSelect:c,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},qd=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Ha,{...r,children:[a.jsx(Yt,{children:n||e.label}),t]})},$d=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(yd,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ka,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Hd=e=>{const{className:t,...n}=e,r=f("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(En,{...n,className:r})},yt=v.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(Qe.Root,{ref:o,className:f("wu-relative wu-overflow-hidden",e),children:[a.jsx(Qe.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(Pr,{thumbColor:n,railColor:r}),a.jsx(Qe.Corner,{})]}));yt.displayName=Qe.Root.displayName;const Pr=v.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(Qe.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(Qe.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));Pr.displayName=Qe.ScrollAreaScrollbar.displayName;const Ud=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(bd,{...l,open:s,onOpenChange:o,children:[a.jsx(Ua,{dir:u,children:r||n}),a.jsx(gd,{children:a.jsx(ja,{onInteractOutside:c=>c.preventDefault(),children:a.jsx(yt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},jd="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",Fr=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:c,dir:d,Trigger:w,align:h="start",sideOffset:m=0,side:b="bottom",alignOffset:g,className:x,disabled:S,...y}=e;return a.jsxs(Mr,{...y,open:i,onOpenChange:u,dir:d,children:[a.jsx(Ir,{asChild:!0,dir:d,disabled:S,className:f("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Gd(s,o,S)}),a.jsx(Tn,{className:f("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",x,"wu-menu-content"),align:h,sideOffset:m,side:b,alignOffset:g,onInteractOutside:N=>c&&N.preventDefault(),children:a.jsxs(yt,{className:"h-fit",style:{height:l},dir:d,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(Yt,{dir:d,className:"wu-menu-title",children:r||n}),a.jsx(En,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Gd=(e,t,n)=>{const r=f(jd,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:f("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Vr=p.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=f("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:f("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});Vr.displayName="WuMenuIcon";const no={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},ro=Q.Root,so=Q.Trigger,Kd=Q.Portal,Yd=Q.Close,ao=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Overlay,{ref:n,className:f("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",no.overlay,e),...t}));ao.displayName=Q.Overlay.displayName;const Lr=p.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Kd,{children:[a.jsx(ao,{className:r?"wu-bg-transparent":""}),a.jsxs(Q.Content,{ref:o,className:f("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",no.content,e),...s,children:[t,!n&&a.jsx(Q.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(mt,{variant:"iconOnly",className:f("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wuexp:wu-top-3 wuexp:wu-right-4 wuexp:wu-p-1.5","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Lr.displayName=Q.Content.displayName;const _r=({className:e,...t})=>a.jsx("div",{className:f("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});_r.displayName="DialogHeader";const oo=({className:e,...t})=>a.jsx("div",{className:f("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});oo.displayName="DialogFooter";const xt=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Title,{ref:n,className:f("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));xt.displayName=Q.Title.displayName;const Xd=p.forwardRef(({className:e,...t},n)=>a.jsx(Q.Description,{ref:n,className:f("wu-text-sm wu-text-muted-foreground",e),...t}));Xd.displayName=Q.Description.displayName;const Zd={gradientBackground:"_gradientBackground_1bbet_1"},io=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=p.useRef(null);return p.useEffect(()=>{const c=l.current;if(c){c.style.setProperty("--width",`${c.offsetWidth*n}px`),c.style.setProperty("--height",`${c.offsetHeight*n}px`),c.style.setProperty("--colors",t.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const h=m=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const b=c.getBoundingClientRect();let g=m.clientX-b.left,x=m.clientY-b.top;g=Math.max(0,Math.min(g+i.x,b.width)),x=Math.max(0,Math.min(x+i.y,b.height));const S=`radial-gradient(
5
+ var(--width) var(--height) ellipse at ${g}px ${x}px,
6
6
  var(--colors)
7
- )`;d.style.setProperty("--spotlight-background",E)})};return window.addEventListener("mousemove",b),()=>{window.removeEventListener("mousemove",b),p&&cancelAnimationFrame(p)}}},[t,a,n,u]),r.jsx("div",{ref:i,className:c(al.gradientBackground,"wu-transform-gpu",o),...l,children:s})},ds="calc(100vh - 64px)",sl={sm:"400px",md:"600px",lg:"1200px"},Ut=({Trigger:e,children:t,size:a="md",hideCloseButton:s,preventClickOutside:o,onOpenChange:n,open:u,dir:l,maxWidth:i,maxHeight:d,className:w,style:p,variant:b="action",...h})=>{const x={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return r.jsxs(ns,{modal:!0,onOpenChange:n,open:u,children:[e&&r.jsx(us,{asChild:!0,children:e}),r.jsxs(Wr,{style:{width:"calc(100% - 64px)",maxWidth:i||sl[a],maxHeight:d||ds,...p},hideCloseButton:s,onInteractOutside:m=>o&&m.preventDefault(),dir:l,"aria-describedby":void 0,"data-variant":b,className:c("wu-group wuexp:wu-rounded-[1.1rem]",w),...h,children:["data-theme"in h&&r.jsx(cs,{colors:x[b],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",w),style:{maxHeight:d||ds},children:t}),!("data-theme"in h)&&t]})]})},jt=({children:e,className:t,...a})=>r.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...a,children:e}),ol=({children:e,className:t,...a})=>r.jsx(Pr,{...a,"data-variant":"action",className:c("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",t),children:r.jsx(at,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),nl=({children:e,className:t,...a})=>r.jsx(is,{...a,className:c("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",t),children:e}),ze=({children:e,className:t,...a})=>{const s=f.useRef(null);return r.jsx(tl,{asChild:!0,children:r.jsx(le,{className:t,ref:s,...a,children:e})})},ul=({placeholder:e="Select...",value:t,multiple:a=!1,accessorKey:s,variant:o="flat",dir:n="ltr",customTriggerChildren:u,id:l,disabled:i,selectAll:d,isCheckedAll:w,width:p,...b})=>{const[h,x]=f.useState(""),[m,C]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){C(e),x("");return}const y=s.label;if(a&&Array.isArray(t)){const S=t.map(N=>N[y]).join(", ");x(S)}else!a&&!Array.isArray(t)&&x(t[y])},[t,s.label,a,e]);const E=()=>e&&!h?r.jsx("p",{className:"wu-text-xs wu-opacity-70",children:m}):r.jsx("span",{className:c("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(p||0)-32}px`},children:w?(d==null?void 0:d.triggerText)??h:h});return r.jsx(Dr,{asChild:!0,dir:n,id:l,disabled:i,children:r.jsxs("button",{...b,disabled:i,className:c("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",o==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",b.className),children:[u??E(),r.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},ws=({option:e,value:t,multiple:a=!1,onSelect:s,accessorKey:o,dir:n="ltr"})=>{const[u,l]=f.useState(a?[]:"");f.useEffect(()=>{t&&l(a?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,a]);const i=a?u.includes(JSON.stringify(e[o.value])):u===JSON.stringify(e[o.value]),d=w=>{e.disabled||(s(e),a&&w.preventDefault())};return r.jsxs(vt,{onClick:d,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:n,children:[a&&r.jsx(Ce,{checked:i}),r.jsx(fs,{option:e,accessorKey:o})]})},fs=({option:e,accessorKey:t})=>{const a=String(e[t.label]);return r.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,a,e.isAdmin&&r.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},ps=e=>{const{option:t,handleSelectAll:a,isCheckedAll:s,isPartialSelected:o,...n}=e;switch("type"in t?t.type:"option"){case"all":return r.jsxs(vt,{onSelect:l=>{l.stopPropagation(),l.preventDefault(),a==null||a()},className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:n.dir,children:[r.jsx(Ce,{"data-partial":o,checked:s||o,partial:o}),r.jsx(fs,{option:t,accessorKey:n.accessorKey})]});case"group":return r.jsxs(ja,{dir:n.dir,children:[r.jsx(yt,{className:"wu-text-xs",children:t.label}),t.options.map((l,i)=>f.createElement(ws,{...n,option:l,key:i}))]});case"divider":return r.jsx($t,{className:"wu-mx-4"});default:return r.jsx(ws,{...n,option:t})}},ll=e=>{let t=0,a=0;const s=[],o=[],n=u=>{u.type==="divider"?t++:u.type==="group"?(a++,u.options.forEach(l=>{n(l)})):(s.push(u),u.disabled||o.push(u))};return e.forEach(u=>{n(u)}),{separators:t,groups:a,enabledOptions:o,totalData:s.length,cleanData:s}},il=100,cl=400,hs=({data:e,onSelect:t,multiple:a=!1,defaultValue:s,value:o,accessorKey:n,variant:u="flat",dir:l="ltr",placeholder:i,Label:d,virtualizedThreshold:w=il,maxHeight:p=cl,hasGroup:b=!1,Header:h,CustomTrigger:x,selectAll:m,disabled:C,labelPosition:E="top",onScroll:y,maxContentWidth:S,...N})=>{const[k,A]=f.useState(),T=f.useRef(null),[D,F]=f.useState(!1),[W,_]=f.useState(!1),{cleanData:z,enabledOptions:P}=b||m!=null&&m.enable?ll(e):{cleanData:e,enabledOptions:[]},G=f.useMemo(()=>a&&m!=null&&m.enable&&e.length>0?[{type:"all",[n.label]:m.label||"Select All"},...e]:e,[e,m,a]),q=f.useCallback(U=>{const O=U[n.value];if(a)A((ae=[])=>{const te=ae,We=te.some($=>$[n.value]===O)?te.filter($=>$[n.value]!==O):[...te,U];return t==null||t(We),We});else{const ae=U;A(ae),t==null||t(ae)}},[a,n.value,t]);f.useEffect(()=>{if(s&&o){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!o&&A(void 0),s!==void 0&&A(s),o!==void 0&&A(o)},[s,o]);const oe=G.length>w;f.useEffect(()=>{if(!a)return;const U=m!=null&&m.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===P.length;F(U);const O=(k==null?void 0:k.length)>0&&!U;_(O)},[k,m]);const M=f.useCallback(()=>{const U=D?[]:m!=null&&m.includeDisabled?b?z:e:P;A(U),t==null||t(U)},[D,a,e,P,t,m]),H=gt(E);return r.jsxs("div",{className:c(H,"wu-flex wu-select-container"),ref:T,dir:l,children:[r.jsxs(Ar,{children:[r.jsx(ul,{...N,value:k,multiple:a,variant:u,dir:l,placeholder:i,accessorKey:n,customTriggerChildren:x,id:N.id,disabled:C,selectAll:m,isCheckedAll:D}),r.jsxs(Ht,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:N.id,style:{maxWidth:S},children:[h,oe?r.jsx(tt,{list:G,containerHeight:p,callback:(U,O)=>r.jsx(ps,{option:O,accessorKey:n,multiple:a,onSelect:q,value:k,dir:l,handleSelectAll:M,isCheckedAll:D,isPartialSelected:W}),dir:l}):r.jsx("div",{onScroll:y,style:{maxHeight:p,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:G.map((U,O)=>r.jsx(ps,{option:U,accessorKey:n,multiple:a,onSelect:q,value:k,handleSelectAll:M,isCheckedAll:D,dir:l,isPartialSelected:W},`${O}`))})]})]}),d&&r.jsx(xe,{htmlFor:N.id,className:"wu-select-label",children:d})]})},Gt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dl=({value:e,onChange:t,min:a=j.sub(new Date,{years:5}),max:s=j.add(new Date,{years:1}),placeholder:o="Select a month",Label:n,labelPosition:u="top",disabled:l,id:i,readonly:d,disabledMonths:w=[],...p})=>{const[b,h]=f.useState(null),[x,m]=f.useState(""),[C,E]=f.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=f.useMemo(()=>{const N=new Date(a).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-N+1},(A,T)=>({value:k-T,label:k-T}))},[a,s]);f.useEffect(()=>{if(e){const N=new Date(e),k=N.getFullYear(),A=N.getMonth();h({year:k,month:A}),m(`${Gt[A]} ${k}`),E({value:k,label:k})}},[e]);const S=()=>{b&&t&&(t(new Date(b.year,b.month,15)),m(`${Gt[b.month]} ${b.year}`))};return r.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",gt(u),u==="top"&&"wu-items-start"),children:[r.jsxs(Fe,{children:[r.jsx(Sr,{...p,disabled:l||d,id:i,dir:"ltr",placeholder:o,formattedString:x}),r.jsxs(Ee,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[r.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:r.jsx(hs,{data:y,accessorKey:{value:"value",label:"label"},value:C,onSelect:N=>E(N),multiple:!1,maxHeight:224})}),r.jsx(wl,{year:C==null?void 0:C.value,selectedMonth:b==null?void 0:b.month,selectedYear:b==null?void 0:b.year,onClick:(N,k)=>h({year:k,month:N}),disabledMonths:w}),r.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{onClick:S,children:"Apply"})})})]})]}),n&&r.jsx(xe,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:n})]})},wl=({year:e,selectedMonth:t,selectedYear:a,onClick:s,disabledMonths:o=[]})=>{const n=new Date,u=n.getFullYear(),l=n.getMonth(),i=f.useMemo(()=>{const d=new Set;return o.forEach(w=>{const p=typeof w=="string"?new Date(w):w;d.add(`${p.getFullYear()}-${p.getMonth()}`)}),d},[o]);return r.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:Gt.map((d,w)=>{const p=e===u&&w===l,b=t===w&&a===e;return r.jsx("button",{disabled:i.has(`${e}-${w}`),onClick:()=>s(w,e),className:c("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",p&&"wu-border wu-border-blue-p",b&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${Gt[w]} ${e}`,"data-month":w,"data-year":e,children:d},d)})})},bs=(e,t,a,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[n,u]=f.useState([]),[l,i]=f.useState([]);return f.useEffect(()=>{const d=()=>{var x,m;const w=((x=t.current)==null?void 0:x.clientWidth)||0,p=((m=a.current)==null?void 0:m.clientWidth)||0,b=w-p,h=Math.floor(b/s);u(e.slice(0,h)),i(e.slice(h))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,s]),[n,l]},gs={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},fl=e=>{const{Links:t,children:a,className:s,...o}=e,n=f.useMemo(()=>t.map((w,p)=>f.cloneElement(w,{className:c(gs.wuPrimaryLink,w.props.className,"wu-primary-nav-link"),key:p})),[t]),u=f.useRef(null),l=f.useRef(null),[i,d]=bs(n,u,l);return r.jsx(r.Fragment,{children:r.jsxs("header",{className:c("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...o,ref:u,children:[r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[r.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),d.length>0&&r.jsxs(Fe,{children:[r.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:r.jsx("span",{className:"wm-more-vert"})}),r.jsx(Ee,{className:c(gs.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:l,children:a}),r.jsxs(Fe,{children:[r.jsx(Ue,{className:"sm:wu-hidden",children:r.jsx("span",{className:"wu-text-lg wm-menu"})}),r.jsx(Ee,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:a})]})]})]})})},Or={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},pl=e=>{const{Links:t,children:a,className:s,...o}=e,n=f.useMemo(()=>t.map((p,b)=>f.cloneElement(p.link,{key:b,className:c(Or.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:r.jsxs(r.Fragment,{children:[f.cloneElement(p.imgOrIcon,{className:c("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",p.imgOrIcon.props.className)}),r.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[t]),u=f.useRef(null),l=f.useRef(null),i=f.useRef(null),[d,w]=bs(n,u,i);return r.jsx(r.Fragment,{children:r.jsxs("header",{className:c("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...o,ref:u,children:[r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[r.jsx("nav",{className:c(Or.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:l,children:d}),w.length>0&&r.jsxs(Fe,{children:[r.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:r.jsx("span",{className:"wm-more-vert"})}),r.jsx(Ee,{className:c(Or.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:w})]})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:a}),r.jsxs(Fe,{children:[r.jsx(Ue,{className:"sm:wu-hidden",children:r.jsx("span",{className:"wu-text-lg wm-menu"})}),r.jsx(Ee,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:a})]})]})]})})},ms=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:a=100,onPageChange:s,className:o,disabled:n=!1,...u},l)=>{const[i,d]=f.useState(t),[w,p]=f.useState(a);f.useEffect(()=>{d(t),p(a)},[t,a]);const b=Math.ceil(e/w),h=i*w+1,x=Math.min((i+1)*w,e),m=Array.from({length:b},(y,S)=>S),C=f.useCallback(y=>{y>=0&&y<b&&(d(y),s==null||s(y))},[b,s]),E=224;return r.jsxs("div",{className:c("wu-flex wu-items-center wu-gap-[2px]",o,"wu-pagination"),...u,role:"navigation",children:[r.jsx(xs,{label:"Previous page",onClick:()=>C(i-1),disabled:i===0||n,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),r.jsx(ss,{name:`${h} - ${x}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:n,children:r.jsx(rt,{style:{maxHeight:E+"px"},dir:u.dir,children:m.length>100?r.jsx(tt,{className:"wu-pagination-list",containerHeight:E,list:m,callback:(y,S)=>r.jsxs(_r,{onSelect:()=>C(S),className:c("wu-py-2",S===i&&"wu-bg-gray-20","wu-pagination-item"),children:[S*w+1," -"," ",Math.min((S+1)*w,e)]},y)}):m.map(y=>r.jsxs(_r,{onSelect:()=>C(y),className:c(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*w+1," -"," ",Math.min((y+1)*w,e)]},y))})}),r.jsx(xs,{label:"Next page",onClick:()=>C(i+1),disabled:i===b-1||n,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});ms.displayName="WuPagination";const xs=({label:e,onClick:t,disabled:a,icon:s,className:o})=>r.jsx(le,{variant:"iconOnly",onClick:t,disabled:a,className:c("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",o),"aria-label":e,children:r.jsx("span",{className:c("wu-text-sm",s)})}),hl=({Trigger:e,children:t,className:a,dir:s,open:o,onOpenChange:n,modal:u,...l})=>r.jsxs(Fe,{open:o,onOpenChange:n,modal:u,children:[r.jsx(Ue,{asChild:!0,dir:s,children:e}),r.jsx(Ee,{className:c("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",a),dir:s,...l,children:t})]}),bl=e=>r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{...e})}),vs=g.forwardRef(({className:e,...t},a)=>r.jsx(bt.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:a}));vs.displayName=bt.Root.displayName;const ys=g.forwardRef(({className:e,...t},a)=>r.jsx(bt.Item,{ref:a,className:c("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:r.jsx(bt.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:r.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));ys.displayName=bt.Item.displayName;const Ns=f.forwardRef((e,t)=>{const{options:a,defaultValue:s,onChange:o,label:n,dir:u,...l}=e;return r.jsxs(vs,{defaultValue:s,required:l.required,disabled:l.disabled,onValueChange:o,id:l.id,dir:u,name:l.name,className:c("w-fit",l.className),ref:t,style:l.style,children:[r.jsx(qt,{htmlFor:l.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:n}),a.map(i=>r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[r.jsx(ys,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),r.jsx(qt,{htmlFor:i.value,className:c(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});Ns.displayName="WuRadioGroup";const gl=e=>{const{children:t,...a}=e;return r.jsxs(rt,{...a,role:"complementary","aria-label":"ScrollArea",children:[t,r.jsx(Fr,{orientation:"horizontal"})]})},Oe=g.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...s},o)=>r.jsx(xa.Root,{ref:o,decorative:a,orientation:t,className:c("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...s}));Oe.displayName=xa.Root.displayName;function Cs({className:e,...t}){return r.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Br=768;function Ss(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Br-1}px)`),s=()=>{t(window.innerWidth<Br)};return a.addEventListener("change",s),t(window.innerWidth<Br),()=>a.removeEventListener("change",s)},[]),!!e}const ml="sidebar_state",xl=3600*24*7,vl="256px",yl="256px",Nl="3rem",Cl="b",Es=g.createContext(null);function je(){const e=g.useContext(Es);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Ts=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:s,style:o,children:n,...u},l)=>{const i=Ss(),[d,w]=g.useState(!1),[p,b]=g.useState(i?!0:e),h=t??p,x=g.useCallback(y=>{const S=typeof y=="function"?y(h):y;a?a(S):b(S),document.cookie=`${ml}=${S}; path=/; max-age=${xl}`},[a,h]),m=g.useCallback(()=>i?w(y=>!y):x(y=>!y),[i,x,w]);g.useEffect(()=>{const y=S=>{S.key===Cl&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),m())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m]);const C=h?"expanded":"collapsed",E=g.useMemo(()=>({state:C,open:h,setOpen:x,isMobile:i,openMobile:d,setOpenMobile:w,toggleSidebar:m}),[C,h,x,i,d,w,m]);return r.jsx(Es.Provider,{value:E,children:r.jsx(_a,{delayDuration:0,children:r.jsx("div",{style:{"--sidebar-width":vl,"--sidebar-width-icon":Nl,...o},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:l,...u,children:n})})})});Ts.displayName="SidebarProvider";const ks=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:s,children:o,...n},u)=>{const{isMobile:l,state:i,openMobile:d,setOpenMobile:w}=je();return a==="none"?r.jsx("div",{className:c("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:u,...n,children:o}):l?r.jsx(Qa,{open:d,onOpenChange:w,...n,children:r.jsx(Mr,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":yl},side:e,children:r.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:o})})}):r.jsxs("div",{ref:u,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?a:"","data-variant":t,"data-side":e,children:[r.jsx("div",{className:c("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),r.jsx("div",{className:c("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",s),...n,children:r.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:o})})]})});ks.displayName="Sidebar";const Is=g.forwardRef(({className:e,onClick:t,children:a,...s},o)=>{const{toggleSidebar:n}=je();return r.jsxs(Re,{ref:o,"data-sidebar":"trigger",variant:"secondary",className:c("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:u=>{t==null||t(u),n()},...s,children:[a,r.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Is.displayName="SidebarTrigger";const Sl=g.forwardRef(({className:e,...t},a)=>{const{toggleSidebar:s}=je();return r.jsx("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:c("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});Sl.displayName="SidebarRail";const As=g.forwardRef(({className:e,...t},a)=>r.jsx("main",{ref:a,className:c("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));As.displayName="SidebarInset";const El=g.forwardRef(({className:e,...t},a)=>r.jsx(yr,{ref:a,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));El.displayName="SidebarInput";const Ds=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"header",className:c("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));Ds.displayName="SidebarHeader";const Ms=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"footer",className:c("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Ms.displayName="SidebarFooter";const Tl=g.forwardRef(({className:e,...t},a)=>r.jsx(Oe,{ref:a,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));Tl.displayName="SidebarSeparator";const _s=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"content",className:c("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));_s.displayName="SidebarContent";const Fs=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"group",className:c("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Fs.displayName="SidebarGroup";const Ls=g.forwardRef(({className:e,asChild:t=!1,...a},s)=>{const o=t?Xe.Slot:"div";return r.jsx(o,{ref:s,"data-sidebar":"group-label",className:c("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...a})});Ls.displayName="SidebarGroupLabel";const kl=g.forwardRef(({className:e,asChild:t=!1,...a},s)=>{const o=t?Xe.Slot:"button";return r.jsx(o,{ref:s,"data-sidebar":"group-action",className:c("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...a})});kl.displayName="SidebarGroupAction";const Ws=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"group-content",className:c("wu-w-full wu-text-sm",e),...t}));Ws.displayName="SidebarGroupContent";const qr=g.forwardRef(({className:e,...t},a)=>r.jsx("ul",{ref:a,"data-sidebar":"menu",className:c("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));qr.displayName="SidebarMenu";const Ps=g.forwardRef(({className:e,...t},a)=>r.jsx("li",{ref:a,"data-sidebar":"menu-item",className:c("wu-group/menu-item wu-relative",e),...t}));Ps.displayName="SidebarMenuItem";const Il=Se.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),Os=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:s="default",tooltip:o,className:n,...u},l)=>{const i=e?Xe.Slot:"button",{isMobile:d,state:w}=je(),p=r.jsx(i,{ref:l,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(Il({variant:a,size:s}),n),...u});return o?(typeof o=="string"&&(o={children:o}),r.jsxs(Fa,{children:[r.jsx(La,{asChild:!0,children:p}),r.jsx(Nr,{side:"right",align:"center",hidden:w!=="collapsed"||d,...o})]})):p});Os.displayName="SidebarMenuButton";const Al=g.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...s},o)=>{const n=t?Xe.Slot:"button";return r.jsx(n,{ref:o,"data-sidebar":"menu-action",className:c("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",a&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...s})});Al.displayName="SidebarMenuAction";const Dl=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"menu-badge",className:c("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Dl.displayName="SidebarMenuBadge";const Ml=g.forwardRef(({className:e,showIcon:t=!1,...a},s)=>{const o=g.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return r.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:c("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...a,children:[t&&r.jsx(Cs,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),r.jsx(Cs,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Ml.displayName="SidebarMenuSkeleton";const _l=g.forwardRef(({className:e,...t},a)=>r.jsx("ul",{ref:a,"data-sidebar":"menu-sub",className:c("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));_l.displayName="SidebarMenuSub";const Fl=g.forwardRef(({...e},t)=>r.jsx("li",{ref:t,...e}));Fl.displayName="SidebarMenuSubItem";const Ll=g.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:s,...o},n)=>{const u=e?Xe.Slot:"a";return r.jsx(u,{ref:n,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:c("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...o})});Ll.displayName="SidebarMenuSubButton";const Wl=({children:e,Sidebar:t,className:a,defaultOpen:s=!0,open:o,onOpenChange:n,style:u})=>r.jsxs(Ts,{defaultOpen:s,open:o,onOpenChange:n,children:[r.jsxs(ks,{variant:"sidebar",collapsible:"icon",className:c("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",a),style:u,role:"complementary",children:[r.jsx(Ds,{className:"wu-py-2",children:r.jsx(Bs,{})}),t]}),r.jsx(As,{className:"wu-contain-inline-size",children:e})]}),Bs=e=>{const{state:t,isMobile:a,openMobile:s}=je();return r.jsx(Is,{...e,children:r.jsx(Lr,{showMenu:a?s:t==="expanded"})})},Pl=({className:e,children:t,...a})=>{const s=f.useRef(null),o=f.useRef(null),n=({currentTarget:l})=>{const{scrollTop:i,clientHeight:d,scrollHeight:w}=l;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),o.current&&o.current.classList.toggle("wu-border-[#1b338014]",i+d!==w)},u="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return r.jsxs(_s,{...a,className:c("wu-overflow-hidden wu-gap-0",e),children:[r.jsx("hr",{className:u,ref:s}),r.jsx(rt,{onScroll:n,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),r.jsx("hr",{className:u,ref:o})]})},Ol=e=>r.jsx(Ms,{...e,children:e.children}),Bl=({label:e,children:t,...a})=>r.jsxs(Fs,{...a,className:"wu-p-0",children:[r.jsx("div",{className:"wu-h-8",children:r.jsx(Ls,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),r.jsx(Ws,{children:r.jsx(qr,{children:t})})]}),ql=e=>r.jsx(qr,{...e}),zl=({Icon:e,children:t,className:a,isActive:s,...o})=>{const{state:n}=je(),[u,l]=f.useState(),i=Ss(),d=t&&f.cloneElement(t,{children:r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,r.jsx("span",{className:c("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",n==="collapsed"&&!i&&"wu-opacity-0"),children:t.props.children})]})}),w=f.useRef(null);return f.useEffect(()=>{var p;l(((p=w.current)==null?void 0:p.textContent)||"")},[]),r.jsx(Ps,{...o,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:r.jsx(Os,{className:c("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",a,s&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:s,tooltip:u,asChild:!0,ref:w,children:d})})},Vl=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),zr=(e,t,a=1)=>{const s=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!s)throw new Error("Invalid HSL color format");const o=parseFloat(s[1]),n=parseFloat(s[2]),u=Math.max(0,parseFloat(s[3])+t);return`hsl(${o} ${n}% ${u}% / ${a})`},Hl=({index:e,viewIndex:t,length:a,itemHeight:s})=>{const o=(e-t+a)%a;let n;o===0?n=0:o===a-1&&a>=2?n=-1:o===a-2&&a>=3?n=-2:o===1?n=1:o===2?n=2:o===a-3&&a>=4?n=-3:n=3;const u=Vl.get(n)||{},l=n>0?s+28+(n-1)*20:u.top;return{position:n,styles:{...u,...n>0&&{top:`${l}px`},height:n>0?"32px":s}}},Nt={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},$l=({children:e,className:t,header:a,baseColor:s,position:o=0,style:n,...u})=>{const l=o<=0,i=o===0,d={border:i?`4px solid ${zr(s,Nt.BORDER_LIGHTNESS)}`:"",...n},w={backgroundColor:zr(s,o*Nt.LIGHTNESS_STEP),fontSize:i?Nt.FONT_SIZE_ACTIVE:Nt.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:o<0?"4px":"0px",height:"32px",padding:"4px 8px"},p={backgroundColor:zr(s,45+o*6),height:Nt.CONTENT_HEIGHT,position:"relative",bottom:o<0?"4px":"0px"};return r.jsxs("div",{className:c("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:d,...u,children:[r.jsx("div",{style:w,className:"wu-text-white",children:a}),l&&r.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:p,children:e})]})},Ul=({children:e,Trigger:t,Header:a,styles:s={},classNames:o={},open:n,onOpenChange:u,itemHeight:l})=>{const i={height:l,...s.Trigger};return r.jsxs(ns,{open:n,onOpenChange:u,children:[r.jsx(us,{className:c("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",o.Trigger),style:i,children:r.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),r.jsxs(Wr,{className:c("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",o.Content),hideCloseButton:!0,isStackedCard:!0,style:s.Content,children:[r.jsx(at,{}),r.jsx(ba.DialogClose,{className:c("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",o.CloseButton),style:s.CloseButton,"aria-label":"Close dialog",children:r.jsx(ue,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),a&&r.jsx(Pr,{className:c("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",o.Header),style:s.Header,children:a}),e]})]})};function jl({controlled:e,default:t,name:a,state:s="value"}){const{current:o}=g.useRef(e!==void 0),[n,u]=g.useState(t),l=o?e:n;if(process.env.NODE_ENV!=="production"){g.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${s} state of ${a} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
8
- `))},[s,a,e]);const{current:d}=g.useRef(t);g.useEffect(()=>{!o&&JSON.stringify(d)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${s} state of an uncontrolled ${a} after being initialized. To suppress this warning opt to use a controlled ${a}.`].join(`
9
- `))},[JSON.stringify(t)])}const i=g.useCallback(d=>{o||u(d)},[]);return[l,i]}const qs={};function st(e,t){const a=g.useRef(qs);return a.current===qs&&(a.current=e(t)),a}const Vr=g[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Gl=Vr&&Vr!==g.useLayoutEffect?Vr:e=>e();function Te(e){const t=st(Yl).current;return t.next=e,Gl(t.effect),t.trampoline}function Yl(){const e={next:void 0,callback:Kl,trampoline:(...t)=>{var a;return(a=e.callback)==null?void 0:a.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Kl(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Jl=[];function zs(e){g.useEffect(e,Jl)}const Ct=0;class Yt{constructor(){Wt(this,"currentId",Ct);Wt(this,"clear",()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)});Wt(this,"disposeEffect",()=>this.clear)}static create(){return new Yt}start(t,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,a()},t)}isStarted(){return this.currentId!==Ct}}function Vs(){const e=st(Yt.create).current;return zs(e.disposeEffect),e}const Hs=0;class Hr extends Yt{constructor(){super(...arguments);Wt(this,"clear",()=>{this.currentId!==Hs&&(clearInterval(this.currentId),this.currentId=Hs)})}static create(){return new Hr}start(a,s){this.clear(),this.currentId=setInterval(()=>{s()},a)}}function Xl(){const e=st(Hr.create).current;return zs(e.disposeEffect),e}const ke=typeof document<"u"?g.useLayoutEffect:()=>{};function $s(e){const t=st(Zl,e).current;return t.next=e,ke(t.effect),t}function Zl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ql(){const[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}function $r(e,t,a,s){const o=st(Us).current;return ei(o,e,t,a,s)&&js(o,[e,t,a,s]),o.callback}function Rl(e){const t=st(Us).current;return ti(t,e)&&js(t,e),t.callback}function Us(){return{callback:null,cleanup:null,refs:[]}}function ei(e,t,a,s,o){return e.refs[0]!==t||e.refs[1]!==a||e.refs[2]!==s||e.refs[3]!==o}function ti(e,t){return e.refs.length!==t.length||e.refs.some((a,s)=>a!==t[s])}function js(e,t){if(e.refs=t,t.every(a=>a==null)){e.callback=null;return}e.callback=a=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),a!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const n=t[o];if(n!=null)switch(typeof n){case"function":{const u=n(a);typeof u=="function"&&(s[o]=u);break}case"object":{n.current=a;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const n=t[o];if(n!=null)switch(typeof n){case"function":{const u=s[o];typeof u=="function"?u():n(null);break}case"object":{n.current=null;break}}}}}}}const ri={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Gs(){return typeof window<"u"}function Ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ai(e){return Gs()?e instanceof Element||e instanceof Ur(e).Element:!1}function si(e){return Gs()?e instanceof HTMLElement||e instanceof Ur(e).HTMLElement:!1}function oi(e){return(e==null?void 0:e.ownerDocument)||document}const Kt=typeof navigator<"u",jr=ii(),ni=di(),ui=ci();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const li=jr.platform==="MacIntel"&&jr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(jr.platform);Kt&&ni.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,ui.includes("jsdom/");function ii(){if(!Kt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function ci(){if(!Kt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:a})=>`${t}/${a}`).join(" "):navigator.userAgent}function di(){if(!Kt)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Jt(e,...t){const a=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>a.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${a} for the full message.`}const Gr=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(Gr.displayName="NumberFieldRootContext");function Xt(){const e=g.useContext(Gr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Jt(43));return e}function Ie(){}const Le=Object.freeze({});let Ys=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const wi={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fi={valid(e){return e===null?null:e?{[Ys.valid]:""}:{[Ys.invalid]:""}}},Ks=g.createContext({invalid:void 0,name:void 0,validityData:{state:wi,errors:[],error:"",value:"",initialValue:null},setValidityData:Ie,disabled:void 0,touched:!1,setTouched:Ie,dirty:!1,setDirty:Ie,filled:!1,setFilled:Ie,focused:!1,setFocused:Ie,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Le)=>e,getInputValidationProps:(e=Le)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Ks.displayName="FieldRootContext");function Yr(e=!0){const t=g.useContext(Ks);if(t.setValidityData===Ie&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Jt(28));return t}const pi={...g};let Js=0;function hi(e,t="mui"){const[a,s]=g.useState(e),o=e||a;return g.useEffect(()=>{a==null&&(Js+=1,s(`${t}-${Js}`))},[a,t]),o}const Xs=pi.useId;function bi(e,t){if(Xs!==void 0){const a=Xs();return e??(t?`${t}-${a}`:a)}return hi(e,t)}function gi(e){return bi(e,"base-ui")}const Zs=g.createContext({controlId:void 0,setControlId:Ie,labelId:void 0,setLabelId:Ie,messageIds:[],setMessageIds:Ie,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Zs.displayName="LabelableContext");function Qs(){return g.useContext(Zs)}function mi(e={}){const{id:t,implicit:a=!1,controlRef:s}=e,{controlId:o,setControlId:n}=Qs(),u=gi(t);return ke(()=>{if(!(!a&&!t||n===Ie)){if(a){const l=s==null?void 0:s.current;ai(l)&&l.closest("label")!=null?n(t??null):n(o??u)}else t&&n(t);return()=>{t&&n(void 0)}}},[t,s,o,n,a,u]),o??u}const St={inputValue:()=>null,value:()=>null},xi=parseInt(g.version,10);function vi(e){return xi>=e}function Rs(e){if(!g.isValidElement(e))return null;const t=e,a=t.props;return(vi(19)?a==null?void 0:a.ref:t.ref)??null}function Kr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function yi(e,t){const a={};for(const s in e){const o=e[s];if(t!=null&&t.hasOwnProperty(s)){const n=t[s](o);n!=null&&Object.assign(a,n);continue}o===!0?a[`data-${s.toLowerCase()}`]="":o&&(a[`data-${s.toLowerCase()}`]=o.toString())}return a}function Ni(e,t){return typeof e=="function"?e(t):e}function Ci(e,t){return typeof e=="function"?e(t):e}const Et={};function eo(e,t,a,s,o){let n={...Jr(e,Et)};return t&&(n=Zt(n,t)),a&&(n=Zt(n,a)),s&&(n=Zt(n,s)),n}function Si(e){if(e.length===0)return Et;if(e.length===1)return Jr(e[0],Et);let t={...Jr(e[0],Et)};for(let a=1;a<e.length;a+=1)t=Zt(t,e[a]);return t}function Zt(e,t){return to(t)?t(e):Ei(e,t)}function Ei(e,t){if(!t)return e;for(const a in t){const s=t[a];switch(a){case"style":{e[a]=Kr(e.style,s);break}case"className":{e[a]=ro(e.className,s);break}default:Ti(a,s)?e[a]=ki(e[a],s):e[a]=s}}return e}function Ti(e,t){const a=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return a===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function to(e){return typeof e=="function"}function Jr(e,t){return to(e)?e(t):e??Et}function ki(e,t){return t?e?a=>{if(Ii(a)){const o=a;Xr(o);const n=t(o);return o.baseUIHandlerPrevented||e==null||e(o),n}const s=t(a);return e==null||e(a),s}:t:e}function Xr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ro(e,t){return t?e?t+" "+e:t:e}function Ii(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Tt(e,t,a={}){const s=t.render,o=Ai(t,a);if(a.enabled===!1)return null;const n=a.state??Le;return Di(e,s,o,n)}function Ai(e,t={}){const{className:a,style:s,render:o}=e,{state:n=Le,ref:u,props:l,stateAttributesMapping:i,enabled:d=!0}=t,w=d?Ni(a,n):void 0,p=d?Ci(s,n):void 0,b=d?yi(n,i):Le,h=d?Kr(b,Array.isArray(l)?Si(l):l)??Le:Le;return typeof document<"u"&&(d?Array.isArray(u)?h.ref=Rl([h.ref,Rs(o),...u]):h.ref=$r(h.ref,Rs(o),u):$r(null,null)),d?(w!==void 0&&(h.className=ro(h.className,w)),p!==void 0&&(h.style=Kr(h.style,p)),h):Le}function Di(e,t,a,s){if(t){if(typeof t=="function")return t(a,s);const o=eo(a,t.props);return o.ref=a.ref,g.cloneElement(t,o)}if(e&&typeof e=="string")return Mi(e,a);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Jt(8))}function Mi(e,t){return e==="button"?f.createElement("button",{type:"button",...t,key:t.key}):e==="img"?f.createElement("img",{alt:"",...t,key:t.key}):g.createElement(e,t)}const ao=new Map;function kt(e,t){const a=JSON.stringify({locale:e,options:t}),s=ao.get(a);if(s)return s;const o=new Intl.NumberFormat(e,t);return ao.set(a,o),o}function ot(e,t,a){return e==null?"":kt(t,a).format(e)}function so(e,t,a){return ot(e,t,{...a,maximumFractionDigits:20})}const _i=["零","〇","一","二","三","四","五","六","七","八","九"],Fi={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},oo=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],no=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Zr=["0","1","2","3","4","5","6","7","8","9"],uo=["%","٪","%","﹪"],lo=["‰","؉"],io=["−","-","‒","–","—","﹣"],co=["+","﹢"],Li=".",Wi=",",Pi=new RegExp(`[${oo.join("")}]`,"g"),Oi=new RegExp(`[${no.join("")}]`,"g"),Bi=new RegExp(`[${Zr.join("")}]`,"g"),qi=new RegExp(`[${_i.join("")}]`,"g"),zi=new RegExp(`[${uo.join("")}]`),Vi=new RegExp(`[${lo.join("")}]`),Qr=/[٠١٢٣٤٥٦٧٨٩]/,wo=/[۰۱۲۳۴۵۶۷۸۹]/,Rr=/[零〇一二三四五六七八九]/,fo=new RegExp(`[${Zr.join("")}]`),Hi=[".",",",Li,Wi,"٫","٬"],po=new RegExp("\\p{Zs}","u"),$i=["+",...co],Ui=["-",...io],Qt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ji=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),ho=e=>`[${e.map(ji).join("")}]`,bo=ho(["-"].concat(io)),go=ho(["+"].concat(co)),mo=new RegExp(bo,"gu"),xo=new RegExp(go,"gu"),It=new RegExp(bo),Rt=new RegExp(go);function ea(e,t){const a=kt(e,t).formatToParts(11111.1),s={};return a.forEach(o=>{s[o.type]=o.value}),kt(e).formatToParts(.1).forEach(o=>{o.type==="decimal"&&(s[o.type]=o.value)}),s}function nt(e,t,a){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(mo,"-").replace(xo,"+");let o=!1;const n=s.match(/([+-])\s*$/);n&&(n[1]==="-"&&(o=!0),s=s.replace(/([+-])\s*$/,""));const u=s.match(/^\s*([+-])/);u&&(u[1]==="-"&&(o=!0),s=s.replace(/^\s*[+-]/,""));let l=t;l===void 0&&(Qr.test(s)||wo.test(s)?l="ar":Rr.test(s)&&(l="zh"));const{group:i,decimal:d,currency:w}=ea(l,a),p=kt(l,a).formatToParts(1).filter(T=>T.type==="unit").map(T=>Qt(T.value)),b=p.length?new RegExp(p.join("|"),"g"):null;let h=null;i&&(new RegExp("\\p{Zs}","u").test(i)?h=new RegExp("\\p{Zs}","gu"):i==="'"||i==="’"?h=/['’]/g:h=new RegExp(Qt(i),"g"));let m=[{regex:i?h:null,replacement:""},{regex:d?new RegExp(Qt(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:w?new RegExp(Qt(w),"g"):null,replacement:""},{regex:b,replacement:""},{regex:Pi,replacement:T=>String(oo.indexOf(T))},{regex:Oi,replacement:T=>String(no.indexOf(T))},{regex:Bi,replacement:T=>String(Zr.indexOf(T))},{regex:qi,replacement:T=>Fi[T]}].reduce((T,{regex:D,replacement:F})=>D?T.replace(D,F):T,s);const C=m.lastIndexOf(".");if(C!==-1&&(m=`${m.slice(0,C).replace(/\./g,"")}.${m.slice(C+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const E=(o?"-":"")+m;let y=parseFloat(E);const S=a==null?void 0:a.style,N=S==="unit"&&(a==null?void 0:a.unit)==="percent",k=zi.test(e)||S==="percent";return Vi.test(e)?y/=1e3:!N&&k&&(y/=100),Number.isNaN(y)?null:y}const Gi=60,Yi=400,Ki=50,Ji=3,Xi=8,er=1;function Zi(e,t=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,a))}const Qi=1e-10;function Ri(e){const t=kt("en-US").resolvedOptions(),a=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,a),minimumFractionDigits:a}}function ec(e,t){if(!Number.isFinite(e))return e;const a=Math.min(Math.max(t,0),20);return Number(e.toFixed(a))}function ta(e,t){const{maximumFractionDigits:a}=Ri(t);return ec(e,a)}function tc(e,t,a,s="directional"){if(a===0)return e;const o=Math.abs(a),n=Math.sign(a),u=o*Qi*n,l=s==="nearest"?a:o,i=(e-t+u)/l;let d;return s==="nearest"?d=Math.round(i):n>0?d=Math.floor(i):d=Math.ceil(i),t+d*(s==="nearest"?a:o)}function rc(e,{step:t,minWithDefault:a,maxWithDefault:s,minWithZeroDefault:o,format:n,snapOnStep:u,small:l}){if(e===null)return e;const i=Zi(e,a,s);if(t!=null&&u){if(t===0)return ta(i,n);let d=o;!l&&a!==Number.MIN_SAFE_INTEGER&&(d=a);const w=tc(i,d,t,l?"nearest":"directional");return ta(w,n)}return ta(i,n)}const ac="none",vo="input-change",ra="input-clear",yo="input-blur",sc="input-paste",At="keyboard";function Ae(e,t,a,s){let o=!1,n=!1;const u=s??Le;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){n=!0},get isCanceled(){return o},get isPropagationAllowed(){return n},trigger:a,...u}}function Dt(e,t,a){const s=Le;return{reason:e,event:t??new Event("base-ui"),...s}}const No=g.forwardRef(function(t,a){const{id:s,min:o,max:n,smallStep:u=.1,step:l=1,largeStep:i=10,required:d=!1,disabled:w=!1,readOnly:p=!1,name:b,defaultValue:h,value:x,onValueChange:m,onValueCommitted:C,allowWheelScrub:E=!1,snapOnStep:y=!1,format:S,locale:N,render:k,className:A,inputRef:T,...D}=t,{setDirty:F,validityData:W,disabled:_,setFilled:z,invalid:P,name:G,state:q,validation:oe,shouldValidateOnChange:M}=Yr(),H=_||w,U=G??b,[O,ae]=g.useState(!1),te=o??Number.MIN_SAFE_INTEGER,pe=n??Number.MAX_SAFE_INTEGER,We=o??0,$=S==null?void 0:S.style,I=g.useRef(null),V=$r(T,oe.inputRef),K=mi({id:s}),[L,Z]=jl({controlled:x,default:h,name:"NumberField",state:"value"}),B=L??null,we=$s(B);ke(()=>{z(B!==null)},[z,B]);const he=Ql(),be=$s(S),de=g.useRef(!1),De=Te((J,Y)=>{de.current=!1,C==null||C(J,Y)}),Be=Vs(),ut=Xl(),lt=Vs(),ur=g.useRef(!1),lr=g.useRef(0),Ye=g.useRef(!0),it=g.useRef(null),Ke=g.useRef(()=>{}),[re,Pe]=g.useState(()=>x!==void 0?Co(B,N,S):ot(B,N,S)),[ir,bd]=g.useState("numeric"),gn=Te(()=>{const{decimal:J,group:Y,currency:ne,literal:ie}=ea(N,S),Q=new Set;Hi.forEach(Ne=>Q.add(Ne)),J&&Q.add(J),Y&&(Q.add(Y),po.test(Y)&&Q.add(" "));const Me=$==="percent"||$==="unit"&&(S==null?void 0:S.unit)==="percent",Lt=$==="percent"||$==="unit"&&(S==null?void 0:S.unit)==="permille";return Me&&uo.forEach(Ne=>Q.add(Ne)),Lt&&lo.forEach(Ne=>Q.add(Ne)),$==="currency"&&ne&&Q.add(ne),ie&&(Array.from(ie).forEach(Ne=>Q.add(Ne)),po.test(ie)&&Q.add(" ")),$i.forEach(Ne=>Q.add(Ne)),te<0&&Ui.forEach(Ne=>Q.add(Ne)),Q}),ct=Te(J=>J!=null&&J.altKey?u:J!=null&&J.shiftKey?i:l),cr=Te((J,Y)=>{const ne=Y.event,ie=Y.direction,Q=rc(J,{step:ie?ct(ne)*ie:void 0,format:be.current,minWithDefault:te,maxWithDefault:pe,minWithZeroDefault:We,snapOnStep:y,small:(ne==null?void 0:ne.altKey)??!1});if(Q!==B||J!==B||Ye.current===!1){if(it.current=Q,m==null||m(Q,Y),Y.isCanceled)return;Z(Q),F(Q!==W.initialValue),de.current=!0}Ye.current&&Pe(ot(Q,N,S)),he()}),Ft=Te((J,{direction:Y,currentValue:ne,event:ie,reason:Q})=>{const Me=ne??we.current,Lt=typeof Me=="number"?Me+J*Y:Math.max(0,o??0);cr(Lt,Ae(Q,ie,void 0,{direction:Y}))}),dt=Te(()=>{lt.clear(),Be.clear(),ut.clear(),Ke.current(),lr.current=0}),mn=Te((J,Y)=>{if(dt(),!I.current)return;const ne=Ur(I.current);function ie(Me){Me.preventDefault()}ne.addEventListener("contextmenu",ie),Ke.current=()=>{ne.removeEventListener("contextmenu",ie)},ne.addEventListener("pointerup",Me=>{ur.current=!1,dt();const Lt=it.current??we.current;De(Lt,Dt(J?"increment":"decrement",Me))},{once:!0});function Q(){const Me=ct(Y)??er;Ft(Me,{direction:J?1:-1,event:Y,reason:J?"increment-press":"decrement-press"})}Q(),Be.start(Yi,()=>{ut.start(Gi,Q)})});ke(function(){if(!Ye.current)return;const Y=x!==void 0?Co(B,N,S):ot(B,N,S);Y!==re&&Pe(Y)}),ke(function(){if(!li)return;let Y="text";te>=0&&(Y="decimal"),bd(Y)},[te,$]),g.useEffect(()=>()=>dt(),[dt]),g.useEffect(function(){const Y=I.current;if(H||p||!E||!Y)return;function ne(ie){if(ie.ctrlKey||oi(I.current).activeElement!==I.current)return;ie.preventDefault();const Q=ct(ie)??er;Ft(Q,{direction:ie.deltaY>0?-1:1,event:ie,reason:"wheel"})}return Y.addEventListener("wheel",ne),()=>{Y.removeEventListener("wheel",ne)}},[E,Ft,H,p,i,l,ct]);const pa=g.useMemo(()=>({...q,disabled:H,readOnly:p,required:d,value:B,inputValue:re,scrubbing:O}),[q,H,p,d,B,re,O]),gd=g.useMemo(()=>({inputRef:I,inputValue:re,value:B,startAutoChange:mn,stopAutoChange:dt,minWithDefault:te,maxWithDefault:pe,disabled:H,readOnly:p,id:K,setValue:cr,incrementValue:Ft,getStepAmount:ct,allowInputSyncRef:Ye,formatOptionsRef:be,valueRef:we,lastChangedValueRef:it,hasPendingCommitRef:de,isPressedRef:ur,intentionalTouchCheckTimeout:lt,movesAfterTouchRef:lr,name:U,required:d,invalid:P,inputMode:ir,getAllowedNonNumericKeys:gn,min:o,max:n,setInputValue:Pe,locale:N,isScrubbing:O,setIsScrubbing:ae,state:pa,onValueCommitted:De}),[I,re,B,mn,dt,te,pe,H,p,K,cr,Ft,ct,be,we,lt,U,d,P,ir,gn,o,n,Pe,N,O,pa,De]),md=Tt("div",t,{ref:a,state:pa,props:D,stateAttributesMapping:St});return r.jsxs(Gr.Provider,{value:gd,children:[md,r.jsx("input",{...oe.getInputValidationProps({onChange(J){if(J.nativeEvent.defaultPrevented)return;const Y=J.currentTarget.valueAsNumber,ne=Number.isNaN(Y)?null:Y,ie=Ae(ac,J.nativeEvent);F(ne!==W.initialValue),cr(ne,ie),M()&&oe.commit(ne)}}),ref:V,type:"number",name:U,value:B??"",min:o,max:n,step:l,disabled:H,required:d,"aria-hidden":!0,tabIndex:-1,style:ri})]})});process.env.NODE_ENV!=="production"&&(No.displayName="NumberFieldRoot");function Co(e,t,a){return(a==null?void 0:a.maximumFractionDigits)!=null||(a==null?void 0:a.minimumFractionDigits)!=null?ot(e,t,a):so(e,t,a)}const So=g.forwardRef(function(t,a){const{render:s,className:o,...n}=t,{state:u}=Xt();return Tt("div",t,{ref:a,state:u,props:[{role:"group"},n],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(So.displayName="NumberFieldGroup");let aa;process.env.NODE_ENV!=="production"&&(aa=new Set);function Eo(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");aa.has(t)||(aa.add(t),console.error(`Base UI: ${t}`))}}const To=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(To.displayName="CompositeRootContext");function oc(e=!1){const t=g.useContext(To);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Jt(16));return t}function nc(e){const{focusableWhenDisabled:t,disabled:a,composite:s=!1,tabIndex:o=0,isNativeButton:n}=e,u=s&&t!==!1,l=s&&t===!1;return{props:g.useMemo(()=>{const d={onKeyDown(w){a&&t&&w.key!=="Tab"&&w.preventDefault()}};return s||(d.tabIndex=o,!n&&a&&(d.tabIndex=t?o:-1)),(n&&(t||u)||!n&&a)&&(d["aria-disabled"]=a),n&&(!t||l)&&(d.disabled=a),d},[s,a,t,u,l,n,o])}}function ko(e={}){const{disabled:t=!1,focusableWhenDisabled:a,tabIndex:s=0,native:o=!0}=e,n=g.useRef(null),u=oc(!0)!==void 0,l=Te(()=>{const b=n.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:i}=nc({focusableWhenDisabled:a,disabled:t,composite:u,tabIndex:s,isNativeButton:o});process.env.NODE_ENV!=="production"&&g.useEffect(()=>{if(!n.current)return;const b=n.current.tagName==="BUTTON";o?b||Eo("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):b&&Eo("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[o]);const d=g.useCallback(()=>{const b=n.current;uc(b)&&u&&t&&i.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,i.disabled,u]);ke(d,[d]);const w=g.useCallback((b={})=>{const{onClick:h,onMouseDown:x,onKeyUp:m,onKeyDown:C,onPointerDown:E,...y}=b;return eo({type:o?"button":void 0,onClick(N){if(t){N.preventDefault();return}h==null||h(N)},onMouseDown(N){t||x==null||x(N)},onKeyDown(N){if(t||(Xr(N),C==null||C(N)),N.baseUIHandlerPrevented)return;const k=N.target===N.currentTarget&&!o&&!l()&&!t,A=N.key==="Enter",T=N.key===" ";k&&((T||A)&&N.preventDefault(),A&&(h==null||h(N)))},onKeyUp(N){t||(Xr(N),m==null||m(N)),!N.baseUIHandlerPrevented&&N.target===N.currentTarget&&!o&&!t&&N.key===" "&&(h==null||h(N))},onPointerDown(N){if(t){N.preventDefault();return}E==null||E(N)}},o?void 0:{role:"button"},i,y)},[t,i,o,l]),p=Te(b=>{n.current=b,d()});return{getButtonProps:w,buttonRef:p}}function uc(e){return si(e)&&e.tagName==="BUTTON"}function Io(e){const{allowInputSyncRef:t,disabled:a,formatOptionsRef:s,getStepAmount:o,id:n,incrementValue:u,inputRef:l,inputValue:i,intentionalTouchCheckTimeout:d,isIncrement:w,isPressedRef:p,locale:b,maxWithDefault:h,minWithDefault:x,movesAfterTouchRef:m,readOnly:C,setValue:E,startAutoChange:y,stopAutoChange:S,value:N,valueRef:k,lastChangedValueRef:A,onValueCommitted:T}=e,D=g.useRef({x:0,y:0}),F=g.useRef(!1),W=g.useRef(!1),_=g.useRef(""),z=N!=null&&N<=x,P=N!=null&&N>=h,G=w?"increment-press":"decrement-press";function q(M){t.current=!0;const H=nt(i,b,s.current);H!==null&&(k.current=H,E(H,Ae(G,M,void 0,{direction:w?1:-1})))}return{disabled:a||(w?P:z),"aria-readonly":C||void 0,"aria-label":w?"Increase":"Decrease","aria-controls":n,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){F.current=!0},onTouchEnd(){F.current=!1},onClick(M){const H=a||C||(w?P:z);if(M.defaultPrevented||H||(_.current==="touch"?W.current:M.detail!==0))return;q(M.nativeEvent);const U=o(M)??er,O=k.current;u(U,{direction:w?1:-1,event:M.nativeEvent,reason:G});const ae=A.current??k.current;ae!==O&&T(ae,Dt(G,M.nativeEvent))},onPointerDown(M){var O;const H=!M.button||M.button===0,U=a||(w?P:z);M.defaultPrevented||C||!H||U||(_.current=M.pointerType,W.current=!1,p.current=!0,D.current={x:M.clientX,y:M.clientY},q(M.nativeEvent),M.pointerType!=="touch"?(M.preventDefault(),(O=l.current)==null||O.focus(),y(w,M)):d.start(Ki,()=>{const ae=m.current;m.current=0,p.current&&ae!=null&&ae<Ji?(y(w,M),W.current=!0):(W.current=!1,S())}))},onPointerUp(M){M.pointerType==="touch"&&(p.current=!1)},onPointerMove(M){if(a||C||(w?P:z)||M.pointerType!=="touch"||!p.current)return;m.current!=null&&(m.current+=1);const{x:U,y:O}=D.current,ae=U-M.clientX,te=O-M.clientY;ae**2+te**2>Xi**2&&S()},onMouseEnter(M){const H=a||C||(w?P:z);M.defaultPrevented||H||!p.current||F.current||_.current==="touch"||y(w,M)},onMouseLeave(){F.current||S()},onMouseUp(){F.current||S()}}}const Ao=g.forwardRef(function(t,a){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...l}=t,{allowInputSyncRef:i,disabled:d,formatOptionsRef:w,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:E,locale:y,maxWithDefault:S,minWithDefault:N,movesAfterTouchRef:k,readOnly:A,setValue:T,startAutoChange:D,state:F,stopAutoChange:W,value:_,valueRef:z,lastChangedValueRef:P,onValueCommitted:G}=Xt(),q=n||d,oe=Io({isIncrement:!0,inputRef:x,startAutoChange:D,stopAutoChange:W,minWithDefault:N,maxWithDefault:S,value:_,inputValue:m,disabled:q,readOnly:A,id:b,setValue:T,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:w,valueRef:z,isPressedRef:E,intentionalTouchCheckTimeout:C,movesAfterTouchRef:k,locale:y,lastChangedValueRef:P,onValueCommitted:G}),{getButtonProps:M,buttonRef:H}=ko({disabled:q,native:u}),U=g.useMemo(()=>({...F,disabled:q}),[F,q]);return Tt("button",t,{ref:[a,H],state:U,props:[oe,l,M],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(Ao.displayName="NumberFieldIncrement");const Do=g.forwardRef(function(t,a){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...l}=t,{allowInputSyncRef:i,disabled:d,formatOptionsRef:w,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:E,maxWithDefault:y,minWithDefault:S,movesAfterTouchRef:N,readOnly:k,setValue:A,startAutoChange:T,state:D,stopAutoChange:F,value:W,valueRef:_,locale:z,lastChangedValueRef:P,onValueCommitted:G}=Xt(),q=n||d,oe=Io({isIncrement:!1,inputRef:x,startAutoChange:T,stopAutoChange:F,minWithDefault:S,maxWithDefault:y,value:W,inputValue:m,disabled:q,readOnly:k,id:b,setValue:A,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:w,valueRef:_,isPressedRef:E,intentionalTouchCheckTimeout:C,movesAfterTouchRef:N,locale:z,lastChangedValueRef:P,onValueCommitted:G}),{getButtonProps:M,buttonRef:H}=ko({disabled:q,native:u}),U=g.useMemo(()=>({...D,disabled:q}),[D,q]);return Tt("button",t,{ref:[a,H],state:U,props:[oe,l,M],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(Do.displayName="NumberFieldDecrement");function lc(e){e.preventDefault(),e.stopPropagation()}function ic(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Mo=g.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ie,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Mo.displayName="FormContext");function _o(){return g.useContext(Mo)}function cc(e){const{enabled:t=!0,value:a,id:s,name:o,controlRef:n,commit:u}=e,{formRef:l}=_o(),{invalid:i,markedDirtyRef:d,validityData:w,setValidityData:p}=Yr(),b=Te(e.getValue);ke(()=>{if(!t)return;let h=a;h===void 0&&(h=b()),w.initialValue===null&&h!==null&&p(x=>({...x,initialValue:h}))},[t,p,a,w.initialValue,b]),ke(()=>{!t||!s||l.current.fields.set(s,{getValue:b,name:o,controlRef:n,validityData:ic(w,i),validate(){let h=a;h===void 0&&(h=b()),d.current=!0,zn.flushSync(()=>u(h))}})},[u,n,t,l,b,s,i,d,o,w,a]),ke(()=>{const h=l.current.fields;return()=>{s&&h.delete(s)}},[l,s])}function dc(e,t){const a=g.useRef(e),s=Te(t);ke(()=>{a.current!==e&&s(a.current)},[e,s]),ke(()=>{a.current=e},[e])}const wc={...fi,...St},fc=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Fo=g.forwardRef(function(t,a){const{render:s,className:o,...n}=t,{allowInputSyncRef:u,disabled:l,formatOptionsRef:i,getAllowedNonNumericKeys:d,getStepAmount:w,id:p,incrementValue:b,inputMode:h,inputValue:x,max:m,min:C,name:E,readOnly:y,required:S,setValue:N,state:k,setInputValue:A,locale:T,inputRef:D,value:F,onValueCommitted:W,lastChangedValueRef:_,hasPendingCommitRef:z,valueRef:P}=Xt(),{clearErrors:G}=_o(),{validationMode:q,setTouched:oe,setFocused:M,invalid:H,shouldValidateOnChange:U,validation:O}=Yr(),{labelId:ae}=Qs(),te=g.useRef(!1),pe=g.useRef(!1);return cc({id:p,commit:O.commit,value:F,controlRef:D,name:E,getValue:()=>F??null}),dc(F,I=>{const V=U();if(G(E),V&&O.commit(F),!(I===F||V)){if(pe.current){pe.current=!1;return}O.commit(F,!0)}}),Tt("input",t,{ref:[a,D],state:k,props:[{id:p,required:S,disabled:l,readOnly:y,inputMode:h,value:x,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":H||void 0,"aria-labelledby":ae,suppressHydrationWarning:!0,onFocus(I){if(I.defaultPrevented||y||l||te.current)return;te.current=!0,M(!0);const V=I.currentTarget,K=V.value.length;V.setSelectionRange(K,K)},onBlur(I){if(I.defaultPrevented||y||l)return;oe(!0),M(!1);const V=!u.current,K=z.current;if(u.current=!0,x.trim()===""){N(null,Ae(ra,I.nativeEvent)),q==="onBlur"&&O.commit(null),W(null,Dt(ra,I.nativeEvent));return}const L=i.current,Z=nt(x,T,L);if(Z===null)return;const B=(L==null?void 0:L.maximumFractionDigits)!=null||(L==null?void 0:L.minimumFractionDigits)!=null,we=L==null?void 0:L.maximumFractionDigits,he=B&&typeof we=="number"?Number(Z.toFixed(we)):Z,be=Dt(yo,I.nativeEvent),de=F!==he,De=V||de||K;q==="onBlur"&&O.commit(he),de&&(pe.current=!0,N(he,Ae(yo,I.nativeEvent))),De&&W(he,be);const Be=ot(he,T,L),ut=so(Z,T,L);!(!B&&Z===F&&x===ut)&&x!==Be&&A(Be)},onChange(I){if(I.nativeEvent.defaultPrevented)return;u.current=!1;const V=I.target.value;if(V.trim()===""){A(V),N(null,Ae(ra,I.nativeEvent));return}const K=d();if(!Array.from(V).every(B=>{const we=B>="0"&&B<="9",he=Qr.test(B),be=Rr.test(B),de=wo.test(B),De=fo.test(B),Be=It.test(B);return we||he||be||de||De||Be||K.has(B)}))return;if(I.isTrusted){A(V);const B=nt(V,T,i.current);B!==null&&N(B,Ae(vo,I.nativeEvent));return}const Z=nt(V,T,i.current);Z!==null&&(A(V),N(Z,Ae(vo,I.nativeEvent)))},onKeyDown(I){if(I.defaultPrevented||y||l)return;const V=I.nativeEvent;u.current=!0;const K=d();let L=K.has(I.key);const{decimal:Z,currency:B,percentSign:we}=ea(T,i.current),he=I.currentTarget.selectionStart,be=I.currentTarget.selectionEnd,de=he===0&&be===x.length,De=re=>he!=null&&be!=null&&re>=he&&re<be;if(It.test(I.key)&&Array.from(K).some(re=>It.test(re||""))){const re=x.search(mo),Pe=re!=null&&re!==-1&&De(re);L=!(It.test(x)||Rt.test(x))||de||Pe}if(Rt.test(I.key)&&Array.from(K).some(re=>Rt.test(re||""))){const re=x.search(xo),Pe=re!=null&&re!==-1&&De(re);L=!(It.test(x)||Rt.test(x))||de||Pe}[Z,B,we].forEach(re=>{if(I.key===re){const Pe=x.indexOf(re),ir=De(Pe);L=!x.includes(re)||de||ir}});const Be=I.key>="0"&&I.key<="9",ut=Qr.test(I.key),lt=Rr.test(I.key),ur=fo.test(I.key),lr=fc.has(I.key);if(I.which===229||I.altKey||I.ctrlKey||I.metaKey||L||Be||ut||ur||lt||lr)return;const Ye=nt(x,T,i.current),it=w(I)??er;lc(I);const Ke=Dt(At,V);I.key==="ArrowUp"?(b(it,{direction:1,currentValue:Ye,event:V,reason:At}),W(_.current??P.current,Ke)):I.key==="ArrowDown"?(b(it,{direction:-1,currentValue:Ye,event:V,reason:At}),W(_.current??P.current,Ke)):I.key==="Home"&&C!=null?(N(C,Ae(At,V)),W(_.current??P.current,Ke)):I.key==="End"&&m!=null&&(N(m,Ae(At,V)),W(_.current??P.current,Ke))},onPaste(I){if(I.defaultPrevented||y||l)return;I.preventDefault();const K=(I.clipboardData||window.Clipboard).getData("text/plain"),L=nt(K,T,i.current);L!==null&&(u.current=!1,N(L,Ae(sc,I.nativeEvent)),A(K))}},O.getValidationProps(),n],stateAttributesMapping:wc})});process.env.NODE_ENV!=="production"&&(Fo.displayName="NumberFieldInput");const pc={wuStepper:"_wuStepper_apbnq_1"},hc=({onChange:e,Label:t,defaultValue:a=0,readonly:s,dir:o,step:n=1,min:u,max:l,value:i,className:d,labelPosition:w="left",disabled:p,resetInvalidValueOnBlur:b=!0,...h})=>{const x=g.useId(),[m,C]=g.useState(i!==void 0?Number(i):a||0);g.useEffect(()=>{i!==void 0&&C(Number(i))},[i]);const E=T=>{C(T),e==null||e(T)},y=T=>{const D=Number(T.target.value);Number.isNaN(D)||C(D)},S=()=>{b&&(u!==void 0&&m<u?(C(u),e==null||e(u)):l!==void 0&&m>l&&(C(l),e==null||e(l)))};g.useEffect(()=>{i&&a&&console.warn("As both value and defaultValue are passed, value will be used")},[i,a]);const N={inc:s||l!==void 0&&m>=l||p,dec:s||u!==void 0&&m<=u||p},k=u!==void 0&&m<u||l!==void 0&&m>l,A=c("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return r.jsxs(No,{id:x,value:m,step:n,readOnly:s,onValueChange:T=>typeof T=="number"&&E(T),dir:o,className:c("wu-flex wu-stepper",o==="rtl"&&w!=="top"&&"wu-gap-2",pc.wuStepper,bc({labelPosition:w}),d),children:[t&&r.jsx(xe,{htmlFor:x,className:"wu-input-label",children:t}),r.jsxs(So,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[r.jsx(Do,{"aria-label":"decrement",className:c(A,o==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:N.dec,children:r.jsx("span",{className:"wu-text-base wm-minimize"})}),r.jsx(Fo,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":k||void 0,dir:o,className:c("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",k&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:S,disabled:p,min:u,max:l,step:n,value:m,...h}),r.jsx(Ao,{"aria-label":"increment",className:c(A,o==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:N.inc,children:r.jsx("span",{className:"wu-text-base wm-add"})})]})]})},bc=Se.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}}),Lo=Se.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),gc=g.forwardRef(({className:e,variant:t,size:a,...s},o)=>r.jsx(va.Root,{ref:o,className:c(Lo({variant:t,size:a,className:e})),...s}));gc.displayName=va.Root.displayName;const Wo=g.createContext({size:"default",variant:"default"}),tr=g.forwardRef(({className:e,variant:t,size:a,children:s,...o},n)=>r.jsx(Ot.Root,{ref:n,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...o,children:r.jsx(Wo.Provider,{value:{variant:t,size:a},children:s})}));tr.displayName=Ot.Root.displayName;const Ge=g.forwardRef(({className:e,children:t,variant:a,size:s,...o},n)=>{const u=g.useContext(Wo);return r.jsx(Ot.Item,{ref:n,className:c(Lo({variant:u.variant||a,size:u.size||s}),e),...o,children:t})});Ge.displayName=Ot.Item.displayName;const Po=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,onChange:u}=e,l=i=>c("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",o&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,onValueChange:u,disabled:o,dir:n,className:c("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",o&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[r.jsx("div",{role:"slider",className:c("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&"",s==="opt2"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),r.jsx(Ge,{value:"opt1",className:l("opt1"),children:a[0].label}),r.jsx(Ge,{value:"opt2",className:l("opt2"),children:a[1].label})]})})});Po.displayName="_IconTab";const Oo=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,size:u="md",onChange:l}=e,i=d=>c("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="lg"&&"wu-h-10 wu-min-w-36",d===s&&"wu-text-white wu-font-medium",o&&s===d&&"wu-text-gray-lead","wu-switcher-tab-item");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,onValueChange:l,disabled:o,dir:n,className:c("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",o&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[r.jsx("div",{role:"slider",className:c("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-tab-slider")}),r.jsx(Ge,{value:"opt1",className:i("opt1"),children:r.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:a[0].label})}),r.jsx(Ge,{value:"opt2",className:i("opt2"),children:r.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:a[1].label})})]})})});Oo.displayName="_Tab";const Bo=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,onChange:u}=e,l=p=>c("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",o&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),i=c("wu-w-fit wu-gap-2",o&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=c("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",o&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),w=c("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&n!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&n==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n==="rtl"&&"-wu-translate-x-[10px]",o&&"wu-hidden","wu-switcher-toggle-knob");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,disabled:o,dir:n,className:i,onValueChange:u,children:[r.jsx(Ge,{value:"opt1",className:l("opt1"),children:r.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:a[0].label})}),r.jsx("button",{onClick:()=>u(s==="opt1"?"opt2":"opt1"),className:d,disabled:o,"aria-label":"knob",dir:n,children:r.jsx("div",{className:w,role:"knob",dir:n})}),r.jsx(Ge,{value:"opt2",className:l("opt2"),children:r.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:a[1].label})})]})})});Bo.displayName="_Toggle";const qo=f.forwardRef((e,t)=>{const{type:a,options:s,value:o,disabled:n,dir:u,size:l,onChange:i,toggle:d=!0,...w}=e,[p,b]=f.useState(),h=x=>{let m=p;x!==""?m=x:d&&(m=p==="opt1"?"opt2":"opt1");const C=m==="opt1"?s[0].value:s[1].value;i&&i(C),b(m)};if(f.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");b(o===s[0].value?"opt1":"opt2")},[s,o]),!Array.isArray(s)||s.length<2)return r.jsx(r.Fragment,{});switch(a){case"toggle":return r.jsx(Bo,{...w,ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u});case"iconTab":return r.jsx(Po,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u});default:return r.jsx(Oo,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u,size:l})}});qo.displayName="WuSwitcher";const zo=$e.Root,sa=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx($e.List,{className:c("wu-relative wu-flex",e),...a,ref:s,children:t}));sa.displayName=$e.List.displayName;const oa=g.forwardRef(({className:e,...t},a)=>r.jsx($e.Trigger,{ref:a,className:c("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));oa.displayName=$e.Trigger.displayName;const Vo=g.forwardRef(({className:e,...t},a)=>r.jsx($e.Content,{ref:a,className:e,...t}));Vo.displayName=$e.Content.displayName;const Ho=({items:e,enableAnimation:t})=>{const a="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return r.jsx("div",{className:c("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(s=>r.jsx(Vo,{value:s.value,forceMount:t||void 0,className:c("wu-w-full wu-h-full wu-overflow-y-auto",t&&a,"wu-tab-content"),children:s.Content},s.value))})},mc=e=>{const[t,a]=f.useState(!1),[s,o]=f.useState(!1),n=()=>{const l=e.current;l&&(a(l.scrollLeft>0),o(l.scrollLeft+l.clientWidth<l.scrollWidth))};return f.useEffect(()=>{const l=e.current;return n(),l&&l.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{l&&l.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[e]),{showLeftArrow:t,showRightArrow:s,scrollByTab:l=>{const i=e.current;if(i){const d=(l==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:d,behavior:"smooth"})}}}},$o=(e,t)=>{const[a,s]=f.useState({width:0,left:0,height:0,top:0}),o=t==="vertical";return f.useEffect(()=>{const n=e.current;if(n){const u=()=>{const i=n.querySelector('[data-state="active"]');if(i){const d={width:o?2:i.offsetWidth,left:o?0:i.offsetLeft,height:o?i.offsetHeight:1,top:o?i.offsetTop:0};s(d)}},l=new MutationObserver(u);return l.observe(n,{attributes:!0,subtree:!0}),u(),()=>{l.disconnect()}}},[e,o]),a},xc=({items:e,value:t,defaultValue:a,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:l="top"})=>{var S;const i=f.useRef(null),d=$o(i,"horizontal"),{showLeftArrow:w,showRightArrow:p,scrollByTab:b}=mc(i),[h,x]=f.useState(!1),m=()=>b("left"),C=()=>b("right"),E=N=>r.jsx("div",{"data-testid":`gradient-overlay-${N}`,className:c("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",N==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(N,k,A)=>{const T=k==="left";return r.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",T?"wu-left-0":"wu-right-0",A&&"wu-translate-x-0 wu-opacity-100",!A&&[T?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":T?"scroll-left":"scroll-right",children:r.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return r.jsxs(zo,{defaultValue:a||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"horizontal",dir:u,className:c("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",l==="bottom"?"wu-flex-col-reverse":"wu-flex-col",n),role:"tabs",children:[r.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[w&&h&&E("left"),y(m,"left",w&&h),r.jsxs(sa,{ref:i,className:c("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>r.jsx(oa,{value:N.value,children:N.Trigger},N.value)),r.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:d.width,left:d.left,height:1.25,bottom:l==="bottom"?void 0:0,top:l==="bottom"?0:void 0}})]}),p&&h&&E("right"),y(C,"right",p&&h)]}),r.jsx(Ho,{items:e,enableAnimation:o})]})},vc=e=>{const[t,a]=f.useState(!1),[s,o]=f.useState(!1),n=()=>{const l=e.current;l&&(a(l.scrollTop>0),o(l.scrollTop+l.clientHeight<l.scrollHeight))};return f.useEffect(()=>{const l=e.current;if(l)return n(),l.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{l.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[e]),{showTopArrow:t,showBottomArrow:s,scrollByTab:l=>{const i=e.current;if(i){const d=(l==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:d,behavior:"smooth"})}}}},yc=({items:e,value:t,defaultValue:a,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:l="left"})=>{var S;const i=f.useRef(null),d=$o(i,"vertical"),{showTopArrow:w,showBottomArrow:p,scrollByTab:b}=vc(i),[h,x]=f.useState(!1),m=()=>b("up"),C=()=>b("down"),E=N=>r.jsx("div",{className:c("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",N==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(N,k,A)=>{const T=k==="up";return r.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",T?"-wu-top-1":"-wu-bottom-1",A&&"wu-translate-y-0 wu-opacity-100",!A&&[T?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":T?"scroll-up":"scroll-down",children:r.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return r.jsxs(zo,{defaultValue:a||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"vertical",dir:u,className:c("wu-relative wu-h-full wu-w-full wu-flex",l==="left"?"wu-flex-row":"wu-flex-row-reverse",n),role:"tabs",children:[r.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[w&&h&&E("top"),y(m,"up",w&&h),r.jsxs(sa,{ref:i,className:c("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>r.jsx(oa,{value:N.value,children:N.Trigger},N.value)),r.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:l==="left"?0:void 0,right:l==="right"?0:void 0,height:d.height,top:d.top}})]}),p&&h&&E("bottom"),y(C,"down",p&&h)]}),r.jsx(Ho,{items:e,enableAnimation:o})]})},Nc=({...e})=>e.orientation==="vertical"?r.jsx(yc,{...e}):r.jsx(xc,{...e}),na=g.forwardRef(({className:e,...t},a)=>r.jsx("table",{ref:a,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));na.displayName="Table";const Uo=g.forwardRef(({className:e,...t},a)=>r.jsx("thead",{ref:a,className:c("[&_tr]:wu-border-b",e),...t}));Uo.displayName="TableHeader";const jo=g.forwardRef(({className:e,...t},a)=>r.jsx("tbody",{ref:a,className:c("",e),...t}));jo.displayName="TableBody";const Cc=g.forwardRef(({className:e,...t},a)=>r.jsx("tfoot",{ref:a,className:c("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Cc.displayName="TableFooter";const Mt=g.forwardRef(({className:e,...t},a)=>r.jsx("tr",{ref:a,className:c("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));Mt.displayName="TableRow";const ua=g.forwardRef(({className:e,...t},a)=>r.jsx("th",{ref:a,className:c("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));ua.displayName="TableHead";const rr=g.forwardRef(({className:e,...t},a)=>r.jsx("td",{ref:a,className:c("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));rr.displayName="TableCell";const la=g.forwardRef(({className:e,...t},a)=>r.jsx("caption",{ref:a,className:c("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));la.displayName="TableCaption";const Sc=({columns:e,rowSelection:t})=>{const a=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:o,rowUniqueKey:n}=t||{},u=f.useCallback(i=>d=>{o(()=>d?i:[])},[o]);return{finalColumns:f.useMemo(()=>a?[{id:"select",header:({table:i})=>{const d=i.getRowModel().rows.map(p=>p.original),w=u(d);return r.jsx(Ce,{checked:i.getIsSomeRowsSelected()||i.getIsAllRowsSelected(),partial:i.getIsSomeRowsSelected()&&!i.getIsAllRowsSelected(),onChange:p=>{i.toggleAllRowsSelected(!!p),w(!!p)},"aria-label":"Select all","data-testid":i.getIsSomeRowsSelected()&&!i.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:i})=>r.jsx(Ce,{checked:i.getIsSelected(),onChange:d=>{i.toggleSelected(!!d)},"aria-label":String(i.original[n])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:s},...e]:e,[e,a,u])}};function Go({data:e,columns:t,rowSelection:a}){const{finalColumns:s}=Sc({columns:t,rowSelection:a}),o=f.useMemo(()=>{if(!(a!=null&&a.isEnabled))return{};const n={};for(const u of a.selectedRows){const l=e.findIndex(i=>i[a.rowUniqueKey]===u[a.rowUniqueKey]);l!==-1&&(n[l]=!0)}return n},[e,a]);return{finalColumns:s,rowSelectionState:o}}const Yo=({table:e,size:t,NoDataContent:a,isLoading:s,CustomLoader:o})=>{var l;const[n,u]=f.useState(null);return r.jsx(jo,{children:s?r.jsx(Mt,{children:r.jsx(rr,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:o||r.jsx(et,{className:"wu-w-full"})})}):(l=e.getRowModel().rows)!=null&&l.length?e.getRowModel().rows.map((i,d)=>r.jsx(Mt,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>u(i.id),onMouseOut:()=>u(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?n===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((w,p)=>r.jsx(rr,{className:c("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",w.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",n===i.id&&w.column.id==="actions"?"wu-opacity-100 wu-visible":"",w.column.columnDef.cellAlign==="right"&&"wu-text-right",w.column.columnDef.cellAlign==="center"&&"wu-text-center",w.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:_e.flexRender(w.column.columnDef.cell,w.getContext())},`${w.id}-${p}`))},`${i.id}-${d}`)):r.jsx(Mt,{children:r.jsx(rr,{colSpan:e.getAllColumns().length,children:a})})})},Ko=({table:e,sortableColumns:t,manual:a=!1,onSort:s,size:o,isRowSelected:n,HeaderAction:u,isStickyHeader:l})=>{const i=o==="compact"?"wu-h-8":"wu-h-10",d=w=>{const{id:p,columnDef:b,getIsSorted:h,toggleSorting:x}=w,{header:m}=b;if(!t.includes(p))return m;const C=h(),E=C==="asc",y=C==="desc",S=()=>{a?(x(!y),s==null||s({id:p,desc:y})):x(w.getIsSorted()==="asc")};return r.jsxs("button",{onClick:S,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,r.jsxs("div",{className:"wu-relative",children:[r.jsx("span",{className:c("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",E&&"wu-hidden",!C&&"-wu-top-[11px]")}),r.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!C&&"-wu-bottom-[10px]")})]})]})};return r.jsxs(Uo,{className:c("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",l&&"wu-sticky wu-top-[-.5px] wu-z-10",i),children:[e.getHeaderGroups().map(w=>r.jsx(Mt,{className:"wu-relative",children:w.headers.map(p=>p.column.id==="actions"?r.jsx(ua,{colSpan:p.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${p.getSize()}px`}},p.id):r.jsx(ua,{colSpan:p.colSpan,className:c("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",p.column.columnDef.headerAlign==="right"&&"wu-text-right",p.column.columnDef.headerAlign==="center"&&"wu-text-center",p.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${p.getSize()}px`},children:_e.flexRender(d(p.column),p.getContext())},p.id))},w.id)),n&&u&&r.jsxs("div",{className:c("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",i),children:[r.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:r.jsx(Ce,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:w=>{e.toggleAllRowsSelected(!!w)},"aria-label":"Select all"})}),r.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:u})]})]})},Jo=Se.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),Ec=({data:e,columns:t,isLoading:a=!1,variant:s="unstyled",sort:o,size:n,rowSelection:u,HeaderAction:l,NoDataContent:i,stickyHeader:d=!1,CustomLoader:w,caption:p,...b})=>{var S;const{finalColumns:h,rowSelectionState:x}=Go({data:e,columns:t,rowSelection:u}),m=f.useMemo(()=>h.filter(N=>N.enableSorting).map(N=>N.accessorKey),[h]),C=((S=u==null?void 0:u.selectedRows)==null?void 0:S.length)??0,E=N=>{if(typeof N=="function"){const k=N(x),A=Object.keys(k).filter(T=>k[Number(T)]).map(T=>e[Number(T)]);u==null||u.onRowSelect(A)}},y=_e.useReactTable({data:e,columns:h,getCoreRowModel:_e.getCoreRowModel(),getPaginationRowModel:_e.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:u==null?void 0:u.isEnabled,state:{...u!=null&&u.isEnabled?{rowSelection:x}:{}},onRowSelectionChange:E});return r.jsxs("div",{className:c("wu-text-gray-lead wu-table-container wu-relative"),children:[p&&r.jsx(la,{className:"wu-font-light",children:p}),r.jsxs(na,{...b,className:c(Jo({variant:s}),b.className),children:[r.jsx(Ko,{table:y,sortableColumns:m,manual:!0,onSort:o==null?void 0:o.onSort,size:n,HeaderAction:l,isRowSelected:C>0,isStickyHeader:d}),!a&&r.jsx(Yo,{table:y,size:n,NoDataContent:i,CustomLoader:w})]}),a&&r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:r.jsx(et,{})})]})},Tc=({data:e,columns:t,variant:a="unstyled",size:s="default",sort:o,filterText:n,pagination:u,stickyHeader:l,HeaderAction:i,CustomLoader:d,NoDataContent:w,isLoading:p,caption:b,rowSelection:h,...x})=>{var z;const[m,C]=f.useState((o==null?void 0:o.initial)||[]),[E,y]=f.useState([]),[S,N]=f.useState((u==null?void 0:u.pageIndex)??0),{finalColumns:k,rowSelectionState:A}=Go({data:e,columns:t,rowSelection:h}),T=f.useMemo(()=>k.filter(P=>P.enableSorting).map(P=>P.accessorKey),[k]),D=f.useMemo(()=>k.filter(P=>P.filterable).map(P=>P.accessorKey),[k]),F=((z=h==null?void 0:h.selectedRows)==null?void 0:z.length)??0,W=P=>{const G=typeof P=="function"?P(A):P,q=Object.keys(G).filter(oe=>G[Number(oe)]).map(oe=>e[Number(oe)]);h==null||h.onRowSelect(q)},_=_e.useReactTable({data:e,columns:k,getCoreRowModel:_e.getCoreRowModel(),getFilteredRowModel:_e.getFilteredRowModel(),getSortedRowModel:_e.getSortedRowModel(),getPaginationRowModel:u?_e.getPaginationRowModel():void 0,state:{sorting:m,columnFilters:E,...u?{pagination:u}:{},...h!=null&&h.isEnabled?{rowSelection:A}:{}},onSortingChange:C,onColumnFiltersChange:y,onRowSelectionChange:W});return f.useEffect(()=>{D.forEach(P=>{var G;(G=_.getColumn(P))==null||G.setFilterValue(n)})},[n,D,_]),f.useEffect(()=>{u&&(u==null?void 0:u.pageIndex)!==S&&(h==null||h.onRowSelect(()=>[]),_.resetRowSelection(),N(u.pageIndex))},[u==null?void 0:u.pageIndex]),r.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:r.jsxs(na,{...x,className:c("wu-overflow-x-auto wu-w-full",Jo({variant:a}),"wu-table-fixed",x.className),children:[b&&r.jsx(la,{children:b}),r.jsx(Ko,{table:_,sortableColumns:T,size:s,HeaderAction:i,isRowSelected:F>0,isStickyHeader:l}),r.jsx(Yo,{table:_,size:s,NoDataContent:w,CustomLoader:d,isLoading:p})]})})},Xo=g.forwardRef(({className:e,...t},a)=>r.jsx("textarea",{className:c("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:a,...t}));Xo.displayName="Textarea";const Zo=f.forwardRef((e,t)=>{const{Label:a,id:s=Bt(),variant:o="flat",readonly:n,maxLength:u,labelPosition:l="top",...i}=e,d=p=>{i.onChange&&i.onChange(p)},w=gt(l);return r.jsxs("div",{className:c(w,"wu-flex wu-textarea-container"),dir:i.dir,children:[r.jsx(Xo,{...i,ref:t,id:s,className:c("wu-peer wu-rounded-t-sm",o==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:d,readOnly:n,maxLength:u}),a&&r.jsx(xe,{htmlFor:s,className:"wu-textarea-label",children:a})]})});Zo.displayName="WuTextarea";function kc(e){if(typeof e=="string"&&e.includes("T")){const t=j.parseISO(e);return j.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=j.parse(e,"HH:mm:ss",new Date);return j.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Qo=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Ro=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),en=["am","pm"],ar=50;function Ic(e){return Array(ar).fill(e).flat()}function ia(e,t){const a=e.indexOf(t);return[...e.slice(a),...e.slice(0,a)]}function Ac(e,t){let a=Number(e);return t==="pm"&&a<12&&(a+=12),t==="am"&&a===12&&(a=0),String(a).padStart(2,"0")}function tn(e){const t=Number(e),a=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:a}}const Dc=({value:e,isSelected:t,onClick:a})=>r.jsx("div",{onClick:a,className:c("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),ca=({values:e,selectedValue:t,scrollRef:a,onSelect:s,repeatItems:o=!0,className:n})=>r.jsx("div",{ref:a,className:c("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",n),role:"presentation",children:(o?Ic(e):e).map((u,l)=>r.jsx(Dc,{value:u,isSelected:u===t,onClick:()=>s(u)},`${u}-${l}`))});function Mc(e,t,a,s){const o=f.useMemo(()=>e?ia(Qo,t.padStart(2,"0")):Qo,[e]),n=f.useMemo(()=>e?ia(Ro,a.padStart(2,"0")):Ro,[e]),u=f.useMemo(()=>e?ia(en,s):en,[e]);return{rotatedHours:o,rotatedMinutes:n,rotatedMeridiem:u}}function _c(e,t,a){f.useEffect(()=>{function s(u){if(u){const l=u.scrollHeight/ar,i=Math.floor(ar/2);u.scrollTop=i*l;const d=()=>{const{scrollTop:w}=u,p=Math.round(w/l);(p<=1||p>=ar-2)&&(u.scrollTop=i*l)};return u.addEventListener("scroll",d),()=>{u.removeEventListener("scroll",d)}}}if(!e)return;const o=s(t.current),n=s(a.current);return()=>{o==null||o(),n==null||n()}},[e,t,a])}const rn=({className:e,time:t,Label:a,labelPosition:s,dir:o,...n})=>{const[u,l]=f.useState(!1),[i,d]=f.useState(""),w=f.useRef(null),p=f.useRef(null),b=f.useRef(null),h=f.useRef(null),[x,m]=f.useState("12"),[C,E]=f.useState("00"),[y,S]=f.useState("am");f.useEffect(()=>{if(!t){d(""),m("12"),E("00"),S("am"),w.current&&(w.current.value="");return}const D=kc(t);d(D);const[F,W]=D.split(":"),{hour:_,meridiem:z}=tn(F);m(_),E(W),S(z),w.current&&(w.current.value=D)},[t]),f.useEffect(()=>{const D=F=>{p.current&&!p.current.contains(F.target)&&l(!1)};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[]),_c(u,b,h);const{rotatedHours:N,rotatedMinutes:k,rotatedMeridiem:A}=Mc(u,x,C,y),T=f.useCallback((D,F,W)=>{const _=D??x,z=F??C,P=W??y;m(_),E(z),S(P);const G=`${Ac(_,P)}:${z}`;d(G)},[x,C,y]);return r.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:o,children:[a&&r.jsx(xe,{htmlFor:"time-picker",className:"wu-timepicker-label",children:a}),r.jsxs("div",{className:c("relative inline-block"),ref:p,dir:o,children:[r.jsx(ve,{ref:w,type:"time",value:i,variant:"flat",role:"textbox",onChange:D=>{d(D.target.value);const[F,W]=D.target.value.split(":"),{hour:_,meridiem:z}=tn(F);m(_),E(W),S(z)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:r.jsx(ue,{icon:"wm-schedule",className:c("wu-text-base",n.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>l(D=>!D),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:o,...n}),r.jsx("style",{children:`
7
+ )`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:f(Zd.gradientBackground,"wu-transform-gpu",s),...u,children:r})},uo="calc(100vh - 64px)",Jd={sm:"400px",md:"600px",lg:"1200px"},kn=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:c,className:d,style:w,variant:h="action",...m})=>{const b={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(ro,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(so,{asChild:!0,children:e}),a.jsxs(Lr,{style:{width:"calc(100% - 64px)",maxWidth:l||Jd[n],maxHeight:c||uo,...w},hideCloseButton:r,onInteractOutside:g=>s&&g.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":h,className:f("wu-group wuexp:wu-rounded-[1.1rem]",d),...m,children:["data-theme"in m&&a.jsx(io,{colors:b[h],strokeWidth:4,className:f("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:c||uo},children:t}),!("data-theme"in m)&&t]})]})},Mn=({children:e,className:t,...n})=>a.jsx("div",{className:f("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...n,children:e}),Qd=({children:e,className:t,...n})=>a.jsx(_r,{...n,"data-variant":"action",className:f("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",t),children:a.jsx(xt,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Rd=({children:e,className:t,...n})=>a.jsx(oo,{...n,className:f("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",t),children:e}),Ye=({children:e,className:t,...n})=>{const r=p.useRef(null);return a.jsx(Yd,{asChild:!0,children:a.jsx(ce,{className:t,ref:r,...n,children:e})})},ew=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:c,isCheckedAll:d,width:w,...h})=>{const[m,b]=p.useState(""),[g,x]=p.useState(e);p.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){x(e),b("");return}const y=r.label;if(n&&Array.isArray(t)){const N=t.map(C=>C[y]).join(", ");b(N)}else!n&&!Array.isArray(t)&&b(t[y])},[t,r.label,n,e]);const S=()=>e&&!m?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:g}):a.jsx("span",{className:f("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:d?(c==null?void 0:c.triggerText)??m:m});return a.jsx(Ir,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...h,disabled:l,className:f("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",h.className),children:[i??S(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},lo=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),c=d=>{e.disabled||(r(e),n&&d.preventDefault())};return a.jsxs(Kt,{onClick:c,disabled:e.disabled,className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(Ae,{checked:l}),a.jsx(co,{option:e,accessorKey:s})]})},co=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},wo=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Kt,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:f("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Ae,{"data-partial":s,checked:r||s,partial:s}),a.jsx(co,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Ha,{dir:o.dir,children:[a.jsx(Yt,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>p.createElement(lo,{...o,option:u,key:l}))]});case"divider":return a.jsx(En,{className:"wu-mx-4"});default:return a.jsx(lo,{...o,option:t})}},tw=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},nw=100,rw=400,fo=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:c,virtualizedThreshold:d=nw,maxHeight:w=rw,hasGroup:h=!1,Header:m,CustomTrigger:b,selectAll:g,disabled:x,labelPosition:S="top",onScroll:y,maxContentWidth:N,...C})=>{const[E,M]=p.useState(),A=p.useRef(null),[k,D]=p.useState(!1),[F,V]=p.useState(!1),{cleanData:$,enabledOptions:W}=h||g!=null&&g.enable?tw(e):{cleanData:e,enabledOptions:[]},G=p.useMemo(()=>n&&g!=null&&g.enable&&e.length>0?[{type:"all",[o.label]:g.label||"Select All"},...e]:e,[e,g,n]),q=p.useCallback(z=>{const B=z[o.value];if(n)M((ne=[])=>{const ae=ne,He=ae.some(j=>j[o.value]===B)?ae.filter(j=>j[o.value]!==B):[...ae,z];return t==null||t(He),He});else{const ne=z;M(ne),t==null||t(ne)}},[n,o.value,t]);p.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&M(void 0),r!==void 0&&M(r),s!==void 0&&M(s)},[r,s]);const ue=G.length>d;p.useEffect(()=>{if(!n)return;const z=g!=null&&g.includeDisabled?(E==null?void 0:E.length)===e.length:(E==null?void 0:E.length)===W.length;D(z);const B=(E==null?void 0:E.length)>0&&!z;V(B)},[E,g]);const I=p.useCallback(()=>{const z=k?[]:g!=null&&g.includeDisabled?h?$:e:W;M(z),t==null||t(z)},[k,n,e,W,t,g]),_=Ut(S);return a.jsxs("div",{className:f(_,"wu-flex wu-select-container"),ref:A,dir:u,children:[a.jsxs(Mr,{children:[a.jsx(ew,{...C,value:E,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:b,id:C.id,disabled:x,selectAll:g,isCheckedAll:k}),a.jsxs(Tn,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:C.id,style:{maxWidth:N},children:[m,ue?a.jsx(bt,{list:G,containerHeight:w,callback:(z,B)=>a.jsx(wo,{option:B,accessorKey:o,multiple:n,onSelect:q,value:E,dir:u,handleSelectAll:I,isCheckedAll:k,isPartialSelected:F}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:G.map((z,B)=>a.jsx(wo,{option:z,accessorKey:o,multiple:n,onSelect:q,value:E,handleSelectAll:I,isCheckedAll:k,dir:u,isPartialSelected:F},`${B}`))})]})]}),c&&a.jsx(Ce,{htmlFor:C.id,className:"wu-select-label",children:c})]})},In=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sw=({value:e,onChange:t,min:n=K.sub(new Date,{years:5}),max:r=K.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:c,disabledMonths:d=[],...w})=>{const[h,m]=p.useState(null),[b,g]=p.useState(""),[x,S]=p.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=p.useMemo(()=>{const C=new Date(n).getFullYear(),E=new Date(r).getFullYear();return Array.from({length:E-C+1},(M,A)=>({value:E-A,label:E-A}))},[n,r]);p.useEffect(()=>{if(e){const C=new Date(e),E=C.getFullYear(),M=C.getMonth();m({year:E,month:M}),g(`${In[M]} ${E}`),S({value:E,label:E})}},[e]);const N=()=>{h&&t&&(t(new Date(h.year,h.month,15)),g(`${In[h.month]} ${h.year}`))};return a.jsxs("div",{className:f("wu-flex wu-flex-col wu-items-center",Ut(i),i==="top"&&"wu-items-start"),children:[a.jsxs(ze,{children:[a.jsx(Cr,{...w,disabled:u||c,id:l,dir:"ltr",placeholder:s,formattedString:b}),a.jsxs(Ie,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(fo,{data:y,accessorKey:{value:"value",label:"label"},value:x,onSelect:C=>S(C),multiple:!1,maxHeight:224})}),a.jsx(aw,{year:x==null?void 0:x.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(C,E)=>m({year:E,month:C}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{onClick:N,children:"Apply"})})})]})]}),o&&a.jsx(Ce,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},aw=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=p.useMemo(()=>{const c=new Set;return s.forEach(d=>{const w=typeof d=="string"?new Date(d):d;c.add(`${w.getFullYear()}-${w.getMonth()}`)}),c},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:In.map((c,d)=>{const w=e===i&&d===u,h=t===d&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${d}`),onClick:()=>r(d,e),className:f("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",h&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${In[d]} ${e}`,"data-month":d,"data-year":e,children:c},c)})})},po=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=p.useState([]),[u,l]=p.useState([]);return p.useEffect(()=>{const c=()=>{var b,g;const d=((b=t.current)==null?void 0:b.clientWidth)||0,w=((g=n.current)==null?void 0:g.clientWidth)||0,h=d-w,m=Math.floor(h/r);i(e.slice(0,m)),l(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,r]),[o,u]},ho={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},ow=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((d,w)=>p.cloneElement(d,{className:f(ho.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:w})),[t]),i=p.useRef(null),u=p.useRef(null),[l,c]=po(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),c.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(ho.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},Or={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},iw=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((w,h)=>p.cloneElement(w.link,{key:h,className:f(Or.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[p.cloneElement(w.imgOrIcon,{className:f("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),[c,d]=po(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:f("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:f(Or.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:c}),d.length>0&&a.jsxs(ze,{children:[a.jsx(et,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Ie,{className:f(Or.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(ze,{children:[a.jsx(et,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ie,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},mo=p.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,c]=p.useState(t),[d,w]=p.useState(n);p.useEffect(()=>{c(t),w(n)},[t,n]);const h=Math.ceil(e/d),m=l*d+1,b=Math.min((l+1)*d,e),g=Array.from({length:h},(y,N)=>N),x=p.useCallback(y=>{y>=0&&y<h&&(c(y),r==null||r(y))},[h,r]),S=224;return a.jsxs("div",{className:f("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(go,{label:"Previous page",onClick:()=>x(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Fr,{name:`${m} - ${b}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(yt,{style:{maxHeight:S+"px"},dir:i.dir,children:g.length>100?a.jsx(bt,{className:"wu-pagination-list",containerHeight:S,list:g,callback:(y,N)=>a.jsxs(An,{onSelect:()=>x(N),className:f("wu-py-2",N===l&&"wu-bg-gray-20","wu-pagination-item"),children:[N*d+1," -"," ",Math.min((N+1)*d,e)]},y)}):g.map(y=>a.jsxs(An,{onSelect:()=>x(y),className:f(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*d+1," -"," ",Math.min((y+1)*d,e)]},y))})}),a.jsx(go,{label:"Next page",onClick:()=>x(l+1),disabled:l===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});mo.displayName="WuPagination";const go=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(ce,{variant:"iconOnly",onClick:t,disabled:n,className:f("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:f("wu-text-sm",r)})}),uw=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(ze,{open:s,onOpenChange:o,modal:i,children:[a.jsx(et,{asChild:!0,dir:r,children:e}),a.jsx(Ie,{className:f("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),lw=e=>a.jsx(Bt.PopoverClose,{asChild:!0,children:a.jsx(ce,{...e})}),bo=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Root,{className:f("wu-grid wu-gap-2",e),...t,ref:n}));bo.displayName=Ht.Root.displayName;const yo=v.forwardRef(({className:e,...t},n)=>a.jsx(Ht.Item,{ref:n,className:f("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(Ht.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));yo.displayName=Ht.Item.displayName;const xo=p.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(bo,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:f("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Nn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(yo,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Nn,{htmlFor:l.value,className:f(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});xo.displayName="WuRadioGroup";const cw=e=>{const{children:t,...n}=e;return a.jsxs(yt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Pr,{orientation:"horizontal"})]})},Wr=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(ga.Root,{ref:s,decorative:n,orientation:t,className:f("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Wr.displayName=ga.Root.displayName;function vo({className:e,...t}){return a.jsx("div",{className:f("animate-pulse rounded-md bg-muted",e),...t})}const Br=768;function No(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Br-1}px)`),r=()=>{t(window.innerWidth<Br)};return n.addEventListener("change",r),t(window.innerWidth<Br),()=>n.removeEventListener("change",r)},[]),!!e}const dw="sidebar_state",ww=3600*24*7,fw="256px",pw="256px",hw="3rem",mw="b",So=v.createContext(null);function tt(){const e=v.useContext(So);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Co=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=No(),[c,d]=v.useState(!1),[w,h]=v.useState(l?!0:e),m=t??w,b=v.useCallback(y=>{const N=typeof y=="function"?y(m):y;n?n(N):h(N),document.cookie=`${dw}=${N}; path=/; max-age=${ww}`},[n,m]),g=v.useCallback(()=>l?d(y=>!y):b(y=>!y),[l,b,d]);v.useEffect(()=>{const y=N=>{N.key===mw&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:m,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,b,l,c,d,g]);return a.jsx(So.Provider,{value:S,children:a.jsx(Ia,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":fw,"--sidebar-width-icon":hw,...s},className:f("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Co.displayName="SidebarProvider";const To=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:c,setOpenMobile:d}=tt();return n==="none"?a.jsx("div",{className:f("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(Za,{open:c,onOpenChange:d,...o,children:a.jsx(Dr,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":pw},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:f("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:f("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});To.displayName="Sidebar";const Eo=v.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=tt();return a.jsxs(mt,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:f("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Eo.displayName="SidebarTrigger";const gw=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=tt();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:f("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});gw.displayName="SidebarRail";const Ao=v.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:f("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));Ao.displayName="SidebarInset";const bw=v.forwardRef(({className:e,...t},n)=>a.jsx(vr,{ref:n,"data-sidebar":"input",className:f("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));bw.displayName="SidebarInput";const ko=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:f("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));ko.displayName="SidebarHeader";const Mo=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:f("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Mo.displayName="SidebarFooter";const yw=v.forwardRef(({className:e,...t},n)=>a.jsx(Wr,{ref:n,"data-sidebar":"separator",className:f("wu-mx-2 wu-w-auto",e),...t}));yw.displayName="SidebarSeparator";const Io=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:f("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Io.displayName="SidebarContent";const Do=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:f("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Do.displayName="SidebarGroup";const Po=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:f("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});Po.displayName="SidebarGroupLabel";const xw=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ft.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:f("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});xw.displayName="SidebarGroupAction";const Fo=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:f("wu-w-full wu-text-sm",e),...t}));Fo.displayName="SidebarGroupContent";const zr=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:f("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));zr.displayName="SidebarMenu";const Vo=v.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:f("wu-group/menu-item wu-relative",e),...t}));Vo.displayName="SidebarMenuItem";const vw=Me.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),Lo=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?ft.Slot:"button",{isMobile:c,state:d}=tt(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:f(vw({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Da,{children:[a.jsx(Pa,{asChild:!0,children:w}),a.jsx(Nr,{side:"right",align:"center",hidden:d!=="collapsed"||c,...s})]})):w});Lo.displayName="SidebarMenuButton";const Nw=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?ft.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:f("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});Nw.displayName="SidebarMenuAction";const Sw=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:f("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Sw.displayName="SidebarMenuBadge";const Cw=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:f("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(vo,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(vo,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});Cw.displayName="SidebarMenuSkeleton";const Tw=v.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:f("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Tw.displayName="SidebarMenuSub";const Ew=v.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));Ew.displayName="SidebarMenuSubItem";const Aw=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?ft.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:f("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Aw.displayName="SidebarMenuSubButton";const kw=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Co,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(To,{variant:"sidebar",collapsible:"icon",className:f("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(ko,{className:"wu-py-2",children:a.jsx(_o,{})}),t]}),a.jsx(Ao,{className:"wu-contain-inline-size",children:e})]}),_o=e=>{const{state:t,isMobile:n,openMobile:r}=tt();return a.jsx(Eo,{...e,children:a.jsx(Vr,{showMenu:n?r:t==="expanded"})})},Mw=({className:e,children:t,...n})=>{const r=p.useRef(null),s=p.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:c,scrollHeight:d}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+c!==d)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Io,{...n,className:f("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(yt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Iw=e=>a.jsx(Mo,{...e,children:e.children}),Dw=({label:e,children:t,...n})=>a.jsxs(Do,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Po,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Fo,{children:a.jsx(zr,{children:t})})]}),Pw=e=>a.jsx(zr,{...e}),Fw=({Icon:e,children:t,className:n,isActive:r,...s})=>{const{state:o}=tt(),[i,u]=p.useState(),l=No(),c=t&&p.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,a.jsx("span",{className:f("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t.props.children})]})}),d=p.useRef(null);return p.useEffect(()=>{var w;u(((w=d.current)==null?void 0:w.textContent)||"")},[]),a.jsx(Vo,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Lo,{className:f("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:!0,ref:d,children:c})})},Vw=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),qr=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},Lw=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Vw.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},Xt={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},_w=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,c={border:l?`4px solid ${qr(r,Xt.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:qr(r,s*Xt.LIGHTNESS_STEP),fontSize:l?Xt.FONT_SIZE_ACTIVE:Xt.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:qr(r,45+s*6),height:Xt.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:f("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:c,...i,children:[a.jsx("div",{style:d,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},Ow=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(ro,{open:o,onOpenChange:i,children:[a.jsx(so,{className:f("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(Lr,{className:f("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(xt,{}),a.jsx(pa.DialogClose,{className:f("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(re,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(_r,{className:f("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})};function Ww({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=v.useRef(e!==void 0),[o,i]=v.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){v.useEffect(()=>{s!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
8
+ `))},[r,n,e]);const{current:c}=v.useRef(t);v.useEffect(()=>{!s&&JSON.stringify(c)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
9
+ `))},[JSON.stringify(t)])}const l=v.useCallback(c=>{s||i(c)},[]);return[u,l]}const Oo={};function vt(e,t){const n=v.useRef(Oo);return n.current===Oo&&(n.current=e(t)),n}const $r=v[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Bw=$r&&$r!==v.useLayoutEffect?$r:e=>e();function De(e){const t=vt(zw).current;return t.next=e,Bw(t.effect),t.trampoline}function zw(){const e={next:void 0,callback:qw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function qw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const $w=[];function Wo(e){v.useEffect(e,$w)}const Zt=0;class Dn{constructor(){yn(this,"currentId",Zt);yn(this,"clear",()=>{this.currentId!==Zt&&(clearTimeout(this.currentId),this.currentId=Zt)});yn(this,"disposeEffect",()=>this.clear)}static create(){return new Dn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Zt,n()},t)}isStarted(){return this.currentId!==Zt}}function Bo(){const e=vt(Dn.create).current;return Wo(e.disposeEffect),e}const zo=0;class Hr extends Dn{constructor(){super(...arguments);yn(this,"clear",()=>{this.currentId!==zo&&(clearInterval(this.currentId),this.currentId=zo)})}static create(){return new Hr}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function Hw(){const e=vt(Hr.create).current;return Wo(e.disposeEffect),e}const Pe=typeof document<"u"?v.useLayoutEffect:()=>{};function qo(e){const t=vt(Uw,e).current;return t.next=e,Pe(t.effect),t}function Uw(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jw(){const[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}function Ur(e,t,n,r){const s=vt($o).current;return Kw(s,e,t,n,r)&&Ho(s,[e,t,n,r]),s.callback}function Gw(e){const t=vt($o).current;return Yw(t,e)&&Ho(t,e),t.callback}function $o(){return{callback:null,cleanup:null,refs:[]}}function Kw(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function Yw(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Ho(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Xw={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Uo(){return typeof window<"u"}function jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zw(e){return Uo()?e instanceof Element||e instanceof jr(e).Element:!1}function Jw(e){return Uo()?e instanceof HTMLElement||e instanceof jr(e).HTMLElement:!1}function Qw(e){return(e==null?void 0:e.ownerDocument)||document}const Pn=typeof navigator<"u",Gr=nf(),Rw=sf(),ef=rf();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const tf=Gr.platform==="MacIntel"&&Gr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Gr.platform);Pn&&Rw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,ef.includes("jsdom/");function nf(){if(!Pn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function rf(){if(!Pn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function sf(){if(!Pn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Fn(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const Kr=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kr.displayName="NumberFieldRootContext");function Vn(){const e=v.useContext(Kr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Fn(43));return e}function Fe(){}const qe=Object.freeze({});let jo=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const af={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},of={valid(e){return e===null?null:e?{[jo.valid]:""}:{[jo.invalid]:""}}},Go=v.createContext({invalid:void 0,name:void 0,validityData:{state:af,errors:[],error:"",value:"",initialValue:null},setValidityData:Fe,disabled:void 0,touched:!1,setTouched:Fe,dirty:!1,setDirty:Fe,filled:!1,setFilled:Fe,focused:!1,setFocused:Fe,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=qe)=>e,getInputValidationProps:(e=qe)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Go.displayName="FieldRootContext");function Yr(e=!0){const t=v.useContext(Go);if(t.setValidityData===Fe&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fn(28));return t}const uf={...v};let Ko=0;function lf(e,t="mui"){const[n,r]=v.useState(e),s=e||n;return v.useEffect(()=>{n==null&&(Ko+=1,r(`${t}-${Ko}`))},[n,t]),s}const Yo=uf.useId;function cf(e,t){if(Yo!==void 0){const n=Yo();return e??(t?`${t}-${n}`:n)}return lf(e,t)}function df(e){return cf(e,"base-ui")}const Xo=v.createContext({controlId:void 0,setControlId:Fe,labelId:void 0,setLabelId:Fe,messageIds:[],setMessageIds:Fe,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Xo.displayName="LabelableContext");function Zo(){return v.useContext(Xo)}function wf(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,setControlId:o}=Zo(),i=df(t);return Pe(()=>{if(!(!n&&!t||o===Fe)){if(n){const u=r==null?void 0:r.current;Zw(u)&&u.closest("label")!=null?o(t??null):o(s??i)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,r,s,o,n,i]),s??i}const Jt={inputValue:()=>null,value:()=>null},ff=parseInt(v.version,10);function pf(e){return ff>=e}function Jo(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(pf(19)?n==null?void 0:n.ref:t.ref)??null}function Xr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function hf(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function mf(e,t){return typeof e=="function"?e(t):e}function gf(e,t){return typeof e=="function"?e(t):e}const Qt={};function Qo(e,t,n,r,s){let o={...Zr(e,Qt)};return t&&(o=Ln(o,t)),n&&(o=Ln(o,n)),r&&(o=Ln(o,r)),o}function bf(e){if(e.length===0)return Qt;if(e.length===1)return Zr(e[0],Qt);let t={...Zr(e[0],Qt)};for(let n=1;n<e.length;n+=1)t=Ln(t,e[n]);return t}function Ln(e,t){return Ro(t)?t(e):yf(e,t)}function yf(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Xr(e.style,r);break}case"className":{e[n]=ei(e.className,r);break}default:xf(n,r)?e[n]=vf(e[n],r):e[n]=r}}return e}function xf(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Ro(e){return typeof e=="function"}function Zr(e,t){return Ro(e)?e(t):e??Qt}function vf(e,t){return t?e?n=>{if(Nf(n)){const s=n;Jr(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function Jr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ei(e,t){return t?e?t+" "+e:t:e}function Nf(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Rt(e,t,n={}){const r=t.render,s=Sf(t,n);if(n.enabled===!1)return null;const o=n.state??qe;return Cf(e,r,s,o)}function Sf(e,t={}){const{className:n,style:r,render:s}=e,{state:o=qe,ref:i,props:u,stateAttributesMapping:l,enabled:c=!0}=t,d=c?mf(n,o):void 0,w=c?gf(r,o):void 0,h=c?hf(o,l):qe,m=c?Xr(h,Array.isArray(u)?bf(u):u)??qe:qe;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=Gw([m.ref,Jo(s),...i]):m.ref=Ur(m.ref,Jo(s),i):Ur(null,null)),c?(d!==void 0&&(m.className=ei(m.className,d)),w!==void 0&&(m.style=Xr(m.style,w)),m):qe}function Cf(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Qo(n,t.props);return s.ref=n.ref,v.cloneElement(t,s)}if(e&&typeof e=="string")return Tf(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Fn(8))}function Tf(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}const ti=new Map;function en(e,t){const n=JSON.stringify({locale:e,options:t}),r=ti.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return ti.set(n,s),s}function Nt(e,t,n){return e==null?"":en(t,n).format(e)}function ni(e,t,n){return Nt(e,t,{...n,maximumFractionDigits:20})}const Ef=["零","〇","一","二","三","四","五","六","七","八","九"],Af={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},ri=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],si=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Qr=["0","1","2","3","4","5","6","7","8","9"],ai=["%","٪","%","﹪"],oi=["‰","؉"],ii=["−","-","‒","–","—","﹣"],ui=["+","﹢"],kf=".",Mf=",",If=new RegExp(`[${ri.join("")}]`,"g"),Df=new RegExp(`[${si.join("")}]`,"g"),Pf=new RegExp(`[${Qr.join("")}]`,"g"),Ff=new RegExp(`[${Ef.join("")}]`,"g"),Vf=new RegExp(`[${ai.join("")}]`),Lf=new RegExp(`[${oi.join("")}]`),Rr=/[٠١٢٣٤٥٦٧٨٩]/,li=/[۰۱۲۳۴۵۶۷۸۹]/,es=/[零〇一二三四五六七八九]/,ci=new RegExp(`[${Qr.join("")}]`),_f=[".",",",kf,Mf,"٫","٬"],di=new RegExp("\\p{Zs}","u"),Of=["+",...ui],Wf=["-",...ii],_n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Bf=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),wi=e=>`[${e.map(Bf).join("")}]`,fi=wi(["-"].concat(ii)),pi=wi(["+"].concat(ui)),hi=new RegExp(fi,"gu"),mi=new RegExp(pi,"gu"),tn=new RegExp(fi),On=new RegExp(pi);function ts(e,t){const n=en(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),en(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function St(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(hi,"-").replace(mi,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Rr.test(r)||li.test(r)?u="ar":es.test(r)&&(u="zh"));const{group:l,decimal:c,currency:d}=ts(u,n),w=en(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>_n(A.value)),h=w.length?new RegExp(w.join("|"),"g"):null;let m=null;l&&(new RegExp("\\p{Zs}","u").test(l)?m=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?m=/['’]/g:m=new RegExp(_n(l),"g"));let g=[{regex:l?m:null,replacement:""},{regex:c?new RegExp(_n(c),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(_n(d),"g"):null,replacement:""},{regex:h,replacement:""},{regex:If,replacement:A=>String(ri.indexOf(A))},{regex:Df,replacement:A=>String(si.indexOf(A))},{regex:Pf,replacement:A=>String(Qr.indexOf(A))},{regex:Ff,replacement:A=>Af[A]}].reduce((A,{regex:k,replacement:D})=>k?A.replace(k,D):A,r);const x=g.lastIndexOf(".");if(x!==-1&&(g=`${g.slice(0,x).replace(/\./g,"")}.${g.slice(x+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const S=(s?"-":"")+g;let y=parseFloat(S);const N=n==null?void 0:n.style,C=N==="unit"&&(n==null?void 0:n.unit)==="percent",E=Vf.test(e)||N==="percent";return Lf.test(e)?y/=1e3:!C&&E&&(y/=100),Number.isNaN(y)?null:y}const zf=60,qf=400,$f=50,Hf=3,Uf=8,Wn=1;function jf(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Gf=1e-10;function Kf(e){const t=en("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Yf(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function ns(e,t){const{maximumFractionDigits:n}=Kf(t);return Yf(e,n)}function Xf(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Gf*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let c;return r==="nearest"?c=Math.round(l):o>0?c=Math.floor(l):c=Math.ceil(l),t+c*(r==="nearest"?n:s)}function Zf(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u}){if(e===null)return e;const l=jf(e,n,r);if(t!=null&&i){if(t===0)return ns(l,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const d=Xf(l,c,t,u?"nearest":"directional");return ns(d,o)}return ns(l,o)}const Jf="none",gi="input-change",rs="input-clear",bi="input-blur",Qf="input-paste",nn="keyboard";function Ve(e,t,n,r){let s=!1,o=!1;const i=r??qe;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function rn(e,t,n){const r=qe;return{reason:e,event:t??new Event("base-ui"),...r}}const yi=v.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:c=!1,disabled:d=!1,readOnly:w=!1,name:h,defaultValue:m,value:b,onValueChange:g,onValueCommitted:x,allowWheelScrub:S=!1,snapOnStep:y=!1,format:N,locale:C,render:E,className:M,inputRef:A,...k}=t,{setDirty:D,validityData:F,disabled:V,setFilled:$,invalid:W,name:G,state:q,validation:ue,shouldValidateOnChange:I}=Yr(),_=V||d,z=G??h,[B,ne]=v.useState(!1),ae=s??Number.MIN_SAFE_INTEGER,xe=o??Number.MAX_SAFE_INTEGER,He=s??0,j=N==null?void 0:N.style,P=v.useRef(null),U=Ur(A,ue.inputRef),Z=wf({id:r}),[O,R]=Ww({controlled:b,default:m,name:"NumberField",state:"value"}),H=O??null,be=qo(H);Pe(()=>{$(H!==null)},[$,H]);const ve=jw(),Ne=qo(N),me=v.useRef(!1),Oe=De((J,Y)=>{me.current=!1,x==null||x(J,Y)}),Ge=Bo(),Vt=Hw(),Lt=Bo(),ir=v.useRef(!1),ur=v.useRef(0),ct=v.useRef(!0),_t=v.useRef(null),dt=v.useRef(()=>{}),[oe,Ue]=v.useState(()=>b!==void 0?xi(H,C,N):Nt(H,C,N)),[lr,uy]=v.useState("numeric"),cc=De(()=>{const{decimal:J,group:Y,currency:le,literal:fe}=ts(C,N),ee=new Set;_f.forEach(Ee=>ee.add(Ee)),J&&ee.add(J),Y&&(ee.add(Y),di.test(Y)&&ee.add(" "));const We=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="percent",bn=j==="percent"||j==="unit"&&(N==null?void 0:N.unit)==="permille";return We&&ai.forEach(Ee=>ee.add(Ee)),bn&&oi.forEach(Ee=>ee.add(Ee)),j==="currency"&&le&&ee.add(le),fe&&(Array.from(fe).forEach(Ee=>ee.add(Ee)),di.test(fe)&&ee.add(" ")),Of.forEach(Ee=>ee.add(Ee)),ae<0&&Wf.forEach(Ee=>ee.add(Ee)),ee}),Ot=De(J=>J!=null&&J.altKey?i:J!=null&&J.shiftKey?l:u),cr=De((J,Y)=>{const le=Y.event,fe=Y.direction,ee=Zf(J,{step:fe?Ot(le)*fe:void 0,format:Ne.current,minWithDefault:ae,maxWithDefault:xe,minWithZeroDefault:He,snapOnStep:y,small:(le==null?void 0:le.altKey)??!1});if(ee!==H||J!==H||ct.current===!1){if(_t.current=ee,g==null||g(ee,Y),Y.isCanceled)return;R(ee),D(ee!==F.initialValue),me.current=!0}ct.current&&Ue(Nt(ee,C,N)),ve()}),gn=De((J,{direction:Y,currentValue:le,event:fe,reason:ee})=>{const We=le??be.current,bn=typeof We=="number"?We+J*Y:Math.max(0,s??0);cr(bn,Ve(ee,fe,void 0,{direction:Y}))}),Wt=De(()=>{Lt.clear(),Ge.clear(),Vt.clear(),dt.current(),ur.current=0}),dc=De((J,Y)=>{if(Wt(),!P.current)return;const le=jr(P.current);function fe(We){We.preventDefault()}le.addEventListener("contextmenu",fe),dt.current=()=>{le.removeEventListener("contextmenu",fe)},le.addEventListener("pointerup",We=>{ir.current=!1,Wt();const bn=_t.current??be.current;Oe(bn,rn(J?"increment":"decrement",We))},{once:!0});function ee(){const We=Ot(Y)??Wn;gn(We,{direction:J?1:-1,event:Y,reason:J?"increment-press":"decrement-press"})}ee(),Ge.start(qf,()=>{Vt.start(zf,ee)})});Pe(function(){if(!ct.current)return;const Y=b!==void 0?xi(H,C,N):Nt(H,C,N);Y!==oe&&Ue(Y)}),Pe(function(){if(!tf)return;let Y="text";ae>=0&&(Y="decimal"),uy(Y)},[ae,j]),v.useEffect(()=>()=>Wt(),[Wt]),v.useEffect(function(){const Y=P.current;if(_||w||!S||!Y)return;function le(fe){if(fe.ctrlKey||Qw(P.current).activeElement!==P.current)return;fe.preventDefault();const ee=Ot(fe)??Wn;gn(ee,{direction:fe.deltaY>0?-1:1,event:fe,reason:"wheel"})}return Y.addEventListener("wheel",le),()=>{Y.removeEventListener("wheel",le)}},[S,gn,_,w,l,u,Ot]);const wa=v.useMemo(()=>({...q,disabled:_,readOnly:w,required:c,value:H,inputValue:oe,scrubbing:B}),[q,_,w,c,H,oe,B]),ly=v.useMemo(()=>({inputRef:P,inputValue:oe,value:H,startAutoChange:dc,stopAutoChange:Wt,minWithDefault:ae,maxWithDefault:xe,disabled:_,readOnly:w,id:Z,setValue:cr,incrementValue:gn,getStepAmount:Ot,allowInputSyncRef:ct,formatOptionsRef:Ne,valueRef:be,lastChangedValueRef:_t,hasPendingCommitRef:me,isPressedRef:ir,intentionalTouchCheckTimeout:Lt,movesAfterTouchRef:ur,name:z,required:c,invalid:W,inputMode:lr,getAllowedNonNumericKeys:cc,min:s,max:o,setInputValue:Ue,locale:C,isScrubbing:B,setIsScrubbing:ne,state:wa,onValueCommitted:Oe}),[P,oe,H,dc,Wt,ae,xe,_,w,Z,cr,gn,Ot,Ne,be,Lt,z,c,W,lr,cc,s,o,Ue,C,B,wa,Oe]),cy=Rt("div",t,{ref:n,state:wa,props:k,stateAttributesMapping:Jt});return a.jsxs(Kr.Provider,{value:ly,children:[cy,a.jsx("input",{...ue.getInputValidationProps({onChange(J){if(J.nativeEvent.defaultPrevented)return;const Y=J.currentTarget.valueAsNumber,le=Number.isNaN(Y)?null:Y,fe=Ve(Jf,J.nativeEvent);D(le!==F.initialValue),cr(le,fe),I()&&ue.commit(le)}}),ref:U,type:"number",name:z,value:H??"",min:s,max:o,step:u,disabled:_,required:c,"aria-hidden":!0,tabIndex:-1,style:Xw})]})});process.env.NODE_ENV!=="production"&&(yi.displayName="NumberFieldRoot");function xi(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Nt(e,t,n):ni(e,t,n)}const vi=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=Vn();return Rt("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(vi.displayName="NumberFieldGroup");let ss;process.env.NODE_ENV!=="production"&&(ss=new Set);function Ni(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ss.has(t)||(ss.add(t),console.error(`Base UI: ${t}`))}}const Si=v.createContext(void 0);process.env.NODE_ENV!=="production"&&(Si.displayName="CompositeRootContext");function Rf(e=!1){const t=v.useContext(Si);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Fn(16));return t}function ep(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:v.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||u)&&(c.disabled=n),c},[r,n,t,i,u,o,s])}}function Ci(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,o=v.useRef(null),i=Rf(!0)!==void 0,u=De(()=>{const h=o.current;return!!((h==null?void 0:h.tagName)==="A"&&(h!=null&&h.href))}),{props:l}=ep({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&v.useEffect(()=>{if(!o.current)return;const h=o.current.tagName==="BUTTON";s?h||Ni("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):h&&Ni("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[s]);const c=v.useCallback(()=>{const h=o.current;tp(h)&&i&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,i]);Pe(c,[c]);const d=v.useCallback((h={})=>{const{onClick:m,onMouseDown:b,onKeyUp:g,onKeyDown:x,onPointerDown:S,...y}=h;return Qo({type:s?"button":void 0,onClick(C){if(t){C.preventDefault();return}m==null||m(C)},onMouseDown(C){t||b==null||b(C)},onKeyDown(C){if(t||(Jr(C),x==null||x(C)),C.baseUIHandlerPrevented)return;const E=C.target===C.currentTarget&&!s&&!u()&&!t,M=C.key==="Enter",A=C.key===" ";E&&((A||M)&&C.preventDefault(),M&&(m==null||m(C)))},onKeyUp(C){t||(Jr(C),g==null||g(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!s&&!t&&C.key===" "&&(m==null||m(C))},onPointerDown(C){if(t){C.preventDefault();return}S==null||S(C)}},s?void 0:{role:"button"},l,y)},[t,l,s,u]),w=De(h=>{o.current=h,c()});return{getButtonProps:d,buttonRef:w}}function tp(e){return Jw(e)&&e.tagName==="BUTTON"}function Ti(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:c,isIncrement:d,isPressedRef:w,locale:h,maxWithDefault:m,minWithDefault:b,movesAfterTouchRef:g,readOnly:x,setValue:S,startAutoChange:y,stopAutoChange:N,value:C,valueRef:E,lastChangedValueRef:M,onValueCommitted:A}=e,k=v.useRef({x:0,y:0}),D=v.useRef(!1),F=v.useRef(!1),V=v.useRef(""),$=C!=null&&C<=b,W=C!=null&&C>=m,G=d?"increment-press":"decrement-press";function q(I){t.current=!0;const _=St(l,h,r.current);_!==null&&(E.current=_,S(_,Ve(G,I,void 0,{direction:d?1:-1})))}return{disabled:n||(d?W:$),"aria-readonly":x||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(I){const _=n||x||(d?W:$);if(I.defaultPrevented||_||(V.current==="touch"?F.current:I.detail!==0))return;q(I.nativeEvent);const z=s(I)??Wn,B=E.current;i(z,{direction:d?1:-1,event:I.nativeEvent,reason:G});const ne=M.current??E.current;ne!==B&&A(ne,rn(G,I.nativeEvent))},onPointerDown(I){var B;const _=!I.button||I.button===0,z=n||(d?W:$);I.defaultPrevented||x||!_||z||(V.current=I.pointerType,F.current=!1,w.current=!0,k.current={x:I.clientX,y:I.clientY},q(I.nativeEvent),I.pointerType!=="touch"?(I.preventDefault(),(B=u.current)==null||B.focus(),y(d,I)):c.start($f,()=>{const ne=g.current;g.current=0,w.current&&ne!=null&&ne<Hf?(y(d,I),F.current=!0):(F.current=!1,N())}))},onPointerUp(I){I.pointerType==="touch"&&(w.current=!1)},onPointerMove(I){if(n||x||(d?W:$)||I.pointerType!=="touch"||!w.current)return;g.current!=null&&(g.current+=1);const{x:z,y:B}=k.current,ne=z-I.clientX,ae=B-I.clientY;ne**2+ae**2>Uf**2&&N()},onMouseEnter(I){const _=n||x||(d?W:$);I.defaultPrevented||_||!w.current||D.current||V.current==="touch"||y(d,I)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Ei=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,locale:y,maxWithDefault:N,minWithDefault:C,movesAfterTouchRef:E,readOnly:M,setValue:A,startAutoChange:k,state:D,stopAutoChange:F,value:V,valueRef:$,lastChangedValueRef:W,onValueCommitted:G}=Vn(),q=o||c,ue=Ti({isIncrement:!0,inputRef:b,startAutoChange:k,stopAutoChange:F,minWithDefault:C,maxWithDefault:N,value:V,inputValue:g,disabled:q,readOnly:M,id:h,setValue:A,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:$,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:E,locale:y,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Ci({disabled:q,native:i}),z=v.useMemo(()=>({...D,disabled:q}),[D,q]);return Rt("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(Ei.displayName="NumberFieldIncrement");const Ai=v.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:c,formatOptionsRef:d,getStepAmount:w,id:h,incrementValue:m,inputRef:b,inputValue:g,intentionalTouchCheckTimeout:x,isPressedRef:S,maxWithDefault:y,minWithDefault:N,movesAfterTouchRef:C,readOnly:E,setValue:M,startAutoChange:A,state:k,stopAutoChange:D,value:F,valueRef:V,locale:$,lastChangedValueRef:W,onValueCommitted:G}=Vn(),q=o||c,ue=Ti({isIncrement:!1,inputRef:b,startAutoChange:A,stopAutoChange:D,minWithDefault:N,maxWithDefault:y,value:F,inputValue:g,disabled:q,readOnly:E,id:h,setValue:M,getStepAmount:w,incrementValue:m,allowInputSyncRef:l,formatOptionsRef:d,valueRef:V,isPressedRef:S,intentionalTouchCheckTimeout:x,movesAfterTouchRef:C,locale:$,lastChangedValueRef:W,onValueCommitted:G}),{getButtonProps:I,buttonRef:_}=Ci({disabled:q,native:i}),z=v.useMemo(()=>({...k,disabled:q}),[k,q]);return Rt("button",t,{ref:[n,_],state:z,props:[ue,u,I],stateAttributesMapping:Jt})});process.env.NODE_ENV!=="production"&&(Ai.displayName="NumberFieldDecrement");function np(e){e.preventDefault(),e.stopPropagation()}function rp(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const ki=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Fe,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(ki.displayName="FormContext");function Mi(){return v.useContext(ki)}function sp(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:o,commit:i}=e,{formRef:u}=Mi(),{invalid:l,markedDirtyRef:c,validityData:d,setValidityData:w}=Yr(),h=De(e.getValue);Pe(()=>{if(!t)return;let m=n;m===void 0&&(m=h()),d.initialValue===null&&m!==null&&w(b=>({...b,initialValue:m}))},[t,w,n,d.initialValue,h]),Pe(()=>{!t||!r||u.current.fields.set(r,{getValue:h,name:s,controlRef:o,validityData:rp(d,l),validate(){let m=n;m===void 0&&(m=h()),c.current=!0,Fc.flushSync(()=>i(m))}})},[i,o,t,u,h,r,l,c,s,d,n]),Pe(()=>{const m=u.current.fields;return()=>{r&&m.delete(r)}},[u,r])}function ap(e,t){const n=v.useRef(e),r=De(t);Pe(()=>{n.current!==e&&r(n.current)},[e,r]),Pe(()=>{n.current=e},[e])}const op={...of,...Jt},ip=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ii=v.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:c,getStepAmount:d,id:w,incrementValue:h,inputMode:m,inputValue:b,max:g,min:x,name:S,readOnly:y,required:N,setValue:C,state:E,setInputValue:M,locale:A,inputRef:k,value:D,onValueCommitted:F,lastChangedValueRef:V,hasPendingCommitRef:$,valueRef:W}=Vn(),{clearErrors:G}=Mi(),{validationMode:q,setTouched:ue,setFocused:I,invalid:_,shouldValidateOnChange:z,validation:B}=Yr(),{labelId:ne}=Zo(),ae=v.useRef(!1),xe=v.useRef(!1);return sp({id:w,commit:B.commit,value:D,controlRef:k,name:S,getValue:()=>D??null}),ap(D,P=>{const U=z();if(G(S),U&&B.commit(D),!(P===D||U)){if(xe.current){xe.current=!1;return}B.commit(D,!0)}}),Rt("input",t,{ref:[n,k],state:E,props:[{id:w,required:N,disabled:u,readOnly:y,inputMode:m,value:b,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":_||void 0,"aria-labelledby":ne,suppressHydrationWarning:!0,onFocus(P){if(P.defaultPrevented||y||u||ae.current)return;ae.current=!0,I(!0);const U=P.currentTarget,Z=U.value.length;U.setSelectionRange(Z,Z)},onBlur(P){if(P.defaultPrevented||y||u)return;ue(!0),I(!1);const U=!i.current,Z=$.current;if(i.current=!0,b.trim()===""){C(null,Ve(rs,P.nativeEvent)),q==="onBlur"&&B.commit(null),F(null,rn(rs,P.nativeEvent));return}const O=l.current,R=St(b,A,O);if(R===null)return;const H=(O==null?void 0:O.maximumFractionDigits)!=null||(O==null?void 0:O.minimumFractionDigits)!=null,be=O==null?void 0:O.maximumFractionDigits,ve=H&&typeof be=="number"?Number(R.toFixed(be)):R,Ne=rn(bi,P.nativeEvent),me=D!==ve,Oe=U||me||Z;q==="onBlur"&&B.commit(ve),me&&(xe.current=!0,C(ve,Ve(bi,P.nativeEvent))),Oe&&F(ve,Ne);const Ge=Nt(ve,A,O),Vt=ni(R,A,O);!(!H&&R===D&&b===Vt)&&b!==Ge&&M(Ge)},onChange(P){if(P.nativeEvent.defaultPrevented)return;i.current=!1;const U=P.target.value;if(U.trim()===""){M(U),C(null,Ve(rs,P.nativeEvent));return}const Z=c();if(!Array.from(U).every(H=>{const be=H>="0"&&H<="9",ve=Rr.test(H),Ne=es.test(H),me=li.test(H),Oe=ci.test(H),Ge=tn.test(H);return be||ve||Ne||me||Oe||Ge||Z.has(H)}))return;if(P.isTrusted){M(U);const H=St(U,A,l.current);H!==null&&C(H,Ve(gi,P.nativeEvent));return}const R=St(U,A,l.current);R!==null&&(M(U),C(R,Ve(gi,P.nativeEvent)))},onKeyDown(P){if(P.defaultPrevented||y||u)return;const U=P.nativeEvent;i.current=!0;const Z=c();let O=Z.has(P.key);const{decimal:R,currency:H,percentSign:be}=ts(A,l.current),ve=P.currentTarget.selectionStart,Ne=P.currentTarget.selectionEnd,me=ve===0&&Ne===b.length,Oe=oe=>ve!=null&&Ne!=null&&oe>=ve&&oe<Ne;if(tn.test(P.key)&&Array.from(Z).some(oe=>tn.test(oe||""))){const oe=b.search(hi),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(tn.test(b)||On.test(b))||me||Ue}if(On.test(P.key)&&Array.from(Z).some(oe=>On.test(oe||""))){const oe=b.search(mi),Ue=oe!=null&&oe!==-1&&Oe(oe);O=!(tn.test(b)||On.test(b))||me||Ue}[R,H,be].forEach(oe=>{if(P.key===oe){const Ue=b.indexOf(oe),lr=Oe(Ue);O=!b.includes(oe)||me||lr}});const Ge=P.key>="0"&&P.key<="9",Vt=Rr.test(P.key),Lt=es.test(P.key),ir=ci.test(P.key),ur=ip.has(P.key);if(P.which===229||P.altKey||P.ctrlKey||P.metaKey||O||Ge||Vt||ir||Lt||ur)return;const ct=St(b,A,l.current),_t=d(P)??Wn;np(P);const dt=rn(nn,U);P.key==="ArrowUp"?(h(_t,{direction:1,currentValue:ct,event:U,reason:nn}),F(V.current??W.current,dt)):P.key==="ArrowDown"?(h(_t,{direction:-1,currentValue:ct,event:U,reason:nn}),F(V.current??W.current,dt)):P.key==="Home"&&x!=null?(C(x,Ve(nn,U)),F(V.current??W.current,dt)):P.key==="End"&&g!=null&&(C(g,Ve(nn,U)),F(V.current??W.current,dt))},onPaste(P){if(P.defaultPrevented||y||u)return;P.preventDefault();const Z=(P.clipboardData||window.Clipboard).getData("text/plain"),O=St(Z,A,l.current);O!==null&&(i.current=!1,C(O,Ve(Qf,P.nativeEvent)),M(Z))}},B.getValidationProps(),o],stateAttributesMapping:op})});process.env.NODE_ENV!=="production"&&(Ii.displayName="NumberFieldInput");const up={wuStepper:"_wuStepper_apbnq_1"},lp=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:c,labelPosition:d="left",disabled:w,resetInvalidValueOnBlur:h=!0,...m})=>{const b=v.useId(),[g,x]=v.useState(l!==void 0?Number(l):n||0);v.useEffect(()=>{l!==void 0&&x(Number(l))},[l]);const S=A=>{x(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||x(k)},N=()=>{h&&(i!==void 0&&g<i?(x(i),e==null||e(i)):u!==void 0&&g>u&&(x(u),e==null||e(u)))};v.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const C={inc:r||u!==void 0&&g>=u||w,dec:r||i!==void 0&&g<=i||w},E=i!==void 0&&g<i||u!==void 0&&g>u,M=f("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(yi,{id:b,value:g,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&S(A),dir:s,className:f("wu-flex wu-stepper",s==="rtl"&&d!=="top"&&"wu-gap-2",up.wuStepper,cp({labelPosition:d}),c),children:[t&&a.jsx(Ce,{htmlFor:b,className:"wu-input-label",children:t}),a.jsxs(vi,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Ai,{"aria-label":"decrement",className:f(M,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:C.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ii,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":E||void 0,dir:s,className:f("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",E&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:N,disabled:w,min:i,max:u,step:o,value:g,...m}),a.jsx(Ei,{"aria-label":"increment",className:f(M,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:C.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},cp=Me.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}}),Di=Me.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),dp=v.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(ba.Root,{ref:s,className:f(Di({variant:t,size:n,className:e})),...r}));dp.displayName=ba.Root.displayName;const Pi=v.createContext({size:"default",variant:"default"}),Bn=v.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(xn.Root,{ref:o,className:f("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Pi.Provider,{value:{variant:t,size:n},children:r})}));Bn.displayName=xn.Root.displayName;const nt=v.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=v.useContext(Pi);return a.jsx(xn.Item,{ref:o,className:f(Di({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});nt.displayName=xn.Item.displayName;const Fi=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>f("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:f("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(nt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(nt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Fi.displayName="_IconTab";const Vi=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=c=>f("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",c===r&&"wu-text-white wu-font-medium",s&&r===c&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:f("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:f("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(nt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(nt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Vi.displayName="_Tab";const Li=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>f("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=f("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=f("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),d=f("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(Bn,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(nt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:c,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(nt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});Li.displayName="_Toggle";const _i=p.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:c=!0,...d}=e,[w,h]=p.useState(),m=b=>{let g=w;b!==""?g=b:c&&(g=w==="opt1"?"opt2":"opt1");const x=g==="opt1"?r[0].value:r[1].value;l&&l(x),h(g)};if(p.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");h(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Li,{...d,ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});case"iconTab":return a.jsx(Fi,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i});default:return a.jsx(Vi,{ref:t,options:r,value:w||"opt1",onChange:m,disabled:o,dir:i,size:u})}});_i.displayName="WuSwitcher";const Oi=Re.Root,as=v.forwardRef(({className:e,children:t,...n},r)=>a.jsx(Re.List,{className:f("wu-relative wu-flex",e),...n,ref:r,children:t}));as.displayName=Re.List.displayName;const os=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Trigger,{ref:n,className:f("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));os.displayName=Re.Trigger.displayName;const Wi=v.forwardRef(({className:e,...t},n)=>a.jsx(Re.Content,{ref:n,className:e,...t}));Wi.displayName=Re.Content.displayName;const Bi=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:f("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx(Wi,{value:r.value,forceMount:t||void 0,className:f("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},wp=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return p.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:c,behavior:"smooth"})}}}},zi=(e,t)=>{const[n,r]=p.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return p.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const c={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(c)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},fp=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var N;const l=p.useRef(null),c=zi(l,"horizontal"),{showLeftArrow:d,showRightArrow:w,scrollByTab:h}=wp(l),[m,b]=p.useState(!1),g=()=>h("left"),x=()=>h("right"),S=C=>a.jsx("div",{"data-testid":`gradient-overlay-${C}`,className:f("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",C==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="left";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",M&&"wu-translate-x-0 wu-opacity-100",!M&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Oi,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:f("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("left"),y(g,"left",d&&m),a.jsxs(as,{ref:l,className:f("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(os,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&m&&S("right"),y(x,"right",w&&m)]}),a.jsx(Bi,{items:e,enableAnimation:s})]})},pp=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return p.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const c=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:c,behavior:"smooth"})}}}},hp=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var N;const l=p.useRef(null),c=zi(l,"vertical"),{showTopArrow:d,showBottomArrow:w,scrollByTab:h}=pp(l),[m,b]=p.useState(!1),g=()=>h("up"),x=()=>h("down"),S=C=>a.jsx("div",{className:f("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",C==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(C,E,M)=>{const A=E==="up";return a.jsx("button",{onClick:C,className:f("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",M&&"wu-translate-y-0 wu-opacity-100",!M&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:f("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Oi,{defaultValue:n||((N=e[0])==null?void 0:N.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:f("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[d&&m&&S("top"),y(g,"up",d&&m),a.jsxs(as,{ref:l,className:f("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(C=>a.jsx(os,{value:C.value,children:C.Trigger},C.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:c.height,top:c.top}})]}),w&&m&&S("bottom"),y(x,"down",w&&m)]}),a.jsx(Bi,{items:e,enableAnimation:s})]})},mp=({...e})=>e.orientation==="vertical"?a.jsx(hp,{...e}):a.jsx(fp,{...e}),is=v.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:f("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));is.displayName="Table";const qi=v.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:f("[&_tr]:wu-border-b",e),...t}));qi.displayName="TableHeader";const $i=v.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:f("",e),...t}));$i.displayName="TableBody";const gp=v.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:f("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));gp.displayName="TableFooter";const sn=v.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:f("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));sn.displayName="TableRow";const us=v.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:f("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));us.displayName="TableHead";const zn=v.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:f("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));zn.displayName="TableCell";const ls=v.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:f("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));ls.displayName="TableCaption";const bp=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o}=t||{},i=p.useCallback(l=>c=>{s(()=>c?l:[])},[s]);return{finalColumns:p.useMemo(()=>n?[{id:"select",header:({table:l})=>{const c=l.getRowModel().rows.map(w=>w.original),d=i(c);return a.jsx(Ae,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:w=>{l.toggleAllRowsSelected(!!w),d(!!w)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ae,{checked:l.getIsSelected(),onChange:c=>{l.toggleSelected(!!c)},"aria-label":String(l.original[o])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,i])}};function Hi({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=bp({columns:t,rowSelection:n}),s=p.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const Ui=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s})=>{var u;const[o,i]=p.useState(null);return a.jsx($i,{children:r?a.jsx(sn,{children:a.jsx(zn,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s||a.jsx(gt,{className:"wu-w-full"})})}):(u=e.getRowModel().rows)!=null&&u.length?e.getRowModel().rows.map((l,c)=>a.jsx(sn,{"data-state":l.getIsSelected()&&"selected",onMouseOver:()=>i(l.id),onMouseOut:()=>i(null),className:f("wu-transition-colors wu-border-b wu-border-black/[12%]",l.getIsSelected()?o===l.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:l.getVisibleCells().map((d,w)=>a.jsx(zn,{className:f("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",d.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===l.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":"",d.column.columnDef.cellAlign==="right"&&"wu-text-right",d.column.columnDef.cellAlign==="center"&&"wu-text-center",d.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:Be.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${w}`))},`${l.id}-${c}`)):a.jsx(sn,{children:a.jsx(zn,{colSpan:e.getAllColumns().length,children:n})})})},ji=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u})=>{const l=s==="compact"?"wu-h-8":"wu-h-10",c=d=>{const{id:w,columnDef:h,getIsSorted:m,toggleSorting:b}=d,{header:g}=h;if(!t.includes(w))return g;const x=m(),S=x==="asc",y=x==="desc",N=()=>{n?(b(!y),r==null||r({id:w,desc:y})):b(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:N,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:f("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",S&&"wu-hidden",!x&&"-wu-top-[11px]")}),a.jsx("span",{className:f("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!x&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(qi,{className:f("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",l),children:[e.getHeaderGroups().map(d=>a.jsx(sn,{className:"wu-relative",children:d.headers.map(w=>w.column.id==="actions"?a.jsx(us,{colSpan:w.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${w.getSize()}px`}},w.id):a.jsx(us,{colSpan:w.colSpan,className:f("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",w.column.columnDef.headerAlign==="right"&&"wu-text-right",w.column.columnDef.headerAlign==="center"&&"wu-text-center",w.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${w.getSize()}px`},children:Be.flexRender(c(w.column),w.getContext())},w.id))},d.id)),o&&i&&a.jsxs("div",{className:f("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",l),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:a.jsx(Ae,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:d=>{e.toggleAllRowsSelected(!!d)},"aria-label":"Select all"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})]})},Gi=Me.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),yp=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:c=!1,CustomLoader:d,caption:w,...h})=>{var N;const{finalColumns:m,rowSelectionState:b}=Hi({data:e,columns:t,rowSelection:i}),g=p.useMemo(()=>m.filter(C=>C.enableSorting).map(C=>C.accessorKey),[m]),x=((N=i==null?void 0:i.selectedRows)==null?void 0:N.length)??0,S=C=>{if(typeof C=="function"){const E=C(b),M=Object.keys(E).filter(A=>E[Number(A)]).map(A=>e[Number(A)]);i==null||i.onRowSelect(M)}},y=Be.useReactTable({data:e,columns:m,getCoreRowModel:Be.getCoreRowModel(),getPaginationRowModel:Be.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i==null?void 0:i.isEnabled,state:{...i!=null&&i.isEnabled?{rowSelection:b}:{}},onRowSelectionChange:S});return a.jsxs("div",{className:f("wu-text-gray-lead wu-table-container wu-relative"),children:[w&&a.jsx(ls,{className:"wu-font-light",children:w}),a.jsxs(is,{...h,className:f(Gi({variant:r}),h.className),children:[a.jsx(ji,{table:y,sortableColumns:g,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:x>0,isStickyHeader:c}),!n&&a.jsx(Ui,{table:y,size:o,NoDataContent:l,CustomLoader:d})]}),n&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(gt,{})})]})},xp=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:c,NoDataContent:d,isLoading:w,caption:h,rowSelection:m,...b})=>{var $;const[g,x]=p.useState((s==null?void 0:s.initial)||[]),[S,y]=p.useState([]),[N,C]=p.useState((i==null?void 0:i.pageIndex)??0),{finalColumns:E,rowSelectionState:M}=Hi({data:e,columns:t,rowSelection:m}),A=p.useMemo(()=>E.filter(W=>W.enableSorting).map(W=>W.accessorKey),[E]),k=p.useMemo(()=>E.filter(W=>W.filterable).map(W=>W.accessorKey),[E]),D=(($=m==null?void 0:m.selectedRows)==null?void 0:$.length)??0,F=W=>{const G=typeof W=="function"?W(M):W,q=Object.keys(G).filter(ue=>G[Number(ue)]).map(ue=>e[Number(ue)]);m==null||m.onRowSelect(q)},V=Be.useReactTable({data:e,columns:E,getCoreRowModel:Be.getCoreRowModel(),getFilteredRowModel:Be.getFilteredRowModel(),getSortedRowModel:Be.getSortedRowModel(),getPaginationRowModel:i?Be.getPaginationRowModel():void 0,state:{sorting:g,columnFilters:S,...i?{pagination:i}:{},...m!=null&&m.isEnabled?{rowSelection:M}:{}},onSortingChange:x,onColumnFiltersChange:y,onRowSelectionChange:F});return p.useEffect(()=>{k.forEach(W=>{var G;(G=V.getColumn(W))==null||G.setFilterValue(o)})},[o,k,V]),p.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==N&&(m==null||m.onRowSelect(()=>[]),V.resetRowSelection(),C(i.pageIndex))},[i==null?void 0:i.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(is,{...b,className:f("wu-overflow-x-auto wu-w-full",Gi({variant:n}),"wu-table-fixed",b.className),children:[h&&a.jsx(ls,{children:h}),a.jsx(ji,{table:V,sortableColumns:A,size:r,HeaderAction:l,isRowSelected:D>0,isStickyHeader:u}),a.jsx(Ui,{table:V,size:r,NoDataContent:d,CustomLoader:c,isLoading:w})]})})},Ki=v.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:f("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));Ki.displayName="Textarea";const Yi=p.forwardRef((e,t)=>{const{Label:n,id:r=vn(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,c=w=>{l.onChange&&l.onChange(w)},d=Ut(u);return a.jsxs("div",{className:f(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(Ki,{...l,ref:t,id:r,className:f("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:c,readOnly:o,maxLength:i}),n&&a.jsx(Ce,{htmlFor:r,className:"wu-textarea-label",children:n})]})});Yi.displayName="WuTextarea";function vp(e){if(typeof e=="string"&&e.includes("T")){const t=K.parseISO(e);return K.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=K.parse(e,"HH:mm:ss",new Date);return K.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Xi=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Zi=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Ji=["am","pm"],qn=50;function Np(e){return Array(qn).fill(e).flat()}function cs(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function Sp(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function Qi(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const Cp=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:f("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),ds=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:f("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?Np(e):e).map((i,u)=>a.jsx(Cp,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function Tp(e,t,n,r){const s=p.useMemo(()=>e?cs(Xi,t.padStart(2,"0")):Xi,[e]),o=p.useMemo(()=>e?cs(Zi,n.padStart(2,"0")):Zi,[e]),i=p.useMemo(()=>e?cs(Ji,r):Ji,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function Ep(e,t,n){p.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/qn,l=Math.floor(qn/2);i.scrollTop=l*u;const c=()=>{const{scrollTop:d}=i,w=Math.round(d/u);(w<=1||w>=qn-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",c),()=>{i.removeEventListener("scroll",c)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const Ri=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=p.useState(!1),[l,c]=p.useState(""),d=p.useRef(null),w=p.useRef(null),h=p.useRef(null),m=p.useRef(null),[b,g]=p.useState("12"),[x,S]=p.useState("00"),[y,N]=p.useState("am");p.useEffect(()=>{if(!t){c(""),g("12"),S("00"),N("am"),d.current&&(d.current.value="");return}const k=vp(t);c(k);const[D,F]=k.split(":"),{hour:V,meridiem:$}=Qi(D);g(V),S(F),N($),d.current&&(d.current.value=k)},[t]),p.useEffect(()=>{const k=D=>{w.current&&!w.current.contains(D.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),Ep(i,h,m);const{rotatedHours:C,rotatedMinutes:E,rotatedMeridiem:M}=Tp(i,b,x,y),A=p.useCallback((k,D,F)=>{const V=k??b,$=D??x,W=F??y;g(V),S($),N(W);const G=`${Sp(V,W)}:${$}`;c(G)},[b,x,y]);return a.jsxs("div",{className:f("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(Ce,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:f("relative inline-block"),ref:w,dir:s,children:[a.jsx(Te,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{c(k.target.value);const[D,F]=k.target.value.split(":"),{hour:V,meridiem:$}=Qi(D);g(V),S(F),N($)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(re,{icon:"wm-schedule",className:f("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
10
10
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
11
- `}),u&&r.jsxs("div",{className:c("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[r.jsx(ca,{values:N,selectedValue:x.padStart(2,"0"),scrollRef:b,onSelect:D=>T(D,C),className:"wu-time-hour-picker"}),r.jsx(ca,{values:k,selectedValue:C.padStart(2,"0"),scrollRef:h,onSelect:D=>T(x,D),className:"wu-time-minute-picker"}),r.jsx(ca,{values:A,selectedValue:y,onSelect:D=>T(void 0,void 0,D),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};rn.displayName="WuTimePicker";const Fc=1,Lc=1e6;let da=0;function Wc(){return da=(da+1)%Number.MAX_SAFE_INTEGER,da.toString()}const wa=new Map,an=e=>{if(wa.has(e))return;const t=setTimeout(()=>{wa.delete(e),_t({type:"REMOVE_TOAST",toastId:e})},Lc);wa.set(e,t)},Pc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Fc)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=t;return a?an(a):e.toasts.forEach(s=>{an(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===a||a===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},sr=[];let or={toasts:[]};function _t(e){or=Pc(or,e),sr.forEach(t=>{t(or)})}function sn({...e}){const t=Wc(),a=o=>_t({type:"UPDATE_TOAST",toast:{...o,id:t}}),s=()=>_t({type:"DISMISS_TOAST",toastId:t});return _t({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||s()}}}),{id:t,dismiss:s,update:a}}function Oc(){const[e,t]=f.useState(or);return f.useEffect(()=>(sr.push(t),()=>{const a=sr.indexOf(t);a>-1&&sr.splice(a,1)}),[e]),{...e,toast:sn,dismiss:a=>_t({type:"DISMISS_TOAST",toastId:a})}}const Bc=()=>({showToast:({message:t,variant:a,duration:s,position:o})=>sn({description:t,variant:a,duration:s,position:o})}),qc=me.Provider,zc=Se.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),on=g.forwardRef(({className:e,position:t,...a},s)=>r.jsx(me.Viewport,{ref:s,className:c(zc({position:t}),e),...a}));on.displayName=me.Viewport.displayName;const Vc=Se.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),nn=g.forwardRef(({className:e,variant:t,position:a,...s},o)=>r.jsx(me.Root,{ref:o,className:c(Vc({variant:t,position:a}),e),...s}));nn.displayName=me.Root.displayName;const Hc=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Action,{ref:a,className:c("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));Hc.displayName=me.Action.displayName;const un=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Close,{ref:a,className:c("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:r.jsx("span",{className:"wm-close wu-text-base"})}));un.displayName=me.Close.displayName;const ln=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Title,{ref:a,className:c("wu-text-sm wu-font-semibold",e),...t}));ln.displayName=me.Title.displayName;const cn=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Description,{ref:a,className:c("wu-text-sm wu-opacity-90",e),...t}));cn.displayName=me.Description.displayName;function $c(){const{toasts:e}=Oc(),t=e.reduce((a,s)=>{const o=s.position||"top";return a[o]||(a[o]=[]),a[o].push(s),a},{});return r.jsx(qc,{children:Object.entries(t).map(([a,s])=>r.jsx(on,{position:a,children:s.map(function({id:o,title:n,description:u,action:l,variant:i,position:d,...w}){const p={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return r.jsxs(nn,{variant:i||"success",position:d,...w,children:[r.jsxs("div",{className:"wu-grid wu-gap-1",children:[n&&r.jsx(ln,{children:n}),u&&r.jsxs(cn,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[r.jsx(ue,{icon:p[i||"success"],className:"wu-text-xl"}),u]})]}),l,r.jsx(un,{})]},o)})},a))})}const Uc=()=>r.jsx($c,{}),dn=g.forwardRef(({className:e,dir:t,...a},s)=>r.jsx(fr.Root,{className:c("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...a,ref:s,children:r.jsx(fr.Thumb,{className:c("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));dn.displayName=fr.Root.displayName;const wn=f.forwardRef((e,t)=>{const{Label:a,labelPosition:s="right",onChange:o,className:n,dir:u,disabled:l,id:i=Bt(),...d}=e;return f.useEffect(()=>{const{checked:w,defaultChecked:p}=d;w!==void 0&&p!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),r.jsxs("div",{className:c(jc({labelPosition:s}),"wu-toggle-container"),dir:u,children:[r.jsx(dn,{...d,id:i,disabled:l,ref:t,onCheckedChange:o,className:c("wu-peer",n),dir:u}),r.jsx(xe,{htmlFor:i,className:"wu-toggle-label",children:a})]})});wn.displayName="WuToggle";const jc=Se.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),nr=f.createContext(null),Gc=()=>{const e=f.useContext(nr);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},Yc=()=>{const e=f.useContext(nr);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Kc=({children:e})=>{const[t,a]=f.useState({}),[s,o]=f.useState({}),n=f.useCallback(async(d,w)=>{try{const b=await(await fetch(d)).json();a(b)}catch(p){console.error("Failed to load translations:",p),w&&a(w)}w&&o(w)},[]),u=f.useCallback(d=>{o(d)},[]),l=f.useCallback(()=>({t:(w,p)=>t[w]?t[w]:s[w]?s[w]:p||w}),[t,s]),i={loadTranslations:n,setFallbackTranslations:u,useTranslation:l};return r.jsx(nr.Provider,{value:i,children:e})},Jc={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},fn={main:"_main_1uzld_1",container:"_container_1uzld_5"},pn=f.forwardRef(({className:e,children:t,isOpen:a=!1,contentOffset:s=48,contentOffsetFactor:o=4,header:n,contentAnimation:u="wu-fade-zoom",headerAnimation:l="wu-slide-up-down",dir:i="ltr"},d)=>{const[w,p]=f.useState(`${u}-view-in`),[b,h]=f.useState(`${l}-header-in`),x=f.useRef(null),m=f.useRef(null),[C,E]=f.useState(!1),[y,S]=f.useState(!1),N=()=>{E(!0)},k=()=>{S(!0)};return f.useEffect(()=>{C&&y&&(w.includes("in")?(p(`${u}-view-out`),h(`${l}-header-out`)):(p(`${u}-view-in`),h(`${l}-header-in`)),E(!1),S(!1))},[C,y]),r.jsxs("div",{className:c(fn.main),ref:d,children:[r.jsx(Pt.SwitchTransition,{mode:"out-in",children:r.jsx(Pt.CSSTransition,{nodeRef:m,addEndListener:A=>{x.current&&x.current.addEventListener("transitionend",A,!0)},classNames:b,unmountOnExit:!0,children:n?n(m):null},a?"header-visible":"header-hidden")}),r.jsx(Pt.SwitchTransition,{mode:"out-in",children:r.jsx(Pt.CSSTransition,{nodeRef:x,classNames:w,addEndListener:A=>{x.current&&x.current.addEventListener("transitionend",A,!0)},onExited:N,onEntered:k,unmountOnExit:!0,children:r.jsx("div",{ref:x,className:c(fn.container,e),style:{padding:a?Xc(s,o,i):"0px"},children:t})},a?"details":"card")})]})});pn.displayName="WuDrilldown";function Xc(e,t,a){return typeof e=="number"?a==="rtl"?`${e}px ${e/2}px ${e/t}px ${e/t}px`:`${e}px ${e/t}px ${e/t}px ${e/2}px`:e}const Zc=[Bn.configure({link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const a=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(a.href))return!1;const s=["ftp","file","mailto"],o=a.protocol.replace(":","");if(s.includes(o)||!t.protocols.map(i=>typeof i=="string"?i:i.scheme).includes(o))return!1;const u=["example-phishing.com","malicious-site.net"],l=a.hostname;return!u.includes(l)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),a=["example-no-autolink.com","another-no-autolink.com"],s=t.hostname;return!a.includes(s)}catch{return!1}}}}),On.configure({types:["heading","paragraph"]}),Wn,Ln,Ze.TextStyle,Ze.Color,Ze.BackgroundColor,ga.TaskList,ga.TaskItem,Ze.LineHeight,Ze.FontSize,Ze.FontFamily,qn.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),Pn.TableKit.configure({table:{resizable:!0}})],se={WuContentEditor:"_WuContentEditor_lg9m4_8",EditorAction:"_EditorAction_lg9m4_69",EditorActionActive:"_EditorActionActive_lg9m4_72"},hn=f.createContext(null),Qc=({editor:e,children:t,customFonts:a})=>r.jsx(hn.Provider,{value:{editor:e,customFonts:a},children:t}),ye=()=>{const e=f.useContext(hn);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},Rc=()=>{const{editor:e}=ye(),t=[{id:"bold",icon:"wm-format-bold",tooltip:"Bold",event:()=>e.chain().focus().toggleBold().run()},{id:"underline",icon:"wm-format-underlined",tooltip:"Underline",event:()=>e.chain().focus().toggleUnderline().run()},{id:"italic",icon:"wm-format-italic",tooltip:"Italic",event:()=>e.chain().focus().toggleItalic().run()},{id:"strike",icon:"wm-format-strikethrough",tooltip:"Strikethrough",event:()=>e.chain().focus().toggleStrike().run()}],a=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l;return{bold:(o=s.editor)==null?void 0:o.isActive("bold"),underline:(n=s.editor)==null?void 0:n.isActive("underline"),italic:(u=s.editor)==null?void 0:u.isActive("italic"),strike:(l=s.editor)==null?void 0:l.isActive("strike")}}});return r.jsx(r.Fragment,{children:t.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(a==null?void 0:a[s.id])&&se.EditorActionActive),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},fa=({action:e,defaultValue:t})=>{var o;const[a,s]=f.useState();return f.useEffect(()=>{s(t||e.items.find(n=>n.active)||e.items[0])},[e,t]),r.jsxs(ft.DropdownMenu,{children:[r.jsx(ft.DropdownMenuTrigger,{className:c(se.EditorAction,e.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:r.jsx(ue,{icon:a==null?void 0:a.icon})}),r.jsx(ft.DropdownMenuContent,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px] wu-border wu-border-blue-p wu-rounded wu-bg-white",align:"start",children:(o=e.items)==null?void 0:o.map(n=>r.jsx(ft.DropdownMenuItem,{onClick:()=>{n.event(),s(n)},title:n.tooltip,children:r.jsx("button",{className:c(se.EditorAction,n.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:r.jsx(ue,{icon:n.icon})})},n.id))})]})},ed=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d;return{isParagraph:(o=s.editor)==null?void 0:o.isActive("paragraph"),isH1:(n=s.editor)==null?void 0:n.isActive("heading",{level:1}),isH2:(u=s.editor)==null?void 0:u.isActive("heading",{level:2}),isH3:(l=s.editor)==null?void 0:l.isActive("heading",{level:3}),isH4:(i=s.editor)==null?void 0:i.isActive("heading",{level:4}),isStyle:(d=s.editor)==null?void 0:d.isActive("heading")}}}),a=[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run(),active:t.isParagraph},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run(),active:t.isH1},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run(),active:t.isH2},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run(),active:t.isH3},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run(),active:t.isH4}];return r.jsx(fa,{action:{id:"style",active:t.isStyle,icon:"wm-format-paragraph",items:a},defaultValue:a.find(s=>s.active)})},td=()=>{const{editor:e,customFonts:t}=ye(),a=ge.useEditorState({editor:e,selector:u=>({currentFontFamily:u.editor.getAttributes("textStyle").fontFamily||""})}),s=["Fira Sans","Inter","Poppins","JetBrains Mono","Montserrat",...t||[]],[o,n]=f.useState(a.currentFontFamily||s[0]);return f.useEffect(()=>{var u;n(((u=a.currentFontFamily)==null?void 0:u.replace(/"/g,""))||s[0])},[a.currentFontFamily]),r.jsxs(Ar,{children:[r.jsx(Dr,{className:se.EditorAction+" wu-transition-colors "+(o!=="Fira Sans"&&se.EditorActionActive),style:{fontFamily:o},title:o||"Font Family",children:o==null?void 0:o[0]}),r.jsx(Ht,{align:"start",className:"wu-border-blue-p wu-rounded",children:s.map(u=>r.jsx(vt,{title:u,onSelect:()=>{e.chain().focus().setFontFamily(u).run(),n(u)},className:o===u?se.EditorActionActive:"",children:u},u))})]})},rd=["e","E","+","-"],ad="wu-border wu-rounded wu-w-10 wu-h-6 wu-text-center [appearance:textfield] [&::-webkit-outer-spin-button]:wu-appearance-none [&::-webkit-inner-spin-button]:wu-appearance-none focus:wu-border-blue-p",bn=1,sd=()=>{const{editor:e}=ye(),[t,a]=f.useState(16),s=u=>{e.chain().focus().setFontSize(u+"px").run()},o=u=>{const l=Math.max(bn,u);a(l),s(l)},n=u=>{rd.includes(u.key)?u.preventDefault():u.key==="Enter"&&s(t)};return r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-1",children:[r.jsx("button",{className:se.EditorAction,onClick:()=>o(t-1),disabled:t<=bn,children:"−"}),r.jsx("input",{type:"number",inputMode:"numeric",pattern:"[0-9]*",className:ad,value:t,onKeyDown:n,onChange:u=>a(u.target.valueAsNumber),onBlur:()=>s(t)}),r.jsx("button",{className:se.EditorAction,onClick:()=>o(t+1),disabled:t>=128,children:"+"})]})},od=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:({editor:a})=>({textColor:a.getAttributes("textStyle").color,bgColor:a.getAttributes("textStyle").backgroundColor})});return r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:se.EditorAction,htmlFor:"text-color",title:"Text Color",children:[r.jsx(ue,{icon:"wm-format-color-text",className:"wu-cursor-pointer",style:{color:t.textColor}}),r.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"text-color",defaultValue:"#545E6B",onChange:a=>e.chain().focus().setColor(a.target.value).run()})]}),r.jsxs("label",{className:se.EditorAction,htmlFor:"bg-color",title:"Background Color",children:[r.jsx(ue,{icon:"wm-border-color",className:"wu-cursor-pointer",style:{color:t.bgColor}}),r.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"bg-color",defaultValue:"#545E6B",onChange:a=>e.chain().focus().setBackgroundColor(a.target.value).run()})]})]})},nd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d;return{isUl:(o=s.editor)==null?void 0:o.isActive("bulletList"),isOl:(n=s.editor)==null?void 0:n.isActive("orderedList"),isTodo:(u=s.editor)==null?void 0:u.isActive("taskList"),isList:((l=s.editor)==null?void 0:l.isActive("bulletList"))||((i=s.editor)==null?void 0:i.isActive("orderedList"))||((d=s.editor)==null?void 0:d.isActive("taskList"))}}}),a=[{id:"ul",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run(),active:t.isUl,tooltip:"Bulleted List"},{id:"ol",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run(),active:t.isOl,tooltip:"Numbered List"},{id:"todo",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run(),active:t.isTodo,tooltip:"To-Do List"}];return r.jsx(fa,{action:{id:"style",active:t.isList,icon:"wm-format-paragraph",items:a}})},ud=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u;return{superscript:(o=s.editor)==null?void 0:o.isActive("superscript"),subscript:(n=s.editor)==null?void 0:n.isActive("subscript"),quote:(u=s.editor)==null?void 0:u.isActive("blockquote")}}}),a=[{id:"quote",icon:"wm-format-quote",event:()=>e.chain().focus().toggleBlockquote().run(),active:t==null?void 0:t.quote,tooltip:"Blockquote"},{id:"superscript",icon:"wm-superscript",event:()=>e.chain().focus().toggleSuperscript().run(),active:t==null?void 0:t.superscript,tooltip:"Superscript"},{id:"subscript",icon:"wm-subscript",event:()=>e.chain().focus().toggleSubscript().run(),active:t==null?void 0:t.subscript,tooltip:"Subscript"}];return r.jsx(r.Fragment,{children:a.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(t==null?void 0:t[s.id])&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},ld=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d,w;return{isLeft:(o=s.editor)==null?void 0:o.isActive({textAlign:"left"}),isCenter:(n=s.editor)==null?void 0:n.isActive({textAlign:"center"}),isRight:(u=s.editor)==null?void 0:u.isActive({textAlign:"right"}),isJustify:(l=s.editor)==null?void 0:l.isActive({textAlign:"justify"}),isAligned:((i=s.editor)==null?void 0:i.isActive({textAlign:"center"}))||((d=s.editor)==null?void 0:d.isActive({textAlign:"right"}))||((w=s.editor)==null?void 0:w.isActive({textAlign:"justify"}))}}}),a=[{id:"left",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run(),tooltip:"Align Left",active:t.isLeft},{id:"center",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run(),tooltip:"Align Center",active:t.isCenter},{id:"right",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run(),tooltip:"Align Right",active:t.isRight},{id:"justify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",active:t.isJustify}];return r.jsx(fa,{action:{id:"style",active:t.isAligned,icon:"wm-format-paragraph",items:a}})},id=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>({code:s.editor.isActive("code")})}),a=[{id:"code",event:()=>e.chain().focus().toggleCode().run(),icon:"wm-code",tooltip:"Code"}];return r.jsx(r.Fragment,{children:a.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(t==null?void 0:t[s.id])&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},cd=()=>{const{editor:e}=ye(),t=[{id:"clear",icon:"wm-format-clear",event:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),tooltip:"Clear Formatting"}];return r.jsx(r.Fragment,{children:t.map(a=>r.jsx("button",{title:a.tooltip,className:c(se.EditorAction),onClick:a.event,children:r.jsx(ue,{icon:a.icon})},a.id))})},dd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:l=>{var i,d;return{isImage:(i=l.editor)==null?void 0:i.isActive("image"),imageAttrs:(d=l.editor)==null?void 0:d.getAttributes("image")}}}),[a,s]=f.useState(t.imageAttrs.src||""),[o,n]=f.useState(t.imageAttrs.alt||""),u=()=>{e.chain().focus().setImage({src:a,alt:o}).run()};return r.jsx(Ut,{hideCloseButton:!0,Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isImage&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-image"})}),maxWidth:"400px",children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),r.jsx(ve,{Label:"Image URL",type:"url",value:a,onChange:l=>s(l.target.value),required:!0}),r.jsx(ve,{Label:"Alt Text",type:"text",value:o,onChange:l=>n(l.target.value)}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[r.jsx(ze,{variant:"secondary",children:"Cancel"}),r.jsx(ze,{onClick:u,disabled:!a,children:"Save"})]})]})})},wd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:i=>{var d,w;return{isLink:(d=i.editor)==null?void 0:d.isActive("link"),linkAttrs:(w=i.editor)==null?void 0:w.getAttributes("link")}}}),[a,s]=f.useState(t.linkAttrs.href||""),[o,n]=f.useState(t.linkAttrs.alt||""),u=()=>{e.chain().focus().insertContent({type:"text",text:o||a,marks:[{type:"link",attrs:{href:a}}]}).run()},l=()=>{const{$from:i}=e.state.selection,d=i.parent.textContent,w=i.parentOffset;let p=w,b=w;for(;p>0&&!/\s/.test(d[p-1]);)p--;for(;b<d.length&&!/\s/.test(d[b]);)b++;const h=i.start(),x=h+p,m=h+b,C=d.slice(p,b);e.commands.setTextSelection({from:x,to:m}),s(t.linkAttrs.href||""),n(C||t.linkAttrs.alt||"")};return r.jsx(Ut,{Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isLink&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-link"})}),maxWidth:"400px",onOpenChange:i=>i&&l(),children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),r.jsx(ve,{Label:"Link",type:"url",value:a,onChange:i=>s(i.target.value),required:!0}),r.jsx(ve,{Label:"Text to display",type:"text",value:o,onChange:i=>n(i.target.value)}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[t.isLink&&r.jsx(ze,{color:"error",onClick:()=>e.chain().focus().unsetLink().run(),variant:"secondary",children:"Remove"}),r.jsx(ze,{onClick:u,disabled:!a,children:"Save"})]})]})})},fd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:p=>({isTable:p.editor.isActive("table"),tableAttrs:p.editor.getAttributes("table")})}),[a,s]=f.useState(t.tableAttrs.rows||2),[o,n]=f.useState(t.tableAttrs.cols||2),[u,l]=f.useState(!1),i=f.useRef(null),d=f.useCallback(()=>{i.current=setTimeout(()=>{e.chain().focus().insertTable({rows:a,cols:o,withHeaderRow:u}).run()},100)},[e,a,o,u]),w=f.useCallback(()=>{i.current=setTimeout(()=>{e.chain().focus().deleteTable().run()},100)},[e]);return r.jsx(Ut,{Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isTable&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-table"})}),hideCloseButton:!0,maxWidth:"360px",children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),t.isTable?r.jsxs("div",{className:"wu-space-y-4 wu-mt-2",children:[r.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-4",children:[r.jsx(le,{onClick:()=>e.chain().focus().addColumnBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Left"}),r.jsx(le,{onClick:()=>e.chain().focus().addRowBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Top"}),r.jsx(le,{onClick:()=>e.chain().focus().addColumnAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Right"}),r.jsx(le,{onClick:()=>e.chain().focus().addRowAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Bottom"}),r.jsx(le,{onClick:()=>e.chain().focus().deleteColumn().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Column"}),r.jsx(le,{onClick:()=>e.chain().focus().deleteRow().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Row"})]}),r.jsx(le,{onClick:()=>e.chain().focus().toggleHeaderRow().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Toggle Header Row"})]}):r.jsxs("div",{className:"wu-space-y-3",children:[r.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-3",children:[r.jsx(ve,{Label:"Rows",type:"number",min:1,value:a,onChange:p=>s(Number(p.target.value))}),r.jsx(ve,{Label:"Columns",type:"number",min:1,value:o,onChange:p=>n(Number(p.target.value))})]}),r.jsx(Ce,{Label:"Add header row",checked:u,onChange:l})]}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2 wu-mt-4",children:[r.jsx(ze,{variant:"secondary",children:"Cancel"}),!t.isTable&&r.jsx(r.Fragment,{children:r.jsx(ze,{onClick:d,children:"Insert"})}),t.isTable&&r.jsx(ze,{color:"error",onClick:w,children:"Delete Table"})]})]})})},pd=e=>{const{editor:t,customFonts:a,...s}=e;return r.jsx("div",{...s,children:r.jsx(Qc,{editor:t,customFonts:a,children:r.jsxs("div",{className:"wu-flex wu-gap-1 wu-p-2 wu-items-center wu-justify-start wu-border-b wu-border-gray-40",children:[r.jsx(ed,{}),r.jsx(td,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(sd,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(Rc,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(od,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(nd,{}),r.jsx(ld,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(dd,{}),r.jsx(wd,{}),r.jsx(fd,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(ud,{}),r.jsx(id,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(cd,{})]})})})},hd=e=>{const{defaultValue:t,onUpdate:a,className:s,readonly:o,...n}=e,u=ge.useEditor({editable:!o,extensions:Zc,content:t,onUpdate:({editor:l})=>{a&&a(l.getHTML())}});return r.jsxs("div",{className:c(se.WuContentEditor,s),...n,children:[r.jsx(pd,{editor:u,customFonts:e.customFonts,className:"wu-sticky wu-top-0 wu-z-10 wu-bg-white"}),r.jsx(ge.EditorContent,{editor:u,className:"wu-p-4"})]})};window.wickUiVersion="1.22.0",Object.defineProperty(v,"useContext",{enumerable:!0,get:()=>f.useContext}),v.CHART_COLOR_SYSTEM=Jc,v.WuAccordion=$n,v.WuAppHeader=pu,v.WuAppHeaderAccount=Ta,v.WuAppHeaderBar=Ma,v.WuAppHeaderHelp=ka,v.WuAppHeaderMenu=Da,v.WuAppHeaderSearch=wu,v.WuButton=le,v.WuCalender=Cr,v.WuCard=qa,v.WuCardFooter=Va,v.WuCardHeader=za,v.WuCheckbox=Ce,v.WuChip=yu,v.WuCombobox=Du,v.WuContentEditor=hd,v.WuCopyToClipboard=Mu,v.WuDataTable=Ec,v.WuDatePicker=bu,v.WuDateRangePicker=xu,v.WuDisplay=eu,v.WuDrawer=Bu,v.WuDrawerClose=qu,v.WuDrilldown=pn,v.WuFooter=ts,v.WuFormGroup=du,v.WuHeading=Qn,v.WuHelpButton=rs,v.WuIcon=ue,v.WuInput=ve,v.WuInputError=lu,v.WuInputHint=iu,v.WuLabel=xe,v.WuListbox=Gu,v.WuLoader=et,v.WuMenu=ss,v.WuMenuCheckboxItem=Yu,v.WuMenuIcon=Lr,v.WuMenuItem=_r,v.WuMenuItemGroup=Ku,v.WuMenuRadioItem=Ju,v.WuMenuSeparatorItem=Xu,v.WuModal=Ut,v.WuModalClose=ze,v.WuModalContent=jt,v.WuModalFooter=nl,v.WuModalHeader=ol,v.WuMonthPicker=dl,v.WuPagination=ms,v.WuPopover=hl,v.WuPopoverClose=bl,v.WuPrimaryNavbar=fl,v.WuRadioGroup=Ns,v.WuScrollArea=gl,v.WuSecondaryNavbar=pl,v.WuSelect=hs,v.WuSidebar=Wl,v.WuSidebarContent=Pl,v.WuSidebarFooter=Ol,v.WuSidebarGroup=Bl,v.WuSidebarItem=zl,v.WuSidebarMenu=ql,v.WuSidebarTrigger=Bs,v.WuSpotlight=cs,v.WuStackedCard=$l,v.WuStackedCardOverlay=Ul,v.WuStepper=hc,v.WuSubMenu=Zu,v.WuSubtext=Rn,v.WuSwitcher=qo,v.WuTab=Nc,v.WuTable=Tc,v.WuText=Zn,v.WuTextarea=Zo,v.WuTimePicker=rn,v.WuToast=Uc,v.WuToggle=wn,v.WuTooltip=zt,v.WuTranslationContext=nr,v.WuTranslationProvider=Kc,v.WuTruncatedLabel=fu,v.WuVirtualScroll=tt,v.calculatePosition=Hl,v.useTranslation=Gc,v.useTranslationsContext=Yc,v.useWuShowToast=Bc,v.useWuSidebar=je,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
11
+ `}),i&&a.jsxs("div",{className:f("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(ds,{values:C,selectedValue:b.padStart(2,"0"),scrollRef:h,onSelect:k=>A(k,x),className:"wu-time-hour-picker"}),a.jsx(ds,{values:E,selectedValue:x.padStart(2,"0"),scrollRef:m,onSelect:k=>A(b,k),className:"wu-time-minute-picker"}),a.jsx(ds,{values:M,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Ri.displayName="WuTimePicker";const Ap=1,kp=1e6;let ws=0;function Mp(){return ws=(ws+1)%Number.MAX_SAFE_INTEGER,ws.toString()}const fs=new Map,eu=e=>{if(fs.has(e))return;const t=setTimeout(()=>{fs.delete(e),an({type:"REMOVE_TOAST",toastId:e})},kp);fs.set(e,t)},Ip=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ap)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?eu(n):e.toasts.forEach(r=>{eu(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},$n=[];let Hn={toasts:[]};function an(e){Hn=Ip(Hn,e),$n.forEach(t=>{t(Hn)})}function tu({...e}){const t=Mp(),n=s=>an({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>an({type:"DISMISS_TOAST",toastId:t});return an({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Dp(){const[e,t]=p.useState(Hn);return p.useEffect(()=>($n.push(t),()=>{const n=$n.indexOf(t);n>-1&&$n.splice(n,1)}),[e]),{...e,toast:tu,dismiss:n=>an({type:"DISMISS_TOAST",toastId:n})}}const Pp=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>tu({description:t,variant:n,duration:r,position:s})}),Fp=Se.Provider,Vp=Me.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),nu=v.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Se.Viewport,{ref:r,className:f(Vp({position:t}),e),...n}));nu.displayName=Se.Viewport.displayName;const Lp=Me.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),ru=v.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Se.Root,{ref:s,className:f(Lp({variant:t,position:n}),e),...r}));ru.displayName=Se.Root.displayName;const _p=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Action,{ref:n,className:f("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));_p.displayName=Se.Action.displayName;const su=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Close,{ref:n,className:f("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));su.displayName=Se.Close.displayName;const au=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Title,{ref:n,className:f("wu-text-sm wu-font-semibold",e),...t}));au.displayName=Se.Title.displayName;const ou=v.forwardRef(({className:e,...t},n)=>a.jsx(Se.Description,{ref:n,className:f("wu-text-sm wu-opacity-90",e),...t}));ou.displayName=Se.Description.displayName;function Op(){const{toasts:e}=Dp(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(Fp,{children:Object.entries(t).map(([n,r])=>a.jsx(nu,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:c,...d}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(ru,{variant:l||"success",position:c,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(au,{children:o}),i&&a.jsxs(ou,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(re,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(su,{})]},s)})},n))})}const Wp=()=>a.jsx(Op,{}),iu=v.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(fr.Root,{className:f("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(fr.Thumb,{className:f("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));iu.displayName=fr.Root.displayName;const uu=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=vn(),...c}=e;return p.useEffect(()=>{const{checked:d,defaultChecked:w}=c;d!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),a.jsxs("div",{className:f(Bp({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(iu,{...c,id:l,disabled:u,ref:t,onCheckedChange:s,className:f("wu-peer",o),dir:i}),a.jsx(Ce,{htmlFor:l,className:"wu-toggle-label",children:n})]})});uu.displayName="WuToggle";const Bp=Me.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),Un=p.createContext(null),zp=()=>{const e=p.useContext(Un);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},qp=()=>{const e=p.useContext(Un);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},$p=({children:e})=>{const[t,n]=p.useState({}),[r,s]=p.useState({}),o=p.useCallback(async(c,d)=>{try{const h=await(await fetch(c)).json();n(h)}catch(w){console.error("Failed to load translations:",w),d&&n(d)}d&&s(d)},[]),i=p.useCallback(c=>{s(c)},[]),u=p.useCallback(()=>({t:(d,w)=>t[d]?t[d]:r[d]?r[d]:w||d}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Un.Provider,{value:l,children:e})},Hp={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},lu=p.createContext({});function ps(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const hs=typeof window<"u",cu=hs?p.useLayoutEffect:p.useEffect,jn=p.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const rt=(e,t,n)=>n>t?t:n<e?e:n;function ms(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let on=()=>{},st=()=>{};process.env.NODE_ENV!=="production"&&(on=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ms(t,n))},st=(e,t,n)=>{if(!e)throw new Error(ms(t,n))});const je={},du=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Gp(e){return typeof e=="object"&&e!==null}const wu=e=>/^0[^.\s]+$/u.test(e);function gs(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ct=e=>e,Kp=(e,t)=>n=>t(e(n)),Gn=(...e)=>e.reduce(Kp),fu=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class pu{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>jp(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const $e=e=>e*1e3,Le=e=>e/1e3;function hu(e,t){return t?e*(1e3/t):0}const mu=new Set;function gu(e,t,n){e||mu.has(t)||(console.warn(ms(t,n)),mu.add(t))}const bu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Yp=1e-7,Xp=12;function Zp(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=bu(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Yp&&++u<Xp);return i}function un(e,t,n,r){if(e===t&&n===r)return Ct;const s=o=>Zp(o,0,1,e,n);return o=>o===0||o===1?o:bu(s(o),t,r)}const yu=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xu=e=>t=>1-e(1-t),vu=un(.33,1.53,.69,.99),bs=xu(vu),Nu=yu(bs),Su=e=>(e*=2)<1?.5*bs(e):.5*(2-Math.pow(2,-10*(e-1))),ys=e=>1-Math.sin(Math.acos(e)),Jp=xu(ys),Cu=yu(ys),Qp=un(.42,0,1,1),Rp=un(0,0,.58,1),Tu=un(.42,0,.58,1),eh=e=>Array.isArray(e)&&typeof e[0]!="number",Eu=e=>Array.isArray(e)&&typeof e[0]=="number",Au={linear:Ct,easeIn:Qp,easeInOut:Tu,easeOut:Rp,circIn:ys,circInOut:Cu,circOut:Jp,backIn:bs,backInOut:Nu,backOut:vu,anticipate:Su},th=e=>typeof e=="string",ku=e=>{if(Eu(e)){st(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return un(t,n,r,s)}else if(th(e))return st(Au[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Au[e];return e},Kn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nh(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),e()),d(u)}const c={schedule:(d,w=!1,h=!1)=>{const b=h&&s?n:r;return w&&i.add(d),b.has(d)||b.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(u=d,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(l),n.clear(),s=!1,o&&(o=!1,c.process(d))}};return c}const rh=40;function Mu(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Kn.reduce((N,C)=>(N[C]=nh(o),N),{}),{setup:u,read:l,resolveKeyframes:c,preUpdate:d,update:w,preRender:h,render:m,postRender:b}=i,g=()=>{const N=je.useManualTiming?s.timestamp:performance.now();n=!1,je.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(N-s.timestamp,rh),1)),s.timestamp=N,s.isProcessing=!0,u.process(s),l.process(s),c.process(s),d.process(s),w.process(s),h.process(s),m.process(s),b.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Kn.reduce((N,C)=>{const E=i[C];return N[C]=(M,A=!1,k=!1)=>(n||x(),E.schedule(M,A,k)),N},{}),cancel:N=>{for(let C=0;C<Kn.length;C++)i[Kn[C]].cancel(N)},state:s,steps:i}}const{schedule:_e,cancel:xs,state:Yn}=Mu(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ct,!0);let Xn;function sh(){Xn=void 0}const ke={now:()=>(Xn===void 0&&ke.set(Yn.isProcessing||je.useManualTiming?Yn.timestamp:performance.now()),Xn),set:e=>{Xn=e,queueMicrotask(sh)}},Iu=e=>t=>typeof t=="string"&&t.startsWith(e),Du=Iu("--"),ah=Iu("var(--"),vs=e=>ah(e)?oh.test(e.split("/*")[0].trim()):!1,oh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Tt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...Tt,transform:e=>rt(0,1,e)},Zn={...Tt,default:1},cn=e=>Math.round(e*1e5)/1e5,Ns=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ih(e){return e==null}const uh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ss=(e,t)=>n=>!!(typeof n=="string"&&uh.test(n)&&n.startsWith(e)||t&&!ih(n)&&Object.prototype.hasOwnProperty.call(n,t)),Pu=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(Ns);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},lh=e=>rt(0,255,e),Cs={...Tt,transform:e=>Math.round(lh(e))},at={test:Ss("rgb","red"),parse:Pu("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Cs.transform(e)+", "+Cs.transform(t)+", "+Cs.transform(n)+", "+cn(ln.transform(r))+")"};function ch(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Ts={test:Ss("#"),parse:ch,transform:at.transform},dn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xe=dn("deg"),Et=dn("%"),L=dn("px"),dh=dn("vh"),wh=dn("vw"),Fu={...Et,parse:e=>Et.parse(e)/100,transform:e=>Et.transform(e*100)},At={test:Ss("hsl","hue"),parse:Pu("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Et.transform(cn(t))+", "+Et.transform(cn(n))+", "+cn(ln.transform(r))+")"},de={test:e=>at.test(e)||Ts.test(e)||At.test(e),parse:e=>at.test(e)?at.parse(e):At.test(e)?At.parse(e):Ts.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?at.transform(e):At.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},fh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ph(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ns))==null?void 0:t.length)||0)+(((n=e.match(fh))==null?void 0:n.length)||0)>0}const Vu="number",Lu="color",hh="var",mh="var(",_u="${}",gh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(gh,l=>(de.test(l)?(r.color.push(o),s.push(Lu),n.push(de.parse(l))):l.startsWith(mh)?(r.var.push(o),s.push(hh),n.push(l)):(r.number.push(o),s.push(Vu),n.push(parseFloat(l))),++o,_u)).split(_u);return{values:n,split:u,indexes:r,types:s}}function Ou(e){return wn(e).values}function Wu(e){const{split:t,types:n}=wn(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const u=n[i];u===Vu?o+=cn(s[i]):u===Lu?o+=de.transform(s[i]):o+=s[i]}return o}}const bh=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e;function yh(e){const t=Ou(e);return Wu(e)(t.map(bh))}const Ze={test:ph,parse:Ou,createTransformer:Wu,getAnimatableNone:yh};function Es(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function xh({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Es(l,u,e+1/3),o=Es(l,u,e),i=Es(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Jn(e,t){return n=>n>0?t:e}const fn=(e,t,n)=>e+(t-e)*n,As=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},vh=[Ts,at,At],Nh=e=>vh.find(t=>t.test(e));function Bu(e){const t=Nh(e);if(on(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===At&&(n=xh(n)),n}const zu=(e,t)=>{const n=Bu(e),r=Bu(t);if(!n||!r)return Jn(e,t);const s={...n};return o=>(s.red=As(n.red,r.red,o),s.green=As(n.green,r.green,o),s.blue=As(n.blue,r.blue,o),s.alpha=fn(n.alpha,r.alpha,o),at.transform(s))},ks=new Set(["none","hidden"]);function Sh(e,t){return ks.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ch(e,t){return n=>fn(e,t,n)}function Ms(e){return typeof e=="number"?Ch:typeof e=="string"?vs(e)?Jn:de.test(e)?zu:Ah:Array.isArray(e)?qu:typeof e=="object"?de.test(e)?zu:Th:Jn}function qu(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Ms(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Th(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ms(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Eh(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Ah=(e,t)=>{const n=Ze.createTransformer(t),r=wn(e),s=wn(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ks.has(e)&&!s.values.length||ks.has(t)&&!r.values.length?Sh(e,t):Gn(qu(Eh(r,s),s.values),n):(on(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Jn(e,t))};function $u(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?fn(e,t,n):Ms(e)(e,t)}const kh=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_e.update(t,n),stop:()=>xs(t),now:()=>Yn.isProcessing?Yn.timestamp:ke.now()}},Hu=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Qn=2e4;function Is(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Qn;)t+=n,r=e.next(t);return t>=Qn?1/0:t}function Mh(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Is(r),Qn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Le(s)}}const Ih=5;function Uu(e,t,n){const r=Math.max(t-Ih,0);return hu(n-e(r),t-r)}const ie={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ds=.001;function Dh({duration:e=ie.duration,bounce:t=ie.bounce,velocity:n=ie.velocity,mass:r=ie.mass}){let s,o;on(e<=$e(ie.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=rt(ie.minDamping,ie.maxDamping,i),e=rt(ie.minDuration,ie.maxDuration,Le(e)),i<1?(s=c=>{const d=c*i,w=d*e,h=d-n,m=Ps(c,i),b=Math.exp(-w);return Ds-h/m*b},o=c=>{const w=c*i*e,h=w*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,b=Math.exp(-w),g=Ps(Math.pow(c,2),i);return(-s(c)+Ds>0?-1:1)*((h-m)*b)/g}):(s=c=>{const d=Math.exp(-c*e),w=(c-n)*e+1;return-Ds+d*w},o=c=>{const d=Math.exp(-c*e),w=(n-c)*(e*e);return d*w});const u=5/e,l=Fh(s,o,u);if(e=$e(e),isNaN(l))return{stiffness:ie.stiffness,damping:ie.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const Ph=12;function Fh(e,t,n){let r=n;for(let s=1;s<Ph;s++)r=r-e(r)/t(r);return r}function Ps(e,t){return e*Math.sqrt(1-t*t)}const Vh=["duration","bounce"],Lh=["stiffness","damping","mass"];function ju(e,t){return t.some(n=>e[n]!==void 0)}function _h(e){let t={velocity:ie.velocity,stiffness:ie.stiffness,damping:ie.damping,mass:ie.mass,isResolvedFromDuration:!1,...e};if(!ju(e,Lh)&&ju(e,Vh))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*rt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ie.mass,stiffness:s,damping:o}}else{const n=Dh(e);t={...t,...n,mass:ie.mass},t.isResolvedFromDuration=!0}return t}function Rn(e=ie.visualDuration,t=ie.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:c,mass:d,duration:w,velocity:h,isResolvedFromDuration:m}=_h({...n,velocity:-Le(n.velocity||0)}),b=h||0,g=c/(2*Math.sqrt(l*d)),x=i-o,S=Le(Math.sqrt(l/d)),y=Math.abs(x)<5;r||(r=y?ie.restSpeed.granular:ie.restSpeed.default),s||(s=y?ie.restDelta.granular:ie.restDelta.default);let N;if(g<1){const E=Ps(S,g);N=M=>{const A=Math.exp(-g*S*M);return i-A*((b+g*S*x)/E*Math.sin(E*M)+x*Math.cos(E*M))}}else if(g===1)N=E=>i-Math.exp(-S*E)*(x+(b+S*x)*E);else{const E=S*Math.sqrt(g*g-1);N=M=>{const A=Math.exp(-g*S*M),k=Math.min(E*M,300);return i-A*((b+g*S*x)*Math.sinh(k)+E*x*Math.cosh(k))/E}}const C={calculatedDuration:m&&w||null,next:E=>{const M=N(E);if(m)u.done=E>=w;else{let A=E===0?b:0;g<1&&(A=E===0?$e(b):Uu(N,E,M));const k=Math.abs(A)<=r,D=Math.abs(i-M)<=s;u.done=k&&D}return u.value=u.done?i:M,u},toString:()=>{const E=Math.min(Is(C),Qn),M=Hu(A=>C.next(E*A).value,E,30);return E+"ms "+M},toTransition:()=>{}};return C}Rn.applyToOptions=e=>{const t=Mh(e,100,Rn);return e.ease=t.ease,e.duration=$e(t.duration),e.type="keyframes",e};function Fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:c=.5,restSpeed:d}){const w=e[0],h={done:!1,value:w},m=k=>u!==void 0&&k<u||l!==void 0&&k>l,b=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let g=n*t;const x=w+g,S=i===void 0?x:i(x);S!==x&&(g=S-w);const y=k=>-g*Math.exp(-k/r),N=k=>S+y(k),C=k=>{const D=y(k),F=N(k);h.done=Math.abs(D)<=c,h.value=h.done?S:F};let E,M;const A=k=>{m(h.value)&&(E=k,M=Rn({keyframes:[h.value,b(h.value)],velocity:Uu(N,k,h.value),damping:s,stiffness:o,restDelta:c,restSpeed:d}))};return A(0),{calculatedDuration:null,next:k=>{let D=!1;return!M&&E===void 0&&(D=!0,C(k),A(k)),E!==void 0&&k>=E?M.next(k-E):(!D&&C(k),h)}}}function Oh(e,t,n){const r=[],s=n||je.mix||$u,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Ct:t;u=Gn(l,u)}r.push(u)}return r}function Wh(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(st(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Oh(t,r,s),l=u.length,c=d=>{if(i&&d<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(d<e[w+1]);w++);const h=fu(e[w],e[w+1],d);return u[w](h)};return n?d=>c(rt(e[0],e[o-1],d)):c}function Bh(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fu(0,t,r);e.push(fn(n,1,s))}}function zh(e){const t=[0];return Bh(t,e.length-1),t}function qh(e,t){return e.map(n=>n*t)}function $h(e,t){return e.map(()=>t||Tu).splice(0,e.length-1)}function kt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=eh(r)?r.map(ku):ku(r),o={done:!1,value:t[0]},i=qh(n&&n.length===t.length?n:zh(t),e),u=Wh(i,t,{ease:Array.isArray(s)?s:$h(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const Hh=e=>e!==null;function Vs(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(Hh),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const Uh={decay:Fs,inertia:Fs,tween:kt,keyframes:kt,spring:Rn};function Gu(e){typeof e.type=="string"&&(e.type=Uh[e.type])}class Ls{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const jh=e=>e/100;class _s extends Ls{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ke.now()&&this.tick(ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Gu(t);const{type:n=kt,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||kt;process.env.NODE_ENV!=="production"&&l!==kt&&st(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==kt&&typeof u[0]!="number"&&(this.mixKeyframes=Gn(jh,$u(u[0],u[1])),u=[0,100]);const c=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=Is(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:w,repeatType:h,repeatDelay:m,type:b,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,C=r;if(w){const k=Math.min(this.currentTime,s)/u;let D=Math.floor(k),F=k%1;!F&&k>=1&&(F=1),F===1&&D--,D=Math.min(D,w+1),!!(D%2)&&(h==="reverse"?(F=1-F,m&&(F-=m/u)):h==="mirror"&&(C=i)),N=rt(0,1,F)*u}const E=y?{done:!1,value:d[0]}:C.next(N);o&&(E.value=o(E.value));let{done:M}=E;!y&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return A&&b!==Fs&&(E.value=Vs(d,this.options,x,this.speed)),g&&g(E.value),A&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return Le(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Le(t)}get time(){return Le(this.currentTime)}set time(t){var n;t=$e(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ke.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Le(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=kh,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Gh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ot=e=>e*180/Math.PI,Os=e=>{const t=ot(Math.atan2(e[1],e[0]));return Ws(t)},Kh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Os,rotateZ:Os,skewX:e=>ot(Math.atan(e[1])),skewY:e=>ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ws=e=>(e=e%360,e<0&&(e+=360),e),Ku=Os,Yu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Yh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yu,scaleY:Xu,scale:e=>(Yu(e)+Xu(e))/2,rotateX:e=>Ws(ot(Math.atan2(e[6],e[5]))),rotateY:e=>Ws(ot(Math.atan2(-e[2],e[0]))),rotateZ:Ku,rotate:Ku,skewX:e=>ot(Math.atan(e[4])),skewY:e=>ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bs(e){return e.includes("scale")?1:0}function zs(e,t){if(!e||e==="none")return Bs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Yh,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Kh,s=u}if(!s)return Bs(t);const o=r[t],i=s[1].split(",").map(Zh);return typeof o=="function"?o(i):i[o]}const Xh=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return zs(n,t)};function Zh(e){return parseFloat(e.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set(Mt),Zu=e=>e===Tt||e===L,Jh=new Set(["x","y","z"]),Qh=Mt.filter(e=>!Jh.has(e));function Rh(e){const t=[];return Qh.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const it={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>zs(t,"x"),y:(e,{transform:t})=>zs(t,"y")};it.translateX=it.x,it.translateY=it.y;const ut=new Set;let qs=!1,$s=!1,Hs=!1;function Ju(){if($s){const e=Array.from(ut).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Rh(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$s=!1,qs=!1,ut.forEach(e=>e.complete(Hs)),ut.clear()}function Qu(){ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($s=!0)})}function em(){Hs=!0,Qu(),Ju(),Hs=!1}class Us{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),qs||(qs=!0,_e.read(Qu),_e.resolveKeyframes(Ju))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Gh(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const tm=e=>e.startsWith("--");function nm(e,t,n){tm(t)?e.style.setProperty(t,n):e.style[t]=n}const rm=gs(()=>window.ScrollTimeline!==void 0),sm={};function am(e,t){const n=gs(e);return()=>sm[t]??n()}const Ru=am(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,el={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function tl(e,t){if(e)return typeof e=="function"?Ru()?Hu(e,t):"ease-out":Eu(e)?pn(e):Array.isArray(e)?e.map(n=>tl(n,t)||el.easeOut):el[e]}function om(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const w=tl(u,s);Array.isArray(w)&&(d.easing=w);const h={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function nl(e){return typeof e=="function"&&"applyToOptions"in e}function im({type:e,...t}){return nl(e)&&Ru()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class um extends Ls{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,st(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=im(t);this.animation=om(n,r,s,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Vs(s,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):nm(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Le(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Le(t)}get time(){return Le(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=$e(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&rm()?(this.animation.timeline=t,Ct):n(this)}}const rl={anticipate:Su,backInOut:Nu,circInOut:Cu};function lm(e){return e in rl}function cm(e){typeof e.ease=="string"&&lm(e.ease)&&(e.ease=rl[e.ease])}const sl=10;class dm extends um{constructor(t){cm(t),Gu(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new _s({...i,autoplay:!1}),l=$e(this.finishedTime??this.time);n.setWithVelocity(u.sample(l-sl).value,u.sample(l).value,sl),u.stop()}}const al=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ze.test(e)||e==="0")&&!e.startsWith("url("));function wm(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fm(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=al(s,t),u=al(o,t);return on(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:wm(e)||(n==="spring"||nl(n))&&r}function js(e){e.duration=0,e.type="keyframes"}const pm=new Set(["opacity","clipPath","filter","transform"]),hm=gs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mm(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return hm()&&n&&pm.has(n)&&(n!=="transform"||!c)&&!l&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const gm=40;class bm extends Ls{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:c,element:d,...w}){var b;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=ke.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:c,element:d,...w},m=(d==null?void 0:d.KeyframeResolver)||Us;this.keyframeResolver=new m(u,(g,x,S)=>this.onKeyframesResolved(g,x,h,!S),l,c,d),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=ke.now(),fm(t,o,i,u)||((je.instantAnimations||!l)&&(d==null||d(Vs(t,r,n))),t[0]=t[t.length-1],js(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>gm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!c&&mm(h)?new dm({...h,element:h.motionValue.owner.current}):new _s(h);m.finished.then(()=>this.notifyFinished()).catch(Ct),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),em()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const ym=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xm(e){const t=ym.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const vm=4;function ol(e,t,n=1){st(n<=vm,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=xm(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return du(i)?parseFloat(i):i}return vs(s)?ol(s,t,n+1):s}function il(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const ul=new Set(["width","height","top","left","right","bottom",...Mt]),Nm={test:e=>e==="auto",parse:e=>e},ll=e=>t=>t.test(e),cl=[Tt,L,Et,Xe,wh,dh,Nm],dl=e=>cl.find(ll(e));function Sm(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wu(e):!0}const Cm=new Set(["brightness","contrast","saturate","opacity"]);function Tm(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ns)||[];if(!r)return e;const s=n.replace(r,"");let o=Cm.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Em=/\b([a-z-]*)\(.*?\)/gu,Gs={...Ze,getAnimatableNone:e=>{const t=e.match(Em);return t?t.map(Tm).join(" "):e}},wl={...Tt,transform:Math.round},Ks={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,backgroundPositionX:L,backgroundPositionY:L,...{rotate:Xe,rotateX:Xe,rotateY:Xe,rotateZ:Xe,scale:Zn,scaleX:Zn,scaleY:Zn,scaleZ:Zn,skew:Xe,skewX:Xe,skewY:Xe,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:ln,originX:Fu,originY:Fu,originZ:L},zIndex:wl,fillOpacity:ln,strokeOpacity:ln,numOctaves:wl},Am={...Ks,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Gs,WebkitFilter:Gs},fl=e=>Am[e];function pl(e,t){let n=fl(e);return n!==Gs&&(n=Ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const km=new Set(["auto","none","0"]);function Mm(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!km.has(o)&&wn(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=pl(n,s)}class Im extends Us{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),vs(c))){const d=ol(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ul.has(r)||t.length!==2)return;const[s,o]=t,i=dl(s),u=dl(o);if(i!==u)if(Zu(i)&&Zu(u))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else it[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Sm(t[s]))&&r.push(s);r.length&&Mm(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=it[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Dm(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const hl=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ml(e){return Gp(e)&&"offsetHeight"in e}const gl=30,Pm=e=>!isNaN(parseFloat(e));class Fm{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=ke.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Pm(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&gu(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new pu);const r=this.events[t].add(n);return t==="change"?()=>{r(),_e.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gl);return hu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function er(e,t){return new Fm(e,t)}const{schedule:Vm}=Mu(queueMicrotask,!1),Lm={y:!1};function _m(){return Lm.y}function bl(e,t){const n=Dm(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function yl(e){return!(e.pointerType==="touch"||_m())}function Om(e,t,n={}){const[r,s,o]=bl(e,n),i=u=>{if(!yl(u))return;const{target:l}=u,c=t(l,u);if(typeof c!="function"||!l)return;const d=w=>{yl(w)&&(c(w),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,s)};return r.forEach(u=>{u.addEventListener("pointerenter",i,s)}),o}const xl=(e,t)=>t?e===t?!0:xl(e,t.parentElement):!1,Wm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Bm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zm(e){return Bm.has(e.tagName)||e.tabIndex!==-1}const tr=new WeakSet;function vl(e){return t=>{t.key==="Enter"&&e(t)}}function Ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qm=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=vl(()=>{if(tr.has(n))return;Ys(n,"down");const s=vl(()=>{Ys(n,"up")}),o=()=>Ys(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Nl(e){return Wm(e)&&!0}function $m(e,t,n={}){const[r,s,o]=bl(e,n),i=u=>{const l=u.currentTarget;if(!Nl(u))return;tr.add(l);const c=t(l,u),d=(m,b)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",h),tr.has(l)&&tr.delete(l),Nl(m)&&typeof c=="function"&&c(m,{success:b})},w=m=>{d(m,l===window||l===document||n.useGlobalTarget||xl(l,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",h,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),ml(u)&&(u.addEventListener("focus",c=>qm(c,s)),!zm(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const ge=e=>!!(e&&e.getVelocity),Hm=[...cl,de,Ze],Um=e=>Hm.find(ll(e)),Xs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Sl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jm(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Sl(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Sl(e[s],null)}}}}function Gm(...e){return v.useCallback(jm(...e),e)}class Km extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=ml(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Ym({children:e,isPresent:t,anchorX:n,root:r}){const s=p.useId(),o=p.useRef(null),i=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:u}=p.useContext(Xs),l=Gm(o,e==null?void 0:e.ref);return p.useInsertionEffect(()=>{const{width:c,height:d,top:w,left:h,right:m}=i.current;if(t||!o.current||!c||!d)return;const b=n==="left"?`left: ${h}`:`right: ${m}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");u&&(g.nonce=u);const x=r??document.head;return x.appendChild(g),g.sheet&&g.sheet.insertRule(`
12
+ [data-motion-pop-id="${s}"] {
13
+ position: absolute !important;
14
+ width: ${c}px !important;
15
+ height: ${d}px !important;
16
+ ${b}px !important;
17
+ top: ${w}px !important;
18
+ }
19
+ `),()=>{x.contains(g)&&x.removeChild(g)}},[t]),a.jsx(Km,{isPresent:t,childRef:o,sizeRef:i,children:v.cloneElement(e,{ref:l})})}const Xm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,root:l})=>{const c=ps(Zm),d=p.useId();let w=!0,h=p.useMemo(()=>(w=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{c.set(m,!0);for(const b of c.values())if(!b)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return o&&w&&(h={...h}),p.useMemo(()=>{c.forEach((m,b)=>c.set(b,!1))},[n]),v.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),i==="popLayout"&&(e=a.jsx(Ym,{isPresent:n,anchorX:u,root:l,children:e})),a.jsx(jn.Provider,{value:h,children:e})};function Zm(){return new Map}function Jm(e=!0){const t=p.useContext(jn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=p.useId();p.useEffect(()=>{if(e)return s(o)},[e]);const i=p.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const nr=e=>e.key||"";function Cl(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const Tl=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",root:l})=>{const[c,d]=Jm(i),w=p.useMemo(()=>Cl(e),[e]),h=i&&!c?[]:w.map(nr),m=p.useRef(!0),b=p.useRef(w),g=ps(()=>new Map),[x,S]=p.useState(w),[y,N]=p.useState(w);cu(()=>{m.current=!1,b.current=w;for(let M=0;M<y.length;M++){const A=nr(y[M]);h.includes(A)?g.delete(A):g.get(A)!==!0&&g.set(A,!1)}},[y,h.length,h.join("-")]);const C=[];if(w!==x){let M=[...w];for(let A=0;A<y.length;A++){const k=y[A],D=nr(k);h.includes(D)||(M.splice(A,0,k),C.push(k))}return o==="wait"&&C.length&&(M=C),N(Cl(M)),S(w),null}process.env.NODE_ENV!=="production"&&o==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:E}=p.useContext(lu);return a.jsx(a.Fragment,{children:y.map(M=>{const A=nr(M),k=i&&!c?!1:w===y||h.includes(A),D=()=>{if(g.has(A))g.set(A,!0);else return;let F=!0;g.forEach(V=>{V||(F=!1)}),F&&(E==null||E(),N(b.current),i&&(d==null||d()),r&&r())};return a.jsx(Xm,{isPresent:k,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:k?void 0:D,anchorX:u,children:M},A)})})},Zs=p.createContext({strict:!1}),El={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Dt={};for(const e in El)Dt[e]={isEnabled:t=>El[e].some(n=>!!t[n])};function Al(e){for(const t in e)Dt[t]={...Dt[t],...e[t]}}function kl({children:e,features:t,strict:n=!1}){const[,r]=p.useState(!Js(t)),s=p.useRef(void 0);if(!Js(t)){const{renderer:o,...i}=t;s.current=o,Al(i)}return p.useEffect(()=>{Js(t)&&t().then(({renderer:o,...i})=>{Al(i),s.current=o,r(!0)})},[]),a.jsx(Zs.Provider,{value:{renderer:s.current,strict:n},children:e})}function Js(e){return typeof e=="function"}const Qm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function rr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Qm.has(e)}let Ml=e=>!rr(e);function Rm(e){typeof e=="function"&&(Ml=t=>t.startsWith("on")?!rr(t):e(t))}try{Rm(require("@emotion/is-prop-valid").default)}catch{}function eg(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Ml(s)||n===!0&&rr(s)||!t&&!rr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const sr=p.createContext({});function ar(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function hn(e){return typeof e=="string"||Array.isArray(e)}const Qs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rs=["initial",...Qs];function or(e){return ar(e.animate)||Rs.some(t=>hn(e[t]))}function Il(e){return!!(or(e)||e.variants)}function tg(e,t){if(or(e)){const{initial:n,animate:r}=e;return{initial:n===!1||hn(n)?n:void 0,animate:hn(r)?r:void 0}}return e.inherit!==!1?t:{}}function ng(e){const{initial:t,animate:n}=tg(e,p.useContext(sr));return p.useMemo(()=>({initial:t,animate:n}),[Dl(t),Dl(n)])}function Dl(e){return Array.isArray(e)?e.join(" "):e}function Pl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Pl(e,t.target.x),r=Pl(e,t.target.y);return`${n}% ${r}%`}},rg={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ze.parse(e);if(s.length>5)return r;const o=Ze.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const c=fn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=c),typeof s[3+i]=="number"&&(s[3+i]/=c),o(s)}},sg={borderRadius:{...mn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mn,borderTopRightRadius:mn,borderBottomLeftRadius:mn,borderBottomRightRadius:mn,boxShadow:rg};function Fl(e,{layout:t,layoutId:n}){return It.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!sg[e]||e==="opacity")}const ag={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},og=Mt.length;function ig(e,t,n){let r="",s=!0;for(let o=0;o<og;o++){const i=Mt[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number"?l=u===(i.startsWith("scale")?1:0):l=parseFloat(u)===0,!l||n){const c=hl(u,Ks[i]);if(!l){s=!1;const d=ag[i]||i;r+=`${d}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ea(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const c=t[l];if(It.has(l)){i=!0;continue}else if(Du(l)){s[l]=c;continue}else{const d=hl(c,Ks[l]);l.startsWith("origin")?(u=!0,o[l]=d):r[l]=d}}if(t.transform||(i||n?r.transform=ig(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;r.transformOrigin=`${l} ${c} ${d}`}}const ta=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vl(e,t,n){for(const r in t)!ge(t[r])&&!Fl(r,n)&&(e[r]=t[r])}function ug({transformTemplate:e},t){return p.useMemo(()=>{const n=ta();return ea(n,t,e),Object.assign({},n.vars,n.style)},[t])}function lg(e,t){const n=e.style||{},r={};return Vl(r,n,e),Object.assign(r,ug(e,t)),r}function cg(e,t){const n={},r=lg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const dg={offset:"stroke-dashoffset",array:"stroke-dasharray"},wg={offset:"strokeDashoffset",array:"strokeDasharray"};function fg(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?dg:wg;e[o.offset]=L.transform(-r);const i=L.transform(t),u=L.transform(n);e[o.array]=`${i} ${u}`}function Ll(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,c,d){if(ea(e,u,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:h}=e;w.transform&&(h.transform=w.transform,delete w.transform),(h.transform||w.transformOrigin)&&(h.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete w.transformBox),t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&fg(w,s,o,i,!1)}const _l=()=>({...ta(),attrs:{}}),Ol=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pg(e,t,n,r){const s=p.useMemo(()=>{const o=_l();return Ll(o,t,Ol(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Vl(o,e.style,e),s.style={...o,...s.style}}return s}const hg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function na(e){return typeof e!="string"||e.includes("-")?!1:!!(hg.indexOf(e)>-1||/[A-Z]/u.test(e))}function mg(e,t,n,{latestValues:r},s,o=!1){const u=(na(e)?pg:cg)(t,r,s,e),l=eg(t,typeof e=="string",o),c=e!==p.Fragment?{...l,...u,ref:n}:{},{children:d}=t,w=p.useMemo(()=>ge(d)?d.get():d,[d]);return p.createElement(e,{...c,children:w})}function Wl(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ra(e,t,n,r){if(typeof t=="function"){const[s,o]=Wl(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=Wl(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function gg(e){return ge(e)?e.get():e}function bg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:yg(n,r,s,e),renderState:t()}}function yg(e,t,n,r){const s={},o=r(e,{});for(const h in o)s[h]=gg(o[h]);let{initial:i,animate:u}=e;const l=or(e),c=Il(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const w=d?u:i;if(w&&typeof w!="boolean"&&!ar(w)){const h=Array.isArray(w)?w:[w];for(let m=0;m<h.length;m++){const b=ra(e,h[m]);if(b){const{transitionEnd:g,transition:x,...S}=b;for(const y in S){let N=S[y];if(Array.isArray(N)){const C=d?N.length-1:0;N=N[C]}N!==null&&(s[y]=N)}for(const y in g)s[y]=g[y]}}}return s}const Bl=e=>(t,n)=>{const r=p.useContext(sr),s=p.useContext(jn),o=()=>bg(e,t,r,s);return n?o():ps(o)};function sa(e,t,n){var o;const{style:r}=e,s={};for(const i in r)(ge(r[i])||t.style&&ge(t.style[i])||Fl(i,e)||((o=n==null?void 0:n.getValue(i))==null?void 0:o.liveStyle)!==void 0)&&(s[i]=r[i]);return s}const xg=Bl({scrapeMotionValuesFromProps:sa,createRenderState:ta});function zl(e,t,n){const r=sa(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const o=Mt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const vg=Bl({scrapeMotionValuesFromProps:zl,createRenderState:_l}),Ng=Symbol.for("motionComponentSymbol");function ql(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sg(e,t,n){return p.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ql(n)&&(n.current=r))},[t])}const aa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$l="data-"+aa("framerAppearId"),Cg=p.createContext({});function Tg(e,t,n,r,s){var g,x;const{visualElement:o}=p.useContext(sr),i=p.useContext(Zs),u=p.useContext(jn),l=p.useContext(Xs).reducedMotion,c=p.useRef(null);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,w=p.useContext(Cg);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Eg(c.current,n,s,w);const h=p.useRef(!1);p.useInsertionEffect(()=>{d&&h.current&&d.update(n,u)});const m=n[$l],b=p.useRef(!!m&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,m))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,m)));return cu(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),b.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!b.current&&d.animationState&&d.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,m)}),b.current=!1),d.enteringChildren=void 0)}),d}function Eg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Hl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ql(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Hl(e){if(e)return e.options.allowProjection!==!1?e.projection:Hl(e.parent)}function Ag(e,{forwardMotionProps:t=!1}={},n,r){const s=na(e)?vg:xg;function o(u,l){let c;const d={...p.useContext(Xs),...u,layoutId:kg(u)},{isStatic:w}=d,h=ng(u),m=s(u,w);if(!w&&hs){Mg(d,n);const b=Ig(d);c=b.MeasureLayout,h.visualElement=Tg(e,m,d,r,b.ProjectionNode)}return a.jsxs(sr.Provider,{value:h,children:[c&&h.visualElement?a.jsx(c,{visualElement:h.visualElement,...d}):null,mg(e,u,Sg(m,h.visualElement,l),m,w,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const i=p.forwardRef(o);return i[Ng]=e,i}function kg({layoutId:e}){const t=p.useContext(lu).id;return t&&e!==void 0?t+"-"+e:e}function Mg(e,t){p.useContext(Zs).strict,process.env.NODE_ENV}function Ig(e){const{drag:t,layout:n}=Dt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Dg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Pg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fg(e,t){return Dg(Pg(e.getBoundingClientRect(),t))}const Ul=()=>({min:0,max:0}),jl=()=>({x:Ul(),y:Ul()}),oa={current:null},Gl={current:!1};function Vg(){if(Gl.current=!0,!!hs)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>oa.current=e.matches;e.addEventListener("change",t),t()}else oa.current=!1}const Lg=new WeakMap;function _g(e,t,n){for(const r in t){const s=t[r],o=n[r];if(ge(s))e.addValue(r,s);else if(ge(o))e.addValue(r,er(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,er(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Kl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Og{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Us,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ke.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,_e.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=or(n),this.isVariantNode=Il(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...w}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in w){const m=w[h];l[h]!==void 0&&ge(m)&&m.set(l[h])}}mount(t){var n;this.current=t,Lg.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),Gl.current||Vg(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:oa.current,process.env.NODE_ENV!=="production"&&gu(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),xs(this.notifyUpdate),xs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=It.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&_e.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Dt){const n=Dt[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Kl.length;r++){const s=Kl[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=_g(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=er(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(du(r)||wu(r))?r=parseFloat(r):!Um(r)&&Ze.test(n)&&(r=pl(t,n)),this.setBaseTarget(t,ge(r)?r.get():r)),ge(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ra(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ge(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new pu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Vm.render(this.render)}}class Yl extends Og{constructor(){super(...arguments),this.KeyframeResolver=Im}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Xl(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Wg(e){return window.getComputedStyle(e)}class Bg extends Yl{constructor(){super(...arguments),this.type="html",this.renderInstance=Xl}readValueFromInstance(t,n){var r;if(It.has(n))return(r=this.projection)!=null&&r.isProjecting?Bs(n):Xh(t,n);{const s=Wg(t),o=(Du(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fg(t,n)}build(t,n,r){ea(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sa(t,n,r)}}const Zl=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function zg(e,t,n,r){Xl(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Zl.has(s)?s:aa(s),t.attrs[s])}class qg extends Yl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=jl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(It.has(n)){const r=fl(n);return r&&r.default||0}return n=Zl.has(n)?n:aa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zl(t,n,r)}build(t,n,r){Ll(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){zg(t,n,r,s)}mount(t){this.isSVGTag=Ol(t.tagName),super.mount(t)}}const $g=(e,t)=>na(e)?new qg(t):new Bg(t,{allowProjection:e!==p.Fragment});function Pt(e,t,n){const r=e.getProps();return ra(r,t,n!==void 0?n:r.custom,e)}const ia=e=>Array.isArray(e);function Hg(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,er(n))}function Ug(e){return ia(e)?e[e.length-1]||0:e}function jg(e,t){const n=Pt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Ug(o[i]);Hg(e,i,u)}}function Gg(e){return!!(ge(e)&&e.add)}function Kg(e,t){const n=e.getValue("willChange");if(Gg(n))return n.add(t);if(!n&&je.WillChange){const r=new je.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Yg(e){return e.props[$l]}const Xg=e=>e!==null;function Zg(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Xg),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const Jg={type:"spring",stiffness:500,damping:25,restSpeed:10},Qg=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rg={type:"keyframes",duration:.8},eb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tb=(e,{keyframes:t})=>t.length>2?Rg:It.has(e)?e.startsWith("scale")?Qg(t[1]):Jg:eb;function nb({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:u,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const rb=(e,t,n,r={},s,o)=>i=>{const u=il(r,e)||{},l=u.delay||r.delay||0;let{elapsed:c=0}=r;c=c-$e(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-c,onUpdate:h=>{t.set(h),u.onUpdate&&u.onUpdate(h)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};nb(u)||Object.assign(d,tb(e,d)),d.duration&&(d.duration=$e(d.duration)),d.repeatDelay&&(d.repeatDelay=$e(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let w=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(js(d),d.delay===0&&(w=!0)),(je.instantAnimations||je.skipAnimations)&&(w=!0,js(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const h=Zg(d.keyframes,u);if(h!==void 0){_e.update(()=>{d.onUpdate(h),d.onComplete()});return}}return u.isSync?new _s(d):new bm(d)};function sb({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Jl(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...u}=t;r&&(o=r);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const d in u){const w=e.getValue(d,e.latestValues[d]??null),h=u[d];if(h===void 0||c&&sb(c,d))continue;const m={delay:n,...il(o||{},d)},b=w.get();if(b!==void 0&&!w.isAnimating&&!Array.isArray(h)&&h===b&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const S=Yg(e);if(S){const y=window.MotionHandoffAnimation(S,d,_e);y!==null&&(m.startTime=y,g=!0)}}Kg(e,d),w.start(rb(d,w,h,e.shouldReduceMotion&&ul.has(d)?{type:!1}:m,e,g));const x=w.animation;x&&l.push(x)}return i&&Promise.all(l).then(()=>{_e.update(()=>{i&&jg(e,i)})}),l}function Ql(e,t,n,r=0,s=1){const o=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}function ua(e,t,n={}){var l;const r=Pt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(Jl(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:w,staggerDirection:h}=s;return ab(e,t,c,d,w,h,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[c,d]=u==="beforeChildren"?[o,i]:[i,o];return c().then(()=>d())}else return Promise.all([o(),i(n.delay)])}function ab(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(ua(l,t,{...i,delay:n+(typeof r=="function"?0:r)+Ql(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function ob(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>ua(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=ua(e,t,n);else{const s=typeof t=="function"?Pt(e,t,n.custom):t;r=Promise.all(Jl(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Rl(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ib=Rs.length;function ec(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ec(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ib;n++){const r=Rs[n],s=e.props[r];(hn(s)||s===!1)&&(t[r]=s)}return t}const ub=[...Qs].reverse(),lb=Qs.length;function cb(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ob(e,n,r)))}function db(e){let t=cb(e),n=tc(),r=!0;const s=l=>(c,d)=>{var h;const w=Pt(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(w){const{transition:m,transitionEnd:b,...g}=w;c={...c,...g,...b}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,d=ec(e.parent)||{},w=[],h=new Set;let m={},b=1/0;for(let x=0;x<lb;x++){const S=ub[x],y=n[S],N=c[S]!==void 0?c[S]:d[S],C=hn(N),E=S===l?y.isActive:null;E===!1&&(b=x);let M=N===d[S]&&N!==c[S]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),y.protectedKeys={...m},!y.isActive&&E===null||!N&&!y.prevProp||ar(N)||typeof N=="boolean")continue;const A=wb(y.prevProp,N);let k=A||S===l&&y.isActive&&!M&&C||x>b&&C,D=!1;const F=Array.isArray(N)?N:[N];let V=F.reduce(s(S),{});E===!1&&(V={});const{prevResolvedValues:$={}}=y,W={...$,...V},G=I=>{k=!0,h.has(I)&&(D=!0,h.delete(I)),y.needsAnimating[I]=!0;const _=e.getValue(I);_&&(_.liveStyle=!1)};for(const I in W){const _=V[I],z=$[I];if(m.hasOwnProperty(I))continue;let B=!1;ia(_)&&ia(z)?B=!Rl(_,z):B=_!==z,B?_!=null?G(I):h.add(I):_!==void 0&&h.has(I)?G(I):y.protectedKeys[I]=!0}y.prevProp=N,y.prevResolvedValues=V,y.isActive&&(m={...m,...V}),r&&e.blockInitialAnimation&&(k=!1);const q=M&&A;k&&(!q||D)&&w.push(...F.map(I=>{const _={type:S};if(typeof I=="string"&&r&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,B=Pt(z,I);if(z.enteringChildren&&B){const{delayChildren:ne}=B.transition||{};_.delay=Ql(z.enteringChildren,e,ne)}}return{animation:I,options:_}}))}if(h.size){const x={};if(typeof c.initial!="boolean"){const S=Pt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);S&&S.transition&&(x.transition=S.transition)}h.forEach(S=>{const y=e.getBaseTarget(S),N=e.getValue(S);N&&(N.liveStyle=!0),x[S]=y??null}),w.push({animation:x})}let g=!!w.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(w):Promise.resolve()}function u(l,c){var w;if(n[l].isActive===c)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:i,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tc()}}}function wb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Rl(t,e):!1}function lt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tc(){return{animate:lt(!0),whileInView:lt(),whileHover:lt(),whileTap:lt(),whileDrag:lt(),whileFocus:lt(),exit:lt()}}class Ft{constructor(t){this.isMounted=!1,this.node=t}update(){}}class fb extends Ft{constructor(t){super(t),t.animationState||(t.animationState=db(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ar(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let pb=0;class hb extends Ft{constructor(){super(...arguments),this.id=pb++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const mb={animation:{Feature:fb},exit:{Feature:hb}};function nc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rc(e){return{point:{x:e.pageX,y:e.pageY}}}function sc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&_e.postRender(()=>o(t,rc(t)))}class gb extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=Om(t,(n,r)=>(sc(this.node,r,"Start"),s=>sc(this.node,s,"End"))))}unmount(){}}class bb extends Ft{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gn(nc(this.node.current,"focus",()=>this.onFocus()),nc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ac(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&_e.postRender(()=>o(t,rc(t)))}class yb extends Ft{mount(){const{current:t}=this.node;t&&(this.unmount=$m(t,(n,r)=>(ac(this.node,r,"Start"),(s,{success:o})=>ac(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const la=new WeakMap,ca=new WeakMap,xb=e=>{const t=la.get(e.target);t&&t(e)},vb=e=>{e.forEach(xb)};function Nb({root:e,...t}){const n=e||document;ca.has(n)||ca.set(n,{});const r=ca.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(vb,{root:e,...t})),r[s]}function Sb(e,t,n){const r=Nb(t);return la.set(e,n),r.observe(e),()=>{la.delete(e),r.unobserve(e)}}const Cb={some:0,all:1};class Tb extends Ft{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Cb[s]},u=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:w}=this.node.getProps(),h=c?d:w;h&&h(l)};return Sb(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Eb(t,n))&&this.startObserver()}unmount(){}}function Eb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oc={renderer:$g,...mb,...{inView:{Feature:Tb},tap:{Feature:yb},focus:{Feature:bb},hover:{Feature:gb}}};function Ab(e,t){return Ag(e,t)}const ic=Ab("div"),kb=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o})=>a.jsxs("div",{className:f("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-transform wu-items-center wu-origin-left wu-w-full wu-transition-[height_opacity] wu-duration-300",t!==n?"wu-opacity-100 wu-delay-200 wu-z-50 ":"wu-opacity-0 wu-delay-0 -wu-z-10",s),style:{height:t!==n?`${o}px`:"0px"},children:[a.jsx(Fr,{Trigger:a.jsx(ce,{variant:"iconOnly",className:"wu-w-6 wu-h-6 wu-shrink-0 wu-p-0",Icon:a.jsx("span",{className:"wm-arrow-drop-down wu-w-5 wu-h-5"})}),children:e.map(i=>a.jsx(An,{onSelect:u=>r(u,i.id),children:i.title},i.id))}),a.jsx("div",{className:"wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-1 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(kl,{features:oc,children:a.jsxs(Tl,{initial:!1,mode:"popLayout",children:[Mb(e).map((i,u)=>a.jsx(ic,{initial:{y:8,opacity:0,zIndex:0},animate:{y:0,opacity:1,zIndex:50},exit:{y:-8,opacity:0,zIndex:0},transition:{duration:.3},children:a.jsxs("h6",{"data-id":i.id,onClick:r,className:f("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-1",u===2||u===1||i.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70",i.id==="LEVEL_DOTS"&&"wu-text-[#1B87E6]"),children:[u!==0&&a.jsx("span",{className:"wm-chevron-right wu-text-lg"}),i.title]})},i.id)),"``"]})})})]}),Mb=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},Ib=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default"})=>{const[u,l]=p.useState(n?[n]:[]),[[c,d],w]=p.useState([t,1]),h=(x,S)=>{S&&l([...u,S]),w([x,1])},m=x=>{const S=u.findIndex(y=>y.id===x);if(S!==-1){const y=u.slice(0,S+1);l(y)}w([x,-1])},b=(x,S)=>{const y=S||x.currentTarget.getAttribute("data-id")||"";if(y&&y!==c){const N=u.findIndex(C=>C.id===y);N!==-1&&(l(u.slice(0,N+1)),m(y))}},g=()=>{const x=e[c]?e[c]:null;if(!x)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const S=typeof x.component=="function"?x.component({goNext:h,goBack:m}):x.component;return a.jsx(ic,{custom:d,variants:Db(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:S},c)};return a.jsxs("div",{className:"wu-h-full wu-relative wu-overflow-hidden wu-w-full wu-flex wu-flex-col",children:[a.jsx(kb,{titles:u,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o}),a.jsx(kl,{features:oc,children:a.jsx(Tl,{initial:!1,custom:d,mode:r,children:g()})})]})},Db=e=>{switch(e){case"slideRight":return Fb;case"slideLeft":return Vb;case"fadeZoom":return Lb;case"default":default:return Pb}},Pb={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},Fb={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Vb={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},Lb={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},X={WuContentEditor:"_WuContentEditor_ylyja_8",EditorAction:"_EditorAction_ylyja_70",EditorActionActive:"_EditorActionActive_ylyja_73"},uc=p.createContext(null),_b=({editor:e,children:t,customFonts:n})=>a.jsx(uc.Provider,{value:{editor:e,customFonts:n},children:t}),he=()=>{const e=p.useContext(uc);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},da=({action:e,defaultValue:t})=>{var s;const[n,r]=p.useState();return p.useEffect(()=>{r(t||e.items.find(o=>o.active)||e.items[0])},[e,t]),a.jsxs(zt.DropdownMenu,{children:[a.jsx(zt.DropdownMenuTrigger,{className:f(X.EditorAction,e.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:n==null?void 0:n.icon})}),a.jsx(zt.DropdownMenuContent,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px] wu-border wu-border-blue-p wu-rounded wu-bg-white",align:"start",children:(s=e.items)==null?void 0:s.map(o=>a.jsx(zt.DropdownMenuItem,{onClick:()=>{o.event(),r(o)},title:o.tooltip,children:a.jsx("button",{className:f(X.EditorAction,o.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:a.jsx(re,{icon:o.icon})})},o.id))})]})},Ob=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isParagraph:(s=r.editor)==null?void 0:s.isActive("paragraph"),isH1:(o=r.editor)==null?void 0:o.isActive("heading",{level:1}),isH2:(i=r.editor)==null?void 0:i.isActive("heading",{level:2}),isH3:(u=r.editor)==null?void 0:u.isActive("heading",{level:3}),isH4:(l=r.editor)==null?void 0:l.isActive("heading",{level:4}),isStyle:(c=r.editor)==null?void 0:c.isActive("heading")}}}),n=[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run(),active:t.isParagraph},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run(),active:t.isH1},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run(),active:t.isH2},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run(),active:t.isH3},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run(),active:t.isH4}];return a.jsx(da,{action:{id:"style",active:t.isStyle,icon:"wm-format-paragraph",items:n},defaultValue:n.find(r=>r.active)})},Wb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:({editor:n})=>({textColor:n.getAttributes("textStyle").color})});return a.jsxs("label",{className:X.EditorAction,htmlFor:"text-color",title:"Text Color",children:[a.jsx(re,{icon:"wm-format-color-text",className:"wu-cursor-pointer",style:{color:t.textColor}}),a.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"text-color",defaultValue:"#545E6B",onChange:n=>e.chain().focus().setColor(n.target.value).run()})]})},Bb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c;return{isUl:(s=r.editor)==null?void 0:s.isActive("bulletList"),isOl:(o=r.editor)==null?void 0:o.isActive("orderedList"),isTodo:(i=r.editor)==null?void 0:i.isActive("taskList"),isList:((u=r.editor)==null?void 0:u.isActive("bulletList"))||((l=r.editor)==null?void 0:l.isActive("orderedList"))||((c=r.editor)==null?void 0:c.isActive("taskList"))}}}),n=[{id:"ul",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run(),active:t.isUl,tooltip:"Bulleted List"},{id:"ol",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run(),active:t.isOl,tooltip:"Numbered List"},{id:"todo",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run(),active:t.isTodo,tooltip:"To-Do List"}];return a.jsx(da,{action:{id:"style",active:t.isList,icon:"wm-format-paragraph",items:n}})},zb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:r=>{var s,o,i,u,l,c,d;return{isLeft:(s=r.editor)==null?void 0:s.isActive({textAlign:"left"}),isCenter:(o=r.editor)==null?void 0:o.isActive({textAlign:"center"}),isRight:(i=r.editor)==null?void 0:i.isActive({textAlign:"right"}),isJustify:(u=r.editor)==null?void 0:u.isActive({textAlign:"justify"}),isAligned:((l=r.editor)==null?void 0:l.isActive({textAlign:"center"}))||((c=r.editor)==null?void 0:c.isActive({textAlign:"right"}))||((d=r.editor)==null?void 0:d.isActive({textAlign:"justify"}))}}}),n=[{id:"left",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run(),tooltip:"Align Left",active:t.isLeft},{id:"center",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run(),tooltip:"Align Center",active:t.isCenter},{id:"right",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run(),tooltip:"Align Right",active:t.isRight},{id:"justify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",active:t.isJustify}];return a.jsx(da,{action:{id:"style",active:t.isAligned,icon:"wm-format-paragraph",items:n}})},qb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>({code:n.editor.isActive("code")})});return a.jsx("button",{title:"Code line",className:f(X.EditorAction,(t==null?void 0:t.code)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleCode().run,children:a.jsx(re,{icon:"wm-code"})})},$b=()=>{const{editor:e}=he(),t=[{id:"clear",icon:"wm-format-clear",event:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),tooltip:"Clear Formatting"}];return a.jsx(a.Fragment,{children:t.map(n=>a.jsx("button",{title:n.tooltip,className:f(X.EditorAction),onClick:n.event,children:a.jsx(re,{icon:n.icon})},n.id))})},Hb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{blockquote:(r=n.editor)==null?void 0:r.isActive("blockquote")}}});return a.jsx("button",{title:"quote",className:f(X.EditorAction,(t==null?void 0:t.quote)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleBlockquote().run,children:a.jsx(re,{icon:"wm-format-quote"})})},Ub=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{superscript:(r=n.editor)==null?void 0:r.isActive("superscript")}}});return a.jsx("button",{title:"Superscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSuperscript().run,children:a.jsx(re,{icon:"wm-superscript"})})},jb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{subscript:(r=n.editor)==null?void 0:r.isActive("subscript")}}});return a.jsx("button",{title:"Subscript",className:f(X.EditorAction,(t==null?void 0:t.superscript)&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:e.chain().focus().toggleSubscript().run,children:a.jsx(re,{icon:"wm-subscript"})})},Gb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{bold:(r=n.editor)==null?void 0:r.isActive("bold")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleBold().run,children:a.jsx(re,{icon:"wm-format-bold"})})},Kb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{italic:(r=n.editor)==null?void 0:r.isActive("italic")}}});return a.jsx("button",{title:"Italic",className:f(X.EditorAction,(t==null?void 0:t.italic)&&X.EditorActionActive),onClick:e.chain().focus().toggleItalic().run,children:a.jsx(re,{icon:"wm-format-italic"})})},Yb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{underline:(r=n.editor)==null?void 0:r.isActive("underline")}}});return a.jsx("button",{title:"Bold",className:f(X.EditorAction,(t==null?void 0:t.bold)&&X.EditorActionActive),onClick:e.chain().focus().toggleUnderline().run,children:a.jsx(re,{icon:"wm-format-underlined"})})},Xb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:n=>{var r;return{strikethrough:(r=n.editor)==null?void 0:r.isActive("strike")}}});return a.jsx("button",{title:"strikethrough",className:f(X.EditorAction,(t==null?void 0:t.strikethrough)&&X.EditorActionActive),onClick:e.chain().focus().toggleStrike().run,children:a.jsx(re,{icon:"wm-format-strikethrough"})})},Zb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:w=>({isTable:w.editor.isActive("table"),tableAttrs:w.editor.getAttributes("table")})}),[n,r]=p.useState(t.tableAttrs.rows||2),[s,o]=p.useState(t.tableAttrs.cols||2),[i,u]=p.useState(!1),l=p.useRef(null),c=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().insertTable({rows:n,cols:s,withHeaderRow:i}).run()},100)},[e,n,s,i]),d=p.useCallback(()=>{l.current=setTimeout(()=>{e.chain().focus().deleteTable().run()},100)},[e]);return a.jsx(kn,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isTable&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-table"})}),hideCloseButton:!0,maxWidth:"360px",children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),t.isTable?a.jsxs("div",{className:"wu-space-y-4 wu-mt-2",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-4",children:[a.jsx(ce,{onClick:()=>e.chain().focus().addColumnBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Left"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Top"}),a.jsx(ce,{onClick:()=>e.chain().focus().addColumnAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Right"}),a.jsx(ce,{onClick:()=>e.chain().focus().addRowAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Bottom"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteColumn().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Column"}),a.jsx(ce,{onClick:()=>e.chain().focus().deleteRow().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Row"})]}),a.jsx(ce,{onClick:()=>e.chain().focus().toggleHeaderRow().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Toggle Header Row"})]}):a.jsxs("div",{className:"wu-space-y-3",children:[a.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-3",children:[a.jsx(Te,{Label:"Rows",type:"number",min:1,value:n,onChange:w=>r(Number(w.target.value))}),a.jsx(Te,{Label:"Columns",type:"number",min:1,value:s,onChange:w=>o(Number(w.target.value))})]}),a.jsx(Ae,{Label:"Add header row",checked:i,onChange:u})]}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2 wu-mt-4",children:[a.jsx(Ye,{variant:"secondary",children:"Cancel"}),!t.isTable&&a.jsx(Ye,{onClick:c,children:"Insert"}),t.isTable&&a.jsx(Ye,{color:"error",onClick:d,children:"Delete Table"})]})]})})},Jb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:u=>{var l,c;return{isImage:(l=u.editor)==null?void 0:l.isActive("image"),imageAttrs:(c=u.editor)==null?void 0:c.getAttributes("image")}}}),[n,r]=p.useState(t.imageAttrs.src||""),[s,o]=p.useState(t.imageAttrs.alt||""),i=()=>{e.chain().focus().setImage({src:n,alt:s}).run()};return a.jsx(kn,{hideCloseButton:!0,Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isImage&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-image"})}),maxWidth:"400px",children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Image URL",type:"url",value:n,onChange:u=>r(u.target.value),required:!0}),a.jsx(Te,{Label:"Alt Text",type:"text",value:s,onChange:u=>o(u.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[a.jsx(Ye,{variant:"secondary",children:"Cancel"}),a.jsx(Ye,{onClick:i,disabled:!n,children:"Save"})]})]})})},Qb=()=>{const{editor:e}=he(),t=we.useEditorState({editor:e,selector:l=>{var c,d;return{isLink:(c=l.editor)==null?void 0:c.isActive("link"),linkAttrs:(d=l.editor)==null?void 0:d.getAttributes("link")}}}),[n,r]=p.useState(t.linkAttrs.href||""),[s,o]=p.useState(t.linkAttrs.alt||""),i=()=>{e.chain().focus().insertContent({type:"text",text:s||n,marks:[{type:"link",attrs:{href:n}}]}).run()},u=()=>{const{$from:l}=e.state.selection,c=l.parent.textContent,d=l.parentOffset;let w=d,h=d;for(;w>0&&!/\s/.test(c[w-1]);)w--;for(;h<c.length&&!/\s/.test(c[h]);)h++;const m=l.start(),b=m+w,g=m+h,x=c.slice(w,h);e.commands.setTextSelection({from:b,to:g}),r(t.linkAttrs.href||""),o(x||t.linkAttrs.alt||"")};return a.jsx(kn,{Trigger:a.jsx("button",{className:`${X.EditorAction} ${t.isLink&&X.EditorActionActive}`,children:a.jsx(re,{icon:"wm-link"})}),maxWidth:"400px",onOpenChange:l=>l&&u(),children:a.jsxs(Mn,{children:[a.jsx(xt,{className:"wu-hidden"}),a.jsx(Te,{Label:"Link",type:"url",value:n,onChange:l=>r(l.target.value),required:!0}),a.jsx(Te,{Label:"Text to display",type:"text",value:s,onChange:l=>o(l.target.value)}),a.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[t.isLink&&a.jsx(Ye,{color:"error",onClick:()=>e.chain().focus().unsetLink().run(),variant:"secondary",children:"Remove"}),a.jsx(Ye,{onClick:i,disabled:!n,children:"Save"})]})]})})},Rb=["e","E","+","-"],ey="wu-border wu-rounded wu-w-10 wu-h-6 wu-text-center [appearance:textfield] [&::-webkit-outer-spin-button]:wu-appearance-none [&::-webkit-inner-spin-button]:wu-appearance-none focus:wu-border-blue-p",lc=1,ty=()=>{const{editor:e}=he(),[t,n]=p.useState(16),r=we.useEditorState({editor:e,selector:u=>({fontSize:u.editor.getAttributes("textStyle").fontSize})}),s=u=>{e.chain().focus().setFontSize(u+"px").run()},o=u=>{const l=Math.max(lc,u);n(l),s(l)},i=u=>{Rb.includes(u.key)?u.preventDefault():u.key==="Enter"&&s(t)};return p.useEffect(()=>{var u;n(Number((u=r.fontSize)==null?void 0:u.replace("px",""))||16)},[r.fontSize]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-1",children:[a.jsx("button",{className:X.EditorAction,onClick:()=>o(t-1),disabled:t<=lc,children:"−"}),a.jsx("input",{type:"number",inputMode:"numeric",pattern:"[0-9]*",className:ey,value:t,onKeyDown:i,onChange:u=>n(u.target.valueAsNumber),onBlur:()=>s(t)}),a.jsx("button",{className:X.EditorAction,onClick:()=>o(t+1),disabled:t>=128,children:"+"})]})},ny=()=>{const{editor:e,customFonts:t}=he(),n=we.useEditorState({editor:e,selector:i=>({currentFontFamily:i.editor.getAttributes("textStyle").fontFamily||""})}),r=["Fira Sans","Inter","Poppins","JetBrains Mono","Montserrat",...t||[]],[s,o]=p.useState(n.currentFontFamily||r[0]);return p.useEffect(()=>{var i;o(((i=n.currentFontFamily)==null?void 0:i.replace(/"/g,""))||r[0])},[n.currentFontFamily]),a.jsxs(Mr,{children:[a.jsx(Ir,{className:X.EditorAction+" wu-transition-colors "+(s!=="Fira Sans"&&X.EditorActionActive),style:{fontFamily:s},title:s||"Font Family",children:s==null?void 0:s[0]}),a.jsx(Tn,{align:"start",className:"wu-border-blue-p wu-rounded",children:r.map(i=>a.jsx(Kt,{title:i,onSelect:()=>{e.chain().focus().setFontFamily(i).run(),o(i)},className:s===i?X.EditorActionActive:"",children:i},i))})]})},ry={block:a.jsx(Ob,{}),fontFamily:a.jsx(ny,{}),fontSize:a.jsx(ty,{}),bold:a.jsx(Gb,{}),italic:a.jsx(Kb,{}),underline:a.jsx(Yb,{}),strike:a.jsx(Xb,{}),color:a.jsx(Wb,{}),list:a.jsx(Bb,{}),alignment:a.jsx(zb,{}),image:a.jsx(Jb,{}),link:a.jsx(Qb,{}),table:a.jsx(Zb,{}),blockquote:a.jsx(Hb,{}),superscript:a.jsx(Ub,{}),subscript:a.jsx(jb,{}),codeline:a.jsx(qb,{}),clear:a.jsx($b,{}),"|":a.jsx(Wr,{orientation:"vertical",className:"wu-h-5"})},sy=["block","fontFamily","|","fontSize","|","bold","italic","underline","strike","|","color","|","list","alignment","|","image","link","table","|","blockquote","superscript","subscript","codeline","|","clear"],ay=e=>{const{editor:t,customFonts:n,children:r,items:s=sy,...o}=e;return a.jsx("div",{...o,children:a.jsx(_b,{editor:t,customFonts:n,children:a.jsxs("div",{className:"wu-flex wu-gap-1 wu-p-2 wu-items-center wu-justify-start wu-border-gray-40",children:[s.map((i,u)=>a.jsx(a.Fragment,{children:ry[i]},i+u)),r]})})})},oy=[Dc.configure({link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const n=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(n.href))return!1;const r=["ftp","file","mailto"],s=n.protocol.replace(":","");if(r.includes(s)||!t.protocols.map(l=>typeof l=="string"?l:l.scheme).includes(s))return!1;const i=["example-phishing.com","malicious-site.net"],u=n.hostname;return!i.includes(u)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),n=["example-no-autolink.com","another-no-autolink.com"],r=t.hostname;return!n.includes(r)}catch{return!1}}}}),Ic.configure({types:["heading","paragraph"]}),kc,Ac,pt.TextStyle,pt.Color,pt.BackgroundColor,ha.TaskList,ha.TaskItem,pt.LineHeight,pt.FontSize,pt.FontFamily,Pc.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),Mc.TableKit.configure({table:{resizable:!0}})],iy=e=>{const{defaultValue:t,onUpdate:n,className:r,readonly:s,toolbarPosition:o="top",classNames:i={},customToolbarChildren:u,toolbarItems:l,...c}=e,d=we.useEditor({editable:!s,extensions:oy,content:t,onUpdate:({editor:w})=>{n&&n(w.getHTML())}});return a.jsxs("div",{className:f(X.WuContentEditor,r,o==="top"?"wu-flex-col":"wu-flex-col-reverse"),...c,children:[a.jsx(ay,{editor:d,customFonts:e.customFonts,className:f("wu-sticky wu-z-10 wu-bg-white",i.toolbar,o==="top"?"wu-top-0 wu-border-b":"wu-bottom-0 wu-border-t"),items:l,children:u}),a.jsx(we.EditorContent,{editor:d,className:f("wu-p-4 wu-flex-grow",i.editor)})]})};window.wickUiVersion="1.24.0",Object.defineProperty(T,"useContext",{enumerable:!0,get:()=>p.useContext}),T.CHART_COLOR_SYSTEM=Hp,T.WuAccordion=_c,T.WuAppHeader=id,T.WuAppHeaderAccount=Ca,T.WuAppHeaderBar=Ma,T.WuAppHeaderHelp=Ta,T.WuAppHeaderMenu=ka,T.WuAppHeaderSearch=ad,T.WuButton=ce,T.WuCalender=Sr,T.WuCard=Oa,T.WuCardFooter=Ba,T.WuCardHeader=Wa,T.WuCheckbox=Ae,T.WuChip=pd,T.WuCombobox=Sd,T.WuContentEditor=iy,T.WuCopyToClipboard=Cd,T.WuDataTable=yp,T.WuDatePicker=ld,T.WuDateRangePicker=wd,T.WuDisplay=Kc,T.WuDrawer=Dd,T.WuDrawerClose=Pd,T.WuDrilldown=Ib,T.WuFooter=Ra,T.WuFormGroup=sd,T.WuHeading=jc,T.WuHelpButton=eo,T.WuIcon=re,T.WuInput=Te,T.WuInputError=td,T.WuInputHint=nd,T.WuLabel=Ce,T.WuListbox=Bd,T.WuLoader=gt,T.WuMenu=Fr,T.WuMenuCheckboxItem=zd,T.WuMenuIcon=Vr,T.WuMenuItem=An,T.WuMenuItemGroup=qd,T.WuMenuRadioItem=$d,T.WuMenuSeparatorItem=Hd,T.WuModal=kn,T.WuModalClose=Ye,T.WuModalContent=Mn,T.WuModalFooter=Rd,T.WuModalHeader=Qd,T.WuMonthPicker=sw,T.WuPagination=mo,T.WuPopover=uw,T.WuPopoverClose=lw,T.WuPrimaryNavbar=ow,T.WuRadioGroup=xo,T.WuScrollArea=cw,T.WuSecondaryNavbar=iw,T.WuSelect=fo,T.WuSidebar=kw,T.WuSidebarContent=Mw,T.WuSidebarFooter=Iw,T.WuSidebarGroup=Dw,T.WuSidebarItem=Fw,T.WuSidebarMenu=Pw,T.WuSidebarTrigger=_o,T.WuSpotlight=io,T.WuStackedCard=_w,T.WuStackedCardOverlay=Ow,T.WuStepper=lp,T.WuSubMenu=Ud,T.WuSubtext=Gc,T.WuSwitcher=_i,T.WuTab=mp,T.WuTable=xp,T.WuText=Uc,T.WuTextarea=Yi,T.WuTimePicker=Ri,T.WuToast=Wp,T.WuToggle=uu,T.WuTooltip=Sn,T.WuTranslationContext=Un,T.WuTranslationProvider=$p,T.WuTruncatedLabel=od,T.WuVirtualScroll=bt,T.calculatePosition=Lw,T.useTranslation=zp,T.useTranslationsContext=qp,T.useWuShowToast=Pp,T.useWuSidebar=tt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
12
20
  //# sourceMappingURL=index.js.map