@yusr_systems/ui 2.1.7 → 2.1.9

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,37 +0,0 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react-router-dom`),require(`react/jsx-runtime`),require(`lucide-react`),require(`react`),require(`clsx`),require(`@radix-ui/react-slot`),require(`tailwind-merge`),require(`@radix-ui/react-dialog`),require(`@radix-ui/react-separator`),require(`react-day-picker`),require(`@radix-ui/react-popover`),require(`@radix-ui/react-label`),require(`@radix-ui/react-select`),require(`embla-carousel-react`),require(`react-redux`),require(`@radix-ui/react-context-menu`),require(`@radix-ui/react-dropdown-menu`),require(`@radix-ui/react-tooltip`),require(`@radix-ui/react-primitive`),require(`@radix-ui/react-id`),require(`@radix-ui/react-compose-refs`),require(`@radix-ui/react-avatar`),require(`@radix-ui/react-alert-dialog`),require(`recharts`),require(`@radix-ui/react-checkbox`),require(`react-dom`),require(`@radix-ui/react-direction`),require(`vaul`),require(`@radix-ui/react-scroll-area`),require(`sonner`),require(`@radix-ui/react-switch`),require(`@radix-ui/react-tabs`),require(`@radix-ui/react-toggle-group`),require(`@radix-ui/react-toggle`),require(`@yusr_systems/core`),require(`@reduxjs/toolkit`)):typeof define==`function`&&define.amd?define(`exports.react-router-dom.react/jsx-runtime.lucide-react.react.clsx.@radix-ui/react-slot.tailwind-merge.@radix-ui/react-dialog.@radix-ui/react-separator.react-day-picker.@radix-ui/react-popover.@radix-ui/react-label.@radix-ui/react-select.embla-carousel-react.react-redux.@radix-ui/react-context-menu.@radix-ui/react-dropdown-menu.@radix-ui/react-tooltip.@radix-ui/react-primitive.@radix-ui/react-id.@radix-ui/react-compose-refs.@radix-ui/react-avatar.@radix-ui/react-alert-dialog.recharts.@radix-ui/react-checkbox.react-dom.@radix-ui/react-direction.vaul.@radix-ui/react-scroll-area.sonner.@radix-ui/react-switch.@radix-ui/react-tabs.@radix-ui/react-toggle-group.@radix-ui/react-toggle.@yusr_systems/core.@reduxjs/toolkit`.split(`.`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.YusrUI={},e.react_router_dom,e.jsxRuntime,e.LucideReact,e.React,e.clsx,e._radix_ui_react_slot,e.tailwind_merge,e._radix_ui_react_dialog,e._radix_ui_react_separator,e.react_day_picker,e._radix_ui_react_popover,e._radix_ui_react_label,e._radix_ui_react_select,e.embla_carousel_react,e.react_redux,e._radix_ui_react_context_menu,e._radix_ui_react_dropdown_menu,e._radix_ui_react_tooltip,e._radix_ui_react_primitive,e._radix_ui_react_id,e._radix_ui_react_compose_refs,e._radix_ui_react_avatar,e._radix_ui_react_alert_dialog,e.recharts,e._radix_ui_react_checkbox,e.ReactDOM,e._radix_ui_react_direction,e.vaul,e._radix_ui_react_scroll_area,e.sonner,e._radix_ui_react_switch,e._radix_ui_react_tabs,e._radix_ui_react_toggle_group,e._radix_ui_react_toggle,e.YusrCore,e._reduxjs_toolkit))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var ee=Object.create,te=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,L=Object.getOwnPropertyNames,re=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=L(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ie.call(e,s)&&s!==n&&te(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ne(t,s))||r.enumerable});return e},R=(e,t,n)=>(n=e==null?{}:ee(re(e)),oe(t||!e||!e.__esModule?te(n,`default`,{value:e,enumerable:!0}):n,e));i=R(i),c=R(c),l=R(l),d=R(d),f=R(f),p=R(p),m=R(m),g=R(g),_=R(_),v=R(v),S=R(S),C=R(C),w=R(w),T=R(T),E=R(E),D=R(D),k=R(k),j=R(j),M=R(M),N=R(N),P=R(P);function z({isAuthenticated:e,loginPath:r=`/login`}){let i=(0,t.useLocation)();return e?(0,n.jsx)(t.Outlet,{}):(0,n.jsx)(t.Navigate,{to:r,state:{from:i},replace:!0})}function se(){return(0,n.jsxs)(`div`,{className:`pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-slate-50 dark:bg-background transition-colors duration-500`,children:[(0,n.jsxs)(`div`,{className:`absolute inset-0`,children:[(0,n.jsx)(`div`,{className:`absolute -top-[10%] left-[15%] h-150 w-150 rounded-full
2
- bg-primary/10 blur-[120px]
3
- dark:bg-primary/10 dark:blur-[120px]`}),(0,n.jsx)(`div`,{className:`absolute top-[30%] -right-[5%] h-125 w-125 rounded-full
4
- bg-primary/10 blur-[100px]
5
- dark:primary/5 dark:blur-[100px]`}),(0,n.jsx)(`div`,{className:`absolute -bottom-[10%] left-[20%] h-175 w-175 rounded-full
6
- bg-primary/5 blur-[150px]
7
- dark:bg-primary/5 dark:blur-[150px]`})]}),(0,n.jsx)(`div`,{className:`absolute inset-0 opacity-[0.05] dark:opacity-[0.05]`,style:{backgroundImage:`linear-gradient(#6366f1 1px, transparent 1px), linear-gradient(90deg, #6366f1 1px, transparent 1px)`,backgroundSize:`45px 45px`}}),(0,n.jsxs)(`svg`,{className:`absolute inset-0 h-full w-full`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,n.jsx)(`defs`,{children:(0,n.jsxs)(`linearGradient`,{id:`line-grad`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,n.jsx)(`stop`,{offset:`0%`,stopColor:`transparent`}),(0,n.jsx)(`stop`,{offset:`50%`,stopColor:`currentColor`,stopOpacity:`0.15`}),(0,n.jsx)(`stop`,{offset:`100%`,stopColor:`transparent`})]})}),(0,n.jsx)(`path`,{d:`M0 200 L1000 200`,stroke:`url(#line-grad)`,strokeWidth:`1`,fill:`none`,className:`text-indigo-500 dark:text-primary`}),(0,n.jsx)(`path`,{d:`M0 600 L1000 600`,stroke:`url(#line-grad)`,strokeWidth:`1`,fill:`none`,className:`text-indigo-500 dark:text-primary`}),(0,n.jsx)(`circle`,{cx:`20%`,cy:`30%`,r:`1.5`,className:`fill-indigo-500/30 dark:fill-primary/20`}),(0,n.jsx)(`circle`,{cx:`80%`,cy:`40%`,r:`2`,className:`fill-blue-500/30 dark:fill-primary/30`})]}),(0,n.jsx)(`div`,{className:`absolute inset-0 opacity-[0.015] dark:opacity-[0.03] pointer-events-none`,style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`}})]})}var B=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,V=a.clsx,ce=(e,t)=>n=>{if(t?.variants==null)return V(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=B(t)||B(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return V(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function H(...e){return(0,s.twMerge)((0,a.clsx)(e))}var le=ce(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80 hover:bg-primary/90 cursor-pointer`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground cursor-pointer`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function U({className:e,variant:t=`default`,size:r=`default`,asChild:i=!1,...a}){return(0,n.jsx)(i?o.Slot:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:H(le({variant:t,size:r,className:e})),...a})}function ue({formData:e,dialogMode:t,service:a,disable:o,onSuccess:s,validate:c=()=>!0}){let[l,u]=(0,i.useState)(!1);async function d(){if(!c())return;if(!a){s?.(e);return}u(!0);let n=t===`create`?await a.Add(e):await a.Update(e);u(!1),n.status===200&&s?.(n.data)}return(0,n.jsxs)(U,{disabled:l||o?.(),onClick:d,children:[l&&(0,n.jsx)(r.Loader2,{className:`ml-2 h-4 w-4 animate-spin`}),`حفظ`,a?` التغييرات`:``]})}function de({title:e,items:t,onAdd:i,addLabel:a,emptyMessage:o,error:s,headers:c,children:l}){return(0,n.jsxs)(`div`,{className:`space-y-3`,children:[(0,n.jsxs)(`div`,{className:`flex justify-between items-center mb-4`,children:[(0,n.jsx)(`h3`,{className:`text-sm font-bold`,children:e}),(0,n.jsxs)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:[(0,n.jsx)(r.Plus,{className:`h-4 w-4 ml-2`}),` `,a]})]}),(0,n.jsxs)(`div`,{className:s?`border border-red-600 rounded-md p-2`:``,children:[t.length>0&&(0,n.jsxs)(`div`,{className:`flex gap-3 px-3 mb-1 text-muted-foreground text-xs font-medium`,children:[c.map((e,t)=>(0,n.jsx)(`div`,{className:t===0?`flex-1`:`w-24`,children:e},t)),(0,n.jsx)(`div`,{className:`w-10`})]}),t.length===0?(0,n.jsx)(`p`,{className:`text-xs text-muted-foreground text-center py-6 border-2 border-dashed rounded-lg`,children:o}):(0,n.jsx)(`div`,{className:`space-y-2`,children:t.map((e,t)=>l(e,t))})]}),s&&(0,n.jsx)(`p`,{className:`text-xs text-red-500 font-bold mt-2`,children:s})]})}function fe({...e}){return(0,n.jsx)(c.Root,{"data-slot":`dialog`,...e})}function pe({...e}){return(0,n.jsx)(c.Trigger,{"data-slot":`dialog-trigger`,...e})}function me({...e}){return(0,n.jsx)(c.Portal,{"data-slot":`dialog-portal`,...e})}function he({...e}){return(0,n.jsx)(c.Close,{"data-slot":`dialog-close`,...e})}function ge({className:e,...t}){return(0,n.jsx)(c.Overlay,{"data-slot":`dialog-overlay`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function _e({className:e,children:t,showCloseButton:i=!0,...a}){return(0,n.jsxs)(me,{children:[(0,n.jsx)(ge,{}),(0,n.jsxs)(c.Content,{"data-slot":`dialog-content`,className:H(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...a,children:[t,i&&(0,n.jsx)(c.Close,{"data-slot":`dialog-close`,asChild:!0,children:(0,n.jsxs)(U,{variant:`ghost`,className:a.dir===`rtl`?`absolute top-2 left-2`:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,n.jsx)(r.XIcon,{}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function ve({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`gap-2 flex flex-col`,e),...t})}function ye({className:e,showCloseButton:t=!1,children:r,...i}){return(0,n.jsxs)(`div`,{"data-slot":`dialog-footer`,className:H(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...i,children:[r,t&&(0,n.jsx)(c.Close,{asChild:!0,children:(0,n.jsx)(U,{variant:`outline`,children:`Close`})})]})}function be({className:e,...t}){return(0,n.jsx)(c.Title,{"data-slot":`dialog-title`,className:H(`text-base leading-none font-medium`,e),...t})}function xe({className:e,...t}){return(0,n.jsx)(c.Description,{"data-slot":`dialog-description`,className:H(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,e),...t})}function Se({className:e,orientation:t=`horizontal`,decorative:r=!0,...i}){return(0,n.jsx)(l.Root,{"data-slot":`separator`,decorative:r,orientation:t,className:H(`bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...i})}function Ce({title:e,description:t=``,className:r=`sm:max-w-sm`,formData:i,dialogMode:a,service:o,disable:s,onSuccess:c,validate:l=()=>!0,children:u}){return(0,n.jsxs)(_e,{dir:`rtl`,className:H(r,`scroll-auto`),children:[(0,n.jsxs)(ve,{children:[(0,n.jsx)(be,{children:e}),(0,n.jsx)(xe,{children:t})]}),(0,n.jsx)(Se,{}),u,(0,n.jsxs)(ye,{children:[(0,n.jsx)(he,{asChild:!0,children:(0,n.jsx)(U,{variant:`outline`,children:`إلغاء`})}),(0,n.jsx)(ue,{formData:i,dialogMode:a,service:o,disable:s,onSuccess:c,validate:l})]})]})}function we({entityName:e,id:t,service:a,onSuccess:o}){let[s,c]=(0,i.useState)(!1);async function l(){c(!0),(await a.Delete(t)).status===200&&o?.(),c(!1)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ve,{children:[(0,n.jsxs)(be,{children:[`حذف `,e]}),(0,n.jsx)(xe,{})]}),(0,n.jsx)(Se,{}),(0,n.jsx)(`div`,{className:`mx-auto mb-2 flex h-14 w-14 items-center justify-center rounded-full bg-destructive/10`,children:(0,n.jsx)(r.OctagonAlert,{className:`h-7 w-7 text-destructive`})}),(0,n.jsxs)(`span`,{className:`font-bold text-center text-xl`,children:[`هل أنت متأكد من حذف `,e,` رقم `,t,`؟`]}),(0,n.jsxs)(`span`,{className:`text-center text-[15px]`,children:[`لا يمكن التراجع عن هذا الإجراء. سيؤدي ذلك إلى حذف `,e,` نهائياً وإزالته من خوادمنا.`]}),(0,n.jsxs)(ye,{children:[(0,n.jsx)(he,{asChild:!0,children:(0,n.jsx)(U,{variant:`outline`,children:`إلغاء`})}),(0,n.jsxs)(U,{variant:`destructive`,onClick:l,disabled:s,children:[s&&(0,n.jsx)(r.Loader2,{className:`ml-2 h-4 w-4 animate-spin`}),`تأكيد الحذف`]})]})]})}var Te=365.2425,Ee=6048e5,De=864e5,Oe=3600*24;Oe*7,Oe*Te/12*3;var ke=Symbol.for(`constructDateFrom`);function Ae(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&ke in e?e[ke](t):e instanceof Date?new e.constructor(t):new Date(t)}function je(e,t){return Ae(t||e,e)}var Me={};function Ne(){return Me}function Pe(e,t){let n=Ne(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=je(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function W(e,t){return Pe(e,{...t,weekStartsOn:1})}function Fe(e,t){let n=je(e,t?.in),r=n.getFullYear(),i=Ae(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=W(i),o=Ae(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=W(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Ie(e){let t=je(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Le(e,...t){let n=Ae.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Re(e,t){let n=je(e,t?.in);return n.setHours(0,0,0,0),n}function ze(e,t,n){let[r,i]=Le(n?.in,e,t),a=Re(r),o=Re(i),s=+a-Ie(a),c=+o-Ie(o);return Math.round((s-c)/De)}function Be(e,t){let n=Fe(e,t),r=Ae(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),W(r)}function Ve(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function He(e){return!(!Ve(e)&&typeof e!=`number`||isNaN(+je(e)))}function Ue(e,t){let n=je(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var We={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Ge=(e,t,n)=>{let r,i=We[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Ke(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var qe={date:Ke({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Ke({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Ke({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Je={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Ye=(e,t,n,r)=>Je[e];function Xe(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var G={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:Xe({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Xe({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Xe({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:Xe({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:Xe({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Ze(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?$e(s,e=>e.test(o)):Qe(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Qe(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function $e(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function et(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var tt={code:`en-US`,formatDistance:Ge,formatLong:qe,formatRelative:Ye,localize:G,match:{ordinalNumber:et({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ze({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Ze({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ze({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Ze({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Ze({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function nt(e,t){let n=je(e,t?.in);return ze(n,Ue(n))+1}function rt(e,t){let n=je(e,t?.in),r=W(n)-+Be(n);return Math.round(r/Ee)+1}function it(e,t){let n=je(e,t?.in),r=n.getFullYear(),i=Ne(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Ae(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Pe(o,t),c=Ae(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Pe(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function at(e,t){let n=Ne(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=it(e,t),a=Ae(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Pe(a,t)}function ot(e,t){let n=je(e,t?.in),r=Pe(n,t)-+at(n,t);return Math.round(r/Ee)+1}function K(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var st={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return K(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):K(n+1,2)},d(e,t){return K(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return K(e.getHours()%12||12,t.length)},H(e,t){return K(e.getHours(),t.length)},m(e,t){return K(e.getMinutes(),t.length)},s(e,t){return K(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return K(Math.trunc(r*10**(n-3)),t.length)}},ct={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},lt={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return st.y(e,t)},Y:function(e,t,n,r){let i=it(e,r),a=i>0?i:1-i;return t===`YY`?K(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):K(a,t.length)},R:function(e,t){return K(Fe(e),t.length)},u:function(e,t){return K(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return K(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return K(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return st.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return K(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ot(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):K(i,t.length)},I:function(e,t,n){let r=rt(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):K(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):st.d(e,t)},D:function(e,t,n){let r=nt(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):K(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return K(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return K(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return K(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?ct.noon:r===0?ct.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?ct.evening:r>=12?ct.afternoon:r>=4?ct.morning:ct.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return st.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):st.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):K(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):K(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):st.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):st.s(e,t)},S:function(e,t){return st.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return dt(r);case`XXXX`:case`XX`:return ft(r);default:return ft(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return dt(r);case`xxxx`:case`xx`:return ft(r);default:return ft(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+ut(r,`:`);default:return`GMT`+ft(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+ut(r,`:`);default:return`GMT`+ft(r,`:`)}},t:function(e,t,n){return K(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return K(+e,t.length)}};function ut(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+K(a,2)}function dt(e,t){return e%60==0?(e>0?`-`:`+`)+K(Math.abs(e)/60,2):ft(e,t)}function ft(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=K(Math.trunc(r/60),2),a=K(r%60,2);return n+i+t+a}var pt=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},mt=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},ht={p:mt,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return pt(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,pt(r,t)).replace(`{{time}}`,mt(i,t))}},gt=/^D+$/,_t=/^Y+$/,vt=[`D`,`DD`,`YY`,`YYYY`];function yt(e){return gt.test(e)}function bt(e){return _t.test(e)}function xt(e,t,n){let r=St(e,t,n);if(console.warn(r),vt.includes(e))throw RangeError(r)}function St(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Ct=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tt=/^'([^]*?)'?$/,Et=/''/g,Dt=/[a-zA-Z]/;function Ot(e,t,n){let r=Ne(),i=n?.locale??r.locale??tt,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=je(e,n?.in);if(!He(s))throw RangeError(`Invalid time value`);let c=t.match(wt).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=ht[t];return n(e,i.formatLong)}return e}).join(``).match(Ct).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:kt(e)};if(lt[t])return{isToken:!0,value:e};if(t.match(Dt))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&bt(a)||!n?.useAdditionalDayOfYearTokens&&yt(a))&&xt(a,t,String(e));let o=lt[a[0]];return o(s,a,i.localize,l)}).join(``)}function kt(e){let t=e.match(Tt);return t?t[1].replace(Et,`'`):e}var At={lessThanXSeconds:{one:`أقل من ثانية واحدة`,two:`أقل من ثانتين`,threeToTen:`أقل من {{count}} ثواني`,other:`أقل من {{count}} ثانية`},xSeconds:{one:`ثانية واحدة`,two:`ثانتين`,threeToTen:`{{count}} ثواني`,other:`{{count}} ثانية`},halfAMinute:`نصف دقيقة`,lessThanXMinutes:{one:`أقل من دقيقة`,two:`أقل من دقيقتين`,threeToTen:`أقل من {{count}} دقائق`,other:`أقل من {{count}} دقيقة`},xMinutes:{one:`دقيقة واحدة`,two:`دقيقتين`,threeToTen:`{{count}} دقائق`,other:`{{count}} دقيقة`},aboutXHours:{one:`ساعة واحدة تقريباً`,two:`ساعتين تقريباً`,threeToTen:`{{count}} ساعات تقريباً`,other:`{{count}} ساعة تقريباً`},xHours:{one:`ساعة واحدة`,two:`ساعتين`,threeToTen:`{{count}} ساعات`,other:`{{count}} ساعة`},xDays:{one:`يوم واحد`,two:`يومين`,threeToTen:`{{count}} أيام`,other:`{{count}} يوم`},aboutXWeeks:{one:`أسبوع واحد تقريباً`,two:`أسبوعين تقريباً`,threeToTen:`{{count}} أسابيع تقريباً`,other:`{{count}} أسبوع تقريباً`},xWeeks:{one:`أسبوع واحد`,two:`أسبوعين`,threeToTen:`{{count}} أسابيع`,other:`{{count}} أسبوع`},aboutXMonths:{one:`شهر واحد تقريباً`,two:`شهرين تقريباً`,threeToTen:`{{count}} أشهر تقريباً`,other:`{{count}} شهر تقريباً`},xMonths:{one:`شهر واحد`,two:`شهرين`,threeToTen:`{{count}} أشهر`,other:`{{count}} شهر`},aboutXYears:{one:`عام واحد تقريباً`,two:`عامين تقريباً`,threeToTen:`{{count}} أعوام تقريباً`,other:`{{count}} عام تقريباً`},xYears:{one:`عام واحد`,two:`عامين`,threeToTen:`{{count}} أعوام`,other:`{{count}} عام`},overXYears:{one:`أكثر من عام`,two:`أكثر من عامين`,threeToTen:`أكثر من {{count}} أعوام`,other:`أكثر من {{count}} عام`},almostXYears:{one:`عام واحد تقريباً`,two:`عامين تقريباً`,threeToTen:`{{count}} أعوام تقريباً`,other:`{{count}} عام تقريباً`}},jt=(e,t,n)=>{let r,i=At[e];return r=typeof i==`string`?i:t===1?i.one:t===2?i.two:t<=10?i.threeToTen.replace(`{{count}}`,String(t)):i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`في خلال `+r:`منذ `+r:r},Mt={date:Ke({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Ke({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Ke({formats:{full:`{{date}} 'عند' {{time}}`,long:`{{date}} 'عند' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Nt={lastWeek:`'أخر' eeee 'عند' p`,yesterday:`'أمس عند' p`,today:`'اليوم عند' p`,tomorrow:`'غداً عند' p`,nextWeek:`eeee 'عند' p`,other:`P`},Pt={code:`ar-SA`,formatDistance:jt,formatLong:Mt,formatRelative:(e,t,n,r)=>Nt[e],localize:{ordinalNumber:e=>String(e),era:Xe({values:{narrow:[`ق`,`ب`],abbreviated:[`ق.م.`,`ب.م.`],wide:[`قبل الميلاد`,`بعد الميلاد`]},defaultWidth:`wide`}),quarter:Xe({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`ر1`,`ر2`,`ر3`,`ر4`],wide:[`الربع الأول`,`الربع الثاني`,`الربع الثالث`,`الربع الرابع`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Xe({values:{narrow:[`ي`,`ف`,`م`,`أ`,`م`,`ي`,`ي`,`أ`,`س`,`أ`,`ن`,`د`],abbreviated:[`ينا`,`فبر`,`مارس`,`أبريل`,`مايو`,`يونـ`,`يولـ`,`أغسـ`,`سبتـ`,`أكتـ`,`نوفـ`,`ديسـ`],wide:[`يناير`,`فبراير`,`مارس`,`أبريل`,`مايو`,`يونيو`,`يوليو`,`أغسطس`,`سبتمبر`,`أكتوبر`,`نوفمبر`,`ديسمبر`]},defaultWidth:`wide`}),day:Xe({values:{narrow:[`ح`,`ن`,`ث`,`ر`,`خ`,`ج`,`س`],short:[`أحد`,`اثنين`,`ثلاثاء`,`أربعاء`,`خميس`,`جمعة`,`سبت`],abbreviated:[`أحد`,`اثنـ`,`ثلا`,`أربـ`,`خميـ`,`جمعة`,`سبت`],wide:[`الأحد`,`الاثنين`,`الثلاثاء`,`الأربعاء`,`الخميس`,`الجمعة`,`السبت`]},defaultWidth:`wide`}),dayPeriod:Xe({values:{narrow:{am:`ص`,pm:`م`,midnight:`ن`,noon:`ظ`,morning:`صباحاً`,afternoon:`بعد الظهر`,evening:`مساءاً`,night:`ليلاً`},abbreviated:{am:`ص`,pm:`م`,midnight:`نصف الليل`,noon:`ظهر`,morning:`صباحاً`,afternoon:`بعد الظهر`,evening:`مساءاً`,night:`ليلاً`},wide:{am:`ص`,pm:`م`,midnight:`نصف الليل`,noon:`ظهر`,morning:`صباحاً`,afternoon:`بعد الظهر`,evening:`مساءاً`,night:`ليلاً`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`ص`,pm:`م`,midnight:`ن`,noon:`ظ`,morning:`في الصباح`,afternoon:`بعد الظـهر`,evening:`في المساء`,night:`في الليل`},abbreviated:{am:`ص`,pm:`م`,midnight:`نصف الليل`,noon:`ظهر`,morning:`في الصباح`,afternoon:`بعد الظهر`,evening:`في المساء`,night:`في الليل`},wide:{am:`ص`,pm:`م`,midnight:`نصف الليل`,noon:`ظهر`,morning:`صباحاً`,afternoon:`بعد الظـهر`,evening:`في المساء`,night:`في الليل`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:et({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ze({matchPatterns:{narrow:/^(ق|ب)/i,abbreviated:/^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,wide:/^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^قبل/i,/^بعد/i]},defaultParseWidth:`any`}),quarter:Ze({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^ر[1234]/i,wide:/^الربع [1234]/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ze({matchPatterns:{narrow:/^[يفمأمسند]/i,abbreviated:/^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i,wide:/^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^ي/i,/^ف/i,/^م/i,/^أ/i,/^م/i,/^ي/i,/^ي/i,/^أ/i,/^س/i,/^أ/i,/^ن/i,/^د/i],any:[/^ين/i,/^ف/i,/^مار/i,/^أب/i,/^ماي/i,/^يون/i,/^يول/i,/^أغ/i,/^س/i,/^أك/i,/^ن/i,/^د/i]},defaultParseWidth:`any`}),day:Ze({matchPatterns:{narrow:/^[حنثرخجس]/i,short:/^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,abbreviated:/^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,wide:/^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^ح/i,/^ن/i,/^ث/i,/^ر/i,/^خ/i,/^ج/i,/^س/i],wide:[/^الأحد/i,/^الاثنين/i,/^الثلاثاء/i,/^الأربعاء/i,/^الخميس/i,/^الجمعة/i,/^السبت/i],any:[/^أح/i,/^اث/i,/^ث/i,/^أر/i,/^خ/i,/^ج/i,/^س/i]},defaultParseWidth:`any`}),dayPeriod:Ze({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ft({className:e,classNames:t,showOutsideDays:i=!0,captionLayout:a=`label`,buttonVariant:o=`ghost`,locale:s,formatters:c,components:l,...d}){let f=(0,u.getDefaultClassNames)();return(0,n.jsx)(u.DayPicker,{showOutsideDays:i,className:H(`p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] bg-background group/calendar in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:a,locale:s,formatters:{formatMonthDropdown:e=>e.toLocaleString(s?.code,{month:`short`}),...c},classNames:{root:H(`w-fit`,f.root),months:H(`flex gap-4 flex-col md:flex-row relative`,f.months),month:H(`flex flex-col w-full gap-4`,f.month),nav:H(`flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between`,f.nav),button_previous:H(le({variant:o}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,f.button_previous),button_next:H(le({variant:o}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,f.button_next),month_caption:H(`flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)`,f.month_caption),dropdowns:H(`w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5`,f.dropdowns),dropdown_root:H(`relative rounded-(--cell-radius)`,f.dropdown_root),dropdown:H(`absolute bg-popover inset-0 opacity-0`,f.dropdown),caption_label:H(`select-none font-medium`,a===`label`?`text-sm`:`rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5`,f.caption_label),table:`w-full border-collapse`,weekdays:H(`flex`,f.weekdays),weekday:H(`text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none`,f.weekday),week:H(`flex w-full mt-2`,f.week),week_number_header:H(`select-none w-(--cell-size)`,f.week_number_header),week_number:H(`text-[0.8rem] select-none text-muted-foreground`,f.week_number),day:H(`relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-e-(--cell-radius) group/day aspect-square select-none`,d.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-s-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-s-(--cell-radius)`,f.day),range_start:H(`rounded-s-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:end-0 z-0 isolate`,f.range_start),range_middle:H(`rounded-none`,f.range_middle),range_end:H(`rounded-e-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:start-0 z-0 isolate`,f.range_end),today:H(`bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none`,f.today),outside:H(`text-muted-foreground aria-selected:text-muted-foreground`,f.outside),disabled:H(`text-muted-foreground opacity-50`,f.disabled),hidden:H(`invisible`,f.hidden),...t},components:{Root:({className:e,rootRef:t,...r})=>(0,n.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:H(e),...r}),Chevron:({className:e,orientation:t,...i})=>t===`left`?(0,n.jsx)(r.ChevronLeftIcon,{className:H(`rtl:rotate-180 size-4`,e),...i}):t===`right`?(0,n.jsx)(r.ChevronRightIcon,{className:H(`rtl:rotate-180 size-4`,e),...i}):(0,n.jsx)(r.ChevronDownIcon,{className:H(`size-4`,e),...i}),DayButton:({...e})=>(0,n.jsx)(It,{locale:s,...e}),WeekNumber:({children:e,...t})=>(0,n.jsx)(`td`,{...t,children:(0,n.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...l},...d})}function It({className:e,day:t,modifiers:r,locale:a,...o}){let s=(0,u.getDefaultClassNames)(),c=i.useRef(null);return i.useEffect(()=>{r.focused&&c.current?.focus()},[r.focused]),(0,n.jsx)(U,{ref:c,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(a?.code),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:H(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-e-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-s-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70`,s.day,e),...o})}function Lt({...e}){return(0,n.jsx)(d.Root,{"data-slot":`popover`,...e})}function Rt({...e}){return(0,n.jsx)(d.Trigger,{"data-slot":`popover-trigger`,...e})}function zt({className:e,align:t=`center`,sideOffset:r=4,...i}){return(0,n.jsx)(d.Portal,{children:(0,n.jsx)(d.Content,{"data-slot":`popover-content`,align:t,sideOffset:r,className:H(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden`,e),...i})})}function Bt({...e}){return(0,n.jsx)(d.Anchor,{"data-slot":`popover-anchor`,...e})}function Vt({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`popover-header`,className:H(`flex flex-col gap-0.5 text-sm`,e),...t})}function Ht({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`popover-title`,className:H(`font-medium`,e),...t})}function Ut({className:e,...t}){return(0,n.jsx)(`p`,{"data-slot":`popover-description`,className:H(`text-muted-foreground`,e),...t})}function Wt({value:e,onChange:t,isInvalid:i,placeholder:a=`اختر تاريخا`,locale:o=Pt}){return(0,n.jsxs)(Lt,{children:[(0,n.jsx)(Rt,{asChild:!0,children:(0,n.jsxs)(U,{variant:`outline`,className:H(`w-full justify-between text-left font-normal`,!e&&`text-muted-foreground`,i&&`border-red-600 ring-red-600 text-red-900`),children:[e?Ot(e,`PPP`,{locale:o}):(0,n.jsx)(`span`,{children:a}),(0,n.jsx)(r.ChevronDownIcon,{className:`h-4 w-4 opacity-50`})]})}),(0,n.jsx)(zt,{className:`w-auto p-0`,children:(0,n.jsx)(Ft,{mode:`single`,selected:e,onSelect:t,locale:o})})]})}function Gt({className:e,...t}){return(0,n.jsx)(f.Root,{"data-slot":`label`,className:H(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,e),...t})}function Kt({label:e,error:t,isInvalid:r,children:i,required:a}){return(0,n.jsxs)(`div`,{className:`flex flex-col gap-1.5 w-full`,children:[(0,n.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,n.jsx)(Gt,{className:`text-sm font-medium`,children:e}),a&&(0,n.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),i,r&&t&&(0,n.jsx)(`span`,{className:`text-xs text-red-500 animate-in fade-in slide-in-from-top-1`,children:t})]})}function qt({label:e,error:t,isInvalid:r,required:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:r,required:i,children:(0,n.jsx)(Wt,{...a,isInvalid:r})})}function Jt({className:e,type:t,...r}){return(0,n.jsx)(`input`,{type:t,"data-slot":`input`,className:H(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,e),...r})}function Yt({isInvalid:e,className:t,...r}){return(0,n.jsx)(Jt,{...r,className:H(t,e&&`border-red-500 ring-red-500 text-red-900 focus-visible:ring-red-500`)})}function Xt({value:e,onChange:t,isInvalid:r,locale:i=Pt}){let a=e instanceof Date?e:void 0;return(0,n.jsxs)(`div`,{className:`flex gap-2 w-full`,children:[(0,n.jsx)(`div`,{className:`flex-1`,children:(0,n.jsx)(Wt,{value:a,onChange:e=>{if(!e)return;let n=new Date(e);a&&n.setHours(a.getHours(),a.getMinutes()),t(n)},isInvalid:r,locale:i,placeholder:`إختر تاريخا`})}),(0,n.jsx)(`div`,{className:`w-24`,children:(0,n.jsx)(Yt,{type:`time`,className:`bg-background appearance-none`,value:a?Ot(a,`HH:mm`):``,onChange:e=>{let n=e.target.value;if(!n)return;let[r,i]=n.split(`:`).map(Number),o=a?new Date(a):new Date;o.setHours(r,i,0,0),t(o)},isInvalid:r})})]})}function Zt({label:e,error:t,isInvalid:r,required:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:r,required:i,children:(0,n.jsx)(Xt,{...a,isInvalid:r})})}function Qt({title:e}){return(0,n.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,n.jsx)(Se,{className:`flex-1`}),(0,n.jsx)(Gt,{className:`shrink-0 text-sm font-semibold`,children:e}),(0,n.jsx)(Se,{className:`flex-1`})]})}function $t({title:e,children:t,columns:r=2,className:i}){return(0,n.jsxs)(`div`,{className:H(`space-y-3`,i),children:[e&&(0,n.jsx)(Qt,{title:e}),(0,n.jsx)(`div`,{className:H(`grid gap-4`,{"grid-cols-1":r===1,"grid-cols-2":r===2,"grid-cols-3":r===3}),children:t})]})}function en({label:e,error:t,isInvalid:r,required:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:r,required:i,children:(0,n.jsx)(Yt,{...a,isInvalid:r})})}function tn({onChange:e,min:t,max:r,isInvalid:i,className:a,...o}){return(0,n.jsx)(Jt,{...o,type:`number`,min:t,max:r,className:H(a,i&&`border-red-600 ring-red-600 text-red-900`),onChange:n=>{let i=n.target.value;if(i===``){e?.(void 0);return}let a=Number(i);t!==void 0&&a<Number(t)&&(a=Number(t)),r!==void 0&&a>Number(r)&&(a=Number(r)),e?.(a)}})}function nn({label:e,error:t,isInvalid:r,required:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:r,required:i,children:(0,n.jsx)(tn,{...a,isInvalid:r})})}function rn(e){let[t,a]=(0,i.useState)(!1);return(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsx)(en,{...e,type:t?`text`:`password`,className:`pl-10`}),(0,n.jsx)(`button`,{type:`button`,onClick:()=>a(!t),className:`absolute left-3 top-8.5 text-gray-500 hover:text-gray-700`,children:t?(0,n.jsx)(r.EyeOff,{size:16}):(0,n.jsx)(r.Eye,{size:16})})]})}function an(e){return(0,n.jsx)(en,{...e,type:`tel`,dir:`ltr`,placeholder:`05xxxxxxxx`,className:`text-right font-mono`})}function on({...e}){return(0,n.jsx)(p.Root,{"data-slot":`select`,...e})}function sn({className:e,...t}){return(0,n.jsx)(p.Group,{"data-slot":`select-group`,className:H(`scroll-my-1 p-1`,e),...t})}function cn({...e}){return(0,n.jsx)(p.Value,{"data-slot":`select-value`,...e})}function ln({className:e,size:t=`default`,children:i,...a}){return(0,n.jsxs)(p.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:H(`border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pe-2 ps-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,(0,n.jsx)(p.Icon,{asChild:!0,children:(0,n.jsx)(r.ChevronDownIcon,{className:`text-muted-foreground size-4 pointer-events-none`})})]})}function un({className:e,children:t,position:r=`item-aligned`,align:i=`center`,...a}){return(0,n.jsx)(p.Portal,{children:(0,n.jsxs)(p.Content,{"data-slot":`select-content`,"data-align-trigger":r===`item-aligned`,className:H(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 rtl:data-[side=left]:translate-x-1 data-[side=right]:translate-x-1 rtl:data-[side=right]:-translate-x-1 data-[side=top]:-translate-y-1`,e),position:r,align:i,...a,children:[(0,n.jsx)(mn,{}),(0,n.jsx)(p.Viewport,{"data-position":r,className:H(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,r===`popper`&&``),children:t}),(0,n.jsx)(hn,{})]})})}function dn({className:e,...t}){return(0,n.jsx)(p.Label,{"data-slot":`select-label`,className:H(`text-muted-foreground px-1.5 py-1 text-xs`,e),...t})}function fn({className:e,children:t,...i}){return(0,n.jsxs)(p.Item,{"data-slot":`select-item`,className:H(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i,children:[(0,n.jsx)(`span`,{className:`pointer-events-none absolute end-2 flex size-4 items-center justify-center`,children:(0,n.jsx)(p.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{className:`pointer-events-none`})})}),(0,n.jsx)(p.ItemText,{children:t})]})}function pn({className:e,...t}){return(0,n.jsx)(p.Separator,{"data-slot":`select-separator`,className:H(`bg-border -mx-1 my-1 h-px pointer-events-none`,e),...t})}function mn({className:e,...t}){return(0,n.jsx)(p.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:H(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,n.jsx)(r.ChevronUpIcon,{})})}function hn({className:e,...t}){return(0,n.jsx)(p.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:H(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,n.jsx)(r.ChevronDownIcon,{})})}function gn({value:e,onValueChange:t,options:r,placeholder:i,isInvalid:a,disabled:o}){return(0,n.jsxs)(on,{value:e,onValueChange:t,dir:`rtl`,disabled:o,children:[(0,n.jsx)(ln,{className:H(`w-full`,a&&`border-red-600 ring-red-600 text-red-900`),children:(0,n.jsx)(cn,{placeholder:i})}),(0,n.jsx)(un,{children:r.map(e=>(0,n.jsx)(fn,{value:e.value,children:e.label},e.value))})]})}function _n({label:e,error:t,required:r,isInvalid:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:i,required:r,children:(0,n.jsx)(gn,{...a,isInvalid:i})})}function vn({className:e,size:t=`default`,...r}){return(0,n.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col`,e),...r})}function yn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-header`,className:H(`gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]`,e),...t})}function bn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-title`,className:H(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function xn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-description`,className:H(`text-muted-foreground text-sm`,e),...t})}function Sn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-action`,className:H(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}function Cn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-content`,className:H(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function wn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`card-footer`,className:H(`bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center`,e),...t})}var Tn=i.createContext(null);function En(){let e=i.useContext(Tn);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function Dn({orientation:e=`horizontal`,opts:t,setApi:r,plugins:a,className:o,children:s,...c}){let[l,u]=(0,m.default)({...t,axis:e===`horizontal`?`x`:`y`},a),[d,f]=i.useState(!1),[p,h]=i.useState(!1),g=i.useCallback(e=>{e&&(f(e.canScrollPrev()),h(e.canScrollNext()))},[]),_=i.useCallback(()=>{u?.scrollPrev()},[u]),v=i.useCallback(()=>{u?.scrollNext()},[u]),y=i.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),_()):e.key===`ArrowRight`&&(e.preventDefault(),v())},[_,v]);return i.useEffect(()=>{!u||!r||r(u)},[u,r]),i.useEffect(()=>{if(u)return g(u),u.on(`reInit`,g),u.on(`select`,g),()=>{u?.off(`select`,g)}},[u,g]),(0,n.jsx)(Tn.Provider,{value:{carouselRef:l,api:u,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:_,scrollNext:v,canScrollPrev:d,canScrollNext:p},children:(0,n.jsx)(`div`,{onKeyDownCapture:y,className:H(`relative`,o),role:`region`,"aria-roledescription":`carousel`,"data-slot":`carousel`,...c,children:s})})}function On({className:e,...t}){let{carouselRef:r,orientation:i}=En();return(0,n.jsx)(`div`,{ref:r,className:`overflow-hidden`,"data-slot":`carousel-content`,children:(0,n.jsx)(`div`,{className:H(`flex`,i===`horizontal`?`-ms-4`:`-mt-4 flex-col`,e),...t})})}function kn({className:e,...t}){let{orientation:r}=En();return(0,n.jsx)(`div`,{role:`group`,"aria-roledescription":`slide`,"data-slot":`carousel-item`,className:H(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`ps-4`:`pt-4`,e),...t})}function An({className:e,variant:t=`outline`,size:i=`icon-sm`,...a}){let{orientation:o,scrollPrev:s,canScrollPrev:c}=En();return(0,n.jsxs)(U,{"data-slot":`carousel-previous`,variant:t,size:i,className:H(`absolute touch-manipulation rounded-full`,o===`horizontal`?`top-1/2 -start-12 -translate-y-1/2`:`-top-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...a,children:[(0,n.jsx)(r.ChevronLeftIcon,{className:`rtl:rotate-180`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})}function jn({className:e,variant:t=`outline`,size:i=`icon-sm`,...a}){let{orientation:o,scrollNext:s,canScrollNext:c}=En();return(0,n.jsxs)(U,{"data-slot":`carousel-next`,variant:t,size:i,className:H(`absolute touch-manipulation rounded-full`,o===`horizontal`?`top-1/2 -end-12 -translate-y-1/2`:`-bottom-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...a,children:[(0,n.jsx)(r.ChevronRightIcon,{className:`rtl:rotate-180`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})}function Mn(e){return e?.contentType===`application/pdf`||e?.extension?.toLowerCase()===`.pdf`}function Nn({label:e,file:t,onFileChange:a,onRemove:o,onDownload:s,getFileSrc:c,showPreview:l,fileInputRef:u,error:d,isInvalid:f,dir:p=`rtl`}){let m=(0,i.useMemo)(()=>Array.isArray(t)?t:t?[t]:[],[t]),h=(0,i.useMemo)(()=>m.filter(e=>l(e)),[m,l]),g=(0,i.useCallback)(e=>{a(e),e.target&&(e.target.value=``)},[a]),_=(0,i.useCallback)(e=>{let t=Mn(e),i=c(e);return t?(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center w-full h-full bg-muted/30`,children:[(0,n.jsx)(r.FileText,{className:`h-12 w-12 text-red-500 mb-2`}),(0,n.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground px-2 truncate w-full text-center`,children:`PDF Document`})]}):(0,n.jsx)(`img`,{src:i,alt:`File preview`,loading:`lazy`,className:`w-full h-full object-cover transition-transform duration-300 group-hover:scale-105`})},[c]);return(0,n.jsxs)(`div`,{className:`space-y-3`,children:[(0,n.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground pb-10`,children:e}),h.length>0?(0,n.jsxs)(`div`,{className:`space-y-2 max-w-100 mt-3`,children:[(0,n.jsxs)(Dn,{opts:{direction:p,align:`start`,dragFree:!0},className:`w-full relative group`,children:[(0,n.jsx)(On,{children:h.map((e,t)=>{let i=e.url||(e.base64File?e.base64File.substring(0,40):`fallback-key-${t}`),a=m.indexOf(e);return(0,n.jsx)(kn,{className:`basis-full`,children:(0,n.jsx)(`div`,{className:`p-1`,children:(0,n.jsx)(vn,{className:`relative group overflow-hidden border-2 aspect-video flex items-center justify-center bg-background shadow-sm`,children:(0,n.jsxs)(Cn,{className:`p-0 w-full h-full flex items-center justify-center`,children:[(0,n.jsxs)(fe,{children:[(0,n.jsx)(pe,{asChild:!0,children:(0,n.jsxs)(`div`,{className:`cursor-zoom-in w-full h-full relative group`,children:[_(e),(0,n.jsx)(`div`,{className:`absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center`,children:(0,n.jsx)(r.Maximize2,{className:`text-white w-6 h-6`})})]})}),(0,n.jsx)(_e,{className:`sm:max-w-[80vw] sm:w-[80vw] sm:h-[80vh] p-0 bg-background/95 border-none shadow-2xl overflow-hidden flex items-center justify-center`,children:e.contentType===`application/pdf`||e.extension?.toLowerCase()===`.pdf`?(0,n.jsx)(`iframe`,{src:c(e),title:`PDF Preview`,className:`w-full h-full border-none bg-white`}):(0,n.jsx)(`div`,{className:`relative w-full h-full flex items-center justify-center p-4`,children:(0,n.jsx)(`img`,{alt:`Full view`,src:c(e),className:`max-w-full max-h-full object-contain shadow-lg rounded-sm`})})})]}),(0,n.jsxs)(`div`,{className:`absolute top-2 right-2 flex flex-col gap-2 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity z-30`,children:[(0,n.jsx)(U,{type:`button`,size:`icon`,className:`h-7 w-7 rounded-full shadow-lg bg-red-600 text-white`,onClick:t=>{t.stopPropagation(),o(a,e)},"aria-label":`Remove file`,children:(0,n.jsx)(r.X,{className:`h-4 w-4`})}),(0,n.jsx)(U,{type:`button`,size:`icon`,variant:`secondary`,className:`h-7 w-7 rounded-full shadow-lg`,onClick:t=>{t.stopPropagation(),s(t,e)},"aria-label":`Download file`,children:(0,n.jsx)(r.Download,{className:`h-4 w-4`})})]})]})})})},i)})}),h.length>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(An,{className:`absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full z-40 bg-background/80 hover:bg-background`}),(0,n.jsx)(jn,{className:`absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full z-40 bg-background/80 hover:bg-background`})]})]}),(0,n.jsxs)(U,{type:`button`,variant:`outline`,size:`sm`,className:`w-full text-[10px] h-8 border-dashed border-2 hover:bg-muted`,onClick:()=>u.current?.click(),children:[(0,n.jsx)(r.UploadCloud,{className:`ml-2 h-4 w-4`}),`تغيير / إضافة صورة`]})]}):(0,n.jsxs)(`div`,{onClick:()=>u.current?.click(),className:H(`flex flex-col items-center justify-center w-100 mt-3 h-50 border-2 border-dashed rounded-md cursor-pointer hover:bg-muted/50 transition-colors bg-muted/5`,f&&`border-red-500 bg-red-50`),children:[(0,n.jsx)(r.UploadCloud,{className:`h-8 w-8 text-muted-foreground mb-2`}),(0,n.jsx)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:`ارفع الملفات`}),(0,n.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60 mt-1`,children:`يمكنك اختيار ملفات (صور ، PDF)`})]}),f&&d&&(0,n.jsx)(`p`,{className:`text-[10px] text-red-500 font-medium mr-1`,children:d}),(0,n.jsx)(Jt,{type:`file`,ref:u,className:`hidden`,accept:`image/jpeg,image/png,image/gif,application/pdf`,onChange:g,multiple:!0})]})}function Pn({className:e,...t}){return(0,n.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}function Fn({isInvalid:e,className:t,...r}){return(0,n.jsx)(Pn,{...r,className:H(t,e&&`border-red-600 focus-visible:ring-red-600`)})}function In({label:e,error:t,isInvalid:r,required:i,...a}){return(0,n.jsx)(Kt,{label:e,error:t,isInvalid:r,required:i,children:(0,n.jsx)(Fn,{...a,isInvalid:r})})}function Ln(e){return(0,n.jsx)(en,{...e,type:`text`})}function Rn({srcLight:e,srcDark:t,alt:a,onClose:o}){return(0,i.useEffect)(()=>{let e=e=>e.key===`Escape`&&o();return window.addEventListener(`keydown`,e),document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=``}},[o]),(0,n.jsxs)(`div`,{className:`fixed inset-0 z-100 flex items-center justify-center bg-background/90 backdrop-blur-sm p-4 md:p-10`,onClick:o,children:[(0,n.jsx)(`button`,{className:`absolute top-4 left-4 rounded-full bg-muted p-2 text-foreground hover:bg-accent transition-colors`,onClick:o,"aria-label":`إغلاق`,children:(0,n.jsx)(r.X,{className:`h-5 w-5`})}),(0,n.jsxs)(`div`,{className:`relative max-h-full max-w-6xl w-full overflow-hidden rounded-xl border border-border shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`img`,{src:e,alt:a,className:`block dark:hidden w-full h-auto object-contain`}),(0,n.jsx)(`img`,{src:t,alt:a,className:`hidden dark:block w-full h-auto object-contain`})]})]})}function zn({srcLight:e,srcDark:t,alt:i,className:a,wrapperClassName:o,onOpen:s}){return(0,n.jsxs)(`div`,{className:`group/zoom relative cursor-zoom-in overflow-hidden ${o??``}`,onClick:()=>s(e,t,i),title:`انقر للتكبير`,children:[(0,n.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center opacity-0 transition-opacity duration-200 group-hover/zoom:opacity-100 bg-foreground/10`,children:(0,n.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full bg-background/80 px-3 py-1.5 text-xs font-medium text-foreground shadow backdrop-blur-sm`,children:[(0,n.jsx)(r.ZoomIn,{className:`h-3.5 w-3.5`}),`تكبير`]})}),(0,n.jsx)(`img`,{src:e,alt:i,className:`block dark:hidden transition-transform duration-300 group-hover/zoom:scale-105 ${a??``}`}),(0,n.jsx)(`img`,{src:t,alt:i,className:`hidden dark:block transition-transform duration-300 group-hover/zoom:scale-105 ${a??``}`})]})}function Bn(e,t,n,r){var a=this,o=(0,i.useRef)(null),s=(0,i.useRef)(0),c=(0,i.useRef)(0),l=(0,i.useRef)(null),u=(0,i.useRef)([]),d=(0,i.useRef)(),f=(0,i.useRef)(),p=(0,i.useRef)(e),m=(0,i.useRef)(!0),h=(0,i.useRef)(),g=(0,i.useRef)();p.current=e;var _=typeof window<`u`,v=!t&&t!==0&&_;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=+t||0;var y=!!(n||={}).leading,b=!(`trailing`in n)||!!n.trailing,x=!!n.flushOnExit&&b,S=`maxWait`in n,C=`debounceOnServer`in n&&!!n.debounceOnServer,w=S?Math.max(+n.maxWait||0,t):null,T=(0,i.useMemo)(function(){var e=function(e){var t=u.current,n=d.current;return u.current=d.current=null,s.current=e,c.current=c.current||e,f.current=p.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},i=function(e){if(!m.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||S&&e-s.current>=w},T=function(t){return l.current=null,b&&u.current?e(t):(u.current=d.current=null,f.current)},E=function e(){var r=Date.now();if(y&&c.current===s.current&&D(),i(r))return T(r);if(m.current){var a=t-(r-o.current);n(e,S?Math.min(a,w-(r-s.current)):a)}},D=function(){r&&r({})},O=function(){if(_||C){var r,c=Date.now(),p=i(c);if(u.current=[].slice.call(arguments),d.current=a,o.current=c,x&&!h.current&&(h.current=function(){global.document?.visibilityState===`hidden`&&g.current.flush()},(r=global.document)==null||r.addEventListener==null||r.addEventListener(`visibilitychange`,h.current)),p){if(!l.current&&m.current)return s.current=o.current,n(E,t),y?e(o.current):f.current;if(S)return n(E,t),e(o.current)}return l.current||n(E,t),f.current}};return O.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,u.current=o.current=d.current=l.current=null,e&&r&&r({})},O.isPending=function(){return!!l.current},O.flush=function(){return l.current?T(Date.now()):f.current},O},[y,S,t,w,b,x,v,_,C,r]);return g.current=T,(0,i.useEffect)(function(){return m.current=!0,function(){var e;x&&g.current.flush(),h.current&&=((e=global.document)==null||e.removeEventListener==null||e.removeEventListener(`visibilitychange`,h.current),null),m.current=!1}},[x]),T}function Vn({columnsNames:e,onSearch:t}){let[a,o]=(0,i.useState)(``),[s,c]=(0,i.useState)(e[0]?.value||``),l=Bn((e,n)=>{e.trim()?t({value:e,columnName:n}):t(void 0)},500);return(0,n.jsx)(`div`,{className:`p-3 rounded-t-xl border-x border-t flex flex-col sm:flex-row gap-4`,children:(0,n.jsxs)(`div`,{className:`relative w-full flex gap-2`,children:[e.length>1&&(0,n.jsxs)(on,{dir:`rtl`,value:s,onValueChange:e=>{c(e),a.trim()&&l(a,e)},children:[(0,n.jsx)(ln,{className:`bg-secondary border-none`,children:(0,n.jsx)(cn,{placeholder:`اختر العمود`})}),(0,n.jsx)(un,{children:e.map(e=>(0,n.jsx)(fn,{value:e.value,children:e.label},e.value))})]}),(0,n.jsxs)(`div`,{className:`relative flex-1`,children:[(0,n.jsx)(r.Search,{className:`absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,n.jsx)(Jt,{value:a,onChange:e=>{let n=e.target.value;o(n),n?l(n,s):(l.cancel(),t(void 0))},placeholder:`ابحث...`,className:`pr-10 bg-secondary border-none focus-visible:ring-1`})]})]})})}function Hn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,n.jsx)(`table`,{"data-slot":`table`,className:H(`w-full caption-bottom text-sm`,e),...t})})}function Un({className:e,...t}){return(0,n.jsx)(`thead`,{"data-slot":`table-header`,className:H(`[&_tr]:border-b`,e),...t})}function Wn({className:e,...t}){return(0,n.jsx)(`tbody`,{"data-slot":`table-body`,className:H(`[&_tr:last-child]:border-0`,e),...t})}function Gn({className:e,...t}){return(0,n.jsx)(`tfoot`,{"data-slot":`table-footer`,className:H(`bg-muted/50 border-t font-medium [&>tr]:last:border-b-0`,e),...t})}function Kn({className:e,...t}){return(0,n.jsx)(`tr`,{"data-slot":`table-row`,className:H(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,e),...t})}function qn({className:e,...t}){return(0,n.jsx)(`th`,{"data-slot":`table-head`,className:H(`text-foreground h-10 px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0`,e),...t})}function Jn({className:e,...t}){return(0,n.jsx)(`td`,{"data-slot":`table-cell`,className:H(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0`,e),...t})}function Yn({className:e,...t}){return(0,n.jsx)(`caption`,{"data-slot":`table-caption`,className:H(`text-muted-foreground mt-4 text-sm`,e),...t})}function Xn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`empty`,className:H(`gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance`,e),...t})}function Zn({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`empty-header`,className:H(`gap-2 flex max-w-sm flex-col items-center`,e),...t})}var Qn=ce(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function $n({className:e,variant:t=`default`,...r}){return(0,n.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:H(Qn({variant:t,className:e})),...r})}function er({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`empty-title`,className:H(`text-sm font-medium tracking-tight`,e),...t})}function tr({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`empty-description`,className:H(`text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function nr({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`empty-content`,className:H(`gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance`,e),...t})}function rr({mode:e}){return e===`loading`?(0,n.jsx)(ir,{}):e===`error`?(0,n.jsx)(or,{}):(0,n.jsx)(ar,{})}function ir(){return(0,n.jsxs)(Xn,{children:[(0,n.jsxs)(Zn,{children:[(0,n.jsx)($n,{variant:`icon`,children:(0,n.jsx)(r.Table,{})}),(0,n.jsx)(er,{children:`الرجاء الانتظار`}),(0,n.jsx)(tr,{children:`يتم تحميل البيانات المطلوبة`})]}),(0,n.jsx)(nr,{children:(0,n.jsx)(r.LoaderPinwheelIcon,{className:`animate-spin duration-700`})})]})}function ar(){return(0,n.jsx)(Xn,{children:(0,n.jsxs)(Zn,{children:[(0,n.jsx)($n,{variant:`icon`,children:(0,n.jsx)(r.Table,{})}),(0,n.jsx)(er,{children:`لا توجد بيانات لعرضها`}),(0,n.jsx)(tr,{children:`هذا الجدول فارغ ولا يحتوي على بيانات للعرض`})]})})}function or(){return(0,n.jsxs)(Xn,{children:[(0,n.jsxs)(Zn,{children:[(0,n.jsx)($n,{variant:`icon`,children:(0,n.jsx)(r.Table,{})}),(0,n.jsx)(er,{children:`حدث خطأ ما`}),(0,n.jsx)(tr,{children:`حدث خطأ اثناء جلب البيانات الرجاء التحقق من اتصالك الانترنت او اتصل بخدمة العملاء لدينا في حال تكراره`})]}),(0,n.jsx)(nr,{children:(0,n.jsx)(r.RefreshCwOff,{})})]})}function sr({state:e,children:t}){return e.isLoading?(0,n.jsx)(rr,{mode:`loading`}):e.entities?.count==0?(0,n.jsx)(rr,{mode:`empty`}):e.entities==null?(0,n.jsx)(rr,{mode:`loading`}):(0,n.jsx)(Hn,{children:t})}function cr({...e}){return(0,n.jsx)(g.Root,{"data-slot":`context-menu`,...e})}function lr({className:e,...t}){return(0,n.jsx)(g.Trigger,{"data-slot":`context-menu-trigger`,className:H(`select-none`,e),...t})}function ur({...e}){return(0,n.jsx)(g.Group,{"data-slot":`context-menu-group`,...e})}function dr({...e}){return(0,n.jsx)(g.Portal,{"data-slot":`context-menu-portal`,...e})}function fr({...e}){return(0,n.jsx)(g.Sub,{"data-slot":`context-menu-sub`,...e})}function pr({...e}){return(0,n.jsx)(g.RadioGroup,{"data-slot":`context-menu-radio-group`,...e})}function mr({className:e,...t}){return(0,n.jsx)(g.Portal,{children:(0,n.jsx)(g.Content,{"data-slot":`context-menu-content`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto`,e),...t})})}function hr({className:e,inset:t,variant:r=`default`,...i}){return(0,n.jsx)(g.Item,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":r,className:H(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function gr({className:e,inset:t,children:i,...a}){return(0,n.jsxs)(g.SubTrigger,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:H(`focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,(0,n.jsx)(r.ChevronRightIcon,{className:`rtl:rotate-180 ms-auto`})]})}function _r({className:e,...t}){return(0,n.jsx)(g.SubContent,{"data-slot":`context-menu-sub-content`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground min-w-32 rounded-lg border p-1 shadow-lg duration-100 z-50 origin-(--radix-context-menu-content-transform-origin) overflow-hidden`,e),...t})}function vr({className:e,children:t,checked:i,inset:a,...o}){return(0,n.jsxs)(g.CheckboxItem,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:H(`focus:bg-accent focus:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[(0,n.jsx)(`span`,{className:`absolute end-2 pointer-events-none`,children:(0,n.jsx)(g.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),t]})}function yr({className:e,children:t,inset:i,...a}){return(0,n.jsxs)(g.RadioItem,{"data-slot":`context-menu-radio-item`,"data-inset":i,className:H(`focus:bg-accent focus:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[(0,n.jsx)(`span`,{className:`absolute end-2 pointer-events-none`,children:(0,n.jsx)(g.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),t]})}function br({className:e,inset:t,...r}){return(0,n.jsx)(g.Label,{"data-slot":`context-menu-label`,"data-inset":t,className:H(`text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function xr({className:e,...t}){return(0,n.jsx)(g.Separator,{"data-slot":`context-menu-separator`,className:H(`bg-border -mx-1 my-1 h-px`,e),...t})}function Sr({className:e,...t}){return(0,n.jsx)(`span`,{"data-slot":`context-menu-shortcut`,className:H(`text-muted-foreground group-focus/context-menu-item:text-accent-foreground ms-auto text-xs tracking-widest`,e),...t})}function Cr({tableRows:e,dropdownMenu:t,contextMenuContent:r}){return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(cr,{dir:`rtl`,children:[(0,n.jsx)(lr,{asChild:!0,children:(0,n.jsxs)(Kn,{className:`hover:bg-secondary/50 transition-colors`,children:[(0,n.jsx)(Jn,{children:t}),e.map((e,t)=>(0,n.jsx)(Jn,{children:(0,n.jsx)(`span`,{className:e.rowStyles,children:e.rowName})},t))]})}),r]})})}function wr({cards:e}){return(0,n.jsx)(`div`,{className:`mb-5 grid grid-cols-1 sm:grid-cols-2 gap-5`,children:e.map((e,t)=>(0,n.jsxs)(vn,{className:`shadow-sm`,children:[(0,n.jsxs)(yn,{className:`flex flex-row items-center justify-between space-y-0 pb-2`,children:[(0,n.jsx)(bn,{className:`text-sm font-medium text-muted-foreground`,children:e.title}),e.icon]}),(0,n.jsx)(Cn,{children:(0,n.jsx)(`div`,{className:`text-2xl font-bold`,children:e.data})})]},t))})}function Tr({title:e,buttonTitle:t,createComp:a,isButtonVisible:o=!0}){let[s,c]=(0,i.useState)(!1),l=i.default.isValidElement(a)?i.default.cloneElement(a,{onSuccess:e=>{c(!1),a.props.onSuccess?.(e)}}):a;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{className:`flex justify-between mb-8 gap-3`,children:[(0,n.jsx)(`div`,{children:(0,n.jsx)(`h1`,{children:e})}),o&&(0,n.jsxs)(U,{variant:`default`,onClick:()=>c(!0),children:[(0,n.jsx)(r.PlusIcon,{className:`h-4 w-4`}),t]})]}),s&&(0,n.jsx)(fe,{open:s,onOpenChange:c,children:l})]})}function Er({tableHeadRows:e}){return(0,n.jsx)(Un,{className:`bg-muted`,children:(0,n.jsx)(Kn,{children:e.map((e,t)=>(0,n.jsx)(qn,{className:e.rowStyles,children:e.rowName},t))})})}function Dr({className:e,...t}){return(0,n.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,"data-slot":`pagination`,className:H(`mx-auto flex w-full justify-center`,e),...t})}function Or({className:e,...t}){return(0,n.jsx)(`ul`,{"data-slot":`pagination-content`,className:H(`gap-0.5 flex items-center`,e),...t})}function kr({...e}){return(0,n.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function Ar({className:e,isActive:t,size:r=`icon`,...i}){return(0,n.jsx)(U,{asChild:!0,variant:t?`outline`:`ghost`,size:r,className:H(e),children:(0,n.jsx)(`a`,{"aria-current":t?`page`:void 0,"data-slot":`pagination-link`,"data-active":t,...i})})}function jr({className:e,text:t=`Previous`,...i}){return(0,n.jsxs)(Ar,{"aria-label":`Go to previous page`,size:`default`,className:H(`ps-1.5!`,e),...i,children:[(0,n.jsx)(r.ChevronLeftIcon,{"data-icon":`inline-start`,className:`rtl:rotate-180`}),(0,n.jsx)(`span`,{className:`hidden sm:block`,children:t})]})}function Mr({className:e,text:t=`Next`,...i}){return(0,n.jsxs)(Ar,{"aria-label":`Go to next page`,size:`default`,className:H(`pe-1.5!`,e),...i,children:[(0,n.jsx)(`span`,{className:`hidden sm:block`,children:t}),(0,n.jsx)(r.ChevronRightIcon,{"data-icon":`inline-end`,className:`rtl:rotate-180`})]})}function Nr({className:e,...t}){return(0,n.jsxs)(`span`,{"aria-hidden":!0,"data-slot":`pagination-ellipsis`,className:H(`size-8 [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center`,e),...t,children:[(0,n.jsx)(r.MoreHorizontalIcon,{}),(0,n.jsx)(`span`,{className:`sr-only`,children:`More pages`})]})}function Pr({...e}){return(0,n.jsx)(_.Root,{"data-slot":`dropdown-menu`,...e})}function Fr({...e}){return(0,n.jsx)(_.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function Ir({...e}){return(0,n.jsx)(_.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function Lr({className:e,align:t=`start`,sideOffset:r=4,...i}){return(0,n.jsx)(_.Portal,{children:(0,n.jsx)(_.Content,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:t,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function Rr({...e}){return(0,n.jsx)(_.Group,{"data-slot":`dropdown-menu-group`,...e})}function zr({className:e,inset:t,variant:r=`default`,...i}){return(0,n.jsx)(_.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":r,className:H(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function Br({className:e,children:t,checked:i,inset:a,...o}){return(0,n.jsxs)(_.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:H(`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[(0,n.jsx)(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,n.jsx)(_.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),t]})}function Vr({...e}){return(0,n.jsx)(_.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function Hr({className:e,children:t,inset:i,...a}){return(0,n.jsxs)(_.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:H(`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[(0,n.jsx)(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,n.jsx)(_.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),t]})}function Ur({className:e,inset:t,...r}){return(0,n.jsx)(_.Label,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:H(`text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Wr({className:e,...t}){return(0,n.jsx)(_.Separator,{"data-slot":`dropdown-menu-separator`,className:H(`bg-border -mx-1 my-1 h-px`,e),...t})}function Gr({className:e,...t}){return(0,n.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:H(`text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ms-auto text-xs tracking-widest`,e),...t})}function Kr({...e}){return(0,n.jsx)(_.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function qr({className:e,inset:t,children:i,...a}){return(0,n.jsxs)(_.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:H(`focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,(0,n.jsx)(r.ChevronRightIcon,{className:`rtl:rotate-180 ms-auto`})]})}function Jr({className:e,...t}){return(0,n.jsx)(_.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...t})}var Yr=768;function Xr(){let[e,t]=i.useState(void 0);return i.useEffect(()=>{let e=window.matchMedia(`(max-width: ${Yr-1}px)`),n=()=>{t(window.innerWidth<Yr)};return e.addEventListener(`change`,n),t(window.innerWidth<Yr),()=>e.removeEventListener(`change`,n)},[]),!!e}function Zr({...e}){return(0,n.jsx)(c.Root,{"data-slot":`sheet`,...e})}function Qr({...e}){return(0,n.jsx)(c.Trigger,{"data-slot":`sheet-trigger`,...e})}function $r({...e}){return(0,n.jsx)(c.Close,{"data-slot":`sheet-close`,...e})}function ei({...e}){return(0,n.jsx)(c.Portal,{"data-slot":`sheet-portal`,...e})}function ti({className:e,...t}){return(0,n.jsx)(c.Overlay,{"data-slot":`sheet-overlay`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...t})}function ni({className:e,children:t,side:i=`right`,showCloseButton:a=!0,...o}){return(0,n.jsxs)(ei,{children:[(0,n.jsx)(ti,{}),(0,n.jsxs)(c.Content,{"data-slot":`sheet-content`,"data-side":i,className:H(`bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...o,children:[t,a&&(0,n.jsx)(c.Close,{"data-slot":`sheet-close`,asChild:!0,children:(0,n.jsxs)(U,{variant:`ghost`,className:`absolute top-3 end-3`,size:`icon-sm`,children:[(0,n.jsx)(r.XIcon,{}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function ri({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sheet-header`,className:H(`gap-0.5 p-4 flex flex-col`,e),...t})}function ii({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sheet-footer`,className:H(`gap-2 p-4 mt-auto flex flex-col`,e),...t})}function ai({className:e,...t}){return(0,n.jsx)(c.Title,{"data-slot":`sheet-title`,className:H(`text-foreground text-base font-medium`,e),...t})}function oi({className:e,...t}){return(0,n.jsx)(c.Description,{"data-slot":`sheet-description`,className:H(`text-muted-foreground text-sm`,e),...t})}function si({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`skeleton`,className:H(`bg-muted rounded-md animate-pulse`,e),...t})}function ci({delayDuration:e=0,...t}){return(0,n.jsx)(v.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function li({...e}){return(0,n.jsx)(v.Root,{"data-slot":`tooltip`,...e})}function ui({...e}){return(0,n.jsx)(v.Trigger,{"data-slot":`tooltip-trigger`,...e})}function di({className:e,sideOffset:t=0,children:r,...i}){return(0,n.jsx)(v.Portal,{children:(0,n.jsxs)(v.Content,{"data-slot":`tooltip-content`,sideOffset:t,className:H(`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)`,e),...i,children:[r,(0,n.jsx)(v.Arrow,{className:`size-2.5 rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]`})]})})}var fi=`sidebar_state`,pi=3600*24*7,mi=`16rem`,hi=`18rem`,gi=`3rem`,_i=`b`,vi=i.createContext(null);function yi(){let e=i.useContext(vi);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function bi({defaultOpen:e=!0,open:t,onOpenChange:r,className:a,style:o,children:s,...c}){let l=Xr(),[u,d]=i.useState(!1),[f,p]=i.useState(e),m=t??f,h=i.useCallback(e=>{let t=typeof e==`function`?e(m):e;r?r(t):p(t),document.cookie=`${fi}=${t}; path=/; max-age=${pi}`},[r,m]),g=i.useCallback(()=>l?d(e=>!e):h(e=>!e),[l,h,d]);i.useEffect(()=>{let e=e=>{e.key===_i&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let _=m?`expanded`:`collapsed`,v=i.useMemo(()=>({state:_,open:m,setOpen:h,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:g}),[_,m,h,l,u,d,g]);return(0,n.jsx)(vi.Provider,{value:v,children:(0,n.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":mi,"--sidebar-width-icon":gi,...o},className:H(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full`,a),...c,children:s})})}function xi({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,dir:o,...s}){let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=yi();return r===`none`?(0,n.jsx)(`div`,{"data-slot":`sidebar`,className:H(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,i),...s,children:a}):c?(0,n.jsx)(Zr,{open:u,onOpenChange:d,...s,children:(0,n.jsxs)(ni,{dir:o,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":hi},side:e,children:[(0,n.jsxs)(ri,{className:`sr-only`,children:[(0,n.jsx)(ai,{children:`Sidebar`}),(0,n.jsx)(oi,{children:`Displays the mobile sidebar.`})]}),(0,n.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:a})]})}):(0,n.jsxs)(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":l,"data-collapsible":l===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,n.jsx)(`div`,{"data-slot":`sidebar-gap`,className:H(`transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,n.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:H(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s`,i),...s,children:(0,n.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col`,children:a})})]})}function Si({className:e,onClick:t,...i}){let{toggleSidebar:a}=yi();return(0,n.jsxs)(U,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:H(e),onClick:e=>{t?.(e),a()},...i,children:[(0,n.jsx)(r.PanelLeftIcon,{className:`rtl:rotate-180`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Ci({className:e,...t}){let{toggleSidebar:r}=yi();return(0,n.jsx)(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:H(`hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize rtl:in-data-[side=left]:cursor-e-resize in-data-[side=right]:cursor-e-resize rtl:in-data-[side=right]:cursor-w-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize rtl:[[data-side=left][data-state=collapsed]_&]:cursor-w-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize rtl:[[data-side=right][data-state=collapsed]_&]:cursor-e-resize`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 rtl:group-data-[collapsible=offcanvas]:-translate-x-0 group-data-[collapsible=offcanvas]:after:start-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-end-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-start-2`,e),...t})}function wi({className:e,...t}){return(0,n.jsx)(`main`,{"data-slot":`sidebar-inset`,className:H(`bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 relative flex w-full flex-1 flex-col`,e),...t})}function Ti({className:e,...t}){return(0,n.jsx)(Jt,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:H(`bg-background h-8 w-full shadow-none`,e),...t})}function Ei({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:H(`gap-2 p-2 flex flex-col`,e),...t})}function Di({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:H(`gap-2 p-2 flex flex-col`,e),...t})}function Oi({className:e,...t}){return(0,n.jsx)(Se,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:H(`bg-sidebar-border mx-2 w-auto`,e),...t})}function ki({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:H(`no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function Ai({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:H(`p-2 relative flex w-full min-w-0 flex-col`,e),...t})}function ji({className:e,asChild:t=!1,...r}){return(0,n.jsx)(t?o.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:H(`text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0`,e),...r})}function Mi({className:e,asChild:t=!1,...r}){return(0,n.jsx)(t?o.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:H(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 end-3 w-5 rounded-md p-0 focus-visible:ring-2 [&>svg]:size-4 flex aspect-square items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0`,e),...r})}function Ni({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:H(`text-sm w-full`,e),...t})}function Pi({className:e,...t}){return(0,n.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:H(`gap-0 flex w-full min-w-0 flex-col`,e),...t})}function Fi({className:e,...t}){return(0,n.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:H(`group/menu-item relative`,e),...t})}var Ii=ce(`ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-start text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-6 [&_svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-15 text-lg`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Li({asChild:e=!1,isActive:t=!1,variant:r=`default`,size:i=`default`,tooltip:a,className:s,...c}){let l=e?o.Slot:`button`,{isMobile:u,state:d}=yi(),f=(0,n.jsx)(l,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":i,"data-active":t,className:H(Ii({variant:r,size:i}),s),...c});return a?(typeof a==`string`&&(a={children:a}),(0,n.jsxs)(li,{children:[(0,n.jsx)(ui,{asChild:!0,children:f}),(0,n.jsx)(di,{side:`right`,align:`center`,hidden:d!==`collapsed`||u,...a})]})):f}function Ri({className:e,asChild:t=!1,showOnHover:r=!1,...i}){return(0,n.jsx)(t?o.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:H(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 end-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0`,r&&`peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0`,e),...i})}function zi({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:H(`text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute end-1 h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden`,e),...t})}function Bi({className:e,showIcon:t=!1,...r}){let[a]=i.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,n.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:H(`h-8 gap-2 rounded-md px-2 flex items-center`,e),...r,children:[t&&(0,n.jsx)(si,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,n.jsx)(si,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":a}})]})}function Vi({className:e,...t}){return(0,n.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:H(`border-sidebar-border mx-3.5 translate-x-px rtl:-translate-x-px gap-1 border-s px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col`,e),...t})}function Hi({className:e,...t}){return(0,n.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:H(`group/menu-sub-item relative`,e),...t})}function Ui({asChild:e=!1,size:t=`md`,isActive:r=!1,className:i,...a}){return(0,n.jsx)(e?o.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":r,className:H(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px rtl:translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0`,i),...a})}function Wi({pageSize:e,totalNumber:t,currentPage:r,onPageChanged:i}){let a=Math.ceil(t/e);return(0,n.jsxs)(`div`,{className:`p-4 border-t bg-muted flex items-center justify-between text-sm text-muted-foreground`,children:[(0,n.jsxs)(`span`,{className:`w-50`,children:[` `,`نتائج `,(r-1)*e,` - `,r*e,` من `,t,` `]}),(0,n.jsx)(Dr,{dir:`rtl`,className:`justify-end w-auto mx-0`,children:(0,n.jsxs)(Or,{children:[(0,n.jsx)(kr,{children:(0,n.jsx)(jr,{onClick:()=>{r>1&&i?.(r-1)},text:`السابق`})}),(0,n.jsxs)(Pr,{dir:`rtl`,children:[(0,n.jsx)(Ir,{asChild:!0,children:(0,n.jsx)(Li,{className:`w-full h-5 justify-start gap-2 text-base`,children:(0,n.jsx)(`span`,{children:r})})}),(0,n.jsx)(Lr,{align:`end`,children:Array.from({length:Math.ceil(t/e)},(e,t)=>(0,n.jsx)(zr,{onClick:()=>i?.(t+1),children:t+1},t+1))})]}),(0,n.jsx)(kr,{children:(0,n.jsx)(Mr,{onClick:()=>{r<a&&i?.(r+1)},text:`التالي`})})]})})]})}function Gi({onEditClicked:e,onDeleteClicked:t,type:i,permissions:a}){return(0,n.jsxs)(n.Fragment,{children:[i===`dropdown`&&(0,n.jsxs)(Pr,{dir:`rtl`,children:[(0,n.jsx)(Ir,{asChild:!0,children:(0,n.jsx)(U,{variant:`ghost`,className:`h-8 w-8 p-0`,children:(0,n.jsx)(r.MoreHorizontal,{className:`h-4 w-4`})})}),(0,n.jsxs)(Lr,{align:`start`,children:[(0,n.jsx)(Ur,{children:`الإجراءات`}),(0,n.jsx)(Wr,{}),a.updatePermission&&(0,n.jsx)(zr,{onSelect:e,children:`تعديل`}),a.deletePermission&&(0,n.jsx)(zr,{className:`text-destructive`,onSelect:t,children:`حذف`})]})]}),i===`context`&&(0,n.jsx)(mr,{children:(0,n.jsxs)(ur,{children:[(0,n.jsx)(br,{children:`الإجراءات`}),(0,n.jsx)(xr,{}),a.updatePermission&&(0,n.jsx)(hr,{onSelect:e,children:`تعديل`}),a.deletePermission&&(0,n.jsx)(hr,{className:`text-destructive`,onSelect:t,children:`حذف`})]})})]})}function Ki({permissions:e,useSlice:t,entityName:r,title:a,addNewItemTitle:o,cards:s,columnsToFilter:c,actions:l,service:u,entityState:d,tableHeadRows:f,tableRowMapper:p,ChangeDialog:m,children:g}){let _=(0,h.useDispatch)(),{selectedRow:v,isChangeDialogOpen:y,isDeleteDialogOpen:b}=t();return(0,i.useEffect)(()=>{_(l.filter(void 0))},[_,l.filter]),(0,n.jsxs)(`div`,{className:`px-5 py-3`,children:[(0,n.jsx)(Tr,{title:a,buttonTitle:o,isButtonVisible:e.addPermission,createComp:m}),(0,n.jsx)(wr,{cards:s}),(0,n.jsx)(Vn,{columnsNames:c,onSearch:e=>_(l.filter(e))}),(0,n.jsxs)(`div`,{className:`rounded-b-xl border shadow-sm overflow-hidden`,children:[(0,n.jsxs)(sr,{state:d,children:[(0,n.jsx)(Er,{tableHeadRows:f}),(0,n.jsx)(Wn,{children:d.entities?.data?.map((t,r)=>(0,n.jsx)(Cr,{tableRows:p(t),dropdownMenu:(0,n.jsx)(Gi,{permissions:e,type:`dropdown`,onEditClicked:()=>_(l.openChangeDialog(t)),onDeleteClicked:()=>_(l.openDeleteDialog(t))}),contextMenuContent:(0,n.jsx)(Gi,{permissions:e,type:`context`,onEditClicked:()=>_(l.openChangeDialog(t)),onDeleteClicked:()=>_(l.openDeleteDialog(t))})},r))})]}),(0,n.jsx)(Wi,{pageSize:d.rowsPerPage,totalNumber:d.entities?.count??0,currentPage:d.currentPage||1,onPageChanged:e=>_(l.setCurrentPage(e))}),y&&e.updatePermission&&(0,n.jsx)(fe,{open:y,onOpenChange:e=>_(l.setIsChangeDialogOpen(e)),children:m}),b&&e.deletePermission&&(0,n.jsx)(fe,{open:b,onOpenChange:e=>_(l.setIsDeleteDialogOpen(e)),children:(0,n.jsx)(_e,{dir:`rtl`,className:`sm:max-w-sm`,children:(0,n.jsx)(we,{entityName:r,id:v?.id??0,service:u,onSuccess:()=>{_(l.refresh({deletedId:v?.id})),_(l.setIsDeleteDialogOpen(!1))}})})}),g]})]})}var qi=1,Ji=.9,Yi=.8,Xi=.17,Zi=.1,Qi=.999,$i=.9999,ea=.99,ta=/[\\\/_+.#"@\[\(\{&]/,na=/[\\\/_+.#"@\[\(\{&]/g,ra=/[\s-]/,ia=/[\s-]/g;function aa(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?qi:ea;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=aa(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=qi:ta.test(e.charAt(l-1))?(d*=Yi,p=e.slice(i,l-1).match(na),p&&i>0&&(d*=Qi**+p.length)):ra.test(e.charAt(l-1))?(d*=Ji,m=e.slice(i,l-1).match(ia),m&&i>0&&(d*=Qi**+m.length)):(d*=Xi,i>0&&(d*=Qi**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=$i)),(d<Zi&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=aa(e,t,n,r,l+1,a+2,o),f*Zi>d&&(d=f*Zi)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function oa(e){return e.toLowerCase().replace(ia,` `)}function sa(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,aa(e,t,oa(e),oa(t),0,0,{})}var ca=`[cmdk-group=""]`,la=`[cmdk-group-items=""]`,ua=`[cmdk-group-heading=""]`,da=`[cmdk-item=""]`,fa=`${da}:not([aria-disabled="true"])`,pa=`cmdk-item-select`,ma=`data-value`,ha=(e,t,n)=>sa(e,t,n),ga=i.createContext(void 0),_a=()=>i.useContext(ga),va=i.createContext(void 0),ya=()=>i.useContext(va),ba=i.createContext(void 0),xa=i.forwardRef((e,t)=>{let n=Fa(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fa(()=>new Set),a=Fa(()=>new Map),o=Fa(()=>new Map),s=Fa(()=>new Set),c=Na(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,x=(0,b.useId)(),S=(0,b.useId)(),C=(0,b.useId)(),w=i.useRef(null),T=Ra();Pa(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,E.emit()}},[d]),Pa(()=>{T(6,M)},[]);let E=i.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),D=i.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=c.current?.filter??ha;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=w.current;P().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(la);t?t.appendChild(e.parentElement===t?e:e.closest(`${la} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${la} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${ca}[${ma}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=P().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ma);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ca)?.querySelector(ua))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${da}[aria-selected="true"]`)}function P(){return Array.from(w.current?.querySelectorAll(fa)||[])}function F(e){let t=P()[e];t&&E.setState(`value`,t.getAttribute(ma))}function I(e){var t;let n=N(),r=P(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(ma))}function ee(e){let t=N()?.closest(ca),n;for(;t&&!n;)t=e>0?ja(t,ca):Ma(t,ca),n=t?.querySelector(fa);n?E.setState(`value`,n.getAttribute(ma)):I(e)}let te=()=>F(P().length-1),ne=e=>{e.preventDefault(),e.metaKey?te():e.altKey?ee(1):I(1)},L=e=>{e.preventDefault(),e.metaKey?F(0):e.altKey?ee(-1):I(-1)};return i.createElement(y.Primitive.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&ne(e);break;case`ArrowDown`:ne(e);break;case`p`:case`k`:_&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),F(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(pa);t.dispatchEvent(e)}}}}},i.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:Va},l),Ba(e,e=>i.createElement(va.Provider,{value:E},i.createElement(ga.Provider,{value:D},e))))}),Sa=i.forwardRef((e,t)=>{let n=(0,b.useId)(),r=i.useRef(null),a=i.useContext(ba),o=_a(),s=Na(e),c=s.current?.forceMount??a?.forceMount;Pa(()=>{if(!c)return o.item(n,a?.id)},[c]);let l=La(n,r,[e.value,e.children,r],e.keywords),u=ya(),d=Ia(e=>e.value&&e.value===l.current),f=Ia(e=>c||o.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);i.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(pa,p),()=>t.removeEventListener(pa,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:S,...C}=e;return i.createElement(y.Primitive.div,{ref:(0,x.composeRefs)(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Ca=i.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=(0,b.useId)(),c=i.useRef(null),l=i.useRef(null),u=(0,b.useId)(),d=_a(),f=Ia(e=>a||d.filter()===!1?!0:e.search?e.filtered.groups.has(s):!0);Pa(()=>d.group(s),[]),La(s,c,[e.value,e.heading,l]);let p=i.useMemo(()=>({id:s,forceMount:a}),[a]);return i.createElement(y.Primitive.div,{ref:(0,x.composeRefs)(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&i.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Ba(e,e=>i.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},i.createElement(ba.Provider,{value:p},e))))}),wa=i.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=i.useRef(null),o=Ia(e=>!e.search);return!n&&!o?null:i.createElement(y.Primitive.div,{ref:(0,x.composeRefs)(a,t),...r,"cmdk-separator":``,role:`separator`})}),Ta=i.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=ya(),s=Ia(e=>e.search),c=Ia(e=>e.selectedItemId),l=_a();return i.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),i.createElement(y.Primitive.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ea=i.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=i.useRef(null),s=i.useRef(null),c=Ia(e=>e.selectedItemId),l=_a();return i.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),i.createElement(y.Primitive.div,{ref:(0,x.composeRefs)(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Ba(e,e=>i.createElement(`div`,{ref:(0,x.composeRefs)(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Da=i.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...l}=e;return i.createElement(c.Root,{open:n,onOpenChange:r},i.createElement(c.Portal,{container:s},i.createElement(c.Overlay,{"cmdk-overlay":``,className:a}),i.createElement(c.Content,{"aria-label":e.label,"cmdk-dialog":``,className:o},i.createElement(xa,{ref:t,...l}))))}),Oa=i.forwardRef((e,t)=>Ia(e=>e.filtered.count===0)?i.createElement(y.Primitive.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ka=i.forwardRef((e,t)=>{let{progress:n,children:r,label:a=`Loading...`,...o}=e;return i.createElement(y.Primitive.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ba(e,e=>i.createElement(`div`,{"aria-hidden":!0},e)))}),Aa=Object.assign(xa,{List:Ea,Item:Sa,Input:Ta,Group:Ca,Separator:wa,Dialog:Da,Empty:Oa,Loading:ka});function ja(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ma(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Na(e){let t=i.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>`u`?i.useEffect:i.useLayoutEffect;function Fa(e){let t=i.useRef();return t.current===void 0&&(t.current=e()),t}function Ia(e){let t=ya(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function La(e,t,n,r=[]){let a=i.useRef(),o=_a();return Pa(()=>{var i;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():a.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(i=t.current)==null||i.setAttribute(ma,s),a.current=s}),a}var Ra=()=>{let[e,t]=i.useState(),n=Fa(()=>new Map);return Pa(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function za(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Ba({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(za(t),{ref:t.ref},n(t.props.children)):n(t)}var Va={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Ha({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:H(`border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,e),...t})}var Ua=ce(`text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`ps-2 has-[>button]:ms-[-0.3rem] has-[>kbd]:ms-[-0.15rem] order-first`,"inline-end":`pe-2 has-[>button]:me-[-0.3rem] has-[>kbd]:me-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Wa({className:e,align:t=`inline-start`,...r}){return(0,n.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:H(Ua({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...r})}var Ga=ce(`gap-2 text-sm shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Ka({className:e,type:t=`button`,variant:r=`ghost`,size:i=`xs`,...a}){return(0,n.jsx)(U,{type:t,"data-size":i,variant:r,className:H(Ga({size:i}),e),...a})}function qa({className:e,...t}){return(0,n.jsx)(`span`,{className:H(`text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none`,e),...t})}function Ja({className:e,...t}){return(0,n.jsx)(Jt,{"data-slot":`input-group-control`,className:H(`rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1`,e),...t})}function Ya({className:e,...t}){return(0,n.jsx)(Pn,{"data-slot":`input-group-control`,className:H(`rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1 resize-none`,e),...t})}function Xa({className:e,...t}){return(0,n.jsx)(Aa,{"data-slot":`command`,className:H(`bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden`,e),...t})}function Za({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:r,className:i,showCloseButton:a=!1,...o}){return(0,n.jsxs)(fe,{...o,children:[(0,n.jsxs)(ve,{className:`sr-only`,children:[(0,n.jsx)(be,{children:e}),(0,n.jsx)(xe,{children:t})]}),(0,n.jsx)(_e,{className:H(`rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0`,i),showCloseButton:a,children:r})]})}function Qa({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,n.jsxs)(Ha,{className:`bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:ps-2!`,children:[(0,n.jsx)(Aa.Input,{"data-slot":`command-input`,className:H(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,n.jsx)(Wa,{children:(0,n.jsx)(r.SearchIcon,{className:`size-4 shrink-0 opacity-50`})})]})})}function $a({className:e,...t}){return(0,n.jsx)(Aa.List,{"data-slot":`command-list`,className:H(`no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto`,e),...t})}function eo({className:e,...t}){return(0,n.jsx)(Aa.Empty,{"data-slot":`command-empty`,className:H(`py-6 text-center text-sm`,e),...t})}function to({className:e,...t}){return(0,n.jsx)(Aa.Group,{"data-slot":`command-group`,className:H(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,e),...t})}function no({className:e,...t}){return(0,n.jsx)(Aa.Separator,{"data-slot":`command-separator`,className:H(`bg-border -mx-1 h-px`,e),...t})}function ro({className:e,children:t,...i}){return(0,n.jsxs)(Aa.Item,{"data-slot":`command-item`,className:H(`data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! [&_svg:not([class*='size-'])]:size-4 group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i,children:[t,(0,n.jsx)(r.CheckIcon,{className:`ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function io({className:e,...t}){return(0,n.jsx)(`span`,{"data-slot":`command-shortcut`,className:H(`text-muted-foreground group-data-selected/command-item:text-foreground ms-auto text-xs tracking-widest`,e),...t})}function ao({items:e,itemLabelKey:t,itemValueKey:a,value:o,onValueChange:s,disabled:c,errorInputClass:l,placeholder:u=`اختر...`,columnsNames:d,onSearch:f}){let[p,m]=i.useState(!1),h=e.find(e=>String(e[a])===o),g=h?String(h[t]):u;return(0,n.jsxs)(Lt,{open:p,onOpenChange:m,modal:!0,children:[(0,n.jsx)(Rt,{asChild:!0,children:(0,n.jsxs)(U,{variant:`outline`,role:`combobox`,"aria-expanded":p,disabled:c,className:H(`w-full justify-between px-3 font-normal`,!o&&`text-muted-foreground`,l),children:[(0,n.jsx)(`span`,{className:`truncate text-start`,children:g}),(0,n.jsx)(r.ChevronsUpDown,{className:`h-4 w-4 shrink-0 opacity-50 ltr:ml-2 rtl:mr-2`})]})}),(0,n.jsxs)(zt,{className:`w-[--radix-popover-trigger-width] p-0`,align:`start`,dir:`rtl`,children:[(0,n.jsx)(Vn,{columnsNames:d,onSearch:f}),(0,n.jsx)(Xa,{shouldFilter:!1,children:(0,n.jsx)($a,{className:`max-h-50 overflow-y-auto overflow-x-hidden`,children:e.length===0?(0,n.jsx)(eo,{className:`py-6 text-center text-sm text-muted-foreground`,children:`لا توجد بيانات`}):(0,n.jsx)(to,{children:e.map(e=>{let i=String(e[a]),c=String(e[t]);return(0,n.jsxs)(ro,{value:i,onSelect:()=>{s(i),m(!1)},className:`cursor-pointer`,children:[(0,n.jsx)(r.Check,{className:H(`h-4 w-4 ltr:mr-2 rtl:ml-2`,o===i?`opacity-100`:`opacity-0`)}),c]},i)})})})})]})]})}function oo({className:e,size:t=`default`,...r}){return(0,n.jsx)(S.Root,{"data-slot":`avatar`,"data-size":t,className:H(`size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten`,e),...r})}function so({className:e,...t}){return console.log(t),(0,n.jsx)(S.Image,{"data-slot":`avatar-image`,className:H(`rounded-full aspect-square size-full object-cover`,e),...t})}function co({className:e,...t}){return(0,n.jsx)(S.Fallback,{"data-slot":`avatar-fallback`,className:H(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,e),...t})}function lo({className:e,...t}){return(0,n.jsx)(`span`,{"data-slot":`avatar-badge`,className:H(`bg-primary text-primary-foreground ring-background absolute end-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,e),...t})}function uo({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`avatar-group`,className:H(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,e),...t})}function fo({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`avatar-group-count`,className:H(`bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2`,e),...t})}function po({company:e}){return(0,n.jsx)(Pi,{children:(0,n.jsx)(Fi,{children:(0,n.jsxs)(Li,{size:`lg`,className:`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground`,children:[(0,n.jsxs)(oo,{className:`h-8 w-8 rounded-lg grayscale`,children:[(0,n.jsx)(so,{src:e.logo,alt:e.name}),(0,n.jsx)(co,{className:`rounded-lg`,children:`YSR`})]}),(0,n.jsx)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:(0,n.jsx)(`span`,{className:`truncate font-medium`,children:e.name})})]})})})}function mo({logos:e,alt:t=`Logo`}){let{state:r}=yi(),i=r===`collapsed`;return(0,n.jsxs)(`div`,{className:`
8
- animate-fadeSlide transition-all duration-300 pb-3
9
- ${i?`w-8`:`w-35 px-2`}
10
- `,children:[(0,n.jsx)(`img`,{src:i?e.collapsed.light:e.full.light,alt:t,className:`block dark:hidden transition-all duration-300 h-auto object-contain w-full`}),(0,n.jsx)(`img`,{src:i?e.collapsed.dark:e.full.dark,alt:t,className:`hidden dark:block transition-all duration-300 h-auto object-contain w-full`})]})}function ho({items:e}){return(0,n.jsx)(Ai,{className:`mt-5`,children:(0,n.jsx)(Ni,{children:(0,n.jsx)(Pi,{children:e.map(e=>e.hasAuth&&(0,n.jsx)(Fi,{children:(0,n.jsx)(Li,{asChild:!0,tooltip:e.title,children:(0,n.jsxs)(t.Link,{to:e.url,className:`flex items-center justify-start gap-3 w-full px-3`,children:[(0,n.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-4`,children:e.icon}),(0,n.jsx)(`span`,{className:`font-medium truncate`,children:e.title})]})})},e.title))})})})}var go=(0,i.createContext)({theme:`system`,setTheme:()=>null});function _o({children:e,defaultTheme:t=`system`,storageKey:r=`vite-ui-theme`,...a}){let[o,s]=(0,i.useState)(()=>localStorage.getItem(r)||t);(0,i.useEffect)(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),o===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(o)},[o]);let c={theme:o,setTheme:e=>{localStorage.setItem(r,e),s(e)}};return(0,n.jsx)(go.Provider,{...a,value:c,children:e})}var vo=()=>{let e=(0,i.useContext)(go);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function yo({variant:e=`icon`}){let{setTheme:t}=vo();return(0,n.jsxs)(Pr,{dir:`rtl`,children:[(0,n.jsx)(Ir,{asChild:!0,children:e===`sidebar`?(0,n.jsxs)(Li,{className:`w-full justify-start gap-3 px-3`,children:[(0,n.jsxs)(`div`,{className:`relative flex items-center justify-center shrink-0 size-4`,children:[(0,n.jsx)(r.Sun,{className:`h-4 w-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),(0,n.jsx)(r.Moon,{className:`absolute h-4 w-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`})]}),(0,n.jsx)(`span`,{className:`font-medium`,children:`تغيير المظهر`})]}):(0,n.jsxs)(U,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:[(0,n.jsx)(r.Sun,{className:`h-4 w-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),(0,n.jsx)(r.Moon,{className:`absolute h-4 w-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`}),(0,n.jsx)(`span`,{className:`sr-only`,children:`تغيير الثمة`})]})}),(0,n.jsxs)(Lr,{align:`end`,children:[(0,n.jsx)(zr,{onClick:()=>t(`light`),children:`فاتح`}),(0,n.jsx)(zr,{onClick:()=>t(`dark`),children:`داكن`}),(0,n.jsx)(zr,{onClick:()=>t(`system`),children:`النظام`})]})]})}function bo({items:e,onLogout:i,...a}){return(0,n.jsx)(Ai,{...a,children:(0,n.jsx)(Ni,{children:(0,n.jsxs)(Pi,{children:[e.map(e=>(0,n.jsx)(Fi,{children:(0,n.jsx)(Li,{asChild:!0,children:(0,n.jsxs)(t.Link,{to:e.url,className:`flex items-center justify-start gap-3 w-full px-3`,children:[(0,n.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-4`,children:e.icon}),(0,n.jsx)(`span`,{className:`font-medium truncate`,children:e.title})]})})},e.title)),(0,n.jsx)(Fi,{children:(0,n.jsx)(yo,{variant:`sidebar`})}),(0,n.jsx)(Fi,{children:(0,n.jsx)(Li,{asChild:!0,onClick:i,children:(0,n.jsxs)(`div`,{className:`flex items-center justify-start gap-3 w-full px-3 text-destructive cursor-pointer`,children:[(0,n.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-4`,children:(0,n.jsx)(r.LogOutIcon,{})}),(0,n.jsx)(`span`,{className:`font-medium truncate`,children:`تسجيل الخروج`})]})})},`logout`)]})})})}function xo({user:e}){return(0,n.jsx)(Pi,{children:(0,n.jsx)(Fi,{children:(0,n.jsxs)(Li,{size:`lg`,className:`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground`,children:[(0,n.jsxs)(oo,{className:`h-8 w-8 rounded-lg grayscale`,children:[(0,n.jsx)(so,{src:`/avatars/shadcn.jpg`,alt:e?.username}),(0,n.jsx)(co,{className:`rounded-lg`,children:`YSR`})]}),(0,n.jsx)(`div`,{className:`grid flex-1 text-start text-sm leading-tight`,children:(0,n.jsx)(`span`,{className:`truncate font-medium`,children:e?.username})})]})})})}function So({entityName:e}){return(0,n.jsxs)(`div`,{className:`sm:max-w-xl flex flex-col items-center justify-center py-20`,children:[(0,n.jsx)(r.Loader2,{className:`h-10 w-10 animate-spin text-primary`}),(0,n.jsxs)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:[`جاري تحميل بيانات `,e,`...`]})]})}function Co({...e}){return(0,n.jsx)(C.Root,{"data-slot":`alert-dialog`,...e})}function wo({...e}){return(0,n.jsx)(C.Trigger,{"data-slot":`alert-dialog-trigger`,...e})}function To({...e}){return(0,n.jsx)(C.Portal,{"data-slot":`alert-dialog-portal`,...e})}function Eo({className:e,...t}){return(0,n.jsx)(C.Overlay,{"data-slot":`alert-dialog-overlay`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...t})}function Do({className:e,size:t=`default`,...r}){return(0,n.jsxs)(To,{children:[(0,n.jsx)(Eo,{}),(0,n.jsx)(C.Content,{"data-slot":`alert-dialog-content`,"data-size":t,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 start-1/2 z-50 grid w-full -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 outline-none`,e),...r})]})}function Oo({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:H(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function ko({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:H(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ao({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-dialog-media`,className:H(`bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6`,e),...t})}function jo({className:e,...t}){return(0,n.jsx)(C.Title,{"data-slot":`alert-dialog-title`,className:H(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Mo({className:e,...t}){return(0,n.jsx)(C.Description,{"data-slot":`alert-dialog-description`,className:H(`text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3`,e),...t})}function No({className:e,variant:t=`default`,size:r=`default`,...i}){return(0,n.jsx)(U,{variant:t,size:r,asChild:!0,children:(0,n.jsx)(C.Action,{"data-slot":`alert-dialog-action`,className:H(e),...i})})}function Po({className:e,variant:t=`outline`,size:r=`default`,...i}){return(0,n.jsx)(U,{variant:t,size:r,asChild:!0,children:(0,n.jsx)(C.Cancel,{"data-slot":`alert-dialog-cancel`,className:H(e),...i})})}var Fo=ce(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Io({className:e,variant:t,...r}){return(0,n.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:H(Fo({variant:t}),e),...r})}function Lo({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-title`,className:H(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function Ro({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-description`,className:H(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function zo({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`alert-action`,className:H(`absolute top-2 end-2`,e),...t})}var Bo=ce(`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Vo({className:e,variant:t=`default`,asChild:r=!1,...i}){return(0,n.jsx)(r?o.Slot:`span`,{"data-slot":`badge`,"data-variant":t,className:H(Bo({variant:t}),e),...i})}function Ho({className:e,...t}){return(0,n.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:H(e),...t})}function Uo({className:e,...t}){return(0,n.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:H(`text-muted-foreground gap-1.5 text-sm flex flex-wrap items-center wrap-break-word`,e),...t})}function Wo({className:e,...t}){return(0,n.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:H(`gap-1 inline-flex items-center`,e),...t})}function Go({asChild:e,className:t,...r}){return(0,n.jsx)(e?o.Slot:`a`,{"data-slot":`breadcrumb-link`,className:H(`hover:text-foreground transition-colors`,t),...r})}function Ko({className:e,...t}){return(0,n.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:H(`text-foreground font-normal`,e),...t})}function qo({children:e,className:t,...i}){return(0,n.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:H(`[&>svg]:size-3.5`,t),...i,children:e??(0,n.jsx)(r.ChevronRightIcon,{className:`rtl:rotate-180`})})}function Jo({className:e,...t}){return(0,n.jsxs)(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:H(`size-5 [&>svg]:size-4 flex items-center justify-center`,e),...t,children:[(0,n.jsx)(r.MoreHorizontalIcon,{}),(0,n.jsx)(`span`,{className:`sr-only`,children:`More`})]})}var Yo={light:``,dark:`.dark`},Xo=i.createContext(null);function Zo(){let e=i.useContext(Xo);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function Qo({id:e,className:t,children:r,config:a,...o}){let s=i.useId(),c=`chart-${e||s.replace(/:/g,``)}`;return(0,n.jsx)(Xo.Provider,{value:{config:a},children:(0,n.jsxs)(`div`,{"data-slot":`chart`,"data-chart":c,className:H(`[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border[&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent[&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...o,children:[(0,n.jsx)($o,{id:c,config:a}),(0,n.jsx)(w.ResponsiveContainer,{children:r})]})})}var $o=({id:e,config:t})=>{let r=Object.entries(t).filter(([,e])=>e.theme||e.color);return r.length?(0,n.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(Yo).map(([t,n])=>`
11
- ${n} [data-chart=${e}] {
12
- ${r.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
13
- `)}
14
- }
15
- `).join(`
16
- `)}}):null},es=w.Tooltip;function ts({active:e,payload:t,className:r,indicator:a=`dot`,hideLabel:o=!1,hideIndicator:s=!1,label:c,labelFormatter:l,labelClassName:u,formatter:d,color:f,nameKey:p,labelKey:m}){let{config:h}=Zo(),g=i.useMemo(()=>{if(o||!t?.length)return null;let[e]=t,r=is(h,e,`${m||e?.dataKey||e?.name||`value`}`),i=!m&&typeof c==`string`?h[c]?.label||c:r?.label;return l?(0,n.jsx)(`div`,{className:H(`font-medium`,u),children:l(i,t)}):i?(0,n.jsx)(`div`,{className:H(`font-medium`,u),children:i}):null},[c,l,t,o,u,h,m]);if(!e||!t?.length)return null;let _=t.length===1&&a!==`dot`;return(0,n.jsxs)(`div`,{className:H(`border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-32 items-start`,r),children:[_?null:g,(0,n.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let r=is(h,e,`${p||e.name||e.dataKey||`value`}`),i=f||e.payload.fill||e.color;return(0,n.jsx)(`div`,{className:H(`[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5`,a===`dot`&&`items-center`),children:d&&e?.value!==void 0&&e.name?d(e.value,e.name,e,t,e.payload):(0,n.jsxs)(n.Fragment,{children:[r?.icon?(0,n.jsx)(r.icon,{}):!s&&(0,n.jsx)(`div`,{className:H(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":a===`dot`,"w-1":a===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":a===`dashed`,"my-0.5":_&&a===`dashed`}),style:{"--color-bg":i,"--color-border":i}}),(0,n.jsxs)(`div`,{className:H(`flex flex-1 justify-between leading-none`,_?`items-end`:`items-center`),children:[(0,n.jsxs)(`div`,{className:`grid gap-1.5`,children:[_?g:null,(0,n.jsx)(`span`,{className:`text-muted-foreground`,children:r?.label||e.name})]}),e.value&&(0,n.jsx)(`span`,{className:`text-foreground font-mono font-medium tabular-nums`,children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})}var ns=w.Legend;function rs({className:e,hideIcon:t=!1,payload:r,verticalAlign:i=`bottom`,nameKey:a}){let{config:o}=Zo();return r?.length?(0,n.jsx)(`div`,{className:H(`flex items-center justify-center gap-4`,i===`top`?`pb-3`:`pt-3`,e),children:r.filter(e=>e.type!==`none`).map(e=>{let r=is(o,e,`${a||e.dataKey||`value`}`);return(0,n.jsxs)(`div`,{className:H(`[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3`),children:[r?.icon&&!t?(0,n.jsx)(r.icon,{}):(0,n.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),r?.label]},e.value)})}):null}function is(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}function as({className:e,...t}){return(0,n.jsx)(T.Root,{"data-slot":`checkbox`,className:H(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,n.jsx)(T.Indicator,{"data-slot":`checkbox-indicator`,className:`[&>svg]:size-3.5 grid place-content-center text-current transition-none`,children:(0,n.jsx)(r.CheckIcon,{})})})}function os({controlled:e,default:t,name:n,state:r=`value`}){let{current:a}=i.useRef(e!==void 0),[o,s]=i.useState(t),c=a?e:o;if(process.env.NODE_ENV!==`production`){i.useEffect(()=>{a!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${a?``:`un`}controlled ${r} state of ${n} to be ${a?`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(`
17
- `))},[r,n,e]);let{current:o}=i.useRef(t);i.useEffect(()=>{!a&&JSON.stringify(o)!==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(`
18
- `))},[JSON.stringify(t)])}return[c,i.useCallback(e=>{a||s(e)},[])]}var q=typeof document<`u`?i.useLayoutEffect:()=>{};function ss(e){let t=i.useRef(!0);t.current&&(t.current=!1,e())}var cs={};function ls(e,t){let n=i.useRef(cs);return n.current===cs&&(n.current=e(t)),n}var us=i[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ds=us&&us!==i.useLayoutEffect?us:e=>e();function J(e){let t=ls(fs).current;return t.next=e,ds(t.effect),t.trampoline}function fs(){let e={next:void 0,callback:ps,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ps(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}function ms(e,t,n,r){let i=ls(gs).current;return _s(i,e,t,n,r)&&ys(i,[e,t,n,r]),i.callback}function hs(e){let t=ls(gs).current;return vs(t,e)&&ys(t,e),t.callback}function gs(){return{callback:null,cleanup:null,refs:[]}}function _s(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function vs(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ys(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var bs={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},xs={...bs,position:`fixed`,top:0,left:0},Ss={...bs,position:`absolute`};function Cs(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ws=Cs(`https://base-ui.com/production-error`,`Base UI`),Ts=(e,t,n)=>{if(t.length===1&&t[0]===n){let t=!1;try{let n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`The result function returned its own inputs without modification. e.g
19
- \`createSelector([state => state.todos], todos => todos)\`
20
- This could lead to inefficient memoization and unnecessary re-renders.
21
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},Es=(e,t,n)=>{let{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:a,inputSelectorResultsCopy:o}=e,s=r(()=>({}),...i);if(s.apply(null,a)!==s.apply(null,o)){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`An input selector returned a different result when passed same arguments.
22
- This means your output selector will likely run more frequently than intended.
23
- Avoid returning a new reference inside your input selector, e.g.
24
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},Ds={inputStabilityCheck:`once`,identityFunctionCheck:`once`},Os=Symbol(`NOT_FOUND`);function ks(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function As(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function js(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Ms=e=>Array.isArray(e)?e:[e];function Ns(e){let t=Array.isArray(e[0])?e[0]:e;return js(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Ps(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Fs=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...Ds,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:Ts},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:Es}}};function Is(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Os},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ls(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return Os}function i(t,i){r(t)===Os&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Rs=(e,t)=>e===t;function zs(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function Bs(e,t){let{equalityCheck:n=Rs,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=zs(n),o=0,s=r<=1?Is(a):Ls(r,a);function c(){let t=s.get(arguments);if(t===Os){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Vs=class{constructor(e){this.value=e}deref(){return this.value}},Hs=typeof WeakRef<`u`?WeakRef:Vs,Us=0,Ws=1;function Gs(){return{s:Us,v:void 0,o:null,p:null}}function Ks(e,t={}){let n=Gs(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=Gs(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=Gs(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Ws)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Hs(c):c}return s.s=Ws,s.v=c,c}return o.clearCache=()=>{n=Gs(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function qs(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),ks(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Ks,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Ms(c),p=Ms(u),m=Ns(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=Ps(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=Fs(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=Ps(m,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:s,memoizeOptions:f},arguments)}g&&=!1}return i},...p);return Object.assign(_,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Js=qs(Ks),Ys=Object.assign((e,t=Js)=>{As(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Ys});qs({memoize:Bs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var Y=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?ws(1):`Unsupported number of selectors`);let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Xs=ae((e=>{var t=require(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Zs=ae((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require(`react`),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Qs=ae(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Xs():t.exports=Zs()})),$s=ae((e=>{var t=require(`react`),n=Qs();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ec=ae((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require(`react`),r=Qs(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),tc=ae(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=$s():t.exports=ec()})),nc=parseInt(i.version,10);function rc(e){return nc>=e}var ic=[],ac=void 0;function oc(){return ac}function sc(e){ic.push(e)}var cc=Qs(),lc=tc(),uc=rc(19)?fc:pc;function X(e,t,n,r,i){return uc(e,t,n,r,i)}function dc(e,t,n,r,a){let o=i.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return(0,cc.useSyncExternalStore)(e.subscribe,o,o)}sc({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,cc.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function fc(e,t,n,r,i){let a=oc();if(!a)return dc(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function pc(e,t,n,r,i){return(0,lc.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var mc=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return X(this,e,t,n,r)}};function hc(){}var gc=Object.freeze([]),_c=Object.freeze({}),vc=class extends mc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){i.useDebugValue(e),q(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;if(process.env.NODE_ENV!==`production`){i.useDebugValue(e,e=>Object.keys(e));let t=i.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){i.useDebugValue(e);let n=t!==void 0;if(q(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n]),process.env.NODE_ENV!==`production`){let t=this.controlledValues??=new Map;t.has(e)||t.set(e,n);let r=t.get(e);r!==void 0&&r!==n&&console.error(`A component is changing the ${n?``:`un`}controlled state of ${e.toString()} to be ${n?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return i.useDebugValue(e),X(this,this.selectors[e],t,n,r)}useContextCallback(e,t){i.useDebugValue(e);let n=J(t??hc);this.context[e]=n}useStateSetter(e){let t=i.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},yc=[];function bc(e){i.useEffect(e,yc)}var xc=null,Sc=globalThis.requestAnimationFrame,Cc=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&Sc!==requestAnimationFrame&&(Sc=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},wc=class e{static create(){return new e}static request(e){return Cc.request(e)}static cancel(e){return Cc.cancel(e)}currentId=xc;request(e){this.cancel(),this.currentId=Cc.request(()=>{this.currentId=xc,e()})}cancel=()=>{this.currentId!==xc&&(Cc.cancel(this.currentId),this.currentId=xc)};disposeEffect=()=>this.cancel};function Tc(){let e=ls(wc.create).current;return bc(e.disposeEffect),e}var Ec=0,Dc=class e{static create(){return new e}currentId=Ec;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ec,t()},e)}isStarted(){return this.currentId!==Ec}clear=()=>{this.currentId!==Ec&&(clearTimeout(this.currentId),this.currentId=Ec)};disposeEffect=()=>this.clear};function Oc(){let e=ls(Dc.create).current;return bc(e.disposeEffect),e}function kc(e){let t=ls(Ac,e).current;return t.next=e,q(t.effect),t}function Ac(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jc(){return typeof window<`u`}function Mc(e){return Fc(e)?(e.nodeName||``).toLowerCase():`#document`}function Nc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pc(e){return((Fc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Fc(e){return jc()?e instanceof Node||e instanceof Nc(e).Node:!1}function Ic(e){return jc()?e instanceof Element||e instanceof Nc(e).Element:!1}function Lc(e){return jc()?e instanceof HTMLElement||e instanceof Nc(e).HTMLElement:!1}function Rc(e){return!jc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Nc(e).ShadowRoot}function zc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Xc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Bc(e){return/^(table|td|th)$/.test(Mc(e))}function Vc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Hc=/transform|translate|scale|rotate|perspective|filter/,Uc=/paint|layout|strict|content/,Wc=e=>!!e&&e!==`none`,Gc;function Kc(e){let t=Ic(e)?Xc(e):e;return Wc(t.transform)||Wc(t.translate)||Wc(t.scale)||Wc(t.rotate)||Wc(t.perspective)||!Jc()&&(Wc(t.backdropFilter)||Wc(t.filter))||Hc.test(t.willChange||``)||Uc.test(t.contain||``)}function qc(e){let t=Qc(e);for(;Lc(t)&&!Yc(t);){if(Kc(t))return t;if(Vc(t))return null;t=Qc(t)}return null}function Jc(){return Gc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Gc}function Yc(e){return/^(html|body|#document)$/.test(Mc(e))}function Xc(e){return Nc(e).getComputedStyle(e)}function Zc(e){return Ic(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qc(e){if(Mc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Rc(e)&&e.host||Pc(e);return Rc(t)?t.host:t}function $c(e){let t=Qc(e);return Yc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lc(t)&&zc(t)?t:$c(t)}function el(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=$c(e),i=r===e.ownerDocument?.body,a=Nc(r);if(i){let e=tl(a);return t.concat(a,a.visualViewport||[],zc(r)?r:[],e&&n?el(e):[])}else return t.concat(r,el(r,[],n))}function tl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var nl=typeof navigator<`u`,rl=fl(),il=ml(),al=pl(),ol=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),sl=rl.platform===`MacIntel`&&rl.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(rl.platform),cl=nl&&/firefox/i.test(al),ll=nl&&/apple/i.test(navigator.vendor);nl&&/Edg/i.test(al);var ul=nl&&/android/i.test(il)||/android/i.test(al);nl&&il.toLowerCase().startsWith(`mac`)&&navigator.maxTouchPoints;var dl=al.includes(`jsdom/`);function fl(){if(!nl)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function pl(){if(!nl)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function ml(){if(!nl)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var hl=`data-base-ui-focusable`,gl=`ArrowLeft`,_l=`ArrowRight`,vl=`ArrowUp`,yl=`ArrowDown`;function bl(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Rc(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function xl(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Sl(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Cl(e){return e.matches(`html,body`)}function wl(e){return Lc(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Tl(e){return e?e.getAttribute(`role`)===`combobox`&&wl(e):!1}function El(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Dl(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Dl(e,t.id,n)])}function Ol(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function kl(e){e.preventDefault(),e.stopPropagation()}function Al(e){return`nativeEvent`in e}function jl(e){return e.pointerType===``&&e.isTrusted?!0:ul&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ml(e){return dl?!1:!ul&&e.width===0&&e.height===0||ul&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Nl(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Pl(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Fl=[`top`,`right`,`bottom`,`left`],Il=Math.min,Ll=Math.max,Rl=Math.round,zl=Math.floor,Bl=e=>({x:e,y:e}),Vl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Hl(e,t,n){return Ll(e,Il(t,n))}function Ul(e,t){return typeof e==`function`?e(t):e}function Wl(e){return e.split(`-`)[0]}function Gl(e){return e.split(`-`)[1]}function Kl(e){return e===`x`?`y`:`x`}function ql(e){return e===`y`?`height`:`width`}function Jl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Yl(e){return Kl(Jl(e))}function Xl(e,t,n){n===void 0&&(n=!1);let r=Gl(e),i=Yl(e),a=ql(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=au(o)),[o,au(o)]}function Zl(e){let t=au(e);return[Ql(e),t,Ql(t)]}function Ql(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var $l=[`left`,`right`],eu=[`right`,`left`],tu=[`top`,`bottom`],nu=[`bottom`,`top`];function ru(e,t,n){switch(e){case`top`:case`bottom`:return n?t?eu:$l:t?$l:eu;case`left`:case`right`:return t?tu:nu;default:return[]}}function iu(e,t,n,r){let i=Gl(e),a=ru(Wl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ql)))),a}function au(e){let t=Wl(e);return Vl[t]+e.slice(t.length)}function ou(e){return{top:0,right:0,bottom:0,left:0,...e}}function su(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ou(e)}function cu(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function lu(e,t,n){return Math.floor(e/t)!==n}function uu(e,t){return t<0||t>=e.current.length}function du(e,t){return pu(e,{disabledIndices:t})}function fu(e,t){return pu(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function pu(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&vu(e,a,r));return a}function mu(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f;if(t.key===`ArrowUp`?f=`up`:t.key===`ArrowDown`&&(f=`down`),f){let n=[],i=[],p=!1,m=0;{let t=null,r=-1;e.current.forEach((e,a)=>{if(e==null)return;m+=1;let o=e.closest(`[role="row"]`);o&&(p=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(a),i[a]=r})}let h=!1,g=0;if(p)for(let e of n){let t=e.length;t>g&&(g=t),t!==a&&(h=!0)}let _=h&&m<e.current.length,v=g||a,y=t=>{if(!h||l===-1)return;let a=i[l];if(a==null)return;let s=n[a].indexOf(l),c=t===`up`?-1:1;for(let t=a+c,i=0;i<n.length;i+=1,t+=c){if(t<0||t>=n.length){if(!r||_)return;t=t<0?n.length-1:0}let i=n[t];for(let t=Math.min(s,i.length-1);t>=0;--t){let n=i[t];if(!vu(e,n,o))return n}}},b=t=>{if(!_||l===-1)return;let n=l%v,i=t===`up`?-v:v,a=c-c%v,s=zl(c/v)+1;for(let t=l-n+i,u=0;u<s;u+=1,t+=i){if(t<0||t>c){if(!r)return;t=t<0?a:0}let i=Math.min(t+v-1,c);for(let r=Math.min(t+n,i);r>=t;--r)if(!vu(e,r,o))return r}};u&&kl(t);let x=y(f)??b(f);if(x!==void 0)d=x;else if(l===-1)d=f===`up`?c:s;else if(d=pu(e,{startingIndex:l,amount:v,decrement:f===`up`,disabledIndices:o}),r){if(f===`up`&&(l-v<s||d<0)){let e=l%v,t=c%v,n=c-(t-e);d=t===e?c:t>e?n:n-v}f===`down`&&l+v>c&&(d=pu(e,{startingIndex:l%v-v,amount:v,disabledIndices:o}))}uu(e,d)&&(d=l)}if(n===`both`){let n=zl(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&kl(t),l%a===a-1?r&&(d=pu(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=pu(e,{startingIndex:l,disabledIndices:o}),r&&lu(d,a,n)&&(d=pu(e,{startingIndex:l-l%a-1,disabledIndices:o}))),lu(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&kl(t),l%a===0?r&&(d=pu(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=pu(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&lu(d,a,n)&&(d=pu(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),lu(d,a,n)&&(d=l));let s=zl(c/a)===n;uu(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:pu(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function hu(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{if(e>t&&process.env.NODE_ENV!==`production`)throw Error(`[Floating UI]: Invalid grid - item width at index ${o} is greater than grid columns`);let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function gu(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function _u(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function vu(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e.current[t];return r?yu(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function yu(e){return Xc(e).display!==`none`}var bu=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),xu=typeof Element>`u`,Su=xu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cu=!xu&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},wu=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):wu(e.parentNode))},Tu=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Eu=function(e,t,n){if(wu(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(bu));return t&&Su.call(e,bu)&&r.unshift(e),r=r.filter(n),r},Du=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!wu(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Du(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Su.call(a,bu)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!wu(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Du(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Ou=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ku=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Tu(e))&&!Ou(e)?0:e.tabIndex},Au=function(e,t){var n=ku(e);return n<0&&t&&!Ou(e)?0:n},ju=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Mu=function(e){return e.tagName===`INPUT`},Nu=function(e){return Mu(e)&&e.type===`hidden`},Pu=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Fu=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Iu=function(e){if(!e.name)return!0;var t=e.form||Cu(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Fu(r,e.form);return!i||i===e},Lu=function(e){return Mu(e)&&e.type===`radio`},Ru=function(e){return Lu(e)&&!Iu(e)},zu=function(e){var t=e&&Cu(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Cu(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Bu=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Vu=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Su.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Su.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Cu(e);if(o&&!o.shadowRoot&&r(o)===!0)return Bu(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(zu(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Bu(e);return!1},Hu=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Su.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Uu=function(e,t){return!(t.disabled||Nu(t)||Vu(t,e)||Pu(t)||Hu(t))},Wu=function(e,t){return!(Ru(t)||ku(t)<0||!Uu(e,t))},Gu=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Ku=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Au(a,i),s=i?Ku(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ju).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},qu=function(e,t){return t||={},Ku(t.getShadowRoot?Du([e],t.includeContainer,{filter:Wu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Gu}):Eu(e,t.includeContainer,Wu.bind(null,t)))},Ju=function(e,t){return t||={},t.getShadowRoot?Du([e],t.includeContainer,{filter:Uu.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Eu(e,t.includeContainer,Uu.bind(null,t))},Yu=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Su.call(e,bu)===!1?!1:Wu(t,e)};function Xu(e){return e?.ownerDocument||document}var Zu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Qu(e,t){let n=qu(e,Zu()),r=n.length;if(r===0)return;let i=bl(Xu(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function $u(e){return Qu(Xu(e).body,1)||e}function ed(e){return Qu(Xu(e).body,-1)||e}function td(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function nd(e){qu(e,Zu()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function rd(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var id={style:{transition:`none`}},ad={fallbackAxisSide:`none`},od={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},sd=`none`,cd=`trigger-press`,ld=`outside-press`,ud=`item-press`,dd=`close-press`,fd=`clear-press`,pd=`chip-remove-press`,md=`input-change`,hd=`input-clear`,gd=`input-press`,_d=`focus-out`,vd=`escape-key`,yd=`list-navigation`;function Q(e,t,n,r){let i=!1,a=!1,o=r??_c;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function bd(e,t,n){let r=n??_c;return{reason:e,event:t??new Event(`base-ui`),...r}}var xd=i.forwardRef(function(e,t){let[r,a]=i.useState();q(()=>{ll&&a(`button`)},[]);let o={tabIndex:0,role:r};return(0,n.jsx)(`span`,{...e,ref:t,style:xs,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(xd.displayName=`FocusGuard`);function Sd(e){return`data-base-ui-${e}`}var Cd=0;function wd(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Cd);let a=()=>e?.focus({preventScroll:n});i?a():Cd=requestAnimationFrame(a)}var Td={inert:new WeakMap,"aria-hidden":new WeakMap},Ed=`data-base-ui-inert`,Dd={inert:new WeakSet,"aria-hidden":new WeakSet},Od=new WeakMap,kd=0;function Ad(e){return Dd[e]}function jd(e){return e?Rc(e)?e.host:jd(e.parentNode):null}var Md=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=jd(t);return e.contains(n)?n:null}).filter(e=>e!=null),Nd=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Pd=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Mc(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Fd(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Md(t,e),u=i?Md(t,a):[],d=new Set(u),f=i?Pd(t,Nd(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=Td[o],n=Ad(o);c=n,s=e;let r=Md(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Pd(t,Nd(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Od.get(e)||0)+1;Od.set(e,t),m.push(e),t===1&&e.setAttribute(Ed,``)}),kd+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Od.get(e)||0)-1;Od.set(e,t),t||e.removeAttribute(Ed)}),--kd,kd||(Td.inert=new WeakMap,Td[`aria-hidden`]=new WeakMap,Dd.inert=new WeakSet,Dd[`aria-hidden`]=new WeakSet,Od=new WeakMap)}}function Id(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=Xu(e[0]).body;return Fd(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Ld={...i},Rd=0;function zd(e,t=`mui`){let[n,r]=i.useState(e),a=e||n;return i.useEffect(()=>{n??(Rd+=1,r(`${t}-${Rd}`))},[n,t]),a}var Bd=Ld.useId;function Vd(e,t){if(Bd!==void 0){let n=Bd();return e??(t?`${t}-${n}`:n)}return zd(e,t)}function Hd(e){if(!i.isValidElement(e))return null;let t=e,n=t.props;return(rc(19)?n?.ref:t.ref)??null}function Ud(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Wd;process.env.NODE_ENV!==`production`&&(Wd=new Set);function Gd(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);Wd.has(t)||(Wd.add(t),console.warn(`Base UI: ${t}`))}}function Kd(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function qd(e,t){return typeof e==`function`?e(t):e}function Jd(e,t){return typeof e==`function`?e(t):e}var Yd={};function Xd(e,t,n,r,i){let a={...nf(e,Yd)};return t&&(a=Qd(a,t)),n&&(a=Qd(a,n)),r&&(a=Qd(a,r)),i&&(a=Qd(a,i)),a}function Zd(e){if(e.length===0)return Yd;if(e.length===1)return nf(e[0],Yd);let t={...nf(e[0],Yd)};for(let n=1;n<e.length;n+=1)t=Qd(t,e[n]);return t}function Qd(e,t){return tf(t)?t(e):$d(e,t)}function $d(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ud(e.style,r);break;case`className`:e[n]=of(e.className,r);break;default:ef(n,r)?e[n]=rf(e[n],r):e[n]=r}}return e}function ef(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function tf(e){return typeof e==`function`}function nf(e,t){return tf(e)?e(t):e??Yd}function rf(e,t){return t?e?n=>{if(sf(n)){let r=n;af(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function af(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function of(e,t){return t?e?t+` `+e:t:e}function sf(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function cf(e,t,n={}){let r=t.render,i=lf(t,n);return n.enabled===!1?null:df(e,r,i,n.state??_c)}function lf(e,t={}){let{className:n,style:r,render:i}=e,{state:a=_c,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?qd(n,a):void 0,d=l?Jd(r,a):void 0,f=l?Kd(a,c):_c,p=l?Ud(f,Array.isArray(s)?Zd(s):s)??_c:_c;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=hs([p.ref,Hd(i),...o]):p.ref=ms(p.ref,Hd(i),o):ms(null,null)),l?(u!==void 0&&(p.className=of(p.className,u)),d!==void 0&&(p.style=Ud(p.style,d)),p):_c}var uf=Symbol.for(`react.lazy`);function df(e,t,n,r){if(t){if(typeof t==`function`)return process.env.NODE_ENV!==`production`&&ff(t),t(n,r);let e=Xd(n,t.props);e.ref=n.ref;let a=t;if(a?.$$typeof===uf&&(a=i.Children.toArray(t)[0]),process.env.NODE_ENV!==`production`&&!i.isValidElement(a))throw 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(`
25
- `));return i.cloneElement(a,e)}if(e&&typeof e==`string`)return pf(e,n);throw Error(process.env.NODE_ENV===`production`?ws(8):`Base UI: Render element or function are not defined.`)}function ff(e){let t=e.name;if(t.length===0)return;let n=t.charCodeAt(0);n<65||n>90||Gd(`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 pf(e,t){return e===`button`?(0,i.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,i.createElement)(`img`,{alt:``,...t,key:t.key}):i.createElement(e,t)}var mf=i.createContext(null);process.env.NODE_ENV!==`production`&&(mf.displayName=`PortalContext`);var hf=()=>i.useContext(mf),gf=Sd(`portal`);function _f(e={}){let{ref:t,container:n,componentProps:r=_c,elementProps:a}=e,o=Vd(),s=hf()?.portalNode,[c,l]=i.useState(null),[u,d]=i.useState(null),f=J(e=>{e!==null&&d(e)}),p=i.useRef(null);q(()=>{if(n===null){p.current&&(p.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(Fc(n)?n:n.current))??s??document.body;if(e==null){p.current&&(p.current=null,d(null),l(null));return}p.current!==e&&(p.current=e,d(null),l(e))},[n,s,o]);let m=cf(`div`,r,{ref:[t,f],props:[{id:o,[gf]:``},a]});return{portalNode:u,portalSubtree:c&&m?E.createPortal(m,c):null}}var vf=i.forwardRef(function(e,t){let{children:r,container:a,className:o,render:s,renderGuards:c,...l}=e,{portalNode:u,portalSubtree:d}=_f({container:a,ref:t,componentProps:e,elementProps:l}),f=i.useRef(null),p=i.useRef(null),m=i.useRef(null),h=i.useRef(null),[g,_]=i.useState(null),v=g?.modal,y=g?.open,b=typeof c==`boolean`?c:!!g&&!g.modal&&g.open&&!!u;i.useEffect(()=>{if(!u||v)return;function e(e){u&&e.relatedTarget&&td(e)&&(e.type===`focusin`?rd:nd)(u)}return u.addEventListener(`focusin`,e,!0),u.addEventListener(`focusout`,e,!0),()=>{u.removeEventListener(`focusin`,e,!0),u.removeEventListener(`focusout`,e,!0)}},[u,v]),i.useEffect(()=>{!u||y||rd(u)},[y,u]);let x=i.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:u,setFocusManagerState:_}),[u]);return(0,n.jsxs)(i.Fragment,{children:[d,(0,n.jsxs)(mf.Provider,{value:x,children:[b&&u&&(0,n.jsx)(xd,{"data-type":`outside`,ref:f,onFocus:e=>{td(e,u)?m.current?.focus():ed(g?g.domReference:null)?.focus()}}),b&&u&&(0,n.jsx)(`span`,{"aria-owns":u.id,style:od}),u&&E.createPortal(r,u),b&&u&&(0,n.jsx)(xd,{"data-type":`outside`,ref:p,onFocus:e=>{td(e,u)?h.current?.focus():($u(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Q(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(vf.displayName=`FloatingPortal`);function yf(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var bf=i.createContext(null);process.env.NODE_ENV!==`production`&&(bf.displayName=`FloatingNodeContext`);var xf=i.createContext(null);process.env.NODE_ENV!==`production`&&(xf.displayName=`FloatingTreeContext`);var Sf=()=>i.useContext(bf)?.id||null,Cf=e=>{let t=i.useContext(xf);return e??t};function wf(e){return e==null?e:`current`in e?e.current:e}function Tf(e,t){let n=Nc(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ef=20,Df=[];function Of(){Df=Df.filter(e=>e.deref()?.isConnected)}function kf(e){Of(),e&&Mc(e)!==`body`&&(Df.push(new WeakRef(e)),Df.length>Ef&&(Df=Df.slice(-Ef)))}function Af(){return Of(),Df[Df.length-1]?.deref()}function jf(e){if(!e)return null;let t=Zu();return Yu(e,t)?e:qu(e,t)[0]||e}function Mf(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():yu(e)}function Nf(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Zu(),r=Ju(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Yu(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Pf(e){let{context:t,children:r,disabled:a=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=`rootStore`in t?t.rootStore:t,v=_.useState(`open`),y=_.useState(`domReferenceElement`),b=_.useState(`floatingElement`),{events:x,dataRef:S}=_.context,C=J(()=>S.current.floatingContext?.nodeId),w=o===!1,T=Tl(y)&&w,E=i.useRef([`content`]),D=kc(o),O=kc(s),k=kc(d),A=Cf(h),j=hf(),M=i.useRef(!1),N=i.useRef(!1),P=i.useRef(!1),F=i.useRef(-1),I=i.useRef(``),ee=i.useRef(``),te=i.useRef(null),ne=i.useRef(null),L=ms(te,m,j?.beforeInsideRef),re=ms(ne,j?.afterInsideRef),ie=Oc(),ae=Oc(),oe=Tc(),R=j!=null,z=El(b),se=J((e=z)=>e?qu(e,Zu()):[]),B=J(()=>g?.().filter(e=>e!=null)??[]),V=J(e=>{let t=se(e);return E.current.map(()=>t).filter(Boolean).flat()});i.useEffect(()=>{if(a||!l)return;function e(e){e.key===`Tab`&&Z(z,bl(Xu(z)))&&se().length===0&&!T&&kl(e)}let t=Xu(z);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[a,y,z,l,E,T,se,V]),i.useEffect(()=>{if(a||!v)return;let e=Xu(z);function t(){P.current=!1}function n(e){let t=xl(e),n=B();P.current=!(Z(b,t)||Z(y,t)||Z(j?.portalNode,t)||n.some(e=>e===t||Z(e,t))),ee.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(N.current=!0)}function r(){ee.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,r,!0)}},[a,b,y,z,v,j,B]),i.useEffect(()=>{if(a||!u)return;let e=Xu(z);function t(){N.current=!0,ae.start(0,()=>{N.current=!1})}function n(e){let t=xl(e),n=se().indexOf(t);n!==-1&&(F.current=n)}function r(t){let n=t.relatedTarget,r=t.currentTarget,i=xl(t);queueMicrotask(()=>{let a=C(),o=_.context.triggerElements,s=B(),u=n?.hasAttribute(Sd(`focus-guard`))&&[te.current,ne.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,wf(p),wf(f)].includes(n),d=!(Z(y,n)||Z(b,n)||Z(n,b)||Z(j?.portalNode,n)||s.some(e=>e===n||Z(e,n))||n!=null&&o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))||u||A&&(Dl(A.nodesRef.current,a).find(e=>Z(e.context?.elements.floating,n)||Z(e.context?.elements.domReference,n))||Ol(A.nodesRef.current,a).find(e=>[e.context?.elements.floating,El(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&z&&Nf(z,E),c&&r!==y&&!Mf(i)&&bl(e)===e.body){if(Lc(z)&&(z.focus(),c===`popup`)){oe.request(()=>{z.focus()});return}let e=F.current,t=se(),n=t[e]||t[t.length-1]||z;Lc(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!l)&&n&&d&&!N.current&&(T||n!==Af())&&(M.current=!0,_.setOpen(!1,Q(_d,t)))})}function i(){P.current||(S.current.insideReactTree=!0,ie.start(0,()=>{S.current.insideReactTree=!1}))}let o=Lc(y)?y:null,s=[];if(!(!b&&!o))return o&&(o.addEventListener(`focusout`,r),o.addEventListener(`pointerdown`,t),s.push(()=>{o.removeEventListener(`focusout`,r),o.removeEventListener(`pointerdown`,t)})),b&&(b.addEventListener(`focusin`,n),b.addEventListener(`focusout`,r),j&&(b.addEventListener(`focusout`,i,!0),s.push(()=>{b.removeEventListener(`focusout`,i,!0)})),s.push(()=>{b.removeEventListener(`focusin`,n),b.removeEventListener(`focusout`,r)})),()=>{s.forEach(e=>{e()})}},[a,y,b,z,l,A,j,_,u,c,se,T,C,E,S,ie,ae,oe,f,p,B]),i.useEffect(()=>{if(a||!b||!v)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${Sd(`portal`)}]`)||[]),t=(A?Ol(A.nodesRef.current,C()):[]).find(e=>Tl(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Id([...[b,...e,te.current,ne.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...B()],t,wf(p),wf(f),T?y:null].filter(e=>e!=null),{ariaHidden:l||T,mark:!1}),r=Id([b,...e].filter(e=>e!=null));return()=>{r(),n()}},[v,a,y,b,l,E,j,T,A,C,f,p,B]),q(()=>{if(!v||a||!Lc(z))return;let e=bl(Xu(z));queueMicrotask(()=>{let t=V(z),n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||z:wf(r),i=i||t[0]||z,!Z(z,e)&&wd(i,{preventScroll:i===z})})},[a,v,z,w,V,D,k]),q(()=>{if(a||!z)return;let e=Xu(z);kf(bl(e));function t(e){if(e.open||(I.current=Tf(e.nativeEvent,ee.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(M.current=!0),e.reason===`outside-press`)if(e.nested)M.current=!1;else if(jl(e.nativeEvent)||Ml(e.nativeEvent))M.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}x.on(`openchange`,t);function n(){let e=O.current,t=typeof e==`function`?e(I.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=y||Af();return e&&e.isConnected?e:null}let n=y||Af();return wf(t)||n||null}return()=>{x.off(`openchange`,t);let r=bl(e),i=B(),a=Z(b,r)||i.some(e=>e===r||Z(e,r))||A&&Dl(A.nodesRef.current,C(),!1).some(e=>Z(e.context?.elements.floating,r)),o=n();queueMicrotask(()=>{let t=jf(o),n=typeof O.current!=`boolean`;O.current&&!M.current&&Lc(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),M.current=!1})}},[a,b,z,O,S,x,A,y,C,B]),q(()=>{if(!ol||v||!b)return;let e=bl(Xu(b));!Lc(e)||!wl(e)||Z(b,e)&&e.blur()},[v,b]),q(()=>{if(!(a||!j))return j.setFocusManagerState({modal:l,closeOnFocusOut:u,open:v,onOpenChange:_.setOpen,domReference:y}),()=>{j.setFocusManagerState(null)}},[a,j,l,v,_,u,y]),q(()=>{if(!(a||!z))return Nf(z,E),()=>{queueMicrotask(Of)}},[a,z,E]);let ce=!a&&(l?!T:!0)&&(R||l);return(0,n.jsxs)(i.Fragment,{children:[ce&&(0,n.jsx)(xd,{"data-type":`inside`,ref:L,onFocus:e=>{if(l){let e=V();wd(e[e.length-1])}else j?.portalNode&&(M.current=!1,td(e,j.portalNode)?$u(y)?.focus():wf(p??j.beforeOutsideRef)?.focus())}}),r,ce&&(0,n.jsx)(xd,{"data-type":`inside`,ref:re,onFocus:e=>{l?wd(V()[0]):j?.portalNode&&(u&&(M.current=!0),td(e,j.portalNode)?ed(y)?.focus():wf(f??j.afterOutsideRef)?.focus())}})]})}function Ff(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:a=!0,event:o=`click`,toggle:s=!0,ignoreMouse:c=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:d=cd}=t,f=i.useRef(void 0),p=Tc(),m=Oc(),h=i.useMemo(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current,i=e.nativeEvent,a=n.select(`open`);if(e.button!==0||o===`click`||Nl(t,!0)&&c)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=a&&_||!(a&&s&&(!(h&&l)||g===`click`||g===`mousedown`));if(wl(i.target)){let e=Q(d,i,i.target);v&&t===`touch`&&u>0?m.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let y=e.currentTarget;p.request(()=>{let e=Q(d,i,y);v&&t===`touch`&&u>0?m.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(o===`mousedown-only`)return;let t=f.current;if(o===`mousedown`&&t){f.current=void 0;return}if(Nl(t,!0)&&c)return;let i=n.select(`open`),a=r.current.openEvent,p=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&p||!(i&&s&&(!(a&&l)||Pl(a))),g=Q(d,e.nativeEvent,e.currentTarget);h&&t===`touch`&&u>0?m.start(u,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){f.current=void 0}}),[r,o,c,n,l,s,p,m,u,d]);return i.useMemo(()=>a?{reference:h}:_c,[a,h])}var If={intentional:`onClick`,sloppy:`onPointerDown`};function Lf(){return!1}function Rf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function zf(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),a=n.useState(`floatingElement`),{dataRef:o}=n.context,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u=`sloppy`,referencePress:d=Lf,referencePressEvent:f=`sloppy`,bubbles:p,externalTree:m}=t,h=Cf(m),g=J(typeof l==`function`?l:()=>!1),_=typeof l==`function`?g:l,v=_!==!1,y=J(()=>u),b=i.useRef(!1),x=i.useRef(!1),S=i.useRef(!1),{escapeKey:C,outsidePress:w}=Rf(p),T=i.useRef(null),E=Oc(),D=Oc(),O=J(()=>{D.clear(),o.current.insideReactTree=!1}),k=i.useRef(!1),A=i.useRef(``),j=J(d),M=J(e=>{if(!r||!s||!c||e.key!==`Escape`||k.current)return;let t=o.current.floatingContext?.nodeId,i=h?Dl(h.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Q(vd,Al(e)?e.nativeEvent:e);n.setOpen(!1,a),!C&&!a.isPropagationAllowed&&e.stopPropagation()}),N=J(()=>{o.current.insideReactTree=!0,D.start(0,O)});i.useEffect(()=>{if(!r||!s)return;o.current.__escapeKeyBubbles=C,o.current.__outsidePressBubbles=w;let e=new Dc,t=new Dc;function i(){e.clear(),k.current=!0}function l(){e.start(Jc()?5:0,()=>{k.current=!1})}function u(){S.current=!0,t.start(0,()=>{S.current=!1})}function d(){b.current=!1,x.current=!1}function f(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function m(e){let t=o.current.floatingContext?.nodeId,r=h&&Dl(h.nodesRef.current,t).some(t=>Sl(e,t.context?.elements.floating));return Sl(e,n.select(`floatingElement`))||Sl(e,n.select(`domReferenceElement`))||r}function g(e){if(p(e)){O();return}if(o.current.insideReactTree){O();return}let r=xl(e),i=`[${Sd(`inert`)}]`,a=Array.from(Xu(n.select(`floatingElement`)).querySelectorAll(i)),s=Ic(r)?r.getRootNode():null;Rc(s)&&(a=a.concat(Array.from(s.querySelectorAll(i))));let c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>Z(e,r))))return;let l=Ic(r)?r:null;for(;l&&!Yc(l);){let e=Qc(l);if(Yc(e)||!Ic(e))break;l=e}if(a.length&&Ic(r)&&!Cl(r)&&!Z(r,n.select(`floatingElement`))&&a.every(e=>!Z(l,e)))return;if(Lc(r)&&!(`touches`in e)){let t=Yc(r),n=Xc(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(m(e))return;if(f()===`intentional`&&S.current){t.clear(),S.current=!1;return}if(typeof _==`function`&&!_(e))return;let u=o.current.floatingContext?.nodeId,d=h?Dl(h.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Q(ld,e)),O()}function D(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!s||Sl(e,n.select(`floatingElement`))||Sl(e,n.select(`domReferenceElement`))||g(e)}function j(e){if(f()!==`sloppy`||!n.select(`open`)||!s||Sl(e,n.select(`floatingElement`))||Sl(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function N(e){A.current=`touch`;let t=xl(e);function n(){j(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function P(e){if(E.clear(),e.type===`pointerdown`&&(A.current=e.pointerType),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let t=xl(e);function n(){e.type===`pointerdown`?D(e):g(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function F(e){if(!b.current)return;let n=x.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!m(e)){if(n){u();return}typeof _==`function`&&!_(e)||(t.clear(),S.current=!0,O())}}}function I(e){if(f()!==`sloppy`||!T.current||Sl(e,n.select(`floatingElement`))||Sl(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(g(e),E.clear(),T.current=null)}function ee(e){let t=xl(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function te(e){f()!==`sloppy`||!T.current||Sl(e,n.select(`floatingElement`))||Sl(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&g(e),E.clear(),T.current=null)}function ne(e){let t=xl(e);function n(){te(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}let L=Xu(a);return c&&(L.addEventListener(`keydown`,M),L.addEventListener(`compositionstart`,i),L.addEventListener(`compositionend`,l)),v&&(L.addEventListener(`click`,P,!0),L.addEventListener(`pointerdown`,P,!0),L.addEventListener(`pointerup`,F,!0),L.addEventListener(`pointercancel`,F,!0),L.addEventListener(`mousedown`,P,!0),L.addEventListener(`mouseup`,F,!0),L.addEventListener(`touchstart`,N,!0),L.addEventListener(`touchmove`,ee,!0),L.addEventListener(`touchend`,ne,!0)),()=>{c&&(L.removeEventListener(`keydown`,M),L.removeEventListener(`compositionstart`,i),L.removeEventListener(`compositionend`,l)),v&&(L.removeEventListener(`click`,P,!0),L.removeEventListener(`pointerdown`,P,!0),L.removeEventListener(`pointerup`,F,!0),L.removeEventListener(`pointercancel`,F,!0),L.removeEventListener(`mousedown`,P,!0),L.removeEventListener(`mouseup`,F,!0),L.removeEventListener(`touchstart`,N,!0),L.removeEventListener(`touchmove`,ee,!0),L.removeEventListener(`touchend`,ne,!0)),e.clear(),t.clear(),d(),S.current=!1}},[o,a,c,v,_,r,s,C,w,M,O,y,h,n,E]),i.useEffect(O,[_,O]);let P=i.useMemo(()=>({onKeyDown:M,[If[f]]:e=>{j()&&n.setOpen(!1,Q(cd,e.nativeEvent))},...f!==`intentional`&&{onClick(e){j()&&n.setOpen(!1,Q(`trigger-press`,e.nativeEvent))}}}),[M,n,f,j]),F=J(e=>{if(!r||!s||e.button!==0)return;let t=xl(e.nativeEvent);Z(n.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),I=J(e=>{!r||!s||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)}),ee=i.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:N,onMouseDownCapture(e){N(),F(e)},onPointerDownCapture(e){N(),F(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,F,I]);return i.useMemo(()=>s?{reference:P,floating:ee,trigger:P}:{},[s,P,ee])}function Bf(e,t,n){let{reference:r,floating:i}=e,a=Jl(t),o=Yl(t),s=ql(o),c=Wl(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Gl(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Vf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ul(t,e),p=su(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=cu(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=cu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Hf=50,Uf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bf(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Hf&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ul(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Wl(r),_=Jl(o),v=Wl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[au(o)]:Zl(o)),x=p!==`none`;!d&&x&&b.push(...iu(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Xl(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Jl(t))||T.every(e=>Jl(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Jl(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Gf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kf(e){return Fl.some(t=>e[t]>=0)}var qf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ul(e,t);switch(i){case`referenceHidden`:{let e=Gf(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Kf(e)}}}case`escaped`:{let e=Gf(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Kf(e)}}}default:return{}}}}},Jf=new Set([`left`,`top`]);async function Yf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Wl(n),s=Gl(n),c=Jl(n)===`y`,l=Jf.has(o)?-1:1,u=a&&c?-1:1,d=Ul(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Xf=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Yf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Zf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ul(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Jl(Wl(i)),p=Kl(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Hl(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Hl(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Qf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ul(e,t),u={x:n,y:r},d=Jl(i),f=Kl(d),p=u[f],m=u[d],h=Ul(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Jf.has(Wl(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},$f=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ul(e,t),u=await o.detectOverflow(t,l),d=Wl(i),f=Gl(i),p=Jl(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Il(h-u[g],v),x=Il(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ll(u.left,0),t=Ll(u.right,0),n=Ll(u.top,0),r=Ll(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ll(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ll(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ep(e){let t=Xc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Lc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Rl(n)!==a||Rl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function tp(e){return Ic(e)?e:e.contextElement}function np(e){let t=tp(e);if(!Lc(t))return Bl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ep(t),o=(a?Rl(n.width):n.width)/r,s=(a?Rl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rp=Bl(0);function ip(e){let t=Nc(e);return!Jc()||!t.visualViewport?rp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ap(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nc(e)?!1:t}function op(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=tp(e),o=Bl(1);t&&(r?Ic(r)&&(o=np(r)):o=np(e));let s=ap(a,n,r)?ip(a):Bl(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Nc(a),t=r&&Ic(r)?Nc(r):r,n=e,i=tl(n);for(;i&&r&&t!==n;){let e=np(i),t=i.getBoundingClientRect(),r=Xc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Nc(i),i=tl(n)}}return cu({width:u,height:d,x:c,y:l})}function sp(e,t){let n=Zc(e).scrollLeft;return t?t.left+n:op(Pc(e)).left+n}function cp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sp(e,n),y:n.top+t.scrollTop}}function lp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Pc(r),s=t?Vc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Bl(1),u=Bl(0),d=Lc(r);if((d||!d&&!a)&&((Mc(r)!==`body`||zc(o))&&(c=Zc(r)),d)){let e=op(r);l=np(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cp(o,c):Bl(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function up(e){return Array.from(e.getClientRects())}function dp(e){let t=Pc(e),n=Zc(e),r=e.ownerDocument.body,i=Ll(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ll(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+sp(e),s=-n.scrollTop;return Xc(r).direction===`rtl`&&(o+=Ll(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var fp=25;function pp(e,t){let n=Nc(e),r=Pc(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Jc();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=sp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=fp&&(a-=o)}else l<=fp&&(a+=l);return{width:a,height:o,x:s,y:c}}function mp(e,t){let n=op(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Lc(e)?np(e):Bl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hp(e,t,n){let r;if(t===`viewport`)r=pp(e,n);else if(t===`document`)r=dp(Pc(e));else if(Ic(t))r=mp(t,n);else{let n=ip(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return cu(r)}function gp(e,t){let n=Qc(e);return n===t||!Ic(n)||Yc(n)?!1:Xc(n).position===`fixed`||gp(n,t)}function _p(e,t){let n=t.get(e);if(n)return n;let r=el(e,[],!1).filter(e=>Ic(e)&&Mc(e)!==`body`),i=null,a=Xc(e).position===`fixed`,o=a?Qc(e):e;for(;Ic(o)&&!Yc(o);){let t=Xc(o),n=Kc(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||zc(o)&&!n&&gp(e,o))?r=r.filter(e=>e!==o):i=t,o=Qc(o)}return t.set(e,r),r}function vp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Vc(t)?[]:_p(t,this._c):[].concat(n),r],o=hp(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hp(t,a[e],i);s=Ll(n.top,s),c=Il(n.right,c),l=Il(n.bottom,l),u=Ll(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function yp(e){let{width:t,height:n}=ep(e);return{width:t,height:n}}function bp(e,t,n){let r=Lc(t),i=Pc(t),a=n===`fixed`,o=op(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Bl(0);function l(){c.x=sp(i)}if(r||!r&&!a)if((Mc(t)!==`body`||zc(i))&&(s=Zc(t)),r){let e=op(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?cp(i,s):Bl(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function xp(e){return Xc(e).position===`static`}function Sp(e,t){if(!Lc(e)||Xc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Pc(e)===n&&(n=n.ownerDocument.body),n}function Cp(e,t){let n=Nc(e);if(Vc(e))return n;if(!Lc(e)){let t=Qc(e);for(;t&&!Yc(t);){if(Ic(t)&&!xp(t))return t;t=Qc(t)}return n}let r=Sp(e,t);for(;r&&Bc(r)&&xp(r);)r=Sp(r,t);return r&&Yc(r)&&xp(r)&&!Kc(r)?n:r||qc(e)||n}var wp=async function(e){let t=this.getOffsetParent||Cp,n=this.getDimensions,r=await n(e.floating);return{reference:bp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tp(e){return Xc(e).direction===`rtl`}var Ep={convertOffsetParentRelativeRectToViewportRelativeRect:lp,getDocumentElement:Pc,getClippingRect:vp,getOffsetParent:Cp,getElementRects:wp,getClientRects:up,getDimensions:yp,getScale:np,isElement:Ic,isRTL:Tp};function Dp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Op(e,t){let n=null,r,i=Pc(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=zl(d),h=zl(i.clientWidth-(u+f)),g=zl(i.clientHeight-(d+p)),_=zl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ll(0,Il(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Dp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function kp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=tp(e),u=i||a?[...l?el(l):[],...t?el(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Op(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?op(e):null;c&&g();function g(){let t=op(e);h&&!Dp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ap=Xf,jp=Zf,Mp=Wf,Np=$f,Pp=qf,Fp=Qf,Ip=(e,t,n)=>{let r=new Map,i={platform:Ep,...n},a={...i.platform,_c:r};return Uf(e,t,{...i,platform:a})},Lp=typeof document<`u`?i.useLayoutEffect:function(){};function Rp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Rp(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bp(e,t){let n=zp(e);return Math.round(t*n)/n}function Vp(e){let t=i.useRef(e);return Lp(()=>{t.current=e}),t}function Hp(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Rp(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),D=l!=null,O=Vp(l),k=Vp(a),A=Vp(u),j=i.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Ip(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Rp(T.current,t)&&(T.current=t,E.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Lp(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=i.useRef(!1);Lp(()=>(M.current=!0,()=>{M.current=!1}),[]),Lp(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=i.useMemo(()=>({reference:x,floating:S}),[x,S]),F=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Bp(P.floating,d.x),r=Bp(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zp(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var Up=(e,t)=>{let n=Ap(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wp=(e,t)=>{let n=jp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gp=(e,t)=>({fn:Fp(e).fn,options:[e,t]}),Kp=(e,t)=>{let n=Mp(e);return{name:n.name,fn:n.fn,options:[e,t]}},qp=(e,t)=>{let n=Np(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jp=(e,t)=>{let n=Pp(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yp={open:Y(e=>e.open),domReferenceElement:Y(e=>e.domReferenceElement),referenceElement:Y(e=>e.positionReference??e.referenceElement),floatingElement:Y(e=>e.floatingElement),floatingId:Y(e=>e.floatingId)},Xp=class extends vc{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:yf(),nested:t,noEmit:n,triggerElements:i},Yp)}setOpen=(e,t)=>{if((!e||!this.state.open||Pl(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function Zp(e,t=!1,n=!1){let[r,a]=i.useState(e&&t?`idle`:void 0),[o,s]=i.useState(e);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&r!==`ending`&&!n&&a(`ending`),!e&&!o&&r===`ending`&&a(void 0),q(()=>{if(!e&&o&&r!==`ending`&&n){let e=wc.request(()=>{a(`ending`)});return()=>{wc.cancel(e)}}},[e,o,r,n]),q(()=>{if(!e||t)return;let n=wc.request(()=>{a(void 0)});return()=>{wc.cancel(n)}},[t,e]),q(()=>{if(!e||!t)return;e&&o&&r!==`idle`&&a(`starting`);let n=wc.request(()=>{a(`idle`)});return()=>{wc.cancel(n)}},[t,e,o,a,r]),i.useMemo(()=>({mounted:o,setMounted:s,transitionStatus:r}),[o,r])}var Qp=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),$p={[Qp.startingStyle]:``},em={[Qp.endingStyle]:``},tm={transitionStatus(e){return e===`starting`?$p:e===`ending`?em:null}};function nm(e,t=!1,n=!0){let r=Tc();return J((i,a=null)=>{r.cancel();function o(){E.flushSync(i)}let s=wf(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=Qp.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function rm(e){let{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=J(a),s=nm(r,n,!1);i.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var im=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);if(n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t),process.env.NODE_ENV!==`production`&&this.elementsSet.size!==this.idMap.size))throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`)}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function am(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Vd(),a=Sf()!=null;if(process.env.NODE_ENV!==`production`){let e=r.reference;e&&!Ic(e)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`",`instead.`)}let o=ls(()=>new Xp({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new im,floatingId:i,nested:a,noEmit:!1})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Ic(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function om(e={}){let{nodeId:t,externalTree:n}=e,r=am(e),a=e.rootContext||r,o={reference:a.useState(`referenceElement`),floating:a.useState(`floatingElement`),domReference:a.useState(`domReferenceElement`)},[s,c]=i.useState(null),l=i.useRef(null),u=Cf(n);q(()=>{o.domReference&&(l.current=o.domReference)},[o.domReference]);let d=Hp({...e,elements:{...o,...s&&{reference:s}}}),f=i.useCallback(e=>{let t=Ic(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),d.refs.setReference(t)},[d.refs]),[p,m]=i.useState(null),[h,g]=i.useState(null);a.useSyncedValue(`referenceElement`,p),a.useSyncedValue(`domReferenceElement`,Ic(p)?p:null),a.useSyncedValue(`floatingElement`,h);let _=i.useCallback(e=>{(Ic(e)||e===null)&&(l.current=e,m(e)),(Ic(d.refs.reference.current)||d.refs.reference.current===null||e!==null&&!Ic(e))&&d.refs.setReference(e)},[d.refs,m]),v=i.useCallback(e=>{g(e),d.refs.setFloating(e)},[d.refs]),y=i.useMemo(()=>({...d.refs,setReference:_,setFloating:v,setPositionReference:f,domReference:l}),[d.refs,_,v,f]),b=i.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),x=a.useState(`open`),S=a.useState(`floatingId`),C=i.useMemo(()=>({...d,dataRef:a.context.dataRef,open:x,onOpenChange:a.setOpen,events:a.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:a}),[d,y,b,t,a,x,S]);return q(()=>{a.context.dataRef.current.floatingContext=C;let e=u?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),i.useMemo(()=>({...d,context:C,refs:y,elements:b,rootStore:a}),[d,y,b,C,a])}function sm(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),a=e.map(e=>e?.trigger),o=i.useCallback(t=>cm(t,e,`reference`),t),s=i.useCallback(t=>cm(t,e,`floating`),n),c=i.useCallback(t=>cm(t,e,`item`),r),l=i.useCallback(t=>cm(t,e,`trigger`),a);return i.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c,getTriggerProps:l}),[o,s,c,l])}function cm(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[hl]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&lm(a,s,i,r)}return lm(a,e,i,r),a}function lm(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var um=`Escape`;function dm(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function fm(e,t){return dm(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function pm(e,t,n){return dm(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function mm(e,t,n){return dm(t,n?e===gl:e===_l,e===yl)}function hm(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===um:dm(t,n?e===_l:e===gl,e===vl)}function gm(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),a=n.useState(`floatingElement`),o=n.useState(`domReferenceElement`),s=n.context.dataRef,{listRef:c,activeIndex:l,onNavigate:u=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:p=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:_=!1,focusItemOnOpen:v=`auto`,focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:x=void 0,orientation:S=`vertical`,parentOrientation:C,cols:w=1,id:T,resetOnPointerLeave:E=!0,externalTree:D}=t;process.env.NODE_ENV!==`production`&&(p&&(m||console.warn("`useListNavigation` looping must be enabled to allow escaping."),_||console.warn("`useListNavigation` must be virtual to allow escaping.")),S===`vertical`&&w>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",`be either "horizontal" or "both".`));let O=kc(El(a)),k=Sf(),A=Cf(D);q(()=>{s.current.orientation=S},[s,S]);let j=Tl(o),M=i.useRef(v),N=i.useRef(f??-1),P=i.useRef(null),F=i.useRef(!0),I=J(e=>{u(N.current===-1?null:N.current,e)}),ee=i.useRef(I),te=i.useRef(!!a),ne=i.useRef(r),L=i.useRef(!1),re=i.useRef(!1),ie=kc(x),ae=kc(r),oe=kc(f),R=kc(E),z=J(()=>{function e(e){_?A?.events.emit(`virtualfocus`,e):wd(e,{sync:L.current,preventScroll:!0})}let t=c.current[N.current],n=re.current;t&&e(t),(L.current?e=>e():requestAnimationFrame)(()=>{let r=c.current[N.current]||t;r&&(t||e(r),B&&(n||!F.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{d&&(r&&a?(N.current=f??-1,M.current&&f!=null&&(re.current=!0,I())):te.current&&(N.current=-1,ee.current()))},[d,r,a,f,I]),q(()=>{if(d){if(!r){L.current=!1;return}if(a)if(l==null){if(L.current=!1,oe.current!=null)return;if(te.current&&(N.current=-1,z()),(!ne.current||!te.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,t=()=>{c.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(N.current=P.current==null||pm(P.current,S,g)||h?du(c):fu(c),P.current=null,I())};t()}}else uu(c,l)||(N.current=l,z(),re.current=!1)}},[d,r,a,l,oe,h,c,S,g,I,z,ie]),q(()=>{if(!d||a||!A||_||!te.current)return;let e=A.nodesRef.current,t=e.find(e=>e.id===k)?.context?.elements.floating,n=bl(Xu(a)),r=e.some(e=>e.context&&Z(e.context.elements.floating,n));t&&!r&&F.current&&t.focus({preventScroll:!0})},[d,a,A,k,_]),q(()=>{ee.current=I,ne.current=r,te.current=!!a}),q(()=>{r||(P.current=null,M.current=v)},[r,v]);let se=l!=null,B=i.useMemo(()=>{function e(e){if(!ae.current)return;let t=c.current.indexOf(e.currentTarget);t!==-1&&N.current!==t&&(N.current=t,I(e))}return{onFocus(t){L.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){L.current=!0,re.current=!1,y&&e(t)},onPointerLeave(e){if(!ae.current||!F.current||e.pointerType===`touch`)return;L.current=!0;let t=e.relatedTarget;if(!(!y||c.current.includes(t))&&R.current&&(wd(null,{sync:!0}),N.current=-1,I(e),!_)){let e=O.current,t=bl(Xu(e));e&&Z(e,t)&&e.focus({preventScroll:!0})}}}},[ae,O,y,c,I,R,_]),V=i.useCallback(()=>C??A?.nodesRef.current.find(e=>e.id===k)?.context?.dataRef?.current.orientation,[k,A,C]),ce=J(e=>{if(F.current=!1,L.current=!0,e.which===229||!ae.current&&e.currentTarget===O.current)return;if(h&&hm(e.key,S,g,w)){fm(e.key,V())||kl(e),n.setOpen(!1,Q(yd,e.nativeEvent)),Lc(o)&&(_?A?.events.emit(`virtualfocus`,o):o.focus());return}let t=N.current,i=du(c,x),a=fu(c,x);if(j||(e.key===`Home`&&(kl(e),N.current=i,I(e)),e.key===`End`&&(kl(e),N.current=a,I(e))),w>1){let t=Array.from({length:c.current.length},()=>({width:1,height:1})),n=hu(t,w,!1),r=n.findIndex(e=>e!=null&&!vu(c,e,x)),o=n.reduce((e,t,n)=>t!=null&&!vu(c,t,x)?n:e,-1),s=n[mu({current:n.map(e=>e==null?null:c.current[e])},{event:e,orientation:S,loopFocus:m,rtl:g,cols:w,disabledIndices:_u([...(typeof x==`function`?null:x)||c.current.map((e,t)=>vu(c,t,x)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:gu(N.current>a?i:N.current,t,n,w,e.key===`ArrowDown`?`bl`:e.key===(g?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(s!=null&&(N.current=s,I(e)),S===`both`)return}if(fm(e.key,S)){if(kl(e),r&&!_&&bl(e.currentTarget.ownerDocument)===e.currentTarget){N.current=pm(e.key,S,g)?i:a,I(e);return}pm(e.key,S,g)?m?t>=a?p&&t!==c.current.length?N.current=-1:(L.current=!1,N.current=i):N.current=pu(c,{startingIndex:t,disabledIndices:x}):N.current=Math.min(a,pu(c,{startingIndex:t,disabledIndices:x})):m?t<=i?p&&t!==-1?N.current=c.current.length:(L.current=!1,N.current=a):N.current=pu(c,{startingIndex:t,decrement:!0,disabledIndices:x}):N.current=Math.max(i,pu(c,{startingIndex:t,decrement:!0,disabledIndices:x})),uu(c,N.current)&&(N.current=-1),I(e)}}),H=i.useMemo(()=>_&&r&&se&&{"aria-activedescendant":`${T}-${l}`},[_,r,se,T,l]),le=i.useMemo(()=>({"aria-orientation":S===`both`?void 0:S,...j?{}:H,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!_){let t=xl(e.nativeEvent);if(t&&!Z(O.current,t))return;kl(e),n.setOpen(!1,Q(_d,e.nativeEvent)),Lc(o)&&o.focus();return}ce(e)},onPointerMove(){F.current=!0}}),[H,ce,O,S,j,n,r,_,o]),U=i.useMemo(()=>{function e(e){v===`auto`&&jl(e.nativeEvent)&&(M.current=!_)}function t(e){M.current=v,v===`auto`&&Ml(e.nativeEvent)&&(M.current=!0)}return{onKeyDown(e){let t=n.select(`open`);F.current=!1;let r=e.key.startsWith(`Arrow`),i=mm(e.key,V(),g),a=fm(e.key,S),o=(h?i:a)||e.key===`Enter`||e.key.trim()===``;if(_&&t)return ce(e);if(!(!t&&!b&&r)){if(o){let t=fm(e.key,V());P.current=h&&t?null:e.key}if(h){i&&(kl(e),t?(N.current=du(c,ie.current),I(e)):n.setOpen(!0,Q(yd,e.nativeEvent,e.currentTarget)));return}a&&(oe.current!=null&&(N.current=oe.current),kl(e),!t&&b?n.setOpen(!0,Q(yd,e.nativeEvent,e.currentTarget)):ce(e),t&&I(e))}},onFocus(e){n.select(`open`)&&!_&&(N.current=-1,I(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,ie,v,c,h,I,n,b,S,V,g,oe,_]),ue=i.useMemo(()=>({...H,...U}),[H,U]);return i.useMemo(()=>d?{reference:ue,floating:le,item:B,trigger:U}:{},[d,ue,le,U,B])}function _m(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,a=n.useState(`open`),{listRef:o,elementsRef:s,activeIndex:c,onMatch:l,onTypingChange:u,enabled:d=!0,resetMs:f=750,selectedIndex:p=null}=t,m=Oc(),h=i.useRef(``),g=i.useRef(p??c??-1),_=i.useRef(null);q(()=>{!a&&p!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[a,p,m]),q(()=>{a&&h.current===``&&(g.current=p??c??-1)},[a,p,c]);let v=J(e=>{e?r.current.typing||(r.current.typing=e,u?.(e)):r.current.typing&&(r.current.typing=e,u?.(e))}),y=J(e=>{function t(e){let t=s?.current[e];return!t||yu(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=o.current;if(h.current.length>0&&e.key===` `&&(kl(e),v(!0)),h.current.length>0&&h.current[0]!==` `&&n(r,h.current)===-1&&e.key!==` `&&v(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;a&&e.key!==` `&&(kl(e),v(!0));let i=h.current===``;i&&(g.current=p??c??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(f,()=>{h.current=``,g.current=_.current,v(!1)});let u=((i?p??c??-1:g.current)??0)+1,d=n(r,h.current,u);d===-1?e.key!==` `&&(h.current=``,v(!1)):(l?.(d),_.current=d)}),b=J(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=Z(r,t),o=Z(i,t);a||o||(m.clear(),h.current=``,g.current=_.current,v(!1))}),x=i.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]),S=i.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return i.useMemo(()=>d?{reference:x,floating:S}:{},[d,x,S])}var vm=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(vm.displayName=`ComboboxRootContext`);var ym=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(ym.displayName=`ComboboxFloatingContext`);var bm=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(bm.displayName=`ComboboxDerivedItemsContext`);var xm=i.createContext(``);process.env.NODE_ENV!==`production`&&(xm.displayName=`ComboboxInputValueContext`);function Sm(){let e=i.useContext(vm);if(!e)throw Error(process.env.NODE_ENV===`production`?ws(22):`Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function Cm(){let e=i.useContext(ym);if(!e)throw Error(process.env.NODE_ENV===`production`?ws(23):`Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function wm(){let e=i.useContext(bm);if(!e)throw Error(process.env.NODE_ENV===`production`?ws(24):`Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function Tm(){return i.useContext(xm)}var Em=(e,t)=>Object.is(e,t);function Dm(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Om(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Dm(t,e,n))}function km(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Dm(e,t,n))}function Am(e,t,n){return e.filter(e=>!Dm(t,e,n))}function jm(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Mm(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Nm(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Mm(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Pm(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return jm(e)}function Fm(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?jm(e.value):jm(e)}function Im(e,t,n){function r(){return Pm(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Mm(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Lm(e,t,r){return e.reduce((e,a,o)=>(o>0&&e.push(`, `),e.push((0,n.jsx)(i.Fragment,{children:Im(a,t,r)},o)),e),[])}var $={id:Y(e=>e.id),labelId:Y(e=>e.labelId),query:Y(e=>e.query),items:Y(e=>e.items),selectedValue:Y(e=>e.selectedValue),hasSelectionChips:Y(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:Y(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:Y((e,t)=>t?Nm(e.items):!1),open:Y(e=>e.open),mounted:Y(e=>e.mounted),forceMounted:Y(e=>e.forceMounted),inline:Y(e=>e.inline),activeIndex:Y(e=>e.activeIndex),selectedIndex:Y(e=>e.selectedIndex),isActive:Y((e,t)=>e.activeIndex===t),isSelected:Y((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Dm(t,e,n)):Dm(t,r,n)}),transitionStatus:Y(e=>e.transitionStatus),popupProps:Y(e=>e.popupProps),inputProps:Y(e=>e.inputProps),triggerProps:Y(e=>e.triggerProps),getItemProps:Y(e=>e.getItemProps),positionerElement:Y(e=>e.positionerElement),listElement:Y(e=>e.listElement),triggerElement:Y(e=>e.triggerElement),inputElement:Y(e=>e.inputElement),inputGroupElement:Y(e=>e.inputGroupElement),popupSide:Y(e=>e.popupSide),openMethod:Y(e=>e.openMethod),inputInsidePopup:Y(e=>e.inputInsidePopup),selectionMode:Y(e=>e.selectionMode),listRef:Y(e=>e.listRef),labelsRef:Y(e=>e.labelsRef),popupRef:Y(e=>e.popupRef),emptyRef:Y(e=>e.emptyRef),inputRef:Y(e=>e.inputRef),keyboardActiveRef:Y(e=>e.keyboardActiveRef),chipsContainerRef:Y(e=>e.chipsContainerRef),clearRef:Y(e=>e.clearRef),valuesRef:Y(e=>e.valuesRef),allValuesRef:Y(e=>e.allValuesRef),name:Y(e=>e.name),disabled:Y(e=>e.disabled),readOnly:Y(e=>e.readOnly),required:Y(e=>e.required),grid:Y(e=>e.grid),isGrouped:Y(e=>e.isGrouped),virtualized:Y(e=>e.virtualized),onOpenChangeComplete:Y(e=>e.onOpenChangeComplete),openOnInputClick:Y(e=>e.openOnInputClick),itemToStringLabel:Y(e=>e.itemToStringLabel),isItemEqualToValue:Y(e=>e.isItemEqualToValue),modal:Y(e=>e.modal),autoHighlight:Y(e=>e.autoHighlight),submitOnItemClick:Y(e=>e.submitOnItemClick)},Rm=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}({}),zm={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Bm={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Vm={disabled:!1,...Bm},Hm={valid(e){return e===null?null:e?{[Rm.valid]:``}:{[Rm.invalid]:``}}},Um=i.createContext({invalid:void 0,name:void 0,validityData:{state:zm,errors:[],error:``,value:``,initialValue:null},setValidityData:hc,disabled:void 0,touched:Bm.touched,setTouched:hc,dirty:Bm.dirty,setDirty:hc,filled:Bm.filled,setFilled:hc,focused:Bm.focused,setFocused:hc,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Vm,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=_c)=>e,getInputValidationProps:(e=_c)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!==`production`&&(Um.displayName=`FieldRootContext`);function Wm(e=!0){let t=i.useContext(Um);if(t.setValidityData===hc&&!e)throw Error(process.env.NODE_ENV===`production`?ws(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return t}function Gm(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var Km=i.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:hc,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(Km.displayName=`FormContext`);function qm(){return i.useContext(Km)}function Jm(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=qm(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=Wm(),f=J(e.getValue);q(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),q(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:Gm(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?E.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),q(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}function Ym(e){return Vd(e,`base-ui`)}var Xm=i.createContext({controlId:void 0,registerControlId:hc,labelId:void 0,setLabelId:hc,messageIds:[],setMessageIds:hc,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(Xm.displayName=`LabelableContext`);function Zm(){return i.useContext(Xm)}function Qm(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:o}=Zm(),s=Ym(t),c=n?a:void 0,l=ls(()=>Symbol(`labelable-control`)),u=i.useRef(!1),d=i.useRef(t!=null),f=J(()=>{!u.current||o===hc||(u.current=!1,o(l.current,void 0))});return q(()=>{if(o===hc)return;let e;if(n){let n=r?.current;e=Ic(n)&&n.closest(`label`)!=null?t??null:c??s}else if(t!=null)d.current=!0,e=t;else if(d.current)e=s;else{f();return}if(e===void 0){f();return}u.current=!0,o(l.current,e)},[t,r,c,o,n,s,l,f]),i.useEffect(()=>f,[f]),a??s}function $m(e,t){return(n,r)=>{if(n==null)return!1;let i=Pm(n,t);return e.contains(i,r)}}function eh(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let a=Pm(r,t),o=n==null?``:Pm(n,t);return o&&e.contains(o,i)&&o.length===i.length?!0:e.contains(a,i)}}var th=new Map;function nh(e){return Array.isArray(e)?e.map(e=>nh(e)).join(`,`):e==null?``:String(e)}function rh(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${nh(e.locale)}|${JSON.stringify(t)}`,r=th.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=Pm(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=Pm(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=Pm(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return th.set(n,a),a}var ih=rh;function ah(e){let t=i.useRef(``),n=i.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:i.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function oh(e,t){let n=i.useRef(e),r=J(t);q(()=>{n.current!==e&&r(n.current)},[e,r]),q(()=>{n.current=e},[e])}function sh(e){let[t,n]=i.useState(null),r=J((t,r)=>{e||n(r||(sl?`touch`:``))});oh(e,t=>{t&&!e&&n(null)});let{onClick:a,onPointerDown:o}=ah(r);return i.useMemo(()=>({openMethod:t,triggerProps:{onClick:a,onPointerDown:o}}),[t,a,o])}var ch=Symbol(`none`),lh={value:ch,index:-1};function uh(e){let{id:t,onOpenChangeComplete:r,defaultSelectedValue:a=null,selectedValue:o,onSelectedValueChange:s,defaultInputValue:c,inputValue:l,selectionMode:u=`none`,onItemHighlighted:d,name:f,disabled:p=!1,readOnly:m=!1,required:h=!1,inputRef:g,grid:_=!1,items:v,filteredItems:y,filter:b,openOnInputClick:x=!0,autoHighlight:S=!1,keepHighlight:C=!1,highlightItemOnHover:w=!0,loopFocus:T=!0,itemToStringLabel:E,itemToStringValue:D,isItemEqualToValue:O=Em,virtualized:k=!1,inline:A=!1,fillInputOnItemPress:j=!0,modal:M=!1,limit:N=-1,autoComplete:P=`list`,formAutoComplete:F,locale:I,submitOnItemClick:ee=!1}=e,{clearErrors:te}=qm(),{setDirty:ne,validityData:L,shouldValidateOnChange:re,setFilled:ie,name:ae,disabled:oe,setTouched:R,setFocused:z,validationMode:se,validation:B}=Wm(),V=Qm({id:t}),ce=ih({locale:I}),[H,le]=i.useState(!1),[U,ue]=i.useState(null),de=i.useRef([]),fe=i.useRef([]),pe=i.useRef(null),me=i.useRef(null),he=i.useRef(null),ge=i.useRef(null),_e=i.useRef(null),ve=i.useRef(!0),ye=i.useRef(!1),be=i.useRef(null),xe=i.useRef(null),Se=i.useRef(null),Ce=i.useRef(lh),we=i.useRef(null),Te=i.useRef([]),Ee=i.useRef([]),De=oe||p,Oe=ae??f,ke=u===`multiple`,Ae=u===`single`,je=l!==void 0||c!==void 0,Me=v!==void 0,Ne=y!==void 0,Pe;Pe=S===`always`?`always`:S?`input-change`:!1;let[W,Fe]=os({controlled:o,default:ke?a??gc:a,name:`Combobox`,state:`selectedValue`}),Ie=i.useMemo(()=>b===null?()=>!0:b===void 0?Ae&&!H?eh(ce,E,W):$m(ce,E):b,[b,Ae,W,H,ce,E]),Le=ls(()=>je?c??``:Ae?Pm(W,E):``).current,[Re,ze]=os({controlled:l,default:Le,name:`Combobox`,state:`inputValue`}),[Be,Ve]=os({controlled:e.open,default:e.defaultOpen,name:`Combobox`,state:`open`}),He=Mm(v),Ue=U??(Re===``?``:String(Re).trim()),We=Ae?Pm(W,E):``,Ge=Ae&&!H&&Ue!==``&&We!==``&&We.length===Ue.length&&ce.contains(We,Ue),Ke=Ge?``:Ue,qe=Me&&Ne&&Ge,Je=i.useMemo(()=>v?He?v.flatMap(e=>e.items):v:gc,[v,He]),Ye=i.useMemo(()=>{if(y&&!qe)return y;if(!v)return gc;if(He){let e=v,t=[],n=0;for(let r of e){if(N>-1&&n>=N)break;let e=Ke===``?r.items:r.items.filter(e=>Ie(e,Ke,E));if(e.length===0)continue;let i=N>-1?N-n:1/0,a=e.slice(0,i);if(a.length>0){let e={...r,items:a};t.push(e),n+=a.length}}return t}if(Ke===``)return N>-1?Je.slice(0,N):Je;let e=[];for(let t of Je){if(N>-1&&e.length>=N)break;Ie(t,Ke,E)&&e.push(t)}return e},[y,qe,v,He,Ke,N,Ie,E,Je]),Xe=i.useMemo(()=>He?Ye.flatMap(e=>e.items):Ye,[Ye,He]),G=ls(()=>new mc({id:V,labelId:void 0,selectedValue:W,open:Be,filter:Ie,query:Ue,items:v,selectionMode:u,listRef:de,labelsRef:fe,popupRef:pe,emptyRef:_e,inputRef:me,startDismissRef:he,endDismissRef:ge,keyboardActiveRef:ve,chipsContainerRef:be,clearRef:xe,valuesRef:Te,allValuesRef:Ee,selectionEventRef:Se,name:Oe,disabled:De,readOnly:m,required:h,grid:_,isGrouped:He,virtualized:k,openOnInputClick:x,itemToStringLabel:E,isItemEqualToValue:O,modal:M,autoHighlight:Pe,submitOnItemClick:ee,hasInputValue:je,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:A,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:r||hc,setOpen:hc,setInputValue:hc,setSelectedValue:hc,setIndices:hc,onItemHighlighted:hc,handleSelection:hc,getItemProps:()=>_c,forceMount:hc,requestSubmit:hc})).current,Ze=u===`none`?Re:W,Qe=i.useMemo(()=>u===`none`?Ze:Array.isArray(W)?W.map(e=>Fm(e,D)):Fm(W,D),[Ze,D,u,W]),$e=J(d),et=J(r),tt=X(G,$.activeIndex),nt=X(G,$.selectedIndex),rt=X(G,$.positionerElement),it=X(G,$.listElement),at=X(G,$.triggerElement),ot=X(G,$.inputElement),K=X(G,$.inputGroupElement),st=X(G,$.inline),ct=X(G,$.inputInsidePopup),lt=kc(at),{mounted:ut,setMounted:dt,transitionStatus:ft}=Zp(Be),{openMethod:pt,triggerProps:mt}=sh(Be);Jm({id:V,name:Oe,commit:B.commit,value:Ze,controlRef:ct?lt:me,getValue:()=>Qe});let ht=J(()=>{v?fe.current=Xe.map(e=>Pm(e,E)):G.set(`forceMounted`,!0)}),gt=i.useRef(W);q(()=>{W!==gt.current&&ht()},[ht,W]);let _t=J(e=>{G.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0)if(e.activeIndex===null)Ce.current!==lh&&(Ce.current=lh,$e(void 0,bd(t,void 0,{index:-1})));else{let n=Te.current[e.activeIndex];Ce.current={value:n,index:e.activeIndex},$e(n,bd(t,void 0,{index:e.activeIndex}))}}),vt=J((t,n)=>{if(ye.current=n.reason===hd,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&le(!0),we.current={hasQuery:e},e&&Pe&&G.state.activeIndex==null&&G.set(`activeIndex`,0)}}ze(t)}}),yt=J((t,n)=>{if(Be!==t&&(n.reason===`escape-key`&&Me&&Xe.length===0&&!G.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(!t&&H&&(Ae?(st||ue(Ue),Ue===``&&le(!1)):ke&&(st||ct?_t({activeIndex:null}):ue(Ue),vt(``,Q(hd,n.event)))),Ve(t),!t&&ct&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(R(!0),z(!1),se===`onBlur`)))){let e=u===`none`?Re:W;B.commit(e)}}),bt=J((e,t)=>{s?.(e,t),!t.isCanceled&&(Fe(e),(u===`none`&&pe.current&&j||Ae&&!G.state.inputInsidePopup)&&vt(Pm(e,E),Q(t.reason,t.event)),Ae&&e!=null&&t.reason!==`input-change`&&H&&!st&&ue(Ue))}),xt=J((e,t)=>{let n=t;if(n===void 0){if(tt===null)return;n=Te.current[tt]}let r=xl(e),i=Se.current??e;Se.current=null;let a=Q(ud,i),o=r?.closest(`a`)?.getAttribute(`href`);if(o){o.startsWith(`#`)&&yt(!1,a);return}if(ke){let e=Array.isArray(W)?W:[];if(bt(Om(e,n,G.state.isItemEqualToValue)?Am(e,n,G.state.isItemEqualToValue):[...e,n],a),!(me.current&&me.current.value.trim()!==``))return;G.state.inputInsidePopup?vt(``,Q(hd,a.event)):yt(!1,a)}else bt(n,a),yt(!1,a)}),St=J(()=>{if(!G.state.submitOnItemClick)return;let e=G.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Ct=J(()=>{if(dt(!1),et?.(!1),le(!1),ue(null),_t(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ke&&me.current&&me.current.value!==``&&!ye.current&&vt(``,Q(hd)),Ae)if(G.state.inputInsidePopup)me.current&&me.current.value!==``&&vt(``,Q(hd));else{let e=Pm(W,E);me.current&&me.current.value!==e&&vt(e,Q(e===``?hd:sd))}}),wt=i.useMemo(()=>st&&rt?{current:rt.closest(`[role="dialog"]`)}:pe,[st,rt]);rm({enabled:!e.actionsRef,open:Be,ref:wt,onComplete(){Be||Ct()}}),i.useImperativeHandle(e.actionsRef,()=>({unmount:Ct}),[Ct]),q(function(){if(Be||u===`none`)return;let e=v?Je:Ee.current;if(ke){let t=Array.isArray(W)?W:[],n=t[t.length-1],r=km(e,n,O);_t({selectedIndex:r===-1?null:r})}else{let t=km(e,W,O);_t({selectedIndex:t===-1?null:t})}},[Be,W,v,u,Je,ke,O,_t]),q(()=>{v&&(Te.current=Xe,de.current.length=Xe.length)},[v,Xe]),q(()=>{let e=we.current;if(e&&(e.hasQuery?Pe&&G.set(`activeIndex`,0):Pe===`always`&&G.set(`activeIndex`,0),we.current=null),!Be&&!st)return;let t=Me||Ne?Xe:Te.current,n=G.state.activeIndex;if(n==null){if(Pe===`always`&&t.length>0){G.set(`activeIndex`,0);return}Ce.current!==lh&&(Ce.current=lh,G.state.onItemHighlighted(void 0,bd(sd,void 0,{index:-1})));return}if(n>=t.length){Ce.current!==lh&&(Ce.current=lh,G.state.onItemHighlighted(void 0,bd(sd,void 0,{index:-1}))),G.set(`activeIndex`,null);return}let r=t[n],i=Ce.current.value,a=i!==ch&&Dm(r,i,G.state.isItemEqualToValue);(Ce.current.index!==n||!a)&&(Ce.current={value:r,index:n},G.state.onItemHighlighted(r,bd(sd,void 0,{index:n})))},[tt,Pe,Ne,Me,Xe,st,Be,G]),q(()=>{if(u===`none`){ie(String(Re)!==``);return}ie(ke?Array.isArray(W)&&W.length>0:W!=null)},[ie,u,Re,W,ke]),i.useEffect(()=>{Me&&Pe&&Xe.length===0&&_t({activeIndex:null})},[Me,Pe,Xe.length,_t]),oh(Ue,()=>{!Be||Ue===``||Ue===String(Le)||le(!0)}),oh(W,()=>{if(u!==`none`&&(te(Oe),ne(W!==L.initialValue),re()?B.commit(W):B.commit(W,!0),Ae&&!je&&!ct)){let e=Pm(W,E);Re!==e&&vt(e,Q(sd))}}),oh(Re,()=>{u===`none`&&(te(Oe),ne(Re!==L.initialValue),re()?B.commit(Re):B.commit(Re,!0))}),oh(v,()=>{if(!Ae||je||ct||H)return;let e=Pm(W,E);Re!==e&&vt(e,Q(sd))});let Tt=am({open:st?!0:Be,onOpenChange:yt,elements:{reference:ct?at:ot,floating:rt}}),Et,Dt;st||(Et=_?`grid`:`listbox`,Dt=Be?`true`:`false`);let{getReferenceProps:Ot,getFloatingProps:kt,getItemProps:At}=sm([i.useMemo(()=>{let e=ot?.tagName===`INPUT`,t=ot==null||e,n=t||Be,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Dt,r[`aria-haspopup`]=Et,r[`aria-controls`]=Be?it?.id:void 0,r[`aria-autocomplete`]=P),{reference:r,floating:{role:`presentation`}}},[ot,Be,Dt,Et,it?.id,P]),Ff(Tt,{enabled:!m&&!De&&x,event:`mousedown-only`,toggle:!1,touchOpenDelay:ct?0:50,reason:gd}),zf(Tt,{enabled:!m&&!De&&!st,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:st?!0:void 0,outsidePress(e){let t=xl(e);return!Z(at,t)&&!Z(xe.current,t)&&!Z(be.current,t)&&!Z(K,t)}}),gm(Tt,{enabled:!m&&!De,id:V,listRef:de,activeIndex:tt,selectedIndex:nt,virtual:!0,loopFocus:T,allowEscape:T&&!Pe,focusItemOnOpen:H||u===`none`&&!Pe?!1:`auto`,focusItemOnHover:w,resetOnPointerLeave:!C,cols:_?2:1,orientation:_?`horizontal`:void 0,disabledIndices:gc,onNavigate(e,t){!t&&!Be||ft===`ending`||_t(t?{activeIndex:e,type:ve.current?`keyboard`:`pointer`}:{activeIndex:e})}})]);ss(()=>{G.update({inline:A,popupProps:kt(),inputProps:Ot(),triggerProps:mt,getItemProps:At,setOpen:yt,setInputValue:vt,setSelectedValue:bt,setIndices:_t,onItemHighlighted:$e,handleSelection:xt,forceMount:ht,requestSubmit:St})}),q(()=>{G.update({id:V,selectedValue:W,open:Be,mounted:ut,transitionStatus:ft,items:v,inline:A,popupProps:kt(),inputProps:Ot(),triggerProps:mt,openMethod:pt,getItemProps:At,selectionMode:u,name:Oe,disabled:De,readOnly:m,required:h,grid:_,isGrouped:He,virtualized:k,onOpenChangeComplete:et,openOnInputClick:x,itemToStringLabel:E,modal:M,autoHighlight:Pe,isItemEqualToValue:O,submitOnItemClick:ee,hasInputValue:je,requestSubmit:St})},[G,V,W,Be,ut,ft,v,kt,Ot,At,pt,mt,u,Oe,De,m,h,B,_,He,k,et,x,E,M,O,ee,je,A,St,Pe]);let jt=ms(g,B.inputRef),Mt=i.useMemo(()=>({query:Ue,hasItems:Me,filteredItems:Ye,flatFilteredItems:Xe}),[Ue,Me,Ye,Xe]),Nt=i.useMemo(()=>Array.isArray(Ze)?``:Fm(Ze,D),[Ze,D]),Pt=ke&&Array.isArray(W)&&W.length>0,Ft=ke||u===`none`?void 0:Oe,It=i.useMemo(()=>!ke||!Array.isArray(W)||!Oe?null:W.map(e=>{let t=Fm(e,D);return(0,n.jsx)(`input`,{type:`hidden`,name:Oe,value:t},t)}),[ke,W,Oe,D]),Lt=(0,n.jsxs)(i.Fragment,{children:[e.children,(0,n.jsx)(`input`,{...B.getInputValidationProps({onFocus(){if(ct){at?.focus();return}(me.current||at)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Q(sd,e.nativeEvent);function r(){if(ke)return;if(u===`none`){ne(t!==L.initialValue),vt(t,n),re()&&B.commit(t);return}let e=Te.current.find(e=>Fm(e,D).toLowerCase()===t.toLowerCase());e!=null&&(ne(e!==L.initialValue),bt?.(e,n),re()&&B.commit(e))}v?r():(ht(),queueMicrotask(r))}}),id:V&&Ft==null?`${V}-hidden-input`:void 0,name:Ft,autoComplete:F,disabled:De,required:h&&!Pt,readOnly:m,value:Nt,ref:jt,style:Ft?Ss:xs,tabIndex:-1,"aria-hidden":!0}),It]});return(0,n.jsx)(vm.Provider,{value:G,children:(0,n.jsx)(ym.Provider,{value:Tt,children:(0,n.jsx)(bm.Provider,{value:Mt,children:(0,n.jsx)(xm.Provider,{value:Re,children:Lt})})})})}function dh(e){let{multiple:t=!1,defaultValue:r,value:i,onValueChange:a,autoComplete:o,...s}=e;return(0,n.jsx)(uh,{...s,selectionMode:t?`multiple`:`single`,selectedValue:i,defaultSelectedValue:r,onSelectedValueChange:a,formAutoComplete:o})}var fh;process.env.NODE_ENV!==`production`&&(fh=new Set);function ph(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);fh.has(t)||(fh.add(t),console.error(`Base UI: ${t}`))}}function mh(e,t){return e??t}function hh(e){let{children:t,placeholder:r}=e,a=Sm(),o=X(a,$.itemToStringLabel),s=X(a,$.selectedValue),c=X(a,$.items),l=X(a,$.selectionMode)===`multiple`,u=X(a,$.hasSelectedValue),d=!u&&r!=null&&t==null,f=X(a,$.hasNullItemLabel,d),p=null;return p=typeof t==`function`?t(s):t??(!u&&r!=null&&!f?r:l&&Array.isArray(s)?Lm(s,c,o):Im(s,c,o)),(0,n.jsx)(i.Fragment,{children:p})}var gh=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Qp.startingStyle]=`startingStyle`,e[e.endingStyle=Qp.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),_h=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),vh={[_h.popupOpen]:``},yh={[_h.popupOpen]:``,[_h.pressed]:``},bh={[gh.open]:``},xh={[gh.closed]:``},Sh={[gh.anchorHidden]:``},Ch={open(e){return e?vh:null}},wh={open(e){return e?yh:null}},Th={open(e){return e?bh:xh},anchorHidden(e){return e?Sh:null}},Eh={...wh,...Hm,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},Dh=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(Dh.displayName=`ComboboxChipsContext`);function Oh(){return i.useContext(Dh)}var kh=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(kh.displayName=`ComboboxPositionerContext`);function Ah(e){let t=i.useContext(kh);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?ws(21):`Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component`);return t}var jh=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(jh.displayName=`DirectionContext`);function Mh(){return i.useContext(jh)?.direction??`ltr`}var Nh=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(Nh.displayName=`CompositeRootContext`);function Ph(e=!1){let t=i.useContext(Nh);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?ws(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function Fh(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,s=r&&t!==!1,c=r&&t===!1;return{props:i.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,o,a])}}function Ih(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=i.useRef(null),c=Ph(!0),l=o??c!==void 0,{props:u}=Fh({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a});process.env.NODE_ENV!==`production`&&i.useEffect(()=>{if(!s.current)return;let e=Lh(s.current);a?e||ph(`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\`.${Ld.captureOwnerStack?.()||``}`):e&&ph(`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\`.${Ld.captureOwnerStack?.()||``}`)},[a]);let d=i.useCallback(()=>{let e=s.current;Lh(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return q(d,[d]),{getButtonProps:i.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return Xd({type:a?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(af(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,s=Lh(i),c=!a&&Rh(i),u=r&&(a?s:!c),d=e.key===`Enter`,f=e.key===` `,p=i.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),c||a&&s?(i.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!a&&(f||d)&&e.preventDefault(),!a&&d&&n?.(e))},onKeyUp(e){if(!t){if(af(e),i?.(e),e.target===e.currentTarget&&a&&l&&Lh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},a?void 0:{role:`button`},u,c)},[t,u,l,a]),buttonRef:J(e=>{s.current=e,d()})}}function Lh(e){return Lc(e)&&e.tagName===`BUTTON`}function Rh(e){return!!(e?.tagName===`A`&&e?.href)}var zh=i.forwardRef(function(e,t){let r=Sm(),{buttonRef:i,getButtonProps:a}=Ih({native:!1});return(0,n.jsx)(`span`,{ref:ms(t,i),...a({onClick:J(e=>{r.state.setOpen(!1,Q(dd,e.nativeEvent,e.currentTarget))})}),"aria-label":`Dismiss`,tabIndex:void 0,style:Ss})});process.env.NODE_ENV!==`production`&&(zh.displayName=`ComboboxInternalDismissButton`);var Bh=i.forwardRef(function(e,t){let{render:r,className:a,disabled:o=!1,id:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=Wm(),{labelId:h}=Zm(),g=Oh(),_=!!Ah(!0),v=Sm(),{filteredItems:y}=wm(),b=Tm(),x=Mh(),S=X(v,$.required),C=X(v,$.disabled),w=X(v,$.readOnly),T=X(v,$.name),E=X(v,$.selectionMode),D=X(v,$.autoHighlight),O=X(v,$.inputProps),k=X(v,$.triggerProps),A=X(v,$.open),j=X(v,$.mounted),M=X(v,$.selectedValue),N=X(v,$.popupSide),P=X(v,$.positionerElement),F=X(v,$.id),I=X(v,$.inline),ee=X(v,$.modal),te=!!D,ne=j&&P?N:null,L=u||C||o,re=y.length===0,ie=_||I,ae=!ie||ee,oe=Ym(s??(ie?void 0:F)),R=mh(h,void 0),z=_?Bm:l,[se,B]=i.useState(null),V=i.useRef(!1),ce=i.useRef(null),H=i.useRef(!1),le=J(e=>{let t=_||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue(``,Q(sd)),v.update({inputElement:e,inputInsidePopup:t})}),U=_||!m?c:m.getValidationProps(c),ue={...z,open:A,disabled:L,readOnly:w,popupSide:ne,listEmpty:re};function de(e){if(!g)return;let t,{highlightedChipIndex:n}=g;if(n!==void 0){if(e.key===`ArrowLeft`)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===`ArrowRight`)e.preventDefault(),t=n<M.length-1?n+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let r=n>=M.length-1?M.length-2:n;t=r>=0?r:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`})}return t}return e.key===`ArrowLeft`&&(e.currentTarget.selectionStart??0)===0&&M.length>0?(e.preventDefault(),t=Math.max(M.length-1,0)):e.key===`Backspace`&&e.currentTarget.value===``&&M.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let fe=cf(`input`,e,{state:ue,ref:[t,v.state.inputRef,le],props:[O,k,{type:`text`,value:e.value??se??b,"aria-readonly":w||void 0,"aria-required":S||void 0,"aria-labelledby":R,disabled:L,readOnly:w,required:E===`none`?S:void 0,...E===`none`&&T&&{name:T},id:oe,onFocus(){if(f(!0),!I||!H.current)return;H.current=!1;let e=ce.current;e==null||!Object.hasOwn(v.state.valuesRef.current,e)||v.state.setIndices({activeIndex:e})},onBlur(){d(!0),f(!1);let e=v.state.activeIndex;if(I&&e!==null&&D!==`always`&&(ce.current=e,H.current=!0,v.state.setIndices({activeIndex:null})),p===`onBlur`){let e=E===`none`?b:M;m.commit(e)}},onCompositionStart(e){ul||(V.current=!0,B(e.currentTarget.value))},onCompositionEnd(e){V.current=!1;let t=e.currentTarget.value;B(null),v.state.setInputValue(t,Q(md,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=V.current||!n;if(V.current){let t=e.currentTarget.value;B(t),t===``&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,Q(hd,e.nativeEvent));let n=t.trim(),i=te&&n!==``;!w&&!L&&n&&r&&(v.state.setOpen(!0,Q(md,e.nativeEvent)),te||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!i&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}v.state.setInputValue(e.currentTarget.value,Q(md,e.nativeEvent));let i=e.currentTarget.value===``,a=Q(hd,e.nativeEvent);i&&!v.state.inputInsidePopup&&(E===`single`&&v.state.setSelectedValue(null,a),v.state.openOnInputClick||v.state.setOpen(!1,a));let o=e.currentTarget.value.trim();!w&&!L&&o&&r&&(v.state.setOpen(!0,Q(md,e.nativeEvent)),te||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})),A&&v.state.activeIndex!==null&&!te&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(L||w||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=x===`rtl`;if(e.key===`Home`){kl(e);let n=cl&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){kl(e);let i=cl&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=Q(vd,e.nativeEvent),r=E===`multiple`?[]:null;v.state.setInputValue(``,n),v.state.setSelectedValue(r,n),!t&&!v.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(g&&e.key===`Backspace`&&t.value===``&&g.highlightedChipIndex===void 0&&Array.isArray(M)&&M.length>0){let t=M.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?`keyboard`:`pointer`}),v.state.setSelectedValue(t,Q(sd,e.nativeEvent));return}let i=g?.highlightedChipIndex!==void 0,a=de(e);if(g?.setHighlightedChipIndex(a),a===void 0?i&&v.state.inputRef.current?.focus():g?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=v.state.activeIndex,n=e.nativeEvent;if(t===null){if(I)return;v.state.setOpen(!1,Q(sd,n));return}kl(e);let r=v.state.listRef.current[t];r&&(v.state.selectionEventRef.current=n,r.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},U],stateAttributesMapping:Eh});return(0,n.jsxs)(i.Fragment,{children:[A&&ae&&(0,n.jsx)(zh,{ref:v.state.startDismissRef}),fe]})});process.env.NODE_ENV!==`production`&&(Bh.displayName=`ComboboxInput`);function Vh(e){let t=e.getBoundingClientRect();if(process.env.NODE_ENV!==`production`)return t;let n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var Hh=2,Uh=i.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:o=!1,id:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=Wm(),{labelId:h}=Zm(),g=Sm(),{filteredItems:_}=wm(),v=X(g,$.selectionMode),y=X(g,$.disabled),b=X(g,$.readOnly),x=X(g,$.required),S=X(g,$.mounted),C=X(g,$.popupSide),w=X(g,$.positionerElement),T=X(g,$.listElement),E=X(g,$.triggerProps),D=X(g,$.triggerElement),O=X(g,$.inputInsidePopup),k=X(g,$.id),A=X(g,$.labelId),j=X(g,$.open),M=X(g,$.selectedValue),N=X(g,$.activeIndex),P=X(g,$.selectedIndex),F=X(g,$.hasSelectedValue),I=Cm(),ee=Tm(),te=Oc(),ne=u||y||o,L=_.length===0,re=S&&w?C:null;Qm({id:O?s:void 0});let ie=O?s??k:s,ae=mh(h,A),oe=i.useRef(``);function R(e){oe.current=e.pointerType}let z=I.useState(`domReferenceElement`);i.useEffect(()=>{O&&D&&D!==z&&I.set(`domReferenceElement`,D)},[D,z,I,O]);let{reference:se}=_m(I,{enabled:!j&&!b&&!y&&v===`single`,listRef:g.state.labelsRef,activeIndex:N,selectedIndex:P,onMatch(e){let t=g.state.valuesRef.current[e];t!==void 0&&g.state.setSelectedValue(t,Q(`none`))}}),{reference:B}=Ff(I,{enabled:!b&&!y,event:`mousedown`}),{buttonRef:V,getButtonProps:ce}=Ih({native:a,disabled:ne}),H={...l,open:j,disabled:ne,popupSide:re,listEmpty:L,placeholder:!F};return cf(`button`,e,{ref:[t,V,J(e=>{g.set(`triggerElement`,e)})],state:H,props:[E,B,se,{id:ie,tabIndex:O?0:-1,role:O?`combobox`:void 0,"aria-expanded":j?`true`:`false`,"aria-haspopup":O?`dialog`:`listbox`,"aria-controls":j?T?.id:void 0,"aria-required":O&&x||void 0,"aria-labelledby":ae,onPointerDown:R,onPointerEnter:R,onFocus(){f(!0),!(ne||b)&&te.start(0,g.state.forceMount)},onBlur(e){if(!Z(w,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=v===`none`?ee:M;m.commit(e)}},onMouseDown(e){if(ne||b||(O||I.set(`domReferenceElement`,e.currentTarget),g.state.forceMount(),oe.current!==`touch`&&(g.state.inputRef.current?.focus(),O||e.preventDefault()),j))return;let t=Xu(e.currentTarget);function n(e){if(!D)return;let t=xl(e),n=g.state.positionerElement,r=g.state.listElement;if(Z(D,t)||Z(n,t)||Z(r,t)||t===D)return;let i=Vh(D),a=e.clientX>=i.left-Hh&&e.clientX<=i.right+Hh,o=e.clientY>=i.top-Hh&&e.clientY<=i.bottom+Hh;a&&o||g.state.setOpen(!1,Q(`cancel-open`,e))}O&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){ne||b||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(kl(e),g.state.setOpen(!0,Q(yd,e.nativeEvent)),g.state.inputRef.current?.focus())}},m?m.getValidationProps(c):c,ce],stateAttributesMapping:Eh})});process.env.NODE_ENV!==`production`&&(Uh.displayName=`ComboboxTrigger`);var Wh=i.createContext(null);process.env.NODE_ENV!==`production`&&(Wh.displayName=`GroupCollectionContext`);function Gh(){return i.useContext(Wh)}function Kh(e){let{children:t,items:r}=e,a=i.useMemo(()=>({items:r}),[r]);return(0,n.jsx)(Wh.Provider,{value:a,children:t})}function qh(e){let{children:t}=e,{filteredItems:r}=wm(),a=Gh(),o=a?a.items:r;return o?(0,n.jsx)(i.Fragment,{children:o.map(t)}):null}var Jh=i.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(Jh.displayName=`CompositeListContext`);function Yh(){return i.useContext(Jh)}function Xh(e){let{children:t,elementsRef:r,labelsRef:a,onMapChange:o}=e,s=J(o),c=i.useRef(0),l=ls(Qh).current,u=ls(Zh).current,[d,f]=i.useState(0),p=i.useRef(d),m=J((e,t)=>{u.set(e,t??null),p.current+=1,f(p.current)}),h=J(e=>{u.delete(e),p.current+=1,f(p.current)}),g=i.useMemo(()=>{let e=new Map;return Array.from(u.keys()).filter(e=>e.isConnected).sort($h).forEach((t,n)=>{let r=u.get(t)??{};e.set(t,{...r,index:n})}),e},[u,d]);q(()=>{if(typeof MutationObserver!=`function`||g.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(p.current+=1,f(p.current))});return g.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[g]),q(()=>{p.current===d&&(r.current.length!==g.size&&(r.current.length=g.size),a&&a.current.length!==g.size&&(a.current.length=g.size),c.current=g.size),s(g)},[s,g,r,a,d]),q(()=>()=>{r.current=[]},[r]),q(()=>()=>{a&&(a.current=[])},[a]);let _=J(e=>(l.add(e),()=>{l.delete(e)}));q(()=>{l.forEach(e=>e(g))},[l,g]);let v=i.useMemo(()=>({register:m,unregister:h,subscribeMapChange:_,elementsRef:r,labelsRef:a,nextIndexRef:c}),[m,h,_,r,a,c]);return(0,n.jsx)(Jh.Provider,{value:v,children:t})}function Zh(){return new Map}function Qh(){return new Set}function $h(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var eg=i.forwardRef(function(e,t){var r;let{render:a,className:o,children:s,...c}=e,l=Sm(),u=Cm(),d=!!Ah(!0),{filteredItems:f}=wm(),p=X(l,$.items),m=X(l,$.labelsRef),h=X(l,$.listRef),g=X(l,$.selectionMode),_=X(l,$.grid),v=X(l,$.popupProps),y=X(l,$.disabled),b=X(l,$.readOnly),x=X(l,$.virtualized),S=g===`multiple`,C=f.length===0,w=J(e=>{l.set(`positionerElement`,e)}),T=J(e=>{l.set(`listElement`,e)}),E=i.useMemo(()=>typeof s==`function`?r||=(0,n.jsx)(qh,{children:s}):s,[s]),D={empty:C},O=u.useState(`floatingId`),k=cf(`div`,e,{state:D,ref:[t,T,d?null:w],props:[v,{children:E,tabIndex:-1,id:O,role:_?`grid`:`listbox`,"aria-multiselectable":S?`true`:void 0,onKeyDown(e){if(!(y||b)&&e.key===`Enter`){let t=l.state.activeIndex;if(t==null)return;kl(e);let n=e.nativeEvent,r=l.state.listRef.current[t];r&&(l.state.selectionEventRef.current=n,r.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},c]});return x?k:(0,n.jsx)(Xh,{elementsRef:h,labelsRef:p?void 0:m,children:k})});process.env.NODE_ENV!==`production`&&(eg.displayName=`ComboboxList`);var tg=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(tg.displayName=`ComboboxPortalContext`);function ng(){let e=i.useContext(tg);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?ws(20):`Base UI: <Combobox.Portal> is missing.`);return e}var rg=i.forwardRef(function(e,t){let{keepMounted:r=!1,...i}=e,a=Sm(),o=X(a,$.mounted),s=X(a,$.forceMounted);return o||r||s?(0,n.jsx)(tg.Provider,{value:r,children:(0,n.jsx)(vf,{ref:t,...i})}):null});process.env.NODE_ENV!==`production`&&(rg.displayName=`ComboboxPortal`);function ig(e){return rc(19)?e:e?`true`:void 0}var ag={},og={},sg=``;function cg(e){if(typeof document>`u`)return!1;let t=Xu(e);return Nc(t).innerWidth-t.documentElement.clientWidth>0}function lg(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Xu(e),n=t.documentElement,r=t.body,i=zc(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ug(e){let t=Xu(e),n=t.documentElement,r=t.body,i=zc(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function dg(e){let t=Xu(e),n=t.documentElement,r=t.body,i=Nc(n),a=0,o=0,s=!1,c=wc.create();if(ol&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ag={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},sg=n.style.scrollBehavior,og={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=zc(n)?n:r;if(s=lg(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,ag),Object.assign(r.style,og),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=sg)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var fg=new class{lockCount=0;restore=null;timeoutLock=Dc.create();timeoutUnlock=Dc.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Xu(e).documentElement,n=Nc(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=hc;return}this.restore=sl||!cg(e)?ug(e):dg(e)}};function pg(e=!0,t=null){q(()=>{if(e)return fg.acquire(t)},[e,t])}var mg=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Ul(e,t)||{};if(l==null)return{};let f=su(u),p={x:n,y:r},m=Yl(i),h=ql(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Hl(k,j,A),N=!c.arrow&&Gl(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),hg=(e,t)=>({...mg(e),options:[e,t]}),gg={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Jp().fn(e)).data?.referenceHidden||a}}}},_g={sideX:`left`,sideY:`top`};function vg(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function yg(e,t,n){let{rects:r,placement:i}=e;return{side:vg(t,Wl(i),n),align:Gl(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function bg(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=i.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=J(D),k=D?O:t,A=kc(t),j=Mh()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=o===`center`?M:`${M}-${o}`,P=l,F=r===`bottom`?1:0,I=r===`top`?1:0,ee=r===`right`?1:0,te=r===`left`?1:0;typeof P==`number`?P={top:P+F,right:P+te,bottom:P+I,left:P+ee}:P&&={top:(P.top||0)+F,right:(P.right||0)+te,bottom:(P.bottom||0)+I,left:(P.left||0)+ee};let ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:P},L=i.useRef(null),re=kc(a),ie=kc(s),ae=[Up(e=>{let t=yg(e,r,j),n=typeof re.current==`function`?re.current(t):re.current,i=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof a==`function`?0:a,typeof s==`function`?0:s,j,r])],oe=T===`none`&&w!==`shift`,R=!oe&&(u||_||w===`shift`),z=w===`none`?null:Kp({...ne,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),se=oe?null:Wp(e=>{let t=Xu(e.elements.floating).documentElement;return{...ne,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:R,limiter:u||_?void 0:Gp(e=>{if(!L.current)return{};let{width:t,height:n}=L.current.getBoundingClientRect(),r=Jl(Wl(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[ne,u,_,P,T]);w===`shift`||T===`shift`||o===`center`?ae.push(se,z):ae.push(z,se),ae.push(qp({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),hg(()=>({element:L.current||document.createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:i,rects:o,y:s}=e,c=Wl(i),l=Jl(c),u=L.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(yg(e,r,j)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,R&&l===`y`&&b?S:x),{}}},gg,y),q(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let B=i.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:V,elements:ce,x:H,y:le,middlewareData:U,update:ue,placement:de,context:fe,isPositioned:pe,floatingStyles:me}=om({rootContext:m,placement:N,middleware:ae,strategy:n,whileElementsMounted:p?void 0:(...e)=>kp(...e,B),nodeId:v,externalTree:x}),{sideX:he,sideY:ge}=U.adaptiveOrigin||_g,_e=pe?n:`fixed`,ve=i.useMemo(()=>{let e=y?{position:_e,[he]:H,[ge]:le}:{position:_e,...me};return pe||(e.opacity=0),e},[y,_e,he,H,ge,le,me,pe]),ye=i.useRef(null);q(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(xg(t)?t.current:t)||null;n!==ye.current&&(V.setPositionReference(n),ye.current=n)},[h,V,k,A]),i.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&xg(e)&&e.current!==ye.current&&(V.setPositionReference(e.current),ye.current=e.current)},[h,V,k,A]),i.useEffect(()=>{if(p&&h&&ce.domReference&&ce.floating)return kp(ce.domReference,ce.floating,ue,B)},[p,h,ce,ue,B]);let be=Wl(de),xe=vg(r,be,j),Se=Gl(de)||`center`,Ce=!!U.hide?.referenceHidden;q(()=>{b&&h&&pe&&C(be)},[b,h,pe,be]);let we=i.useMemo(()=>({position:`absolute`,top:U.arrow?.y,left:U.arrow?.x}),[U.arrow]),Te=U.arrow?.centerOffset!==0;return i.useMemo(()=>({positionerStyles:ve,arrowStyles:we,arrowRef:L,arrowUncentered:Te,side:xe,align:Se,physicalSide:be,anchorHidden:Ce,refs:V,context:fe,isPositioned:pe,update:ue}),[ve,we,L,Te,xe,Se,be,Ce,V,fe,pe,ue])}function xg(e){return e!=null&&`current`in e}function Sg(e){return e===`starting`?id:_c}var Cg=i.forwardRef(function(e,t){let{cutout:r,...i}=e,a;if(r){let e=r?.getBoundingClientRect();a=`polygon(
26
- 0% 0%,
27
- 100% 0%,
28
- 100% 100%,
29
- 0% 100%,
30
- 0% 0%,
31
- ${e.left}px ${e.top}px,
32
- ${e.left}px ${e.bottom}px,
33
- ${e.right}px ${e.bottom}px,
34
- ${e.right}px ${e.top}px,
35
- ${e.left}px ${e.top}px
36
- )`}return(0,n.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...i,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:a}})});process.env.NODE_ENV!==`production`&&(Cg.displayName=`InternalBackdrop`);var wg=i.forwardRef(function(e,t){let{render:r,className:a,anchor:o,positionMethod:s=`absolute`,side:c=`bottom`,align:l=`center`,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ad,...v}=e,y=Sm(),{filteredItems:b}=wm(),x=Cm(),S=ng(),C=X(y,$.modal),w=X(y,$.open),T=X(y,$.mounted),E=X(y,$.openMethod),D=X(y,$.triggerElement),O=X(y,$.inputElement),k=X(y,$.inputGroupElement),A=X(y,$.inputInsidePopup),j=X(y,$.transitionStatus),M=b.length===0,N=bg({anchor:o??(A?D:k??O),floatingRootContext:x,positionMethod:s,mounted:T,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g,keepMounted:S,collisionAvoidance:_,lazyFlip:!0});pg(w&&C&&E!==`touch`,D);let P=i.useMemo(()=>{let e={...N.positionerStyles};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!T,style:e}},[w,T,N.positionerStyles]),F={open:w,side:N.side,align:N.align,anchorHidden:N.anchorHidden,empty:M};q(()=>{y.set(`popupSide`,N.side)},[y,N.side]);let I=i.useMemo(()=>({side:N.side,align:N.align,arrowRef:N.arrowRef,arrowUncentered:N.arrowUncentered,arrowStyles:N.arrowStyles,anchorHidden:N.anchorHidden,isPositioned:N.isPositioned}),[N.side,N.align,N.arrowRef,N.arrowUncentered,N.arrowStyles,N.anchorHidden,N.isPositioned]),ee=cf(`div`,e,{state:F,ref:[t,J(e=>{y.set(`positionerElement`,e)})],props:[P,Sg(j),v],stateAttributesMapping:Th});return(0,n.jsxs)(kh.Provider,{value:I,children:[T&&C&&(0,n.jsx)(Cg,{inert:ig(!w),cutout:k??O??D}),ee]})});process.env.NODE_ENV!==`production`&&(wg.displayName=`ComboboxPositioner`);var Tg={...Th,...tm},Eg=i.forwardRef(function(e,t){let{render:r,className:a,initialFocus:o,finalFocus:s,...c}=e,l=Sm(),u=Ah(),d=Cm(),{filteredItems:f}=wm(),p=X(l,$.mounted),m=X(l,$.open),h=X(l,$.openMethod),g=X(l,$.transitionStatus),_=X(l,$.inputInsidePopup),v=X(l,$.inputElement),y=X(l,$.modal),b=f.length===0;rm({open:m,ref:l.state.popupRef,onComplete(){m&&l.state.onOpenChangeComplete(!0)}});let x=cf(`div`,e,{state:{open:m,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:g,empty:b},ref:[t,l.state.popupRef],props:[{role:_?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=xl(e.nativeEvent);h!==`touch`&&(Z(l.state.listElement,t)||t===e.currentTarget)&&l.state.inputRef.current?.focus()}},Sg(g),c],stateAttributesMapping:Tg}),S=o===void 0?_?e=>e===`touch`?l.state.popupRef.current:v:!1:o,C;C=s??(_?void 0:!1);let w=!_||y;return(0,n.jsx)(Pf,{context:d,disabled:!p,modal:w,openInteractionType:h,initialFocus:S,returnFocus:C,getInsideElements:()=>[l.state.startDismissRef.current,l.state.endDismissRef.current],children:(0,n.jsxs)(i.Fragment,{children:[x,w&&(0,n.jsx)(zh,{ref:l.state.endDismissRef})]})})});process.env.NODE_ENV!==`production`&&(Eg.displayName=`ComboboxPopup`);var Dg=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(Dg.displayName=`ComboboxGroupContext`);function Og(){let e=i.useContext(Dg);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?ws(18):`Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.`);return e}var kg=i.forwardRef(function(e,t){let{render:r,className:a,items:o,...s}=e,[c,l]=i.useState(),u=i.useMemo(()=>({labelId:c,setLabelId:l,items:o}),[c,l,o]),d=cf(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":c},s]}),f=(0,n.jsx)(Dg.Provider,{value:u,children:d});return o?(0,n.jsx)(Kh,{items:o,children:f}):f});process.env.NODE_ENV!==`production`&&(kg.displayName=`ComboboxGroup`);var Ag=i.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{setLabelId:o}=Og(),s=Ym(i);return q(()=>(o(s),()=>{o(void 0)}),[s,o]),cf(`div`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(Ag.displayName=`ComboboxGroupLabel`);var jg=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Mg(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,elementsRef:u,labelsRef:d,nextIndexRef:f}=Yh(),p=i.useRef(-1),[m,h]=i.useState(o??(a===jg.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),g=i.useRef(null),_=i.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(u.current[m]=e,d)){let n=t!==void 0;d.current[m]=n?t:r?.current?.textContent??e.textContent}},[m,u,d,t,r]);return q(()=>{if(o!=null)return;let e=g.current;if(e)return s(e,n),()=>{c(e)}},[o,s,c,n]),q(()=>{if(o==null)return l(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[o,l,h]),i.useMemo(()=>({ref:_,index:m}),[m,_])}var Ng=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ng.displayName=`ComboboxItemContext`);function Pg(){let e=i.useContext(Ng);if(!e)throw Error(process.env.NODE_ENV===`production`?ws(19):`Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.`);return e}var Fg=i.createContext(!1);process.env.NODE_ENV!==`production`&&(Fg.displayName=`ComboboxRowContext`);function Ig(){return i.useContext(Fg)}var Lg=i.memo(i.forwardRef(function(e,t){let{render:r,className:a,value:o=null,index:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=i.useRef(!1),f=i.useRef(null),p=Mg({index:s,textRef:f,indexGuessBehavior:jg.GuessFromOrder}),m=Sm(),h=Ig(),{flatFilteredItems:g,hasItems:_}=wm(),v=X(m,$.open),y=X(m,$.selectionMode),b=X(m,$.readOnly),x=X(m,$.virtualized),S=X(m,$.isItemEqualToValue),C=y!==`none`,w=s??(x?km(g,o,S):p.index),T=p.index!==-1,D=X(m,$.id),O=X(m,$.isActive,w),k=X(m,$.isSelected,o),A=X(m,$.getItemProps),j=i.useRef(null),M=D!=null&&T?`${D}-${w}`:void 0,N=k&&C;q(()=>{if(!(T&&(x||s!=null)))return;let e=m.state.listRef.current;return e[w]=j.current,()=>{delete e[w]}},[T,x,w,s,m]),q(()=>{if(!T||_)return;let e=m.state.valuesRef.current;return e[w]=o,y!==`none`&&m.state.allValuesRef.current.push(o),()=>{delete e[w]}},[T,_,w,o,m,y]),q(()=>{if(!v){d.current=!1;return}if(!T||_)return;let e=m.state.selectedValue;Dm(o,Array.isArray(e)?e[e.length-1]:e,S)&&m.set(`selectedIndex`,w)},[T,_,v,m,w,o,S]);let P={disabled:c,selected:N,highlighted:O},F=A({active:O,selected:N});F.id=void 0,F.onFocus=void 0;let{getButtonProps:I,buttonRef:ee}=Ih({disabled:c,focusableWhenDisabled:!0,native:l,composite:!0});function te(e){function t(){m.state.handleSelection(e,o)}m.state.submitOnItemClick?(E.flushSync(t),m.state.requestSubmit()):t()}let ne={id:M,role:h?`gridcell`:`option`,"aria-selected":C?N:void 0,tabIndex:void 0,onPointerDownCapture(e){d.current=!0,e.preventDefault()},onClick(e){c||b||te(e.nativeEvent)},onMouseUp(e){let t=d.current;d.current=!1,!(c||b||e.button!==0||t||!O)&&te(e.nativeEvent)}},L=cf(`div`,e,{ref:[ee,t,p.ref,j],state:P,props:[F,ne,u,I]}),re=i.useMemo(()=>({selected:N,textRef:f}),[N,f]);return(0,n.jsx)(Ng.Provider,{value:re,children:L})}));process.env.NODE_ENV!==`production`&&(Lg.displayName=`ComboboxItem`);var Rg=i.forwardRef(function(e,t){let r=e.keepMounted??!1,{selected:i}=Pg();return r||i?(0,n.jsx)(zg,{...e,ref:t}):null});process.env.NODE_ENV!==`production`&&(Rg.displayName=`ComboboxItemIndicator`);var zg=i.memo(i.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:a,...o}=e,{selected:s}=Pg(),c=i.useRef(null),{transitionStatus:l,setMounted:u}=Zp(s),d=cf(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:tm});return rm({open:s,ref:c,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!==`production`&&(zg.displayName=`Inner`);var Bg=i.forwardRef(function(e,t){let{render:r,className:a,...o}=e,s=Sm(),c=X(s,$.open),l=X(s,$.hasSelectionChips),[u,d]=i.useState(void 0);c&&u!==void 0&&d(void 0);let f=i.useRef([]),p=cf(`div`,e,{ref:[t,s.state.chipsContainerRef],props:[l?{role:`toolbar`}:_c,o]}),m=i.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:d,chipsRef:f}),[u,d,f]);return(0,n.jsx)(Dh.Provider,{value:m,children:(0,n.jsx)(Xh,{elementsRef:f,children:p})})});process.env.NODE_ENV!==`production`&&(Bg.displayName=`ComboboxChips`);var Vg=i.createContext(void 0);process.env.NODE_ENV!==`production`&&(Vg.displayName=`ComboboxChipContext`);function Hg(){let e=i.useContext(Vg);if(!e)throw Error(process.env.NODE_ENV===`production`?ws(17):`useComboboxChipContext must be used within a ComboboxChip`);return e}var Ug=i.forwardRef(function(e,t){let{render:r,className:a,...o}=e,s=Sm(),{setHighlightedChipIndex:c,chipsRef:l}=Oh(),u=X(s,$.disabled),d=X(s,$.readOnly),f=X(s,$.selectedValue),{ref:p,index:m}=Mg();function h(e){let t=m;if(e.key===`ArrowLeft`)e.preventDefault(),t=m>0?m-1:void 0;else if(e.key===`ArrowRight`)e.preventDefault(),t=m<f.length-1?m+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){let n=m>=f.length-1?f.length-2:m;t=n>=0?n:void 0,kl(e),s.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),s.state.setSelectedValue(f.filter((e,t)=>t!==m),Q(sd,e.nativeEvent))}else e.key===`Enter`||e.key===` `?(kl(e),t=void 0):e.key===`ArrowDown`||e.key===`ArrowUp`?(kl(e),s.state.setOpen(!0,Q(yd,e.nativeEvent)),t=void 0):e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(t=void 0);return t}let g=cf(`div`,e,{ref:[t,p],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":d||void 0,onKeyDown(e){if(u||d)return;let t=h(e);E.flushSync(()=>{c(t)}),t===void 0?s.state.inputRef.current?.focus():l.current[t]?.focus()},onMouseDown(e){d||(e.preventDefault(),!u&&s.state.inputRef.current?.focus())}},o]}),_=i.useMemo(()=>({index:m}),[m]);return(0,n.jsx)(Vg.Provider,{value:_,children:g})});process.env.NODE_ENV!==`production`&&(Ug.displayName=`ComboboxChip`);var Wg=i.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,s=Sm(),{index:c}=Hg(),l=X(s,$.disabled),u=X(s,$.readOnly),d=X(s,$.selectedValue),f=X(s,$.isItemEqualToValue),p=l||i,{buttonRef:m,getButtonProps:h}=Ih({native:a,disabled:p||u,focusableWhenDisabled:!0}),g={disabled:p};function _(e){let t=s.state.activeIndex;if(t==null)return;let n=km(s.state.valuesRef.current,e,f);n!==-1&&t===n&&s.state.setIndices({activeIndex:null,type:s.state.keyboardActiveRef.current?`keyboard`:`pointer`})}function v(e){let t=Q(pd,e.nativeEvent),n=d[c];return _(n),s.state.setSelectedValue(d.filter((e,t)=>t!==c),t),s.state.inputRef.current?.focus(),t}return cf(`button`,e,{ref:[t,m],state:g,props:[{tabIndex:-1,onClick(e){p||u||v(e).isPropagationAllowed||e.stopPropagation()},onKeyDown(e){p||u||(e.key===`Enter`||e.key===` `)&&(v(e).isPropagationAllowed||kl(e))}},o,h]})});process.env.NODE_ENV!==`production`&&(Wg.displayName=`ComboboxChipRemove`);var Gg=i.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,{filteredItems:o}=wm(),s=Sm(),c=o.length===0?i:null;return cf(`div`,e,{ref:[t,s.state.emptyRef],props:[{children:c,role:`status`,"aria-live":`polite`,"aria-atomic":!0},a]})});process.env.NODE_ENV!==`production`&&(Gg.displayName=`ComboboxEmpty`);var Kg={...tm,...Ch},qg=i.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,...s}=e,{disabled:c}=Wm(),l=Sm(),u=X(l,$.selectionMode),d=X(l,$.disabled),f=X(l,$.readOnly),p=X(l,$.open),m=X(l,$.selectedValue),h=X(l,$.hasSelectionChips),g=Tm(),_=!1;_=u===`none`?g!==``:u===`single`?m!=null:h;let v=c||d||i,{buttonRef:y,getButtonProps:b}=Ih({native:a,disabled:v}),{mounted:x,transitionStatus:S,setMounted:C}=Zp(_),w={disabled:v,open:p,transitionStatus:S};rm({open:_,ref:l.state.clearRef,onComplete(){_||C(!1)}});let T=cf(`button`,e,{state:w,ref:[t,y,l.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(v||f)return;let t=l.state.keyboardActiveRef;l.state.setInputValue(``,Q(fd,e.nativeEvent)),u===`none`?l.state.setIndices({activeIndex:null,type:t.current?`keyboard`:`pointer`}):(l.state.setSelectedValue(Array.isArray(m)?[]:null,Q(fd,e.nativeEvent)),l.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?`keyboard`:`pointer`})),l.state.inputRef.current?.focus()}},s,b],stateAttributesMapping:Kg});return o||x?T:null});process.env.NODE_ENV!==`production`&&(qg.displayName=`ComboboxClear`);var Jg=i.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return cf(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},a]})});process.env.NODE_ENV!==`production`&&(Jg.displayName=`Separator`);var Yg=dh;function Xg({...e}){return(0,n.jsx)(hh,{"data-slot":`combobox-value`,...e})}function Zg({className:e,children:t,...i}){return(0,n.jsxs)(Uh,{"data-slot":`combobox-trigger`,className:H(`[&_svg:not([class*='size-'])]:size-4`,e),...i,children:[t,(0,n.jsx)(r.ChevronDownIcon,{className:`text-muted-foreground size-4 pointer-events-none`})]})}function Qg({className:e,...t}){return(0,n.jsx)(qg,{"data-slot":`combobox-clear`,render:(0,n.jsx)(Ka,{variant:`ghost`,size:`icon-xs`}),className:H(e),...t,children:(0,n.jsx)(r.XIcon,{className:`pointer-events-none`})})}function $g({className:e,children:t,disabled:r=!1,showTrigger:i=!0,showClear:a=!1,...o}){return(0,n.jsxs)(Ha,{className:H(`w-auto`,e),children:[(0,n.jsx)(Bh,{render:(0,n.jsx)(Ja,{disabled:r}),...o}),(0,n.jsxs)(Wa,{align:`inline-end`,children:[i&&(0,n.jsx)(Ka,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:r,children:(0,n.jsx)(Zg,{})}),a&&(0,n.jsx)(Qg,{disabled:r})]}),t]})}function e_({className:e,side:t=`bottom`,sideOffset:r=6,align:i=`start`,alignOffset:a=0,anchor:o,...s}){return(0,n.jsx)(rg,{children:(0,n.jsx)(wg,{side:t,sideOffset:r,align:i,alignOffset:a,anchor:o,className:`isolate z-50`,children:(0,n.jsx)(Eg,{"data-slot":`combobox-content`,"data-chips":!!o,className:H(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-end-2 data-[side=inline-end]:slide-in-from-start-2 group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)`,e),...s})})})}function t_({className:e,...t}){return(0,n.jsx)(eg,{"data-slot":`combobox-list`,className:H(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 p-1 data-empty:p-0 overflow-y-auto overscroll-contain`,e),...t})}function n_({className:e,children:t,...i}){return(0,n.jsxs)(Lg,{"data-slot":`combobox-item`,className:H(`data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i,children:[t,(0,n.jsx)(Rg,{render:(0,n.jsx)(`span`,{className:`pointer-events-none absolute end-2 flex size-4 items-center justify-center`}),children:(0,n.jsx)(r.CheckIcon,{className:`pointer-events-none`})})]})}function r_({className:e,...t}){return(0,n.jsx)(kg,{"data-slot":`combobox-group`,className:H(e),...t})}function i_({className:e,...t}){return(0,n.jsx)(Ag,{"data-slot":`combobox-label`,className:H(`text-muted-foreground px-2 py-1.5 text-xs`,e),...t})}function a_({...e}){return(0,n.jsx)(qh,{"data-slot":`combobox-collection`,...e})}function o_({className:e,...t}){return(0,n.jsx)(Gg,{"data-slot":`combobox-empty`,className:H(`text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex`,e),...t})}function s_({className:e,...t}){return(0,n.jsx)(Jg,{"data-slot":`combobox-separator`,className:H(`bg-border -mx-1 my-1 h-px`,e),...t})}function c_({className:e,...t}){return(0,n.jsx)(Bg,{"data-slot":`combobox-chips`,className:H(`dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1`,e),...t})}function l_({className:e,children:t,showRemove:i=!0,...a}){return(0,n.jsxs)(Ug,{"data-slot":`combobox-chip`,className:H(`bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pe-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50`,e),...a,children:[t,i&&(0,n.jsx)(Wg,{render:(0,n.jsx)(U,{variant:`ghost`,size:`icon-xs`}),className:`-ms-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:(0,n.jsx)(r.XIcon,{className:`pointer-events-none`})})]})}function u_({className:e,...t}){return(0,n.jsx)(Bh,{"data-slot":`combobox-chip-input`,className:H(`min-w-16 flex-1 outline-none`,e),...t})}function d_(){return i.useRef(null)}function f_({dir:e,direction:t,children:r}){return(0,n.jsx)(D.DirectionProvider,{dir:t??e,children:r})}var p_=D.useDirection;function m_({...e}){return(0,n.jsx)(O.Drawer.Root,{"data-slot":`drawer`,...e})}function h_({...e}){return(0,n.jsx)(O.Drawer.Trigger,{"data-slot":`drawer-trigger`,...e})}function g_({...e}){return(0,n.jsx)(O.Drawer.Portal,{"data-slot":`drawer-portal`,...e})}function __({...e}){return(0,n.jsx)(O.Drawer.Close,{"data-slot":`drawer-close`,...e})}function v_({className:e,...t}){return(0,n.jsx)(O.Drawer.Overlay,{"data-slot":`drawer-overlay`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...t})}function y_({className:e,children:t,...r}){return(0,n.jsxs)(g_,{"data-slot":`drawer-portal`,children:[(0,n.jsx)(v_,{}),(0,n.jsxs)(O.Drawer.Content,{"data-slot":`drawer-content`,className:H(`bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-e-xl data-[vaul-drawer-direction=left]:border-e data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-s-xl data-[vaul-drawer-direction=right]:border-s data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50`,e),...r,children:[(0,n.jsx)(`div`,{className:`bg-muted mt-4 h-1 w-[100px] rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function b_({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`drawer-header`,className:H(`gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-start flex flex-col`,e),...t})}function x_({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`drawer-footer`,className:H(`gap-2 p-4 mt-auto flex flex-col`,e),...t})}function S_({className:e,...t}){return(0,n.jsx)(O.Drawer.Title,{"data-slot":`drawer-title`,className:H(`text-foreground text-base font-medium`,e),...t})}function C_({className:e,...t}){return(0,n.jsx)(O.Drawer.Description,{"data-slot":`drawer-description`,className:H(`text-muted-foreground text-sm`,e),...t})}function w_({className:e,...t}){return(0,n.jsx)(`fieldset`,{"data-slot":`field-set`,className:H(`gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col`,e),...t})}function T_({className:e,variant:t=`legend`,...r}){return(0,n.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:H(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...r})}function E_({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`field-group`,className:H(`gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col`,e),...t})}var D_=ce(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function O_({className:e,orientation:t=`vertical`,...r}){return(0,n.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:H(D_({orientation:t}),e),...r})}function k_({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`field-content`,className:H(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,e),...t})}function A_({className:e,...t}){return(0,n.jsx)(Gt,{"data-slot":`field-label`,className:H(`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function j_({className:e,...t}){return(0,n.jsx)(`div`,{"data-slot":`field-label`,className:H(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,e),...t})}function M_({className:e,...t}){return(0,n.jsx)(`p`,{"data-slot":`field-description`,className:H(`text-muted-foreground text-start text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance`,`last:mt-0 nth-last-2:-mt-1`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function N_({children:e,className:t,...r}){return(0,n.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:H(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,t),...r,children:[(0,n.jsx)(Se,{className:`absolute inset-0 top-1/2`}),e&&(0,n.jsx)(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:e})]})}function P_({className:e,children:t,errors:r,...a}){let o=(0,i.useMemo)(()=>{if(t)return t;if(!r?.length)return null;let e=[...new Map(r.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,n.jsx)(`ul`,{className:`ms-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,n.jsx)(`li`,{children:e.message},t))})},[t,r]);return o?(0,n.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:H(`text-destructive text-sm font-normal`,e),...a,children:o}):null}function F_({className:e,children:t,...r}){return(0,n.jsxs)(k.Root,{"data-slot":`scroll-area`,className:H(`relative`,e),...r,children:[(0,n.jsx)(k.Viewport,{"data-slot":`scroll-area-viewport`,className:`focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,children:t}),(0,n.jsx)(I_,{}),(0,n.jsx)(k.Corner,{})]})}function I_({className:e,orientation:t=`vertical`,...r}){return(0,n.jsx)(k.ScrollAreaScrollbar,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:H(`data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent flex touch-none p-px transition-colors select-none`,e),...r,children:(0,n.jsx)(k.ScrollAreaThumb,{"data-slot":`scroll-area-thumb`,className:`rounded-full bg-border relative flex-1`})})}var L_=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},R_=i.createContext(void 0),z_={setTheme:e=>{},themes:[]},B_=()=>i.useContext(R_)??z_;i.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:o,value:s,themes:c,nonce:l,scriptProps:u})=>{let d=JSON.stringify([n,t,o,e,c,s,r,a]).slice(1,-1);return i.createElement(`script`,{...u,suppressHydrationWarning:!0,nonce:typeof window>`u`?l:``,dangerouslySetInnerHTML:{__html:`(${L_.toString()})(${d})`}})});var V_=({...e})=>{let{theme:t=`system`}=B_();return(0,n.jsx)(A.Toaster,{theme:t,className:`toaster group`,icons:{success:(0,n.jsx)(r.CircleCheckIcon,{className:`size-4`}),info:(0,n.jsx)(r.InfoIcon,{className:`size-4`}),warning:(0,n.jsx)(r.TriangleAlertIcon,{className:`size-4`}),error:(0,n.jsx)(r.OctagonXIcon,{className:`size-4`}),loading:(0,n.jsx)(r.Loader2Icon,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};function H_({className:e,size:t=`default`,...r}){return(0,n.jsx)(j.Root,{"data-slot":`switch`,"data-size":t,className:H(`data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...r,children:(0,n.jsx)(j.Thumb,{"data-slot":`switch-thumb`,className:`bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform`})})}function U_({className:e,orientation:t=`horizontal`,...r}){return(0,n.jsx)(M.Root,{"data-slot":`tabs`,"data-orientation":t,className:H(`gap-2 group/tabs flex data-horizontal:flex-col`,e),...r})}var W_=ce(`rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function G_({className:e,variant:t=`default`,...r}){return(0,n.jsx)(M.List,{"data-slot":`tabs-list`,"data-variant":t,className:H(W_({variant:t}),e),...r})}function K_({className:e,...t}){return(0,n.jsx)(M.Trigger,{"data-slot":`tabs-trigger`,className:H(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-end-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function q_({className:e,...t}){return(0,n.jsx)(M.Content,{"data-slot":`tabs-content`,className:H(`text-sm flex-1 outline-none`,e),...t})}var J_=ce(`hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-muted border bg-transparent`},size:{default:`h-8 min-w-8 px-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]`,lg:`h-9 min-w-9 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function Y_({className:e,variant:t=`default`,size:r=`default`,...i}){return(0,n.jsx)(P.Root,{"data-slot":`toggle`,className:H(J_({variant:t,size:r,className:e})),...i})}var X_=i.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function Z_({className:e,variant:t,size:r,spacing:i=0,orientation:a=`horizontal`,children:o,...s}){return(0,n.jsx)(N.Root,{"data-slot":`toggle-group`,"data-variant":t,"data-size":r,"data-spacing":i,"data-orientation":a,style:{"--gap":i},className:H(`rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-vertical:flex-col data-vertical:items-stretch`,e),...s,children:(0,n.jsx)(X_.Provider,{value:{variant:t,size:r,spacing:i,orientation:a},children:o})})}function Q_({className:e,children:t,variant:r=`default`,size:a=`default`,...o}){let s=i.useContext(X_);return(0,n.jsx)(N.Item,{"data-slot":`toggle-group-item`,"data-variant":s.variant||r,"data-size":s.size||a,"data-spacing":s.spacing,className:H(`group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-s-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-e-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-s-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-s group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,J_({variant:s.variant||r,size:s.size||a}),e),...o,children:t})}function $_(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[a,o]=(0,i.useState)(!1);return{selectedRow:e,isEditDialogOpen:n,isDeleteDialogOpen:a,setIsEditDialogOpen:r,setIsDeleteDialogOpen:o,openEditDialog:e=>{t(e),r(!0)},openDeleteDialog:e=>{t(e),o(!0)}}}function ev(e,t,n){return{addRow:(0,i.useCallback)(r=>{t(t=>({...t,[e]:[...t[e]||[],r]})),n(e)},[e,t,n]),removeRow:(0,i.useCallback)((r,i)=>{t(t=>{let n=(t[e]||[]).filter((e,t)=>t!==r),a=i?n.map((e,t)=>({...e,[i]:t+1})):n;return{...t,[e]:a}}),n(e)},[e,t,n]),updateRow:(0,i.useCallback)((r,i,a)=>{t(t=>{let n=[...t[e]||[]];return n[r]={...n[r],[i]:a},{...t,[e]:n}}),n(i)},[e,t,n])}}function tv(e,t){let[n,r]=(0,i.useState)({}),a=e=>n[e],o=e=>!!n[e];return{errors:n,getError:a,isInvalid:o,validate:(0,i.useCallback)(()=>{let n={},i=!0;return t.forEach(t=>{let r=t.selector(e);for(let a of t.validators){let o=a(r,e);if(o){n[t.field]=o,i=!1;break}}}),r(n),i},[e,t]),clearError:e=>{r(t=>{let n={...t};return delete n[e],n})},errorInputClass:e=>o(e)?`border-red-600 dark:border-red-600 ring-red-600 text-red-600 placeholder:text-red-600`:``}}function nv(e,t){let[n,r]=(0,i.useState)({...e}),[a,o]=(0,i.useState)(e);e!==a&&(r({...e}),o(e));let s=tv(n,t);return{formData:n,handleChange:(0,i.useCallback)(e=>{r(t=>{let n=typeof e==`function`?e(t):e;return Object.keys(n).forEach(e=>{s.clearError(e)}),{...t,...n}})},[s]),...s}}function rv(){let[e,t]=(0,i.useState)(null);return{lightbox:e,openLightbox:(0,i.useCallback)((e,n,r)=>{t({srcLight:e,srcDark:n,alt:r})},[]),closeLightbox:(0,i.useCallback)(()=>t(null),[])}}function iv(e,t){let n=(0,i.useRef)(null),r=async r=>{let i=Array.from(r.target.files||[]);if(i.length===0)return;let a=[`image/jpeg`,`image/png`,`image/gif`,`application/pdf`],o=[],s=[];for(let e of i){if(e.size>2097152){s.push(`الملف "${e.name}" كبير جداً.`);continue}if(!a.includes(e.type)){s.push(`نوع الملف "${e.name}" غير مدعوم.`);continue}o.push(e)}if(s.length>0&&alert(s.join(`
37
- `)),o.length===0)return;let c=o.map(e=>new Promise(t=>{let n=new FileReader;n.onloadend=()=>{let r=n.result;t(new F.StorageFile({url:r,base64File:r.split(`,`)[1],extension:`.${e.name.split(`.`).pop()}`,contentType:e.type,status:F.StorageFileStatus.New}))},n.readAsDataURL(e)})),l=await Promise.all(c);e(e=>{let n=e[t],r;return r=Array.isArray(n)?[...n,...l]:l[0],{...e,[t]:r}}),n.current&&(n.current.value=``)},a=n=>{e(e=>{let r=e[t];if(Array.isArray(r)){let i=[...r],a=i[n];return a.status===F.StorageFileStatus.New?i.splice(n,1):i[n]=new F.StorageFile({...a,status:F.StorageFileStatus.Delete}),{...e,[t]:i}}else{let n=r;return{...e,[t]:n?.status===F.StorageFileStatus.New?void 0:new F.StorageFile({...n,status:F.StorageFileStatus.Delete})}}})},o=e=>e?.url||(e?.base64File?`data:${e.contentType};base64,${e.base64File}`:``);return{fileInputRef:n,handleFileChange:r,handleRemoveFile:a,handleDownload:async(e,t)=>{e.stopPropagation();let n=o(t);if(n)try{let e=await(await fetch(n)).blob(),r=window.URL.createObjectURL(e),i=document.createElement(`a`);i.href=r,i.download=`file_${Date.now()}.${t?.contentType?.split(`/`)[1]||`png`}`,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}catch{window.open(n,`_blank`)}},showFilePreview:e=>!!(e?.url&&e.status!==F.StorageFileStatus.Delete),getFileSrc:o}}var av=(e,t)=>{window.addEventListener(`storage`,n=>{n.key===F.AuthConstants.AuthCheckStorageItemName&&e(t.syncFromStorage())}),window.addEventListener(F.AuthConstants.UnauthorizedEventName,()=>{e(t.logout())})};function ov(e){return(0,I.createSlice)({name:e,initialState:{selectedRow:null,isChangeDialogOpen:!1,isDeleteDialogOpen:!1},reducers:{openChangeDialog:(e,t)=>{e.selectedRow=t.payload,e.isChangeDialogOpen=!0},openDeleteDialog:(e,t)=>{e.selectedRow=t.payload,e.isDeleteDialogOpen=!0},setIsChangeDialogOpen:(e,t)=>{e.isChangeDialogOpen=t.payload,t.payload||(e.selectedRow=null)},setIsDeleteDialogOpen:(e,t)=>{e.isDeleteDialogOpen=t.payload,t.payload||(e.selectedRow=null)}}})}var sv=Symbol.for(`immer-nothing`),cv=Symbol.for(`immer-draftable`),lv=Symbol.for(`immer-state`),uv=process.env.NODE_ENV===`production`?[]:[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},`This object has been frozen and should not be mutated`,function(e){return`Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? `+e},`An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.`,`Immer forbids circular references`,"The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},`Object.defineProperty() cannot be used on an Immer draft`,`Object.setPrototypeOf() cannot be used on an Immer draft`,`Immer only supports deleting array indices`,`Immer only supports setting array indices and the 'length' property`,function(e){return`'original' expects a draft, got: ${e}`}];function dv(e,...t){if(process.env.NODE_ENV!==`production`){let n=uv[e],r=Fv(n)?n.apply(null,t):n;throw Error(`[Immer] ${r}`)}throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fv=Object,pv=fv.getPrototypeOf,mv=`constructor`,hv=`prototype`,gv=`configurable`,_v=`enumerable`,vv=`writable`,yv=`value`,bv=e=>!!e&&!!e[lv];function xv(e){return e?wv(e)||jv(e)||!!e[cv]||!!e[mv]?.[cv]||Mv(e)||Nv(e):!1}var Sv=fv[hv][mv].toString(),Cv=new WeakMap;function wv(e){if(!e||!Pv(e))return!1;let t=pv(e);if(t===null||t===fv[hv])return!0;let n=fv.hasOwnProperty.call(t,mv)&&t[mv];if(n===Object)return!0;if(!Fv(n))return!1;let r=Cv.get(n);return r===void 0&&(r=Function.toString.call(n),Cv.set(n,r)),r===Sv}function Tv(e,t,n=!0){Ev(e)===0?(n?Reflect.ownKeys(e):fv.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ev(e){let t=e[lv];return t?t.type_:jv(e)?1:Mv(e)?2:Nv(e)?3:0}var Dv=(e,t,n=Ev(e))=>n===2?e.has(t):fv[hv].hasOwnProperty.call(e,t),Ov=(e,t,n=Ev(e))=>n===2?e.get(t):e[t],kv=(e,t,n,r=Ev(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Av(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var jv=Array.isArray,Mv=e=>e instanceof Map,Nv=e=>e instanceof Set,Pv=e=>typeof e==`object`,Fv=e=>typeof e==`function`,Iv=e=>typeof e==`boolean`;function Lv(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Rv=e=>e.copy_||e.base_,zv=e=>e.modified_?e.copy_:e.base_;function Bv(e,t){if(Mv(e))return new Map(e);if(Nv(e))return new Set(e);if(jv(e))return Array[hv].slice.call(e);let n=wv(e);if(t===!0||t===`class_only`&&!n){let t=fv.getOwnPropertyDescriptors(e);delete t[lv];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[vv]===!1&&(a[vv]=!0,a[gv]=!0),(a.get||a.set)&&(t[i]={[gv]:!0,[vv]:!0,[_v]:a[_v],[yv]:e[i]})}return fv.create(pv(e),t)}else{let t=pv(e);if(t!==null&&n)return{...e};let r=fv.create(t);return fv.assign(r,e)}}function Vv(e,t=!1){return Wv(e)||bv(e)||!xv(e)?e:(Ev(e)>1&&fv.defineProperties(e,{set:Uv,add:Uv,clear:Uv,delete:Uv}),fv.freeze(e),t&&Tv(e,(e,t)=>{Vv(t,!0)},!1),e)}function Hv(){dv(2)}var Uv={[yv]:Hv};function Wv(e){return e===null||!Pv(e)?!0:fv.isFrozen(e)}var Gv=`MapSet`,Kv=`Patches`,qv=`ArrayMethods`,Jv={};function Yv(e){let t=Jv[e];return t||dv(0,e),t}var Xv=e=>!!Jv[e],Zv,Qv=()=>Zv,$v=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Xv(Gv)?Yv(Gv):void 0,arrayMethodsPlugin_:Xv(qv)?Yv(qv):void 0});function ey(e,t){t&&(e.patchPlugin_=Yv(Kv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ty(e){ny(e),e.drafts_.forEach(iy),e.drafts_=null}function ny(e){e===Zv&&(Zv=e.parent_)}var ry=e=>Zv=$v(Zv,e);function iy(e){let t=e[lv];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ay(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[lv].modified_&&(ty(t),dv(4)),xv(e)&&(e=oy(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[lv].base_,e,t)}else e=oy(t,n);return sy(t,e,!0),ty(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===sv?void 0:e}function oy(e,t){if(Wv(t))return t;let n=t[lv];if(!n)return hy(t,e.handledSet_,e);if(!ly(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);py(n,e)}return n.copy_}function sy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vv(t,n)}function cy(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ly=(e,t)=>e.scope_===t,uy=[];function dy(e,t,n,r){let i=Rv(e),a=e.type_;if(r!==void 0&&Ov(i,r,a)===t){kv(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Tv(i,(e,n)=>{if(bv(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??uy;for(let e of o)kv(i,e,n,a)}function fy(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ly(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=zv(i);dy(e,i.draft_??i,a,n),py(i,r)})}function py(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}cy(e)}}function my(e,t,n){let{scope_:r}=e;if(bv(n)){let i=n[lv];ly(i,r)&&i.callbacks_.push(function(){Cy(e),dy(e,n,zv(i),t)})}else xv(n)&&e.callbacks_.push(function(){let i=Rv(e);e.type_===3?i.has(n)&&hy(n,r.handledSet_,r):Ov(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&hy(Ov(e.copy_,t,e.type_),r.handledSet_,r)})}function hy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||bv(e)||t.has(e)||!xv(e)||Wv(e)?e:(t.add(e),Tv(e,(r,i)=>{if(bv(i)){let t=i[lv];ly(t,n)&&(kv(e,r,zv(t),e.type_),cy(t))}else xv(i)&&hy(i,t,n)}),e)}function gy(e,t){let n=jv(e),r={type_:n?1:0,scope_:t?t.scope_:Qv(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=_y;n&&(i=[r],a=vy);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var _y={get(e,t){if(t===lv)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Rv(e);if(!Dv(i,t,e.type_))return by(e,i,t);let a=i[t];if(e.finalized_||!xv(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Lv(t))return a;if(a===yy(e.base_,t)){Cy(e);let n=e.type_===1?+t:t,r=Ty(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Rv(e)},ownKeys(e){return Reflect.ownKeys(Rv(e))},set(e,t,n){let r=xy(Rv(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=yy(Rv(e),t),i=r?.[lv];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Av(n,r)&&(n!==void 0||Dv(e.base_,t,e.type_)))return!0;Cy(e),Sy(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),my(e,t,n),!0)},deleteProperty(e,t){return Cy(e),yy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Sy(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Rv(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[vv]:!0,[gv]:e.type_!==1||t!==`length`,[_v]:r[_v],[yv]:n[t]}},defineProperty(){dv(11)},getPrototypeOf(e){return pv(e.base_)},setPrototypeOf(){dv(12)}},vy={};for(let e in _y){let t=_y[e];vy[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}vy.deleteProperty=function(e,t){return process.env.NODE_ENV!==`production`&&isNaN(parseInt(t))&&dv(13),vy.set.call(this,e,t,void 0)},vy.set=function(e,t,n){return process.env.NODE_ENV!==`production`&&t!==`length`&&isNaN(parseInt(t))&&dv(14),_y.set.call(this,e[0],t,n,e[0])};function yy(e,t){let n=e[lv];return(n?Rv(n):e)[t]}function by(e,t,n){let r=xy(t,n);return r?yv in r?r[yv]:r.get?.call(e.draft_):void 0}function xy(e,t){if(!(t in e))return;let n=pv(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=pv(n)}}function Sy(e){e.modified_||(e.modified_=!0,e.parent_&&Sy(e.parent_))}function Cy(e){e.copy_||=(e.assigned_=new Map,Bv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wy=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Fv(e)&&!Fv(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Fv(t)||dv(6),n!==void 0&&!Fv(n)&&dv(7);let r;if(xv(e)){let i=ry(this),a=Ty(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ty(i):ny(i)}return ey(i,n),ay(r,i)}else if(!e||!Pv(e)){if(r=t(e),r===void 0&&(r=e),r===sv&&(r=void 0),this.autoFreeze_&&Vv(r,!0),n){let t=[],i=[];Yv(Kv).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else dv(1,e)},this.produceWithPatches=(e,t)=>{if(Fv(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Iv(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Iv(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Iv(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){xv(e)||dv(8),bv(e)&&(e=Ey(e));let t=ry(this),n=Ty(t,e,void 0);return n[lv].isManual_=!0,ny(t),n}finishDraft(e,t){let n=e&&e[lv];(!n||!n.isManual_)&&dv(9);let{scope_:r}=n;return ey(r,t),ay(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Yv(Kv).applyPatches_;return bv(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Ty(e,t,n,r){let[i,a]=Mv(t)?Yv(Gv).proxyMap_(t,n):Nv(t)?Yv(Gv).proxySet_(t,n):gy(t,n);return(n?.scope_??Qv()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?fy(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Ey(e){return bv(e)||dv(10,e),Dy(e)}function Dy(e){if(!xv(e)||Wv(e))return e;let t=e[lv],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Bv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Bv(e,!0);return Tv(n,(e,t)=>{kv(n,e,Dy(t))},r),t&&(t.finalized_=!1),n}new wy().produce;var Oy=e=>e;function ky(e,t,n,r){let i=(0,I.createSlice)({name:e,initialState:{entities:{data:[],count:0},isLoaded:!1,isLoading:!1,currentPage:1,rowsPerPage:100},reducers:{setCurrentPage:(e,t)=>{e.currentPage=t.payload},refresh:(e,t)=>{let{data:n,deletedId:r}=t.payload;if(r)--e.entities.count,e.entities.data=e.entities.data?.filter(e=>e.id!==r);else if(n){let t=e.entities.data?.findIndex(e=>e.id===n.id);t!==void 0&&t!==-1?e.entities.data&&(e.entities.data[t]=Oy(n)):(e.entities.count+=1,e.entities.data=[Oy(n),...e.entities.data??[]])}},...r||{}},extraReducers:e=>{e.addCase(a.pending,e=>{e.isLoading=!0}).addCase(a.fulfilled,(e,t)=>{e.isLoading=!1,e.isLoaded=!0,t.payload&&(e.entities=t.payload)}).addCase(a.rejected,e=>{e.isLoading=!1})}}),a=(0,I.createAsyncThunk)(`${e}/filter`,async(r,{getState:i})=>{let a=i()[e],o;return o=n?await n(a.currentPage,a.rowsPerPage,r):await t.Filter(a.currentPage,a.rowsPerPage,r),o?.data});return{reducer:i.reducer,actions:{...i.actions,filter:a}}}e.Alert=Io,e.AlertAction=zo,e.AlertDescription=Ro,e.AlertDialog=Co,e.AlertDialogAction=No,e.AlertDialogCancel=Po,e.AlertDialogContent=Do,e.AlertDialogDescription=Mo,e.AlertDialogFooter=ko,e.AlertDialogHeader=Oo,e.AlertDialogMedia=Ao,e.AlertDialogOverlay=Eo,e.AlertDialogPortal=To,e.AlertDialogTitle=jo,e.AlertDialogTrigger=wo,e.AlertTitle=Lo,e.Avatar=oo,e.AvatarBadge=lo,e.AvatarFallback=co,e.AvatarGroup=uo,e.AvatarGroupCount=fo,e.AvatarImage=so,e.Badge=Vo,e.BaseInput=Yt,e.Breadcrumb=Ho,e.BreadcrumbEllipsis=Jo,e.BreadcrumbItem=Wo,e.BreadcrumbLink=Go,e.BreadcrumbList=Uo,e.BreadcrumbPage=Ko,e.BreadcrumbSeparator=qo,e.Button=U,e.Calendar=Ft,e.CalendarDayButton=It,e.Card=vn,e.CardAction=Sn,e.CardContent=Cn,e.CardDescription=xn,e.CardFooter=wn,e.CardHeader=yn,e.CardTitle=bn,e.Carousel=Dn,e.CarouselContent=On,e.CarouselItem=kn,e.CarouselNext=jn,e.CarouselPrevious=An,e.ChangeDialog=Ce,e.ChartContainer=Qo,e.ChartLegend=ns,e.ChartLegendContent=rs,e.ChartStyle=$o,e.ChartTooltip=es,e.ChartTooltipContent=ts,e.Checkbox=as,e.Combobox=Yg,e.ComboboxChip=l_,e.ComboboxChips=c_,e.ComboboxChipsInput=u_,e.ComboboxCollection=a_,e.ComboboxContent=e_,e.ComboboxEmpty=o_,e.ComboboxGroup=r_,e.ComboboxInput=$g,e.ComboboxItem=n_,e.ComboboxLabel=i_,e.ComboboxList=t_,e.ComboboxSeparator=s_,e.ComboboxTrigger=Zg,e.ComboboxValue=Xg,e.Command=Xa,e.CommandDialog=Za,e.CommandEmpty=eo,e.CommandGroup=to,e.CommandInput=Qa,e.CommandItem=ro,e.CommandList=$a,e.CommandSeparator=no,e.CommandShortcut=io,e.ContextMenu=cr,e.ContextMenuCheckboxItem=vr,e.ContextMenuContent=mr,e.ContextMenuGroup=ur,e.ContextMenuItem=hr,e.ContextMenuLabel=br,e.ContextMenuPortal=dr,e.ContextMenuRadioGroup=pr,e.ContextMenuRadioItem=yr,e.ContextMenuSeparator=xr,e.ContextMenuShortcut=Sr,e.ContextMenuSub=fr,e.ContextMenuSubContent=_r,e.ContextMenuSubTrigger=gr,e.ContextMenuTrigger=lr,e.CrudEmptyTablePreview=rr,e.CrudPage=Ki,e.CrudTable=sr,e.CrudTableBodyRow=Cr,e.CrudTableCard=wr,e.CrudTableHeader=Tr,e.CrudTableHeaderRows=Er,e.CrudTablePagination=Wi,e.CrudTableRowActionsMenu=Gi,e.DateField=qt,e.DateInput=Wt,e.DateTimeField=Zt,e.DateTimeInput=Xt,e.DeleteDialog=we,e.Dialog=fe,e.DialogClose=he,e.DialogContent=_e,e.DialogDescription=xe,e.DialogFooter=ye,e.DialogHeader=ve,e.DialogOverlay=ge,e.DialogPortal=me,e.DialogTitle=be,e.DialogTrigger=pe,e.DirectionProvider=f_,e.Drawer=m_,e.DrawerClose=__,e.DrawerContent=y_,e.DrawerDescription=C_,e.DrawerFooter=x_,e.DrawerHeader=b_,e.DrawerOverlay=v_,e.DrawerPortal=g_,e.DrawerTitle=S_,e.DrawerTrigger=h_,e.DropdownMenu=Pr,e.DropdownMenuCheckboxItem=Br,e.DropdownMenuContent=Lr,e.DropdownMenuGroup=Rr,e.DropdownMenuItem=zr,e.DropdownMenuLabel=Ur,e.DropdownMenuPortal=Fr,e.DropdownMenuRadioGroup=Vr,e.DropdownMenuRadioItem=Hr,e.DropdownMenuSeparator=Wr,e.DropdownMenuShortcut=Gr,e.DropdownMenuSub=Kr,e.DropdownMenuSubContent=Jr,e.DropdownMenuSubTrigger=qr,e.DropdownMenuTrigger=Ir,e.DynamicListContainer=de,e.Empty=Xn,e.EmptyContent=nr,e.EmptyDescription=tr,e.EmptyHeader=Zn,e.EmptyMedia=$n,e.EmptyTitle=er,e.Field=O_,e.FieldContent=k_,e.FieldDescription=M_,e.FieldError=P_,e.FieldGroup=E_,e.FieldLabel=A_,e.FieldLegend=T_,e.FieldSeparator=N_,e.FieldSet=w_,e.FieldTitle=j_,e.FieldsSection=$t,e.FormField=Kt,e.Input=Jt,e.InputField=en,e.InputGroup=Ha,e.InputGroupAddon=Wa,e.InputGroupButton=Ka,e.InputGroupInput=Ja,e.InputGroupText=qa,e.InputGroupTextarea=Ya,e.Label=Gt,e.Lightbox=Rn,e.Loading=So,e.NumberField=nn,e.NumberInput=tn,e.Pagination=Dr,e.PaginationContent=Or,e.PaginationEllipsis=Nr,e.PaginationItem=kr,e.PaginationLink=Ar,e.PaginationNext=Mr,e.PaginationPrevious=jr,e.PasswordField=rn,e.PhoneField=an,e.Popover=Lt,e.PopoverAnchor=Bt,e.PopoverContent=zt,e.PopoverDescription=Ut,e.PopoverHeader=Vt,e.PopoverTitle=Ht,e.PopoverTrigger=Rt,e.ProtectedRoute=z,e.SaveButton=ue,e.ScrollArea=F_,e.ScrollBar=I_,e.SearchInput=Vn,e.SearchableSelect=ao,e.Select=on,e.SelectContent=un,e.SelectField=_n,e.SelectGroup=sn,e.SelectInput=gn,e.SelectItem=fn,e.SelectLabel=dn,e.SelectScrollDownButton=hn,e.SelectScrollUpButton=mn,e.SelectSeparator=pn,e.SelectTrigger=ln,e.SelectValue=cn,e.Separator=Se,e.Sheet=Zr,e.SheetClose=$r,e.SheetContent=ni,e.SheetDescription=oi,e.SheetFooter=ii,e.SheetHeader=ri,e.SheetTitle=ai,e.SheetTrigger=Qr,e.SideBarCompanyData=po,e.SideBarMainMenu=ho,e.SideBarSecondaryMenu=bo,e.SideBarUserData=xo,e.Sidebar=xi,e.SidebarContent=ki,e.SidebarFooter=Di,e.SidebarGroup=Ai,e.SidebarGroupAction=Mi,e.SidebarGroupContent=Ni,e.SidebarGroupLabel=ji,e.SidebarHeader=Ei,e.SidebarInput=Ti,e.SidebarInset=wi,e.SidebarLogo=mo,e.SidebarMenu=Pi,e.SidebarMenuAction=Ri,e.SidebarMenuBadge=zi,e.SidebarMenuButton=Li,e.SidebarMenuItem=Fi,e.SidebarMenuSkeleton=Bi,e.SidebarMenuSub=Vi,e.SidebarMenuSubButton=Ui,e.SidebarMenuSubItem=Hi,e.SidebarProvider=bi,e.SidebarRail=Ci,e.SidebarSeparator=Oi,e.SidebarTrigger=Si,e.Skeleton=si,e.StorageFileField=Nn,e.Switch=H_,e.Table=Hn,e.TableBody=Wn,e.TableCaption=Yn,e.TableCell=Jn,e.TableFooter=Gn,e.TableHead=qn,e.TableHeader=Un,e.TableRow=Kn,e.Tabs=U_,e.TabsContent=q_,e.TabsList=G_,e.TabsTrigger=K_,e.TextAreaField=In,e.TextAreaInput=Fn,e.TextField=Ln,e.Textarea=Pn,e.ThemeProvider=_o,e.ThemeToggle=yo,e.TitleSeparator=Qt,e.Toaster=V_,e.Toggle=Y_,e.ToggleGroup=Z_,e.ToggleGroupItem=Q_,e.Tooltip=li,e.TooltipContent=di,e.TooltipProvider=ci,e.TooltipTrigger=ui,e.YusrBusBackground=se,e.ZoomableImage=zn,e.badgeVariants=Bo,e.buttonVariants=le,e.cn=H,e.createGenericDialogSlice=ov,e.createGenericEntitySlice=ky,e.isPDF=Mn,e.setupAuthListeners=av,e.tabsListVariants=W_,e.toggleVariants=J_,e.useCarousel=En,e.useComboboxAnchor=d_,e.useDialog=$_,e.useDirection=p_,e.useDynamicList=ev,e.useEntityForm=nv,e.useFormValidation=tv,e.useIsMobile=Xr,e.useLightBox=rv,e.useSidebar=yi,e.useStorageFile=iv,e.useTheme=vo});