@npm-questionpro/wick-ui-lib 1.35.2 → 1.35.4

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,10 +1,10 @@
1
- (function(I,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("react-dom"),require("@tanstack/react-table"),require("date-fns"),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("@radix-ui/react-tabs"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","react-dom","@tanstack/react-table","date-fns","@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","@radix-ui/react-tabs","@radix-ui/react-toast","@radix-ui/react-switch"],a):(I=typeof globalThis<"u"?globalThis:I||self,a(I["wick-ui-lib"]={},I["react/jsx-runtime"],I.RadixUIAvatar,I.React,I.clsx,I.tailwindMerge,I.RadixUIAccordion,I.RadixUISlot,I.ClassVarianceAuthority,I.ReactDayPicker,I.RadixUICheckbox,I.RadixUILabel,I.cmdk,I.RadixUIPopover,I.RadixUITooltip,I.ReactVirtuoso,I.RadixUIDropdownMenu,I.ReactDOM,I.TanstackReactTable,I.dateFns,I.RadixUIDialog,I.RadixUIScrollArea,I.RadixUIRadioGroup,I.RadixUISeparator,I.RadixUIToggleGroup,I.RadixUIToggle,I.RadixUITabs,I.RadixUIToast,I.RadixUISwitch))})(this,(function(I,a,St,h,Sd,Cd,Td,Ct,qe,$a,Ed,Md,xe,Ht,kr,Ha,Id,Ad,Me,U,za,kd,Dd,_d,Pd,Vd,Od,Fd,Ld){"use strict";var Iv=Object.defineProperty;var Av=(I,a,St)=>a in I?Iv(I,a,{enumerable:!0,configurable:!0,writable:!0,value:St}):I[a]=St;var Ee=(I,a,St)=>Av(I,typeof a!="symbol"?a+"":a,St);var yd;function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Tt=he(St),x=he(h),ut=he(Td),Dr=he(Ed),Ua=he(Md),zt=he(Ht),Ut=he(kr),ne=he(Id),ja=he(Ad),te=he(za),lt=he(kd),jt=he(Dd),Ga=he(_d),An=he(Pd),Ka=he(Vd),ct=he(Od),Ie=he(Fd),_r=he(Ld),Wd=Cd.extendTailwindMerge({prefix:"wu-"});function m(...e){return Wd(Sd.clsx(e))}const Pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Vr(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function kn(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Bd=e=>e?/\S+@questionpro\.com/.test(e):!1,Ya=ut.Root,Or=x.forwardRef(({className:e,...t},n)=>a.jsx(ut.Item,{ref:n,className:m("wu-border-b",e),...t}));Or.displayName="AccordionItem";const Fr=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ut.Header,{className:"wu-flex",children:a.jsxs(ut.Trigger,{ref:r,className:m("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));Fr.displayName=ut.Trigger.displayName;const Lr=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ut.Content,{ref:r,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...n,children:a.jsx("div",{className:m("wu-pb-4 wu-pt-0",e),children:t})}));Lr.displayName=ut.Content.displayName;const qd=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(Ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Or,{value:u,dir:r,className:m(n,c),children:[a.jsx(Fr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Lr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(Ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Or,{value:u,dir:r,className:m(n,c),children:[a.jsx(Fr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Lr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}},Wr=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Root,{ref:n,className:m("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Wr.displayName=Tt.Root.displayName;const Br=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Image,{ref:n,className:m("wu-aspect-square wu-h-full wu-w-full",e),...t}));Br.displayName=Tt.Image.displayName;const qr=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Fallback,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));qr.displayName=Tt.Fallback.displayName;const we={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Ze=(e,t)=>t.includes(".")?t.split(".").reduce((n,r)=>n==null?void 0:n[r],e):e==null?void 0:e[t],$d=({log:e,accessorKey:t})=>{const n=Ze(e,t.time),r=Ze(e,t.userName),s=Ze(e,t.userInitials),o=Ze(e,t.userImage??""),i=Ze(e,t.tags??""),u=Ze(e,t.description);return a.jsxs("div",{className:we.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:we.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:we.content,"data-slot":"content",children:[a.jsx("div",{className:we.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:we.tags,"data-slot":"tags",children:i.map((l,d)=>a.jsx("span",{className:m(we.tag,d===0?we.tagPrimary:we.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:we.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(Wr,{className:we.avatar,"data-slot":"avatar",children:[a.jsx(Br,{src:o,alt:r,"data-slot":"log-user-avatar-image"}),a.jsx(qr,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:s})]}),a.jsxs("p",{className:we.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:we.userName,"data-slot":"log-username",children:r})," ",u]})]})]})]})},Hd=h.memo($d),zd=({logs:e,accessorKey:t,className:n,...r})=>{const s=h.useMemo(()=>e.reduce((o,i)=>{const u=Ze(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:m(we.timelineContainer,n),"data-slot":"timeline-container",...r,children:[a.jsx("div",{className:we.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(s).map(([o,i])=>a.jsxs("div",{className:we.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:we.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:we.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:we.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:we.logList,"data-slot":"log-list",children:i.map(u=>{const l=Ze(u,t.id);return a.jsx(Hd,{log:u,accessorKey:t},l)})})]},o))]})};function $r(e,t){h.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Hr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Xa=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=h.useState(!1),u=h.useRef(null),l=h.useRef(null);$r([u,l],()=>i(!1));const d=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Hr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&Hr.open),children:[a.jsx("button",{className:m("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:c=>{c.preventDefault(),d()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:m(Hr.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:r})]})})})})},zr=qe.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm wu-leading-normal"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px] wu-rounded-lg","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent disabled:wu-ring-gray-subtle"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Et=x.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?Ct.Slot:"button";return a.jsx(u,{className:m(zr({size:n,color:r,variant:t,className:e})),ref:i,...o})});Et.displayName="Button";const dt=h.forwardRef((e,t)=>Ud(e,t)),Ud=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=m("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},d=a.jsxs("div",{...o,ref:t,className:m("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),c=a.jsxs("div",{...o,ref:t,className:m("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:i,style:{fontSize:u},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:s==="spinner"?d:c})};dt.displayName="WuLoader";const Ae=h.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:d="primary",selected:c,...w},p)=>{const f={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Et,{...w,disabled:e||t,variant:n,size:r,className:m(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",c&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",l),color:d,style:{backgroundColor:t?f[d]:"",...w.style},ref:p,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(dt,{color:"#fff",size:"sm"}),!t&&i]})});Ae.displayName="WuButton";const jd=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(Ae,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Gd=({user:e,dir:t})=>{const n=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:m("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:m(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},Kd=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:m("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:m("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),Yd=({user:e,dir:t})=>{var n,r,s,o,i,u,l,d,c;return a.jsxs("section",{className:m("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:m("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(u=e==null?void 0:e.license)==null?void 0:u.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(l=e==null?void 0:e.license)==null?void 0:l.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),a.jsx("p",{children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDate})]})]})]})]})},Za=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Xa,{Trigger:a.jsxs(Wr,{className:m("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[a.jsx(Br,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(qr,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:m("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:n,children:[a.jsx(Yd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Kd,{settings:e.settings,dir:n}),a.jsx(Gd,{user:e,dir:n}),a.jsx(jd,{onLogout:t,DataCenter:r})]})}):null},Ja=({menuList:e,dir:t})=>{const n=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return a.jsx(Xa,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Pr(r.link),onKeyDown:o=>{o.key==="Enter"&&Pr(r.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
1
+ (function(I,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("react-dom"),require("@tanstack/react-table"),require("date-fns"),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("@radix-ui/react-tabs"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","react-dom","@tanstack/react-table","date-fns","@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","@radix-ui/react-tabs","@radix-ui/react-toast","@radix-ui/react-switch"],a):(I=typeof globalThis<"u"?globalThis:I||self,a(I["wick-ui-lib"]={},I["react/jsx-runtime"],I.RadixUIAvatar,I.React,I.clsx,I.tailwindMerge,I.RadixUIAccordion,I.RadixUISlot,I.ClassVarianceAuthority,I.ReactDayPicker,I.RadixUICheckbox,I.RadixUILabel,I.cmdk,I.RadixUIPopover,I.RadixUITooltip,I.ReactVirtuoso,I.RadixUIDropdownMenu,I.ReactDOM,I.TanstackReactTable,I.dateFns,I.RadixUIDialog,I.RadixUIScrollArea,I.RadixUIRadioGroup,I.RadixUISeparator,I.RadixUIToggleGroup,I.RadixUIToggle,I.RadixUITabs,I.RadixUIToast,I.RadixUISwitch))})(this,(function(I,a,St,h,Sd,Cd,Td,Ct,qe,$a,Ed,Md,xe,Ht,kr,Ha,Id,Ad,Me,z,Ua,kd,Dd,_d,Pd,Vd,Od,Fd,Ld){"use strict";var Iv=Object.defineProperty;var Av=(I,a,St)=>a in I?Iv(I,a,{enumerable:!0,configurable:!0,writable:!0,value:St}):I[a]=St;var Ee=(I,a,St)=>Av(I,typeof a!="symbol"?a+"":a,St);var yd;function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Tt=he(St),x=he(h),ut=he(Td),Dr=he(Ed),za=he(Md),Ut=he(Ht),zt=he(kr),ne=he(Id),ja=he(Ad),te=he(Ua),lt=he(kd),jt=he(Dd),Ga=he(_d),An=he(Pd),Ka=he(Vd),ct=he(Od),Ie=he(Fd),_r=he(Ld),Wd=Cd.extendTailwindMerge({prefix:"wu-"});function m(...e){return Wd(Sd.clsx(e))}const Pr=e=>{window==null||window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Vr(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function kn(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const Bd=e=>e?/\S+@questionpro\.com/.test(e):!1,Ya=ut.Root,Or=x.forwardRef(({className:e,...t},n)=>a.jsx(ut.Item,{ref:n,className:m("wu-border-b",e),...t}));Or.displayName="AccordionItem";const Fr=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ut.Header,{className:"wu-flex",children:a.jsxs(ut.Trigger,{ref:r,className:m("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));Fr.displayName=ut.Trigger.displayName;const Lr=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ut.Content,{ref:r,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...n,children:a.jsx("div",{className:m("wu-pb-4 wu-pt-0",e),children:t})}));Lr.displayName=ut.Content.displayName;const qd=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(Ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Or,{value:u,dir:r,className:m(n,c),children:[a.jsx(Fr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Lr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(Ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Or,{value:u,dir:r,className:m(n,c),children:[a.jsx(Fr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Lr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}},Wr=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Root,{ref:n,className:m("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Wr.displayName=Tt.Root.displayName;const Br=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Image,{ref:n,className:m("wu-aspect-square wu-h-full wu-w-full",e),...t}));Br.displayName=Tt.Image.displayName;const qr=x.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Fallback,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));qr.displayName=Tt.Fallback.displayName;const we={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Ze=(e,t)=>t.includes(".")?t.split(".").reduce((n,r)=>n==null?void 0:n[r],e):e==null?void 0:e[t],$d=({log:e,accessorKey:t})=>{const n=Ze(e,t.time),r=Ze(e,t.userName),s=Ze(e,t.userInitials),o=Ze(e,t.userImage??""),i=Ze(e,t.tags??""),u=Ze(e,t.description);return a.jsxs("div",{className:we.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:we.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:we.content,"data-slot":"content",children:[a.jsx("div",{className:we.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:we.tags,"data-slot":"tags",children:i.map((l,d)=>a.jsx("span",{className:m(we.tag,d===0?we.tagPrimary:we.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:we.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(Wr,{className:we.avatar,"data-slot":"avatar",children:[a.jsx(Br,{src:o,alt:r,"data-slot":"log-user-avatar-image"}),a.jsx(qr,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:s})]}),a.jsxs("p",{className:we.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:we.userName,"data-slot":"log-username",children:r})," ",u]})]})]})]})},Hd=h.memo($d),Ud=({logs:e,accessorKey:t,className:n,...r})=>{const s=h.useMemo(()=>e.reduce((o,i)=>{const u=Ze(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:m(we.timelineContainer,n),"data-slot":"timeline-container",...r,children:[a.jsx("div",{className:we.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(s).map(([o,i])=>a.jsxs("div",{className:we.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:we.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:we.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:we.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:we.logList,"data-slot":"log-list",children:i.map(u=>{const l=Ze(u,t.id);return a.jsx(Hd,{log:u,accessorKey:t},l)})})]},o))]})};function $r(e,t){h.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Hr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Xa=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=h.useState(!1),u=h.useRef(null),l=h.useRef(null);$r([u,l],()=>i(!1));const d=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Hr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&Hr.open),children:[a.jsx("button",{className:m("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:c=>{c.preventDefault(),d()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:m(Hr.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:r})]})})})})},Ur=qe.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm wu-leading-normal"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px] wu-rounded-lg","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],upgrade:["wu-bg-orange-soft hover:wu-bg-orange-deep","wu-text-orange-deep hover:wu-text-orange-deep","wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent disabled:wu-ring-gray-subtle"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Et=x.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?Ct.Slot:"button";return a.jsx(u,{className:m(Ur({size:n,color:r,variant:t,className:e})),ref:i,...o})});Et.displayName="Button";const dt=h.forwardRef((e,t)=>zd(e,t)),zd=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=m("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},d=a.jsxs("div",{...o,ref:t,className:m("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),c=a.jsxs("div",{...o,ref:t,className:m("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:i,style:{fontSize:u},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:s==="spinner"?d:c})};dt.displayName="WuLoader";const Ae=h.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:d="primary",selected:c,...w},p)=>{const f={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Et,{...w,disabled:e||t,variant:n,size:r,className:m(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",c&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",l),color:d,style:{backgroundColor:t?f[d]:"",...w.style},ref:p,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(dt,{color:"#fff",size:"sm"}),!t&&i]})});Ae.displayName="WuButton";const jd=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(Ae,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),Gd=({user:e,dir:t})=>{const n=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:m("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:m(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},Kd=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:m("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:m("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),Yd=({user:e,dir:t})=>{var n,r,s,o,i,u,l,d,c;return a.jsxs("section",{className:m("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:m("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(u=e==null?void 0:e.license)==null?void 0:u.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(l=e==null?void 0:e.license)==null?void 0:l.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),a.jsx("p",{children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDate})]})]})]})]})},Za=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Xa,{Trigger:a.jsxs(Wr,{className:m("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[a.jsx(Br,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(qr,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:m("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:n,children:[a.jsx(Yd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Kd,{settings:e.settings,dir:n}),a.jsx(Gd,{user:e,dir:n}),a.jsx(jd,{onLogout:t,DataCenter:r})]})}):null},Ja=({menuList:e,dir:t})=>{const n=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return a.jsx(Xa,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Pr(r.link),onKeyDown:o=>{o.key==="Enter"&&Pr(r.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
2
2
  focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer`,children:a.jsx(Qa,{item:r,dir:t})}):a.jsx("a",{href:r.link,target:"_blank",className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[0.04] focus-visible:wu-border-none
3
3
  focus-visible:wu-bg-black
4
- focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:a.jsx(Qa,{item:r,dir:t})})},s))})})},Qa=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:m("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),Xd=e=>{const[t,n]=h.useState(()=>window.innerWidth<=e);return h.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Zd({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const d=l[u];if(d){d.focus();const c=e[u]||null;n(c)}},s=(u,l,d,c)=>{u.preventDefault();const w=d==="down"?l+1:l-1;r(w,c)},o=(u,l,d,c)=>{t!=null&&t.products&&t.products[t.products.length-1].name===c&&(u.preventDefault(),r(l+1,d))},i=(u,l)=>{u.preventDefault();const d=e[l]===t?null:e[l];n(d)};return function(l,d,c){const w=document.querySelectorAll("[data-product-category]"),{key:p}=l;switch(p){case"ArrowDown":s(l,d,"down",w);break;case"ArrowUp":s(l,d,"up",w);break;case"Tab":o(l,d,w,c);break;case"Enter":case" ":i(l,d);break}}}const Jd=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Qd=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:m(i[t],n),children:r})},Rd=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},ew=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Pe=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:m(t,n),role:"presentation","aria-label":t})},tw=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:m("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:u=>{r&&u.key==="ArrowDown"&&n(u,-1)},"aria-label":"product-switcher",children:[a.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(Pe,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ae={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"},nw=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=m("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=m("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:m("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[a.jsx("div",{className:ae.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},rw={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"},sw=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=h.useState(e.name===t),l=e.name===n,d=e.name===t,c=!e.active,w="#1b3380",p="#c5cce0",f="#ffcf70",g=m("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",d&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),b=m("wu-text-blue-p wu-text-base",d&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),v=i||s===e.name||l?w:p;return a.jsxs("li",{className:m(ae.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&ae.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&ae.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":c,dir:r,onKeyDown:N=>{if(N.key==="Enter"){N.preventDefault();const y=N.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:c?f:v}}),a.jsxs("a",{className:m(ae.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:m(b,rw[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:m(g),children:e.name})]})]},e.name)},aw=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,d=h.useMemo(()=>u.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[u]),c=h.useMemo(()=>u.filter(g=>!g.active),[u]),[w,p]=h.useState(i),f=g=>g.map((b,v)=>a.jsx(sw,{product:b,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},v));return l?a.jsxs(a.Fragment,{children:[f(d),c.length>0&&a.jsxs("li",{className:m(ae.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>p("#f5a300"),onMouseOut:()=>p(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:m(ae.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),f(c)]}):a.jsxs("li",{className:m(ae.productListItem,ae.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:ae.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Ra=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:d,setFocusItem:c})=>{const w="#ffcf70",[p,f]=h.useState(window.innerWidth>768);return h.useEffect(()=>{const g=()=>{f(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.jsx("ul",{className:m(ae.productDropdownMenu,n&&ae.productDropdownMenuOpen,t==="rtl"&&ae.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((g,b)=>a.jsxs("li",{className:m(ae.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===g&&ae.open,u&&ae.open),onMouseEnter:()=>p&&o(g),onMouseLeave:()=>p&&o(null),"aria-label":g.name,dir:t,onKeyDown:v=>i(v,b),tabIndex:0,"data-product-category":!0,children:[a.jsx(nw,{category:g,dir:t,openCategory:s}),a.jsx("ul",{className:m(ae.productList,t==="rtl"&&ae.rtlProductList),dir:t,children:a.jsx(aw,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:d,setFocusItem:c,borderColorLocked:w})})]},g.name))})},ow=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:m("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:m("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:d=>{t&&d.key==="ArrowDown"&&l(d,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),iw=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:m("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"aria-label":"menu-toggle-btn",children:[a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},eo=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),d=h.useRef(null),[c,w]=h.useState(!1),[p,f]=h.useState(null),[g,b]=h.useState(n.base),[v,N]=h.useState(""),[y,C]=h.useState(!1),S=Xd(768);$r([u,i],()=>{w(!1),f(null)}),$r([l,d,u],()=>{C(!1),w(!1),f(null)}),h.useEffect(()=>{const A=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[c]),h.useEffect(()=>b(n.base),[n.base]);const T=A=>{A.preventDefault(),A.stopPropagation(),w(k=>{const M=!k;return M||f(null),M})},D=(A,k)=>{Zd({productCategories:e,openCategory:p,setOpenCategory:f})(A,k,v)};return a.jsx("div",{className:m("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:S?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(iw,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:d,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(ow,{isProductButtonShow:y,isDropdownOpen:c,activeProductColor:n,activeProductBgColor:g,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:l,handleKeyDown:D,dir:r}),a.jsx("div",{className:m("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Ra,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:p,productCategories:e,setOpenCategory:f,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:c?n.hover:g},onMouseOver:()=>b(n.hover),onMouseOut:()=>b(n.base),children:[a.jsx(tw,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:T,handleKeyDown:D,isDropdownOpen:c}),a.jsx(Ra,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:p,productCategories:e,setOpenCategory:f,dropdownRef:u,expandAll:o,dir:r})]})})},to=({children:e,dir:t,className:n})=>a.jsx("section",{className:m("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",n),children:a.jsx("div",{className:"wu-grow",children:e})}),uw=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=h.useState(n);return h.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{"data-testid":"search-icon",icon:"wm-search",className:m("wu-absolute wu-top-1 wu-left-1.5","wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)}),a.jsx("input",{placeholder:t,onChange:u=>r(u.target.value),className:m("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","wu-h-8 wu-pl-8 wu-pr-4 wu-text-xs wu-text-gray-lead",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",...s})]})},no=Ut.Provider,ro=Ut.Root,so=Ut.Trigger,Ur=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Ut.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...n}));Ur.displayName=Ut.Content.displayName;const Dn=h.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,...d},c)=>a.jsx(no,{delayDuration:r||200,children:a.jsxs(ro,{open:u,onOpenChange:l,children:[a.jsx(so,{asChild:!0,children:a.jsx("span",{ref:c,children:s})}),a.jsx(kr.Portal,{children:e&&a.jsxs(Ur,{...d,side:t||"top",sideOffset:n||0,className:m("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(kr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Dn.displayName="WuTooltip";const lw=({label:e,className:t})=>{const n=h.useRef(null),[r,s]=h.useState(!1);return h.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,d=e.length*l;s(d>i||u>i)}},[e]),a.jsx("p",{ref:n,className:m("wu-w-full wu-truncate",t),children:r?a.jsx(Dn,{content:e,positionOffset:8,children:e}):e})},cw=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:d,DataCenter:c}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:m("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Bd((w=r==null?void 0:r.profile)==null?void 0:w.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(eo,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:d})}),a.jsx(to,{dir:l,children:s}),a.jsxs("section",{className:m("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(Ja,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Za,{user:r,onLogout:o,dir:l,DataCenter:c})]})]})})},Ge=zt.Root,wt=zt.Trigger,$e=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(zt.Portal,{children:a.jsx(zt.Content,{ref:s,align:t,sideOffset:n,className:m("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));$e.displayName=zt.Content.displayName;function ao({className:e,classNames:t,dir:n="ltr",...r}){const s=$a.getDefaultClassNames();return a.jsx($a.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:m("wu-p-3",e),classNames:{root:m(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:m("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:m(s.month_caption,"wu-mb-5"),months:m(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:m(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:m(s.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:m(s.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:m(s.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:m(s.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:m(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:m("rm",s.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:m(s.range_end,"wu-rounded-none"),range_start:m(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:m(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:m(s.button_next,zr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:m(s.button_previous,zr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:m(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:m(s.chevron,"!wu-text-red-500"),outside:m(s.outside,"wu-invisible"),disabled:m(s.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...r})}ao.displayName="Calendar";const jr=e=>a.jsx(ao,{...e}),oo=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[s&&a.jsx(Ae,{variant:"secondary",onClick:r,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Gr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(Ht.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(Ae,{...u,className:m("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),io=(e,t,n,r)=>{const s=U.startOfDay(e).getTime();return!!(t||n&&s<U.startOfDay(n).getTime()||r&&s>U.startOfDay(r).getTime())},_n=e=>e?typeof e=="string"?new Date(e):e:new Date,Kr="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",dw=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ww=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:m("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},fw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=h.useState(!1);return h.useEffect(()=>{var d;(((d=t==null?void 0:t.current)==null?void 0:d.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:m("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},pw=qe.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"),Pn=x.forwardRef(({className:e,...t},n)=>a.jsx(Ua.Root,{ref:n,className:m(pw(),e),...t}));Pn.displayName=Ua.Root.displayName;const ke=e=>a.jsx(Pn,{...e,className:m("wu-text-gray-lead wu-leading-6",e.className)}),hw=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const d=m("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),c=m("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),p=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:d,dir:o,...u,children:[e,a.jsxs("div",{className:c,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:p,children:t})]})]})},mw=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:r,minDate:s=U.sub(new Date,{years:5}),maxDate:o=U.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:d,showResetButton:c=!1,placeholder:w="Select Date",CustomTrigger:p,...f})=>{const[g,b]=h.useState(),[v,N]=h.useState(""),y=h.useCallback(()=>{const S=_n(g);N(U.format(S,e)),n&&n(g)},[g,e,n]),C=h.useCallback(()=>{d?d():(b(void 0),N(""),n&&n(void 0))},[n,d]);return h.useEffect(()=>{const S=_n(t);b(S),N(U.format(S,e))},[t,e]),a.jsxs(ke,{className:m("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(Ge,{children:[a.jsx(Gr,{formattedString:v,dir:i,placeholder:w,CustomTrigger:p,...f}),a.jsx($e,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(jr,{dir:i,mode:"single",captionLayout:"dropdown",selected:g,onSelect:b,disabled:S=>io(S,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:g,className:m("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(oo,{handleDateChange:y,disabled:r,onReset:C,showResetButton:c})})})]})]})},uo={};function Je(e,t){const n=x.useRef(uo);return n.current===uo&&(n.current=e(t)),n}const Yr=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],gw=Yr&&Yr!==x.useLayoutEffect?Yr:e=>e();function ge(e){const t=Je(bw).current;return t.next=e,gw(t.effect),t.trampoline}function bw(){const e={next:void 0,callback:yw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function yw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function vw(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const Gt=vw("https://base-ui.com/production-error","Base UI");function Ve(){}const Ke=Object.freeze({});let lo=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const xw={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Kt={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Nw={disabled:!1,...Kt},Xr={valid(e){return e===null?null:e?{[lo.valid]:""}:{[lo.invalid]:""}}},co=x.createContext({invalid:void 0,name:void 0,validityData:{state:xw,errors:[],error:"",value:"",initialValue:null},setValidityData:Ve,disabled:void 0,touched:Kt.touched,setTouched:Ve,dirty:Kt.dirty,setDirty:Ve,filled:Kt.filled,setFilled:Ve,focused:Kt.focused,setFocused:Ve,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Nw,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Ke)=>e,getInputValidationProps:(e=Ke)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(co.displayName="FieldRootContext");function Vn(e=!0){const t=x.useContext(co);if(t.setValidityData===Ve&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Gt(28));return t}const wo=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ve,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(wo.displayName="FormContext");function fo(){return x.useContext(wo)}function Zr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Yt={};function po(e,t,n,r,s){let o={...Jr(e,Yt)};return t&&(o=On(o,t)),n&&(o=On(o,n)),r&&(o=On(o,r)),o}function Sw(e){if(e.length===0)return Yt;if(e.length===1)return Jr(e[0],Yt);let t={...Jr(e[0],Yt)};for(let n=1;n<e.length;n+=1)t=On(t,e[n]);return t}function On(e,t){return ho(t)?t(e):Cw(e,t)}function Cw(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Zr(e.style,r);break}case"className":{e[n]=mo(e.className,r);break}default:Tw(n,r)?e[n]=Ew(e[n],r):e[n]=r}}return e}function Tw(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function ho(e){return typeof e=="function"}function Jr(e,t){return ho(e)?e(t):e??Yt}function Ew(e,t){return t?e?n=>{if(Mw(n)){const s=n;Qr(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function Qr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function mo(e,t){return t?e?t+" "+e:t:e}function Mw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const ft={...x};let go=0;function Iw(e,t="mui"){const[n,r]=x.useState(e),s=e||n;return x.useEffect(()=>{n==null&&(go+=1,r(`${t}-${go}`))},[n,t]),s}const bo=ft.useId;function Aw(e,t){if(bo!==void 0){const n=bo();return e??(t?`${t}-${n}`:n)}return Iw(e,t)}function yo(e){return Aw(e,"base-ui")}const vo=x.createContext({controlId:void 0,registerControlId:Ve,labelId:void 0,setLabelId:Ve,messageIds:[],setMessageIds:Ve,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(vo.displayName="LabelableContext");function Rr(){return x.useContext(vo)}function Fn(e,t,n,r){const s=Je(xo).current;return Dw(s,e,t,n,r)&&No(s,[e,t,n,r]),s.callback}function kw(e){const t=Je(xo).current;return _w(t,e)&&No(t,e),t.callback}function xo(){return{callback:null,cleanup:null,refs:[]}}function Dw(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function _w(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function No(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Pw=parseInt(x.version,10);function Vw(e){return Pw>=e}function So(e){if(!x.isValidElement(e))return null;const t=e,n=t.props;return(Vw(19)?n==null?void 0:n.ref:t.ref)??null}let es;process.env.NODE_ENV!=="production"&&(es=new Set);function ts(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");es.has(t)||(es.add(t),console.warn(`Base UI: ${t}`))}}function Ow(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Fw(e,t){return typeof e=="function"?e(t):e}function Lw(e,t){return typeof e=="function"?e(t):e}function Ye(e,t,n={}){const r=t.render,s=Ww(t,n);if(n.enabled===!1)return null;const o=n.state??Ke;return qw(e,r,s,o)}function Ww(e,t={}){const{className:n,style:r,render:s}=e,{state:o=Ke,ref:i,props:u,stateAttributesMapping:l,enabled:d=!0}=t,c=d?Fw(n,o):void 0,w=d?Lw(r,o):void 0,p=d?Ow(o,l):Ke,f=d?Zr(p,Array.isArray(u)?Sw(u):u)??Ke:Ke;return typeof document<"u"&&(d?Array.isArray(i)?f.ref=kw([f.ref,So(s),...i]):f.ref=Fn(f.ref,So(s),i):Fn(null,null)),d?(c!==void 0&&(f.className=mo(f.className,c)),w!==void 0&&(f.style=Zr(f.style,w)),f):Ke}const Bw=Symbol.for("react.lazy");function qw(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&$w(t),t(n,r);const s=po(n,t.props);s.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===Bw&&(o=x.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!x.isValidElement(o))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
5
- `));return x.cloneElement(o,s)}if(e&&typeof e=="string")return Hw(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Gt(8))}function $w(e){const t=e.name;if(t.length===0)return;const n=t.charCodeAt(0);n<65||n>90||ts(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function Hw(e,t){return e==="button"?h.createElement("button",{type:"button",...t,key:t.key}):e==="img"?h.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const zw=[];function Ln(e){x.useEffect(e,zw)}const Xt=0;class Wn{constructor(){Ee(this,"currentId",Xt);Ee(this,"clear",()=>{this.currentId!==Xt&&(clearTimeout(this.currentId),this.currentId=Xt)});Ee(this,"disposeEffect",()=>this.clear)}static create(){return new Wn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Xt,n()},t)}isStarted(){return this.currentId!==Xt}}function Co(){const e=Je(Wn.create).current;return Ln(e.disposeEffect),e}function Uw(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let ns;process.env.NODE_ENV!=="production"&&(ns=new Set);function To(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ns.has(t)||(ns.add(t),console.error(`Base UI: ${t}`))}}function Eo(){return typeof window<"u"}function rs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jw(e){return Eo()?e instanceof Element||e instanceof rs(e).Element:!1}function Gw(e){return Eo()?e instanceof HTMLElement||e instanceof rs(e).HTMLElement:!1}function Mo(e){return(e==null?void 0:e.ownerDocument)||document}const Bn=typeof navigator<"u",ss=Zw(),Kw=Qw(),Yw=Jw();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Xw=ss.platform==="MacIntel"&&ss.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ss.platform);Bn&&Kw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Yw.includes("jsdom/");function Zw(){if(!Bn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Jw(){if(!Bn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Qw(){if(!Bn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Rw(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ef(e){e.preventDefault(),e.stopPropagation()}const re=typeof document<"u"?x.useLayoutEffect:()=>{},qn=null;let Io=globalThis.requestAnimationFrame;class tf{constructor(){Ee(this,"callbacks",[]);Ee(this,"callbacksCount",0);Ee(this,"nextId",1);Ee(this,"startId",1);Ee(this,"isScheduled",!1);Ee(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&Io!==requestAnimationFrame&&(Io=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $n=new tf;class le{constructor(){Ee(this,"currentId",qn);Ee(this,"cancel",()=>{this.currentId!==qn&&($n.cancel(this.currentId),this.currentId=qn)});Ee(this,"disposeEffect",()=>this.cancel)}static create(){return new le}static request(t){return $n.request(t)}static cancel(t){return $n.cancel(t)}request(t){this.cancel(),this.currentId=$n.request(()=>{this.currentId=qn,t()})}}function Ao(){const e=Je(le.create).current;return Ln(e.disposeEffect),e}function nf(e){return e==null?e:"current"in e?e.current:e}let Zt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const rf={[Zt.startingStyle]:""},sf={[Zt.endingStyle]:""},ko={transitionStatus(e){return e==="starting"?rf:e==="ending"?sf:null}};function Do(e,t=!1,n=!0){const r=Ao();return ge((s,o=null)=>{r.cancel();function i(){ja.flushSync(s)}const u=nf(e);if(u==null)return;const l=u;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let d=function(){const w=Zt.startingStyle;if(!l.hasAttribute(w)){r.request(c);return}const p=new MutationObserver(()=>{l.hasAttribute(w)||(p.disconnect(),c())});p.observe(l,{attributes:!0,attributeFilter:[w]}),o==null||o.addEventListener("abort",()=>p.disconnect(),{once:!0})},c=function(){Promise.all(l.getAnimations().map(w=>w.finished)).then(()=>{o!=null&&o.aborted||i()}).catch(()=>{const w=l.getAnimations();if(n){if(o!=null&&o.aborted)return;i()}else w.length>0&&w.some(p=>p.pending||p.playState!=="finished")&&c()})};if(t){d();return}r.request(c)}})}function af(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=ge(s),i=Do(r,n,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return i(o,u.signal),()=>{u.abort()}},[t,n,o,i])}function of(e,t=!1,n=!1){const[r,s]=x.useState(e&&t?"idle":void 0),[o,i]=x.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),re(()=>{if(!e&&o&&r!=="ending"&&n){const u=le.request(()=>{s("ending")});return()=>{le.cancel(u)}}},[e,o,r,n]),re(()=>{if(!e||t)return;const u=le.request(()=>{s(void 0)});return()=>{le.cancel(u)}},[t,e]),re(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=le.request(()=>{s("idle")});return()=>{le.cancel(u)}},[t,e,o,s,r]),x.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:r}),[o,r])}function as({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=x.useRef(e!==void 0),[o,i]=x.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){x.useEffect(()=>{s!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
4
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:a.jsx(Qa,{item:r,dir:t})})},s))})})},Qa=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:m("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),Xd=e=>{const[t,n]=h.useState(()=>window.innerWidth<=e);return h.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Zd({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const d=l[u];if(d){d.focus();const c=e[u]||null;n(c)}},s=(u,l,d,c)=>{u.preventDefault();const w=d==="down"?l+1:l-1;r(w,c)},o=(u,l,d,c)=>{t!=null&&t.products&&t.products[t.products.length-1].name===c&&(u.preventDefault(),r(l+1,d))},i=(u,l)=>{u.preventDefault();const d=e[l]===t?null:e[l];n(d)};return function(l,d,c){const w=document.querySelectorAll("[data-product-category]"),{key:p}=l;switch(p){case"ArrowDown":s(l,d,"down",w);break;case"ArrowUp":s(l,d,"up",w);break;case"Tab":o(l,d,w,c);break;case"Enter":case" ":i(l,d);break}}}const Jd=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Qd=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:m(i[t],n),children:r})},Rd=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},ew=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Pe=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:m(t,n),role:"presentation","aria-label":t})},tw=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:m("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:u=>{r&&u.key==="ArrowDown"&&n(u,-1)},"aria-label":"product-switcher",children:[a.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(Pe,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ae={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"},nw=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=m("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=m("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:m("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:t,children:[a.jsx("div",{className:ae.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},rw={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"},sw=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=h.useState(e.name===t),l=e.name===n,d=e.name===t,c=!e.active,w="#1b3380",p="#c5cce0",f="#ffcf70",g=m("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",d&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),b=m("wu-text-blue-p wu-text-base",d&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),v=i||s===e.name||l?w:p;return a.jsxs("li",{className:m(ae.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&ae.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&ae.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":c,dir:r,onKeyDown:N=>{if(N.key==="Enter"){N.preventDefault();const y=N.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:c?f:v}}),a.jsxs("a",{className:m(ae.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:m(b,rw[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:m(g),children:e.name})]})]},e.name)},aw=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,d=h.useMemo(()=>u.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[u]),c=h.useMemo(()=>u.filter(g=>!g.active),[u]),[w,p]=h.useState(i),f=g=>g.map((b,v)=>a.jsx(sw,{product:b,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},v));return l?a.jsxs(a.Fragment,{children:[f(d),c.length>0&&a.jsxs("li",{className:m(ae.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>p("#f5a300"),onMouseOut:()=>p(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:m(ae.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),f(c)]}):a.jsxs("li",{className:m(ae.productListItem,ae.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:m(ae.topBorder,r==="rtl"&&ae.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:ae.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Ra=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:d,setFocusItem:c})=>{const w="#ffcf70",[p,f]=h.useState(window.innerWidth>768);return h.useEffect(()=>{const g=()=>{f(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.jsx("ul",{className:m(ae.productDropdownMenu,n&&ae.productDropdownMenuOpen,t==="rtl"&&ae.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((g,b)=>a.jsxs("li",{className:m(ae.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===g&&ae.open,u&&ae.open),onMouseEnter:()=>p&&o(g),onMouseLeave:()=>p&&o(null),"aria-label":g.name,dir:t,onKeyDown:v=>i(v,b),tabIndex:0,"data-product-category":!0,children:[a.jsx(nw,{category:g,dir:t,openCategory:s}),a.jsx("ul",{className:m(ae.productList,t==="rtl"&&ae.rtlProductList),dir:t,children:a.jsx(aw,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:d,setFocusItem:c,borderColorLocked:w})})]},g.name))})},ow=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:m("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:m("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:d=>{t&&d.key==="ArrowDown"&&l(d,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),iw=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:m("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"aria-label":"menu-toggle-btn",children:[a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),a.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},eo=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),d=h.useRef(null),[c,w]=h.useState(!1),[p,f]=h.useState(null),[g,b]=h.useState(n.base),[v,N]=h.useState(""),[y,C]=h.useState(!1),S=Xd(768);$r([u,i],()=>{w(!1),f(null)}),$r([l,d,u],()=>{C(!1),w(!1),f(null)}),h.useEffect(()=>{const A=k=>{k.key==="Escape"&&w(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[c]),h.useEffect(()=>b(n.base),[n.base]);const T=A=>{A.preventDefault(),A.stopPropagation(),w(k=>{const M=!k;return M||f(null),M})},D=(A,k)=>{Zd({productCategories:e,openCategory:p,setOpenCategory:f})(A,k,v)};return a.jsx("div",{className:m("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:S?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(iw,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:d,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(ow,{isProductButtonShow:y,isDropdownOpen:c,activeProductColor:n,activeProductBgColor:g,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:l,handleKeyDown:D,dir:r}),a.jsx("div",{className:m("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(Ra,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:p,productCategories:e,setOpenCategory:f,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:c?n.hover:g},onMouseOver:()=>b(n.hover),onMouseOut:()=>b(n.base),children:[a.jsx(tw,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:T,handleKeyDown:D,isDropdownOpen:c}),a.jsx(Ra,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:p,productCategories:e,setOpenCategory:f,dropdownRef:u,expandAll:o,dir:r})]})})},to=({children:e,dir:t,className:n})=>a.jsx("section",{className:m("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",n),children:a.jsx("div",{className:"wu-grow",children:e})}),uw=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=h.useState(n);return h.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{"data-testid":"search-icon",icon:"wm-search",className:m("wu-absolute wu-top-1 wu-left-1.5","wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)}),a.jsx("input",{placeholder:t,onChange:u=>r(u.target.value),className:m("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","wu-h-8 wu-pl-8 wu-pr-4 wu-text-xs wu-text-gray-lead",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",...s})]})},no=zt.Provider,ro=zt.Root,so=zt.Trigger,zr=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(zt.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...n}));zr.displayName=zt.Content.displayName;const Dn=h.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,...d},c)=>a.jsx(no,{delayDuration:r||200,children:a.jsxs(ro,{open:u,onOpenChange:l,children:[a.jsx(so,{asChild:!0,children:a.jsx("span",{ref:c,children:s})}),a.jsx(kr.Portal,{children:e&&a.jsxs(zr,{...d,side:t||"top",sideOffset:n||0,className:m("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,i&&a.jsx(kr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Dn.displayName="WuTooltip";const lw=({label:e,className:t})=>{const n=h.useRef(null),[r,s]=h.useState(!1);return h.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,d=e.length*l;s(d>i||u>i)}},[e]),a.jsx("p",{ref:n,className:m("wu-w-full wu-truncate",t),children:r?a.jsx(Dn,{content:e,positionOffset:8,children:e}):e})},cw=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:d,DataCenter:c}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:m("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Bd((w=r==null?void 0:r.profile)==null?void 0:w.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(eo,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:d})}),a.jsx(to,{dir:l,children:s}),a.jsxs("section",{className:m("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(Ja,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Za,{user:r,onLogout:o,dir:l,DataCenter:c})]})]})})},Ge=Ut.Root,wt=Ut.Trigger,$e=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(Ut.Portal,{children:a.jsx(Ut.Content,{ref:s,align:t,sideOffset:n,className:m("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));$e.displayName=Ut.Content.displayName;function ao({className:e,classNames:t,dir:n="ltr",...r}){const s=$a.getDefaultClassNames();return a.jsx($a.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:m("wu-p-3",e),classNames:{root:m(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:m("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:m(s.month_caption,"wu-mb-5"),months:m(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:m(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:m(s.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:m(s.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:m(s.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:m(s.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:m(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:m("rm",s.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:m(s.range_end,"wu-rounded-none"),range_start:m(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:m(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:m(s.button_next,Ur({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:m(s.button_previous,Ur({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:m(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:m(s.chevron,"!wu-text-red-500"),outside:m(s.outside,"wu-invisible"),disabled:m(s.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...r})}ao.displayName="Calendar";const jr=e=>a.jsx(ao,{...e}),oo=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[s&&a.jsx(Ae,{variant:"secondary",onClick:r,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Gr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(Ht.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(Ae,{...u,className:m("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),io=(e,t,n,r)=>{const s=z.startOfDay(e).getTime();return!!(t||n&&s<z.startOfDay(n).getTime()||r&&s>z.startOfDay(r).getTime())},_n=e=>e?typeof e=="string"?new Date(e):e:new Date,Kr="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",dw=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ww=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:m("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},fw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=h.useState(!1);return h.useEffect(()=>{var d;(((d=t==null?void 0:t.current)==null?void 0:d.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:m("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},pw=qe.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"),Pn=x.forwardRef(({className:e,...t},n)=>a.jsx(za.Root,{ref:n,className:m(pw(),e),...t}));Pn.displayName=za.Root.displayName;const ke=e=>a.jsx(Pn,{...e,className:m("wu-text-gray-lead wu-leading-6",e.className)}),hw=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const d=m("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),c=m("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),p=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:d,dir:o,...u,children:[e,a.jsxs("div",{className:c,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:p,children:t})]})]})},mw=({formatString:e="yyyy-MM-dd",value:t,onChange:n,disabled:r,minDate:s=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:d,showResetButton:c=!1,placeholder:w="Select Date",CustomTrigger:p,...f})=>{const[g,b]=h.useState(),[v,N]=h.useState(""),y=h.useCallback(()=>{const S=_n(g);N(z.format(S,e)),n&&n(g)},[g,e,n]),C=h.useCallback(()=>{d?d():(b(void 0),N(""),n&&n(void 0))},[n,d]);return h.useEffect(()=>{const S=_n(t);b(S),N(z.format(S,e))},[t,e]),a.jsxs(ke,{className:m("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(Ge,{children:[a.jsx(Gr,{formattedString:v,dir:i,placeholder:w,CustomTrigger:p,...f}),a.jsx($e,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:i,children:a.jsx(jr,{dir:i,mode:"single",captionLayout:"dropdown",selected:g,onSelect:b,disabled:S=>io(S,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:g,className:m("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(oo,{handleDateChange:y,disabled:r,onReset:C,showResetButton:c})})})]})]})},uo={};function Je(e,t){const n=x.useRef(uo);return n.current===uo&&(n.current=e(t)),n}const Yr=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],gw=Yr&&Yr!==x.useLayoutEffect?Yr:e=>e();function ge(e){const t=Je(bw).current;return t.next=e,gw(t.effect),t.trampoline}function bw(){const e={next:void 0,callback:yw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function yw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function vw(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const Gt=vw("https://base-ui.com/production-error","Base UI");function Ve(){}const Ke=Object.freeze({});let lo=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const xw={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Kt={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Nw={disabled:!1,...Kt},Xr={valid(e){return e===null?null:e?{[lo.valid]:""}:{[lo.invalid]:""}}},co=x.createContext({invalid:void 0,name:void 0,validityData:{state:xw,errors:[],error:"",value:"",initialValue:null},setValidityData:Ve,disabled:void 0,touched:Kt.touched,setTouched:Ve,dirty:Kt.dirty,setDirty:Ve,filled:Kt.filled,setFilled:Ve,focused:Kt.focused,setFocused:Ve,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Nw,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Ke)=>e,getInputValidationProps:(e=Ke)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(co.displayName="FieldRootContext");function Vn(e=!0){const t=x.useContext(co);if(t.setValidityData===Ve&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Gt(28));return t}const wo=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ve,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(wo.displayName="FormContext");function fo(){return x.useContext(wo)}function Zr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Yt={};function po(e,t,n,r,s){let o={...Jr(e,Yt)};return t&&(o=On(o,t)),n&&(o=On(o,n)),r&&(o=On(o,r)),o}function Sw(e){if(e.length===0)return Yt;if(e.length===1)return Jr(e[0],Yt);let t={...Jr(e[0],Yt)};for(let n=1;n<e.length;n+=1)t=On(t,e[n]);return t}function On(e,t){return ho(t)?t(e):Cw(e,t)}function Cw(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Zr(e.style,r);break}case"className":{e[n]=mo(e.className,r);break}default:Tw(n,r)?e[n]=Ew(e[n],r):e[n]=r}}return e}function Tw(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function ho(e){return typeof e=="function"}function Jr(e,t){return ho(e)?e(t):e??Yt}function Ew(e,t){return t?e?n=>{if(Mw(n)){const s=n;Qr(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:t:e}function Qr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function mo(e,t){return t?e?t+" "+e:t:e}function Mw(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const ft={...x};let go=0;function Iw(e,t="mui"){const[n,r]=x.useState(e),s=e||n;return x.useEffect(()=>{n==null&&(go+=1,r(`${t}-${go}`))},[n,t]),s}const bo=ft.useId;function Aw(e,t){if(bo!==void 0){const n=bo();return e??(t?`${t}-${n}`:n)}return Iw(e,t)}function yo(e){return Aw(e,"base-ui")}const vo=x.createContext({controlId:void 0,registerControlId:Ve,labelId:void 0,setLabelId:Ve,messageIds:[],setMessageIds:Ve,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(vo.displayName="LabelableContext");function Rr(){return x.useContext(vo)}function Fn(e,t,n,r){const s=Je(xo).current;return Dw(s,e,t,n,r)&&No(s,[e,t,n,r]),s.callback}function kw(e){const t=Je(xo).current;return _w(t,e)&&No(t,e),t.callback}function xo(){return{callback:null,cleanup:null,refs:[]}}function Dw(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function _w(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function No(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Pw=parseInt(x.version,10);function Vw(e){return Pw>=e}function So(e){if(!x.isValidElement(e))return null;const t=e,n=t.props;return(Vw(19)?n==null?void 0:n.ref:t.ref)??null}let es;process.env.NODE_ENV!=="production"&&(es=new Set);function ts(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");es.has(t)||(es.add(t),console.warn(`Base UI: ${t}`))}}function Ow(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Fw(e,t){return typeof e=="function"?e(t):e}function Lw(e,t){return typeof e=="function"?e(t):e}function Ye(e,t,n={}){const r=t.render,s=Ww(t,n);if(n.enabled===!1)return null;const o=n.state??Ke;return qw(e,r,s,o)}function Ww(e,t={}){const{className:n,style:r,render:s}=e,{state:o=Ke,ref:i,props:u,stateAttributesMapping:l,enabled:d=!0}=t,c=d?Fw(n,o):void 0,w=d?Lw(r,o):void 0,p=d?Ow(o,l):Ke,f=d?Zr(p,Array.isArray(u)?Sw(u):u)??Ke:Ke;return typeof document<"u"&&(d?Array.isArray(i)?f.ref=kw([f.ref,So(s),...i]):f.ref=Fn(f.ref,So(s),i):Fn(null,null)),d?(c!==void 0&&(f.className=mo(f.className,c)),w!==void 0&&(f.style=Zr(f.style,w)),f):Ke}const Bw=Symbol.for("react.lazy");function qw(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&$w(t),t(n,r);const s=po(n,t.props);s.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===Bw&&(o=x.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!x.isValidElement(o))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
5
+ `));return x.cloneElement(o,s)}if(e&&typeof e=="string")return Hw(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Gt(8))}function $w(e){const t=e.name;if(t.length===0)return;const n=t.charCodeAt(0);n<65||n>90||ts(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function Hw(e,t){return e==="button"?h.createElement("button",{type:"button",...t,key:t.key}):e==="img"?h.createElement("img",{alt:"",...t,key:t.key}):x.createElement(e,t)}const Uw=[];function Ln(e){x.useEffect(e,Uw)}const Xt=0;class Wn{constructor(){Ee(this,"currentId",Xt);Ee(this,"clear",()=>{this.currentId!==Xt&&(clearTimeout(this.currentId),this.currentId=Xt)});Ee(this,"disposeEffect",()=>this.clear)}static create(){return new Wn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Xt,n()},t)}isStarted(){return this.currentId!==Xt}}function Co(){const e=Je(Wn.create).current;return Ln(e.disposeEffect),e}function zw(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let ns;process.env.NODE_ENV!=="production"&&(ns=new Set);function To(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ns.has(t)||(ns.add(t),console.error(`Base UI: ${t}`))}}function Eo(){return typeof window<"u"}function rs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jw(e){return Eo()?e instanceof Element||e instanceof rs(e).Element:!1}function Gw(e){return Eo()?e instanceof HTMLElement||e instanceof rs(e).HTMLElement:!1}function Mo(e){return(e==null?void 0:e.ownerDocument)||document}const Bn=typeof navigator<"u",ss=Zw(),Kw=Qw(),Yw=Jw();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Xw=ss.platform==="MacIntel"&&ss.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ss.platform);Bn&&Kw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Yw.includes("jsdom/");function Zw(){if(!Bn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Jw(){if(!Bn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Qw(){if(!Bn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Rw(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ef(e){e.preventDefault(),e.stopPropagation()}const re=typeof document<"u"?x.useLayoutEffect:()=>{},qn=null;let Io=globalThis.requestAnimationFrame;class tf{constructor(){Ee(this,"callbacks",[]);Ee(this,"callbacksCount",0);Ee(this,"nextId",1);Ee(this,"startId",1);Ee(this,"isScheduled",!1);Ee(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&Io!==requestAnimationFrame&&(Io=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $n=new tf;class le{constructor(){Ee(this,"currentId",qn);Ee(this,"cancel",()=>{this.currentId!==qn&&($n.cancel(this.currentId),this.currentId=qn)});Ee(this,"disposeEffect",()=>this.cancel)}static create(){return new le}static request(t){return $n.request(t)}static cancel(t){return $n.cancel(t)}request(t){this.cancel(),this.currentId=$n.request(()=>{this.currentId=qn,t()})}}function Ao(){const e=Je(le.create).current;return Ln(e.disposeEffect),e}function nf(e){return e==null?e:"current"in e?e.current:e}let Zt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const rf={[Zt.startingStyle]:""},sf={[Zt.endingStyle]:""},ko={transitionStatus(e){return e==="starting"?rf:e==="ending"?sf:null}};function Do(e,t=!1,n=!0){const r=Ao();return ge((s,o=null)=>{r.cancel();function i(){ja.flushSync(s)}const u=nf(e);if(u==null)return;const l=u;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let d=function(){const w=Zt.startingStyle;if(!l.hasAttribute(w)){r.request(c);return}const p=new MutationObserver(()=>{l.hasAttribute(w)||(p.disconnect(),c())});p.observe(l,{attributes:!0,attributeFilter:[w]}),o==null||o.addEventListener("abort",()=>p.disconnect(),{once:!0})},c=function(){Promise.all(l.getAnimations().map(w=>w.finished)).then(()=>{o!=null&&o.aborted||i()}).catch(()=>{const w=l.getAnimations();if(n){if(o!=null&&o.aborted)return;i()}else w.length>0&&w.some(p=>p.pending||p.playState!=="finished")&&c()})};if(t){d();return}r.request(c)}})}function af(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=ge(s),i=Do(r,n,!1);x.useEffect(()=>{if(!t)return;const u=new AbortController;return i(o,u.signal),()=>{u.abort()}},[t,n,o,i])}function of(e,t=!1,n=!1){const[r,s]=x.useState(e&&t?"idle":void 0),[o,i]=x.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),re(()=>{if(!e&&o&&r!=="ending"&&n){const u=le.request(()=>{s("ending")});return()=>{le.cancel(u)}}},[e,o,r,n]),re(()=>{if(!e||t)return;const u=le.request(()=>{s(void 0)});return()=>{le.cancel(u)}},[t,e]),re(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=le.request(()=>{s("idle")});return()=>{le.cancel(u)}},[t,e,o,s,r]),x.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:r}),[o,r])}function as({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=x.useRef(e!==void 0),[o,i]=x.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){x.useEffect(()=>{s!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
6
6
  `))},[r,n,e]);const{current:d}=x.useRef(t);x.useEffect(()=>{!s&&JSON.stringify(d)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
7
- `))},[JSON.stringify(t)])}const l=x.useCallback(d=>{s||i(d)},[]);return[u,l]}function _o(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:o}=Rr(),i=yo(t),u=n?s:void 0,l=Je(()=>Symbol("labelable-control")),d=x.useRef(!1),c=x.useRef(t!=null),w=ge(()=>{!d.current||o===Ve||(d.current=!1,o(l.current,void 0))});return re(()=>{if(o===Ve)return;let p;if(n){const f=r==null?void 0:r.current;jw(f)&&f.closest("label")!=null?p=t??null:p=u??i}else if(t!=null)c.current=!0,p=t;else if(c.current)p=i;else{w();return}if(p===void 0){w();return}d.current=!0,o(l.current,p)},[t,r,u,o,n,i,l,w]),x.useEffect(()=>w,[w]),s??i}function Po(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:o,commit:i}=e,{formRef:u}=fo(),{invalid:l,markedDirtyRef:d,validityData:c,setValidityData:w}=Vn(),p=ge(e.getValue);re(()=>{if(!t)return;let f=n;f===void 0&&(f=p()),c.initialValue===null&&f!==null&&w(g=>({...g,initialValue:f}))},[t,w,n,c.initialValue,p]),re(()=>{!t||!r||u.current.fields.set(r,{getValue:p,name:s,controlRef:o,validityData:Uw(c,l),validate(f=!0){let g=n;g===void 0&&(g=p()),d.current=!0,f?ja.flushSync(()=>i(g)):i(g)}})},[i,o,t,u,p,r,l,d,s,c,n]),re(()=>{const f=u.current.fields;return()=>{r&&f.delete(r)}},[u,r])}const Jt="none",uf="trigger-press",lf="increment-press",cf="decrement-press",os="input-change",Qt="input-clear",Hn="input-blur",is="input-paste",Rt="keyboard";function De(e,t,n,r){let s=!1,o=!1;const i=r??Ke;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function en(e,t,n){const r=Ke;return{reason:e,event:t??new Event("base-ui"),...r}}const Vo=x.forwardRef(function(t,n){const{render:r,className:s,id:o,name:i,value:u,disabled:l=!1,onValueChange:d,defaultValue:c,autoFocus:w=!1,...p}=t,{state:f,name:g,disabled:b,setTouched:v,setDirty:N,validityData:y,setFocused:C,setFilled:S,validationMode:T,validation:D}=Vn(),A=b||l,k=g??i,M={...f,disabled:A},{labelId:_}=Rr(),P=_o({id:o});re(()=>{var $;const q=u!=null;($=D.inputRef.current)!=null&&$.value||q&&u!==""?S(!0):q&&u===""&&S(!1)},[D.inputRef,S,u]);const E=x.useRef(null);re(()=>{w&&E.current===Rw(Mo(E.current))&&C(!0)},[w,C]);const[V]=as({controlled:u,default:c,name:"FieldControl",state:"value"}),L=u!==void 0,O=L?V:void 0;return Po({id:P,name:k,commit:D.commit,value:O,getValue:()=>{var q;return(q=D.inputRef.current)==null?void 0:q.value},controlRef:D.inputRef}),Ye("input",t,{ref:[n,E],state:M,props:[{id:P,disabled:A,name:k,ref:D.inputRef,"aria-labelledby":_,autoFocus:w,...L?{value:O}:{defaultValue:c},onChange(q){const $=q.currentTarget.value;d==null||d($,De(Jt,q.nativeEvent)),N($!==y.initialValue),S($!=="")},onFocus(){C(!0)},onBlur(q){v(!0),C(!1),T==="onBlur"&&D.commit(q.currentTarget.value)},onKeyDown(q){q.currentTarget.tagName==="INPUT"&&q.key==="Enter"&&(v(!0),D.commit(q.currentTarget.value))}},D.getInputValidationProps(),p],stateAttributesMapping:Xr})});process.env.NODE_ENV!=="production"&&(Vo.displayName="FieldControl");const Oo=x.forwardRef(function(t,n){return a.jsx(Vo,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(Oo.displayName="Input");const zn={wuInputGroup:"_wuInputGroup_dz2g7_1",wuInputIcon:"_wuInputIcon_dz2g7_20",wuInput:"_wuInput_dz2g7_1",passwordToggle:"_passwordToggle_dz2g7_89"},Fo=h.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:r})=>{const s=h.useCallback(i=>{if(n||r){i.preventDefault(),i.stopPropagation();return}t()},[n,r,t]),o=n||r;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:zn.passwordToggle,onClick:s,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(Pe,{icon:e?"wm-visibility":"wm-visibility-off"})})});Fo.displayName="PasswordToggle";const Qe=h.memo(h.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:r,iconPosition:s="left",variant:o="flat",type:i,readonly:u,invalid:l,id:d,...c},w)=>{const p=h.useId(),f=d||p;if(i==="submit")return a.jsx(Ae,{className:e,id:f,"aria-label":c["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:c.disabled,children:t||"Submit"});const[g,b]=h.useState(!1),v=h.useCallback(()=>{b(T=>!T)},[]),{finalIcon:N,finalIconPosition:y}=h.useMemo(()=>i==="password"?{finalIcon:a.jsx(Fo,{showPassword:g,onToggle:v,readOnly:u,disabled:c.disabled}),finalIconPosition:"right"}:{finalIcon:r,finalIconPosition:s},[i,r,s,g,v]),C=h.useMemo(()=>i==="password"&&g?"text":i,[i,g]),S=h.useMemo(()=>m(zn.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:zn.wuInputGroup,"data-label-position":n,"data-icon-position":N&&y,children:[N&&a.jsx("span",{className:zn.wuInputIcon,children:N}),a.jsx(Oo,{ref:w,className:S,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:f,...c}),t&&a.jsx(ke,{htmlFor:f,children:t})]})}));Qe.displayName="WuInput";const Lo="yyyy-MM-dd",df=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],wf=({current:e,onSelect:t,presetRanges:n=dw})=>{const[r,s]=h.useState(),[o,i]=h.useState(!1),[u,l]=h.useState(""),[d,c]=h.useState(""),[w,p]=h.useState(!1),f=h.useMemo(()=>n.map(y=>y.value),[n]),g=m("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"),b=h.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const C=Number(y)-1;s(C),i(!1),t({from:U.sub(new Date,{days:C}),to:new Date})},[t]),v=h.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Kr).test(y))return!1;const T=new Date(C==="start"?y:e.from),D=new Date(C==="end"?y:e.to);return U.isBefore(D,T)?(p(!0),!1):(p(!1),!(U.isSameDay(T,e.from)&&U.isSameDay(D,e.to)))},[e]),N=h.useCallback((y,C)=>{if((C==="start"?l:c)(y),v(y,C)){const T={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(T.from=new Date(y)),C==="end"&&(T.to=new Date(y)),t(T)}},[e,t,v]);return h.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&U.isValid(e.to)&&U.isValid(e.from)){l(U.format(e.from,Lo)),c(U.format(e.to,Lo));const y=U.differenceInCalendarDays(e.to,e.from);U.isToday(e.to)&&f.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,f]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:df.map(({label:y,value:C})=>a.jsx(Et,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:C})=>a.jsx("li",{children:a.jsx("button",{className:m(g,r===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:m(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Qe,{placeholder:"Start Date",pattern:Kr,value:u,onChange:y=>N(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Qe,{placeholder:"End Date",pattern:Kr,value:d,onChange:y=>N(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},ff=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(Ge,{open:s,onOpenChange:o,modal:i,children:[a.jsx(wt,{asChild:!0,dir:r,children:e}),a.jsx($e,{className:m("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),us=e=>a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{...e})}),Mt={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},pf=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],Ne=e=>{if(!e)return"";try{const t=new Date(e);if(!U.isValid(t))return"";const n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}catch{return""}},Wo=e=>{if(!e)return null;try{const t=U.parseISO(e);return U.isValid(t)?U.startOfDay(t):null}catch{return null}},hf=(e,t,n)=>!(t&&e<U.startOfDay(t)||n&&e>U.startOfDay(n)),Bo=e=>U.sub(new Date,{days:e}),qo=e=>e?U.sub(new Date,{days:1}):new Date;function mf({ranges:e=pf,excludeToday:t=!0,current:n,onSelect:r,onReset:s,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...d}){const[c,w]=h.useState(Ne(n==null?void 0:n.from)||Ne(l)),[p,f]=h.useState(Ne(n==null?void 0:n.to)||Ne(u)),[g,b]=h.useState(!1),[v,N]=h.useState(""),[y,C]=h.useState("");h.useEffect(()=>{w(Ne(n==null?void 0:n.from)||Ne(l)),f(Ne(n==null?void 0:n.to)||Ne(u)),N(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const S=h.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const M=U.differenceInCalendarDays(n.to,n.from)+1;return e.find(_=>_.value===M)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),T=h.useCallback(M=>{const _=Bo(M),P=qo(t);w(Ne(_)),f(Ne(P)),N(""),C(""),b(!1),r==null||r({from:_,to:P})},[t,r]),D=h.useCallback((M,_)=>{const P=Wo(M);if(_==="start"?(w(M),N("")):(f(M),C("")),!P){if(M){const L="Please enter a valid date";_==="start"?N(L):C(L)}return}if(!hf(P,l,u)){const L=l&&P<U.startOfDay(l)?`Date must be on or after ${U.format(l,"MMM d, yyyy")}`:`Date must be on or before ${U.format(u,"MMM d, yyyy")}`;_==="start"?N(L):C(L);return}const V=Wo(_==="start"?p:c);_==="start"&&V?P<=V?r==null||r({from:P,to:V}):N("Start date must be before or equal to end date"):_==="end"&&V&&(P>=V?r==null||r({from:V,to:P}):C("End date must be after or equal to start date"))},[c,p,r,l,u]),A=h.useMemo(()=>e.map(M=>{const _=Bo(M.value),P=qo(t);return{...M,displayStartDate:U.format(_,"MMM d, yyyy"),displayEndDate:U.format(P,"MMM d, yyyy")}}),[e,t]),k=g||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!S;return a.jsxs("div",{className:Mt.wuDateRangeNativeSidebar,...d,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>b(!0),"data-selected":k,"aria-pressed":k,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:Mt.customInputs,"data-expanded":k,children:[a.jsxs("div",{className:Mt.inputsRow,children:[a.jsx(Qe,{type:"date",value:c,onChange:M=>D(M.target.value,"start"),Label:"Start",min:Ne(l),max:Ne(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Qe,{type:"date",value:p,onChange:M=>D(M.target.value,"end"),Label:"End",min:c||Ne(l),max:Ne(u),"aria-describedby":y?"end-date-error":void 0})]}),(v||y)&&a.jsxs("div",{className:Mt.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:Mt.errorText,children:v}),y&&a.jsx("p",{id:"end-date-error",className:Mt.errorText,children:y})]})]}),A.map(M=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>T(M.value),"data-selected":!k&&(S==null?void 0:S.value)===M.value,"aria-pressed":!k&&(S==null?void 0:S.value)===M.value,"aria-label":`Select ${M.label}`,children:[M.label," ",a.jsxs("small",{children:["(",M.displayStartDate," - ",M.displayEndDate,")"]})]})},M.value))]}),a.jsxs("footer",{children:[i&&a.jsx(us,{variant:"secondary",Icon:a.jsx(Pe,{icon:"wm-refresh"}),onClick:s,children:"Reset"}),a.jsx(us,{onClick:o,disabled:!!(v||y),children:"Apply"})]})]})}const gf=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:r,minDate:s=U.sub(new Date,{years:5}),maxDate:o=U.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:d,Label:c,labelPosition:w="top",onReset:p,showResetButton:f=!0,placeholder:g="Select Date Range",CustomTrigger:b,native:v,...N})=>{const[y,C]=h.useState(t),[S,T]=h.useState(t),[D,A]=h.useState(""),k=h.useCallback(()=>{if(S){const P=S.from,E=S.to;C({from:P,to:E}),A(`${U.format(P,e)} - ${U.format(E,e)}`),n&&n({from:P,to:E})}},[S,e,n]),M=h.useCallback(()=>{T(y)},[y]),_=h.useCallback(()=>{p?p():(C(void 0),T(void 0),A(""),n&&n(void 0))},[p,n]);return h.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const P=_n(t.from),E=_n(t.to);C(t),T(t),A(`${U.format(P,e)} - ${U.format(E,e)}`)}else C(void 0),T({to:new Date,from:new Date})},[t,e]),a.jsxs(ke,{className:m("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[c,a.jsxs(Ge,{onOpenChange:P=>!P&&M(),children:[a.jsx(Gr,{formattedString:D,dir:i,placeholder:g,CustomTrigger:b,...N}),a.jsx($e,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:"start",sideOffset:-.5,dir:i,children:v?a.jsx(mf,{current:S,onSelect:P=>{T(P)},ranges:d,onApply:k,onReset:_,showResetButton:f,minDate:s,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(wf,{current:S,onSelect:T,presetRanges:d}),a.jsx(jr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:T,disabled:P=>io(P,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:y==null?void 0:y.from,className:m("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(oo,{handleDateChange:k,disabled:r,onReset:_,showResetButton:f})})]})})]})]})},$o=h.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:m("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});$o.displayName="WuCard";const Ho=h.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Ho.displayName="WuCardHeader";const zo=h.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});zo.displayName="WuCardHeader";const Uo=x.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(Dr.Root,{ref:r,className:m("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(Dr.Indicator,{className:m("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Uo.displayName=Dr.Root.displayName;const He=h.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=Vr(),partial:l,onChange:d,required:c,readonly:w,...p}=e;return h.useEffect(()=>{p.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[p.defaultChecked,r]),a.jsxs("div",{className:bf({labelPosition:o,className:"wu-checkbox-container"}),dir:p.dir,children:[a.jsx(Uo,{id:u,...p,partial:l,checked:r,disabled:n||w,onCheckedChange:d,className:m("wu-peer wu-checkbox",i),required:c,ref:t}),s&&a.jsx(ke,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),bf=qe.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"}}});He.displayName="WuCheckbox";const yf=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:m("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},ls=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));ls.displayName=xe.Command.displayName;const jo=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(xe.Command.Input,{ref:n,className:m("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));jo.displayName=xe.Command.Input.displayName;const cs=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.List,{ref:n,className:m("",e),...t}));cs.displayName=xe.Command.List.displayName;const ds=x.forwardRef((e,t)=>a.jsx(xe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ds.displayName=xe.Command.Empty.displayName;const tn=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Group,{ref:n,className:m("",e),...t}));tn.displayName=xe.Command.Group.displayName;const ws=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Separator,{ref:n,className:m("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));ws.displayName=xe.Command.Separator.displayName;const nn=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Item,{ref:n,className:m("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));nn.displayName=xe.Command.Item.displayName;const Go=(e,t,n,r)=>h.useMemo(()=>{if(!e||!n||t.length===0)return t;const s=Array.isArray(n)?n:[n];if(s.length===0)return t;const o=new Set(s.map(d=>String(d[r.value]))),i=[],u=[],l=[];return t.forEach(d=>{const c=d[r.value];c===void 0?i.push(d):o.has(String(c))?u.push(d):l.push(d)}),[...i,...u,...l]},[t,n,r.value,e]),It=h.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(Ha.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));It.displayName="WuVirtualScroll";const vf=({tags:e,triggerRef:t})=>{const[n,r]=h.useState([]),[s,o]=h.useState([]),i=h.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,d)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},d))}),[s]),u=l=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=l,document.body.appendChild(d);const c=d.offsetWidth;return document.body.removeChild(d),c+8};return h.useEffect(()=>{const l=()=>{if(t.current){const p=t.current.offsetWidth-20-36;let f=0;const g=[],b=[];e.forEach(v=>{const N=u(v);f+N+8<p?(g.push(v),f+=N+8):b.push(v)}),r(g),o(b)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,d)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},d)),s.length>0&&a.jsx(Dn,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},xf=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,className:w,...p})=>{const[f,g]=h.useState([]),b=h.useRef(null);h.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){g([]);return}if(i){const N=n;g(N==null?void 0:N.map(y=>y[o.label]));return}else g([n[o.label]])},[n]);const v=()=>{var N;return f.length?c&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((N=b.current)==null?void 0:N.offsetWidth)||0)-32}px`},children:f.join(", ")}):a.jsx(vf,{tags:f,triggerRef:b}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(wt,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...p,ref:b,disabled:l,className:m("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[v(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ko=ne.Root,Yo=ne.Trigger,Xo=ne.Group,Nf=ne.Portal,Sf=ne.Sub,Cf=ne.RadioGroup,Zo=x.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(ne.SubTrigger,{ref:o,className:m("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:m("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:m("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Zo.displayName=ne.SubTrigger.displayName;const Jo=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.SubContent,{ref:n,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));Jo.displayName=ne.SubContent.displayName;const fs=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(ne.Portal,{children:a.jsx(ne.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));fs.displayName=ne.Content.displayName;const Un=x.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(ne.Item,{ref:r,className:m("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Un.displayName=ne.Item.displayName;const Qo=x.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(ne.CheckboxItem,{ref:o,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:m("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(ne.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Qo.displayName=ne.CheckboxItem.displayName;const Ro=x.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(ne.RadioItem,{ref:r,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(ne.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ro.displayName=ne.RadioItem.displayName;const rn=x.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(ne.Label,{ref:r,className:m("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));rn.displayName=ne.Label.displayName;const jn=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.Separator,{ref:n,className:m("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));jn.displayName=ne.Separator.displayName;const ei=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=()=>{e.disabled||r(e)};return a.jsxs(nn,{onSelect:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(He,{checked:l}),a.jsx(Tf,{option:e,accessorKey:s})]})},Tf=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},ti=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(nn,{onSelect:r,className:m("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(He,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(tn,{children:[a.jsx(rn,{children:t.label}),t.options.map((l,d)=>h.createElement(ei,{...i,option:l,key:d}))]});case"divider":return a.jsx(ws,{className:"wu-mx-4"});default:return a.jsx(ei,{...i,option:t})}},Ef=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Mf=h.memo(Qe),If=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:d,onSelect:c,Label:w,maxHeight:p=420,multiple:f=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:N,labelPosition:y="top",className:C,onScroll:S,maxContentWidth:T,enableSearch:D=!0,noDataContent:A,selectedToTop:k=!1,...M})=>{const[_,P]=h.useState(""),[E,V]=h.useState(),[L,O]=h.useState(!1),[W,q]=h.useState(!1),[$,G]=h.useState(!1),Z=h.useRef(null),{allOptions:H,enabledOptions:J}=h.useMemo(()=>g||b&&!b.includeDisabled?Ef(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ie=h.useMemo(()=>{if(!_)return e;const j=_.toLowerCase();return H.filter(ee=>ee[t.label].toLowerCase().includes(j))},[_,H,e,t.label]),fe=h.useMemo(()=>f&&b!=null&&b.enable&&!_&&ie.length>0?[{type:"all"},...ie]:ie,[ie,_,f]),Se=Go(k,fe,E,t),F=h.useCallback(j=>{const ee=j[t.value];f?V(Q=>{const ye=Q||[],Ce=ye.some(Te=>Te[t.value]===ee)?ye.filter(Te=>Te[t.value]!==ee):[...ye,j];return c==null||c(Ce),Ce}):(O(!1),V(j),c==null||c(j))},[f,t.value,c]),z=h.useCallback(j=>P(j.target.value),[]),Y=h.useCallback(()=>P(""),[]);h.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?V(n):r!==void 0&&V(r)},[n,r]),h.useEffect(()=>{if(!f)return;const j=b!=null&&b.includeDisabled?(E==null?void 0:E.length)===H.length:(E==null?void 0:E.length)===J.length;q(j);const ee=(E==null?void 0:E.length)>0&&!j;G(ee)},[E,b]);const K=h.useCallback(()=>{const j=W?[]:b!=null&&b.includeDisabled?H:J;V(j),c==null||c(j)},[W,f,H,J,c,b]),me=kn(y);return a.jsxs("div",{className:m(me,"wu-flex wu-combobox-container"),ref:Z,children:[a.jsxs(Ge,{onOpenChange:j=>{j&&Y(),O(j)},open:L,modal:!0,children:[a.jsx(xf,{selectedOptions:E,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:d,multiple:f,disabled:N,selectAll:b,isCheckedAll:W,className:C,id:v,...M}),a.jsx($e,{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:T},children:a.jsxs(ls,{id:v,children:[D&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Mf,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:z,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),s,a.jsxs(cs,{children:[a.jsx(ds,{children:A||"No results found."}),Se.length>=o?a.jsx(It,{className:"wu-combobox-list",containerHeight:p,list:Se,callback:(j,ee)=>a.jsx(ti,{option:ee,value:E,onSelect:F,multiple:f,accessorKey:t,dir:d,selectAll:b,handleSelectAll:K,isCheckedAll:W,isPartialSelected:$},j),dir:d}):a.jsx("div",{style:{height:"fit-content",maxHeight:p,overflow:"auto"},className:"wu-combobox-list",onScroll:S,children:Se.map(j=>{const ee=j,Q=String(ee[t.value]??ee.type);return a.jsx(ti,{option:ee,value:E,onSelect:F,multiple:f,accessorKey:t,dir:d,selectAll:b,handleSelectAll:K,isCheckedAll:W,isPartialSelected:$},Q)})})]})]})})]}),w&&a.jsx(ke,{htmlFor:v,className:"wu-combobox-label",children:w})]})},Af=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=h.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(Ae,{...r,onClick:i,variant:"iconOnly",className:m("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:m("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(Pe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ni=te.Root,kf=te.Trigger,Df=te.Close,_f=te.Portal,ri=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));ri.displayName=te.Overlay.displayName;const Pf=qe.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"}}),ps=x.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(_f,{children:[a.jsx(ri,{className:s}),a.jsxs(te.Content,{ref:u,className:m(Pf({side:e}),t),...i,children:[n,!r&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ps.displayName=te.Content.displayName;const si=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-semibold",e),...t}));si.displayName=te.Title.displayName;const Vf=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm",e),...t}));Vf.displayName=te.Description.displayName;const Of=e=>t=>{e&&t.preventDefault()},Ff=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:d,closeButtonClassName:c,...w}=e;return a.jsxs(ni,{open:i,onOpenChange:u,children:[a.jsx(kf,{asChild:!0,children:t}),a.jsxs(ps,{onInteractOutside:Of(l),side:o,className:m("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:d,closeButtonClassName:c,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(si,{})}),n]})]})},Lf=({children:e,...t})=>a.jsx(Df,{...t,children:e}),ai=h.createContext({});function hs(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const oi=typeof window<"u"?h.useLayoutEffect:h.useEffect,Gn=h.createContext(null);function Wf(e,t){e.indexOf(t)===-1&&e.push(t)}function Bf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Re=(e,t,n)=>n>t?t:n<e?e:n;function ms(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let sn=()=>{},pt=()=>{};typeof process<"u"&&((yd=process.env)==null?void 0:yd.NODE_ENV)!=="production"&&(sn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ms(t,n))},pt=(e,t,n)=>{if(!e)throw new Error(ms(t,n))});const et={},ii=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qf(e){return typeof e=="object"&&e!==null}const ui=e=>/^0[^.\s]+$/u.test(e);function li(e){let t;return()=>(t===void 0&&(t=e()),t)}const At=e=>e,$f=(e,t)=>n=>t(e(n)),Kn=(...e)=>e.reduce($f),ci=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class di{constructor(){this.subscriptions=[]}add(t){return Wf(this.subscriptions,t),()=>Bf(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Oe=e=>e*1e3,ze=e=>e/1e3;function wi(e,t){return t?e*(1e3/t):0}const fi=new Set;function pi(e,t,n){e||fi.has(t)||(console.warn(ms(t,n)),fi.add(t))}const hi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Hf=1e-7,zf=12;function Uf(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=hi(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Hf&&++u<zf);return i}function an(e,t,n,r){if(e===t&&n===r)return At;const s=o=>Uf(o,0,1,e,n);return o=>o===0||o===1?o:hi(s(o),t,r)}const mi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gi=e=>t=>1-e(1-t),bi=an(.33,1.53,.69,.99),gs=gi(bi),yi=mi(gs),vi=e=>e>=1?1:(e*=2)<1?.5*gs(e):.5*(2-Math.pow(2,-10*(e-1))),bs=e=>1-Math.sin(Math.acos(e)),jf=gi(bs),xi=mi(bs),Gf=an(.42,0,1,1),Kf=an(0,0,.58,1),Ni=an(.42,0,.58,1),Yf=e=>Array.isArray(e)&&typeof e[0]!="number",Si=e=>Array.isArray(e)&&typeof e[0]=="number",Ci={linear:At,easeIn:Gf,easeInOut:Ni,easeOut:Kf,circIn:bs,circInOut:xi,circOut:jf,backIn:gs,backInOut:yi,backOut:bi,anticipate:vi},Xf=e=>typeof e=="string",Ti=e=>{if(Si(e)){pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return an(t,n,r,s)}else if(Xf(e))return pt(Ci[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ci[e];return e},Yn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zf(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(d.schedule(c),e()),c(u)}const d={schedule:(c,w=!1,p=!1)=>{const g=p&&s?n:r;return w&&i.add(c),g.add(c),c},cancel:c=>{r.delete(c),i.delete(c)},process:c=>{if(u=c,s){o=!0;return}s=!0;const w=n;n=r,r=w,n.forEach(l),n.clear(),s=!1,o&&(o=!1,d.process(c))}};return d}const Jf=40;function Ei(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Yn.reduce((C,S)=>(C[S]=Zf(o),C),{}),{setup:u,read:l,resolveKeyframes:d,preUpdate:c,update:w,preRender:p,render:f,postRender:g}=i,b=()=>{const C=et.useManualTiming,S=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,Jf),1)),s.timestamp=S,s.isProcessing=!0,u.process(s),l.process(s),d.process(s),c.process(s),w.process(s),p.process(s),f.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},v=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Yn.reduce((C,S)=>{const T=i[S];return C[S]=(D,A=!1,k=!1)=>(n||v(),T.schedule(D,A,k)),C},{}),cancel:C=>{for(let S=0;S<Yn.length;S++)i[Yn[S]].cancel(C)},state:s,steps:i}}const{schedule:Fe,cancel:ys,state:Xn}=Ei(typeof requestAnimationFrame<"u"?requestAnimationFrame:At,!0);let Zn;function Qf(){Zn=void 0}const _e={now:()=>(Zn===void 0&&_e.set(Xn.isProcessing||et.useManualTiming?Xn.timestamp:performance.now()),Zn),set:e=>{Zn=e,queueMicrotask(Qf)}},Mi=e=>t=>typeof t=="string"&&t.startsWith(e),Ii=Mi("--"),Rf=Mi("var(--"),vs=e=>Rf(e)?ep.test(e.split("/*")[0].trim()):!1,ep=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ai(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const kt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},on={...kt,transform:e=>Re(0,1,e)},Jn={...kt,default:1},un=e=>Math.round(e*1e5)/1e5,xs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tp(e){return e==null}const np=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ns=(e,t)=>n=>!!(typeof n=="string"&&np.test(n)&&n.startsWith(e)||t&&!tp(n)&&Object.prototype.hasOwnProperty.call(n,t)),ki=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(xs);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},rp=e=>Re(0,255,e),Ss={...kt,transform:e=>Math.round(rp(e))},ht={test:Ns("rgb","red"),parse:ki("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ss.transform(e)+", "+Ss.transform(t)+", "+Ss.transform(n)+", "+un(on.transform(r))+")"};function sp(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Cs={test:Ns("#"),parse:sp,transform:ht.transform},ln=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tt=ln("deg"),Dt=ln("%"),B=ln("px"),ap=ln("vh"),op=ln("vw"),Di={...Dt,parse:e=>Dt.parse(e)/100,transform:e=>Dt.transform(e*100)},_t={test:Ns("hsl","hue"),parse:ki("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Dt.transform(un(t))+", "+Dt.transform(un(n))+", "+un(on.transform(r))+")"},de={test:e=>ht.test(e)||Cs.test(e)||_t.test(e),parse:e=>ht.test(e)?ht.parse(e):_t.test(e)?_t.parse(e):Cs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ht.transform(e):_t.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},ip=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function up(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xs))==null?void 0:t.length)||0)+(((n=e.match(ip))==null?void 0:n.length)||0)>0}const _i="number",Pi="color",lp="var",cp="var(",Vi="${}",dp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(dp,l=>(de.test(l)?(r.color.push(o),s.push(Pi),n.push(de.parse(l))):l.startsWith(cp)?(r.var.push(o),s.push(lp),n.push(l)):(r.number.push(o),s.push(_i),n.push(parseFloat(l))),++o,Vi)).split(Vi);return{values:n,split:u,indexes:r,types:s}}function wp(e){return Pt(e).values}function Oi({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===_i?s+=un(r[o]):i===Pi?s+=de.transform(r[o]):s+=r[o]}return s}}function fp(e){return Oi(Pt(e))}const pp=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e,hp=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:pp(e);function mp(e){const t=Pt(e);return Oi(t)(t.values.map((r,s)=>hp(r,t.split[s])))}const Ue={test:up,parse:wp,createTransformer:fp,getAnimatableNone:mp};function Ts(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Ts(l,u,e+1/3),o=Ts(l,u,e),i=Ts(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Qn(e,t){return n=>n>0?t:e}const cn=(e,t,n)=>e+(t-e)*n,Es=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},bp=[Cs,ht,_t],yp=e=>bp.find(t=>t.test(e));function Fi(e){const t=yp(e);if(sn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===_t&&(n=gp(n)),n}const Li=(e,t)=>{const n=Fi(e),r=Fi(t);if(!n||!r)return Qn(e,t);const s={...n};return o=>(s.red=Es(n.red,r.red,o),s.green=Es(n.green,r.green,o),s.blue=Es(n.blue,r.blue,o),s.alpha=cn(n.alpha,r.alpha,o),ht.transform(s))},Ms=new Set(["none","hidden"]);function vp(e,t){return Ms.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function xp(e,t){return n=>cn(e,t,n)}function Is(e){return typeof e=="number"?xp:typeof e=="string"?vs(e)?Qn:de.test(e)?Li:Cp:Array.isArray(e)?Wi:typeof e=="object"?de.test(e)?Li:Np:Qn}function Wi(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Is(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Np(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Is(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Sp(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Cp=(e,t)=>{const n=Ue.createTransformer(t),r=Pt(e),s=Pt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ms.has(e)&&!s.values.length||Ms.has(t)&&!r.values.length?vp(e,t):Kn(Wi(Sp(r,s),s.values),n):(sn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qn(e,t))};function Bi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?cn(e,t,n):Is(e)(e,t)}const Tp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Fe.update(t,n),stop:()=>ys(t),now:()=>Xn.isProcessing?Xn.timestamp:_e.now()}},qi=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Rn=2e4;function As(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Ep(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(As(r),Rn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:ze(s)}}const oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ks(e,t){return e*Math.sqrt(1-t*t)}const Mp=12;function Ip(e,t,n){let r=n;for(let s=1;s<Mp;s++)r=r-e(r)/t(r);return r}const Ds=.001;function Ap({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let s,o;sn(e<=Oe(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Re(oe.minDamping,oe.maxDamping,i),e=Re(oe.minDuration,oe.maxDuration,ze(e)),i<1?(s=d=>{const c=d*i,w=c*e,p=c-n,f=ks(d,i),g=Math.exp(-w);return Ds-p/f*g},o=d=>{const w=d*i*e,p=w*n+n,f=Math.pow(i,2)*Math.pow(d,2)*e,g=Math.exp(-w),b=ks(Math.pow(d,2),i);return(-s(d)+Ds>0?-1:1)*((p-f)*g)/b}):(s=d=>{const c=Math.exp(-d*e),w=(d-n)*e+1;return-Ds+c*w},o=d=>{const c=Math.exp(-d*e),w=(n-d)*(e*e);return c*w});const u=5/e,l=Ip(s,o,u);if(e=Oe(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const kp=["duration","bounce"],Dp=["stiffness","damping","mass"];function $i(e,t){return t.some(n=>e[n]!==void 0)}function _p(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!$i(e,Dp)&&$i(e,kp))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Re(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:oe.mass,stiffness:s,damping:o}}else{const n=Ap({...e,velocity:0});t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function er(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:d,mass:c,duration:w,velocity:p,isResolvedFromDuration:f}=_p({...n,velocity:-ze(n.velocity||0)}),g=p||0,b=d/(2*Math.sqrt(l*c)),v=i-o,N=ze(Math.sqrt(l/c)),y=Math.abs(v)<5;r||(r=y?oe.restSpeed.granular:oe.restSpeed.default),s||(s=y?oe.restDelta.granular:oe.restDelta.default);let C,S,T,D,A,k;if(b<1)T=ks(N,b),D=(g+b*N*v)/T,C=_=>{const P=Math.exp(-b*N*_);return i-P*(D*Math.sin(T*_)+v*Math.cos(T*_))},A=b*N*D+v*T,k=b*N*v-D*T,S=_=>Math.exp(-b*N*_)*(A*Math.sin(T*_)+k*Math.cos(T*_));else if(b===1){C=P=>i-Math.exp(-N*P)*(v+(g+N*v)*P);const _=g+N*v;S=P=>Math.exp(-N*P)*(N*_*P-g)}else{const _=N*Math.sqrt(b*b-1);C=L=>{const O=Math.exp(-b*N*L),W=Math.min(_*L,300);return i-O*((g+b*N*v)*Math.sinh(W)+_*v*Math.cosh(W))/_};const P=(g+b*N*v)/_,E=b*N*P-v*_,V=b*N*v-P*_;S=L=>{const O=Math.exp(-b*N*L),W=Math.min(_*L,300);return O*(E*Math.sinh(W)+V*Math.cosh(W))}}const M={calculatedDuration:f&&w||null,velocity:_=>Oe(S(_)),next:_=>{if(!f&&b<1){const E=Math.exp(-b*N*_),V=Math.sin(T*_),L=Math.cos(T*_),O=i-E*(D*V+v*L),W=Oe(E*(A*V+k*L));return u.done=Math.abs(W)<=r&&Math.abs(i-O)<=s,u.value=u.done?i:O,u}const P=C(_);if(f)u.done=_>=w;else{const E=Oe(S(_));u.done=Math.abs(E)<=r&&Math.abs(i-P)<=s}return u.value=u.done?i:P,u},toString:()=>{const _=Math.min(As(M),Rn),P=qi(E=>M.next(_*E).value,_,30);return _+"ms "+P},toTransition:()=>{}};return M}er.applyToOptions=e=>{const t=Ep(e,100,er);return e.ease=t.ease,e.duration=Oe(t.duration),e.type="keyframes",e};const Pp=5;function Hi(e,t,n){const r=Math.max(t-Pp,0);return wi(n-e(r),t-r)}function _s({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:d=.5,restSpeed:c}){const w=e[0],p={done:!1,value:w},f=k=>u!==void 0&&k<u||l!==void 0&&k>l,g=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let b=n*t;const v=w+b,N=i===void 0?v:i(v);N!==v&&(b=N-w);const y=k=>-b*Math.exp(-k/r),C=k=>N+y(k),S=k=>{const M=y(k),_=C(k);p.done=Math.abs(M)<=d,p.value=p.done?N:_};let T,D;const A=k=>{f(p.value)&&(T=k,D=er({keyframes:[p.value,g(p.value)],velocity:Hi(C,k,p.value),damping:s,stiffness:o,restDelta:d,restSpeed:c}))};return A(0),{calculatedDuration:null,next:k=>{let M=!1;return!D&&T===void 0&&(M=!0,S(k),A(k)),T!==void 0&&k>=T?D.next(k-T):(!M&&S(k),p)}}}function Vp(e,t,n){const r=[],s=n||et.mix||Bi,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||At:t;u=Kn(l,u)}r.push(u)}return r}function Op(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(pt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Vp(t,r,s),l=u.length,d=c=>{if(i&&c<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(c<e[w+1]);w++);const p=ci(e[w],e[w+1],c);return u[w](p)};return n?c=>d(Re(e[0],e[o-1],c)):d}function Fp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ci(0,t,r);e.push(cn(n,1,s))}}function Lp(e){const t=[0];return Fp(t,e.length-1),t}function Wp(e,t){return e.map(n=>n*t)}function Bp(e,t){return e.map(()=>t||Ni).splice(0,e.length-1)}function Vt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Yf(r)?r.map(Ti):Ti(r),o={done:!1,value:t[0]},i=Wp(n&&n.length===t.length?n:Lp(t),e),u=Op(i,t,{ease:Array.isArray(s)?s:Bp(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const qp=e=>e!==null;function tr(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(qp),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const $p={decay:_s,inertia:_s,tween:Vt,keyframes:Vt,spring:er};function zi(e){typeof e.type=="string"&&(e.type=$p[e.type])}class Ps{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Hp=e=>e/100;class nr extends Ps{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==_e.now()&&this.tick(_e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;zi(t);const{type:n=Vt,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||Vt;process.env.NODE_ENV!=="production"&&l!==Vt&&pt(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==Vt&&typeof u[0]!="number"&&(this.mixKeyframes=Kn(Hp,Bi(u[0],u[1])),u=[0,100]);const d=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=As(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:c,repeat:w,repeatType:p,repeatDelay:f,type:g,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-d*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,S=r;if(w){const k=Math.min(this.currentTime,s)/u;let M=Math.floor(k),_=k%1;!_&&k>=1&&(_=1),_===1&&M--,M=Math.min(M,w+1),!!(M%2)&&(p==="reverse"?(_=1-_,f&&(_-=f/u)):p==="mirror"&&(S=i)),C=Re(0,1,_)*u}let T;y?(this.delayState.value=c[0],T=this.delayState):T=S.next(C),o&&!y&&(T.value=o(T.value));let{done:D}=T;!y&&l!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return A&&g!==_s&&(T.value=tr(c,this.options,v,this.speed)),b&&b(T.value),A&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return ze(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(this.currentTime)}set time(t){t=Oe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Hi(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(_e.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ze(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Tp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function zp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const mt=e=>e*180/Math.PI,Vs=e=>{const t=mt(Math.atan2(e[1],e[0]));return Os(t)},Up={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vs,rotateZ:Vs,skewX:e=>mt(Math.atan(e[1])),skewY:e=>mt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Os=e=>(e=e%360,e<0&&(e+=360),e),Ui=Vs,ji=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),jp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ji,scaleY:Gi,scale:e=>(ji(e)+Gi(e))/2,rotateX:e=>Os(mt(Math.atan2(e[6],e[5]))),rotateY:e=>Os(mt(Math.atan2(-e[2],e[0]))),rotateZ:Ui,rotate:Ui,skewX:e=>mt(Math.atan(e[4])),skewY:e=>mt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Fs(e){return e.includes("scale")?1:0}function Ls(e,t){if(!e||e==="none")return Fs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=jp,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Up,s=u}if(!s)return Fs(t);const o=r[t],i=s[1].split(",").map(Kp);return typeof o=="function"?o(i):i[o]}const Gp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ls(n,t)};function Kp(e){return parseFloat(e.trim())}const Ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ft=new Set(Ot),Ki=e=>e===kt||e===B,Yp=new Set(["x","y","z"]),Xp=Ot.filter(e=>!Yp.has(e));function Zp(e){const t=[];return Xp.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ls(t,"x"),y:(e,{transform:t})=>Ls(t,"y")};nt.translateX=nt.x,nt.translateY=nt.y;const gt=new Set;let Ws=!1,Bs=!1,qs=!1;function Yi(){if(Bs){const e=Array.from(gt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Zp(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Bs=!1,Ws=!1,gt.forEach(e=>e.complete(qs)),gt.clear()}function Xi(){gt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bs=!0)})}function Jp(){qs=!0,Xi(),Yi(),qs=!1}class $s{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(gt.add(this),Ws||(Ws=!0,Fe.read(Xi),Fe.resolveKeyframes(Yi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}zp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gt.delete(this)}cancel(){this.state==="scheduled"&&(gt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Qp=e=>e.startsWith("--");function Zi(e,t,n){Qp(t)?e.style.setProperty(t,n):e.style[t]=n}const Rp={};function Ji(e,t){const n=li(e);return()=>Rp[t]??n()}const eh=Ji(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Qi=Ji(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dn([0,.65,.55,1]),circOut:dn([.55,0,1,.45]),backIn:dn([.31,.01,.66,-.59]),backOut:dn([.33,1.53,.69,.99])};function eu(e,t){if(e)return typeof e=="function"?Qi()?qi(e,t):"ease-out":Si(e)?dn(e):Array.isArray(e)?e.map(n=>eu(n,t)||Ri.easeOut):Ri[e]}function th(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},d=void 0){const c={[t]:n};l&&(c.offset=l);const w=eu(u,s);Array.isArray(w)&&(c.easing=w);const p={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),e.animate(c,p)}function tu(e){return typeof e=="function"&&"applyToOptions"in e}function nh({type:e,...t}){return tu(e)&&Qi()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class nu extends Ps{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=nh(t);this.animation=th(n,r,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=tr(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Zi(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ze(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ze(t)}get time(){return ze(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Oe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&eh()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),At):s(this)}}const ru={anticipate:vi,backInOut:yi,circInOut:xi};function rh(e){return e in ru}function sh(e){typeof e.ease=="string"&&rh(e.ease)&&(e.ease=ru[e.ease])}const Hs=10;class ah extends nu{constructor(t){sh(t),zi(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new nr({...i,autoplay:!1}),l=Math.max(Hs,_e.now()-this.startTime),d=Re(0,Hs,l-Hs),c=u.sample(l).value,{name:w}=this.options;o&&w&&Zi(o,w,c),n.setWithVelocity(u.sample(Math.max(0,l-d)).value,c,d),u.stop()}}const su=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ue.test(e)||e==="0")&&!e.startsWith("url("));function oh(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ih(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=su(s,t),u=su(o,t);return sn(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:oh(e)||(n==="spring"||tu(n))&&r}function zs(e){e.duration=0,e.type="keyframes"}const au=new Set(["opacity","clipPath","filter","transform"]),uh=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lh(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&uh.test(e[t]))return!0;return!1}const ch=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),dh=li(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wh(e){var w;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:u}=e;if(!(((w=t==null?void 0:t.owner)==null?void 0:w.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:c}=t.owner.getProps();return dh()&&n&&(au.has(n)||ch.has(n)&&lh(u))&&(n!=="transform"||!c)&&!d&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const fh=40;class ph extends Ps{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:d,element:c,...w}){var g;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=_e.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:d,element:c,...w},f=(c==null?void 0:c.KeyframeResolver)||$s;this.keyframeResolver=new f(u,(b,v,N)=>this.onKeyframesResolved(b,v,p,!N),l,d,c),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,s){var N,y;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:d,onUpdate:c}=r;this.resolvedAt=_e.now();let w=!0;ih(t,o,i,u)||(w=!1,(et.instantAnimations||!l)&&(c==null||c(tr(t,r,n))),t[0]=t[t.length-1],zs(r),r.repeat=0);const f={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>fh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=w&&!d&&wh(f),b=(y=(N=f.motionValue)==null?void 0:N.owner)==null?void 0:y.current;let v;if(g)try{v=new ah({...f,element:b})}catch{v=new nr(f)}else v=new nr(f);v.finished.then(()=>{this.notifyFinished()}).catch(At),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Jp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function ou(e,t,n,r=0,s=1){const o=Array.from(e).sort((d,c)=>d.sortNodePosition(c)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}const hh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mh(e){const t=hh.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const gh=4;function iu(e,t,n=1){pt(n<=gh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=mh(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return ii(i)?parseFloat(i):i}return vs(s)?iu(s,t,n+1):s}const bh={type:"spring",stiffness:500,damping:25,restSpeed:10},yh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),vh={type:"keyframes",duration:.8},xh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Nh=(e,{keyframes:t})=>t.length>2?vh:Ft.has(e)?e.startsWith("scale")?yh(t[1]):bh:xh;function uu(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function lu(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?uu(n,e):n}const Sh=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ch(e){for(const t in e)if(!Sh.has(t))return!0;return!1}const Th=(e,t,n,r={},s,o)=>i=>{const u=lu(r,e)||{},l=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Oe(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:p=>{t.set(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Ch(u)||Object.assign(c,Nh(e,c)),c.duration&&(c.duration=Oe(c.duration)),c.repeatDelay&&(c.repeatDelay=Oe(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let w=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(zs(c),c.delay===0&&(w=!0)),(et.instantAnimations||et.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(w=!0,zs(c),c.delay=0),c.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const p=tr(c.keyframes,u);if(p!==void 0){Fe.update(()=>{c.onUpdate(p),c.onComplete()});return}}return u.isSync?new nr(c):new ph(c)};function cu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Us(e,t,n,r){if(typeof t=="function"){const[s,o]=cu(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=cu(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function bt(e,t,n){const r=e.getProps();return Us(r,t,n!==void 0?n:r.custom,e)}const du=new Set(["width","height","top","left","right","bottom",...Ot]),wu=30,Eh=e=>!isNaN(parseFloat(e));class Mh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=_e.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=_e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Eh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&pi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new di);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=_e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wu);return wi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rr(e,t){return new Mh(e,t)}const js=e=>Array.isArray(e);function Ih(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rr(n))}function Ah(e){return js(e)?e[e.length-1]||0:e}function kh(e,t){const n=bt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Ah(o[i]);Ih(e,i,u)}}const be=e=>!!(e&&e.getVelocity);function Dh(e){return!!(be(e)&&e.add)}function _h(e,t){const n=e.getValue("willChange");if(Dh(n))return n.add(t);if(!n&&et.WillChange){const r=new et.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Gs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const fu="data-"+Gs("framerAppearId");function Ph(e){return e.props[fu]}function Vh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function pu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?uu(o,l):l;const d=o==null?void 0:o.reduceMotion;r&&(o=r);const c=[],w=s&&e.animationState&&e.animationState.getState()[s];for(const p in u){const f=e.getValue(p,e.latestValues[p]??null),g=u[p];if(g===void 0||w&&Vh(w,p))continue;const b={delay:n,...lu(o||{},p)},v=f.get();if(v!==void 0&&!f.isAnimating()&&!Array.isArray(g)&&g===v&&!b.velocity){Fe.update(()=>f.set(g));continue}let N=!1;if(window.MotionHandoffAnimation){const S=Ph(e);if(S){const T=window.MotionHandoffAnimation(S,p,Fe);T!==null&&(b.startTime=T,N=!0)}}_h(e,p);const y=d??e.shouldReduceMotion;f.start(Th(p,f,g,y&&du.has(p)?{type:!1}:b,e,N));const C=f.animation;C&&c.push(C)}if(i){const p=()=>Fe.update(()=>{i&&kh(e,i)});c.length?Promise.all(c).then(p):p()}return c}function Ks(e,t,n={}){var l;const r=bt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(pu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:w,staggerDirection:p}=s;return Oh(e,t,d,c,w,p,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,c]=u==="beforeChildren"?[o,i]:[i,o];return d().then(()=>c())}else return Promise.all([o(),i(n.delay)])}function Oh(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(Ks(l,t,{...i,delay:n+(typeof r=="function"?0:r)+ou(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function Fh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Ks(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Ks(e,t,n);else{const s=typeof t=="function"?bt(e,t,n.custom):t;r=Promise.all(pu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Lh={test:e=>e==="auto",parse:e=>e},hu=e=>t=>t.test(e),mu=[kt,B,Dt,tt,op,ap,Lh],gu=e=>mu.find(hu(e));function Wh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ui(e):!0}const Bh=new Set(["brightness","contrast","saturate","opacity"]);function qh(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xs)||[];if(!r)return e;const s=n.replace(r,"");let o=Bh.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const $h=/\b([a-z-]*)\(.*?\)/gu,Ys={...Ue,getAnimatableNone:e=>{const t=e.match($h);return t?t.map(qh).join(" "):e}},Xs={...Ue,getAnimatableNone:e=>{const t=Ue.parse(e);return Ue.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},bu={...kt,transform:Math.round},Zs={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...{rotate:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Jn,scaleX:Jn,scaleY:Jn,scaleZ:Jn,skew:tt,skewX:tt,skewY:tt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:on,originX:Di,originY:Di,originZ:B},zIndex:bu,fillOpacity:on,strokeOpacity:on,numOctaves:bu},Hh={...Zs,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Ys,WebkitFilter:Ys,mask:Xs,WebkitMask:Xs},yu=e=>Hh[e],zh=new Set([Ys,Xs]);function vu(e,t){let n=yu(e);return zh.has(n)||(n=Ue),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Uh=new Set(["auto","none","0"]);function jh(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!Uh.has(o)&&Pt(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=vu(n,s)}class Gh extends $s{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let w=t[c];if(typeof w=="string"&&(w=w.trim(),vs(w))){const p=iu(w,n.current);p!==void 0&&(t[c]=p),c===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!du.has(r)||t.length!==2)return;const[s,o]=t,i=gu(s),u=gu(o),l=Ai(s),d=Ai(o);if(l!==d&&nt[r]){this.needsMeasurement=!0;return}if(i!==u)if(Ki(i)&&Ki(u))for(let c=0;c<t.length;c++){const w=t[c];typeof w=="string"&&(t[c]=parseFloat(w))}else nt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Wh(t[s]))&&r.push(s);r.length&&jh(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=nt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Kh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const xu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sr(e){return qf(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Yh}=Ei(queueMicrotask,!1),Xh={y:!1};function Zh(){return Xh.y}function Nu(e,t){const n=Kh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Jh(e){return!(e.pointerType==="touch"||Zh())}function Qh(e,t,n={}){const[r,s,o]=Nu(e,n);return r.forEach(i=>{let u=!1,l=!1,d;const c=()=>{i.removeEventListener("pointerleave",g)},w=v=>{d&&(d(v),d=void 0),c()},p=v=>{u=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,w(v))},f=()=>{u=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},g=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},b=v=>{if(!Jh(v))return;l=!1;const N=t(i,v);typeof N=="function"&&(d=N,i.addEventListener("pointerleave",g,s))};i.addEventListener("pointerenter",b,s),i.addEventListener("pointerdown",f,s)}),o}const Su=(e,t)=>t?e===t?!0:Su(e,t.parentElement):!1,Rh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,em=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function tm(e){return em.has(e.tagName)||e.isContentEditable===!0}const ar=new WeakSet;function Cu(e){return t=>{t.key==="Enter"&&e(t)}}function Js(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const nm=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Cu(()=>{if(ar.has(n))return;Js(n,"down");const s=Cu(()=>{Js(n,"up")}),o=()=>Js(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Tu(e){return Rh(e)&&!0}const Eu=new WeakSet;function rm(e,t,n={}){const[r,s,o]=Nu(e,n),i=u=>{const l=u.currentTarget;if(!Tu(u)||Eu.has(u))return;ar.add(l),n.stopPropagation&&Eu.add(u);const d=t(l,u),c=(f,g)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",p),ar.has(l)&&ar.delete(l),Tu(f)&&typeof d=="function"&&d(f,{success:g})},w=f=>{c(f,l===window||l===document||n.useGlobalTarget||Su(l,f.target))},p=f=>{c(f,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",p,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),sr(u)&&(u.addEventListener("focus",d=>nm(d,s)),!tm(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const sm=[...mu,de,Ue],am=e=>sm.find(hu(e)),Mu=()=>({min:0,max:0}),Iu=()=>({x:Mu(),y:Mu()}),om=new WeakMap;function or(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wn(e){return typeof e=="string"||Array.isArray(e)}const Qs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rs=["initial",...Qs];function ir(e){return or(e.animate)||Rs.some(t=>wn(e[t]))}function Au(e){return!!(ir(e)||e.variants)}function im(e,t,n){for(const r in t){const s=t[r],o=n[r];if(be(s))e.addValue(r,s);else if(be(o))e.addValue(r,rr(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,rr(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ea={current:null},ku={current:!1},um=typeof window<"u";function lm(){if(ku.current=!0,!!um)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ea.current=e.matches;e.addEventListener("change",t),t()}else ea.current=!1}const Du=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ur={};function _u(e){ur=e}function cm(){return ur}class dm{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$s,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=_e.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Fe.render(this.render,!1,!0))};const{latestValues:d,renderState:c}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ir(n),this.isVariantNode=Au(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in p){const g=p[f];d[f]!==void 0&&be(g)&&g.set(d[f])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,om.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ku.current||lm(),this.shouldReduceMotion=ea.current),process.env.NODE_ENV!=="production"&&pi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ys(this.notifyUpdate),ys(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&au.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:d,duration:c}=n.accelerate,w=new nu({element:this.current,name:t,keyframes:u,times:l,ease:d,duration:Oe(c)}),p=i(w);this.valueSubscriptions.set(t,()=>{p(),w.cancel()});return}const r=Ft.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Fe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ur){const n=ur[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Iu()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Du.length;r++){const s=Du[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=im(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ii(r)||ui(r))?r=parseFloat(r):!am(r)&&Ue.test(n)&&(r=vu(t,n)),this.setBaseTarget(t,be(r)?r.get():r)),be(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Us(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!be(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new di),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Yh.render(this.render)}}class Pu extends dm{constructor(){super(...arguments),this.KeyframeResolver=Gh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;be(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Lt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function wm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function fm(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pm(e,t){return wm(fm(e.getBoundingClientRect(),t))}const hm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mm=Ot.length;function gm(e,t,n){let r="",s=!0;for(let o=0;o<mm;o++){const i=Ot[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const d=parseFloat(u);l=i.startsWith("scale")?d===1:d===0}if(!l||n){const d=xu(u,Zs[i]);if(!l){s=!1;const c=hm[i]||i;r+=`${c}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ta(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const d=t[l];if(Ft.has(l)){i=!0;continue}else if(Ii(l)){s[l]=d;continue}else{const c=xu(d,Zs[l]);l.startsWith("origin")?(u=!0,o[l]=c):r[l]=c}}if(t.transform||(i||n?r.transform=gm(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:d="50%",originZ:c=0}=o;r.transformOrigin=`${l} ${d} ${c}`}}function Vu(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Ou(e,t.target.x),r=Ou(e,t.target.y);return`${n}% ${r}%`}},bm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ue.parse(e);if(s.length>5)return r;const o=Ue.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const d=cn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=d),typeof s[3+i]=="number"&&(s[3+i]/=d),o(s)}},ym={borderRadius:{...fn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomLeftRadius:fn,borderBottomRightRadius:fn,boxShadow:bm};function Fu(e,{layout:t,layoutId:n}){return Ft.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ym[e]||e==="opacity")}function na(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const u in r)(be(r[u])||s&&be(s[u])||Fu(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=r[u]);return o}function vm(e){return window.getComputedStyle(e)}class xm extends Pu{constructor(){super(...arguments),this.type="html",this.renderInstance=Vu}readValueFromInstance(t,n){var r;if(Ft.has(n))return(r=this.projection)!=null&&r.isProjecting?Fs(n):Gp(t,n);{const s=vm(t),o=(Ii(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pm(t,n)}build(t,n,r){ta(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return na(t,n,r)}}const Nm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sm={offset:"strokeDashoffset",array:"strokeDasharray"};function Cm(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?Nm:Sm;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const Tm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Lu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,d,c){if(ta(e,u,d),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:p}=e;w.transform&&(p.transform=w.transform,delete w.transform),(p.transform||w.transformOrigin)&&(p.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),p.transform&&(p.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete w.transformBox);for(const f of Tm)w[f]!==void 0&&(p[f]=w[f],delete w[f]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&Cm(w,s,o,i,!1)}const Wu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Bu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Em(e,t,n,r){Vu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Wu.has(s)?s:Gs(s),t.attrs[s])}function qu(e,t,n){const r=na(e,t,n);for(const s in e)if(be(e[s])||be(t[s])){const o=Ot.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class Mm extends Pu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Iu}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ft.has(n)){const r=yu(n);return r&&r.default||0}return n=Wu.has(n)?n:Gs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qu(t,n,r)}build(t,n,r){Lu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Em(t,n,r,s)}mount(t){this.isSVGTag=Bu(t.tagName),super.mount(t)}}const Im=Rs.length;function $u(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$u(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Im;n++){const r=Rs[n],s=e.props[r];(wn(s)||s===!1)&&(t[r]=s)}return t}function Hu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Am=[...Qs].reverse(),km=Qs.length;function Dm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Fh(e,n,r)))}function _m(e){let t=Dm(e),n=zu(),r=!0,s=!1;const o=d=>(c,w)=>{var f;const p=bt(e,w,d==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(p){const{transition:g,transitionEnd:b,...v}=p;c={...c,...v,...b}}return c};function i(d){t=d(e)}function u(d){const{props:c}=e,w=$u(e.parent)||{},p=[],f=new Set;let g={},b=1/0;for(let N=0;N<km;N++){const y=Am[N],C=n[y],S=c[y]!==void 0?c[y]:w[y],T=wn(S),D=y===d?C.isActive:null;D===!1&&(b=N);let A=S===w[y]&&S!==c[y]&&T;if(A&&(r||s)&&e.manuallyAnimateOnMount&&(A=!1),C.protectedKeys={...g},!C.isActive&&D===null||!S&&!C.prevProp||or(S)||typeof S=="boolean")continue;if(y==="exit"&&C.isActive&&D!==!0){C.prevResolvedValues&&(g={...g,...C.prevResolvedValues});continue}const k=Pm(C.prevProp,S);let M=k||y===d&&C.isActive&&!A&&T||N>b&&T,_=!1;const P=Array.isArray(S)?S:[S];let E=P.reduce(o(y),{});D===!1&&(E={});const{prevResolvedValues:V={}}=C,L={...V,...E},O=$=>{M=!0,f.has($)&&(_=!0,f.delete($)),C.needsAnimating[$]=!0;const G=e.getValue($);G&&(G.liveStyle=!1)};for(const $ in L){const G=E[$],Z=V[$];if(g.hasOwnProperty($))continue;let H=!1;js(G)&&js(Z)?H=!Hu(G,Z):H=G!==Z,H?G!=null?O($):f.add($):G!==void 0&&f.has($)?O($):C.protectedKeys[$]=!0}C.prevProp=S,C.prevResolvedValues=E,C.isActive&&(g={...g,...E}),(r||s)&&e.blockInitialAnimation&&(M=!1);const W=A&&k;M&&(!W||_)&&p.push(...P.map($=>{const G={type:y};if(typeof $=="string"&&(r||s)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,H=bt(Z,$);if(Z.enteringChildren&&H){const{delayChildren:J}=H.transition||{};G.delay=ou(Z.enteringChildren,e,J)}}return{animation:$,options:G}}))}if(f.size){const N={};if(typeof c.initial!="boolean"){const y=bt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(N.transition=y.transition)}f.forEach(y=>{const C=e.getBaseTarget(y),S=e.getValue(y);S&&(S.liveStyle=!0),N[y]=C??null}),p.push({animation:N})}let v=!!p.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(p):Promise.resolve()}function l(d,c){var p;if(n[d].isActive===c)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(f=>{var g;return(g=f.animationState)==null?void 0:g.setActive(d,c)}),n[d].isActive=c;const w=u(d);for(const f in n)n[f].protectedKeys={};return w}return{animateChanges:u,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=zu(),s=!0}}}function Pm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hu(t,e):!1}function yt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zu(){return{animate:yt(!0),whileInView:yt(),whileHover:yt(),whileTap:yt(),whileDrag:yt(),whileFocus:yt(),exit:yt()}}function Uu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Vm(e){return be(e)?e.get():e}const ra=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ju(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Om(...e){return t=>{let n=!1;const r=e.map(s=>{const o=ju(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():ju(e[s],null)}}}}function Fm(...e){return x.useCallback(Om(...e),e)}class Lm extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(sr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=sr(r)&&r.offsetWidth||0,o=sr(r)&&r.offsetHeight||0,i=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(i.height),u.width=parseFloat(i.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Wm({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:o}){var p;const i=h.useId(),u=h.useRef(null),l=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=h.useContext(ra),c=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),w=Fm(u,c);return h.useInsertionEffect(()=>{const{width:f,height:g,top:b,left:v,right:N,bottom:y}=l.current;if(t||o===!1||!u.current||!f||!g)return;const C=n==="left"?`left: ${v}`:`right: ${N}`,S=r==="bottom"?`bottom: ${y}`:`top: ${b}`;u.current.dataset.motionPopId=i;const T=document.createElement("style");d&&(T.nonce=d);const D=s??document.head;return D.appendChild(T),T.sheet&&T.sheet.insertRule(`
7
+ `))},[JSON.stringify(t)])}const l=x.useCallback(d=>{s||i(d)},[]);return[u,l]}function _o(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:o}=Rr(),i=yo(t),u=n?s:void 0,l=Je(()=>Symbol("labelable-control")),d=x.useRef(!1),c=x.useRef(t!=null),w=ge(()=>{!d.current||o===Ve||(d.current=!1,o(l.current,void 0))});return re(()=>{if(o===Ve)return;let p;if(n){const f=r==null?void 0:r.current;jw(f)&&f.closest("label")!=null?p=t??null:p=u??i}else if(t!=null)c.current=!0,p=t;else if(c.current)p=i;else{w();return}if(p===void 0){w();return}d.current=!0,o(l.current,p)},[t,r,u,o,n,i,l,w]),x.useEffect(()=>w,[w]),s??i}function Po(e){const{enabled:t=!0,value:n,id:r,name:s,controlRef:o,commit:i}=e,{formRef:u}=fo(),{invalid:l,markedDirtyRef:d,validityData:c,setValidityData:w}=Vn(),p=ge(e.getValue);re(()=>{if(!t)return;let f=n;f===void 0&&(f=p()),c.initialValue===null&&f!==null&&w(g=>({...g,initialValue:f}))},[t,w,n,c.initialValue,p]),re(()=>{!t||!r||u.current.fields.set(r,{getValue:p,name:s,controlRef:o,validityData:zw(c,l),validate(f=!0){let g=n;g===void 0&&(g=p()),d.current=!0,f?ja.flushSync(()=>i(g)):i(g)}})},[i,o,t,u,p,r,l,d,s,c,n]),re(()=>{const f=u.current.fields;return()=>{r&&f.delete(r)}},[u,r])}const Jt="none",uf="trigger-press",lf="increment-press",cf="decrement-press",os="input-change",Qt="input-clear",Hn="input-blur",is="input-paste",Rt="keyboard";function De(e,t,n,r){let s=!1,o=!1;const i=r??Ke;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function en(e,t,n){const r=Ke;return{reason:e,event:t??new Event("base-ui"),...r}}const Vo=x.forwardRef(function(t,n){const{render:r,className:s,id:o,name:i,value:u,disabled:l=!1,onValueChange:d,defaultValue:c,autoFocus:w=!1,...p}=t,{state:f,name:g,disabled:b,setTouched:v,setDirty:N,validityData:y,setFocused:C,setFilled:S,validationMode:T,validation:D}=Vn(),A=b||l,k=g??i,M={...f,disabled:A},{labelId:_}=Rr(),P=_o({id:o});re(()=>{var $;const q=u!=null;($=D.inputRef.current)!=null&&$.value||q&&u!==""?S(!0):q&&u===""&&S(!1)},[D.inputRef,S,u]);const E=x.useRef(null);re(()=>{w&&E.current===Rw(Mo(E.current))&&C(!0)},[w,C]);const[V]=as({controlled:u,default:c,name:"FieldControl",state:"value"}),L=u!==void 0,O=L?V:void 0;return Po({id:P,name:k,commit:D.commit,value:O,getValue:()=>{var q;return(q=D.inputRef.current)==null?void 0:q.value},controlRef:D.inputRef}),Ye("input",t,{ref:[n,E],state:M,props:[{id:P,disabled:A,name:k,ref:D.inputRef,"aria-labelledby":_,autoFocus:w,...L?{value:O}:{defaultValue:c},onChange(q){const $=q.currentTarget.value;d==null||d($,De(Jt,q.nativeEvent)),N($!==y.initialValue),S($!=="")},onFocus(){C(!0)},onBlur(q){v(!0),C(!1),T==="onBlur"&&D.commit(q.currentTarget.value)},onKeyDown(q){q.currentTarget.tagName==="INPUT"&&q.key==="Enter"&&(v(!0),D.commit(q.currentTarget.value))}},D.getInputValidationProps(),p],stateAttributesMapping:Xr})});process.env.NODE_ENV!=="production"&&(Vo.displayName="FieldControl");const Oo=x.forwardRef(function(t,n){return a.jsx(Vo,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(Oo.displayName="Input");const Un={wuInputGroup:"_wuInputGroup_1t4ep_1",wuInputIcon:"_wuInputIcon_1t4ep_20",wuInput:"_wuInput_1t4ep_1",passwordToggle:"_passwordToggle_1t4ep_89"},Fo=h.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:r})=>{const s=h.useCallback(i=>{if(n||r){i.preventDefault(),i.stopPropagation();return}t()},[n,r,t]),o=n||r;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:Un.passwordToggle,onClick:s,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(Pe,{icon:e?"wm-visibility":"wm-visibility-off"})})});Fo.displayName="PasswordToggle";const Qe=h.memo(h.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:r,iconPosition:s="left",variant:o="flat",type:i,readonly:u,invalid:l,id:d,...c},w)=>{const p=h.useId(),f=d||p;if(i==="submit")return a.jsx(Ae,{className:e,id:f,"aria-label":c["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:c.disabled,children:t||"Submit"});const[g,b]=h.useState(!1),v=h.useCallback(()=>{b(T=>!T)},[]),{finalIcon:N,finalIconPosition:y}=h.useMemo(()=>i==="password"?{finalIcon:a.jsx(Fo,{showPassword:g,onToggle:v,readOnly:u,disabled:c.disabled}),finalIconPosition:"right"}:{finalIcon:r,finalIconPosition:s},[i,r,s,g,v]),C=h.useMemo(()=>i==="password"&&g?"text":i,[i,g]),S=h.useMemo(()=>m(Un.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:Un.wuInputGroup,"data-label-position":n,"data-icon-position":N&&y,children:[N&&a.jsx("span",{className:Un.wuInputIcon,children:N}),a.jsx(Oo,{ref:w,className:S,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:f,...c}),t&&a.jsx(ke,{htmlFor:f,children:t})]})}));Qe.displayName="WuInput";const Lo="yyyy-MM-dd",df=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],wf=({current:e,onSelect:t,presetRanges:n=dw})=>{const[r,s]=h.useState(),[o,i]=h.useState(!1),[u,l]=h.useState(""),[d,c]=h.useState(""),[w,p]=h.useState(!1),f=h.useMemo(()=>n.map(y=>y.value),[n]),g=m("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"),b=h.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const C=Number(y)-1;s(C),i(!1),t({from:z.sub(new Date,{days:C}),to:new Date})},[t]),v=h.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Kr).test(y))return!1;const T=new Date(C==="start"?y:e.from),D=new Date(C==="end"?y:e.to);return z.isBefore(D,T)?(p(!0),!1):(p(!1),!(z.isSameDay(T,e.from)&&z.isSameDay(D,e.to)))},[e]),N=h.useCallback((y,C)=>{if((C==="start"?l:c)(y),v(y,C)){const T={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(T.from=new Date(y)),C==="end"&&(T.to=new Date(y)),t(T)}},[e,t,v]);return h.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&z.isValid(e.to)&&z.isValid(e.from)){l(z.format(e.from,Lo)),c(z.format(e.to,Lo));const y=z.differenceInCalendarDays(e.to,e.from);z.isToday(e.to)&&f.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,f]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:df.map(({label:y,value:C})=>a.jsx(Et,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:C})=>a.jsx("li",{children:a.jsx("button",{className:m(g,r===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:m(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Qe,{placeholder:"Start Date",pattern:Kr,value:u,onChange:y=>N(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Qe,{placeholder:"End Date",pattern:Kr,value:d,onChange:y=>N(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},ff=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(Ge,{open:s,onOpenChange:o,modal:i,children:[a.jsx(wt,{asChild:!0,dir:r,children:e}),a.jsx($e,{className:m("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),us=e=>a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{...e})}),Mt={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},pf=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],Ne=e=>{if(!e)return"";try{const t=new Date(e);if(!z.isValid(t))return"";const n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}catch{return""}},Wo=e=>{if(!e)return null;try{const t=z.parseISO(e);return z.isValid(t)?z.startOfDay(t):null}catch{return null}},hf=(e,t,n)=>!(t&&e<z.startOfDay(t)||n&&e>z.startOfDay(n)),Bo=e=>z.sub(new Date,{days:e}),qo=e=>e?z.sub(new Date,{days:1}):new Date;function mf({ranges:e=pf,excludeToday:t=!0,current:n,onSelect:r,onReset:s,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...d}){const[c,w]=h.useState(Ne(n==null?void 0:n.from)||Ne(l)),[p,f]=h.useState(Ne(n==null?void 0:n.to)||Ne(u)),[g,b]=h.useState(!1),[v,N]=h.useState(""),[y,C]=h.useState("");h.useEffect(()=>{w(Ne(n==null?void 0:n.from)||Ne(l)),f(Ne(n==null?void 0:n.to)||Ne(u)),N(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const S=h.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const M=z.differenceInCalendarDays(n.to,n.from)+1;return e.find(_=>_.value===M)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),T=h.useCallback(M=>{const _=Bo(M),P=qo(t);w(Ne(_)),f(Ne(P)),N(""),C(""),b(!1),r==null||r({from:_,to:P})},[t,r]),D=h.useCallback((M,_)=>{const P=Wo(M);if(_==="start"?(w(M),N("")):(f(M),C("")),!P){if(M){const L="Please enter a valid date";_==="start"?N(L):C(L)}return}if(!hf(P,l,u)){const L=l&&P<z.startOfDay(l)?`Date must be on or after ${z.format(l,"MMM d, yyyy")}`:`Date must be on or before ${z.format(u,"MMM d, yyyy")}`;_==="start"?N(L):C(L);return}const V=Wo(_==="start"?p:c);_==="start"&&V?P<=V?r==null||r({from:P,to:V}):N("Start date must be before or equal to end date"):_==="end"&&V&&(P>=V?r==null||r({from:V,to:P}):C("End date must be after or equal to start date"))},[c,p,r,l,u]),A=h.useMemo(()=>e.map(M=>{const _=Bo(M.value),P=qo(t);return{...M,displayStartDate:z.format(_,"MMM d, yyyy"),displayEndDate:z.format(P,"MMM d, yyyy")}}),[e,t]),k=g||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!S;return a.jsxs("div",{className:Mt.wuDateRangeNativeSidebar,...d,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>b(!0),"data-selected":k,"aria-pressed":k,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:Mt.customInputs,"data-expanded":k,children:[a.jsxs("div",{className:Mt.inputsRow,children:[a.jsx(Qe,{type:"date",value:c,onChange:M=>D(M.target.value,"start"),Label:"Start",min:Ne(l),max:Ne(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Qe,{type:"date",value:p,onChange:M=>D(M.target.value,"end"),Label:"End",min:c||Ne(l),max:Ne(u),"aria-describedby":y?"end-date-error":void 0})]}),(v||y)&&a.jsxs("div",{className:Mt.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:Mt.errorText,children:v}),y&&a.jsx("p",{id:"end-date-error",className:Mt.errorText,children:y})]})]}),A.map(M=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>T(M.value),"data-selected":!k&&(S==null?void 0:S.value)===M.value,"aria-pressed":!k&&(S==null?void 0:S.value)===M.value,"aria-label":`Select ${M.label}`,children:[M.label," ",a.jsxs("small",{children:["(",M.displayStartDate," - ",M.displayEndDate,")"]})]})},M.value))]}),a.jsxs("footer",{children:[i&&a.jsx(us,{variant:"secondary",Icon:a.jsx(Pe,{icon:"wm-refresh"}),onClick:s,children:"Reset"}),a.jsx(us,{onClick:o,disabled:!!(v||y),children:"Apply"})]})]})}const gf=({formatString:e="yyyy/MM/dd",value:t,onChange:n,disabled:r,minDate:s=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:i="ltr",minDateToSelect:u,maxDateToSelect:l,presetRanges:d,Label:c,labelPosition:w="top",onReset:p,showResetButton:f=!0,placeholder:g="Select Date Range",CustomTrigger:b,native:v,...N})=>{const[y,C]=h.useState(t),[S,T]=h.useState(t),[D,A]=h.useState(""),k=h.useCallback(()=>{if(S){const P=S.from,E=S.to;C({from:P,to:E}),A(`${z.format(P,e)} - ${z.format(E,e)}`),n&&n({from:P,to:E})}},[S,e,n]),M=h.useCallback(()=>{T(y)},[y]),_=h.useCallback(()=>{p?p():(C(void 0),T(void 0),A(""),n&&n(void 0))},[p,n]);return h.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const P=_n(t.from),E=_n(t.to);C(t),T(t),A(`${z.format(P,e)} - ${z.format(E,e)}`)}else C(void 0),T({to:new Date,from:new Date})},[t,e]),a.jsxs(ke,{className:m("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[c,a.jsxs(Ge,{onOpenChange:P=>!P&&M(),children:[a.jsx(Gr,{formattedString:D,dir:i,placeholder:g,CustomTrigger:b,...N}),a.jsx($e,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:"start",sideOffset:-.5,dir:i,children:v?a.jsx(mf,{current:S,onSelect:P=>{T(P)},ranges:d,onApply:k,onReset:_,showResetButton:f,minDate:s,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(wf,{current:S,onSelect:T,presetRanges:d}),a.jsx(jr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:T,disabled:P=>io(P,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:y==null?void 0:y.from,className:m("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(oo,{handleDateChange:k,disabled:r,onReset:_,showResetButton:f})})]})})]})]})},$o=h.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:m("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});$o.displayName="WuCard";const Ho=h.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Ho.displayName="WuCardHeader";const Uo=h.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Uo.displayName="WuCardHeader";const zo=x.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(Dr.Root,{ref:r,className:m("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(Dr.Indicator,{className:m("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));zo.displayName=Dr.Root.displayName;const He=h.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=Vr(),partial:l,onChange:d,required:c,readonly:w,...p}=e;return h.useEffect(()=>{p.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[p.defaultChecked,r]),a.jsxs("div",{className:bf({labelPosition:o,className:"wu-checkbox-container"}),dir:p.dir,children:[a.jsx(zo,{id:u,...p,partial:l,checked:r,disabled:n||w,onCheckedChange:d,className:m("wu-peer wu-checkbox",i),required:c,ref:t}),s&&a.jsx(ke,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),bf=qe.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"}}});He.displayName="WuCheckbox";const yf=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:m("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},ls=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));ls.displayName=xe.Command.displayName;const jo=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(xe.Command.Input,{ref:n,className:m("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));jo.displayName=xe.Command.Input.displayName;const cs=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.List,{ref:n,className:m("",e),...t}));cs.displayName=xe.Command.List.displayName;const ds=x.forwardRef((e,t)=>a.jsx(xe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ds.displayName=xe.Command.Empty.displayName;const tn=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Group,{ref:n,className:m("",e),...t}));tn.displayName=xe.Command.Group.displayName;const ws=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Separator,{ref:n,className:m("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));ws.displayName=xe.Command.Separator.displayName;const nn=x.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Item,{ref:n,className:m("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));nn.displayName=xe.Command.Item.displayName;const Go=(e,t,n,r)=>h.useMemo(()=>{if(!e||!n||t.length===0)return t;const s=Array.isArray(n)?n:[n];if(s.length===0)return t;const o=new Set(s.map(d=>String(d[r.value]))),i=[],u=[],l=[];return t.forEach(d=>{const c=d[r.value];c===void 0?i.push(d):o.has(String(c))?u.push(d):l.push(d)}),[...i,...u,...l]},[t,n,r.value,e]),It=h.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(Ha.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));It.displayName="WuVirtualScroll";const vf=({tags:e,triggerRef:t})=>{const[n,r]=h.useState([]),[s,o]=h.useState([]),i=h.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,d)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},d))}),[s]),u=l=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=l,document.body.appendChild(d);const c=d.offsetWidth;return document.body.removeChild(d),c+8};return h.useEffect(()=>{const l=()=>{if(t.current){const p=t.current.offsetWidth-20-36;let f=0;const g=[],b=[];e.forEach(v=>{const N=u(v);f+N+8<p?(g.push(v),f+=N+8):b.push(v)}),r(g),o(b)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,d)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},d)),s.length>0&&a.jsx(Dn,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},xf=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,className:w,...p})=>{const[f,g]=h.useState([]),b=h.useRef(null);h.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){g([]);return}if(i){const N=n;g(N==null?void 0:N.map(y=>y[o.label]));return}else g([n[o.label]])},[n]);const v=()=>{var N;return f.length?c&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((N=b.current)==null?void 0:N.offsetWidth)||0)-32}px`},children:f.join(", ")}):a.jsx(vf,{tags:f,triggerRef:b}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(wt,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...p,ref:b,disabled:l,className:m("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[v(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ko=ne.Root,Yo=ne.Trigger,Xo=ne.Group,Nf=ne.Portal,Sf=ne.Sub,Cf=ne.RadioGroup,Zo=x.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(ne.SubTrigger,{ref:o,className:m("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:m("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:m("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Zo.displayName=ne.SubTrigger.displayName;const Jo=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.SubContent,{ref:n,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));Jo.displayName=ne.SubContent.displayName;const fs=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(ne.Portal,{children:a.jsx(ne.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));fs.displayName=ne.Content.displayName;const zn=x.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(ne.Item,{ref:r,className:m("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));zn.displayName=ne.Item.displayName;const Qo=x.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(ne.CheckboxItem,{ref:o,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:m("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(ne.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Qo.displayName=ne.CheckboxItem.displayName;const Ro=x.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(ne.RadioItem,{ref:r,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(ne.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ro.displayName=ne.RadioItem.displayName;const rn=x.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(ne.Label,{ref:r,className:m("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));rn.displayName=ne.Label.displayName;const jn=x.forwardRef(({className:e,...t},n)=>a.jsx(ne.Separator,{ref:n,className:m("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));jn.displayName=ne.Separator.displayName;const ei=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=()=>{e.disabled||r(e)};return a.jsxs(nn,{onSelect:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(He,{checked:l}),a.jsx(Tf,{option:e,accessorKey:s})]})},Tf=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},ti=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(nn,{onSelect:r,className:m("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(He,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(tn,{children:[a.jsx(rn,{children:t.label}),t.options.map((l,d)=>h.createElement(ei,{...i,option:l,key:d}))]});case"divider":return a.jsx(ws,{className:"wu-mx-4"});default:return a.jsx(ei,{...i,option:t})}},Ef=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Mf=h.memo(Qe),If=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:d,onSelect:c,Label:w,maxHeight:p=420,multiple:f=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:N,labelPosition:y="top",className:C,onScroll:S,maxContentWidth:T,enableSearch:D=!0,noDataContent:A,selectedToTop:k=!1,...M})=>{const[_,P]=h.useState(""),[E,V]=h.useState(),[L,O]=h.useState(!1),[W,q]=h.useState(!1),[$,G]=h.useState(!1),Z=h.useRef(null),{allOptions:H,enabledOptions:J}=h.useMemo(()=>g||b&&!b.includeDisabled?Ef(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ie=h.useMemo(()=>{if(!_)return e;const j=_.toLowerCase();return H.filter(ee=>ee[t.label].toLowerCase().includes(j))},[_,H,e,t.label]),fe=h.useMemo(()=>f&&b!=null&&b.enable&&!_&&ie.length>0?[{type:"all"},...ie]:ie,[ie,_,f]),Se=Go(k,fe,E,t),F=h.useCallback(j=>{const ee=j[t.value];f?V(Q=>{const ye=Q||[],Ce=ye.some(Te=>Te[t.value]===ee)?ye.filter(Te=>Te[t.value]!==ee):[...ye,j];return c==null||c(Ce),Ce}):(O(!1),V(j),c==null||c(j))},[f,t.value,c]),U=h.useCallback(j=>P(j.target.value),[]),Y=h.useCallback(()=>P(""),[]);h.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?V(n):r!==void 0&&V(r)},[n,r]),h.useEffect(()=>{if(!f)return;const j=b!=null&&b.includeDisabled?(E==null?void 0:E.length)===H.length:(E==null?void 0:E.length)===J.length;q(j);const ee=(E==null?void 0:E.length)>0&&!j;G(ee)},[E,b]);const K=h.useCallback(()=>{const j=W?[]:b!=null&&b.includeDisabled?H:J;V(j),c==null||c(j)},[W,f,H,J,c,b]),me=kn(y);return a.jsxs("div",{className:m(me,"wu-flex wu-combobox-container"),ref:Z,children:[a.jsxs(Ge,{onOpenChange:j=>{j&&Y(),O(j)},open:L,modal:!0,children:[a.jsx(xf,{selectedOptions:E,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:d,multiple:f,disabled:N,selectAll:b,isCheckedAll:W,className:C,id:v,...M}),a.jsx($e,{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:T},children:a.jsxs(ls,{id:v,children:[D&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Mf,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:U,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),s,a.jsxs(cs,{children:[a.jsx(ds,{children:A||"No results found."}),Se.length>=o?a.jsx(It,{className:"wu-combobox-list",containerHeight:p,list:Se,callback:(j,ee)=>a.jsx(ti,{option:ee,value:E,onSelect:F,multiple:f,accessorKey:t,dir:d,selectAll:b,handleSelectAll:K,isCheckedAll:W,isPartialSelected:$},j),dir:d}):a.jsx("div",{style:{height:"fit-content",maxHeight:p,overflow:"auto"},className:"wu-combobox-list",onScroll:S,children:Se.map(j=>{const ee=j,Q=String(ee[t.value]??ee.type);return a.jsx(ti,{option:ee,value:E,onSelect:F,multiple:f,accessorKey:t,dir:d,selectAll:b,handleSelectAll:K,isCheckedAll:W,isPartialSelected:$},Q)})})]})]})})]}),w&&a.jsx(ke,{htmlFor:v,className:"wu-combobox-label",children:w})]})},Af=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=h.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(Ae,{...r,onClick:i,variant:"iconOnly",className:m("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:m("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(Pe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ni=te.Root,kf=te.Trigger,Df=te.Close,_f=te.Portal,ri=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));ri.displayName=te.Overlay.displayName;const Pf=qe.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"}}),ps=x.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(_f,{children:[a.jsx(ri,{className:s}),a.jsxs(te.Content,{ref:u,className:m(Pf({side:e}),t),...i,children:[n,!r&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ps.displayName=te.Content.displayName;const si=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-semibold",e),...t}));si.displayName=te.Title.displayName;const Vf=x.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm",e),...t}));Vf.displayName=te.Description.displayName;const Of=e=>t=>{e&&t.preventDefault()},Ff=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:d,closeButtonClassName:c,...w}=e;return a.jsxs(ni,{open:i,onOpenChange:u,children:[a.jsx(kf,{asChild:!0,children:t}),a.jsxs(ps,{onInteractOutside:Of(l),side:o,className:m("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:d,closeButtonClassName:c,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(si,{})}),n]})]})},Lf=({children:e,...t})=>a.jsx(Df,{...t,children:e}),ai=h.createContext({});function hs(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const oi=typeof window<"u"?h.useLayoutEffect:h.useEffect,Gn=h.createContext(null);function Wf(e,t){e.indexOf(t)===-1&&e.push(t)}function Bf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Re=(e,t,n)=>n>t?t:n<e?e:n;function ms(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let sn=()=>{},pt=()=>{};typeof process<"u"&&((yd=process.env)==null?void 0:yd.NODE_ENV)!=="production"&&(sn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ms(t,n))},pt=(e,t,n)=>{if(!e)throw new Error(ms(t,n))});const et={},ii=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qf(e){return typeof e=="object"&&e!==null}const ui=e=>/^0[^.\s]+$/u.test(e);function li(e){let t;return()=>(t===void 0&&(t=e()),t)}const At=e=>e,$f=(e,t)=>n=>t(e(n)),Kn=(...e)=>e.reduce($f),ci=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class di{constructor(){this.subscriptions=[]}add(t){return Wf(this.subscriptions,t),()=>Bf(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Oe=e=>e*1e3,Ue=e=>e/1e3;function wi(e,t){return t?e*(1e3/t):0}const fi=new Set;function pi(e,t,n){e||fi.has(t)||(console.warn(ms(t,n)),fi.add(t))}const hi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Hf=1e-7,Uf=12;function zf(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=hi(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Hf&&++u<Uf);return i}function an(e,t,n,r){if(e===t&&n===r)return At;const s=o=>zf(o,0,1,e,n);return o=>o===0||o===1?o:hi(s(o),t,r)}const mi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gi=e=>t=>1-e(1-t),bi=an(.33,1.53,.69,.99),gs=gi(bi),yi=mi(gs),vi=e=>e>=1?1:(e*=2)<1?.5*gs(e):.5*(2-Math.pow(2,-10*(e-1))),bs=e=>1-Math.sin(Math.acos(e)),jf=gi(bs),xi=mi(bs),Gf=an(.42,0,1,1),Kf=an(0,0,.58,1),Ni=an(.42,0,.58,1),Yf=e=>Array.isArray(e)&&typeof e[0]!="number",Si=e=>Array.isArray(e)&&typeof e[0]=="number",Ci={linear:At,easeIn:Gf,easeInOut:Ni,easeOut:Kf,circIn:bs,circInOut:xi,circOut:jf,backIn:gs,backInOut:yi,backOut:bi,anticipate:vi},Xf=e=>typeof e=="string",Ti=e=>{if(Si(e)){pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return an(t,n,r,s)}else if(Xf(e))return pt(Ci[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ci[e];return e},Yn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zf(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(d.schedule(c),e()),c(u)}const d={schedule:(c,w=!1,p=!1)=>{const g=p&&s?n:r;return w&&i.add(c),g.add(c),c},cancel:c=>{r.delete(c),i.delete(c)},process:c=>{if(u=c,s){o=!0;return}s=!0;const w=n;n=r,r=w,n.forEach(l),n.clear(),s=!1,o&&(o=!1,d.process(c))}};return d}const Jf=40;function Ei(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Yn.reduce((C,S)=>(C[S]=Zf(o),C),{}),{setup:u,read:l,resolveKeyframes:d,preUpdate:c,update:w,preRender:p,render:f,postRender:g}=i,b=()=>{const C=et.useManualTiming,S=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,Jf),1)),s.timestamp=S,s.isProcessing=!0,u.process(s),l.process(s),d.process(s),c.process(s),w.process(s),p.process(s),f.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},v=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Yn.reduce((C,S)=>{const T=i[S];return C[S]=(D,A=!1,k=!1)=>(n||v(),T.schedule(D,A,k)),C},{}),cancel:C=>{for(let S=0;S<Yn.length;S++)i[Yn[S]].cancel(C)},state:s,steps:i}}const{schedule:Fe,cancel:ys,state:Xn}=Ei(typeof requestAnimationFrame<"u"?requestAnimationFrame:At,!0);let Zn;function Qf(){Zn=void 0}const _e={now:()=>(Zn===void 0&&_e.set(Xn.isProcessing||et.useManualTiming?Xn.timestamp:performance.now()),Zn),set:e=>{Zn=e,queueMicrotask(Qf)}},Mi=e=>t=>typeof t=="string"&&t.startsWith(e),Ii=Mi("--"),Rf=Mi("var(--"),vs=e=>Rf(e)?ep.test(e.split("/*")[0].trim()):!1,ep=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ai(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const kt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},on={...kt,transform:e=>Re(0,1,e)},Jn={...kt,default:1},un=e=>Math.round(e*1e5)/1e5,xs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tp(e){return e==null}const np=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ns=(e,t)=>n=>!!(typeof n=="string"&&np.test(n)&&n.startsWith(e)||t&&!tp(n)&&Object.prototype.hasOwnProperty.call(n,t)),ki=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(xs);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},rp=e=>Re(0,255,e),Ss={...kt,transform:e=>Math.round(rp(e))},ht={test:Ns("rgb","red"),parse:ki("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ss.transform(e)+", "+Ss.transform(t)+", "+Ss.transform(n)+", "+un(on.transform(r))+")"};function sp(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Cs={test:Ns("#"),parse:sp,transform:ht.transform},ln=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tt=ln("deg"),Dt=ln("%"),B=ln("px"),ap=ln("vh"),op=ln("vw"),Di={...Dt,parse:e=>Dt.parse(e)/100,transform:e=>Dt.transform(e*100)},_t={test:Ns("hsl","hue"),parse:ki("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Dt.transform(un(t))+", "+Dt.transform(un(n))+", "+un(on.transform(r))+")"},de={test:e=>ht.test(e)||Cs.test(e)||_t.test(e),parse:e=>ht.test(e)?ht.parse(e):_t.test(e)?_t.parse(e):Cs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ht.transform(e):_t.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},ip=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function up(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xs))==null?void 0:t.length)||0)+(((n=e.match(ip))==null?void 0:n.length)||0)>0}const _i="number",Pi="color",lp="var",cp="var(",Vi="${}",dp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(dp,l=>(de.test(l)?(r.color.push(o),s.push(Pi),n.push(de.parse(l))):l.startsWith(cp)?(r.var.push(o),s.push(lp),n.push(l)):(r.number.push(o),s.push(_i),n.push(parseFloat(l))),++o,Vi)).split(Vi);return{values:n,split:u,indexes:r,types:s}}function wp(e){return Pt(e).values}function Oi({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===_i?s+=un(r[o]):i===Pi?s+=de.transform(r[o]):s+=r[o]}return s}}function fp(e){return Oi(Pt(e))}const pp=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e,hp=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:pp(e);function mp(e){const t=Pt(e);return Oi(t)(t.values.map((r,s)=>hp(r,t.split[s])))}const ze={test:up,parse:wp,createTransformer:fp,getAnimatableNone:mp};function Ts(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Ts(l,u,e+1/3),o=Ts(l,u,e),i=Ts(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Qn(e,t){return n=>n>0?t:e}const cn=(e,t,n)=>e+(t-e)*n,Es=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},bp=[Cs,ht,_t],yp=e=>bp.find(t=>t.test(e));function Fi(e){const t=yp(e);if(sn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===_t&&(n=gp(n)),n}const Li=(e,t)=>{const n=Fi(e),r=Fi(t);if(!n||!r)return Qn(e,t);const s={...n};return o=>(s.red=Es(n.red,r.red,o),s.green=Es(n.green,r.green,o),s.blue=Es(n.blue,r.blue,o),s.alpha=cn(n.alpha,r.alpha,o),ht.transform(s))},Ms=new Set(["none","hidden"]);function vp(e,t){return Ms.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function xp(e,t){return n=>cn(e,t,n)}function Is(e){return typeof e=="number"?xp:typeof e=="string"?vs(e)?Qn:de.test(e)?Li:Cp:Array.isArray(e)?Wi:typeof e=="object"?de.test(e)?Li:Np:Qn}function Wi(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>Is(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Np(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Is(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Sp(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Cp=(e,t)=>{const n=ze.createTransformer(t),r=Pt(e),s=Pt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ms.has(e)&&!s.values.length||Ms.has(t)&&!r.values.length?vp(e,t):Kn(Wi(Sp(r,s),s.values),n):(sn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qn(e,t))};function Bi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?cn(e,t,n):Is(e)(e,t)}const Tp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Fe.update(t,n),stop:()=>ys(t),now:()=>Xn.isProcessing?Xn.timestamp:_e.now()}},qi=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Rn=2e4;function As(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Ep(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(As(r),Rn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Ue(s)}}const oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ks(e,t){return e*Math.sqrt(1-t*t)}const Mp=12;function Ip(e,t,n){let r=n;for(let s=1;s<Mp;s++)r=r-e(r)/t(r);return r}const Ds=.001;function Ap({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let s,o;sn(e<=Oe(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Re(oe.minDamping,oe.maxDamping,i),e=Re(oe.minDuration,oe.maxDuration,Ue(e)),i<1?(s=d=>{const c=d*i,w=c*e,p=c-n,f=ks(d,i),g=Math.exp(-w);return Ds-p/f*g},o=d=>{const w=d*i*e,p=w*n+n,f=Math.pow(i,2)*Math.pow(d,2)*e,g=Math.exp(-w),b=ks(Math.pow(d,2),i);return(-s(d)+Ds>0?-1:1)*((p-f)*g)/b}):(s=d=>{const c=Math.exp(-d*e),w=(d-n)*e+1;return-Ds+c*w},o=d=>{const c=Math.exp(-d*e),w=(n-d)*(e*e);return c*w});const u=5/e,l=Ip(s,o,u);if(e=Oe(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const kp=["duration","bounce"],Dp=["stiffness","damping","mass"];function $i(e,t){return t.some(n=>e[n]!==void 0)}function _p(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!$i(e,Dp)&&$i(e,kp))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Re(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:oe.mass,stiffness:s,damping:o}}else{const n=Ap({...e,velocity:0});t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function er(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:d,mass:c,duration:w,velocity:p,isResolvedFromDuration:f}=_p({...n,velocity:-Ue(n.velocity||0)}),g=p||0,b=d/(2*Math.sqrt(l*c)),v=i-o,N=Ue(Math.sqrt(l/c)),y=Math.abs(v)<5;r||(r=y?oe.restSpeed.granular:oe.restSpeed.default),s||(s=y?oe.restDelta.granular:oe.restDelta.default);let C,S,T,D,A,k;if(b<1)T=ks(N,b),D=(g+b*N*v)/T,C=_=>{const P=Math.exp(-b*N*_);return i-P*(D*Math.sin(T*_)+v*Math.cos(T*_))},A=b*N*D+v*T,k=b*N*v-D*T,S=_=>Math.exp(-b*N*_)*(A*Math.sin(T*_)+k*Math.cos(T*_));else if(b===1){C=P=>i-Math.exp(-N*P)*(v+(g+N*v)*P);const _=g+N*v;S=P=>Math.exp(-N*P)*(N*_*P-g)}else{const _=N*Math.sqrt(b*b-1);C=L=>{const O=Math.exp(-b*N*L),W=Math.min(_*L,300);return i-O*((g+b*N*v)*Math.sinh(W)+_*v*Math.cosh(W))/_};const P=(g+b*N*v)/_,E=b*N*P-v*_,V=b*N*v-P*_;S=L=>{const O=Math.exp(-b*N*L),W=Math.min(_*L,300);return O*(E*Math.sinh(W)+V*Math.cosh(W))}}const M={calculatedDuration:f&&w||null,velocity:_=>Oe(S(_)),next:_=>{if(!f&&b<1){const E=Math.exp(-b*N*_),V=Math.sin(T*_),L=Math.cos(T*_),O=i-E*(D*V+v*L),W=Oe(E*(A*V+k*L));return u.done=Math.abs(W)<=r&&Math.abs(i-O)<=s,u.value=u.done?i:O,u}const P=C(_);if(f)u.done=_>=w;else{const E=Oe(S(_));u.done=Math.abs(E)<=r&&Math.abs(i-P)<=s}return u.value=u.done?i:P,u},toString:()=>{const _=Math.min(As(M),Rn),P=qi(E=>M.next(_*E).value,_,30);return _+"ms "+P},toTransition:()=>{}};return M}er.applyToOptions=e=>{const t=Ep(e,100,er);return e.ease=t.ease,e.duration=Oe(t.duration),e.type="keyframes",e};const Pp=5;function Hi(e,t,n){const r=Math.max(t-Pp,0);return wi(n-e(r),t-r)}function _s({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:d=.5,restSpeed:c}){const w=e[0],p={done:!1,value:w},f=k=>u!==void 0&&k<u||l!==void 0&&k>l,g=k=>u===void 0?l:l===void 0||Math.abs(u-k)<Math.abs(l-k)?u:l;let b=n*t;const v=w+b,N=i===void 0?v:i(v);N!==v&&(b=N-w);const y=k=>-b*Math.exp(-k/r),C=k=>N+y(k),S=k=>{const M=y(k),_=C(k);p.done=Math.abs(M)<=d,p.value=p.done?N:_};let T,D;const A=k=>{f(p.value)&&(T=k,D=er({keyframes:[p.value,g(p.value)],velocity:Hi(C,k,p.value),damping:s,stiffness:o,restDelta:d,restSpeed:c}))};return A(0),{calculatedDuration:null,next:k=>{let M=!1;return!D&&T===void 0&&(M=!0,S(k),A(k)),T!==void 0&&k>=T?D.next(k-T):(!M&&S(k),p)}}}function Vp(e,t,n){const r=[],s=n||et.mix||Bi,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||At:t;u=Kn(l,u)}r.push(u)}return r}function Op(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(pt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Vp(t,r,s),l=u.length,d=c=>{if(i&&c<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(c<e[w+1]);w++);const p=ci(e[w],e[w+1],c);return u[w](p)};return n?c=>d(Re(e[0],e[o-1],c)):d}function Fp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ci(0,t,r);e.push(cn(n,1,s))}}function Lp(e){const t=[0];return Fp(t,e.length-1),t}function Wp(e,t){return e.map(n=>n*t)}function Bp(e,t){return e.map(()=>t||Ni).splice(0,e.length-1)}function Vt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Yf(r)?r.map(Ti):Ti(r),o={done:!1,value:t[0]},i=Wp(n&&n.length===t.length?n:Lp(t),e),u=Op(i,t,{ease:Array.isArray(s)?s:Bp(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const qp=e=>e!==null;function tr(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(qp),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const $p={decay:_s,inertia:_s,tween:Vt,keyframes:Vt,spring:er};function Ui(e){typeof e.type=="string"&&(e.type=$p[e.type])}class Ps{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Hp=e=>e/100;class nr extends Ps{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==_e.now()&&this.tick(_e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ui(t);const{type:n=Vt,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||Vt;process.env.NODE_ENV!=="production"&&l!==Vt&&pt(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==Vt&&typeof u[0]!="number"&&(this.mixKeyframes=Kn(Hp,Bi(u[0],u[1])),u=[0,100]);const d=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=As(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:c,repeat:w,repeatType:p,repeatDelay:f,type:g,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-d*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,S=r;if(w){const k=Math.min(this.currentTime,s)/u;let M=Math.floor(k),_=k%1;!_&&k>=1&&(_=1),_===1&&M--,M=Math.min(M,w+1),!!(M%2)&&(p==="reverse"?(_=1-_,f&&(_-=f/u)):p==="mirror"&&(S=i)),C=Re(0,1,_)*u}let T;y?(this.delayState.value=c[0],T=this.delayState):T=S.next(C),o&&!y&&(T.value=o(T.value));let{done:D}=T;!y&&l!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return A&&g!==_s&&(T.value=tr(c,this.options,v,this.speed)),b&&b(T.value),A&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return Ue(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(this.currentTime)}set time(t){t=Oe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Hi(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(_e.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ue(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Tp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Up(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const mt=e=>e*180/Math.PI,Vs=e=>{const t=mt(Math.atan2(e[1],e[0]));return Os(t)},zp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vs,rotateZ:Vs,skewX:e=>mt(Math.atan(e[1])),skewY:e=>mt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Os=e=>(e=e%360,e<0&&(e+=360),e),zi=Vs,ji=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),jp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ji,scaleY:Gi,scale:e=>(ji(e)+Gi(e))/2,rotateX:e=>Os(mt(Math.atan2(e[6],e[5]))),rotateY:e=>Os(mt(Math.atan2(-e[2],e[0]))),rotateZ:zi,rotate:zi,skewX:e=>mt(Math.atan(e[4])),skewY:e=>mt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Fs(e){return e.includes("scale")?1:0}function Ls(e,t){if(!e||e==="none")return Fs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=jp,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=zp,s=u}if(!s)return Fs(t);const o=r[t],i=s[1].split(",").map(Kp);return typeof o=="function"?o(i):i[o]}const Gp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ls(n,t)};function Kp(e){return parseFloat(e.trim())}const Ot=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ft=new Set(Ot),Ki=e=>e===kt||e===B,Yp=new Set(["x","y","z"]),Xp=Ot.filter(e=>!Yp.has(e));function Zp(e){const t=[];return Xp.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ls(t,"x"),y:(e,{transform:t})=>Ls(t,"y")};nt.translateX=nt.x,nt.translateY=nt.y;const gt=new Set;let Ws=!1,Bs=!1,qs=!1;function Yi(){if(Bs){const e=Array.from(gt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Zp(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Bs=!1,Ws=!1,gt.forEach(e=>e.complete(qs)),gt.clear()}function Xi(){gt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bs=!0)})}function Jp(){qs=!0,Xi(),Yi(),qs=!1}class $s{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(gt.add(this),Ws||(Ws=!0,Fe.read(Xi),Fe.resolveKeyframes(Yi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Up(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gt.delete(this)}cancel(){this.state==="scheduled"&&(gt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Qp=e=>e.startsWith("--");function Zi(e,t,n){Qp(t)?e.style.setProperty(t,n):e.style[t]=n}const Rp={};function Ji(e,t){const n=li(e);return()=>Rp[t]??n()}const eh=Ji(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Qi=Ji(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dn([0,.65,.55,1]),circOut:dn([.55,0,1,.45]),backIn:dn([.31,.01,.66,-.59]),backOut:dn([.33,1.53,.69,.99])};function eu(e,t){if(e)return typeof e=="function"?Qi()?qi(e,t):"ease-out":Si(e)?dn(e):Array.isArray(e)?e.map(n=>eu(n,t)||Ri.easeOut):Ri[e]}function th(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},d=void 0){const c={[t]:n};l&&(c.offset=l);const w=eu(u,s);Array.isArray(w)&&(c.easing=w);const p={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),e.animate(c,p)}function tu(e){return typeof e=="function"&&"applyToOptions"in e}function nh({type:e,...t}){return tu(e)&&Qi()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class nu extends Ps{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=nh(t);this.animation=th(n,r,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=tr(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Zi(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ue(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Oe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&eh()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),At):s(this)}}const ru={anticipate:vi,backInOut:yi,circInOut:xi};function rh(e){return e in ru}function sh(e){typeof e.ease=="string"&&rh(e.ease)&&(e.ease=ru[e.ease])}const Hs=10;class ah extends nu{constructor(t){sh(t),Ui(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new nr({...i,autoplay:!1}),l=Math.max(Hs,_e.now()-this.startTime),d=Re(0,Hs,l-Hs),c=u.sample(l).value,{name:w}=this.options;o&&w&&Zi(o,w,c),n.setWithVelocity(u.sample(Math.max(0,l-d)).value,c,d),u.stop()}}const su=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ze.test(e)||e==="0")&&!e.startsWith("url("));function oh(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ih(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=su(s,t),u=su(o,t);return sn(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:oh(e)||(n==="spring"||tu(n))&&r}function Us(e){e.duration=0,e.type="keyframes"}const au=new Set(["opacity","clipPath","filter","transform"]),uh=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lh(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&uh.test(e[t]))return!0;return!1}const ch=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),dh=li(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wh(e){var w;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:u}=e;if(!(((w=t==null?void 0:t.owner)==null?void 0:w.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:c}=t.owner.getProps();return dh()&&n&&(au.has(n)||ch.has(n)&&lh(u))&&(n!=="transform"||!c)&&!d&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const fh=40;class ph extends Ps{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:d,element:c,...w}){var g;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=_e.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:d,element:c,...w},f=(c==null?void 0:c.KeyframeResolver)||$s;this.keyframeResolver=new f(u,(b,v,N)=>this.onKeyframesResolved(b,v,p,!N),l,d,c),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,s){var N,y;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:d,onUpdate:c}=r;this.resolvedAt=_e.now();let w=!0;ih(t,o,i,u)||(w=!1,(et.instantAnimations||!l)&&(c==null||c(tr(t,r,n))),t[0]=t[t.length-1],Us(r),r.repeat=0);const f={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>fh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=w&&!d&&wh(f),b=(y=(N=f.motionValue)==null?void 0:N.owner)==null?void 0:y.current;let v;if(g)try{v=new ah({...f,element:b})}catch{v=new nr(f)}else v=new nr(f);v.finished.then(()=>{this.notifyFinished()}).catch(At),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Jp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function ou(e,t,n,r=0,s=1){const o=Array.from(e).sort((d,c)=>d.sortNodePosition(c)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}const hh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mh(e){const t=hh.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const gh=4;function iu(e,t,n=1){pt(n<=gh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=mh(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return ii(i)?parseFloat(i):i}return vs(s)?iu(s,t,n+1):s}const bh={type:"spring",stiffness:500,damping:25,restSpeed:10},yh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),vh={type:"keyframes",duration:.8},xh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Nh=(e,{keyframes:t})=>t.length>2?vh:Ft.has(e)?e.startsWith("scale")?yh(t[1]):bh:xh;function uu(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function lu(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?uu(n,e):n}const Sh=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ch(e){for(const t in e)if(!Sh.has(t))return!0;return!1}const Th=(e,t,n,r={},s,o)=>i=>{const u=lu(r,e)||{},l=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Oe(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:p=>{t.set(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Ch(u)||Object.assign(c,Nh(e,c)),c.duration&&(c.duration=Oe(c.duration)),c.repeatDelay&&(c.repeatDelay=Oe(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let w=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Us(c),c.delay===0&&(w=!0)),(et.instantAnimations||et.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(w=!0,Us(c),c.delay=0),c.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const p=tr(c.keyframes,u);if(p!==void 0){Fe.update(()=>{c.onUpdate(p),c.onComplete()});return}}return u.isSync?new nr(c):new ph(c)};function cu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function zs(e,t,n,r){if(typeof t=="function"){const[s,o]=cu(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=cu(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function bt(e,t,n){const r=e.getProps();return zs(r,t,n!==void 0?n:r.custom,e)}const du=new Set(["width","height","top","left","right","bottom",...Ot]),wu=30,Eh=e=>!isNaN(parseFloat(e));class Mh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=_e.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=_e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Eh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&pi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new di);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=_e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wu);return wi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rr(e,t){return new Mh(e,t)}const js=e=>Array.isArray(e);function Ih(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rr(n))}function Ah(e){return js(e)?e[e.length-1]||0:e}function kh(e,t){const n=bt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Ah(o[i]);Ih(e,i,u)}}const be=e=>!!(e&&e.getVelocity);function Dh(e){return!!(be(e)&&e.add)}function _h(e,t){const n=e.getValue("willChange");if(Dh(n))return n.add(t);if(!n&&et.WillChange){const r=new et.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Gs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const fu="data-"+Gs("framerAppearId");function Ph(e){return e.props[fu]}function Vh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function pu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?uu(o,l):l;const d=o==null?void 0:o.reduceMotion;r&&(o=r);const c=[],w=s&&e.animationState&&e.animationState.getState()[s];for(const p in u){const f=e.getValue(p,e.latestValues[p]??null),g=u[p];if(g===void 0||w&&Vh(w,p))continue;const b={delay:n,...lu(o||{},p)},v=f.get();if(v!==void 0&&!f.isAnimating()&&!Array.isArray(g)&&g===v&&!b.velocity){Fe.update(()=>f.set(g));continue}let N=!1;if(window.MotionHandoffAnimation){const S=Ph(e);if(S){const T=window.MotionHandoffAnimation(S,p,Fe);T!==null&&(b.startTime=T,N=!0)}}_h(e,p);const y=d??e.shouldReduceMotion;f.start(Th(p,f,g,y&&du.has(p)?{type:!1}:b,e,N));const C=f.animation;C&&c.push(C)}if(i){const p=()=>Fe.update(()=>{i&&kh(e,i)});c.length?Promise.all(c).then(p):p()}return c}function Ks(e,t,n={}){var l;const r=bt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(pu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:w,staggerDirection:p}=s;return Oh(e,t,d,c,w,p,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,c]=u==="beforeChildren"?[o,i]:[i,o];return d().then(()=>c())}else return Promise.all([o(),i(n.delay)])}function Oh(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(Ks(l,t,{...i,delay:n+(typeof r=="function"?0:r)+ou(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function Fh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Ks(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Ks(e,t,n);else{const s=typeof t=="function"?bt(e,t,n.custom):t;r=Promise.all(pu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Lh={test:e=>e==="auto",parse:e=>e},hu=e=>t=>t.test(e),mu=[kt,B,Dt,tt,op,ap,Lh],gu=e=>mu.find(hu(e));function Wh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ui(e):!0}const Bh=new Set(["brightness","contrast","saturate","opacity"]);function qh(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xs)||[];if(!r)return e;const s=n.replace(r,"");let o=Bh.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const $h=/\b([a-z-]*)\(.*?\)/gu,Ys={...ze,getAnimatableNone:e=>{const t=e.match($h);return t?t.map(qh).join(" "):e}},Xs={...ze,getAnimatableNone:e=>{const t=ze.parse(e);return ze.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},bu={...kt,transform:Math.round},Zs={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...{rotate:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Jn,scaleX:Jn,scaleY:Jn,scaleZ:Jn,skew:tt,skewX:tt,skewY:tt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:on,originX:Di,originY:Di,originZ:B},zIndex:bu,fillOpacity:on,strokeOpacity:on,numOctaves:bu},Hh={...Zs,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Ys,WebkitFilter:Ys,mask:Xs,WebkitMask:Xs},yu=e=>Hh[e],Uh=new Set([Ys,Xs]);function vu(e,t){let n=yu(e);return Uh.has(n)||(n=ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zh=new Set(["auto","none","0"]);function jh(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!zh.has(o)&&Pt(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=vu(n,s)}class Gh extends $s{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let w=t[c];if(typeof w=="string"&&(w=w.trim(),vs(w))){const p=iu(w,n.current);p!==void 0&&(t[c]=p),c===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!du.has(r)||t.length!==2)return;const[s,o]=t,i=gu(s),u=gu(o),l=Ai(s),d=Ai(o);if(l!==d&&nt[r]){this.needsMeasurement=!0;return}if(i!==u)if(Ki(i)&&Ki(u))for(let c=0;c<t.length;c++){const w=t[c];typeof w=="string"&&(t[c]=parseFloat(w))}else nt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Wh(t[s]))&&r.push(s);r.length&&jh(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=nt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Kh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const xu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sr(e){return qf(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Yh}=Ei(queueMicrotask,!1),Xh={y:!1};function Zh(){return Xh.y}function Nu(e,t){const n=Kh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Jh(e){return!(e.pointerType==="touch"||Zh())}function Qh(e,t,n={}){const[r,s,o]=Nu(e,n);return r.forEach(i=>{let u=!1,l=!1,d;const c=()=>{i.removeEventListener("pointerleave",g)},w=v=>{d&&(d(v),d=void 0),c()},p=v=>{u=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,w(v))},f=()=>{u=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},g=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},b=v=>{if(!Jh(v))return;l=!1;const N=t(i,v);typeof N=="function"&&(d=N,i.addEventListener("pointerleave",g,s))};i.addEventListener("pointerenter",b,s),i.addEventListener("pointerdown",f,s)}),o}const Su=(e,t)=>t?e===t?!0:Su(e,t.parentElement):!1,Rh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,em=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function tm(e){return em.has(e.tagName)||e.isContentEditable===!0}const ar=new WeakSet;function Cu(e){return t=>{t.key==="Enter"&&e(t)}}function Js(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const nm=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Cu(()=>{if(ar.has(n))return;Js(n,"down");const s=Cu(()=>{Js(n,"up")}),o=()=>Js(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Tu(e){return Rh(e)&&!0}const Eu=new WeakSet;function rm(e,t,n={}){const[r,s,o]=Nu(e,n),i=u=>{const l=u.currentTarget;if(!Tu(u)||Eu.has(u))return;ar.add(l),n.stopPropagation&&Eu.add(u);const d=t(l,u),c=(f,g)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",p),ar.has(l)&&ar.delete(l),Tu(f)&&typeof d=="function"&&d(f,{success:g})},w=f=>{c(f,l===window||l===document||n.useGlobalTarget||Su(l,f.target))},p=f=>{c(f,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",p,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),sr(u)&&(u.addEventListener("focus",d=>nm(d,s)),!tm(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const sm=[...mu,de,ze],am=e=>sm.find(hu(e)),Mu=()=>({min:0,max:0}),Iu=()=>({x:Mu(),y:Mu()}),om=new WeakMap;function or(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wn(e){return typeof e=="string"||Array.isArray(e)}const Qs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rs=["initial",...Qs];function ir(e){return or(e.animate)||Rs.some(t=>wn(e[t]))}function Au(e){return!!(ir(e)||e.variants)}function im(e,t,n){for(const r in t){const s=t[r],o=n[r];if(be(s))e.addValue(r,s);else if(be(o))e.addValue(r,rr(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,rr(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ea={current:null},ku={current:!1},um=typeof window<"u";function lm(){if(ku.current=!0,!!um)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ea.current=e.matches;e.addEventListener("change",t),t()}else ea.current=!1}const Du=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ur={};function _u(e){ur=e}function cm(){return ur}class dm{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$s,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=_e.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Fe.render(this.render,!1,!0))};const{latestValues:d,renderState:c}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ir(n),this.isVariantNode=Au(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in p){const g=p[f];d[f]!==void 0&&be(g)&&g.set(d[f])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,om.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ku.current||lm(),this.shouldReduceMotion=ea.current),process.env.NODE_ENV!=="production"&&pi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ys(this.notifyUpdate),ys(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&au.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:d,duration:c}=n.accelerate,w=new nu({element:this.current,name:t,keyframes:u,times:l,ease:d,duration:Oe(c)}),p=i(w);this.valueSubscriptions.set(t,()=>{p(),w.cancel()});return}const r=Ft.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Fe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ur){const n=ur[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Iu()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Du.length;r++){const s=Du[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=im(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ii(r)||ui(r))?r=parseFloat(r):!am(r)&&ze.test(n)&&(r=vu(t,n)),this.setBaseTarget(t,be(r)?r.get():r)),be(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=zs(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!be(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new di),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Yh.render(this.render)}}class Pu extends dm{constructor(){super(...arguments),this.KeyframeResolver=Gh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;be(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Lt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function wm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function fm(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pm(e,t){return wm(fm(e.getBoundingClientRect(),t))}const hm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mm=Ot.length;function gm(e,t,n){let r="",s=!0;for(let o=0;o<mm;o++){const i=Ot[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const d=parseFloat(u);l=i.startsWith("scale")?d===1:d===0}if(!l||n){const d=xu(u,Zs[i]);if(!l){s=!1;const c=hm[i]||i;r+=`${c}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ta(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const d=t[l];if(Ft.has(l)){i=!0;continue}else if(Ii(l)){s[l]=d;continue}else{const c=xu(d,Zs[l]);l.startsWith("origin")?(u=!0,o[l]=c):r[l]=c}}if(t.transform||(i||n?r.transform=gm(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:d="50%",originZ:c=0}=o;r.transformOrigin=`${l} ${d} ${c}`}}function Vu(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Ou(e,t.target.x),r=Ou(e,t.target.y);return`${n}% ${r}%`}},bm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ze.parse(e);if(s.length>5)return r;const o=ze.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const d=cn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=d),typeof s[3+i]=="number"&&(s[3+i]/=d),o(s)}},ym={borderRadius:{...fn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomLeftRadius:fn,borderBottomRightRadius:fn,boxShadow:bm};function Fu(e,{layout:t,layoutId:n}){return Ft.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ym[e]||e==="opacity")}function na(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const u in r)(be(r[u])||s&&be(s[u])||Fu(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=r[u]);return o}function vm(e){return window.getComputedStyle(e)}class xm extends Pu{constructor(){super(...arguments),this.type="html",this.renderInstance=Vu}readValueFromInstance(t,n){var r;if(Ft.has(n))return(r=this.projection)!=null&&r.isProjecting?Fs(n):Gp(t,n);{const s=vm(t),o=(Ii(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pm(t,n)}build(t,n,r){ta(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return na(t,n,r)}}const Nm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sm={offset:"strokeDashoffset",array:"strokeDasharray"};function Cm(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?Nm:Sm;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const Tm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Lu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,d,c){if(ta(e,u,d),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:p}=e;w.transform&&(p.transform=w.transform,delete w.transform),(p.transform||w.transformOrigin)&&(p.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),p.transform&&(p.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete w.transformBox);for(const f of Tm)w[f]!==void 0&&(p[f]=w[f],delete w[f]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&Cm(w,s,o,i,!1)}const Wu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Bu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Em(e,t,n,r){Vu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Wu.has(s)?s:Gs(s),t.attrs[s])}function qu(e,t,n){const r=na(e,t,n);for(const s in e)if(be(e[s])||be(t[s])){const o=Ot.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class Mm extends Pu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Iu}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ft.has(n)){const r=yu(n);return r&&r.default||0}return n=Wu.has(n)?n:Gs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qu(t,n,r)}build(t,n,r){Lu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Em(t,n,r,s)}mount(t){this.isSVGTag=Bu(t.tagName),super.mount(t)}}const Im=Rs.length;function $u(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$u(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Im;n++){const r=Rs[n],s=e.props[r];(wn(s)||s===!1)&&(t[r]=s)}return t}function Hu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Am=[...Qs].reverse(),km=Qs.length;function Dm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Fh(e,n,r)))}function _m(e){let t=Dm(e),n=Uu(),r=!0,s=!1;const o=d=>(c,w)=>{var f;const p=bt(e,w,d==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(p){const{transition:g,transitionEnd:b,...v}=p;c={...c,...v,...b}}return c};function i(d){t=d(e)}function u(d){const{props:c}=e,w=$u(e.parent)||{},p=[],f=new Set;let g={},b=1/0;for(let N=0;N<km;N++){const y=Am[N],C=n[y],S=c[y]!==void 0?c[y]:w[y],T=wn(S),D=y===d?C.isActive:null;D===!1&&(b=N);let A=S===w[y]&&S!==c[y]&&T;if(A&&(r||s)&&e.manuallyAnimateOnMount&&(A=!1),C.protectedKeys={...g},!C.isActive&&D===null||!S&&!C.prevProp||or(S)||typeof S=="boolean")continue;if(y==="exit"&&C.isActive&&D!==!0){C.prevResolvedValues&&(g={...g,...C.prevResolvedValues});continue}const k=Pm(C.prevProp,S);let M=k||y===d&&C.isActive&&!A&&T||N>b&&T,_=!1;const P=Array.isArray(S)?S:[S];let E=P.reduce(o(y),{});D===!1&&(E={});const{prevResolvedValues:V={}}=C,L={...V,...E},O=$=>{M=!0,f.has($)&&(_=!0,f.delete($)),C.needsAnimating[$]=!0;const G=e.getValue($);G&&(G.liveStyle=!1)};for(const $ in L){const G=E[$],Z=V[$];if(g.hasOwnProperty($))continue;let H=!1;js(G)&&js(Z)?H=!Hu(G,Z):H=G!==Z,H?G!=null?O($):f.add($):G!==void 0&&f.has($)?O($):C.protectedKeys[$]=!0}C.prevProp=S,C.prevResolvedValues=E,C.isActive&&(g={...g,...E}),(r||s)&&e.blockInitialAnimation&&(M=!1);const W=A&&k;M&&(!W||_)&&p.push(...P.map($=>{const G={type:y};if(typeof $=="string"&&(r||s)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,H=bt(Z,$);if(Z.enteringChildren&&H){const{delayChildren:J}=H.transition||{};G.delay=ou(Z.enteringChildren,e,J)}}return{animation:$,options:G}}))}if(f.size){const N={};if(typeof c.initial!="boolean"){const y=bt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(N.transition=y.transition)}f.forEach(y=>{const C=e.getBaseTarget(y),S=e.getValue(y);S&&(S.liveStyle=!0),N[y]=C??null}),p.push({animation:N})}let v=!!p.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(p):Promise.resolve()}function l(d,c){var p;if(n[d].isActive===c)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(f=>{var g;return(g=f.animationState)==null?void 0:g.setActive(d,c)}),n[d].isActive=c;const w=u(d);for(const f in n)n[f].protectedKeys={};return w}return{animateChanges:u,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Uu(),s=!0}}}function Pm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hu(t,e):!1}function yt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Uu(){return{animate:yt(!0),whileInView:yt(),whileHover:yt(),whileTap:yt(),whileDrag:yt(),whileFocus:yt(),exit:yt()}}function zu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Vm(e){return be(e)?e.get():e}const ra=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ju(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Om(...e){return t=>{let n=!1;const r=e.map(s=>{const o=ju(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():ju(e[s],null)}}}}function Fm(...e){return x.useCallback(Om(...e),e)}class Lm extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(sr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=sr(r)&&r.offsetWidth||0,o=sr(r)&&r.offsetHeight||0,i=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(i.height),u.width=parseFloat(i.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Wm({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:o}){var p;const i=h.useId(),u=h.useRef(null),l=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=h.useContext(ra),c=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),w=Fm(u,c);return h.useInsertionEffect(()=>{const{width:f,height:g,top:b,left:v,right:N,bottom:y}=l.current;if(t||o===!1||!u.current||!f||!g)return;const C=n==="left"?`left: ${v}`:`right: ${N}`,S=r==="bottom"?`bottom: ${y}`:`top: ${b}`;u.current.dataset.motionPopId=i;const T=document.createElement("style");d&&(T.nonce=d);const D=s??document.head;return D.appendChild(T),T.sheet&&T.sheet.insertRule(`
8
8
  [data-motion-pop-id="${i}"] {
9
9
  position: absolute !important;
10
10
  width: ${f}px !important;
@@ -12,10 +12,10 @@
12
12
  ${C}px !important;
13
13
  ${S}px !important;
14
14
  }
15
- `),()=>{var A;(A=u.current)==null||A.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[t]),a.jsx(Lm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Bm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=hs(qm),w=h.useId();let p=!0,f=h.useMemo(()=>(p=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const b of c.values())if(!b)return;r&&r()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,r]);return o&&p&&(f={...f}),h.useMemo(()=>{c.forEach((g,b)=>c.set(b,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(Wm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:f,children:e})};function qm(){return new Map}function $m(e=!0){const t=h.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=h.useId();h.useEffect(()=>{if(e)return s(o)},[e]);const i=h.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Gu(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=$m(i),p=h.useMemo(()=>Gu(e),[e]),f=i&&!c?[]:p.map(lr),g=h.useRef(!0),b=h.useRef(p),v=hs(()=>new Map),N=h.useRef(new Set),[y,C]=h.useState(p),[S,T]=h.useState(p);oi(()=>{g.current=!1,b.current=p;for(let k=0;k<S.length;k++){const M=lr(S[k]);f.includes(M)?(v.delete(M),N.current.delete(M)):v.get(M)!==!0&&v.set(M,!1)}},[S,f.length,f.join("-")]);const D=[];if(p!==y){let k=[...p];for(let M=0;M<S.length;M++){const _=S[M],P=lr(_);f.includes(P)||(k.splice(M,0,_),D.push(_))}return o==="wait"&&D.length&&(k=D),T(Gu(k)),C(p),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=h.useContext(ai);return a.jsx(a.Fragment,{children:S.map(k=>{const M=lr(k),_=i&&!c?!1:p===S||f.includes(M),P=()=>{if(N.current.has(M))return;if(v.has(M))N.current.add(M),v.set(M,!0);else return;let E=!0;v.forEach(V=>{V||(E=!1)}),E&&(A==null||A(),T(b.current),i&&(w==null||w()),r&&r())};return a.jsx(Bm,{isPresent:_,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:k},M)})})},sa=h.createContext({strict:!1}),Yu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xu=!1;function Hm(){if(Xu)return;const e={};for(const t in Yu)e[t]={isEnabled:n=>Yu[t].some(r=>!!n[r])};_u(e),Xu=!0}function Zu(){return Hm(),cm()}function Ju(e){const t=Zu();for(const n in e)t[n]={...t[n],...e[n]};_u(t)}function Qu({children:e,features:t,strict:n=!1}){const[,r]=h.useState(!aa(t)),s=h.useRef(void 0);if(!aa(t)){const{renderer:o,...i}=t;s.current=o,Ju(i)}return h.useEffect(()=>{aa(t)&&t().then(({renderer:o,...i})=>{Ju(i),s.current=o,r(!0)})},[]),a.jsx(sa.Provider,{value:{renderer:s.current,strict:n},children:e})}function aa(e){return typeof e=="function"}const zm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zm.has(e)}let Ru=e=>!cr(e);function Um(e){typeof e=="function"&&(Ru=t=>t.startsWith("on")?!cr(t):e(t))}try{Um(require("@emotion/is-prop-valid").default)}catch{}function jm(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||be(e[s])||(Ru(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=h.createContext({});function Gm(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Km(e){const{initial:t,animate:n}=Gm(e,h.useContext(dr));return h.useMemo(()=>({initial:t,animate:n}),[el(t),el(n)])}function el(e){return Array.isArray(e)?e.join(" "):e}const oa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)!be(t[r])&&!Fu(r,n)&&(e[r]=t[r])}function Ym({transformTemplate:e},t){return h.useMemo(()=>{const n=oa();return ta(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Xm(e,t){const n=e.style||{},r={};return tl(r,n,e),Object.assign(r,Ym(e,t)),r}function Zm(e,t){const n={},r=Xm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nl=()=>({...oa(),attrs:{}});function Jm(e,t,n,r){const s=h.useMemo(()=>{const o=nl();return Lu(o,t,Bu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};tl(o,e.style,e),s.style={...o,...s.style}}return s}const Qm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ia(e){return typeof e!="string"||e.includes("-")?!1:!!(Qm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Rm(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??ia(e)?Jm:Zm)(t,r,s,e),d=jm(t,typeof e=="string",o),c=e!==h.Fragment?{...d,...l,ref:n}:{},{children:w}=t,p=h.useMemo(()=>be(w)?w.get():w,[w]);return h.createElement(e,{...c,children:p})}function eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:tg(n,r,s,e),renderState:t()}}function tg(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Vm(o[p]);let{initial:i,animate:u}=e;const l=ir(e),d=Au(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const p=Array.isArray(w)?w:[w];for(let f=0;f<p.length;f++){const g=Us(e,p[f]);if(g){const{transitionEnd:b,transition:v,...N}=g;for(const y in N){let C=N[y];if(Array.isArray(C)){const S=c?C.length-1:0;C=C[S]}C!==null&&(s[y]=C)}for(const y in b)s[y]=b[y]}}}return s}const rl=e=>(t,n)=>{const r=h.useContext(dr),s=h.useContext(Gn),o=()=>eg(e,t,r,s);return n?o():hs(o)},ng=rl({scrapeMotionValuesFromProps:na,createRenderState:oa}),rg=rl({scrapeMotionValuesFromProps:qu,createRenderState:nl}),sg=Symbol.for("motionComponentSymbol");function ag(e,t,n){const r=h.useRef(n);h.useInsertionEffect(()=>{r.current=n});const s=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const og=h.createContext({});function ig(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ug(e,t,n,r,s,o){var C,S;const{visualElement:i}=h.useContext(dr),u=h.useContext(sa),l=h.useContext(Gn),d=h.useContext(ra),c=d.reducedMotion,w=d.skipAnimations,p=h.useRef(null),f=h.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,b=h.useContext(og);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&lg(p.current,n,s,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const N=n[fu],y=h.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,N)));return oi(()=>{f.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),y.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,N)}),y.current=!1),g.enteringChildren=void 0)}),g}function lg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ig(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function sl(e){if(e)return e.options.allowProjection!==!1?e.projection:sl(e.parent)}function cg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":ia(e),i=o?rg:ng;function u(d,c){let w;const p={...h.useContext(ra),...d,layoutId:dg(d)},{isStatic:f}=p,g=Km(d),b=i(d,f);if(!f&&typeof window<"u"){wg(p,r);const v=fg(p);w=v.MeasureLayout,g.visualElement=ug(e,b,p,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...p}):null,Rm(e,d,ag(b,g.visualElement,c),b,f,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[sg]=e,l}function dg({layoutId:e}){const t=h.useContext(ai).id;return t&&e!==void 0?t+"-"+e:e}function wg(e,t){h.useContext(sa).strict,process.env.NODE_ENV}function fg(e){const t=Zu(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const pg=(e,t)=>t.isSVG??ia(e)?new Mm(t):new xm(t,{allowProjection:e!==h.Fragment});class hg extends Lt{constructor(t){super(t),t.animationState||(t.animationState=_m(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mg=0;class gg extends Lt{constructor(){super(...arguments),this.id=mg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=bt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const p in w)(o=this.node.getValue(p))==null||o.jump(w[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const bg={animation:{Feature:hg},exit:{Feature:gg}};function al(e){return{point:{x:e.pageX,y:e.pageY}}}function ol(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class yg extends Lt{mount(){const{current:t}=this.node;t&&(this.unmount=Qh(t,(n,r)=>(ol(this.node,r,"Start"),s=>ol(this.node,s,"End"))))}unmount(){}}class vg extends Lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(Uu(this.node.current,"focus",()=>this.onFocus()),Uu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function il(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class xg extends Lt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=rm(t,(s,o)=>(il(this.node,o,"Start"),(i,{success:u})=>il(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ua=new WeakMap,la=new WeakMap,Ng=e=>{const t=ua.get(e.target);t&&t(e)},Sg=e=>{e.forEach(Ng)};function Cg({root:e,...t}){const n=e||document;la.has(n)||la.set(n,{});const r=la.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Sg,{root:e,...t})),r[s]}function Tg(e,t,n){const r=Cg(t);return ua.set(e,n),r.observe(e),()=>{ua.delete(e),r.unobserve(e)}}const Eg={some:0,all:1};class Mg extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Eg[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:p}=this.node.getProps(),f=c?w:p;f&&f(d)};this.stopObserver=Tg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ig(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Ig({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ul={renderer:pg,...bg,...{inView:{Feature:Mg},tap:{Feature:xg},focus:{Feature:vg},hover:{Feature:yg}}};function Ag(e,t){return cg(e,t)}const ll=Ag("div"),kg=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Qo,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(Un,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Dg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Xo,{...r,children:[a.jsx(rn,{children:n||e.label}),t]})},_g=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(Cf,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ro,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Pg=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(lt.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(lt.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(ca,{thumbColor:n,railColor:r}),a.jsx(lt.Corner,{})]}));Wt.displayName=lt.Root.displayName;const ca=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(lt.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(lt.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));ca.displayName=lt.ScrollAreaScrollbar.displayName;const Vg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(Sf,{...l,open:s,onOpenChange:o,children:[a.jsx(Zo,{dir:u,children:r||n}),a.jsx(Nf,{children:a.jsx(Jo,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Og="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",da=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:p="start",sideOffset:f=0,side:g="bottom",alignOffset:b,className:v,disabled:N,...y}=e;return a.jsxs(Ko,{...y,open:i,onOpenChange:u,dir:c,children:[a.jsx(Yo,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Fg(s,o,N)}),a.jsx(fs,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:p,sideOffset:f,side:g,alignOffset:b,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(rn,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Fg=(e,t,n)=>{const r=m(Og,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=h.useState(!1);return a.jsx(da,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:8,Trigger:a.jsx(Ae,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-p-0"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Wg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition",t!==n?"wu-translate-y-0 wu-opacity-100 wu-z-50 wu-delay-200":"wu-translate-y-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Lg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Qu,{features:ul,children:a.jsxs(Ku,{initial:!1,mode:"popLayout",children:[Bg(e).map((l,d)=>a.jsx(ll,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-2 wu-h-6",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light",i==="rtl"&&"wu-rotate-180")}),l.title]})},l.id)),"``"]})})})]})},Bg=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},qg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=h.useState(n?[n]:[]),[[c,w],p]=h.useState([t,1]),f=(N,y)=>{y&&d([...l,y]),p([N,1])},g=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);d(C)}p([N,-1])},b=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const S=l.findIndex(T=>T.id===C);S!==-1&&(d(l.slice(0,S+1)),g(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const y=typeof N.component=="function"?N.component({goNext:f,goBack:g}):N.component;return a.jsx(ll,{dir:u,custom:w,variants:$g(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:y},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Wg,{titles:l,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(Qu,{features:ul,children:a.jsx(Ku,{initial:!1,custom:w,mode:r,children:v()})})]})},$g=e=>{switch(e){case"slideRight":return zg;case"slideLeft":return Ug;case"fadeZoom":return jg;case"default":default:return Hg}},Hg={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},zg={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Ug={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},jg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},cl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(dt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});cl.displayName="WuFooter";const dl=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Pr(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});dl.displayName="WuHelpButton";const rt=(e,t)=>`wu-listbox-${e}`;function Gg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:p,className:f})=>h.createElement(nn,{...d,key:JSON.stringify(p),onSelect:()=>r==null?void 0:r(p),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(p))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",f,rt("item")),disabled:p.disabled},s&&a.jsx(He,{checked:l==null?void 0:l(p)}),u?u({value:p,isSelected:l==null?void 0:l(p)}):a.jsx(a.Fragment,{children:p[n.label]}));if(c){const p=t[n.group],f=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(tn,{heading:f,children:p==null?void 0:p.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const Kg=h.memo(Gg),Yg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(jo,{...n,"aria-label":"Search",className:m("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;",rt("input"),t)})]})},Xg=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(nn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(He,{checked:o,partial:u}),t||"Select All"]})},Zg=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[p,f]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!r){f(null);return}f(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,f]),a.jsx(wt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,rt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!p&&"wu-font-light"),children:p||s}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",rt("drop-icon"))})]})})},wl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Jg=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>wl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else wl(i,s,n)&&o.push(i)}return o},fl=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:p,disabled:f,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:S,className:T,listClass:D,placeholder:A="Select items...",variant:k,labelPosition:M="top",maxContentWidth:_,maxContentHeight:P,modal:E,...V}=e,[L,O]=h.useState(!1),[W,q]=h.useState(""),[$,G]=h.useState(r),Z=h.useMemo(()=>n,[n]),H=h.useMemo(()=>{if(!b||!W)return t;const F=W.toLowerCase().trim();return Jg(t,F,n)},[t,W,n.label,b]),J=F=>{g?G(z=>{const Y=F[n.value],K=Array.isArray(z)?z:[],j=K.some(ee=>ee[n.value]===Y)?K.filter(ee=>ee[n.value]!==Y):[...K,F];return w&&w(j),j}):(G(F),w&&w(F),O(!1))},ie=h.useCallback(F=>{const z=F?t:[];G(z),v!=null&&v.onSelectAll&&v.onSelectAll(F),w&&w(z)},[t,v,w]),fe=F=>Array.isArray($)?$.some(z=>z[n.value]===F[n.value]):($==null?void 0:$[n.value])===F[n.value];h.useEffect(()=>{G(r)},[r]);const Se=F=>{const z=(Y,K)=>{const me=n.group&&Array.isArray(Y[n.group]),j=y&&me&&K>0&&F.length>1;return a.jsxs(h.Fragment,{children:[j&&a.jsx(ws,{}),a.jsx(Kg,{option:Y,accessorKey:Z,multiple:g,onSelect:ee=>J(ee),dir:S,GroupLabel:i,Item:s,isSelected:ee=>fe(ee)})]},JSON.stringify(Y))};return F.length>N?a.jsx(It,{list:F,callback:(Y,K)=>z(K,Y),dir:S}):F.map((Y,K)=>z(Y,K))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",rt("container")),dir:S,children:[o&&a.jsx(ke,{htmlFor:C,className:rt("label"),children:o}),a.jsxs(Ge,{open:L,onOpenChange:F=>{O(F),F||setTimeout(()=>{q("")},100)},modal:E,children:[a.jsx(Zg,{CustomTrigger:l,disabled:f,value:$,accessorKey:n,placeholder:A,Chip:c,className:T,handleUnselect:J,variant:k,id:C,dir:S,...V}),a.jsx($e,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",rt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(ls,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(Yg,{value:W,onValueChange:q}),u,a.jsxs(cs,{className:m("wu-overflow-y-auto",rt("list"),D),onScroll:p,style:{maxHeight:P||"420px"},children:[a.jsx(ds,{children:d||"No results found."}),a.jsx(tn,{children:g&&(v==null?void 0:v.enabled)&&!W&&a.jsx(Xg,{data:t,value:$,onSelectAll:ie,label:v.label})}),a.jsx(tn,{children:Se(H)})]})]})})]})]})},wa=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});wa.displayName="WuMenuIcon";const pl={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%]"},hl=te.Root,ml=te.Trigger,Qg=te.Portal,Rg=te.Close,gl=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",pl.overlay,e),...t}));gl.displayName=te.Overlay.displayName;const fa=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Qg,{children:[a.jsx(gl,{className:r?"wu-bg-transparent":""}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",pl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));fa.displayName=te.Content.displayName;const pa=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});pa.displayName="DialogHeader";const bl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});bl.displayName="DialogFooter";const ha=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ha.displayName=te.Title.displayName;const eb=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));eb.displayName=te.Description.displayName;const tb={gradientBackground:"_gradientBackground_1uc4j_1"},yl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const p=f=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=d.getBoundingClientRect();let b=f.clientX-g.left,v=f.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const N=`radial-gradient(
15
+ `),()=>{var A;(A=u.current)==null||A.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[t]),a.jsx(Lm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Bm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=hs(qm),w=h.useId();let p=!0,f=h.useMemo(()=>(p=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const b of c.values())if(!b)return;r&&r()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,r]);return o&&p&&(f={...f}),h.useMemo(()=>{c.forEach((g,b)=>c.set(b,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(Wm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:f,children:e})};function qm(){return new Map}function $m(e=!0){const t=h.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=h.useId();h.useEffect(()=>{if(e)return s(o)},[e]);const i=h.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Gu(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=$m(i),p=h.useMemo(()=>Gu(e),[e]),f=i&&!c?[]:p.map(lr),g=h.useRef(!0),b=h.useRef(p),v=hs(()=>new Map),N=h.useRef(new Set),[y,C]=h.useState(p),[S,T]=h.useState(p);oi(()=>{g.current=!1,b.current=p;for(let k=0;k<S.length;k++){const M=lr(S[k]);f.includes(M)?(v.delete(M),N.current.delete(M)):v.get(M)!==!0&&v.set(M,!1)}},[S,f.length,f.join("-")]);const D=[];if(p!==y){let k=[...p];for(let M=0;M<S.length;M++){const _=S[M],P=lr(_);f.includes(P)||(k.splice(M,0,_),D.push(_))}return o==="wait"&&D.length&&(k=D),T(Gu(k)),C(p),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=h.useContext(ai);return a.jsx(a.Fragment,{children:S.map(k=>{const M=lr(k),_=i&&!c?!1:p===S||f.includes(M),P=()=>{if(N.current.has(M))return;if(v.has(M))N.current.add(M),v.set(M,!0);else return;let E=!0;v.forEach(V=>{V||(E=!1)}),E&&(A==null||A(),T(b.current),i&&(w==null||w()),r&&r())};return a.jsx(Bm,{isPresent:_,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:k},M)})})},sa=h.createContext({strict:!1}),Yu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xu=!1;function Hm(){if(Xu)return;const e={};for(const t in Yu)e[t]={isEnabled:n=>Yu[t].some(r=>!!n[r])};_u(e),Xu=!0}function Zu(){return Hm(),cm()}function Ju(e){const t=Zu();for(const n in e)t[n]={...t[n],...e[n]};_u(t)}function Qu({children:e,features:t,strict:n=!1}){const[,r]=h.useState(!aa(t)),s=h.useRef(void 0);if(!aa(t)){const{renderer:o,...i}=t;s.current=o,Ju(i)}return h.useEffect(()=>{aa(t)&&t().then(({renderer:o,...i})=>{Ju(i),s.current=o,r(!0)})},[]),a.jsx(sa.Provider,{value:{renderer:s.current,strict:n},children:e})}function aa(e){return typeof e=="function"}const Um=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Um.has(e)}let Ru=e=>!cr(e);function zm(e){typeof e=="function"&&(Ru=t=>t.startsWith("on")?!cr(t):e(t))}try{zm(require("@emotion/is-prop-valid").default)}catch{}function jm(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||be(e[s])||(Ru(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=h.createContext({});function Gm(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Km(e){const{initial:t,animate:n}=Gm(e,h.useContext(dr));return h.useMemo(()=>({initial:t,animate:n}),[el(t),el(n)])}function el(e){return Array.isArray(e)?e.join(" "):e}const oa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)!be(t[r])&&!Fu(r,n)&&(e[r]=t[r])}function Ym({transformTemplate:e},t){return h.useMemo(()=>{const n=oa();return ta(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Xm(e,t){const n=e.style||{},r={};return tl(r,n,e),Object.assign(r,Ym(e,t)),r}function Zm(e,t){const n={},r=Xm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nl=()=>({...oa(),attrs:{}});function Jm(e,t,n,r){const s=h.useMemo(()=>{const o=nl();return Lu(o,t,Bu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};tl(o,e.style,e),s.style={...o,...s.style}}return s}const Qm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ia(e){return typeof e!="string"||e.includes("-")?!1:!!(Qm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Rm(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??ia(e)?Jm:Zm)(t,r,s,e),d=jm(t,typeof e=="string",o),c=e!==h.Fragment?{...d,...l,ref:n}:{},{children:w}=t,p=h.useMemo(()=>be(w)?w.get():w,[w]);return h.createElement(e,{...c,children:p})}function eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:tg(n,r,s,e),renderState:t()}}function tg(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Vm(o[p]);let{initial:i,animate:u}=e;const l=ir(e),d=Au(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const p=Array.isArray(w)?w:[w];for(let f=0;f<p.length;f++){const g=zs(e,p[f]);if(g){const{transitionEnd:b,transition:v,...N}=g;for(const y in N){let C=N[y];if(Array.isArray(C)){const S=c?C.length-1:0;C=C[S]}C!==null&&(s[y]=C)}for(const y in b)s[y]=b[y]}}}return s}const rl=e=>(t,n)=>{const r=h.useContext(dr),s=h.useContext(Gn),o=()=>eg(e,t,r,s);return n?o():hs(o)},ng=rl({scrapeMotionValuesFromProps:na,createRenderState:oa}),rg=rl({scrapeMotionValuesFromProps:qu,createRenderState:nl}),sg=Symbol.for("motionComponentSymbol");function ag(e,t,n){const r=h.useRef(n);h.useInsertionEffect(()=>{r.current=n});const s=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const og=h.createContext({});function ig(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ug(e,t,n,r,s,o){var C,S;const{visualElement:i}=h.useContext(dr),u=h.useContext(sa),l=h.useContext(Gn),d=h.useContext(ra),c=d.reducedMotion,w=d.skipAnimations,p=h.useRef(null),f=h.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,b=h.useContext(og);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&lg(p.current,n,s,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const N=n[fu],y=h.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,N)));return oi(()=>{f.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),y.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,N)}),y.current=!1),g.enteringChildren=void 0)}),g}function lg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ig(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function sl(e){if(e)return e.options.allowProjection!==!1?e.projection:sl(e.parent)}function cg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":ia(e),i=o?rg:ng;function u(d,c){let w;const p={...h.useContext(ra),...d,layoutId:dg(d)},{isStatic:f}=p,g=Km(d),b=i(d,f);if(!f&&typeof window<"u"){wg(p,r);const v=fg(p);w=v.MeasureLayout,g.visualElement=ug(e,b,p,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...p}):null,Rm(e,d,ag(b,g.visualElement,c),b,f,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[sg]=e,l}function dg({layoutId:e}){const t=h.useContext(ai).id;return t&&e!==void 0?t+"-"+e:e}function wg(e,t){h.useContext(sa).strict,process.env.NODE_ENV}function fg(e){const t=Zu(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const pg=(e,t)=>t.isSVG??ia(e)?new Mm(t):new xm(t,{allowProjection:e!==h.Fragment});class hg extends Lt{constructor(t){super(t),t.animationState||(t.animationState=_m(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mg=0;class gg extends Lt{constructor(){super(...arguments),this.id=mg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=bt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const p in w)(o=this.node.getValue(p))==null||o.jump(w[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const bg={animation:{Feature:hg},exit:{Feature:gg}};function al(e){return{point:{x:e.pageX,y:e.pageY}}}function ol(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class yg extends Lt{mount(){const{current:t}=this.node;t&&(this.unmount=Qh(t,(n,r)=>(ol(this.node,r,"Start"),s=>ol(this.node,s,"End"))))}unmount(){}}class vg extends Lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(zu(this.node.current,"focus",()=>this.onFocus()),zu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function il(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class xg extends Lt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=rm(t,(s,o)=>(il(this.node,o,"Start"),(i,{success:u})=>il(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ua=new WeakMap,la=new WeakMap,Ng=e=>{const t=ua.get(e.target);t&&t(e)},Sg=e=>{e.forEach(Ng)};function Cg({root:e,...t}){const n=e||document;la.has(n)||la.set(n,{});const r=la.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Sg,{root:e,...t})),r[s]}function Tg(e,t,n){const r=Cg(t);return ua.set(e,n),r.observe(e),()=>{ua.delete(e),r.unobserve(e)}}const Eg={some:0,all:1};class Mg extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Eg[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:p}=this.node.getProps(),f=c?w:p;f&&f(d)};this.stopObserver=Tg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ig(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Ig({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ul={renderer:pg,...bg,...{inView:{Feature:Mg},tap:{Feature:xg},focus:{Feature:vg},hover:{Feature:yg}}};function Ag(e,t){return cg(e,t)}const ll=Ag("div"),kg=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Qo,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(zn,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Dg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Xo,{...r,children:[a.jsx(rn,{children:n||e.label}),t]})},_g=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(Cf,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ro,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Pg=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(lt.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(lt.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(ca,{thumbColor:n,railColor:r}),a.jsx(lt.Corner,{})]}));Wt.displayName=lt.Root.displayName;const ca=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(lt.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(lt.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));ca.displayName=lt.ScrollAreaScrollbar.displayName;const Vg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(Sf,{...l,open:s,onOpenChange:o,children:[a.jsx(Zo,{dir:u,children:r||n}),a.jsx(Nf,{children:a.jsx(Jo,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Og="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",da=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:p="start",sideOffset:f=0,side:g="bottom",alignOffset:b,className:v,disabled:N,...y}=e;return a.jsxs(Ko,{...y,open:i,onOpenChange:u,dir:c,children:[a.jsx(Yo,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Fg(s,o,N)}),a.jsx(fs,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:p,sideOffset:f,side:g,alignOffset:b,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(rn,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Fg=(e,t,n)=>{const r=m(Og,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=h.useState(!1);return a.jsx(da,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:4,Trigger:a.jsx(Ae,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-rounded-sm"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Wg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-2 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition wu-duration-200",t!==n?"wu-translate-x-0 wu-opacity-100 wu-z-50 wu-delay-200":i==="rtl"?"wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0":"-wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Lg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Qu,{features:ul,children:a.jsxs(Ku,{initial:!1,mode:"popLayout",children:[Bg(e).map((l,d)=>a.jsx(ll,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-leading-4 wu-font-normal wu-items-center wu-gap-2",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light wu-max-w-4 wu-flex wu-justify-center",i==="rtl"&&"wu-rotate-180")}),l.id==="LEVEL_DOTS"?a.jsx("span",{className:"wu-flex wu-justify-center wu-w-[11px]",children:l.title}):l.title]})},l.id)),"``"]})})})]})},Bg=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},qg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=h.useState(n?[n]:[]),[[c,w],p]=h.useState([t,1]),f=(N,y)=>{y&&d([...l,y]),p([N,1])},g=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);d(C)}p([N,-1])},b=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const S=l.findIndex(T=>T.id===C);S!==-1&&(d(l.slice(0,S+1)),g(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const y=typeof N.component=="function"?N.component({goNext:f,goBack:g}):N.component;return a.jsx(ll,{dir:u,custom:w,variants:$g(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:y},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Wg,{titles:l,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(Qu,{features:ul,children:a.jsx(Ku,{initial:!1,custom:w,mode:r,children:v()})})]})},$g=e=>{switch(e){case"slideRight":return Ug;case"slideLeft":return zg;case"fadeZoom":return jg;case"default":default:return Hg}},Hg={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},Ug={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},zg={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},jg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},cl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(dt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});cl.displayName="WuFooter";const dl=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Pr(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});dl.displayName="WuHelpButton";const rt=(e,t)=>`wu-listbox-${e}`;function Gg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:p,className:f})=>h.createElement(nn,{...d,key:JSON.stringify(p),onSelect:()=>r==null?void 0:r(p),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(p))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",f,rt("item")),disabled:p.disabled},s&&a.jsx(He,{checked:l==null?void 0:l(p)}),u?u({value:p,isSelected:l==null?void 0:l(p)}):a.jsx(a.Fragment,{children:p[n.label]}));if(c){const p=t[n.group],f=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(tn,{heading:f,children:p==null?void 0:p.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const Kg=h.memo(Gg),Yg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(jo,{...n,"aria-label":"Search",className:m("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;",rt("input"),t)})]})},Xg=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(nn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(He,{checked:o,partial:u}),t||"Select All"]})},Zg=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[p,f]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!r){f(null);return}f(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,f]),a.jsx(wt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,rt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!p&&"wu-font-light"),children:p||s}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",rt("drop-icon"))})]})})},wl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Jg=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>wl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else wl(i,s,n)&&o.push(i)}return o},fl=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:p,disabled:f,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:S,className:T,listClass:D,placeholder:A="Select items...",variant:k,labelPosition:M="top",maxContentWidth:_,maxContentHeight:P,modal:E,...V}=e,[L,O]=h.useState(!1),[W,q]=h.useState(""),[$,G]=h.useState(r),Z=h.useMemo(()=>n,[n]),H=h.useMemo(()=>{if(!b||!W)return t;const F=W.toLowerCase().trim();return Jg(t,F,n)},[t,W,n.label,b]),J=F=>{g?G(U=>{const Y=F[n.value],K=Array.isArray(U)?U:[],j=K.some(ee=>ee[n.value]===Y)?K.filter(ee=>ee[n.value]!==Y):[...K,F];return w&&w(j),j}):(G(F),w&&w(F),O(!1))},ie=h.useCallback(F=>{const U=F?t:[];G(U),v!=null&&v.onSelectAll&&v.onSelectAll(F),w&&w(U)},[t,v,w]),fe=F=>Array.isArray($)?$.some(U=>U[n.value]===F[n.value]):($==null?void 0:$[n.value])===F[n.value];h.useEffect(()=>{G(r)},[r]);const Se=F=>{const U=(Y,K)=>{const me=n.group&&Array.isArray(Y[n.group]),j=y&&me&&K>0&&F.length>1;return a.jsxs(h.Fragment,{children:[j&&a.jsx(ws,{}),a.jsx(Kg,{option:Y,accessorKey:Z,multiple:g,onSelect:ee=>J(ee),dir:S,GroupLabel:i,Item:s,isSelected:ee=>fe(ee)})]},JSON.stringify(Y))};return F.length>N?a.jsx(It,{list:F,callback:(Y,K)=>U(K,Y),dir:S}):F.map((Y,K)=>U(Y,K))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",rt("container")),dir:S,children:[o&&a.jsx(ke,{htmlFor:C,className:rt("label"),children:o}),a.jsxs(Ge,{open:L,onOpenChange:F=>{O(F),F||setTimeout(()=>{q("")},100)},modal:E,children:[a.jsx(Zg,{CustomTrigger:l,disabled:f,value:$,accessorKey:n,placeholder:A,Chip:c,className:T,handleUnselect:J,variant:k,id:C,dir:S,...V}),a.jsx($e,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",rt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(ls,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(Yg,{value:W,onValueChange:q}),u,a.jsxs(cs,{className:m("wu-overflow-y-auto",rt("list"),D),onScroll:p,style:{maxHeight:P||"420px"},children:[a.jsx(ds,{children:d||"No results found."}),a.jsx(tn,{children:g&&(v==null?void 0:v.enabled)&&!W&&a.jsx(Xg,{data:t,value:$,onSelectAll:ie,label:v.label})}),a.jsx(tn,{children:Se(H)})]})]})})]})]})},wa=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});wa.displayName="WuMenuIcon";const pl={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%]"},hl=te.Root,ml=te.Trigger,Qg=te.Portal,Rg=te.Close,gl=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",pl.overlay,e),...t}));gl.displayName=te.Overlay.displayName;const fa=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Qg,{children:[a.jsx(gl,{className:r?"wu-bg-transparent":""}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",pl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));fa.displayName=te.Content.displayName;const pa=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});pa.displayName="DialogHeader";const bl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});bl.displayName="DialogFooter";const ha=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ha.displayName=te.Title.displayName;const eb=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));eb.displayName=te.Description.displayName;const tb={gradientBackground:"_gradientBackground_1uc4j_1"},yl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const p=f=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=d.getBoundingClientRect();let b=f.clientX-g.left,v=f.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const N=`radial-gradient(
16
16
  var(--width) var(--height) ellipse at ${b}px ${v}px,
17
17
  var(--colors)
18
- )`;d.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",p),()=>{window.removeEventListener("mousemove",p),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(tb.gradientBackground,"wu-transform-gpu",s),...u,children:r})},fr={wuModalBodyWrapper:"_wuModalBodyWrapper_uaelx_1","wu-modal-footer":"_wu-modal-footer_uaelx_5","wu-modal-content":"_wu-modal-content_uaelx_5","wu-modal-header":"_wu-modal-header_uaelx_9"},vl="calc(100vh - 64px)",nb={sm:"400px",md:"600px",lg:"1200px"},rb=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:d,className:c,style:w,variant:p="action",...f})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(hl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(ml,{asChild:!0,children:e}),a.jsx(fa,{style:{width:"calc(100% - 64px)",maxWidth:l||nb[n],maxHeight:d||vl,...w},hideCloseButton:r,onInteractOutside:b=>s&&b.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":p,className:m("wu-group wu-rounded-[.88rem]",fr.wuModalBodyWrapper,c),...f,children:a.jsx(yl,{colors:g[p],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",c),style:{maxHeight:d||vl},children:t})})]})},sb=({children:e,className:t,...n})=>a.jsx("div",{className:m("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",fr["wu-modal-content"],t),...n,children:e}),ab=({children:e,className:t,...n})=>a.jsx(pa,{...n,"data-variant":"action",className:m("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-[.88rem] wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",fr["wu-modal-header"],t),children:a.jsx(ha,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),ob=({children:e,className:t,...n})=>a.jsx(bl,{...n,className:m("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",fr["wu-modal-footer"],t),children:e}),ib=({children:e,className:t,...n})=>{const r=h.useRef(null);return a.jsx(Rg,{asChild:!0,children:a.jsx(Ae,{className:t,ref:r,...n,children:e})})},ub=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,width:w,...p})=>{const[f,g]=h.useState(""),[b,v]=h.useState(e);h.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),g("");return}const y=r.label;if(n&&Array.isArray(t)){const C=t.map(S=>S[y]).join(", ");g(C)}else!n&&!Array.isArray(t)&&g(t[y])},[t,r.label,n,e]);const N=()=>e&&!f?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):a.jsx("span",{className:m("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:c?(d==null?void 0:d.triggerText)??f:f});return a.jsx(Yo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...p,disabled:l,className:m("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",p.className),children:[i??N(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},xl=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=c=>{e.disabled||(r(e),n&&c.preventDefault())};return a.jsxs(Un,{onClick:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(He,{checked:l}),a.jsx(Nl,{option:e,accessorKey:s})]})},Nl=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Sl=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Un,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(He,{"data-partial":s,checked:r||s,partial:s}),a.jsx(Nl,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Xo,{dir:o.dir,children:[a.jsx(rn,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>h.createElement(xl,{...o,option:u,key:l}))]});case"divider":return a.jsx(jn,{className:"wu-mx-4"});default:return a.jsx(xl,{...o,option:t})}},lb=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},cb=100,db=400,Cl=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:d,virtualizedThreshold:c=cb,maxHeight:w=db,hasGroup:p=!1,Header:f,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:N="top",onScroll:y,maxContentWidth:C,selectedToTop:S=!1,...T})=>{const[D,A]=h.useState(),k=h.useRef(null),[M,_]=h.useState(!1),[P,E]=h.useState(!1),{cleanData:V,enabledOptions:L}=lb(e),O=h.useMemo(()=>n&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,n]),W=h.useCallback(H=>{const J=H[o.value];if(n)A((ie=[])=>{const fe=ie,F=fe.some(z=>z[o.value]===J)?fe.filter(z=>z[o.value]!==J):[...fe,H];return t==null||t(F),F});else{const ie=H;A(ie),t==null||t(ie)}},[n,o.value,t]);h.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&A(void 0),r!==void 0&&A(r),s!==void 0&&A(s)},[r,s]);const q=Go(S,O,D,o),$=q.length>c;h.useEffect(()=>{if(!n)return;const H=b!=null&&b.includeDisabled?(D==null?void 0:D.length)===e.length:(D==null?void 0:D.length)===L.length;_(H);const J=(D==null?void 0:D.length)>0&&!H;E(J)},[D,b]);const G=h.useCallback(()=>{const H=M?[]:b!=null&&b.includeDisabled?p?V:e:L;A(H),t==null||t(H)},[M,n,e,L,t,b]),Z=kn(N);return a.jsxs("div",{className:m(Z,"wu-flex wu-select-container"),ref:k,dir:u,children:[a.jsxs(Ko,{children:[a.jsx(ub,{...T,value:D,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:g,id:T.id,disabled:v,selectAll:b,isCheckedAll:M}),a.jsxs(fs,{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:T.id,style:{maxWidth:C},children:[f,$?a.jsx(It,{list:q,containerHeight:w,callback:(H,J)=>a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,dir:u,handleSelectAll:G,isCheckedAll:M,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:q.map(H=>{const J=H,ie=String(J[o.value]??J.type);return a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,handleSelectAll:G,isCheckedAll:M,dir:u,isPartialSelected:P},ie)})})]})]}),d&&a.jsx(ke,{htmlFor:T.id,className:"wu-select-label",children:d})]})},pr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wb=({value:e,onChange:t,min:n=U.sub(new Date,{years:5}),max:r=U.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:d,disabledMonths:c=[],...w})=>{const[p,f]=h.useState(null),[g,b]=h.useState(""),[v,N]=h.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=h.useMemo(()=>{const S=new Date(n).getFullYear(),T=new Date(r).getFullYear();return Array.from({length:T-S+1},(D,A)=>({value:T-A,label:T-A}))},[n,r]);h.useEffect(()=>{if(e){const S=new Date(e),T=S.getFullYear(),D=S.getMonth();f({year:T,month:D}),b(`${pr[D]} ${T}`),N({value:T,label:T})}},[e]);const C=()=>{p&&t&&(t(new Date(p.year,p.month,15)),b(`${pr[p.month]} ${p.year}`))};return a.jsxs("div",{className:m("wu-flex wu-flex-col wu-items-center",kn(i),i==="top"&&"wu-items-start"),children:[a.jsxs(Ge,{children:[a.jsx(Gr,{...w,disabled:u||d,id:l,dir:"ltr",placeholder:s,formattedString:g}),a.jsxs($e,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(Cl,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:S=>N(S),multiple:!1,maxHeight:224})}),a.jsx(fb,{year:v==null?void 0:v.value,selectedMonth:p==null?void 0:p.month,selectedYear:p==null?void 0:p.year,onClick:(S,T)=>f({year:T,month:S}),disabledMonths:c}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(ke,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},fb=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=h.useMemo(()=>{const d=new Set;return s.forEach(c=>{const w=typeof c=="string"?new Date(c):c;d.add(`${w.getFullYear()}-${w.getMonth()}`)}),d},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:pr.map((d,c)=>{const w=e===i&&c===u,p=t===c&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${c}`),onClick:()=>r(c,e),className:m("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",p&&"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":`${pr[c]} ${e}`,"data-month":c,"data-year":e,children:d},d)})})},Tl=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=h.useState([]),[u,l]=h.useState([]);return h.useEffect(()=>{const d=()=>{var g,b;const c=((g=t.current)==null?void 0:g.clientWidth)||0,w=((b=n.current)==null?void 0:b.clientWidth)||0,p=c-w,f=Math.floor(p/r);i(e.slice(0,f)),l(e.slice(f))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,r]),[o,u]},El={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},pb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((c,w)=>h.cloneElement(c,{className:m(El.wuPrimaryLink,c.props.className,"wu-primary-nav-link"),key:w})),[t]),i=h.useRef(null),u=h.useRef(null),[l,d]=Tl(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),d.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(El.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},ma={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},hb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((w,p)=>h.cloneElement(w.link,{key:p,className:m(ma.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[h.cloneElement(w.imgOrIcon,{className:m("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),[d,c]=Tl(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:m(ma.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:d}),c.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(ma.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},Ml=h.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,d]=h.useState(t),[c,w]=h.useState(n);h.useEffect(()=>{d(t),w(n)},[t,n]);const p=Math.ceil(e/c),f=l*c+1,g=Math.min((l+1)*c,e),b=Array.from({length:p},(y,C)=>C),v=h.useCallback(y=>{y>=0&&y<p&&(d(y),r==null||r(y))},[p,r]),N=224;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Il,{label:"Previous page",onClick:()=>v(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(da,{name:`${f} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Wt,{style:{maxHeight:N+"px"},dir:i.dir,children:b.length>100?a.jsx(It,{className:"wu-pagination-list",containerHeight:N,list:b,callback:(y,C)=>a.jsxs(wr,{onSelect:()=>v(C),className:m("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*c+1," -"," ",Math.min((C+1)*c,e)]},y)}):b.map(y=>a.jsxs(wr,{onSelect:()=>v(y),className:m(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*c+1," -"," ",Math.min((y+1)*c,e)]},y))})}),a.jsx(Il,{label:"Next page",onClick:()=>v(l+1),disabled:l===p-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ml.displayName="WuPagination";const Il=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(Ae,{variant:"iconOnly",onClick:t,disabled:n,className:m("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:m("wu-text-sm",r)})}),Al=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));Al.displayName=jt.Root.displayName;const kl=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Item,{ref:n,className:m("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(jt.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));kl.displayName=jt.Item.displayName;const Dl=h.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(Al,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:m("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Pn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(kl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Pn,{htmlFor:l.value,className:m(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});Dl.displayName="WuRadioGroup";const mb=e=>{const{children:t,...n}=e;return a.jsxs(Wt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(ca,{orientation:"horizontal"})]})},_l=x.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:m("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));_l.displayName="Input";const Pl=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(Ga.Root,{ref:s,decorative:n,orientation:t,className:m("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Pl.displayName=Ga.Root.displayName;function Vl({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const ga=768;function ba(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ga-1}px)`),r=()=>{t(window.innerWidth<ga)};return n.addEventListener("change",r),t(window.innerWidth<ga),()=>n.removeEventListener("change",r)},[]),!!e}const gb="sidebar_state",bb=3600*24*7,yb="256px",vb="256px",xb="3rem",Nb="b",Ol=x.createContext(null);function st(){const e=x.useContext(Ol);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Fl=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=ba(),[d,c]=x.useState(!1),[w,p]=x.useState(l?!0:e),f=t??w,g=x.useCallback(y=>{const C=typeof y=="function"?y(f):y;n?n(C):p(C),document.cookie=`${gb}=${C}; path=/; max-age=${bb}`},[n,f]),b=x.useCallback(()=>l?c(y=>!y):g(y=>!y),[l,g,c]);x.useEffect(()=>{const y=C=>{C.key===Nb&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=f?"expanded":"collapsed",N=x.useMemo(()=>({state:v,open:f,setOpen:g,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:b}),[v,f,g,l,d,c,b]);return a.jsx(Ol.Provider,{value:N,children:a.jsx(no,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":yb,"--sidebar-width-icon":xb,...s},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Fl.displayName="SidebarProvider";const Ll=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:d,setOpenMobile:c}=st();return n==="none"?a.jsx("div",{className:m("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(ni,{open:d,onOpenChange:c,...o,children:a.jsx(ps,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":vb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:m("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:m("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});Ll.displayName="Sidebar";const Wl=x.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=st();return a.jsxs(Et,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:m("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Wl.displayName="SidebarTrigger";const Sb=x.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=st();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:m("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});Sb.displayName="SidebarRail";const Bl=x.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:m("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));Bl.displayName="SidebarInset";const Cb=x.forwardRef(({className:e,...t},n)=>a.jsx(_l,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));Cb.displayName="SidebarInput";const ql=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:m("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));ql.displayName="SidebarHeader";const $l=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:m("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));$l.displayName="SidebarFooter";const Tb=x.forwardRef(({className:e,...t},n)=>a.jsx(Pl,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));Tb.displayName="SidebarSeparator";const Hl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:m("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Hl.displayName="SidebarContent";const zl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:m("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));zl.displayName="SidebarGroup";const Ul=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:m("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});Ul.displayName="SidebarGroupLabel";const Eb=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:m("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});Eb.displayName="SidebarGroupAction";const jl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:m("wu-w-full wu-text-sm",e),...t}));jl.displayName="SidebarGroupContent";const ya=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:m("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));ya.displayName="SidebarMenu";const Gl=x.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("wu-group/menu-item wu-relative",e),...t}));Gl.displayName="SidebarMenuItem";const Mb=qe.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"}}),Kl=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?Ct.Slot:"button",{isMobile:d,state:c}=st(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:m(Mb({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ro,{children:[a.jsx(so,{asChild:!0,children:w}),a.jsx(Ur,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):w});Kl.displayName="SidebarMenuButton";const Ib=x.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?Ct.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:m("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});Ib.displayName="SidebarMenuAction";const Ab=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Ab.displayName="SidebarMenuBadge";const kb=x.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:m("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Vl,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Vl,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});kb.displayName="SidebarMenuSkeleton";const Db=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Db.displayName="SidebarMenuSub";const _b=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));_b.displayName="SidebarMenuSubItem";const Pb=x.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?Ct.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:m("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Pb.displayName="SidebarMenuSubButton";function Vb(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,o=t!==void 0,[i,u]=as({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:d,transitionStatus:c}=of(i,!0,!0),[w,p]=x.useState(i),[{height:f,width:g},b]=x.useState({height:void 0,width:void 0}),v=yo(),[N,y]=x.useState(),C=N??v,[S,T]=x.useState(!1),[D,A]=x.useState(!1),k=x.useRef(null),M=x.useRef(null),_=x.useRef(null),P=x.useRef(null),E=Do(P,!1),V=ge(L=>{const O=!i,W=De(uf,L.nativeEvent);if(r(O,W),W.isCanceled)return;const q=P.current;M.current==="css-animation"&&q!=null&&q.style.removeProperty("animation-name"),!S&&!D&&(M.current!=null&&M.current!=="css-animation"&&!l&&O&&d(!0),M.current==="css-animation"&&(!w&&O&&p(!0),!l&&O&&d(!0))),u(O),M.current==="none"&&l&&!O&&d(!1)});return re(()=>{o&&M.current==="none"&&!D&&!i&&d(!1)},[o,D,i,t,d]),x.useMemo(()=>({abortControllerRef:k,animationTypeRef:M,disabled:s,handleTrigger:V,height:f,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:E,setDimensions:b,setHiddenUntilFound:T,setKeepMounted:A,setMounted:d,setOpen:u,setPanelIdState:y,setVisible:p,transitionDimensionRef:_,transitionStatus:c,visible:w,width:g}),[k,M,s,V,f,l,i,C,P,E,b,T,A,d,u,p,_,c,w,g])}const va=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(va.displayName="CollapsibleRootContext");function Yl(){const e=x.useContext(va);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Gt(15));return e}let pn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zt.startingStyle]="startingStyle",e[e.endingStyle=Zt.endingStyle]="endingStyle",e})({}),Ob=(function(e){return e.panelOpen="data-panel-open",e})({});const Fb={[pn.open]:""},Lb={[pn.closed]:""},Wb={open(e){return e?{[Ob.panelOpen]:""}:null}},Xl={...{open(e){return e?Fb:Lb}},...ko},Zl=x.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,...d}=t,c=ge(u),w=Vb({open:l,defaultOpen:o,onOpenChange:c,disabled:i}),p=x.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),f=x.useMemo(()=>({...w,onOpenChange:c,state:p}),[w,c,p]),g=Ye("div",t,{state:p,ref:n,props:d,stateAttributesMapping:Xl});return a.jsx(va.Provider,{value:f,children:g})});process.env.NODE_ENV!=="production"&&(Zl.displayName="CollapsibleRoot");const Jl=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jl.displayName="CompositeRootContext");function Bb(e=!1){const t=x.useContext(Jl);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Gt(16));return t}function qb(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:x.useMemo(()=>{const d={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(d.tabIndex=s,!o&&n&&(d.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||u)&&(d.disabled=n),d},[r,n,t,i,u,o,s])}}function xa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=x.useRef(null),u=Bb(!0),l=o??u!==void 0,{props:d}=qb({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{var g,b;if(!i.current)return;const f=hr(i.current);if(s){if(!f){const v=((g=ft.captureOwnerStack)==null?void 0:g.call(ft))||"";To(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${v}`)}}else if(f){const v=((b=ft.captureOwnerStack)==null?void 0:b.call(ft))||"";To(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${v}`)}},[s]);const c=x.useCallback(()=>{const f=i.current;hr(f)&&l&&t&&d.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,d.disabled,l]);re(c,[c]);const w=x.useCallback((f={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:N,onPointerDown:y,...C}=f;return po({type:s?"button":void 0,onClick(T){if(t){T.preventDefault();return}g==null||g(T)},onMouseDown(T){t||b==null||b(T)},onKeyDown(T){if(t||(Qr(T),N==null||N(T),T.baseUIHandlerPrevented))return;const D=T.target===T.currentTarget,A=T.currentTarget,k=hr(A),M=!s&&$b(A),_=D&&(s?k:!M),P=T.key==="Enter",E=T.key===" ",V=A.getAttribute("role"),L=(V==null?void 0:V.startsWith("menuitem"))||V==="option"||V==="gridcell";if(D&&l&&E){if(T.defaultPrevented&&L)return;T.preventDefault(),M||s&&k?(A.click(),T.preventBaseUIHandler()):_&&(g==null||g(T),T.preventBaseUIHandler());return}_&&(!s&&(E||P)&&T.preventDefault(),!s&&P&&(g==null||g(T)))},onKeyUp(T){if(!t){if(Qr(T),v==null||v(T),T.target===T.currentTarget&&s&&l&&hr(T.currentTarget)&&T.key===" "){T.preventDefault();return}T.baseUIHandlerPrevented||T.target===T.currentTarget&&!s&&!l&&T.key===" "&&(g==null||g(T))}},onPointerDown(T){if(t){T.preventDefault();return}y==null||y(T)}},s?void 0:{role:"button"},d,C)},[t,d,l,s]),p=ge(f=>{i.current=f,c()});return{getButtonProps:w,buttonRef:p}}function hr(e){return Gw(e)&&e.tagName==="BUTTON"}function $b(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Hb={...Wb,...ko},Ql=x.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:i,disabled:u}=Yl(),{className:l,disabled:d=u,id:c,render:w,nativeButton:p=!0,...f}=t,{getButtonProps:g,buttonRef:b}=xa({disabled:d,focusableWhenDisabled:!0,native:p}),v=x.useMemo(()=>({"aria-controls":s?r:void 0,"aria-expanded":s,onClick:o}),[r,s,o]);return Ye("button",t,{state:i,ref:[n,b],props:[v,f,g],stateAttributesMapping:Hb})});process.env.NODE_ENV!=="production"&&(Ql.displayName="CollapsibleTrigger");let zb=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Ub(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:s,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:d,open:c,panelRef:w,runOnceAnimationsFinish:p,setDimensions:f,setMounted:g,setOpen:b,setVisible:v,transitionDimensionRef:N,visible:y,width:C}=e,S=x.useRef(!1),T=x.useRef(null),D=x.useRef(c),A=x.useRef(c),k=Ao(),M=x.useMemo(()=>n.current==="css-animation"?!y:!c&&!l,[c,l,y,n]),_=ge(E=>{if(!E)return;if(n.current==null||N.current==null){const O=getComputedStyle(E),W=O.animationName!=="none"&&O.animationName!=="",q=O.transitionDuration!=="0s"&&O.transitionDuration!=="";W&&q?process.env.NODE_ENV!=="production"&&ts("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):O.animationName==="none"&&O.transitionDuration!=="0s"?n.current="css-transition":O.animationName!=="none"&&O.transitionDuration==="0s"?n.current="css-animation":n.current="none",E.getAttribute(zb.orientation)==="horizontal"||O.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(n.current!=="css-transition")return;(s===void 0||C===void 0)&&(f({height:E.scrollHeight,width:E.scrollWidth}),A.current&&E.style.setProperty("transition-duration","0s"));let V=-1,L=-1;return V=le.request(()=>{A.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{le.cancel(V),le.cancel(L)}}),P=Fn(r,w,_);return re(()=>{if(n.current!=="css-transition")return;const E=w.current;if(!E)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),c){const L={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};Object.keys(L).forEach(O=>{E.style.setProperty(O,"initial","important")}),!A.current&&!i&&E.setAttribute(pn.startingStyle,""),f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{Object.entries(L).forEach(([O,W])=>{W===""?E.style.removeProperty(O):E.style.setProperty(O,W)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;f({height:E.scrollHeight,width:E.scrollWidth});const L=new AbortController;t.current=L;const O=L.signal;let W=null;const q=pn.endingStyle;return W=new MutationObserver($=>{$.some(Z=>Z.type==="attributes"&&Z.attributeName===q)&&(W==null||W.disconnect(),W=null,p(()=>{f({height:0,width:0}),E.style.removeProperty("content-visibility"),g(!1),t.current===L&&(t.current=null)},O))}),W.observe(E,{attributes:!0,attributeFilter:[q]}),()=>{W==null||W.disconnect(),k.cancel(),t.current===L&&(L.abort(),t.current=null)}}return()=>{le.cancel(V)}},[t,n,k,o,i,l,c,w,p,f,g]),re(()=>{if(n.current!=="css-animation")return;const E=w.current;E&&(T.current=E.style.animationName||T.current,E.style.setProperty("animation-name","none"),f({height:E.scrollHeight,width:E.scrollWidth}),!D.current&&!S.current&&E.style.removeProperty("animation-name"),c?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,p(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,c,w,p,f,g,v,y]),Ln(()=>{const E=le.request(()=>{D.current=!1});return()=>le.cancel(E)}),re(()=>{if(!o)return;const E=w.current;if(!E)return;let V=-1,L=-1;return c&&S.current&&(E.style.transitionDuration="0s",f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{S.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})})),()=>{le.cancel(V),le.cancel(L)}},[o,c,w,f]),re(()=>{const E=w.current;E&&o&&M&&(E.setAttribute("hidden","until-found"),n.current==="css-transition"&&E.setAttribute(pn.startingStyle,""))},[o,M,n,w]),x.useEffect(function(){const V=w.current;if(!V)return;function L(O){S.current=!0,b(!0),d(!0,De(Jt,O))}return V.addEventListener("beforematch",L),()=>{V.removeEventListener("beforematch",L)}},[d,w,b]),x.useMemo(()=>({props:{hidden:M,id:u,ref:P}}),[M,u,P])}let Rl=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const ec=x.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:o,render:i,id:u,...l}=t;process.env.NODE_ENV!=="production"&&re(()=>{s&&o===!1&&ts("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[s,o]);const{abortControllerRef:d,animationTypeRef:c,height:w,mounted:p,onOpenChange:f,open:g,panelId:b,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setHiddenUntilFound:C,setKeepMounted:S,setMounted:T,setPanelIdState:D,setOpen:A,setVisible:k,state:M,transitionDimensionRef:_,visible:P,width:E,transitionStatus:V}=Yl(),L=s??!1,O=o??!1;re(()=>{if(u)return D(u),()=>{D(void 0)}},[u,D]),re(()=>{C(L)},[C,L]),re(()=>{S(O)},[S,O]);const{props:W}=Ub({abortControllerRef:d,animationTypeRef:c,externalRef:n,height:w,hiddenUntilFound:L,id:b,keepMounted:O,mounted:p,onOpenChange:f,open:g,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setMounted:T,setOpen:A,setVisible:k,transitionDimensionRef:_,visible:P,width:E});af({open:g&&V==="idle",ref:v,onComplete(){g&&y({height:void 0,width:void 0})}});const q=x.useMemo(()=>({...M,transitionStatus:V}),[M,V]),$=Ye("div",t,{state:q,ref:[n,v],props:[W,{style:{[Rl.collapsiblePanelHeight]:w===void 0?"auto":`${w}px`,[Rl.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},l],stateAttributesMapping:Xl});return O||L||!O&&p?$:null});process.env.NODE_ENV!=="production"&&(ec.displayName="CollapsiblePanel");const jb=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Fl,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(Ll,{variant:"sidebar",collapsible:"icon",className:m("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(ql,{className:"wu-py-2",children:a.jsx(tc,{})}),t]}),a.jsx(Bl,{className:"wu-contain-inline-size",children:e})]}),tc=e=>{const{state:t,isMobile:n,openMobile:r}=st();return a.jsx(Wl,{...e,children:a.jsx(wa,{showMenu:n?r:t==="expanded"})})},Gb=({className:e,children:t,...n})=>{const r=h.useRef(null),s=h.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:d,scrollHeight:c}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+d!==c)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Hl,{...n,className:m("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(Wt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Kb=e=>a.jsx($l,{...e,children:e.children}),Yb=({label:e,children:t,...n})=>a.jsxs(zl,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Ul,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(jl,{children:a.jsx(ya,{children:t})})]}),Xb=e=>a.jsx(ya,{...e}),nc=({Icon:e,children:t,className:n,isActive:r,...s})=>{var w;const{state:o}=st(),[i,u]=h.useState(),l=ba(),d=h.isValidElement(t)?h.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),c=h.useRef(null);return h.useEffect(()=>{var p;u(((p=c.current)==null?void 0:p.textContent)||"")},[]),a.jsx(Gl,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Kl,{className:m("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:h.isValidElement(t),ref:c,children:d})})},Zb=({Title:e,Icon:t,children:n,className:r,...s})=>{const{state:o}=st(),i=ba();return a.jsxs(Zl,{children:[a.jsx(Ql,{render:u=>{const l="data-panel-open"in u;return a.jsxs(nc,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Pe,{icon:"wm-arrow-forward-ios",className:m("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(ec,{className:m(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',r),...s,children:n})]})},Jb=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),Na=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},Qb=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Jb.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},hn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Rb=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,d={border:l?`4px solid ${Na(r,hn.BORDER_LIGHTNESS)}`:"",...o},c={backgroundColor:Na(r,s*hn.LIGHTNESS_STEP),fontSize:l?hn.FONT_SIZE_ACTIVE:hn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:Na(r,45+s*6),height:hn.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:m("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:d,...i,children:[a.jsx("div",{style:c,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},ey=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(hl,{open:o,onOpenChange:i,children:[a.jsx(ml,{className:m("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(fa,{className:m("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(ha,{}),a.jsx(za.DialogClose,{className:m("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(pa,{className:m("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})},rc=0;class Sa extends Wn{constructor(){super(...arguments);Ee(this,"clear",()=>{this.currentId!==rc&&(clearInterval(this.currentId),this.currentId=rc)})}static create(){return new Sa}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function ty(){const e=Je(Sa.create).current;return Ln(e.disposeEffect),e}function sc(e){const t=Je(ny,e).current;return t.next=e,re(t.effect),t}function ny(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ry(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}const ac={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},sy={...ac,position:"fixed",top:0,left:0},ay={...ac,position:"absolute"},Ca=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ca.displayName="NumberFieldRootContext");function mr(){const e=x.useContext(Ca);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Gt(43));return e}const mn={inputValue:()=>null,value:()=>null,...Xr},oc=new Map;function gn(e,t){const n=JSON.stringify({locale:e,options:t}),r=oc.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return oc.set(n,s),s}function Bt(e,t,n){return e==null?"":gn(t,n).format(e)}function ic(e,t,n){return Bt(e,t,{...n,maximumFractionDigits:20})}const oy=["零","〇","一","二","三","四","五","六","七","八","九"],iy={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},uc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],lc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ta=["0","1","2","3","4","5","6","7","8","9"],cc=["%","٪","%","﹪"],dc=["‰","؉"],wc=["−","-","‒","–","—","﹣"],fc=["+","﹢"],uy=".",ly=",",cy=new RegExp(`[${uc.join("")}]`,"g"),dy=new RegExp(`[${lc.join("")}]`,"g"),wy=new RegExp(`[${Ta.join("")}]`,"g"),fy=new RegExp(`[${oy.join("")}]`,"g"),py=new RegExp(`[${cc.join("")}]`),hy=new RegExp(`[${dc.join("")}]`),Ea=/[٠١٢٣٤٥٦٧٨٩]/,pc=/[۰۱۲۳۴۵۶۷۸۹]/,Ma=/[零〇一二三四五六七八九]/,hc=new RegExp(`[${Ta.join("")}]`),my=[".",",",uy,ly,"٫","٬"],mc=new RegExp("\\p{Zs}","u"),gy=["+",...fc],by=["-",...wc],gr=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),yy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),gc=e=>`[${e.map(yy).join("")}]`,bc=gc(["-"].concat(wc)),yc=gc(["+"].concat(fc)),vc=new RegExp(bc,"gu"),xc=new RegExp(yc,"gu"),bn=new RegExp(bc),br=new RegExp(yc);function Ia(e,t){const n=gn(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),gn(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function yn(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(vc,"-").replace(xc,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Ea.test(r)||pc.test(r)?u="ar":Ma.test(r)&&(u="zh"));const{group:l,decimal:d,currency:c}=Ia(u,n),w=gn(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>gr(A.value)),p=w.length?new RegExp(w.join("|"),"g"):null;let f=null;l&&(new RegExp("\\p{Zs}","u").test(l)?f=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?f=/['’]/g:f=new RegExp(gr(l),"g"));let b=[{regex:l?f:null,replacement:""},{regex:d?new RegExp(gr(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:c?new RegExp(gr(c),"g"):null,replacement:""},{regex:p,replacement:""},{regex:cy,replacement:A=>String(uc.indexOf(A))},{regex:dy,replacement:A=>String(lc.indexOf(A))},{regex:wy,replacement:A=>String(Ta.indexOf(A))},{regex:fy,replacement:A=>iy[A]}].reduce((A,{regex:k,replacement:M})=>k?A.replace(k,M):A,r);const v=b.lastIndexOf(".");if(v!==-1&&(b=`${b.slice(0,v).replace(/\./g,"")}.${b.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const N=(s?"-":"")+b;let y=parseFloat(N);const C=n==null?void 0:n.style,S=C==="unit"&&(n==null?void 0:n.unit)==="percent",T=py.test(e)||C==="percent";return hy.test(e)?y/=1e3:!S&&T&&(y/=100),Number.isNaN(y)?null:y}const vy=60,xy=400,Ny=50,Sy=3,Cy=8,yr=1;function Ty(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ey=1e-10;function My(e){const t=gn("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Iy(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Aa(e,t){const{maximumFractionDigits:n}=My(t);return Iy(e,n)}function Ay(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Ey*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let d;return r==="nearest"?d=Math.round(l):o>0?d=Math.floor(l):d=Math.ceil(l),t+d*(r==="nearest"?n:s)}function ky(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const d=l?Ty(e,n,r):e;if(t!=null&&i){if(t===0)return Aa(d,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const w=Ay(d,c,t,u?"nearest":"directional");return Aa(w,o)}return Aa(d,o)}const Nc=x.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:d=!1,disabled:c=!1,readOnly:w=!1,name:p,defaultValue:f,value:g,onValueChange:b,onValueCommitted:v,allowWheelScrub:N=!1,snapOnStep:y=!1,allowOutOfRange:C=!1,format:S,locale:T,render:D,className:A,inputRef:k,...M}=t,{setDirty:_,validityData:P,disabled:E,setFilled:V,invalid:L,name:O,state:W,validation:q,shouldValidateOnChange:$}=Vn(),G=E||c,Z=O??p,H=u==="any"?1:u,[J,ie]=x.useState(!1),fe=s??Number.MIN_SAFE_INTEGER,Se=o??Number.MAX_SAFE_INTEGER,F=s??0,z=S==null?void 0:S.style,Y=x.useRef(null),K=Fn(k,q.inputRef),me=_o({id:r}),[j,ee]=as({controlled:g,default:f,name:"NumberField",state:"value"}),Q=j??null,ye=sc(Q);re(()=>{V(Q!==null)},[V,Q]);const je=ry(),Ce=sc(S),Te=x.useRef(!1),xt=ge((R,X)=>{Te.current=!1,v==null||v(R,X)}),Cn=Co(),Mr=ty(),Tn=Co(),En=x.useRef(!1),Mn=x.useRef(0),Xe=x.useRef(!0),ue=x.useRef(null),ot=x.useRef(()=>{}),[Nt,Ir]=x.useState(()=>g!==void 0?Sc(Q,T,S):Bt(Q,T,S)),[vd,Tv]=x.useState("numeric"),xd=ge(()=>{const{decimal:R,group:X,currency:ce,literal:pe}=Ia(T,S),se=new Set;my.forEach(ve=>se.add(ve)),R&&se.add(R),X&&(se.add(X),mc.test(X)&&se.add(" "));const We=z==="percent"||z==="unit"&&(S==null?void 0:S.unit)==="percent",Be=z==="percent"||z==="unit"&&(S==null?void 0:S.unit)==="permille";return We&&cc.forEach(ve=>se.add(ve)),Be&&dc.forEach(ve=>se.add(ve)),z==="currency"&&ce&&se.add(ce),pe&&(Array.from(pe).forEach(ve=>se.add(ve)),mc.test(pe)&&se.add(" ")),gy.forEach(ve=>se.add(ve)),fe<0&&by.forEach(ve=>se.add(ve)),se}),$t=ge(R=>R!=null&&R.altKey?i:R!=null&&R.shiftKey?l:H),Ar=ge((R,X)=>{const ce=X.event,pe=X.direction,se=X.reason,We=!C||!(se===os||se===Hn||se===is||se===Qt||se===Jt),Be=ky(R,{step:pe?$t(ce)*pe:void 0,format:Ce.current,minWithDefault:fe,maxWithDefault:Se,minWithZeroDefault:F,snapOnStep:y,small:(ce==null?void 0:ce.altKey)??!1,clamp:We}),ve=X.reason===os||X.reason===Qt||X.reason===Hn||X.reason===is||X.reason===Jt,qa=Be!==Q||ve&&(R!==Q||Xe.current===!1);if(qa){if(ue.current=Be,b==null||b(Be,X),X.isCanceled)return qa;ee(Be),_(Be!==P.initialValue),Te.current=!0}return Xe.current&&Ir(Bt(Be,T,S)),je(),qa}),In=ge((R,{direction:X,currentValue:ce,event:pe,reason:se})=>{const We=ce??ye.current,Be=typeof We=="number"?We+R*X:Math.max(0,s??0);return Ar(Be,De(se,pe,void 0,{direction:X}))}),it=ge(()=>{Tn.clear(),Cn.clear(),Mr.clear(),ot.current(),Mn.current=0}),Nd=ge((R,X)=>{if(it(),!Y.current)return;const ce=rs(Y.current);function pe(We){We.preventDefault()}ce.addEventListener("contextmenu",pe),ot.current=()=>{ce.removeEventListener("contextmenu",pe)},ce.addEventListener("pointerup",We=>{En.current=!1,it();const Be=ue.current??ye.current;xt(Be,en(R?lf:cf,We))},{once:!0});function se(){const We=$t(X)??yr;return In(We,{direction:R?1:-1,event:X,reason:R?"increment-press":"decrement-press"})}if(!se()){it();return}Cn.start(xy,()=>{Mr.start(vy,()=>{se()||it()})})});re(function(){if(!Xe.current)return;const X=g!==void 0?Sc(Q,T,S):Bt(Q,T,S);X!==Nt&&Ir(X)}),re(function(){if(!Xw)return;let X="text";fe>=0&&(X="decimal"),Tv(X)},[fe,z]),x.useEffect(()=>()=>it(),[it]),x.useEffect(function(){const X=Y.current;if(G||w||!N||!X)return;function ce(pe){if(pe.ctrlKey||Mo(Y.current).activeElement!==Y.current)return;pe.preventDefault();const se=$t(pe)??yr;In(se,{direction:pe.deltaY>0?-1:1,event:pe,reason:"wheel"})}return X.addEventListener("wheel",ce),()=>{X.removeEventListener("wheel",ce)}},[N,In,G,w,l,H,$t]);const Ba=x.useMemo(()=>({...W,disabled:G,readOnly:w,required:d,value:Q,inputValue:Nt,scrubbing:J}),[W,G,w,d,Q,Nt,J]),Ev=x.useMemo(()=>({inputRef:Y,inputValue:Nt,value:Q,startAutoChange:Nd,stopAutoChange:it,minWithDefault:fe,maxWithDefault:Se,disabled:G,readOnly:w,id:me,setValue:Ar,incrementValue:In,getStepAmount:$t,allowInputSyncRef:Xe,formatOptionsRef:Ce,valueRef:ye,lastChangedValueRef:ue,hasPendingCommitRef:Te,isPressedRef:En,intentionalTouchCheckTimeout:Tn,movesAfterTouchRef:Mn,name:Z,required:d,invalid:L,inputMode:vd,getAllowedNonNumericKeys:xd,min:s,max:o,setInputValue:Ir,locale:T,isScrubbing:J,setIsScrubbing:ie,state:Ba,onValueCommitted:xt}),[Y,Nt,Q,Nd,it,fe,Se,G,w,me,Ar,In,$t,Ce,ye,Tn,Z,d,L,vd,xd,s,o,Ir,T,J,Ba,xt]),Mv=Ye("div",t,{ref:n,state:Ba,props:M,stateAttributesMapping:mn});return a.jsxs(Ca.Provider,{value:Ev,children:[Mv,a.jsx("input",{...q.getInputValidationProps({onFocus(){var R;(R=Y.current)==null||R.focus()},onChange(R){if(R.nativeEvent.defaultPrevented)return;const X=R.currentTarget.valueAsNumber,ce=Number.isNaN(X)?null:X,pe=De(Jt,R.nativeEvent);_(ce!==P.initialValue),Ar(ce,pe),$()&&q.commit(ce)}}),ref:K,type:"number",name:Z,value:Q??"",min:s,max:o,step:u,disabled:G,required:d,"aria-hidden":!0,tabIndex:-1,style:Z?ay:sy})]})});process.env.NODE_ENV!=="production"&&(Nc.displayName="NumberFieldRoot");function Sc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Bt(e,t,n):ic(e,t,n)}const Cc=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=mr();return Ye("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Cc.displayName="NumberFieldGroup");function vn(e){return e==="touch"||e==="pen"}function Tc(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:d,isIncrement:c,isPressedRef:w,locale:p,movesAfterTouchRef:f,readOnly:g,setValue:b,startAutoChange:v,stopAutoChange:N,valueRef:y,lastChangedValueRef:C,onValueCommitted:S}=e,T=x.useRef({x:0,y:0}),D=x.useRef(!1),A=x.useRef(!1),k=x.useRef(""),M=c?"increment-press":"decrement-press";function _(E){t.current=!0;const V=yn(l,p,r.current);V!==null&&(y.current=V,b(V,De(M,E,void 0,{direction:c?1:-1})))}return{disabled:n,"aria-readonly":g||void 0,"aria-label":c?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(E){const V=n||g;if(E.defaultPrevented||V||(vn(k.current)?A.current:E.detail!==0))return;_(E.nativeEvent);const L=s(E)??yr,O=y.current;i(L,{direction:c?1:-1,event:E.nativeEvent,reason:M});const W=C.current??y.current;W!==O&&S(W,en(M,E.nativeEvent))},onPointerDown(E){var O;const V=!E.button||E.button===0;if(E.defaultPrevented||g||!V||n)return;k.current=E.pointerType,A.current=!1,w.current=!0,T.current={x:E.clientX,y:E.clientY},_(E.nativeEvent),vn(E.pointerType)?d.start(Ny,()=>{const W=f.current;f.current=0,w.current&&W!=null&&W<Sy?(v(c,E),A.current=!0):(A.current=!1,N())}):(E.preventDefault(),(O=u.current)==null||O.focus(),v(c,E))},onPointerUp(E){vn(E.pointerType)&&(w.current=!1)},onPointerMove(E){if(n||g||!vn(E.pointerType)||!w.current)return;f.current!=null&&(f.current+=1);const{x:L,y:O}=T.current,W=L-E.clientX,q=O-E.clientY;W**2+q**2>Cy**2&&N()},onMouseEnter(E){const V=n||g;E.defaultPrevented||V||!w.current||D.current||vn(k.current)||v(c,E)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Ec=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,locale:y,maxWithDefault:C,movesAfterTouchRef:S,readOnly:T,setValue:D,startAutoChange:A,state:k,stopAutoChange:M,value:_,valueRef:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=_!=null&&_>=C,O=o||d||L,W=Tc({isIncrement:!0,inputRef:g,startAutoChange:A,stopAutoChange:M,inputValue:b,disabled:O,readOnly:T,id:p,setValue:D,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:P,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:S,locale:y,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...k,disabled:O}),[k,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Ec.displayName="NumberFieldIncrement");const Mc=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,minWithDefault:y,movesAfterTouchRef:C,readOnly:S,setValue:T,startAutoChange:D,state:A,stopAutoChange:k,value:M,valueRef:_,locale:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=M!=null&&M<=y,O=o||d||L,W=Tc({isIncrement:!1,inputRef:g,startAutoChange:D,stopAutoChange:k,inputValue:b,disabled:O,readOnly:S,id:p,setValue:T,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:_,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:C,locale:P,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...A,disabled:O}),[A,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Mc.displayName="NumberFieldDecrement");function Dy(e,t){const n=x.useRef(e),r=ge(t);re(()=>{n.current!==e&&r(n.current)},[e,r]),re(()=>{n.current=e},[e])}const _y={...Xr,...mn},Py=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ic=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:d,getStepAmount:c,id:w,incrementValue:p,inputMode:f,inputValue:g,max:b,min:v,name:N,readOnly:y,required:C,setValue:S,state:T,setInputValue:D,locale:A,inputRef:k,value:M,onValueCommitted:_,lastChangedValueRef:P,hasPendingCommitRef:E,valueRef:V}=mr(),{clearErrors:L}=fo(),{validationMode:O,setTouched:W,setFocused:q,invalid:$,shouldValidateOnChange:G,validation:Z}=Vn(),{labelId:H}=Rr(),J=x.useRef(!1),ie=x.useRef(!1);return Po({id:w,commit:Z.commit,value:M,controlRef:k,name:N,getValue:()=>M??null}),Dy(M,F=>{const z=G();if(L(N),z&&Z.commit(M),!(F===M||z)){if(ie.current){ie.current=!1;return}Z.commit(M,!0)}}),Ye("input",t,{ref:[n,k],state:T,props:[{id:w,required:C,disabled:u,readOnly:y,inputMode:f,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":$||void 0,"aria-labelledby":H,suppressHydrationWarning:!0,onFocus(F){if(F.defaultPrevented||y||u||(q(!0),J.current))return;J.current=!0;const z=F.currentTarget,Y=z.value.length;z.setSelectionRange(Y,Y)},onBlur(F){if(F.defaultPrevented||y||u)return;W(!0),q(!1);const z=!i.current,Y=E.current;if(i.current=!0,g.trim()===""){S(null,De(Qt,F.nativeEvent)),O==="onBlur"&&Z.commit(null),_(null,en(Qt,F.nativeEvent));return}const K=l.current,me=yn(g,A,K);if(me===null)return;const j=(K==null?void 0:K.maximumFractionDigits)!=null||(K==null?void 0:K.minimumFractionDigits)!=null,ee=K==null?void 0:K.maximumFractionDigits,Q=j&&typeof ee=="number"?Number(me.toFixed(ee)):me,ye=en(Hn,F.nativeEvent),je=M!==Q,Ce=z||je||Y;O==="onBlur"&&Z.commit(Q),je&&(ie.current=!0,S(Q,De(Hn,F.nativeEvent))),Ce&&_(Q,ye);const Te=Bt(Q,A,K),xt=ic(me,A,K);!(!j&&me===M&&g===xt)&&g!==Te&&D(Te)},onChange(F){if(F.nativeEvent.defaultPrevented)return;i.current=!1;const z=F.target.value;if(z.trim()===""){D(z),S(null,De(Qt,F.nativeEvent));return}const Y=d();if(!Array.from(z).every(j=>{const ee=j>="0"&&j<="9",Q=Ea.test(j),ye=Ma.test(j),je=pc.test(j),Ce=hc.test(j),Te=bn.test(j);return ee||Q||ye||je||Ce||Te||Y.has(j)}))return;const me=yn(z,A,l.current);D(z),me!==null&&S(me,De(os,F.nativeEvent))},onKeyDown(F){if(F.defaultPrevented||y||u)return;const z=F.nativeEvent;i.current=!0;const Y=d();let K=Y.has(F.key);const{decimal:me,currency:j,percentSign:ee}=Ia(A,l.current),Q=F.currentTarget.selectionStart,ye=F.currentTarget.selectionEnd,je=Q===0&&ye===g.length,Ce=ue=>Q!=null&&ye!=null&&ue>=Q&&ue<ye;if(bn.test(F.key)&&Array.from(Y).some(ue=>bn.test(ue||""))){const ue=g.search(vc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}if(br.test(F.key)&&Array.from(Y).some(ue=>br.test(ue||""))){const ue=g.search(xc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}[me,j,ee].forEach(ue=>{if(F.key===ue){const ot=g.indexOf(ue),Nt=Ce(ot);K=!g.includes(ue)||je||Nt}});const Te=F.key>="0"&&F.key<="9",xt=Ea.test(F.key),Cn=Ma.test(F.key),Mr=hc.test(F.key),Tn=Py.has(F.key);if(F.which===229||F.altKey||F.ctrlKey||F.metaKey||K||Te||xt||Mr||Cn||Tn)return;const En=yn(g,A,l.current),Mn=c(F)??yr;ef(F);const Xe=en(Rt,z);F.key==="ArrowUp"?(p(Mn,{direction:1,currentValue:En,event:z,reason:Rt}),_(P.current??V.current,Xe)):F.key==="ArrowDown"?(p(Mn,{direction:-1,currentValue:En,event:z,reason:Rt}),_(P.current??V.current,Xe)):F.key==="Home"&&v!=null?(S(v,De(Rt,z)),_(P.current??V.current,Xe)):F.key==="End"&&b!=null&&(S(b,De(Rt,z)),_(P.current??V.current,Xe))},onPaste(F){if(F.defaultPrevented||y||u)return;F.preventDefault();const Y=(F.clipboardData||window.Clipboard).getData("text/plain"),K=yn(Y,A,l.current);K!==null&&(i.current=!1,S(K,De(is,F.nativeEvent)),D(Y))}},Z.getValidationProps(),o],stateAttributesMapping:_y})});process.env.NODE_ENV!=="production"&&(Ic.displayName="NumberFieldInput");const Vy={wuStepper:"_wuStepper_apbnq_1"},Oy=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:d,labelPosition:c="left",disabled:w,resetInvalidValueOnBlur:p=!0,...f})=>{const g=x.useId(),[b,v]=x.useState(l!==void 0?Number(l):n||0);x.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const N=A=>{v(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||v(k)},C=()=>{p&&(i!==void 0&&b<i?(v(i),e==null||e(i)):u!==void 0&&b>u&&(v(u),e==null||e(u)))};x.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const S={inc:r||u!==void 0&&b>=u||w,dec:r||i!==void 0&&b<=i||w},T=i!==void 0&&b<i||u!==void 0&&b>u,D=m("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(Nc,{id:g,value:b,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&N(A),dir:s,className:m("wu-flex wu-stepper",s==="rtl"&&c!=="top"&&"wu-gap-2",Vy.wuStepper,Fy({labelPosition:c}),d),children:[t&&a.jsx(ke,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(Cc,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Mc,{"aria-label":"decrement",className:m(D,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:S.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ic,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||void 0,dir:s,className:m("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:C,disabled:w,min:i,max:u,step:o,value:b,...f}),a.jsx(Ec,{"aria-label":"increment",className:m(D,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:S.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Fy=qe.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"}}}),Le={container:"_container_1cpdq_1",sidebar:"_sidebar_1cpdq_5",content:"_content_1cpdq_13",sourceWrapper:"_sourceWrapper_1cpdq_17",list:"_list_1cpdq_25",listItem:"_listItem_1cpdq_29",listItemActive:"_listItemActive_1cpdq_42",label:"_label_1cpdq_46",icon:"_icon_1cpdq_50",sharedWrapper:"_sharedWrapper_1cpdq_54"},Ac=h.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Le.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));Ac.displayName="WuSharedSurvey";const Ly=(e,t=!1)=>{if(e)return a.jsx("span",{className:Le.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Le.icon,n),"aria-hidden":"true"})},kc=h.memo(({children:e,icon:t,isActive:n,isShared:r,className:s,...o})=>a.jsxs("button",{className:m(Le.listItem,n&&Le.listItemActive,s),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Ly(t,r),a.jsx("span",{className:Le.label,children:e})]}));kc.displayName="WuSurveyItem";const Dc=h.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Le.list,t),...n,children:e}));Dc.displayName="WuSurveyList";const _c=e=>{const{className:t,variant:n="outlined",...r}=e;return a.jsx("div",{className:Le.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(fl,{variant:n,showGroupSeparator:!0,className:m(Le.source,t),...r})})};_c.displayName="WuSurveySource";const Wy=h.memo(_c),Pc=h.memo(({Sidebar:e,children:t,className:n,...r})=>a.jsxs("div",{className:m(Le.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...r,children:[e&&a.jsx("div",{className:Le.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Le.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Pc.displayName="WuSurveySelect";const Vc=qe.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"}}),By=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(Ka.Root,{ref:s,className:m(Vc({variant:t,size:n,className:e})),...r}));By.displayName=Ka.Root.displayName;const Oc=x.createContext({size:"default",variant:"default"}),vr=x.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(An.Root,{ref:o,className:m("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Oc.Provider,{value:{variant:t,size:n},children:r})}));vr.displayName=An.Root.displayName;const vt=x.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=x.useContext(Oc);return a.jsx(An.Item,{ref:o,className:m(Vc({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});vt.displayName=An.Item.displayName;const Fc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>m("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:m("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(vt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Fc.displayName="_IconTab";const Lc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=d=>m("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",d===r&&"wu-text-white wu-font-medium",s&&r===d&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:m("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(vt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(vt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Lc.displayName="_Tab";const Wc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>m("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=m("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=m("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),c=m("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(vt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:d,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:c,role:"knob",dir:o})}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});Wc.displayName="_Toggle";const Bc=h.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:d=!0,...c}=e,[w,p]=h.useState(),f=g=>{let b=w;g!==""?b=g:d&&(b=w==="opt1"?"opt2":"opt1");const v=b==="opt1"?r[0].value:r[1].value;l&&l(v),p(b)};if(h.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");p(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Wc,{...c,ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});case"iconTab":return a.jsx(Fc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});default:return a.jsx(Lc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i,size:u})}});Bc.displayName="WuSwitcher";const qc=ct.Root,ka=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ct.List,{className:m("wu-relative wu-flex",e),...n,ref:r,children:t}));ka.displayName=ct.List.displayName;const Da=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Trigger,{ref:n,className:m("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));Da.displayName=ct.Trigger.displayName;const $c=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Content,{ref:n,className:e,...t}));$c.displayName=ct.Content.displayName;const Hc=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:m("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx($c,{value:r.value,forceMount:t||void 0,className:m("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},qy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return h.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:d,behavior:"smooth"})}}}},zc=(e,t)=>{const[n,r]=h.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return h.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const d={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(d)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},$y=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=h.useRef(null),d=zc(l,"horizontal"),{showLeftArrow:c,showRightArrow:w,scrollByTab:p}=qy(l),[f,g]=h.useState(!1),b=()=>p("left"),v=()=>p("right"),N=S=>a.jsx("div",{"data-testid":`gradient-overlay-${S}`,className:m("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",S==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="left";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",D&&"wu-translate-x-0 wu-opacity-100",!D&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:m("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("left"),y(b,"left",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:d.width,left:d.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&f&&N("right"),y(v,"right",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},Hy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return h.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:d,behavior:"smooth"})}}}},zy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=h.useRef(null),d=zc(l,"vertical"),{showTopArrow:c,showBottomArrow:w,scrollByTab:p}=Hy(l),[f,g]=h.useState(!1),b=()=>p("up"),v=()=>p("down"),N=S=>a.jsx("div",{className:m("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",S==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="up";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",D&&"wu-translate-y-0 wu-opacity-100",!D&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:m("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("top"),y(b,"up",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:d.height,top:d.top}})]}),w&&f&&N("bottom"),y(v,"down",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},Uy=({...e})=>e.orientation==="vertical"?a.jsx(zy,{...e}):a.jsx($y,{...e}),_a=x.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));_a.displayName="Table";const Pa=x.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));Pa.displayName="TableHeader";const xn=x.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));xn.displayName="TableBody";const jy=x.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:m("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));jy.displayName="TableFooter";const at=x.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:m("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));at.displayName="TableRow";const xr=x.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:m("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));xr.displayName="TableHead";const qt=x.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:m("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));qt.displayName="TableCell";const Nn=x.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:m("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Nn.displayName="TableCaption";const Gy=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=h.useCallback(c=>w=>{s==null||s(w?c:[])},[s]);return{finalColumns:h.useMemo(()=>n?[{id:"select",header:({table:c})=>{const w=c.getRowModel().rows.map(f=>f.original).filter(f=>!(i!=null&&i(f))),p=l(w);return u?a.jsx("div",{}):a.jsx(He,{checked:c.getIsSomeRowsSelected()||c.getIsAllRowsSelected(),partial:c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected(),onChange:f=>{c.toggleAllRowsSelected(!!f),p(!!f)},"aria-label":"Select all","data-testid":c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:c})=>{const w=(i==null?void 0:i(c.original))??!1;return a.jsx(He,{checked:c.getIsSelected(),disabled:w,onChange:p=>{w||c.toggleSelected(!!p)},"aria-label":String(c.original[o])})},filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,l,i,u])}};function Uc({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=Gy({columns:t,rowSelection:n}),s=h.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const jc=48,Gc="expander";function Kc(e,t){return e?[{id:Gc,accessorKey:Gc,header:"",cell:({row:n})=>{const r=n.getIsExpanded();return a.jsx("button",{type:"button",className:"wu-inline-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-text-[10px]",onClick:()=>n.toggleExpanded(),"aria-label":r?"Collapse row":"Expand row",children:a.jsx("span",{className:m("wm-arrow-forward-ios wu-transition-all",r?"wu-rotate-90":"")})})},enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,enableHiding:!1,size:jc},...t]:t}function Ky(e,t){const n=t.map(r=>{var s;return(s=r.columnDef)==null?void 0:s.expandableRowContent}).find(r=>r);return n==null?void 0:n.call(null,e)}function Yc(e,t,n){return e===!0&&(!t||n>t)}const Xc=(e,t)=>m("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),Zc=(e,t="default",n,r=!1)=>m("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left",r&&"wu-overflow-hidden"),Yy=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",Xy=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),Zy=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),Jy=(e,t)=>m("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),Qy=(e,t)=>m("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),Jc=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s,isRowDisabled:o,isRowExpandable:i})=>{const u=e.getVisibleLeafColumns().length,l=e.getRowModel().rows;return r?a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s??a.jsx(dt,{className:"wu-w-full"})})})}):l!=null&&l.length?a.jsx(xn,{children:l.flatMap((d,c)=>{const w=(o==null?void 0:o(d.original))??!1,p=d.getIsSelected(),f=d.getIsExpanded(),g=a.jsx(at,{"data-disabled":w,"data-state":p&&"selected",className:Xc(p,w),"data-expanded":f,children:d.getVisibleCells().map((N,y)=>{const C=N.column.columnDef;return a.jsx(qt,{className:Zc(N.column.id,t,C.cellAlign),children:Me.flexRender(C.cell,N.getContext())},`${N.id}-${y}`)})},`${d.id}-${c}`),b=i&&f?Ky(d,e.getVisibleLeafColumns()):null,v=b?a.jsx(at,{"data-expanded":"true","data-state":p&&"selected",children:a.jsx(qt,{colSpan:u,children:b})},`${d.id}-expanded-${c}`):null;return v?[g,v]:[g]})}):a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,children:n})})})},Va=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:d})=>{var N;const c=s==="compact"?"wu-h-8":"wu-h-10",w=e.getVisibleLeafColumns(),p=y=>{const{id:C,columnDef:S,getIsSorted:T,toggleSorting:D}=y,A=S.header,k=S.headerAlign;if(!t.includes(C))return A;const M=T(),_=M==="asc",P=M==="desc",E=()=>{n?(D(!P),r==null||r({id:C,desc:P})):D(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:E,"aria-label":`Sort by ${A}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",Zy(k)),children:[A,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:Qy(_,!!M)}),a.jsx("span",{className:Jy(P,!!M)})]})]})},f=y=>y.column.id==="actions"?a.jsx(xr,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(xr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",Xy(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:Me.flexRender(p(y.column),y.getContext())},y.id),g=()=>e.getHeaderGroups().map(y=>a.jsx(at,{className:"wu-relative",children:y.headers.map(f)},y.id)),b=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",c),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=w[0])==null?void 0:y.getSize(),marginLeft:d?jc:void 0},children:a.jsx(He,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:C=>e.toggleAllRowsSelected(!!C),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},v=o&&i;if(l){const y=((N=e.getHeaderGroups()[0])==null?void 0:N.headers)??[];return a.jsxs(at,{className:"wu-relative",children:[y.map(f),v&&a.jsx(xr,{colSpan:w.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:b()})]})}return a.jsxs(Pa,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",c),children:[g(),v&&a.jsx("div",{className:m("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",c),children:b()})]})},Qc=h.forwardRef((e,t)=>a.jsx(xn,{...e,ref:t}));Qc.displayName="TableBodyComponent";const Rc=({table:e,size:t,isRowDisabled:n,containerHeight:r=600,sortableColumns:s,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l})=>{const d=e.getRowModel().rows,c=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ha.TableVirtuoso,{style:{height:r},totalCount:d.length,fixedHeaderContent:()=>a.jsx(Va,{table:e,sortableColumns:s,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:w=>{const p=d[w];return p?a.jsx(a.Fragment,{children:p.getVisibleCells().map((f,g)=>{const b=f.column.columnDef;return a.jsx(qt,{className:Zc(f.column.id,t,b.cellAlign,!0),children:Me.flexRender(b.cell,f.getContext())},`${f.id}-${g}`)})}):null},components:{Table:({style:w,...p})=>a.jsxs("table",{...p,style:{...w,width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},className:"wu-table-fixed",children:[a.jsx("colgroup",{children:c.map(f=>a.jsx("col",{style:{width:`${f.getSize()}px`}},f.id))}),p.children]}),TableBody:Qc,TableHead:w=>a.jsx(Pa,{...w,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",Yy(t),w.className)}),TableRow:({...w})=>{const p=w["data-index"],f=d[p],g=f?(n==null?void 0:n(f.original))??!1:!1,b=(f==null?void 0:f.getIsSelected())??!1;return a.jsx(at,{...w,"data-disabled":g,"data-state":b&&"selected",className:Xc(b,g)})}}})})},Nr=qe.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),Ry=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:d=!1,CustomLoader:c,caption:w,virtualization:p,isRowExpandable:f,...g})=>{var _,P;const[b,v]=h.useState({}),{finalColumns:N,rowSelectionState:y}=Uc({data:e,columns:t,rowSelection:i}),C=h.useMemo(()=>N.filter(E=>E.enableSorting).map(E=>E.accessorKey),[N]),S=h.useMemo(()=>Kc(f,N),[N,f]),T=((_=i==null?void 0:i.selectedRows)==null?void 0:_.length)??0,D=E=>{const V=typeof E=="function"?E(y):E,L=[],O=i==null?void 0:i.isRowDisabled;for(const W in V){if(!V[W])continue;const q=e[Number(W)];q&&(O!=null&&O(q)||L.push(q))}i==null||i.onRowSelect(L)},A=Me.useReactTable({data:e,columns:S,getCoreRowModel:Me.getCoreRowModel(),getPaginationRowModel:Me.getPaginationRowModel(),getExpandedRowModel:f?Me.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?E=>!i.isRowDisabled(E.original):!0,enableExpanding:!!f,state:{...i!=null&&i.isEnabled?{rowSelection:y}:{},...f?{expanded:b}:{}},onRowSelectionChange:D,...f?{onExpandedChange:v}:{}}),k=Yc(p==null?void 0:p.enabled,p==null?void 0:p.threshold,e.length),M=(p==null?void 0:p.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative"),children:k?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:r})),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(dt,{className:"wu-w-full"})}):(P=A.getRowModel().rows)!=null&&P.length?a.jsx(Rc,{table:A,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:M,sortableColumns:C,HeaderAction:u,isRowSelected:T>0,manual:!0,onSort:s==null?void 0:s.onSort}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(_a,{...g,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:r}),"wu-table-fixed",g.className),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),a.jsx(Va,{table:A,sortableColumns:C,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:T>0,isStickyHeader:d,isRowExpandable:f}),a.jsx(Jc,{table:A,size:o,NoDataContent:l,CustomLoader:c,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:f})]})})},ev=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:d,NoDataContent:c,isLoading:w,caption:p,rowSelection:f,isRowExpandable:g,virtualization:b,...v})=>{var G,Z;const[N,y]=h.useState((s==null?void 0:s.initial)||[]),[C,S]=h.useState([]),[T,D]=h.useState((i==null?void 0:i.pageIndex)??0),[A,k]=h.useState({}),{finalColumns:M,rowSelectionState:_}=Uc({data:e,columns:t,rowSelection:f}),P=h.useMemo(()=>M.filter(H=>H.enableSorting).map(H=>H.accessorKey),[M]),E=h.useMemo(()=>M.filter(H=>H.filterable).map(H=>H.accessorKey),[M]),V=((G=f==null?void 0:f.selectedRows)==null?void 0:G.length)??0,L=h.useMemo(()=>Kc(g,M),[M,g]),O=H=>{const J=typeof H=="function"?H(_):H,ie=[],fe=f==null?void 0:f.isRowDisabled;for(const Se in J){if(!J[Se])continue;const F=e[Number(Se)];F&&(fe!=null&&fe(F)||ie.push(F))}f==null||f.onRowSelect(ie)},W=Me.useReactTable({data:e,columns:L,getCoreRowModel:Me.getCoreRowModel(),getFilteredRowModel:Me.getFilteredRowModel(),getSortedRowModel:Me.getSortedRowModel(),getPaginationRowModel:i?Me.getPaginationRowModel():void 0,getExpandedRowModel:g?Me.getExpandedRowModel():void 0,enableRowSelection:f!=null&&f.isRowDisabled?H=>!f.isRowDisabled(H.original):!0,enableExpanding:!!g,state:{sorting:N,columnFilters:C,...i?{pagination:i}:{},...f!=null&&f.isEnabled?{rowSelection:_}:{},...g?{expanded:A}:{}},onSortingChange:y,onColumnFiltersChange:S,onRowSelectionChange:O,...g?{onExpandedChange:k}:{}});h.useEffect(()=>{E.forEach(H=>{var J;(J=W.getColumn(H))==null||J.setFilterValue(o)})},[o,E,W]),h.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==T&&(f==null||f.onRowSelect(()=>[]),W.resetRowSelection(),D(i.pageIndex))},[i==null?void 0:i.pageIndex]);const q=Yc(b==null?void 0:b.enabled,b==null?void 0:b.threshold,e.length),$=(b==null?void 0:b.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:q?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:n})),children:[p&&a.jsx(Nn,{children:p}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(dt,{className:"wu-w-full"})}):(Z=W.getRowModel().rows)!=null&&Z.length?a.jsx(Rc,{table:W,size:r,isRowDisabled:f==null?void 0:f.isRowDisabled,containerHeight:$,sortableColumns:P,HeaderAction:l,isRowSelected:V>0}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:c})]}):a.jsxs(_a,{...v,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:n}),"wu-table-fixed",v.className),children:[p&&a.jsx(Nn,{children:p}),a.jsx(Va,{table:W,sortableColumns:P,size:r,HeaderAction:l,isRowSelected:V>0,isStickyHeader:u,isRowExpandable:g}),a.jsx(Jc,{table:W,size:r,NoDataContent:c,CustomLoader:d,isLoading:w,isRowDisabled:f==null?void 0:f.isRowDisabled,isRowExpandable:g})]})})},ed=x.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:m("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));ed.displayName="Textarea";const td=h.forwardRef((e,t)=>{const{Label:n,id:r=Vr(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,d=w=>{l.onChange&&l.onChange(w)},c=kn(u);return a.jsxs("div",{className:m(c,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(ed,{...l,ref:t,id:r,className:m("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:d,readOnly:o,maxLength:i}),n&&a.jsx(ke,{htmlFor:r,className:"wu-textarea-label",children:n})]})});td.displayName="WuTextarea";function tv(e){if(typeof e=="string"&&e.includes("T")){const t=U.parseISO(e);return U.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=U.parse(e,"HH:mm:ss",new Date);return U.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const nd=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],rd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),sd=["am","pm"],Sr=50;function nv(e){return Array(Sr).fill(e).flat()}function Oa(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function rv(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function ad(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const sv=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:m("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),Fa=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:m("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?nv(e):e).map((i,u)=>a.jsx(sv,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function av(e,t,n,r){const s=h.useMemo(()=>e?Oa(nd,t.padStart(2,"0")):nd,[e]),o=h.useMemo(()=>e?Oa(rd,n.padStart(2,"0")):rd,[e]),i=h.useMemo(()=>e?Oa(sd,r):sd,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function ov(e,t,n){h.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/Sr,l=Math.floor(Sr/2);i.scrollTop=l*u;const d=()=>{const{scrollTop:c}=i,w=Math.round(c/u);(w<=1||w>=Sr-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",d),()=>{i.removeEventListener("scroll",d)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const od=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=h.useState(!1),[l,d]=h.useState(""),c=h.useRef(null),w=h.useRef(null),p=h.useRef(null),f=h.useRef(null),[g,b]=h.useState("12"),[v,N]=h.useState("00"),[y,C]=h.useState("am");h.useEffect(()=>{if(!t){d(""),b("12"),N("00"),C("am"),c.current&&(c.current.value="");return}const k=tv(t);d(k);const[M,_]=k.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E),c.current&&(c.current.value=k)},[t]),h.useEffect(()=>{const k=M=>{w.current&&!w.current.contains(M.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),ov(i,p,f);const{rotatedHours:S,rotatedMinutes:T,rotatedMeridiem:D}=av(i,g,v,y),A=h.useCallback((k,M,_)=>{const P=k??g,E=M??v,V=_??y;b(P),N(E),C(V);const L=`${rv(P,V)}:${E}`;d(L)},[g,v,y]);return a.jsxs("div",{className:m("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(ke,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:m("relative inline-block"),ref:w,dir:s,children:[a.jsx(Qe,{ref:c,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{d(k.target.value);const[M,_]=k.target.value.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(Pe,{icon:"wm-schedule",className:m("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
18
+ )`;d.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",p),()=>{window.removeEventListener("mousemove",p),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(tb.gradientBackground,"wu-transform-gpu",s),...u,children:r})},fr={wuModalBodyWrapper:"_wuModalBodyWrapper_uaelx_1","wu-modal-footer":"_wu-modal-footer_uaelx_5","wu-modal-content":"_wu-modal-content_uaelx_5","wu-modal-header":"_wu-modal-header_uaelx_9"},vl="calc(100vh - 64px)",nb={sm:"400px",md:"600px",lg:"1200px"},rb=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:d,className:c,style:w,variant:p="action",...f})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(hl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(ml,{asChild:!0,children:e}),a.jsx(fa,{style:{width:"calc(100% - 64px)",maxWidth:l||nb[n],maxHeight:d||vl,...w},hideCloseButton:r,onInteractOutside:b=>s&&b.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":p,className:m("wu-group wu-rounded-[.88rem]",fr.wuModalBodyWrapper,c),...f,children:a.jsx(yl,{colors:g[p],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",c),style:{maxHeight:d||vl},children:t})})]})},sb=({children:e,className:t,...n})=>a.jsx("div",{className:m("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",fr["wu-modal-content"],t),...n,children:e}),ab=({children:e,className:t,...n})=>a.jsx(pa,{...n,"data-variant":"action",className:m("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-[.88rem] wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",fr["wu-modal-header"],t),children:a.jsx(ha,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),ob=({children:e,className:t,...n})=>a.jsx(bl,{...n,className:m("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",fr["wu-modal-footer"],t),children:e}),ib=({children:e,className:t,...n})=>{const r=h.useRef(null);return a.jsx(Rg,{asChild:!0,children:a.jsx(Ae,{className:t,ref:r,...n,children:e})})},ub=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,width:w,...p})=>{const[f,g]=h.useState(""),[b,v]=h.useState(e);h.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),g("");return}const y=r.label;if(n&&Array.isArray(t)){const C=t.map(S=>S[y]).join(", ");g(C)}else!n&&!Array.isArray(t)&&g(t[y])},[t,r.label,n,e]);const N=()=>e&&!f?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):a.jsx("span",{className:m("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:c?(d==null?void 0:d.triggerText)??f:f});return a.jsx(Yo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...p,disabled:l,className:m("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",p.className),children:[i??N(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},xl=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=c=>{e.disabled||(r(e),n&&c.preventDefault())};return a.jsxs(zn,{onClick:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(He,{checked:l}),a.jsx(Nl,{option:e,accessorKey:s})]})},Nl=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Sl=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(zn,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(He,{"data-partial":s,checked:r||s,partial:s}),a.jsx(Nl,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Xo,{dir:o.dir,children:[a.jsx(rn,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>h.createElement(xl,{...o,option:u,key:l}))]});case"divider":return a.jsx(jn,{className:"wu-mx-4"});default:return a.jsx(xl,{...o,option:t})}},lb=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},cb=100,db=400,Cl=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:d,virtualizedThreshold:c=cb,maxHeight:w=db,hasGroup:p=!1,Header:f,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:N="top",onScroll:y,maxContentWidth:C,selectedToTop:S=!1,...T})=>{const[D,A]=h.useState(),k=h.useRef(null),[M,_]=h.useState(!1),[P,E]=h.useState(!1),{cleanData:V,enabledOptions:L}=lb(e),O=h.useMemo(()=>n&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,n]),W=h.useCallback(H=>{const J=H[o.value];if(n)A((ie=[])=>{const fe=ie,F=fe.some(U=>U[o.value]===J)?fe.filter(U=>U[o.value]!==J):[...fe,H];return t==null||t(F),F});else{const ie=H;A(ie),t==null||t(ie)}},[n,o.value,t]);h.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&A(void 0),r!==void 0&&A(r),s!==void 0&&A(s)},[r,s]);const q=Go(S,O,D,o),$=q.length>c;h.useEffect(()=>{if(!n)return;const H=b!=null&&b.includeDisabled?(D==null?void 0:D.length)===e.length:(D==null?void 0:D.length)===L.length;_(H);const J=(D==null?void 0:D.length)>0&&!H;E(J)},[D,b]);const G=h.useCallback(()=>{const H=M?[]:b!=null&&b.includeDisabled?p?V:e:L;A(H),t==null||t(H)},[M,n,e,L,t,b]),Z=kn(N);return a.jsxs("div",{className:m(Z,"wu-flex wu-select-container"),ref:k,dir:u,children:[a.jsxs(Ko,{children:[a.jsx(ub,{...T,value:D,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:g,id:T.id,disabled:v,selectAll:b,isCheckedAll:M}),a.jsxs(fs,{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:T.id,style:{maxWidth:C},children:[f,$?a.jsx(It,{list:q,containerHeight:w,callback:(H,J)=>a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,dir:u,handleSelectAll:G,isCheckedAll:M,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:q.map(H=>{const J=H,ie=String(J[o.value]??J.type);return a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,handleSelectAll:G,isCheckedAll:M,dir:u,isPartialSelected:P},ie)})})]})]}),d&&a.jsx(ke,{htmlFor:T.id,className:"wu-select-label",children:d})]})},pr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wb=({value:e,onChange:t,min:n=z.sub(new Date,{years:5}),max:r=z.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:d,disabledMonths:c=[],...w})=>{const[p,f]=h.useState(null),[g,b]=h.useState(""),[v,N]=h.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=h.useMemo(()=>{const S=new Date(n).getFullYear(),T=new Date(r).getFullYear();return Array.from({length:T-S+1},(D,A)=>({value:T-A,label:T-A}))},[n,r]);h.useEffect(()=>{if(e){const S=new Date(e),T=S.getFullYear(),D=S.getMonth();f({year:T,month:D}),b(`${pr[D]} ${T}`),N({value:T,label:T})}},[e]);const C=()=>{p&&t&&(t(new Date(p.year,p.month,15)),b(`${pr[p.month]} ${p.year}`))};return a.jsxs("div",{className:m("wu-flex wu-flex-col wu-items-center",kn(i),i==="top"&&"wu-items-start"),children:[a.jsxs(Ge,{children:[a.jsx(Gr,{...w,disabled:u||d,id:l,dir:"ltr",placeholder:s,formattedString:g}),a.jsxs($e,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(Cl,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:S=>N(S),multiple:!1,maxHeight:224})}),a.jsx(fb,{year:v==null?void 0:v.value,selectedMonth:p==null?void 0:p.month,selectedYear:p==null?void 0:p.year,onClick:(S,T)=>f({year:T,month:S}),disabledMonths:c}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(ke,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},fb=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=h.useMemo(()=>{const d=new Set;return s.forEach(c=>{const w=typeof c=="string"?new Date(c):c;d.add(`${w.getFullYear()}-${w.getMonth()}`)}),d},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:pr.map((d,c)=>{const w=e===i&&c===u,p=t===c&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${c}`),onClick:()=>r(c,e),className:m("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",p&&"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":`${pr[c]} ${e}`,"data-month":c,"data-year":e,children:d},d)})})},Tl=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=h.useState([]),[u,l]=h.useState([]);return h.useEffect(()=>{const d=()=>{var g,b;const c=((g=t.current)==null?void 0:g.clientWidth)||0,w=((b=n.current)==null?void 0:b.clientWidth)||0,p=c-w,f=Math.floor(p/r);i(e.slice(0,f)),l(e.slice(f))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,r]),[o,u]},El={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},pb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((c,w)=>h.cloneElement(c,{className:m(El.wuPrimaryLink,c.props.className,"wu-primary-nav-link"),key:w})),[t]),i=h.useRef(null),u=h.useRef(null),[l,d]=Tl(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),d.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(El.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},ma={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},hb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((w,p)=>h.cloneElement(w.link,{key:p,className:m(ma.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[h.cloneElement(w.imgOrIcon,{className:m("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),[d,c]=Tl(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:m(ma.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:d}),c.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(ma.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},Ml=h.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,d]=h.useState(t),[c,w]=h.useState(n);h.useEffect(()=>{d(t),w(n)},[t,n]);const p=Math.ceil(e/c),f=l*c+1,g=Math.min((l+1)*c,e),b=Array.from({length:p},(y,C)=>C),v=h.useCallback(y=>{y>=0&&y<p&&(d(y),r==null||r(y))},[p,r]),N=224;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Il,{label:"Previous page",onClick:()=>v(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(da,{name:`${f} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Wt,{style:{maxHeight:N+"px"},dir:i.dir,children:b.length>100?a.jsx(It,{className:"wu-pagination-list",containerHeight:N,list:b,callback:(y,C)=>a.jsxs(wr,{onSelect:()=>v(C),className:m("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*c+1," -"," ",Math.min((C+1)*c,e)]},y)}):b.map(y=>a.jsxs(wr,{onSelect:()=>v(y),className:m(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*c+1," -"," ",Math.min((y+1)*c,e)]},y))})}),a.jsx(Il,{label:"Next page",onClick:()=>v(l+1),disabled:l===p-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ml.displayName="WuPagination";const Il=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(Ae,{variant:"iconOnly",onClick:t,disabled:n,className:m("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:m("wu-text-sm",r)})}),Al=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));Al.displayName=jt.Root.displayName;const kl=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Item,{ref:n,className:m("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(jt.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));kl.displayName=jt.Item.displayName;const Dl=h.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(Al,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:m("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Pn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(kl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Pn,{htmlFor:l.value,className:m(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});Dl.displayName="WuRadioGroup";const mb=e=>{const{children:t,...n}=e;return a.jsxs(Wt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(ca,{orientation:"horizontal"})]})},_l=x.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:m("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));_l.displayName="Input";const Pl=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(Ga.Root,{ref:s,decorative:n,orientation:t,className:m("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Pl.displayName=Ga.Root.displayName;function Vl({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const ga=768;function ba(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ga-1}px)`),r=()=>{t(window.innerWidth<ga)};return n.addEventListener("change",r),t(window.innerWidth<ga),()=>n.removeEventListener("change",r)},[]),!!e}const gb="sidebar_state",bb=3600*24*7,yb="256px",vb="256px",xb="3rem",Nb="b",Ol=x.createContext(null);function st(){const e=x.useContext(Ol);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Fl=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=ba(),[d,c]=x.useState(!1),[w,p]=x.useState(l?!0:e),f=t??w,g=x.useCallback(y=>{const C=typeof y=="function"?y(f):y;n?n(C):p(C),document.cookie=`${gb}=${C}; path=/; max-age=${bb}`},[n,f]),b=x.useCallback(()=>l?c(y=>!y):g(y=>!y),[l,g,c]);x.useEffect(()=>{const y=C=>{C.key===Nb&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=f?"expanded":"collapsed",N=x.useMemo(()=>({state:v,open:f,setOpen:g,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:b}),[v,f,g,l,d,c,b]);return a.jsx(Ol.Provider,{value:N,children:a.jsx(no,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":yb,"--sidebar-width-icon":xb,...s},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Fl.displayName="SidebarProvider";const Ll=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:d,setOpenMobile:c}=st();return n==="none"?a.jsx("div",{className:m("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(ni,{open:d,onOpenChange:c,...o,children:a.jsx(ps,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":vb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:m("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:m("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});Ll.displayName="Sidebar";const Wl=x.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=st();return a.jsxs(Et,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:m("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Wl.displayName="SidebarTrigger";const Sb=x.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=st();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:m("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});Sb.displayName="SidebarRail";const Bl=x.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:m("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));Bl.displayName="SidebarInset";const Cb=x.forwardRef(({className:e,...t},n)=>a.jsx(_l,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));Cb.displayName="SidebarInput";const ql=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:m("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));ql.displayName="SidebarHeader";const $l=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:m("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));$l.displayName="SidebarFooter";const Tb=x.forwardRef(({className:e,...t},n)=>a.jsx(Pl,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));Tb.displayName="SidebarSeparator";const Hl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:m("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Hl.displayName="SidebarContent";const Ul=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:m("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Ul.displayName="SidebarGroup";const zl=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:m("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});zl.displayName="SidebarGroupLabel";const Eb=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:m("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});Eb.displayName="SidebarGroupAction";const jl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:m("wu-w-full wu-text-sm",e),...t}));jl.displayName="SidebarGroupContent";const ya=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:m("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));ya.displayName="SidebarMenu";const Gl=x.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("wu-group/menu-item wu-relative",e),...t}));Gl.displayName="SidebarMenuItem";const Mb=qe.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"}}),Kl=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?Ct.Slot:"button",{isMobile:d,state:c}=st(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:m(Mb({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ro,{children:[a.jsx(so,{asChild:!0,children:w}),a.jsx(zr,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):w});Kl.displayName="SidebarMenuButton";const Ib=x.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?Ct.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:m("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});Ib.displayName="SidebarMenuAction";const Ab=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Ab.displayName="SidebarMenuBadge";const kb=x.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:m("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Vl,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Vl,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});kb.displayName="SidebarMenuSkeleton";const Db=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Db.displayName="SidebarMenuSub";const _b=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));_b.displayName="SidebarMenuSubItem";const Pb=x.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?Ct.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:m("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Pb.displayName="SidebarMenuSubButton";function Vb(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,o=t!==void 0,[i,u]=as({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:d,transitionStatus:c}=of(i,!0,!0),[w,p]=x.useState(i),[{height:f,width:g},b]=x.useState({height:void 0,width:void 0}),v=yo(),[N,y]=x.useState(),C=N??v,[S,T]=x.useState(!1),[D,A]=x.useState(!1),k=x.useRef(null),M=x.useRef(null),_=x.useRef(null),P=x.useRef(null),E=Do(P,!1),V=ge(L=>{const O=!i,W=De(uf,L.nativeEvent);if(r(O,W),W.isCanceled)return;const q=P.current;M.current==="css-animation"&&q!=null&&q.style.removeProperty("animation-name"),!S&&!D&&(M.current!=null&&M.current!=="css-animation"&&!l&&O&&d(!0),M.current==="css-animation"&&(!w&&O&&p(!0),!l&&O&&d(!0))),u(O),M.current==="none"&&l&&!O&&d(!1)});return re(()=>{o&&M.current==="none"&&!D&&!i&&d(!1)},[o,D,i,t,d]),x.useMemo(()=>({abortControllerRef:k,animationTypeRef:M,disabled:s,handleTrigger:V,height:f,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:E,setDimensions:b,setHiddenUntilFound:T,setKeepMounted:A,setMounted:d,setOpen:u,setPanelIdState:y,setVisible:p,transitionDimensionRef:_,transitionStatus:c,visible:w,width:g}),[k,M,s,V,f,l,i,C,P,E,b,T,A,d,u,p,_,c,w,g])}const va=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(va.displayName="CollapsibleRootContext");function Yl(){const e=x.useContext(va);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Gt(15));return e}let pn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zt.startingStyle]="startingStyle",e[e.endingStyle=Zt.endingStyle]="endingStyle",e})({}),Ob=(function(e){return e.panelOpen="data-panel-open",e})({});const Fb={[pn.open]:""},Lb={[pn.closed]:""},Wb={open(e){return e?{[Ob.panelOpen]:""}:null}},Xl={...{open(e){return e?Fb:Lb}},...ko},Zl=x.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,...d}=t,c=ge(u),w=Vb({open:l,defaultOpen:o,onOpenChange:c,disabled:i}),p=x.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),f=x.useMemo(()=>({...w,onOpenChange:c,state:p}),[w,c,p]),g=Ye("div",t,{state:p,ref:n,props:d,stateAttributesMapping:Xl});return a.jsx(va.Provider,{value:f,children:g})});process.env.NODE_ENV!=="production"&&(Zl.displayName="CollapsibleRoot");const Jl=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jl.displayName="CompositeRootContext");function Bb(e=!1){const t=x.useContext(Jl);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Gt(16));return t}function qb(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:x.useMemo(()=>{const d={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(d.tabIndex=s,!o&&n&&(d.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||u)&&(d.disabled=n),d},[r,n,t,i,u,o,s])}}function xa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=x.useRef(null),u=Bb(!0),l=o??u!==void 0,{props:d}=qb({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{var g,b;if(!i.current)return;const f=hr(i.current);if(s){if(!f){const v=((g=ft.captureOwnerStack)==null?void 0:g.call(ft))||"";To(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${v}`)}}else if(f){const v=((b=ft.captureOwnerStack)==null?void 0:b.call(ft))||"";To(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${v}`)}},[s]);const c=x.useCallback(()=>{const f=i.current;hr(f)&&l&&t&&d.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,d.disabled,l]);re(c,[c]);const w=x.useCallback((f={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:N,onPointerDown:y,...C}=f;return po({type:s?"button":void 0,onClick(T){if(t){T.preventDefault();return}g==null||g(T)},onMouseDown(T){t||b==null||b(T)},onKeyDown(T){if(t||(Qr(T),N==null||N(T),T.baseUIHandlerPrevented))return;const D=T.target===T.currentTarget,A=T.currentTarget,k=hr(A),M=!s&&$b(A),_=D&&(s?k:!M),P=T.key==="Enter",E=T.key===" ",V=A.getAttribute("role"),L=(V==null?void 0:V.startsWith("menuitem"))||V==="option"||V==="gridcell";if(D&&l&&E){if(T.defaultPrevented&&L)return;T.preventDefault(),M||s&&k?(A.click(),T.preventBaseUIHandler()):_&&(g==null||g(T),T.preventBaseUIHandler());return}_&&(!s&&(E||P)&&T.preventDefault(),!s&&P&&(g==null||g(T)))},onKeyUp(T){if(!t){if(Qr(T),v==null||v(T),T.target===T.currentTarget&&s&&l&&hr(T.currentTarget)&&T.key===" "){T.preventDefault();return}T.baseUIHandlerPrevented||T.target===T.currentTarget&&!s&&!l&&T.key===" "&&(g==null||g(T))}},onPointerDown(T){if(t){T.preventDefault();return}y==null||y(T)}},s?void 0:{role:"button"},d,C)},[t,d,l,s]),p=ge(f=>{i.current=f,c()});return{getButtonProps:w,buttonRef:p}}function hr(e){return Gw(e)&&e.tagName==="BUTTON"}function $b(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Hb={...Wb,...ko},Ql=x.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:i,disabled:u}=Yl(),{className:l,disabled:d=u,id:c,render:w,nativeButton:p=!0,...f}=t,{getButtonProps:g,buttonRef:b}=xa({disabled:d,focusableWhenDisabled:!0,native:p}),v=x.useMemo(()=>({"aria-controls":s?r:void 0,"aria-expanded":s,onClick:o}),[r,s,o]);return Ye("button",t,{state:i,ref:[n,b],props:[v,f,g],stateAttributesMapping:Hb})});process.env.NODE_ENV!=="production"&&(Ql.displayName="CollapsibleTrigger");let Ub=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function zb(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:s,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:d,open:c,panelRef:w,runOnceAnimationsFinish:p,setDimensions:f,setMounted:g,setOpen:b,setVisible:v,transitionDimensionRef:N,visible:y,width:C}=e,S=x.useRef(!1),T=x.useRef(null),D=x.useRef(c),A=x.useRef(c),k=Ao(),M=x.useMemo(()=>n.current==="css-animation"?!y:!c&&!l,[c,l,y,n]),_=ge(E=>{if(!E)return;if(n.current==null||N.current==null){const O=getComputedStyle(E),W=O.animationName!=="none"&&O.animationName!=="",q=O.transitionDuration!=="0s"&&O.transitionDuration!=="";W&&q?process.env.NODE_ENV!=="production"&&ts("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):O.animationName==="none"&&O.transitionDuration!=="0s"?n.current="css-transition":O.animationName!=="none"&&O.transitionDuration==="0s"?n.current="css-animation":n.current="none",E.getAttribute(Ub.orientation)==="horizontal"||O.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(n.current!=="css-transition")return;(s===void 0||C===void 0)&&(f({height:E.scrollHeight,width:E.scrollWidth}),A.current&&E.style.setProperty("transition-duration","0s"));let V=-1,L=-1;return V=le.request(()=>{A.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{le.cancel(V),le.cancel(L)}}),P=Fn(r,w,_);return re(()=>{if(n.current!=="css-transition")return;const E=w.current;if(!E)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),c){const L={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};Object.keys(L).forEach(O=>{E.style.setProperty(O,"initial","important")}),!A.current&&!i&&E.setAttribute(pn.startingStyle,""),f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{Object.entries(L).forEach(([O,W])=>{W===""?E.style.removeProperty(O):E.style.setProperty(O,W)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;f({height:E.scrollHeight,width:E.scrollWidth});const L=new AbortController;t.current=L;const O=L.signal;let W=null;const q=pn.endingStyle;return W=new MutationObserver($=>{$.some(Z=>Z.type==="attributes"&&Z.attributeName===q)&&(W==null||W.disconnect(),W=null,p(()=>{f({height:0,width:0}),E.style.removeProperty("content-visibility"),g(!1),t.current===L&&(t.current=null)},O))}),W.observe(E,{attributes:!0,attributeFilter:[q]}),()=>{W==null||W.disconnect(),k.cancel(),t.current===L&&(L.abort(),t.current=null)}}return()=>{le.cancel(V)}},[t,n,k,o,i,l,c,w,p,f,g]),re(()=>{if(n.current!=="css-animation")return;const E=w.current;E&&(T.current=E.style.animationName||T.current,E.style.setProperty("animation-name","none"),f({height:E.scrollHeight,width:E.scrollWidth}),!D.current&&!S.current&&E.style.removeProperty("animation-name"),c?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,p(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,c,w,p,f,g,v,y]),Ln(()=>{const E=le.request(()=>{D.current=!1});return()=>le.cancel(E)}),re(()=>{if(!o)return;const E=w.current;if(!E)return;let V=-1,L=-1;return c&&S.current&&(E.style.transitionDuration="0s",f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{S.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})})),()=>{le.cancel(V),le.cancel(L)}},[o,c,w,f]),re(()=>{const E=w.current;E&&o&&M&&(E.setAttribute("hidden","until-found"),n.current==="css-transition"&&E.setAttribute(pn.startingStyle,""))},[o,M,n,w]),x.useEffect(function(){const V=w.current;if(!V)return;function L(O){S.current=!0,b(!0),d(!0,De(Jt,O))}return V.addEventListener("beforematch",L),()=>{V.removeEventListener("beforematch",L)}},[d,w,b]),x.useMemo(()=>({props:{hidden:M,id:u,ref:P}}),[M,u,P])}let Rl=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const ec=x.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:o,render:i,id:u,...l}=t;process.env.NODE_ENV!=="production"&&re(()=>{s&&o===!1&&ts("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[s,o]);const{abortControllerRef:d,animationTypeRef:c,height:w,mounted:p,onOpenChange:f,open:g,panelId:b,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setHiddenUntilFound:C,setKeepMounted:S,setMounted:T,setPanelIdState:D,setOpen:A,setVisible:k,state:M,transitionDimensionRef:_,visible:P,width:E,transitionStatus:V}=Yl(),L=s??!1,O=o??!1;re(()=>{if(u)return D(u),()=>{D(void 0)}},[u,D]),re(()=>{C(L)},[C,L]),re(()=>{S(O)},[S,O]);const{props:W}=zb({abortControllerRef:d,animationTypeRef:c,externalRef:n,height:w,hiddenUntilFound:L,id:b,keepMounted:O,mounted:p,onOpenChange:f,open:g,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setMounted:T,setOpen:A,setVisible:k,transitionDimensionRef:_,visible:P,width:E});af({open:g&&V==="idle",ref:v,onComplete(){g&&y({height:void 0,width:void 0})}});const q=x.useMemo(()=>({...M,transitionStatus:V}),[M,V]),$=Ye("div",t,{state:q,ref:[n,v],props:[W,{style:{[Rl.collapsiblePanelHeight]:w===void 0?"auto":`${w}px`,[Rl.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},l],stateAttributesMapping:Xl});return O||L||!O&&p?$:null});process.env.NODE_ENV!=="production"&&(ec.displayName="CollapsiblePanel");const jb=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Fl,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(Ll,{variant:"sidebar",collapsible:"icon",className:m("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(ql,{className:"wu-py-2",children:a.jsx(tc,{})}),t]}),a.jsx(Bl,{className:"wu-contain-inline-size",children:e})]}),tc=e=>{const{state:t,isMobile:n,openMobile:r}=st();return a.jsx(Wl,{...e,children:a.jsx(wa,{showMenu:n?r:t==="expanded"})})},Gb=({className:e,children:t,...n})=>{const r=h.useRef(null),s=h.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:d,scrollHeight:c}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+d!==c)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Hl,{...n,className:m("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(Wt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Kb=e=>a.jsx($l,{...e,children:e.children}),Yb=({label:e,children:t,...n})=>a.jsxs(Ul,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(zl,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(jl,{children:a.jsx(ya,{children:t})})]}),Xb=e=>a.jsx(ya,{...e}),nc=({Icon:e,children:t,className:n,isActive:r,...s})=>{var w;const{state:o}=st(),[i,u]=h.useState(),l=ba(),d=h.isValidElement(t)?h.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),c=h.useRef(null);return h.useEffect(()=>{var p;u(((p=c.current)==null?void 0:p.textContent)||"")},[]),a.jsx(Gl,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Kl,{className:m("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:h.isValidElement(t),ref:c,children:d})})},Zb=({Title:e,Icon:t,children:n,className:r,...s})=>{const{state:o}=st(),i=ba();return a.jsxs(Zl,{children:[a.jsx(Ql,{render:u=>{const l="data-panel-open"in u;return a.jsxs(nc,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Pe,{icon:"wm-arrow-forward-ios",className:m("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(ec,{className:m(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',r),...s,children:n})]})},Jb=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),Na=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},Qb=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Jb.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},hn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Rb=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,d={border:l?`4px solid ${Na(r,hn.BORDER_LIGHTNESS)}`:"",...o},c={backgroundColor:Na(r,s*hn.LIGHTNESS_STEP),fontSize:l?hn.FONT_SIZE_ACTIVE:hn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:Na(r,45+s*6),height:hn.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:m("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:d,...i,children:[a.jsx("div",{style:c,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},ey=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(hl,{open:o,onOpenChange:i,children:[a.jsx(ml,{className:m("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(fa,{className:m("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(ha,{}),a.jsx(Ua.DialogClose,{className:m("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(pa,{className:m("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})},rc=0;class Sa extends Wn{constructor(){super(...arguments);Ee(this,"clear",()=>{this.currentId!==rc&&(clearInterval(this.currentId),this.currentId=rc)})}static create(){return new Sa}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function ty(){const e=Je(Sa.create).current;return Ln(e.disposeEffect),e}function sc(e){const t=Je(ny,e).current;return t.next=e,re(t.effect),t}function ny(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ry(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}const ac={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},sy={...ac,position:"fixed",top:0,left:0},ay={...ac,position:"absolute"},Ca=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ca.displayName="NumberFieldRootContext");function mr(){const e=x.useContext(Ca);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Gt(43));return e}const mn={inputValue:()=>null,value:()=>null,...Xr},oc=new Map;function gn(e,t){const n=JSON.stringify({locale:e,options:t}),r=oc.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return oc.set(n,s),s}function Bt(e,t,n){return e==null?"":gn(t,n).format(e)}function ic(e,t,n){return Bt(e,t,{...n,maximumFractionDigits:20})}const oy=["零","〇","一","二","三","四","五","六","七","八","九"],iy={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},uc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],lc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ta=["0","1","2","3","4","5","6","7","8","9"],cc=["%","٪","%","﹪"],dc=["‰","؉"],wc=["−","-","‒","–","—","﹣"],fc=["+","﹢"],uy=".",ly=",",cy=new RegExp(`[${uc.join("")}]`,"g"),dy=new RegExp(`[${lc.join("")}]`,"g"),wy=new RegExp(`[${Ta.join("")}]`,"g"),fy=new RegExp(`[${oy.join("")}]`,"g"),py=new RegExp(`[${cc.join("")}]`),hy=new RegExp(`[${dc.join("")}]`),Ea=/[٠١٢٣٤٥٦٧٨٩]/,pc=/[۰۱۲۳۴۵۶۷۸۹]/,Ma=/[零〇一二三四五六七八九]/,hc=new RegExp(`[${Ta.join("")}]`),my=[".",",",uy,ly,"٫","٬"],mc=new RegExp("\\p{Zs}","u"),gy=["+",...fc],by=["-",...wc],gr=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),yy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),gc=e=>`[${e.map(yy).join("")}]`,bc=gc(["-"].concat(wc)),yc=gc(["+"].concat(fc)),vc=new RegExp(bc,"gu"),xc=new RegExp(yc,"gu"),bn=new RegExp(bc),br=new RegExp(yc);function Ia(e,t){const n=gn(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),gn(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function yn(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(vc,"-").replace(xc,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Ea.test(r)||pc.test(r)?u="ar":Ma.test(r)&&(u="zh"));const{group:l,decimal:d,currency:c}=Ia(u,n),w=gn(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>gr(A.value)),p=w.length?new RegExp(w.join("|"),"g"):null;let f=null;l&&(new RegExp("\\p{Zs}","u").test(l)?f=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?f=/['’]/g:f=new RegExp(gr(l),"g"));let b=[{regex:l?f:null,replacement:""},{regex:d?new RegExp(gr(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:c?new RegExp(gr(c),"g"):null,replacement:""},{regex:p,replacement:""},{regex:cy,replacement:A=>String(uc.indexOf(A))},{regex:dy,replacement:A=>String(lc.indexOf(A))},{regex:wy,replacement:A=>String(Ta.indexOf(A))},{regex:fy,replacement:A=>iy[A]}].reduce((A,{regex:k,replacement:M})=>k?A.replace(k,M):A,r);const v=b.lastIndexOf(".");if(v!==-1&&(b=`${b.slice(0,v).replace(/\./g,"")}.${b.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const N=(s?"-":"")+b;let y=parseFloat(N);const C=n==null?void 0:n.style,S=C==="unit"&&(n==null?void 0:n.unit)==="percent",T=py.test(e)||C==="percent";return hy.test(e)?y/=1e3:!S&&T&&(y/=100),Number.isNaN(y)?null:y}const vy=60,xy=400,Ny=50,Sy=3,Cy=8,yr=1;function Ty(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ey=1e-10;function My(e){const t=gn("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Iy(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Aa(e,t){const{maximumFractionDigits:n}=My(t);return Iy(e,n)}function Ay(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Ey*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let d;return r==="nearest"?d=Math.round(l):o>0?d=Math.floor(l):d=Math.ceil(l),t+d*(r==="nearest"?n:s)}function ky(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const d=l?Ty(e,n,r):e;if(t!=null&&i){if(t===0)return Aa(d,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const w=Ay(d,c,t,u?"nearest":"directional");return Aa(w,o)}return Aa(d,o)}const Nc=x.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:d=!1,disabled:c=!1,readOnly:w=!1,name:p,defaultValue:f,value:g,onValueChange:b,onValueCommitted:v,allowWheelScrub:N=!1,snapOnStep:y=!1,allowOutOfRange:C=!1,format:S,locale:T,render:D,className:A,inputRef:k,...M}=t,{setDirty:_,validityData:P,disabled:E,setFilled:V,invalid:L,name:O,state:W,validation:q,shouldValidateOnChange:$}=Vn(),G=E||c,Z=O??p,H=u==="any"?1:u,[J,ie]=x.useState(!1),fe=s??Number.MIN_SAFE_INTEGER,Se=o??Number.MAX_SAFE_INTEGER,F=s??0,U=S==null?void 0:S.style,Y=x.useRef(null),K=Fn(k,q.inputRef),me=_o({id:r}),[j,ee]=as({controlled:g,default:f,name:"NumberField",state:"value"}),Q=j??null,ye=sc(Q);re(()=>{V(Q!==null)},[V,Q]);const je=ry(),Ce=sc(S),Te=x.useRef(!1),xt=ge((R,X)=>{Te.current=!1,v==null||v(R,X)}),Cn=Co(),Mr=ty(),Tn=Co(),En=x.useRef(!1),Mn=x.useRef(0),Xe=x.useRef(!0),ue=x.useRef(null),ot=x.useRef(()=>{}),[Nt,Ir]=x.useState(()=>g!==void 0?Sc(Q,T,S):Bt(Q,T,S)),[vd,Tv]=x.useState("numeric"),xd=ge(()=>{const{decimal:R,group:X,currency:ce,literal:pe}=Ia(T,S),se=new Set;my.forEach(ve=>se.add(ve)),R&&se.add(R),X&&(se.add(X),mc.test(X)&&se.add(" "));const We=U==="percent"||U==="unit"&&(S==null?void 0:S.unit)==="percent",Be=U==="percent"||U==="unit"&&(S==null?void 0:S.unit)==="permille";return We&&cc.forEach(ve=>se.add(ve)),Be&&dc.forEach(ve=>se.add(ve)),U==="currency"&&ce&&se.add(ce),pe&&(Array.from(pe).forEach(ve=>se.add(ve)),mc.test(pe)&&se.add(" ")),gy.forEach(ve=>se.add(ve)),fe<0&&by.forEach(ve=>se.add(ve)),se}),$t=ge(R=>R!=null&&R.altKey?i:R!=null&&R.shiftKey?l:H),Ar=ge((R,X)=>{const ce=X.event,pe=X.direction,se=X.reason,We=!C||!(se===os||se===Hn||se===is||se===Qt||se===Jt),Be=ky(R,{step:pe?$t(ce)*pe:void 0,format:Ce.current,minWithDefault:fe,maxWithDefault:Se,minWithZeroDefault:F,snapOnStep:y,small:(ce==null?void 0:ce.altKey)??!1,clamp:We}),ve=X.reason===os||X.reason===Qt||X.reason===Hn||X.reason===is||X.reason===Jt,qa=Be!==Q||ve&&(R!==Q||Xe.current===!1);if(qa){if(ue.current=Be,b==null||b(Be,X),X.isCanceled)return qa;ee(Be),_(Be!==P.initialValue),Te.current=!0}return Xe.current&&Ir(Bt(Be,T,S)),je(),qa}),In=ge((R,{direction:X,currentValue:ce,event:pe,reason:se})=>{const We=ce??ye.current,Be=typeof We=="number"?We+R*X:Math.max(0,s??0);return Ar(Be,De(se,pe,void 0,{direction:X}))}),it=ge(()=>{Tn.clear(),Cn.clear(),Mr.clear(),ot.current(),Mn.current=0}),Nd=ge((R,X)=>{if(it(),!Y.current)return;const ce=rs(Y.current);function pe(We){We.preventDefault()}ce.addEventListener("contextmenu",pe),ot.current=()=>{ce.removeEventListener("contextmenu",pe)},ce.addEventListener("pointerup",We=>{En.current=!1,it();const Be=ue.current??ye.current;xt(Be,en(R?lf:cf,We))},{once:!0});function se(){const We=$t(X)??yr;return In(We,{direction:R?1:-1,event:X,reason:R?"increment-press":"decrement-press"})}if(!se()){it();return}Cn.start(xy,()=>{Mr.start(vy,()=>{se()||it()})})});re(function(){if(!Xe.current)return;const X=g!==void 0?Sc(Q,T,S):Bt(Q,T,S);X!==Nt&&Ir(X)}),re(function(){if(!Xw)return;let X="text";fe>=0&&(X="decimal"),Tv(X)},[fe,U]),x.useEffect(()=>()=>it(),[it]),x.useEffect(function(){const X=Y.current;if(G||w||!N||!X)return;function ce(pe){if(pe.ctrlKey||Mo(Y.current).activeElement!==Y.current)return;pe.preventDefault();const se=$t(pe)??yr;In(se,{direction:pe.deltaY>0?-1:1,event:pe,reason:"wheel"})}return X.addEventListener("wheel",ce),()=>{X.removeEventListener("wheel",ce)}},[N,In,G,w,l,H,$t]);const Ba=x.useMemo(()=>({...W,disabled:G,readOnly:w,required:d,value:Q,inputValue:Nt,scrubbing:J}),[W,G,w,d,Q,Nt,J]),Ev=x.useMemo(()=>({inputRef:Y,inputValue:Nt,value:Q,startAutoChange:Nd,stopAutoChange:it,minWithDefault:fe,maxWithDefault:Se,disabled:G,readOnly:w,id:me,setValue:Ar,incrementValue:In,getStepAmount:$t,allowInputSyncRef:Xe,formatOptionsRef:Ce,valueRef:ye,lastChangedValueRef:ue,hasPendingCommitRef:Te,isPressedRef:En,intentionalTouchCheckTimeout:Tn,movesAfterTouchRef:Mn,name:Z,required:d,invalid:L,inputMode:vd,getAllowedNonNumericKeys:xd,min:s,max:o,setInputValue:Ir,locale:T,isScrubbing:J,setIsScrubbing:ie,state:Ba,onValueCommitted:xt}),[Y,Nt,Q,Nd,it,fe,Se,G,w,me,Ar,In,$t,Ce,ye,Tn,Z,d,L,vd,xd,s,o,Ir,T,J,Ba,xt]),Mv=Ye("div",t,{ref:n,state:Ba,props:M,stateAttributesMapping:mn});return a.jsxs(Ca.Provider,{value:Ev,children:[Mv,a.jsx("input",{...q.getInputValidationProps({onFocus(){var R;(R=Y.current)==null||R.focus()},onChange(R){if(R.nativeEvent.defaultPrevented)return;const X=R.currentTarget.valueAsNumber,ce=Number.isNaN(X)?null:X,pe=De(Jt,R.nativeEvent);_(ce!==P.initialValue),Ar(ce,pe),$()&&q.commit(ce)}}),ref:K,type:"number",name:Z,value:Q??"",min:s,max:o,step:u,disabled:G,required:d,"aria-hidden":!0,tabIndex:-1,style:Z?ay:sy})]})});process.env.NODE_ENV!=="production"&&(Nc.displayName="NumberFieldRoot");function Sc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Bt(e,t,n):ic(e,t,n)}const Cc=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=mr();return Ye("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Cc.displayName="NumberFieldGroup");function vn(e){return e==="touch"||e==="pen"}function Tc(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:d,isIncrement:c,isPressedRef:w,locale:p,movesAfterTouchRef:f,readOnly:g,setValue:b,startAutoChange:v,stopAutoChange:N,valueRef:y,lastChangedValueRef:C,onValueCommitted:S}=e,T=x.useRef({x:0,y:0}),D=x.useRef(!1),A=x.useRef(!1),k=x.useRef(""),M=c?"increment-press":"decrement-press";function _(E){t.current=!0;const V=yn(l,p,r.current);V!==null&&(y.current=V,b(V,De(M,E,void 0,{direction:c?1:-1})))}return{disabled:n,"aria-readonly":g||void 0,"aria-label":c?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(E){const V=n||g;if(E.defaultPrevented||V||(vn(k.current)?A.current:E.detail!==0))return;_(E.nativeEvent);const L=s(E)??yr,O=y.current;i(L,{direction:c?1:-1,event:E.nativeEvent,reason:M});const W=C.current??y.current;W!==O&&S(W,en(M,E.nativeEvent))},onPointerDown(E){var O;const V=!E.button||E.button===0;if(E.defaultPrevented||g||!V||n)return;k.current=E.pointerType,A.current=!1,w.current=!0,T.current={x:E.clientX,y:E.clientY},_(E.nativeEvent),vn(E.pointerType)?d.start(Ny,()=>{const W=f.current;f.current=0,w.current&&W!=null&&W<Sy?(v(c,E),A.current=!0):(A.current=!1,N())}):(E.preventDefault(),(O=u.current)==null||O.focus(),v(c,E))},onPointerUp(E){vn(E.pointerType)&&(w.current=!1)},onPointerMove(E){if(n||g||!vn(E.pointerType)||!w.current)return;f.current!=null&&(f.current+=1);const{x:L,y:O}=T.current,W=L-E.clientX,q=O-E.clientY;W**2+q**2>Cy**2&&N()},onMouseEnter(E){const V=n||g;E.defaultPrevented||V||!w.current||D.current||vn(k.current)||v(c,E)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Ec=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,locale:y,maxWithDefault:C,movesAfterTouchRef:S,readOnly:T,setValue:D,startAutoChange:A,state:k,stopAutoChange:M,value:_,valueRef:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=_!=null&&_>=C,O=o||d||L,W=Tc({isIncrement:!0,inputRef:g,startAutoChange:A,stopAutoChange:M,inputValue:b,disabled:O,readOnly:T,id:p,setValue:D,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:P,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:S,locale:y,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...k,disabled:O}),[k,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Ec.displayName="NumberFieldIncrement");const Mc=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,minWithDefault:y,movesAfterTouchRef:C,readOnly:S,setValue:T,startAutoChange:D,state:A,stopAutoChange:k,value:M,valueRef:_,locale:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=M!=null&&M<=y,O=o||d||L,W=Tc({isIncrement:!1,inputRef:g,startAutoChange:D,stopAutoChange:k,inputValue:b,disabled:O,readOnly:S,id:p,setValue:T,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:_,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:C,locale:P,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...A,disabled:O}),[A,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Mc.displayName="NumberFieldDecrement");function Dy(e,t){const n=x.useRef(e),r=ge(t);re(()=>{n.current!==e&&r(n.current)},[e,r]),re(()=>{n.current=e},[e])}const _y={...Xr,...mn},Py=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ic=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:d,getStepAmount:c,id:w,incrementValue:p,inputMode:f,inputValue:g,max:b,min:v,name:N,readOnly:y,required:C,setValue:S,state:T,setInputValue:D,locale:A,inputRef:k,value:M,onValueCommitted:_,lastChangedValueRef:P,hasPendingCommitRef:E,valueRef:V}=mr(),{clearErrors:L}=fo(),{validationMode:O,setTouched:W,setFocused:q,invalid:$,shouldValidateOnChange:G,validation:Z}=Vn(),{labelId:H}=Rr(),J=x.useRef(!1),ie=x.useRef(!1);return Po({id:w,commit:Z.commit,value:M,controlRef:k,name:N,getValue:()=>M??null}),Dy(M,F=>{const U=G();if(L(N),U&&Z.commit(M),!(F===M||U)){if(ie.current){ie.current=!1;return}Z.commit(M,!0)}}),Ye("input",t,{ref:[n,k],state:T,props:[{id:w,required:C,disabled:u,readOnly:y,inputMode:f,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":$||void 0,"aria-labelledby":H,suppressHydrationWarning:!0,onFocus(F){if(F.defaultPrevented||y||u||(q(!0),J.current))return;J.current=!0;const U=F.currentTarget,Y=U.value.length;U.setSelectionRange(Y,Y)},onBlur(F){if(F.defaultPrevented||y||u)return;W(!0),q(!1);const U=!i.current,Y=E.current;if(i.current=!0,g.trim()===""){S(null,De(Qt,F.nativeEvent)),O==="onBlur"&&Z.commit(null),_(null,en(Qt,F.nativeEvent));return}const K=l.current,me=yn(g,A,K);if(me===null)return;const j=(K==null?void 0:K.maximumFractionDigits)!=null||(K==null?void 0:K.minimumFractionDigits)!=null,ee=K==null?void 0:K.maximumFractionDigits,Q=j&&typeof ee=="number"?Number(me.toFixed(ee)):me,ye=en(Hn,F.nativeEvent),je=M!==Q,Ce=U||je||Y;O==="onBlur"&&Z.commit(Q),je&&(ie.current=!0,S(Q,De(Hn,F.nativeEvent))),Ce&&_(Q,ye);const Te=Bt(Q,A,K),xt=ic(me,A,K);!(!j&&me===M&&g===xt)&&g!==Te&&D(Te)},onChange(F){if(F.nativeEvent.defaultPrevented)return;i.current=!1;const U=F.target.value;if(U.trim()===""){D(U),S(null,De(Qt,F.nativeEvent));return}const Y=d();if(!Array.from(U).every(j=>{const ee=j>="0"&&j<="9",Q=Ea.test(j),ye=Ma.test(j),je=pc.test(j),Ce=hc.test(j),Te=bn.test(j);return ee||Q||ye||je||Ce||Te||Y.has(j)}))return;const me=yn(U,A,l.current);D(U),me!==null&&S(me,De(os,F.nativeEvent))},onKeyDown(F){if(F.defaultPrevented||y||u)return;const U=F.nativeEvent;i.current=!0;const Y=d();let K=Y.has(F.key);const{decimal:me,currency:j,percentSign:ee}=Ia(A,l.current),Q=F.currentTarget.selectionStart,ye=F.currentTarget.selectionEnd,je=Q===0&&ye===g.length,Ce=ue=>Q!=null&&ye!=null&&ue>=Q&&ue<ye;if(bn.test(F.key)&&Array.from(Y).some(ue=>bn.test(ue||""))){const ue=g.search(vc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}if(br.test(F.key)&&Array.from(Y).some(ue=>br.test(ue||""))){const ue=g.search(xc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}[me,j,ee].forEach(ue=>{if(F.key===ue){const ot=g.indexOf(ue),Nt=Ce(ot);K=!g.includes(ue)||je||Nt}});const Te=F.key>="0"&&F.key<="9",xt=Ea.test(F.key),Cn=Ma.test(F.key),Mr=hc.test(F.key),Tn=Py.has(F.key);if(F.which===229||F.altKey||F.ctrlKey||F.metaKey||K||Te||xt||Mr||Cn||Tn)return;const En=yn(g,A,l.current),Mn=c(F)??yr;ef(F);const Xe=en(Rt,U);F.key==="ArrowUp"?(p(Mn,{direction:1,currentValue:En,event:U,reason:Rt}),_(P.current??V.current,Xe)):F.key==="ArrowDown"?(p(Mn,{direction:-1,currentValue:En,event:U,reason:Rt}),_(P.current??V.current,Xe)):F.key==="Home"&&v!=null?(S(v,De(Rt,U)),_(P.current??V.current,Xe)):F.key==="End"&&b!=null&&(S(b,De(Rt,U)),_(P.current??V.current,Xe))},onPaste(F){if(F.defaultPrevented||y||u)return;F.preventDefault();const Y=(F.clipboardData||window.Clipboard).getData("text/plain"),K=yn(Y,A,l.current);K!==null&&(i.current=!1,S(K,De(is,F.nativeEvent)),D(Y))}},Z.getValidationProps(),o],stateAttributesMapping:_y})});process.env.NODE_ENV!=="production"&&(Ic.displayName="NumberFieldInput");const Vy={wuStepper:"_wuStepper_apbnq_1"},Oy=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:d,labelPosition:c="left",disabled:w,resetInvalidValueOnBlur:p=!0,...f})=>{const g=x.useId(),[b,v]=x.useState(l!==void 0?Number(l):n||0);x.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const N=A=>{v(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||v(k)},C=()=>{p&&(i!==void 0&&b<i?(v(i),e==null||e(i)):u!==void 0&&b>u&&(v(u),e==null||e(u)))};x.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const S={inc:r||u!==void 0&&b>=u||w,dec:r||i!==void 0&&b<=i||w},T=i!==void 0&&b<i||u!==void 0&&b>u,D=m("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(Nc,{id:g,value:b,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&N(A),dir:s,className:m("wu-flex wu-stepper",s==="rtl"&&c!=="top"&&"wu-gap-2",Vy.wuStepper,Fy({labelPosition:c}),d),children:[t&&a.jsx(ke,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(Cc,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Mc,{"aria-label":"decrement",className:m(D,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:S.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ic,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||void 0,dir:s,className:m("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:C,disabled:w,min:i,max:u,step:o,value:b,...f}),a.jsx(Ec,{"aria-label":"increment",className:m(D,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:S.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Fy=qe.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"}}}),Le={container:"_container_1cpdq_1",sidebar:"_sidebar_1cpdq_5",content:"_content_1cpdq_13",sourceWrapper:"_sourceWrapper_1cpdq_17",list:"_list_1cpdq_25",listItem:"_listItem_1cpdq_29",listItemActive:"_listItemActive_1cpdq_42",label:"_label_1cpdq_46",icon:"_icon_1cpdq_50",sharedWrapper:"_sharedWrapper_1cpdq_54"},Ac=h.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Le.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));Ac.displayName="WuSharedSurvey";const Ly=(e,t=!1)=>{if(e)return a.jsx("span",{className:Le.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Le.icon,n),"aria-hidden":"true"})},kc=h.memo(({children:e,icon:t,isActive:n,isShared:r,className:s,...o})=>a.jsxs("button",{className:m(Le.listItem,n&&Le.listItemActive,s),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Ly(t,r),a.jsx("span",{className:Le.label,children:e})]}));kc.displayName="WuSurveyItem";const Dc=h.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Le.list,t),...n,children:e}));Dc.displayName="WuSurveyList";const _c=e=>{const{className:t,variant:n="outlined",...r}=e;return a.jsx("div",{className:Le.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(fl,{variant:n,showGroupSeparator:!0,className:m(Le.source,t),...r})})};_c.displayName="WuSurveySource";const Wy=h.memo(_c),Pc=h.memo(({Sidebar:e,children:t,className:n,...r})=>a.jsxs("div",{className:m(Le.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...r,children:[e&&a.jsx("div",{className:Le.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Le.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Pc.displayName="WuSurveySelect";const Vc=qe.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"}}),By=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(Ka.Root,{ref:s,className:m(Vc({variant:t,size:n,className:e})),...r}));By.displayName=Ka.Root.displayName;const Oc=x.createContext({size:"default",variant:"default"}),vr=x.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(An.Root,{ref:o,className:m("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Oc.Provider,{value:{variant:t,size:n},children:r})}));vr.displayName=An.Root.displayName;const vt=x.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=x.useContext(Oc);return a.jsx(An.Item,{ref:o,className:m(Vc({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});vt.displayName=An.Item.displayName;const Fc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>m("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:m("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(vt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Fc.displayName="_IconTab";const Lc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=d=>m("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",d===r&&"wu-text-white wu-font-medium",s&&r===d&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:m("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(vt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(vt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Lc.displayName="_Tab";const Wc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>m("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=m("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=m("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),c=m("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(vt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:d,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:c,role:"knob",dir:o})}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});Wc.displayName="_Toggle";const Bc=h.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:d=!0,...c}=e,[w,p]=h.useState(),f=g=>{let b=w;g!==""?b=g:d&&(b=w==="opt1"?"opt2":"opt1");const v=b==="opt1"?r[0].value:r[1].value;l&&l(v),p(b)};if(h.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");p(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Wc,{...c,ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});case"iconTab":return a.jsx(Fc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});default:return a.jsx(Lc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i,size:u})}});Bc.displayName="WuSwitcher";const qc=ct.Root,ka=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ct.List,{className:m("wu-relative wu-flex",e),...n,ref:r,children:t}));ka.displayName=ct.List.displayName;const Da=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Trigger,{ref:n,className:m("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));Da.displayName=ct.Trigger.displayName;const $c=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Content,{ref:n,className:e,...t}));$c.displayName=ct.Content.displayName;const Hc=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:m("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx($c,{value:r.value,forceMount:t||void 0,className:m("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},qy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return h.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:d,behavior:"smooth"})}}}},Uc=(e,t)=>{const[n,r]=h.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return h.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const d={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(d)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},$y=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=h.useRef(null),d=Uc(l,"horizontal"),{showLeftArrow:c,showRightArrow:w,scrollByTab:p}=qy(l),[f,g]=h.useState(!1),b=()=>p("left"),v=()=>p("right"),N=S=>a.jsx("div",{"data-testid":`gradient-overlay-${S}`,className:m("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",S==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="left";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",D&&"wu-translate-x-0 wu-opacity-100",!D&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:m("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("left"),y(b,"left",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:d.width,left:d.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&f&&N("right"),y(v,"right",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},Hy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return h.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:d,behavior:"smooth"})}}}},Uy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=h.useRef(null),d=Uc(l,"vertical"),{showTopArrow:c,showBottomArrow:w,scrollByTab:p}=Hy(l),[f,g]=h.useState(!1),b=()=>p("up"),v=()=>p("down"),N=S=>a.jsx("div",{className:m("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",S==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="up";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",D&&"wu-translate-y-0 wu-opacity-100",!D&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:m("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("top"),y(b,"up",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:d.height,top:d.top}})]}),w&&f&&N("bottom"),y(v,"down",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},zy=({...e})=>e.orientation==="vertical"?a.jsx(Uy,{...e}):a.jsx($y,{...e}),_a=x.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));_a.displayName="Table";const Pa=x.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));Pa.displayName="TableHeader";const xn=x.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));xn.displayName="TableBody";const jy=x.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:m("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));jy.displayName="TableFooter";const at=x.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:m("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));at.displayName="TableRow";const xr=x.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:m("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));xr.displayName="TableHead";const qt=x.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:m("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));qt.displayName="TableCell";const Nn=x.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:m("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Nn.displayName="TableCaption";const Gy=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=h.useCallback(c=>w=>{s==null||s(w?c:[])},[s]);return{finalColumns:h.useMemo(()=>n?[{id:"select",header:({table:c})=>{const w=c.getRowModel().rows.map(f=>f.original).filter(f=>!(i!=null&&i(f))),p=l(w);return u?a.jsx("div",{}):a.jsx(He,{checked:c.getIsSomeRowsSelected()||c.getIsAllRowsSelected(),partial:c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected(),onChange:f=>{c.toggleAllRowsSelected(!!f),p(!!f)},"aria-label":"Select all","data-testid":c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:c})=>{const w=(i==null?void 0:i(c.original))??!1;return a.jsx(He,{checked:c.getIsSelected(),disabled:w,onChange:p=>{w||c.toggleSelected(!!p)},"aria-label":String(c.original[o])})},filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,l,i,u])}};function zc({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=Gy({columns:t,rowSelection:n}),s=h.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const jc=48,Gc="expander";function Kc(e,t){return e?[{id:Gc,accessorKey:Gc,header:"",cell:({row:n})=>{const r=n.getIsExpanded();return a.jsx("button",{type:"button",className:"wu-inline-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-text-[10px]",onClick:()=>n.toggleExpanded(),"aria-label":r?"Collapse row":"Expand row",children:a.jsx("span",{className:m("wm-arrow-forward-ios wu-transition-all",r?"wu-rotate-90":"")})})},enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,enableHiding:!1,size:jc},...t]:t}function Ky(e,t){const n=t.map(r=>{var s;return(s=r.columnDef)==null?void 0:s.expandableRowContent}).find(r=>r);return n==null?void 0:n.call(null,e)}function Yc(e,t,n){return e===!0&&(!t||n>t)}const Xc=(e,t)=>m("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),Zc=(e,t="default",n,r=!1)=>m("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left",r&&"wu-overflow-hidden"),Yy=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",Xy=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),Zy=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),Jy=(e,t)=>m("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),Qy=(e,t)=>m("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),Jc=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s,isRowDisabled:o,isRowExpandable:i})=>{const u=e.getVisibleLeafColumns().length,l=e.getRowModel().rows;return r?a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s??a.jsx(dt,{className:"wu-w-full"})})})}):l!=null&&l.length?a.jsx(xn,{children:l.flatMap((d,c)=>{const w=(o==null?void 0:o(d.original))??!1,p=d.getIsSelected(),f=d.getIsExpanded(),g=a.jsx(at,{"data-disabled":w,"data-state":p&&"selected",className:Xc(p,w),"data-expanded":f,children:d.getVisibleCells().map((N,y)=>{const C=N.column.columnDef;return a.jsx(qt,{className:Zc(N.column.id,t,C.cellAlign),children:Me.flexRender(C.cell,N.getContext())},`${N.id}-${y}`)})},`${d.id}-${c}`),b=i&&f?Ky(d,e.getVisibleLeafColumns()):null,v=b?a.jsx(at,{"data-expanded":"true","data-state":p&&"selected",children:a.jsx(qt,{colSpan:u,children:b})},`${d.id}-expanded-${c}`):null;return v?[g,v]:[g]})}):a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,children:n})})})},Va=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:d})=>{var N;const c=s==="compact"?"wu-h-8":"wu-h-10",w=e.getVisibleLeafColumns(),p=y=>{const{id:C,columnDef:S,getIsSorted:T,toggleSorting:D}=y,A=S.header,k=S.headerAlign;if(!t.includes(C))return A;const M=T(),_=M==="asc",P=M==="desc",E=()=>{n?(D(!P),r==null||r({id:C,desc:P})):D(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:E,"aria-label":`Sort by ${A}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",Zy(k)),children:[A,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:Qy(_,!!M)}),a.jsx("span",{className:Jy(P,!!M)})]})]})},f=y=>y.column.id==="actions"?a.jsx(xr,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(xr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",Xy(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:Me.flexRender(p(y.column),y.getContext())},y.id),g=()=>e.getHeaderGroups().map(y=>a.jsx(at,{className:"wu-relative",children:y.headers.map(f)},y.id)),b=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",c),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=w[0])==null?void 0:y.getSize(),marginLeft:d?jc:void 0},children:a.jsx(He,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:C=>e.toggleAllRowsSelected(!!C),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},v=o&&i;if(l){const y=((N=e.getHeaderGroups()[0])==null?void 0:N.headers)??[];return a.jsxs(at,{className:"wu-relative",children:[y.map(f),v&&a.jsx(xr,{colSpan:w.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:b()})]})}return a.jsxs(Pa,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",c),children:[g(),v&&a.jsx("div",{className:m("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",c),children:b()})]})},Qc=h.forwardRef((e,t)=>a.jsx(xn,{...e,ref:t}));Qc.displayName="TableBodyComponent";const Rc=({table:e,size:t,isRowDisabled:n,containerHeight:r=600,sortableColumns:s,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l})=>{const d=e.getRowModel().rows,c=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ha.TableVirtuoso,{style:{height:r},totalCount:d.length,fixedHeaderContent:()=>a.jsx(Va,{table:e,sortableColumns:s,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:w=>{const p=d[w];return p?a.jsx(a.Fragment,{children:p.getVisibleCells().map((f,g)=>{const b=f.column.columnDef;return a.jsx(qt,{className:Zc(f.column.id,t,b.cellAlign,!0),children:Me.flexRender(b.cell,f.getContext())},`${f.id}-${g}`)})}):null},components:{Table:({style:w,...p})=>a.jsxs("table",{...p,style:{...w,width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},className:"wu-table-fixed",children:[a.jsx("colgroup",{children:c.map(f=>a.jsx("col",{style:{width:`${f.getSize()}px`}},f.id))}),p.children]}),TableBody:Qc,TableHead:w=>a.jsx(Pa,{...w,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",Yy(t),w.className)}),TableRow:({...w})=>{const p=w["data-index"],f=d[p],g=f?(n==null?void 0:n(f.original))??!1:!1,b=(f==null?void 0:f.getIsSelected())??!1;return a.jsx(at,{...w,"data-disabled":g,"data-state":b&&"selected",className:Xc(b,g)})}}})})},Nr=qe.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),Ry=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:d=!1,CustomLoader:c,caption:w,virtualization:p,isRowExpandable:f,...g})=>{var _,P;const[b,v]=h.useState({}),{finalColumns:N,rowSelectionState:y}=zc({data:e,columns:t,rowSelection:i}),C=h.useMemo(()=>N.filter(E=>E.enableSorting).map(E=>E.accessorKey),[N]),S=h.useMemo(()=>Kc(f,N),[N,f]),T=((_=i==null?void 0:i.selectedRows)==null?void 0:_.length)??0,D=E=>{const V=typeof E=="function"?E(y):E,L=[],O=i==null?void 0:i.isRowDisabled;for(const W in V){if(!V[W])continue;const q=e[Number(W)];q&&(O!=null&&O(q)||L.push(q))}i==null||i.onRowSelect(L)},A=Me.useReactTable({data:e,columns:S,getCoreRowModel:Me.getCoreRowModel(),getPaginationRowModel:Me.getPaginationRowModel(),getExpandedRowModel:f?Me.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?E=>!i.isRowDisabled(E.original):!0,enableExpanding:!!f,state:{...i!=null&&i.isEnabled?{rowSelection:y}:{},...f?{expanded:b}:{}},onRowSelectionChange:D,...f?{onExpandedChange:v}:{}}),k=Yc(p==null?void 0:p.enabled,p==null?void 0:p.threshold,e.length),M=(p==null?void 0:p.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative"),children:k?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:r})),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(dt,{className:"wu-w-full"})}):(P=A.getRowModel().rows)!=null&&P.length?a.jsx(Rc,{table:A,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:M,sortableColumns:C,HeaderAction:u,isRowSelected:T>0,manual:!0,onSort:s==null?void 0:s.onSort}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(_a,{...g,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:r}),"wu-table-fixed",g.className),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),a.jsx(Va,{table:A,sortableColumns:C,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:T>0,isStickyHeader:d,isRowExpandable:f}),a.jsx(Jc,{table:A,size:o,NoDataContent:l,CustomLoader:c,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:f})]})})},ev=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:d,NoDataContent:c,isLoading:w,caption:p,rowSelection:f,isRowExpandable:g,virtualization:b,...v})=>{var G,Z;const[N,y]=h.useState((s==null?void 0:s.initial)||[]),[C,S]=h.useState([]),[T,D]=h.useState((i==null?void 0:i.pageIndex)??0),[A,k]=h.useState({}),{finalColumns:M,rowSelectionState:_}=zc({data:e,columns:t,rowSelection:f}),P=h.useMemo(()=>M.filter(H=>H.enableSorting).map(H=>H.accessorKey),[M]),E=h.useMemo(()=>M.filter(H=>H.filterable).map(H=>H.accessorKey),[M]),V=((G=f==null?void 0:f.selectedRows)==null?void 0:G.length)??0,L=h.useMemo(()=>Kc(g,M),[M,g]),O=H=>{const J=typeof H=="function"?H(_):H,ie=[],fe=f==null?void 0:f.isRowDisabled;for(const Se in J){if(!J[Se])continue;const F=e[Number(Se)];F&&(fe!=null&&fe(F)||ie.push(F))}f==null||f.onRowSelect(ie)},W=Me.useReactTable({data:e,columns:L,getCoreRowModel:Me.getCoreRowModel(),getFilteredRowModel:Me.getFilteredRowModel(),getSortedRowModel:Me.getSortedRowModel(),getPaginationRowModel:i?Me.getPaginationRowModel():void 0,getExpandedRowModel:g?Me.getExpandedRowModel():void 0,enableRowSelection:f!=null&&f.isRowDisabled?H=>!f.isRowDisabled(H.original):!0,enableExpanding:!!g,state:{sorting:N,columnFilters:C,...i?{pagination:i}:{},...f!=null&&f.isEnabled?{rowSelection:_}:{},...g?{expanded:A}:{}},onSortingChange:y,onColumnFiltersChange:S,onRowSelectionChange:O,...g?{onExpandedChange:k}:{}});h.useEffect(()=>{E.forEach(H=>{var J;(J=W.getColumn(H))==null||J.setFilterValue(o)})},[o,E,W]),h.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==T&&(f==null||f.onRowSelect(()=>[]),W.resetRowSelection(),D(i.pageIndex))},[i==null?void 0:i.pageIndex]);const q=Yc(b==null?void 0:b.enabled,b==null?void 0:b.threshold,e.length),$=(b==null?void 0:b.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:q?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:n})),children:[p&&a.jsx(Nn,{children:p}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(dt,{className:"wu-w-full"})}):(Z=W.getRowModel().rows)!=null&&Z.length?a.jsx(Rc,{table:W,size:r,isRowDisabled:f==null?void 0:f.isRowDisabled,containerHeight:$,sortableColumns:P,HeaderAction:l,isRowSelected:V>0}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:c})]}):a.jsxs(_a,{...v,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:n}),"wu-table-fixed",v.className),children:[p&&a.jsx(Nn,{children:p}),a.jsx(Va,{table:W,sortableColumns:P,size:r,HeaderAction:l,isRowSelected:V>0,isStickyHeader:u,isRowExpandable:g}),a.jsx(Jc,{table:W,size:r,NoDataContent:c,CustomLoader:d,isLoading:w,isRowDisabled:f==null?void 0:f.isRowDisabled,isRowExpandable:g})]})})},ed=x.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:m("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));ed.displayName="Textarea";const td=h.forwardRef((e,t)=>{const{Label:n,id:r=Vr(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,d=w=>{l.onChange&&l.onChange(w)},c=kn(u);return a.jsxs("div",{className:m(c,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(ed,{...l,ref:t,id:r,className:m("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:d,readOnly:o,maxLength:i}),n&&a.jsx(ke,{htmlFor:r,className:"wu-textarea-label",children:n})]})});td.displayName="WuTextarea";function tv(e){if(typeof e=="string"&&e.includes("T")){const t=z.parseISO(e);return z.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=z.parse(e,"HH:mm:ss",new Date);return z.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const nd=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],rd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),sd=["am","pm"],Sr=50;function nv(e){return Array(Sr).fill(e).flat()}function Oa(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function rv(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function ad(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const sv=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:m("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),Fa=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:m("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?nv(e):e).map((i,u)=>a.jsx(sv,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function av(e,t,n,r){const s=h.useMemo(()=>e?Oa(nd,t.padStart(2,"0")):nd,[e]),o=h.useMemo(()=>e?Oa(rd,n.padStart(2,"0")):rd,[e]),i=h.useMemo(()=>e?Oa(sd,r):sd,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function ov(e,t,n){h.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/Sr,l=Math.floor(Sr/2);i.scrollTop=l*u;const d=()=>{const{scrollTop:c}=i,w=Math.round(c/u);(w<=1||w>=Sr-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",d),()=>{i.removeEventListener("scroll",d)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const od=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=h.useState(!1),[l,d]=h.useState(""),c=h.useRef(null),w=h.useRef(null),p=h.useRef(null),f=h.useRef(null),[g,b]=h.useState("12"),[v,N]=h.useState("00"),[y,C]=h.useState("am");h.useEffect(()=>{if(!t){d(""),b("12"),N("00"),C("am"),c.current&&(c.current.value="");return}const k=tv(t);d(k);const[M,_]=k.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E),c.current&&(c.current.value=k)},[t]),h.useEffect(()=>{const k=M=>{w.current&&!w.current.contains(M.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),ov(i,p,f);const{rotatedHours:S,rotatedMinutes:T,rotatedMeridiem:D}=av(i,g,v,y),A=h.useCallback((k,M,_)=>{const P=k??g,E=M??v,V=_??y;b(P),N(E),C(V);const L=`${rv(P,V)}:${E}`;d(L)},[g,v,y]);return a.jsxs("div",{className:m("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(ke,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:m("relative inline-block"),ref:w,dir:s,children:[a.jsx(Qe,{ref:c,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{d(k.target.value);const[M,_]=k.target.value.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(Pe,{icon:"wm-schedule",className:m("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
19
19
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
20
- `}),i&&a.jsxs("div",{className:m("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(Fa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:p,onSelect:k=>A(k,v),className:"wu-time-hour-picker"}),a.jsx(Fa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:f,onSelect:k=>A(g,k),className:"wu-time-minute-picker"}),a.jsx(Fa,{values:D,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};od.displayName="WuTimePicker";const iv=1,uv=1e6;let La=0;function lv(){return La=(La+1)%Number.MAX_SAFE_INTEGER,La.toString()}const Wa=new Map,id=e=>{if(Wa.has(e))return;const t=setTimeout(()=>{Wa.delete(e),Sn({type:"REMOVE_TOAST",toastId:e})},uv);Wa.set(e,t)},cv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,iv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?id(n):e.toasts.forEach(r=>{id(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Cr=[];let Tr={toasts:[]};function Sn(e){Tr=cv(Tr,e),Cr.forEach(t=>{t(Tr)})}function ud({...e}){const t=lv(),n=s=>Sn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Sn({type:"DISMISS_TOAST",toastId:t});return Sn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function dv(){const[e,t]=h.useState(Tr);return h.useEffect(()=>(Cr.push(t),()=>{const n=Cr.indexOf(t);n>-1&&Cr.splice(n,1)}),[e]),{...e,toast:ud,dismiss:n=>Sn({type:"DISMISS_TOAST",toastId:n})}}const wv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>ud({description:t,variant:n,duration:r,position:s})}),fv=Ie.Provider,pv=qe.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),ld=x.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Ie.Viewport,{ref:r,className:m(pv({position:t}),e),...n}));ld.displayName=Ie.Viewport.displayName;const hv=qe.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),cd=x.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Ie.Root,{ref:s,className:m(hv({variant:t,position:n}),e),...r}));cd.displayName=Ie.Root.displayName;const mv=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Action,{ref:n,className:m("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));mv.displayName=Ie.Action.displayName;const dd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Close,{ref:n,className:m("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));dd.displayName=Ie.Close.displayName;const wd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));wd.displayName=Ie.Title.displayName;const fd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));fd.displayName=Ie.Description.displayName;function gv(){const{toasts:e}=dv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(fv,{children:Object.entries(t).map(([n,r])=>a.jsx(ld,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(cd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(wd,{children:o}),i&&a.jsxs(fd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(dd,{})]},s)})},n))})}const bv=()=>a.jsx(gv,{}),pd=x.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(_r.Root,{className:m("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(_r.Thumb,{className:m("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));pd.displayName=_r.Root.displayName;const hd=h.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Vr(),...d}=e;return h.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(yv({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(pd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(ke,{htmlFor:l,className:"wu-toggle-label",children:n})]})});hd.displayName="WuToggle";const yv=qe.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"}}}),Er=h.createContext(null),vv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},xv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Nv=({children:e})=>{const[t,n]=h.useState({}),[r,s]=h.useState({}),o=h.useCallback(async(d,c)=>{try{const p=await(await fetch(d)).json();n(p)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=h.useCallback(d=>{s(d)},[]),u=h.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Er.Provider,{value:l,children:e})},Sv={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"}},md=h.createContext(null),gd=()=>{const e=h.useContext(md);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Cv=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=h.useState(t),[i,u]=h.useState({}),[l,d]=h.useState(!0);h.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const f=await fetch(r,{signal:w.signal});if(!f.ok)throw new Error("Failed to fetch translation keys");const g=await f.json(),b=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:g,code:s}),signal:w.signal});if(!b.ok)throw new Error("Failed to fetch dictionary");const v=await b.json();u(v)}catch(f){f.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",f),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=h.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(md.Provider,{value:c,children:e})},bd=h.memo(({__i18nKey:e})=>{const{dictionary:t}=gd();return a.jsx(a.Fragment,{children:t[e]??e})});bd.displayName="WuTranslate",window&&(window.wickUiVersion="1.35.2",window.wickUiIcon="9.0.0",window.wickUiEditor="0.13.0"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=Sv,I.WuAccordion=qd,I.WuActivityLog=zd,I.WuAppHeader=cw,I.WuAppHeaderAccount=Za,I.WuAppHeaderBar=to,I.WuAppHeaderHelp=Ja,I.WuAppHeaderMenu=eo,I.WuAppHeaderSearch=uw,I.WuButton=Ae,I.WuCalender=jr,I.WuCard=$o,I.WuCardFooter=zo,I.WuCardHeader=Ho,I.WuCheckbox=He,I.WuChip=yf,I.WuCombobox=If,I.WuCopyToClipboard=Af,I.WuDataTable=Ry,I.WuDatePicker=mw,I.WuDateRangePicker=gf,I.WuDisplay=ew,I.WuDrawer=Ff,I.WuDrawerClose=Lf,I.WuDrilldown=qg,I.WuFooter=cl,I.WuFormGroup=hw,I.WuHeading=Qd,I.WuHelpButton=dl,I.WuIcon=Pe,I.WuInput=Qe,I.WuInputError=ww,I.WuInputHint=fw,I.WuLabel=ke,I.WuListbox=fl,I.WuLoader=dt,I.WuMenu=da,I.WuMenuCheckboxItem=kg,I.WuMenuIcon=wa,I.WuMenuItem=wr,I.WuMenuItemGroup=Dg,I.WuMenuRadioItem=_g,I.WuMenuSeparatorItem=Pg,I.WuModal=rb,I.WuModalClose=ib,I.WuModalContent=sb,I.WuModalFooter=ob,I.WuModalHeader=ab,I.WuMonthPicker=wb,I.WuPagination=Ml,I.WuPopover=ff,I.WuPopoverClose=us,I.WuPrimaryNavbar=pb,I.WuRadioGroup=Dl,I.WuScrollArea=mb,I.WuSecondaryNavbar=hb,I.WuSelect=Cl,I.WuSharedSurvey=Ac,I.WuSidebar=jb,I.WuSidebarCollapsibleMenu=Zb,I.WuSidebarContent=Gb,I.WuSidebarFooter=Kb,I.WuSidebarGroup=Yb,I.WuSidebarItem=nc,I.WuSidebarMenu=Xb,I.WuSidebarTrigger=tc,I.WuSpotlight=yl,I.WuStackedCard=Rb,I.WuStackedCardOverlay=ey,I.WuStepper=Oy,I.WuSubMenu=Vg,I.WuSubtext=Rd,I.WuSurveyItem=kc,I.WuSurveyList=Dc,I.WuSurveySelect=Pc,I.WuSurveySource=Wy,I.WuSwitcher=Bc,I.WuTab=Uy,I.WuTable=ev,I.WuText=Jd,I.WuTextarea=td,I.WuTimePicker=od,I.WuToast=bv,I.WuToggle=hd,I.WuTooltip=Dn,I.WuTranslate=bd,I.WuTranslateProvider=Cv,I.WuTranslationContext=Er,I.WuTranslationProvider=Nv,I.WuTruncatedLabel=lw,I.WuVirtualScroll=It,I.calculatePosition=Qb,I.useTranslation=vv,I.useTranslationsContext=xv,I.useWickuiTranslate=gd,I.useWuShowToast=wv,I.useWuSidebar=st,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
20
+ `}),i&&a.jsxs("div",{className:m("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(Fa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:p,onSelect:k=>A(k,v),className:"wu-time-hour-picker"}),a.jsx(Fa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:f,onSelect:k=>A(g,k),className:"wu-time-minute-picker"}),a.jsx(Fa,{values:D,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};od.displayName="WuTimePicker";const iv=1,uv=1e6;let La=0;function lv(){return La=(La+1)%Number.MAX_SAFE_INTEGER,La.toString()}const Wa=new Map,id=e=>{if(Wa.has(e))return;const t=setTimeout(()=>{Wa.delete(e),Sn({type:"REMOVE_TOAST",toastId:e})},uv);Wa.set(e,t)},cv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,iv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?id(n):e.toasts.forEach(r=>{id(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Cr=[];let Tr={toasts:[]};function Sn(e){Tr=cv(Tr,e),Cr.forEach(t=>{t(Tr)})}function ud({...e}){const t=lv(),n=s=>Sn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Sn({type:"DISMISS_TOAST",toastId:t});return Sn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function dv(){const[e,t]=h.useState(Tr);return h.useEffect(()=>(Cr.push(t),()=>{const n=Cr.indexOf(t);n>-1&&Cr.splice(n,1)}),[e]),{...e,toast:ud,dismiss:n=>Sn({type:"DISMISS_TOAST",toastId:n})}}const wv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>ud({description:t,variant:n,duration:r,position:s})}),fv=Ie.Provider,pv=qe.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),ld=x.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Ie.Viewport,{ref:r,className:m(pv({position:t}),e),...n}));ld.displayName=Ie.Viewport.displayName;const hv=qe.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),cd=x.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Ie.Root,{ref:s,className:m(hv({variant:t,position:n}),e),...r}));cd.displayName=Ie.Root.displayName;const mv=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Action,{ref:n,className:m("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));mv.displayName=Ie.Action.displayName;const dd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Close,{ref:n,className:m("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));dd.displayName=Ie.Close.displayName;const wd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));wd.displayName=Ie.Title.displayName;const fd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));fd.displayName=Ie.Description.displayName;function gv(){const{toasts:e}=dv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(fv,{children:Object.entries(t).map(([n,r])=>a.jsx(ld,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(cd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(wd,{children:o}),i&&a.jsxs(fd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(dd,{})]},s)})},n))})}const bv=()=>a.jsx(gv,{}),pd=x.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(_r.Root,{className:m("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(_r.Thumb,{className:m("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));pd.displayName=_r.Root.displayName;const hd=h.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Vr(),...d}=e;return h.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(yv({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(pd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(ke,{htmlFor:l,className:"wu-toggle-label",children:n})]})});hd.displayName="WuToggle";const yv=qe.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"}}}),Er=h.createContext(null),vv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},xv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Nv=({children:e})=>{const[t,n]=h.useState({}),[r,s]=h.useState({}),o=h.useCallback(async(d,c)=>{try{const p=await(await fetch(d)).json();n(p)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=h.useCallback(d=>{s(d)},[]),u=h.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Er.Provider,{value:l,children:e})},Sv={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"}},md=h.createContext(null),gd=()=>{const e=h.useContext(md);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Cv=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=h.useState(t),[i,u]=h.useState({}),[l,d]=h.useState(!0);h.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const f=await fetch(r,{signal:w.signal});if(!f.ok)throw new Error("Failed to fetch translation keys");const g=await f.json(),b=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:g,code:s}),signal:w.signal});if(!b.ok)throw new Error("Failed to fetch dictionary");const v=await b.json();u(v)}catch(f){f.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",f),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=h.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(md.Provider,{value:c,children:e})},bd=h.memo(({__i18nKey:e})=>{const{dictionary:t}=gd();return a.jsx(a.Fragment,{children:t[e]??e})});bd.displayName="WuTranslate",window&&(window.wickUiVersion="1.35.4",window.wickUiIcon="9.0.0",window.wickUiEditor="0.13.0"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=Sv,I.WuAccordion=qd,I.WuActivityLog=Ud,I.WuAppHeader=cw,I.WuAppHeaderAccount=Za,I.WuAppHeaderBar=to,I.WuAppHeaderHelp=Ja,I.WuAppHeaderMenu=eo,I.WuAppHeaderSearch=uw,I.WuButton=Ae,I.WuCalender=jr,I.WuCard=$o,I.WuCardFooter=Uo,I.WuCardHeader=Ho,I.WuCheckbox=He,I.WuChip=yf,I.WuCombobox=If,I.WuCopyToClipboard=Af,I.WuDataTable=Ry,I.WuDatePicker=mw,I.WuDateRangePicker=gf,I.WuDisplay=ew,I.WuDrawer=Ff,I.WuDrawerClose=Lf,I.WuDrilldown=qg,I.WuFooter=cl,I.WuFormGroup=hw,I.WuHeading=Qd,I.WuHelpButton=dl,I.WuIcon=Pe,I.WuInput=Qe,I.WuInputError=ww,I.WuInputHint=fw,I.WuLabel=ke,I.WuListbox=fl,I.WuLoader=dt,I.WuMenu=da,I.WuMenuCheckboxItem=kg,I.WuMenuIcon=wa,I.WuMenuItem=wr,I.WuMenuItemGroup=Dg,I.WuMenuRadioItem=_g,I.WuMenuSeparatorItem=Pg,I.WuModal=rb,I.WuModalClose=ib,I.WuModalContent=sb,I.WuModalFooter=ob,I.WuModalHeader=ab,I.WuMonthPicker=wb,I.WuPagination=Ml,I.WuPopover=ff,I.WuPopoverClose=us,I.WuPrimaryNavbar=pb,I.WuRadioGroup=Dl,I.WuScrollArea=mb,I.WuSecondaryNavbar=hb,I.WuSelect=Cl,I.WuSharedSurvey=Ac,I.WuSidebar=jb,I.WuSidebarCollapsibleMenu=Zb,I.WuSidebarContent=Gb,I.WuSidebarFooter=Kb,I.WuSidebarGroup=Yb,I.WuSidebarItem=nc,I.WuSidebarMenu=Xb,I.WuSidebarTrigger=tc,I.WuSpotlight=yl,I.WuStackedCard=Rb,I.WuStackedCardOverlay=ey,I.WuStepper=Oy,I.WuSubMenu=Vg,I.WuSubtext=Rd,I.WuSurveyItem=kc,I.WuSurveyList=Dc,I.WuSurveySelect=Pc,I.WuSurveySource=Wy,I.WuSwitcher=Bc,I.WuTab=zy,I.WuTable=ev,I.WuText=Jd,I.WuTextarea=td,I.WuTimePicker=od,I.WuToast=bv,I.WuToggle=hd,I.WuTooltip=Dn,I.WuTranslate=bd,I.WuTranslateProvider=Cv,I.WuTranslationContext=Er,I.WuTranslationProvider=Nv,I.WuTruncatedLabel=lw,I.WuVirtualScroll=It,I.calculatePosition=Qb,I.useTranslation=vv,I.useTranslationsContext=xv,I.useWickuiTranslate=gd,I.useWuShowToast=wv,I.useWuSidebar=st,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
21
21
  //# sourceMappingURL=index.js.map