@npm-questionpro/wick-ui-lib 1.2.0 → 1.3.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.
@@ -1,2 +1,2 @@
1
- (function(g,e){typeof exports=="object"&&typeof module<"u"?e(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("@radix-ui/react-scroll-area"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):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","@radix-ui/react-scroll-area","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],e):(g=typeof globalThis<"u"?globalThis:g||self,e(g["wick-ui-lib"]={},g["react/jsx-runtime"],g.AccordionPrimitive,g.React,g.clsx,g.tailwindMerge,g.RadixUIAvatar,g.RadixUISlot,g.ClassVarianceAuthority,g.RadixUILabel,g.RadixUITooltip,g.dateFns,g.RadixUIPopover,g.ReactDayPicker,g.RadixUICheckbox,g.cmdk,g.RadixUIScrollArea,g.ReactVirtuoso,g.RadixUIDropdownMenu,g.RadixUIDialog,g.RadixUIRadioGroup,g.RadixUISeparator,g.RadixUIToggleGroup,g.RadixUIToggle,g.TanstackReactTable,g.RadixUIToast,g.RadixUISwitch))})(this,function(g,e,xr,i,yr,vr,Nr,be,J,Cr,Ke,F,ke,kt,Sr,$,kr,Dr,Tr,Mr,Ir,Wr,_r,Er,Q,qr,Or){"use strict";function j(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const we=j(xr),x=j(i),ge=j(Nr),Dt=j(Cr),De=j(Ke),Te=j(ke),Xe=j(Sr),de=j(kr),A=j(Tr),q=j(Mr),Me=j(Ir),Tt=j(Wr),Pe=j(_r),Mt=j(Er),G=j(qr),Qe=j(Or),Ar={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"}},Pr=vr.extendTailwindMerge({prefix:"wu-"});function o(...t){return Pr(yr.clsx(t))}const Ze=t=>{window.open(t,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Le(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ie(t){switch(t){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 Lr=t=>t?/\S+@questionpro\.com/.test(t):!1,Fr=we.Root,It=x.forwardRef(({className:t,...a},r)=>e.jsx(we.Item,{ref:r,className:o("wu-border-b",t),...a}));It.displayName="AccordionItem";const Wt=x.forwardRef(({className:t,children:a,...r},s)=>e.jsx(we.Header,{className:"wu-flex",children:e.jsxs(we.Trigger,{ref:s,className:o("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",t),...r,children:[a,e.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));Wt.displayName=we.Trigger.displayName;const _t=x.forwardRef(({className:t,children:a,...r},s)=>e.jsx(we.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",...r,children:e.jsx("div",{className:o("wu-pb-4 wu-pt-0",t),children:a})}));_t.displayName=we.Content.displayName;const Br=({items:t,defaultValue:a,className:r="",dir:s="ltr",value:u,onValueChange:l})=>e.jsx(Fr,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:a,value:u,onValueChange:l,dir:s,collapsible:!0,children:t.map(({value:n,Summary:d,Details:w,className:c})=>e.jsxs(It,{value:n,dir:s,className:o(r,c),children:[e.jsx(Wt,{dir:s,children:d}),e.jsx(_t,{children:w})]},n))}),Et=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Root,{ref:r,className:o("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",t),...a}));Et.displayName=ge.Root.displayName;const qt=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Image,{ref:r,className:o("wu-aspect-square wu-h-full wu-w-full",t),...a}));qt.displayName=ge.Image.displayName;const Ot=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Fallback,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",t),...a}));Ot.displayName=ge.Fallback.displayName;function Re(t,a){i.useEffect(()=>{const r=s=>{Array.isArray(t)&&t.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(t)&&(!t.current||t.current.contains(s.target))||a(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,a])}const et={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},At=({dir:t,Trigger:a,triggerClassName:r,DropdownContent:s})=>{const[u,l]=i.useState(!1),n=i.useRef(null),d=i.useRef(null);Re([n,d],()=>l(!1));const w=()=>{l(!u)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:et.dropdownContainer,children:e.jsx("ul",{children:e.jsxs("li",{className:o("wu-flex wu-relative",u&&et.open),children:[e.jsx("button",{className:o("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",r),onClick:c=>{c.preventDefault(),w()},ref:d,"aria-label":"dropdown-trigger",children:a}),e.jsx("div",{className:o(et.dropdownMenu,{open:u},t==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:t,ref:n,"aria-label":"user-menu",children:s})]})})})})},tt=J.cva("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-ring-offset-background wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-focus focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:wu-opacity-80 disabled:wu-ring-gray-subtle wu-leading-[1px]",{variants:{size:{md:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-8",sm:"wu-px-4 wu-py-1 wu-min-w-[104px] wu-h-6",mobile:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-10"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHover wu-text-blue-p wu-ring-1 wu-ring-blue-p hover:wu-text-blue-q hover:wu-ring-blue-pHover",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",error:"wu-bg-red-deep hover:wu-bg-red-deep/80 wu-text-red-deep hover:wu-text-red-deep/80 wu-ring-1 wu-ring-red-deep hover:wu-ring-red-deep/80"},variant:{primary:"wu-text-white wu-ring-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-ring-0 hover:wu-bg-gray-20 ",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent",rounded:"wu-text-white wu-ring-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-ring-0 wu-underline-offset-2 wu-min-w-[auto] wu-px-2 disabled:wu-bg-transparent",iconOnly:"wu-rounded wu-p-2 wu-text-xl wu-h-8 wu-w-8 wu-leading-5 wu-text-gray-lead hover:wu-text-blue-q hover:wu-bg-gray-20 wu-ring-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-ring-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"}}),he=x.forwardRef(({className:t,variant:a,size:r,color:s,asChild:u=!1,...l},n)=>{const d=u?be.Slot:"button";return e.jsx(d,{className:o(tt({size:r,color:s,variant:a,className:t})),ref:n,...l})});he.displayName="Button";const me=i.forwardRef((t,a)=>zr(t,a)),zr=(t,a)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...l}=t,n=o("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let d="7px";r==="sm"?d="7px":r==="md"?d="12px":r==="lg"?d="18px":typeof r=="string"&&(d=r);const w={backgroundColor:s,width:d,height:d},c=e.jsxs("div",{...l,ref:a,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",t.className),role:"status","aria-busy":"true",children:[e.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:d,height:d,borderTopColor:s}}),t.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:t.message})]}),f=e.jsxs("div",{...l,ref:a,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",t.className),role:"alert","aria-busy":"true",children:[e.jsxs("ul",{className:n,style:{fontSize:d},role:"loader",children:[e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w})]}),t.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:t.message})]});return e.jsx(e.Fragment,{children:u==="spinner"?c:f})};me.displayName="WuLoader";const V=i.forwardRef(({disabled:t,loading:a,variant:r="primary",size:s="md",Icon:u,iconPosition:l="left",children:n,floating:d,className:w,color:c="primary",...f},b)=>{const y={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return e.jsxs(he,{...f,disabled:t,variant:r,size:s,className:o(d&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",l==="right"&&"wu-flex-row-reverse",w,a?"wu-cursor-not-allowed wu-ring-0":""),color:c,style:{backgroundColor:a?y[c]:"",...f.style},ref:b,children:[!a&&u&&e.jsx(e.Fragment,{children:u}),a&&e.jsx(me,{color:"#fff",size:"sm"}),!a&&n]})});V.displayName="WuButton";const Hr=({onLogout:t,DataCenter:a})=>e.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[e.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:a}),e.jsx(V,{variant:"outline",size:"sm",Icon:e.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:t,"aria-label":"logout",children:"LOGOUT"})]}),jr=({user:t,dir:a})=>{const r=[t!=null&&t.usage&&Object.keys(t.usage).length>0?{title:t.usage.title,url:t.usage.url,icon:"wm-bar-chart wu-text-base",node:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[e.jsx("code",{className:"wu-font-medium",children:t.usage.collectedResponseCount||"0"}),e.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,t!=null&&t.invoice&&Object.keys(t.invoice).length>0?{title:t.invoice.title,url:t.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:e.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:e.jsx("code",{children:t.invoice.size})})}:null].filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx("ul",{children:r.map(({title:s,url:u,icon:l,node:n},d)=>e.jsx("li",{className:d<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:e.jsxs("a",{href:u,className:o("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",a==="rtl"?"wu-pl-4":"wu-pr-4"),children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("span",{className:o(l,"wu-w-12 wu-text-center")}),e.jsx("span",{children:s})]}),n]})},d))}),e.jsx("hr",{className:"wu-border-gray-subtle"})]})},Ur=({settings:t,dir:a})=>e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"wu-border-gray-subtle"}),e.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("span",{className:o("wu-absolute wm-settings wu-text-base",a==="rtl"?"wu-right-4":"wu-left-4")}),e.jsx("ul",{className:"wu-w-full",dir:a,children:t==null?void 0:t.map(r=>e.jsx("li",{tabIndex:-1,dir:a,children:e.jsx("a",{href:r.url,className:o("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),e.jsx("hr",{className:"wu-border-gray-subtle"})]}),$r=({user:t,dir:a})=>{var r,s,u,l,n,d,w,c,f;return e.jsxs("section",{className:o("wu-flex wu-gap-2 wu-p-4 wu-w-full",a==="rtl"?"wu-pr-0":"wu-pl-0"),children:[e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:e.jsx("span",{className:"wu-text-base wm-person"})}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-1",a==="rtl"&&"wu-text-right"),children:[e.jsx("p",{children:(r=t==null?void 0:t.profile)==null?void 0:r.title}),e.jsxs("a",{href:(s=t==null?void 0:t.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:a,children:[e.jsx("p",{children:(u=t==null?void 0:t.profile)==null?void 0:u.subtitle}),e.jsx("p",{className:"wu-font-light",children:(l=t==null?void 0:t.profile)==null?void 0:l.companyName})]}),(t==null?void 0:t.license)&&Object.keys(t.license).length>0&&e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:a,children:[e.jsx("a",{href:(n=t==null?void 0:t.license)==null?void 0:n.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[e.jsx("p",{className:"wu-font-normal",children:(d=t==null?void 0:t.license)==null?void 0:d.subtitle}),e.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:(w=t==null?void 0:t.license)==null?void 0:w.title})]})}),e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:a,children:[e.jsx("p",{className:"wu-font-normal",children:(c=t==null?void 0:t.license)==null?void 0:c.expiryDatePostFixString}),e.jsx("p",{children:(f=t==null?void 0:t.license)==null?void 0:f.expiryDate})]})]})]})]})},Pt=({user:t,onLogout:a,dir:r,DataCenter:s})=>{var u,l;return t?e.jsx(At,{Trigger:e.jsxs(Et,{className:o("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:[e.jsx(qt,{className:"hover:wu-opacity-80",src:(u=t==null?void 0:t.profile)==null?void 0:u.profilePicture,alt:"User"}),e.jsx(Ot,{children:(l=t==null?void 0:t.profile)==null?void 0:l.initials})]}),dir:r,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:e.jsxs("div",{className:o("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:r,children:[e.jsx($r,{user:t,dir:r}),(t==null?void 0:t.settings)&&t.settings.length>0&&e.jsx(Ur,{settings:t.settings,dir:r}),e.jsx(jr,{user:t,dir:r}),e.jsx(Hr,{onLogout:a,DataCenter:s})]})}):null},Lt=({menuList:t,dir:a})=>{const r=[{icon:"wm-info",title:"Help Center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-calendar-month",title:"Free Online 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-chat",title:"Live Chat",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return e.jsx(At,{dir:a,Trigger:e.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-gray-switcher wu-app-header-help",DropdownContent:e.jsx("ul",{children:(t||r).map((s,u)=>e.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:a,children:s.target==="window"?e.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Ze(s.link),onKeyDown:l=>{l.key==="Enter"&&Ze(s.link)},className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer",children:e.jsx(Ft,{item:s,dir:a})}):e.jsx("a",{href:s.link,target:"_blank",className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0",rel:"noreferrer",children:e.jsx(Ft,{item:s,dir:a})})},u))})})},Ft=({item:t,dir:a})=>e.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[e.jsx("span",{className:`${t.icon} wu-text-xl wu-text-gray-subtle`}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-[2px]",a==="rtl"&&"wu-text-right"),children:[e.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:t.subTitle}),e.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:t.title})]})]}),Gr=t=>{const[a,r]=i.useState(()=>window.innerWidth<=t);return i.useEffect(()=>{const s=()=>{r(window.innerWidth<=t)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[t]),a};function Vr({productCategories:t,openCategory:a,setOpenCategory:r}){const s=(d,w)=>{const c=w[d];if(c){c.focus();const f=t[d]||null;r(f)}},u=(d,w,c,f)=>{d.preventDefault();const b=c==="down"?w+1:w-1;s(b,f)},l=(d,w,c,f)=>{a!=null&&a.products&&a.products[a.products.length-1].name===f&&(d.preventDefault(),s(w+1,c))},n=(d,w)=>{d.preventDefault();const c=t[w]===a?null:t[w];r(c)};return function(w,c,f){const b=document.querySelectorAll("[data-product-category]"),{key:y}=w;switch(y){case"ArrowDown":u(w,c,"down",b);break;case"ArrowUp":u(w,c,"up",b);break;case"Tab":l(w,c,b,f);break;case"Enter":case" ":n(w,c);break}}}const Yr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=t.as||"div";return e.jsx(n,{...u,className:o(l[a],r),children:s})},Jr=t=>{const{size:a="xl",className:r,children:s,...u}=t,l={sm:"h4",md:"h3",lg:"h2",xl:"h1"},n={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},d=l[a];return e.jsx(d,{...u,className:o(n[a],r),children:s})},Kr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=t.as||"div";return e.jsx(n,{...u,className:o(l[a],r),children:s})},Xr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={md:"wu-text-display-2",lg:"wu-text-display-1"},n=t.as||"h1";return e.jsx(n,{...u,className:o(l[a],r),children:s})},ie=t=>{const{icon:a,className:r,...s}=t;return e.jsx("span",{...s,className:o(a,r),role:"presentation","aria-label":a})},Qr=({buttonRef:t,handleDropdownToggle:a,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:l="ltr",homeLink:n="/"})=>e.jsxs("button",{ref:t,type:"button",className:o("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:a,onKeyDown:d=>{s&&d.key==="ArrowDown"&&r(d,-1)},"aria-label":"product-switcher",children:[e.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:n,children:e.jsx(ie,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",l==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),P={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"},Zr=({category:t,dir:a="ltr",openCategory:r})=>{const s=t.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===t.name,l=o("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",a==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),n=o("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",a==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return e.jsxs("div",{className:o("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:a,children:[e.jsx("div",{className:P.productCategoryBorderTop,style:{backgroundColor:s}}),e.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[e.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:e.jsx("img",{src:t.logo,alt:t.name,width:"32px",height:"32px"})}),e.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:t.name})]}),t.active?e.jsx("span",{className:l}):e.jsx("span",{className:n})]})},Rr={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"},es=({product:t,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:l})=>{const[n,d]=i.useState(t.name===a),w=t.name===r,c=t.name===a,f=!t.active,b="#1b3380",y="#c5cce0",v="#ffcf70",m=o("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!t.active&&"wu-text-gray-subtle",n&&"wu-font-normal",t.active&&n&&"wu-text-blue-q"),p=o("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!t.active&&"wu-text-gray-subtle",t.active&&n&&"wu-text-blue-q"),C=n||u===t.name||w?b:y;return e.jsxs("li",{className:o(P.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(w||n)&&P.activeProduct,t.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===t.name&&P.activeProduct,"wu-product-item"),onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),"aria-label":t.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const h=S.currentTarget.querySelector("a");h&&h.click()}},onFocus:()=>{l(t.name)},onBlur:()=>l(""),children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:f?v:C}}),e.jsxs("a",{className:o(P.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:t.link||"#",tabIndex:0,children:[e.jsx("span",{className:o(p,Rr[t.icon||""]),"aria-hidden":!0}),e.jsx("span",{className:o(m),children:t.name})]})]},t.name)},ts=({category:t,currentProduct:a,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:l,borderColorLocked:n="#f5a300"})=>{const{products:d=[],active:w}=t,c=i.useMemo(()=>d.filter(m=>m.active).sort((m,p)=>(m.order||100)-(p.order||100)),[d]),f=i.useMemo(()=>d.filter(m=>!m.active),[d]),[b,y]=i.useState(n),v=m=>m.map((p,C)=>e.jsx(es,{product:p,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:l},C));return w?e.jsxs(e.Fragment,{children:[v(c),f.length>0&&e.jsxs("li",{className:o(P.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>y("#f5a300"),onMouseOut:()=>y(n),"aria-label":"Upgrade to unlock",children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:b},"aria-label":"top-border"}),e.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:o(P.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[e.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),e.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",e.jsx("br",{})," unlock"]})]})]}),v(f)]}):e.jsxs("li",{className:o(P.productListItem,P.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>l("learn"),onBlur:()=>l(""),"aria-label":"Learn More",children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:n}}),e.jsx("a",{className:P.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:e.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Bt=({dropdownRef:t,dir:a,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:l,handleKeyDown:n,expandAll:d,activeProductName:w,focusItem:c,setFocusItem:f})=>{const b="#ffcf70",[y,v]=i.useState(window.innerWidth>768);return i.useEffect(()=>{const m=()=>{v(window.innerWidth>375)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),e.jsx("ul",{className:o(P.productDropdownMenu,r&&P.productDropdownMenuOpen,a==="rtl"&&P.rtlDropdownMenu,"wu-switcher-container"),ref:t,dir:a,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((m,p)=>e.jsxs("li",{className:o(P.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===m&&P.open,d&&P.open),onMouseEnter:()=>y&&l(m),onMouseLeave:()=>y&&l(null),"aria-label":m.name,dir:a,onKeyDown:C=>n(C,p),tabIndex:0,"data-product-category":!0,children:[e.jsx(Zr,{category:m,dir:a,openCategory:u}),e.jsx("ul",{className:o(P.productList,a==="rtl"&&P.rtlProductList),dir:a,children:e.jsx(ts,{category:m,dir:a,activeProductName:w,currentProduct:m.name,focusItem:c,setFocusItem:f,borderColorLocked:b})})]},m.name))})},as=({isProductButtonShow:t,isDropdownOpen:a,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:l,smallScreenButtonRef:n,handleDropdownToggle:d,handleKeyDown:w})=>e.jsx("div",{className:o("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",t?l==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":l==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:a?r.hover:s},children:e.jsxs("button",{ref:n,type:"button",className:o("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",t?"wu-flex":l==="rtl"?"wu-hidden":"wu-flex"),onClick:d,onKeyDown:c=>{a&&c.key==="ArrowDown"&&w(c,-1)},"aria-label":"small-screen-product-btn",children:[u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",a&&"wu-rotate-180")})]})}),rs=({dir:t,isProductButtonShow:a,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const l=()=>{s(n=>!n),a&&u(!1)};return e.jsxs("button",{className:o("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",t==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:l,ref:r,"aria-label":"menu-toggle-btn",children:[e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${a?"wu-opacity-0":"wu-opacity-100"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},zt=({productCategories:t,activeProductName:a,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:l})=>{const n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),c=i.useRef(null),[f,b]=i.useState(!1),[y,v]=i.useState(null),[m,p]=i.useState(r.base),[C,S]=i.useState(""),[h,N]=i.useState(!1),k=Gr(768);Re([d,n],()=>{b(!1),v(null)}),Re([w,c,d],()=>{N(!1),b(!1),v(null)}),i.useEffect(()=>{const _=T=>{T.key==="Escape"&&b(!1)};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[f]),i.useEffect(()=>p(r.base),[r.base]);const D=_=>{_.preventDefault(),_.stopPropagation(),b(T=>{const I=!T;return I||v(null),I})},M=(_,T)=>{console.log(_),Vr({productCategories:t,openCategory:y,setOpenCategory:v})(_,T,C)};return e.jsx("div",{className:o("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:k?e.jsxs("div",{className:"wu-relative wu-flex",children:[e.jsx(rs,{dir:s,isProductButtonShow:h,smallScreenToggleButtonRef:c,setDropdownOpen:b,setIsProductButtonShow:N}),e.jsx(as,{isProductButtonShow:h,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:m,activeProductName:a,handleDropdownToggle:D,smallScreenButtonRef:w,handleKeyDown:M,dir:s}),e.jsx("div",{className:o("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:e.jsx(Bt,{activeProductName:a,focusItem:C,setFocusItem:S,handleKeyDown:M,isDropdownOpen:f,openCategory:y,productCategories:t,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})})]}):e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:f?r.hover:m},onMouseOver:()=>p(r.hover),onMouseOut:()=>p(r.base),children:[e.jsx(Qr,{activeProductName:a,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:D,handleKeyDown:M,isDropdownOpen:f}),e.jsx(Bt,{activeProductName:a,focusItem:C,setFocusItem:S,handleKeyDown:M,isDropdownOpen:f,openCategory:y,productCategories:t,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})]})})},Ht=({children:t,dir:a,className:r})=>e.jsx("section",{className:o("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",a==="rtl"&&"wu-flex-row-reverse",r),children:e.jsx("div",{className:"wu-grow",children:t})}),Fe=x.forwardRef(({className:t,type:a,...r},s)=>e.jsx("input",{type:a,className:o("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",t),ref:s,...r}));Fe.displayName="Input";const ss=t=>{const{message:a,className:r,...s}=t;return e.jsx("p",{...s,className:o("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:a})},us=t=>{var d,w;const{inputRef:a,maxLength:r=50,className:s,...u}=t,[l,n]=i.useState(!1);return i.useEffect(()=>{var c;(((c=a==null?void 0:a.current)==null?void 0:c.value.length)||0)>.75*r?n(!0):n(!1)},[(d=a==null?void 0:a.current)==null?void 0:d.value,r]),e.jsx("p",{...u,className:o("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:l&&`${(w=a==null?void 0:a.current)==null?void 0:w.value.length}/${r}`})},os=J.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"),xe=x.forwardRef(({className:t,...a},r)=>e.jsx(Dt.Root,{ref:r,className:o(os(),t),...a}));xe.displayName=Dt.Root.displayName;const Z=t=>e.jsx(xe,{...t,className:o("wu-text-gray-lead wu-leading-6",t.className)}),ls=({Label:t,Error:a,Hint:r,Input:s,labelPosition:u="top",dir:l="ltr",className:n,...d})=>{const c=o("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",n),f=o("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),b=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),y=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return e.jsxs("div",{className:c,dir:l,...d,children:[t,e.jsxs("div",{className:f,children:[s,r&&e.jsx("div",{className:b,children:r}),a&&e.jsx("div",{className:y,children:a})]})]})},ye=i.forwardRef((t,a)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:l,type:n,value:d,variant:w="flat",readonly:c,id:f=Le(),...b}=t,y=Ie(s),v=u?l!=="right"?"wu-pl-8":"wu-pr-8":"",[m,p]=i.useState(!1),C=()=>{p(h=>!h)},S=h=>{b.onChange&&b.onChange(h)};return e.jsx(e.Fragment,{children:n==="submit"?e.jsx(V,{type:"submit",className:b.className,id:f,children:r||"Submit"}):e.jsx("div",{className:o("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:b.dir,children:e.jsxs("div",{className:o("wu-flex wu-gap-1 wu-relative",y,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&l!=="right"&&e.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),e.jsx(Fe,{...b,className:o("wu-peer wu-text-xs wu-rounded-t-sm",w==="outlined"?"wu-border wu-border-gray-subtle":"",v,b.className),type:m?"text":n,ref:a,readOnly:c,onChange:b.onChange&&S,value:d,id:f}),u&&l==="right"&&e.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:u}),n==="password"&&e.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:e.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:m?e.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):e.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&e.jsx(Z,{htmlFor:f,className:"wu-input-label",children:r})]})})})});ye.displayName="WuInput";const ns=({className:t,placeholder:a="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[l,n]=i.useState(r);return i.useEffect(()=>{n(r)},[r]),e.jsx(ye,{...u,placeholder:a,onChange:d=>s(d.target.value),className:o("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",l?"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",t),type:"search",Icon:e.jsx(ie,{"data-testid":"search-icon",icon:"wm-search",className:o("wu-text-gray-lead wu-cursor-pointer",l&&"wu-text-white"),onClick:()=>n(d=>!d)})})},jt=De.Provider,Ut=De.Root,$t=De.Trigger,at=x.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(De.Content,{ref:s,sideOffset:a,className:o("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",t),...r}));at.displayName=De.Content.displayName;const Be=i.forwardRef(({content:t,position:a,positionOffset:r,duration:s,children:u,className:l,showArrow:n=!1,...d},w)=>e.jsx(jt,{delayDuration:s||200,children:e.jsxs(Ut,{children:[e.jsx($t,{asChild:!0,children:e.jsx("span",{ref:w,children:u})}),e.jsx(Ke.Portal,{children:t&&e.jsxs(at,{...d,side:a||"top",sideOffset:r||0,className:o("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",l),children:[t,n&&e.jsx(Ke.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Be.displayName="WuTooltip";const ws=({label:t,className:a})=>{const r=i.useRef(null),[s,u]=i.useState(!1);return i.useEffect(()=>{const l=r.current;if(l){const n=l.clientWidth,d=l.scrollWidth,w=d/t.length,c=t.length*w;u(c>n||d>n)}},[t]),e.jsx("p",{ref:r,className:o("wu-w-full wu-truncate",a),children:s?e.jsx(Be,{content:t,positionOffset:8,children:t}):t})},ds=t=>{var b;const{productName:a,categories:r=[],user:s,children:u,onLogout:l,homeLink:n=window.location.origin,brandColor:d,dir:w="ltr",expandAll:c,DataCenter:f}=t;return e.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:e.jsxs("header",{className:o("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",w==="rtl"&&"wu-flex-row-reverse",t.className),style:t.style,children:[Lr((b=s==null?void 0:s.profile)==null?void 0:b.subtitle)&&window.wickUiVersion&&e.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1]","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),e.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:e.jsx(zt,{productCategories:r,activeProductName:a,activeProductColor:d,dir:w,homeLink:n,expandAll:c})}),e.jsx(Ht,{dir:w,children:u}),e.jsxs("section",{className:o("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",w==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[e.jsx(Lt,{dir:w}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&e.jsx(Pt,{user:s,onLogout:l,dir:w,DataCenter:f})]})]})})},R=Te.Root,ce=Te.Trigger,X=x.forwardRef(({className:t,align:a="center",sideOffset:r=4,...s},u)=>e.jsx(Te.Portal,{children:e.jsx(Te.Content,{ref:u,align:a,sideOffset:r,className:o("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",t),...s})}));X.displayName=Te.Content.displayName;function Gt({className:t,classNames:a,dir:r="ltr",...s}){const u=kt.getDefaultClassNames();return e.jsx(kt.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:o("wu-p-3",t),classNames:{root:o(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:o("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:o(u.month_caption,"wu-mb-5"),months:o(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:o(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:o(u.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:o(u.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:o(u.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:o(u.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:o(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:o("rm",u.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:o(u.range_end,"wu-rounded-none"),range_start:o(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:o(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:o(u.button_next,tt({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:o(u.button_previous,tt({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:o(u.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",r==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:o(u.chevron,"!wu-text-red-500"),outside:o(u.outside,"wu-invisible"),disabled:o(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...a},components:{Chevron:()=>e.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Gt.displayName="Calendar";const rt=t=>e.jsx(Gt,{...t}),Vt=t=>{const{handleDateChange:a,disabled:r,onReset:s,showResetButton:u}=t;return e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&e.jsx(V,{variant:"secondary",onClick:s,Icon:e.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:a,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},st=({formattedString:t,dir:a,placeholder:r="Select Date",className:s,...u})=>e.jsx(ke.PopoverTrigger,{asChild:!0,dir:a,children:e.jsx(V,{...u,className:o("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),variant:"primary",Icon:e.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:t||r})}),Yt=(t,a,r,s)=>!!(a||r&&t<r||s&&t>s),ze=t=>t?typeof t=="string"?new Date(t):t:new Date,ut="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",is=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],cs=({formatString:t="yyyy-MM-dd",value:a,onChange:r,disabled:s,minDate:u=F.sub(new Date,{years:5}),maxDate:l=F.add(new Date,{years:1}),className:n,dir:d="ltr",Label:w,labelPosition:c="top",onReset:f,showResetButton:b=!1,placeholder:y="Select Date",...v})=>{const[m,p]=i.useState(),[C,S]=i.useState(""),h=i.useCallback(()=>{const k=ze(m);S(F.format(k,t)),r&&r(m)},[m,t,r]),N=i.useCallback(()=>{f?f():(p(void 0),S(""),r&&r(void 0))},[r,f]);return i.useEffect(()=>{const k=ze(a);p(k),S(F.format(k,t))},[a,t]),e.jsxs(Z,{className:o("wu-flex wu-gap-1",c==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[w,e.jsxs(R,{children:[e.jsx(st,{...v,formattedString:C,dir:d,placeholder:y}),e.jsx(X,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:d,children:e.jsx(rt,{dir:d,mode:"single",captionLayout:"dropdown",selected:m,onSelect:p,disabled:k=>Yt(k,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:m,className:o("wu-border wu-border-blue-p",n),footer:e.jsx(Vt,{handleDateChange:h,disabled:s,onReset:N,showResetButton:b})})})]})]})},Jt="yyyy-MM-dd",fs=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],ps=({current:t,onSelect:a,presetRanges:r=is})=>{const[s,u]=i.useState(),[l,n]=i.useState(!1),[d,w]=i.useState(""),[c,f]=i.useState(""),[b,y]=i.useState(!1),v=i.useMemo(()=>r.map(h=>h.value),[r]),m=o("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"),p=i.useCallback(h=>{if(h===void 0){u(void 0),n(!0);return}const N=Number(h)-1;u(N),n(!1),a({from:F.sub(new Date,{days:N}),to:new Date})},[a]),C=i.useCallback((h,N)=>{if(!h||!(t!=null&&t.to)||!(t!=null&&t.from)||!new RegExp(ut).test(h))return!1;const D=new Date(N==="start"?h:t.from),M=new Date(N==="end"?h:t.to);return F.isBefore(M,D)?(y(!0),!1):(y(!1),!(F.isSameDay(D,t.from)&&F.isSameDay(M,t.to)))},[t]),S=i.useCallback((h,N)=>{if((N==="start"?w:f)(h),C(h,N)){const D={from:t==null?void 0:t.from,to:t==null?void 0:t.to};N==="start"&&(D.from=new Date(h)),N==="end"&&(D.to=new Date(h)),a(D)}},[t,a,C]);return i.useEffect(()=>{if(t!=null&&t.to&&(t!=null&&t.from)&&F.isValid(t.to)&&F.isValid(t.from)){w(F.format(t.from,Jt)),f(F.format(t.to,Jt));const h=F.differenceInCalendarDays(t.to,t.from);F.isToday(t.to)&&v.includes(h+1)?(u(h),n(!1)):(u(void 0),n(!0))}},[t,v]),e.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:[e.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:fs.map(({label:h,value:N})=>e.jsx(he,{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:h},N))}),e.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:h,value:N})=>e.jsx("li",{children:e.jsx("button",{className:o(m,s===N-1&&"wu-bg-blue-p/10"),onClick:()=>p(N),children:h})},N)),e.jsx("li",{children:e.jsx("button",{className:o(m,l&&"wu-bg-blue-p/10"),onClick:()=>p(),children:"Custom Range"})})]}),e.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[e.jsx(ye,{placeholder:"Start Date",pattern:ut,value:d,onChange:h=>S(h.target.value,"start"),"aria-label":"Start Date"}),e.jsx(ye,{placeholder:"End Date",pattern:ut,value:c,onChange:h=>S(h.target.value,"end"),"aria-label":"End Date"}),b?e.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"}):e.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"})]})]})},bs=({formatString:t="yyyy/MM/dd",value:a,onChange:r,disabled:s,minDate:u=F.sub(new Date,{years:5}),maxDate:l=F.add(new Date,{years:1}),className:n,dir:d="ltr",minDateToSelect:w,maxDateToSelect:c,presetRanges:f,Label:b,labelPosition:y="top",onReset:v,showResetButton:m=!0,placeholder:p="Select Date Range"})=>{const[C,S]=i.useState(a),[h,N]=i.useState(a),[k,D]=i.useState(""),M=i.useCallback(()=>{if(h){const I=h.from,B=h.to;S({from:I,to:B}),D(`${F.format(I,t)} - ${F.format(B,t)}`),r&&r({from:I,to:B})}},[h,t,r]),_=i.useCallback(()=>{N(C)},[C]),T=i.useCallback(()=>{v?v():(S(void 0),N(void 0),D(""),r&&r(void 0))},[v,r]);return i.useEffect(()=>{if(a!=null&&a.from&&(a!=null&&a.to)){const I=ze(a.from),B=ze(a.to);S(a),N(a),D(`${F.format(I,t)} - ${F.format(B,t)}`)}else S(void 0),N({to:new Date,from:new Date})},[a,t]),e.jsxs(xe,{className:o("wu-flex wu-gap-1",y==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[b,e.jsxs(R,{onOpenChange:I=>!I&&_(),children:[e.jsx(st,{formattedString:k,dir:d,placeholder:p}),e.jsxs(X,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:d,children:[e.jsx(ps,{current:h,onSelect:N,presetRanges:f}),e.jsx(rt,{dir:d,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:h,onSelect:N,disabled:I=>Yt(I,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:C==null?void 0:C.from,className:o("wu-shadow-none",n),min:w,max:c,footer:e.jsx(Vt,{handleDateChange:M,disabled:s,onReset:T,showResetButton:m})})]})]})]})},Kt=i.forwardRef((t,a)=>{const{className:r,rounded:s,...u}=t;return e.jsx("div",{className:o("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",r),ref:a,...u})});Kt.displayName="WuCard";const gs=i.forwardRef((t,a)=>{const{className:r,...s}=t;return e.jsx("div",{ref:a,...s,className:o("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});gs.displayName="WuCardHeader";const hs=i.forwardRef((t,a)=>{const{className:r,...s}=t;return e.jsx("div",{ref:a,...s,className:o("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});hs.displayName="WuCardHeader";const Xt=x.forwardRef(({className:t,partial:a,...r},s)=>e.jsx(Xe.Root,{ref:s,className:o("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",t),...r,children:e.jsxs(Xe.Indicator,{className:o("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!a&&e.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),a&&e.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Xt.displayName=Xe.Root.displayName;const ee=i.forwardRef((t,a)=>{const{disabled:r,checked:s,Label:u,labelPosition:l="right",className:n,id:d=Le(),partial:w,onChange:c,required:f,readonly:b,...y}=t;return i.useEffect(()=>{y.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[y.defaultChecked,s]),e.jsxs("div",{className:ms({labelPosition:l,className:"wu-checkbox-container"}),dir:y.dir,children:[e.jsx(Xt,{id:d,...y,partial:w,checked:s,disabled:r||b,onCheckedChange:c,className:o("wu-peer wu-checkbox",n),required:f,ref:a}),u&&e.jsx(Z,{htmlFor:d,className:"wu-w-full wu-checkbox-label",children:u})]})}),ms=J.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"}}});ee.displayName="WuCheckbox";const xs=t=>{const{className:a,children:r,...s}=t;return e.jsx("span",{...s,className:o("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",a),children:r})},ot=x.forwardRef(({className:t,...a},r)=>e.jsx($.Command,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",t),...a}));ot.displayName=$.Command.displayName;const Qt=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:e.jsx($.Command.Input,{ref:r,className:o("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",t),...a})}));Qt.displayName=$.Command.Input.displayName;const lt=x.forwardRef(({className:t,...a},r)=>e.jsx($.Command.List,{ref:r,className:o("",t),...a}));lt.displayName=$.Command.List.displayName;const nt=x.forwardRef((t,a)=>e.jsx($.Command.Empty,{ref:a,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...t}));nt.displayName=$.Command.Empty.displayName;const He=x.forwardRef(({className:t,...a},r)=>e.jsx($.Command.Group,{ref:r,className:o("",t),...a}));He.displayName=$.Command.Group.displayName;const Zt=x.forwardRef(({className:t,...a},r)=>e.jsx($.Command.Separator,{ref:r,className:o("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",t),...a}));Zt.displayName=$.Command.Separator.displayName;const We=x.forwardRef(({className:t,...a},r)=>e.jsx($.Command.Item,{ref:r,className:o("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",t),...a}));We.displayName=$.Command.Item.displayName;const se=x.forwardRef(({className:t,children:a,thumbColor:r,railColor:s,...u},l)=>e.jsxs(de.Root,{ref:l,className:o("wu-relative wu-overflow-hidden",t),children:[e.jsx(de.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:a}),e.jsx(wt,{thumbColor:r,railColor:s}),e.jsx(de.Corner,{})]}));se.displayName=de.Root.displayName;const wt=x.forwardRef(({className:t,orientation:a="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},l)=>e.jsx(de.ScrollAreaScrollbar,{ref:l,orientation:a,className:o("wu-flex wu-touch-none wu-select-none wu-transition-colors",a==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",a==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",t),style:{background:s},...u,children:e.jsx(de.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));wt.displayName=de.ScrollAreaScrollbar.displayName;const ve=i.forwardRef(({containerHeight:t=400,list:a,callback:r,dir:s,className:u,style:l},n)=>e.jsx(Dr.Virtuoso,{ref:n,dir:s,className:u,style:{height:t,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...l},data:a,itemContent:(d,w)=>r(d,w)}));ve.displayName="WuVirtualScroll";const ys=({tags:t,triggerRef:a})=>{const[r,s]=i.useState([]),[u,l]=i.useState([]),n=i.useMemo(()=>e.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((w,c)=>e.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:w},c))}),[u]),d=w=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=w,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return i.useEffect(()=>{const w=()=>{if(a.current){const y=a.current.offsetWidth-20-36;let v=0;const m=[],p=[];t.forEach(C=>{const S=d(C);v+S+8<y?(m.push(C),v+=S+8):p.push(C)}),s(m),l(p)}};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[t,a]),e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((w,c)=>e.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:w},c)),u.length>0&&e.jsx(Be,{content:n,className:"wu-z-[51] wu-text-left",children:e.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",u.length]})})]})},vs=({placeholder:t="Select...",isEllipse:a=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:l,multiple:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,className:b,...y})=>{const[v,m]=i.useState([]),p=i.useRef(null);i.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){m([]);return}if(n){const S=r;m(S==null?void 0:S.map(h=>h[l.label]));return}else m([r[l.label]])},[r]);const C=()=>{var S;return v.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):a?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=p.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:v.join(", ")}):e.jsx(ys,{tags:v,triggerRef:p}):e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:t})};return e.jsx(ce,{dir:u,asChild:!0,id:d,disabled:w,children:e.jsxs("button",{...y,ref:p,disabled:w,className:o("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",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",b),children:[C(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Rt=A.Root,ea=A.Trigger,ta=A.Group,Ns=A.Portal,Cs=A.Sub,Ss=A.RadioGroup,aa=x.forwardRef(({className:t,inset:a,children:r,position:s,...u},l)=>e.jsxs(A.SubTrigger,{ref:l,className:o("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-3 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",a&&"wu-pl-8",t),...u,children:[s==="left"&&e.jsx("span",{className:o("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&e.jsx("span",{className:o("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));aa.displayName=A.SubTrigger.displayName;const ra=x.forwardRef(({className:t,...a},r)=>e.jsx(A.SubContent,{ref:r,className:o("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",t),...a}));ra.displayName=A.SubContent.displayName;const dt=x.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(A.Portal,{children:e.jsx(A.Content,{ref:s,sideOffset:a,className:o("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",t),...r})}));dt.displayName=A.Content.displayName;const je=x.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(A.Item,{ref:s,className:o("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",a&&"wu-pl-8",t),...r}));je.displayName=A.Item.displayName;const sa=x.forwardRef(({className:t,children:a,checked:r,dir:s,...u},l)=>e.jsxs(A.CheckboxItem,{ref:l,className:o("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",t),checked:r,...u,children:[e.jsx("span",{className:o("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:e.jsx(A.ItemIndicator,{children:e.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),a]}));sa.displayName=A.CheckboxItem.displayName;const ua=x.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(A.RadioItem,{ref:s,className:o("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",t),...r,children:[e.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:e.jsx(A.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:e.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),a]}));ua.displayName=A.RadioItem.displayName;const _e=x.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(A.Label,{ref:s,className:o("wu-p-2 wu-font-medium wu-text-xs",a&&"wu-pl-8",t),...r}));_e.displayName=A.Label.displayName;const Ue=x.forwardRef(({className:t,...a},r)=>e.jsx(A.Separator,{ref:r,className:o("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",t),...a}));Ue.displayName=A.Separator.displayName;const oa=({option:t,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:l})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{a&&d(r?a.map(b=>JSON.stringify(b[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const w=r?n.includes(JSON.stringify(t[u.value])):n===JSON.stringify(t[u.value]),c=()=>{t.disabled||s(t)};return e.jsxs(We,{onSelect:c,disabled:t.disabled,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-combobox-item hover:wu-bg-gray-100",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ee,{checked:w}),e.jsx(ks,{option:t,accessorKey:u})]})},ks=({option:t,accessorKey:a})=>{const r=t[a.label];return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[t.icon&&t.icon,r,t.isAdmin&&e.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},la=t=>{const{option:a,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:l,...n}=t;switch("type"in a?a.type:"option"){case"all":return e.jsx(We,{onSelect:s,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:n.dir,children:e.jsx(ee,{checked:u||l,partial:l,"data-partial":l,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return e.jsxs(He,{children:[e.jsx(_e,{children:a.label}),a.options.map((w,c)=>i.createElement(oa,{...n,option:w,key:c}))]});case"divider":return e.jsx(Zt,{className:"wu-mx-4"});default:return e.jsx(oa,{...n,option:a})}},Ds=t=>{const a=[],r=[],s=[],u=[];return t.forEach(l=>{l.type==="group"?(a.push(l),s.push(...l.options),u.push(...l.options.filter(n=>!n.disabled))):l.type==="divider"?r.push(l):s.push(l),l!=null&&l.disabled||u.push(l)}),{groups:a,dividers:r,allOptions:s,enabledOptions:u}},Ts=i.memo(ye),Ms=({data:t,accessorKey:a,value:r,defaultValue:s,Header:u,virtualizedThreshold:l=100,isEllipse:n,placeholder:d,variant:w,dir:c,onSelect:f,Label:b,maxHeight:y=420,multiple:v=!1,hasGroup:m=!1,selectAll:p,id:C,disabled:S,labelPosition:h="top",className:N,onScroll:k,...D})=>{const[M,_]=i.useState(""),[T,I]=i.useState(),[B,te]=i.useState(!1),[W,H]=i.useState(!1),[K,Y]=i.useState(!1),oe=i.useRef(null),{allOptions:ae,groups:Ne,dividers:Ce,enabledOptions:O}=i.useMemo(()=>m||p&&!p.includeDisabled?Ds(t):{allOptions:t,groups:[],dividers:[],enabledOptions:[]},[t,m]),z=i.useMemo(()=>{if(!M)return t;const L=M.toLowerCase();return ae.filter(re=>re[a.label].toLowerCase().includes(L))},[M,ae,t,a.label]),E=i.useMemo(()=>v&&p!=null&&p.enable&&!M&&z.length>0?[{type:"all"},...z]:z,[z,M,v]),U=i.useMemo(()=>{const L=32*E.length+Ce.length*9+Ne.length*48;return Math.min(y,L)},[y,E,Ce,Ne]),le=i.useCallback(L=>{const re=L[a.value];v?I(fo=>{const Ct=fo||[],mr=Ct.some(St=>St[a.value]===re)?Ct.filter(St=>St[a.value]!==re):[...Ct,L];return f==null||f(mr),mr}):(te(!1),I(L),f==null||f(L))},[v,a.value,f]),ne=i.useCallback(L=>_(L.target.value),[]),Se=i.useCallback(()=>_(""),[]);i.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?I(r):s!==void 0&&I(s)},[r,s]),i.useEffect(()=>{if(!v)return;const L=p!=null&&p.includeDisabled?(T==null?void 0:T.length)===ae.length:(T==null?void 0:T.length)===O.length;H(L);const re=(T==null?void 0:T.length)>0&&!L;Y(re)},[T,p]);const Oe=i.useCallback(()=>{const L=W?[]:p!=null&&p.includeDisabled?ae:O;I(L),f==null||f(L)},[W,v,ae,O,f,p]),Ae=Ie(h);return e.jsxs("div",{className:o(Ae,"wu-flex wu-combobox-container"),ref:oe,children:[e.jsxs(R,{onOpenChange:L=>{L&&Se(),te(L)},open:B,modal:!0,children:[e.jsx(vs,{...D,selectedOptions:T,accessorKey:a,isEllipse:n,placeholder:d,variant:w,dir:c,multiple:v,disabled:S,selectAll:p,isCheckedAll:W,className:N,id:C}),e.jsx(X,{className:"wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,children:e.jsxs(ot,{id:C,children:[e.jsx("div",{className:"wu-m-2",children:e.jsx(Ts,{placeholder:"Search...",Icon:e.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:ne,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,e.jsxs(lt,{children:[e.jsx(nt,{children:"No results found."}),E.length>=l?e.jsx(ve,{className:"wu-combobox-list",containerHeight:y,list:E,callback:(L,re)=>e.jsx(la,{option:re,value:T,onSelect:le,multiple:v,accessorKey:a,dir:c,selectAll:p,handleSelectAll:Oe,isCheckedAll:W,isPartialSelected:K},L),dir:c}):e.jsx(se,{style:{maxHeight:U,height:"fit-content"},className:"wu-combobox-list",onScroll:k,children:E.map((L,re)=>e.jsx(la,{option:L,value:T,onSelect:le,multiple:v,accessorKey:a,dir:c,selectAll:p,handleSelectAll:Oe,isCheckedAll:W,isPartialSelected:K},re))})]})]})})]}),b&&e.jsx(Z,{htmlFor:C,className:"wu-combobox-label",children:b})]})},Is=t=>{const{textToCopy:a,notificationText:r,...s}=t,[u,l]=i.useState(!1),n=async()=>{if(a)try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return e.jsxs(V,{...s,onClick:n,variant:"iconOnly",className:o("wu-relative",t.className),"aria-label":"Copy to clipboard",children:[r&&e.jsx("span",{className:o("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",u?"wu-block":"wu-hidden"),children:r}),e.jsx(ie,{icon:"wm-content-copy",className:"wu-text-lg"})]})},na=q.Root,Ws=q.Trigger,_s=q.Close,Es=q.Portal,wa=x.forwardRef(({className:t,...a},r)=>e.jsx(q.Overlay,{className:o("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",t,"wu-drawer-overlay"),...a,ref:r}));wa.displayName=q.Overlay.displayName;const qs=J.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"}}),it=x.forwardRef(({side:t="right",className:a,children:r,hideCloseButton:s,...u},l)=>e.jsxs(Es,{children:[e.jsx(wa,{}),e.jsxs(q.Content,{ref:l,className:o(qs({side:t}),a),...u,children:[r,!s&&e.jsx(q.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[e.jsx("span",{className:"wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));it.displayName=q.Content.displayName;const da=({className:t,...a})=>e.jsx("div",{className:o("",t),...a});da.displayName="SheetHeader";const ct=x.forwardRef(({className:t,...a},r)=>e.jsx(q.Title,{ref:r,className:o("wu-text-lg wu-font-semibold",t),...a}));ct.displayName=q.Title.displayName;const ia=x.forwardRef(({className:t,...a},r)=>e.jsx(q.Description,{ref:r,className:o("wu-text-sm",t),...a}));ia.displayName=q.Description.displayName;const Os=t=>{const{Trigger:a,children:r,hideCloseButton:s,className:u,side:l="left",open:n,onOpenChange:d,preventClickOutside:w,...c}=t;return e.jsxs(na,{open:n,onOpenChange:d,children:[e.jsx(Ws,{asChild:!0,children:a}),e.jsxs(it,{...c,onInteractOutside:f=>{w&&f.preventDefault()},side:l,className:o("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[e.jsx("div",{className:"wu-hidden",children:e.jsx(ct,{})}),r]})]})},As=({children:t,...a})=>e.jsx(_s,{...a,children:t}),ca=({className:t,isLoading:a,loadingText:r,children:s,...u})=>e.jsxs("footer",{className:o("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",t),...u,children:[e.jsx("div",{className:"wu-flex-1",children:s}),a&&e.jsx(me,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});ca.displayName="WuFooter";const fa=i.forwardRef((t,a)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...l}=t,n=r==="sm"?16:18,d=s.includes("http")?s:`/help/${s}.html`,w=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return e.jsx("button",{...l,ref:a,onClick:()=>Ze(d),children:e.jsx("span",{className:o("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,w,l.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});fa.displayName="WuHelpButton";const ue=(t,a)=>`wu-listbox-${t}`,Ps=t=>{const{CustomTrigger:a,disabled:r,value:s,placeholder:u,accessorKey:l,Chip:n,handleUnselect:d,variant:w,dir:c,...f}=t,[b,y]=i.useState(),v=i.useRef(null);return i.useEffect(()=>{if(!s){y(null);return}y(Array.isArray(s)?n?s.map((p,C)=>n({value:p,unselect:d,key:C})):s.map(p=>p[l.label]).join(", "):n?n({value:s,unselect:d}):s[l.label])},[s,n,l.label,y]),e.jsx(ce,{asChild:!0,id:t.id,disabled:r,ref:v,children:(a==null?void 0:a(s))||e.jsxs("button",{...f,className:o("wu-group 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",w==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f.className,ue("trigger")),children:[e.jsx("div",{className:o("wu-truncate",n&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||u}),e.jsx(ie,{icon:"wm-arrow-drop-down",className:o("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",ue("drop-icon"))})]})})},Ls=t=>{const{option:a,accessorKey:r,onSelect:s,multiple:u,children:l,value:n,dir:d,...w}=t;return e.jsxs(We,{...w,onSelect:()=>s==null?void 0:s(a),value:JSON.stringify(a),className:o("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",d==="rtl"&&"wu-justify-end",ue("item")),disabled:a.disabled,children:[e.jsx("span",{className:"wu-hidden",children:crypto.randomUUID()}),u&&e.jsx(ee,{checked:Array.isArray(n)&&!!n.find(c=>c[r.value]===a[r.value])}),l]})},Fs=i.memo(Ls),Bs=t=>{const{label:a,onSelectAll:r,data:s,value:u}=t,[l,n]=i.useState(!1),[d,w]=i.useState(!1);return i.useEffect(()=>{!u||!s||(n(u.length>0),w(u.length>0&&u.length<s.length))},[s,u]),e.jsxs(We,{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:()=>r==null?void 0:r(!l),children:[e.jsx(ee,{checked:l,partial:d}),a||"Select All"]})},zs=t=>{const{className:a,...r}=t;return e.jsxs("div",{className:"wu-relative",children:[e.jsx(ie,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),e.jsx(Qt,{...r,"aria-label":"Search",className:o("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;",ue("input"),a)})]})},Hs=t=>{const{data:a,accessorKey:r,value:s,Item:u,Label:l,CustomHeader:n,CustomTrigger:d,NoDataContent:w,Chip:c,onSelect:f,onScroll:b,disabled:y,multiple:v,searchable:m,selectAll:p,virtualizedThreshold:C=100,id:S,dir:h,className:N,listClass:k,placeholder:D="Select items...",variant:M,labelPosition:_="top"}=t,[T,I]=i.useState(!1),[B,te]=i.useState(""),[W,H]=i.useState(s),K=i.useMemo(()=>r,[r]),Y=i.useMemo(()=>{if(!m||!B)return a;const O=B.toLowerCase().trim();return a.filter(z=>z[r.label].toLowerCase().trim().includes(O))},[a,B,r.label,m]),oe=O=>{v?H(z=>{const E=O[r.value],U=Array.isArray(z)?z:[],ne=U.some(Se=>Se[r.value]===E)?U.filter(Se=>Se[r.value]!==E):[...U,O];return f&&f(ne),ne}):(H(O),f&&f(O),I(!1))},ae=i.useCallback(O=>{const z=O?a:[];H(z),p!=null&&p.onSelectAll&&p.onSelectAll(O),f&&f(z)},[a,p,f]),Ne=O=>Array.isArray(W)?W.some(z=>z[r.value]===O[r.value]):(W==null?void 0:W[r.value])===O[r.value];i.useEffect(()=>{H(s)},[s]);const Ce=O=>{const z=E=>e.jsx(Fs,{option:E,accessorKey:K,multiple:v,onSelect:()=>oe(E),value:W,dir:h,children:u?u({value:E,isSelected:Ne(E)}):e.jsx(e.Fragment,{children:E[r.label]})},String(E[r.value]));return O.length>C?e.jsx(ve,{list:O,callback:(E,U)=>z(U),dir:h}):O.map(z)};return e.jsxs("div",{className:o("wu-flex wu-text-sm wu-gap-2",_==="top"&&"wu-flex-col wu-gap-1",_==="left"&&"wu-flex-row",_==="right"&&"wu-flex-row-reverse",ue("container")),dir:h,children:[l&&e.jsx(Z,{htmlFor:S,className:ue("label"),children:l}),e.jsxs(R,{open:T,onOpenChange:O=>{I(O),O||setTimeout(()=>{te("")},100)},children:[e.jsx(Ps,{CustomTrigger:d,disabled:y,value:W,accessorKey:r,placeholder:D,Chip:c,className:N,handleUnselect:oe,variant:M,id:S,dir:h}),e.jsx(X,{className:o("wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p",ue("content")),align:"start",sideOffset:-1,children:e.jsxs(ot,{id:t.id,shouldFilter:!1,children:[m&&e.jsx(zs,{value:B,onValueChange:te}),n,e.jsxs(lt,{className:o("wu-max-h-96 wu-overflow-y-auto",ue("list"),k),onScroll:b,children:[e.jsx(nt,{children:w||"No results found."}),e.jsx(He,{children:v&&(p==null?void 0:p.enabled)&&!B&&e.jsx(Bs,{data:a,value:W,onSelectAll:ae,label:p.label})}),e.jsx(He,{children:Ce(Y)})]})]})})]})]})},js=t=>{const{checked:a,onSelect:r,children:s,disabled:u,preventCloseOnSelect:l}=t;return e.jsx(sa,{disabled:u,checked:a,onCheckedChange:r,onSelect:n=>l&&n.preventDefault(),children:s})},ft=t=>{const{children:a,className:r,Icon:s,iconPosition:u="left",disabled:l,onSelect:n,preventCloseOnSelect:d}=t,w=o("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{n&&n(f),d&&f.preventDefault()};return e.jsxs(je,{onSelect:c,disabled:l,className:w,children:[s&&e.jsx("div",{className:"wu-text-base",children:s}),a]})},Us=t=>{const{children:a,...r}=t;return e.jsxs(ta,{...r,children:[e.jsx(_e,{children:t.label}),a]})},$s=t=>{const{options:a,value:r,onSelect:s}=t;return e.jsx(Ss,{value:r,onValueChange:s,children:a.map(u=>e.jsx(ua,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},Gs=t=>{const{className:a,...r}=t,s=o("wu-w-11/12 wu-mx-auto wu-border-gray-40",a);return e.jsx(Ue,{...r,className:s})},Vs=t=>{const{children:a,label:r,open:s,onOpenChange:u,height:l,dir:n,...d}=t;return e.jsxs(Cs,{...d,open:s,onOpenChange:u,children:[e.jsx(aa,{dir:n,children:r}),e.jsx(Ns,{children:e.jsx(ra,{onInteractOutside:w=>w.preventDefault(),children:e.jsx(se,{className:"wu-h-fit",style:{height:l},dir:n,children:a})})})]})},Ys="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",pa=t=>{const{children:a,menuTitle:r,variant:s="flat",name:u,open:l,onOpenChange:n,height:d,preventCloseOnClickOutside:w,dir:c,Trigger:f,align:b="start",sideOffset:y=0,side:v="bottom",alignOffset:m,className:p,disabled:C,...S}=t;return e.jsxs(Rt,{...S,open:l,onOpenChange:n,dir:c,children:[e.jsx(ea,{asChild:!0,dir:c,disabled:C,className:o("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??Js(s,u,C)}),e.jsx(dt,{className:o("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",p,"wu-menu-content"),align:b,sideOffset:y,side:v,alignOffset:m,onInteractOutside:h=>w&&h.preventDefault(),children:e.jsxs(se,{className:"h-fit",style:{height:d},dir:c,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_e,{dir:c,className:"wu-menu-title",children:r}),e.jsx(Ue,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),a??e.jsx("p",{children:"Menu Is Empty"})]})})]})},Js=(t,a,r)=>{const s=o(Ys,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",t==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return e.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[e.jsx("span",{children:a??"Menu"}),e.jsx("span",{className:o("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",r&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},pt=i.forwardRef(({showMenu:t=!1,className:a,color:r="#1B3380",...s},u)=>{const l=o("wu-w-full wu-border wu-transition-all wu-duration-300");return e.jsxs("div",{...s,className:o("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",a),ref:u,"aria-label":"menu-icon",children:[e.jsx("div",{className:`${l} wu-origin-center ${t?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} ${t?"wu-opacity-0":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} wu-origin-center ${t?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});pt.displayName="WuMenuIcon";const ba={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%]"},Ks=q.Root,Xs=q.Trigger,Qs=q.Portal,Zs=q.Close,ga=i.forwardRef(({className:t,...a},r)=>e.jsx(q.Overlay,{ref:r,className:o("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ba.overlay,t),...a}));ga.displayName=q.Overlay.displayName;const ha=i.forwardRef(({className:t,children:a,hideCloseButton:r,...s},u)=>e.jsxs(Qs,{children:[e.jsx(ga,{}),e.jsxs(q.Content,{ref:u,className:o("wu-fixed wu-left-[50%] wu-top-[50%] wu-z-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",ba.content,t),...s,children:[a,!r&&e.jsx(q.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10",children:[e.jsx("span",{className:"wu-text-lg wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ha.displayName=q.Content.displayName;const ma=({className:t,...a})=>e.jsx("div",{className:o("wu-text-center wu-bg-gray-20 wu-w-full",t),...a});ma.displayName="DialogHeader";const xa=({className:t,...a})=>e.jsx("div",{className:o("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",t),...a});xa.displayName="DialogFooter";const ya=i.forwardRef(({className:t,...a},r)=>e.jsx(q.Title,{ref:r,className:o("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",t),...a}));ya.displayName=q.Title.displayName;const Rs=i.forwardRef(({className:t,...a},r)=>e.jsx(q.Description,{ref:r,className:o("wu-text-sm wu-text-muted-foreground",t),...a}));Rs.displayName=q.Description.displayName;const eu="600px",tu={sm:"400px",md:"600px",lg:"1200px"},au={primary:"wu-bg-blue-p wu-text-white hover:wu-bg-opacity-70",secondary:"hover:wu-bg-blue-p hover:wu-bg-gray-100 wu-text-blue-p",iconOnly:"wu-p-2 hover:wu-bg-gray-40 wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 focus-visible:wu-ring-offset-0 focus:wu-bg-blue-soft"},ru=({Trigger:t,children:a,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:l,open:n,dir:d,maxWidth:w,maxHeight:c,...f})=>e.jsxs(Ks,{...f,modal:!0,onOpenChange:l,open:n,children:[t&&e.jsx(Xs,{asChild:!0,children:t}),e.jsx(ha,{style:{width:"calc(100% - 64px)",maxWidth:w||tu[r],maxHeight:c||eu},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:d,"aria-describedby":void 0,children:a})]}),su=({children:t,style:a={},...r})=>e.jsx("div",{className:"wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto",children:e.jsx("div",{...r,style:{...a,paddingLeft:`${(Number(a==null?void 0:a.paddingLeft)||0)+4}px`,paddingRight:`${(Number(a==null?void 0:a.paddingRight)||0)+4}px`},children:t})}),uu=({children:t,className:a,...r})=>e.jsx(ma,{...r,className:o("wu-text-lg wu-text-gray-lead wu-font-medium",a),children:e.jsx(ya,{children:t})}),ou=({children:t,className:a,...r})=>e.jsx(xa,{...r,className:o("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0",a),children:t}),lu=({children:t,variant:a="primary",className:r,...s})=>e.jsx(Zs,{...s,className:o("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-ring-offset-background wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:wu-opacity-80 disabled:wu-ring-gray-subtle wu-px-6 wu-py-2 wu-min-w-[104px] wu-h-8",au[a],r),children:t}),nu=({placeholder:t="Select...",value:a,multiple:r=!1,accessorKey:s,variant:u="flat",dir:l="ltr",customTriggerChildren:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,width:b,...y})=>{const[v,m]=i.useState(""),[p,C]=i.useState(t);i.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){C(t),m("");return}const h=s.label;if(r&&Array.isArray(a)){const N=a.map(k=>k[h]).join(", ");m(N)}else!r&&!Array.isArray(a)&&m(a[h])},[a,s.label,r,t]);const S=()=>t&&!v?e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:p}):e.jsx("span",{className:o("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(b||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??v:v});return e.jsx(ea,{asChild:!0,dir:l,id:d,disabled:w,children:e.jsxs("button",{...y,disabled:w,className:o("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",u==="outlined"&&"wu-border wu-border-gray-40","wu-group wu-select-trigger",y.className),children:[n??S(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},va=({option:t,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:l="ltr"})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{a&&d(r?a.map(b=>JSON.stringify(b[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const w=r?n.includes(JSON.stringify(t[u.value])):n===JSON.stringify(t[u.value]),c=f=>{t.disabled||(s(t),r&&f.preventDefault())};return e.jsxs(je,{onClick:c,disabled:t.disabled,className:o("wu-cursor-pointer wu-select-item wu-h-8 wu-text-xs",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ee,{checked:w}),e.jsx(Na,{option:t,accessorKey:u})]})},Na=({option:t,accessorKey:a})=>{const r=String(t[a.label]);return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[t.icon,r,t.isAdmin&&e.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Ca=t=>{const{option:a,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...l}=t;switch("type"in a?a.type:"option"){case"all":return e.jsxs(je,{onSelect:d=>{d.stopPropagation(),d.preventDefault(),r==null||r()},className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:l.dir,children:[e.jsx(ee,{"data-partial":u,checked:s||u,partial:u}),e.jsx(Na,{option:a,accessorKey:l.accessorKey})]});case"group":return e.jsxs(ta,{dir:l.dir,children:[e.jsx(_e,{className:"wu-text-xs",children:a.label}),a.options.map((d,w)=>i.createElement(va,{...l,option:d,key:w}))]});case"divider":return e.jsx(Ue,{className:"wu-mx-4"});default:return e.jsx(va,{...l,option:a})}},wu=t=>{let a=0,r=0;const s=[],u=[],l=n=>{n.type==="divider"?a++:n.type==="group"?(r++,n.options.forEach(d=>{l(d)})):(s.push(n),n.disabled||u.push(n))};return t.forEach(n=>{l(n)}),{separators:a,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},du=100,iu=400,cu=32,fu=9,pu=32,Sa=({data:t,onSelect:a,multiple:r=!1,defaultValue:s,value:u,accessorKey:l,variant:n="flat",dir:d="ltr",placeholder:w,Label:c,virtualizedThreshold:f=du,maxHeight:b=iu,hasGroup:y=!1,Header:v,CustomTrigger:m,selectAll:p,disabled:C,labelPosition:S="top",onScroll:h,...N})=>{const[k,D]=i.useState(),M=i.useRef(null),[_,T]=i.useState(!1),[I,B]=i.useState(!1),{cleanData:te,totalData:W,separators:H,groups:K,enabledOptions:Y}=y||p!=null&&p.enable?wu(t):{cleanData:t,totalData:t.length,separators:0,groups:0,enabledOptions:[]},oe=i.useMemo(()=>r&&p!=null&&p.enable&&t.length>0?[{type:"all",[l.label]:p.label||"Select All"},...t]:t,[t,p,r]),ae=i.useCallback(E=>{const U=E[l.value];if(r)D((le=[])=>{const ne=le,Oe=ne.some(Ae=>Ae[l.value]===U)?ne.filter(Ae=>Ae[l.value]!==U):[...ne,E];return a==null||a(Oe),Oe});else{const le=E;D(le),a==null||a(le)}},[r,l.value,a]);i.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&D(void 0),s!==void 0&&D(s),u!==void 0&&D(u)},[s,u]);const Ne=i.useMemo(()=>Math.min(b,W*cu+H*fu+K*pu),[b,W,H,K]),Ce=oe.length>f;i.useEffect(()=>{if(!r)return;const E=p!=null&&p.includeDisabled?(k==null?void 0:k.length)===t.length:(k==null?void 0:k.length)===Y.length;T(E);const U=(k==null?void 0:k.length)>0&&!E;B(U)},[k,p]);const O=i.useCallback(()=>{const E=_?[]:p!=null&&p.includeDisabled?y?te:t:Y;D(E),a==null||a(E)},[_,r,t,Y,a,p]),z=Ie(S);return e.jsxs("div",{className:o(z,"wu-flex wu-select-container"),ref:M,dir:d,children:[e.jsxs(Rt,{children:[e.jsx(nu,{...N,value:k,multiple:r,variant:n,dir:d,placeholder:w,accessorKey:l,customTriggerChildren:m,id:N.id,disabled:C,selectAll:p,isCheckedAll:_}),e.jsxs(dt,{className:"wu-w-[--radix-dropdown-menu-trigger-width] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,id:N.id,children:[v,Ce?e.jsx(ve,{list:oe,containerHeight:b,callback:(E,U)=>e.jsx(Ca,{option:U,accessorKey:l,multiple:r,onSelect:ae,value:k,dir:d,handleSelectAll:O,isCheckedAll:_,isPartialSelected:I}),dir:d}):e.jsx(se,{style:{maxHeight:Ne,height:"fit-content"},onScroll:h,children:oe.map((E,U)=>e.jsx(Ca,{option:E,accessorKey:l,multiple:r,onSelect:ae,value:k,handleSelectAll:O,isCheckedAll:_,dir:d,isPartialSelected:I},`${U}`))})]})]}),c&&e.jsx(Z,{htmlFor:N.id,className:"wu-select-label",children:c})]})},$e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bu=({value:t,onChange:a,min:r=F.sub(new Date,{years:5}),max:s=F.add(new Date,{years:1}),placeholder:u="Select a month",Label:l,labelPosition:n="top",disabled:d,id:w,readonly:c,disabledMonths:f=[],...b})=>{const[y,v]=i.useState(null),[m,p]=i.useState(""),[C,S]=i.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),h=i.useMemo(()=>{const k=new Date(r).getFullYear(),D=new Date(s).getFullYear();return Array.from({length:D-k+1},(M,_)=>({value:D-_,label:D-_}))},[r,s]);i.useEffect(()=>{if(t){const k=new Date(t),D=k.getFullYear(),M=k.getMonth();v({year:D,month:M}),p(`${$e[M]} ${D}`),S({value:D,label:D})}},[t]);const N=()=>{y&&a&&(a(new Date(y.year,y.month,15)),p(`${$e[y.month]} ${y.year}`))};return e.jsxs("div",{className:o("wu-flex wu-flex-col wu-items-center",Ie(n),n==="top"&&"wu-items-start"),children:[e.jsxs(R,{children:[e.jsx(st,{...b,disabled:d||c,id:w,dir:"ltr",placeholder:u,formattedString:m}),e.jsxs(X,{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:[e.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:e.jsx(Sa,{data:h,accessorKey:{value:"value",label:"label"},value:C,onSelect:k=>S(k),multiple:!1,maxHeight:7*32})}),e.jsx(gu,{year:C==null?void 0:C.value,selectedMonth:y==null?void 0:y.month,selectedYear:y==null?void 0:y.year,onClick:(k,D)=>v({year:D,month:k}),disabledMonths:f}),e.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:N,children:"Apply"})})})]})]}),l&&e.jsx(Z,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:l})]})},gu=({year:t,selectedMonth:a,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const l=new Date,n=l.getFullYear(),d=l.getMonth(),w=i.useMemo(()=>{const c=new Set;return u.forEach(f=>{const b=typeof f=="string"?new Date(f):f;c.add(`${b.getFullYear()}-${b.getMonth()}`)}),c},[u]);return e.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:$e.map((c,f)=>{const b=t===n&&f===d,y=a===f&&r===t;return e.jsx("button",{disabled:w.has(`${t}-${f}`),onClick:()=>s(f,t),className:o("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",b&&"wu-border wu-border-blue-p",y&&"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":`${$e[f]} ${t}`,"data-month":f,"data-year":t,children:c},c)})})},ka=(t,a,r,s=96)=>{if(t.length===0||s<=0)return[[],[]];const[l,n]=i.useState([]),[d,w]=i.useState([]);return i.useEffect(()=>{const c=()=>{var m,p;const f=((m=a.current)==null?void 0:m.clientWidth)||0,b=((p=r.current)==null?void 0:p.clientWidth)||0,y=f-b,v=Math.floor(y/s);n(t.slice(0,v)),w(t.slice(v))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,s]),[l,d]},Da={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},hu=t=>{const{Links:a,children:r,className:s,...u}=t,l=i.useMemo(()=>a.map((f,b)=>i.cloneElement(f,{className:o(Da.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:b})),[a]),n=i.useRef(null),d=i.useRef(null),[w,c]=ka(l,n,d);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:w}),c.length>0&&e.jsxs(R,{children:[e.jsx(ce,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(X,{className:o(Da.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:d,children:r}),e.jsxs(R,{children:[e.jsx(ce,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(X,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},bt={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},mu=t=>{const{Links:a,children:r,className:s,...u}=t,l=i.useMemo(()=>a.map((b,y)=>i.cloneElement(b.link,{key:y,className:o(bt.wuSecondaryLink,b.link.props.className,"wu-secondary-nav-link-container"),children:e.jsxs(e.Fragment,{children:[i.cloneElement(b.imgOrIcon,{className:o("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",b.imgOrIcon.props.className)}),e.jsx("div",{className:"wu-secondary-nav-link",children:b.link.props.children})]})})),[a]),n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),[c,f]=ka(l,n,w);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("nav",{className:o(bt.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:d,children:c}),f.length>0&&e.jsxs(R,{children:[e.jsx(ce,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(X,{className:o(bt.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:w,children:r}),e.jsxs(R,{children:[e.jsx(ce,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(X,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},Ta=i.forwardRef(({totalRows:t,initialPage:a,initialPageSize:r=100,onPageChange:s,className:u,disabled:l=!1,...n},d)=>{const[w,c]=i.useState(a),[f,b]=i.useState(r);i.useEffect(()=>{c(a),b(r)},[a,r]);const y=Math.ceil(t/f),v=w*f+1,m=Math.min((w+1)*f,t),p=Array.from({length:y},(h,N)=>N),C=i.useCallback(h=>{h>=0&&h<y&&(c(h),s==null||s(h))},[y,s]),S=7*32;return e.jsxs("div",{className:o("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...n,role:"navigation",children:[e.jsx(Ma,{label:"Previous page",onClick:()=>C(w-1),disabled:w===0||l,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),e.jsx(pa,{name:`${v} - ${m}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:l,children:e.jsx(se,{style:{maxHeight:S+"px"},dir:n.dir,children:p.length>100?e.jsx(ve,{className:"wu-pagination-list",containerHeight:S,list:p,callback:(h,N)=>e.jsxs(ft,{onSelect:()=>C(N),className:o("wu-py-2",N===w&&"wu-bg-gray-20","wu-pagination-item"),children:[N*f+1," -"," ",Math.min((N+1)*f,t)]},h)}):p.map(h=>e.jsxs(ft,{onSelect:()=>C(h),className:o(h===w&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[h*f+1," -"," ",Math.min((h+1)*f,t)]},h))})}),e.jsx(Ma,{label:"Next page",onClick:()=>C(w+1),disabled:w===y-1||l,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ta.displayName="WuPagination";const Ma=({label:t,onClick:a,disabled:r,icon:s,className:u})=>e.jsx(V,{variant:"iconOnly",onClick:a,disabled:r,className:o("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",u),"aria-label":t,children:e.jsx("span",{className:o("wu-text-sm",s)})}),xu=({Trigger:t,children:a,className:r,dir:s,open:u,onOpenChange:l,modal:n,...d})=>e.jsxs(R,{open:u,onOpenChange:l,modal:n,children:[e.jsx(ce,{asChild:!0,dir:s,children:t}),e.jsx(X,{className:o("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...d,children:a})]}),yu=t=>e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(V,{...t})}),Ia=x.forwardRef(({className:t,...a},r)=>e.jsx(Me.Root,{className:o("wu-grid wu-gap-2",t),...a,ref:r}));Ia.displayName=Me.Root.displayName;const Wa=x.forwardRef(({className:t,...a},r)=>e.jsx(Me.Item,{ref:r,className:o("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",t),...a,children:e.jsx(Me.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:e.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"})})}));Wa.displayName=Me.Item.displayName;const _a=i.forwardRef((t,a)=>{const{options:r,defaultValue:s,onChange:u,label:l,dir:n,...d}=t;return e.jsxs(Ia,{defaultValue:s,required:d.required,disabled:d.disabled,onValueChange:u,id:d.id,dir:n,name:d.name,className:o("w-fit",d.className),ref:a,style:d.style,children:[e.jsx(xe,{htmlFor:d.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:l}),r.map(w=>e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[e.jsx(Wa,{value:w.value,id:w.value,disabled:w.disabled,required:w.required,"aria-label":w.value,className:"wu-peer wu-radio-item"}),e.jsx(xe,{htmlFor:w.value,className:o(w.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:w.label})]},w.value))]})});_a.displayName="WuRadioGroup";const Ea=x.forwardRef(({className:t,orientation:a="horizontal",decorative:r=!0,...s},u)=>e.jsx(Tt.Root,{ref:u,decorative:r,orientation:a,className:o("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...s}));Ea.displayName=Tt.Root.displayName;function qa({className:t,...a}){return e.jsx("div",{className:o("animate-pulse rounded-md bg-muted",t),...a})}const gt=768;function vu(){const[t,a]=x.useState(void 0);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${gt-1}px)`),s=()=>{a(window.innerWidth<gt)};return r.addEventListener("change",s),a(window.innerWidth<gt),()=>r.removeEventListener("change",s)},[]),!!t}const Nu="sidebar_state",Cu=60*60*24*7,Su="256px",ku="256px",Du="3rem",Tu="b",Oa=x.createContext(null);function fe(){const t=x.useContext(Oa);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Aa=x.forwardRef(({defaultOpen:t=!0,open:a,onOpenChange:r,className:s,style:u,children:l,...n},d)=>{const w=vu(),[c,f]=x.useState(!1),[b,y]=x.useState(t),v=a??b,m=x.useCallback(h=>{const N=typeof h=="function"?h(v):h;r?r(N):y(N),document.cookie=`${Nu}=${N}; path=/; max-age=${Cu}`},[r,v]),p=x.useCallback(()=>w?f(h=>!h):m(h=>!h),[w,m,f]);x.useEffect(()=>{const h=N=>{N.key===Tu&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),p())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[p]);const C=v?"expanded":"collapsed",S=x.useMemo(()=>({state:C,open:v,setOpen:m,isMobile:w,openMobile:c,setOpenMobile:f,toggleSidebar:p}),[C,v,m,w,c,f,p]);return e.jsx(Oa.Provider,{value:S,children:e.jsx(jt,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":Su,"--sidebar-width-icon":Du,...u},className:o("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:d,...n,children:l})})})});Aa.displayName="SidebarProvider";const Pa=x.forwardRef(({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:s,children:u,...l},n)=>{const{isMobile:d,state:w,openMobile:c,setOpenMobile:f}=fe();return r==="none"?e.jsx("div",{className:o("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:n,...l,children:u}):d?e.jsx(na,{open:c,onOpenChange:f,...l,children:e.jsxs(it,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":ku},side:t,children:[e.jsxs(da,{className:"sr-only",children:[e.jsx(ct,{children:"Sidebar"}),e.jsx(ia,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):e.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":w,"data-collapsible":w==="collapsed"?r:"","data-variant":a,"data-side":t,children:[e.jsx("div",{className:o("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",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),e.jsx("div",{className:o("wu-fixed wu-inset-y-0 wu-z-10 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",t==="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)]",a==="floating"||a==="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),...l,children:e.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:u})})]})});Pa.displayName="Sidebar";const La=x.forwardRef(({className:t,onClick:a,children:r,...s},u)=>{const{toggleSidebar:l}=fe();return e.jsxs(he,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:o("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",t),onClick:n=>{a==null||a(n),l()},...s,children:[r,e.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});La.displayName="SidebarTrigger";const Mu=x.forwardRef(({className:t,...a},r)=>{const{toggleSidebar:s}=fe();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:o("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",t),...a})});Mu.displayName="SidebarRail";const Fa=x.forwardRef(({className:t,...a},r)=>e.jsx("main",{ref:r,className:o("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",t),...a}));Fa.displayName="SidebarInset";const Iu=x.forwardRef(({className:t,...a},r)=>e.jsx(Fe,{ref:r,"data-sidebar":"input",className:o("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",t),...a}));Iu.displayName="SidebarInput";const Ba=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:o("wu-flex wu-flex-col wu-gap-2 wu-p-2",t),...a}));Ba.displayName="SidebarHeader";const za=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:o("wu-flex wu-flex-col wu-gap-2 wu-pb-2",t),...a}));za.displayName="SidebarFooter";const Wu=x.forwardRef(({className:t,...a},r)=>e.jsx(Ea,{ref:r,"data-sidebar":"separator",className:o("wu-mx-2 wu-w-auto",t),...a}));Wu.displayName="SidebarSeparator";const Ha=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:o("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",t),...a}));Ha.displayName="SidebarContent";const ja=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:o("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",t),...a}));ja.displayName="SidebarGroup";const Ua=x.forwardRef(({className:t,asChild:a=!1,...r},s)=>{const u=a?be.Slot:"div";return e.jsx(u,{ref:s,"data-sidebar":"group-label",className:o("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",t),...r})});Ua.displayName="SidebarGroupLabel";const _u=x.forwardRef(({className:t,asChild:a=!1,...r},s)=>{const u=a?be.Slot:"button";return e.jsx(u,{ref:s,"data-sidebar":"group-action",className:o("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",t),...r})});_u.displayName="SidebarGroupAction";const $a=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:o("wu-w-full wu-text-sm",t),...a}));$a.displayName="SidebarGroupContent";const ht=x.forwardRef(({className:t,...a},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:o("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",t),...a}));ht.displayName="SidebarMenu";const Ga=x.forwardRef(({className:t,...a},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:o("wu-group/menu-item wu-relative",t),...a}));Ga.displayName="SidebarMenuItem";const Eu=J.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"}}),Va=x.forwardRef(({asChild:t=!1,isActive:a=!1,variant:r="default",size:s="default",tooltip:u,className:l,...n},d)=>{const w=t?be.Slot:"button",{isMobile:c,state:f}=fe(),b=e.jsx(w,{ref:d,"data-sidebar":"menu-button","data-size":s,"data-active":a,className:o(Eu({variant:r,size:s}),l),...n});return u?(typeof u=="string"&&(u={children:u}),e.jsxs(Ut,{children:[e.jsx($t,{asChild:!0,children:b}),e.jsx(at,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):b});Va.displayName="SidebarMenuButton";const qu=x.forwardRef(({className:t,asChild:a=!1,showOnHover:r=!1,...s},u)=>{const l=a?be.Slot:"button";return e.jsx(l,{ref:u,"data-sidebar":"menu-action",className:o("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",r&&"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",t),...s})});qu.displayName="SidebarMenuAction";const Ou=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:o("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",t),...a}));Ou.displayName="SidebarMenuBadge";const Au=x.forwardRef(({className:t,showIcon:a=!1,...r},s)=>{const u=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:o("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",t),...r,children:[a&&e.jsx(qa,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),e.jsx(qa,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});Au.displayName="SidebarMenuSkeleton";const Pu=x.forwardRef(({className:t,...a},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:o("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",t),...a}));Pu.displayName="SidebarMenuSub";const Lu=x.forwardRef(({...t},a)=>e.jsx("li",{ref:a,...t}));Lu.displayName="SidebarMenuSubItem";const Fu=x.forwardRef(({asChild:t=!1,size:a="md",isActive:r,className:s,...u},l)=>{const n=t?be.Slot:"a";return e.jsx(n,{ref:l,"data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:o("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",a==="sm"&&"wu-text-xs",a==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});Fu.displayName="SidebarMenuSubButton";const Bu=({children:t,Sidebar:a,className:r,defaultOpen:s=!0,open:u,onOpenChange:l,style:n})=>e.jsxs(Aa,{defaultOpen:s,open:u,onOpenChange:l,children:[e.jsxs(Pa,{variant:"sidebar",collapsible:"icon",className:o("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:n,role:"complementary",children:[e.jsx(Ba,{className:"wu-py-2",children:e.jsx(Ya,{})}),a]}),e.jsx(Fa,{children:t})]}),Ya=t=>{const{state:a,isMobile:r,openMobile:s}=fe();return e.jsx(La,{...t,children:e.jsx(pt,{showMenu:r?s:a==="expanded"})})},zu=({className:t,children:a,...r})=>{const s=i.useRef(null),u=i.useRef(null),l=({currentTarget:d})=>{const{scrollTop:w,clientHeight:c,scrollHeight:f}=d;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",w!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",w+c!==f)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return e.jsxs(Ha,{...r,className:o("wu-overflow-hidden wu-gap-0",t),children:[e.jsx("hr",{className:n,ref:s}),e.jsx(se,{onScroll:l,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:a}),e.jsx("hr",{className:n,ref:u})]})},Hu=t=>e.jsx(za,{...t,children:t.children}),ju=({label:t,children:a,...r})=>e.jsxs(ja,{...r,className:"wu-p-0",children:[e.jsx("div",{className:"wu-h-8",children:e.jsx(Ua,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:t})}),e.jsx($a,{children:e.jsx(ht,{children:a})})]}),Uu=t=>e.jsx(ht,{...t}),$u=({Icon:t,children:a,className:r,isActive:s,...u})=>{const{state:l}=fe(),[n,d]=i.useState(),w=a&&i.cloneElement(a,{children:e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[t,e.jsx("span",{className:o("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",l==="collapsed"&&"wu-opacity-0"),children:a.props.children})]})}),c=i.useRef(null);return i.useEffect(()=>{var f;d(((f=c.current)==null?void 0:f.textContent)||"")},[]),e.jsx(Ga,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:e.jsx(Va,{className:o("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",r,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:n,asChild:!0,ref:c,children:w})})},Gu=t=>{const{children:a,...r}=t;return e.jsxs(se,{...r,role:"complementary","aria-label":"ScrollArea",children:[a,e.jsx(wt,{orientation:"horizontal"})]})},Vu={wuStepper:"_wuStepper_apbnq_1"},Ja=i.forwardRef((t,a)=>{const{onChange:r,defaultValue:s=0,min:u,max:l,step:n,readonly:d,resetInvalidValueOnBlur:w=!0,value:c,label:f,labelPosition:b="top",className:y,style:v,...m}=t,[p,C]=i.useState(c||s),S=T=>!!(t.disabled||t.readOnly||T==="inc"&&Number(p||0)>=Number(l)||T==="dec"&&Number(p||0)<=Number(u)),h=i.useCallback(T=>{T.preventDefault(),C(I=>Number(I||u||0)+Number(n||1))},[u,n]),N=i.useCallback(T=>{T.preventDefault(),C(I=>I?Number(I)-Number(n||1):0)},[u,n]),k=i.useCallback(T=>T>=Number(u)&&T<=Number(l),[u,l]),D=T=>{const I=T.currentTarget.value;C(I)},M=i.useCallback(()=>{if(w&&!k(Number(p))){const T=Number(u)||0;C(T)}},[u,w,k,p]);i.useEffect(()=>{r&&r(Number(p))},[p,c]),i.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const _=o("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return e.jsxs("div",{className:o(Vu.wuStepper,Yu({labelPosition:b}),y,"wu-stepper"),style:v,dir:m.dir,children:[e.jsx(xe,{htmlFor:m.id,className:o(b!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:m.dir,children:f}),e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:m.dir,children:[e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-add"}),className:o("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-right-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tr-sm wu-p-2",m.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:h,disabled:S("inc"),"aria-label":"increment"}),e.jsx(Fe,{...m,ref:a,type:"number",className:_,onChange:D,min:u,max:l,step:n,readOnly:d,onBlur:M,value:p}),e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-minimize"}),className:o("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-left-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tl-sm wu-p-2",m.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:N,disabled:S("dec"),"aria-label":"decrement"})]})]})}),Yu=J.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"}}});Ja.displayName="WuStepper";const Ka=J.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"}}),Ju=x.forwardRef(({className:t,variant:a,size:r,...s},u)=>e.jsx(Mt.Root,{ref:u,className:o(Ka({variant:a,size:r,className:t})),...s}));Ju.displayName=Mt.Root.displayName;const Xa=x.createContext({size:"default",variant:"default"}),Ge=x.forwardRef(({className:t,variant:a,size:r,children:s,...u},l)=>e.jsx(Pe.Root,{ref:l,className:o("wu-flex wu-items-center wu-justify-center wu-gap-1",t),...u,children:e.jsx(Xa.Provider,{value:{variant:a,size:r},children:s})}));Ge.displayName=Pe.Root.displayName;const pe=x.forwardRef(({className:t,children:a,variant:r,size:s,...u},l)=>{const n=x.useContext(Xa);return e.jsx(Pe.Item,{ref:l,className:o(Ka({variant:n.variant||r,size:n.size||s}),t),...u,children:a})});pe.displayName=Pe.Item.displayName;const Qa=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=t,d=w=>o("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",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",w===s&&"wu-text-white",u&&s===w&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return e.jsx(e.Fragment,{children:e.jsxs(Ge,{ref:a,type:"single",value:s,onValueChange:n,disabled:u,dir:l,className:o("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",u&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[e.jsx("div",{role:"slider",className:o("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"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),e.jsx(pe,{value:"opt1",className:d("opt1"),children:r[0].label}),e.jsx(pe,{value:"opt2",className:d("opt2"),children:r[1].label})]})})});Qa.displayName="_IconTab";const Za=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,size:n="md",onChange:d}=t,w=c=>o("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",c===s&&"wu-text-white wu-font-medium",u&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return e.jsx(e.Fragment,{children:e.jsxs(Ge,{ref:a,type:"single",value:s,onValueChange:d,disabled:u,dir:l,className:o("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",u&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[e.jsx("div",{role:"slider",className:o("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 ",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),e.jsx(pe,{value:"opt1",className:w("opt1"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),e.jsx(pe,{value:"opt2",className:w("opt2"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});Za.displayName="_Tab";const Ra=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=t,d=b=>o("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",b===s&&"wu-text-primary wu-font-medium",u&&s===b&&"wu-text-gray-lead","wu-switcher-toggle-item"),w=o("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=o("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",u&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),f=o("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"&&l!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&l==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return e.jsx(e.Fragment,{children:e.jsxs(Ge,{ref:a,type:"single",value:s,disabled:u,dir:l,className:w,onValueChange:n,children:[e.jsx(pe,{value:"opt1",className:d("opt1"),children:e.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:r[0].label})}),e.jsx("button",{onClick:()=>n(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:l,children:e.jsx("div",{className:f,role:"knob",dir:l})}),e.jsx(pe,{value:"opt2",className:d("opt2"),children:e.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});Ra.displayName="_Toggle";const er=i.forwardRef((t,a)=>{const{type:r,options:s,value:u,disabled:l,dir:n,size:d,onChange:w,toggle:c=!0,...f}=t,[b,y]=i.useState(),v=m=>{let p=b;m!==""?p=m:c&&(p=b==="opt1"?"opt2":"opt1");const C=p==="opt1"?s[0].value:s[1].value;w&&w(C),y(p)};if(i.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");y(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return e.jsx(e.Fragment,{});switch(r){case"toggle":return e.jsx(Ra,{...f,ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});case"iconTab":return e.jsx(Qa,{ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});default:return e.jsx(Za,{ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n,size:d})}});er.displayName="WuSwitcher";const mt=x.forwardRef(({className:t,...a},r)=>e.jsx("table",{ref:r,className:o("wu-w-full wu-caption-bottom wu-text-sm",t),...a}));mt.displayName="Table";const tr=x.forwardRef(({className:t,...a},r)=>e.jsx("thead",{ref:r,className:o("[&_tr]:wu-border-b",t),...a}));tr.displayName="TableHeader";const ar=x.forwardRef(({className:t,...a},r)=>e.jsx("tbody",{ref:r,className:o("",t),...a}));ar.displayName="TableBody";const Ku=x.forwardRef(({className:t,...a},r)=>e.jsx("tfoot",{ref:r,className:o("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",t),...a}));Ku.displayName="TableFooter";const Ee=x.forwardRef(({className:t,...a},r)=>e.jsx("tr",{ref:r,className:o("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",t),...a}));Ee.displayName="TableRow";const xt=x.forwardRef(({className:t,...a},r)=>e.jsx("th",{ref:r,className:o("wu-h-10 wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",t),...a}));xt.displayName="TableHead";const Ve=x.forwardRef(({className:t,...a},r)=>e.jsx("td",{ref:r,className:o("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",t),...a}));Ve.displayName="TableCell";const yt=x.forwardRef(({className:t,...a},r)=>e.jsx("caption",{ref:r,className:o("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",t),...a}));yt.displayName="TableCaption";const rr=({columns:t,rowSelection:a})=>{const r=(a==null?void 0:a.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=a||{},l=i.useCallback(d=>w=>{s(()=>w?d:[])},[s]);return{finalColumns:i.useMemo(()=>r?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(f=>f.original),c=l(w);return e.jsx(ee,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:f=>{d.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>e.jsx(ee,{checked:d.getIsSelected(),onChange:w=>{d.toggleSelected(!!w)},"aria-label":String(d.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...t]:t,[t,r,l])}},sr=({table:t,size:a,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var d;const[l,n]=i.useState(null);return e.jsx(ar,{children:s?e.jsx(Ee,{children:e.jsx(Ve,{colSpan:t.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||e.jsx(me,{className:"wu-w-full"})})}):(d=t.getRowModel().rows)!=null&&d.length?t.getRowModel().rows.map(w=>e.jsx(Ee,{"data-state":w.getIsSelected()&&"selected",onMouseOver:()=>n(w.id),onMouseOut:()=>n(null),className:o("wu-transition-colors wu-border-b wu-border-black/[12%]",w.getIsSelected()?l===w.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:w.getVisibleCells().map(c=>e.jsx(Ve,{className:o("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",a==="compact"?"wu-h-8":"wu-h-10",c.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",l===w.id&&c.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:Q.flexRender(c.column.columnDef.cell,c.getContext())},c.id))},w.id)):e.jsx(Ee,{children:e.jsx(Ve,{colSpan:t.getAllColumns().length,children:r})})})},ur=({table:t,sortableColumns:a,manual:r=!1,onSort:s,size:u,isRowSelected:l,HeaderAction:n,isStickyHeader:d})=>{const w=c=>{const{id:f,columnDef:b,getIsSorted:y,toggleSorting:v}=c,{header:m}=b;if(!a.includes(f))return m;const p=y(),C=p==="asc",S=p==="desc",h=()=>{r?(v(!S),s==null||s({id:f,desc:S})):v(c.getIsSorted()==="asc")};return e.jsxs("button",{onClick:h,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,e.jsxs("div",{className:"wu-relative",children:[e.jsx("span",{className:o("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",C&&"wu-hidden",!p&&"-wu-top-[11px]")}),e.jsx("span",{className:o("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!p&&"-wu-bottom-[10px]")})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(tr,{className:o("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",d&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:t.getHeaderGroups().map(c=>e.jsx(Ee,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?e.jsx(xt,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):e.jsx(xt,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:Q.flexRender(w(f.column),f.getContext())},f.id))},c.id))}),l&&n&&e.jsx("div",{className:o("wu-absolute wu-left-10 wu-top-0 wu-flex wu-items-center wu-px-4 wu-border-t",u==="compact"?"wu-h-8":"wu-h-10","wu-bg-gray-20 wu-text-gray-lead wu-text-xs wu-font-medium wu-z-10","wu-w-[calc(100%-40px)]","wu-transition-all wu-duration-300 wu-ease-in-out",d&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:n})]})},Xu=({data:t,columns:a,isLoading:r=!1,variant:s="unstyled",sort:u,size:l,rowSelection:n,HeaderAction:d,NoDataContent:w,stickyHeader:c=!1,CustomLoader:f,caption:b,...y})=>{var h;const v=((h=n==null?void 0:n.selectedRows)==null?void 0:h.length)??0,{finalColumns:m}=rr({columns:a,rowSelection:n}),p=i.useMemo(()=>a.filter(N=>N.enableSorting).map(N=>N.accessorKey),[m]),C=i.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const N={};for(const k of n.selectedRows){const D=t.findIndex(M=>M[n.rowUniqueKey]===k[n.rowUniqueKey]);D!==-1&&(N[D]=!0)}return N},[n==null?void 0:n.selectedRows,t,n==null?void 0:n.rowUniqueKey,n==null?void 0:n.isEnabled]),S=Q.useReactTable({data:t,columns:m,getCoreRowModel:Q.getCoreRowModel(),getPaginationRowModel:Q.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:C}:{}},onRowSelectionChange:N=>{if(typeof N=="function"){const k=N(C),D=Object.keys(k).filter(M=>k[M]).map(M=>t[Number(M)]);n==null||n.onRowSelect(D)}}});return e.jsxs("div",{className:o("wu-table-container wu-relative"),children:[b&&e.jsx(yt,{className:"wu-font-light",children:b}),e.jsxs(mt,{...y,className:o(Qu({variant:s}),y.className),children:[e.jsx(ur,{table:S,sortableColumns:p,manual:!0,onSort:u==null?void 0:u.onSort,size:l,HeaderAction:d,isRowSelected:v>0,isStickyHeader:c}),!r&&e.jsx(sr,{table:S,size:l,NoDataContent:w,CustomLoader:f})]}),r&&e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:e.jsx(me,{})})]})},Qu=J.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"}}}),or=({data:t,columns:a,caption:r,variant:s="unstyled",sort:u,filterText:l,size:n="default",pagination:d,rowSelection:w,HeaderAction:c,NoDataContent:f,CustomLoader:b,isLoading:y,stickyHeader:v,...m})=>{var te;const[p,C]=i.useState((u==null?void 0:u.initial)||[]),[S,h]=i.useState([]),N=((te=w==null?void 0:w.selectedRows)==null?void 0:te.length)??0,[k,D]=i.useState((d==null?void 0:d.pageIndex)??0),{finalColumns:M}=rr({columns:a,rowSelection:w}),_=i.useMemo(()=>M.filter(W=>W.enableSorting).map(W=>W.accessorKey),[M]),T=i.useMemo(()=>M.filter(W=>W.filterable).map(W=>W.accessorKey),[M]),I=i.useMemo(()=>{if(!(w!=null&&w.isEnabled))return{};const W={};for(const H of w.selectedRows){const K=t.findIndex(Y=>Y[w.rowUniqueKey]===H[w.rowUniqueKey]);K!==-1&&(W[K]=!0)}return W},[w==null?void 0:w.selectedRows,t,w==null?void 0:w.rowUniqueKey,w==null?void 0:w.isEnabled]),B=Q.useReactTable({data:t,columns:M,getCoreRowModel:Q.getCoreRowModel(),enableRowSelection:w==null?void 0:w.isEnabled,getPaginationRowModel:Q.getPaginationRowModel(),getSortedRowModel:Q.getSortedRowModel(),getFilteredRowModel:Q.getFilteredRowModel(),initialState:{pagination:{pageSize:(d==null?void 0:d.pageSize)??100,pageIndex:(d==null?void 0:d.pageIndex)??0}},state:{sorting:p,columnFilters:S,...d?{pagination:d}:{},...w!=null&&w.isEnabled?{rowSelection:I}:{}},onSortingChange:C,onColumnFiltersChange:h,onRowSelectionChange:W=>{const H=typeof W=="function"?W(I):W,K=Object.keys(H).filter(Y=>H[Y]).map(Y=>t[Number(Y)]);w==null||w.onRowSelect(K)}});return i.useEffect(()=>{T.forEach(W=>{var H;(H=B.getColumn(W))==null||H.setFilterValue(l)})},[l,T,B]),i.useEffect(()=>{d&&(d==null?void 0:d.pageIndex)!==k&&(w==null||w.onRowSelect(()=>[]),B.resetRowSelection(),D(d.pageIndex))},[d==null?void 0:d.pageIndex]),e.jsx("div",{className:"wu-table-container wu-relative",children:e.jsxs(mt,{...m,className:o(Zu({variant:s}),"wu-table-fixed",m.className),children:[r&&e.jsx(yt,{className:"wu-font-light",children:r}),e.jsx(ur,{table:B,sortableColumns:_,size:n,HeaderAction:c,isRowSelected:N>0,isStickyHeader:v}),e.jsx(sr,{table:B,size:n,NoDataContent:f,CustomLoader:b,isLoading:y})]})})},Zu=J.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"}}});or.displayName="WuTable";const lr=x.forwardRef(({className:t,...a},r)=>e.jsx("textarea",{className:o("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 ",t),ref:r,...a}));lr.displayName="Textarea";const nr=i.forwardRef((t,a)=>{const{Label:r,id:s=Le(),variant:u="flat",readonly:l,maxLength:n,labelPosition:d="top",...w}=t,c=b=>{w.onChange&&w.onChange(b)},f=Ie(d);return e.jsxs("div",{className:o(f,"wu-flex wu-textarea-container"),dir:w.dir,children:[e.jsx(lr,{...w,ref:a,id:s,className:o("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",w.className),onChange:c,readOnly:l,maxLength:n}),r&&e.jsx(Z,{htmlFor:s,className:"wu-textarea-label",children:r})]})});nr.displayName="WuTextarea";const Ru=1,eo=1e6;let vt=0;function to(){return vt=(vt+1)%Number.MAX_SAFE_INTEGER,vt.toString()}const Nt=new Map,wr=t=>{if(Nt.has(t))return;const a=setTimeout(()=>{Nt.delete(t),qe({type:"REMOVE_TOAST",toastId:t})},eo);Nt.set(t,a)},ao=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,Ru)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===a.toast.id?{...r,...a.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=a;return r?wr(r):t.toasts.forEach(s=>{wr(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==a.toastId)}}},Ye=[];let Je={toasts:[]};function qe(t){Je=ao(Je,t),Ye.forEach(a=>{a(Je)})}function ro({...t}){const a=to(),r=u=>qe({type:"UPDATE_TOAST",toast:{...u,id:a}}),s=()=>qe({type:"DISMISS_TOAST",toastId:a});return qe({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:u=>{u||s()}}}),{id:a,dismiss:s,update:r}}function dr(){const[t,a]=i.useState(Je);return i.useEffect(()=>(Ye.push(a),()=>{const r=Ye.indexOf(a);r>-1&&Ye.splice(r,1)}),[t]),{...t,toast:ro,dismiss:r=>qe({type:"DISMISS_TOAST",toastId:r})}}const so=()=>{const{toast:t}=dr();if(!t)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:a="success",message:r,duration:s=3e3})=>{t?t({description:r,variant:a,duration:s}):console.error("Toast instance not initialized")}}},uo=G.Provider,oo=J.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",bottomRight:"wu-right-0 wu-bottom-0",bottomReft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),ir=x.forwardRef(({className:t,position:a,...r},s)=>e.jsx(G.Viewport,{ref:s,className:o(oo({position:a}),t),...r}));ir.displayName=G.Viewport.displayName;const lo=J.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 data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",{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"}},defaultVariants:{variant:"default"}}),cr=x.forwardRef(({className:t,variant:a,...r},s)=>e.jsx(G.Root,{ref:s,className:o(lo({variant:a}),t),...r}));cr.displayName=G.Root.displayName;const no=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Action,{ref:r,className:o("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",t),...a}));no.displayName=G.Action.displayName;const fr=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Close,{ref:r,className:o("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",t),"toast-close":"","aria-label":"Close toast",...a,children:e.jsx("span",{className:"wm-close wu-text-base"})}));fr.displayName=G.Close.displayName;const pr=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Title,{ref:r,className:o("wu-text-sm wu-font-semibold",t),...a}));pr.displayName=G.Title.displayName;const br=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Description,{ref:r,className:o("wu-text-sm wu-opacity-90",t),...a}));br.displayName=G.Description.displayName;function wo(){const{toasts:t}=dr();return e.jsxs(uo,{children:[t.map(function({id:a,title:r,description:s,action:u,variant:l,...n}){const d={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return e.jsxs(cr,{variant:l,...n,children:[e.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&e.jsx(pr,{children:r}),s&&e.jsxs(br,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[e.jsx(ie,{icon:d[l||"success"],className:"wu-text-xl"}),s]})]}),u,e.jsx(fr,{})]},a)}),e.jsx(ir,{})]})}const io=()=>e.jsx(wo,{}),gr=x.forwardRef(({className:t,dir:a,...r},s)=>e.jsx(Qe.Root,{className:o("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",t),...r,ref:s,children:e.jsx(Qe.Thumb,{className:o("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",a==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",a!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));gr.displayName=Qe.Root.displayName;const hr=i.forwardRef((t,a)=>{const{Label:r,labelPosition:s="right",onChange:u,className:l,dir:n,disabled:d,id:w=Le(),...c}=t;return i.useEffect(()=>{const{checked:f,defaultChecked:b}=c;f!==void 0&&b!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),e.jsxs("div",{className:o(co({labelPosition:s}),"wu-toggle-container"),dir:n,children:[e.jsx(gr,{...c,id:w,disabled:d,ref:a,onCheckedChange:u,className:o("wu-peer",l),dir:n}),e.jsx(Z,{htmlFor:w,className:"wu-toggle-label",children:r})]})});hr.displayName="WuToggle";const co=J.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"}}});window.wickUiVersion="1.1.0",g.CHART_COLOR_SYSTEM=Ar,g.WuAccordion=Br,g.WuAppHeader=ds,g.WuAppHeaderAccount=Pt,g.WuAppHeaderBar=Ht,g.WuAppHeaderHelp=Lt,g.WuAppHeaderMenu=zt,g.WuAppHeaderSearch=ns,g.WuButton=V,g.WuCalender=rt,g.WuCard=Kt,g.WuCheckbox=ee,g.WuChip=xs,g.WuCombobox=Ms,g.WuCopyToClipboard=Is,g.WuDataTable=Xu,g.WuDatePicker=cs,g.WuDateRangePicker=bs,g.WuDisplay=Xr,g.WuDrawer=Os,g.WuDrawerClose=As,g.WuFooter=ca,g.WuFormGroup=ls,g.WuHeading=Jr,g.WuHelpButton=fa,g.WuIcon=ie,g.WuInput=ye,g.WuInputError=ss,g.WuInputHint=us,g.WuLabel=Z,g.WuListbox=Hs,g.WuLoader=me,g.WuMenu=pa,g.WuMenuCheckboxItem=js,g.WuMenuIcon=pt,g.WuMenuItem=ft,g.WuMenuItemGroup=Us,g.WuMenuRadioItem=$s,g.WuMenuSeparatorItem=Gs,g.WuModal=ru,g.WuModalClose=lu,g.WuModalContent=su,g.WuModalFooter=ou,g.WuModalHeader=uu,g.WuMonthPicker=bu,g.WuPagination=Ta,g.WuPopover=xu,g.WuPopoverClose=yu,g.WuPrimaryNavbar=hu,g.WuRadioGroup=_a,g.WuScrollArea=Gu,g.WuSecondaryNavbar=mu,g.WuSelect=Sa,g.WuSidebar=Bu,g.WuSidebarContent=zu,g.WuSidebarFooter=Hu,g.WuSidebarGroup=ju,g.WuSidebarItem=$u,g.WuSidebarMenu=Uu,g.WuSidebarTrigger=Ya,g.WuStepper=Ja,g.WuSubMenu=Vs,g.WuSubtext=Kr,g.WuSwitcher=er,g.WuTable=or,g.WuText=Yr,g.WuTextarea=nr,g.WuToast=io,g.WuToggle=hr,g.WuTooltip=Be,g.WuTruncatedLabel=ws,g.WuVirtualScroll=ve,g.useWuShowToast=so,g.useWuSidebar=fe,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,e){typeof exports=="object"&&typeof module<"u"?e(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("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):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","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],e):(g=typeof globalThis<"u"?globalThis:g||self,e(g["wick-ui-lib"]={},g["react/jsx-runtime"],g.AccordionPrimitive,g.React,g.clsx,g.tailwindMerge,g.RadixUIAvatar,g.RadixUISlot,g.ClassVarianceAuthority,g.RadixUILabel,g.RadixUITooltip,g.dateFns,g.RadixUIPopover,g.ReactDayPicker,g.RadixUICheckbox,g.cmdk,g.ReactVirtuoso,g.RadixUIDropdownMenu,g.RadixUIDialog,g.RadixUIScrollArea,g.RadixUIRadioGroup,g.RadixUISeparator,g.RadixUIToggleGroup,g.RadixUIToggle,g.TanstackReactTable,g.RadixUIToast,g.RadixUISwitch))})(this,function(g,e,yr,i,vr,Nr,Cr,be,K,Sr,Xe,F,ke,Dt,kr,G,Dr,Tr,Mr,Ir,Wr,_r,Er,qr,R,Or,Ar){"use strict";function U(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const le=U(yr),x=U(i),ge=U(Cr),Tt=U(Sr),De=U(Xe),Te=U(ke),Qe=U(kr),A=U(Tr),O=U(Mr),ne=U(Ir),Me=U(Wr),Mt=U(_r),Le=U(Er),It=U(qr),V=U(Or),Ze=U(Ar),Pr={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"}},Lr=Nr.extendTailwindMerge({prefix:"wu-"});function o(...t){return Lr(vr.clsx(t))}const Re=t=>{window.open(t,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Fe(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ie(t){switch(t){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 Fr=t=>t?/\S+@questionpro\.com/.test(t):!1,Br=le.Root,Wt=x.forwardRef(({className:t,...a},r)=>e.jsx(le.Item,{ref:r,className:o("wu-border-b",t),...a}));Wt.displayName="AccordionItem";const _t=x.forwardRef(({className:t,children:a,...r},s)=>e.jsx(le.Header,{className:"wu-flex",children:e.jsxs(le.Trigger,{ref:s,className:o("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",t),...r,children:[a,e.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));_t.displayName=le.Trigger.displayName;const Et=x.forwardRef(({className:t,children:a,...r},s)=>e.jsx(le.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",...r,children:e.jsx("div",{className:o("wu-pb-4 wu-pt-0",t),children:a})}));Et.displayName=le.Content.displayName;const zr=({items:t,defaultValue:a,className:r="",dir:s="ltr",value:u,onValueChange:l})=>e.jsx(Br,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:a,value:u,onValueChange:l,dir:s,collapsible:!0,children:t.map(({value:n,Summary:d,Details:w,className:c})=>e.jsxs(Wt,{value:n,dir:s,className:o(r,c),children:[e.jsx(_t,{dir:s,children:d}),e.jsx(Et,{children:w})]},n))}),qt=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Root,{ref:r,className:o("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",t),...a}));qt.displayName=ge.Root.displayName;const Ot=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Image,{ref:r,className:o("wu-aspect-square wu-h-full wu-w-full",t),...a}));Ot.displayName=ge.Image.displayName;const At=x.forwardRef(({className:t,...a},r)=>e.jsx(ge.Fallback,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",t),...a}));At.displayName=ge.Fallback.displayName;function et(t,a){i.useEffect(()=>{const r=s=>{Array.isArray(t)&&t.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(t)&&(!t.current||t.current.contains(s.target))||a(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,a])}const tt={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Pt=({dir:t,Trigger:a,triggerClassName:r,DropdownContent:s})=>{const[u,l]=i.useState(!1),n=i.useRef(null),d=i.useRef(null);et([n,d],()=>l(!1));const w=()=>{l(!u)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:tt.dropdownContainer,children:e.jsx("ul",{children:e.jsxs("li",{className:o("wu-flex wu-relative",u&&tt.open),children:[e.jsx("button",{className:o("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",r),onClick:c=>{c.preventDefault(),w()},ref:d,"aria-label":"dropdown-trigger",children:a}),e.jsx("div",{className:o(tt.dropdownMenu,{open:u},t==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:t,ref:n,"aria-label":"user-menu",children:s})]})})})})},at=K.cva("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-ring-offset-background wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-focus focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:wu-opacity-80 disabled:wu-ring-gray-subtle wu-leading-[1px]",{variants:{size:{md:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-8",sm:"wu-px-4 wu-py-1 wu-min-w-[104px] wu-h-6",mobile:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-10"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHover wu-text-blue-p wu-ring-1 wu-ring-blue-p hover:wu-text-blue-q hover:wu-ring-blue-pHover",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",error:"wu-bg-red-deep hover:wu-bg-red-deep/80 wu-text-red-deep hover:wu-text-red-deep/80 wu-ring-1 wu-ring-red-deep hover:wu-ring-red-deep/80"},variant:{primary:"wu-text-white wu-ring-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-ring-0 hover:wu-bg-gray-20 ",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent",rounded:"wu-text-white wu-ring-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-ring-0 wu-underline-offset-2 wu-min-w-[auto] wu-px-2 disabled:wu-bg-transparent",iconOnly:"wu-rounded wu-p-2 wu-text-xl wu-h-8 wu-w-8 wu-leading-5 wu-text-gray-lead hover:wu-text-blue-q hover:wu-bg-gray-20 wu-ring-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-ring-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"}}),he=x.forwardRef(({className:t,variant:a,size:r,color:s,asChild:u=!1,...l},n)=>{const d=u?be.Slot:"button";return e.jsx(d,{className:o(at({size:r,color:s,variant:a,className:t})),ref:n,...l})});he.displayName="Button";const me=i.forwardRef((t,a)=>Hr(t,a)),Hr=(t,a)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...l}=t,n=o("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let d="7px";r==="sm"?d="7px":r==="md"?d="12px":r==="lg"?d="18px":typeof r=="string"&&(d=r);const w={backgroundColor:s,width:d,height:d},c=e.jsxs("div",{...l,ref:a,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",t.className),role:"status","aria-busy":"true",children:[e.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:d,height:d,borderTopColor:s}}),t.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:t.message})]}),f=e.jsxs("div",{...l,ref:a,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",t.className),role:"alert","aria-busy":"true",children:[e.jsxs("ul",{className:n,style:{fontSize:d},role:"loader",children:[e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w})]}),t.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:t.message})]});return e.jsx(e.Fragment,{children:u==="spinner"?c:f})};me.displayName="WuLoader";const Y=i.forwardRef(({disabled:t,loading:a,variant:r="primary",size:s="md",Icon:u,iconPosition:l="left",children:n,floating:d,className:w,color:c="primary",...f},b)=>{const m={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return e.jsxs(he,{...f,disabled:t,variant:r,size:s,className:o(d&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",l==="right"&&"wu-flex-row-reverse",w,a?"wu-cursor-not-allowed wu-ring-0":""),color:c,style:{backgroundColor:a?m[c]:"",...f.style},ref:b,children:[!a&&u&&e.jsx(e.Fragment,{children:u}),a&&e.jsx(me,{color:"#fff",size:"sm"}),!a&&n]})});Y.displayName="WuButton";const jr=({onLogout:t,DataCenter:a})=>e.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[e.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:a}),e.jsx(Y,{variant:"outline",size:"sm",Icon:e.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:t,"aria-label":"logout",children:"LOGOUT"})]}),Ur=({user:t,dir:a})=>{const r=[t!=null&&t.usage&&Object.keys(t.usage).length>0?{title:t.usage.title,url:t.usage.url,icon:"wm-bar-chart wu-text-base",node:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[e.jsx("code",{className:"wu-font-medium",children:t.usage.collectedResponseCount||"0"}),e.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,t!=null&&t.invoice&&Object.keys(t.invoice).length>0?{title:t.invoice.title,url:t.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:e.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:e.jsx("code",{children:t.invoice.size})})}:null].filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx("ul",{children:r.map(({title:s,url:u,icon:l,node:n},d)=>e.jsx("li",{className:d<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:e.jsxs("a",{href:u,className:o("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",a==="rtl"?"wu-pl-4":"wu-pr-4"),children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("span",{className:o(l,"wu-w-12 wu-text-center")}),e.jsx("span",{children:s})]}),n]})},d))}),e.jsx("hr",{className:"wu-border-gray-subtle"})]})},$r=({settings:t,dir:a})=>e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"wu-border-gray-subtle"}),e.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("span",{className:o("wu-absolute wm-settings wu-text-base",a==="rtl"?"wu-right-4":"wu-left-4")}),e.jsx("ul",{className:"wu-w-full",dir:a,children:t==null?void 0:t.map(r=>e.jsx("li",{tabIndex:-1,dir:a,children:e.jsx("a",{href:r.url,className:o("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),e.jsx("hr",{className:"wu-border-gray-subtle"})]}),Gr=({user:t,dir:a})=>{var r,s,u,l,n,d,w,c,f;return e.jsxs("section",{className:o("wu-flex wu-gap-2 wu-p-4 wu-w-full",a==="rtl"?"wu-pr-0":"wu-pl-0"),children:[e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:e.jsx("span",{className:"wu-text-base wm-person"})}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-1",a==="rtl"&&"wu-text-right"),children:[e.jsx("p",{children:(r=t==null?void 0:t.profile)==null?void 0:r.title}),e.jsxs("a",{href:(s=t==null?void 0:t.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:a,children:[e.jsx("p",{children:(u=t==null?void 0:t.profile)==null?void 0:u.subtitle}),e.jsx("p",{className:"wu-font-light",children:(l=t==null?void 0:t.profile)==null?void 0:l.companyName})]}),(t==null?void 0:t.license)&&Object.keys(t.license).length>0&&e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:a,children:[e.jsx("a",{href:(n=t==null?void 0:t.license)==null?void 0:n.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[e.jsx("p",{className:"wu-font-normal",children:(d=t==null?void 0:t.license)==null?void 0:d.subtitle}),e.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:(w=t==null?void 0:t.license)==null?void 0:w.title})]})}),e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:a,children:[e.jsx("p",{className:"wu-font-normal",children:(c=t==null?void 0:t.license)==null?void 0:c.expiryDatePostFixString}),e.jsx("p",{children:(f=t==null?void 0:t.license)==null?void 0:f.expiryDate})]})]})]})]})},Lt=({user:t,onLogout:a,dir:r,DataCenter:s})=>{var u,l;return t?e.jsx(Pt,{Trigger:e.jsxs(qt,{className:o("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:[e.jsx(Ot,{className:"hover:wu-opacity-80",src:(u=t==null?void 0:t.profile)==null?void 0:u.profilePicture,alt:"User"}),e.jsx(At,{children:(l=t==null?void 0:t.profile)==null?void 0:l.initials})]}),dir:r,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:e.jsxs("div",{className:o("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:r,children:[e.jsx(Gr,{user:t,dir:r}),(t==null?void 0:t.settings)&&t.settings.length>0&&e.jsx($r,{settings:t.settings,dir:r}),e.jsx(Ur,{user:t,dir:r}),e.jsx(jr,{onLogout:a,DataCenter:s})]})}):null},Ft=({menuList:t,dir:a})=>{const r=[{icon:"wm-info",title:"Help Center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-calendar-month",title:"Free Online 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-chat",title:"Live Chat",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return e.jsx(Pt,{dir:a,Trigger:e.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-gray-switcher wu-app-header-help",DropdownContent:e.jsx("ul",{children:(t||r).map((s,u)=>e.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:a,children:s.target==="window"?e.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Re(s.link),onKeyDown:l=>{l.key==="Enter"&&Re(s.link)},className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer",children:e.jsx(Bt,{item:s,dir:a})}):e.jsx("a",{href:s.link,target:"_blank",className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0",rel:"noreferrer",children:e.jsx(Bt,{item:s,dir:a})})},u))})})},Bt=({item:t,dir:a})=>e.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[e.jsx("span",{className:`${t.icon} wu-text-xl wu-text-gray-subtle`}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-[2px]",a==="rtl"&&"wu-text-right"),children:[e.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:t.subTitle}),e.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:t.title})]})]}),Vr=t=>{const[a,r]=i.useState(()=>window.innerWidth<=t);return i.useEffect(()=>{const s=()=>{r(window.innerWidth<=t)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[t]),a};function Yr({productCategories:t,openCategory:a,setOpenCategory:r}){const s=(d,w)=>{const c=w[d];if(c){c.focus();const f=t[d]||null;r(f)}},u=(d,w,c,f)=>{d.preventDefault();const b=c==="down"?w+1:w-1;s(b,f)},l=(d,w,c,f)=>{a!=null&&a.products&&a.products[a.products.length-1].name===f&&(d.preventDefault(),s(w+1,c))},n=(d,w)=>{d.preventDefault();const c=t[w]===a?null:t[w];r(c)};return function(w,c,f){const b=document.querySelectorAll("[data-product-category]"),{key:m}=w;switch(m){case"ArrowDown":u(w,c,"down",b);break;case"ArrowUp":u(w,c,"up",b);break;case"Tab":l(w,c,b,f);break;case"Enter":case" ":n(w,c);break}}}const Jr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=t.as||"div";return e.jsx(n,{...u,className:o(l[a],r),children:s})},Kr=t=>{const{size:a="xl",className:r,children:s,...u}=t,l={sm:"h4",md:"h3",lg:"h2",xl:"h1"},n={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},d=l[a];return e.jsx(d,{...u,className:o(n[a],r),children:s})},Xr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=t.as||"div";return e.jsx(n,{...u,className:o(l[a],r),children:s})},Qr=t=>{const{size:a="lg",className:r,children:s,...u}=t,l={md:"wu-text-display-2",lg:"wu-text-display-1"},n=t.as||"h1";return e.jsx(n,{...u,className:o(l[a],r),children:s})},we=t=>{const{icon:a,className:r,...s}=t;return e.jsx("span",{...s,className:o(a,r),role:"presentation","aria-label":a})},Zr=({buttonRef:t,handleDropdownToggle:a,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:l="ltr",homeLink:n="/"})=>e.jsxs("button",{ref:t,type:"button",className:o("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:a,onKeyDown:d=>{s&&d.key==="ArrowDown"&&r(d,-1)},"aria-label":"product-switcher",children:[e.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:n,children:e.jsx(we,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",l==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),P={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"},Rr=({category:t,dir:a="ltr",openCategory:r})=>{const s=t.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===t.name,l=o("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",a==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),n=o("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",a==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return e.jsxs("div",{className:o("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:a,children:[e.jsx("div",{className:P.productCategoryBorderTop,style:{backgroundColor:s}}),e.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[e.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:e.jsx("img",{src:t.logo,alt:t.name,width:"32px",height:"32px"})}),e.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:t.name})]}),t.active?e.jsx("span",{className:l}):e.jsx("span",{className:n})]})},es={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"},ts=({product:t,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:l})=>{const[n,d]=i.useState(t.name===a),w=t.name===r,c=t.name===a,f=!t.active,b="#1b3380",m="#c5cce0",v="#ffcf70",y=o("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!t.active&&"wu-text-gray-subtle",n&&"wu-font-normal",t.active&&n&&"wu-text-blue-q"),p=o("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!t.active&&"wu-text-gray-subtle",t.active&&n&&"wu-text-blue-q"),C=n||u===t.name||w?b:m;return e.jsxs("li",{className:o(P.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(w||n)&&P.activeProduct,t.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===t.name&&P.activeProduct,"wu-product-item"),onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),"aria-label":t.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const h=S.currentTarget.querySelector("a");h&&h.click()}},onFocus:()=>{l(t.name)},onBlur:()=>l(""),children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:f?v:C}}),e.jsxs("a",{className:o(P.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:t.link||"#",tabIndex:0,children:[e.jsx("span",{className:o(p,es[t.icon||""]),"aria-hidden":!0}),e.jsx("span",{className:o(y),children:t.name})]})]},t.name)},as=({category:t,currentProduct:a,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:l,borderColorLocked:n="#f5a300"})=>{const{products:d=[],active:w}=t,c=i.useMemo(()=>d.filter(y=>y.active).sort((y,p)=>(y.order||100)-(p.order||100)),[d]),f=i.useMemo(()=>d.filter(y=>!y.active),[d]),[b,m]=i.useState(n),v=y=>y.map((p,C)=>e.jsx(ts,{product:p,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:l},C));return w?e.jsxs(e.Fragment,{children:[v(c),f.length>0&&e.jsxs("li",{className:o(P.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>m("#f5a300"),onMouseOut:()=>m(n),"aria-label":"Upgrade to unlock",children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:b},"aria-label":"top-border"}),e.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:o(P.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[e.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),e.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",e.jsx("br",{})," unlock"]})]})]}),v(f)]}):e.jsxs("li",{className:o(P.productListItem,P.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>l("learn"),onBlur:()=>l(""),"aria-label":"Learn More",children:[e.jsx("div",{className:o(P.topBorder,s==="rtl"&&P.topBorderRtl),style:{backgroundColor:n}}),e.jsx("a",{className:P.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:e.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},zt=({dropdownRef:t,dir:a,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:l,handleKeyDown:n,expandAll:d,activeProductName:w,focusItem:c,setFocusItem:f})=>{const b="#ffcf70",[m,v]=i.useState(window.innerWidth>768);return i.useEffect(()=>{const y=()=>{v(window.innerWidth>375)};return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),e.jsx("ul",{className:o(P.productDropdownMenu,r&&P.productDropdownMenuOpen,a==="rtl"&&P.rtlDropdownMenu,"wu-switcher-container"),ref:t,dir:a,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((y,p)=>e.jsxs("li",{className:o(P.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===y&&P.open,d&&P.open),onMouseEnter:()=>m&&l(y),onMouseLeave:()=>m&&l(null),"aria-label":y.name,dir:a,onKeyDown:C=>n(C,p),tabIndex:0,"data-product-category":!0,children:[e.jsx(Rr,{category:y,dir:a,openCategory:u}),e.jsx("ul",{className:o(P.productList,a==="rtl"&&P.rtlProductList),dir:a,children:e.jsx(as,{category:y,dir:a,activeProductName:w,currentProduct:y.name,focusItem:c,setFocusItem:f,borderColorLocked:b})})]},y.name))})},rs=({isProductButtonShow:t,isDropdownOpen:a,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:l,smallScreenButtonRef:n,handleDropdownToggle:d,handleKeyDown:w})=>e.jsx("div",{className:o("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",t?l==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":l==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:a?r.hover:s},children:e.jsxs("button",{ref:n,type:"button",className:o("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",t?"wu-flex":l==="rtl"?"wu-hidden":"wu-flex"),onClick:d,onKeyDown:c=>{a&&c.key==="ArrowDown"&&w(c,-1)},"aria-label":"small-screen-product-btn",children:[u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",a&&"wu-rotate-180")})]})}),ss=({dir:t,isProductButtonShow:a,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const l=()=>{s(n=>!n),a&&u(!1)};return e.jsxs("button",{className:o("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",t==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:l,ref:r,"aria-label":"menu-toggle-btn",children:[e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${a?"wu-opacity-0":"wu-opacity-100"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Ht=({productCategories:t,activeProductName:a,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:l})=>{const n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),c=i.useRef(null),[f,b]=i.useState(!1),[m,v]=i.useState(null),[y,p]=i.useState(r.base),[C,S]=i.useState(""),[h,N]=i.useState(!1),M=Vr(768);et([d,n],()=>{b(!1),v(null)}),et([w,c,d],()=>{N(!1),b(!1),v(null)}),i.useEffect(()=>{const _=I=>{I.key==="Escape"&&b(!1)};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[f]),i.useEffect(()=>p(r.base),[r.base]);const k=_=>{_.preventDefault(),_.stopPropagation(),b(I=>{const D=!I;return D||v(null),D})},T=(_,I)=>{console.log(_),Yr({productCategories:t,openCategory:m,setOpenCategory:v})(_,I,C)};return e.jsx("div",{className:o("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:M?e.jsxs("div",{className:"wu-relative wu-flex",children:[e.jsx(ss,{dir:s,isProductButtonShow:h,smallScreenToggleButtonRef:c,setDropdownOpen:b,setIsProductButtonShow:N}),e.jsx(rs,{isProductButtonShow:h,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:y,activeProductName:a,handleDropdownToggle:k,smallScreenButtonRef:w,handleKeyDown:T,dir:s}),e.jsx("div",{className:o("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:e.jsx(zt,{activeProductName:a,focusItem:C,setFocusItem:S,handleKeyDown:T,isDropdownOpen:f,openCategory:m,productCategories:t,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})})]}):e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:f?r.hover:y},onMouseOver:()=>p(r.hover),onMouseOut:()=>p(r.base),children:[e.jsx(Zr,{activeProductName:a,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:k,handleKeyDown:T,isDropdownOpen:f}),e.jsx(zt,{activeProductName:a,focusItem:C,setFocusItem:S,handleKeyDown:T,isDropdownOpen:f,openCategory:m,productCategories:t,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})]})})},jt=({children:t,dir:a,className:r})=>e.jsx("section",{className:o("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",a==="rtl"&&"wu-flex-row-reverse",r),children:e.jsx("div",{className:"wu-grow",children:t})}),Be=x.forwardRef(({className:t,type:a,...r},s)=>e.jsx("input",{type:a,className:o("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",t),ref:s,...r}));Be.displayName="Input";const us=t=>{const{message:a,className:r,...s}=t;return e.jsx("p",{...s,className:o("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:a})},os=t=>{var d,w;const{inputRef:a,maxLength:r=50,className:s,...u}=t,[l,n]=i.useState(!1);return i.useEffect(()=>{var c;(((c=a==null?void 0:a.current)==null?void 0:c.value.length)||0)>.75*r?n(!0):n(!1)},[(d=a==null?void 0:a.current)==null?void 0:d.value,r]),e.jsx("p",{...u,className:o("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:l&&`${(w=a==null?void 0:a.current)==null?void 0:w.value.length}/${r}`})},ls=K.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"),We=x.forwardRef(({className:t,...a},r)=>e.jsx(Tt.Root,{ref:r,className:o(ls(),t),...a}));We.displayName=Tt.Root.displayName;const X=t=>e.jsx(We,{...t,className:o("wu-text-gray-lead wu-leading-6",t.className)}),ns=({Label:t,Error:a,Hint:r,Input:s,labelPosition:u="top",dir:l="ltr",className:n,...d})=>{const c=o("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",n),f=o("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),b=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),m=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return e.jsxs("div",{className:c,dir:l,...d,children:[t,e.jsxs("div",{className:f,children:[s,r&&e.jsx("div",{className:b,children:r}),a&&e.jsx("div",{className:m,children:a})]})]})},xe=i.forwardRef((t,a)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:l,type:n,value:d,variant:w="flat",readonly:c,id:f=Fe(),...b}=t,m=Ie(s),v=u?l!=="right"?"wu-pl-8":"wu-pr-8":"",[y,p]=i.useState(!1),C=()=>{p(h=>!h)},S=h=>{b.onChange&&b.onChange(h)};return e.jsx(e.Fragment,{children:n==="submit"?e.jsx(Y,{type:"submit",className:b.className,id:f,children:r||"Submit"}):e.jsx("div",{className:o("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:b.dir,children:e.jsxs("div",{className:o("wu-flex wu-gap-1 wu-relative",m,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&l!=="right"&&e.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),e.jsx(Be,{...b,className:o("wu-peer wu-text-xs wu-rounded-t-sm",w==="outlined"?"wu-border wu-border-gray-subtle":"",v,b.className),type:y?"text":n,ref:a,readOnly:c,onChange:b.onChange&&S,value:d,id:f}),u&&l==="right"&&e.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:u}),n==="password"&&e.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:e.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:y?e.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):e.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&e.jsx(X,{htmlFor:f,className:"wu-input-label",children:r})]})})})});xe.displayName="WuInput";const ws=({className:t,placeholder:a="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[l,n]=i.useState(r);return i.useEffect(()=>{n(r)},[r]),e.jsx(xe,{...u,placeholder:a,onChange:d=>s(d.target.value),className:o("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",l?"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",t),type:"search",Icon:e.jsx(we,{"data-testid":"search-icon",icon:"wm-search",className:o("wu-text-gray-lead wu-cursor-pointer",l&&"wu-text-white"),onClick:()=>n(d=>!d)})})},Ut=De.Provider,$t=De.Root,Gt=De.Trigger,rt=x.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(De.Content,{ref:s,sideOffset:a,className:o("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",t),...r}));rt.displayName=De.Content.displayName;const ze=i.forwardRef(({content:t,position:a,positionOffset:r,duration:s,children:u,className:l,showArrow:n=!1,...d},w)=>e.jsx(Ut,{delayDuration:s||200,children:e.jsxs($t,{children:[e.jsx(Gt,{asChild:!0,children:e.jsx("span",{ref:w,children:u})}),e.jsx(Xe.Portal,{children:t&&e.jsxs(rt,{...d,side:a||"top",sideOffset:r||0,className:o("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",l),children:[t,n&&e.jsx(Xe.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));ze.displayName="WuTooltip";const ds=({label:t,className:a})=>{const r=i.useRef(null),[s,u]=i.useState(!1);return i.useEffect(()=>{const l=r.current;if(l){const n=l.clientWidth,d=l.scrollWidth,w=d/t.length,c=t.length*w;u(c>n||d>n)}},[t]),e.jsx("p",{ref:r,className:o("wu-w-full wu-truncate",a),children:s?e.jsx(ze,{content:t,positionOffset:8,children:t}):t})},is=t=>{var b;const{productName:a,categories:r=[],user:s,children:u,onLogout:l,homeLink:n=window.location.origin,brandColor:d,dir:w="ltr",expandAll:c,DataCenter:f}=t;return e.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:e.jsxs("header",{className:o("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",w==="rtl"&&"wu-flex-row-reverse",t.className),style:t.style,children:[Fr((b=s==null?void 0:s.profile)==null?void 0:b.subtitle)&&window.wickUiVersion&&e.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1]","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),e.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:e.jsx(Ht,{productCategories:r,activeProductName:a,activeProductColor:d,dir:w,homeLink:n,expandAll:c})}),e.jsx(jt,{dir:w,children:u}),e.jsxs("section",{className:o("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",w==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[e.jsx(Ft,{dir:w}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&e.jsx(Lt,{user:s,onLogout:l,dir:w,DataCenter:f})]})]})})},ee=Te.Root,de=Te.Trigger,Q=x.forwardRef(({className:t,align:a="center",sideOffset:r=4,...s},u)=>e.jsx(Te.Portal,{children:e.jsx(Te.Content,{ref:u,align:a,sideOffset:r,className:o("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",t),...s})}));Q.displayName=Te.Content.displayName;function Vt({className:t,classNames:a,dir:r="ltr",...s}){const u=Dt.getDefaultClassNames();return e.jsx(Dt.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:o("wu-p-3",t),classNames:{root:o(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:o("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:o(u.month_caption,"wu-mb-5"),months:o(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:o(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:o(u.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:o(u.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:o(u.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:o(u.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:o(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:o("rm",u.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:o(u.range_end,"wu-rounded-none"),range_start:o(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:o(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:o(u.button_next,at({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:o(u.button_previous,at({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:o(u.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",r==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:o(u.chevron,"!wu-text-red-500"),outside:o(u.outside,"wu-invisible"),disabled:o(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...a},components:{Chevron:()=>e.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Vt.displayName="Calendar";const st=t=>e.jsx(Vt,{...t}),Yt=t=>{const{handleDateChange:a,disabled:r,onReset:s,showResetButton:u}=t;return e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&e.jsx(Y,{variant:"secondary",onClick:s,Icon:e.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(Y,{onClick:a,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},ut=({formattedString:t,dir:a,placeholder:r="Select Date",className:s,variant:u="primary",color:l,...n})=>e.jsx(ke.PopoverTrigger,{asChild:!0,dir:a,children:e.jsx(Y,{...n,className:o("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",u==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:e.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:t||r})}),Jt=(t,a,r,s)=>!!(a||r&&t<r||s&&t>s),He=t=>t?typeof t=="string"?new Date(t):t:new Date,ot="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",cs=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],fs=({formatString:t="yyyy-MM-dd",value:a,onChange:r,disabled:s,minDate:u=F.sub(new Date,{years:5}),maxDate:l=F.add(new Date,{years:1}),dir:n="ltr",Label:d,labelPosition:w="top",onReset:c,showResetButton:f=!1,placeholder:b="Select Date",...m})=>{const[v,y]=i.useState(),[p,C]=i.useState(""),S=i.useCallback(()=>{const N=He(v);C(F.format(N,t)),r&&r(v)},[v,t,r]),h=i.useCallback(()=>{c?c():(y(void 0),C(""),r&&r(void 0))},[r,c]);return i.useEffect(()=>{const N=He(a);y(N),C(F.format(N,t))},[a,t]),e.jsxs(X,{className:o("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[d,e.jsxs(ee,{children:[e.jsx(ut,{...m,formattedString:p,dir:n,placeholder:b}),e.jsx(Q,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:n,children:e.jsx(st,{dir:n,mode:"single",captionLayout:"dropdown",selected:v,onSelect:y,disabled:N=>Jt(N,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:v,className:o("wu-border wu-border-blue-p wu-date-picker"),footer:e.jsx(Yt,{handleDateChange:S,disabled:s,onReset:h,showResetButton:f})})})]})]})},Kt="yyyy-MM-dd",ps=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],bs=({current:t,onSelect:a,presetRanges:r=cs})=>{const[s,u]=i.useState(),[l,n]=i.useState(!1),[d,w]=i.useState(""),[c,f]=i.useState(""),[b,m]=i.useState(!1),v=i.useMemo(()=>r.map(h=>h.value),[r]),y=o("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"),p=i.useCallback(h=>{if(h===void 0){u(void 0),n(!0);return}const N=Number(h)-1;u(N),n(!1),a({from:F.sub(new Date,{days:N}),to:new Date})},[a]),C=i.useCallback((h,N)=>{if(!h||!(t!=null&&t.to)||!(t!=null&&t.from)||!new RegExp(ot).test(h))return!1;const k=new Date(N==="start"?h:t.from),T=new Date(N==="end"?h:t.to);return F.isBefore(T,k)?(m(!0),!1):(m(!1),!(F.isSameDay(k,t.from)&&F.isSameDay(T,t.to)))},[t]),S=i.useCallback((h,N)=>{if((N==="start"?w:f)(h),C(h,N)){const k={from:t==null?void 0:t.from,to:t==null?void 0:t.to};N==="start"&&(k.from=new Date(h)),N==="end"&&(k.to=new Date(h)),a(k)}},[t,a,C]);return i.useEffect(()=>{if(t!=null&&t.to&&(t!=null&&t.from)&&F.isValid(t.to)&&F.isValid(t.from)){w(F.format(t.from,Kt)),f(F.format(t.to,Kt));const h=F.differenceInCalendarDays(t.to,t.from);F.isToday(t.to)&&v.includes(h+1)?(u(h),n(!1)):(u(void 0),n(!0))}},[t,v]),e.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:[e.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:ps.map(({label:h,value:N})=>e.jsx(he,{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:h},N))}),e.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:h,value:N})=>e.jsx("li",{children:e.jsx("button",{className:o(y,s===N-1&&"wu-bg-blue-p/10"),onClick:()=>p(N),children:h})},N)),e.jsx("li",{children:e.jsx("button",{className:o(y,l&&"wu-bg-blue-p/10"),onClick:()=>p(),children:"Custom Range"})})]}),e.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[e.jsx(xe,{placeholder:"Start Date",pattern:ot,value:d,onChange:h=>S(h.target.value,"start"),"aria-label":"Start Date"}),e.jsx(xe,{placeholder:"End Date",pattern:ot,value:c,onChange:h=>S(h.target.value,"end"),"aria-label":"End Date"}),b?e.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"}):e.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"})]})]})},gs=({formatString:t="yyyy/MM/dd",value:a,onChange:r,disabled:s,minDate:u=F.sub(new Date,{years:5}),maxDate:l=F.add(new Date,{years:1}),dir:n="ltr",minDateToSelect:d,maxDateToSelect:w,presetRanges:c,Label:f,labelPosition:b="top",onReset:m,showResetButton:v=!0,placeholder:y="Select Date Range",...p})=>{const[C,S]=i.useState(a),[h,N]=i.useState(a),[M,k]=i.useState(""),T=i.useCallback(()=>{if(h){const D=h.from,B=h.to;S({from:D,to:B}),k(`${F.format(D,t)} - ${F.format(B,t)}`),r&&r({from:D,to:B})}},[h,t,r]),_=i.useCallback(()=>{N(C)},[C]),I=i.useCallback(()=>{m?m():(S(void 0),N(void 0),k(""),r&&r(void 0))},[m,r]);return i.useEffect(()=>{if(a!=null&&a.from&&(a!=null&&a.to)){const D=He(a.from),B=He(a.to);S(a),N(a),k(`${F.format(D,t)} - ${F.format(B,t)}`)}else S(void 0),N({to:new Date,from:new Date})},[a,t]),e.jsxs(X,{className:o("wu-flex wu-gap-1",b==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[f,e.jsxs(ee,{onOpenChange:D=>!D&&_(),children:[e.jsx(ut,{...p,formattedString:M,dir:n,placeholder:y}),e.jsxs(Q,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:n,children:[e.jsx(bs,{current:h,onSelect:N,presetRanges:c}),e.jsx(st,{dir:n,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:h,onSelect:N,disabled:D=>Jt(D,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:C==null?void 0:C.from,className:o("wu-shadow-none wu-date-range-picker"),min:d,max:w,footer:e.jsx(Yt,{handleDateChange:T,disabled:s,onReset:I,showResetButton:v})})]})]})]})},Xt=i.forwardRef((t,a)=>{const{className:r,rounded:s,...u}=t;return e.jsx("div",{className:o("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",r),ref:a,...u})});Xt.displayName="WuCard";const hs=i.forwardRef((t,a)=>{const{className:r,...s}=t;return e.jsx("div",{ref:a,...s,className:o("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});hs.displayName="WuCardHeader";const ms=i.forwardRef((t,a)=>{const{className:r,...s}=t;return e.jsx("div",{ref:a,...s,className:o("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});ms.displayName="WuCardHeader";const Qt=x.forwardRef(({className:t,partial:a,...r},s)=>e.jsx(Qe.Root,{ref:s,className:o("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",t),...r,children:e.jsxs(Qe.Indicator,{className:o("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!a&&e.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),a&&e.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Qt.displayName=Qe.Root.displayName;const te=i.forwardRef((t,a)=>{const{disabled:r,checked:s,Label:u,labelPosition:l="right",className:n,id:d=Fe(),partial:w,onChange:c,required:f,readonly:b,...m}=t;return i.useEffect(()=>{m.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[m.defaultChecked,s]),e.jsxs("div",{className:xs({labelPosition:l,className:"wu-checkbox-container"}),dir:m.dir,children:[e.jsx(Qt,{id:d,...m,partial:w,checked:s,disabled:r||b,onCheckedChange:c,className:o("wu-peer wu-checkbox",n),required:f,ref:a}),u&&e.jsx(X,{htmlFor:d,className:"wu-w-full wu-checkbox-label",children:u})]})}),xs=K.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"}}});te.displayName="WuCheckbox";const ys=t=>{const{className:a,children:r,...s}=t;return e.jsx("span",{...s,className:o("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",a),children:r})},lt=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Command,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",t),...a}));lt.displayName=G.Command.displayName;const Zt=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:e.jsx(G.Command.Input,{ref:r,className:o("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",t),...a})}));Zt.displayName=G.Command.Input.displayName;const nt=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Command.List,{ref:r,className:o("",t),...a}));nt.displayName=G.Command.List.displayName;const wt=x.forwardRef((t,a)=>e.jsx(G.Command.Empty,{ref:a,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...t}));wt.displayName=G.Command.Empty.displayName;const je=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Command.Group,{ref:r,className:o("",t),...a}));je.displayName=G.Command.Group.displayName;const Rt=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Command.Separator,{ref:r,className:o("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",t),...a}));Rt.displayName=G.Command.Separator.displayName;const _e=x.forwardRef(({className:t,...a},r)=>e.jsx(G.Command.Item,{ref:r,className:o("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",t),...a}));_e.displayName=G.Command.Item.displayName;const ye=i.forwardRef(({containerHeight:t=400,list:a,callback:r,dir:s,className:u,style:l},n)=>e.jsx(Dr.Virtuoso,{ref:n,dir:s,className:u,style:{height:t,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...l},data:a,itemContent:(d,w)=>r(d,w)}));ye.displayName="WuVirtualScroll";const vs=({tags:t,triggerRef:a})=>{const[r,s]=i.useState([]),[u,l]=i.useState([]),n=i.useMemo(()=>e.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((w,c)=>e.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:w},c))}),[u]),d=w=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=w,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return i.useEffect(()=>{const w=()=>{if(a.current){const m=a.current.offsetWidth-20-36;let v=0;const y=[],p=[];t.forEach(C=>{const S=d(C);v+S+8<m?(y.push(C),v+=S+8):p.push(C)}),s(y),l(p)}};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[t,a]),e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((w,c)=>e.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:w},c)),u.length>0&&e.jsx(ze,{content:n,className:"wu-z-[51] wu-text-left",children:e.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",u.length]})})]})},Ns=({placeholder:t="Select...",isEllipse:a=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:l,multiple:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,className:b,...m})=>{const[v,y]=i.useState([]),p=i.useRef(null);i.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){y([]);return}if(n){const S=r;y(S==null?void 0:S.map(h=>h[l.label]));return}else y([r[l.label]])},[r]);const C=()=>{var S;return v.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):a?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=p.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:v.join(", ")}):e.jsx(vs,{tags:v,triggerRef:p}):e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:t})};return e.jsx(de,{dir:u,asChild:!0,id:d,disabled:w,children:e.jsxs("button",{...m,ref:p,disabled:w,className:o("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",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",b),children:[C(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},ea=A.Root,ta=A.Trigger,aa=A.Group,Cs=A.Portal,Ss=A.Sub,ks=A.RadioGroup,ra=x.forwardRef(({className:t,inset:a,children:r,position:s,...u},l)=>e.jsxs(A.SubTrigger,{ref:l,className:o("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-3 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",a&&"wu-pl-8",t),...u,children:[s==="left"&&e.jsx("span",{className:o("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&e.jsx("span",{className:o("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));ra.displayName=A.SubTrigger.displayName;const sa=x.forwardRef(({className:t,...a},r)=>e.jsx(A.SubContent,{ref:r,className:o("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",t),...a}));sa.displayName=A.SubContent.displayName;const dt=x.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(A.Portal,{children:e.jsx(A.Content,{ref:s,sideOffset:a,className:o("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",t),...r})}));dt.displayName=A.Content.displayName;const Ue=x.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(A.Item,{ref:s,className:o("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",a&&"wu-pl-8",t),...r}));Ue.displayName=A.Item.displayName;const ua=x.forwardRef(({className:t,children:a,checked:r,dir:s,...u},l)=>e.jsxs(A.CheckboxItem,{ref:l,className:o("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",t),checked:r,...u,children:[e.jsx("span",{className:o("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:e.jsx(A.ItemIndicator,{children:e.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),a]}));ua.displayName=A.CheckboxItem.displayName;const oa=x.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(A.RadioItem,{ref:s,className:o("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",t),...r,children:[e.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:e.jsx(A.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:e.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),a]}));oa.displayName=A.RadioItem.displayName;const Ee=x.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(A.Label,{ref:s,className:o("wu-p-2 wu-font-medium wu-text-xs",a&&"wu-pl-8",t),...r}));Ee.displayName=A.Label.displayName;const $e=x.forwardRef(({className:t,...a},r)=>e.jsx(A.Separator,{ref:r,className:o("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",t),...a}));$e.displayName=A.Separator.displayName;const la=({option:t,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:l})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{a&&d(r?a.map(b=>JSON.stringify(b[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const w=r?n.includes(JSON.stringify(t[u.value])):n===JSON.stringify(t[u.value]),c=()=>{t.disabled||s(t)};return e.jsxs(_e,{onSelect:c,disabled:t.disabled,className:o("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(te,{checked:w}),e.jsx(Ds,{option:t,accessorKey:u})]})},Ds=({option:t,accessorKey:a})=>{const r=t[a.label];return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[t.icon&&t.icon,r,t.isAdmin&&e.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},na=t=>{const{option:a,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:l,...n}=t;switch("type"in a?a.type:"option"){case"all":return e.jsx(_e,{onSelect:s,className:o("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:n.dir,children:e.jsx(te,{checked:u||l,partial:l,"data-partial":l,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return e.jsxs(je,{children:[e.jsx(Ee,{children:a.label}),a.options.map((w,c)=>i.createElement(la,{...n,option:w,key:c}))]});case"divider":return e.jsx(Rt,{className:"wu-mx-4"});default:return e.jsx(la,{...n,option:a})}},Ts=t=>{const a=[],r=[],s=[],u=[];return t.forEach(l=>{l.type==="group"?(a.push(l),s.push(...l.options),u.push(...l.options.filter(n=>!n.disabled))):l.type==="divider"?r.push(l):s.push(l),l!=null&&l.disabled||u.push(l)}),{groups:a,dividers:r,allOptions:s,enabledOptions:u}},Ms=i.memo(xe),Is=({data:t,accessorKey:a,value:r,defaultValue:s,Header:u,virtualizedThreshold:l=100,isEllipse:n,placeholder:d,variant:w,dir:c,onSelect:f,Label:b,maxHeight:m=420,multiple:v=!1,hasGroup:y=!1,selectAll:p,id:C,disabled:S,labelPosition:h="top",className:N,onScroll:M,maxContentWidth:k,...T})=>{const[_,I]=i.useState(""),[D,B]=i.useState(),[re,E]=i.useState(!1),[H,j]=i.useState(!1),[$,fe]=i.useState(!1),pe=i.useRef(null),{allOptions:Z,groups:Ne,dividers:Ce,enabledOptions:oe}=i.useMemo(()=>y||p&&!p.includeDisabled?Ts(t):{allOptions:t,groups:[],dividers:[],enabledOptions:[]},[t,y]),q=i.useMemo(()=>{if(!_)return t;const L=_.toLowerCase();return Z.filter(ae=>ae[a.label].toLowerCase().includes(L))},[_,Z,t,a.label]),W=i.useMemo(()=>v&&p!=null&&p.enable&&!_&&q.length>0?[{type:"all"},...q]:q,[q,_,v]),z=i.useMemo(()=>{const L=32*W.length+Ce.length*9+Ne.length*48;return Math.min(m,L)},[m,W,Ce,Ne]),J=i.useCallback(L=>{const ae=L[a.value];v?B(po=>{const St=po||[],xr=St.some(kt=>kt[a.value]===ae)?St.filter(kt=>kt[a.value]!==ae):[...St,L];return f==null||f(xr),xr}):(E(!1),B(L),f==null||f(L))},[v,a.value,f]),Se=i.useCallback(L=>I(L.target.value),[]),Ae=i.useCallback(()=>I(""),[]);i.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?B(r):s!==void 0&&B(s)},[r,s]),i.useEffect(()=>{if(!v)return;const L=p!=null&&p.includeDisabled?(D==null?void 0:D.length)===Z.length:(D==null?void 0:D.length)===oe.length;j(L);const ae=(D==null?void 0:D.length)>0&&!L;fe(ae)},[D,p]);const se=i.useCallback(()=>{const L=H?[]:p!=null&&p.includeDisabled?Z:oe;B(L),f==null||f(L)},[H,v,Z,oe,f,p]),Pe=Ie(h);return e.jsxs("div",{className:o(Pe,"wu-flex wu-combobox-container"),ref:pe,children:[e.jsxs(ee,{onOpenChange:L=>{L&&Ae(),E(L)},open:re,modal:!0,children:[e.jsx(Ns,{...T,selectedOptions:D,accessorKey:a,isEllipse:n,placeholder:d,variant:w,dir:c,multiple:v,disabled:S,selectAll:p,isCheckedAll:H,className:N,id:C}),e.jsx(Q,{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:e.jsxs(lt,{id:C,children:[e.jsx("div",{className:"wu-m-2",children:e.jsx(Ms,{placeholder:"Search...",Icon:e.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:Se,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,e.jsxs(nt,{children:[e.jsx(wt,{children:"No results found."}),W.length>=l?e.jsx(ye,{className:"wu-combobox-list",containerHeight:m,list:W,callback:(L,ae)=>e.jsx(na,{option:ae,value:D,onSelect:J,multiple:v,accessorKey:a,dir:c,selectAll:p,handleSelectAll:se,isCheckedAll:H,isPartialSelected:$},L),dir:c}):e.jsx("div",{style:{maxHeight:z,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:M,children:W.map((L,ae)=>e.jsx(na,{option:L,value:D,onSelect:J,multiple:v,accessorKey:a,dir:c,selectAll:p,handleSelectAll:se,isCheckedAll:H,isPartialSelected:$},ae))})]})]})})]}),b&&e.jsx(X,{htmlFor:C,className:"wu-combobox-label",children:b})]})},Ws=t=>{const{textToCopy:a,notificationText:r,...s}=t,[u,l]=i.useState(!1),n=async()=>{if(a)try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return e.jsxs(Y,{...s,onClick:n,variant:"iconOnly",className:o("wu-relative",t.className),"aria-label":"Copy to clipboard",children:[r&&e.jsx("span",{className:o("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",u?"wu-block":"wu-hidden"),children:r}),e.jsx(we,{icon:"wm-content-copy",className:"wu-text-lg"})]})},wa=O.Root,_s=O.Trigger,Es=O.Close,qs=O.Portal,da=x.forwardRef(({className:t,...a},r)=>e.jsx(O.Overlay,{className:o("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",t,"wu-drawer-overlay"),...a,ref:r}));da.displayName=O.Overlay.displayName;const Os=K.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"}}),it=x.forwardRef(({side:t="right",className:a,children:r,hideCloseButton:s,...u},l)=>e.jsxs(qs,{children:[e.jsx(da,{}),e.jsxs(O.Content,{ref:l,className:o(Os({side:t}),a),...u,children:[r,!s&&e.jsx(O.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[e.jsx("span",{className:"wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));it.displayName=O.Content.displayName;const ia=({className:t,...a})=>e.jsx("div",{className:o("",t),...a});ia.displayName="SheetHeader";const ct=x.forwardRef(({className:t,...a},r)=>e.jsx(O.Title,{ref:r,className:o("wu-text-lg wu-font-semibold",t),...a}));ct.displayName=O.Title.displayName;const ca=x.forwardRef(({className:t,...a},r)=>e.jsx(O.Description,{ref:r,className:o("wu-text-sm",t),...a}));ca.displayName=O.Description.displayName;const As=t=>{const{Trigger:a,children:r,hideCloseButton:s,className:u,side:l="left",open:n,onOpenChange:d,preventClickOutside:w,...c}=t;return e.jsxs(wa,{open:n,onOpenChange:d,children:[e.jsx(_s,{asChild:!0,children:a}),e.jsxs(it,{...c,onInteractOutside:f=>{w&&f.preventDefault()},side:l,className:o("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[e.jsx("div",{className:"wu-hidden",children:e.jsx(ct,{})}),r]})]})},Ps=({children:t,...a})=>e.jsx(Es,{...a,children:t}),fa=({className:t,isLoading:a,loadingText:r,children:s,...u})=>e.jsxs("footer",{className:o("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",t),...u,children:[e.jsx("div",{className:"wu-flex-1",children:s}),a&&e.jsx(me,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});fa.displayName="WuFooter";const pa=i.forwardRef((t,a)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...l}=t,n=r==="sm"?16:18,d=s.includes("http")?s:`/help/${s}.html`,w=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return e.jsx("button",{...l,ref:a,onClick:()=>Re(d),children:e.jsx("span",{className:o("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,w,l.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});pa.displayName="WuHelpButton";const ue=(t,a)=>`wu-listbox-${t}`,Ls=t=>{const{CustomTrigger:a,disabled:r,value:s,placeholder:u,accessorKey:l,Chip:n,handleUnselect:d,variant:w,dir:c,...f}=t,[b,m]=i.useState(),v=i.useRef(null);return i.useEffect(()=>{if(!s){m(null);return}m(Array.isArray(s)?n?s.map((p,C)=>n({value:p,unselect:d,key:C})):s.map(p=>p[l.label]).join(", "):n?n({value:s,unselect:d}):s[l.label])},[s,n,l.label,m]),e.jsx(de,{asChild:!0,id:t.id,disabled:r,ref:v,children:(a==null?void 0:a(s))||e.jsxs("button",{...f,className:o("wu-group 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",w==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f.className,ue("trigger")),children:[e.jsx("div",{className:o("wu-truncate",n&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||u}),e.jsx(we,{icon:"wm-arrow-drop-down",className:o("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",ue("drop-icon"))})]})})},Fs=t=>{const{option:a,accessorKey:r,onSelect:s,multiple:u,children:l,value:n,dir:d,...w}=t;return e.jsxs(_e,{...w,onSelect:()=>s==null?void 0:s(a),value:JSON.stringify(a),className:o("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",d==="rtl"&&"wu-justify-end",ue("item")),disabled:a.disabled,children:[e.jsx("span",{className:"wu-hidden",children:crypto.randomUUID()}),u&&e.jsx(te,{checked:Array.isArray(n)&&!!n.find(c=>c[r.value]===a[r.value])}),l]})},Bs=i.memo(Fs),zs=t=>{const{label:a,onSelectAll:r,data:s,value:u}=t,[l,n]=i.useState(!1),[d,w]=i.useState(!1);return i.useEffect(()=>{!u||!s||(n(u.length>0),w(u.length>0&&u.length<s.length))},[s,u]),e.jsxs(_e,{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:()=>r==null?void 0:r(!l),children:[e.jsx(te,{checked:l,partial:d}),a||"Select All"]})},Hs=t=>{const{className:a,...r}=t;return e.jsxs("div",{className:"wu-relative",children:[e.jsx(we,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),e.jsx(Zt,{...r,"aria-label":"Search",className:o("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;",ue("input"),a)})]})},js=t=>{const{data:a,accessorKey:r,value:s,Item:u,Label:l,CustomHeader:n,CustomTrigger:d,NoDataContent:w,Chip:c,onSelect:f,onScroll:b,disabled:m,multiple:v,searchable:y,selectAll:p,virtualizedThreshold:C=100,id:S,dir:h,className:N,listClass:M,placeholder:k="Select items...",variant:T,labelPosition:_="top",maxContentWidth:I,maxContentHeight:D}=t,[B,re]=i.useState(!1),[E,H]=i.useState(""),[j,$]=i.useState(s),fe=i.useMemo(()=>r,[r]),pe=i.useMemo(()=>{if(!y||!E)return a;const q=E.toLowerCase().trim();return a.filter(W=>W[r.label].toLowerCase().trim().includes(q))},[a,E,r.label,y]),Z=q=>{v?$(W=>{const z=q[r.value],J=Array.isArray(W)?W:[],Ae=J.some(se=>se[r.value]===z)?J.filter(se=>se[r.value]!==z):[...J,q];return f&&f(Ae),Ae}):($(q),f&&f(q),re(!1))},Ne=i.useCallback(q=>{const W=q?a:[];$(W),p!=null&&p.onSelectAll&&p.onSelectAll(q),f&&f(W)},[a,p,f]),Ce=q=>Array.isArray(j)?j.some(W=>W[r.value]===q[r.value]):(j==null?void 0:j[r.value])===q[r.value];i.useEffect(()=>{$(s)},[s]);const oe=q=>{const W=z=>e.jsx(Bs,{option:z,accessorKey:fe,multiple:v,onSelect:()=>Z(z),value:j,dir:h,children:u?u({value:z,isSelected:Ce(z)}):e.jsx(e.Fragment,{children:z[r.label]})},String(z[r.value]));return q.length>C?e.jsx(ye,{list:q,callback:(z,J)=>W(J),dir:h}):q.map(W)};return e.jsxs("div",{className:o("wu-flex wu-text-sm wu-gap-2",_==="top"&&"wu-flex-col wu-gap-1",_==="left"&&"wu-flex-row",_==="right"&&"wu-flex-row-reverse",ue("container")),dir:h,children:[l&&e.jsx(X,{htmlFor:S,className:ue("label"),children:l}),e.jsxs(ee,{open:B,onOpenChange:q=>{re(q),q||setTimeout(()=>{H("")},100)},children:[e.jsx(Ls,{CustomTrigger:d,disabled:m,value:j,accessorKey:r,placeholder:k,Chip:c,className:N,handleUnselect:Z,variant:T,id:S,dir:h}),e.jsx(Q,{className:o("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",ue("content")),align:"start",sideOffset:-1,style:{maxWidth:I},children:e.jsxs(lt,{id:t.id,shouldFilter:!1,children:[y&&e.jsx(Hs,{value:E,onValueChange:H}),n,e.jsxs(nt,{className:o("wu-overflow-y-auto",ue("list"),M),onScroll:b,style:{maxHeight:D||"420px"},children:[e.jsx(wt,{children:w||"No results found."}),e.jsx(je,{children:v&&(p==null?void 0:p.enabled)&&!E&&e.jsx(zs,{data:a,value:j,onSelectAll:Ne,label:p.label})}),e.jsx(je,{children:oe(pe)})]})]})})]})]})},Us=t=>{const{checked:a,onSelect:r,children:s,disabled:u,preventCloseOnSelect:l}=t;return e.jsx(ua,{disabled:u,checked:a,onCheckedChange:r,onSelect:n=>l&&n.preventDefault(),children:s})},ft=t=>{const{children:a,className:r,Icon:s,iconPosition:u="left",disabled:l,onSelect:n,preventCloseOnSelect:d}=t,w=o("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{n&&n(f),d&&f.preventDefault()};return e.jsxs(Ue,{onSelect:c,disabled:l,className:w,children:[s&&e.jsx("div",{className:"wu-text-base",children:s}),a]})},$s=t=>{const{children:a,...r}=t;return e.jsxs(aa,{...r,children:[e.jsx(Ee,{children:t.label}),a]})},Gs=t=>{const{options:a,value:r,onSelect:s}=t;return e.jsx(ks,{value:r,onValueChange:s,children:a.map(u=>e.jsx(oa,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},Vs=t=>{const{className:a,...r}=t,s=o("wu-w-11/12 wu-mx-auto wu-border-gray-40",a);return e.jsx($e,{...r,className:s})},ve=x.forwardRef(({className:t,children:a,thumbColor:r,railColor:s,...u},l)=>e.jsxs(ne.Root,{ref:l,className:o("wu-relative wu-overflow-hidden",t),children:[e.jsx(ne.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:a}),e.jsx(pt,{thumbColor:r,railColor:s}),e.jsx(ne.Corner,{})]}));ve.displayName=ne.Root.displayName;const pt=x.forwardRef(({className:t,orientation:a="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},l)=>e.jsx(ne.ScrollAreaScrollbar,{ref:l,orientation:a,className:o("wu-flex wu-touch-none wu-select-none wu-transition-colors",a==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",a==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",t),style:{background:s},...u,children:e.jsx(ne.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));pt.displayName=ne.ScrollAreaScrollbar.displayName;const Ys=t=>{const{children:a,label:r,open:s,onOpenChange:u,height:l,dir:n,...d}=t;return e.jsxs(Ss,{...d,open:s,onOpenChange:u,children:[e.jsx(ra,{dir:n,children:r}),e.jsx(Cs,{children:e.jsx(sa,{onInteractOutside:w=>w.preventDefault(),children:e.jsx(ve,{className:"wu-h-fit",style:{height:l},dir:n,children:a})})})]})},Js="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",ba=t=>{const{children:a,menuTitle:r,variant:s="flat",name:u,open:l,onOpenChange:n,height:d,preventCloseOnClickOutside:w,dir:c,Trigger:f,align:b="start",sideOffset:m=0,side:v="bottom",alignOffset:y,className:p,disabled:C,...S}=t;return e.jsxs(ea,{...S,open:l,onOpenChange:n,dir:c,children:[e.jsx(ta,{asChild:!0,dir:c,disabled:C,className:o("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??Ks(s,u,C)}),e.jsx(dt,{className:o("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",p,"wu-menu-content"),align:b,sideOffset:m,side:v,alignOffset:y,onInteractOutside:h=>w&&h.preventDefault(),children:e.jsxs(ve,{className:"h-fit",style:{height:d},dir:c,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{dir:c,className:"wu-menu-title",children:r}),e.jsx($e,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),a??e.jsx("p",{children:"Menu Is Empty"})]})})]})},Ks=(t,a,r)=>{const s=o(Js,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",t==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return e.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[e.jsx("span",{children:a??"Menu"}),e.jsx("span",{className:o("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",r&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},bt=i.forwardRef(({showMenu:t=!1,className:a,color:r="#1B3380",...s},u)=>{const l=o("wu-w-full wu-border wu-transition-all wu-duration-300");return e.jsxs("div",{...s,className:o("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",a),ref:u,"aria-label":"menu-icon",children:[e.jsx("div",{className:`${l} wu-origin-center ${t?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} ${t?"wu-opacity-0":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} wu-origin-center ${t?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});bt.displayName="WuMenuIcon";const ga={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%]"},Xs=O.Root,Qs=O.Trigger,Zs=O.Portal,Rs=O.Close,ha=i.forwardRef(({className:t,...a},r)=>e.jsx(O.Overlay,{ref:r,className:o("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ga.overlay,t),...a}));ha.displayName=O.Overlay.displayName;const ma=i.forwardRef(({className:t,children:a,hideCloseButton:r,...s},u)=>e.jsxs(Zs,{children:[e.jsx(ha,{}),e.jsxs(O.Content,{ref:u,className:o("wu-fixed wu-left-[50%] wu-top-[50%] wu-z-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",ga.content,t),...s,children:[a,!r&&e.jsx(O.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10",children:[e.jsx("span",{className:"wu-text-lg wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ma.displayName=O.Content.displayName;const xa=({className:t,...a})=>e.jsx("div",{className:o("wu-text-center wu-bg-gray-20 wu-w-full",t),...a});xa.displayName="DialogHeader";const ya=({className:t,...a})=>e.jsx("div",{className:o("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",t),...a});ya.displayName="DialogFooter";const va=i.forwardRef(({className:t,...a},r)=>e.jsx(O.Title,{ref:r,className:o("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",t),...a}));va.displayName=O.Title.displayName;const eu=i.forwardRef(({className:t,...a},r)=>e.jsx(O.Description,{ref:r,className:o("wu-text-sm wu-text-muted-foreground",t),...a}));eu.displayName=O.Description.displayName;const tu="600px",au={sm:"400px",md:"600px",lg:"1200px"},ru={primary:"wu-bg-blue-p wu-text-white hover:wu-bg-opacity-70",secondary:"hover:wu-bg-blue-p hover:wu-bg-gray-100 wu-text-blue-p",iconOnly:"wu-p-2 hover:wu-bg-gray-40 wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 focus-visible:wu-ring-offset-0 focus:wu-bg-blue-soft"},su=({Trigger:t,children:a,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:l,open:n,dir:d,maxWidth:w,maxHeight:c,...f})=>e.jsxs(Xs,{...f,modal:!0,onOpenChange:l,open:n,children:[t&&e.jsx(Qs,{asChild:!0,children:t}),e.jsx(ma,{style:{width:"calc(100% - 64px)",maxWidth:w||au[r],maxHeight:c||tu},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:d,"aria-describedby":void 0,children:a})]}),uu=({children:t,style:a={},...r})=>e.jsx("div",{className:"wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto",children:e.jsx("div",{...r,style:{...a,paddingLeft:`${(Number(a==null?void 0:a.paddingLeft)||0)+4}px`,paddingRight:`${(Number(a==null?void 0:a.paddingRight)||0)+4}px`},children:t})}),ou=({children:t,className:a,...r})=>e.jsx(xa,{...r,className:o("wu-text-lg wu-text-gray-lead wu-font-medium",a),children:e.jsx(va,{children:t})}),lu=({children:t,className:a,...r})=>e.jsx(ya,{...r,className:o("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0",a),children:t}),nu=({children:t,variant:a="primary",className:r,...s})=>e.jsx(Rs,{...s,className:o("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-ring-offset-background wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:wu-opacity-80 disabled:wu-ring-gray-subtle wu-px-6 wu-py-2 wu-min-w-[104px] wu-h-8",ru[a],r),children:t}),wu=({placeholder:t="Select...",value:a,multiple:r=!1,accessorKey:s,variant:u="flat",dir:l="ltr",customTriggerChildren:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,width:b,...m})=>{const[v,y]=i.useState(""),[p,C]=i.useState(t);i.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){C(t),y("");return}const h=s.label;if(r&&Array.isArray(a)){const N=a.map(M=>M[h]).join(", ");y(N)}else!r&&!Array.isArray(a)&&y(a[h])},[a,s.label,r,t]);const S=()=>t&&!v?e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:p}):e.jsx("span",{className:o("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(b||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??v:v});return e.jsx(ta,{asChild:!0,dir:l,id:d,disabled:w,children:e.jsxs("button",{...m,disabled:w,className:o("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",u==="outlined"&&"wu-border wu-border-gray-subtle","wu-group wu-select-trigger",m.className),children:[n??S(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Na=({option:t,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:l="ltr"})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{a&&d(r?a.map(b=>JSON.stringify(b[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const w=r?n.includes(JSON.stringify(t[u.value])):n===JSON.stringify(t[u.value]),c=f=>{t.disabled||(s(t),r&&f.preventDefault())};return e.jsxs(Ue,{onClick:c,disabled:t.disabled,className:o("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(te,{checked:w}),e.jsx(Ca,{option:t,accessorKey:u})]})},Ca=({option:t,accessorKey:a})=>{const r=String(t[a.label]);return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[t.icon,r,t.isAdmin&&e.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Sa=t=>{const{option:a,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...l}=t;switch("type"in a?a.type:"option"){case"all":return e.jsxs(Ue,{onSelect:d=>{d.stopPropagation(),d.preventDefault(),r==null||r()},className:o("wu-cursor-pointer wu-text-xs wu-py-8 wu-leading-4 wu-select-item"),dir:l.dir,children:[e.jsx(te,{"data-partial":u,checked:s||u,partial:u}),e.jsx(Ca,{option:a,accessorKey:l.accessorKey})]});case"group":return e.jsxs(aa,{dir:l.dir,children:[e.jsx(Ee,{className:"wu-text-xs",children:a.label}),a.options.map((d,w)=>i.createElement(Na,{...l,option:d,key:w}))]});case"divider":return e.jsx($e,{className:"wu-mx-4"});default:return e.jsx(Na,{...l,option:a})}},du=t=>{let a=0,r=0;const s=[],u=[],l=n=>{n.type==="divider"?a++:n.type==="group"?(r++,n.options.forEach(d=>{l(d)})):(s.push(n),n.disabled||u.push(n))};return t.forEach(n=>{l(n)}),{separators:a,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},iu=100,cu=400,fu=32,pu=9,bu=32,ka=({data:t,onSelect:a,multiple:r=!1,defaultValue:s,value:u,accessorKey:l,variant:n="flat",dir:d="ltr",placeholder:w,Label:c,virtualizedThreshold:f=iu,maxHeight:b=cu,hasGroup:m=!1,Header:v,CustomTrigger:y,selectAll:p,disabled:C,labelPosition:S="top",onScroll:h,maxContentWidth:N,...M})=>{const[k,T]=i.useState(),_=i.useRef(null),[I,D]=i.useState(!1),[B,re]=i.useState(!1),{cleanData:E,totalData:H,separators:j,groups:$,enabledOptions:fe}=m||p!=null&&p.enable?du(t):{cleanData:t,totalData:t.length,separators:0,groups:0,enabledOptions:[]},pe=i.useMemo(()=>r&&p!=null&&p.enable&&t.length>0?[{type:"all",[l.label]:p.label||"Select All"},...t]:t,[t,p,r]),Z=i.useCallback(W=>{const z=W[l.value];if(r)T((J=[])=>{const Se=J,se=Se.some(Pe=>Pe[l.value]===z)?Se.filter(Pe=>Pe[l.value]!==z):[...Se,W];return a==null||a(se),se});else{const J=W;T(J),a==null||a(J)}},[r,l.value,a]);i.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&T(void 0),s!==void 0&&T(s),u!==void 0&&T(u)},[s,u]);const Ne=i.useMemo(()=>Math.min(b,H*fu+j*pu+$*bu),[b,H,j,$]),Ce=pe.length>f;i.useEffect(()=>{if(!r)return;const W=p!=null&&p.includeDisabled?(k==null?void 0:k.length)===t.length:(k==null?void 0:k.length)===fe.length;D(W);const z=(k==null?void 0:k.length)>0&&!W;re(z)},[k,p]);const oe=i.useCallback(()=>{const W=I?[]:p!=null&&p.includeDisabled?m?E:t:fe;T(W),a==null||a(W)},[I,r,t,fe,a,p]),q=Ie(S);return e.jsxs("div",{className:o(q,"wu-flex wu-select-container"),ref:_,dir:d,children:[e.jsxs(ea,{children:[e.jsx(wu,{...M,value:k,multiple:r,variant:n,dir:d,placeholder:w,accessorKey:l,customTriggerChildren:y,id:M.id,disabled:C,selectAll:p,isCheckedAll:I}),e.jsxs(dt,{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:M.id,style:{maxWidth:N},children:[v,Ce?e.jsx(ye,{list:pe,containerHeight:b,callback:(W,z)=>e.jsx(Sa,{option:z,accessorKey:l,multiple:r,onSelect:Z,value:k,dir:d,handleSelectAll:oe,isCheckedAll:I,isPartialSelected:B}),dir:d}):e.jsx("div",{onScroll:h,style:{maxHeight:Ne,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:pe.map((W,z)=>e.jsx(Sa,{option:W,accessorKey:l,multiple:r,onSelect:Z,value:k,handleSelectAll:oe,isCheckedAll:I,dir:d,isPartialSelected:B},`${z}`))})]})]}),c&&e.jsx(X,{htmlFor:M.id,className:"wu-select-label",children:c})]})},Ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gu=({value:t,onChange:a,min:r=F.sub(new Date,{years:5}),max:s=F.add(new Date,{years:1}),placeholder:u="Select a month",Label:l,labelPosition:n="top",disabled:d,id:w,readonly:c,disabledMonths:f=[],...b})=>{const[m,v]=i.useState(null),[y,p]=i.useState(""),[C,S]=i.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),h=i.useMemo(()=>{const M=new Date(r).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-M+1},(T,_)=>({value:k-_,label:k-_}))},[r,s]);i.useEffect(()=>{if(t){const M=new Date(t),k=M.getFullYear(),T=M.getMonth();v({year:k,month:T}),p(`${Ge[T]} ${k}`),S({value:k,label:k})}},[t]);const N=()=>{m&&a&&(a(new Date(m.year,m.month,15)),p(`${Ge[m.month]} ${m.year}`))};return e.jsxs("div",{className:o("wu-flex wu-flex-col wu-items-center",Ie(n),n==="top"&&"wu-items-start"),children:[e.jsxs(ee,{children:[e.jsx(ut,{...b,disabled:d||c,id:w,dir:"ltr",placeholder:u,formattedString:y}),e.jsxs(Q,{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:[e.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:e.jsx(ka,{data:h,accessorKey:{value:"value",label:"label"},value:C,onSelect:M=>S(M),multiple:!1,maxHeight:7*32})}),e.jsx(hu,{year:C==null?void 0:C.value,selectedMonth:m==null?void 0:m.month,selectedYear:m==null?void 0:m.year,onClick:(M,k)=>v({year:k,month:M}),disabledMonths:f}),e.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(Y,{onClick:N,children:"Apply"})})})]})]}),l&&e.jsx(X,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:l})]})},hu=({year:t,selectedMonth:a,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const l=new Date,n=l.getFullYear(),d=l.getMonth(),w=i.useMemo(()=>{const c=new Set;return u.forEach(f=>{const b=typeof f=="string"?new Date(f):f;c.add(`${b.getFullYear()}-${b.getMonth()}`)}),c},[u]);return e.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:Ge.map((c,f)=>{const b=t===n&&f===d,m=a===f&&r===t;return e.jsx("button",{disabled:w.has(`${t}-${f}`),onClick:()=>s(f,t),className:o("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",b&&"wu-border wu-border-blue-p",m&&"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":`${Ge[f]} ${t}`,"data-month":f,"data-year":t,children:c},c)})})},Da=(t,a,r,s=96)=>{if(t.length===0||s<=0)return[[],[]];const[l,n]=i.useState([]),[d,w]=i.useState([]);return i.useEffect(()=>{const c=()=>{var y,p;const f=((y=a.current)==null?void 0:y.clientWidth)||0,b=((p=r.current)==null?void 0:p.clientWidth)||0,m=f-b,v=Math.floor(m/s);n(t.slice(0,v)),w(t.slice(v))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,s]),[l,d]},Ta={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},mu=t=>{const{Links:a,children:r,className:s,...u}=t,l=i.useMemo(()=>a.map((f,b)=>i.cloneElement(f,{className:o(Ta.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:b})),[a]),n=i.useRef(null),d=i.useRef(null),[w,c]=Da(l,n,d);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:w}),c.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(Ta.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:d,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},gt={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},xu=t=>{const{Links:a,children:r,className:s,...u}=t,l=i.useMemo(()=>a.map((b,m)=>i.cloneElement(b.link,{key:m,className:o(gt.wuSecondaryLink,b.link.props.className,"wu-secondary-nav-link-container"),children:e.jsxs(e.Fragment,{children:[i.cloneElement(b.imgOrIcon,{className:o("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",b.imgOrIcon.props.className)}),e.jsx("div",{className:"wu-secondary-nav-link",children:b.link.props.children})]})})),[a]),n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),[c,f]=Da(l,n,w);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("nav",{className:o(gt.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:d,children:c}),f.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(gt.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:w,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},Ma=i.forwardRef(({totalRows:t,initialPage:a,initialPageSize:r=100,onPageChange:s,className:u,disabled:l=!1,...n},d)=>{const[w,c]=i.useState(a),[f,b]=i.useState(r);i.useEffect(()=>{c(a),b(r)},[a,r]);const m=Math.ceil(t/f),v=w*f+1,y=Math.min((w+1)*f,t),p=Array.from({length:m},(h,N)=>N),C=i.useCallback(h=>{h>=0&&h<m&&(c(h),s==null||s(h))},[m,s]),S=7*32;return e.jsxs("div",{className:o("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...n,role:"navigation",children:[e.jsx(Ia,{label:"Previous page",onClick:()=>C(w-1),disabled:w===0||l,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),e.jsx(ba,{name:`${v} - ${y}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:l,children:e.jsx(ve,{style:{maxHeight:S+"px"},dir:n.dir,children:p.length>100?e.jsx(ye,{className:"wu-pagination-list",containerHeight:S,list:p,callback:(h,N)=>e.jsxs(ft,{onSelect:()=>C(N),className:o("wu-py-2",N===w&&"wu-bg-gray-20","wu-pagination-item"),children:[N*f+1," -"," ",Math.min((N+1)*f,t)]},h)}):p.map(h=>e.jsxs(ft,{onSelect:()=>C(h),className:o(h===w&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[h*f+1," -"," ",Math.min((h+1)*f,t)]},h))})}),e.jsx(Ia,{label:"Next page",onClick:()=>C(w+1),disabled:w===m-1||l,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ma.displayName="WuPagination";const Ia=({label:t,onClick:a,disabled:r,icon:s,className:u})=>e.jsx(Y,{variant:"iconOnly",onClick:a,disabled:r,className:o("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",u),"aria-label":t,children:e.jsx("span",{className:o("wu-text-sm",s)})}),yu=({Trigger:t,children:a,className:r,dir:s,open:u,onOpenChange:l,modal:n,...d})=>e.jsxs(ee,{open:u,onOpenChange:l,modal:n,children:[e.jsx(de,{asChild:!0,dir:s,children:t}),e.jsx(Q,{className:o("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...d,children:a})]}),vu=t=>e.jsx(ke.PopoverClose,{asChild:!0,children:e.jsx(Y,{...t})}),Wa=x.forwardRef(({className:t,...a},r)=>e.jsx(Me.Root,{className:o("wu-grid wu-gap-2",t),...a,ref:r}));Wa.displayName=Me.Root.displayName;const _a=x.forwardRef(({className:t,...a},r)=>e.jsx(Me.Item,{ref:r,className:o("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",t),...a,children:e.jsx(Me.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:e.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"})})}));_a.displayName=Me.Item.displayName;const Ea=i.forwardRef((t,a)=>{const{options:r,defaultValue:s,onChange:u,label:l,dir:n,...d}=t;return e.jsxs(Wa,{defaultValue:s,required:d.required,disabled:d.disabled,onValueChange:u,id:d.id,dir:n,name:d.name,className:o("w-fit",d.className),ref:a,style:d.style,children:[e.jsx(We,{htmlFor:d.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:l}),r.map(w=>e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[e.jsx(_a,{value:w.value,id:w.value,disabled:w.disabled,required:w.required,"aria-label":w.value,className:"wu-peer wu-radio-item"}),e.jsx(We,{htmlFor:w.value,className:o(w.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:w.label})]},w.value))]})});Ea.displayName="WuRadioGroup";const qa=x.forwardRef(({className:t,orientation:a="horizontal",decorative:r=!0,...s},u)=>e.jsx(Mt.Root,{ref:u,decorative:r,orientation:a,className:o("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...s}));qa.displayName=Mt.Root.displayName;function Oa({className:t,...a}){return e.jsx("div",{className:o("animate-pulse rounded-md bg-muted",t),...a})}const ht=768;function Nu(){const[t,a]=x.useState(void 0);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ht-1}px)`),s=()=>{a(window.innerWidth<ht)};return r.addEventListener("change",s),a(window.innerWidth<ht),()=>r.removeEventListener("change",s)},[]),!!t}const Cu="sidebar_state",Su=60*60*24*7,ku="256px",Du="256px",Tu="3rem",Mu="b",Aa=x.createContext(null);function ie(){const t=x.useContext(Aa);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Pa=x.forwardRef(({defaultOpen:t=!0,open:a,onOpenChange:r,className:s,style:u,children:l,...n},d)=>{const w=Nu(),[c,f]=x.useState(!1),[b,m]=x.useState(t),v=a??b,y=x.useCallback(h=>{const N=typeof h=="function"?h(v):h;r?r(N):m(N),document.cookie=`${Cu}=${N}; path=/; max-age=${Su}`},[r,v]),p=x.useCallback(()=>w?f(h=>!h):y(h=>!h),[w,y,f]);x.useEffect(()=>{const h=N=>{N.key===Mu&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),p())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[p]);const C=v?"expanded":"collapsed",S=x.useMemo(()=>({state:C,open:v,setOpen:y,isMobile:w,openMobile:c,setOpenMobile:f,toggleSidebar:p}),[C,v,y,w,c,f,p]);return e.jsx(Aa.Provider,{value:S,children:e.jsx(Ut,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":ku,"--sidebar-width-icon":Tu,...u},className:o("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:d,...n,children:l})})})});Pa.displayName="SidebarProvider";const La=x.forwardRef(({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:s,children:u,...l},n)=>{const{isMobile:d,state:w,openMobile:c,setOpenMobile:f}=ie();return r==="none"?e.jsx("div",{className:o("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:n,...l,children:u}):d?e.jsx(wa,{open:c,onOpenChange:f,...l,children:e.jsxs(it,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Du},side:t,children:[e.jsxs(ia,{className:"sr-only",children:[e.jsx(ct,{children:"Sidebar"}),e.jsx(ca,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):e.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":w,"data-collapsible":w==="collapsed"?r:"","data-variant":a,"data-side":t,children:[e.jsx("div",{className:o("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",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),e.jsx("div",{className:o("wu-fixed wu-inset-y-0 wu-z-10 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",t==="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)]",a==="floating"||a==="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),...l,children:e.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:u})})]})});La.displayName="Sidebar";const Fa=x.forwardRef(({className:t,onClick:a,children:r,...s},u)=>{const{toggleSidebar:l}=ie();return e.jsxs(he,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:o("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",t),onClick:n=>{a==null||a(n),l()},...s,children:[r,e.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Fa.displayName="SidebarTrigger";const Iu=x.forwardRef(({className:t,...a},r)=>{const{toggleSidebar:s}=ie();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:o("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",t),...a})});Iu.displayName="SidebarRail";const Ba=x.forwardRef(({className:t,...a},r)=>e.jsx("main",{ref:r,className:o("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",t),...a}));Ba.displayName="SidebarInset";const Wu=x.forwardRef(({className:t,...a},r)=>e.jsx(Be,{ref:r,"data-sidebar":"input",className:o("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",t),...a}));Wu.displayName="SidebarInput";const za=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:o("wu-flex wu-flex-col wu-gap-2 wu-p-2",t),...a}));za.displayName="SidebarHeader";const Ha=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:o("wu-flex wu-flex-col wu-gap-2 wu-pb-2",t),...a}));Ha.displayName="SidebarFooter";const _u=x.forwardRef(({className:t,...a},r)=>e.jsx(qa,{ref:r,"data-sidebar":"separator",className:o("wu-mx-2 wu-w-auto",t),...a}));_u.displayName="SidebarSeparator";const ja=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:o("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",t),...a}));ja.displayName="SidebarContent";const Ua=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:o("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",t),...a}));Ua.displayName="SidebarGroup";const $a=x.forwardRef(({className:t,asChild:a=!1,...r},s)=>{const u=a?be.Slot:"div";return e.jsx(u,{ref:s,"data-sidebar":"group-label",className:o("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",t),...r})});$a.displayName="SidebarGroupLabel";const Eu=x.forwardRef(({className:t,asChild:a=!1,...r},s)=>{const u=a?be.Slot:"button";return e.jsx(u,{ref:s,"data-sidebar":"group-action",className:o("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",t),...r})});Eu.displayName="SidebarGroupAction";const Ga=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:o("wu-w-full wu-text-sm",t),...a}));Ga.displayName="SidebarGroupContent";const mt=x.forwardRef(({className:t,...a},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:o("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",t),...a}));mt.displayName="SidebarMenu";const Va=x.forwardRef(({className:t,...a},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:o("wu-group/menu-item wu-relative",t),...a}));Va.displayName="SidebarMenuItem";const qu=K.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"}}),Ya=x.forwardRef(({asChild:t=!1,isActive:a=!1,variant:r="default",size:s="default",tooltip:u,className:l,...n},d)=>{const w=t?be.Slot:"button",{isMobile:c,state:f}=ie(),b=e.jsx(w,{ref:d,"data-sidebar":"menu-button","data-size":s,"data-active":a,className:o(qu({variant:r,size:s}),l),...n});return u?(typeof u=="string"&&(u={children:u}),e.jsxs($t,{children:[e.jsx(Gt,{asChild:!0,children:b}),e.jsx(rt,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):b});Ya.displayName="SidebarMenuButton";const Ou=x.forwardRef(({className:t,asChild:a=!1,showOnHover:r=!1,...s},u)=>{const l=a?be.Slot:"button";return e.jsx(l,{ref:u,"data-sidebar":"menu-action",className:o("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",r&&"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",t),...s})});Ou.displayName="SidebarMenuAction";const Au=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:o("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",t),...a}));Au.displayName="SidebarMenuBadge";const Pu=x.forwardRef(({className:t,showIcon:a=!1,...r},s)=>{const u=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:o("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",t),...r,children:[a&&e.jsx(Oa,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),e.jsx(Oa,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});Pu.displayName="SidebarMenuSkeleton";const Lu=x.forwardRef(({className:t,...a},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:o("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",t),...a}));Lu.displayName="SidebarMenuSub";const Fu=x.forwardRef(({...t},a)=>e.jsx("li",{ref:a,...t}));Fu.displayName="SidebarMenuSubItem";const Bu=x.forwardRef(({asChild:t=!1,size:a="md",isActive:r,className:s,...u},l)=>{const n=t?be.Slot:"a";return e.jsx(n,{ref:l,"data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:o("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",a==="sm"&&"wu-text-xs",a==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});Bu.displayName="SidebarMenuSubButton";const zu=({children:t,Sidebar:a,className:r,defaultOpen:s=!0,open:u,onOpenChange:l,style:n})=>e.jsxs(Pa,{defaultOpen:s,open:u,onOpenChange:l,children:[e.jsxs(La,{variant:"sidebar",collapsible:"icon",className:o("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:n,role:"complementary",children:[e.jsx(za,{className:"wu-py-2",children:e.jsx(Ja,{})}),a]}),e.jsx(Ba,{children:t})]}),Ja=t=>{const{state:a,isMobile:r,openMobile:s}=ie();return e.jsx(Fa,{...t,children:e.jsx(bt,{showMenu:r?s:a==="expanded"})})},Hu=({className:t,children:a,...r})=>{const s=i.useRef(null),u=i.useRef(null),l=({currentTarget:d})=>{const{scrollTop:w,clientHeight:c,scrollHeight:f}=d;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",w!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",w+c!==f)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return e.jsxs(ja,{...r,className:o("wu-overflow-hidden wu-gap-0",t),children:[e.jsx("hr",{className:n,ref:s}),e.jsx(ve,{onScroll:l,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:a}),e.jsx("hr",{className:n,ref:u})]})},ju=t=>e.jsx(Ha,{...t,children:t.children}),Uu=({label:t,children:a,...r})=>e.jsxs(Ua,{...r,className:"wu-p-0",children:[e.jsx("div",{className:"wu-h-8",children:e.jsx($a,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:t})}),e.jsx(Ga,{children:e.jsx(mt,{children:a})})]}),$u=t=>e.jsx(mt,{...t}),Gu=({Icon:t,children:a,className:r,isActive:s,...u})=>{const{state:l}=ie(),[n,d]=i.useState(),w=a&&i.cloneElement(a,{children:e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[t,e.jsx("span",{className:o("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",l==="collapsed"&&"wu-opacity-0"),children:a.props.children})]})}),c=i.useRef(null);return i.useEffect(()=>{var f;d(((f=c.current)==null?void 0:f.textContent)||"")},[]),e.jsx(Va,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:e.jsx(Ya,{className:o("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",r,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:n,asChild:!0,ref:c,children:w})})},Vu=t=>{const{children:a,...r}=t;return e.jsxs(ve,{...r,role:"complementary","aria-label":"ScrollArea",children:[a,e.jsx(pt,{orientation:"horizontal"})]})},Yu={wuStepper:"_wuStepper_apbnq_1"},Ka=i.forwardRef((t,a)=>{const{onChange:r,defaultValue:s=0,min:u,max:l,step:n,readonly:d,resetInvalidValueOnBlur:w=!0,value:c,label:f,labelPosition:b="top",className:m,style:v,...y}=t,[p,C]=i.useState(c||s),S=I=>!!(t.disabled||t.readOnly||I==="inc"&&Number(p||0)>=Number(l)||I==="dec"&&Number(p||0)<=Number(u)),h=i.useCallback(I=>{I.preventDefault(),C(D=>Number(D||u||0)+Number(n||1))},[u,n]),N=i.useCallback(I=>{I.preventDefault(),C(D=>D?Number(D)-Number(n||1):0)},[u,n]),M=i.useCallback(I=>I>=Number(u)&&I<=Number(l),[u,l]),k=I=>{const D=I.currentTarget.value;C(D)},T=i.useCallback(()=>{if(w&&!M(Number(p))){const I=Number(u)||0;C(I)}},[u,w,M,p]);i.useEffect(()=>{r&&r(Number(p))},[p,c]),i.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const _=o("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return e.jsxs("div",{className:o(Yu.wuStepper,Ju({labelPosition:b}),m,"wu-stepper"),style:v,dir:y.dir,children:[e.jsx(We,{htmlFor:y.id,className:o(b!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:y.dir,children:f}),e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:y.dir,children:[e.jsx(Y,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-add"}),className:o("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-right-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tr-sm wu-p-2",y.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:h,disabled:S("inc"),"aria-label":"increment"}),e.jsx(Be,{...y,ref:a,type:"number",className:_,onChange:k,min:u,max:l,step:n,readOnly:d,onBlur:T,value:p}),e.jsx(Y,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-minimize"}),className:o("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-left-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tl-sm wu-p-2",y.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:N,disabled:S("dec"),"aria-label":"decrement"})]})]})}),Ju=K.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"}}});Ka.displayName="WuStepper";const Xa=K.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"}}),Ku=x.forwardRef(({className:t,variant:a,size:r,...s},u)=>e.jsx(It.Root,{ref:u,className:o(Xa({variant:a,size:r,className:t})),...s}));Ku.displayName=It.Root.displayName;const Qa=x.createContext({size:"default",variant:"default"}),Ve=x.forwardRef(({className:t,variant:a,size:r,children:s,...u},l)=>e.jsx(Le.Root,{ref:l,className:o("wu-flex wu-items-center wu-justify-center wu-gap-1",t),...u,children:e.jsx(Qa.Provider,{value:{variant:a,size:r},children:s})}));Ve.displayName=Le.Root.displayName;const ce=x.forwardRef(({className:t,children:a,variant:r,size:s,...u},l)=>{const n=x.useContext(Qa);return e.jsx(Le.Item,{ref:l,className:o(Xa({variant:n.variant||r,size:n.size||s}),t),...u,children:a})});ce.displayName=Le.Item.displayName;const Za=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=t,d=w=>o("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",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",w===s&&"wu-text-white",u&&s===w&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return e.jsx(e.Fragment,{children:e.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:n,disabled:u,dir:l,className:o("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",u&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[e.jsx("div",{role:"slider",className:o("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"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),e.jsx(ce,{value:"opt1",className:d("opt1"),children:r[0].label}),e.jsx(ce,{value:"opt2",className:d("opt2"),children:r[1].label})]})})});Za.displayName="_IconTab";const Ra=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,size:n="md",onChange:d}=t,w=c=>o("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",c===s&&"wu-text-white wu-font-medium",u&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return e.jsx(e.Fragment,{children:e.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:d,disabled:u,dir:l,className:o("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",u&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[e.jsx("div",{role:"slider",className:o("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 ",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),e.jsx(ce,{value:"opt1",className:w("opt1"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),e.jsx(ce,{value:"opt2",className:w("opt2"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});Ra.displayName="_Tab";const er=i.forwardRef((t,a)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=t,d=b=>o("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",b===s&&"wu-text-primary wu-font-medium",u&&s===b&&"wu-text-gray-lead","wu-switcher-toggle-item"),w=o("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=o("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",u&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),f=o("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"&&l!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&l==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return e.jsx(e.Fragment,{children:e.jsxs(Ve,{ref:a,type:"single",value:s,disabled:u,dir:l,className:w,onValueChange:n,children:[e.jsx(ce,{value:"opt1",className:d("opt1"),children:e.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:r[0].label})}),e.jsx("button",{onClick:()=>n(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:l,children:e.jsx("div",{className:f,role:"knob",dir:l})}),e.jsx(ce,{value:"opt2",className:d("opt2"),children:e.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});er.displayName="_Toggle";const tr=i.forwardRef((t,a)=>{const{type:r,options:s,value:u,disabled:l,dir:n,size:d,onChange:w,toggle:c=!0,...f}=t,[b,m]=i.useState(),v=y=>{let p=b;y!==""?p=y:c&&(p=b==="opt1"?"opt2":"opt1");const C=p==="opt1"?s[0].value:s[1].value;w&&w(C),m(p)};if(i.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");m(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return e.jsx(e.Fragment,{});switch(r){case"toggle":return e.jsx(er,{...f,ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});case"iconTab":return e.jsx(Za,{ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});default:return e.jsx(Ra,{ref:a,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n,size:d})}});tr.displayName="WuSwitcher";const xt=x.forwardRef(({className:t,...a},r)=>e.jsx("table",{ref:r,className:o("wu-w-full wu-caption-bottom wu-text-sm",t),...a}));xt.displayName="Table";const ar=x.forwardRef(({className:t,...a},r)=>e.jsx("thead",{ref:r,className:o("[&_tr]:wu-border-b",t),...a}));ar.displayName="TableHeader";const rr=x.forwardRef(({className:t,...a},r)=>e.jsx("tbody",{ref:r,className:o("",t),...a}));rr.displayName="TableBody";const Xu=x.forwardRef(({className:t,...a},r)=>e.jsx("tfoot",{ref:r,className:o("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",t),...a}));Xu.displayName="TableFooter";const qe=x.forwardRef(({className:t,...a},r)=>e.jsx("tr",{ref:r,className:o("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",t),...a}));qe.displayName="TableRow";const yt=x.forwardRef(({className:t,...a},r)=>e.jsx("th",{ref:r,className:o("wu-h-10 wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",t),...a}));yt.displayName="TableHead";const Ye=x.forwardRef(({className:t,...a},r)=>e.jsx("td",{ref:r,className:o("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",t),...a}));Ye.displayName="TableCell";const vt=x.forwardRef(({className:t,...a},r)=>e.jsx("caption",{ref:r,className:o("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",t),...a}));vt.displayName="TableCaption";const sr=({columns:t,rowSelection:a})=>{const r=(a==null?void 0:a.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=a||{},l=i.useCallback(d=>w=>{s(()=>w?d:[])},[s]);return{finalColumns:i.useMemo(()=>r?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(f=>f.original),c=l(w);return e.jsx(te,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:f=>{d.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>e.jsx(te,{checked:d.getIsSelected(),onChange:w=>{d.toggleSelected(!!w)},"aria-label":String(d.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...t]:t,[t,r,l])}},ur=({table:t,size:a,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var d;const[l,n]=i.useState(null);return e.jsx(rr,{children:s?e.jsx(qe,{children:e.jsx(Ye,{colSpan:t.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||e.jsx(me,{className:"wu-w-full"})})}):(d=t.getRowModel().rows)!=null&&d.length?t.getRowModel().rows.map(w=>e.jsx(qe,{"data-state":w.getIsSelected()&&"selected",onMouseOver:()=>n(w.id),onMouseOut:()=>n(null),className:o("wu-transition-colors wu-border-b wu-border-black/[12%]",w.getIsSelected()?l===w.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:w.getVisibleCells().map(c=>e.jsx(Ye,{className:o("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",a==="compact"?"wu-h-8":"wu-h-10",c.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",l===w.id&&c.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:R.flexRender(c.column.columnDef.cell,c.getContext())},c.id))},w.id)):e.jsx(qe,{children:e.jsx(Ye,{colSpan:t.getAllColumns().length,children:r})})})},or=({table:t,sortableColumns:a,manual:r=!1,onSort:s,size:u,isRowSelected:l,HeaderAction:n,isStickyHeader:d})=>{const w=c=>{const{id:f,columnDef:b,getIsSorted:m,toggleSorting:v}=c,{header:y}=b;if(!a.includes(f))return y;const p=m(),C=p==="asc",S=p==="desc",h=()=>{r?(v(!S),s==null||s({id:f,desc:S})):v(c.getIsSorted()==="asc")};return e.jsxs("button",{onClick:h,"aria-label":`Sort by ${y}`,className:"wu-flex wu-items-center wu-gap-4",children:[y,e.jsxs("div",{className:"wu-relative",children:[e.jsx("span",{className:o("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",C&&"wu-hidden",!p&&"-wu-top-[11px]")}),e.jsx("span",{className:o("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!p&&"-wu-bottom-[10px]")})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(ar,{className:o("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",d&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:t.getHeaderGroups().map(c=>e.jsx(qe,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?e.jsx(yt,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):e.jsx(yt,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:R.flexRender(w(f.column),f.getContext())},f.id))},c.id))}),l&&n&&e.jsx("div",{className:o("wu-absolute wu-left-10 wu-top-0 wu-flex wu-items-center wu-px-4 wu-border-t",u==="compact"?"wu-h-8":"wu-h-10","wu-bg-gray-20 wu-text-gray-lead wu-text-xs wu-font-medium wu-z-10","wu-w-[calc(100%-40px)]","wu-transition-all wu-duration-300 wu-ease-in-out",d&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:n})]})},Qu=({data:t,columns:a,isLoading:r=!1,variant:s="unstyled",sort:u,size:l,rowSelection:n,HeaderAction:d,NoDataContent:w,stickyHeader:c=!1,CustomLoader:f,caption:b,...m})=>{var h;const v=((h=n==null?void 0:n.selectedRows)==null?void 0:h.length)??0,{finalColumns:y}=sr({columns:a,rowSelection:n}),p=i.useMemo(()=>a.filter(N=>N.enableSorting).map(N=>N.accessorKey),[y]),C=i.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const N={};for(const M of n.selectedRows){const k=t.findIndex(T=>T[n.rowUniqueKey]===M[n.rowUniqueKey]);k!==-1&&(N[k]=!0)}return N},[n==null?void 0:n.selectedRows,t,n==null?void 0:n.rowUniqueKey,n==null?void 0:n.isEnabled]),S=R.useReactTable({data:t,columns:y,getCoreRowModel:R.getCoreRowModel(),getPaginationRowModel:R.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:C}:{}},onRowSelectionChange:N=>{if(typeof N=="function"){const M=N(C),k=Object.keys(M).filter(T=>M[T]).map(T=>t[Number(T)]);n==null||n.onRowSelect(k)}}});return e.jsxs("div",{className:o("wu-table-container wu-relative"),children:[b&&e.jsx(vt,{className:"wu-font-light",children:b}),e.jsxs(xt,{...m,className:o(Zu({variant:s}),m.className),children:[e.jsx(or,{table:S,sortableColumns:p,manual:!0,onSort:u==null?void 0:u.onSort,size:l,HeaderAction:d,isRowSelected:v>0,isStickyHeader:c}),!r&&e.jsx(ur,{table:S,size:l,NoDataContent:w,CustomLoader:f})]}),r&&e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:e.jsx(me,{})})]})},Zu=K.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"}}}),lr=({data:t,columns:a,caption:r,variant:s="unstyled",sort:u,filterText:l,size:n="default",pagination:d,rowSelection:w,HeaderAction:c,NoDataContent:f,CustomLoader:b,isLoading:m,stickyHeader:v,...y})=>{var re;const[p,C]=i.useState((u==null?void 0:u.initial)||[]),[S,h]=i.useState([]),N=((re=w==null?void 0:w.selectedRows)==null?void 0:re.length)??0,[M,k]=i.useState((d==null?void 0:d.pageIndex)??0),{finalColumns:T}=sr({columns:a,rowSelection:w}),_=i.useMemo(()=>T.filter(E=>E.enableSorting).map(E=>E.accessorKey),[T]),I=i.useMemo(()=>T.filter(E=>E.filterable).map(E=>E.accessorKey),[T]),D=i.useMemo(()=>{if(!(w!=null&&w.isEnabled))return{};const E={};for(const H of w.selectedRows){const j=t.findIndex($=>$[w.rowUniqueKey]===H[w.rowUniqueKey]);j!==-1&&(E[j]=!0)}return E},[w==null?void 0:w.selectedRows,t,w==null?void 0:w.rowUniqueKey,w==null?void 0:w.isEnabled]),B=R.useReactTable({data:t,columns:T,getCoreRowModel:R.getCoreRowModel(),enableRowSelection:w==null?void 0:w.isEnabled,getPaginationRowModel:R.getPaginationRowModel(),getSortedRowModel:R.getSortedRowModel(),getFilteredRowModel:R.getFilteredRowModel(),initialState:{pagination:{pageSize:(d==null?void 0:d.pageSize)??100,pageIndex:(d==null?void 0:d.pageIndex)??0}},state:{sorting:p,columnFilters:S,...d?{pagination:d}:{},...w!=null&&w.isEnabled?{rowSelection:D}:{}},onSortingChange:C,onColumnFiltersChange:h,onRowSelectionChange:E=>{const H=typeof E=="function"?E(D):E,j=Object.keys(H).filter($=>H[$]).map($=>t[Number($)]);w==null||w.onRowSelect(j)}});return i.useEffect(()=>{I.forEach(E=>{var H;(H=B.getColumn(E))==null||H.setFilterValue(l)})},[l,I,B]),i.useEffect(()=>{d&&(d==null?void 0:d.pageIndex)!==M&&(w==null||w.onRowSelect(()=>[]),B.resetRowSelection(),k(d.pageIndex))},[d==null?void 0:d.pageIndex]),e.jsx("div",{className:"wu-table-container wu-relative",children:e.jsxs(xt,{...y,className:o(Ru({variant:s}),"wu-table-fixed",y.className),children:[r&&e.jsx(vt,{className:"wu-font-light",children:r}),e.jsx(or,{table:B,sortableColumns:_,size:n,HeaderAction:c,isRowSelected:N>0,isStickyHeader:v}),e.jsx(ur,{table:B,size:n,NoDataContent:f,CustomLoader:b,isLoading:m})]})})},Ru=K.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"}}});lr.displayName="WuTable";const nr=x.forwardRef(({className:t,...a},r)=>e.jsx("textarea",{className:o("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 ",t),ref:r,...a}));nr.displayName="Textarea";const wr=i.forwardRef((t,a)=>{const{Label:r,id:s=Fe(),variant:u="flat",readonly:l,maxLength:n,labelPosition:d="top",...w}=t,c=b=>{w.onChange&&w.onChange(b)},f=Ie(d);return e.jsxs("div",{className:o(f,"wu-flex wu-textarea-container"),dir:w.dir,children:[e.jsx(nr,{...w,ref:a,id:s,className:o("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",w.className),onChange:c,readOnly:l,maxLength:n}),r&&e.jsx(X,{htmlFor:s,className:"wu-textarea-label",children:r})]})});wr.displayName="WuTextarea";const eo=1,to=1e6;let Nt=0;function ao(){return Nt=(Nt+1)%Number.MAX_SAFE_INTEGER,Nt.toString()}const Ct=new Map,dr=t=>{if(Ct.has(t))return;const a=setTimeout(()=>{Ct.delete(t),Oe({type:"REMOVE_TOAST",toastId:t})},to);Ct.set(t,a)},ro=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,eo)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===a.toast.id?{...r,...a.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=a;return r?dr(r):t.toasts.forEach(s=>{dr(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==a.toastId)}}},Je=[];let Ke={toasts:[]};function Oe(t){Ke=ro(Ke,t),Je.forEach(a=>{a(Ke)})}function so({...t}){const a=ao(),r=u=>Oe({type:"UPDATE_TOAST",toast:{...u,id:a}}),s=()=>Oe({type:"DISMISS_TOAST",toastId:a});return Oe({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:u=>{u||s()}}}),{id:a,dismiss:s,update:r}}function ir(){const[t,a]=i.useState(Ke);return i.useEffect(()=>(Je.push(a),()=>{const r=Je.indexOf(a);r>-1&&Je.splice(r,1)}),[t]),{...t,toast:so,dismiss:r=>Oe({type:"DISMISS_TOAST",toastId:r})}}const uo=()=>{const{toast:t}=ir();if(!t)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:a="success",message:r,duration:s=3e3})=>{t?t({description:r,variant:a,duration:s}):console.error("Toast instance not initialized")}}},oo=V.Provider,lo=K.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",bottomRight:"wu-right-0 wu-bottom-0",bottomReft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),cr=x.forwardRef(({className:t,position:a,...r},s)=>e.jsx(V.Viewport,{ref:s,className:o(lo({position:a}),t),...r}));cr.displayName=V.Viewport.displayName;const no=K.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 data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",{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"}},defaultVariants:{variant:"default"}}),fr=x.forwardRef(({className:t,variant:a,...r},s)=>e.jsx(V.Root,{ref:s,className:o(no({variant:a}),t),...r}));fr.displayName=V.Root.displayName;const wo=x.forwardRef(({className:t,...a},r)=>e.jsx(V.Action,{ref:r,className:o("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",t),...a}));wo.displayName=V.Action.displayName;const pr=x.forwardRef(({className:t,...a},r)=>e.jsx(V.Close,{ref:r,className:o("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",t),"toast-close":"","aria-label":"Close toast",...a,children:e.jsx("span",{className:"wm-close wu-text-base"})}));pr.displayName=V.Close.displayName;const br=x.forwardRef(({className:t,...a},r)=>e.jsx(V.Title,{ref:r,className:o("wu-text-sm wu-font-semibold",t),...a}));br.displayName=V.Title.displayName;const gr=x.forwardRef(({className:t,...a},r)=>e.jsx(V.Description,{ref:r,className:o("wu-text-sm wu-opacity-90",t),...a}));gr.displayName=V.Description.displayName;function io(){const{toasts:t}=ir();return e.jsxs(oo,{children:[t.map(function({id:a,title:r,description:s,action:u,variant:l,...n}){const d={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return e.jsxs(fr,{variant:l,...n,children:[e.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&e.jsx(br,{children:r}),s&&e.jsxs(gr,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[e.jsx(we,{icon:d[l||"success"],className:"wu-text-xl"}),s]})]}),u,e.jsx(pr,{})]},a)}),e.jsx(cr,{})]})}const co=()=>e.jsx(io,{}),hr=x.forwardRef(({className:t,dir:a,...r},s)=>e.jsx(Ze.Root,{className:o("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",t),...r,ref:s,children:e.jsx(Ze.Thumb,{className:o("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",a==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",a!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));hr.displayName=Ze.Root.displayName;const mr=i.forwardRef((t,a)=>{const{Label:r,labelPosition:s="right",onChange:u,className:l,dir:n,disabled:d,id:w=Fe(),...c}=t;return i.useEffect(()=>{const{checked:f,defaultChecked:b}=c;f!==void 0&&b!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),e.jsxs("div",{className:o(fo({labelPosition:s}),"wu-toggle-container"),dir:n,children:[e.jsx(hr,{...c,id:w,disabled:d,ref:a,onCheckedChange:u,className:o("wu-peer",l),dir:n}),e.jsx(X,{htmlFor:w,className:"wu-toggle-label",children:r})]})});mr.displayName="WuToggle";const fo=K.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"}}});window.wickUiVersion="1.3.0",g.CHART_COLOR_SYSTEM=Pr,g.WuAccordion=zr,g.WuAppHeader=is,g.WuAppHeaderAccount=Lt,g.WuAppHeaderBar=jt,g.WuAppHeaderHelp=Ft,g.WuAppHeaderMenu=Ht,g.WuAppHeaderSearch=ws,g.WuButton=Y,g.WuCalender=st,g.WuCard=Xt,g.WuCheckbox=te,g.WuChip=ys,g.WuCombobox=Is,g.WuCopyToClipboard=Ws,g.WuDataTable=Qu,g.WuDatePicker=fs,g.WuDateRangePicker=gs,g.WuDisplay=Qr,g.WuDrawer=As,g.WuDrawerClose=Ps,g.WuFooter=fa,g.WuFormGroup=ns,g.WuHeading=Kr,g.WuHelpButton=pa,g.WuIcon=we,g.WuInput=xe,g.WuInputError=us,g.WuInputHint=os,g.WuLabel=X,g.WuListbox=js,g.WuLoader=me,g.WuMenu=ba,g.WuMenuCheckboxItem=Us,g.WuMenuIcon=bt,g.WuMenuItem=ft,g.WuMenuItemGroup=$s,g.WuMenuRadioItem=Gs,g.WuMenuSeparatorItem=Vs,g.WuModal=su,g.WuModalClose=nu,g.WuModalContent=uu,g.WuModalFooter=lu,g.WuModalHeader=ou,g.WuMonthPicker=gu,g.WuPagination=Ma,g.WuPopover=yu,g.WuPopoverClose=vu,g.WuPrimaryNavbar=mu,g.WuRadioGroup=Ea,g.WuScrollArea=Vu,g.WuSecondaryNavbar=xu,g.WuSelect=ka,g.WuSidebar=zu,g.WuSidebarContent=Hu,g.WuSidebarFooter=ju,g.WuSidebarGroup=Uu,g.WuSidebarItem=Gu,g.WuSidebarMenu=$u,g.WuSidebarTrigger=Ja,g.WuStepper=Ka,g.WuSubMenu=Ys,g.WuSubtext=Xr,g.WuSwitcher=tr,g.WuTable=lr,g.WuText=Jr,g.WuTextarea=wr,g.WuToast=co,g.WuToggle=mr,g.WuTooltip=ze,g.WuTruncatedLabel=ds,g.WuVirtualScroll=ye,g.useWuShowToast=uo,g.useWuSidebar=ie,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.js.map