@object-ui/components 17.7.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,19 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("clsx"),require("tailwind-merge"),require("@object-ui/react"),require("react"),require("react/jsx-runtime"),require("@object-ui/sdui-parser"),require("@radix-ui/react-accordion"),require("lucide-react"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-aspect-ratio"),require("@radix-ui/react-avatar"),require("react-day-picker"),require("date-fns/locale/en-US"),require("@object-ui/i18n"),require("embla-carousel-react"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-collapsible"),require("cmdk"),require("@radix-ui/react-dialog"),require("@radix-ui/react-context-menu"),require("vaul"),require("@radix-ui/react-dropdown-menu"),require("react-hook-form"),require("@radix-ui/react-label"),require("@radix-ui/react-hover-card"),require("input-otp"),require("@radix-ui/react-menubar"),require("@radix-ui/react-navigation-menu"),require("@radix-ui/react-popover"),require("@radix-ui/react-progress"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-slider"),require("next-themes"),require("sonner"),require("@radix-ui/react-switch"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("lucide-react/dynamic.mjs"),require("react-resizable-panels"),require("date-fns"),require("@objectstack/spec/ui"),require("@object-ui/types")):typeof define==`function`&&define.amd?define(`exports,@object-ui/core,clsx,tailwind-merge,@object-ui/react,react,react/jsx-runtime,@object-ui/sdui-parser,@radix-ui/react-accordion,lucide-react,@radix-ui/react-alert-dialog,@radix-ui/react-slot,class-variance-authority,@radix-ui/react-aspect-ratio,@radix-ui/react-avatar,react-day-picker,date-fns/locale/en-US,@object-ui/i18n,embla-carousel-react,@radix-ui/react-checkbox,@radix-ui/react-collapsible,cmdk,@radix-ui/react-dialog,@radix-ui/react-context-menu,vaul,@radix-ui/react-dropdown-menu,react-hook-form,@radix-ui/react-label,@radix-ui/react-hover-card,input-otp,@radix-ui/react-menubar,@radix-ui/react-navigation-menu,@radix-ui/react-popover,@radix-ui/react-progress,@radix-ui/react-radio-group,@radix-ui/react-scroll-area,@radix-ui/react-select,@radix-ui/react-separator,@radix-ui/react-tooltip,@radix-ui/react-slider,next-themes,sonner,@radix-ui/react-switch,@radix-ui/react-tabs,@radix-ui/react-toggle-group,@radix-ui/react-toggle,lucide-react/dynamic.mjs,react-resizable-panels,date-fns,@objectstack/spec/ui,@object-ui/types`.split(`,`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIComponents={},e.ObjectUICore,e.clsx,e.tailwind_merge,e.ObjectUIReact,e.React,e.react_jsx_runtime,e._object_ui_sdui_parser,e._radix_ui_react_accordion,e.lucide_react,e._radix_ui_react_alert_dialog,e._radix_ui_react_slot,e.class_variance_authority,e._radix_ui_react_aspect_ratio,e._radix_ui_react_avatar,e.react_day_picker,e.date_fns_locale_en_US,e._object_ui_i18n,e.embla_carousel_react,e._radix_ui_react_checkbox,e._radix_ui_react_collapsible,e.cmdk,e._radix_ui_react_dialog,e._radix_ui_react_context_menu,e.vaul,e._radix_ui_react_dropdown_menu,e.react_hook_form,e._radix_ui_react_label,e._radix_ui_react_hover_card,e.input_otp,e._radix_ui_react_menubar,e._radix_ui_react_navigation_menu,e._radix_ui_react_popover,e._radix_ui_react_progress,e._radix_ui_react_radio_group,e._radix_ui_react_scroll_area,e._radix_ui_react_select,e._radix_ui_react_separator,e._radix_ui_react_tooltip,e._radix_ui_react_slider,e.next_themes,e.sonner,e._radix_ui_react_switch,e._radix_ui_react_tabs,e._radix_ui_react_toggle_group,e._radix_ui_react_toggle,e.lucide_react_dynamic_mjs,e.react_resizable_panels,e.date_fns,e._objectstack_spec_ui,e._object_ui_types))})(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,ee,P,F,I,L,R,z,B,te,ne,re,V,ie,H,U,ae,oe){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var se=Object.create,W=Object.defineProperty,G=Object.getOwnPropertyDescriptor,ce=Object.getOwnPropertyNames,le=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty,de=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ce(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ue.call(e,s)&&s!==n&&W(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=G(t,s))||r.enumerable});return e},K=(e,t,n)=>(n=e==null?{}:se(le(e)),de(t||!e||!e.__esModule||!ue.call(e,`default`)?W(n,`default`,{value:e,enumerable:!0}):n,e));a=K(a,1),c=K(c,1),u=K(u,1),p=K(p,1),m=K(m,1),v=K(v,1),y=K(y,1),b=K(b,1),S=K(S,1),C=K(C,1),T=K(T,1),D=K(D,1),O=K(O,1),A=K(A,1),j=K(j,1),M=K(M,1),N=K(N,1),ee=K(ee,1),P=K(P,1),F=K(F,1),I=K(I,1),L=K(L,1),R=K(R,1),te=K(te,1),ne=K(ne,1),re=K(re,1),V=K(V,1);function q(...e){return(0,r.twMerge)((0,n.clsx)(e))}function fe(e){return!e||Array.isArray(e)&&e.length===0}function pe(e,t){return fe(e)?null:t(e)}function J(e){return fe(e)?null:typeof e==`string`||typeof e==`number`?e:Array.isArray(e)?e.length===1?(0,o.jsx)(i.SchemaRenderer,{schema:e[0]}):e.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e.id||t)):(0,o.jsx)(i.SchemaRenderer,{schema:e})}function me(e,t){return pe(t,t=>{let n=J(t);return(0,o.jsx)(e,{asChild:a.default.isValidElement(n),children:n})})}var he=new Set;function ge(e,t){process.env.NODE_ENV!==`production`&&(he.has(e)||(he.add(e),console.warn(t)))}var _e=`[ObjectUI] The "div" component is deprecated on every authoring surface. Please use Shadcn components instead:
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("clsx"),require("tailwind-merge"),require("@object-ui/react"),require("react"),require("react/jsx-runtime"),require("@object-ui/sdui-parser"),require("@radix-ui/react-accordion"),require("lucide-react"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-aspect-ratio"),require("@radix-ui/react-avatar"),require("react-day-picker"),require("date-fns/locale/en-US"),require("@object-ui/i18n"),require("embla-carousel-react"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-collapsible"),require("cmdk"),require("@radix-ui/react-dialog"),require("@radix-ui/react-context-menu"),require("vaul"),require("@radix-ui/react-dropdown-menu"),require("react-hook-form"),require("@radix-ui/react-label"),require("@radix-ui/react-hover-card"),require("input-otp"),require("@radix-ui/react-menubar"),require("@radix-ui/react-navigation-menu"),require("@radix-ui/react-popover"),require("@radix-ui/react-progress"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-slider"),require("next-themes"),require("sonner"),require("@radix-ui/react-switch"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("lucide-react/dynamic.mjs"),require("react-resizable-panels"),require("date-fns"),require("@objectstack/spec/ui"),require("@objectstack/spec/data"),require("@object-ui/types")):typeof define==`function`&&define.amd?define(`exports,@object-ui/core,clsx,tailwind-merge,@object-ui/react,react,react/jsx-runtime,@object-ui/sdui-parser,@radix-ui/react-accordion,lucide-react,@radix-ui/react-alert-dialog,@radix-ui/react-slot,class-variance-authority,@radix-ui/react-aspect-ratio,@radix-ui/react-avatar,react-day-picker,date-fns/locale/en-US,@object-ui/i18n,embla-carousel-react,@radix-ui/react-checkbox,@radix-ui/react-collapsible,cmdk,@radix-ui/react-dialog,@radix-ui/react-context-menu,vaul,@radix-ui/react-dropdown-menu,react-hook-form,@radix-ui/react-label,@radix-ui/react-hover-card,input-otp,@radix-ui/react-menubar,@radix-ui/react-navigation-menu,@radix-ui/react-popover,@radix-ui/react-progress,@radix-ui/react-radio-group,@radix-ui/react-scroll-area,@radix-ui/react-select,@radix-ui/react-separator,@radix-ui/react-tooltip,@radix-ui/react-slider,next-themes,sonner,@radix-ui/react-switch,@radix-ui/react-tabs,@radix-ui/react-toggle-group,@radix-ui/react-toggle,lucide-react/dynamic.mjs,react-resizable-panels,date-fns,@objectstack/spec/ui,@objectstack/spec/data,@object-ui/types`.split(`,`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIComponents={},e.ObjectUICore,e.clsx,e.tailwind_merge,e.ObjectUIReact,e.React,e.react_jsx_runtime,e._object_ui_sdui_parser,e._radix_ui_react_accordion,e.lucide_react,e._radix_ui_react_alert_dialog,e._radix_ui_react_slot,e.class_variance_authority,e._radix_ui_react_aspect_ratio,e._radix_ui_react_avatar,e.react_day_picker,e.date_fns_locale_en_US,e._object_ui_i18n,e.embla_carousel_react,e._radix_ui_react_checkbox,e._radix_ui_react_collapsible,e.cmdk,e._radix_ui_react_dialog,e._radix_ui_react_context_menu,e.vaul,e._radix_ui_react_dropdown_menu,e.react_hook_form,e._radix_ui_react_label,e._radix_ui_react_hover_card,e.input_otp,e._radix_ui_react_menubar,e._radix_ui_react_navigation_menu,e._radix_ui_react_popover,e._radix_ui_react_progress,e._radix_ui_react_radio_group,e._radix_ui_react_scroll_area,e._radix_ui_react_select,e._radix_ui_react_separator,e._radix_ui_react_tooltip,e._radix_ui_react_slider,e.next_themes,e.sonner,e._radix_ui_react_switch,e._radix_ui_react_tabs,e._radix_ui_react_toggle_group,e._radix_ui_react_toggle,e.lucide_react_dynamic_mjs,e.react_resizable_panels,e.date_fns,e._objectstack_spec_ui,e._objectstack_spec_data,e._object_ui_types))})(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,ee,L,R,z,B,te,ne,re,ie,ae,V,H,U,oe,se){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var ce=Object.create,W=Object.defineProperty,G=Object.getOwnPropertyDescriptor,le=Object.getOwnPropertyNames,ue=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,fe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=le(t),a=0,o=i.length,s;a<o;a++)s=i[a],!de.call(e,s)&&s!==n&&W(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=G(t,s))||r.enumerable});return e},K=(e,t,n)=>(n=e==null?{}:ce(ue(e)),fe(t||!e||!e.__esModule||!de.call(e,`default`)?W(n,`default`,{value:e,enumerable:!0}):n,e));a=K(a,1),c=K(c,1),u=K(u,1),p=K(p,1),m=K(m,1),v=K(v,1),y=K(y,1),b=K(b,1),S=K(S,1),C=K(C,1),T=K(T,1),D=K(D,1),O=K(O,1),A=K(A,1),j=K(j,1),M=K(M,1),N=K(N,1),P=K(P,1),F=K(F,1),I=K(I,1),ee=K(ee,1),L=K(L,1),R=K(R,1),te=K(te,1),ne=K(ne,1),re=K(re,1),ie=K(ie,1);function q(...e){return(0,r.twMerge)((0,n.clsx)(e))}function pe(e){return!e||Array.isArray(e)&&e.length===0}function me(e,t){return pe(e)?null:t(e)}function J(e){return pe(e)?null:typeof e==`string`||typeof e==`number`?e:Array.isArray(e)?e.length===1?(0,o.jsx)(i.SchemaRenderer,{schema:e[0]}):e.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e.id||t)):(0,o.jsx)(i.SchemaRenderer,{schema:e})}function he(e,t){return me(t,t=>{let n=J(t);return(0,o.jsx)(e,{asChild:a.default.isValidElement(n),children:n})})}var ge=new Set;function _e(e,t){process.env.NODE_ENV!==`production`&&(ge.has(e)||(ge.add(e),console.warn(t)))}var ve=`[ObjectUI] The "div" component is deprecated on every authoring surface. Please use Shadcn components instead:
2
2
  - For a plain wrapper the drop-in swap is "box": same element, your \`className\` verbatim, no layout of its own.
3
3
  - Reach for "card", "flex", "container", "stack", or "grid" only when you want their layout — each injects classes of its own, and "card" also moves children into an extra element.
4
4
  - Move any \`body\` content into \`children\` first: \`body\` is the child-list spelling objectui#6771 retired, so validation refuses it by name, and neither this component nor any replacement above draws it.
5
5
  This applies to JSON-authored nodes and to kind:'html' pages alike: an html page refuses the
6
6
  tag when it compiles, naming the same replacement.
7
- See documentation at https://www.objectui.org/docs/components for alternatives.`,ve=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{ge(`div`,_e);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`div`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:J(e.children)})});t.ComponentRegistry.register(`div`,ve,{namespace:`ui`,label:`Container (Deprecated)`,deprecated:{surfaces:[`json`,`html`],replacement:'author "box" for a plain wrapper — the one drop-in swap; reach for "card", "flex", "container", "stack" or "grid" only when you want their layout, and move `body` content into `children` first'},inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{className:`p-2 sm:p-4 border border-dashed border-gray-300 rounded min-h-[100px]`}});var ye={h1:`text-4xl font-semibold tracking-tight`,h2:`text-3xl font-semibold tracking-tight`,h3:`text-2xl font-semibold tracking-tight`,h4:`text-xl font-semibold tracking-tight`,h5:`text-lg font-semibold tracking-tight`,h6:`text-base font-semibold tracking-tight`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`,overline:`text-xs font-medium uppercase tracking-widest text-muted-foreground`},be={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,body:`span`,caption:`span`,overline:`span`},xe={left:`block text-left`,center:`block text-center`,right:`block text-right`,justify:`block text-justify`};t.ComponentRegistry.register(`text`,({schema:e,...n})=>{let{style:r,...i}=n,a=i[`data-obj-id`],s=q(e.variant?ye[e.variant]:void 0,e.align?xe[e.align]:void 0,e.className||i.className)||void 0;if(a||s){let n=e.variant&&be[e.variant]||`span`;return(0,o.jsx)(n,{...(0,t.toDomProps)(i),style:r,className:s,children:e.content})}return(0,o.jsx)(o.Fragment,{children:e.content})},{namespace:`ui`,label:`Text`,inputs:[{name:`content`,type:`string`,required:!0},{name:`variant`,type:`enum`,enum:[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`body`,`caption`,`overline`]},{name:`align`,type:`enum`,enum:[`left`,`center`,`right`,`justify`]}],defaultProps:{content:`Text content`}});var Se=new Set;function Ce(e,t){process.env.NODE_ENV!==`production`&&(Se.has(e)||(Se.add(e),console.warn(t)))}var we=`[ObjectUI] The "span" component is deprecated for JSON-authored pages. Please use Shadcn components instead:
7
+ See documentation at https://www.objectui.org/docs/components for alternatives.`,ye=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{_e(`div`,ve);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`div`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:J(e.children)})});t.ComponentRegistry.register(`div`,ye,{namespace:`ui`,label:`Container (Deprecated)`,deprecated:{surfaces:[`json`,`html`],replacement:'author "box" for a plain wrapper — the one drop-in swap; reach for "card", "flex", "container", "stack" or "grid" only when you want their layout, and move `body` content into `children` first'},inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{className:`p-2 sm:p-4 border border-dashed border-gray-300 rounded min-h-[100px]`}});var be={h1:`text-4xl font-semibold tracking-tight`,h2:`text-3xl font-semibold tracking-tight`,h3:`text-2xl font-semibold tracking-tight`,h4:`text-xl font-semibold tracking-tight`,h5:`text-lg font-semibold tracking-tight`,h6:`text-base font-semibold tracking-tight`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`,overline:`text-xs font-medium uppercase tracking-widest text-muted-foreground`},xe={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,body:`span`,caption:`span`,overline:`span`},Se={left:`block text-left`,center:`block text-center`,right:`block text-right`,justify:`block text-justify`};t.ComponentRegistry.register(`text`,({schema:e,...n})=>{let{style:r,...i}=n,a=i[`data-obj-id`],s=q(e.variant?be[e.variant]:void 0,e.align?Se[e.align]:void 0,e.className||i.className)||void 0;if(a||s){let n=e.variant&&xe[e.variant]||`span`;return(0,o.jsx)(n,{...(0,t.toDomProps)(i),style:r,className:s,children:e.content})}return(0,o.jsx)(o.Fragment,{children:e.content})},{namespace:`ui`,label:`Text`,inputs:[{name:`content`,type:`string`,required:!0},{name:`variant`,type:`enum`,enum:[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`body`,`caption`,`overline`]},{name:`align`,type:`enum`,enum:[`left`,`center`,`right`,`justify`]}],defaultProps:{content:`Text content`}});var Ce=new Set;function we(e,t){process.env.NODE_ENV!==`production`&&(Ce.has(e)||(Ce.add(e),console.warn(t)))}var Te=`[ObjectUI] The "span" component is deprecated for JSON-authored pages. Please use Shadcn components instead:
8
8
  - For badges/labels: use "badge" component
9
9
  - For inline text emphasis: use "text" component with appropriate className
10
10
  This applies to JSON-authored nodes. In a kind:'html' page the tag is part of that tier's own
11
11
  vocabulary, is compiled straight through, and is not reported here.
12
- See documentation at https://www.objectui.org/docs/components for alternatives.`,Te=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{(0,s.isHtmlTierNode)(e)||Ce(`span`,we);let{"data-obj-id":i,"data-obj-type":a,style:c,...l}=n;return(0,o.jsx)(`span`,{ref:r,className:t,...l,"data-obj-id":i,"data-obj-type":a,style:c,children:J(e.children)||e.value})});t.ComponentRegistry.register(`span`,Te,{namespace:`ui`,label:`Inline Container (Deprecated)`,deprecated:{surfaces:[`json`],replacement:`use "badge" for labels, or "text" with a className for inline emphasis`},inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Inline content, rendered ahead of `value`"}],defaultProps:{className:`px-1.5 py-0.5 sm:px-2 sm:py-1`}});var Ee=c.Root,Y=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(c.Item,{ref:n,className:q(`border-b`,e),...t}));Y.displayName=`AccordionItem`;var De=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(c.Header,{className:`flex`,children:(0,o.jsxs)(c.Trigger,{ref:r,className:q(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));De.displayName=c.Trigger.displayName;var Oe=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(c.Content,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,o.jsx)(`div`,{className:q(`pb-4 pt-0`,e),children:t})}));Oe.displayName=c.Content.displayName;var ke=(0,f.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),X=a.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,o.jsx)(r?d.Slot:`button`,{className:q(ke({variant:t,size:n,className:e})),ref:a,...i}));X.displayName=`Button`;var Ae=u.Root,je=u.Trigger,Me=u.Portal,Ne=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Overlay,{className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Ne.displayName=u.Overlay.displayName;var Pe=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(Me,{children:[(0,o.jsx)(Ne,{}),(0,o.jsx)(u.Content,{ref:n,className:q(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));Pe.displayName=u.Content.displayName;var Fe=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Fe.displayName=`AlertDialogHeader`;var Ie=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Ie.displayName=`AlertDialogFooter`;var Le=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Title,{ref:n,className:q(`text-lg font-semibold`,e),...t}));Le.displayName=u.Title.displayName;var Z=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));Z.displayName=u.Description.displayName;var Re=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Action,{ref:n,className:q(ke(),e),...t}));Re.displayName=u.Action.displayName;var ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Cancel,{ref:n,className:q(ke({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));ze.displayName=u.Cancel.displayName;var Be=(0,f.cva)(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),Ve=a.forwardRef(({className:e,variant:t,...n},r)=>(0,o.jsx)(`div`,{ref:r,role:`alert`,className:q(Be({variant:t}),e),...n}));Ve.displayName=`Alert`;var He=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h5`,{ref:n,className:q(`mb-1 font-medium leading-none tracking-tight`,e),...t}));He.displayName=`AlertTitle`;var Ue=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-sm [&_p]:leading-relaxed`,e),...t}));Ue.displayName=`AlertDescription`;var We=p.Root,Ge=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Root,{ref:n,className:q(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));Ge.displayName=m.Root.displayName;var Ke=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Image,{ref:n,className:q(`aspect-square h-full w-full`,e),...t}));Ke.displayName=m.Image.displayName;var qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Fallback,{ref:n,className:q(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));qe.displayName=m.Fallback.displayName;var Je=(0,f.cva)(`inline-flex items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ye({className:e,variant:t,...n}){return(0,o.jsx)(`div`,{className:q(Je({variant:t}),e),...n})}var Xe=a.forwardRef(({...e},t)=>(0,o.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));Xe.displayName=`Breadcrumb`;var Ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ol`,{ref:n,className:q(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));Ze.displayName=`BreadcrumbList`;var Qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:q(`inline-flex items-center gap-1.5`,e),...t}));Qe.displayName=`BreadcrumbItem`;var $e=a.forwardRef(({asChild:e,className:t,...n},r)=>(0,o.jsx)(e?d.Slot:`a`,{ref:r,className:q(`transition-colors hover:text-foreground`,t),...n}));$e.displayName=`BreadcrumbLink`;var et=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:q(`font-normal text-foreground`,e),...t}));et.displayName=`BreadcrumbPage`;var tt=({children:e,className:t,...n})=>(0,o.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:q(`[&>svg]:w-3.5 [&>svg]:h-3.5`,t),...n,children:e??(0,o.jsx)(l.ChevronRight,{})});tt.displayName=`BreadcrumbSeparator`;var nt=({className:e,...t})=>(0,o.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:q(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More`})]});nt.displayName=`BreadcrumbElipssis`;var rt=`en-US`,it=Object.freeze({af:()=>import(`date-fns/locale/af`).then(e=>e.af),ar:()=>import(`date-fns/locale/ar`).then(e=>e.ar),"ar-DZ":()=>import(`date-fns/locale/ar-DZ`).then(e=>e.arDZ),"ar-EG":()=>import(`date-fns/locale/ar-EG`).then(e=>e.arEG),"ar-MA":()=>import(`date-fns/locale/ar-MA`).then(e=>e.arMA),"ar-SA":()=>import(`date-fns/locale/ar-SA`).then(e=>e.arSA),"ar-TN":()=>import(`date-fns/locale/ar-TN`).then(e=>e.arTN),az:()=>import(`date-fns/locale/az`).then(e=>e.az),be:()=>import(`date-fns/locale/be`).then(e=>e.be),"be-tarask":()=>import(`date-fns/locale/be-tarask`).then(e=>e.beTarask),bg:()=>import(`date-fns/locale/bg`).then(e=>e.bg),bn:()=>import(`date-fns/locale/bn`).then(e=>e.bn),bs:()=>import(`date-fns/locale/bs`).then(e=>e.bs),ca:()=>import(`date-fns/locale/ca`).then(e=>e.ca),ckb:()=>import(`date-fns/locale/ckb`).then(e=>e.ckb),cs:()=>import(`date-fns/locale/cs`).then(e=>e.cs),cy:()=>import(`date-fns/locale/cy`).then(e=>e.cy),da:()=>import(`date-fns/locale/da`).then(e=>e.da),de:()=>import(`date-fns/locale/de`).then(e=>e.de),"de-AT":()=>import(`date-fns/locale/de-AT`).then(e=>e.deAT),el:()=>import(`date-fns/locale/el`).then(e=>e.el),"en-AU":()=>import(`date-fns/locale/en-AU`).then(e=>e.enAU),"en-CA":()=>import(`date-fns/locale/en-CA`).then(e=>e.enCA),"en-GB":()=>import(`date-fns/locale/en-GB`).then(e=>e.enGB),"en-IE":()=>import(`date-fns/locale/en-IE`).then(e=>e.enIE),"en-IN":()=>import(`date-fns/locale/en-IN`).then(e=>e.enIN),"en-NZ":()=>import(`date-fns/locale/en-NZ`).then(e=>e.enNZ),"en-ZA":()=>import(`date-fns/locale/en-ZA`).then(e=>e.enZA),eo:()=>import(`date-fns/locale/eo`).then(e=>e.eo),es:()=>import(`date-fns/locale/es`).then(e=>e.es),et:()=>import(`date-fns/locale/et`).then(e=>e.et),eu:()=>import(`date-fns/locale/eu`).then(e=>e.eu),"fa-IR":()=>import(`date-fns/locale/fa-IR`).then(e=>e.faIR),fi:()=>import(`date-fns/locale/fi`).then(e=>e.fi),fr:()=>import(`date-fns/locale/fr`).then(e=>e.fr),"fr-CA":()=>import(`date-fns/locale/fr-CA`).then(e=>e.frCA),"fr-CH":()=>import(`date-fns/locale/fr-CH`).then(e=>e.frCH),fy:()=>import(`date-fns/locale/fy`).then(e=>e.fy),gd:()=>import(`date-fns/locale/gd`).then(e=>e.gd),gl:()=>import(`date-fns/locale/gl`).then(e=>e.gl),gu:()=>import(`date-fns/locale/gu`).then(e=>e.gu),he:()=>import(`date-fns/locale/he`).then(e=>e.he),hi:()=>import(`date-fns/locale/hi`).then(e=>e.hi),hr:()=>import(`date-fns/locale/hr`).then(e=>e.hr),ht:()=>import(`date-fns/locale/ht`).then(e=>e.ht),hu:()=>import(`date-fns/locale/hu`).then(e=>e.hu),hy:()=>import(`date-fns/locale/hy`).then(e=>e.hy),id:()=>import(`date-fns/locale/id`).then(e=>e.id),is:()=>import(`date-fns/locale/is`).then(e=>e.is),it:()=>import(`date-fns/locale/it`).then(e=>e.it),"it-CH":()=>import(`date-fns/locale/it-CH`).then(e=>e.itCH),ja:()=>import(`date-fns/locale/ja`).then(e=>e.ja),"ja-Hira":()=>import(`date-fns/locale/ja-Hira`).then(e=>e.jaHira),ka:()=>import(`date-fns/locale/ka`).then(e=>e.ka),kk:()=>import(`date-fns/locale/kk`).then(e=>e.kk),km:()=>import(`date-fns/locale/km`).then(e=>e.km),kn:()=>import(`date-fns/locale/kn`).then(e=>e.kn),ko:()=>import(`date-fns/locale/ko`).then(e=>e.ko),lb:()=>import(`date-fns/locale/lb`).then(e=>e.lb),lt:()=>import(`date-fns/locale/lt`).then(e=>e.lt),lv:()=>import(`date-fns/locale/lv`).then(e=>e.lv),mk:()=>import(`date-fns/locale/mk`).then(e=>e.mk),mn:()=>import(`date-fns/locale/mn`).then(e=>e.mn),ms:()=>import(`date-fns/locale/ms`).then(e=>e.ms),mt:()=>import(`date-fns/locale/mt`).then(e=>e.mt),nb:()=>import(`date-fns/locale/nb`).then(e=>e.nb),nl:()=>import(`date-fns/locale/nl`).then(e=>e.nl),"nl-BE":()=>import(`date-fns/locale/nl-BE`).then(e=>e.nlBE),nn:()=>import(`date-fns/locale/nn`).then(e=>e.nn),oc:()=>import(`date-fns/locale/oc`).then(e=>e.oc),pl:()=>import(`date-fns/locale/pl`).then(e=>e.pl),pt:()=>import(`date-fns/locale/pt`).then(e=>e.pt),"pt-BR":()=>import(`date-fns/locale/pt-BR`).then(e=>e.ptBR),ro:()=>import(`date-fns/locale/ro`).then(e=>e.ro),ru:()=>import(`date-fns/locale/ru`).then(e=>e.ru),se:()=>import(`date-fns/locale/se`).then(e=>e.se),sk:()=>import(`date-fns/locale/sk`).then(e=>e.sk),sl:()=>import(`date-fns/locale/sl`).then(e=>e.sl),sq:()=>import(`date-fns/locale/sq`).then(e=>e.sq),sr:()=>import(`date-fns/locale/sr`).then(e=>e.sr),"sr-Latn":()=>import(`date-fns/locale/sr-Latn`).then(e=>e.srLatn),sv:()=>import(`date-fns/locale/sv`).then(e=>e.sv),ta:()=>import(`date-fns/locale/ta`).then(e=>e.ta),te:()=>import(`date-fns/locale/te`).then(e=>e.te),th:()=>import(`date-fns/locale/th`).then(e=>e.th),tr:()=>import(`date-fns/locale/tr`).then(e=>e.tr),ug:()=>import(`date-fns/locale/ug`).then(e=>e.ug),uk:()=>import(`date-fns/locale/uk`).then(e=>e.uk),uz:()=>import(`date-fns/locale/uz`).then(e=>e.uz),"uz-Cyrl":()=>import(`date-fns/locale/uz-Cyrl`).then(e=>e.uzCyrl),vi:()=>import(`date-fns/locale/vi`).then(e=>e.vi),"zh-CN":()=>import(`date-fns/locale/zh-CN`).then(e=>e.zhCN),"zh-HK":()=>import(`date-fns/locale/zh-HK`).then(e=>e.zhHK),"zh-TW":()=>import(`date-fns/locale/zh-TW`).then(e=>e.zhTW)});Object.freeze([rt,...Object.keys(it)]);var at=new Map([[rt,g.enUS]]),ot=new Map,st=new Map;function ct(e){return e===rt||Object.prototype.hasOwnProperty.call(it,e)}function lt(e){let t=st.get(e);if(t!==void 0)return t;let n=rt;try{let t=new Intl.Locale(e),{language:r,script:i,region:a}=t.maximize();n=[t.baseName,a?`${r}-${a}`:void 0,i?`${r}-${i}`:void 0,r].find(e=>!!e&&ct(e))??rt}catch{}return st.set(e,n),n}function ut(e){let t=at.get(e);if(t)return Promise.resolve(t);let n=ot.get(e);if(n)return n;let r=Object.prototype.hasOwnProperty.call(it,e)?it[e]:void 0;if(!r)return Promise.resolve(g.enUS);let i=r().then(t=>(at.set(e,t),t)).finally(()=>{ot.delete(e)});return ot.set(e,i),i}function dt(e){let t=(0,_.useDisplayLocale)(),n=lt(e??t),[,r]=a.useReducer(e=>e+1,0),i=at.get(n);return a.useEffect(()=>{if(at.has(n))return;let e=!0;return ut(n).then(()=>{e&&r()},()=>{}),()=>{e=!1}},[n]),i??g.enUS}function ft({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,formatters:a,components:s,localeTag:c,...u}){let d=(0,h.getDefaultClassNames)(),f=dt(c);return(0,o.jsx)(h.DayPicker,{locale:f,showOutsideDays:n,className:q(`bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[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:r,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...a},classNames:{root:q(`w-fit`,d.root),months:q(`relative flex flex-col gap-4 md:flex-row`,d.months),month:q(`flex w-full flex-col gap-4`,d.month),nav:q(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,d.nav),button_previous:q(ke({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,d.button_previous),button_next:q(ke({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,d.button_next),month_caption:q(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,d.month_caption),dropdowns:q(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,d.dropdowns),dropdown_root:q(`has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border`,d.dropdown_root),dropdown:q(`bg-popover absolute inset-0 opacity-0`,d.dropdown),caption_label:q(`select-none font-medium`,r===`label`?`text-sm`:`[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`,d.caption_label),weekdays:q(`flex`,d.weekdays),weekday:q(`text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal`,d.weekday),week:q(`mt-2 flex w-full`,d.week),week_number_header:q(`w-(--cell-size) select-none`,d.week_number_header),week_number:q(`text-muted-foreground select-none text-[0.8rem]`,d.week_number),day:q(`group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md`,d.day),range_start:q(`bg-accent rounded-l-md`,d.range_start),range_middle:q(`rounded-none`,d.range_middle),range_end:q(`bg-accent rounded-r-md`,d.range_end),today:q(`bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none`,d.today),outside:q(`text-muted-foreground aria-selected:text-muted-foreground`,d.outside),disabled:q(`text-muted-foreground opacity-50`,d.disabled),hidden:q(`invisible`,d.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,o.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:q(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,o.jsx)(l.ChevronLeftIcon,{className:q(`size-4`,e),...n}):t===`right`?(0,o.jsx)(l.ChevronRightIcon,{className:q(`size-4`,e),...n}):(0,o.jsx)(l.ChevronDownIcon,{className:q(`size-4`,e),...n}),DayButton:pt,WeekNumber:({children:e,...t})=>(0,o.jsx)(`td`,{...t,children:(0,o.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...u})}function pt({className:e,day:t,modifiers:n,...r}){let i=(0,h.getDefaultClassNames)(),s=a.useRef(null);return a.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),(0,o.jsx)(X,{ref:s,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:q(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-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 flex aspect-square h-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70`,i.day,e),...r})}var mt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));mt.displayName=`Card`;var ht=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex flex-col space-y-1.5 p-6`,e),...t}));ht.displayName=`CardHeader`;var gt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));gt.displayName=`CardTitle`;var _t=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));_t.displayName=`CardDescription`;var vt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`p-6 pt-0`,e),...t}));vt.displayName=`CardContent`;var yt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex items-center p-6 pt-0`,e),...t}));yt.displayName=`CardFooter`;var bt=a.createContext(null);function xt(){let e=a.useContext(bt);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}var St=a.forwardRef(({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:s,...c},l)=>{let[u,d]=(0,v.default)({...t,axis:e===`horizontal`?`x`:`y`},r),[f,p]=a.useState(!1),[m,h]=a.useState(!1),g=a.useCallback(e=>{e&&(p(e.canScrollPrev()),h(e.canScrollNext()))},[]),_=a.useCallback(()=>{d?.scrollPrev()},[d]),y=a.useCallback(()=>{d?.scrollNext()},[d]),b=a.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),_()):e.key===`ArrowRight`&&(e.preventDefault(),y())},[_,y]);return a.useEffect(()=>{d&&n&&n(d)},[d,n]),a.useEffect(()=>{if(d)return g(d),d.on(`reInit`,g),d.on(`select`,g),()=>{d?.off(`select`,g)}},[d,g]),(0,o.jsx)(bt.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:_,scrollNext:y,canScrollPrev:f,canScrollNext:m},children:(0,o.jsx)(`div`,{ref:l,onKeyDownCapture:b,className:q(`relative`,i),role:`region`,"aria-roledescription":`carousel`,...c,children:s})})});St.displayName=`Carousel`;var Ct=a.forwardRef(({className:e,...t},n)=>{let{carouselRef:r,orientation:i}=xt();return(0,o.jsx)(`div`,{ref:r,className:`overflow-hidden`,children:(0,o.jsx)(`div`,{ref:n,className:q(`flex`,i===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})});Ct.displayName=`CarouselContent`;var wt=a.forwardRef(({className:e,...t},n)=>{let{orientation:r}=xt();return(0,o.jsx)(`div`,{ref:n,role:`group`,"aria-roledescription":`slide`,className:q(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,e),...t})});wt.displayName=`CarouselItem`;var Tt=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollPrev:s,canScrollPrev:c}=xt();return(0,o.jsxs)(X,{ref:i,variant:t,size:n,className:q(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-left-12 top-1/2 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...r,children:[(0,o.jsx)(l.ArrowLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})});Tt.displayName=`CarouselPrevious`;var Et=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollNext:s,canScrollNext:c}=xt();return(0,o.jsxs)(X,{ref:i,variant:t,size:n,className:q(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-right-12 top-1/2 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...r,children:[(0,o.jsx)(l.ArrowRight,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})});Et.displayName=`CarouselNext`;var Dt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Root,{ref:n,className:q(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,o.jsx)(y.Indicator,{className:q(`grid place-content-center text-current`),children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}));Dt.displayName=y.Root.displayName;var Ot=b.Root,kt=b.CollapsibleTrigger,At=b.CollapsibleContent,jt=(0,_.createSafeTranslation)({"common.close":`Close`},`common.close`);function Mt(){let{t:e}=jt();return(0,o.jsx)(`span`,{className:`sr-only`,children:e(`common.close`)})}var Nt=S.Root,Pt=S.Trigger,Ft=S.Portal,It=S.Close,Lt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Overlay,{ref:n,className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Lt.displayName=S.Overlay.displayName;var Rt=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(Ft,{children:[(0,o.jsx)(Lt,{}),(0,o.jsxs)(S.Content,{ref:r,className:q(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,o.jsxs)(S.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(Mt,{})]})]})]}));Rt.displayName=S.Content.displayName;var zt=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});zt.displayName=`DialogHeader`;var Bt=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Bt.displayName=`DialogFooter`;var Vt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Title,{ref:n,className:q(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Vt.displayName=S.Title.displayName;var Ht=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));Ht.displayName=S.Description.displayName;var Ut=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command,{ref:n,className:q(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Ut.displayName=x.Command.displayName;var Wt=({children:e,contentProps:t,title:n=`Command Palette`,description:r,...i})=>{let{className:a,...s}=t??{};return(0,o.jsx)(Nt,{...i,children:(0,o.jsxs)(Rt,{className:q(`overflow-hidden p-0 shadow-lg`,a),...s,children:[(0,o.jsx)(Vt,{className:`sr-only`,children:n}),r?(0,o.jsx)(Ht,{className:`sr-only`,children:r}):null,(0,o.jsx)(Ut,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:e})]})})},Gt=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,o.jsx)(l.Search,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,o.jsx)(x.Command.Input,{ref:n,className:q(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Gt.displayName=x.Command.Input.displayName;var Kt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.List,{ref:n,className:q(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Kt.displayName=x.Command.List.displayName;var qt=a.forwardRef((e,t)=>(0,o.jsx)(x.Command.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));qt.displayName=x.Command.Empty.displayName;var Jt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Group,{ref:n,className:q(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Jt.displayName=x.Command.Group.displayName;var Yt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Separator,{ref:n,className:q(`-mx-1 h-px bg-border`,e),...t}));Yt.displayName=x.Command.Separator.displayName;var Xt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Item,{ref:n,className:q(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...t}));Xt.displayName=x.Command.Item.displayName;var Zt=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});Zt.displayName=`CommandShortcut`;var Qt=C.Root,$t=C.Trigger,en=C.Group,tn=C.Portal,nn=C.Sub,rn=C.RadioGroup,an=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(C.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto h-4 w-4`})]}));an.displayName=C.SubTrigger.displayName;var on=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-context-menu-content-transform-origin)`,e),...t}));on.displayName=C.SubContent.displayName;var sn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Portal,{children:(0,o.jsx)(C.Content,{ref:n,className:q(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-context-menu-content-transform-origin)`,e),...t})}));sn.displayName=C.Content.displayName;var cn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));cn.displayName=C.Item.displayName;var ln=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(C.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));ln.displayName=C.CheckboxItem.displayName;var un=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(C.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));un.displayName=C.RadioItem.displayName;var dn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));dn.displayName=C.Label.displayName;var fn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-border`,e),...t}));fn.displayName=C.Separator.displayName;var pn=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});pn.displayName=`ContextMenuShortcut`;var mn=({shouldScaleBackground:e=!0,...t})=>(0,o.jsx)(w.Drawer.Root,{shouldScaleBackground:e,...t});mn.displayName=`Drawer`;var hn=w.Drawer.Trigger,gn=w.Drawer.Portal,_n=w.Drawer.Close,vn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Overlay,{ref:n,className:q(`fixed inset-0 z-50 bg-black/80`,e),...t}));vn.displayName=w.Drawer.Overlay.displayName;var yn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(gn,{children:[(0,o.jsx)(vn,{}),(0,o.jsxs)(w.Drawer.Content,{ref:r,className:q(`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background`,e),...n,children:[(0,o.jsx)(`div`,{className:`mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted`}),t]})]}));yn.displayName=`DrawerContent`;var bn=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`grid gap-1.5 p-4 text-center sm:text-left`,e),...t});bn.displayName=`DrawerHeader`;var xn=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`mt-auto flex flex-col gap-2 p-4`,e),...t});xn.displayName=`DrawerFooter`;var Sn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Title,{ref:n,className:q(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Sn.displayName=w.Drawer.Title.displayName;var Cn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));Cn.displayName=w.Drawer.Description.displayName;var wn=T.Root,Tn=T.Trigger,En=T.Group,Dn=T.Portal,On=T.Sub,kn=T.RadioGroup,An=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(T.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto`})]}));An.displayName=T.SubTrigger.displayName;var jn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));jn.displayName=T.SubContent.displayName;var Mn=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(T.Portal,{children:(0,o.jsx)(T.Content,{ref:r,sideOffset:t,className:q(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));Mn.displayName=T.Content.displayName;var Nn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(T.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));Nn.displayName=T.Item.displayName;var Pn=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(T.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(T.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));Pn.displayName=T.CheckboxItem.displayName;var Fn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(T.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(T.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));Fn.displayName=T.RadioItem.displayName;var In=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(T.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));In.displayName=T.Label.displayName;var Ln=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));Ln.displayName=T.Separator.displayName;var Rn=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest opacity-60`,e),...t});Rn.displayName=`DropdownMenuShortcut`;var zn=(0,f.cva)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Bn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(D.Root,{ref:n,className:q(zn(),e),...t}));Bn.displayName=D.Root.displayName;var Vn=E.FormProvider,Hn=a.createContext(null),Un=({...e})=>(0,o.jsx)(Hn.Provider,{value:{name:e.name},children:(0,o.jsx)(E.Controller,{...e})}),Wn=()=>{let e=a.useContext(Hn),t=a.useContext(Gn),{getFieldState:n,formState:r}=(0,E.useFormContext)();if(!e)throw Error(`useFormField should be used within <FormField>`);if(!t)throw Error(`useFormField should be used within <FormItem>`);let i=n(e.name,r),{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Gn=a.createContext(null),Kn=a.forwardRef(({className:e,...t},n)=>{let r=a.useId();return(0,o.jsx)(Gn.Provider,{value:{id:r},children:(0,o.jsx)(`div`,{ref:n,className:q(`space-y-2`,e),...t})})});Kn.displayName=`FormItem`;var qn=a.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=Wn();return(0,o.jsx)(Bn,{ref:n,className:q(r&&`text-destructive`,e),htmlFor:i,...t})});qn.displayName=`FormLabel`;var Jn=a.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Wn();return(0,o.jsx)(d.Slot,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});Jn.displayName=`FormControl`;var Yn=a.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=Wn();return(0,o.jsx)(`p`,{ref:n,id:r,className:q(`text-sm text-muted-foreground`,e),...t})});Yn.displayName=`FormDescription`;var Xn=a.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=Wn(),s=i?String(i?.message??``):t;return s?(0,o.jsx)(`p`,{ref:r,id:a,className:q(`text-sm font-medium text-destructive`,e),...n,children:s}):null});Xn.displayName=`FormMessage`;var Zn=O.Root,Qn=O.Trigger,$n=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(O.Content,{ref:i,align:t,sideOffset:n,className:q(`z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-hover-card-content-transform-origin)`,e),...r}));$n.displayName=O.Content.displayName;var er=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(k.OTPInput,{ref:r,containerClassName:q(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),className:q(`disabled:cursor-not-allowed`,e),...n}));er.displayName=`InputOTP`;var tr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex items-center`,e),...t}));tr.displayName=`InputOTPGroup`;var nr=a.forwardRef(({index:e,className:t,...n},r)=>{let{char:i,hasFakeCaret:s,isActive:c}=a.useContext(k.OTPInputContext).slots[e];return(0,o.jsxs)(`div`,{ref:r,className:q(`relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md`,c&&`z-10 ring-2 ring-ring ring-offset-background`,t),...n,children:[i,s&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,o.jsx)(`div`,{className:`h-4 w-px animate-caret-blink bg-foreground duration-1000`})})]})});nr.displayName=`InputOTPSlot`;var rr=a.forwardRef(({...e},t)=>(0,o.jsx)(`div`,{ref:t,role:`separator`,...e,children:(0,o.jsx)(l.Dot,{})}));rr.displayName=`InputOTPSeparator`;var Q=a.forwardRef(({className:e,type:t,...n},r)=>(0,o.jsx)(`input`,{type:t,className:q(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));Q.displayName=`Input`;function ir({...e}){return(0,o.jsx)(A.Menu,{...e})}function ar({...e}){return(0,o.jsx)(A.Group,{...e})}function or({...e}){return(0,o.jsx)(A.Portal,{...e})}function sr({...e}){return(0,o.jsx)(A.RadioGroup,{...e})}function cr({...e}){return(0,o.jsx)(A.Sub,{"data-slot":`menubar-sub`,...e})}var lr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Root,{ref:n,className:q(`flex h-10 items-center space-x-1 rounded-md border bg-background p-1`,e),...t}));lr.displayName=A.Root.displayName;var ur=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Trigger,{ref:n,className:q(`flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,e),...t}));ur.displayName=A.Trigger.displayName;var dr=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(A.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto h-4 w-4`})]}));dr.displayName=A.SubTrigger.displayName;var fr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-menubar-content-transform-origin)`,e),...t}));fr.displayName=A.SubContent.displayName;var pr=a.forwardRef(({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i},a)=>(0,o.jsx)(A.Portal,{children:(0,o.jsx)(A.Content,{ref:a,align:t,alignOffset:n,sideOffset:r,className:q(`z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-menubar-content-transform-origin)`,e),...i})}));pr.displayName=A.Content.displayName;var mr=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(A.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));mr.displayName=A.Item.displayName;var hr=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(A.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(A.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));hr.displayName=A.CheckboxItem.displayName;var gr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(A.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(A.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));gr.displayName=A.RadioItem.displayName;var _r=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(A.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));_r.displayName=A.Label.displayName;var vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));vr.displayName=A.Separator.displayName;var yr=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});yr.displayname=`MenubarShortcut`;var br=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(j.Root,{ref:r,className:q(`relative z-10 flex max-w-max flex-1 items-center justify-center`,e),...n,children:[t,(0,o.jsx)(Dr,{})]}));br.displayName=j.Root.displayName;var xr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.List,{ref:n,className:q(`group flex flex-1 list-none items-center justify-center space-x-1`,e),...t}));xr.displayName=j.List.displayName;var Sr=j.Item,Cr=(0,f.cva)(`group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent`),wr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(j.Trigger,{ref:r,className:q(Cr(),`group`,e),...n,children:[t,` `,(0,o.jsx)(l.ChevronDown,{className:`relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180`,"aria-hidden":`true`})]}));wr.displayName=j.Trigger.displayName;var Tr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Content,{ref:n,className:q(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,e),...t}));Tr.displayName=j.Content.displayName;var Er=j.Link,Dr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:q(`absolute left-0 top-full flex justify-center`),children:(0,o.jsx)(j.Viewport,{className:q(`origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]`,e),ref:n,...t})}));Dr.displayName=j.Viewport.displayName;var Or=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Indicator,{ref:n,className:q(`top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,e),...t,children:(0,o.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`})}));Or.displayName=j.Indicator.displayName;var kr=({className:e,...t})=>(0,o.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,className:q(`mx-auto flex w-full justify-center`,e),...t});kr.displayName=`Pagination`;var Ar=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:q(`flex flex-row items-center gap-1`,e),...t}));Ar.displayName=`PaginationContent`;var jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:q(``,e),...t}));jr.displayName=`PaginationItem`;var Mr=({className:e,isActive:t,size:n=`icon`,...r})=>(0,o.jsx)(`a`,{"aria-current":t?`page`:void 0,className:q(ke({variant:t?`outline`:`ghost`,size:n}),e),...r});Mr.displayName=`PaginationLink`;var Nr=({className:e,...t})=>(0,o.jsxs)(Mr,{"aria-label":`Go to previous page`,size:`default`,className:q(`gap-1 pl-2.5`,e),...t,children:[(0,o.jsx)(l.ChevronLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:`Previous`})]});Nr.displayName=`PaginationPrevious`;var Pr=({className:e,...t})=>(0,o.jsxs)(Mr,{"aria-label":`Go to next page`,size:`default`,className:q(`gap-1 pr-2.5`,e),...t,children:[(0,o.jsx)(`span`,{children:`Next`}),(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})]});Pr.displayName=`PaginationNext`;var Fr=({className:e,...t})=>(0,o.jsxs)(`span`,{"aria-hidden":!0,className:q(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More pages`})]});Fr.displayName=`PaginationEllipsis`;var Ir=M.Root,Lr=M.Trigger,Rr=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(M.Portal,{children:(0,o.jsx)(M.Content,{ref:i,align:t,sideOffset:n,className:q(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-popover-content-transform-origin)`,e),...r})}));Rr.displayName=M.Content.displayName;var zr=a.forwardRef(({className:e,value:t,...n},r)=>(0,o.jsx)(N.Root,{ref:r,className:q(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,o.jsx)(N.Indicator,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));zr.displayName=N.Root.displayName;var Br=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ee.Root,{className:q(`grid gap-2`,e),...t,ref:n}));Br.displayName=ee.Root.displayName;var Vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ee.Item,{ref:n,className:q(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,o.jsx)(ee.Indicator,{className:`flex items-center justify-center`,children:(0,o.jsx)(l.Circle,{className:`h-2.5 w-2.5 fill-current text-current`})})}));Vr.displayName=ee.Item.displayName;var Hr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(P.Root,{ref:r,className:q(`relative overflow-hidden`,e),...n,children:[(0,o.jsx)(P.Viewport,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,o.jsx)(Ur,{}),(0,o.jsx)(P.Corner,{})]}));Hr.displayName=P.Root.displayName;var Ur=a.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,o.jsx)(P.ScrollAreaScrollbar,{ref:r,orientation:t,className:q(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,o.jsx)(P.ScrollAreaThumb,{className:`relative flex-1 rounded-full bg-border`})}));Ur.displayName=P.ScrollAreaScrollbar.displayName;var Wr=({onValueChange:e,...t})=>{let n=a.useCallback(t=>{t!==``&&e?.(t)},[e]);return(0,o.jsx)(F.Root,{...t,onValueChange:n})};Wr.displayName=F.Root.displayName;var Gr=F.Group,Kr=F.Value,qr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(F.Trigger,{ref:r,className:q(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,o.jsx)(F.Icon,{asChild:!0,children:(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4 opacity-50`})})]}));qr.displayName=F.Trigger.displayName;var Jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(F.ScrollUpButton,{ref:n,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(l.ChevronUp,{className:`h-4 w-4`})}));Jr.displayName=F.ScrollUpButton.displayName;var Yr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(F.ScrollDownButton,{ref:n,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4`})}));Yr.displayName=F.ScrollDownButton.displayName;var Xr=a.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,o.jsx)(F.Portal,{children:(0,o.jsxs)(F.Content,{ref:i,className:q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,o.jsx)(Jr,{}),(0,o.jsx)(F.Viewport,{className:q(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,o.jsx)(Yr,{})]})}));Xr.displayName=F.Content.displayName;var Zr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(F.Label,{ref:n,className:q(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));Zr.displayName=F.Label.displayName;var Qr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(F.Item,{ref:r,className:q(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(F.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),(0,o.jsx)(F.ItemText,{children:t})]}));Qr.displayName=F.Item.displayName;var $r=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(F.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));$r.displayName=F.Separator.displayName;var ei=a.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,o.jsx)(I.Root,{ref:i,decorative:n,orientation:t,className:q(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));ei.displayName=I.Root.displayName;var ti=S.Root,ni=S.Trigger,ri=S.Close,ii=S.Portal,ai=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Overlay,{className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));ai.displayName=S.Overlay.displayName;var oi=(0,f.cva)(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),si=a.forwardRef(({side:e=`right`,className:t,children:n,hideOverlay:r,...i},a)=>(0,o.jsxs)(ii,{children:[!r&&(0,o.jsx)(ai,{}),(0,o.jsxs)(S.Content,{ref:a,className:q(oi({side:e}),t),...i,children:[n,(0,o.jsxs)(S.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(Mt,{})]})]})]}));si.displayName=S.Content.displayName;var ci=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});ci.displayName=`SheetHeader`;var li=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});li.displayName=`SheetFooter`;var ui=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Title,{ref:n,className:q(`text-lg font-semibold text-foreground`,e),...t}));ui.displayName=S.Title.displayName;var di=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));di.displayName=S.Description.displayName;var fi=768;function pi(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<fi)};return e.addEventListener(`change`,n),t(window.innerWidth<fi),()=>e.removeEventListener(`change`,n)},[]),!!e}function mi(e){if(typeof document>`u`)return;let t=document.cookie;if(t)for(let n of t.split(`;`)){let t=n.indexOf(`=`);if(t===-1||n.slice(0,t).trim()!==e)continue;let r=n.slice(t+1).trim();return r===`true`||r!==`false`&&void 0}}function $({className:e,...t}){return(0,o.jsx)(`div`,{className:q(`animate-pulse rounded-md bg-muted`,e),...t})}var hi=L.Provider,gi=L.Root,_i=L.Trigger,vi=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(L.Content,{ref:r,sideOffset:t,className:q(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=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 origin-(--radix-tooltip-content-transform-origin)`,e),...n}));vi.displayName=L.Content.displayName;var yi=`sidebar_state`,bi=604800,xi=`16rem`,Si=`18rem`,Ci=`3rem`,wi=`b`,Ti=a.createContext(null);function Ei(){let e=a.useContext(Ti);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Di(){return a.useContext(Ti)}var Oi=a.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:s,...c},l)=>{let u=pi(),[d,f]=a.useState(!1),[p,m]=a.useState(()=>mi(yi)??e),h=t??p,g=a.useCallback(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`${yi}=${t}; path=/; max-age=${bi}`},[n,h]),_=a.useCallback(()=>u?f(e=>!e):g(e=>!e),[u,g,f]);a.useEffect(()=>{let e=e=>{e.key===wi&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,y=a.useMemo(()=>({state:v,open:h,setOpen:g,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,u,d,f,_]);return(0,o.jsx)(Ti.Provider,{value:y,children:(0,o.jsx)(hi,{delayDuration:0,children:(0,o.jsx)(`div`,{style:{"--sidebar-width":xi,"--sidebar-width-icon":Ci,...i},className:q(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:l,...c,children:s})})})});Oi.displayName=`SidebarProvider`;var ki=a.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},s)=>{let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=Ei();return n===`none`?(0,o.jsx)(`div`,{className:q(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:s,...a,children:i}):c?(0,o.jsx)(ti,{open:u,onOpenChange:d,...a,children:(0,o.jsxs)(si,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden data-[state=open]:duration-300 data-[state=open]:ease-out`,style:{"--sidebar-width":Si},side:e,children:[(0,o.jsxs)(ci,{className:`sr-only`,children:[(0,o.jsx)(ui,{children:`Sidebar`}),(0,o.jsx)(di,{children:`Displays the mobile sidebar.`})]}),(0,o.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,o.jsxs)(`div`,{ref:s,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":l,"data-collapsible":n,"data-variant":t,"data-side":e,children:[(0,o.jsx)(`div`,{className:q(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{className:q(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem_+_2px)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});ki.displayName=`Sidebar`;var Ai=a.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=Ei();return(0,o.jsxs)(X,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:q(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,o.jsx)(l.PanelLeft,{}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});Ai.displayName=`SidebarTrigger`;var ji=a.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=Ei();return(0,o.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:q(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:translate-x-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:after:left-full group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-state=collapsed][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-state=collapsed][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});ji.displayName=`SidebarRail`;var Mi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`main`,{ref:n,className:q(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));Mi.displayName=`SidebarInset`;var Ni=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(Q,{ref:n,"data-sidebar":`input`,className:q(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Ni.displayName=`SidebarInput`;var Pi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:q(`flex flex-col gap-2 p-2`,e),...t}));Pi.displayName=`SidebarHeader`;var Fi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:q(`flex flex-col gap-2 p-2`,e),...t}));Fi.displayName=`SidebarFooter`;var Ii=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ei,{ref:n,"data-sidebar":`separator`,className:q(`mx-2 w-auto bg-sidebar-border`,e),...t}));Ii.displayName=`SidebarSeparator`;var Li=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:q(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[state=collapsed]:group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Li.displayName=`SidebarContent`;var Ri=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:q(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));Ri.displayName=`SidebarGroup`;var zi=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?d.Slot:`div`,{ref:r,"data-sidebar":`group-label`,className:q(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:-mt-8 group-data-[state=collapsed]:group-data-[collapsible=icon]:opacity-0`,e),...n}));zi.displayName=`SidebarGroupLabel`;var Bi=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?d.Slot:`button`,{ref:r,"data-sidebar":`group-action`,className:q(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...n}));Bi.displayName=`SidebarGroupAction`;var Vi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:q(`w-full text-sm`,e),...t}));Vi.displayName=`SidebarGroupContent`;var Hi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:q(`flex w-full min-w-0 flex-col gap-1`,e),...t}));Hi.displayName=`SidebarMenu`;var Ui=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:q(`group/menu-item relative`,e),...t}));Ui.displayName=`SidebarMenuItem`;var Wi=(0,f.cva)(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding,color,background-color] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground sidebar-menu-button-icon-mode [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm sidebar-menu-button-icon-mode-lg`}},defaultVariants:{variant:`default`,size:`default`}}),Gi=a.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...s},c)=>{let l=e?d.Slot:`button`,{isMobile:u,state:f}=Ei(),p=(0,o.jsx)(l,{ref:c,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:q(Wi({variant:n,size:r}),a),...s});return i?(typeof i==`string`&&(i={children:i}),(0,o.jsxs)(gi,{children:[(0,o.jsx)(_i,{asChild:!0,children:p}),(0,o.jsx)(vi,{side:`right`,align:`center`,hidden:f!==`collapsed`||u,...i})]})):p});Gi.displayName=`SidebarMenuButton`;var Ki=a.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,o.jsx)(t?d.Slot:`button`,{ref:i,"data-sidebar":`menu-action`,className:q(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));Ki.displayName=`SidebarMenuAction`;var qi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:q(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));qi.displayName=`SidebarMenuBadge`;var Ji=a.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=a.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,o.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:q(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,o.jsx)($,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,o.jsx)($,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Ji.displayName=`SidebarMenuSkeleton`;var Yi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:q(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Yi.displayName=`SidebarMenuSub`;var Xi=a.forwardRef(({...e},t)=>(0,o.jsx)(`li`,{ref:t,...e}));Xi.displayName=`SidebarMenuSubItem`;var Zi=a.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,o.jsx)(e?d.Slot:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:q(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,r),...i}));Zi.displayName=`SidebarMenuSubButton`;function Qi(e){let{thumbProps:t,...n}=e;return{root:n,thumb:{"aria-label":e[`aria-label`],...t??{}}}}var $i=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(R.Root,{ref:n,className:q(`relative flex w-full touch-none select-none items-center`,e),...Qi(t).root,children:[(0,o.jsx)(R.Track,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,o.jsx)(R.Range,{className:`absolute h-full bg-primary`})}),(0,o.jsx)(R.Thumb,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,...Qi(t).thumb})]}));$i.displayName=R.Root.displayName;var ea=({...e})=>{let{theme:t=`system`}=(0,z.useTheme)();return(0,o.jsx)(B.Toaster,{theme:t,className:`toaster group`,icons:{success:(0,o.jsx)(l.CircleCheck,{className:`h-4 w-4`}),info:(0,o.jsx)(l.Info,{className:`h-4 w-4`}),warning:(0,o.jsx)(l.TriangleAlert,{className:`h-4 w-4`}),error:(0,o.jsx)(l.OctagonX,{className:`h-4 w-4`}),loading:(0,o.jsx)(l.LoaderCircle,{className:`h-4 w-4 animate-spin`})},toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},ta=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(te.Root,{className:q(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,o.jsx)(te.Thumb,{className:q(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));ta.displayName=te.Root.displayName;var na=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(`div`,{className:q(`relative w-full overflow-auto`,t),children:(0,o.jsx)(`table`,{ref:r,className:q(`w-full caption-bottom text-sm`,e),...n})}));na.displayName=`Table`;var ra=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`thead`,{ref:n,className:q(`[&_tr]:border-b`,e),...t}));ra.displayName=`TableHeader`;var ia=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tbody`,{ref:n,className:q(`[&_tr:last-child]:border-0`,e),...t}));ia.displayName=`TableBody`;var aa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tfoot`,{ref:n,className:q(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));aa.displayName=`TableFooter`;var oa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tr`,{ref:n,className:q(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));oa.displayName=`TableRow`;var sa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`th`,{ref:n,className:q(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));sa.displayName=`TableHead`;var ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`td`,{ref:n,className:q(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));ca.displayName=`TableCell`;var la=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`caption`,{ref:n,className:q(`mt-4 text-sm text-muted-foreground`,e),...t}));la.displayName=`TableCaption`;var ua=ne.Root,da=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.List,{ref:n,className:q(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));da.displayName=ne.List.displayName;var fa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.Trigger,{ref:n,className:q(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,e),...t}));fa.displayName=ne.Trigger.displayName;var pa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.Content,{ref:n,className:q(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));pa.displayName=ne.Content.displayName;var ma=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`textarea`,{className:q(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));ma.displayName=`Textarea`;var ha=(0,f.cva)(`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-accent hover:text-accent-foreground`},size:{default:`h-10 px-3 min-w-10`,sm:`h-9 px-2.5 min-w-9`,lg:`h-11 px-5 min-w-11`}},defaultVariants:{variant:`default`,size:`default`}}),ga=a.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,o.jsx)(V.Root,{ref:i,className:q(ha({variant:t,size:n,className:e})),...r}));ga.displayName=V.Root.displayName;var _a=a.createContext({size:`default`,variant:`default`}),va=a.forwardRef(({className:e,variant:t,size:n,children:r,...i},a)=>(0,o.jsx)(re.Root,{ref:a,className:q(`flex items-center justify-center gap-1`,e),...i,children:(0,o.jsx)(_a.Provider,{value:{variant:t,size:n},children:r})}));va.displayName=re.Root.displayName;var ya=a.forwardRef(({className:e,children:t,variant:n,size:r,...i},s)=>{let c=a.useContext(_a);return(0,o.jsx)(re.Item,{ref:s,className:q(ha({variant:c.variant||n,size:c.size||r}),e),...i,children:t})});ya.displayName=re.Item.displayName;var ba=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h1`,{ref:n,className:q(`scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl`,e),...t}));ba.displayName=`TypographyH1`;var xa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h2`,{ref:n,className:q(`scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0`,e),...t}));xa.displayName=`TypographyH2`;var Sa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h3`,{ref:n,className:q(`scroll-m-20 text-2xl font-semibold tracking-tight`,e),...t}));Sa.displayName=`TypographyH3`;var Ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h4`,{ref:n,className:q(`scroll-m-20 text-xl font-semibold tracking-tight`,e),...t}));Ca.displayName=`TypographyH4`;var wa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`leading-7 [&:not(:first-child)]:mt-6`,e),...t}));wa.displayName=`TypographyP`;var Ta=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`blockquote`,{ref:n,className:q(`mt-6 border-l-2 pl-6 italic`,e),...t}));Ta.displayName=`TypographyBlockquote`;var Ea=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:q(`my-6 ml-6 list-disc [&>li]:mt-2`,e),...t}));Ea.displayName=`TypographyList`;var Da=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`code`,{ref:n,className:q(`relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold`,e),...t}));Da.displayName=`TypographyInlineCode`;var Oa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`text-xl text-muted-foreground`,e),...t}));Oa.displayName=`TypographyLead`;var ka=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-lg font-semibold`,e),...t}));ka.displayName=`TypographyLarge`;var Aa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`small`,{ref:n,className:q(`text-sm font-medium leading-none`,e),...t}));Aa.displayName=`TypographySmall`;var ja=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));ja.displayName=`TypographyMuted`;var Ma=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(ei,{ref:r,orientation:e.orientation,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s})});t.ComponentRegistry.register(`separator`,Ma,{namespace:`ui`,label:`Separator`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`className`,type:`string`}],defaultProps:{orientation:`horizontal`,className:`my-2 sm:my-4`}}),t.ComponentRegistry.register(`image`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`img`,{src:e.src,alt:e.alt||``,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Image`,icon:`image`,category:`basic`,inputs:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`className`,type:`string`}],defaultProps:{className:`max-w-full h-auto`}});var Na=`AArrowDown:a-arrow-down,AArrowUp:a-arrow-up,ALargeSmall:a-large-small,Accessibility:accessibility,Activity:activity,Ad:ad,AirVent:air-vent,Airplay:airplay,AlarmClock:alarm-clock,AlarmClockCheck:alarm-clock-check,AlarmClockMinus:alarm-clock-minus,AlarmClockOff:alarm-clock-off,AlarmClockPlus:alarm-clock-plus,AlarmSmoke:alarm-smoke,Album:album,AlignCenterHorizontal:align-center-horizontal,AlignCenterVertical:align-center-vertical,AlignEndHorizontal:align-end-horizontal,AlignEndVertical:align-end-vertical,AlignHorizontalDistributeCenter:align-horizontal-distribute-center,AlignHorizontalDistributeEnd:align-horizontal-distribute-end,AlignHorizontalDistributeStart:align-horizontal-distribute-start,AlignHorizontalJustifyCenter:align-horizontal-justify-center,AlignHorizontalJustifyEnd:align-horizontal-justify-end,AlignHorizontalJustifyStart:align-horizontal-justify-start,AlignHorizontalSpaceAround:align-horizontal-space-around,AlignHorizontalSpaceBetween:align-horizontal-space-between,AlignStartHorizontal:align-start-horizontal,AlignStartVertical:align-start-vertical,AlignVerticalDistributeCenter:align-vertical-distribute-center,AlignVerticalDistributeEnd:align-vertical-distribute-end,AlignVerticalDistributeStart:align-vertical-distribute-start,AlignVerticalJustifyCenter:align-vertical-justify-center,AlignVerticalJustifyEnd:align-vertical-justify-end,AlignVerticalJustifyStart:align-vertical-justify-start,AlignVerticalSpaceAround:align-vertical-space-around,AlignVerticalSpaceBetween:align-vertical-space-between,Ambulance:ambulance,Ampersand:ampersand,Ampersands:ampersands,Amphora:amphora,Anchor:anchor,Angle:angle,Antenna:antenna,Anvil:anvil,Aperture:aperture,AppWindow:app-window,AppWindowMac:app-window-mac,Apple:apple,Archive:archive,ArchiveRestore:archive-restore,ArchiveX:archive-x,Armchair:armchair,ArrowBigDown:arrow-big-down,ArrowBigDownDash:arrow-big-down-dash,ArrowBigLeft:arrow-big-left,ArrowBigLeftDash:arrow-big-left-dash,ArrowBigRight:arrow-big-right,ArrowBigRightDash:arrow-big-right-dash,ArrowBigUp:arrow-big-up,ArrowBigUpDash:arrow-big-up-dash,ArrowDown:arrow-down,ArrowDown01:arrow-down-0-1,ArrowDown10:arrow-down-1-0,ArrowDownAZ:arrow-down-a-z,ArrowDownFromLine:arrow-down-from-line,ArrowDownLeft:arrow-down-left,ArrowDownNarrowWide:arrow-down-narrow-wide,ArrowDownRight:arrow-down-right,ArrowDownToDot:arrow-down-to-dot,ArrowDownToLine:arrow-down-to-line,ArrowDownUp:arrow-down-up,ArrowDownWideNarrow:arrow-down-wide-narrow,ArrowDownZA:arrow-down-z-a,ArrowLeft:arrow-left,ArrowLeftFromLine:arrow-left-from-line,ArrowLeftRight:arrow-left-right,ArrowLeftToLine:arrow-left-to-line,ArrowRight:arrow-right,ArrowRightFromLine:arrow-right-from-line,ArrowRightLeft:arrow-right-left,ArrowRightToLine:arrow-right-to-line,ArrowUp:arrow-up,ArrowUp01:arrow-up-0-1,ArrowUp10:arrow-up-1-0,ArrowUpAZ:arrow-up-a-z,ArrowUpDown:arrow-up-down,ArrowUpFromDot:arrow-up-from-dot,ArrowUpFromLine:arrow-up-from-line,ArrowUpLeft:arrow-up-left,ArrowUpNarrowWide:arrow-up-narrow-wide,ArrowUpRight:arrow-up-right,ArrowUpToLine:arrow-up-to-line,ArrowUpWideNarrow:arrow-up-wide-narrow,ArrowUpZA:arrow-up-z-a,ArrowsUpFromLine:arrows-up-from-line,Asterisk:asterisk,Astroid:astroid,AtSign:at-sign,Atom:atom,AudioLines:audio-lines,AudioLinesOff:audio-lines-off,AudioLinesX:audio-lines-x,AudioWaveform:audio-waveform,Award:award,Axe:axe,Axis3d:axis-3d,Baby:baby,Backpack:backpack,Badge:badge,BadgeAlert:badge-alert,BadgeCent:badge-cent,BadgeCheck:badge-check,BadgeDollarSign:badge-dollar-sign,BadgeEuro:badge-euro,BadgeIndianRupee:badge-indian-rupee,BadgeInfo:badge-info,BadgeJapaneseYen:badge-japanese-yen,BadgeMinus:badge-minus,BadgePercent:badge-percent,BadgePlus:badge-plus,BadgePoundSterling:badge-pound-sterling,BadgeQuestionMark:badge-question-mark,BadgeRussianRuble:badge-russian-ruble,BadgeSwissFranc:badge-swiss-franc,BadgeTurkishLira:badge-turkish-lira,BadgeX:badge-x,BaggageClaim:baggage-claim,Balloon:balloon,Ban:ban,Banana:banana,Bandage:bandage,Banknote:banknote,BanknoteArrowDown:banknote-arrow-down,BanknoteArrowUp:banknote-arrow-up,BanknoteCheck:banknote-check,BanknoteX:banknote-x,Barcode:barcode,Barrel:barrel,Baseline:baseline,Bath:bath,Battery:battery,BatteryCharging:battery-charging,BatteryFull:battery-full,BatteryLow:battery-low,BatteryMedium:battery-medium,BatteryPlus:battery-plus,BatteryWarning:battery-warning,Beaker:beaker,Bean:bean,BeanOff:bean-off,Bed:bed,BedDouble:bed-double,BedSingle:bed-single,Beef:beef,BeefOff:beef-off,Beer:beer,BeerOff:beer-off,Bell:bell,BellCheck:bell-check,BellDot:bell-dot,BellElectric:bell-electric,BellMinus:bell-minus,BellOff:bell-off,BellPlus:bell-plus,BellRing:bell-ring,BetweenHorizontalEnd:between-horizontal-end,BetweenHorizontalStart:between-horizontal-start,BetweenVerticalEnd:between-vertical-end,BetweenVerticalStart:between-vertical-start,BicepsFlexed:biceps-flexed,Bike:bike,Binary:binary,Binoculars:binoculars,Biohazard:biohazard,Bird:bird,Birdhouse:birdhouse,Bitcoin:bitcoin,Blend:blend,Blender:blender,Blinds:blinds,Blocks:blocks,Bluetooth:bluetooth,BluetoothConnected:bluetooth-connected,BluetoothOff:bluetooth-off,BluetoothSearching:bluetooth-searching,Bold:bold,Bolt:bolt,Bomb:bomb,Bone:bone,BoneFracture:bone-fracture,Book:book,BookA:book-a,BookAlert:book-alert,BookAudio:book-audio,BookCheck:book-check,BookCopy:book-copy,BookDashed:book-dashed,BookDown:book-down,BookHeadphones:book-headphones,BookHeart:book-heart,BookImage:book-image,BookKey:book-key,BookLock:book-lock,BookMarked:book-marked,BookMinus:book-minus,BookOpen:book-open,BookOpenCheck:book-open-check,BookOpenText:book-open-text,BookPlus:book-plus,BookSearch:book-search,BookText:book-text,BookType:book-type,BookUp:book-up,BookUp2:book-up-2,BookUser:book-user,BookX:book-x,Bookmark:bookmark,BookmarkCheck:bookmark-check,BookmarkMinus:bookmark-minus,BookmarkOff:bookmark-off,BookmarkPlus:bookmark-plus,BookmarkX:bookmark-x,BoomBox:boom-box,Bot:bot,BotMessageSquare:bot-message-square,BotOff:bot-off,BottleWine:bottle-wine,BowArrow:bow-arrow,Box:box,Boxes:boxes,Braces:braces,Brackets:brackets,Brain:brain,BrainCircuit:brain-circuit,BrainCog:brain-cog,BrickWall:brick-wall,BrickWallFire:brick-wall-fire,BrickWallShield:brick-wall-shield,Bridge:bridge,Briefcase:briefcase,BriefcaseBusiness:briefcase-business,BriefcaseConveyorBelt:briefcase-conveyor-belt,BriefcaseMedical:briefcase-medical,BringToFront:bring-to-front,Broccoli:broccoli,Broom:broom,BroomSparkles:broom-sparkles,Brush:brush,BrushCleaning:brush-cleaning,Bubbles:bubbles,Bug:bug,BugOff:bug-off,BugPlay:bug-play,Building:building,Building2:building-2,Bus:bus,BusFront:bus-front,Cable:cable,CableCar:cable-car,Cake:cake,CakeSlice:cake-slice,Calculator:calculator,Calendar:calendar,Calendar1:calendar-1,CalendarArrowDown:calendar-arrow-down,CalendarArrowUp:calendar-arrow-up,CalendarCheck:calendar-check,CalendarCheck2:calendar-check-2,CalendarClock:calendar-clock,CalendarCog:calendar-cog,CalendarDays:calendar-days,CalendarFold:calendar-fold,CalendarHeart:calendar-heart,CalendarMinus:calendar-minus,CalendarMinus2:calendar-minus-2,CalendarOff:calendar-off,CalendarPlus:calendar-plus,CalendarPlus2:calendar-plus-2,CalendarRange:calendar-range,CalendarSearch:calendar-search,CalendarSync:calendar-sync,CalendarX:calendar-x,CalendarX2:calendar-x-2,Calendars:calendars,Camera:camera,CameraOff:camera-off,Can:can,CanSoda:can-soda,Candy:candy,CandyCane:candy-cane,CandyOff:candy-off,Cannabis:cannabis,CannabisOff:cannabis-off,Captions:captions,CaptionsOff:captions-off,Car:car,CarBattery:car-battery,CarFront:car-front,CarTaxiFront:car-taxi-front,Caravan:caravan,CardSim:card-sim,Carrot:carrot,Carton:carton,CartonOff:carton-off,CaseLower:case-lower,CaseSensitive:case-sensitive,CaseUpper:case-upper,CassetteTape:cassette-tape,Cast:cast,Castle:castle,Cat:cat,Cctv:cctv,CctvOff:cctv-off,ChartArea:chart-area,ChartBar:chart-bar,ChartBarBig:chart-bar-big,ChartBarDecreasing:chart-bar-decreasing,ChartBarIncreasing:chart-bar-increasing,ChartBarStacked:chart-bar-stacked,ChartCandlestick:chart-candlestick,ChartColumn:chart-column,ChartColumnBig:chart-column-big,ChartColumnDecreasing:chart-column-decreasing,ChartColumnIncreasing:chart-column-increasing,ChartColumnStacked:chart-column-stacked,ChartGantt:chart-gantt,ChartLine:chart-line,ChartNetwork:chart-network,ChartNoAxesColumn:chart-no-axes-column,ChartNoAxesColumnDecreasing:chart-no-axes-column-decreasing,ChartNoAxesColumnIncreasing:chart-no-axes-column-increasing,ChartNoAxesCombined:chart-no-axes-combined,ChartNoAxesGantt:chart-no-axes-gantt,ChartPie:chart-pie,ChartScatter:chart-scatter,ChartSpline:chart-spline,Check:check,CheckCheck:check-check,CheckLine:check-line,ChefHat:chef-hat,Cherry:cherry,ChessBishop:chess-bishop,ChessKing:chess-king,ChessKnight:chess-knight,ChessPawn:chess-pawn,ChessQueen:chess-queen,ChessRook:chess-rook,ChevronDown:chevron-down,ChevronFirst:chevron-first,ChevronLast:chevron-last,ChevronLeft:chevron-left,ChevronRight:chevron-right,ChevronUp:chevron-up,ChevronsDown:chevrons-down,ChevronsDownUp:chevrons-down-up,ChevronsLeft:chevrons-left,ChevronsLeftRight:chevrons-left-right,ChevronsLeftRightEllipsis:chevrons-left-right-ellipsis,ChevronsRight:chevrons-right,ChevronsRightLeft:chevrons-right-left,ChevronsUp:chevrons-up,ChevronsUpDown:chevrons-up-down,Church:church,Cigarette:cigarette,CigaretteOff:cigarette-off,Circle:circle,CircleAlert:circle-alert,CircleArrowDown:circle-arrow-down,CircleArrowLeft:circle-arrow-left,CircleArrowOutDownLeft:circle-arrow-out-down-left,CircleArrowOutDownRight:circle-arrow-out-down-right,CircleArrowOutUpLeft:circle-arrow-out-up-left,CircleArrowOutUpRight:circle-arrow-out-up-right,CircleArrowRight:circle-arrow-right,CircleArrowUp:circle-arrow-up,CircleCheck:circle-check,CircleCheckBig:circle-check-big,CircleChevronDown:circle-chevron-down,CircleChevronLeft:circle-chevron-left,CircleChevronRight:circle-chevron-right,CircleChevronUp:circle-chevron-up,CircleDashed:circle-dashed,CircleDashedCheck:circle-dashed-check,CircleDivide:circle-divide,CircleDollarSign:circle-dollar-sign,CircleDot:circle-dot,CircleDotDashed:circle-dot-dashed,CircleEllipsis:circle-ellipsis,CircleEqual:circle-equal,CircleEuro:circle-euro,CircleFadingArrowUp:circle-fading-arrow-up,CircleFadingPlus:circle-fading-plus,CircleGauge:circle-gauge,CircleMinus:circle-minus,CircleOff:circle-off,CircleParking:circle-parking,CircleParkingOff:circle-parking-off,CirclePause:circle-pause,CirclePercent:circle-percent,CirclePile:circle-pile,CirclePlay:circle-play,CirclePlus:circle-plus,CirclePoundSterling:circle-pound-sterling,CirclePower:circle-power,CircleQuestionMark:circle-question-mark,CircleSlash:circle-slash,CircleSlash2:circle-slash-2,CircleSmall:circle-small,CircleStar:circle-star,CircleStop:circle-stop,CircleUser:circle-user,CircleUserRound:circle-user-round,CircleX:circle-x,CircuitBoard:circuit-board,Citrus:citrus,Clapperboard:clapperboard,Clipboard:clipboard,ClipboardCheck:clipboard-check,ClipboardClock:clipboard-clock,ClipboardCopy:clipboard-copy,ClipboardList:clipboard-list,ClipboardMinus:clipboard-minus,ClipboardPaste:clipboard-paste,ClipboardPen:clipboard-pen,ClipboardPenLine:clipboard-pen-line,ClipboardPlus:clipboard-plus,ClipboardType:clipboard-type,ClipboardX:clipboard-x,Clock:clock,Clock1:clock-1,Clock10:clock-10,Clock11:clock-11,Clock12:clock-12,Clock2:clock-2,Clock3:clock-3,Clock4:clock-4,Clock5:clock-5,Clock6:clock-6,Clock7:clock-7,Clock8:clock-8,Clock9:clock-9,ClockAlert:clock-alert,ClockArrowDown:clock-arrow-down,ClockArrowLeft:clock-arrow-left,ClockArrowRight:clock-arrow-right,ClockArrowUp:clock-arrow-up,ClockCheck:clock-check,ClockFading:clock-fading,ClockPlus:clock-plus,ClosedCaption:closed-caption,Cloud:cloud,CloudAlert:cloud-alert,CloudBackup:cloud-backup,CloudCheck:cloud-check,CloudCog:cloud-cog,CloudDownload:cloud-download,CloudDrizzle:cloud-drizzle,CloudFog:cloud-fog,CloudHail:cloud-hail,CloudLightning:cloud-lightning,CloudMoon:cloud-moon,CloudMoonRain:cloud-moon-rain,CloudOff:cloud-off,CloudRain:cloud-rain,CloudRainWind:cloud-rain-wind,CloudSnow:cloud-snow,CloudSun:cloud-sun,CloudSunRain:cloud-sun-rain,CloudSync:cloud-sync,CloudUpload:cloud-upload,Cloudy:cloudy,Clover:clover,Club:club,Code:code,CodeXml:code-xml,Coffee:coffee,Cog:cog,Coins:coins,Columns2:columns-2,Columns3:columns-3,Columns3Cog:columns-3-cog,Columns4:columns-4,Combine:combine,Command:command,Compass:compass,Component:component,Computer:computer,ConciergeBell:concierge-bell,Cone:cone,Construction:construction,Contact:contact,ContactRound:contact-round,Container:container,Contrast:contrast,Cookie:cookie,CookingPot:cooking-pot,Copy:copy,CopyCheck:copy-check,CopyMinus:copy-minus,CopyPlus:copy-plus,CopySlash:copy-slash,CopyX:copy-x,Copyleft:copyleft,Copyright:copyright,CornerDownLeft:corner-down-left,CornerDownRight:corner-down-right,CornerLeftDown:corner-left-down,CornerLeftUp:corner-left-up,CornerRightDown:corner-right-down,CornerRightUp:corner-right-up,CornerUpLeft:corner-up-left,CornerUpRight:corner-up-right,Cpu:cpu,CreativeCommons:creative-commons,CreditCard:credit-card,CreditCardCheck:credit-card-check,CreditCardMinus:credit-card-minus,CreditCardPlus:credit-card-plus,CreditCardReader:credit-card-reader,CreditCardX:credit-card-x,Croissant:croissant,Crop:crop,Cross:cross,Crosshair:crosshair,Crown:crown,Cuboid:cuboid,CupSoda:cup-soda,Currency:currency,Cylinder:cylinder,Dam:dam,Database:database,DatabaseArrowDown:database-arrow-down,DatabaseArrowUp:database-arrow-up,DatabaseBackup:database-backup,DatabaseCheck:database-check,DatabaseMinus:database-minus,DatabasePlus:database-plus,DatabaseSearch:database-search,DatabaseX:database-x,DatabaseZap:database-zap,DecimalsArrowLeft:decimals-arrow-left,DecimalsArrowRight:decimals-arrow-right,Delete:delete,Dessert:dessert,Diameter:diameter,Diamond:diamond,DiamondMinus:diamond-minus,DiamondPercent:diamond-percent,DiamondPlus:diamond-plus,Dice1:dice-1,Dice2:dice-2,Dice3:dice-3,Dice4:dice-4,Dice5:dice-5,Dice6:dice-6,Dices:dices,Diff:diff,Disc:disc,Disc2:disc-2,Disc3:disc-3,DiscAlbum:disc-album,Divide:divide,Dna:dna,DnaOff:dna-off,Dock:dock,Dog:dog,DollarSign:dollar-sign,Dome:dome,Donut:donut,DoorClosed:door-closed,DoorClosedLocked:door-closed-locked,DoorOpen:door-open,DoorStairwell:door-stairwell,Dot:dot,Download:download,DraftingCompass:drafting-compass,Drama:drama,Drill:drill,Drone:drone,Droplet:droplet,DropletOff:droplet-off,Droplets:droplets,Drum:drum,Drumstick:drumstick,Dumbbell:dumbbell,Ear:ear,EarOff:ear-off,Earth:earth,EarthLock:earth-lock,Eclipse:eclipse,Egg:egg,EggFried:egg-fried,EggOff:egg-off,Eject:eject,Ellipse:ellipse,Ellipsis:ellipsis,EllipsisVertical:ellipsis-vertical,Engine:engine,Equal:equal,EqualApproximately:equal-approximately,EqualApproximatelyNot:equal-approximately-not,EqualNot:equal-not,Eraser:eraser,EthernetPort:ethernet-port,Euro:euro,EvCharger:ev-charger,Expand:expand,ExternalLink:external-link,Eye:eye,EyeClosed:eye-closed,EyeDashed:eye-dashed,EyeOff:eye-off,FaceAngry:face-angry,FaceExpressionless:face-expressionless,FaceGrinning:face-grinning,FaceNeutral:face-neutral,FaceSlightlyFrowning:face-slightly-frowning,FaceSlightlySmiling:face-slightly-smiling,FaceSlightlySmilingPlus:face-slightly-smiling-plus,Factory:factory,Fan:fan,FastForward:fast-forward,Feather:feather,Fence:fence,FerrisWheel:ferris-wheel,File:file,FileArchive:file-archive,FileAxis3d:file-axis-3d,FileBadge:file-badge,FileBox:file-box,FileBraces:file-braces,FileBracesCorner:file-braces-corner,FileChartColumn:file-chart-column,FileChartColumnIncreasing:file-chart-column-increasing,FileChartLine:file-chart-line,FileChartPie:file-chart-pie,FileCheck:file-check,FileCheckCorner:file-check-corner,FileClock:file-clock,FileCode:file-code,FileCodeCorner:file-code-corner,FileCog:file-cog,FileDiff:file-diff,FileDigit:file-digit,FileDown:file-down,FileExclamationPoint:file-exclamation-point,FileHeadphone:file-headphone,FileHeart:file-heart,FileImage:file-image,FileInput:file-input,FileKey:file-key,FileLock:file-lock,FileMinus:file-minus,FileMinusCorner:file-minus-corner,FileMusic:file-music,FileOutput:file-output,FilePen:file-pen,FilePenLine:file-pen-line,FilePlay:file-play,FilePlus:file-plus,FilePlusCorner:file-plus-corner,FileQuestionMark:file-question-mark,FileScan:file-scan,FileSearch:file-search,FileSearchCorner:file-search-corner,FileSignal:file-signal,FileSliders:file-sliders,FileSpreadsheet:file-spreadsheet,FileStack:file-stack,FileSymlink:file-symlink,FileTerminal:file-terminal,FileText:file-text,FileType:file-type,FileTypeCorner:file-type-corner,FileUp:file-up,FileUser:file-user,FileVideoCamera:file-video-camera,FileVolume:file-volume,FileX:file-x,FileXCorner:file-x-corner,Files:files,Film:film,FingerprintPattern:fingerprint-pattern,FireExtinguisher:fire-extinguisher,Fish:fish,FishOff:fish-off,FishSymbol:fish-symbol,FishingHook:fishing-hook,FishingRod:fishing-rod,Flag:flag,FlagOff:flag-off,FlagTriangleLeft:flag-triangle-left,FlagTriangleRight:flag-triangle-right,Flame:flame,FlameKindling:flame-kindling,Flashlight:flashlight,FlashlightOff:flashlight-off,FlaskConical:flask-conical,FlaskConicalOff:flask-conical-off,FlaskRound:flask-round,FlipHorizontal2:flip-horizontal-2,FlipVertical2:flip-vertical-2,Flower:flower,Flower2:flower-2,Focus:focus,FoldHorizontal:fold-horizontal,FoldVertical:fold-vertical,Folder:folder,FolderArchive:folder-archive,FolderBookmark:folder-bookmark,FolderCheck:folder-check,FolderClock:folder-clock,FolderClosed:folder-closed,FolderCode:folder-code,FolderCog:folder-cog,FolderDot:folder-dot,FolderDown:folder-down,FolderGit:folder-git,FolderGit2:folder-git-2,FolderHeart:folder-heart,FolderInput:folder-input,FolderKanban:folder-kanban,FolderKey:folder-key,FolderLock:folder-lock,FolderMinus:folder-minus,FolderOpen:folder-open,FolderOpenDot:folder-open-dot,FolderOutput:folder-output,FolderPen:folder-pen,FolderPlus:folder-plus,FolderRoot:folder-root,FolderSearch:folder-search,FolderSearch2:folder-search-2,FolderSymlink:folder-symlink,FolderSync:folder-sync,FolderTree:folder-tree,FolderUp:folder-up,FolderX:folder-x,Folders:folders,Footprints:footprints,Forklift:forklift,Form:form,Forward:forward,Frame:frame,Fuel:fuel,Fullscreen:fullscreen,Funnel:funnel,FunnelPlus:funnel-plus,FunnelX:funnel-x,Galaxy:galaxy,GalleryHorizontal:gallery-horizontal,GalleryHorizontalEnd:gallery-horizontal-end,GalleryThumbnails:gallery-thumbnails,GalleryVertical:gallery-vertical,GalleryVerticalEnd:gallery-vertical-end,Gamepad:gamepad,Gamepad2:gamepad-2,GamepadDirectional:gamepad-directional,GapHorizontal:gap-horizontal,GapVertical:gap-vertical,Gauge:gauge,Gavel:gavel,Gem:gem,GeorgianLari:georgian-lari,Germ:germ,GermOff:germ-off,Ghost:ghost,Gift:gift,GitBranch:git-branch,GitBranchMinus:git-branch-minus,GitBranchPlus:git-branch-plus,GitCommitHorizontal:git-commit-horizontal,GitCommitVertical:git-commit-vertical,GitCompare:git-compare,GitCompareArrows:git-compare-arrows,GitFork:git-fork,GitGraph:git-graph,GitMerge:git-merge,GitMergeConflict:git-merge-conflict,GitPullRequest:git-pull-request,GitPullRequestArrow:git-pull-request-arrow,GitPullRequestClosed:git-pull-request-closed,GitPullRequestCreate:git-pull-request-create,GitPullRequestCreateArrow:git-pull-request-create-arrow,GitPullRequestDraft:git-pull-request-draft,GlassWater:glass-water,Glasses:glasses,Globe:globe,GlobeCheck:globe-check,GlobeLock:globe-lock,GlobeOff:globe-off,GlobeX:globe-x,Goal:goal,Gpu:gpu,GraduationCap:graduation-cap,Grape:grape,Grid2x2:grid-2x2,Grid2x2Check:grid-2x2-check,Grid2x2Plus:grid-2x2-plus,Grid2x2X:grid-2x2-x,Grid3x2:grid-3x2,Grid3x3:grid-3x3,Grip:grip,GripHorizontal:grip-horizontal,GripVertical:grip-vertical,Group:group,Guitar:guitar,Ham:ham,Hamburger:hamburger,Hammer:hammer,Hand:hand,HandCoins:hand-coins,HandFist:hand-fist,HandGrab:hand-grab,HandHeart:hand-heart,HandHelping:hand-helping,HandMetal:hand-metal,HandPlatter:hand-platter,Handbag:handbag,Handshake:handshake,HardDrive:hard-drive,HardDriveDownload:hard-drive-download,HardDriveUpload:hard-drive-upload,HardHat:hard-hat,Hash:hash,HatGlasses:hat-glasses,Haze:haze,Hd:hd,HdmiPort:hdmi-port,Heading:heading,Heading1:heading-1,Heading2:heading-2,Heading3:heading-3,Heading4:heading-4,Heading5:heading-5,Heading6:heading-6,HeadphoneOff:headphone-off,Headphones:headphones,Headset:headset,Heart:heart,HeartCrack:heart-crack,HeartHandshake:heart-handshake,HeartMinus:heart-minus,HeartOff:heart-off,HeartPlus:heart-plus,HeartPulse:heart-pulse,HeartX:heart-x,Heater:heater,Helicopter:helicopter,Hexagon:hexagon,Highlighter:highlighter,Hop:hop,HopOff:hop-off,Hospital:hospital,Hotel:hotel,Hourglass:hourglass,House:house,HouseHeart:house-heart,HousePlug:house-plug,HousePlus:house-plus,HouseWifi:house-wifi,IceCreamBowl:ice-cream-bowl,IceCreamCone:ice-cream-cone,IdCard:id-card,IdCardLanyard:id-card-lanyard,Image:image,ImageDown:image-down,ImageMinus:image-minus,ImageOff:image-off,ImagePlay:image-play,ImagePlus:image-plus,ImageUp:image-up,ImageUpscale:image-upscale,Images:images,Import:import,Inbox:inbox,IndianRupee:indian-rupee,Infinity:infinity,Info:info,InspectionPanel:inspection-panel,Italic:italic,IterationCcw:iteration-ccw,IterationCw:iteration-cw,JapaneseYen:japanese-yen,Joystick:joystick,Kanban:kanban,Kayak:kayak,Key:key,KeyRound:key-round,KeySquare:key-square,Keyboard:keyboard,KeyboardMusic:keyboard-music,KeyboardOff:keyboard-off,Lamp:lamp,LampCeiling:lamp-ceiling,LampDesk:lamp-desk,LampFloor:lamp-floor,LampWallDown:lamp-wall-down,LampWallUp:lamp-wall-up,LandPlot:land-plot,Landmark:landmark,Languages:languages,Laptop:laptop,LaptopMinimal:laptop-minimal,LaptopMinimalCheck:laptop-minimal-check,Lasso:lasso,LassoSelect:lasso-select,LayerArrowDown:layer-arrow-down,LayerArrowUp:layer-arrow-up,Layers:layers,Layers2:layers-2,LayersArrowDown:layers-arrow-down,LayersArrowUp:layers-arrow-up,LayersMinus:layers-minus,LayersPlus:layers-plus,LayoutDashboard:layout-dashboard,LayoutFreeform:layout-freeform,LayoutGrid:layout-grid,LayoutList:layout-list,LayoutPanelLeft:layout-panel-left,LayoutPanelTop:layout-panel-top,LayoutTemplate:layout-template,Leaf:leaf,LeafyGreen:leafy-green,Lectern:lectern,LensConcave:lens-concave,LensConvex:lens-convex,Library:library,LibraryBig:library-big,LifeBuoy:life-buoy,Ligature:ligature,Lightbulb:lightbulb,LightbulbOff:lightbulb-off,Lighthouse:lighthouse,LineDotRightHorizontal:line-dot-right-horizontal,LineSquiggle:line-squiggle,LineStyle:line-style,Link:link,Link2:link-2,Link2Off:link-2-off,List:list,ListCheck:list-check,ListChecks:list-checks,ListChevronsDownUp:list-chevrons-down-up,ListChevronsUpDown:list-chevrons-up-down,ListClock:list-clock,ListCollapse:list-collapse,ListEnd:list-end,ListFilter:list-filter,ListFilterPlus:list-filter-plus,ListIndentDecrease:list-indent-decrease,ListIndentIncrease:list-indent-increase,ListMinus:list-minus,ListMusic:list-music,ListOrdered:list-ordered,ListPlus:list-plus,ListRestart:list-restart,ListSortAscending:list-sort-ascending,ListSortDescending:list-sort-descending,ListStart:list-start,ListTodo:list-todo,ListTree:list-tree,ListVideo:list-video,ListX:list-x,Loader:loader,LoaderCircle:loader-circle,LoaderPinwheel:loader-pinwheel,Locate:locate,LocateFixed:locate-fixed,LocateOff:locate-off,Lock:lock,LockKeyhole:lock-keyhole,LockKeyholeOpen:lock-keyhole-open,LockOpen:lock-open,LogIn:log-in,LogOut:log-out,Logs:logs,Lollipop:lollipop,Luggage:luggage,Magnet:magnet,Mail:mail,MailBadge:mail-badge,MailCheck:mail-check,MailClock:mail-clock,MailMinus:mail-minus,MailOpen:mail-open,MailPen:mail-pen,MailPlus:mail-plus,MailQuestionMark:mail-question-mark,MailSearch:mail-search,MailWarning:mail-warning,MailX:mail-x,Mailbox:mailbox,Mails:mails,Map:map,MapMinus:map-minus,MapPin:map-pin,MapPinCheck:map-pin-check,MapPinCheckInside:map-pin-check-inside,MapPinHouse:map-pin-house,MapPinMinus:map-pin-minus,MapPinMinusInside:map-pin-minus-inside,MapPinOff:map-pin-off,MapPinPen:map-pin-pen,MapPinPlus:map-pin-plus,MapPinPlusInside:map-pin-plus-inside,MapPinSearch:map-pin-search,MapPinX:map-pin-x,MapPinXInside:map-pin-x-inside,MapPinned:map-pinned,MapPlus:map-plus,Mars:mars,MarsStroke:mars-stroke,Martini:martini,Maximize:maximize,Maximize2:maximize-2,Medal:medal,Megaphone:megaphone,MegaphoneOff:megaphone-off,MemoryStick:memory-stick,Menu:menu,Merge:merge,MessageCircle:message-circle,MessageCircleCheck:message-circle-check,MessageCircleCode:message-circle-code,MessageCircleDashed:message-circle-dashed,MessageCircleDashedCheck:message-circle-dashed-check,MessageCircleHeart:message-circle-heart,MessageCircleMore:message-circle-more,MessageCircleOff:message-circle-off,MessageCirclePlus:message-circle-plus,MessageCircleQuestionMark:message-circle-question-mark,MessageCircleReply:message-circle-reply,MessageCircleWarning:message-circle-warning,MessageCircleX:message-circle-x,MessageSquare:message-square,MessageSquareCheck:message-square-check,MessageSquareCode:message-square-code,MessageSquareDashed:message-square-dashed,MessageSquareDiff:message-square-diff,MessageSquareDot:message-square-dot,MessageSquareHeart:message-square-heart,MessageSquareLock:message-square-lock,MessageSquareMore:message-square-more,MessageSquareOff:message-square-off,MessageSquarePlus:message-square-plus,MessageSquareQuote:message-square-quote,MessageSquareReply:message-square-reply,MessageSquareShare:message-square-share,MessageSquareText:message-square-text,MessageSquareWarning:message-square-warning,MessageSquareX:message-square-x,MessagesSquare:messages-square,Metronome:metronome,Mic:mic,MicAudioLines:mic-audio-lines,MicOff:mic-off,MicSignal:mic-signal,MicVocal:mic-vocal,Microchip:microchip,Microscope:microscope,Microwave:microwave,MidiPort:midi-port,Milestone:milestone,Milk:milk,MilkOff:milk-off,Minimize:minimize,Minimize2:minimize-2,Minus:minus,MirrorRectangular:mirror-rectangular,MirrorRound:mirror-round,Monitor:monitor,MonitorCheck:monitor-check,MonitorCloud:monitor-cloud,MonitorCog:monitor-cog,MonitorDot:monitor-dot,MonitorDown:monitor-down,MonitorOff:monitor-off,MonitorPause:monitor-pause,MonitorPlay:monitor-play,MonitorSmartphone:monitor-smartphone,MonitorSpeaker:monitor-speaker,MonitorStop:monitor-stop,MonitorUp:monitor-up,MonitorX:monitor-x,Moon:moon,MoonStar:moon-star,Mop:mop,MopSparkles:mop-sparkles,Mosque:mosque,Motorbike:motorbike,Mountain:mountain,MountainSnow:mountain-snow,Mouse:mouse,MouseLeft:mouse-left,MouseOff:mouse-off,MousePointer:mouse-pointer,MousePointer2:mouse-pointer-2,MousePointer2Off:mouse-pointer-2-off,MousePointerBan:mouse-pointer-ban,MousePointerClick:mouse-pointer-click,MouseRight:mouse-right,Move:move,Move3d:move-3d,MoveDiagonal:move-diagonal,MoveDiagonal2:move-diagonal-2,MoveDown:move-down,MoveDownLeft:move-down-left,MoveDownRight:move-down-right,MoveHorizontal:move-horizontal,MoveLeft:move-left,MoveRight:move-right,MoveUp:move-up,MoveUpLeft:move-up-left,MoveUpRight:move-up-right,MoveVertical:move-vertical,Music:music,Music2:music-2,Music3:music-3,Music4:music-4,Navigation:navigation,Navigation2:navigation-2,Navigation2Off:navigation-2-off,NavigationOff:navigation-off,Network:network,Newspaper:newspaper,Nfc:nfc,NonBinary:non-binary,Notebook:notebook,NotebookPen:notebook-pen,NotebookTabs:notebook-tabs,NotebookText:notebook-text,NotepadText:notepad-text,NotepadTextDashed:notepad-text-dashed,Nut:nut,NutOff:nut-off,Octagon:octagon,OctagonAlert:octagon-alert,OctagonMinus:octagon-minus,OctagonPause:octagon-pause,OctagonX:octagon-x,Omega:omega,Option:option,Orbit:orbit,Origami:origami,Package:package,Package2:package-2,PackageCheck:package-check,PackageMinus:package-minus,PackageOpen:package-open,PackagePlus:package-plus,PackageSearch:package-search,PackageX:package-x,PaintBucket:paint-bucket,PaintRoller:paint-roller,Paintbrush:paintbrush,PaintbrushVertical:paintbrush-vertical,Palette:palette,Panda:panda,PanelBottom:panel-bottom,PanelBottomClose:panel-bottom-close,PanelBottomDashed:panel-bottom-dashed,PanelBottomOpen:panel-bottom-open,PanelLeft:panel-left,PanelLeftClose:panel-left-close,PanelLeftDashed:panel-left-dashed,PanelLeftOpen:panel-left-open,PanelLeftRightDashed:panel-left-right-dashed,PanelRight:panel-right,PanelRightClose:panel-right-close,PanelRightDashed:panel-right-dashed,PanelRightOpen:panel-right-open,PanelTop:panel-top,PanelTopBottomDashed:panel-top-bottom-dashed,PanelTopClose:panel-top-close,PanelTopDashed:panel-top-dashed,PanelTopOpen:panel-top-open,PanelsLeftBottom:panels-left-bottom,PanelsRightBottom:panels-right-bottom,PanelsTopLeft:panels-top-left,PaperBag:paper-bag,Paperclip:paperclip,Parasol:parasol,Parentheses:parentheses,ParkingMeter:parking-meter,PartyPopper:party-popper,Pause:pause,PawPrint:paw-print,PcCase:pc-case,Pen:pen,PenLine:pen-line,PenOff:pen-off,PenTool:pen-tool,Pencil:pencil,PencilLine:pencil-line,PencilOff:pencil-off,PencilRuler:pencil-ruler,PencilSparkles:pencil-sparkles,Pentagon:pentagon,Percent:percent,PersonStanding:person-standing,Phi:phi,PhilippinePeso:philippine-peso,Phone:phone,PhoneCall:phone-call,PhoneForwarded:phone-forwarded,PhoneIncoming:phone-incoming,PhoneMissed:phone-missed,PhoneOff:phone-off,PhoneOutgoing:phone-outgoing,Pi:pi,Piano:piano,Pickaxe:pickaxe,PictureInPicture:picture-in-picture,PictureInPicture2:picture-in-picture-2,PiggyBank:piggy-bank,Pilcrow:pilcrow,PilcrowLeft:pilcrow-left,PilcrowRight:pilcrow-right,Pill:pill,PillBottle:pill-bottle,Pin:pin,PinOff:pin-off,Pipette:pipette,Pizza:pizza,Plane:plane,PlaneLanding:plane-landing,PlaneTakeoff:plane-takeoff,Play:play,PlayOff:play-off,PlayingCard:playing-card,PlayingCards:playing-cards,PlayingCardsFan:playing-cards-fan,Plug:plug,Plug2:plug-2,PlugZap:plug-zap,Plus:plus,PocketKnife:pocket-knife,Podium:podium,Pointer:pointer,PointerOff:pointer-off,Popcorn:popcorn,Popsicle:popsicle,PoundSterling:pound-sterling,Power:power,PowerOff:power-off,Presentation:presentation,Printer:printer,PrinterCheck:printer-check,PrinterX:printer-x,Projector:projector,Proportions:proportions,Puzzle:puzzle,Pyramid:pyramid,QrCode:qr-code,Quote:quote,Rabbit:rabbit,Radar:radar,Radiation:radiation,Radical:radical,Radio:radio,RadioOff:radio-off,RadioReceiver:radio-receiver,RadioTower:radio-tower,Radius:radius,Rainbow:rainbow,Rat:rat,Ratio:ratio,Receipt:receipt,ReceiptCent:receipt-cent,ReceiptEuro:receipt-euro,ReceiptIndianRupee:receipt-indian-rupee,ReceiptJapaneseYen:receipt-japanese-yen,ReceiptPoundSterling:receipt-pound-sterling,ReceiptRussianRuble:receipt-russian-ruble,ReceiptSwissFranc:receipt-swiss-franc,ReceiptText:receipt-text,ReceiptTurkishLira:receipt-turkish-lira,RectangleCircle:rectangle-circle,RectangleEllipsis:rectangle-ellipsis,RectangleGoggles:rectangle-goggles,RectangleHorizontal:rectangle-horizontal,RectangleVertical:rectangle-vertical,Recycle:recycle,Redo:redo,Redo2:redo-2,RedoDot:redo-dot,RefreshCcw:refresh-ccw,RefreshCcwDot:refresh-ccw-dot,RefreshCw:refresh-cw,RefreshCwOff:refresh-cw-off,Refrigerator:refrigerator,Regex:regex,RemoveFormatting:remove-formatting,Repeat:repeat,Repeat1:repeat-1,Repeat2:repeat-2,RepeatOff:repeat-off,Replace:replace,ReplaceAll:replace-all,Reply:reply,ReplyAll:reply-all,Rewind:rewind,Ribbon:ribbon,Road:road,RobotArm:robot-arm,RobotVacuum:robot-vacuum,Rocket:rocket,RockingChair:rocking-chair,RollerCoaster:roller-coaster,Rose:rose,Rotate3d:rotate-3d,RotateCcw:rotate-ccw,RotateCcwClock:rotate-ccw-clock,RotateCcwKey:rotate-ccw-key,RotateCcwSquare:rotate-ccw-square,RotateCw:rotate-cw,RotateCwFadingClock:rotate-cw-fading-clock,RotateCwSquare:rotate-cw-square,Route:route,RouteOff:route-off,Router:router,Rows2:rows-2,Rows3:rows-3,Rows4:rows-4,Rss:rss,Ruler:ruler,RulerDimensionLine:ruler-dimension-line,RussianRuble:russian-ruble,Sailboat:sailboat,Salad:salad,Sandwich:sandwich,Satellite:satellite,SatelliteDish:satellite-dish,SaudiRiyal:saudi-riyal,Save:save,SaveAll:save-all,SaveCheck:save-check,SaveOff:save-off,SavePen:save-pen,SavePlus:save-plus,Scale:scale,Scale3d:scale-3d,Scaling:scaling,Scan:scan,ScanBarcode:scan-barcode,ScanBox:scan-box,ScanEye:scan-eye,ScanFace:scan-face,ScanHeart:scan-heart,ScanLine:scan-line,ScanQrCode:scan-qr-code,ScanSearch:scan-search,ScanSquare:scan-square,ScanText:scan-text,School:school,Scissors:scissors,ScissorsLineDashed:scissors-line-dashed,Scooter:scooter,ScreenShare:screen-share,ScreenShareOff:screen-share-off,Scroll:scroll,ScrollText:scroll-text,Search:search,SearchAlert:search-alert,SearchCheck:search-check,SearchCode:search-code,SearchSlash:search-slash,SearchX:search-x,Section:section,Send:send,SendHorizontal:send-horizontal,SendToBack:send-to-back,SeparatorHorizontal:separator-horizontal,SeparatorVertical:separator-vertical,Server:server,ServerCog:server-cog,ServerCrash:server-crash,ServerOff:server-off,ServerPlus:server-plus,Settings:settings,Settings2:settings-2,Shapes:shapes,Share:share,Share2:share-2,Sheet:sheet,Shell:shell,ShelvingUnit:shelving-unit,Shield:shield,ShieldAlert:shield-alert,ShieldBan:shield-ban,ShieldCheck:shield-check,ShieldCog:shield-cog,ShieldCogCorner:shield-cog-corner,ShieldEllipsis:shield-ellipsis,ShieldHalf:shield-half,ShieldKeyhole:shield-keyhole,ShieldLock:shield-lock,ShieldMinus:shield-minus,ShieldOff:shield-off,ShieldPlus:shield-plus,ShieldQuestionMark:shield-question-mark,ShieldUser:shield-user,ShieldX:shield-x,Ship:ship,ShipCargo:ship-cargo,ShipWheel:ship-wheel,Shirt:shirt,ShoppingBag:shopping-bag,ShoppingBasket:shopping-basket,ShoppingCart:shopping-cart,ShoppingCartMinus:shopping-cart-minus,ShoppingCartPlus:shopping-cart-plus,Shovel:shovel,ShowerHead:shower-head,Shredder:shredder,Shrimp:shrimp,ShrimpOff:shrimp-off,Shrink:shrink,Shrub:shrub,Shuffle:shuffle,Sigma:sigma,Signal:signal,SignalHigh:signal-high,SignalLow:signal-low,SignalMedium:signal-medium,SignalZero:signal-zero,Signature:signature,Signpost:signpost,SignpostBig:signpost-big,Siren:siren,SkipBack:skip-back,SkipForward:skip-forward,Skull:skull,Slash:slash,Slice:slice,SlidersHorizontal:sliders-horizontal,SlidersVertical:sliders-vertical,Smartphone:smartphone,SmartphoneCharging:smartphone-charging,SmartphoneNfc:smartphone-nfc,Snail:snail,Snowflake:snowflake,SoapDispenserDroplet:soap-dispenser-droplet,Sofa:sofa,SolarPanel:solar-panel,Soup:soup,Space:space,Spade:spade,Sparkle:sparkle,Sparkles:sparkles,Speaker:speaker,Speech:speech,SpellCheck:spell-check,SpellCheck2:spell-check-2,Spline:spline,SplinePointer:spline-pointer,Split:split,Spool:spool,SportShoe:sport-shoe,Spotlight:spotlight,SprayCan:spray-can,Sprout:sprout,Square:square,SquareActivity:square-activity,SquareArrowDown:square-arrow-down,SquareArrowDownLeft:square-arrow-down-left,SquareArrowDownRight:square-arrow-down-right,SquareArrowLeft:square-arrow-left,SquareArrowOutDownLeft:square-arrow-out-down-left,SquareArrowOutDownRight:square-arrow-out-down-right,SquareArrowOutUpLeft:square-arrow-out-up-left,SquareArrowOutUpRight:square-arrow-out-up-right,SquareArrowRight:square-arrow-right,SquareArrowRightEnter:square-arrow-right-enter,SquareArrowRightExit:square-arrow-right-exit,SquareArrowUp:square-arrow-up,SquareArrowUpLeft:square-arrow-up-left,SquareArrowUpRight:square-arrow-up-right,SquareAsterisk:square-asterisk,SquareBottomDashedScissors:square-bottom-dashed-scissors,SquareCenterlineDashedHorizontal:square-centerline-dashed-horizontal,SquareCenterlineDashedVertical:square-centerline-dashed-vertical,SquareChartGantt:square-chart-gantt,SquareCheck:square-check,SquareCheckBig:square-check-big,SquareChevronDown:square-chevron-down,SquareChevronLeft:square-chevron-left,SquareChevronRight:square-chevron-right,SquareChevronUp:square-chevron-up,SquareCode:square-code,SquareDashed:square-dashed,SquareDashedBottom:square-dashed-bottom,SquareDashedBottomCode:square-dashed-bottom-code,SquareDashedKanban:square-dashed-kanban,SquareDashedMousePointer:square-dashed-mouse-pointer,SquareDashedText:square-dashed-text,SquareDashedTopSolid:square-dashed-top-solid,SquareDimensions:square-dimensions,SquareDivide:square-divide,SquareDot:square-dot,SquareEqual:square-equal,SquareExclamationPoint:square-exclamation-point,SquareFunction:square-function,SquareKanban:square-kanban,SquareLibrary:square-library,SquareM:square-m,SquareMenu:square-menu,SquareMinus:square-minus,SquareMousePointer:square-mouse-pointer,SquareOff:square-off,SquareParking:square-parking,SquareParkingOff:square-parking-off,SquarePause:square-pause,SquarePen:square-pen,SquarePercent:square-percent,SquarePi:square-pi,SquarePilcrow:square-pilcrow,SquarePlay:square-play,SquarePlus:square-plus,SquarePower:square-power,SquareRadical:square-radical,SquareRoundCorner:square-round-corner,SquareScissors:square-scissors,SquareSigma:square-sigma,SquareSlash:square-slash,SquareSplitHorizontal:square-split-horizontal,SquareSplitVertical:square-split-vertical,SquareSquare:square-square,SquareStack:square-stack,SquareStar:square-star,SquareStop:square-stop,SquareTerminal:square-terminal,SquareText:square-text,SquareUser:square-user,SquareUserRound:square-user-round,SquareX:square-x,SquaresExclude:squares-exclude,SquaresIntersect:squares-intersect,SquaresSubtract:squares-subtract,SquaresUnite:squares-unite,Squircle:squircle,SquircleDashed:squircle-dashed,Squirrel:squirrel,Stamp:stamp,Star:star,StarCheck:star-check,StarHalf:star-half,StarMinus:star-minus,StarOff:star-off,StarPlus:star-plus,StarX:star-x,StepBack:step-back,StepForward:step-forward,Stethoscope:stethoscope,Sticker:sticker,StickyNote:sticky-note,StickyNoteCheck:sticky-note-check,StickyNoteMinus:sticky-note-minus,StickyNoteOff:sticky-note-off,StickyNotePlus:sticky-note-plus,StickyNoteX:sticky-note-x,StickyNotes:sticky-notes,Stone:stone,Store:store,StretchHorizontal:stretch-horizontal,StretchVertical:stretch-vertical,Strikethrough:strikethrough,Subscript:subscript,Summary:summary,Sun:sun,SunDim:sun-dim,SunMedium:sun-medium,SunMoon:sun-moon,SunSnow:sun-snow,Sunrise:sunrise,Sunset:sunset,Superscript:superscript,SwatchBook:swatch-book,SwissFranc:swiss-franc,SwitchCamera:switch-camera,Sword:sword,Swords:swords,Syringe:syringe,Table:table,Table2:table-2,TableCellsMerge:table-cells-merge,TableCellsSplit:table-cells-split,TableColumnsSplit:table-columns-split,TableOfContents:table-of-contents,TableProperties:table-properties,TableRowsSplit:table-rows-split,Tablet:tablet,TabletSmartphone:tablet-smartphone,Tablets:tablets,Tag:tag,TagPlus:tag-plus,TagX:tag-x,Tags:tags,Tally1:tally-1,Tally2:tally-2,Tally3:tally-3,Tally4:tally-4,Tally5:tally-5,Tangent:tangent,Target:target,Telescope:telescope,Tent:tent,TentTree:tent-tree,Terminal:terminal,TestTube:test-tube,TestTubeDiagonal:test-tube-diagonal,TestTubes:test-tubes,TextAlignCenter:text-align-center,TextAlignEnd:text-align-end,TextAlignJustify:text-align-justify,TextAlignStart:text-align-start,TextCursor:text-cursor,TextCursorInput:text-cursor-input,TextInitial:text-initial,TextQuote:text-quote,TextSearch:text-search,TextWrap:text-wrap,Theater:theater,Thermometer:thermometer,ThermometerSnowflake:thermometer-snowflake,ThermometerSun:thermometer-sun,ThumbsDown:thumbs-down,ThumbsUp:thumbs-up,TicTacToe:tic-tac-toe,Ticket:ticket,TicketCheck:ticket-check,TicketMinus:ticket-minus,TicketPercent:ticket-percent,TicketPlus:ticket-plus,TicketSlash:ticket-slash,TicketX:ticket-x,Tickets:tickets,TicketsPlane:tickets-plane,Timeline:timeline,Timer:timer,TimerOff:timer-off,TimerReset:timer-reset,ToggleLeft:toggle-left,ToggleRight:toggle-right,Toilet:toilet,ToolCase:tool-case,Toolbox:toolbox,Tornado:tornado,Torus:torus,Touchpad:touchpad,TouchpadOff:touchpad-off,TowelRack:towel-rack,TowerControl:tower-control,ToyBrick:toy-brick,Tractor:tractor,TrafficCone:traffic-cone,Trailer:trailer,TrainFront:train-front,TrainFrontTunnel:train-front-tunnel,TrainTrack:train-track,TramFront:tram-front,Transgender:transgender,Trash:trash,TrashOff:trash-off,TreeDeciduous:tree-deciduous,TreePalm:tree-palm,TreePine:tree-pine,Trees:trees,TrendingDown:trending-down,TrendingUp:trending-up,TrendingUpDown:trending-up-down,Triangle:triangle,TriangleAlert:triangle-alert,TriangleDashed:triangle-dashed,TriangleRight:triangle-right,Trophy:trophy,Truck:truck,TruckElectric:truck-electric,TurkishLira:turkish-lira,Turntable:turntable,Turtle:turtle,Tv:tv,TvMinimal:tv-minimal,TvMinimalPlay:tv-minimal-play,Type:type,TypeOutline:type-outline,Umbrella:umbrella,UmbrellaOff:umbrella-off,Underline:underline,Undo:undo,Undo2:undo-2,UndoDot:undo-dot,UnfoldHorizontal:unfold-horizontal,UnfoldVertical:unfold-vertical,Ungroup:ungroup,University:university,Unlink:unlink,Unlink2:unlink-2,Unplug:unplug,Upload:upload,Usb:usb,UsbCPort:usb-c-port,User:user,UserCheck:user-check,UserCog:user-cog,UserGroup:user-group,UserKey:user-key,UserLock:user-lock,UserMinus:user-minus,UserPen:user-pen,UserPlus:user-plus,UserRound:user-round,UserRoundArrowLeft:user-round-arrow-left,UserRoundCheck:user-round-check,UserRoundCog:user-round-cog,UserRoundGroup:user-round-group,UserRoundKey:user-round-key,UserRoundMinus:user-round-minus,UserRoundPen:user-round-pen,UserRoundPlus:user-round-plus,UserRoundSearch:user-round-search,UserRoundX:user-round-x,UserSearch:user-search,UserShield:user-shield,UserStar:user-star,UserX:user-x,Users:users,UsersRound:users-round,Utensils:utensils,UtensilsCrossed:utensils-crossed,UtilityPole:utility-pole,Van:van,Variable:variable,Vault:vault,VectorPolygon:vector-polygon,VectorSquare:vector-square,Vegan:vegan,VenetianMask:venetian-mask,Venus:venus,VenusAndMars:venus-and-mars,Vibrate:vibrate,VibrateOff:vibrate-off,Video:video,VideoOff:video-off,Videotape:videotape,View:view,Virus:virus,VirusOff:virus-off,Voicemail:voicemail,Volleyball:volleyball,Volume:volume,Volume1:volume-1,Volume2:volume-2,VolumeOff:volume-off,VolumeX:volume-x,Vote:vote,Wallet:wallet,WalletCards:wallet-cards,WalletMinimal:wallet-minimal,Wallpaper:wallpaper,Wand:wand,WandSparkles:wand-sparkles,Warehouse:warehouse,WashingMachine:washing-machine,Watch:watch,WavesArrowDown:waves-arrow-down,WavesArrowUp:waves-arrow-up,WavesHorizontal:waves-horizontal,WavesLadder:waves-ladder,WavesVertical:waves-vertical,Waypoints:waypoints,Webcam:webcam,WebcamOff:webcam-off,Webhook:webhook,WebhookOff:webhook-off,Weight:weight,WeightTilde:weight-tilde,Wheat:wheat,WheatOff:wheat-off,Whistle:whistle,WholeWord:whole-word,Wifi:wifi,WifiCog:wifi-cog,WifiHigh:wifi-high,WifiLow:wifi-low,WifiOff:wifi-off,WifiPen:wifi-pen,WifiSync:wifi-sync,WifiZero:wifi-zero,Wind:wind,WindArrowDown:wind-arrow-down,Wine:wine,WineOff:wine-off,Workflow:workflow,Worm:worm,Wrench:wrench,WrenchOff:wrench-off,X:x,XLineTop:x-line-top,Zap:zap,ZapOff:zap-off,ZodiacAquarius:zodiac-aquarius,ZodiacAries:zodiac-aries,ZodiacCancer:zodiac-cancer,ZodiacCapricorn:zodiac-capricorn,ZodiacGemini:zodiac-gemini,ZodiacLeo:zodiac-leo,ZodiacLibra:zodiac-libra,ZodiacOphiuchus:zodiac-ophiuchus,ZodiacPisces:zodiac-pisces,ZodiacSagittarius:zodiac-sagittarius,ZodiacScorpio:zodiac-scorpio,ZodiacTaurus:zodiac-taurus,ZodiacVirgo:zodiac-virgo,ZoomIn:zoom-in,ZoomOut:zoom-out`,Pa={Home:`House`};function Fa(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var Ia=null;function La(e){if(Ia===null){let e=new Map;for(let t of Na.split(`,`)){let n=t.indexOf(`:`);e.set(t.slice(0,n),t.slice(n+1))}Ia=e}return Ia.get(e)}function Ra(e,t,n){return[`lucide-${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,`lucide-${t}`,n].filter((e,t,n)=>!!e&&String(e).trim()!==``&&n.indexOf(e)===t).join(` `).trim()}var za=[],Ba=new Map,Va=new Map;function Ha(e,t){let n=Va.get(e);if(n)return n;let r=a.default.forwardRef(({className:n,...r},i)=>{let[o,s]=a.default.useState(()=>Ba.get(t));return a.default.useEffect(()=>{if(o!==void 0)return;let e=!0,n=ie.dynamicIconImports[t];if(n)return n().then(n=>{let r=n.__iconData?.node??n.__iconNode;r&&(Ba.set(t,r),e&&s(r))}).catch(()=>{}),()=>{e=!1}},[o]),a.default.createElement(l.Icon,{...r,ref:i,iconNode:o??za,className:Ra(e,t,n)})});r.displayName=e;let i=r;return Va.set(e,i),i}function Ua(e){let t=Fa(e);return{pascal:t,key:Pa[t]||t}}function Wa(e){if(!e)return null;let t=Ua(e).key,n=La(t);return n===void 0?null:Ha(t,n)}var Ga=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...u}=r,d=e.size?{width:e.size,height:e.size}:void 0,f=q(e.color,e.className,n),p=typeof e.icon==`string`?e.icon:``,m=typeof e.name==`string`&&e.name.length>0?e.name:``,{pascal:h,key:g}=Ua(p),_=p?Wa(p):void 0;return _?(0,o.jsx)(_,{ref:i,className:f,style:{...d,...c},...(0,t.toDomProps)(u),"data-obj-id":a,"data-obj-type":s}):(console.warn(`ui:icon: no lucide glyph resolves for ${p?`"${p}"`:`an absent icon name`}${p?` (lookup: "${h}"${g===h?``:` -> "${g}"`})`:``}. Rendering a visible placeholder instead of nothing (objectui#5631).`+(!p&&m?` This node names its glyph with the SDUI identity key \`name\` ("${m}"), which is no longer read as a glyph name. Rename it: \`icon: "${m}"\`. Stored metadata converts in bulk with \`migrateIconNodeKeys\` from \`@object-ui/types\`.`:``)),(0,o.jsx)(l.SquareDashed,{ref:i,role:`img`,"aria-label":p?`Unresolved icon: ${p}`:m?`Unresolved icon: \`name\` is no longer the icon key, rename it to \`icon\` (${m})`:`Unresolved icon`,className:f,style:{...d,...c},...(0,t.toDomProps)(u),"data-obj-id":a,"data-obj-type":s,"data-objectui-icon-unresolved":p||`(none)`,...!p&&m?{"data-objectui-icon-legacy-name-key":m}:{}}))});Ga.displayName=`IconRenderer`,t.ComponentRegistry.register(`icon`,Ga,{namespace:`ui`,label:`Icon`,icon:`face-slightly-smiling`,category:`basic`,inputs:[{name:`icon`,type:`string`},{name:`size`,type:`number`},{name:`color`,type:`string`},{name:`className`,type:`string`}]}),t.ComponentRegistry.register(`html`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`div`,{className:q(`prose prose-sm max-w-none dark:prose-invert`,t),dangerouslySetInnerHTML:{__html:e.html},...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`HTML Content`,inputs:[{name:`html`,type:`string`,description:`Raw HTML content`}]});var Ka=new Set([`img`,`hr`,`br`]),qa=`h1.h2.h3.h4.h5.h6.p.a.blockquote.pre.code.strong.em.b.i.u.small.mark.sub.sup.del.ins.abbr.ul.ol.li.dl.dt.dd.figure.figcaption.img.hr.br.time.address.cite.q`.split(`.`),Ja={a:[{name:`href`,type:`string`},{name:`target`,type:`string`},{name:`rel`,type:`string`},{name:`title`,type:`string`}],img:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`width`,type:`number`},{name:`height`,type:`number`},{name:`title`,type:`string`}],time:[{name:`dateTime`,type:`string`}],abbr:[{name:`title`,type:`string`}],q:[{name:`cite`,type:`string`}],blockquote:[{name:`cite`,type:`string`}]};function Ya(e){if(typeof e!=`string`)return;let t=e.trim();if(!/^(javascript|data|vbscript):/i.test(t))return t}function Xa(e){if(typeof e!=`string`||e.trim().length===0)return null;let t=e.trim();if(/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith(`//`)||t.startsWith(`#`))return null;try{let e=new URL(t,`https://internal.invalid/`);return e.pathname+e.search+e.hash}catch{return null}}for(let e of qa){let n=Ka.has(e),r=(0,a.forwardRef)(({schema:t,className:r,...o},s)=>{let{"data-obj-id":c,"data-obj-type":l,style:u,dangerouslySetInnerHTML:d,children:f,...p}=o,m={};for(let[e,t]of Object.entries(p))/^on[A-Z]/.test(e)||(m[e]=t);e===`a`&&`href`in m&&(m.href=Ya(m.href));let h=(0,a.useContext)(i.ActionCtxReact),g;if(e===`a`&&h){let e=Xa(m.href),t=typeof m.target==`string`?m.target:``;e&&(!t||t===`_self`)&&(g=t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),h.runner.execute({type:`url`,target:e,toast:{showOnSuccess:!1}}).then(e=>{e?.success&&e.redirect&&window.location.assign(e.redirect)}))})}return(0,a.createElement)(e,{ref:s,className:r,...m,...g?{onClick:g}:{},"data-obj-id":c,"data-obj-type":l,style:u},n?void 0:J(t?.children))});r.displayName=`Html${e.charAt(0).toUpperCase()}${e.slice(1)}`,t.ComponentRegistry.register(e,r,{namespace:`ui`,label:e.toUpperCase(),category:`basic`,inputs:[{name:`className`,type:`string`},...Ja[e]??[],...n?[]:[{name:`children`,type:`slot`}]]})}t.ComponentRegistry.register(`button-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(`div`,{className:q(`flex flex-wrap sm:inline-flex rounded-md shadow-sm`,e.className),role:`group`,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.buttons?.map((t,n)=>(0,o.jsx)(X,{variant:t.variant||e.variant,size:t.size||e.size,disabled:t.disabled,className:q(`rounded-none`,n===0&&`rounded-l-md`,n===(e.buttons?.length||0)-1&&`rounded-r-md`,n>0&&`-ml-px`,t.className),children:t.label},n))})},{namespace:`ui`,label:`Button Group`,inputs:[{name:`variant`,type:`enum`,enum:[`default`,`destructive`,`outline`,`secondary`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`]},{name:`className`,type:`string`}],defaultProps:{variant:`default`,size:`default`,buttons:[{label:`Left`},{label:`Middle`},{label:`Right`}]}}),t.ComponentRegistry.register(`pagination`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,onPageChange:a,...s}=t,c=e.currentPage||1,l=e.totalPages||1,u=(e,t)=>{t.preventDefault(),e!==c&&(e<1||e>l||a&&a(e))},d=()=>l<=7?Array.from({length:l},(e,t)=>t+1):c<=3?[1,2,3,4,5,-1,l]:c>=l-2?[1,-1,l-4,l-3,l-2,l-1,l]:[1,-1,c-1,c,c+1,-1,l];return(0,o.jsx)(kr,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsxs)(Ar,{children:[(0,o.jsx)(jr,{children:(0,o.jsx)(Nr,{href:`#`,onClick:e=>u(c-1,e),className:c<=1?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c<=1})}),d().map((e,t)=>(0,o.jsx)(jr,{children:e===-1?(0,o.jsx)(Fr,{}):(0,o.jsx)(Mr,{href:`#`,isActive:e===c,onClick:t=>u(e,t),className:`cursor-pointer`,children:e})},t)),(0,o.jsx)(jr,{children:(0,o.jsx)(Pr,{href:`#`,onClick:e=>u(c+1,e),className:c>=l?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c>=l})})]})})},{namespace:`ui`,label:`Pagination`,inputs:[{name:`currentPage`,type:`number`},{name:`totalPages`,type:`number`},{name:`className`,type:`string`}],defaultProps:{currentPage:1,totalPages:10}}),t.ComponentRegistry.register(`navigation-menu`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(br,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsx)(xr,{children:e.items?.map((e,t)=>(0,o.jsx)(Sr,{children:e.children?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wr,{children:e.label}),(0,o.jsx)(Tr,{children:(0,o.jsx)(`ul`,{className:`grid w-full gap-3 p-4 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]`,children:e.children.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(Er,{asChild:!0,children:(0,o.jsxs)(`a`,{className:q(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`),href:e.href,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium leading-none`,children:e.label}),e.description&&(0,o.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:e.description})]})})},t))})})]}):(0,o.jsx)(Er,{href:e.href,children:e.label})},t))})})},{namespace:`ui`,label:`Navigation Menu`,inputs:[{name:`className`,type:`string`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`About`,href:`/about`}]}});function Za(e){return e.includes(`-`)?e.toLowerCase():e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).replace(/(?<![0-9])([A-Za-z])([0-9])/g,`$1-$2`).toLowerCase()}var Qa=new Set(ie.iconNames);function $a(e){return Qa.has(e)}function eo(e){return!!e&&$a(Za(e))}var to=new Map;function no(e){if(!e)return l.Database;let t=to.get(e);if(t)return t;let n=Za(e);if(!$a(n))return to.set(e,l.Database),l.Database;let r=e=>a.default.createElement(ie.DynamicIcon,{name:n,fallback:l.Database,...e});return r.displayName=`LucideIcon(${e})`,to.set(e,r),r}var ro=({name:e,...t})=>{if(!e)return a.default.createElement(l.Database,t);let n=Za(e);return $a(n)?a.default.createElement(ie.DynamicIcon,{name:n,fallback:l.Database,...t}):a.default.createElement(l.Database,t)};function io(e){let t=(0,i.isConfigBag)(e?.props)?e.props:{},n=(0,i.isConfigBag)(e?.properties)?e.properties:{};return{...t,...n}}var ao=new Set;function oo(e,t){if(process.env.NODE_ENV===`production`)return;let n=String(e.name??e.label??`(unnamed)`),r=`${t}:${n}`;ao.has(r)||(ao.add(r),console.warn(`[${t}] action "${n}" carries an OBJECT under node-level \`params\`; it is ignored. \`params\` is only the \`ActionParam[]\` list of inputs to collect from the user. Put static execution values under \`properties.params\` instead (for a \`type: "api"\` request payload, use \`bodyExtra\`). See objectui#10289.`))}function so(e){let t=e.properties;return(0,i.isConfigBag)(t)&&(0,i.isConfigBag)(t.params)?t.params:void 0}function co(e,t){let n=so(e),r=e.params;return(0,i.isConfigBag)(r)&&r!==n&&oo(e,t),n}function lo(e,t){let n=e.properties;return(0,i.isConfigBag)(n)?{...e,properties:t(n)}:e}function uo(e,t){if(so(e))return so(lo(e,t))}function fo(e,t,n){let r=e.params;if(!(r==null||Array.isArray(r))){if(t===`api`)return r;(0,i.isConfigBag)(r)&&po(e,t,n)}}function po(e,t,n){if(process.env.NODE_ENV===`production`)return;let r=String(e.name??e.label??`(unnamed)`),i=`entry:${n}:${r}`;ao.has(i)||(ao.add(i),console.warn(`[${n}] action "${r}" (type "${String(t)}") carries an OBJECT under \`params\`; it is not forwarded. \`params\` is only the \`ActionParam[]\` list of inputs to collect from the user. Only a \`type: "api"\` action still reads an object \`params\`, as its request payload, until 18 (use \`bodyExtra\`). See objectui#10462.`))}var mo={left:`text-left`,center:`text-center`,right:`text-right`},ho={h1:`text-4xl font-semibold tracking-tight`,h2:`text-3xl font-semibold tracking-tight`,h3:`text-2xl font-semibold tracking-tight`,h4:`text-xl font-semibold tracking-tight`,h5:`text-lg font-semibold tracking-tight`,h6:`text-base font-semibold tracking-tight`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`,overline:`text-xs font-medium uppercase tracking-widest text-muted-foreground`,heading:`text-2xl font-semibold tracking-tight`,subheading:`text-lg font-medium text-foreground`},go={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,body:`p`,caption:`p`,overline:`p`,heading:`h2`,subheading:`h3`};function _o({schema:e}){let t=io(e),{language:n}=(0,_.useObjectTranslation)(),r=(0,_.useDisplayLocale)(),a=t.variant??`body`,s=t.align??`left`,c=go[a]??`p`;return(0,o.jsx)(c,{className:q(ho[a]??ho.body,mo[s],e?.className),...(0,i.resolveInlineAriaProps)(t.aria,r),children:(0,_.pickLocalized)(t.content,n)})}t.ComponentRegistry.register(`text`,_o,{namespace:`element`,skipFallback:!0,label:`Text`,category:`content`,inputs:[{name:`content`,type:[`string`,`object`],required:!0,description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`variant`,type:`enum`,enum:[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`body`,`caption`,`overline`,`heading`,`subheading`],description:`One of the nine text styles ui:text uses: h1-h6 (rendered as that heading level), body, caption or overline. heading and subheading are earlier spellings the contract still accepts and renders as h2 and h3; write h2 or h3 instead.`},{name:`align`,type:`enum`,enum:[`left`,`center`,`right`]}]});function vo({schema:e}){return(0,o.jsx)(ei,{className:q(`my-4`,e?.className)})}t.ComponentRegistry.register(`divider`,vo,{namespace:`element`,skipFallback:!0,label:`Divider`,category:`content`});var yo={cover:`object-cover`,contain:`object-contain`,fill:`object-fill`};function bo({schema:e}){let t=io(e),n=(0,_.useDisplayLocale)(),r=t.fit??`cover`;return t.src?(0,o.jsx)(`img`,{src:t.src,alt:t.alt??``,className:q(`w-full rounded-md`,yo[r]??yo.cover,e?.className),style:t.height?{height:t.height}:void 0,...(0,i.resolveInlineAriaProps)(t.aria,n)}):(0,o.jsx)(`div`,{className:q(`flex items-center justify-center rounded-md border border-dashed bg-muted/30 text-xs text-muted-foreground`,e?.className),style:{height:t.height??120},children:`no image source`})}t.ComponentRegistry.register(`image`,bo,{namespace:`element`,skipFallback:!0,label:`Image`,category:`content`});var xo={primary:`default`,secondary:`secondary`,danger:`destructive`,ghost:`ghost`,link:`link`},So={small:`sm`,medium:`default`,large:`lg`};function Co({schema:e}){let t=io(e),n=xo[t.variant??`primary`]??`default`,r=So[t.size??`medium`]??`default`,{language:s}=(0,_.useObjectTranslation)(),c=(0,_.useDisplayLocale)(),l=(0,_.pickLocalized)(t.label,s),u=t.iconPosition??`left`,d=t.icon?(0,o.jsx)(ro,{name:t.icon,className:`h-4 w-4`}):null,{execute:f}=(0,i.useAction)(),[p,m]=a.useState(!1),h=t.action,g=a.useCallback(async()=>{if(h&&!p){m(!0);try{let e=Array.isArray(h.params)?{actionParams:h.params}:{params:fo(h,h.actionType||h.type,`element:button`)};await f({type:h.actionType||h.type,name:h.name,label:h.label,description:h.description,target:h.target,openIn:h.openIn,endpoint:h.endpoint,method:h.method,navigate:h.navigate,to:h.to,opensInNewTab:h.opensInNewTab,bodyExtra:h.bodyExtra,confirmText:h.confirmText,successMessage:h.successMessage,errorMessage:h.errorMessage,refreshAfter:h.refreshAfter,...e})}finally{m(!1)}}},[h,f,p]);return(0,o.jsxs)(X,{type:`button`,variant:n,size:r,disabled:t.disabled||p,className:q(e?.className),onClick:h?g:void 0,...(0,i.resolveInlineAriaProps)(t.aria,c),children:[u===`left`&&d,l,u===`right`&&d]})}t.ComponentRegistry.register(`button`,Co,{namespace:`element`,skipFallback:!0,label:`Button`,category:`action`,inputs:[{name:`label`,type:[`string`,`object`],required:!0,description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`action`,type:`object`,description:`Inline ActionDef executed on click (url / navigation / api / script / modal / flow); omitted → renders inert`},{name:`variant`,type:`enum`,enum:[`primary`,`secondary`,`danger`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`small`,`medium`,`large`]},{name:`icon`,type:`string`,description:`Lucide icon name`},{name:`iconPosition`,type:`enum`,enum:[`left`,`right`]},{name:`disabled`,type:`boolean`}]});var wo={number:{},currency:{currency:`USD`},percent:{style:`percent`,maximumFractionDigits:1}};function To(e,t,n,r,i,a){if(e==null||Number.isNaN(e))return`—`;let o=wo[t??`number`]??wo.number;t===`currency`&&(o=i?{...wo.currency,currency:i}:wo.number);let s=(0,_.formatDisplayNumber)(e,{...o,locale:a});return`${n??``}${s}${r??``}`}function Eo({schema:e}){let n=io(e),r=(0,i.useAdapter)(),s=(0,i.useElementDataSource)(e,r),c=s.composed,{t:l}=(0,_.useObjectTranslation)(),u=a.useMemo(()=>{if(!c)return{filter:n.filter};let e=(0,t.toFilterNodeSafely)(n.filter);if(!e.ok)return{filter:void 0,refusal:e.refusal};let r=(0,t.toFilterNodeSafely)(c.filter);return r.ok?{filter:(0,t.mergeFilterNodes)(e.node,r.node)}:{filter:void 0,refusal:r.refusal}},[c,n.filter]),d=u.refusal,f=s.status===`loading`||s.status===`missing`||d?void 0:c?.object??n.object,{currency:p}=(0,_.useLocalization)(),m=(0,_.useDisplayLocale)(),[h,g]=a.useState(null),[v,y]=a.useState(!0),[b,x]=a.useState(null),S=(0,i.useFilterScope)(),C=(0,i.useResolvedFilter)(u.filter,S),w=a.useMemo(()=>C?JSON.stringify(C):``,[C]),T=(0,i.useDataInvalidation)(r&&n.aggregate?f:void 0);return a.useEffect(()=>{let e=!1;if(!r||!f||!n.aggregate){y(!1);return}return y(!0),x(null),(async()=>{try{if(typeof r.aggregate==`function`){let t=await r.aggregate(f,{field:n.field,function:n.aggregate,groupBy:`_all`,filter:C}),i=Array.isArray(t)?t[0]:t,a=n.aggregate===`count`?`count`:`${n.field??``}_${n.aggregate}`,o=i?.[a]??i?.[n.field??``]??i?.value??(typeof i==`number`?i:null);e||g(typeof o==`number`?o:o==null?null:Number(o))}else if(typeof r.find==`function`){let t=await r.find(f,C?{$filter:C}:void 0),i=t?.data??(Array.isArray(t)?t:[]),a=null;if(n.aggregate===`count`)a=i.length;else if(n.field){let e=i.map(e=>Number(e?.[n.field])).filter(e=>!Number.isNaN(e));e.length&&(n.aggregate===`sum`?a=e.reduce((e,t)=>e+t,0):n.aggregate===`avg`?a=e.reduce((e,t)=>e+t,0)/e.length:n.aggregate===`min`?a=Math.min(...e):n.aggregate===`max`&&(a=Math.max(...e)))}e||g(a)}}catch(t){e||x(t?.message??`aggregate failed`)}finally{e||y(!1)}})(),()=>{e=!0}},[r,f,n.field,n.aggregate,w,T]),s.status===`missing`||d?(0,o.jsx)(i.ElementDataSourceErrorPanel,{testId:`element-number`,title:`This metric’s data source could not be resolved`,message:d?.message??s.error}):s.status===`loading`?(0,o.jsx)(i.ElementDataSourceLoadingPanel,{testId:`element-number`}):n.aggregate&&!n.object&&s.status===`absent`?(0,o.jsx)(`div`,{className:q(`text-xs text-muted-foreground`,e?.className),"data-testid":`element-number-no-object`,...(0,i.resolveInlineAriaProps)(n.aria,m),children:l(`element.number.noObject`,{defaultValue:`No object named: set object or dataSource.object.`})}):(0,o.jsxs)(`div`,{className:q(`flex flex-col gap-1`,e?.className),...(0,i.resolveInlineAriaProps)(n.aria,m),children:[(0,o.jsx)(`div`,{className:`text-3xl font-semibold tracking-tight tabular-nums`,children:v?`…`:To(h,n.format,n.prefix,n.suffix,p,m)}),b&&(0,o.jsx)(`div`,{className:`text-xs text-destructive`,children:b})]})}t.ComponentRegistry.register(`number`,(0,t.elementDataSourceBlock)(Eo),{namespace:`element`,skipFallback:!0,label:`Number`,category:`content`,inputs:[{name:`object`,type:`string`,description:"Object the aggregate runs over. Required unless a node-level `dataSource` binding names one; when both are set, `dataSource.object` wins."},{name:`aggregate`,type:`enum`,enum:[`count`,`sum`,`avg`,`min`,`max`],required:!0},{name:`field`,type:`string`,description:`Measure field (required for every aggregate except count)`},{name:`filter`,type:`array`,description:"Criteria the aggregate is scoped by. When a node-level `dataSource` binding also supplies a filter (its own, or the saved view its `view` names), the two are AND-combined: neither is dropped."},{name:`format`,type:`enum`,enum:[`number`,`currency`,`percent`]},{name:`prefix`,type:`string`},{name:`suffix`,type:`string`}]});function Do(e,t){if(!e||!t)return;let n=e.fields;if(n)return Array.isArray(n)?n.find(e=>e?.name===t):n[t]}function Oo({hint:e,icon:t,title:n,subtitle:r,children:i}){return(0,o.jsxs)(`div`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-2.5 border-b bg-muted/40 px-3.5 py-2.5`,children:[(0,o.jsx)(t,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-semibold leading-tight`,children:n}),(0,o.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-muted-foreground`,children:e})]}),r&&(0,o.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:r})]})]}),(0,o.jsx)(`div`,{className:`p-3.5`,children:i})]})}function ko({tone:e=`muted`,children:t}){return(0,o.jsxs)(`div`,{className:q(`flex items-center gap-2 rounded-md border border-dashed px-3 py-2.5 text-xs`,e===`warn`?`border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-300`:`bg-muted/30 text-muted-foreground`),children:[e===`warn`&&(0,o.jsx)(l.AlertTriangle,{className:`h-3.5 w-3.5 shrink-0`}),t]})}function Ao({object:e,name:t}){let{item:n,loading:r,error:s}=(0,i.useMetadataItem)(`object`,e??null),c=a.useMemo(()=>{let e=n?.validations??n?.validationRules??[];if(Array.isArray(e))return e.find(e=>e?.type===`state_machine`&&(!t||e?.name===t))},[n,t]);if(!e)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`object`}),` for the state machine.`]});if(r)return(0,o.jsxs)(ko,{children:[`Loading `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(s)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Failed to load object `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,s.message]});if(!n)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Object `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});if(!c)return(0,o.jsxs)(ko,{tone:`warn`,children:[`No state machine`,t?` named “${t}”`:``,` on `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`.`]});let u=c.transitions&&typeof c.transitions==`object`&&!Array.isArray(c.transitions)?c.transitions:{},d=Do(n,c.field),f=Array.isArray(d?.options)?d.options:[],p=new Map(f.map(e=>[e.value,e])),m=e=>p.get(e)?.label??e,h=e=>p.get(e)?.color,g=f.find(e=>e.default)?.value,_=new Set;g&&_.add(g);for(let e of f)_.add(e.value);for(let[e,t]of Object.entries(u)){_.add(e);for(let e of t)_.add(e)}let v=[..._],y=({value:e})=>{let t=h(e);return(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-background px-2 py-0.5 text-xs font-medium`,children:[(0,o.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:t??`var(--muted-foreground)`}}),m(e)]})};return(0,o.jsx)(Oo,{hint:`state machine`,icon:l.Workflow,title:c.label??c.name??`State machine`,subtitle:(0,o.jsxs)(o.Fragment,{children:[`Lifecycle of `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),c.field?(0,o.jsxs)(o.Fragment,{children:[` · field `,(0,o.jsx)(`code`,{className:`font-mono`,children:c.field})]}):null]}),children:(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:v.map(e=>{let t=u[e]??[],n=e===g,r=t.length===0;return(0,o.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(y,{value:e}),n&&(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-400`,children:[(0,o.jsx)(l.CircleDot,{className:`h-3 w-3`}),` initial`]}),r?(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,o.jsx)(l.Flag,{className:`h-3 w-3`}),` final`]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.ArrowRight,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,o.jsx)(`span`,{className:`flex flex-wrap gap-1.5`,children:t.map(e=>(0,o.jsx)(y,{value:e},e))})]})]},e)})})})}var jo=new Set([`script`,`http_request`,`connector_action`,`assignment`,`get_record`,`create_record`,`update_record`,`delete_record`,`boundary_event`]);function Mo({name:e,detail:t}){let{item:n,loading:r,error:a}=(0,i.useMetadataItem)(`flow`,e??null);if(!e)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`name`}),` for the flow.`]});if(r)return(0,o.jsxs)(ko,{children:[`Loading flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(a)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Failed to load flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,a.message]});if(!n)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});let s=Array.isArray(n.nodes)?n.nodes:[],c=(t??`business`)===`business`,u=c?s.filter(e=>!jo.has(e?.type)):s,d=s.length-u.length;return(0,o.jsxs)(Oo,{hint:`flow`,icon:l.GitBranch,title:n.label??n.name??e,subtitle:n.description??(0,o.jsxs)(o.Fragment,{children:[`Process with `,s.length,` step`,s.length===1?``:`s`]}),children:[u.length===0?(0,o.jsx)(ko,{children:`No steps to show.`}):(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:u.map((e,t)=>(0,o.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[11px] font-semibold text-primary`,children:t+1}),(0,o.jsx)(`span`,{className:`text-sm`,children:e?.label??e?.id??`(step)`}),e?.type&&(0,o.jsx)(`span`,{className:`ml-auto rounded border bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e.type})]},e?.id??t))}),c&&d>0&&(0,o.jsxs)(`div`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[d,` technical step`,d===1?``:`s`,` hidden · set `,(0,o.jsx)(`code`,{className:`font-mono`,children:`detail: technical`}),` to show all`]})]})}var No=[{key:`allowCreate`,label:`C`},{key:`allowRead`,label:`R`},{key:`allowEdit`,label:`U`},{key:`allowDelete`,label:`D`}];function Po({name:e}){let{item:t,loading:n,error:r}=(0,i.useMetadataItem)(`permission`,e??null);if(!e)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`name`}),` for the permission set.`]});if(n)return(0,o.jsxs)(ko,{children:[`Loading permission set `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(r)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Failed to load permission `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,r.message]});if(!t)return(0,o.jsxs)(ko,{tone:`warn`,children:[`Permission set `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});let a=t.objects&&typeof t.objects==`object`?t.objects:{},s=Object.entries(a);return(0,o.jsx)(Oo,{hint:`permission`,icon:l.ShieldCheck,title:t.label??t.name??e,subtitle:(0,o.jsxs)(o.Fragment,{children:[`Object access · `,s.length,` object`,s.length===1?``:`s`]}),children:s.length===0?(0,o.jsx)(ko,{children:`No object permissions declared.`}):(0,o.jsxs)(`table`,{className:`w-full border-separate border-spacing-0 text-xs`,children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{className:`text-muted-foreground`,children:[(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-medium`,children:`Object`}),No.map(e=>(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-center font-mono font-medium`,title:e.key,children:e.label},e.key))]})}),(0,o.jsx)(`tbody`,{children:s.map(([e,t])=>(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 font-mono`,children:e}),No.map(e=>(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 text-center`,children:t?.[e.key]?(0,o.jsx)(l.Check,{className:`mx-auto h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400`}):(0,o.jsx)(l.Minus,{className:`mx-auto h-3.5 w-3.5 text-muted-foreground/40`})},e.key))]},e))})]})})}function Fo(e){switch(e.type){case`state_machine`:return(0,o.jsx)(Ao,{...e});case`flow`:return(0,o.jsx)(Mo,{...e});case`permission`:return(0,o.jsx)(Po,{...e});default:return(0,o.jsxs)(ko,{tone:`warn`,children:[`Unknown metadata view type`,e.type?` “${e.type}”`:``,`. Expected`,` `,(0,o.jsx)(`code`,{className:`font-mono`,children:`state_machine`}),`, `,(0,o.jsx)(`code`,{className:`font-mono`,children:`flow`}),`, or`,` `,(0,o.jsx)(`code`,{className:`font-mono`,children:`permission`}),`.`]})}}function Io({schema:e}){let{aria:t,...n}=io(e),r=(0,_.useDisplayLocale)();return(0,o.jsx)(`div`,{...(0,i.resolveInlineAriaProps)(t,r),children:(0,o.jsx)(Fo,{...n})})}t.ComponentRegistry.register(`metadata_viewer`,Io,{namespace:`element`,skipFallback:!0,label:`Metadata Viewer`,category:`content`});function Lo(e){return e==null||e===``?`—`:typeof e==`object`?JSON.stringify(e):String(e)}function Ro({schema:e}){let t=io(e),n=Array.isArray(t.items)?t.items:[],r=t.columns===2?`sm:grid-cols-2`:`grid-cols-1`;return n.length===0?(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No details`}):(0,o.jsx)(`dl`,{className:q(`grid gap-x-6 gap-y-3`,r,e?.className,t.className),"data-testid":`definition-list`,children:n.map((e,n)=>(0,o.jsxs)(`div`,{className:q(t.inline?`flex items-baseline justify-between gap-3`:`flex flex-col gap-0.5`),children:[(0,o.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e.term}),(0,o.jsx)(`dd`,{className:`text-sm text-foreground`,children:Lo(e.description)})]},n))})}t.ComponentRegistry.register(`definition-list`,Ro,{namespace:`element`,skipFallback:!0,label:`Definition List`,category:`content`,inputs:[{name:`items`,type:`array`,of:`object`,description:'Term/description pairs [{ term, description }], in order: `term` is the row label, `description` is shown as-is (an object as JSON, an omitted one as an em dash). Omitted or empty renders the "No details" state'},{name:`columns`,type:`enum`,enum:[{label:`1`,value:1},{label:`2`,value:2}],description:`Grid columns from the small breakpoint up: the NUMBER 1 or 2 (default 1)`},{name:`inline`,type:`boolean`,description:`Term and description on one baseline-aligned row`}]});function zo({schema:e}){let t=io(e),n=(0,i.useAdapter)(),[r,s]=a.useState([]),[c,l]=a.useState(!0),[u,d]=a.useState(null),f=(0,i.useFilterScope)(),p=(0,i.useResolvedFilter)(t.filter,f),m=a.useMemo(()=>p?JSON.stringify(p):``,[p]),h=a.useMemo(()=>t.sort?JSON.stringify(t.sort):``,[t.sort]),g=a.useMemo(()=>(t.fields??[]).map(e=>typeof e==`string`?{field:e}:e),[t.fields]),_=(0,i.useDataInvalidation)(n&&typeof n.find==`function`?t.object:void 0);return a.useEffect(()=>{let e=!1;if(!n||!t.object||typeof n.find!=`function`){l(!1);return}return l(!0),d(null),(async()=>{try{let r={};p&&(r.$filter=p),t.sort&&(r.$orderby=t.sort),t.limit&&(r.$top=t.limit);let i=await n.find(t.object,r),a=i?.data??(Array.isArray(i)?i:[]);e||s(a)}catch(t){e||d(t?.message??`Failed to load`)}finally{e||l(!1)}})(),()=>{e=!0}},[n,t.object,m,h,t.limit,_]),c?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`Loading…`}):u?(0,o.jsx)(`p`,{className:`py-2 text-sm text-destructive`,children:u}):r.length===0?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:t.emptyText??`No records`}):(0,o.jsx)(`ul`,{className:q(t.divided!==!1&&`divide-y divide-border`,e?.className,t.className),"data-testid":`repeater`,children:r.map((e,n)=>(0,o.jsxs)(`li`,{className:`flex items-baseline gap-3 py-2`,children:[t.titleField&&(0,o.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:Lo(e[t.titleField])}),g.map(t=>(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Lo(e[t.field])},t.field))]},e?.id??n))})}t.ComponentRegistry.register(`repeater`,zo,{namespace:`element`,skipFallback:!0,label:`Repeater`,category:`content`,inputs:[{name:`object`,type:`string`,required:!0,description:`Object whose records the list repeats over`},{name:`titleField`,type:`string`},{name:`fields`,type:`array`,description:"Fields shown after the title on each line, in order: a bare field name, or `{ field }`"},{name:`filter`,type:`array`,of:`object`,description:"Filter rules `[{ field, operator, value }]`. A string `value` may be a context token such as `{current_user_id}`, resolved before the query"},{name:`sort`,type:`array`,of:`object`,description:"Sort order `[{ field, order }]`, applied in list order"},{name:`limit`,type:`number`},{name:`emptyText`,type:`string`},{name:`divided`,type:`boolean`,description:`Separator between rows`}]});function Bo(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`){let t=e;return String(t.label??t.name??t.title??t.en??``)}return String(e)}function Vo({schema:e}){let t=io(e),n=(0,i.useAdapter)(),r=(0,i.useElementDataSource)(e,n),s=r.composed,c=r.status===`loading`||r.status===`missing`?void 0:s?.object??t.object,l=(0,i.useFilterScope)(),u=(0,i.useResolvedFilter)(s?.filter??t.filter,l),d=s?.sort??t.sort,f=s?.limit??t.limit??50,p=t.labelField??`name`,m=t.valueField??`id`,h=(0,i.usePageVariableBinding)(e?.id),{language:g}=(0,_.useObjectTranslation)(),[v,y]=a.useState([]),[b,x]=a.useState(!0),[S,C]=a.useState(null),w=a.useMemo(()=>u?JSON.stringify(u):``,[u]),T=a.useMemo(()=>d?JSON.stringify(d):``,[d]),E=(0,i.useDataInvalidation)(n&&typeof n.find==`function`?c:void 0),D=a.useRef(null);a.useEffect(()=>{let e=!1;if(!n||!c||typeof n.find!=`function`){x(!1);return}let t=JSON.stringify([c,w,T,f]),r=D.current;return(r===null||r.adapter!==n||r.signature!==t)&&(x(!0),C(null)),(async()=>{try{let r={};u&&(r.$filter=u),d&&(r.$orderby=d),f&&(r.$top=f);let i=await n.find(c,r),a=i?.data??(Array.isArray(i)?i:[]);e||(y(a),C(null),D.current={adapter:n,signature:t})}catch(t){e||C(t?.message??`Failed to load`)}finally{e||x(!1)}})(),()=>{e=!0}},[n,c,w,T,f,E]);let O=h?.value,k=h?String(O??``):void 0,A=a.useCallback(e=>{h?.setValue(e)},[h]),j=(0,_.pickLocalized)(t.label,g),M=(0,_.pickLocalized)(t.placeholder??`Select a record…`,g),N=(0,_.pickLocalized)(t.emptyText??`No records`,g),ee=(0,_.useDisplayLocale)(),P=(0,i.resolveInlineAriaProps)(t.aria,ee);return r.status===`missing`?(0,o.jsx)(i.ElementDataSourceErrorPanel,{testId:`record-picker`,title:`This record picker’s data source could not be resolved`,message:r.error}):r.status===`loading`?(0,o.jsx)(i.ElementDataSourceLoadingPanel,{testId:`record-picker`}):(0,o.jsxs)(`div`,{className:q(`space-y-1.5`,e?.className),"data-testid":`record-picker`,"data-picker-id":e?.id,children:[j&&(0,o.jsx)(Bn,{htmlFor:e?.id,className:`text-sm font-medium text-foreground`,children:j}),(0,o.jsxs)(Wr,{value:k,onValueChange:A,disabled:b||!!S||!c,children:[(0,o.jsx)(qr,{id:e?.id,className:`w-full max-w-xs`,"data-testid":`record-picker-trigger`,...P,children:(0,o.jsx)(Kr,{placeholder:b?`Loading…`:S?`Failed to load`:M})}),(0,o.jsx)(Xr,{children:v.map((e,t)=>{let n=e?.[m],r=String(n??t);return(0,o.jsx)(Qr,{value:r,children:Bo(e?.[p])||r},r)})})]}),!b&&!S&&v.length===0&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N})]})}t.ComponentRegistry.register(`record_picker`,(0,t.elementDataSourceBlock)(Vo),{namespace:`element`,skipFallback:!0,label:`Record Picker`,category:`input`,inputs:[{name:`object`,type:`string`},{name:`filter`,type:`array`,description:'Filter rules narrowing which records the picker offers, as a ViewFilterRule ARRAY — `[{ field: "status", operator: "equals", value: "open" }, …]`, the one filter orthography this map\'s array-declared `filter` doors share. It becomes the `$filter` of the picker\'s own query, so it decides which records exist for the user, not merely how they are shown. PRECEDENCE: a node-level `dataSource` binding wins outright. The renderer reads `dataSource.filter ?? filter`, so when the binding — or the saved view its `view` names, which AND-combine with each other because the spec calls the binding\'s filter *additional* — supplies a filter, THIS key is dropped entirely rather than merged into it; it applies only when the node carries no `dataSource`, or that `dataSource` and its view both leave `filter` unset. MEMBERS ARE RULE OBJECTS: the MongoDB-style record form (`{ status: "open" }`, `{ $and: [ … ] }`) was retired by objectstack#14406 and the spec now refuses it by kind, and a bare tuple (`["a", "=", 1]`) is refused as a member because each entry must be an object.'},{name:`labelField`,type:`string`},{name:`valueField`,type:`string`},{name:`placeholder`,type:[`string`,`object`],description:'Prompt shown in the closed control while no record is selected (renderer default "Select a record…"). Display-only — it never reaches the query. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), the `I18nLabel` union rc.6 widened this key to; the renderer resolves the map against the active language at the read site, falling back through base language, a region-qualified sibling, `default`, then `en`. It is REPLACED while the picker is busy: "Loading…" while it reads a new set of options and "Failed to load" after an error both win over this key (a re-read of the same options after a data change keeps them on screen and shows no "Loading…"). An authored empty string stays empty; the default applies only when the key is absent.'},{name:`label`,type:[`string`,`object`],description:'Caption rendered above the picker, in a `<label>` element — tied to the control by `htmlFor` when the node carries an `id`, so clicking it focuses the picker and the text becomes the combobox’s accessible name (objectui#5771), unless the block’s `aria.ariaLabel` names the combobox, which wins. Display-only — it never reaches the query, and it is OMITTED entirely when the key is absent or resolves to an empty string. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), the `I18nLabel` union rc.6 widened this key to; the renderer resolves the map against the active language at the read site, with the same fallback chain as `placeholder`. Distinct from `labelField`, which names the RECORD field each offered row is titled by.'},{name:`sort`,type:`array`,of:`object`,description:'Row order, as an array of `{ field, order }` entries — `[{ field: "name", order: "asc" }]`. It becomes the `$orderby` of the picker\'s own query, so it decides the order records are offered in. `order` is `asc` or `desc`; the terse string form (`"name asc"`) is not accepted by the contract. PRECEDENCE: identical to `filter` above and for the same reason — the renderer reads `dataSource.sort ?? sort`, so a node-level `dataSource` binding (or the saved view its `view` names) REPLACES this key outright rather than merging with it; it applies only when the node carries no `dataSource`, or that `dataSource` and its view both leave `sort` unset.'},{name:`limit`,type:`number`,description:"Maximum number of records the picker offers, as a whole number. It becomes the `$top` of the picker's own query, so it bounds what the user can choose from rather than how the list is displayed — a record outside the limit cannot be picked at all, and the control gives no sign that more exist. PRECEDENCE, first source that supplies a cap wins: (1) `dataSource.limit`; (2) the row cap of the saved view that `dataSource.view` names; (3) THIS key; (4) 50. A cap in (1) or (2) counts only when it is a positive integer — one the contract refuses (`0`, a negative, a non-integer) is treated as NOT AUTHORED and falls through to the next source exactly as an absent one does (objectui#10016), so a refused `dataSource.limit` does not win. DEFAULT: the 50 in (4) is applied by the renderer — the trailing `?? 50` where the picker resolves its `limit` — not by the schema."},{name:`emptyText`,type:[`string`,`object`],description:'Text shown in place of the row list when the query returns no records (renderer default "No records", `record-picker.tsx:213`). Unlike `filter` / `sort` / `limit` this is display-only — it never reaches the query, and a node-level `dataSource` binding does not override it. Accepts either a plain string or an inline per-locale map (`{ en: "None", "zh-CN": "无记录" }`) — the `I18nLabel` union rc.6 widened this key to — and the renderer resolves the map against the active language at the read site, falling back through base language, `default`, then `en`. An authored empty string stays empty; the "No records" default applies only when the key is absent.'}]});var Ho=[`text`,`email`,`number`,`tel`,`url`,`password`];function Uo({schema:e}){let t=io(e),n=Ho.includes(t.inputType)?t.inputType:`text`,{language:r}=(0,_.useObjectTranslation)(),s=(0,i.usePageVariableBinding)(e?.id),c=a.useRef(!1);a.useEffect(()=>{c.current||(c.current=!0,s&&t.defaultValue!==void 0&&(s.value==null||s.value===``)&&s.setValue(t.defaultValue))},[]);let l=s?.value,u=s?l==null?``:String(l):void 0,d=a.useCallback(e=>{if(!s)return;let t=e.target.value;s.setValue(n===`number`?t===``?``:Number(t):t)},[s,n]),f=(0,_.pickLocalized)(t.label,r),p=(0,_.pickLocalized)(t.placeholder,r),m=(0,_.pickLocalized)(t.description,r),h=a.useId(),g=m?`${h}-description`:void 0,v=(0,_.useDisplayLocale)(),y=(0,i.resolveInlineAriaProps)(t.aria,v),b=[g,y[`aria-describedby`]].filter(Boolean).join(` `)||void 0;return(0,o.jsxs)(`div`,{className:q(`grid w-full max-w-sm items-center gap-1.5`,e?.className),"data-testid":`text-input`,"data-input-id":e?.id,children:[f&&(0,o.jsxs)(Bn,{htmlFor:e?.id,children:[f,t.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Q,{id:e?.id,type:n,placeholder:p||void 0,value:u,defaultValue:u===void 0?t.defaultValue:void 0,required:t.required,disabled:t.disabled,...y,"aria-describedby":b,onChange:d}),m&&(0,o.jsx)(`p`,{id:g,className:`text-sm text-muted-foreground`,children:m})]})}t.ComponentRegistry.register(`text_input`,Uo,{namespace:`element`,skipFallback:!0,label:`Text Input`,category:`input`,inputs:[{name:`label`,type:[`string`,`object`],description:'Caption rendered ABOVE the input, in a `<label>` element — tied to the field by `htmlFor` when the node carries an `id`, so clicking it focuses the input. Display-only, and OMITTED entirely when the key is absent or resolves to an empty string; because the `required` asterisk is drawn on this element, a required input with no label shows no asterisk at all. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`) — the `I18nLabel` union the contract admits on this key — and the renderer resolves the map against the active language at the read site, falling back through base language, a region-qualified sibling, `default`, then `en`, and finally to any remaining entry.'},{name:`placeholder`,type:[`string`,`object`],description:'Prompt shown INSIDE the field while it is empty, as the native input\'s `placeholder` attribute — it disappears as the user types and never becomes the input\'s value, so it is never what a bound page variable receives. Display-only, with no renderer default: an absent key means no placeholder, and an authored empty string (or a map no locale limb resolves) drops the attribute altogether rather than setting an empty one. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), resolved against the active language with the same fallback chain as `label`.'},{name:`inputType`,type:`enum`,enum:[`text`,`email`,`number`,`tel`,`url`,`password`]},{name:`defaultValue`,type:[`string`,`number`],description:"Initial value (string or number). With a page variable bound to this input — a variable whose `source` is this component id — it is pushed into that variable ONCE on mount, and only while the variable is still empty, so `page.<var>` and the submit body carry it before the user types; a variable that declares its own defaultValue wins. With no bound variable it becomes the native input's uncontrolled initial value and nothing else reads it."},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:[`string`,`object`],description:'Helper text rendered BELOW the input, in its own `<p>` — a different destination from `label` (above, in a `<label>`) and `placeholder` (inside the field), reached by the same read path. Display-only, and OMITTED entirely when the key is absent or resolves to an empty string. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), resolved against the active language with the same fallback chain as `label`. The paragraph IS tied to the field with `aria-describedby`, so the resolved text is the input’s accessible DESCRIPTION and assistive tech announces it with the field rather than leaving it as unreachable decoration. That association does not depend on the node carrying an `id` (`label`’s `htmlFor` does): the id `aria-describedby` needs sits on the paragraph, which the renderer mints per instance, and it is emitted only when a paragraph is actually rendered — an absent or empty `description` puts no paragraph id in the input’s `aria-describedby`, which then carries only an authored `aria.ariaDescribedBy`, or is absent. An authored `aria.ariaDescribedBy` is added after the paragraph’s id, never in place of it. Prefer `label` anyway for an instruction a user MUST NOT miss: a description is announced after the field’s name, and screen readers gate description text behind verbosity settings a user can turn down (NVDA’s “Report object descriptions”, VoiceOver hint verbosity), so it is the half of the announcement most likely to go unheard — the same advice as before, now resting on announcement order and verbosity rather than on the text being unwired.'}]});function Wo(e){return e==null?void 0:String(e)}function Go(e,t){let n=e?.find(e=>String(e.value)===t);return n?n.value:t}var Ko=new Set([`required`,`minLength`,`maxLength`,`min`,`max`,`pattern`,`validate`]),qo=({className:e,...t})=>(0,o.jsx)(H.Group,{className:q(`flex h-full w-full`,e),...t}),Jo=H.Panel,Yo=({withHandle:e,className:t,...n})=>(0,o.jsx)(H.Separator,{className:q(`relative flex w-px items-center justify-center bg-border`,`after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1`,`aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full`,`aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full`,`aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0`,`[&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,o.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,o.jsx)(l.GripVertical,{className:`h-2.5 w-2.5`})})}),Xo=(0,_.createSafeTranslation)({"common.cancel":`Cancel`,"form.fullscreen.title":`Edit text`,"form.fullscreen.description":`Edit the full text value, then save or cancel your changes.`,"form.fullscreen.done":`Done`,"form.fullscreen.toggle":`Edit {{label}} fullscreen`,"form.fullscreen.textFallback":`text`},`common.cancel`);function Zo({value:e,onCommit:t,label:n,testIdPrefix:r,readOnly:i=!1,disabled:s=!1,error:c,children:u,footer:d}){let{t:f}=Xo(),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(e??``),_=(0,a.useId)(),v=`${_}-fullscreen-title`,y=`${_}-fullscreen-error`,b={"aria-labelledby":v,"aria-invalid":!!c,...c?{"aria-errormessage":y}:null};return i?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,onClick:()=>{s||i||(g(e??``),m(!0))},disabled:s,className:q(`absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm transition-colors`,`disabled:opacity-50 disabled:pointer-events-none`),"aria-label":f(`form.fullscreen.toggle`,{label:n??f(`form.fullscreen.textFallback`)}),"data-testid":`${r}-fullscreen-toggle`,children:(0,o.jsx)(l.Maximize2,{className:`size-3.5`})}),(0,o.jsx)(Nt,{open:p,onOpenChange:m,children:(0,o.jsxs)(Rt,{className:`sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0`,"data-testid":`${r}-fullscreen-dialog`,children:[(0,o.jsxs)(zt,{className:`p-4 border-b`,children:[(0,o.jsx)(Vt,{className:`text-base`,children:(0,o.jsx)(`span`,{id:v,children:n??f(`form.fullscreen.title`)})}),(0,o.jsx)(Ht,{className:`sr-only`,children:f(`form.fullscreen.description`)}),c?(0,o.jsx)(`p`,{id:y,className:`text-sm font-medium text-destructive`,"data-testid":`${r}-fullscreen-error`,children:c}):null]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:u(h,g,s,b)}),(0,o.jsxs)(Bt,{className:`p-3 border-t flex-row justify-between sm:justify-end gap-2`,children:[d?.(h),(0,o.jsxs)(`div`,{className:`flex gap-2 ml-auto`,children:[(0,o.jsxs)(X,{type:`button`,variant:`ghost`,onClick:()=>m(!1),children:[(0,o.jsx)(l.X,{className:`size-4 mr-1`}),` `,f(`common.cancel`)]}),(0,o.jsxs)(X,{type:`button`,onClick:()=>{!s&&!i&&t(h),m(!1)},disabled:s,"data-testid":`${r}-fullscreen-save`,children:[(0,o.jsx)(l.Check,{className:`size-4 mr-1`}),` `,f(`form.fullscreen.done`)]})]})]})]})})]})}var Qo=1e3,$o=.1,es=20;function ts(e){return Math.max(Math.ceil(e*$o),es)}var ns=(0,_.createSafeTranslation)({"fields.textarea.characterCount":`Character count: {{count}} of {{max}}`,"fields.textarea.charactersRemaining":`Characters remaining: {{count}}`},`fields.textarea.characterCount`);function rs({length:e,maxLength:t,descriptionId:n,announceNearLimit:r,className:i,testId:s}){let{t:c}=ns(),l=c(`fields.textarea.characterCount`,{count:e,max:t}),u=r&&t-e<=ts(t)?c(`fields.textarea.charactersRemaining`,{count:Math.max(t-e,0)}):``,[d,f]=(0,a.useState)(``);return(0,a.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>f(u),Qo);return()=>clearTimeout(e)},[u]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:i,"aria-hidden":`true`,"data-testid":s,children:[e,`/`,t]}),(0,o.jsx)(`span`,{id:n,className:`sr-only`,children:l}),r&&(0,o.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:d===u?u:``})]})}function is({label:e,description:t,collapsible:n,collapsed:r,onToggle:i,className:a}){return!e&&!t?null:(0,o.jsxs)(`div`,{className:q(`col-span-full pt-4 pb-1 border-b border-border`,n&&`cursor-pointer select-none`,a),onClick:n?i:void 0,role:n?`button`:void 0,"aria-expanded":n?!r:void 0,children:[e&&(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n&&(r?(0,o.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 text-muted-foreground`}):(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground`})),(0,o.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:e})]}),t&&(0,o.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:t})]})}function as(e){let t=new Map;for(let n of e)n?.name&&!t.has(n.name)&&t.set(n.name,n);return t}function os(e,t){let n=new Set;for(let t of e)for(let e of t.fields)n.add(e.name);return t.filter(e=>e?.name&&!n.has(e.name))}var ss=e=>typeof e==`number`&&Number.isFinite(e)?String(e):void 0,cs=[`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`],ls={"@sm:2":`@sm:col-span-2`,"@sm:3":`@sm:col-span-3`,"@sm:4":`@sm:col-span-4`,"@md:2":`@md:col-span-2`,"@md:3":`@md:col-span-3`,"@md:4":`@md:col-span-4`,"@lg:2":`@lg:col-span-2`,"@lg:3":`@lg:col-span-3`,"@lg:4":`@lg:col-span-4`,"@xl:2":`@xl:col-span-2`,"@xl:3":`@xl:col-span-3`,"@xl:4":`@xl:col-span-4`,"@2xl:2":`@2xl:col-span-2`,"@2xl:3":`@2xl:col-span-3`,"@2xl:4":`@2xl:col-span-4`,"@3xl:2":`@3xl:col-span-2`,"@3xl:3":`@3xl:col-span-3`,"@3xl:4":`@3xl:col-span-4`,"@4xl:2":`@4xl:col-span-2`,"@4xl:3":`@4xl:col-span-3`,"@4xl:4":`@4xl:col-span-4`,"@5xl:2":`@5xl:col-span-2`,"@5xl:3":`@5xl:col-span-3`,"@5xl:4":`@5xl:col-span-4`,"@6xl:2":`@6xl:col-span-2`,"@6xl:3":`@6xl:col-span-3`,"@6xl:4":`@6xl:col-span-4`,"@7xl:2":`@7xl:col-span-2`,"@7xl:3":`@7xl:col-span-3`,"@7xl:4":`@7xl:col-span-4`,"sm:2":`sm:col-span-2`,"sm:3":`sm:col-span-3`,"sm:4":`sm:col-span-4`,"md:2":`md:col-span-2`,"md:3":`md:col-span-3`,"md:4":`md:col-span-4`,"lg:2":`lg:col-span-2`,"lg:3":`lg:col-span-3`,"lg:4":`lg:col-span-4`,"xl:2":`xl:col-span-2`,"xl:3":`xl:col-span-3`,"xl:4":`xl:col-span-4`,"2xl:2":`2xl:col-span-2`,"2xl:3":`2xl:col-span-3`,"2xl:4":`2xl:col-span-4`,"3xl:2":`3xl:col-span-2`,"3xl:3":`3xl:col-span-3`,"3xl:4":`3xl:col-span-4`,"4xl:2":`4xl:col-span-2`,"4xl:3":`4xl:col-span-3`,"4xl:4":`4xl:col-span-4`,"5xl:2":`5xl:col-span-2`,"5xl:3":`5xl:col-span-3`,"5xl:4":`5xl:col-span-4`,"6xl:2":`6xl:col-span-2`,"6xl:3":`6xl:col-span-3`,"6xl:4":`6xl:col-span-4`,"7xl:2":`7xl:col-span-2`,"7xl:3":`7xl:col-span-3`,"7xl:4":`7xl:col-span-4`},us={2:`col-span-2`,3:`col-span-3`,4:`col-span-4`};function ds(e,t){let n=Array.from(e.matchAll(/(@)?(sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl):grid-cols-(\d+)/g)).map(e=>({at:e[1]||``,bp:e[2],cols:Number(e[3])})).sort((e,t)=>cs.indexOf(e.bp)-cs.indexOf(t.bp));if(!n.length)return us[Math.min(Math.max(t,2),4)];let r=[],i=1;for(let e of n){let n=Math.min(e.cols,t);if(n<=i)continue;let a=ls[`${e.at}${e.bp}:${n}`];a&&(r.push(a),i=n)}return r.join(` `)}var fs=(0,_.createSafeTranslation)({"common.selectOption":`Select an option`,"common.submit":`Submit`,"common.cancel":`Cancel`,"form.fullscreen.title":`Edit text`,"form.fullscreen.description":`Edit the full text value, then save or cancel your changes.`,"form.fullscreen.done":`Done`,"form.fullscreen.toggle":`Edit {{label}} fullscreen`,"form.fullscreen.textFallback":`text`,"fields.options.selectFirst":`Select {{fields}} first`,"fields.options.empty":`No options available`,"validation.required":`{{field}} is required`,"validation.minLength":`{{field}} must be at least {{min}} characters`,"validation.maxLength":`{{field}} must be at most {{max}} characters`,"validation.min":`{{field}} must be at least {{min}}`,"validation.max":`{{field}} must be at most {{max}}`,"validation.pattern":`{{field}} format is invalid`,"validation.email":`Please enter a valid email address`,"validation.url":`Please enter a valid URL`,"validation.formInvalid":`Please check the highlighted fields: {{fields}}`,"validation.formInvalidJoiner":`, `,"errors.forbidden":`Access denied.`,"form.noPermissionToSave":`You don't have permission to save this record.`,"form.submitFailed":`Could not save. Please try again.`,"form.clearedOnHide":`Cleared — no longer applicable given the current values: {{fields}}`,"form.visibleWhenFaulted":`Can't submit: the visibleWhen rule of {{fields}} could not be evaluated. The rule must be fixed before this form can be submitted.`},`common.selectOption`),ps=e=>e==null||e===``||Array.isArray(e)&&e.length===0,ms=(e,t)=>{if(ps(e)&&ps(t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},hs=(e,t)=>Object.prototype.hasOwnProperty.call(e??{},t),gs=(e,t)=>{let n=new Set([...Object.keys(e??{}),...Object.keys(t??{})]);for(let r of n)if(!ms(e?.[r],t?.[r]))return!0;return!1},_s=new Set([`checkbox`,`switch`,`boolean`,`toggle`,`field:boolean`,`field:switch`,`field:checkbox`]),vs=e=>e?.widget||e?.field?.widget||e?.type,ys=new Set([`input`,`textarea`,`checkbox`,`switch`,`select`]),bs={select:`field:multiselect`};function xs(e,t){return t&&hs(bs,e)?bs[e]:e}var Ss=new Set;function Cs(e,t){if(process.env.NODE_ENV===`production`)return;let n=`${e}::${[...t].sort().join(`,`)}`;Ss.has(n)||(Ss.add(n),console.error(`[object-ui] form field '${e}': validation rule(s) ${t.map(e=>`'${e}'`).join(`, `)} are not rules react-hook-form runs — the field renders, but these rules validate NOTHING. Recognized rules: ${[...Ko].join(`, `)}. Check the spelling (\`minLength\`, not \`minlength\`); express email/url checks as a \`pattern\` whose \`value\` is a RegExp; and declare \`validation\` as an OBJECT — spreading an array leaves numeric keys that run nothing.`))}var ws=new Set([`object-ref`,`filter-condition`,`recipient-picker`]);function Ts(e){return t.EXPANDABLE_FIELD_TYPES.has(e)||ws.has(e)}function Es(e){let{dataSource:t,inputType:n,options:r,field:i,schema:a,showActions:o,fieldContainerClass:s,mobileStickyActions:c,mobile_fullscreen:l,dependentValues:u,dependsOn:d,dependsOnLabels:f,emptyHint:p,label:m,error:h,...g}=e;return g}function Ds(e){if(e==null)return`null`;let t=typeof e;return t===`string`?JSON.stringify(e):t===`number`||t===`boolean`?String(e):Array.isArray(e)?`[${e.map(Ds).join(`, `)}]`:JSON.stringify(String(e))}function Os(e){if(!e||!e.field)return null;let t=`record[${JSON.stringify(e.field)}]`,n=[];return e.equals!==void 0&&n.push(`${t} == ${Ds(e.equals)}`),e.notEquals!==void 0&&n.push(`${t} != ${Ds(e.notEquals)}`),Array.isArray(e.in)&&n.push(`${t} in ${Ds(e.in)}`),n.length>0?n.join(` && `):null}function ks(e){return e.startsWith(`field:`)?e.slice(6):e}function As(e){if(ys.has(e))return`control`;let n=t.ComponentRegistry.getMeta(ks(e),`field`)?.labelling;return n===`group`||n===`display`?n:`control`}function js(e){return ys.has(e)?!1:e.includes(`:`)?e.startsWith(`field:`)&&!!t.ComponentRegistry.get(e):!!t.ComponentRegistry.get(`field:${e}`)}function Ms(e,t){return!ys.has(e)||e!==`select`?!1:!t||t.length===0}var Ns=a.default.forwardRef(function({labelId:e,children:t,id:n,"aria-describedby":r,"aria-invalid":i},a){return(0,o.jsx)(`div`,{ref:a,id:n,role:`group`,"aria-labelledby":n?`${e} ${n}`:e,"aria-describedby":r,"data-slot":`readonly-field-group`,children:t})});Ns.displayName=`ReadonlyFieldGroup`;function Ps(e,t){return e?(0,o.jsx)(Ns,{labelId:e,children:t}):t}function Fs(e,n){let{dataSource:r,inputType:i,showActions:a,fieldContainerClass:o,mobileStickyActions:s,mobile_fullscreen:c,dependentValues:l,dependsOnLabels:u,emptyHint:d,label:f,schema:p,...m}=n,h=ks(e);return{...m,...Ts(h)?{dataSource:r,dependentValues:l,dependsOnLabels:u}:{},...t.CASCADE_OPTION_WIDGET_TYPES.has(h)?{dependentValues:l,emptyHint:d}:{}}}function Is({value:e,onChange:t,placeholder:n,className:r,label:i,readOnly:s,disabled:c,error:l,maxLength:u,...d}){let f=s===!0||c===!0,p=e=>{f||t?.(e)},m=a.default.useId(),h=`${m}-charcount`,g=`${m}-fullscreen-charcount`,_=[d[`aria-describedby`],u?h:void 0].filter(Boolean).join(` `)||void 0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(ma,{placeholder:n,className:q(!s&&`pr-10`,r),value:e??``,onChange:e=>p(e.target.value),...d,maxLength:u,"aria-describedby":_,readOnly:s,disabled:c}),u?(0,o.jsx)(rs,{length:(e??``).length,maxLength:u,descriptionId:h,announceNearLimit:!0,className:`absolute bottom-2 right-2 text-xs text-gray-400`,testId:`form-textarea-character-count`}):null,(0,o.jsx)(Zo,{value:e??``,onCommit:p,label:i,testIdPrefix:`form-textarea`,readOnly:s,disabled:c,error:l,footer:e=>u?(0,o.jsx)(rs,{length:e.length,maxLength:u,descriptionId:g,announceNearLimit:!1,className:`text-xs text-muted-foreground self-center`,testId:`form-textarea-fullscreen-character-count`}):null,children:(e,t,r,i)=>(0,o.jsx)(ma,{autoFocus:!0,value:e,onChange:e=>t(e.target.value),placeholder:n,className:`h-full min-h-full resize-none text-base`,disabled:r,maxLength:u,"data-testid":`form-textarea-fullscreen-input`,...i,"aria-describedby":u?g:void 0})})]})}function Ls({value:e,placeholder:t,className:n,readOnly:r,maxLength:i,...s}){let c=`${a.default.useId()}-charcount`,l=[s[`aria-describedby`],i?c:void 0].filter(Boolean).join(` `)||void 0,u=(0,o.jsx)(ma,{placeholder:t,className:n,...s,maxLength:i,"aria-describedby":l,readOnly:r,value:e??``});return i?(0,o.jsxs)(`div`,{className:`relative`,children:[u,(0,o.jsx)(rs,{length:(e??``).length,maxLength:i,descriptionId:c,announceNearLimit:!0,className:`absolute bottom-2 right-2 text-xs text-gray-400`,testId:`form-textarea-character-count`})]}):u}t.ComponentRegistry.register(`form`,({schema:e,className:n,onAction:r,disabled:s,...c})=>{let{t:u}=fs(),d=a.default.useId(),{defaultValues:f={},previousValues:p,fields:m=[],submitLabel:h,cancelLabel:g,showCancel:_=!1,showSubmit:v=!0,layout:y=`vertical`,columns:b=1,onSubmit:x,onChange:S,onDirtyChange:C,onCancel:w,resetOnSubmit:T=!1,validationMode:D=`onSubmit`}=e,O=s===!0,k=a.default.useMemo(()=>m.filter(e=>e&&typeof e.field==`string`&&typeof e.name!=`string`),[m]),A=a.default.useMemo(()=>k.length===0?m:m.filter(e=>!k.includes(e)),[m,k]);a.default.useEffect(()=>{for(let e of k)console.error(`[object-ui] form field { field: '${e.field}' } was NOT rendered: \`field\` is the spec form-view vocabulary (a reference to an object field), and a standalone form has no object schema to resolve it against. Rename the key to \`name\` (the form data path) — or use an object-bound form (objectName + sections), whose section fields accept the spec shape.`);for(let e of m)e&&typeof e.field==`string`&&typeof e.name==`string`&&console.warn(`[object-ui] form field '${e.name}' mixes vocabularies: it also carries { field: '${e.field}' } (spec form-view key), which this standalone renderer ignores. Drop one of the two.`)},[m,k]),a.default.useEffect(()=>{for(let e of m){let t=e?.validation;if(typeof t!=`object`||!t)continue;let n=Object.keys(t).filter(e=>!Ko.has(e));n.length!==0&&Cs(String(e?.name),n)}},[m]);let j=a.default.useMemo(()=>{let e={...f},t=!1;for(let n of A)typeof n?.name==`string`&&(hs(e,n.name)||_s.has(vs(n))&&(e[n.name]=!1,t=!0));return t?e:f},[f,A]),M=(0,E.useForm)({defaultValues:j,mode:D,shouldFocusError:!1}),N=a.default.useRef(null),[ee,P]=a.default.useState(!1),[F,I]=a.default.useState(null),L=`form-outcome:${a.default.useId()}`,[R,z]=a.default.useState(void 0),[te,ne]=a.default.useState([]),re=M.watch(),V=a.default.useMemo(()=>{if(!p||typeof p!=`object`)return;let e={};for(let t of A)t?.name&&(e[t.name]=null);for(let t of Object.keys(p))p[t]!==void 0&&(e[t]=p[t]);return e},[A,p]),ie=V===void 0,H=(0,i.usePredicateScope)(),U=a.default.useMemo(()=>{let e={};for(let t of A)t?.name&&(e[t.name]=null);if(V)for(let t of Object.keys(V))e[t]=V[t];for(let t of Object.keys(re))re[t]!==void 0&&(e[t]=re[t]);return e},[A,V,JSON.stringify(re)]),ae=a.default.useMemo(()=>{let e=new Set;if(!V)return e;for(let n of A){let r=n?.name;r&&(0,t.resolveFieldRuleState)({visibleWhen:n.visibleWhen,readonlyWhen:n.readonlyWhen,requiredWhen:n.requiredWhen},U,{required:!!n.required,readonly:n.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(n,ie)},V,H,`field '${r}'`).readonly&&e.add(r)}return e},[A,U,V,ie,H]),{conditionallyHiddenFieldNames:oe,faultedVisibleWhenFieldNames:se}=a.default.useMemo(()=>{let e=new Set,n=[];for(let r of A){let i=r?.name;if(!i)continue;let a=r.visibleWhen,o=r.visibleOn;if(a!=null||o!=null){if(a!=null){let o=(0,t.resolveFieldRuleState)({visibleWhen:a,readonlyWhen:r.readonlyWhen,requiredWhen:r.requiredWhen},U,{required:!!r.required,readonly:r.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(r,ie)},V,H,`field '${i}'`);if(o.faults.visibleWhen!==void 0&&r.type!==`section-divider`&&n.push(i),!o.visible){e.add(i);continue}}o!=null&&!(0,t.evalFieldPredicate)(o,U,!0,V,H,{context:`visibleOn of field '${i}'`})&&e.add(i)}}return{conditionallyHiddenFieldNames:e,faultedVisibleWhenFieldNames:n}},[A,U,V,ie,H]),W=a.default.useMemo(()=>{let e=new Set;for(let n of A){let r=n;if(r?.type!==`section-divider`)continue;let i=r.fields;if(!Array.isArray(i)||i.length===0)continue;let a=r.name,o=!!r.hidden;if(!o){let e=Os(r.condition);e&&!(0,t.evalFieldPredicate)(e,U,!0,void 0,void 0,{context:`condition of field '${a}'`})&&(o=!0)}if(o||(0,t.resolveFieldRuleState)({visibleWhen:r.visibleWhen,readonlyWhen:r.readonlyWhen,requiredWhen:r.requiredWhen},U,{required:!!r.required,readonly:r.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(r,ie)},V,H,`field '${a}'`).visible||(o=!0),!o&&r.visibleOn!=null&&((0,t.evalFieldPredicate)(r.visibleOn,U,!0,V,H,{context:`visibleOn of field '${a}'`})||(o=!0)),o)for(let t of i)typeof t==`string`&&e.add(t)}return e},[A,U,V,ie,H]),G=a.default.useMemo(()=>{let t=e.fieldTabs;if(e.children||!Array.isArray(t))return null;let n=t.filter(e=>e&&typeof e.key==`string`);return n.length>1?n:null},[e.fieldTabs,e.children]),ce=a.default.useMemo(()=>{let e=new Set;for(let n of G??[]){let r=n.visibleWhen;r!=null&&((0,t.evalFieldPredicate)(r,U,!0,V,H,{context:`visibleWhen of fieldTab '${n.key}'`})||e.add(n.key))}return e},[G,U,V,H]),le=a.default.useMemo(()=>{let e=new Set;if(!G||ce.size===0)return e;for(let t of G)if(ce.has(t.key))for(let n of t.fields??[])typeof n==`string`&&e.add(n);for(let t of G)if(!ce.has(t.key))for(let n of t.fields??[])e.delete(n);return e},[G,ce]);a.default.useEffect(()=>{let e=M.formState.errors;if(e&&Object.keys(e).length!==0)for(let n of A){let r=n?.name;if(!r||!e[r])continue;let i=(0,t.resolveFieldRuleState)({visibleWhen:n.visibleWhen,readonlyWhen:n.readonlyWhen,requiredWhen:n.requiredWhen},U,{required:!!n.required,readonly:n.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(n,ie)},V,H,`field '${r}'`),a=n.visibleOn==null||(0,t.evalFieldPredicate)(n.visibleOn,U,!0,V,H,{context:`visibleOn of field '${r}'`}),o=e[r]?.type;(!i.visible||!a||W.has(r)||le.has(r)||!i.required&&o===`required`)&&M.clearErrors(r)}},[U,H,W,le]);let ue=a.default.useContext(i.SchemaRendererContext)?.dataSource??null,de=a.default.useMemo(()=>{let e={};for(let t of A)t?.name&&(e[t.name]=t.label||t.name);return e},[A]),K=a.default.useMemo(()=>{let e=new Map;for(let t of G??[])for(let n of t.fields??[])e.has(n)||e.set(n,t.key);return e},[G]),fe=a.default.useMemo(()=>{if(!G?.length)return;let t=G.map(e=>e.key).filter(e=>!ce.has(e));if(t.length)return R&&t.includes(R)?R:e.defaultFieldTab&&t.includes(e.defaultFieldTab)?e.defaultFieldTab:t[0]},[G,ce,R,e.defaultFieldTab]),pe=a.default.useMemo(()=>{if(!G)return null;let e=as(A);return G.map(t=>({key:t.key,label:t.label||t.key,description:t.description,containerClass:t.containerClass,fields:(t.fields??[]).map(t=>e.get(t)).filter(e=>!!e)}))},[G,A]),me=a.default.useMemo(()=>pe?os(pe,A):[],[pe,A]),he=a.default.useMemo(()=>pe?ce.size===0?pe:pe.filter(e=>!ce.has(e.key)):null,[pe,ce]),ge=a.default.useMemo(()=>{let t=e.fieldPanes;if(e.children||G||!Array.isArray(t))return null;let n=t.filter(e=>e&&typeof e.key==`string`);return n.length>1?n:null},[e.fieldPanes,e.children,G]),_e=a.default.useMemo(()=>{if(!ge)return null;let e=as(A);return ge.map(t=>({key:t.key,defaultSize:ss(t.defaultSize),minSize:ss(t.minSize)??`20`,containerClass:t.containerClass,fields:(t.fields??[]).map(t=>e.get(t)).filter(e=>!!e)}))},[ge,A]),ve=a.default.useMemo(()=>_e?os(_e,A):[],[_e,A]),ye=a.default.useMemo(()=>{let e=new Set;if(!G)return e;for(let t of te){let n=K.get(t);n&&e.add(n)}return e},[G,K,te]);a.default.useEffect(()=>{for(let e of A){let n=e?.name;if(!n)continue;let r=e.widget||e.type;if(typeof r!=`string`||!t.CASCADE_OPTION_WIDGET_TYPES.has(ks(r)))continue;let i=e.options;if(!i||i.length===0)continue;let a=e.dependsOn;if(!i.some(e=>e?.visibleWhen!=null)&&!a)continue;let o=M.getValues(n);if(o==null||o===``)continue;let{options:s,gated:c}=(0,t.resolveCascadingOptions)(i,U,a,H);c||(0,t.isValueStillOffered)(o,s)||M.setValue(n,Array.isArray(o)?[]:null,{shouldValidate:!1,shouldDirty:!0})}},[U,H]);let be=a.default.useRef(void 0),xe=a.default.useRef(void 0);a.default.useEffect(()=>{let e=be.current;if(be.current=oe,!e)return;let t=xe.current,n=t!==void 0&&!gs(t.values,M.getValues());n||(xe.current=void 0);let r=[];for(let t of oe){if(e.has(t))continue;let n=M.getValues(t);n!=null&&n!==``&&(M.setValue(t,Array.isArray(n)?[]:null,{shouldValidate:!1,shouldDirty:!0}),(Array.isArray(n)?n.length===0:n===!1&&_s.has(vs(A.find(e=>e?.name===t))))||r.push(t))}if(r.length===0)return;let i=n&&t?[...t.names,...r]:r;xe.current={names:i,values:{...M.getValues()}},B.toast.warning(u(`form.clearedOnHide`,{fields:i.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))}),{id:L})},[oe]);let Se=a.default.useRef(void 0),Ce=a.default.useRef(j??{}),we=a.default.useRef(!1);a.default.useLayoutEffect(()=>{let e;try{e=JSON.stringify(j??{})}catch{e=String(Date.now())}if(Se.current===e)return;Se.current=e;let t=j??{},n=Ce.current,r=Object.entries(M.getValues()).filter(([e,r])=>!hs(t,e)&&!hs(n,e)&&!ms(n[e],r));Ce.current=t,we.current=!0;try{M.reset(j);for(let[e,t]of r)M.setValue(e,t,{shouldValidate:!1,shouldDirty:!0})}finally{we.current=!1}ne([]),C?.(r.length>0)},[j]),a.default.useLayoutEffect(()=>{if(r){let e=M.watch(e=>{we.current||r({type:`form_change`,data:e,formData:e})});return()=>e.unsubscribe()}},[M,r]),a.default.useLayoutEffect(()=>{let e=M.watch(e=>{C?.(gs(Ce.current,e))});return()=>e.unsubscribe()},[M,C]),a.default.useLayoutEffect(()=>{if(S){let e=M.watch(e=>{we.current||S(e)});return()=>e.unsubscribe()}},[M,S]);let Te=e=>{let t=N.current??document,n=typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`),r=t.querySelector(`[data-field="${n}"]`);r&&(r.scrollIntoView?.({behavior:`smooth`,block:`center`}),r.querySelector(`input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]`)?.focus?.({preventScroll:!0}))},Ee=e=>{if(e.length===0)return;ne(e);let t=e.map(e=>de[e]||e),n=t.slice(0,3).join(u(`validation.formInvalidJoiner`))+(t.length>3?`…`:``);B.toast.error(u(`validation.formInvalid`,{fields:n}),{id:L});let r=new Set(e),i=A.map(e=>e?.name).find(e=>!!e&&r.has(e))??e[0],a=K.get(i);if(!(a&&ce.has(a))){if(a&&a!==fe){z(a),typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>Te(i)):setTimeout(()=>Te(i),0);return}Te(i)}},Y=M.handleSubmit(async e=>{P(!0),I(null),B.toast.dismiss(L),ne([]);let t=e;if(e&&(e.nativeEvent||typeof e.preventDefault==`function`||typeof e.stopPropagation==`function`||e.target||e.bubbles))t=M.getValues();else if(!t||Object.keys(t).length===0){let e=M.getValues();e&&Object.keys(e).length>0&&(t=e)}if(ae.size>0&&t&&typeof t==`object`){let e={};for(let n of Object.keys(t))ae.has(n)||(e[n]=t[n]);t=e}try{if(r){let e=await r({type:`form_submit`,data:t,formData:t});if(e?.error){I(e.error),B.toast.error(e.error,{id:L});return}}x&&typeof x==`function`&&await x(t),T&&M.reset()}catch(e){let t=(0,i.extractFieldErrors)(e);if(t){let n=t.filter(e=>A.some(t=>t?.name===e.field));for(let t of n)M.setError(t.field,{type:`server`,message:t.message||(0,i.extractWriteErrorMessage)(e)||u(`form.submitFailed`)});if(n.length>0&&n.length===t.length){Ee(n.map(e=>e.field));return}}let n=(0,i.declaredUserMessage)(e)??((0,i.isPermissionError)(e)?u(`form.noPermissionToSave`):(0,i.extractWriteErrorMessage)(e)??u(`form.submitFailed`));(0,i.isPermissionError)(e)&&typeof console<`u`&&console.warn(`[form] write denied:`,e),I(n),B.toast.error(n,{id:L}),typeof process<`u`&&process.env.NODE_ENV===`development`&&console.error(`Form submission error:`,e)}finally{P(!1)}},e=>{Ee(Object.keys(e||{}))}),De=e=>{if(se.length>0){e?.preventDefault?.(),B.toast.dismiss(L);let t=u(`form.visibleWhenFaulted`,{fields:se.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))});return I(t),B.toast.error(t,{id:L}),ne(se),Promise.resolve()}return Y(e)},Oe=()=>{M.reset(),w&&typeof w==`function`&&w(),r&&r({type:`form_cancel`,data:M.getValues()})},ke=b>1?q(`grid gap-4`,b===1?``:b===2?`md:grid-cols-2`:b===3?`md:grid-cols-2 lg:grid-cols-3`:`md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`):`space-y-4`,Ae=e.fieldContainerClass||ke,je=e.fieldTabsPosition||`top`,Me=je===`left`||je===`right`,Ne=a.default.useRef(void 0),Pe=Ne.current??=new Map,Fe=n=>{let{name:r,label:i,description:a,type:s=`input`,required:c=!1,disabled:l=!1,validation:f={},condition:p,colSpan:m,hidden:h,widget:g,visibleOn:_,readonly:v,visibleWhen:y,readonlyWhen:b,requiredWhen:x,...S}=n;if(h||W.has(r))return null;let C=Os(p);if(C&&!(0,t.evalFieldPredicate)(C,U,!0,void 0,void 0,{context:`condition of field '${r}'`}))return null;let w=(0,t.resolveFieldRuleState)({visibleWhen:y,readonlyWhen:b,requiredWhen:x},U,{required:c,readonly:v===!0,serverOwnedValue:(0,t.isServerOwnedValue)(n,ie)},V,H,`field '${r}'`);if(!w.visible||_!=null&&!(0,t.evalFieldPredicate)(_,U,!0,V,H,{context:`visibleOn of field '${r}'`}))return null;let T=w.required,E=w.readonly;if(s===`section-divider`){let e=S;return(0,o.jsx)(is,{label:i,description:a,collapsible:e.collapsible,collapsed:e.collapsed,onToggle:e.onToggle,className:e.className},r)}let D={...f};delete D.required,T?Pe.set(r,typeof f.required==`string`?f.required:u(`validation.required`,{field:i||r})):Pe.delete(r);let k=D.validate;D.validate={...typeof k==`function`?{validate:k}:k??{},required:e=>{let n=Pe.get(r);return n===void 0||!(0,t.isMissingForRequired)(e)||n}};let A=(e,t)=>e&&typeof e==`object`&&e.message==null&&typeof e.messageKey==`string`?{...e,message:u(e.messageKey,{field:i||r,...t?.(e)})}:e;D.minLength&&=A(D.minLength,e=>({min:e.value})),D.maxLength&&=A(D.maxLength,e=>({max:e.value})),D.min&&=A(D.min,e=>({min:e.value})),D.max&&=A(D.max,e=>({max:e.value})),D.pattern&&=A(D.pattern);let j=n.id??r,N=xs(g||S.field?.widget||s,S.multiple),P=t.CASCADE_OPTION_WIDGET_TYPES.has(ks(N)),F=S.options,I=P?(0,t.resolveCascadingOptions)(F,U,n.dependsOn,H):null,L=I?.gated??!1,R=I?.dependsOnFields??[],z=I?I.options:F,B=L?u(`fields.options.selectFirst`,{fields:R.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))}):void 0,te=e.fieldContainerClass||ke,ne=e=>ds(te,e),re=m&&m>1?m===2?ne(2):m===3?ne(3):m>=4?ne(4):``:``,ae=`field:${e.objectName?`${e.objectName}.`:``}${r}`,oe=As(N),se=oe===`group`,G=(E===!0||oe===`display`)&&!!i&&!se&&js(N),ce=i&&(se||G)?`${d}${String(r).replace(/\s+/g,`_`)}-group-label`:void 0,le=se?ce:void 0,K=P?z:S.options,q=Ms(N,K);return(0,o.jsx)(Un,{control:M.control,name:r,rules:D,render:({field:e,fieldState:t})=>(0,o.jsxs)(Kn,{className:re||void 0,"data-testid":ae,"data-field":r,children:[i&&(0,o.jsxs)(qn,{className:`text-xs font-normal text-muted-foreground`,...ce?{id:ce,htmlFor:void 0}:null,...q?{htmlFor:void 0}:null,children:[i,T&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Jn,{children:Ps(G?ce:void 0,qs(N,{...S,field:n.field||n,...e,inputType:S.inputType,label:i,options:K,placeholder:S.placeholder??(N===`select`?u(`common.selectOption`):void 0),disabled:O||l||ee||L,readonly:E,emptyHint:B,dataSource:ue,dependentValues:U,dependsOnLabels:de,error:t.error?.message,"aria-required":T||void 0,...le?{"aria-labelledby":le}:null}))}),a&&(0,o.jsx)(Yn,{children:a}),(0,o.jsx)(Xn,{})]})},j)},{"data-obj-id":Ie,"data-obj-type":Le,style:Z,onSubmit:Re,onChange:ze,submitLabel:Be,cancelLabel:He,showSubmit:We,showCancel:Ge,resetOnSubmit:Ke,defaultValues:qe,inputType:Je,dataSource:Ye,showActions:Xe,fieldContainerClass:Ze,mobileStickyActions:Qe,objectName:$e,previousValues:et,onDirtyChange:tt,onCancel:nt,fields:rt,layout:it,columns:at,validationMode:ot,fieldTabs:st,defaultFieldTab:ct,fieldTabsPosition:lt,fieldPanes:ut,fieldPanesOrientation:dt,fieldPanesResizable:ft,...pt}=c;return(0,o.jsx)(Vn,{...M,children:(0,o.jsxs)(`form`,{ref:N,onSubmit:De,className:n,...pt,"data-obj-id":Ie,"data-obj-type":Le,style:Z,children:[F&&(0,o.jsxs)(Ve,{variant:`destructive`,className:`mb-4`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Ue,{children:F})]}),k.length>0&&(0,o.jsxs)(Ve,{variant:`destructive`,className:`mb-4`,"data-testid":`form-spec-vocabulary-error`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Ue,{children:`Not rendered — spec form-view vocabulary ({ field: … }) in a standalone form: `+k.map(e=>e.field).join(`, `)+`. Use { name: … }, or an object-bound form with sections.`})]}),e.children?(0,o.jsx)(`div`,{className:e.fieldContainerClass||`space-y-4`,children:J(e.children)}):pe&&he?(0,o.jsxs)(o.Fragment,{children:[me.length>0&&(0,o.jsx)(`div`,{className:q(Ae,`mb-4`),children:me.map(Fe)}),he.length>0&&(0,o.jsxs)(ua,{value:fe,onValueChange:z,orientation:Me?`vertical`:`horizontal`,className:q(`flex w-full`,Me?`gap-4`:`flex-col`),children:[(0,o.jsx)(da,{className:q(`self-start`,Me?q(`h-auto flex-col`,je===`right`&&`order-last`):je===`bottom`?`order-last mt-4`:`mb-4`),children:he.map(e=>(0,o.jsxs)(fa,{value:e.key,"data-testid":`form-tab:${e.key}`,"data-error":ye.has(e.key)||void 0,className:q(Me&&`w-full justify-start`,ye.has(e.key)&&`text-destructive data-[state=active]:text-destructive`),children:[e.label,ye.has(e.key)&&(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1.5 size-1.5 rounded-full bg-destructive`})]},e.key))}),(0,o.jsx)(`div`,{className:`min-w-0 flex-1`,children:he.map(e=>(0,o.jsxs)(pa,{value:e.key,forceMount:!0,className:`mt-0 data-[state=inactive]:hidden`,"data-testid":`form-tab-panel:${e.key}`,children:[e.description&&(0,o.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:e.description}),(0,o.jsx)(`div`,{className:e.containerClass||Ae,children:e.fields.map(Fe)})]},e.key))})]})]}):_e?(0,o.jsxs)(o.Fragment,{children:[ve.length>0&&(0,o.jsx)(`div`,{className:q(Ae,`mb-4`),children:ve.map(Fe)}),(0,o.jsx)(qo,{orientation:e.fieldPanesOrientation===`vertical`?`vertical`:`horizontal`,className:`min-h-[300px] rounded-lg border`,children:_e.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[n>0&&(0,o.jsx)(Yo,{withHandle:e.fieldPanesResizable!==!1,disabled:e.fieldPanesResizable===!1}),(0,o.jsx)(Jo,{defaultSize:t.defaultSize,minSize:t.minSize,children:(0,o.jsx)(`div`,{className:q(`@container p-4`,t.containerClass||Ae),"data-testid":`form-pane:${t.key}`,children:t.fields.map(Fe)})})]},t.key))})]}):(0,o.jsx)(`div`,{className:Ae,children:A.map(Fe)}),e.showActions!==!1&&(0,o.jsxs)(`div`,{className:q(`flex flex-col sm:flex-row gap-2 ${y===`horizontal`?`sm:justify-end`:`sm:justify-start`} mt-6`,e.mobileStickyActions&&`sticky bottom-0 z-10 -mx-4 px-4 py-3 bg-background/95 supports-[backdrop-filter]:bg-background/80 backdrop-blur border-t md:static md:mx-0 md:px-0 md:py-0 md:bg-transparent md:border-0 md:backdrop-blur-none`),"data-testid":e.mobileStickyActions?`form-mobile-sticky-actions`:void 0,children:[_&&(0,o.jsx)(X,{type:`button`,variant:`outline`,onClick:Oe,disabled:ee||O,className:`w-full sm:w-auto`,children:g??u(`common.cancel`)}),v&&(0,o.jsxs)(X,{type:`submit`,disabled:ee||O,className:`w-full sm:w-auto`,children:[ee&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),h??u(`common.submit`)]})]})]})})},{namespace:`ui`,label:`Form`,inputs:[{name:`fields`,type:`array`,description:`Array of field configurations with name, label, type, validation, etc.`},{name:`defaultValues`,type:`object`,description:`Object with default values for form fields`},{name:`submitLabel`,type:`string`},{name:`cancelLabel`,type:`string`},{name:`showCancel`,type:`boolean`},{name:`layout`,type:`enum`,enum:[`vertical`,`horizontal`]},{name:`columns`,type:`number`,description:`For multi-column layouts (1-4)`},{name:`validationMode`,type:`enum`,enum:[`onSubmit`,`onBlur`,`onChange`,`onTouched`,`all`]},{name:`resetOnSubmit`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`className`,type:`string`},{name:`fieldContainerClass`,type:`string`},{name:`children`,type:`slot`,description:`Authored form body, rendered in place of the generated field list`}],defaultProps:{submitLabel:`Submit`,cancelLabel:`Cancel`,showCancel:!1,layout:`vertical`,columns:1,validationMode:`onSubmit`,resetOnSubmit:!1,disabled:!1,fields:[{name:`name`,label:`Name`,type:`input`,required:!0,placeholder:`Enter your name`},{name:`email`,label:`Email`,type:`input`,inputType:`email`,required:!0,placeholder:`Enter your email`}]}});var Rs=new Set([`date`,`datetime-local`,`time`,`month`,`week`]),zs={email:`email`,password:`password`,secret:`password`,"ui:password":`password`},Bs=new Set([`password`,`secret`]),Vs=new Set;function Hs(e,t){let n=`${e}::${t}`;Vs.has(n)||(Vs.add(n),console.error(`[object-ui] form field '${t}': widget '${e}' is NOT registered, so this form has no widget for a SECRET value. The field renders a refusal instead of an input — the default input branch would render it as \`type="text"\` and put the secret on screen in clear text (objectui#5322). Register the field widgets — \`registerAllFields()\` from \`@object-ui/fields\` — so '${e}' resolves. In a hand-authored standalone form, write the built-in spelling \`{ type: 'password' }\` instead, which renders the native masked input on this branch.`))}function Us({widgetType:e,fieldName:t,className:n,...r}){return a.default.useEffect(()=>{Hs(e,t)},[e,t]),(0,o.jsx)(`div`,{role:`alert`,"data-testid":`field-missing-secret-widget`,"data-missing-field-widget":e,className:q(`rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive`,n),...r,children:`This field was not rendered: its widget \`${e}\` is not registered. Register the field widgets (\`registerAllFields()\` from \`@object-ui/fields\`). A secret is never rendered in a plain text box.`})}function Ws(e){if(e&&Rs.has(e))return e=>{let t=e.currentTarget;if(!(t.disabled||t.readOnly))try{t.showPicker?.()}catch{}}}function Gs({emptyHint:e,className:t,...n}){let{t:r}=fs();return(0,o.jsx)(`div`,{className:q(`text-sm text-muted-foreground`,t),...n,children:e||r(`fields.options.empty`)})}var Ks=a.default.forwardRef(function({options:e,placeholder:t,value:n,onValueChange:r,disabled:i,name:a,className:s,...c},l){return(0,o.jsxs)(Wr,{name:a,value:Wo(n),onValueChange:t=>r?.(Go(e,t)),disabled:i,children:[(0,o.jsx)(qr,{ref:l,...c,className:q(`min-h-[44px] sm:min-h-0`,s),children:(0,o.jsx)(Kr,{placeholder:t})}),(0,o.jsx)(Xr,{children:e.map(e=>(0,o.jsx)(Qr,{value:String(e.value),children:e.label},String(e.value)))})]})});function qs(e,n){let r=!ys.has(e)&&!e.includes(`:`)?t.ComponentRegistry.get(`field:${e}`):void 0,i=ys.has(e)?void 0:r||(e.startsWith(`field:`)?t.ComponentRegistry.get(e):void 0);if(i)return(0,o.jsx)(i,{...Fs(e,n)});let{inputType:a,options:s=[],placeholder:c,readonly:l,emptyHint:u,...d}=n,f=Es(d),p=l&&`bg-muted/40 cursor-default focus-visible:ring-0`;switch(e){case`input`:{let e=d.maxLength;if(a===`file`){let{value:e,...t}=f;return(0,o.jsx)(Q,{type:`file`,placeholder:c,className:`min-h-[44px] sm:min-h-0`,...t})}return(0,o.jsx)(Q,{type:a||`text`,placeholder:c,className:q(`min-h-[44px] sm:min-h-0`,p),...f,maxLength:e,onClick:e=>{Ws(a)?.(e),f.onClick?.(e)},readOnly:l,value:f.value??``})}case`textarea`:{let{mobile_fullscreen:e,label:t,error:n}=d,r=d.maxLength,i=f;return e?(0,o.jsx)(Is,{placeholder:c,label:t,error:n,className:q(`min-h-[44px] sm:min-h-0`,p),...i,maxLength:r,readOnly:l,value:i.value??``}):(0,o.jsx)(Ls,{placeholder:c,className:q(`min-h-[44px] sm:min-h-0`,p),...i,maxLength:r,readOnly:l,value:i.value??``})}case`checkbox`:{let{value:e,onChange:t,disabled:n,...r}=f;return(0,o.jsx)(Dt,{checked:e,onCheckedChange:t,disabled:n||l,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...r})}case`switch`:{let{value:e,onChange:t,disabled:n,...r}=f;return(0,o.jsx)(ta,{checked:e,onCheckedChange:t,disabled:n||l,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...r})}case`select`:{let{value:e,onChange:t,disabled:n,...r}=f;return!s||s.length===0?(0,o.jsx)(Gs,{emptyHint:u}):(0,o.jsx)(Ks,{...r,options:s,placeholder:c,value:e,onValueChange:t,disabled:n||l})}default:{let t=ks(e);if(e.startsWith(`field:`)&&Bs.has(t))return(0,o.jsx)(Us,{widgetType:e,fieldName:String(d.name??``)});let n=d.maxLength;return(0,o.jsx)(Q,{type:a||zs[t]||`text`,placeholder:c,className:q(p),...f,maxLength:n,onClick:e=>{Ws(a)?.(e),f.onClick?.(e)},readOnly:l})}}}var Js=[...t.SDUI_DOM_PASS_THROUGH_KEYS,`name`,`disabled`];function Ys(e){return(0,t.pickDomProps)(e,Js)}var Xs=(0,a.forwardRef)(({schema:e,disabled:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,u=Wa(e.icon),d=e.loading||n.loading,f=t||d;return(0,o.jsxs)(X,{ref:r,type:e.buttonType||`button`,variant:e.variant,size:e.size,className:e.className,disabled:f,...Ys(c),"data-obj-id":i,"data-obj-type":a,style:s,children:[d&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!d&&u&&e.iconPosition!==`right`&&(0,o.jsx)(u,{className:`mr-2 h-4 w-4`}),e.label||J(e.children),!d&&u&&e.iconPosition===`right`&&(0,o.jsx)(u,{className:`ml-2 h-4 w-4`})]})});Xs.displayName=`ButtonRenderer`,t.ComponentRegistry.register(`button`,Xs,{namespace:`ui`,label:`Button`,inputs:[{name:`label`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Button`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`label`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(Bn,{className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.text||e.label})},{namespace:`ui`,label:`Label`,inputs:[{name:`text`,type:`string`,required:!0},{name:`className`,type:`string`}],defaultProps:{text:`Label Text`}});var Zs=({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let s=e=>{n&&n(e.target.value)},{"data-obj-id":c,"data-obj-type":l,style:u,...d}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":c,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsxs)(Bn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Q,{type:e.inputType||`text`,id:e.id,name:e.name,placeholder:e.placeholder,className:t,required:e.required,disabled:i,readOnly:e.readOnly,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:s,min:e.min,max:e.max,step:e.step,maxLength:e.maxLength,pattern:e.pattern,...Ys(d)}),e.description&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.error&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e.error})]})};t.ComponentRegistry.register(`input`,Zs,{namespace:`ui`,label:`Input Field`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`inputType`,type:`enum`,enum:[`text`,`email`,`password`,`number`,`tel`,`url`,`date`,`time`,`datetime-local`]},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}],defaultProps:{inputType:`text`}}),t.ComponentRegistry.register(`email`,e=>(0,o.jsx)(Zs,{...e,schema:{...e.schema,inputType:`email`}}),{namespace:`ui`,label:`Email Input`,icon:`mail`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}]}),t.ComponentRegistry.register(`password`,e=>(0,o.jsx)(Zs,{...e,schema:{...e.schema,inputType:`password`}}),{namespace:`ui`,label:`Password Input`,icon:`lock`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}]}),t.ComponentRegistry.register(`textarea`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let s=e=>{n&&n(e.target.value)},{"data-obj-id":c,"data-obj-type":l,style:u,...d}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full gap-1.5`,e.wrapperClass),"data-obj-id":c,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsxs)(Bn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(ma,{id:e.id,name:e.name,placeholder:e.placeholder,className:t,disabled:i,readOnly:e.readOnly,required:e.required,rows:e.rows,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:s,...Ys(d)})]})},{namespace:`ui`,label:`Textarea`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`rows`,type:`number`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Textarea label`,placeholder:`Enter text here...`,rows:3,id:`textarea-field`}}),t.ComponentRegistry.register(`checkbox`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let{"data-obj-id":s,"data-obj-type":c,style:l,...u}=a;return(0,o.jsxs)(`div`,{className:q(`flex items-center space-x-2`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[(0,o.jsx)(Dt,{id:e.id,className:t,checked:r??e.checked??!1,defaultChecked:r===void 0?e.defaultChecked:void 0,onCheckedChange:e=>{n&&n(e)},disabled:i,required:e.required,name:e.name,...Ys(u)}),(0,o.jsxs)(Bn,{htmlFor:e.id,className:q(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]})]})},{namespace:`ui`,label:`Checkbox`,inputs:[{name:`label`,type:`string`,required:!0},{name:`id`,type:`string`,required:!0},{name:`checked`,type:`boolean`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`}],defaultProps:{label:`Checkbox label`,id:`checkbox-field`}}),t.ComponentRegistry.register(`switch`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2 ${e.wrapperClass||``}`,"data-obj-id":r,"data-obj-type":i,style:a,children:[(0,o.jsx)(ta,{id:e.id,className:t,...Ys(s)}),(0,o.jsx)(Bn,{htmlFor:e.id,children:e.label})]})},{namespace:`ui`,label:`Switch`,inputs:[{name:`label`,type:`string`,required:!0},{name:`id`,type:`string`,required:!0},{name:`checked`,type:`boolean`}],defaultProps:{label:`Switch label`,id:`switch-field`}}),t.ComponentRegistry.register(`select`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let{"data-obj-id":s,"data-obj-type":c,style:l,...u}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsxs)(Bn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsxs)(Wr,{defaultValue:r===void 0?Wo(e.defaultValue):void 0,value:Wo(r??e.value),onValueChange:t=>{n&&n(Go(e.options,t))},disabled:i,required:e.required,name:e.name,...u,children:[(0,o.jsx)(qr,{id:e.id,className:t,children:(0,o.jsx)(Kr,{placeholder:e.placeholder})}),(0,o.jsx)(Xr,{children:e.options?.map(e=>(0,o.jsx)(Qr,{value:String(e.value),disabled:e.disabled,children:e.label},String(e.value)))})]})]})},{namespace:`ui`,label:`Select`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`defaultValue`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`options`,type:`array`,description:`Array of {label, value} objects`}],defaultProps:{label:`Select an option`,placeholder:`Choose...`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}});var Qs=`vertical`,$s={horizontal:`flex flex-row flex-wrap items-center gap-4`,vertical:void 0};t.ComponentRegistry.register(`radio-group`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation??Qs;return(0,o.jsx)(Br,{defaultValue:Wo(e.defaultValue),orientation:c,className:q($s[c],t),...Ys(s),"data-obj-id":r,"data-obj-type":i,style:a,children:e.options?.map(t=>(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(Vr,{value:String(t.value),id:`${e.id}-${String(t.value)}`}),(0,o.jsx)(Bn,{htmlFor:`${e.id}-${String(t.value)}`,children:t.label})]},String(t.value)))})},{namespace:`ui`,label:`Radio Group`,inputs:[{name:`defaultValue`,type:`string`},{name:`id`,type:`string`,required:!0},{name:`options`,type:`array`,description:`Array of {label, value} objects`},{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`className`,type:`string`}],defaultProps:{id:`radio-group`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`slider`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=Array.isArray(e.defaultValue)?e.defaultValue:e.defaultValue===void 0?void 0:[e.defaultValue];return(0,o.jsx)($i,{defaultValue:c,max:e.max,min:e.min,step:e.step,className:t,...Ys(s),"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Slider`,inputs:[{name:`defaultValue`,type:`array`},{name:`max`,type:`number`},{name:`min`,type:`number`},{name:`step`,type:`number`},{name:`className`,type:`string`}],defaultProps:{defaultValue:[50],max:100,min:0,step:1,className:`w-full`}}),t.ComponentRegistry.register(`toggle`,({schema:e,...t})=>{let{style:n,...r}=t;return(0,o.jsx)(ga,{variant:e.variant,size:e.size,pressed:e.pressed,"aria-label":(0,i.resolveKeyedI18nLabel)(e.ariaLabel),...Ys(r),style:n,children:e.label||J(e.children)})},{namespace:`ui`,label:`Toggle`,inputs:[{name:`label`,type:`string`},{name:`pressed`,type:`boolean`},{name:`variant`,type:`enum`,enum:[`default`,`outline`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`]},{name:`ariaLabel`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Toggle`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`input-otp`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{style:a,...s}=i,c=e.length||6,l=e.separator===!0&&c>1?Math.ceil(c/2):c,u=(e,t)=>Array.from({length:t-e},(t,n)=>(0,o.jsx)(nr,{index:e+n},e+n));return(0,o.jsxs)(er,{maxLength:c,className:t,value:r??e.value,onChange:e=>{n&&n(e)},...Ys(s),style:a,children:[(0,o.jsx)(tr,{children:u(0,l)}),l<c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(rr,{}),(0,o.jsx)(tr,{children:u(l,c)})]})]})},{namespace:`ui`,label:`Input OTP`,inputs:[{name:`length`,type:`number`},{name:`separator`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{length:6}});function ec(e){return typeof e==`string`?(0,t.toDisplayDate)(e):e instanceof Date?e:void 0}function tc(e,t){if(t!=null){if(e===`multiple`)return Array.isArray(t)?t.map(ec).filter(e=>e!==void 0):void 0;if(e===`range`){if(typeof t!=`object`||Array.isArray(t)||t instanceof Date)return;let{from:e,to:n}=t;return{from:ec(e),to:ec(n)}}return ec(t)}}function nc(e){let t=e=>e instanceof Date&&!Number.isNaN(e.getTime());if(Array.isArray(e))return e.find(t);let n=e instanceof Date?e:e?.from;return t(n)?n:void 0}t.ComponentRegistry.register(`calendar`,({schema:e,className:t,...n})=>{let r=e.mode||`single`,i=tc(r,e.value||e.defaultValue);return(0,o.jsx)(ft,{mode:r,selected:i,defaultMonth:nc(i),className:t,...n})},{namespace:`ui`,skipFallback:!0,label:`Calendar`,inputs:[{name:`mode`,type:`enum`,enum:[`single`,`multiple`,`range`]},{name:`className`,type:`string`}],defaultProps:{mode:`single`,className:`rounded-md border`}});function rc(e){return typeof e==`string`&&(0,t.isRealCalendarDate)(e)?(0,t.toDisplayDate)(e):e}t.ComponentRegistry.register(`date-picker`,({schema:e,className:t,value:n,onChange:r,...i})=>{let a=dt(),s=rc(n),c=s,u=e=>{r&&r(e)},{"data-obj-id":d,"data-obj-type":f,style:p,...m}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-1.5 ${e.wrapperClass||``}`,"data-obj-id":d,"data-obj-type":f,style:p,children:[e.label&&(0,o.jsx)(Bn,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(Ir,{children:[(0,o.jsx)(Lr,{asChild:!0,children:(0,o.jsxs)(X,{id:e.id,variant:`outline`,className:q(`w-full justify-start text-left font-normal`,!n&&`text-muted-foreground`,t),...Ys(m),children:[(0,o.jsx)(l.CalendarIcon,{className:`mr-2 h-4 w-4`}),s?(0,U.format)(s,e.format||`PPP`,{locale:a}):(0,o.jsx)(`span`,{children:e.placeholder||`Pick a date`})]})}),(0,o.jsx)(Rr,{className:`w-auto p-0`,children:(0,o.jsx)(ft,{mode:`single`,defaultMonth:c,selected:c,onSelect:u,autoFocus:!0})})]})]})},{namespace:`ui`,label:`Date Picker`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`format`,type:`string`,description:`date-fns format string (e.g., "PPP", "yyyy-MM-dd")`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Date`,placeholder:`Pick a date`,format:`PPP`,id:`date-picker-field`}}),t.ComponentRegistry.register(`file-upload`,({schema:e,className:t,value:n,onChange:r,...i})=>{let[s,c]=(0,a.useState)(n||[]),[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(0),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(u){let e=setInterval(()=>{p(t=>t>=100?(clearInterval(e),d(!1),0):t+5)},50);return()=>clearInterval(e)}},[u]);let h=t=>{let n=Array.from(t.target.files||[]);if(n.length>0){d(!0),p(0);let t=e.multiple?[...s,...n]:n;setTimeout(()=>{c(t),r&&r(t)},1e3)}},g=e=>{let t=s.filter((t,n)=>n!==e);c(t),r&&r(t)},_=()=>{m.current?.click()},{"data-obj-id":v,"data-obj-type":y,style:b,...x}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-2 ${e.wrapperClass||``}`,"data-obj-id":v,"data-obj-type":y,style:b,children:[e.label&&(0,o.jsx)(Bn,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(`div`,{className:q(`relative flex flex-col gap-3 group/upload`,t),children:[(0,o.jsx)(`input`,{ref:m,type:`file`,id:e.id,className:`hidden`,accept:e.accept,multiple:e.multiple,onChange:h,...Ys(x)}),(0,o.jsxs)(`div`,{onClick:_,className:q(`relative overflow-hidden cursor-pointer rounded-lg border-2 border-dashed transition-all duration-300 min-h-[120px] flex flex-col items-center justify-center p-4 sm:p-6 gap-3`,u?`border-cyan-400 bg-cyan-950/30`:`border-slate-700 bg-slate-900/50 hover:bg-slate-900 hover:border-cyan-500/50 hover:shadow-[0_0_20px_-5px_rgba(6,182,212,0.3)]`),children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-5 pointer-events-none`}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[linear-gradient(to_right,#80808012_1px,transparent_1px),linear-gradient(to_bottom,#80808012_1px,transparent_1px)] bg-[size:14px_24px] pointer-events-none`}),(0,o.jsx)(`div`,{className:q(`relative z-10 p-3 rounded-full bg-slate-800 border border-slate-700 transition-all duration-500`,u?`scale-110 shadow-[0_0_30px_cyan] border-cyan-400 animate-bounce`:`group-hover/upload:scale-110 group-hover/upload:shadow-lg group-hover/upload:border-cyan-500`),children:u?(0,o.jsx)(l.Rocket,{className:`w-8 h-8 text-cyan-300 animate-pulse`}):(0,o.jsx)(l.Upload,{className:`w-6 h-6 text-slate-400 group-hover/upload:text-cyan-400`})}),(0,o.jsx)(`div`,{className:`relative z-10 text-center`,children:(0,o.jsx)(`p`,{className:q(`text-xs font-mono uppercase tracking-widest transition-colors`,u?`text-cyan-300`:`text-slate-500 group-hover/upload:text-cyan-200`),children:u?`INITIATING LAUNCH SEQUENCE...`:e.buttonText||`DROP PAYLOAD OR CLICK TO UPLOAD`})}),u&&(0,o.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1 bg-cyan-500 shadow-[0_0_10px_cyan] transition-all duration-75 ease-out`,style:{width:`${f}%`}})]}),s.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-2 mt-1 perspective-1000`,children:s.map((e,t)=>(0,o.jsxs)(`div`,{className:`relative group/file overflow-hidden flex items-center justify-between p-3 border border-border bg-card/80 rounded-sm text-sm transition-all hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 animate-in slide-in-from-bottom-2 fade-in`,children:[(0,o.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-[2px] bg-primary/50 group-hover/file:bg-primary group-hover/file:shadow-[0_0_8px_hsl(var(--primary))]`}),(0,o.jsxs)(`div`,{className:`flex items-center gap-3 z-10`,children:[(0,o.jsx)(l.CheckCircle2,{className:`w-4 h-4 text-emerald-500 rounded-full`}),(0,o.jsx)(`span`,{className:`truncate max-w-[150px] sm:max-w-[200px] md:max-w-[300px] text-muted-foreground group-hover/file:text-foreground font-mono text-xs transition-colors`,children:e.name})]}),(0,o.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive`,onClick:()=>g(t),children:(0,o.jsx)(l.X,{className:`h-3 w-3`})}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-transparent via-primary/5 to-transparent -translate-x-full group-hover/file:animate-[shimmer_1s_infinite] pointer-events-none`})]},t))})]})]})},{namespace:`ui`,label:`File Upload`,inputs:[{name:`label`,type:`string`},{name:`buttonText`,type:`string`},{name:`accept`,type:`string`,description:`MIME types (e.g., "image/*,application/pdf")`},{name:`multiple`,type:`boolean`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Upload files`,buttonText:`Choose files`,multiple:!0,id:`file-upload-field`}});var ic=(0,f.cva)(`flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function ac({className:e,orientation:t,...n}){return(0,o.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(ic({orientation:t}),e),...n})}function oc({className:e,asChild:t=!1,...n}){return(0,o.jsx)(t?d.Slot:`div`,{className:q(`bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...n})}function sc({className:e,orientation:t=`vertical`,...n}){return(0,o.jsx)(ei,{"data-slot":`button-group-separator`,orientation:t,className:q(`bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto`,e),...n})}function cc({options:e,value:t,onValueChange:n,placeholder:r=`Select option...`,searchPlaceholder:i=`Search...`,emptyText:s=`No option found.`,className:c,disabled:u,...d}){let[f,p]=a.useState(!1);return(0,o.jsxs)(Ir,{open:f,onOpenChange:p,children:[(0,o.jsx)(Lr,{asChild:!0,children:(0,o.jsxs)(X,{type:`button`,...d,variant:`outline`,role:`combobox`,"aria-expanded":f,className:q(`w-[200px] min-w-0 justify-between`,c),disabled:u,children:[(0,o.jsx)(`span`,{className:`truncate`,children:t?e.find(e=>e.value===t)?.label:r}),(0,o.jsx)(l.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,o.jsx)(Rr,{className:`w-[var(--radix-popover-trigger-width)] min-w-[200px] p-0`,children:(0,o.jsxs)(Ut,{children:[(0,o.jsx)(Gt,{placeholder:i}),(0,o.jsxs)(Kt,{children:[(0,o.jsx)(qt,{children:s}),(0,o.jsx)(Jt,{children:e.map(e=>(0,o.jsxs)(Xt,{value:e.value,disabled:e.disabled,onSelect:e=>{n?.(e===t?``:e),p(!1)},children:[(0,o.jsx)(l.Check,{className:q(`mr-2 h-4 w-4`,t===e.value?`opacity-100`:`opacity-0`)}),e.label]},e.value))})]})]})})]})}function lc({label:e,value:t,onClick:n,children:r,className:i}){return(0,o.jsxs)(n?`button`:`div`,{className:q(`flex items-center justify-between py-1.5 min-h-[32px] w-full text-left`,n&&`cursor-pointer hover:bg-accent/50 rounded-sm -mx-1 px-1`,i),onClick:n,type:n?`button`:void 0,children:[(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 max-w-[45%] truncate`,title:e,children:e}),r||(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate ml-4 text-right max-w-[55%]`,title:t,children:t})]})}var uc=[{value:`equals`,label:`Equals`},{value:`not_equals`,label:`Does not equal`},{value:`contains`,label:`Contains`},{value:`icontains`,label:`Contains (ignore case)`},{value:`not_contains`,label:`Does not contain`},{value:`is_empty`,label:`Is empty`},{value:`is_not_empty`,label:`Is not empty`},{value:`greater_than`,label:`Greater than`},{value:`less_than`,label:`Less than`},{value:`greater_than_or_equal`,label:`Greater than or equal`},{value:`less_than_or_equal`,label:`Less than or equal`},{value:`before`,label:`Before`},{value:`after`,label:`After`},{value:`between`,label:`Between`},{value:`in`,label:`In`},{value:`not_in`,label:`Not in`},{value:`starts_with`,label:`Starts with`},{value:`ends_with`,label:`Ends with`},{value:`is_null`,label:`Is null`},{value:`is_not_null`,label:`Is not null`},{value:`exists`,label:`Is set`},{value:`notExists`,label:`Is not set`}],dc=new Set([`exists`,`notExists`]),fc=uc.map(e=>e.value),pc=new Set(fc);function mc(e){return pc.has(e)}var hc=new Map([[`containsCaseInsensitive`,`icontains`]]);function gc(e){let t=hc.get(e);if(t!==void 0)return t;let n=(0,ae.normalizeFilterOperator)(e);return typeof n==`string`?n:e}function _c(e){let t=!1,n=e.conditions.map(e=>{if(!e||typeof e.operator!=`string`)return e;let n=gc(e.operator);return n===e.operator||!mc(n)?e:(t=!0,{...e,operator:n})});return t?{...e,conditions:n}:e}var vc=new Set([`is_empty`,`is_not_empty`,`is_null`,`is_not_null`,`exists`,`notExists`]),yc=new Set(ae.VIEW_FILTER_LIST_VALUE_OPERATORS),bc=new Set(ae.VIEW_FILTER_PAIR_VALUE_OPERATORS);function xc(e){let t=gc(e);return yc.has(t)?`list`:bc.has(t)?`pair`:`scalar`}function Sc(e,t){switch(xc(t)){case`list`:return Array.isArray(e)?e:$c(e);case`pair`:{let[t=``,n=``]=$c(e);return t===``&&n===``?[]:[t,n]}default:return Array.isArray(e)?e[0]??``:e}}function Cc(e,t){let n=gc(e);return t.some(e=>gc(e.value)===n)?e:t[0]?.value??e}function wc(e,t){let n=gc(e);return t.find(e=>gc(e.value)===n)?.value??e}function Tc(e){let t=e||`text`;return Kc.includes(t)?`number`:t===`boolean`?`boolean`:t===`date`?`date`:t===`datetime`?`datetime`:t===`time`?`time`:`text`}var Ec={text:`text`,number:`number`,date:`date`,datetime:`datetime-local`,time:`time`,boolean:`text`},Dc=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?$/,Oc=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function kc(e,t,n){return Number(e)<=23&&Number(t)<=59&&(n===void 0||Number(n)<=59)}function Ac(e,n){if(e===``)return``;switch(n){case`text`:return typeof e==`string`?e:String(e);case`number`:{if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`boolean`)return;let t=e.trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?n:void 0}case`boolean`:{if(typeof e==`boolean`)return e;if(typeof e==`number`)return;let t=e.trim().toLowerCase();return t===`true`||t!==`false`&&void 0}case`date`:{if(typeof e!=`string`)return;let n=e.trim(),r=Dc.exec(n);return r?(0,t.isRealCalendarDate)(r[1])&&kc(r[2],r[3],r[4])?r[1]:void 0:(0,t.isRealCalendarDate)(n)?n:void 0}case`datetime`:{if(typeof e!=`string`)return;let n=e.trim(),r=Dc.exec(n);return r&&(0,t.isRealCalendarDate)(r[1])&&kc(r[2],r[3],r[4])?n:void 0}case`time`:{if(typeof e!=`string`)return;let t=e.trim(),n=Oc.exec(t);return n&&kc(n[1],n[2],n[3])?t:void 0}}}function jc(e,t,n){let r=Tc(t);switch(xc(n)){case`list`:{let t=[];for(let n of $c(e)){let e=Ac(n,r);e!==void 0&&e!==``&&t.push(e)}return t}case`pair`:{let[t=``,n=``]=$c(e),i=Ac(t,r)??``,a=Ac(n,r)??``;return i===``&&a===``?[]:[i,a]}default:return Ac(Array.isArray(e)?e[0]??``:e,r)??``}}function Mc(e){return(e?.options??[]).map(e=>String(e.value))}function Nc(e){let t=e?.options;return Array.isArray(t)&&t.length>0}function Pc(e,t){if(!e?.options)return!1;let n=e.type||``;switch(xc(t)){case`list`:return!0;case`pair`:return!1;default:return Jc.includes(n)||Yc.includes(n)}}function Fc(e,t,n){if(!Nc(t)||!Pc(t,n))return e;let r=new Set(Mc(t));if(xc(n)===`list`)return $c(e).filter(e=>r.has(String(e)));let i=Array.isArray(e)?e[0]??``:e;return Zc(i)?``:r.has(String(i))?i:``}function Ic(e,t){if(xc(e)===`pair`){let e=$c(t??``);return e.length===2&&!Zc(e[0])&&!Zc(e[1])}return!(t==null||t===``||Array.isArray(t)&&t.length===0)}function Lc(e){let[t=``,n=``]=$c(e);return[t,n]}var Rc=(0,_.createSafeTranslation)({"filterBuilder.where":`Where`,"filterBuilder.and":`AND`,"filterBuilder.or":`OR`,"filterBuilder.clearAll":`Clear all`,"filterBuilder.selectField":`Select field`,"filterBuilder.operator":`Operator`,"filterBuilder.selectValue":`Select value`,"filterBuilder.value":`Value`,"filterBuilder.addFilter":`Add filter`,"filterBuilder.removeCondition":`Remove condition`,"filterBuilder.trueLabel":`True`,"filterBuilder.falseLabel":`False`,"filterBuilder.noResults":`No results`,"filterBuilder.searchField":`Search {{label}}…`,"filterBuilder.enterId":`Enter {{label}} id`,"filterBuilder.addValue":`Type a value, press Enter`,"filterBuilder.removeValue":`Remove {{value}}`,"filterBuilder.rangeStart":`From`,"filterBuilder.rangeEnd":`To`,"filterBuilder.operators.equals":`Equals`,"filterBuilder.operators.not_equals":`Does not equal`,"filterBuilder.operators.contains":`Contains`,"filterBuilder.operators.icontains":`Contains (ignore case)`,"filterBuilder.operators.not_contains":`Does not contain`,"filterBuilder.operators.is_empty":`Is empty`,"filterBuilder.operators.is_not_empty":`Is not empty`,"filterBuilder.operators.greater_than":`Greater than`,"filterBuilder.operators.less_than":`Less than`,"filterBuilder.operators.greater_than_or_equal":`Greater than or equal`,"filterBuilder.operators.less_than_or_equal":`Less than or equal`,"filterBuilder.operators.before":`Before`,"filterBuilder.operators.after":`After`,"filterBuilder.operators.between":`Between`,"filterBuilder.operators.in":`In`,"filterBuilder.operators.not_in":`Not in`,"filterBuilder.operators.starts_with":`Starts with`,"filterBuilder.operators.ends_with":`Ends with`,"filterBuilder.operators.is_null":`Is null`,"filterBuilder.operators.is_not_null":`Is not null`,"filterBuilder.operators.exists":`Is set`,"filterBuilder.operators.notExists":`Is not set`,"validation.required":`{{field}} is required`},`filterBuilder.where`),zc=[`is_null`,`is_not_null`,`exists`,`notExists`],Bc=[`equals`,`not_equals`,`contains`,`icontains`,`not_contains`,`starts_with`,`ends_with`,`is_empty`,`is_not_empty`,...zc],Vc=[`equals`,`not_equals`,`greater_than`,`less_than`,`greater_than_or_equal`,`less_than_or_equal`,`is_empty`,`is_not_empty`,...zc],Hc=[`equals`,`not_equals`],Uc=[`equals`,`not_equals`,`before`,`after`,`between`,`is_empty`,`is_not_empty`,...zc],Wc=[`equals`,`not_equals`,`in`,`not_in`,`is_empty`,`is_not_empty`,...zc],Gc=[`equals`,`not_equals`,`in`,`not_in`,`is_empty`,`is_not_empty`,...zc],Kc=[`number`,`currency`,`percent`,`rating`],qc=[`date`,`datetime`,`time`],Jc=[`select`,`status`],Yc=[`lookup`,`master_detail`,`user`];function Xc(e,n=[]){let r=e||`text`,i=(0,t.isRetiredFieldType)(r);i&&(0,t.reportRetiredFieldType)(r);let a=i?Bc:Kc.includes(r)?Vc:r===`boolean`?Hc:qc.includes(r)?Uc:Jc.includes(r)?Wc:Yc.includes(r)?Gc:Bc,o=new Set(n);return uc.filter(e=>a.includes(e.value)&&(!dc.has(e.value)||o.has(e.value)))}function Zc(e){return e==null||e===``}function Qc(e){return Zc(e)?``:String(e)}function $c(e){return Array.isArray(e)?e:Zc(e)?[]:[e]}function el(e){return!!e&&typeof e==`object`&&Array.isArray(e.conditions)&&(e.logic===`and`||e.logic===`or`)}var tl={id:`root`,logic:`and`,conditions:[]};function nl({fields:e=[],value:n,onChange:r,className:i,showClearAll:s=!0,extraOperators:c}){let{t:u}=Rc(),[d,f]=a.useState(el(n)?_c(n):tl);a.useEffect(()=>{if(!el(n))return;let e=_c(n);JSON.stringify(e)!==JSON.stringify(d)&&f(e)},[n]);let p=e=>{f(e),r?.(e)},m=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,operator:`equals`,value:``};p({...d,conditions:[...d.conditions,t]})},h=e=>{p({...d,conditions:d.conditions.filter(t=>t.id!==e)})},g=()=>{p({...d,conditions:[]})},_=(e,t)=>{p({...d,conditions:d.conditions.map(n=>n.id===e?{...n,...t}:n)})},v=(e,t)=>{p({...d,conditions:d.conditions.map(n=>n.id===e?{...n,operator:t,value:Sc(n.value,t)}:n)})},y=()=>{p({...d,logic:d.logic===`and`?`or`:`and`})},b=t=>Xc(e.find(e=>e.value===t)?.type,c),x=(t,n)=>{let r=b(n),i=e.find(e=>e.value===n),a=i?.type;p({...d,conditions:d.conditions.map(e=>{if(e.id!==t)return e;let o=Cc(e.operator,r),s=mc(o)?o:e.operator,c=jc(s===e.operator?e.value:Sc(e.value,s),a,s);return{...e,field:n,operator:s,value:Fc(c,i,s)}})})},S=e=>!vc.has(gc(e)),C=t=>Ec[Tc(e.find(e=>e.value===t)?.type)],w=n=>{let r=e.find(e=>e.value===n.field),i=xc(n.operator),a=i===`list`,s=(0,t.isRetiredFieldType)(r?.type);if(s&&(0,t.reportRetiredFieldType)(r.type),!s&&Yc.includes(r?.type||``)&&!Nc(r)&&(r?.referenceTo||r?.type===`user`))return(0,o.jsx)(il,{field:r,value:n.value,multiple:a,onChange:e=>_(n.id,{value:e})});if(r?.options&&a){let e=$c(n.value),t=Mc(r),i=[...new Set(e.map(String).filter(e=>!t.includes(e)))];return(0,o.jsxs)(`div`,{className:`max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2`,children:[i.map(t=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer bg-primary/5 text-primary`,"data-testid":`filter-value-outside-options-${n.field}`,children:[(0,o.jsx)(Dt,{checked:!0,onCheckedChange:()=>_(n.id,{value:e.filter(e=>String(e)!==t)})}),(0,o.jsx)(`span`,{className:`truncate`,children:t})]},`outside-${t}`)),r.options.map(t=>{let r=e.map(String).includes(String(t.value));return(0,o.jsxs)(`label`,{className:q(`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer`,r?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,o.jsx)(Dt,{checked:r,onCheckedChange:r=>{let i=r?[...e,t.value]:e.filter(e=>String(e)!==String(t.value));_(n.id,{value:i})}}),(0,o.jsx)(`span`,{className:`truncate`,children:t.label})]},t.value)})]})}if(a)return(0,o.jsx)(rl,{values:$c(n.value),inputType:C(n.field),numeric:Kc.includes(r?.type||``),testId:`filter-multi-value-${n.field}`,onChange:e=>_(n.id,{value:e})});if(i===`pair`){let e=Lc(n.value),t=C(n.field),i=Kc.includes(r?.type||``),a=Zc(e[0])===Zc(e[1])?null:+!Zc(e[0]),s=`filter-range-incomplete-${n.id}`,c=u(a===0?`filterBuilder.rangeStart`:`filterBuilder.rangeEnd`),l=e=>a===e||void 0,d=(t,r)=>{let a=[e[0],e[1]];a[t]=i?Ac(r,`number`)??``:r,_(n.id,{value:a[0]===``&&a[1]===``?[]:a})};return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-testid":`filter-range-${n.field}`,children:[(0,o.jsx)(Q,{type:t,className:q(`h-9 text-sm`,a===0&&`border-destructive`),placeholder:u(`filterBuilder.rangeStart`),"aria-label":u(`filterBuilder.rangeStart`),"aria-invalid":l(0),"aria-describedby":a===0?s:void 0,value:Qc(e[0]),onChange:e=>d(0,e.target.value)}),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`-`}),(0,o.jsx)(Q,{type:t,className:q(`h-9 text-sm`,a===1&&`border-destructive`),placeholder:u(`filterBuilder.rangeEnd`),"aria-label":u(`filterBuilder.rangeEnd`),"aria-invalid":l(1),"aria-describedby":a===1?s:void 0,value:Qc(e[1]),onChange:e=>d(1,e.target.value)})]}),a!==null&&(0,o.jsx)(`p`,{id:s,className:`text-xs text-destructive`,children:u(`validation.required`,{field:c})})]})}if(r?.options&&(Jc.includes(r.type||``)||Yc.includes(r.type||``))){let e=Qc(n.value),t=e!==``&&!Mc(r).includes(e);return(0,o.jsxs)(Wr,{value:e,onValueChange:e=>_(n.id,{value:e}),children:[(0,o.jsx)(qr,{className:`h-9 text-sm`,children:(0,o.jsx)(Kr,{placeholder:u(`filterBuilder.selectValue`)})}),(0,o.jsxs)(Xr,{children:[t&&(0,o.jsx)(Qr,{value:e,"data-testid":`filter-value-outside-options-${n.field}`,children:e}),r.options.map(e=>(0,o.jsx)(Qr,{value:e.value,children:e.label},e.value))]})]})}if(r?.type===`boolean`)return(0,o.jsxs)(Wr,{value:Qc(n.value),onValueChange:e=>_(n.id,{value:e===`true`}),children:[(0,o.jsx)(qr,{className:`h-9 text-sm`,children:(0,o.jsx)(Kr,{placeholder:u(`filterBuilder.selectValue`)})}),(0,o.jsxs)(Xr,{children:[(0,o.jsx)(Qr,{value:`true`,children:u(`filterBuilder.trueLabel`)}),(0,o.jsx)(Qr,{value:`false`,children:u(`filterBuilder.falseLabel`)})]})]});let c=C(n.field),l=()=>Zc(n.value)?``:c===`date`&&typeof n.value==`string`?n.value.split(`T`)[0]:Qc(n.value),d=e=>{let t=e;Kc.includes(r?.type||``)?t=Ac(e,`number`)??``:qc.includes(r?.type||``)&&(t=e),_(n.id,{value:t})};return(0,o.jsx)(Q,{type:c,className:`h-9 text-sm`,placeholder:u(`filterBuilder.value`),value:l(),onChange:e=>d(e.target.value)})};return(0,o.jsxs)(`div`,{className:q(`space-y-3`,i),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:u(`filterBuilder.where`)}),d.conditions.length>1&&(0,o.jsx)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:y,className:`h-7 text-xs`,children:d.logic===`or`?u(`filterBuilder.or`):u(`filterBuilder.and`)})]}),s&&d.conditions.length>0&&(0,o.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:g,className:`h-7 text-xs text-muted-foreground hover:text-destructive`,children:[(0,o.jsx)(l.Trash2,{className:`h-3 w-3 mr-1`}),u(`filterBuilder.clearAll`)]})]}),(0,o.jsx)(`div`,{className:`space-y-2`,children:d.conditions.map(t=>(0,o.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex-1 grid grid-cols-12 gap-2`,children:[(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Wr,{value:t.field,onValueChange:e=>x(t.id,e),children:[(0,o.jsx)(qr,{className:`h-9 text-sm`,children:(0,o.jsx)(Kr,{placeholder:u(`filterBuilder.selectField`)})}),(0,o.jsx)(Xr,{children:e.map(e=>(0,o.jsx)(Qr,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Wr,{value:wc(t.operator,b(t.field)),onValueChange:e=>{mc(e)&&v(t.id,e)},children:[(0,o.jsx)(qr,{className:`h-9 text-sm`,children:(0,o.jsx)(Kr,{placeholder:u(`filterBuilder.operator`)})}),(0,o.jsx)(Xr,{children:b(t.field).map(e=>(0,o.jsx)(Qr,{value:e.value,children:u(`filterBuilder.operators.${e.value}`)},e.value))})]})}),S(t.operator)&&(0,o.jsx)(`div`,{className:`col-span-4`,children:w(t)})]}),(0,o.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>h(t.id),children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:u(`filterBuilder.removeCondition`)})]})]},t.id))}),(0,o.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:m,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3`}),u(`filterBuilder.addFilter`)]})]})}nl.displayName=`FilterBuilder`;function rl({values:e,inputType:t,numeric:n,testId:r,onChange:i}){let{t:s}=Rc(),[c,u]=a.useState(``),d=t=>{let r=t.trim();if(r===``)return;let a=n?Ac(r,`number`):r;a!==void 0&&a!==``&&(u(``),!e.some(e=>String(e)===String(a))&&i([...e,a]))},f=t=>{i(e.filter((e,n)=>n!==t))};return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background p-1.5`,"data-testid":r,children:[e.map((e,t)=>(0,o.jsxs)(Ye,{variant:`secondary`,className:`gap-1`,children:[(0,o.jsx)(`span`,{className:`truncate max-w-[12ch]`,children:String(e)}),(0,o.jsx)(`button`,{type:`button`,onClick:()=>f(t),className:`ml-0.5 rounded-full text-muted-foreground hover:text-foreground`,"aria-label":s(`filterBuilder.removeValue`,{value:String(e)}),children:(0,o.jsx)(l.X,{className:`h-3 w-3`})})]},`${String(e)}-${t}`)),(0,o.jsx)(Q,{type:t,value:c,onChange:e=>u(e.target.value),onKeyDown:t=>{t.key===`Enter`||t.key===`,`?(t.preventDefault(),d(c)):t.key===`Backspace`&&c===``&&e.length>0&&f(e.length-1)},onBlur:()=>d(c),placeholder:e.length===0?s(`filterBuilder.addValue`):``,"aria-label":s(`filterBuilder.addValue`),className:`h-7 flex-1 border-0 bg-transparent p-0 px-1 shadow-none focus-visible:ring-0 min-w-[6ch] text-sm`})]})}rl.displayName=`MultiValueInput`;function il({field:e,value:t,multiple:n,onChange:r}){let{t:s}=Rc(),c=a.useContext(i.SchemaRendererContext)?.dataSource??null,u=e.referenceTo||(e.type===`user`?`users`:void 0),d=e.displayField||`name`,f=e.idField||`id`,[p,m]=a.useState(!1),[h,g]=a.useState(``),[_,v]=a.useState([]),[y,b]=a.useState(!1),[x,S]=a.useState(null),[C,w]=a.useState({}),T=a.useRef(null),E=a.useMemo(()=>n?$c(t).map(e=>String(e)):Zc(t)?[]:[String(t)],[t,n]),D=c!=null&&typeof c.find==`function`&&!!u,O=a.useCallback(e=>{let t=e?.[f]??e?.id??e?._id,n=e?.[d]??e?.label??e?.name??String(t);return{value:t,label:String(n)}},[d,f]),k=a.useCallback(async e=>{if(D){b(!0),S(null);try{let t={$top:50};e&&e.trim()&&(t.$search=e.trim());let n=await c.find(u,t),r=(n?.data??n??[]).map(O);v(r),r.length>0&&w(e=>{let t={...e};for(let e of r)t[String(e.value)]=e.label;return t})}catch(e){S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}}},[c,u,D,O]);a.useEffect(()=>{if(!D||E.length===0)return;let e=E.filter(e=>!(e in C));if(e.length===0)return;let t=!1;return(async()=>{try{let n=await c.find(u,{$top:e.length,$filter:{[f]:{$in:e}}}),r=n?.data??n??[];if(t)return;w(e=>{let t={...e};for(let e of r){let n=O(e);t[String(n.value)]=n.label}return t})}catch{}})(),()=>{t=!0}},[E,D,c,u,f,O,C]),a.useEffect(()=>{p&&D&&_.length===0&&k()},[p]);let A=e=>{g(e),D&&(T.current&&clearTimeout(T.current),T.current=setTimeout(()=>k(e||void 0),300))},j=e=>{if(n){let n=$c(t);r(n.map(String).includes(String(e))?n.filter(t=>String(t)!==String(e)):[...n,e])}else r(e),m(!1)};return D?(0,o.jsxs)(Ir,{open:p,onOpenChange:m,children:[(0,o.jsx)(Lr,{asChild:!0,children:(0,o.jsxs)(`button`,{type:`button`,className:q(`inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm`,`hover:bg-accent hover:text-accent-foreground`,`focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1`),"data-testid":`lookup-picker-${e.value}`,children:[E.length===0?(0,o.jsx)(`span`,{className:`text-muted-foreground truncate`,children:s(`filterBuilder.searchField`,{label:e.label})}):n?(0,o.jsx)(`span`,{className:`truncate`,children:E.length===1?C[E[0]]||E[0]:`${E.length} selected`}):(0,o.jsx)(`span`,{className:`truncate`,children:C[E[0]]||E[0]}),(0,o.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[E.length>0&&(0,o.jsx)(l.X,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(n?[]:``)}}),(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5 opacity-60`})]})]})}),(0,o.jsxs)(Rr,{align:`start`,className:`w-72 p-0`,children:[(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,children:[(0,o.jsx)(l.Search,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,o.jsx)(`input`,{autoFocus:!0,value:h,onChange:e=>A(e.target.value),placeholder:s(`filterBuilder.searchField`,{label:e.label}),className:`flex h-9 w-full bg-transparent px-2 py-1 text-sm outline-none placeholder:text-muted-foreground`,"data-testid":`lookup-search-${e.value}`}),y&&(0,o.jsx)(l.Loader2,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`})]}),(0,o.jsxs)(`div`,{className:`max-h-64 overflow-y-auto p-1`,"data-testid":`lookup-options-${e.value}`,children:[x&&(0,o.jsx)(`div`,{className:`px-3 py-2 text-xs text-destructive`,children:x}),!x&&!y&&_.length===0&&(0,o.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:s(`filterBuilder.noResults`)}),_.map(e=>{let t=E.includes(String(e.value));return(0,o.jsxs)(`label`,{className:q(`flex items-center gap-2 px-2 py-1.5 rounded text-sm cursor-pointer`,t?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[n?(0,o.jsx)(Dt,{checked:t,onCheckedChange:()=>j(e.value)}):(0,o.jsx)(`input`,{type:`radio`,checked:t,onChange:()=>j(e.value),className:`rounded-full border-input`}),(0,o.jsx)(`span`,{className:`truncate flex-1`,children:e.label})]},String(e.value))})]})]})]}):n?(0,o.jsx)(rl,{values:$c(t),inputType:`text`,numeric:!1,testId:`lookup-ids-${e.value}`,onChange:r}):(0,o.jsx)(Q,{className:`h-9 text-sm`,placeholder:s(`filterBuilder.enterId`,{label:e.label}),value:E[0]??``,onChange:e=>r(e.target.value)})}var al=(0,_.createSafeTranslation)({"sortBuilder.sortBy":`Sort by`,"sortBuilder.thenBy":`Then by`,"sortBuilder.selectField":`Select field`,"sortBuilder.ascending":`A → Z`,"sortBuilder.descending":`Z → A`,"sortBuilder.addSort":`Add sort`,"sortBuilder.removeSort":`Remove sort`},`sortBuilder.sortBy`);function ol({fields:e=[],value:t=[],onChange:n,className:r}){let{t:i}=al(),s=a.useCallback(e=>(e||[]).map((e,t)=>({id:e?.id??(typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`sort-${t}-${e?.field??``}`),field:e?.field??``,order:e?.order??e?.sortOrder??`asc`})),[]),[c,u]=a.useState(()=>s(t));a.useEffect(()=>{let e=s(t),n=e=>e.map(({id:e,...t})=>t);JSON.stringify(n(e))!==JSON.stringify(n(c))&&u(e)},[t,c,s]);let d=e=>{u(e),n?.(e)},f=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,order:`asc`};d([...c,t])},p=(e,t)=>{d(c.map(n=>n.id===e?{...n,...t}:n))},m=e=>{d(c.filter(t=>t.id!==e))};return(0,o.jsxs)(`div`,{className:q(`space-y-3`,r),children:[(0,o.jsx)(`div`,{className:`space-y-2`,children:c.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium w-16 text-muted-foreground`,children:i(n===0?`sortBuilder.sortBy`:`sortBuilder.thenBy`)}),(0,o.jsx)(`div`,{className:`flex-1`,children:(0,o.jsxs)(Wr,{value:t.field,onValueChange:e=>p(t.id,{field:e}),children:[(0,o.jsx)(qr,{className:`h-9`,children:(0,o.jsx)(Kr,{placeholder:i(`sortBuilder.selectField`)})}),(0,o.jsx)(Xr,{children:e.map(e=>(0,o.jsx)(Qr,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`w-28`,children:(0,o.jsxs)(Wr,{value:t.order,onValueChange:e=>p(t.id,{order:e}),children:[(0,o.jsx)(qr,{className:`h-9`,children:(0,o.jsx)(Kr,{})}),(0,o.jsxs)(Xr,{children:[(0,o.jsx)(Qr,{value:`asc`,children:i(`sortBuilder.ascending`)}),(0,o.jsx)(Qr,{value:`desc`,children:i(`sortBuilder.descending`)})]})]})}),(0,o.jsx)(X,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>m(t.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`})})]},t.id))}),(0,o.jsxs)(X,{variant:`outline`,size:`sm`,onClick:f,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3 mr-2`}),i(`sortBuilder.addSort`)]})]})}var sl=(0,_.createSafeTranslation)({"common.select":`Select…`},`common.select`);function cl({field:e,value:t,onChange:n,draft:r,objectDef:i}){let{t:a}=sl();if(e.visibleWhen&&!e.visibleWhen(r))return null;let s=e.disabled||(e.disabledWhen?e.disabledWhen(r):!1),c=t??e.defaultValue,u=null;switch(e.type){case`input`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsx)(Q,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,value:c??``,placeholder:e.placeholder,disabled:s,onChange:e=>n(e.target.value)})});break;case`textarea`:u=(0,o.jsx)(lc,{label:e.label,className:`flex-col items-stretch gap-1`,children:(0,o.jsx)(ma,{"data-testid":`config-field-${e.key}`,className:`min-h-[60px] w-full text-xs`,value:c??``,placeholder:e.placeholder,disabled:s,rows:3,onChange:e=>n(e.target.value)})});break;case`switch`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsx)(ta,{"data-testid":`config-field-${e.key}`,checked:!!c,disabled:s,onCheckedChange:e=>n(e),className:`scale-75`})});break;case`checkbox`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsx)(Dt,{"data-testid":`config-field-${e.key}`,checked:!!c,disabled:s,onCheckedChange:e=>n(e)})});break;case`select`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsxs)(Wr,{value:String(c??``),onValueChange:e=>n(e),disabled:s,children:[(0,o.jsx)(qr,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,children:(0,o.jsx)(Kr,{placeholder:e.placeholder??a(`common.select`)})}),(0,o.jsx)(Xr,{children:(e.options??[]).map(e=>(0,o.jsx)(Qr,{value:e.value,children:e.label},e.value))})]})});break;case`slider`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-2 w-32`,children:[(0,o.jsx)($i,{"data-testid":`config-field-${e.key}`,value:[Number(c??e.min??0)],min:e.min??0,max:e.max??100,step:e.step??1,disabled:s,onValueChange:e=>n(e[0]),"aria-label":e.label}),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground w-6 text-right`,children:c??e.min??0})]})});break;case`color`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsx)(`input`,{"data-testid":`config-field-${e.key}`,type:`color`,className:`h-7 w-10 rounded border cursor-pointer`,value:c??`#000000`,disabled:s,onChange:e=>n(e.target.value)})});break;case`icon-group`:u=(0,o.jsx)(lc,{label:e.label,children:(0,o.jsx)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`config-field-${e.key}`,children:(e.options??[]).map(e=>(0,o.jsx)(X,{type:`button`,size:`sm`,variant:c===e.value?`default`:`ghost`,className:q(`h-7 w-7 p-0`,c===e.value&&`ring-1 ring-primary`),disabled:s,onClick:()=>n(e.value),title:e.label,children:e.icon??(0,o.jsx)(`span`,{className:`text-[10px]`,children:e.label.charAt(0)})},e.value))})});break;case`field-picker`:u=(0,o.jsx)(lc,{label:e.label,value:c??e.placeholder??`Select field…`,onClick:s?void 0:()=>{}});break;case`filter`:u=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(lc,{label:e.label}),(0,o.jsx)(nl,{fields:e.fields,value:c,onChange:n,className:`px-1 pb-2`})]});break;case`sort`:u=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(lc,{label:e.label}),(0,o.jsx)(ol,{fields:e.fields,value:c,onChange:n,className:`px-1 pb-2`})]});break;case`custom`:e.render&&(u=(0,o.jsx)(o.Fragment,{children:e.render(c,n,r)}));break;case`summary`:u=(0,o.jsx)(lc,{label:e.label,onClick:e.onSummaryClick,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate max-w-[120px]`,"data-testid":`config-field-${e.key}-text`,children:e.summaryText??c??``}),e.onSummaryClick&&(0,o.jsx)(l.Settings,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`,"aria-hidden":`true`,"data-testid":`config-field-${e.key}-gear`})]})})}return u?e.helpText?(0,o.jsxs)(`div`,{children:[u,(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5 mb-1`,children:e.helpText})]}):(0,o.jsx)(o.Fragment,{children:u}):null}function ll({title:e,icon:t,collapsible:n,collapsed:r,onToggle:i,testId:a,className:s}){let c=(0,o.jsxs)(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider flex items-center gap-1.5`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,"aria-hidden":`true`,children:t}),e]});return n?(0,o.jsxs)(`button`,{"data-testid":a,className:q(`flex items-center justify-between pt-4 pb-1.5 first:pt-0 w-full text-left`,s),onClick:i,type:`button`,"aria-expanded":!r,children:[c,r?(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3 text-muted-foreground`}):(0,o.jsx)(l.ChevronDown,{className:`h-3 w-3 text-muted-foreground`})]}):(0,o.jsx)(`div`,{className:q(`pt-4 pb-1.5 first:pt-0`,s),"data-testid":a,children:c})}var ul=(0,_.createSafeTranslation)({"common.save":`Save`,"common.discard":`Discard`},`common.save`);function dl({open:e,onClose:t,schema:n,draft:r,isDirty:i,onFieldChange:s,onSave:c,onDiscard:u,headerExtra:d,objectDef:f,className:p,style:m,saveLabel:h,discardLabel:g,panelRef:_,role:v,ariaLabel:y,tabIndex:b,testId:x,closeTitle:S,footerTestId:C,saveTestId:w,discardTestId:T,expandedSections:E,onUndo:D,onRedo:O,canUndo:k,canRedo:A,undoLabel:j=`Undo`,redoLabel:M=`Redo`}){let[N,ee]=(0,a.useState)({}),{t:P}=ul();if(!e)return null;let F=(e,t)=>{ee(n=>({...n,[e]:!(n[e]??t??!1)}))},I=(e,t)=>E&&E.includes(e)?!1:N[e]??t??!1;return(0,o.jsxs)(`div`,{ref:_,"data-testid":x??`config-panel`,role:v,"aria-label":y,tabIndex:b,style:m,className:q(`absolute inset-y-0 right-0 w-full sm:w-[var(--config-panel-width,280px)] sm:relative border-l bg-background flex flex-col shrink-0 z-20`,p),children:[(0,o.jsxs)(`div`,{className:`px-4 py-3 border-b flex items-center justify-between shrink-0`,children:[(0,o.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,o.jsx)(`ol`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:n.breadcrumb.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[t>0&&(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3`}),(0,o.jsx)(`li`,{className:q(t===n.breadcrumb.length-1&&`text-foreground font-medium`),children:e})]},t))})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D&&(0,o.jsx)(X,{size:`sm`,variant:`ghost`,onClick:D,disabled:!k,className:`h-7 w-7 p-0`,"data-testid":`config-panel-undo`,title:j,children:(0,o.jsx)(l.Undo2,{className:`h-3.5 w-3.5`})}),O&&(0,o.jsx)(X,{size:`sm`,variant:`ghost`,onClick:O,disabled:!A,className:`h-7 w-7 p-0`,"data-testid":`config-panel-redo`,title:M,children:(0,o.jsx)(l.Redo2,{className:`h-3.5 w-3.5`})}),d,(0,o.jsx)(X,{size:`sm`,variant:`ghost`,onClick:t,className:`h-7 w-7 p-0`,"data-testid":`config-panel-close`,title:S,children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 overflow-auto px-4 pb-4`,children:n.sections.map((e,t)=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let n=I(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-section-${e.key}`,children:[t>0&&(0,o.jsx)(ei,{className:`my-3`}),(0,o.jsx)(ll,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:n,onToggle:()=>F(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`}),e.hint&&(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mb-1`,children:e.hint}),!n&&(0,o.jsxs)(`div`,{className:`space-y-1`,children:[e.fields.map(e=>(0,o.jsx)(cl,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key)),e.subsections?.map(e=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let t=I(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-subsection-${e.key}`,className:`ml-1`,role:`group`,"aria-label":e.title,children:[(0,o.jsx)(ll,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:t,onToggle:()=>F(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`,className:`pt-2 pb-1`}),!t&&(0,o.jsx)(`div`,{className:`space-y-1`,children:e.fields.map(e=>(0,o.jsx)(cl,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key))})]},e.key)})]})]},e.key)})}),i&&(0,o.jsxs)(`div`,{className:`px-4 py-2 border-t flex gap-2 shrink-0`,"data-testid":C??`config-panel-footer`,children:[(0,o.jsxs)(X,{size:`sm`,onClick:c,"data-testid":w??`config-panel-save`,children:[(0,o.jsx)(l.Save,{className:`h-3.5 w-3.5 mr-1`}),h??P(`common.save`)]}),(0,o.jsxs)(X,{size:`sm`,variant:`ghost`,onClick:u,"data-testid":T??`config-panel-discard`,children:[(0,o.jsx)(l.RotateCcw,{className:`h-3.5 w-3.5 mr-1`}),g??P(`common.discard`)]})]})]})}function fl({date:e,onDateChange:t,placeholder:n=`Pick a date`,className:r,disabled:i}){let a=dt();return(0,o.jsxs)(Ir,{children:[(0,o.jsx)(Lr,{asChild:!0,children:(0,o.jsxs)(X,{variant:`outline`,className:q(`w-[280px] justify-start text-left font-normal`,!e&&`text-muted-foreground`,r),disabled:i,children:[(0,o.jsx)(l.CalendarIcon,{className:`mr-2 h-4 w-4`}),e?(0,U.format)(e,`PPP`,{locale:a}):(0,o.jsx)(`span`,{children:n})]})}),(0,o.jsx)(Rr,{className:`w-auto p-0`,children:(0,o.jsx)(ft,{mode:`single`,defaultMonth:e,selected:e,onSelect:t,autoFocus:!0})})]})}function pl(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`detail.noValue`);return!t||t===`detail.noValue`?`No value`:t}function ml({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty`,className:q(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg p-(--empty-padding) [--empty-padding:--spacing(6)] md:[--empty-padding:--spacing(12)] text-center text-balance`,e),...t})}function hl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var gl=(0,f.cva)(`flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function _l({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(gl({variant:t,className:e})),...n})}function vl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-lg font-medium tracking-tight`,e),...t})}function yl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function bl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-content`,className:q(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function xl({className:e,glyph:t=`—`,...n}){let r=pl();return(0,o.jsx)(`span`,{"data-slot":`empty-value`,"aria-label":r,className:q(`select-none text-muted-foreground/50 no-underline pointer-events-none`,e),...n,children:t})}var Sl=(0,f.cva)(`space-y-2`),Cl=a.forwardRef(({className:e,label:t,description:n,error:r,required:i,htmlFor:s,children:c,...l},u)=>{let f=a.useId(),p=s||f,m=`${p}-description`,h=`${p}-error`;return(0,o.jsxs)(`div`,{ref:u,className:q(Sl(),e),...l,children:[t&&(0,o.jsxs)(Bn,{htmlFor:p,className:q(r&&`text-destructive`),children:[t,i&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(d.Slot,{id:p,"aria-describedby":[n&&m,r&&h].filter(Boolean).join(` `)||void 0,"aria-invalid":!!r,"aria-required":i||void 0,children:c}),n&&!r&&(0,o.jsx)(`p`,{id:m,className:`text-[0.8rem] text-muted-foreground`,children:n}),r&&(0,o.jsx)(`p`,{id:h,className:`text-[0.8rem] font-medium text-destructive`,children:r})]})});Cl.displayName=`FieldContainer`;var wl=a.forwardRef(({className:e,startContent:t,endContent:n,children:r,...i},a)=>(0,o.jsxs)(`div`,{ref:a,className:q(`flex w-full items-center rounded-md border border-input bg-transparent ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,`has-[[data-invalid]]:border-destructive`,e),...i,children:[t&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-r h-full self-stretch rounded-l-md`,children:t}),(0,o.jsx)(`div`,{className:`flex-1 relative [&_input]:border-0 [&_input]:shadow-none [&_input]:focus-visible:ring-0 [&_input]:bg-transparent`,children:r}),n&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-l h-full self-stretch rounded-r-md`,children:n})]}));wl.displayName=`InputGroup`;function Tl({className:e,...t}){return(0,o.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:q(`group/item-group flex flex-col`,e),...t})}function El({className:e,...t}){return(0,o.jsx)(ei,{"data-slot":`item-separator`,orientation:`horizontal`,className:q(`my-0`,e),...t})}var Dl=(0,f.cva)(`group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,{variants:{variant:{default:`bg-transparent`,outline:`border-border`,muted:`bg-muted/50`},size:{default:`p-4 gap-4 `,sm:`py-3 px-4 gap-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function Ol({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,o.jsx)(r?d.Slot:`div`,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(Dl({variant:t,size:n,className:e})),...i})}var kl=(0,f.cva)(`flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5`,{variants:{variant:{default:`bg-transparent`,icon:`size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4`,image:`size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function Al({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:q(kl({variant:t,className:e})),...n})}function jl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-content`,className:q(`flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none`,e),...t})}function Ml({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-title`,className:q(`flex w-fit items-center gap-2 text-sm leading-snug font-medium`,e),...t})}function Nl({className:e,...t}){return(0,o.jsx)(`p`,{"data-slot":`item-description`,className:q(`text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function Pl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-actions`,className:q(`flex items-center gap-2`,e),...t})}function Fl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-header`,className:q(`flex basis-full items-center justify-between gap-2`,e),...t})}function Il({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-footer`,className:q(`flex basis-full items-center justify-between gap-2`,e),...t})}function Ll({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd`,className:q(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,e),...t})}function Rl({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-1`,e),...t})}var zl=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(`select`,{className:q(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n,children:t}));zl.displayName=`NativeSelect`;var Bl=`[data-radix-popper-content-wrapper],[data-radix-select-content],[data-radix-select-viewport]`;function Vl(e){return!!e?.closest?.(Bl)}function Hl(e){let t=a.useRef(!1);return a.useEffect(()=>{let e=e=>{let n=e.target;t.current=!!document.querySelector(Bl)||!!n?.closest?.(`[role="dialog"]`)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]),a.useCallback(n=>{let r=n.detail?.originalEvent,i=r?.target??null;if(Vl(i)||i?.closest?.(`[role="dialog"]`)){n.preventDefault();return}if(r?.type===`pointerdown`&&t.current){n.preventDefault();return}e?.(n)},[e])}var Ul=a.forwardRef(({className:e,children:t,onInteractOutside:n,showCloseButton:r=!0,...i},a)=>{let s=Hl(n);return(0,o.jsxs)(Ft,{children:[(0,o.jsx)(Lt,{}),(0,o.jsxs)(S.Content,{ref:a,onInteractOutside:s,className:q(`fixed inset-0 z-50 w-full bg-background p-4 shadow-lg duration-200`,`h-[100dvh]`,`sm:inset-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%]`,`sm:max-w-lg sm:h-auto sm:max-h-[90vh] sm:rounded-lg sm:border sm:p-6`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]`,`data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...i,children:[t,r&&(0,o.jsxs)(S.Close,{className:q(`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity`,`hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,`disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 flex items-center justify-center`),children:[(0,o.jsx)(l.X,{className:`h-5 w-5 sm:h-4 sm:w-4`}),(0,o.jsx)(Mt,{})]})]})]})});Ul.displayName=`MobileDialogContent`;var Wl=(0,_.createSafeTranslation)({"common.close":`Close`,"common.closePanel":`Close panel`,"common.resizeDrawer":`Resize drawer`,"detail.openAsFullPage":`Open as full page`,"detail.recordDetail":`Record Detail`,"detail.recordDetailOverlay":`Record detail overlay for {{title}}.`},`common.close`);function Gl(e){return`drawer-width:${e}`}function Kl(e){return`objectui.drawerWidth.${e}`}function ql(){let e=a.default.useRef(null),t=a.default.useCallback(t=>{let n=t?.target;n&&typeof n.getBoundingClientRect==`function`&&(e.current=n)},[]);return{anchorRef:e,captureAnchor:t,anchorCaptureProps:a.default.useMemo(()=>({onClickCapture:t}),[t])}}function Jl(e){if(e!=null)return typeof e==`number`?`${e}px`:e}function Yl(e){let t=Jl(e);return t?{"--ov-w":t}:{}}var Xl=360,Zl=.95;function Ql(e,t){let[n,r]=a.default.useState(null),i=a.default.useRef(!1);return a.default.useEffect(()=>{if(!(!e||typeof window>`u`))try{let n=window.localStorage.getItem(`ov:${e}`);if(n){let e=Number(n);Number.isFinite(e)&&e>=Xl&&r(e);return}if(!t)return;let i=window.localStorage.getItem(t);if(!i)return;let a=parseInt(i,10);if(!Number.isFinite(a)||a<Xl)return;r(a),window.localStorage.setItem(`ov:${e}`,String(a)),window.localStorage.removeItem(t)}catch{}},[e,t]),{width:n,handleMouseDown:a.default.useCallback(t=>{if(!e||typeof window>`u`)return;t.preventDefault(),i.current=!0;let n=Math.floor(window.innerWidth*Zl);document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let a=e=>{if(!i.current)return;let t=Math.min(n,Math.max(Xl,window.innerWidth-e.clientX));r(t)},o=()=>{i.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o),r(t=>{if(t!=null)try{window.localStorage.setItem(`ov:${e}`,String(t))}catch{}return t})};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},[e]),handleDoubleClick:a.default.useCallback(()=>{if(!(!e||typeof window>`u`)){r(null);try{window.localStorage.removeItem(`ov:${e}`)}catch{}}},[e]),enabled:!!e}}var $l=({isOpen:e,selectedRecord:t,mode:n,close:r,setIsOpen:i,width:a,view:s,title:c,description:u,className:d,children:f,renderView:p,mainContent:m,popoverTrigger:h,popoverAnchorRef:g,onExpand:_,expandLabel:v,storageKey:y,legacyStorageKey:b})=>{let x=Yl(a),{t:S}=Wl(),C=c||S(`detail.recordDetail`),w=v??S(`detail.openAsFullPage`),T=S(`detail.recordDetailOverlay`,{title:C}),E=Ql(n===`drawer`?y:void 0,n===`drawer`?b:void 0),D=Hl();if(n===`page`||n===`new_window`||n===`none`||!t)return null;let O=Jl(a)??`42rem`,k=E.width==null?{"--ov-w":`max(${O}, min(60vw, 880px))`}:{"--ov-w":`${E.width}px`},A=e=>p&&s?p(e,s):f(e);if(n===`drawer`)return(0,o.jsx)(ti,{open:e,onOpenChange:i,children:(0,o.jsxs)(si,{side:`right`,onInteractOutside:D,onOpenAutoFocus:e=>e.preventDefault(),className:q(`w-screen max-w-none sm:w-full sm:max-w-[var(--ov-w,42rem)] p-0 flex flex-col gap-0 overflow-hidden`,`[&>button:last-of-type]:hidden`,d),style:k,children:[E.enabled&&(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":S(`common.resizeDrawer`),onMouseDown:E.handleMouseDown,onDoubleClick:E.handleDoubleClick,className:`hidden sm:block absolute left-0 top-0 bottom-0 z-30 w-1 cursor-col-resize touch-none bg-transparent hover:bg-primary/40 active:bg-primary/60 transition-colors`}),(0,o.jsxs)(ci,{className:`shrink-0 flex-row items-center justify-between gap-2 space-y-0 px-4 py-2 border-b bg-muted/30`,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(ui,{className:`truncate text-xs font-medium tracking-wide text-muted-foreground`,children:C}),u?(0,o.jsx)(di,{className:`truncate text-xs`,children:u}):(0,o.jsx)(di,{className:`sr-only`,children:T})]}),(0,o.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[_&&(0,o.jsx)(`button`,{type:`button`,onClick:_,"aria-label":w,title:w,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(l.Maximize2,{className:`h-3.5 w-3.5`})}),(0,o.jsx)(ri,{asChild:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":S(`common.close`),title:S(`common.close`),className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`})})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:A(t)})]})});if(n===`modal`)return(0,o.jsx)(Nt,{open:e,onOpenChange:i,children:(0,o.jsxs)(Rt,{onInteractOutside:D,className:q(`w-[calc(100vw-1rem)] max-w-none sm:max-w-[var(--ov-w,42rem)] max-h-[90vh] overflow-y-auto`,d),style:x,children:[_&&(0,o.jsx)(`button`,{type:`button`,onClick:_,"aria-label":w,title:w,className:`absolute right-12 top-4 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors`,children:(0,o.jsx)(l.Maximize2,{className:`h-4 w-4`})}),(0,o.jsxs)(zt,{children:[(0,o.jsx)(Vt,{children:C}),u?(0,o.jsx)(Ht,{children:u}):(0,o.jsx)(Ht,{className:`sr-only`,children:T})]}),(0,o.jsx)(`div`,{className:`mt-4`,children:A(t)})]})});if(n===`split`){if(!e||!m)return null;let n=a&&typeof a==`number`?Math.min(70,Math.max(20,a/1200*100)):40,i=100-n;return(0,o.jsxs)(qo,{orientation:`horizontal`,className:q(`h-full`,d),children:[(0,o.jsx)(Jo,{defaultSize:i,minSize:30,children:m}),(0,o.jsx)(Yo,{withHandle:!0}),(0,o.jsx)(Jo,{defaultSize:n,minSize:20,children:(0,o.jsxs)(`div`,{className:`h-full overflow-y-auto p-4`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,o.jsx)(`h3`,{className:`text-lg font-semibold`,children:C}),(0,o.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":S(`common.closePanel`),children:(0,o.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,o.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,o.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),u&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:u}),A(t)]})})]})}return n===`popover`?!h&&!g?e?(0,o.jsx)(Nt,{open:e,onOpenChange:i,children:(0,o.jsxs)(Rt,{className:q(`w-96 max-h-[80vh] overflow-y-auto p-4`,d),style:x,children:[(0,o.jsxs)(zt,{children:[(0,o.jsx)(Vt,{className:`text-sm`,children:C}),u?(0,o.jsx)(Ht,{className:`text-xs`,children:u}):(0,o.jsx)(Ht,{className:`sr-only`,children:T})]}),(0,o.jsx)(`div`,{className:`mt-2`,children:A(t)})]})}):null:(0,o.jsxs)(Ir,{open:e,onOpenChange:i,children:[h?(0,o.jsx)(Lr,{asChild:!0,children:h}):(0,o.jsx)(M.Anchor,{virtualRef:g}),(0,o.jsx)(Rr,{className:q(`w-96 max-h-[400px] overflow-y-auto p-4`,d),style:x,children:(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(`h4`,{className:`text-sm font-semibold`,children:C}),u&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u}),A(t)]})})]}):null};$l.displayName=`NavigationOverlay`;function eu({className:e,...t}){return(0,o.jsx)(`div`,{role:`status`,"aria-label":`Loading`,className:q(`flex items-center justify-center`,e),...t,children:(0,o.jsx)(l.Loader2,{className:`animate-spin text-muted-foreground w-full h-full min-w-4 min-h-4`})})}var tu={addGroup:`Add group field`,collapseTitle:`Collapsed by default`,removeTitle:`Remove`,ascendingTitle:`Ascending`,descendingTitle:`Descending`};function nu({value:e,onChange:t,fieldOptions:n,maxLevels:r=3,className:i,labels:a}){let s={...tu,...a||{}},c=e?.fields??[],u=new Set(c.map(e=>e.field)),d=e=>{t(e.length?{fields:e}:void 0)};return(0,o.jsxs)(`div`,{"data-testid":`grouping-editor`,className:q(`flex flex-col gap-1.5 w-full`,i),children:[c.map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`select`,{"data-testid":`grouping-field-${t}`,className:`text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground flex-1 min-w-0`,value:e.field,onChange:n=>{let r=[...c];r[t]={...e,field:n.target.value},d(r)},children:n.filter(t=>t.value===e.field||!u.has(t.value)).map(e=>(0,o.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,o.jsx)(`button`,{type:`button`,title:e.order===`asc`?s.ascendingTitle:s.descendingTitle,"data-testid":`grouping-order-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-muted`,onClick:()=>{let n=[...c];n[t]={...e,order:e.order===`asc`?`desc`:`asc`},d(n)},children:e.order===`asc`?(0,o.jsx)(l.ArrowUp,{className:`h-3 w-3`}):(0,o.jsx)(l.ArrowDown,{className:`h-3 w-3`})}),(0,o.jsx)(`label`,{title:s.collapseTitle,className:`flex items-center text-xs text-muted-foreground`,children:(0,o.jsx)(`input`,{type:`checkbox`,"data-testid":`grouping-collapsed-${t}`,className:`h-3 w-3`,checked:e.collapsed,onChange:n=>{let r=[...c];r[t]={...e,collapsed:n.target.checked},d(r)}})}),(0,o.jsx)(`button`,{type:`button`,title:s.removeTitle,"data-testid":`grouping-remove-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-muted hover:text-destructive`,onClick:()=>{let e=c.filter((e,n)=>n!==t);d(e)},children:(0,o.jsx)(l.X,{className:`h-3 w-3`})})]},t)),c.length<r&&(()=>{let e=n.filter(e=>!u.has(e.value));return e.length===0?null:(0,o.jsxs)(`button`,{type:`button`,"data-testid":`grouping-add`,className:`flex h-7 items-center gap-1 self-start rounded-md border border-dashed border-input bg-background px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:()=>{let t=[...c,{field:e[0].value,order:`asc`,collapsed:!1}];d(t)},children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3`}),s.addGroup]})})()]})}function ru({rows:e=5,columns:t=4,className:n,...r}){return(0,o.jsxs)(`div`,{"data-slot":`grid-skeleton`,className:q(`w-full space-y-2`,n),...r,children:[(0,o.jsx)(`div`,{className:`flex gap-4 px-4 py-2`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)($,{className:`h-4 flex-1 rounded`},t))}),Array.from({length:e}).map((e,n)=>(0,o.jsx)(`div`,{className:`flex gap-4 rounded-md border px-4 py-3`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)($,{className:q(`h-4 flex-1 rounded`,t===0&&`max-w-[40%]`)},t))},n))]})}function iu({columns:e=3,cardsPerColumn:t=3,className:n,...r}){return(0,o.jsx)(`div`,{"data-slot":`kanban-skeleton`,className:q(`flex gap-4 overflow-x-auto`,n),...r,children:Array.from({length:e}).map((e,n)=>(0,o.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsx)($,{className:`h-5 w-24 rounded`}),Array.from({length:t}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background p-3`,children:[(0,o.jsx)($,{className:`h-4 w-3/4 rounded`}),(0,o.jsx)($,{className:`h-3 w-1/2 rounded`})]},t))]},n))})}function au({rows:e=4,className:t,...n}){return(0,o.jsxs)(`div`,{"data-slot":`form-skeleton`,className:q(`w-full max-w-lg space-y-6`,t),...n,children:[Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)($,{className:`h-4 w-28 rounded`}),(0,o.jsx)($,{className:`h-9 w-full rounded-md`})]},t)),(0,o.jsx)($,{className:`h-9 w-24 rounded-md`})]})}function ou({rows:e=5,className:t,...n}){return(0,o.jsx)(`div`,{"data-slot":`list-skeleton`,className:q(`w-full space-y-3`,t),...n,children:Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border px-4 py-3`,children:[(0,o.jsx)($,{className:`size-8 shrink-0 rounded-full`}),(0,o.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,o.jsx)($,{className:`h-4 w-3/5 rounded`}),(0,o.jsx)($,{className:`h-3 w-2/5 rounded`})]})]},t))})}function su({className:e,...t}){return(0,o.jsxs)(`div`,{"data-slot":`chart-skeleton`,className:q(`w-full space-y-4`,e),...t,children:[(0,o.jsx)($,{className:`h-5 w-40 rounded`}),(0,o.jsx)(`div`,{className:`flex h-48 items-end gap-2 rounded-md border p-4`,children:[`h-2/5`,`h-3/5`,`h-1/3`,`h-4/5`,`h-1/2`,`h-3/4`,`h-2/5`].map((e,t)=>(0,o.jsx)($,{className:q(`flex-1 rounded-t`,e)},t))}),(0,o.jsxs)(`div`,{className:`flex gap-4`,children:[(0,o.jsx)($,{className:`h-3 w-16 rounded`}),(0,o.jsx)($,{className:`h-3 w-16 rounded`}),(0,o.jsx)($,{className:`h-3 w-16 rounded`})]})]})}function cu({variant:e,...t}){switch(e){case`grid`:return(0,o.jsx)(ru,{...t});case`kanban`:return(0,o.jsx)(iu,{...t});case`form`:return(0,o.jsx)(au,{...t});case`list`:return(0,o.jsx)(ou,{...t});case`chart`:return(0,o.jsx)(su,{...t})}}function lu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`shimmer-skeleton`,className:q(`rounded-md bg-muted`,`motion-safe:bg-[linear-gradient(90deg,hsl(var(--muted))_0%,hsl(var(--muted-foreground)/0.12)_50%,hsl(var(--muted))_100%)]`,`motion-safe:bg-[length:200%_100%] motion-safe:animate-shimmer`,e),...t})}var uu=({title:e,icon:t,objectLabel:n,resourceId:r,showStar:i=!0,showCopyId:s=!0,isFavorite:c,onToggleFavorite:u,className:d,inlineExtras:f})=>{let{t:p}=(0,_.useObjectTranslation)(),[m,h]=a.default.useState(!1),[g,v]=a.default.useState(!1),y=c??m,b=a.default.useCallback(()=>{let e=!y;u&&u(e),c===void 0&&h(e)},[y,c,u]),x=a.default.useCallback(()=>{if(r)try{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(r),v(!0),setTimeout(()=>v(!1),1500)}catch{}},[r]),S=p(y?`detail.removeFromFavorites`:`detail.addToFavorites`),C=p(g?`detail.copied`:`detail.copyRecordId`);return(0,o.jsx)(hi,{children:(0,o.jsx)(`div`,{className:q(`flex flex-col min-w-0`,d),children:(0,o.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0 self-center`,"aria-hidden":!0,children:t}),(0,o.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold truncate`,children:e}),n&&(0,o.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground/70 shrink-0`,children:n}),s&&r&&(0,o.jsxs)(gi,{children:[(0,o.jsx)(_i,{asChild:!0,children:(0,o.jsx)(X,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground/50 hover:text-foreground`,onClick:x,"aria-label":C,children:g?(0,o.jsx)(l.Check,{className:`h-3 w-3 text-green-600`}):(0,o.jsx)(l.Copy,{className:`h-3 w-3`})})}),(0,o.jsx)(vi,{children:C})]}),i&&(0,o.jsxs)(gi,{children:[(0,o.jsx)(_i,{asChild:!0,children:(0,o.jsx)(X,{variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:b,"aria-label":S,"aria-pressed":y,children:(0,o.jsx)(l.Star,{className:q(`h-4 w-4`,y?`fill-yellow-400 text-yellow-400`:`text-muted-foreground`)})})}),(0,o.jsx)(vi,{children:S})]}),f]})})})},du=!1;function fu(){if(du||typeof document>`u`)return;let e=`objui-refresh-indicator-kf`;if(document.getElementById(e)){du=!0;return}let t=document.createElement(`style`);t.id=e,t.textContent=`
12
+ See documentation at https://www.objectui.org/docs/components for alternatives.`,Ee=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{(0,s.isHtmlTierNode)(e)||we(`span`,Te);let{"data-obj-id":i,"data-obj-type":a,style:c,...l}=n;return(0,o.jsx)(`span`,{ref:r,className:t,...l,"data-obj-id":i,"data-obj-type":a,style:c,children:J(e.children)||e.value})});t.ComponentRegistry.register(`span`,Ee,{namespace:`ui`,label:`Inline Container (Deprecated)`,deprecated:{surfaces:[`json`],replacement:`use "badge" for labels, or "text" with a className for inline emphasis`},inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Inline content, rendered ahead of `value`"}],defaultProps:{className:`px-1.5 py-0.5 sm:px-2 sm:py-1`}});var De=c.Root,Oe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(c.Item,{ref:n,className:q(`border-b`,e),...t}));Oe.displayName=`AccordionItem`;var ke=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(c.Header,{className:`flex`,children:(0,o.jsxs)(c.Trigger,{ref:r,className:q(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));ke.displayName=c.Trigger.displayName;var Ae=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(c.Content,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,o.jsx)(`div`,{className:q(`pb-4 pt-0`,e),children:t})}));Ae.displayName=c.Content.displayName;var je=(0,f.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),Y=a.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,o.jsx)(r?d.Slot:`button`,{className:q(je({variant:t,size:n,className:e})),ref:a,...i}));Y.displayName=`Button`;var X=u.Root,Me=u.Trigger,Ne=u.Portal,Pe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Overlay,{className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Pe.displayName=u.Overlay.displayName;var Fe=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(Ne,{children:[(0,o.jsx)(Pe,{}),(0,o.jsx)(u.Content,{ref:n,className:q(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));Fe.displayName=u.Content.displayName;var Ie=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Ie.displayName=`AlertDialogHeader`;var Le=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Le.displayName=`AlertDialogFooter`;var Re=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Title,{ref:n,className:q(`text-lg font-semibold`,e),...t}));Re.displayName=u.Title.displayName;var ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));ze.displayName=u.Description.displayName;var Be=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Action,{ref:n,className:q(je(),e),...t}));Be.displayName=u.Action.displayName;var Ve=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(u.Cancel,{ref:n,className:q(je({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));Ve.displayName=u.Cancel.displayName;var He=(0,f.cva)(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),Ue=a.forwardRef(({className:e,variant:t,...n},r)=>(0,o.jsx)(`div`,{ref:r,role:`alert`,className:q(He({variant:t}),e),...n}));Ue.displayName=`Alert`;var We=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h5`,{ref:n,className:q(`mb-1 font-medium leading-none tracking-tight`,e),...t}));We.displayName=`AlertTitle`;var Ge=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-sm [&_p]:leading-relaxed`,e),...t}));Ge.displayName=`AlertDescription`;var Ke=p.Root,qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Root,{ref:n,className:q(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));qe.displayName=m.Root.displayName;var Je=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Image,{ref:n,className:q(`aspect-square h-full w-full`,e),...t}));Je.displayName=m.Image.displayName;var Z=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(m.Fallback,{ref:n,className:q(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));Z.displayName=m.Fallback.displayName;var Ye=(0,f.cva)(`inline-flex items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Xe({className:e,variant:t,...n}){return(0,o.jsx)(`div`,{className:q(Ye({variant:t}),e),...n})}var Ze=a.forwardRef(({...e},t)=>(0,o.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));Ze.displayName=`Breadcrumb`;var Qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ol`,{ref:n,className:q(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));Qe.displayName=`BreadcrumbList`;var $e=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:q(`inline-flex items-center gap-1.5`,e),...t}));$e.displayName=`BreadcrumbItem`;var et=a.forwardRef(({asChild:e,className:t,...n},r)=>(0,o.jsx)(e?d.Slot:`a`,{ref:r,className:q(`transition-colors hover:text-foreground`,t),...n}));et.displayName=`BreadcrumbLink`;var tt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:q(`font-normal text-foreground`,e),...t}));tt.displayName=`BreadcrumbPage`;var nt=({children:e,className:t,...n})=>(0,o.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:q(`[&>svg]:w-3.5 [&>svg]:h-3.5`,t),...n,children:e??(0,o.jsx)(l.ChevronRight,{})});nt.displayName=`BreadcrumbSeparator`;var rt=({className:e,...t})=>(0,o.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:q(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More`})]});rt.displayName=`BreadcrumbElipssis`;var it=`en-US`,at=Object.freeze({af:()=>import(`date-fns/locale/af`).then(e=>e.af),ar:()=>import(`date-fns/locale/ar`).then(e=>e.ar),"ar-DZ":()=>import(`date-fns/locale/ar-DZ`).then(e=>e.arDZ),"ar-EG":()=>import(`date-fns/locale/ar-EG`).then(e=>e.arEG),"ar-MA":()=>import(`date-fns/locale/ar-MA`).then(e=>e.arMA),"ar-SA":()=>import(`date-fns/locale/ar-SA`).then(e=>e.arSA),"ar-TN":()=>import(`date-fns/locale/ar-TN`).then(e=>e.arTN),az:()=>import(`date-fns/locale/az`).then(e=>e.az),be:()=>import(`date-fns/locale/be`).then(e=>e.be),"be-tarask":()=>import(`date-fns/locale/be-tarask`).then(e=>e.beTarask),bg:()=>import(`date-fns/locale/bg`).then(e=>e.bg),bn:()=>import(`date-fns/locale/bn`).then(e=>e.bn),bs:()=>import(`date-fns/locale/bs`).then(e=>e.bs),ca:()=>import(`date-fns/locale/ca`).then(e=>e.ca),ckb:()=>import(`date-fns/locale/ckb`).then(e=>e.ckb),cs:()=>import(`date-fns/locale/cs`).then(e=>e.cs),cy:()=>import(`date-fns/locale/cy`).then(e=>e.cy),da:()=>import(`date-fns/locale/da`).then(e=>e.da),de:()=>import(`date-fns/locale/de`).then(e=>e.de),"de-AT":()=>import(`date-fns/locale/de-AT`).then(e=>e.deAT),el:()=>import(`date-fns/locale/el`).then(e=>e.el),"en-AU":()=>import(`date-fns/locale/en-AU`).then(e=>e.enAU),"en-CA":()=>import(`date-fns/locale/en-CA`).then(e=>e.enCA),"en-GB":()=>import(`date-fns/locale/en-GB`).then(e=>e.enGB),"en-IE":()=>import(`date-fns/locale/en-IE`).then(e=>e.enIE),"en-IN":()=>import(`date-fns/locale/en-IN`).then(e=>e.enIN),"en-NZ":()=>import(`date-fns/locale/en-NZ`).then(e=>e.enNZ),"en-ZA":()=>import(`date-fns/locale/en-ZA`).then(e=>e.enZA),eo:()=>import(`date-fns/locale/eo`).then(e=>e.eo),es:()=>import(`date-fns/locale/es`).then(e=>e.es),et:()=>import(`date-fns/locale/et`).then(e=>e.et),eu:()=>import(`date-fns/locale/eu`).then(e=>e.eu),"fa-IR":()=>import(`date-fns/locale/fa-IR`).then(e=>e.faIR),fi:()=>import(`date-fns/locale/fi`).then(e=>e.fi),fr:()=>import(`date-fns/locale/fr`).then(e=>e.fr),"fr-CA":()=>import(`date-fns/locale/fr-CA`).then(e=>e.frCA),"fr-CH":()=>import(`date-fns/locale/fr-CH`).then(e=>e.frCH),fy:()=>import(`date-fns/locale/fy`).then(e=>e.fy),gd:()=>import(`date-fns/locale/gd`).then(e=>e.gd),gl:()=>import(`date-fns/locale/gl`).then(e=>e.gl),gu:()=>import(`date-fns/locale/gu`).then(e=>e.gu),he:()=>import(`date-fns/locale/he`).then(e=>e.he),hi:()=>import(`date-fns/locale/hi`).then(e=>e.hi),hr:()=>import(`date-fns/locale/hr`).then(e=>e.hr),ht:()=>import(`date-fns/locale/ht`).then(e=>e.ht),hu:()=>import(`date-fns/locale/hu`).then(e=>e.hu),hy:()=>import(`date-fns/locale/hy`).then(e=>e.hy),id:()=>import(`date-fns/locale/id`).then(e=>e.id),is:()=>import(`date-fns/locale/is`).then(e=>e.is),it:()=>import(`date-fns/locale/it`).then(e=>e.it),"it-CH":()=>import(`date-fns/locale/it-CH`).then(e=>e.itCH),ja:()=>import(`date-fns/locale/ja`).then(e=>e.ja),"ja-Hira":()=>import(`date-fns/locale/ja-Hira`).then(e=>e.jaHira),ka:()=>import(`date-fns/locale/ka`).then(e=>e.ka),kk:()=>import(`date-fns/locale/kk`).then(e=>e.kk),km:()=>import(`date-fns/locale/km`).then(e=>e.km),kn:()=>import(`date-fns/locale/kn`).then(e=>e.kn),ko:()=>import(`date-fns/locale/ko`).then(e=>e.ko),lb:()=>import(`date-fns/locale/lb`).then(e=>e.lb),lt:()=>import(`date-fns/locale/lt`).then(e=>e.lt),lv:()=>import(`date-fns/locale/lv`).then(e=>e.lv),mk:()=>import(`date-fns/locale/mk`).then(e=>e.mk),mn:()=>import(`date-fns/locale/mn`).then(e=>e.mn),ms:()=>import(`date-fns/locale/ms`).then(e=>e.ms),mt:()=>import(`date-fns/locale/mt`).then(e=>e.mt),nb:()=>import(`date-fns/locale/nb`).then(e=>e.nb),nl:()=>import(`date-fns/locale/nl`).then(e=>e.nl),"nl-BE":()=>import(`date-fns/locale/nl-BE`).then(e=>e.nlBE),nn:()=>import(`date-fns/locale/nn`).then(e=>e.nn),oc:()=>import(`date-fns/locale/oc`).then(e=>e.oc),pl:()=>import(`date-fns/locale/pl`).then(e=>e.pl),pt:()=>import(`date-fns/locale/pt`).then(e=>e.pt),"pt-BR":()=>import(`date-fns/locale/pt-BR`).then(e=>e.ptBR),ro:()=>import(`date-fns/locale/ro`).then(e=>e.ro),ru:()=>import(`date-fns/locale/ru`).then(e=>e.ru),se:()=>import(`date-fns/locale/se`).then(e=>e.se),sk:()=>import(`date-fns/locale/sk`).then(e=>e.sk),sl:()=>import(`date-fns/locale/sl`).then(e=>e.sl),sq:()=>import(`date-fns/locale/sq`).then(e=>e.sq),sr:()=>import(`date-fns/locale/sr`).then(e=>e.sr),"sr-Latn":()=>import(`date-fns/locale/sr-Latn`).then(e=>e.srLatn),sv:()=>import(`date-fns/locale/sv`).then(e=>e.sv),ta:()=>import(`date-fns/locale/ta`).then(e=>e.ta),te:()=>import(`date-fns/locale/te`).then(e=>e.te),th:()=>import(`date-fns/locale/th`).then(e=>e.th),tr:()=>import(`date-fns/locale/tr`).then(e=>e.tr),ug:()=>import(`date-fns/locale/ug`).then(e=>e.ug),uk:()=>import(`date-fns/locale/uk`).then(e=>e.uk),uz:()=>import(`date-fns/locale/uz`).then(e=>e.uz),"uz-Cyrl":()=>import(`date-fns/locale/uz-Cyrl`).then(e=>e.uzCyrl),vi:()=>import(`date-fns/locale/vi`).then(e=>e.vi),"zh-CN":()=>import(`date-fns/locale/zh-CN`).then(e=>e.zhCN),"zh-HK":()=>import(`date-fns/locale/zh-HK`).then(e=>e.zhHK),"zh-TW":()=>import(`date-fns/locale/zh-TW`).then(e=>e.zhTW)});Object.freeze([it,...Object.keys(at)]);var ot=new Map([[it,g.enUS]]),st=new Map,ct=new Map;function lt(e){return e===it||Object.prototype.hasOwnProperty.call(at,e)}function ut(e){let t=ct.get(e);if(t!==void 0)return t;let n=it;try{let t=new Intl.Locale(e),{language:r,script:i,region:a}=t.maximize();n=[t.baseName,a?`${r}-${a}`:void 0,i?`${r}-${i}`:void 0,r].find(e=>!!e&&lt(e))??it}catch{}return ct.set(e,n),n}function dt(e){let t=ot.get(e);if(t)return Promise.resolve(t);let n=st.get(e);if(n)return n;let r=Object.prototype.hasOwnProperty.call(at,e)?at[e]:void 0;if(!r)return Promise.resolve(g.enUS);let i=r().then(t=>(ot.set(e,t),t)).finally(()=>{st.delete(e)});return st.set(e,i),i}function ft(e){let t=(0,_.useDisplayLocale)(),n=ut(e??t),[,r]=a.useReducer(e=>e+1,0),i=ot.get(n);return a.useEffect(()=>{if(ot.has(n))return;let e=!0;return dt(n).then(()=>{e&&r()},()=>{}),()=>{e=!1}},[n]),i??g.enUS}function pt({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,formatters:a,components:s,localeTag:c,...u}){let d=(0,h.getDefaultClassNames)(),f=ft(c);return(0,o.jsx)(h.DayPicker,{locale:f,showOutsideDays:n,className:q(`bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[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:r,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...a},classNames:{root:q(`w-fit`,d.root),months:q(`relative flex flex-col gap-4 md:flex-row`,d.months),month:q(`flex w-full flex-col gap-4`,d.month),nav:q(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,d.nav),button_previous:q(je({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,d.button_previous),button_next:q(je({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,d.button_next),month_caption:q(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,d.month_caption),dropdowns:q(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,d.dropdowns),dropdown_root:q(`has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border`,d.dropdown_root),dropdown:q(`bg-popover absolute inset-0 opacity-0`,d.dropdown),caption_label:q(`select-none font-medium`,r===`label`?`text-sm`:`[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`,d.caption_label),weekdays:q(`flex`,d.weekdays),weekday:q(`text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal`,d.weekday),week:q(`mt-2 flex w-full`,d.week),week_number_header:q(`w-(--cell-size) select-none`,d.week_number_header),week_number:q(`text-muted-foreground select-none text-[0.8rem]`,d.week_number),day:q(`group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md`,d.day),range_start:q(`bg-accent rounded-l-md`,d.range_start),range_middle:q(`rounded-none`,d.range_middle),range_end:q(`bg-accent rounded-r-md`,d.range_end),today:q(`bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none`,d.today),outside:q(`text-muted-foreground aria-selected:text-muted-foreground`,d.outside),disabled:q(`text-muted-foreground opacity-50`,d.disabled),hidden:q(`invisible`,d.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,o.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:q(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,o.jsx)(l.ChevronLeftIcon,{className:q(`size-4`,e),...n}):t===`right`?(0,o.jsx)(l.ChevronRightIcon,{className:q(`size-4`,e),...n}):(0,o.jsx)(l.ChevronDownIcon,{className:q(`size-4`,e),...n}),DayButton:mt,WeekNumber:({children:e,...t})=>(0,o.jsx)(`td`,{...t,children:(0,o.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...u})}function mt({className:e,day:t,modifiers:n,...r}){let i=(0,h.getDefaultClassNames)(),s=a.useRef(null);return a.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),(0,o.jsx)(Y,{ref:s,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:q(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-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 flex aspect-square h-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70`,i.day,e),...r})}var ht=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));ht.displayName=`Card`;var gt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex flex-col space-y-1.5 p-6`,e),...t}));gt.displayName=`CardHeader`;var _t=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));_t.displayName=`CardTitle`;var vt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));vt.displayName=`CardDescription`;var yt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`p-6 pt-0`,e),...t}));yt.displayName=`CardContent`;var bt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex items-center p-6 pt-0`,e),...t}));bt.displayName=`CardFooter`;var xt=a.createContext(null);function St(){let e=a.useContext(xt);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}var Ct=a.forwardRef(({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:s,...c},l)=>{let[u,d]=(0,v.default)({...t,axis:e===`horizontal`?`x`:`y`},r),[f,p]=a.useState(!1),[m,h]=a.useState(!1),g=a.useCallback(e=>{e&&(p(e.canScrollPrev()),h(e.canScrollNext()))},[]),_=a.useCallback(()=>{d?.scrollPrev()},[d]),y=a.useCallback(()=>{d?.scrollNext()},[d]),b=a.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),_()):e.key===`ArrowRight`&&(e.preventDefault(),y())},[_,y]);return a.useEffect(()=>{d&&n&&n(d)},[d,n]),a.useEffect(()=>{if(d)return g(d),d.on(`reInit`,g),d.on(`select`,g),()=>{d?.off(`select`,g)}},[d,g]),(0,o.jsx)(xt.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:_,scrollNext:y,canScrollPrev:f,canScrollNext:m},children:(0,o.jsx)(`div`,{ref:l,onKeyDownCapture:b,className:q(`relative`,i),role:`region`,"aria-roledescription":`carousel`,...c,children:s})})});Ct.displayName=`Carousel`;var wt=a.forwardRef(({className:e,...t},n)=>{let{carouselRef:r,orientation:i}=St();return(0,o.jsx)(`div`,{ref:r,className:`overflow-hidden`,children:(0,o.jsx)(`div`,{ref:n,className:q(`flex`,i===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})});wt.displayName=`CarouselContent`;var Tt=a.forwardRef(({className:e,...t},n)=>{let{orientation:r}=St();return(0,o.jsx)(`div`,{ref:n,role:`group`,"aria-roledescription":`slide`,className:q(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,e),...t})});Tt.displayName=`CarouselItem`;var Et=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollPrev:s,canScrollPrev:c}=St();return(0,o.jsxs)(Y,{ref:i,variant:t,size:n,className:q(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-left-12 top-1/2 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...r,children:[(0,o.jsx)(l.ArrowLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})});Et.displayName=`CarouselPrevious`;var Dt=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollNext:s,canScrollNext:c}=St();return(0,o.jsxs)(Y,{ref:i,variant:t,size:n,className:q(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-right-12 top-1/2 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!c,onClick:s,...r,children:[(0,o.jsx)(l.ArrowRight,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})});Dt.displayName=`CarouselNext`;var Ot=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Root,{ref:n,className:q(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,o.jsx)(y.Indicator,{className:q(`grid place-content-center text-current`),children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}));Ot.displayName=y.Root.displayName;var kt=b.Root,At=b.CollapsibleTrigger,jt=b.CollapsibleContent,Mt=(0,_.createSafeTranslation)({"common.close":`Close`},`common.close`);function Nt(){let{t:e}=Mt();return(0,o.jsx)(`span`,{className:`sr-only`,children:e(`common.close`)})}var Pt=S.Root,Ft=S.Trigger,It=S.Portal,Lt=S.Close,Rt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Overlay,{ref:n,className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Rt.displayName=S.Overlay.displayName;var zt=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(It,{children:[(0,o.jsx)(Rt,{}),(0,o.jsxs)(S.Content,{ref:r,className:q(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,o.jsxs)(S.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(Nt,{})]})]})]}));zt.displayName=S.Content.displayName;var Bt=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Bt.displayName=`DialogHeader`;var Vt=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Vt.displayName=`DialogFooter`;var Ht=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Title,{ref:n,className:q(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Ht.displayName=S.Title.displayName;var Ut=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));Ut.displayName=S.Description.displayName;var Wt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command,{ref:n,className:q(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Wt.displayName=x.Command.displayName;var Gt=({children:e,contentProps:t,title:n=`Command Palette`,description:r,...i})=>{let{className:a,...s}=t??{};return(0,o.jsx)(Pt,{...i,children:(0,o.jsxs)(zt,{className:q(`overflow-hidden p-0 shadow-lg`,a),...s,children:[(0,o.jsx)(Ht,{className:`sr-only`,children:n}),r?(0,o.jsx)(Ut,{className:`sr-only`,children:r}):null,(0,o.jsx)(Wt,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:e})]})})},Kt=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,o.jsx)(l.Search,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,o.jsx)(x.Command.Input,{ref:n,className:q(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Kt.displayName=x.Command.Input.displayName;var qt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.List,{ref:n,className:q(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));qt.displayName=x.Command.List.displayName;var Jt=a.forwardRef((e,t)=>(0,o.jsx)(x.Command.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));Jt.displayName=x.Command.Empty.displayName;var Yt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Group,{ref:n,className:q(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Yt.displayName=x.Command.Group.displayName;var Xt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Separator,{ref:n,className:q(`-mx-1 h-px bg-border`,e),...t}));Xt.displayName=x.Command.Separator.displayName;var Zt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Command.Item,{ref:n,className:q(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...t}));Zt.displayName=x.Command.Item.displayName;var Qt=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});Qt.displayName=`CommandShortcut`;var $t=C.Root,en=C.Trigger,tn=C.Group,nn=C.Portal,rn=C.Sub,an=C.RadioGroup,on=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(C.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto h-4 w-4`})]}));on.displayName=C.SubTrigger.displayName;var sn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-context-menu-content-transform-origin)`,e),...t}));sn.displayName=C.SubContent.displayName;var cn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Portal,{children:(0,o.jsx)(C.Content,{ref:n,className:q(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-context-menu-content-transform-origin)`,e),...t})}));cn.displayName=C.Content.displayName;var ln=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));ln.displayName=C.Item.displayName;var un=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(C.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));un.displayName=C.CheckboxItem.displayName;var dn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(C.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));dn.displayName=C.RadioItem.displayName;var fn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));fn.displayName=C.Label.displayName;var pn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-border`,e),...t}));pn.displayName=C.Separator.displayName;var mn=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});mn.displayName=`ContextMenuShortcut`;var hn=({shouldScaleBackground:e=!0,...t})=>(0,o.jsx)(w.Drawer.Root,{shouldScaleBackground:e,...t});hn.displayName=`Drawer`;var gn=w.Drawer.Trigger,_n=w.Drawer.Portal,vn=w.Drawer.Close,yn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Overlay,{ref:n,className:q(`fixed inset-0 z-50 bg-black/80`,e),...t}));yn.displayName=w.Drawer.Overlay.displayName;var bn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(_n,{children:[(0,o.jsx)(yn,{}),(0,o.jsxs)(w.Drawer.Content,{ref:r,className:q(`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background`,e),...n,children:[(0,o.jsx)(`div`,{className:`mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted`}),t]})]}));bn.displayName=`DrawerContent`;var xn=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`grid gap-1.5 p-4 text-center sm:text-left`,e),...t});xn.displayName=`DrawerHeader`;var Sn=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`mt-auto flex flex-col gap-2 p-4`,e),...t});Sn.displayName=`DrawerFooter`;var Cn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Title,{ref:n,className:q(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Cn.displayName=w.Drawer.Title.displayName;var wn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(w.Drawer.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));wn.displayName=w.Drawer.Description.displayName;var Tn=T.Root,En=T.Trigger,Dn=T.Group,On=T.Portal,kn=T.Sub,An=T.RadioGroup,jn=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(T.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto`})]}));jn.displayName=T.SubTrigger.displayName;var Mn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));Mn.displayName=T.SubContent.displayName;var Nn=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(T.Portal,{children:(0,o.jsx)(T.Content,{ref:r,sideOffset:t,className:q(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));Nn.displayName=T.Content.displayName;var Pn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(T.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));Pn.displayName=T.Item.displayName;var Fn=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(T.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(T.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));Fn.displayName=T.CheckboxItem.displayName;var In=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(T.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(T.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));In.displayName=T.RadioItem.displayName;var Ln=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(T.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));Ln.displayName=T.Label.displayName;var Rn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));Rn.displayName=T.Separator.displayName;var zn=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest opacity-60`,e),...t});zn.displayName=`DropdownMenuShortcut`;var Bn=(0,f.cva)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Vn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(D.Root,{ref:n,className:q(Bn(),e),...t}));Vn.displayName=D.Root.displayName;var Hn=E.FormProvider,Un=a.createContext(null),Wn=({...e})=>(0,o.jsx)(Un.Provider,{value:{name:e.name},children:(0,o.jsx)(E.Controller,{...e})}),Gn=()=>{let e=a.useContext(Un),t=a.useContext(Kn),{getFieldState:n,formState:r}=(0,E.useFormContext)();if(!e)throw Error(`useFormField should be used within <FormField>`);if(!t)throw Error(`useFormField should be used within <FormItem>`);let i=n(e.name,r),{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Kn=a.createContext(null),qn=a.forwardRef(({className:e,...t},n)=>{let r=a.useId();return(0,o.jsx)(Kn.Provider,{value:{id:r},children:(0,o.jsx)(`div`,{ref:n,className:q(`space-y-2`,e),...t})})});qn.displayName=`FormItem`;var Jn=a.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=Gn();return(0,o.jsx)(Vn,{ref:n,className:q(r&&`text-destructive`,e),htmlFor:i,...t})});Jn.displayName=`FormLabel`;var Yn=a.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Gn();return(0,o.jsx)(d.Slot,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});Yn.displayName=`FormControl`;var Xn=a.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=Gn();return(0,o.jsx)(`p`,{ref:n,id:r,className:q(`text-sm text-muted-foreground`,e),...t})});Xn.displayName=`FormDescription`;var Zn=a.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=Gn(),s=i?String(i?.message??``):t;return s?(0,o.jsx)(`p`,{ref:r,id:a,className:q(`text-sm font-medium text-destructive`,e),...n,children:s}):null});Zn.displayName=`FormMessage`;var Qn=O.Root,$n=O.Trigger,er=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(O.Content,{ref:i,align:t,sideOffset:n,className:q(`z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-hover-card-content-transform-origin)`,e),...r}));er.displayName=O.Content.displayName;var tr=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(k.OTPInput,{ref:r,containerClassName:q(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),className:q(`disabled:cursor-not-allowed`,e),...n}));tr.displayName=`InputOTP`;var nr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`flex items-center`,e),...t}));nr.displayName=`InputOTPGroup`;var rr=a.forwardRef(({index:e,className:t,...n},r)=>{let{char:i,hasFakeCaret:s,isActive:c}=a.useContext(k.OTPInputContext).slots[e];return(0,o.jsxs)(`div`,{ref:r,className:q(`relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md`,c&&`z-10 ring-2 ring-ring ring-offset-background`,t),...n,children:[i,s&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,o.jsx)(`div`,{className:`h-4 w-px animate-caret-blink bg-foreground duration-1000`})})]})});rr.displayName=`InputOTPSlot`;var ir=a.forwardRef(({...e},t)=>(0,o.jsx)(`div`,{ref:t,role:`separator`,...e,children:(0,o.jsx)(l.Dot,{})}));ir.displayName=`InputOTPSeparator`;var Q=a.forwardRef(({className:e,type:t,...n},r)=>(0,o.jsx)(`input`,{type:t,className:q(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));Q.displayName=`Input`;function ar({...e}){return(0,o.jsx)(A.Menu,{...e})}function or({...e}){return(0,o.jsx)(A.Group,{...e})}function sr({...e}){return(0,o.jsx)(A.Portal,{...e})}function cr({...e}){return(0,o.jsx)(A.RadioGroup,{...e})}function lr({...e}){return(0,o.jsx)(A.Sub,{"data-slot":`menubar-sub`,...e})}var ur=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Root,{ref:n,className:q(`flex h-10 items-center space-x-1 rounded-md border bg-background p-1`,e),...t}));ur.displayName=A.Root.displayName;var dr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Trigger,{ref:n,className:q(`flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,e),...t}));dr.displayName=A.Trigger.displayName;var fr=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(A.SubTrigger,{ref:i,className:q(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(l.ChevronRight,{className:`ml-auto h-4 w-4`})]}));fr.displayName=A.SubTrigger.displayName;var pr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.SubContent,{ref:n,className:q(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-menubar-content-transform-origin)`,e),...t}));pr.displayName=A.SubContent.displayName;var mr=a.forwardRef(({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i},a)=>(0,o.jsx)(A.Portal,{children:(0,o.jsx)(A.Content,{ref:a,align:t,alignOffset:n,sideOffset:r,className:q(`z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-menubar-content-transform-origin)`,e),...i})}));mr.displayName=A.Content.displayName;var hr=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(A.Item,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));hr.displayName=A.Item.displayName;var gr=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(A.CheckboxItem,{ref:i,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(A.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),t]}));gr.displayName=A.CheckboxItem.displayName;var _r=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(A.RadioItem,{ref:r,className:q(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(A.ItemIndicator,{children:(0,o.jsx)(l.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));_r.displayName=A.RadioItem.displayName;var vr=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(A.Label,{ref:r,className:q(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));vr.displayName=A.Label.displayName;var yr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(A.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));yr.displayName=A.Separator.displayName;var br=({className:e,...t})=>(0,o.jsx)(`span`,{className:q(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});br.displayname=`MenubarShortcut`;var xr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(j.Root,{ref:r,className:q(`relative z-10 flex max-w-max flex-1 items-center justify-center`,e),...n,children:[t,(0,o.jsx)(Or,{})]}));xr.displayName=j.Root.displayName;var Sr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.List,{ref:n,className:q(`group flex flex-1 list-none items-center justify-center space-x-1`,e),...t}));Sr.displayName=j.List.displayName;var Cr=j.Item,wr=(0,f.cva)(`group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent`),Tr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(j.Trigger,{ref:r,className:q(wr(),`group`,e),...n,children:[t,` `,(0,o.jsx)(l.ChevronDown,{className:`relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180`,"aria-hidden":`true`})]}));Tr.displayName=j.Trigger.displayName;var Er=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Content,{ref:n,className:q(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,e),...t}));Er.displayName=j.Content.displayName;var Dr=j.Link,Or=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:q(`absolute left-0 top-full flex justify-center`),children:(0,o.jsx)(j.Viewport,{className:q(`origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]`,e),ref:n,...t})}));Or.displayName=j.Viewport.displayName;var kr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Indicator,{ref:n,className:q(`top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,e),...t,children:(0,o.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`})}));kr.displayName=j.Indicator.displayName;var Ar=({className:e,...t})=>(0,o.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,className:q(`mx-auto flex w-full justify-center`,e),...t});Ar.displayName=`Pagination`;var jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:q(`flex flex-row items-center gap-1`,e),...t}));jr.displayName=`PaginationContent`;var Mr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:q(``,e),...t}));Mr.displayName=`PaginationItem`;var Nr=({className:e,isActive:t,size:n=`icon`,...r})=>(0,o.jsx)(`a`,{"aria-current":t?`page`:void 0,className:q(je({variant:t?`outline`:`ghost`,size:n}),e),...r});Nr.displayName=`PaginationLink`;var Pr=({className:e,...t})=>(0,o.jsxs)(Nr,{"aria-label":`Go to previous page`,size:`default`,className:q(`gap-1 pl-2.5`,e),...t,children:[(0,o.jsx)(l.ChevronLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:`Previous`})]});Pr.displayName=`PaginationPrevious`;var Fr=({className:e,...t})=>(0,o.jsxs)(Nr,{"aria-label":`Go to next page`,size:`default`,className:q(`gap-1 pr-2.5`,e),...t,children:[(0,o.jsx)(`span`,{children:`Next`}),(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})]});Fr.displayName=`PaginationNext`;var Ir=({className:e,...t})=>(0,o.jsxs)(`span`,{"aria-hidden":!0,className:q(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More pages`})]});Ir.displayName=`PaginationEllipsis`;var Lr=M.Root,Rr=M.Trigger,zr=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(M.Portal,{children:(0,o.jsx)(M.Content,{ref:i,align:t,sideOffset:n,className:q(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-popover-content-transform-origin)`,e),...r})}));zr.displayName=M.Content.displayName;var Br=a.forwardRef(({className:e,value:t,...n},r)=>(0,o.jsx)(N.Root,{ref:r,className:q(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,o.jsx)(N.Indicator,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));Br.displayName=N.Root.displayName;var Vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(P.Root,{className:q(`grid gap-2`,e),...t,ref:n}));Vr.displayName=P.Root.displayName;var Hr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(P.Item,{ref:n,className:q(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,o.jsx)(P.Indicator,{className:`flex items-center justify-center`,children:(0,o.jsx)(l.Circle,{className:`h-2.5 w-2.5 fill-current text-current`})})}));Hr.displayName=P.Item.displayName;var Ur=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(F.Root,{ref:r,className:q(`relative overflow-hidden`,e),...n,children:[(0,o.jsx)(F.Viewport,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,o.jsx)(Wr,{}),(0,o.jsx)(F.Corner,{})]}));Ur.displayName=F.Root.displayName;var Wr=a.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,o.jsx)(F.ScrollAreaScrollbar,{ref:r,orientation:t,className:q(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,o.jsx)(F.ScrollAreaThumb,{className:`relative flex-1 rounded-full bg-border`})}));Wr.displayName=F.ScrollAreaScrollbar.displayName;var Gr=({onValueChange:e,...t})=>{let n=a.useCallback(t=>{t!==``&&e?.(t)},[e]);return(0,o.jsx)(I.Root,{...t,onValueChange:n})};Gr.displayName=I.Root.displayName;var Kr=I.Group,qr=I.Value,Jr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(I.Trigger,{ref:r,className:q(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,o.jsx)(I.Icon,{asChild:!0,children:(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4 opacity-50`})})]}));Jr.displayName=I.Trigger.displayName;var Yr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(I.ScrollUpButton,{ref:n,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(l.ChevronUp,{className:`h-4 w-4`})}));Yr.displayName=I.ScrollUpButton.displayName;var Xr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(I.ScrollDownButton,{ref:n,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4`})}));Xr.displayName=I.ScrollDownButton.displayName;var Zr=a.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,o.jsx)(I.Portal,{children:(0,o.jsxs)(I.Content,{ref:i,className:q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,o.jsx)(Yr,{}),(0,o.jsx)(I.Viewport,{className:q(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,o.jsx)(Xr,{})]})}));Zr.displayName=I.Content.displayName;var Qr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(I.Label,{ref:n,className:q(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));Qr.displayName=I.Label.displayName;var $r=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(I.Item,{ref:r,className:q(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(I.ItemIndicator,{children:(0,o.jsx)(l.Check,{className:`h-4 w-4`})})}),(0,o.jsx)(I.ItemText,{children:t})]}));$r.displayName=I.Item.displayName;var ei=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(I.Separator,{ref:n,className:q(`-mx-1 my-1 h-px bg-muted`,e),...t}));ei.displayName=I.Separator.displayName;var ti=a.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,o.jsx)(ee.Root,{ref:i,decorative:n,orientation:t,className:q(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));ti.displayName=ee.Root.displayName;var ni=S.Root,ri=S.Trigger,ii=S.Close,ai=S.Portal,oi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Overlay,{className:q(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));oi.displayName=S.Overlay.displayName;var si=(0,f.cva)(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),ci=a.forwardRef(({side:e=`right`,className:t,children:n,hideOverlay:r,...i},a)=>(0,o.jsxs)(ai,{children:[!r&&(0,o.jsx)(oi,{}),(0,o.jsxs)(S.Content,{ref:a,className:q(si({side:e}),t),...i,children:[n,(0,o.jsxs)(S.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(Nt,{})]})]})]}));ci.displayName=S.Content.displayName;var li=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});li.displayName=`SheetHeader`;var ui=({className:e,...t})=>(0,o.jsx)(`div`,{className:q(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});ui.displayName=`SheetFooter`;var di=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Title,{ref:n,className:q(`text-lg font-semibold text-foreground`,e),...t}));di.displayName=S.Title.displayName;var fi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Description,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));fi.displayName=S.Description.displayName;var pi=768;function mi(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<pi)};return e.addEventListener(`change`,n),t(window.innerWidth<pi),()=>e.removeEventListener(`change`,n)},[]),!!e}function hi(e){if(typeof document>`u`)return;let t=document.cookie;if(t)for(let n of t.split(`;`)){let t=n.indexOf(`=`);if(t===-1||n.slice(0,t).trim()!==e)continue;let r=n.slice(t+1).trim();return r===`true`||r!==`false`&&void 0}}function $({className:e,...t}){return(0,o.jsx)(`div`,{className:q(`animate-pulse rounded-md bg-muted`,e),...t})}var gi=L.Provider,_i=L.Root,vi=L.Trigger,yi=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(L.Content,{ref:r,sideOffset:t,className:q(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=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 origin-(--radix-tooltip-content-transform-origin)`,e),...n}));yi.displayName=L.Content.displayName;var bi=`sidebar_state`,xi=604800,Si=`16rem`,Ci=`18rem`,wi=`3rem`,Ti=`b`,Ei=a.createContext(null);function Di(){let e=a.useContext(Ei);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Oi(){return a.useContext(Ei)}var ki=a.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:s,...c},l)=>{let u=mi(),[d,f]=a.useState(!1),[p,m]=a.useState(()=>hi(bi)??e),h=t??p,g=a.useCallback(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`${bi}=${t}; path=/; max-age=${xi}`},[n,h]),_=a.useCallback(()=>u?f(e=>!e):g(e=>!e),[u,g,f]);a.useEffect(()=>{let e=e=>{e.key===Ti&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,y=a.useMemo(()=>({state:v,open:h,setOpen:g,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,u,d,f,_]);return(0,o.jsx)(Ei.Provider,{value:y,children:(0,o.jsx)(gi,{delayDuration:0,children:(0,o.jsx)(`div`,{style:{"--sidebar-width":Si,"--sidebar-width-icon":wi,...i},className:q(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:l,...c,children:s})})})});ki.displayName=`SidebarProvider`;var Ai=a.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},s)=>{let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=Di();return n===`none`?(0,o.jsx)(`div`,{className:q(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:s,...a,children:i}):c?(0,o.jsx)(ni,{open:u,onOpenChange:d,...a,children:(0,o.jsxs)(ci,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden data-[state=open]:duration-300 data-[state=open]:ease-out`,style:{"--sidebar-width":Ci},side:e,children:[(0,o.jsxs)(li,{className:`sr-only`,children:[(0,o.jsx)(di,{children:`Sidebar`}),(0,o.jsx)(fi,{children:`Displays the mobile sidebar.`})]}),(0,o.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,o.jsxs)(`div`,{ref:s,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":l,"data-collapsible":n,"data-variant":t,"data-side":e,children:[(0,o.jsx)(`div`,{className:q(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{className:q(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem_+_2px)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});Ai.displayName=`Sidebar`;var ji=a.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=Di();return(0,o.jsxs)(Y,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:q(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,o.jsx)(l.PanelLeft,{}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});ji.displayName=`SidebarTrigger`;var Mi=a.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=Di();return(0,o.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:q(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:translate-x-0 group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:after:left-full group-data-[state=collapsed]:group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-state=collapsed][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-state=collapsed][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});Mi.displayName=`SidebarRail`;var Ni=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`main`,{ref:n,className:q(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));Ni.displayName=`SidebarInset`;var Pi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(Q,{ref:n,"data-sidebar":`input`,className:q(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Pi.displayName=`SidebarInput`;var Fi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:q(`flex flex-col gap-2 p-2`,e),...t}));Fi.displayName=`SidebarHeader`;var Ii=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:q(`flex flex-col gap-2 p-2`,e),...t}));Ii.displayName=`SidebarFooter`;var Li=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ti,{ref:n,"data-sidebar":`separator`,className:q(`mx-2 w-auto bg-sidebar-border`,e),...t}));Li.displayName=`SidebarSeparator`;var Ri=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:q(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[state=collapsed]:group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Ri.displayName=`SidebarContent`;var zi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:q(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));zi.displayName=`SidebarGroup`;var Bi=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?d.Slot:`div`,{ref:r,"data-sidebar":`group-label`,className:q(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:-mt-8 group-data-[state=collapsed]:group-data-[collapsible=icon]:opacity-0`,e),...n}));Bi.displayName=`SidebarGroupLabel`;var Vi=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?d.Slot:`button`,{ref:r,"data-sidebar":`group-action`,className:q(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...n}));Vi.displayName=`SidebarGroupAction`;var Hi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:q(`w-full text-sm`,e),...t}));Hi.displayName=`SidebarGroupContent`;var Ui=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:q(`flex w-full min-w-0 flex-col gap-1`,e),...t}));Ui.displayName=`SidebarMenu`;var Wi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:q(`group/menu-item relative`,e),...t}));Wi.displayName=`SidebarMenuItem`;var Gi=(0,f.cva)(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding,color,background-color] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground sidebar-menu-button-icon-mode [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm sidebar-menu-button-icon-mode-lg`}},defaultVariants:{variant:`default`,size:`default`}}),Ki=a.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...s},c)=>{let l=e?d.Slot:`button`,{isMobile:u,state:f}=Di(),p=(0,o.jsx)(l,{ref:c,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:q(Gi({variant:n,size:r}),a),...s});return i?(typeof i==`string`&&(i={children:i}),(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:p}),(0,o.jsx)(yi,{side:`right`,align:`center`,hidden:f!==`collapsed`||u,...i})]})):p});Ki.displayName=`SidebarMenuButton`;var qi=a.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,o.jsx)(t?d.Slot:`button`,{ref:i,"data-sidebar":`menu-action`,className:q(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));qi.displayName=`SidebarMenuAction`;var Ji=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:q(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Ji.displayName=`SidebarMenuBadge`;var Yi=a.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=a.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,o.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:q(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,o.jsx)($,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,o.jsx)($,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Yi.displayName=`SidebarMenuSkeleton`;var Xi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:q(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Xi.displayName=`SidebarMenuSub`;var Zi=a.forwardRef(({...e},t)=>(0,o.jsx)(`li`,{ref:t,...e}));Zi.displayName=`SidebarMenuSubItem`;var Qi=a.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,o.jsx)(e?d.Slot:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:q(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,r),...i}));Qi.displayName=`SidebarMenuSubButton`;function $i(e){let{thumbProps:t,...n}=e;return{root:n,thumb:{"aria-label":e[`aria-label`],...t??{}}}}var ea=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(R.Root,{ref:n,className:q(`relative flex w-full touch-none select-none items-center`,e),...$i(t).root,children:[(0,o.jsx)(R.Track,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,o.jsx)(R.Range,{className:`absolute h-full bg-primary`})}),(0,o.jsx)(R.Thumb,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,...$i(t).thumb})]}));ea.displayName=R.Root.displayName;var ta=({...e})=>{let{theme:t=`system`}=(0,z.useTheme)();return(0,o.jsx)(B.Toaster,{theme:t,className:`toaster group`,icons:{success:(0,o.jsx)(l.CircleCheck,{className:`h-4 w-4`}),info:(0,o.jsx)(l.Info,{className:`h-4 w-4`}),warning:(0,o.jsx)(l.TriangleAlert,{className:`h-4 w-4`}),error:(0,o.jsx)(l.OctagonX,{className:`h-4 w-4`}),loading:(0,o.jsx)(l.LoaderCircle,{className:`h-4 w-4 animate-spin`})},toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},na=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(te.Root,{className:q(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,o.jsx)(te.Thumb,{className:q(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));na.displayName=te.Root.displayName;var ra=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(`div`,{className:q(`relative w-full overflow-auto`,t),children:(0,o.jsx)(`table`,{ref:r,className:q(`w-full caption-bottom text-sm`,e),...n})}));ra.displayName=`Table`;var ia=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`thead`,{ref:n,className:q(`[&_tr]:border-b`,e),...t}));ia.displayName=`TableHeader`;var aa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tbody`,{ref:n,className:q(`[&_tr:last-child]:border-0`,e),...t}));aa.displayName=`TableBody`;var oa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tfoot`,{ref:n,className:q(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));oa.displayName=`TableFooter`;var sa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tr`,{ref:n,className:q(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));sa.displayName=`TableRow`;var ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`th`,{ref:n,className:q(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));ca.displayName=`TableHead`;var la=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`td`,{ref:n,className:q(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));la.displayName=`TableCell`;var ua=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`caption`,{ref:n,className:q(`mt-4 text-sm text-muted-foreground`,e),...t}));ua.displayName=`TableCaption`;var da=ne.Root,fa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.List,{ref:n,className:q(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));fa.displayName=ne.List.displayName;var pa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.Trigger,{ref:n,className:q(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,e),...t}));pa.displayName=ne.Trigger.displayName;var ma=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ne.Content,{ref:n,className:q(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));ma.displayName=ne.Content.displayName;var ha=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`textarea`,{className:q(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));ha.displayName=`Textarea`;var ga=(0,f.cva)(`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-accent hover:text-accent-foreground`},size:{default:`h-10 px-3 min-w-10`,sm:`h-9 px-2.5 min-w-9`,lg:`h-11 px-5 min-w-11`}},defaultVariants:{variant:`default`,size:`default`}}),_a=a.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,o.jsx)(ie.Root,{ref:i,className:q(ga({variant:t,size:n,className:e})),...r}));_a.displayName=ie.Root.displayName;var va=a.createContext({size:`default`,variant:`default`}),ya=a.forwardRef(({className:e,variant:t,size:n,children:r,...i},a)=>(0,o.jsx)(re.Root,{ref:a,className:q(`flex items-center justify-center gap-1`,e),...i,children:(0,o.jsx)(va.Provider,{value:{variant:t,size:n},children:r})}));ya.displayName=re.Root.displayName;var ba=a.forwardRef(({className:e,children:t,variant:n,size:r,...i},s)=>{let c=a.useContext(va);return(0,o.jsx)(re.Item,{ref:s,className:q(ga({variant:c.variant||n,size:c.size||r}),e),...i,children:t})});ba.displayName=re.Item.displayName;var xa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h1`,{ref:n,className:q(`scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl`,e),...t}));xa.displayName=`TypographyH1`;var Sa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h2`,{ref:n,className:q(`scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0`,e),...t}));Sa.displayName=`TypographyH2`;var Ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h3`,{ref:n,className:q(`scroll-m-20 text-2xl font-semibold tracking-tight`,e),...t}));Ca.displayName=`TypographyH3`;var wa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h4`,{ref:n,className:q(`scroll-m-20 text-xl font-semibold tracking-tight`,e),...t}));wa.displayName=`TypographyH4`;var Ta=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`leading-7 [&:not(:first-child)]:mt-6`,e),...t}));Ta.displayName=`TypographyP`;var Ea=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`blockquote`,{ref:n,className:q(`mt-6 border-l-2 pl-6 italic`,e),...t}));Ea.displayName=`TypographyBlockquote`;var Da=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:q(`my-6 ml-6 list-disc [&>li]:mt-2`,e),...t}));Da.displayName=`TypographyList`;var Oa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`code`,{ref:n,className:q(`relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold`,e),...t}));Oa.displayName=`TypographyInlineCode`;var ka=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`text-xl text-muted-foreground`,e),...t}));ka.displayName=`TypographyLead`;var Aa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:q(`text-lg font-semibold`,e),...t}));Aa.displayName=`TypographyLarge`;var ja=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`small`,{ref:n,className:q(`text-sm font-medium leading-none`,e),...t}));ja.displayName=`TypographySmall`;var Ma=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:q(`text-sm text-muted-foreground`,e),...t}));Ma.displayName=`TypographyMuted`;var Na=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(ti,{ref:r,orientation:e.orientation,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s})});t.ComponentRegistry.register(`separator`,Na,{namespace:`ui`,label:`Separator`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`className`,type:`string`}],defaultProps:{orientation:`horizontal`,className:`my-2 sm:my-4`}}),t.ComponentRegistry.register(`image`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`img`,{src:e.src,alt:e.alt||``,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Image`,icon:`image`,category:`basic`,inputs:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`className`,type:`string`}],defaultProps:{className:`max-w-full h-auto`}});var Pa=`AArrowDown:a-arrow-down,AArrowUp:a-arrow-up,ALargeSmall:a-large-small,Accessibility:accessibility,Activity:activity,Ad:ad,AirVent:air-vent,Airplay:airplay,AlarmClock:alarm-clock,AlarmClockCheck:alarm-clock-check,AlarmClockMinus:alarm-clock-minus,AlarmClockOff:alarm-clock-off,AlarmClockPlus:alarm-clock-plus,AlarmSmoke:alarm-smoke,Album:album,AlignCenterHorizontal:align-center-horizontal,AlignCenterVertical:align-center-vertical,AlignEndHorizontal:align-end-horizontal,AlignEndVertical:align-end-vertical,AlignHorizontalDistributeCenter:align-horizontal-distribute-center,AlignHorizontalDistributeEnd:align-horizontal-distribute-end,AlignHorizontalDistributeStart:align-horizontal-distribute-start,AlignHorizontalJustifyCenter:align-horizontal-justify-center,AlignHorizontalJustifyEnd:align-horizontal-justify-end,AlignHorizontalJustifyStart:align-horizontal-justify-start,AlignHorizontalSpaceAround:align-horizontal-space-around,AlignHorizontalSpaceBetween:align-horizontal-space-between,AlignStartHorizontal:align-start-horizontal,AlignStartVertical:align-start-vertical,AlignVerticalDistributeCenter:align-vertical-distribute-center,AlignVerticalDistributeEnd:align-vertical-distribute-end,AlignVerticalDistributeStart:align-vertical-distribute-start,AlignVerticalJustifyCenter:align-vertical-justify-center,AlignVerticalJustifyEnd:align-vertical-justify-end,AlignVerticalJustifyStart:align-vertical-justify-start,AlignVerticalSpaceAround:align-vertical-space-around,AlignVerticalSpaceBetween:align-vertical-space-between,Ambulance:ambulance,Ampersand:ampersand,Ampersands:ampersands,Amphora:amphora,Anchor:anchor,Angle:angle,Antenna:antenna,Anvil:anvil,Aperture:aperture,AppWindow:app-window,AppWindowMac:app-window-mac,Apple:apple,Archive:archive,ArchiveRestore:archive-restore,ArchiveX:archive-x,Armchair:armchair,ArrowBigDown:arrow-big-down,ArrowBigDownDash:arrow-big-down-dash,ArrowBigLeft:arrow-big-left,ArrowBigLeftDash:arrow-big-left-dash,ArrowBigRight:arrow-big-right,ArrowBigRightDash:arrow-big-right-dash,ArrowBigUp:arrow-big-up,ArrowBigUpDash:arrow-big-up-dash,ArrowDown:arrow-down,ArrowDown01:arrow-down-0-1,ArrowDown10:arrow-down-1-0,ArrowDownAZ:arrow-down-a-z,ArrowDownFromLine:arrow-down-from-line,ArrowDownLeft:arrow-down-left,ArrowDownNarrowWide:arrow-down-narrow-wide,ArrowDownRight:arrow-down-right,ArrowDownToDot:arrow-down-to-dot,ArrowDownToLine:arrow-down-to-line,ArrowDownUp:arrow-down-up,ArrowDownWideNarrow:arrow-down-wide-narrow,ArrowDownZA:arrow-down-z-a,ArrowLeft:arrow-left,ArrowLeftFromLine:arrow-left-from-line,ArrowLeftRight:arrow-left-right,ArrowLeftToLine:arrow-left-to-line,ArrowRight:arrow-right,ArrowRightFromLine:arrow-right-from-line,ArrowRightLeft:arrow-right-left,ArrowRightToLine:arrow-right-to-line,ArrowUp:arrow-up,ArrowUp01:arrow-up-0-1,ArrowUp10:arrow-up-1-0,ArrowUpAZ:arrow-up-a-z,ArrowUpDown:arrow-up-down,ArrowUpFromDot:arrow-up-from-dot,ArrowUpFromLine:arrow-up-from-line,ArrowUpLeft:arrow-up-left,ArrowUpNarrowWide:arrow-up-narrow-wide,ArrowUpRight:arrow-up-right,ArrowUpToLine:arrow-up-to-line,ArrowUpWideNarrow:arrow-up-wide-narrow,ArrowUpZA:arrow-up-z-a,ArrowsUpFromLine:arrows-up-from-line,Asterisk:asterisk,Astroid:astroid,AtSign:at-sign,Atom:atom,AudioLines:audio-lines,AudioLinesOff:audio-lines-off,AudioLinesX:audio-lines-x,AudioWaveform:audio-waveform,Award:award,Axe:axe,Axis3d:axis-3d,Baby:baby,Backpack:backpack,Badge:badge,BadgeAlert:badge-alert,BadgeCent:badge-cent,BadgeCheck:badge-check,BadgeDollarSign:badge-dollar-sign,BadgeEuro:badge-euro,BadgeIndianRupee:badge-indian-rupee,BadgeInfo:badge-info,BadgeJapaneseYen:badge-japanese-yen,BadgeMinus:badge-minus,BadgePercent:badge-percent,BadgePlus:badge-plus,BadgePoundSterling:badge-pound-sterling,BadgeQuestionMark:badge-question-mark,BadgeRussianRuble:badge-russian-ruble,BadgeSwissFranc:badge-swiss-franc,BadgeTurkishLira:badge-turkish-lira,BadgeX:badge-x,BaggageClaim:baggage-claim,Balloon:balloon,Ban:ban,Banana:banana,Bandage:bandage,Banknote:banknote,BanknoteArrowDown:banknote-arrow-down,BanknoteArrowUp:banknote-arrow-up,BanknoteCheck:banknote-check,BanknoteX:banknote-x,Barcode:barcode,Barrel:barrel,Baseline:baseline,Bath:bath,Battery:battery,BatteryCharging:battery-charging,BatteryFull:battery-full,BatteryLow:battery-low,BatteryMedium:battery-medium,BatteryPlus:battery-plus,BatteryWarning:battery-warning,Beaker:beaker,Bean:bean,BeanOff:bean-off,Bed:bed,BedDouble:bed-double,BedSingle:bed-single,Beef:beef,BeefOff:beef-off,Beer:beer,BeerOff:beer-off,Bell:bell,BellCheck:bell-check,BellDot:bell-dot,BellElectric:bell-electric,BellMinus:bell-minus,BellOff:bell-off,BellPlus:bell-plus,BellRing:bell-ring,BetweenHorizontalEnd:between-horizontal-end,BetweenHorizontalStart:between-horizontal-start,BetweenVerticalEnd:between-vertical-end,BetweenVerticalStart:between-vertical-start,BicepsFlexed:biceps-flexed,Bike:bike,Binary:binary,Binoculars:binoculars,Biohazard:biohazard,Bird:bird,Birdhouse:birdhouse,Bitcoin:bitcoin,Blend:blend,Blender:blender,Blinds:blinds,Blocks:blocks,Bluetooth:bluetooth,BluetoothConnected:bluetooth-connected,BluetoothOff:bluetooth-off,BluetoothSearching:bluetooth-searching,Bold:bold,Bolt:bolt,Bomb:bomb,Bone:bone,BoneFracture:bone-fracture,Book:book,BookA:book-a,BookAlert:book-alert,BookAudio:book-audio,BookCheck:book-check,BookCopy:book-copy,BookDashed:book-dashed,BookDown:book-down,BookHeadphones:book-headphones,BookHeart:book-heart,BookImage:book-image,BookKey:book-key,BookLock:book-lock,BookMarked:book-marked,BookMinus:book-minus,BookOpen:book-open,BookOpenCheck:book-open-check,BookOpenText:book-open-text,BookPlus:book-plus,BookSearch:book-search,BookText:book-text,BookType:book-type,BookUp:book-up,BookUp2:book-up-2,BookUser:book-user,BookX:book-x,Bookmark:bookmark,BookmarkCheck:bookmark-check,BookmarkMinus:bookmark-minus,BookmarkOff:bookmark-off,BookmarkPlus:bookmark-plus,BookmarkX:bookmark-x,BoomBox:boom-box,Bot:bot,BotMessageSquare:bot-message-square,BotOff:bot-off,BottleWine:bottle-wine,BowArrow:bow-arrow,Box:box,Boxes:boxes,Braces:braces,Brackets:brackets,Brain:brain,BrainCircuit:brain-circuit,BrainCog:brain-cog,BrickWall:brick-wall,BrickWallFire:brick-wall-fire,BrickWallShield:brick-wall-shield,Bridge:bridge,Briefcase:briefcase,BriefcaseBusiness:briefcase-business,BriefcaseConveyorBelt:briefcase-conveyor-belt,BriefcaseMedical:briefcase-medical,BringToFront:bring-to-front,Broccoli:broccoli,Broom:broom,BroomSparkles:broom-sparkles,Brush:brush,BrushCleaning:brush-cleaning,Bubbles:bubbles,Bug:bug,BugOff:bug-off,BugPlay:bug-play,Building:building,Building2:building-2,Bus:bus,BusFront:bus-front,Cable:cable,CableCar:cable-car,Cake:cake,CakeSlice:cake-slice,Calculator:calculator,Calendar:calendar,Calendar1:calendar-1,CalendarArrowDown:calendar-arrow-down,CalendarArrowUp:calendar-arrow-up,CalendarCheck:calendar-check,CalendarCheck2:calendar-check-2,CalendarClock:calendar-clock,CalendarCog:calendar-cog,CalendarDays:calendar-days,CalendarFold:calendar-fold,CalendarHeart:calendar-heart,CalendarMinus:calendar-minus,CalendarMinus2:calendar-minus-2,CalendarOff:calendar-off,CalendarPlus:calendar-plus,CalendarPlus2:calendar-plus-2,CalendarRange:calendar-range,CalendarSearch:calendar-search,CalendarSync:calendar-sync,CalendarX:calendar-x,CalendarX2:calendar-x-2,Calendars:calendars,Camera:camera,CameraOff:camera-off,Can:can,CanSoda:can-soda,Candy:candy,CandyCane:candy-cane,CandyOff:candy-off,Cannabis:cannabis,CannabisOff:cannabis-off,Captions:captions,CaptionsOff:captions-off,Car:car,CarBattery:car-battery,CarFront:car-front,CarTaxiFront:car-taxi-front,Caravan:caravan,CardSim:card-sim,Carrot:carrot,Carton:carton,CartonOff:carton-off,CaseLower:case-lower,CaseSensitive:case-sensitive,CaseUpper:case-upper,CassetteTape:cassette-tape,Cast:cast,Castle:castle,Cat:cat,Cctv:cctv,CctvOff:cctv-off,ChartArea:chart-area,ChartBar:chart-bar,ChartBarBig:chart-bar-big,ChartBarDecreasing:chart-bar-decreasing,ChartBarIncreasing:chart-bar-increasing,ChartBarStacked:chart-bar-stacked,ChartCandlestick:chart-candlestick,ChartColumn:chart-column,ChartColumnBig:chart-column-big,ChartColumnDecreasing:chart-column-decreasing,ChartColumnIncreasing:chart-column-increasing,ChartColumnStacked:chart-column-stacked,ChartGantt:chart-gantt,ChartLine:chart-line,ChartNetwork:chart-network,ChartNoAxesColumn:chart-no-axes-column,ChartNoAxesColumnDecreasing:chart-no-axes-column-decreasing,ChartNoAxesColumnIncreasing:chart-no-axes-column-increasing,ChartNoAxesCombined:chart-no-axes-combined,ChartNoAxesGantt:chart-no-axes-gantt,ChartPie:chart-pie,ChartScatter:chart-scatter,ChartSpline:chart-spline,Check:check,CheckCheck:check-check,CheckLine:check-line,ChefHat:chef-hat,Cherry:cherry,ChessBishop:chess-bishop,ChessKing:chess-king,ChessKnight:chess-knight,ChessPawn:chess-pawn,ChessQueen:chess-queen,ChessRook:chess-rook,ChevronDown:chevron-down,ChevronFirst:chevron-first,ChevronLast:chevron-last,ChevronLeft:chevron-left,ChevronRight:chevron-right,ChevronUp:chevron-up,ChevronsDown:chevrons-down,ChevronsDownUp:chevrons-down-up,ChevronsLeft:chevrons-left,ChevronsLeftRight:chevrons-left-right,ChevronsLeftRightEllipsis:chevrons-left-right-ellipsis,ChevronsRight:chevrons-right,ChevronsRightLeft:chevrons-right-left,ChevronsUp:chevrons-up,ChevronsUpDown:chevrons-up-down,Church:church,Cigarette:cigarette,CigaretteOff:cigarette-off,Circle:circle,CircleAlert:circle-alert,CircleArrowDown:circle-arrow-down,CircleArrowLeft:circle-arrow-left,CircleArrowOutDownLeft:circle-arrow-out-down-left,CircleArrowOutDownRight:circle-arrow-out-down-right,CircleArrowOutUpLeft:circle-arrow-out-up-left,CircleArrowOutUpRight:circle-arrow-out-up-right,CircleArrowRight:circle-arrow-right,CircleArrowUp:circle-arrow-up,CircleCheck:circle-check,CircleCheckBig:circle-check-big,CircleChevronDown:circle-chevron-down,CircleChevronLeft:circle-chevron-left,CircleChevronRight:circle-chevron-right,CircleChevronUp:circle-chevron-up,CircleDashed:circle-dashed,CircleDashedCheck:circle-dashed-check,CircleDivide:circle-divide,CircleDollarSign:circle-dollar-sign,CircleDot:circle-dot,CircleDotDashed:circle-dot-dashed,CircleEllipsis:circle-ellipsis,CircleEqual:circle-equal,CircleEuro:circle-euro,CircleFadingArrowUp:circle-fading-arrow-up,CircleFadingPlus:circle-fading-plus,CircleGauge:circle-gauge,CircleMinus:circle-minus,CircleOff:circle-off,CircleParking:circle-parking,CircleParkingOff:circle-parking-off,CirclePause:circle-pause,CirclePercent:circle-percent,CirclePile:circle-pile,CirclePlay:circle-play,CirclePlus:circle-plus,CirclePoundSterling:circle-pound-sterling,CirclePower:circle-power,CircleQuestionMark:circle-question-mark,CircleSlash:circle-slash,CircleSlash2:circle-slash-2,CircleSmall:circle-small,CircleStar:circle-star,CircleStop:circle-stop,CircleUser:circle-user,CircleUserRound:circle-user-round,CircleX:circle-x,CircuitBoard:circuit-board,Citrus:citrus,Clapperboard:clapperboard,Clipboard:clipboard,ClipboardCheck:clipboard-check,ClipboardClock:clipboard-clock,ClipboardCopy:clipboard-copy,ClipboardList:clipboard-list,ClipboardMinus:clipboard-minus,ClipboardPaste:clipboard-paste,ClipboardPen:clipboard-pen,ClipboardPenLine:clipboard-pen-line,ClipboardPlus:clipboard-plus,ClipboardType:clipboard-type,ClipboardX:clipboard-x,Clock:clock,Clock1:clock-1,Clock10:clock-10,Clock11:clock-11,Clock12:clock-12,Clock2:clock-2,Clock3:clock-3,Clock4:clock-4,Clock5:clock-5,Clock6:clock-6,Clock7:clock-7,Clock8:clock-8,Clock9:clock-9,ClockAlert:clock-alert,ClockArrowDown:clock-arrow-down,ClockArrowLeft:clock-arrow-left,ClockArrowRight:clock-arrow-right,ClockArrowUp:clock-arrow-up,ClockCheck:clock-check,ClockFading:clock-fading,ClockPlus:clock-plus,ClosedCaption:closed-caption,Cloud:cloud,CloudAlert:cloud-alert,CloudBackup:cloud-backup,CloudCheck:cloud-check,CloudCog:cloud-cog,CloudDownload:cloud-download,CloudDrizzle:cloud-drizzle,CloudFog:cloud-fog,CloudHail:cloud-hail,CloudLightning:cloud-lightning,CloudMoon:cloud-moon,CloudMoonRain:cloud-moon-rain,CloudOff:cloud-off,CloudRain:cloud-rain,CloudRainWind:cloud-rain-wind,CloudSnow:cloud-snow,CloudSun:cloud-sun,CloudSunRain:cloud-sun-rain,CloudSync:cloud-sync,CloudUpload:cloud-upload,Cloudy:cloudy,Clover:clover,Club:club,Code:code,CodeXml:code-xml,Coffee:coffee,Cog:cog,Coins:coins,Columns2:columns-2,Columns3:columns-3,Columns3Cog:columns-3-cog,Columns4:columns-4,Combine:combine,Command:command,Compass:compass,Component:component,Computer:computer,ConciergeBell:concierge-bell,Cone:cone,Construction:construction,Contact:contact,ContactRound:contact-round,Container:container,Contrast:contrast,Cookie:cookie,CookingPot:cooking-pot,Copy:copy,CopyCheck:copy-check,CopyMinus:copy-minus,CopyPlus:copy-plus,CopySlash:copy-slash,CopyX:copy-x,Copyleft:copyleft,Copyright:copyright,CornerDownLeft:corner-down-left,CornerDownRight:corner-down-right,CornerLeftDown:corner-left-down,CornerLeftUp:corner-left-up,CornerRightDown:corner-right-down,CornerRightUp:corner-right-up,CornerUpLeft:corner-up-left,CornerUpRight:corner-up-right,Cpu:cpu,CreativeCommons:creative-commons,CreditCard:credit-card,CreditCardCheck:credit-card-check,CreditCardMinus:credit-card-minus,CreditCardPlus:credit-card-plus,CreditCardReader:credit-card-reader,CreditCardX:credit-card-x,Croissant:croissant,Crop:crop,Cross:cross,Crosshair:crosshair,Crown:crown,Cuboid:cuboid,CupSoda:cup-soda,Currency:currency,Cylinder:cylinder,Dam:dam,Database:database,DatabaseArrowDown:database-arrow-down,DatabaseArrowUp:database-arrow-up,DatabaseBackup:database-backup,DatabaseCheck:database-check,DatabaseMinus:database-minus,DatabasePlus:database-plus,DatabaseSearch:database-search,DatabaseX:database-x,DatabaseZap:database-zap,DecimalsArrowLeft:decimals-arrow-left,DecimalsArrowRight:decimals-arrow-right,Delete:delete,Dessert:dessert,Diameter:diameter,Diamond:diamond,DiamondMinus:diamond-minus,DiamondPercent:diamond-percent,DiamondPlus:diamond-plus,Dice1:dice-1,Dice2:dice-2,Dice3:dice-3,Dice4:dice-4,Dice5:dice-5,Dice6:dice-6,Dices:dices,Diff:diff,Disc:disc,Disc2:disc-2,Disc3:disc-3,DiscAlbum:disc-album,Divide:divide,Dna:dna,DnaOff:dna-off,Dock:dock,Dog:dog,DollarSign:dollar-sign,Dome:dome,Donut:donut,DoorClosed:door-closed,DoorClosedLocked:door-closed-locked,DoorOpen:door-open,DoorStairwell:door-stairwell,Dot:dot,Download:download,DraftingCompass:drafting-compass,Drama:drama,Drill:drill,Drone:drone,Droplet:droplet,DropletOff:droplet-off,Droplets:droplets,Drum:drum,Drumstick:drumstick,Dumbbell:dumbbell,Ear:ear,EarOff:ear-off,Earth:earth,EarthLock:earth-lock,Eclipse:eclipse,Egg:egg,EggFried:egg-fried,EggOff:egg-off,Eject:eject,Ellipse:ellipse,Ellipsis:ellipsis,EllipsisVertical:ellipsis-vertical,Engine:engine,Equal:equal,EqualApproximately:equal-approximately,EqualApproximatelyNot:equal-approximately-not,EqualNot:equal-not,Eraser:eraser,EthernetPort:ethernet-port,Euro:euro,EvCharger:ev-charger,Expand:expand,ExternalLink:external-link,Eye:eye,EyeClosed:eye-closed,EyeDashed:eye-dashed,EyeOff:eye-off,FaceAngry:face-angry,FaceExpressionless:face-expressionless,FaceGrinning:face-grinning,FaceNeutral:face-neutral,FaceSlightlyFrowning:face-slightly-frowning,FaceSlightlySmiling:face-slightly-smiling,FaceSlightlySmilingPlus:face-slightly-smiling-plus,Factory:factory,Fan:fan,FastForward:fast-forward,Feather:feather,Fence:fence,FerrisWheel:ferris-wheel,File:file,FileArchive:file-archive,FileAxis3d:file-axis-3d,FileBadge:file-badge,FileBox:file-box,FileBraces:file-braces,FileBracesCorner:file-braces-corner,FileChartColumn:file-chart-column,FileChartColumnIncreasing:file-chart-column-increasing,FileChartLine:file-chart-line,FileChartPie:file-chart-pie,FileCheck:file-check,FileCheckCorner:file-check-corner,FileClock:file-clock,FileCode:file-code,FileCodeCorner:file-code-corner,FileCog:file-cog,FileDiff:file-diff,FileDigit:file-digit,FileDown:file-down,FileExclamationPoint:file-exclamation-point,FileHeadphone:file-headphone,FileHeart:file-heart,FileImage:file-image,FileInput:file-input,FileKey:file-key,FileLock:file-lock,FileMinus:file-minus,FileMinusCorner:file-minus-corner,FileMusic:file-music,FileOutput:file-output,FilePen:file-pen,FilePenLine:file-pen-line,FilePlay:file-play,FilePlus:file-plus,FilePlusCorner:file-plus-corner,FileQuestionMark:file-question-mark,FileScan:file-scan,FileSearch:file-search,FileSearchCorner:file-search-corner,FileSignal:file-signal,FileSliders:file-sliders,FileSpreadsheet:file-spreadsheet,FileStack:file-stack,FileSymlink:file-symlink,FileTerminal:file-terminal,FileText:file-text,FileType:file-type,FileTypeCorner:file-type-corner,FileUp:file-up,FileUser:file-user,FileVideoCamera:file-video-camera,FileVolume:file-volume,FileX:file-x,FileXCorner:file-x-corner,Files:files,Film:film,FingerprintPattern:fingerprint-pattern,FireExtinguisher:fire-extinguisher,Fish:fish,FishOff:fish-off,FishSymbol:fish-symbol,FishingHook:fishing-hook,FishingRod:fishing-rod,Flag:flag,FlagOff:flag-off,FlagTriangleLeft:flag-triangle-left,FlagTriangleRight:flag-triangle-right,Flame:flame,FlameKindling:flame-kindling,Flashlight:flashlight,FlashlightOff:flashlight-off,FlaskConical:flask-conical,FlaskConicalOff:flask-conical-off,FlaskRound:flask-round,FlipHorizontal2:flip-horizontal-2,FlipVertical2:flip-vertical-2,Flower:flower,Flower2:flower-2,Focus:focus,FoldHorizontal:fold-horizontal,FoldVertical:fold-vertical,Folder:folder,FolderArchive:folder-archive,FolderBookmark:folder-bookmark,FolderCheck:folder-check,FolderClock:folder-clock,FolderClosed:folder-closed,FolderCode:folder-code,FolderCog:folder-cog,FolderDot:folder-dot,FolderDown:folder-down,FolderGit:folder-git,FolderGit2:folder-git-2,FolderHeart:folder-heart,FolderInput:folder-input,FolderKanban:folder-kanban,FolderKey:folder-key,FolderLock:folder-lock,FolderMinus:folder-minus,FolderOpen:folder-open,FolderOpenDot:folder-open-dot,FolderOutput:folder-output,FolderPen:folder-pen,FolderPlus:folder-plus,FolderRoot:folder-root,FolderSearch:folder-search,FolderSearch2:folder-search-2,FolderSymlink:folder-symlink,FolderSync:folder-sync,FolderTree:folder-tree,FolderUp:folder-up,FolderX:folder-x,Folders:folders,Footprints:footprints,Forklift:forklift,Form:form,Forward:forward,Frame:frame,Fuel:fuel,Fullscreen:fullscreen,Funnel:funnel,FunnelPlus:funnel-plus,FunnelX:funnel-x,Galaxy:galaxy,GalleryHorizontal:gallery-horizontal,GalleryHorizontalEnd:gallery-horizontal-end,GalleryThumbnails:gallery-thumbnails,GalleryVertical:gallery-vertical,GalleryVerticalEnd:gallery-vertical-end,Gamepad:gamepad,Gamepad2:gamepad-2,GamepadDirectional:gamepad-directional,GapHorizontal:gap-horizontal,GapVertical:gap-vertical,Gauge:gauge,Gavel:gavel,Gem:gem,GeorgianLari:georgian-lari,Germ:germ,GermOff:germ-off,Ghost:ghost,Gift:gift,GitBranch:git-branch,GitBranchMinus:git-branch-minus,GitBranchPlus:git-branch-plus,GitCommitHorizontal:git-commit-horizontal,GitCommitVertical:git-commit-vertical,GitCompare:git-compare,GitCompareArrows:git-compare-arrows,GitFork:git-fork,GitGraph:git-graph,GitMerge:git-merge,GitMergeConflict:git-merge-conflict,GitPullRequest:git-pull-request,GitPullRequestArrow:git-pull-request-arrow,GitPullRequestClosed:git-pull-request-closed,GitPullRequestCreate:git-pull-request-create,GitPullRequestCreateArrow:git-pull-request-create-arrow,GitPullRequestDraft:git-pull-request-draft,GlassWater:glass-water,Glasses:glasses,Globe:globe,GlobeCheck:globe-check,GlobeLock:globe-lock,GlobeOff:globe-off,GlobeX:globe-x,Goal:goal,Gpu:gpu,GraduationCap:graduation-cap,Grape:grape,Grid2x2:grid-2x2,Grid2x2Check:grid-2x2-check,Grid2x2Plus:grid-2x2-plus,Grid2x2X:grid-2x2-x,Grid3x2:grid-3x2,Grid3x3:grid-3x3,Grip:grip,GripHorizontal:grip-horizontal,GripVertical:grip-vertical,Group:group,Guitar:guitar,Ham:ham,Hamburger:hamburger,Hammer:hammer,Hand:hand,HandCoins:hand-coins,HandFist:hand-fist,HandGrab:hand-grab,HandHeart:hand-heart,HandHelping:hand-helping,HandMetal:hand-metal,HandPlatter:hand-platter,Handbag:handbag,Handshake:handshake,HardDrive:hard-drive,HardDriveDownload:hard-drive-download,HardDriveUpload:hard-drive-upload,HardHat:hard-hat,Hash:hash,HatGlasses:hat-glasses,Haze:haze,Hd:hd,HdmiPort:hdmi-port,Heading:heading,Heading1:heading-1,Heading2:heading-2,Heading3:heading-3,Heading4:heading-4,Heading5:heading-5,Heading6:heading-6,HeadphoneOff:headphone-off,Headphones:headphones,Headset:headset,Heart:heart,HeartCrack:heart-crack,HeartHandshake:heart-handshake,HeartMinus:heart-minus,HeartOff:heart-off,HeartPlus:heart-plus,HeartPulse:heart-pulse,HeartX:heart-x,Heater:heater,Helicopter:helicopter,Hexagon:hexagon,Highlighter:highlighter,Hop:hop,HopOff:hop-off,Hospital:hospital,Hotel:hotel,Hourglass:hourglass,House:house,HouseHeart:house-heart,HousePlug:house-plug,HousePlus:house-plus,HouseWifi:house-wifi,IceCreamBowl:ice-cream-bowl,IceCreamCone:ice-cream-cone,IdCard:id-card,IdCardLanyard:id-card-lanyard,Image:image,ImageDown:image-down,ImageMinus:image-minus,ImageOff:image-off,ImagePlay:image-play,ImagePlus:image-plus,ImageUp:image-up,ImageUpscale:image-upscale,Images:images,Import:import,Inbox:inbox,IndianRupee:indian-rupee,Infinity:infinity,Info:info,InspectionPanel:inspection-panel,Italic:italic,IterationCcw:iteration-ccw,IterationCw:iteration-cw,JapaneseYen:japanese-yen,Joystick:joystick,Kanban:kanban,Kayak:kayak,Key:key,KeyRound:key-round,KeySquare:key-square,Keyboard:keyboard,KeyboardMusic:keyboard-music,KeyboardOff:keyboard-off,Lamp:lamp,LampCeiling:lamp-ceiling,LampDesk:lamp-desk,LampFloor:lamp-floor,LampWallDown:lamp-wall-down,LampWallUp:lamp-wall-up,LandPlot:land-plot,Landmark:landmark,Languages:languages,Laptop:laptop,LaptopMinimal:laptop-minimal,LaptopMinimalCheck:laptop-minimal-check,Lasso:lasso,LassoSelect:lasso-select,LayerArrowDown:layer-arrow-down,LayerArrowUp:layer-arrow-up,Layers:layers,Layers2:layers-2,LayersArrowDown:layers-arrow-down,LayersArrowUp:layers-arrow-up,LayersMinus:layers-minus,LayersPlus:layers-plus,LayoutDashboard:layout-dashboard,LayoutFreeform:layout-freeform,LayoutGrid:layout-grid,LayoutList:layout-list,LayoutPanelLeft:layout-panel-left,LayoutPanelTop:layout-panel-top,LayoutTemplate:layout-template,Leaf:leaf,LeafyGreen:leafy-green,Lectern:lectern,LensConcave:lens-concave,LensConvex:lens-convex,Library:library,LibraryBig:library-big,LifeBuoy:life-buoy,Ligature:ligature,Lightbulb:lightbulb,LightbulbOff:lightbulb-off,Lighthouse:lighthouse,LineDotRightHorizontal:line-dot-right-horizontal,LineSquiggle:line-squiggle,LineStyle:line-style,Link:link,Link2:link-2,Link2Off:link-2-off,List:list,ListCheck:list-check,ListChecks:list-checks,ListChevronsDownUp:list-chevrons-down-up,ListChevronsUpDown:list-chevrons-up-down,ListClock:list-clock,ListCollapse:list-collapse,ListEnd:list-end,ListFilter:list-filter,ListFilterPlus:list-filter-plus,ListIndentDecrease:list-indent-decrease,ListIndentIncrease:list-indent-increase,ListMinus:list-minus,ListMusic:list-music,ListOrdered:list-ordered,ListPlus:list-plus,ListRestart:list-restart,ListSortAscending:list-sort-ascending,ListSortDescending:list-sort-descending,ListStart:list-start,ListTodo:list-todo,ListTree:list-tree,ListVideo:list-video,ListX:list-x,Loader:loader,LoaderCircle:loader-circle,LoaderPinwheel:loader-pinwheel,Locate:locate,LocateFixed:locate-fixed,LocateOff:locate-off,Lock:lock,LockKeyhole:lock-keyhole,LockKeyholeOpen:lock-keyhole-open,LockOpen:lock-open,LogIn:log-in,LogOut:log-out,Logs:logs,Lollipop:lollipop,Luggage:luggage,Magnet:magnet,Mail:mail,MailBadge:mail-badge,MailCheck:mail-check,MailClock:mail-clock,MailMinus:mail-minus,MailOpen:mail-open,MailPen:mail-pen,MailPlus:mail-plus,MailQuestionMark:mail-question-mark,MailSearch:mail-search,MailWarning:mail-warning,MailX:mail-x,Mailbox:mailbox,Mails:mails,Map:map,MapMinus:map-minus,MapPin:map-pin,MapPinCheck:map-pin-check,MapPinCheckInside:map-pin-check-inside,MapPinHouse:map-pin-house,MapPinMinus:map-pin-minus,MapPinMinusInside:map-pin-minus-inside,MapPinOff:map-pin-off,MapPinPen:map-pin-pen,MapPinPlus:map-pin-plus,MapPinPlusInside:map-pin-plus-inside,MapPinSearch:map-pin-search,MapPinX:map-pin-x,MapPinXInside:map-pin-x-inside,MapPinned:map-pinned,MapPlus:map-plus,Mars:mars,MarsStroke:mars-stroke,Martini:martini,Maximize:maximize,Maximize2:maximize-2,Medal:medal,Megaphone:megaphone,MegaphoneOff:megaphone-off,MemoryStick:memory-stick,Menu:menu,Merge:merge,MessageCircle:message-circle,MessageCircleCheck:message-circle-check,MessageCircleCode:message-circle-code,MessageCircleDashed:message-circle-dashed,MessageCircleDashedCheck:message-circle-dashed-check,MessageCircleHeart:message-circle-heart,MessageCircleMore:message-circle-more,MessageCircleOff:message-circle-off,MessageCirclePlus:message-circle-plus,MessageCircleQuestionMark:message-circle-question-mark,MessageCircleReply:message-circle-reply,MessageCircleWarning:message-circle-warning,MessageCircleX:message-circle-x,MessageSquare:message-square,MessageSquareCheck:message-square-check,MessageSquareCode:message-square-code,MessageSquareDashed:message-square-dashed,MessageSquareDiff:message-square-diff,MessageSquareDot:message-square-dot,MessageSquareHeart:message-square-heart,MessageSquareLock:message-square-lock,MessageSquareMore:message-square-more,MessageSquareOff:message-square-off,MessageSquarePlus:message-square-plus,MessageSquareQuote:message-square-quote,MessageSquareReply:message-square-reply,MessageSquareShare:message-square-share,MessageSquareText:message-square-text,MessageSquareWarning:message-square-warning,MessageSquareX:message-square-x,MessagesSquare:messages-square,Metronome:metronome,Mic:mic,MicAudioLines:mic-audio-lines,MicOff:mic-off,MicSignal:mic-signal,MicVocal:mic-vocal,Microchip:microchip,Microscope:microscope,Microwave:microwave,MidiPort:midi-port,Milestone:milestone,Milk:milk,MilkOff:milk-off,Minimize:minimize,Minimize2:minimize-2,Minus:minus,MirrorRectangular:mirror-rectangular,MirrorRound:mirror-round,Monitor:monitor,MonitorCheck:monitor-check,MonitorCloud:monitor-cloud,MonitorCog:monitor-cog,MonitorDot:monitor-dot,MonitorDown:monitor-down,MonitorOff:monitor-off,MonitorPause:monitor-pause,MonitorPlay:monitor-play,MonitorSmartphone:monitor-smartphone,MonitorSpeaker:monitor-speaker,MonitorStop:monitor-stop,MonitorUp:monitor-up,MonitorX:monitor-x,Moon:moon,MoonStar:moon-star,Mop:mop,MopSparkles:mop-sparkles,Mosque:mosque,Motorbike:motorbike,Mountain:mountain,MountainSnow:mountain-snow,Mouse:mouse,MouseLeft:mouse-left,MouseOff:mouse-off,MousePointer:mouse-pointer,MousePointer2:mouse-pointer-2,MousePointer2Off:mouse-pointer-2-off,MousePointerBan:mouse-pointer-ban,MousePointerClick:mouse-pointer-click,MouseRight:mouse-right,Move:move,Move3d:move-3d,MoveDiagonal:move-diagonal,MoveDiagonal2:move-diagonal-2,MoveDown:move-down,MoveDownLeft:move-down-left,MoveDownRight:move-down-right,MoveHorizontal:move-horizontal,MoveLeft:move-left,MoveRight:move-right,MoveUp:move-up,MoveUpLeft:move-up-left,MoveUpRight:move-up-right,MoveVertical:move-vertical,Music:music,Music2:music-2,Music3:music-3,Music4:music-4,Navigation:navigation,Navigation2:navigation-2,Navigation2Off:navigation-2-off,NavigationOff:navigation-off,Network:network,Newspaper:newspaper,Nfc:nfc,NonBinary:non-binary,Notebook:notebook,NotebookPen:notebook-pen,NotebookTabs:notebook-tabs,NotebookText:notebook-text,NotepadText:notepad-text,NotepadTextDashed:notepad-text-dashed,Nut:nut,NutOff:nut-off,Octagon:octagon,OctagonAlert:octagon-alert,OctagonMinus:octagon-minus,OctagonPause:octagon-pause,OctagonX:octagon-x,Omega:omega,Option:option,Orbit:orbit,Origami:origami,Package:package,Package2:package-2,PackageCheck:package-check,PackageMinus:package-minus,PackageOpen:package-open,PackagePlus:package-plus,PackageSearch:package-search,PackageX:package-x,PaintBucket:paint-bucket,PaintRoller:paint-roller,Paintbrush:paintbrush,PaintbrushVertical:paintbrush-vertical,Palette:palette,Panda:panda,PanelBottom:panel-bottom,PanelBottomClose:panel-bottom-close,PanelBottomDashed:panel-bottom-dashed,PanelBottomOpen:panel-bottom-open,PanelLeft:panel-left,PanelLeftClose:panel-left-close,PanelLeftDashed:panel-left-dashed,PanelLeftOpen:panel-left-open,PanelLeftRightDashed:panel-left-right-dashed,PanelRight:panel-right,PanelRightClose:panel-right-close,PanelRightDashed:panel-right-dashed,PanelRightOpen:panel-right-open,PanelTop:panel-top,PanelTopBottomDashed:panel-top-bottom-dashed,PanelTopClose:panel-top-close,PanelTopDashed:panel-top-dashed,PanelTopOpen:panel-top-open,PanelsLeftBottom:panels-left-bottom,PanelsRightBottom:panels-right-bottom,PanelsTopLeft:panels-top-left,PaperBag:paper-bag,Paperclip:paperclip,Parasol:parasol,Parentheses:parentheses,ParkingMeter:parking-meter,PartyPopper:party-popper,Pause:pause,PawPrint:paw-print,PcCase:pc-case,Pen:pen,PenLine:pen-line,PenOff:pen-off,PenTool:pen-tool,Pencil:pencil,PencilLine:pencil-line,PencilOff:pencil-off,PencilRuler:pencil-ruler,PencilSparkles:pencil-sparkles,Pentagon:pentagon,Percent:percent,PersonStanding:person-standing,Phi:phi,PhilippinePeso:philippine-peso,Phone:phone,PhoneCall:phone-call,PhoneForwarded:phone-forwarded,PhoneIncoming:phone-incoming,PhoneMissed:phone-missed,PhoneOff:phone-off,PhoneOutgoing:phone-outgoing,Pi:pi,Piano:piano,Pickaxe:pickaxe,PictureInPicture:picture-in-picture,PictureInPicture2:picture-in-picture-2,PiggyBank:piggy-bank,Pilcrow:pilcrow,PilcrowLeft:pilcrow-left,PilcrowRight:pilcrow-right,Pill:pill,PillBottle:pill-bottle,Pin:pin,PinOff:pin-off,Pipette:pipette,Pizza:pizza,Plane:plane,PlaneLanding:plane-landing,PlaneTakeoff:plane-takeoff,Play:play,PlayOff:play-off,PlayingCard:playing-card,PlayingCards:playing-cards,PlayingCardsFan:playing-cards-fan,Plug:plug,Plug2:plug-2,PlugZap:plug-zap,Plus:plus,PocketKnife:pocket-knife,Podium:podium,Pointer:pointer,PointerOff:pointer-off,Popcorn:popcorn,Popsicle:popsicle,PoundSterling:pound-sterling,Power:power,PowerOff:power-off,Presentation:presentation,Printer:printer,PrinterCheck:printer-check,PrinterX:printer-x,Projector:projector,Proportions:proportions,Puzzle:puzzle,Pyramid:pyramid,QrCode:qr-code,Quote:quote,Rabbit:rabbit,Radar:radar,Radiation:radiation,Radical:radical,Radio:radio,RadioOff:radio-off,RadioReceiver:radio-receiver,RadioTower:radio-tower,Radius:radius,Rainbow:rainbow,Rat:rat,Ratio:ratio,Receipt:receipt,ReceiptCent:receipt-cent,ReceiptEuro:receipt-euro,ReceiptIndianRupee:receipt-indian-rupee,ReceiptJapaneseYen:receipt-japanese-yen,ReceiptPoundSterling:receipt-pound-sterling,ReceiptRussianRuble:receipt-russian-ruble,ReceiptSwissFranc:receipt-swiss-franc,ReceiptText:receipt-text,ReceiptTurkishLira:receipt-turkish-lira,RectangleCircle:rectangle-circle,RectangleEllipsis:rectangle-ellipsis,RectangleGoggles:rectangle-goggles,RectangleHorizontal:rectangle-horizontal,RectangleVertical:rectangle-vertical,Recycle:recycle,Redo:redo,Redo2:redo-2,RedoDot:redo-dot,RefreshCcw:refresh-ccw,RefreshCcwDot:refresh-ccw-dot,RefreshCw:refresh-cw,RefreshCwOff:refresh-cw-off,Refrigerator:refrigerator,Regex:regex,RemoveFormatting:remove-formatting,Repeat:repeat,Repeat1:repeat-1,Repeat2:repeat-2,RepeatOff:repeat-off,Replace:replace,ReplaceAll:replace-all,Reply:reply,ReplyAll:reply-all,Rewind:rewind,Ribbon:ribbon,Road:road,RobotArm:robot-arm,RobotVacuum:robot-vacuum,Rocket:rocket,RockingChair:rocking-chair,RollerCoaster:roller-coaster,Rose:rose,Rotate3d:rotate-3d,RotateCcw:rotate-ccw,RotateCcwClock:rotate-ccw-clock,RotateCcwKey:rotate-ccw-key,RotateCcwSquare:rotate-ccw-square,RotateCw:rotate-cw,RotateCwFadingClock:rotate-cw-fading-clock,RotateCwSquare:rotate-cw-square,Route:route,RouteOff:route-off,Router:router,Rows2:rows-2,Rows3:rows-3,Rows4:rows-4,Rss:rss,Ruler:ruler,RulerDimensionLine:ruler-dimension-line,RussianRuble:russian-ruble,Sailboat:sailboat,Salad:salad,Sandwich:sandwich,Satellite:satellite,SatelliteDish:satellite-dish,SaudiRiyal:saudi-riyal,Save:save,SaveAll:save-all,SaveCheck:save-check,SaveOff:save-off,SavePen:save-pen,SavePlus:save-plus,Scale:scale,Scale3d:scale-3d,Scaling:scaling,Scan:scan,ScanBarcode:scan-barcode,ScanBox:scan-box,ScanEye:scan-eye,ScanFace:scan-face,ScanHeart:scan-heart,ScanLine:scan-line,ScanQrCode:scan-qr-code,ScanSearch:scan-search,ScanSquare:scan-square,ScanText:scan-text,School:school,Scissors:scissors,ScissorsLineDashed:scissors-line-dashed,Scooter:scooter,ScreenShare:screen-share,ScreenShareOff:screen-share-off,Scroll:scroll,ScrollText:scroll-text,Search:search,SearchAlert:search-alert,SearchCheck:search-check,SearchCode:search-code,SearchSlash:search-slash,SearchX:search-x,Section:section,Send:send,SendHorizontal:send-horizontal,SendToBack:send-to-back,SeparatorHorizontal:separator-horizontal,SeparatorVertical:separator-vertical,Server:server,ServerCog:server-cog,ServerCrash:server-crash,ServerOff:server-off,ServerPlus:server-plus,Settings:settings,Settings2:settings-2,Shapes:shapes,Share:share,Share2:share-2,Sheet:sheet,Shell:shell,ShelvingUnit:shelving-unit,Shield:shield,ShieldAlert:shield-alert,ShieldBan:shield-ban,ShieldCheck:shield-check,ShieldCog:shield-cog,ShieldCogCorner:shield-cog-corner,ShieldEllipsis:shield-ellipsis,ShieldHalf:shield-half,ShieldKeyhole:shield-keyhole,ShieldLock:shield-lock,ShieldMinus:shield-minus,ShieldOff:shield-off,ShieldPlus:shield-plus,ShieldQuestionMark:shield-question-mark,ShieldUser:shield-user,ShieldX:shield-x,Ship:ship,ShipCargo:ship-cargo,ShipWheel:ship-wheel,Shirt:shirt,ShoppingBag:shopping-bag,ShoppingBasket:shopping-basket,ShoppingCart:shopping-cart,ShoppingCartMinus:shopping-cart-minus,ShoppingCartPlus:shopping-cart-plus,Shovel:shovel,ShowerHead:shower-head,Shredder:shredder,Shrimp:shrimp,ShrimpOff:shrimp-off,Shrink:shrink,Shrub:shrub,Shuffle:shuffle,Sigma:sigma,Signal:signal,SignalHigh:signal-high,SignalLow:signal-low,SignalMedium:signal-medium,SignalZero:signal-zero,Signature:signature,Signpost:signpost,SignpostBig:signpost-big,Siren:siren,SkipBack:skip-back,SkipForward:skip-forward,Skull:skull,Slash:slash,Slice:slice,SlidersHorizontal:sliders-horizontal,SlidersVertical:sliders-vertical,Smartphone:smartphone,SmartphoneCharging:smartphone-charging,SmartphoneNfc:smartphone-nfc,Snail:snail,Snowflake:snowflake,SoapDispenserDroplet:soap-dispenser-droplet,Sofa:sofa,SolarPanel:solar-panel,Soup:soup,Space:space,Spade:spade,Sparkle:sparkle,Sparkles:sparkles,Speaker:speaker,Speech:speech,SpellCheck:spell-check,SpellCheck2:spell-check-2,Spline:spline,SplinePointer:spline-pointer,Split:split,Spool:spool,SportShoe:sport-shoe,Spotlight:spotlight,SprayCan:spray-can,Sprout:sprout,Square:square,SquareActivity:square-activity,SquareArrowDown:square-arrow-down,SquareArrowDownLeft:square-arrow-down-left,SquareArrowDownRight:square-arrow-down-right,SquareArrowLeft:square-arrow-left,SquareArrowOutDownLeft:square-arrow-out-down-left,SquareArrowOutDownRight:square-arrow-out-down-right,SquareArrowOutUpLeft:square-arrow-out-up-left,SquareArrowOutUpRight:square-arrow-out-up-right,SquareArrowRight:square-arrow-right,SquareArrowRightEnter:square-arrow-right-enter,SquareArrowRightExit:square-arrow-right-exit,SquareArrowUp:square-arrow-up,SquareArrowUpLeft:square-arrow-up-left,SquareArrowUpRight:square-arrow-up-right,SquareAsterisk:square-asterisk,SquareBottomDashedScissors:square-bottom-dashed-scissors,SquareCenterlineDashedHorizontal:square-centerline-dashed-horizontal,SquareCenterlineDashedVertical:square-centerline-dashed-vertical,SquareChartGantt:square-chart-gantt,SquareCheck:square-check,SquareCheckBig:square-check-big,SquareChevronDown:square-chevron-down,SquareChevronLeft:square-chevron-left,SquareChevronRight:square-chevron-right,SquareChevronUp:square-chevron-up,SquareCode:square-code,SquareDashed:square-dashed,SquareDashedBottom:square-dashed-bottom,SquareDashedBottomCode:square-dashed-bottom-code,SquareDashedKanban:square-dashed-kanban,SquareDashedMousePointer:square-dashed-mouse-pointer,SquareDashedText:square-dashed-text,SquareDashedTopSolid:square-dashed-top-solid,SquareDimensions:square-dimensions,SquareDivide:square-divide,SquareDot:square-dot,SquareEqual:square-equal,SquareExclamationPoint:square-exclamation-point,SquareFunction:square-function,SquareKanban:square-kanban,SquareLibrary:square-library,SquareM:square-m,SquareMenu:square-menu,SquareMinus:square-minus,SquareMousePointer:square-mouse-pointer,SquareOff:square-off,SquareParking:square-parking,SquareParkingOff:square-parking-off,SquarePause:square-pause,SquarePen:square-pen,SquarePercent:square-percent,SquarePi:square-pi,SquarePilcrow:square-pilcrow,SquarePlay:square-play,SquarePlus:square-plus,SquarePower:square-power,SquareRadical:square-radical,SquareRoundCorner:square-round-corner,SquareScissors:square-scissors,SquareSigma:square-sigma,SquareSlash:square-slash,SquareSplitHorizontal:square-split-horizontal,SquareSplitVertical:square-split-vertical,SquareSquare:square-square,SquareStack:square-stack,SquareStar:square-star,SquareStop:square-stop,SquareTerminal:square-terminal,SquareText:square-text,SquareUser:square-user,SquareUserRound:square-user-round,SquareX:square-x,SquaresExclude:squares-exclude,SquaresIntersect:squares-intersect,SquaresSubtract:squares-subtract,SquaresUnite:squares-unite,Squircle:squircle,SquircleDashed:squircle-dashed,Squirrel:squirrel,Stamp:stamp,Star:star,StarCheck:star-check,StarHalf:star-half,StarMinus:star-minus,StarOff:star-off,StarPlus:star-plus,StarX:star-x,StepBack:step-back,StepForward:step-forward,Stethoscope:stethoscope,Sticker:sticker,StickyNote:sticky-note,StickyNoteCheck:sticky-note-check,StickyNoteMinus:sticky-note-minus,StickyNoteOff:sticky-note-off,StickyNotePlus:sticky-note-plus,StickyNoteX:sticky-note-x,StickyNotes:sticky-notes,Stone:stone,Store:store,StretchHorizontal:stretch-horizontal,StretchVertical:stretch-vertical,Strikethrough:strikethrough,Subscript:subscript,Summary:summary,Sun:sun,SunDim:sun-dim,SunMedium:sun-medium,SunMoon:sun-moon,SunSnow:sun-snow,Sunrise:sunrise,Sunset:sunset,Superscript:superscript,SwatchBook:swatch-book,SwissFranc:swiss-franc,SwitchCamera:switch-camera,Sword:sword,Swords:swords,Syringe:syringe,Table:table,Table2:table-2,TableCellsMerge:table-cells-merge,TableCellsSplit:table-cells-split,TableColumnsSplit:table-columns-split,TableOfContents:table-of-contents,TableProperties:table-properties,TableRowsSplit:table-rows-split,Tablet:tablet,TabletSmartphone:tablet-smartphone,Tablets:tablets,Tag:tag,TagPlus:tag-plus,TagX:tag-x,Tags:tags,Tally1:tally-1,Tally2:tally-2,Tally3:tally-3,Tally4:tally-4,Tally5:tally-5,Tangent:tangent,Target:target,Telescope:telescope,Tent:tent,TentTree:tent-tree,Terminal:terminal,TestTube:test-tube,TestTubeDiagonal:test-tube-diagonal,TestTubes:test-tubes,TextAlignCenter:text-align-center,TextAlignEnd:text-align-end,TextAlignJustify:text-align-justify,TextAlignStart:text-align-start,TextCursor:text-cursor,TextCursorInput:text-cursor-input,TextInitial:text-initial,TextQuote:text-quote,TextSearch:text-search,TextWrap:text-wrap,Theater:theater,Thermometer:thermometer,ThermometerSnowflake:thermometer-snowflake,ThermometerSun:thermometer-sun,ThumbsDown:thumbs-down,ThumbsUp:thumbs-up,TicTacToe:tic-tac-toe,Ticket:ticket,TicketCheck:ticket-check,TicketMinus:ticket-minus,TicketPercent:ticket-percent,TicketPlus:ticket-plus,TicketSlash:ticket-slash,TicketX:ticket-x,Tickets:tickets,TicketsPlane:tickets-plane,Timeline:timeline,Timer:timer,TimerOff:timer-off,TimerReset:timer-reset,ToggleLeft:toggle-left,ToggleRight:toggle-right,Toilet:toilet,ToolCase:tool-case,Toolbox:toolbox,Tornado:tornado,Torus:torus,Touchpad:touchpad,TouchpadOff:touchpad-off,TowelRack:towel-rack,TowerControl:tower-control,ToyBrick:toy-brick,Tractor:tractor,TrafficCone:traffic-cone,Trailer:trailer,TrainFront:train-front,TrainFrontTunnel:train-front-tunnel,TrainTrack:train-track,TramFront:tram-front,Transgender:transgender,Trash:trash,TrashOff:trash-off,TreeDeciduous:tree-deciduous,TreePalm:tree-palm,TreePine:tree-pine,Trees:trees,TrendingDown:trending-down,TrendingUp:trending-up,TrendingUpDown:trending-up-down,Triangle:triangle,TriangleAlert:triangle-alert,TriangleDashed:triangle-dashed,TriangleRight:triangle-right,Trophy:trophy,Truck:truck,TruckElectric:truck-electric,TurkishLira:turkish-lira,Turntable:turntable,Turtle:turtle,Tv:tv,TvMinimal:tv-minimal,TvMinimalPlay:tv-minimal-play,Type:type,TypeOutline:type-outline,Umbrella:umbrella,UmbrellaOff:umbrella-off,Underline:underline,Undo:undo,Undo2:undo-2,UndoDot:undo-dot,UnfoldHorizontal:unfold-horizontal,UnfoldVertical:unfold-vertical,Ungroup:ungroup,University:university,Unlink:unlink,Unlink2:unlink-2,Unplug:unplug,Upload:upload,Usb:usb,UsbCPort:usb-c-port,User:user,UserCheck:user-check,UserCog:user-cog,UserGroup:user-group,UserKey:user-key,UserLock:user-lock,UserMinus:user-minus,UserPen:user-pen,UserPlus:user-plus,UserRound:user-round,UserRoundArrowLeft:user-round-arrow-left,UserRoundCheck:user-round-check,UserRoundCog:user-round-cog,UserRoundGroup:user-round-group,UserRoundKey:user-round-key,UserRoundMinus:user-round-minus,UserRoundPen:user-round-pen,UserRoundPlus:user-round-plus,UserRoundSearch:user-round-search,UserRoundX:user-round-x,UserSearch:user-search,UserShield:user-shield,UserStar:user-star,UserX:user-x,Users:users,UsersRound:users-round,Utensils:utensils,UtensilsCrossed:utensils-crossed,UtilityPole:utility-pole,Van:van,Variable:variable,Vault:vault,VectorPolygon:vector-polygon,VectorSquare:vector-square,Vegan:vegan,VenetianMask:venetian-mask,Venus:venus,VenusAndMars:venus-and-mars,Vibrate:vibrate,VibrateOff:vibrate-off,Video:video,VideoOff:video-off,Videotape:videotape,View:view,Virus:virus,VirusOff:virus-off,Voicemail:voicemail,Volleyball:volleyball,Volume:volume,Volume1:volume-1,Volume2:volume-2,VolumeOff:volume-off,VolumeX:volume-x,Vote:vote,Wallet:wallet,WalletCards:wallet-cards,WalletMinimal:wallet-minimal,Wallpaper:wallpaper,Wand:wand,WandSparkles:wand-sparkles,Warehouse:warehouse,WashingMachine:washing-machine,Watch:watch,WavesArrowDown:waves-arrow-down,WavesArrowUp:waves-arrow-up,WavesHorizontal:waves-horizontal,WavesLadder:waves-ladder,WavesVertical:waves-vertical,Waypoints:waypoints,Webcam:webcam,WebcamOff:webcam-off,Webhook:webhook,WebhookOff:webhook-off,Weight:weight,WeightTilde:weight-tilde,Wheat:wheat,WheatOff:wheat-off,Whistle:whistle,WholeWord:whole-word,Wifi:wifi,WifiCog:wifi-cog,WifiHigh:wifi-high,WifiLow:wifi-low,WifiOff:wifi-off,WifiPen:wifi-pen,WifiSync:wifi-sync,WifiZero:wifi-zero,Wind:wind,WindArrowDown:wind-arrow-down,Wine:wine,WineOff:wine-off,Workflow:workflow,Worm:worm,Wrench:wrench,WrenchOff:wrench-off,X:x,XLineTop:x-line-top,Zap:zap,ZapOff:zap-off,ZodiacAquarius:zodiac-aquarius,ZodiacAries:zodiac-aries,ZodiacCancer:zodiac-cancer,ZodiacCapricorn:zodiac-capricorn,ZodiacGemini:zodiac-gemini,ZodiacLeo:zodiac-leo,ZodiacLibra:zodiac-libra,ZodiacOphiuchus:zodiac-ophiuchus,ZodiacPisces:zodiac-pisces,ZodiacSagittarius:zodiac-sagittarius,ZodiacScorpio:zodiac-scorpio,ZodiacTaurus:zodiac-taurus,ZodiacVirgo:zodiac-virgo,ZoomIn:zoom-in,ZoomOut:zoom-out`,Fa={Home:`House`};function Ia(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var La=null;function Ra(e){if(La===null){let e=new Map;for(let t of Pa.split(`,`)){let n=t.indexOf(`:`);e.set(t.slice(0,n),t.slice(n+1))}La=e}return La.get(e)}function za(e,t,n){return[`lucide-${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,`lucide-${t}`,n].filter((e,t,n)=>!!e&&String(e).trim()!==``&&n.indexOf(e)===t).join(` `).trim()}var Ba=[],Va=new Map,Ha=new Map;function Ua(e,t){let n=Ha.get(e);if(n)return n;let r=a.default.forwardRef(({className:n,...r},i)=>{let[o,s]=a.default.useState(()=>Va.get(t));return a.default.useEffect(()=>{if(o!==void 0)return;let e=!0,n=ae.dynamicIconImports[t];if(n)return n().then(n=>{let r=n.__iconData?.node??n.__iconNode;r&&(Va.set(t,r),e&&s(r))}).catch(()=>{}),()=>{e=!1}},[o]),a.default.createElement(l.Icon,{...r,ref:i,iconNode:o??Ba,className:za(e,t,n)})});r.displayName=e;let i=r;return Ha.set(e,i),i}function Wa(e){let t=Ia(e);return{pascal:t,key:Fa[t]||t}}function Ga(e){if(!e)return null;let t=Wa(e).key,n=Ra(t);return n===void 0?null:Ua(t,n)}var Ka=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...u}=r,d=e.size?{width:e.size,height:e.size}:void 0,f=q(e.color,e.className,n),p=typeof e.icon==`string`?e.icon:``,m=typeof e.name==`string`&&e.name.length>0?e.name:``,{pascal:h,key:g}=Wa(p),_=p?Ga(p):void 0;return _?(0,o.jsx)(_,{ref:i,className:f,style:{...d,...c},...(0,t.toDomProps)(u),"data-obj-id":a,"data-obj-type":s}):(console.warn(`ui:icon: no lucide glyph resolves for ${p?`"${p}"`:`an absent icon name`}${p?` (lookup: "${h}"${g===h?``:` -> "${g}"`})`:``}. Rendering a visible placeholder instead of nothing (objectui#5631).`+(!p&&m?` This node names its glyph with the SDUI identity key \`name\` ("${m}"), which is no longer read as a glyph name. Rename it: \`icon: "${m}"\`. Stored metadata converts in bulk with \`migrateIconNodeKeys\` from \`@object-ui/types\`.`:``)),(0,o.jsx)(l.SquareDashed,{ref:i,role:`img`,"aria-label":p?`Unresolved icon: ${p}`:m?`Unresolved icon: \`name\` is no longer the icon key, rename it to \`icon\` (${m})`:`Unresolved icon`,className:f,style:{...d,...c},...(0,t.toDomProps)(u),"data-obj-id":a,"data-obj-type":s,"data-objectui-icon-unresolved":p||`(none)`,...!p&&m?{"data-objectui-icon-legacy-name-key":m}:{}}))});Ka.displayName=`IconRenderer`,t.ComponentRegistry.register(`icon`,Ka,{namespace:`ui`,label:`Icon`,icon:`face-slightly-smiling`,category:`basic`,inputs:[{name:`icon`,type:`string`},{name:`size`,type:`number`},{name:`color`,type:`string`},{name:`className`,type:`string`}]}),t.ComponentRegistry.register(`html`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`div`,{className:q(`prose prose-sm max-w-none dark:prose-invert`,t),dangerouslySetInnerHTML:{__html:e.html},...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`HTML Content`,inputs:[{name:`html`,type:`string`,description:`Raw HTML content`}]});var qa=new Set([`img`,`hr`,`br`]),Ja=`h1.h2.h3.h4.h5.h6.p.a.blockquote.pre.code.strong.em.b.i.u.small.mark.sub.sup.del.ins.abbr.ul.ol.li.dl.dt.dd.figure.figcaption.img.hr.br.time.address.cite.q`.split(`.`),Ya={a:[{name:`href`,type:`string`},{name:`target`,type:`string`},{name:`rel`,type:`string`},{name:`title`,type:`string`}],img:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`width`,type:`number`},{name:`height`,type:`number`},{name:`title`,type:`string`}],time:[{name:`dateTime`,type:`string`}],abbr:[{name:`title`,type:`string`}],q:[{name:`cite`,type:`string`}],blockquote:[{name:`cite`,type:`string`}]};function Xa(e){if(typeof e!=`string`)return;let t=e.trim();if(!/^(javascript|data|vbscript):/i.test(t))return t}function Za(e){if(typeof e!=`string`||e.trim().length===0)return null;let t=e.trim();if(/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith(`//`)||t.startsWith(`#`))return null;try{let e=new URL(t,`https://internal.invalid/`);return e.pathname+e.search+e.hash}catch{return null}}for(let e of Ja){let n=qa.has(e),r=(0,a.forwardRef)(({schema:t,className:r,...o},s)=>{let{"data-obj-id":c,"data-obj-type":l,style:u,dangerouslySetInnerHTML:d,children:f,...p}=o,m={};for(let[e,t]of Object.entries(p))/^on[A-Z]/.test(e)||(m[e]=t);e===`a`&&`href`in m&&(m.href=Xa(m.href));let h=(0,a.useContext)(i.ActionCtxReact),g;if(e===`a`&&h){let e=Za(m.href),t=typeof m.target==`string`?m.target:``;e&&(!t||t===`_self`)&&(g=t=>{t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),h.runner.execute({type:`url`,target:e,toast:{showOnSuccess:!1}}).then(e=>{e?.success&&e.redirect&&window.location.assign(e.redirect)}))})}return(0,a.createElement)(e,{ref:s,className:r,...m,...g?{onClick:g}:{},"data-obj-id":c,"data-obj-type":l,style:u},n?void 0:J(t?.children))});r.displayName=`Html${e.charAt(0).toUpperCase()}${e.slice(1)}`,t.ComponentRegistry.register(e,r,{namespace:`ui`,label:e.toUpperCase(),category:`basic`,inputs:[{name:`className`,type:`string`},...Ya[e]??[],...n?[]:[{name:`children`,type:`slot`}]]})}t.ComponentRegistry.register(`button-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(`div`,{className:q(`flex flex-wrap sm:inline-flex rounded-md shadow-sm`,e.className),role:`group`,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.buttons?.map((t,n)=>(0,o.jsx)(Y,{variant:t.variant||e.variant,size:t.size||e.size,disabled:t.disabled,className:q(`rounded-none`,n===0&&`rounded-l-md`,n===(e.buttons?.length||0)-1&&`rounded-r-md`,n>0&&`-ml-px`,t.className),children:t.label},n))})},{namespace:`ui`,label:`Button Group`,inputs:[{name:`variant`,type:`enum`,enum:[`default`,`destructive`,`outline`,`secondary`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`]},{name:`className`,type:`string`}],defaultProps:{variant:`default`,size:`default`,buttons:[{label:`Left`},{label:`Middle`},{label:`Right`}]}});var Qa=(0,_.createSafeTranslation)({"table.previousPage":`Previous page`,"table.nextPage":`Next page`},`table.previousPage`);t.ComponentRegistry.register(`pagination`,({schema:e,...t})=>{let{t:n}=Qa(),{"data-obj-id":r,"data-obj-type":i,style:a,onPageChange:s,...c}=t,l=e.currentPage||1,u=e.totalPages||1,d=(e,t)=>{t.preventDefault(),e!==l&&(e<1||e>u||s&&s(e))},f=()=>u<=7?Array.from({length:u},(e,t)=>t+1):l<=3?[1,2,3,4,5,-1,u]:l>=u-2?[1,-1,u-4,u-3,u-2,u-1,u]:[1,-1,l-1,l,l+1,-1,u];return(0,o.jsx)(Ar,{className:e.className,...c,"data-obj-id":r,"data-obj-type":i,style:a,children:(0,o.jsxs)(jr,{children:[(0,o.jsx)(Mr,{children:(0,o.jsx)(Pr,{href:`#`,"aria-label":n(`table.previousPage`),onClick:e=>d(l-1,e),className:l<=1?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":l<=1})}),f().map((e,t)=>(0,o.jsx)(Mr,{children:e===-1?(0,o.jsx)(Ir,{}):(0,o.jsx)(Nr,{href:`#`,isActive:e===l,onClick:t=>d(e,t),className:`cursor-pointer`,children:e})},t)),(0,o.jsx)(Mr,{children:(0,o.jsx)(Fr,{href:`#`,"aria-label":n(`table.nextPage`),onClick:e=>d(l+1,e),className:l>=u?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":l>=u})})]})})},{namespace:`ui`,label:`Pagination`,inputs:[{name:`currentPage`,type:`number`},{name:`totalPages`,type:`number`},{name:`className`,type:`string`}],defaultProps:{currentPage:1,totalPages:10}}),t.ComponentRegistry.register(`navigation-menu`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(xr,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsx)(Sr,{children:e.items?.map((e,t)=>(0,o.jsx)(Cr,{children:e.children?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Tr,{children:e.label}),(0,o.jsx)(Er,{children:(0,o.jsx)(`ul`,{className:`grid w-full gap-3 p-4 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]`,children:e.children.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(Dr,{asChild:!0,children:(0,o.jsxs)(`a`,{className:q(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`),href:e.href,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium leading-none`,children:e.label}),e.description&&(0,o.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:e.description})]})})},t))})})]}):(0,o.jsx)(Dr,{href:e.href,children:e.label})},t))})})},{namespace:`ui`,label:`Navigation Menu`,inputs:[{name:`className`,type:`string`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`About`,href:`/about`}]}});function $a(e){return e.includes(`-`)?e.toLowerCase():e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).replace(/(?<![0-9])([A-Za-z])([0-9])/g,`$1-$2`).toLowerCase()}var eo=new Set(ae.iconNames);function to(e){return eo.has(e)}function no(e){return!!e&&to($a(e))}var ro=new Map;function io(e){if(!e)return l.Database;let t=ro.get(e);if(t)return t;let n=$a(e);if(!to(n))return ro.set(e,l.Database),l.Database;let r=e=>a.default.createElement(ae.DynamicIcon,{name:n,fallback:l.Database,...e});return r.displayName=`LucideIcon(${e})`,ro.set(e,r),r}var ao=({name:e,...t})=>{if(!e)return a.default.createElement(l.Database,t);let n=$a(e);return to(n)?a.default.createElement(ae.DynamicIcon,{name:n,fallback:l.Database,...t}):a.default.createElement(l.Database,t)},oo=`[A-Za-z][A-Za-z0-9-]*`,so=`<${oo}(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^"'=<>\`\\s]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,co=`<\\/${oo}\\s*>`,lo=new RegExp([so,co,`<!-->`,`<!--->`,`<!--[\\s\\S]*?-->`,`<\\?[\\s\\S]*?\\?>`,`<![A-Za-z][^>]*>`,`<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`].join(`|`));function uo(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}var fo=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function po(e){if(!e||/\s/.test(e)||uo(e))return null;let t=/^([A-Za-z][A-Za-z0-9+.-]*):/.exec(e);if(t)return fo.has(`${t[1].toLowerCase()}:`)?e:null;let n=e.indexOf(`:`);if(n!==-1){let t=e.search(/[/?#]/);if(t===-1||n<t)return null}return e}function mo(e,t){return t===`all`||/^(?:https?:)?\/\//i.test(e)}function ho(e,t={}){let{classNames:n={},newTab:r=`external`}=t,i=[],s=e,c=[{re:/(?<!`)`([^`]+)`(?!`)/,render:e=>(0,o.jsx)(`code`,{className:n.code,children:e[1]})},{re:/\*\*([^*\s](?:[^*]*[^*\s])?)\*\*/,render:e=>(0,o.jsx)(`strong`,{className:n.strong,children:e[1]})},{re:/\*([^*\s](?:[^*]*[^*\s])?)\*/,render:e=>(0,o.jsx)(`em`,{className:n.em,children:e[1]})},{re:/\[([^\]]+)\]\(([^)]+)\)/,render:e=>{let t=po(e[2]);return t===null?e[1]:mo(t,r)?(0,o.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:n.link,children:e[1]}):(0,o.jsx)(`a`,{href:t,className:n.link,children:e[1]})}},{re:lo,render:()=>null}];for(;s;){let e=-1,t=null,n=null;for(let r of c){let i=r.re.exec(s);i&&(e===-1||i.index<e)&&(e=i.index,t=i,n=r)}if(!t||!n){i.push(s);break}e>0&&i.push(s.slice(0,e)),i.push(n.render(t)),s=s.slice(e+t[0].length)}return(0,o.jsx)(o.Fragment,{children:i.map((e,t)=>(0,o.jsx)(a.Fragment,{children:e},t))})}function go(e){let t=(0,i.isConfigBag)(e?.props)?e.props:{},n=(0,i.isConfigBag)(e?.properties)?e.properties:{};return{...t,...n}}var _o=new Set;function vo(e,t){if(process.env.NODE_ENV===`production`)return;let n=String(e.name??e.label??`(unnamed)`),r=`${t}:${n}`;_o.has(r)||(_o.add(r),console.warn(`[${t}] action "${n}" carries an OBJECT under node-level \`params\`; it is ignored. \`params\` is only the \`ActionParam[]\` list of inputs to collect from the user. Put static execution values under \`properties.params\` instead (for a \`type: "api"\` request payload, use \`bodyExtra\`). See objectui#10289.`))}function yo(e){let t=e.properties;return(0,i.isConfigBag)(t)&&(0,i.isConfigBag)(t.params)?t.params:void 0}function bo(e,t){let n=yo(e),r=e.params;return(0,i.isConfigBag)(r)&&r!==n&&vo(e,t),n}function xo(e,t){let n=e.properties;return(0,i.isConfigBag)(n)?{...e,properties:t(n)}:e}function So(e,t,n){let r=e.params;if(!(r==null||Array.isArray(r))){if(t===`api`)return r;(0,i.isConfigBag)(r)&&Co(e,t,n)}}function Co(e,t,n){if(process.env.NODE_ENV===`production`)return;let r=String(e.name??e.label??`(unnamed)`),i=`entry:${n}:${r}`;_o.has(i)||(_o.add(i),console.warn(`[${n}] action "${r}" (type "${String(t)}") carries an OBJECT under \`params\`; it is not forwarded. \`params\` is only the \`ActionParam[]\` list of inputs to collect from the user. Only a \`type: "api"\` action still reads an object \`params\`, as its request payload, until 18 (use \`bodyExtra\`). See objectui#10462.`))}var wo={left:`text-left`,center:`text-center`,right:`text-right`},To={h1:`text-4xl font-semibold tracking-tight`,h2:`text-3xl font-semibold tracking-tight`,h3:`text-2xl font-semibold tracking-tight`,h4:`text-xl font-semibold tracking-tight`,h5:`text-lg font-semibold tracking-tight`,h6:`text-base font-semibold tracking-tight`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`,overline:`text-xs font-medium uppercase tracking-widest text-muted-foreground`},Eo={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,body:`p`,caption:`p`,overline:`p`},Do={classNames:{code:`rounded bg-muted px-1.5 py-0.5 font-mono text-[0.85em]`,strong:`font-semibold`,link:`text-primary underline underline-offset-2 hover:no-underline`},newTab:`external`};function Oo({schema:e}){let t=go(e),{language:n}=(0,_.useObjectTranslation)(),r=(0,_.useDisplayLocale)(),a=t.variant??`body`,s=t.align??`left`,c=Eo[a]??`p`;return(0,o.jsx)(c,{className:q(To[a]??To.body,wo[s],e?.className),...(0,i.resolveInlineAriaProps)(t.aria,r),children:ho((0,_.pickLocalized)(t.content,n),Do)})}t.ComponentRegistry.register(`text`,Oo,{namespace:`element`,skipFallback:!0,label:`Text`,category:`content`,inputs:[{name:`content`,type:[`string`,`object`],required:!0,description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`variant`,type:`enum`,enum:[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`body`,`caption`,`overline`],description:`One of the nine text styles ui:text uses: h1-h6 (rendered as that heading level), body, caption or overline. The earlier spellings heading and subheading are refused; write h2 or h3 instead.`},{name:`align`,type:`enum`,enum:[`left`,`center`,`right`]}]});function ko({schema:e}){return(0,o.jsx)(ti,{className:q(`my-4`,e?.className)})}t.ComponentRegistry.register(`divider`,ko,{namespace:`element`,skipFallback:!0,label:`Divider`,category:`content`});var Ao={cover:`object-cover`,contain:`object-contain`,fill:`object-fill`};function jo({schema:e}){let t=go(e),n=(0,_.useDisplayLocale)(),{t:r}=(0,_.useObjectTranslation)(),a=t.fit??`cover`;return t.src?(0,o.jsx)(`img`,{src:t.src,alt:t.alt??``,className:q(`w-full rounded-md`,Ao[a]??Ao.cover,e?.className),style:t.height?{height:t.height}:void 0,...(0,i.resolveInlineAriaProps)(t.aria,n)}):(0,o.jsx)(`div`,{className:q(`flex items-center justify-center rounded-md border border-dashed bg-muted/30 text-xs text-muted-foreground`,e?.className),style:{height:t.height??120},"data-testid":`element-image-no-source`,children:r(`element.image.noSource`,{defaultValue:`No image source`})})}t.ComponentRegistry.register(`image`,jo,{namespace:`element`,skipFallback:!0,label:`Image`,category:`content`});var Mo={primary:`default`,secondary:`secondary`,danger:`destructive`,ghost:`ghost`,link:`link`},No={small:`sm`,medium:`default`,large:`lg`};function Po({schema:e}){let t=go(e),n=Mo[t.variant??`primary`]??`default`,r=No[t.size??`medium`]??`default`,{language:s}=(0,_.useObjectTranslation)(),c=(0,_.useDisplayLocale)(),l=(0,_.pickLocalized)(t.label,s),u=t.iconPosition??`left`,d=t.icon?(0,o.jsx)(ao,{name:t.icon,className:`h-4 w-4`}):null,{execute:f}=(0,i.useAction)(),p=(0,i.useActionTextLocalizer)(),[m,h]=a.useState(!1),g=t.action,v=a.useCallback(async()=>{if(g&&!m){h(!0);try{let e=p(void 0,g),t=Array.isArray(e.params)?{actionParams:e.params}:{params:So(e,e.actionType||e.type,`element:button`)};await f({type:e.actionType||e.type,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,navigate:e.navigate,to:e.to,opensInNewTab:e.opensInNewTab,bodyExtra:e.bodyExtra,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,...t})}finally{h(!1)}}},[g,f,p,m]);return(0,o.jsxs)(Y,{type:`button`,variant:n,size:r,disabled:t.disabled||m,className:q(e?.className),onClick:g?v:void 0,...(0,i.resolveInlineAriaProps)(t.aria,c),children:[u===`left`&&d,l,u===`right`&&d]})}t.ComponentRegistry.register(`button`,Po,{namespace:`element`,skipFallback:!0,label:`Button`,category:`action`,inputs:[{name:`label`,type:[`string`,`object`],required:!0,description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`action`,type:`object`,description:`Inline ActionDef executed on click (url / navigation / api / script / modal / flow); omitted → renders inert`},{name:`variant`,type:`enum`,enum:[`primary`,`secondary`,`danger`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`small`,`medium`,`large`]},{name:`icon`,type:`string`,description:`Lucide icon name`},{name:`iconPosition`,type:`enum`,enum:[`left`,`right`]},{name:`disabled`,type:`boolean`}]});var Fo={number:{},currency:{currency:`USD`},percent:{style:`percent`,maximumFractionDigits:1}};function Io(e,t,n,r,i,a){if(e==null||Number.isNaN(e))return`—`;let o=Fo[t??`number`]??Fo.number;t===`currency`&&(o=i?{...Fo.currency,currency:i}:Fo.number);let s=(0,_.formatDisplayNumber)(e,{...o,locale:a});return`${n??``}${s}${r??``}`}function Lo({schema:e}){let n=go(e),r=(0,i.useAdapter)(),s=(0,i.useElementDataSource)(e,r),c=s.composed,{t:l}=(0,_.useObjectTranslation)(),u=a.useMemo(()=>{if(!c)return{filter:void 0};let e=(0,t.toFilterNodeSafely)(c.filter);return e.ok?{filter:e.node}:{filter:void 0,refusal:e.refusal}},[c]),d=u.refusal,f=s.status===`loading`||s.status===`missing`||d?void 0:c?.object,{currency:p}=(0,_.useLocalization)(),m=(0,_.useDisplayLocale)(),[h,g]=a.useState(null),[v,y]=a.useState(!0),[b,x]=a.useState(null),S=(0,i.useFilterScope)(),C=(0,i.useResolvedFilter)(u.filter,S),w=a.useMemo(()=>C?JSON.stringify(C):``,[C]),T=(0,i.useDataInvalidation)(r&&n.aggregate?f:void 0);return a.useEffect(()=>{let e=!1;if(!r||!f||!n.aggregate){y(!1);return}return y(!0),x(null),(async()=>{try{if(typeof r.aggregate==`function`){let t=await r.aggregate(f,{field:n.field,function:n.aggregate,groupBy:`_all`,filter:C}),i=Array.isArray(t)?t[0]:t,a=n.aggregate===`count`?`count`:`${n.field??``}_${n.aggregate}`,o=i?.[a]??i?.[n.field??``]??i?.value??(typeof i==`number`?i:null);e||g(typeof o==`number`?o:o==null?null:Number(o))}else if(typeof r.find==`function`){let t=await r.find(f,C?{$filter:C}:void 0),i=t?.data??(Array.isArray(t)?t:[]),a=null;if(n.aggregate===`count`)a=i.length;else if(n.field){let e=i.map(e=>Number(e?.[n.field])).filter(e=>!Number.isNaN(e));e.length&&(n.aggregate===`sum`?a=e.reduce((e,t)=>e+t,0):n.aggregate===`avg`?a=e.reduce((e,t)=>e+t,0)/e.length:n.aggregate===`min`?a=Math.min(...e):n.aggregate===`max`&&(a=Math.max(...e)))}e||g(a)}}catch(t){e||x(t?.message??``)}finally{e||y(!1)}})(),()=>{e=!0}},[r,f,n.field,n.aggregate,w,T]),s.status===`missing`||d?(0,o.jsx)(i.ElementDataSourceErrorPanel,{testId:`element-number`,title:l(`element.number.sourceUnresolved`,{defaultValue:`This metric’s data source could not be resolved`}),message:d?.message??s.error}):s.status===`loading`?(0,o.jsx)(i.ElementDataSourceLoadingPanel,{testId:`element-number`}):n.aggregate&&s.status===`absent`?(0,o.jsx)(`div`,{className:q(`text-xs text-muted-foreground`,e?.className),"data-testid":`element-number-no-object`,...(0,i.resolveInlineAriaProps)(n.aria,m),children:l(`element.number.noObject`,{defaultValue:`No object named: set dataSource.object.`})}):(0,o.jsxs)(`div`,{className:q(`flex flex-col gap-1`,e?.className),...(0,i.resolveInlineAriaProps)(n.aria,m),children:[v?(0,o.jsx)($,{role:`status`,"aria-label":l(`common.loading`,{defaultValue:`Loading…`}),className:`h-9 w-20`,"data-testid":`element-number-loading`}):(0,o.jsx)(`div`,{className:`text-3xl font-semibold tracking-tight tabular-nums`,children:Io(h,n.format,n.prefix,n.suffix,p,m)}),b!==null&&(0,o.jsx)(`div`,{className:`text-xs text-destructive`,"data-testid":`element-number-error`,children:b||l(`errors.unknown`,{defaultValue:`An unexpected error occurred.`})})]})}t.ComponentRegistry.register(`number`,(0,t.elementDataSourceBlock)(Lo),{namespace:`element`,skipFallback:!0,label:`Number`,category:`content`,inputs:[{name:`aggregate`,type:`enum`,enum:[`count`,`sum`,`avg`,`min`,`max`],required:!0},{name:`field`,type:`string`,description:`Measure field (required for every aggregate except count)`},{name:`format`,type:`enum`,enum:[`number`,`currency`,`percent`]},{name:`prefix`,type:`string`},{name:`suffix`,type:`string`}]});function Ro(e,t){if(!e||!t)return;let n=e.fields;if(n)return Array.isArray(n)?n.find(e=>e?.name===t):n[t]}function zo({hint:e,icon:t,title:n,subtitle:r,children:i}){return(0,o.jsxs)(`div`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-2.5 border-b bg-muted/40 px-3.5 py-2.5`,children:[(0,o.jsx)(t,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-semibold leading-tight`,children:n}),(0,o.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-muted-foreground`,children:e})]}),r&&(0,o.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:r})]})]}),(0,o.jsx)(`div`,{className:`p-3.5`,children:i})]})}var Bo=[``,``,``];function Vo({children:e}){return(0,o.jsx)(`code`,{className:`font-mono`,children:e})}function Ho(e,t){return e.split(/([\uE000-\uE002])/u).map((e,n)=>{let r=Bo.indexOf(e);return r===-1?e:(0,o.jsx)(a.Fragment,{children:t[r]},n)})}function Uo(){let{t:e}=(0,_.useObjectTranslation)();return{t:e,missing:t=>(0,o.jsx)(Wo,{tone:`warn`,children:Ho(e(`element.metadataViewer.missingKey`,{defaultValue:`Missing {{key}} for this view.`,key:Bo[0]}),[(0,o.jsx)(Vo,{children:t},`k`)])}),loading:t=>(0,o.jsx)(Wo,{children:Ho(e(`element.metadataViewer.loading`,{defaultValue:`Loading {{name}}…`,name:Bo[0]}),[(0,o.jsx)(Vo,{children:t},`n`)])}),failed:(t,n)=>(0,o.jsx)(Wo,{tone:`warn`,children:Ho(e(`element.metadataViewer.loadFailed`,{defaultValue:`Failed to load {{name}}: {{message}}`,name:Bo[0],message:n}),[(0,o.jsx)(Vo,{children:t},`n`)])}),notFound:t=>(0,o.jsx)(Wo,{tone:`warn`,children:Ho(e(`element.metadataViewer.notFound`,{defaultValue:`{{name}} not found.`,name:Bo[0]}),[(0,o.jsx)(Vo,{children:t},`n`)])})}}function Wo({tone:e=`muted`,children:t}){return(0,o.jsxs)(`div`,{className:q(`flex items-center gap-2 rounded-md border border-dashed px-3 py-2.5 text-xs`,e===`warn`?`border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-300`:`bg-muted/30 text-muted-foreground`),children:[e===`warn`&&(0,o.jsx)(l.AlertTriangle,{className:`h-3.5 w-3.5 shrink-0`}),t]})}function Go({object:e,name:t}){let{item:n,loading:r,error:s}=(0,i.useMetadataItem)(`object`,e??null),{t:c,...u}=Uo(),d=a.useMemo(()=>{let e=n?.validations??n?.validationRules??[];if(Array.isArray(e))return e.find(e=>e?.type===`state_machine`&&(!t||e?.name===t))},[n,t]);if(!e)return u.missing(`object`);if(r)return u.loading(e);if(s)return u.failed(e,s.message);if(!n)return u.notFound(e);if(!d)return(0,o.jsx)(Wo,{tone:`warn`,children:Ho(t?c(`element.metadataViewer.noStateMachineNamed`,{defaultValue:`No state machine named “{{name}}” on {{object}}.`,name:t,object:Bo[0]}):c(`element.metadataViewer.noStateMachine`,{defaultValue:`No state machine on {{object}}.`,object:Bo[0]}),[(0,o.jsx)(Vo,{children:e},`o`)])});let f=d.transitions&&typeof d.transitions==`object`&&!Array.isArray(d.transitions)?d.transitions:{},p=Ro(n,d.field),m=Array.isArray(p?.options)?p.options:[],h=new Map(m.map(e=>[e.value,e])),g=e=>h.get(e)?.label??e,_=e=>h.get(e)?.color,v=m.find(e=>e.default)?.value,y=new Set;v&&y.add(v);for(let e of m)y.add(e.value);for(let[e,t]of Object.entries(f)){y.add(e);for(let e of t)y.add(e)}let b=[...y],x=({value:e})=>{let t=_(e);return(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-background px-2 py-0.5 text-xs font-medium`,children:[(0,o.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:t??`var(--muted-foreground)`}}),g(e)]})},S=c(`element.metadataViewer.stateMachine`,{defaultValue:`State machine`});return(0,o.jsx)(zo,{hint:S,icon:l.Workflow,title:d.label??d.name??S,subtitle:(0,o.jsxs)(o.Fragment,{children:[Ho(c(`element.metadataViewer.lifecycle`,{defaultValue:`Lifecycle of {{object}}`,object:Bo[0]}),[(0,o.jsx)(Vo,{children:e},`o`)]),d.field?(0,o.jsxs)(o.Fragment,{children:[` · `,Ho(c(`element.metadataViewer.field`,{defaultValue:`field {{field}}`,field:Bo[0]}),[(0,o.jsx)(Vo,{children:d.field},`f`)])]}):null]}),children:(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:b.map(e=>{let t=f[e]??[],n=e===v,r=t.length===0;return(0,o.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(x,{value:e}),n&&(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-400`,children:[(0,o.jsx)(l.CircleDot,{className:`h-3 w-3`}),` `,c(`element.metadataViewer.initial`,{defaultValue:`initial`})]}),r?(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,o.jsx)(l.Flag,{className:`h-3 w-3`}),` `,c(`element.metadataViewer.final`,{defaultValue:`final`})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.ArrowRight,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,o.jsx)(`span`,{className:`flex flex-wrap gap-1.5`,children:t.map(e=>(0,o.jsx)(x,{value:e},e))})]})]},e)})})})}var Ko=new Set([`script`,`http`,`connector_action`,`assignment`,`get_record`,`create_record`,`update_record`,`delete_record`,`boundary_event`]);function qo({name:e,detail:t}){let{item:n,loading:r,error:a}=(0,i.useMetadataItem)(`flow`,e??null),{t:s,...c}=Uo();if(!e)return c.missing(`name`);if(r)return c.loading(e);if(a)return c.failed(e,a.message);if(!n)return c.notFound(e);let u=Array.isArray(n.nodes)?n.nodes:[],d=(t??`business`)===`business`,f=d?u.filter(e=>!Ko.has(e?.type)):u,p=u.length-f.length;return(0,o.jsxs)(zo,{hint:s(`element.metadataViewer.flow`,{defaultValue:`Flow`}),icon:l.GitBranch,title:n.label??n.name??e,subtitle:n.description??s(`element.metadataViewer.steps`,{defaultValue:`Steps: {{count}}`,count:u.length}),children:[f.length===0?(0,o.jsx)(Wo,{children:s(`element.metadataViewer.noSteps`,{defaultValue:`No steps to show.`})}):(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:f.map((e,t)=>(0,o.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[11px] font-semibold text-primary`,children:t+1}),(0,o.jsx)(`span`,{className:`text-sm`,children:e?.label??e?.id??s(`element.metadataViewer.untitledStep`,{defaultValue:`(step)`})}),e?.type&&(0,o.jsx)(`span`,{className:`ml-auto rounded border bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e.type})]},e?.id??t))}),d&&p>0&&(0,o.jsx)(`div`,{className:`mt-2 text-[11px] text-muted-foreground`,children:Ho(s(`element.metadataViewer.hiddenSteps`,{defaultValue:`Technical steps hidden: {{count}} · set {{setting}} to show all`,count:p,setting:Bo[0]}),[(0,o.jsx)(Vo,{children:`detail: technical`},`s`)])})]})}var Jo=[{key:`allowCreate`,label:`C`},{key:`allowRead`,label:`R`},{key:`allowEdit`,label:`U`},{key:`allowDelete`,label:`D`}];function Yo({name:e}){let{item:t,loading:n,error:r}=(0,i.useMetadataItem)(`permission`,e??null),{t:a,...s}=Uo();if(!e)return s.missing(`name`);if(n)return s.loading(e);if(r)return s.failed(e,r.message);if(!t)return s.notFound(e);let c=t.objects&&typeof t.objects==`object`?t.objects:{},u=Object.entries(c);return(0,o.jsx)(zo,{hint:a(`element.metadataViewer.permission`,{defaultValue:`Permission`}),icon:l.ShieldCheck,title:t.label??t.name??e,subtitle:a(`element.metadataViewer.objectAccess`,{defaultValue:`Object access: {{count}}`,count:u.length}),children:u.length===0?(0,o.jsx)(Wo,{children:a(`element.metadataViewer.noPermissions`,{defaultValue:`No object permissions declared.`})}):(0,o.jsxs)(`table`,{className:`w-full border-separate border-spacing-0 text-xs`,children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{className:`text-muted-foreground`,children:[(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-medium`,children:a(`element.metadataViewer.object`,{defaultValue:`Object`})}),Jo.map(e=>(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-center font-mono font-medium`,title:e.key,children:e.label},e.key))]})}),(0,o.jsx)(`tbody`,{children:u.map(([e,t])=>(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 font-mono`,children:e}),Jo.map(e=>(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 text-center`,children:t?.[e.key]?(0,o.jsx)(l.Check,{className:`mx-auto h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400`}):(0,o.jsx)(l.Minus,{className:`mx-auto h-3.5 w-3.5 text-muted-foreground/40`})},e.key))]},e))})]})})}function Xo(e){let{t}=(0,_.useObjectTranslation)();switch(e.type){case`state_machine`:return(0,o.jsx)(Go,{...e});case`flow`:return(0,o.jsx)(qo,{...e});case`permission`:return(0,o.jsx)(Yo,{...e});default:return(0,o.jsx)(Wo,{tone:`warn`,children:Ho(e.type?t(`element.metadataViewer.unknownTypeNamed`,{defaultValue:`Unknown metadata view type “{{type}}”. Expected {{a}}, {{b}} or {{c}}.`,type:e.type,a:Bo[0],b:Bo[1],c:Bo[2]}):t(`element.metadataViewer.unknownType`,{defaultValue:`Unknown metadata view type. Expected {{a}}, {{b}} or {{c}}.`,a:Bo[0],b:Bo[1],c:Bo[2]}),[(0,o.jsx)(Vo,{children:`state_machine`},`a`),(0,o.jsx)(Vo,{children:`flow`},`b`),(0,o.jsx)(Vo,{children:`permission`},`c`)])})}}function Zo({schema:e}){let{aria:t,...n}=go(e),r=(0,_.useDisplayLocale)();return(0,o.jsx)(`div`,{...(0,i.resolveInlineAriaProps)(t,r),children:(0,o.jsx)(Xo,{...n})})}t.ComponentRegistry.register(`metadata_viewer`,Zo,{namespace:`element`,skipFallback:!0,label:`Metadata Viewer`,category:`content`});function Qo(e){return e==null||e===``?`—`:typeof e==`object`?JSON.stringify(e):String(e)}function $o({schema:e}){let t=go(e),n=Array.isArray(t.items)?t.items:[],r=t.columns===2?`sm:grid-cols-2`:`grid-cols-1`,{t:i}=(0,_.useObjectTranslation)();return n.length===0?(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`definition-list-empty`,children:i(`common.noData`,{defaultValue:`No data`})}):(0,o.jsx)(`dl`,{className:q(`grid gap-x-6 gap-y-3`,r,e?.className,t.className),"data-testid":`definition-list`,children:n.map((e,n)=>(0,o.jsxs)(`div`,{className:q(t.inline?`flex items-baseline justify-between gap-3`:`flex flex-col gap-0.5`),children:[(0,o.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e.term}),(0,o.jsx)(`dd`,{className:`text-sm text-foreground`,children:Qo(e.description)})]},n))})}t.ComponentRegistry.register(`definition-list`,$o,{namespace:`element`,skipFallback:!0,label:`Definition List`,category:`content`,inputs:[{name:`items`,type:`array`,of:`object`,description:'Term/description pairs [{ term, description }], in order: `term` is the row label, `description` is shown as-is (an object as JSON, an omitted one as an em dash). Omitted or empty renders the empty state: the active language’s "No data" (`common.noData`)'},{name:`columns`,type:`enum`,enum:[{label:`1`,value:1},{label:`2`,value:2}],description:`Grid columns from the small breakpoint up: the NUMBER 1 or 2 (default 1)`},{name:`inline`,type:`boolean`,description:`Term and description on one baseline-aligned row`}]});function es({schema:e}){let t=go(e),n=(0,i.useAdapter)(),{t:r}=(0,_.useObjectTranslation)(),s=(0,i.useElementDataSource)(e,n),{composed:c}=s,l=s.status===`loading`||s.status===`missing`?void 0:c?.object,u=c?.sort,d=c?.limit,[f,p]=a.useState([]),[m,h]=a.useState(!0),[g,v]=a.useState(null),y=(0,i.useFilterScope)(),b=(0,i.useResolvedFilter)(c?.filter,y),x=a.useMemo(()=>b?JSON.stringify(b):``,[b]),S=a.useMemo(()=>u?JSON.stringify(u):``,[u]),C=a.useMemo(()=>(t.fields??[]).map(e=>typeof e==`string`?{field:e}:e),[t.fields]),w=(0,i.useDataInvalidation)(n&&typeof n.find==`function`?l:void 0);return a.useEffect(()=>{let e=!1;if(!n||!l||typeof n.find!=`function`){h(!1);return}return h(!0),v(null),(async()=>{try{let t={};b&&(t.$filter=b),u&&(t.$orderby=u),d&&(t.$top=d);let r=await n.find(l,t),i=r?.data??(Array.isArray(r)?r:[]);e||p(i)}catch(t){e||v(t?.message??``)}finally{e||h(!1)}})(),()=>{e=!0}},[n,l,x,S,d,w]),s.status===`missing`?(0,o.jsx)(i.ElementDataSourceErrorPanel,{testId:`repeater`,message:s.error}):s.status===`loading`?(0,o.jsx)(i.ElementDataSourceLoadingPanel,{testId:`repeater`}):m?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,role:`status`,"data-testid":`repeater-loading`,children:r(`common.loading`,{defaultValue:`Loading…`})}):g===null?f.length===0?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:t.emptyText??r(`common.noData`,{defaultValue:`No data`})}):(0,o.jsx)(`ul`,{className:q(t.divided!==!1&&`divide-y divide-border`,e?.className,t.className),"data-testid":`repeater`,children:f.map((e,n)=>(0,o.jsxs)(`li`,{className:`flex items-baseline gap-3 py-2`,children:[t.titleField&&(0,o.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:Qo(e[t.titleField])}),C.map(t=>(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:Qo(e[t.field])},t.field))]},e?.id??n))}):(0,o.jsx)(`p`,{className:`py-2 text-sm text-destructive`,"data-testid":`repeater-error`,children:g||r(`list.loadErrorTitle`,{defaultValue:`Couldn’t load records`})})}t.ComponentRegistry.register(`repeater`,(0,t.elementDataSourceBlock)(es),{namespace:`element`,skipFallback:!0,label:`Repeater`,category:`content`,inputs:[{name:`titleField`,type:`string`},{name:`fields`,type:`array`,description:"Fields shown after the title on each line, in order: a bare field name, or `{ field }`"},{name:`emptyText`,type:`string`},{name:`divided`,type:`boolean`,description:`Separator between rows`}]});function ts(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`){let t=e;return String(t.label??t.name??t.title??t.en??``)}return String(e)}function ns({schema:e}){let t=go(e),n=(0,i.useAdapter)(),r=(0,i.useElementDataSource)(e,n),s=r.composed,c=r.status===`loading`||r.status===`missing`?void 0:s?.object,l=(0,i.useFilterScope)(),u=(0,i.useResolvedFilter)(s?.filter,l),d=s?.sort,f=s?.limit??50,p=t.labelField??`name`,m=t.valueField??`id`,h=(0,i.usePageVariableBinding)(e?.id),{language:g,t:v}=(0,_.useObjectTranslation)(),[y,b]=a.useState([]),[x,S]=a.useState(!0),[C,w]=a.useState(null),T=a.useMemo(()=>u?JSON.stringify(u):``,[u]),E=a.useMemo(()=>d?JSON.stringify(d):``,[d]),D=(0,i.useDataInvalidation)(n&&typeof n.find==`function`?c:void 0),O=a.useRef(null);a.useEffect(()=>{let e=!1;if(!n||!c||typeof n.find!=`function`){S(!1);return}let t=JSON.stringify([c,T,E,f]),r=O.current;return(r===null||r.adapter!==n||r.signature!==t)&&(S(!0),w(null)),(async()=>{try{let r={};u&&(r.$filter=u),d&&(r.$orderby=d),f&&(r.$top=f);let i=await n.find(c,r),a=i?.data??(Array.isArray(i)?i:[]);e||(b(a),w(null),O.current={adapter:n,signature:t})}catch(t){e||w(t?.message??``)}finally{e||S(!1)}})(),()=>{e=!0}},[n,c,T,E,f,D]);let k=h?.value,A=h?String(k??``):void 0,j=a.useCallback(e=>{h?.setValue(e)},[h]),M=(0,_.pickLocalized)(t.label,g),N=(0,_.pickLocalized)(t.placeholder??v(`lookup.selectRecord`,{defaultValue:`Select record`}),g),P=(0,_.pickLocalized)(t.emptyText??v(`common.noData`,{defaultValue:`No data`}),g),F=(0,_.useDisplayLocale)(),I=(0,i.resolveInlineAriaProps)(t.aria,F);return r.status===`missing`?(0,o.jsx)(i.ElementDataSourceErrorPanel,{testId:`record-picker`,title:v(`element.recordPicker.sourceUnresolved`,{defaultValue:`This record picker’s data source could not be resolved`}),message:r.error}):r.status===`loading`?(0,o.jsx)(i.ElementDataSourceLoadingPanel,{testId:`record-picker`}):(0,o.jsxs)(`div`,{className:q(`space-y-1.5`,e?.className),"data-testid":`record-picker`,"data-picker-id":e?.id,children:[M&&(0,o.jsx)(Vn,{htmlFor:e?.id,className:`text-sm font-medium text-foreground`,children:M}),(0,o.jsxs)(Gr,{value:A,onValueChange:j,disabled:x||C!==null||!c,children:[(0,o.jsx)(Jr,{id:e?.id,className:`w-full max-w-xs`,"data-testid":`record-picker-trigger`,...I,children:(0,o.jsx)(qr,{placeholder:x?v(`common.loading`,{defaultValue:`Loading…`}):C===null?N:v(`list.loadErrorTitle`,{defaultValue:`Couldn’t load records`})})}),(0,o.jsx)(Zr,{children:y.map((e,t)=>{let n=e?.[m],r=String(n??t);return(0,o.jsx)($r,{value:r,children:ts(e?.[p])||r},r)})})]}),!x&&C===null&&y.length===0&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:P})]})}t.ComponentRegistry.register(`record_picker`,(0,t.elementDataSourceBlock)(ns),{namespace:`element`,skipFallback:!0,label:`Record Picker`,category:`input`,inputs:[{name:`labelField`,type:`string`},{name:`valueField`,type:`string`},{name:`placeholder`,type:[`string`,`object`],description:'Prompt shown in the closed control while no record is selected (renderer default: the active language’s "Select record", `lookup.selectRecord`). Display-only — it never reaches the query. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), the `I18nLabel` union rc.6 widened this key to; the renderer resolves the map against the active language at the read site, falling back through base language, a region-qualified sibling, `default`, then `en`. It is REPLACED while the picker is busy: the active language’s "Loading…" (`common.loading`) while it reads a new set of options and "Couldn’t load records" (`list.loadErrorTitle`) after an error both win over this key (a re-read of the same options after a data change keeps them on screen and shows no "Loading…"). An authored empty string stays empty; the default applies only when the key is absent.'},{name:`label`,type:[`string`,`object`],description:'Caption rendered above the picker, in a `<label>` element — tied to the control by `htmlFor` when the node carries an `id`, so clicking it focuses the picker and the text becomes the combobox’s accessible name (objectui#5771), unless the block’s `aria.ariaLabel` names the combobox, which wins. Display-only — it never reaches the query, and it is OMITTED entirely when the key is absent or resolves to an empty string. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), the `I18nLabel` union rc.6 widened this key to; the renderer resolves the map against the active language at the read site, with the same fallback chain as `placeholder`. Distinct from `labelField`, which names the RECORD field each offered row is titled by.'},{name:`emptyText`,type:[`string`,`object`],description:'Text shown in place of the row list when the query returns no records (renderer default: the active language’s "No data", `common.noData`). Unlike the node-level `dataSource` binding\'s `filter` / `sort` / `limit` this is display-only — it never reaches the query, and the binding does not override it. Accepts either a plain string or an inline per-locale map (`{ en: "None", "zh-CN": "无记录" }`) — the `I18nLabel` union rc.6 widened this key to — and the renderer resolves the map against the active language at the read site, falling back through base language, `default`, then `en`. An authored empty string stays empty; the default applies only when the key is absent.'}]});var rs=[`text`,`email`,`number`,`tel`,`url`,`password`];function is({schema:e}){let t=go(e),n=rs.includes(t.inputType)?t.inputType:`text`,{language:r}=(0,_.useObjectTranslation)(),s=(0,i.usePageVariableBinding)(e?.id),c=a.useRef(!1);a.useEffect(()=>{c.current||(c.current=!0,s&&t.defaultValue!==void 0&&(s.value==null||s.value===``)&&s.setValue(t.defaultValue))},[]);let l=s?.value,u=s?l==null?``:String(l):void 0,d=a.useCallback(e=>{if(!s)return;let t=e.target.value;s.setValue(n===`number`?t===``?``:Number(t):t)},[s,n]),f=(0,_.pickLocalized)(t.label,r),p=(0,_.pickLocalized)(t.placeholder,r),m=(0,_.pickLocalized)(t.description,r),h=a.useId(),g=m?`${h}-description`:void 0,v=(0,_.useDisplayLocale)(),y=(0,i.resolveInlineAriaProps)(t.aria,v),b=[g,y[`aria-describedby`]].filter(Boolean).join(` `)||void 0;return(0,o.jsxs)(`div`,{className:q(`grid w-full max-w-sm items-center gap-1.5`,e?.className),"data-testid":`text-input`,"data-input-id":e?.id,children:[f&&(0,o.jsxs)(Vn,{htmlFor:e?.id,children:[f,t.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Q,{id:e?.id,type:n,placeholder:p||void 0,value:u,defaultValue:u===void 0?t.defaultValue:void 0,required:t.required,disabled:t.disabled,...y,"aria-describedby":b,onChange:d}),m&&(0,o.jsx)(`p`,{id:g,className:`text-sm text-muted-foreground`,children:m})]})}t.ComponentRegistry.register(`text_input`,is,{namespace:`element`,skipFallback:!0,label:`Text Input`,category:`input`,inputs:[{name:`label`,type:[`string`,`object`],description:'Caption rendered ABOVE the input, in a `<label>` element — tied to the field by `htmlFor` when the node carries an `id`, so clicking it focuses the input. Display-only, and OMITTED entirely when the key is absent or resolves to an empty string; because the `required` asterisk is drawn on this element, a required input with no label shows no asterisk at all. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`) — the `I18nLabel` union the contract admits on this key — and the renderer resolves the map against the active language at the read site, falling back through base language, a region-qualified sibling, `default`, then `en`, and finally to any remaining entry.'},{name:`placeholder`,type:[`string`,`object`],description:'Prompt shown INSIDE the field while it is empty, as the native input\'s `placeholder` attribute — it disappears as the user types and never becomes the input\'s value, so it is never what a bound page variable receives. Display-only, with no renderer default: an absent key means no placeholder, and an authored empty string (or a map no locale limb resolves) drops the attribute altogether rather than setting an empty one. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), resolved against the active language with the same fallback chain as `label`.'},{name:`inputType`,type:`enum`,enum:[`text`,`email`,`number`,`tel`,`url`,`password`]},{name:`defaultValue`,type:[`string`,`number`],description:"Initial value (string or number). With a page variable bound to this input — a variable whose `source` is this component id — it is pushed into that variable ONCE on mount, and only while the variable is still empty, so `page.<var>` and the submit body carry it before the user types; a variable that declares its own defaultValue wins. With no bound variable it becomes the native input's uncontrolled initial value and nothing else reads it."},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:[`string`,`object`],description:'Helper text rendered BELOW the input, in its own `<p>` — a different destination from `label` (above, in a `<label>`) and `placeholder` (inside the field), reached by the same read path. Display-only, and OMITTED entirely when the key is absent or resolves to an empty string. Accepts either a plain string or an inline per-locale map (`{ en: "Owner", "zh-CN": "负责人" }`), resolved against the active language with the same fallback chain as `label`. The paragraph IS tied to the field with `aria-describedby`, so the resolved text is the input’s accessible DESCRIPTION and assistive tech announces it with the field rather than leaving it as unreachable decoration. That association does not depend on the node carrying an `id` (`label`’s `htmlFor` does): the id `aria-describedby` needs sits on the paragraph, which the renderer mints per instance, and it is emitted only when a paragraph is actually rendered — an absent or empty `description` puts no paragraph id in the input’s `aria-describedby`, which then carries only an authored `aria.ariaDescribedBy`, or is absent. An authored `aria.ariaDescribedBy` is added after the paragraph’s id, never in place of it. Prefer `label` anyway for an instruction a user MUST NOT miss: a description is announced after the field’s name, and screen readers gate description text behind verbosity settings a user can turn down (NVDA’s “Report object descriptions”, VoiceOver hint verbosity), so it is the half of the announcement most likely to go unheard — the same advice as before, now resting on announcement order and verbosity rather than on the text being unwired.'}]});var as=[...t.SDUI_DOM_PASS_THROUGH_KEYS,`name`,`disabled`];function os(e){return(0,t.pickDomProps)(e,as)}function ss(e){return e==null?void 0:String(e)}function cs(e,t){let n=e?.find(e=>String(e.value)===t);return n?n.value:t}var ls=new Set([`required`,`minLength`,`maxLength`,`min`,`max`,`pattern`,`validate`]),us=({className:e,...t})=>(0,o.jsx)(V.Group,{className:q(`flex h-full w-full`,e),...t}),ds=V.Panel,fs=({withHandle:e,className:t,...n})=>(0,o.jsx)(V.Separator,{className:q(`relative flex w-px items-center justify-center bg-border`,`after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1`,`aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full`,`aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full`,`aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0`,`[&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,o.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,o.jsx)(l.GripVertical,{className:`h-2.5 w-2.5`})})}),ps=`sm:w-[calc(100%-2rem)]`,ms=(0,_.createSafeTranslation)({"common.cancel":`Cancel`,"form.fullscreen.title":`Edit text`,"form.fullscreen.description":`Edit the full text value, then save or cancel your changes.`,"form.fullscreen.done":`Done`,"form.fullscreen.toggle":`Edit {{label}} fullscreen`,"form.fullscreen.textFallback":`text`},`common.cancel`);function hs({value:e,onCommit:t,label:n,testIdPrefix:r,readOnly:i=!1,disabled:s=!1,error:c,children:u,footer:d}){let{t:f}=ms(),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(e??``),_=(0,a.useId)(),v=`${_}-fullscreen-title`,y=`${_}-fullscreen-error`,b={"aria-labelledby":v,"aria-invalid":!!c,...c?{"aria-errormessage":y}:null};return i?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,onClick:()=>{s||i||(g(e??``),m(!0))},disabled:s,className:q(`absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm transition-colors`,`disabled:opacity-50 disabled:pointer-events-none`),"aria-label":f(`form.fullscreen.toggle`,{label:n??f(`form.fullscreen.textFallback`)}),"data-testid":`${r}-fullscreen-toggle`,children:(0,o.jsx)(l.Maximize2,{className:`size-3.5`})}),(0,o.jsx)(Pt,{open:p,onOpenChange:m,children:(0,o.jsxs)(zt,{className:`sm:max-w-3xl ${ps} h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0`,"data-testid":`${r}-fullscreen-dialog`,children:[(0,o.jsxs)(Bt,{className:`p-4 border-b`,children:[(0,o.jsx)(Ht,{className:`text-base`,children:(0,o.jsx)(`span`,{id:v,children:n??f(`form.fullscreen.title`)})}),(0,o.jsx)(Ut,{className:`sr-only`,children:f(`form.fullscreen.description`)}),c?(0,o.jsx)(`p`,{id:y,className:`text-sm font-medium text-destructive`,"data-testid":`${r}-fullscreen-error`,children:c}):null]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:u(h,g,s,b)}),(0,o.jsxs)(Vt,{className:`p-3 border-t flex-row justify-between sm:justify-end gap-2`,children:[d?.(h),(0,o.jsxs)(`div`,{className:`flex gap-2 ml-auto`,children:[(0,o.jsxs)(Y,{type:`button`,variant:`ghost`,onClick:()=>m(!1),children:[(0,o.jsx)(l.X,{className:`size-4 mr-1`}),` `,f(`common.cancel`)]}),(0,o.jsxs)(Y,{type:`button`,onClick:()=>{!s&&!i&&t(h),m(!1)},disabled:s,"data-testid":`${r}-fullscreen-save`,children:[(0,o.jsx)(l.Check,{className:`size-4 mr-1`}),` `,f(`form.fullscreen.done`)]})]})]})]})})]})}var gs=1e3,_s=.1,vs=20;function ys(e){return Math.max(Math.ceil(e*_s),vs)}var bs=(0,_.createSafeTranslation)({"fields.textarea.characterCount":`Character count: {{count}} of {{max}}`,"fields.textarea.charactersRemaining":`Characters remaining: {{count}}`},`fields.textarea.characterCount`);function xs({length:e,maxLength:t,descriptionId:n,announceNearLimit:r,className:i,testId:s}){let{t:c}=bs(),l=c(`fields.textarea.characterCount`,{count:e,max:t}),u=r&&t-e<=ys(t)?c(`fields.textarea.charactersRemaining`,{count:Math.max(t-e,0)}):``,[d,f]=(0,a.useState)(``);return(0,a.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>f(u),gs);return()=>clearTimeout(e)},[u]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`div`,{className:i,"aria-hidden":`true`,"data-testid":s,children:[e,`/`,t]}),(0,o.jsx)(`span`,{id:n,className:`sr-only`,children:l}),r&&(0,o.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:d===u?u:``})]})}function Ss(e,t){return!!e||!!t}function Cs(e){let t=e;return t?.type===`section-divider`&&t.visibleWhenFault===`hidden`&&t.visibleWhen!=null}function ws(e,t){return`visibleWhen of field group ${e} '${t}' — fail-closed, the group is hidden`}function Ts(e,n,r,i){return(0,t.evalFieldPredicate)(e.visibleWhen,n,!1,r,i,{context:ws(`section`,String(e.name))})}function Es({label:e,description:t,collapsible:n,collapsed:r,onToggle:i,className:a}){return Ss(e,t)?(0,o.jsxs)(`div`,{className:q(`col-span-full pt-4 pb-1 border-b border-border`,n&&`cursor-pointer select-none ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,a),onClick:n?i:void 0,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.repeat||i?.())}:void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,"aria-expanded":n?!r:void 0,children:[e&&(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n&&(r?(0,o.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 text-muted-foreground`}):(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground`})),(0,o.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:e})]}),t&&(0,o.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:t})]}):null}function Ds(e){let t=new Map;for(let n of e)n?.name&&!t.has(n.name)&&t.set(n.name,n);return t}function Os(e,t){let n=new Set;for(let t of e)for(let e of t.fields)n.add(e.name);return t.filter(e=>e?.name&&!n.has(e.name))}var ks=`mt-4 border-t border-border pt-4`;function As(e){let t=[[]],n=null;for(let r of e){let e=r?.type===`section-divider`;if(e&&Ss(r.label,r.description)){let e=r.fields;n=Array.isArray(e)&&e.length>0?new Set(e):`all`,t[t.length-1].push(r);continue}let i=n===`all`||n!==null&&!e&&n.has(r?.name);n!==null&&!i&&(t.push([]),n=null),t[t.length-1].push(r)}return t}var js=e=>typeof e==`number`&&Number.isFinite(e)?String(e):void 0,Ms=[`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`],Ns={"@sm:2":`@sm:col-span-2`,"@sm:3":`@sm:col-span-3`,"@sm:4":`@sm:col-span-4`,"@md:2":`@md:col-span-2`,"@md:3":`@md:col-span-3`,"@md:4":`@md:col-span-4`,"@lg:2":`@lg:col-span-2`,"@lg:3":`@lg:col-span-3`,"@lg:4":`@lg:col-span-4`,"@xl:2":`@xl:col-span-2`,"@xl:3":`@xl:col-span-3`,"@xl:4":`@xl:col-span-4`,"@2xl:2":`@2xl:col-span-2`,"@2xl:3":`@2xl:col-span-3`,"@2xl:4":`@2xl:col-span-4`,"@3xl:2":`@3xl:col-span-2`,"@3xl:3":`@3xl:col-span-3`,"@3xl:4":`@3xl:col-span-4`,"@4xl:2":`@4xl:col-span-2`,"@4xl:3":`@4xl:col-span-3`,"@4xl:4":`@4xl:col-span-4`,"@5xl:2":`@5xl:col-span-2`,"@5xl:3":`@5xl:col-span-3`,"@5xl:4":`@5xl:col-span-4`,"@6xl:2":`@6xl:col-span-2`,"@6xl:3":`@6xl:col-span-3`,"@6xl:4":`@6xl:col-span-4`,"@7xl:2":`@7xl:col-span-2`,"@7xl:3":`@7xl:col-span-3`,"@7xl:4":`@7xl:col-span-4`,"sm:2":`sm:col-span-2`,"sm:3":`sm:col-span-3`,"sm:4":`sm:col-span-4`,"md:2":`md:col-span-2`,"md:3":`md:col-span-3`,"md:4":`md:col-span-4`,"lg:2":`lg:col-span-2`,"lg:3":`lg:col-span-3`,"lg:4":`lg:col-span-4`,"xl:2":`xl:col-span-2`,"xl:3":`xl:col-span-3`,"xl:4":`xl:col-span-4`,"2xl:2":`2xl:col-span-2`,"2xl:3":`2xl:col-span-3`,"2xl:4":`2xl:col-span-4`,"3xl:2":`3xl:col-span-2`,"3xl:3":`3xl:col-span-3`,"3xl:4":`3xl:col-span-4`,"4xl:2":`4xl:col-span-2`,"4xl:3":`4xl:col-span-3`,"4xl:4":`4xl:col-span-4`,"5xl:2":`5xl:col-span-2`,"5xl:3":`5xl:col-span-3`,"5xl:4":`5xl:col-span-4`,"6xl:2":`6xl:col-span-2`,"6xl:3":`6xl:col-span-3`,"6xl:4":`6xl:col-span-4`,"7xl:2":`7xl:col-span-2`,"7xl:3":`7xl:col-span-3`,"7xl:4":`7xl:col-span-4`},Ps={2:`col-span-2`,3:`col-span-3`,4:`col-span-4`},Fs=`@md:grid-cols-12`,Is=e=>e.split(/\s+/).includes(Fs),Ls={1:`@md:col-span-1`,2:`@md:col-span-2`,3:`@md:col-span-6 @2xl:col-span-4 @4xl:col-span-3`,4:`@md:col-span-6 @2xl:col-span-4`,5:`@md:col-span-5`,6:`@md:col-span-6`,7:`@md:col-span-7`,8:`@md:col-span-12 @2xl:col-span-8`,9:`@md:col-span-12 @4xl:col-span-9`,10:`@md:col-span-10`,11:`@md:col-span-11`,12:`@md:col-span-12`};function Rs(e){return!e||!(e>=1)?``:Ls[Math.min(Math.floor(e),12)]}function zs(e,t){let n=Array.from(e.matchAll(/(@)?(sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl):grid-cols-(\d+)/g)).map(e=>({at:e[1]||``,bp:e[2],cols:Number(e[3])})).sort((e,t)=>Ms.indexOf(e.bp)-Ms.indexOf(t.bp));if(!n.length)return Ps[Math.min(Math.max(t,2),4)];let r=[],i=1;for(let e of n){let n=Math.min(e.cols,t);if(n<=i)continue;let a=Ns[`${e.at}${e.bp}:${n}`];a&&(r.push(a),i=n)}return r.join(` `)}var Bs=(0,_.createSafeTranslation)({"common.selectOption":`Select an option`,"common.submit":`Submit`,"common.cancel":`Cancel`,"form.fullscreen.title":`Edit text`,"form.fullscreen.description":`Edit the full text value, then save or cancel your changes.`,"form.fullscreen.done":`Done`,"form.fullscreen.toggle":`Edit {{label}} fullscreen`,"form.fullscreen.textFallback":`text`,"fields.options.selectFirst":`Select {{fields}} first`,"fields.options.empty":`No options available`,"validation.required":`{{field}} is required`,"validation.minLength":`{{field}} must be at least {{min}} characters`,"validation.maxLength":`{{field}} must be at most {{max}} characters`,"validation.min":`{{field}} must be at least {{min}}`,"validation.max":`{{field}} must be at most {{max}}`,"validation.pattern":`{{field}} format is invalid`,"validation.email":`Please enter a valid email address`,"validation.url":`Please enter a valid URL`,"validation.formInvalid":`Please check the highlighted fields: {{fields}}`,"validation.formInvalidJoiner":`, `,"errors.forbidden":`Access denied.`,"form.noPermissionToSave":`You don't have permission to save this record.`,"form.submitFailed":`Could not save. Please try again.`,"form.clearedOnHide":`Cleared — no longer applicable given the current values: {{fields}}`,"form.visibleWhenFaulted":`Can't submit: the visibleWhen rule of {{fields}} could not be evaluated. The rule must be fixed before this form can be submitted.`,"form.serverDefaultHint":`Set automatically when saved.`},`common.selectOption`),Vs=e=>e==null||e===``||Array.isArray(e)&&e.length===0,Hs=(e,t)=>{if(Vs(e)&&Vs(t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},Us=(e,t)=>Object.prototype.hasOwnProperty.call(e??{},t),Ws=(e,t)=>{let n=new Set([...Object.keys(e??{}),...Object.keys(t??{})]);for(let r of n)if(!Hs(e?.[r],t?.[r]))return!0;return!1},Gs=new Set([`checkbox`,`switch`,`boolean`,`toggle`,`field:boolean`,`field:switch`,`field:checkbox`]),Ks=e=>qs(e?.type,e?.widget,e?.field?.widget);function qs(e,...t){for(let e of t)if(typeof e==`string`&&e!==``&&Js(e))return e;return e}function Js(e){if(Ys.has(e)||lc(e))return!0;let t=sc(e);return Us(vc,e)||Us(vc,t)||yc.has(t)}var Ys=new Set([`input`,`textarea`,`checkbox`,`switch`,`select`]),Xs={select:`field:multiselect`};function Zs(e,t){return t&&Us(Xs,e)?Xs[e]:e}var Qs=new Set;function $s(e,t){if(process.env.NODE_ENV===`production`)return;let n=`${e}::${[...t].sort().join(`,`)}`;Qs.has(n)||(Qs.add(n),console.error(`[object-ui] form field '${e}': validation rule(s) ${t.map(e=>`'${e}'`).join(`, `)} are not rules react-hook-form runs — the field renders, but these rules validate NOTHING. Recognized rules: ${[...ls].join(`, `)}. Check the spelling (\`minLength\`, not \`minlength\`); express email/url checks as a \`pattern\` whose \`value\` is a RegExp; and declare \`validation\` as an OBJECT — spreading an array leaves numeric keys that run nothing.`))}var ec=new Set([`object-ref`,`filter-condition`,`recipient-picker`,`position-ref`,`permission-ref`]);function tc(e){return t.EXPANDABLE_FIELD_TYPES.has(e)||ec.has(e)}function nc(e){let n=e?.name;if(!e||!n)return[];let r=Ks(e);if(typeof r!=`string`||!t.EXPANDABLE_FIELD_TYPES.has(sc(r)))return[];let i=e.field||e,a=i.field,o=(typeof a==`object`&&a&&(`reference`in a||`type`in a)?a:i).dependsOn;return Array.isArray(o)?(0,t.resolveDependsOnFields)(o).filter(e=>e!==n):[]}var rc={input:[`min`,`max`,`step`,`minLength`,`pattern`,`multiple`,`accept`],textarea:[`rows`,`minLength`]};function ic(e,t){let n={};for(let r of rc[t])e[r]!==void 0&&(n[r]=e[r]);return n}function ac(e){if(e==null)return`null`;let t=typeof e;return t===`string`?JSON.stringify(e):t===`number`||t===`boolean`?String(e):Array.isArray(e)?`[${e.map(ac).join(`, `)}]`:JSON.stringify(String(e))}function oc(e){if(!e||!e.field)return null;let t=`record[${JSON.stringify(e.field)}]`,n=[];return e.equals!==void 0&&n.push(`${t} == ${ac(e.equals)}`),e.notEquals!==void 0&&n.push(`${t} != ${ac(e.notEquals)}`),Array.isArray(e.in)&&n.push(`${t} in ${ac(e.in)}`),n.length>0?n.join(` && `):null}function sc(e){return e.startsWith(`field:`)?e.slice(6):e}function cc(e){if(Ys.has(e))return`control`;let n=t.ComponentRegistry.getMeta(sc(e),`field`)?.labelling;return n===`group`||n===`display`?n:`control`}function lc(e){return Ys.has(e)?!1:e.includes(`:`)?e.startsWith(`field:`)&&!!t.ComponentRegistry.get(e):!!t.ComponentRegistry.get(`field:${e}`)}function uc(e,t){return!Ys.has(e)||e!==`select`?!1:!t||t.length===0}var dc=a.default.forwardRef(function({labelId:e,children:t,id:n,"aria-describedby":r,"aria-invalid":i},a){return(0,o.jsx)(`div`,{ref:a,id:n,role:`group`,"aria-labelledby":n?`${e} ${n}`:e,"aria-describedby":r,"data-slot":`readonly-field-group`,children:t})});dc.displayName=`ReadonlyFieldGroup`;function fc(e,t){return e?(0,o.jsx)(dc,{labelId:e,children:t}):t}function pc(e,t){return!e&&!t?null:(0,o.jsxs)(Xn,{children:[e,t&&(0,o.jsx)(`span`,{className:e?`block`:void 0,"data-server-default-hint":`true`,children:t})]})}function mc(e,n){let{dataSource:r,inputType:i,showActions:a,fieldContainerClass:o,mobileStickyActions:s,mobile_fullscreen:c,dependentValues:l,dependsOnLabels:u,emptyHint:d,label:f,schema:p,...m}=n,h=sc(e);return{...m,...tc(h)?{dataSource:r,dependentValues:l,dependsOnLabels:u}:{},...t.CASCADE_OPTION_WIDGET_TYPES.has(h)?{dependentValues:l,emptyHint:d}:{}}}function hc({value:e,onChange:t,placeholder:n,className:r,label:i,readOnly:s,disabled:c,error:l,maxLength:u,...d}){let f=s===!0||c===!0,p=e=>{f||t?.(e)},m=a.default.useId(),h=`${m}-charcount`,g=`${m}-fullscreen-charcount`,_=[d[`aria-describedby`],u?h:void 0].filter(Boolean).join(` `)||void 0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(ha,{placeholder:n,className:q(!s&&`pr-10`,r),value:e??``,onChange:e=>p(e.target.value),...d,maxLength:u,"aria-describedby":_,readOnly:s,disabled:c}),u?(0,o.jsx)(xs,{length:(e??``).length,maxLength:u,descriptionId:h,announceNearLimit:!0,className:`absolute bottom-2 right-2 text-xs text-gray-400`,testId:`form-textarea-character-count`}):null,(0,o.jsx)(hs,{value:e??``,onCommit:p,label:i,testIdPrefix:`form-textarea`,readOnly:s,disabled:c,error:l,footer:e=>u?(0,o.jsx)(xs,{length:e.length,maxLength:u,descriptionId:g,announceNearLimit:!1,className:`text-xs text-muted-foreground self-center`,testId:`form-textarea-fullscreen-character-count`}):null,children:(e,t,r,i)=>(0,o.jsx)(ha,{autoFocus:!0,value:e,onChange:e=>t(e.target.value),placeholder:n,className:`h-full min-h-full resize-none text-base`,disabled:r,maxLength:u,"data-testid":`form-textarea-fullscreen-input`,...i,"aria-describedby":u?g:void 0})})]})}function gc({value:e,placeholder:t,className:n,readOnly:r,maxLength:i,...s}){let c=`${a.default.useId()}-charcount`,l=[s[`aria-describedby`],i?c:void 0].filter(Boolean).join(` `)||void 0,u=(0,o.jsx)(ha,{placeholder:t,className:n,...s,maxLength:i,"aria-describedby":l,readOnly:r,value:e??``});return i?(0,o.jsxs)(`div`,{className:`relative`,children:[u,(0,o.jsx)(xs,{length:(e??``).length,maxLength:i,descriptionId:c,announceNearLimit:!0,className:`absolute bottom-2 right-2 text-xs text-gray-400`,testId:`form-textarea-character-count`})]}):u}t.ComponentRegistry.register(`form`,({schema:e,className:n,onAction:r,disabled:s,...c})=>{let{t:u}=Bs(),d=a.default.useId(),{defaultValues:f={},previousValues:p,fields:m=[],submitLabel:h,cancelLabel:g,showCancel:_=!1,showSubmit:v=!0,layout:y=`vertical`,columns:b=1,onSubmit:x,onChange:S,onDirtyChange:C,onCancel:w,resetOnSubmit:T=!1,validationMode:D=`onSubmit`}=e,O=s===!0,k=a.default.useMemo(()=>m.filter(e=>e&&typeof e.field==`string`&&typeof e.name!=`string`),[m]),A=a.default.useMemo(()=>k.length===0?m:m.filter(e=>!k.includes(e)),[m,k]);a.default.useEffect(()=>{for(let e of k)console.error(`[object-ui] form field { field: '${e.field}' } was NOT rendered: \`field\` is the spec form-view vocabulary (a reference to an object field), and a standalone form has no object schema to resolve it against. Rename the key to \`name\` (the form data path) — or use an object-bound form (objectName + sections), whose section fields accept the spec shape.`);for(let e of m)e&&typeof e.field==`string`&&typeof e.name==`string`&&console.warn(`[object-ui] form field '${e.name}' mixes vocabularies: it also carries { field: '${e.field}' } (spec form-view key), which this standalone renderer ignores. Drop one of the two.`)},[m,k]),a.default.useEffect(()=>{for(let e of m){let t=e?.validation;if(typeof t!=`object`||!t)continue;let n=Object.keys(t).filter(e=>!ls.has(e));n.length!==0&&$s(String(e?.name),n)}},[m]);let j=a.default.useMemo(()=>{if(!p||typeof p!=`object`)return;let e={};for(let t of A)t?.name&&(e[t.name]=null);for(let t of Object.keys(p))p[t]!==void 0&&(e[t]=p[t]);return e},[A,p]),M=j===void 0,N=a.default.useMemo(()=>{let e={...f},n=!1;for(let r of A)typeof r?.name==`string`&&(Us(e,r.name)||Gs.has(Ks(r))&&((0,t.isServerOwnedValue)(r,M)||(e[r.name]=!1,n=!0)));return n?e:f},[f,A,M]),P=(0,E.useForm)({defaultValues:N,mode:D,shouldFocusError:!1}),F=a.default.useRef(null),[I,ee]=a.default.useState(!1),[L,R]=a.default.useState(null),z=`form-outcome:${a.default.useId()}`,[te,ne]=a.default.useState(void 0),[re,ie]=a.default.useState([]),ae=P.watch(),V=(0,i.usePredicateScope)(),H=a.default.useMemo(()=>{let e={};for(let t of A)t?.name&&(e[t.name]=null);if(j)for(let t of Object.keys(j))e[t]=j[t];for(let t of Object.keys(ae))ae[t]!==void 0&&(e[t]=ae[t]);return e},[A,j,JSON.stringify(ae)]),U=a.default.useMemo(()=>{let e=new Set;if(!j)return e;for(let n of A){let r=n?.name;r&&(0,t.resolveFieldRuleState)({visibleWhen:Cs(n)?void 0:n.visibleWhen,readonlyWhen:n.readonlyWhen,requiredWhen:n.requiredWhen},H,{required:!!n.required,readonly:n.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(n,M)},j,V,`field '${r}'`).readonly&&e.add(r)}return e},[A,H,j,M,V]),{conditionallyHiddenFieldNames:oe,faultedVisibleWhenFieldNames:se}=a.default.useMemo(()=>{let e=new Set,n=[];for(let r of A){let i=r?.name;if(!i)continue;let a=r.visibleWhen,o=r.visibleOn;if(a!=null||o!=null){if(a!=null){let o=Cs(r),s=(0,t.resolveFieldRuleState)({visibleWhen:o?void 0:a,readonlyWhen:r.readonlyWhen,requiredWhen:r.requiredWhen},H,{required:!!r.required,readonly:r.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(r,M)},j,V,`field '${i}'`);if(s.faults.visibleWhen!==void 0&&r.type!==`section-divider`&&n.push(i),!s.visible||o&&!Ts(r,H,j,V)){e.add(i);continue}}o!=null&&!(0,t.evalFieldPredicate)(o,H,!0,j,V,{context:`visibleOn of field '${i}'`})&&e.add(i)}}return{conditionallyHiddenFieldNames:e,faultedVisibleWhenFieldNames:n}},[A,H,j,M,V]),ce=a.default.useMemo(()=>{let e=new Set;for(let n of A){let r=n;if(r?.type!==`section-divider`)continue;let i=r.fields;if(!Array.isArray(i)||i.length===0)continue;let a=r.name,o=!!r.hidden;if(!o){let e=oc(r.condition);e&&!(0,t.evalFieldPredicate)(e,H,!0,void 0,void 0,{context:`condition of field '${a}'`})&&(o=!0)}if(!o){let e=Cs(r);(0,t.resolveFieldRuleState)({visibleWhen:e?void 0:r.visibleWhen,readonlyWhen:r.readonlyWhen,requiredWhen:r.requiredWhen},H,{required:!!r.required,readonly:r.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(r,M)},j,V,`field '${a}'`).visible?e&&!Ts(r,H,j,V)&&(o=!0):o=!0}if(!o&&r.visibleOn!=null&&((0,t.evalFieldPredicate)(r.visibleOn,H,!0,j,V,{context:`visibleOn of field '${a}'`})||(o=!0)),o)for(let t of i)typeof t==`string`&&e.add(t)}return e},[A,H,j,M,V]),W=a.default.useMemo(()=>{let t=e.fieldTabs;if(e.children||!Array.isArray(t))return null;let n=t.filter(e=>e&&typeof e.key==`string`);return n.length>1?n:null},[e.fieldTabs,e.children]),G=a.default.useMemo(()=>{let e=new Set;for(let n of W??[]){let r=n.visibleWhen;if(r==null)continue;let i=n.visibleWhenFault===`hidden`;(0,t.evalFieldPredicate)(r,H,!i,j,V,{context:i?ws(`tab`,n.key):`visibleWhen of fieldTab '${n.key}'`})||e.add(n.key)}return e},[W,H,j,V]),le=a.default.useMemo(()=>{let e=new Set;if(!W||G.size===0)return e;for(let t of W)if(G.has(t.key))for(let n of t.fields??[])typeof n==`string`&&e.add(n);for(let t of W)if(!G.has(t.key))for(let n of t.fields??[])e.delete(n);return e},[W,G]);a.default.useEffect(()=>{let e=P.formState.errors;if(e&&Object.keys(e).length!==0)for(let n of A){let r=n?.name;if(!r||!e[r])continue;let i=(0,t.resolveFieldRuleState)({visibleWhen:n.visibleWhen,readonlyWhen:n.readonlyWhen,requiredWhen:n.requiredWhen},H,{required:!!n.required,readonly:n.readonly===!0,serverOwnedValue:(0,t.isServerOwnedValue)(n,M)},j,V,`field '${r}'`),a=n.visibleOn==null||(0,t.evalFieldPredicate)(n.visibleOn,H,!0,j,V,{context:`visibleOn of field '${r}'`}),o=e[r]?.type;(!i.visible||!a||ce.has(r)||le.has(r)||!i.required&&o===`required`)&&P.clearErrors(r)}},[H,V,ce,le]);let ue=a.default.useContext(i.SchemaRendererContext)?.dataSource??null,de=a.default.useMemo(()=>{let e={};for(let t of A)t?.name&&(e[t.name]=t.label||t.name);return e},[A]),fe=a.default.useMemo(()=>{let e=new Map;for(let t of W??[])for(let n of t.fields??[])e.has(n)||e.set(n,t.key);return e},[W]),K=a.default.useMemo(()=>{if(!W?.length)return;let t=W.map(e=>e.key).filter(e=>!G.has(e));if(t.length)return te&&t.includes(te)?te:e.defaultFieldTab&&t.includes(e.defaultFieldTab)?e.defaultFieldTab:t[0]},[W,G,te,e.defaultFieldTab]),pe=a.default.useMemo(()=>{if(!W)return null;let e=Ds(A);return W.map(t=>({key:t.key,label:t.label||t.key,description:t.description,containerClass:t.containerClass,fields:(t.fields??[]).map(t=>e.get(t)).filter(e=>!!e)}))},[W,A]),me=a.default.useMemo(()=>pe?Os(pe,A):[],[pe,A]),he=a.default.useMemo(()=>pe?G.size===0?pe:pe.filter(e=>!G.has(e.key)):null,[pe,G]),ge=a.default.useMemo(()=>{let t=e.fieldPanes;if(e.children||W||!Array.isArray(t))return null;let n=t.filter(e=>e&&typeof e.key==`string`);return n.length>1?n:null},[e.fieldPanes,e.children,W]),_e=a.default.useMemo(()=>{if(!ge)return null;let e=Ds(A);return ge.map(t=>({key:t.key,defaultSize:js(t.defaultSize),minSize:js(t.minSize)??`20`,containerClass:t.containerClass,fields:(t.fields??[]).map(t=>e.get(t)).filter(e=>!!e)}))},[ge,A]),ve=a.default.useMemo(()=>_e?Os(_e,A):[],[_e,A]),ye=a.default.useMemo(()=>{let e=new Set;if(!W)return e;for(let t of re){let n=fe.get(t);n&&e.add(n)}return e},[W,fe,re]);a.default.useEffect(()=>{for(let e of A){let n=e?.name;if(!n)continue;let r=Ks(e);if(typeof r!=`string`||!t.CASCADE_OPTION_WIDGET_TYPES.has(sc(r)))continue;let i=e.options;if(!i||i.length===0)continue;let a=e.dependsOn;if(!i.some(e=>e?.visibleWhen!=null)&&!a)continue;let o=P.getValues(n);if(o==null||o===``)continue;let{options:s,gated:c}=(0,t.resolveCascadingOptions)(i,H,a,V);c||(0,t.isValueStillOffered)(o,s)||P.setValue(n,Array.isArray(o)?[]:null,{shouldValidate:!1,shouldDirty:!0})}},[H,V]);let be=a.default.useRef(void 0),xe=a.default.useRef(void 0);a.default.useEffect(()=>{let e=be.current;if(be.current=oe,!e)return;let t=xe.current,n=t!==void 0&&!Ws(t.values,P.getValues());n||(xe.current=void 0);let r=[];for(let t of oe){if(e.has(t))continue;let n=P.getValues(t);n!=null&&n!==``&&(P.setValue(t,Array.isArray(n)?[]:null,{shouldValidate:!1,shouldDirty:!0}),(Array.isArray(n)?n.length===0:n===!1&&Gs.has(Ks(A.find(e=>e?.name===t))))||r.push(t))}if(r.length===0)return;let i=n&&t?[...t.names,...r]:r;xe.current={names:i,values:{...P.getValues()}},B.toast.warning(u(`form.clearedOnHide`,{fields:i.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))}),{id:z})},[oe]);let Se=a.default.useRef(void 0),Ce=a.default.useRef(N??{}),we=a.default.useRef(!1);a.default.useLayoutEffect(()=>{let e;try{e=JSON.stringify(N??{})}catch{e=String(Date.now())}if(Se.current===e)return;Se.current=e;let t=N??{},n=Ce.current,r=Object.entries(P.getValues()).filter(([e,r])=>!Us(t,e)&&!Us(n,e)&&!Hs(n[e],r));Ce.current=t,we.current=!0;try{P.reset(N);for(let[e,t]of r)P.setValue(e,t,{shouldValidate:!1,shouldDirty:!0})}finally{we.current=!1}ie([]),C?.(r.length>0)},[N]),a.default.useLayoutEffect(()=>{if(r){let e=P.watch(e=>{we.current||r({type:`form_change`,data:e,formData:e})});return()=>e.unsubscribe()}},[P,r]),a.default.useLayoutEffect(()=>{let e=P.watch(e=>{C?.(Ws(Ce.current,e))});return()=>e.unsubscribe()},[P,C]),a.default.useLayoutEffect(()=>{if(S){let e=P.watch(e=>{we.current||S(e)});return()=>e.unsubscribe()}},[P,S]);let Te=a.default.useMemo(()=>{let e=[];for(let t of A){let n=nc(t);n.length>0&&e.push([t.name,n])}return e.length>0?JSON.stringify(e):``},[A]);a.default.useLayoutEffect(()=>{if(!Te)return;let e=JSON.parse(Te),t=Array.from(new Set(e.flatMap(([,e])=>e))),n=()=>{let e=P.getValues(),n={};for(let r of t)n[r]=e?.[r];return n},r=n(),i,a=P.watch((t,a)=>{let o=r,s=n();if(r=s,we.current||!a?.name)return;let c=i===void 0;c&&(i=a.name);try{for(let[t,n]of e){if(t===i||n.every(e=>Hs(o[e],s[e])))continue;let e=P.getValues(t);Vs(e)||P.setValue(t,Array.isArray(e)?[]:null,{shouldValidate:!1,shouldDirty:!0})}}finally{c&&(i=void 0)}});return()=>a.unsubscribe()},[P,Te]);let Ee=e=>{let t=F.current??document,n=typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`),r=t.querySelector(`[data-field="${n}"]`);r&&(r.scrollIntoView?.({behavior:`smooth`,block:`center`}),r.querySelector(`input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]`)?.focus?.({preventScroll:!0}))},De=e=>{if(e.length===0)return;ie(e);let t=e.map(e=>de[e]||e),n=t.slice(0,3).join(u(`validation.formInvalidJoiner`))+(t.length>3?`…`:``);B.toast.error(u(`validation.formInvalid`,{fields:n}),{id:z});let r=new Set(e),i=A.map(e=>e?.name).find(e=>!!e&&r.has(e))??e[0],a=fe.get(i);if(!(a&&G.has(a))){if(a&&a!==K){ne(a),typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>Ee(i)):setTimeout(()=>Ee(i),0);return}Ee(i)}},Oe=P.handleSubmit(async e=>{ee(!0),R(null),B.toast.dismiss(z),ie([]);let t=e;if(e&&(e.nativeEvent||typeof e.preventDefault==`function`||typeof e.stopPropagation==`function`||e.target||e.bubbles))t=P.getValues();else if(!t||Object.keys(t).length===0){let e=P.getValues();e&&Object.keys(e).length>0&&(t=e)}if(U.size>0&&t&&typeof t==`object`){let e={};for(let n of Object.keys(t))U.has(n)||(e[n]=t[n]);t=e}try{if(r){let e=await r({type:`form_submit`,data:t,formData:t});if(e?.error){R(e.error),B.toast.error(e.error,{id:z});return}}x&&typeof x==`function`&&await x(t),T&&P.reset()}catch(e){let t=(0,i.extractFieldErrors)(e);if(t){let n=t.filter(e=>A.some(t=>t?.name===e.field));for(let t of n)P.setError(t.field,{type:`server`,message:t.message||(0,i.extractWriteErrorMessage)(e)||u(`form.submitFailed`)});if(n.length>0&&n.length===t.length){De(n.map(e=>e.field));return}}let n=(0,i.declaredUserMessage)(e)??((0,i.isPermissionError)(e)?u(`form.noPermissionToSave`):(0,i.extractWriteErrorMessage)(e)??u(`form.submitFailed`));(0,i.isPermissionError)(e)&&typeof console<`u`&&console.warn(`[form] write denied:`,e),R(n),B.toast.error(n,{id:z}),typeof process<`u`&&process.env.NODE_ENV===`development`&&console.error(`Form submission error:`,e)}finally{ee(!1)}},e=>{De(Object.keys(e||{}))}),ke=e=>{if(se.length>0){e?.preventDefault?.(),B.toast.dismiss(z);let t=u(`form.visibleWhenFaulted`,{fields:se.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))});return R(t),B.toast.error(t,{id:z}),ie(se),Promise.resolve()}return Oe(e)},Ae=()=>{P.reset(),w&&typeof w==`function`&&w(),r&&r({type:`form_cancel`,data:P.getValues()})},je=b>1?q(`grid gap-4`,b===1?``:b===2?`md:grid-cols-2`:b===3?`md:grid-cols-2 lg:grid-cols-3`:`md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`):`space-y-4`,X=e.fieldContainerClass||je,Me=e.fieldTabsPosition||`top`,Ne=Me===`left`||Me===`right`,Pe=a.default.useRef(void 0),Fe=Pe.current??=new Map,Ie=n=>{let{name:r,label:i,description:a,type:s=`input`,required:c=!1,disabled:l=!1,validation:f={},condition:p,colSpan:m,hidden:h,widget:g,visibleOn:_,readonly:v,visibleWhen:y,readonlyWhen:b,requiredWhen:x,...S}=n;if(h||ce.has(r))return null;let C=oc(p);if(C&&!(0,t.evalFieldPredicate)(C,H,!0,void 0,void 0,{context:`condition of field '${r}'`}))return null;let w=(0,t.isServerOwnedValue)(n,M),T=Cs(n),E=(0,t.resolveFieldRuleState)({visibleWhen:T?void 0:y,readonlyWhen:b,requiredWhen:x},H,{required:c,readonly:v===!0,serverOwnedValue:w},j,V,`field '${r}'`);if(!E.visible||T&&!Ts(n,H,j,V)||_!=null&&!(0,t.evalFieldPredicate)(_,H,!0,j,V,{context:`visibleOn of field '${r}'`}))return null;let D=E.required,k=E.readonly;if(s===`section-divider`){let e=S;return(0,o.jsx)(Es,{label:i,description:a,collapsible:e.collapsible,collapsed:e.collapsed,onToggle:e.onToggle,className:e.className},r)}let A={...f};delete A.required,D?Fe.set(r,typeof f.required==`string`?f.required:u(`validation.required`,{field:i||r})):Fe.delete(r);let N=A.validate;A.validate={...typeof N==`function`?{validate:N}:N??{},required:e=>{let n=Fe.get(r);return n===void 0||!(0,t.isMissingForRequired)(e)||n}};let F=(e,t)=>e&&typeof e==`object`&&e.message==null&&typeof e.messageKey==`string`?{...e,message:u(e.messageKey,{field:i||r,...t?.(e)})}:e;A.minLength&&=F(A.minLength,e=>({min:e.value})),A.maxLength&&=F(A.maxLength,e=>({max:e.value})),A.min&&=F(A.min,e=>({min:e.value})),A.max&&=F(A.max,e=>({max:e.value})),A.pattern&&=F(A.pattern);let ee=n.id??r,L=Zs(qs(s,g,S.field?.widget),S.multiple),R=t.CASCADE_OPTION_WIDGET_TYPES.has(sc(L)),z=S.options,B=R?(0,t.resolveCascadingOptions)(z,H,n.dependsOn,V):null,te=B?.gated??!1,ne=B?.dependsOnFields??[],re=B?B.options:z,ie=te?u(`fields.options.selectFirst`,{fields:ne.map(e=>de[e]||e).join(u(`validation.formInvalidJoiner`))}):void 0,ae=e.fieldContainerClass||je,U=e=>zs(ae,e),oe=Is(ae)?Rs(m):m&&m>1?m===2?U(2):m===3?U(3):m>=4?U(4):``:``,se=`field:${e.objectName?`${e.objectName}.`:``}${r}`,W=cc(L),G=W===`group`,le=(k===!0||W===`display`)&&!!i&&!G&&lc(L),fe=i&&(G||le)?`${d}${String(r).replace(/\s+/g,`_`)}-group-label`:void 0,K=G?fe:void 0,q=R?re:S.options,pe=uc(L,q);return(0,o.jsx)(Wn,{control:P.control,name:r,rules:A,render:({field:e,fieldState:s})=>(0,o.jsxs)(qn,{className:oe||void 0,"data-testid":se,"data-field":r,children:[i&&(0,o.jsxs)(Jn,{className:`text-xs font-normal text-muted-foreground`,...fe?{id:fe,htmlFor:void 0}:null,...pe?{htmlFor:void 0}:null,children:[i,D&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Yn,{children:fc(le?fe:void 0,Dc(L,{...S,field:n.field||n,...e,inputType:S.inputType,label:i,options:q,placeholder:S.placeholder??(L===`select`?u(`common.selectOption`):void 0),disabled:O||l||I||te,readonly:k,emptyHint:ie,dataSource:ue,dependentValues:H,dependsOnLabels:de,error:s.error?.message,"aria-required":D||void 0,...K?{"aria-labelledby":K}:null}))}),pc(a,w&&!k&&!l&&(0,t.isMissingForRequired)(e.value)?u(`form.serverDefaultHint`):void 0),(0,o.jsx)(Zn,{})]})},ee)},Le=e=>{let t=!1;return As(e).map((e,n)=>{let r=e.map(Ie),i=e.some((e,t)=>r[t]!=null&&!(e?.type===`section-divider`&&!Ss(e.label,e.description))),a=n>0&&t&&i;return t||=i,(0,o.jsx)(`div`,{className:a?q(X,ks):X,children:r},n)})},{"data-obj-id":Re,"data-obj-type":ze,style:Be,onSubmit:Ve,onChange:He,submitLabel:We,cancelLabel:Ke,showSubmit:qe,showCancel:Je,resetOnSubmit:Z,defaultValues:Ye,inputType:Xe,dataSource:Ze,showActions:Qe,fieldContainerClass:$e,mobileStickyActions:et,objectName:tt,previousValues:nt,onDirtyChange:rt,onCancel:it,fields:at,layout:ot,columns:st,validationMode:ct,fieldTabs:lt,defaultFieldTab:ut,fieldTabsPosition:dt,fieldPanes:ft,fieldPanesOrientation:pt,fieldPanesResizable:mt,...ht}=c;return(0,o.jsx)(Hn,{...P,children:(0,o.jsxs)(`form`,{ref:F,onSubmit:ke,className:n,...ht,"data-obj-id":Re,"data-obj-type":ze,style:Be,children:[L&&(0,o.jsxs)(Ue,{variant:`destructive`,className:`mb-4`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Ge,{children:L})]}),k.length>0&&(0,o.jsxs)(Ue,{variant:`destructive`,className:`mb-4`,"data-testid":`form-spec-vocabulary-error`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Ge,{children:`Not rendered — spec form-view vocabulary ({ field: … }) in a standalone form: `+k.map(e=>e.field).join(`, `)+`. Use { name: … }, or an object-bound form with sections.`})]}),e.children?(0,o.jsx)(`div`,{className:e.fieldContainerClass||`space-y-4`,children:J(e.children)}):pe&&he?(0,o.jsxs)(o.Fragment,{children:[me.length>0&&(0,o.jsx)(`div`,{className:q(X,`mb-4`),children:me.map(Ie)}),he.length>0&&(0,o.jsxs)(da,{value:K,onValueChange:ne,orientation:Ne?`vertical`:`horizontal`,className:q(`flex w-full`,Ne?`gap-4`:`flex-col`),children:[(0,o.jsx)(fa,{className:q(`self-start`,Ne?q(`h-auto flex-col`,Me===`right`&&`order-last`):Me===`bottom`?`order-last mt-4`:`mb-4`),children:he.map(e=>(0,o.jsxs)(pa,{value:e.key,"data-testid":`form-tab:${e.key}`,"data-error":ye.has(e.key)||void 0,className:q(Ne&&`w-full justify-start`,ye.has(e.key)&&`text-destructive data-[state=active]:text-destructive`),children:[e.label,ye.has(e.key)&&(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1.5 size-1.5 rounded-full bg-destructive`})]},e.key))}),(0,o.jsx)(`div`,{className:`min-w-0 flex-1`,children:he.map(e=>(0,o.jsxs)(ma,{value:e.key,forceMount:!0,className:`mt-0 data-[state=inactive]:hidden`,"data-testid":`form-tab-panel:${e.key}`,children:[e.description&&(0,o.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:e.description}),(0,o.jsx)(`div`,{className:e.containerClass||X,children:e.fields.map(Ie)})]},e.key))})]})]}):_e?(0,o.jsxs)(o.Fragment,{children:[ve.length>0&&(0,o.jsx)(`div`,{className:q(X,`mb-4`),children:ve.map(Ie)}),(0,o.jsx)(us,{orientation:e.fieldPanesOrientation===`vertical`?`vertical`:`horizontal`,className:`min-h-[300px] rounded-lg border`,children:_e.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[n>0&&(0,o.jsx)(fs,{withHandle:e.fieldPanesResizable!==!1,disabled:e.fieldPanesResizable===!1}),(0,o.jsx)(ds,{defaultSize:t.defaultSize,minSize:t.minSize,children:(0,o.jsx)(`div`,{className:q(`@container p-4`,t.containerClass||X),"data-testid":`form-pane:${t.key}`,children:t.fields.map(Ie)})})]},t.key))})]}):Le(A),e.showActions!==!1&&(0,o.jsxs)(`div`,{className:q(`flex flex-col sm:flex-row gap-2 ${y===`horizontal`?`sm:justify-end`:`sm:justify-start`} mt-6`,e.mobileStickyActions&&`sticky bottom-0 z-10 -mx-4 px-4 py-3 bg-background/95 supports-[backdrop-filter]:bg-background/80 backdrop-blur border-t md:static md:mx-0 md:px-0 md:py-0 md:bg-transparent md:border-0 md:backdrop-blur-none`),"data-testid":e.mobileStickyActions?`form-mobile-sticky-actions`:void 0,children:[_&&(0,o.jsx)(Y,{type:`button`,variant:`outline`,onClick:Ae,disabled:I||O,className:`w-full sm:w-auto`,children:g??u(`common.cancel`)}),v&&(0,o.jsxs)(Y,{type:`submit`,disabled:I||O,className:`w-full sm:w-auto`,children:[I&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),h??u(`common.submit`)]})]})]})})},{namespace:`ui`,label:`Form`,inputs:[{name:`fields`,type:`array`,description:`Array of field configurations with name, label, type, validation, etc.`},{name:`defaultValues`,type:`object`,description:`Object with default values for form fields`},{name:`submitLabel`,type:`string`},{name:`cancelLabel`,type:`string`},{name:`showCancel`,type:`boolean`},{name:`layout`,type:`enum`,enum:[`vertical`,`horizontal`]},{name:`columns`,type:`number`,description:`For multi-column layouts (1-4)`},{name:`validationMode`,type:`enum`,enum:[`onSubmit`,`onBlur`,`onChange`,`onTouched`,`all`]},{name:`resetOnSubmit`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`className`,type:`string`},{name:`fieldContainerClass`,type:`string`},{name:`children`,type:`slot`,description:`Authored form body, rendered in place of the generated field list`}],defaultProps:{submitLabel:`Submit`,cancelLabel:`Cancel`,showCancel:!1,layout:`vertical`,columns:1,validationMode:`onSubmit`,resetOnSubmit:!1,disabled:!1,fields:[{name:`name`,label:`Name`,type:`input`,required:!0,placeholder:`Enter your name`},{name:`email`,label:`Email`,type:`input`,inputType:`email`,required:!0,placeholder:`Enter your email`}]}});var _c=new Set([`date`,`datetime-local`,`time`,`month`,`week`]),vc={email:`email`,password:`password`,secret:`password`,"ui:password":`password`},yc=new Set([`password`,`secret`]),bc=new Set;function xc(e,t){let n=`${e}::${t}`;bc.has(n)||(bc.add(n),console.error(`[object-ui] form field '${t}': widget '${e}' is NOT registered, so this form has no widget for a SECRET value. The field renders a refusal instead of an input — the default input branch would render it as \`type="text"\` and put the secret on screen in clear text (objectui#5322). Register the field widgets — \`registerAllFields()\` from \`@object-ui/fields\` — so '${e}' resolves. In a hand-authored standalone form, write the built-in spelling \`{ type: 'password' }\` instead, which renders the native masked input on this branch.`))}function Sc({widgetType:e,fieldName:t,className:n,...r}){return a.default.useEffect(()=>{xc(e,t)},[e,t]),(0,o.jsx)(`div`,{role:`alert`,"data-testid":`field-missing-secret-widget`,"data-missing-field-widget":e,className:q(`rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive`,n),...r,children:`This field was not rendered: its widget \`${e}\` is not registered. Register the field widgets (\`registerAllFields()\` from \`@object-ui/fields\`). A secret is never rendered in a plain text box.`})}function Cc(e){if(e&&_c.has(e))return e=>{let t=e.currentTarget;if(!(t.disabled||t.readOnly))try{t.showPicker?.()}catch{}}}function wc({emptyHint:e,className:t,...n}){let{t:r}=Bs();return(0,o.jsx)(`div`,{className:q(`text-sm text-muted-foreground`,t),...n,children:e||r(`fields.options.empty`)})}var Tc=a.default.forwardRef(function({options:e,placeholder:t,value:n,onValueChange:r,disabled:i,name:a,className:s,...c},l){return(0,o.jsxs)(Gr,{name:a,value:ss(n),onValueChange:t=>r?.(cs(e,t)),disabled:i,children:[(0,o.jsx)(Jr,{ref:l,...c,className:q(`min-h-[44px] sm:min-h-0`,s),children:(0,o.jsx)(qr,{placeholder:t})}),(0,o.jsx)(Zr,{children:e.map(e=>(0,o.jsx)($r,{value:String(e.value),children:e.label},String(e.value)))})]})});function Ec(e){let t=e?.step;if(typeof t==`number`)return t;let n=e?.scale;return typeof n==`number`?10**-n:`any`}function Dc(e,n){let r=!Ys.has(e)&&!e.includes(`:`)?t.ComponentRegistry.get(`field:${e}`):void 0,i=Ys.has(e)?void 0:r||(e.startsWith(`field:`)?t.ComponentRegistry.get(e):void 0);if(i)return(0,o.jsx)(i,{...mc(e,n)});let{inputType:a,options:s=[],placeholder:c,readonly:l,emptyHint:u,...d}=n,f=os(d),{value:p,onChange:m,ref:h}=d,g=l&&`bg-muted/40 cursor-default focus-visible:ring-0`;switch(e){case`input`:{let e=d.maxLength;return a===`file`?(0,o.jsx)(Q,{type:`file`,placeholder:c,...f,...ic(d,`input`),className:q(`min-h-[44px] sm:min-h-0`,f.className),ref:h,onChange:m}):(0,o.jsx)(Q,{type:a||`text`,placeholder:c,...f,...ic(d,`input`),className:q(`min-h-[44px] sm:min-h-0`,g,f.className),ref:h,onChange:m,maxLength:e,...a===`number`?{step:Ec(d.field)}:null,onClick:e=>{Cc(a)?.(e),f.onClick?.(e)},readOnly:l,value:p??``})}case`textarea`:{let{mobile_fullscreen:e,label:t,error:n}=d,r=d.maxLength,i={...f,...ic(d,`textarea`)};return e?(0,o.jsx)(hc,{placeholder:c,label:t,error:n,...i,className:q(`min-h-[44px] sm:min-h-0`,g,i.className),ref:h,onChange:m,maxLength:r,readOnly:l,value:p??``}):(0,o.jsx)(gc,{placeholder:c,...i,className:q(`min-h-[44px] sm:min-h-0`,g,i.className),ref:h,onChange:m,maxLength:r,readOnly:l,value:p??``})}case`checkbox`:{let{disabled:e,...t}=f;return(0,o.jsx)(Ot,{checked:p,onCheckedChange:m,disabled:e||l,...t,className:q(`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,t.className),ref:h})}case`switch`:{let{disabled:e,...t}=f;return(0,o.jsx)(na,{checked:p,onCheckedChange:m,disabled:e||l,...t,className:q(`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,t.className),ref:h})}case`select`:{let{disabled:e,...t}=f;return!s||s.length===0?(0,o.jsx)(wc,{emptyHint:u}):(0,o.jsx)(Tc,{...t,ref:h,options:s,placeholder:c,value:p,onValueChange:m,disabled:e||l})}default:{let t=sc(e);if(e.startsWith(`field:`)&&yc.has(t))return(0,o.jsx)(Sc,{widgetType:e,fieldName:String(d.name??``)});let n=d.maxLength;return(0,o.jsx)(Q,{type:a||vc[t]||`text`,placeholder:c,...f,...ic(d,`input`),className:q(g,f.className),ref:h,onChange:m,value:p,maxLength:n,...a===`number`?{step:Ec(d.field)}:null,onClick:e=>{Cc(a)?.(e),f.onClick?.(e)},readOnly:l})}}}var Oc=(0,a.forwardRef)(({schema:e,disabled:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,u=Ga(e.icon),d=e.loading||n.loading,f=t||d;return(0,o.jsxs)(Y,{ref:r,type:e.buttonType||`button`,variant:e.variant,size:e.size,className:e.className,disabled:f,...os(c),"data-obj-id":i,"data-obj-type":a,style:s,children:[d&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!d&&u&&e.iconPosition!==`right`&&(0,o.jsx)(u,{className:`mr-2 h-4 w-4`}),e.label||J(e.children),!d&&u&&e.iconPosition===`right`&&(0,o.jsx)(u,{className:`ml-2 h-4 w-4`})]})});Oc.displayName=`ButtonRenderer`,t.ComponentRegistry.register(`button`,Oc,{namespace:`ui`,label:`Button`,inputs:[{name:`label`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Button`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`label`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(Vn,{className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.text||e.label})},{namespace:`ui`,label:`Label`,inputs:[{name:`text`,type:`string`,required:!0},{name:`className`,type:`string`}],defaultProps:{text:`Label Text`}});var kc=({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let s=e=>{n&&n(e.target.value)},{"data-obj-id":c,"data-obj-type":l,style:u,...d}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":c,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsxs)(Vn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(Q,{type:e.inputType||`text`,id:e.id,name:e.name,placeholder:e.placeholder,className:t,required:e.required,disabled:i,readOnly:e.readOnly,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:s,min:e.min,max:e.max,step:e.step,maxLength:e.maxLength,pattern:e.pattern,...os(d)}),e.description&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.error&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e.error})]})};t.ComponentRegistry.register(`input`,kc,{namespace:`ui`,label:`Input Field`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`inputType`,type:`enum`,enum:[`text`,`email`,`password`,`number`,`tel`,`url`,`date`,`time`,`datetime-local`]},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}],defaultProps:{inputType:`text`}}),t.ComponentRegistry.register(`email`,e=>(0,o.jsx)(kc,{...e,schema:{...e.schema,inputType:`email`}}),{namespace:`ui`,label:`Email Input`,icon:`mail`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}]}),t.ComponentRegistry.register(`password`,e=>(0,o.jsx)(kc,{...e,schema:{...e.schema,inputType:`password`}}),{namespace:`ui`,label:`Password Input`,icon:`lock`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`},{name:`placeholder`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`description`,type:`string`}]}),t.ComponentRegistry.register(`textarea`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let s=e=>{n&&n(e.target.value)},{"data-obj-id":c,"data-obj-type":l,style:u,...d}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full gap-1.5`,e.wrapperClass),"data-obj-id":c,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsxs)(Vn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(ha,{id:e.id,name:e.name,placeholder:e.placeholder,className:t,disabled:i,readOnly:e.readOnly,required:e.required,rows:e.rows,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:s,...os(d)})]})},{namespace:`ui`,label:`Textarea`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`rows`,type:`number`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Textarea label`,placeholder:`Enter text here...`,rows:3,id:`textarea-field`}}),t.ComponentRegistry.register(`checkbox`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let{"data-obj-id":s,"data-obj-type":c,style:l,...u}=a;return(0,o.jsxs)(`div`,{className:q(`flex items-center space-x-2`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[(0,o.jsx)(Ot,{id:e.id,className:t,checked:r??e.checked??!1,defaultChecked:r===void 0?e.defaultChecked:void 0,onCheckedChange:e=>{n&&n(e)},disabled:i,required:e.required,name:e.name,...os(u)}),(0,o.jsxs)(Vn,{htmlFor:e.id,className:q(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]})]})},{namespace:`ui`,label:`Checkbox`,inputs:[{name:`label`,type:`string`,required:!0},{name:`id`,type:`string`,required:!0},{name:`checked`,type:`boolean`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`}],defaultProps:{label:`Checkbox label`,id:`checkbox-field`}}),t.ComponentRegistry.register(`switch`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2 ${e.wrapperClass||``}`,"data-obj-id":r,"data-obj-type":i,style:a,children:[(0,o.jsx)(na,{id:e.id,className:t,...os(s)}),(0,o.jsx)(Vn,{htmlFor:e.id,children:e.label})]})},{namespace:`ui`,label:`Switch`,inputs:[{name:`label`,type:`string`,required:!0},{name:`id`,type:`string`,required:!0},{name:`checked`,type:`boolean`}],defaultProps:{label:`Switch label`,id:`switch-field`}}),t.ComponentRegistry.register(`select`,({schema:e,className:t,onChange:n,value:r,disabled:i,...a})=>{let{"data-obj-id":s,"data-obj-type":c,style:l,...u}=a;return(0,o.jsxs)(`div`,{className:q(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsxs)(Vn,{htmlFor:e.id,className:q(e.required&&`text-destructive`),children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsxs)(Gr,{defaultValue:r===void 0?ss(e.defaultValue):void 0,value:ss(r??e.value),onValueChange:t=>{n&&n(cs(e.options,t))},disabled:i,required:e.required,name:e.name,...u,children:[(0,o.jsx)(Jr,{id:e.id,className:t,children:(0,o.jsx)(qr,{placeholder:e.placeholder})}),(0,o.jsx)(Zr,{children:e.options?.map(e=>(0,o.jsx)($r,{value:String(e.value),disabled:e.disabled,children:e.label},String(e.value)))})]})]})},{namespace:`ui`,label:`Select`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`defaultValue`,type:`string`},{name:`required`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`options`,type:`array`,description:`Array of {label, value} objects`}],defaultProps:{label:`Select an option`,placeholder:`Choose...`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}});var Ac=`vertical`,jc={horizontal:`flex flex-row flex-wrap items-center gap-4`,vertical:void 0};t.ComponentRegistry.register(`radio-group`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation??Ac;return(0,o.jsx)(Vr,{defaultValue:ss(e.defaultValue),orientation:c,className:q(jc[c],t),...os(s),"data-obj-id":r,"data-obj-type":i,style:a,children:e.options?.map(t=>(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(Hr,{value:String(t.value),id:`${e.id}-${String(t.value)}`}),(0,o.jsx)(Vn,{htmlFor:`${e.id}-${String(t.value)}`,children:t.label})]},String(t.value)))})},{namespace:`ui`,label:`Radio Group`,inputs:[{name:`defaultValue`,type:`string`},{name:`id`,type:`string`,required:!0},{name:`options`,type:`array`,description:`Array of {label, value} objects`},{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`className`,type:`string`}],defaultProps:{id:`radio-group`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`slider`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=Array.isArray(e.defaultValue)?e.defaultValue:e.defaultValue===void 0?void 0:[e.defaultValue];return(0,o.jsx)(ea,{defaultValue:c,max:e.max,min:e.min,step:e.step,className:t,...os(s),"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Slider`,inputs:[{name:`defaultValue`,type:`array`},{name:`max`,type:`number`},{name:`min`,type:`number`},{name:`step`,type:`number`},{name:`className`,type:`string`}],defaultProps:{defaultValue:[50],max:100,min:0,step:1,className:`w-full`}}),t.ComponentRegistry.register(`toggle`,({schema:e,...t})=>{let{style:n,...r}=t;return(0,o.jsx)(_a,{variant:e.variant,size:e.size,pressed:e.pressed,"aria-label":(0,i.resolveKeyedI18nLabel)(e.ariaLabel),...os(r),style:n,children:e.label||J(e.children)})},{namespace:`ui`,label:`Toggle`,inputs:[{name:`label`,type:`string`},{name:`pressed`,type:`boolean`},{name:`variant`,type:`enum`,enum:[`default`,`outline`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`]},{name:`ariaLabel`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Toggle`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`input-otp`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{style:a,...s}=i,c=e.length||6,l=e.separator===!0&&c>1?Math.ceil(c/2):c,u=(e,t)=>Array.from({length:t-e},(t,n)=>(0,o.jsx)(rr,{index:e+n},e+n));return(0,o.jsxs)(tr,{maxLength:c,className:t,value:r??e.value,onChange:e=>{n&&n(e)},...os(s),style:a,children:[(0,o.jsx)(nr,{children:u(0,l)}),l<c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ir,{}),(0,o.jsx)(nr,{children:u(l,c)})]})]})},{namespace:`ui`,label:`Input OTP`,inputs:[{name:`length`,type:`number`},{name:`separator`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{length:6}});function Mc(e){return typeof e==`string`?(0,t.toDisplayDate)(e):e instanceof Date?e:void 0}function Nc(e,t){if(t!=null){if(e===`multiple`)return Array.isArray(t)?t.map(Mc).filter(e=>e!==void 0):void 0;if(e===`range`){if(typeof t!=`object`||Array.isArray(t)||t instanceof Date)return;let{from:e,to:n}=t;return{from:Mc(e),to:Mc(n)}}return Mc(t)}}function Pc(e){let t=e=>e instanceof Date&&!Number.isNaN(e.getTime());if(Array.isArray(e))return e.find(t);let n=e instanceof Date?e:e?.from;return t(n)?n:void 0}t.ComponentRegistry.register(`calendar`,({schema:e,className:t,...n})=>{let r=e.mode||`single`,i=Nc(r,e.value||e.defaultValue);return(0,o.jsx)(pt,{mode:r,selected:i,defaultMonth:Pc(i),className:t,...n})},{namespace:`ui`,skipFallback:!0,label:`Calendar`,inputs:[{name:`mode`,type:`enum`,enum:[`single`,`multiple`,`range`]},{name:`className`,type:`string`}],defaultProps:{mode:`single`,className:`rounded-md border`}});function Fc(e){return typeof e==`string`&&(0,t.isRealCalendarDate)(e)?(0,t.toDisplayDate)(e):e}t.ComponentRegistry.register(`date-picker`,({schema:e,className:t,value:n,onChange:r,...i})=>{let a=ft(),s=Fc(n),c=s,u=e=>{r&&r(e)},{"data-obj-id":d,"data-obj-type":f,style:p,...m}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-1.5 ${e.wrapperClass||``}`,"data-obj-id":d,"data-obj-type":f,style:p,children:[e.label&&(0,o.jsx)(Vn,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(Lr,{children:[(0,o.jsx)(Rr,{asChild:!0,children:(0,o.jsxs)(Y,{id:e.id,variant:`outline`,className:q(`w-full justify-start text-left font-normal`,!n&&`text-muted-foreground`,t),...os(m),children:[(0,o.jsx)(l.CalendarIcon,{className:`mr-2 h-4 w-4`}),s?(0,H.format)(s,e.format||`PPP`,{locale:a}):(0,o.jsx)(`span`,{children:e.placeholder||`Pick a date`})]})}),(0,o.jsx)(zr,{className:`w-auto p-0`,children:(0,o.jsx)(pt,{mode:`single`,defaultMonth:c,selected:c,onSelect:u,autoFocus:!0})})]})]})},{namespace:`ui`,label:`Date Picker`,inputs:[{name:`label`,type:`string`},{name:`placeholder`,type:`string`},{name:`format`,type:`string`,description:`date-fns format string (e.g., "PPP", "yyyy-MM-dd")`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Date`,placeholder:`Pick a date`,format:`PPP`,id:`date-picker-field`}}),t.ComponentRegistry.register(`file-upload`,({schema:e,className:t,value:n,onChange:r,...i})=>{let[s,c]=(0,a.useState)(n||[]),[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(0),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(u){let e=setInterval(()=>{p(t=>t>=100?(clearInterval(e),d(!1),0):t+5)},50);return()=>clearInterval(e)}},[u]);let h=t=>{let n=Array.from(t.target.files||[]);if(n.length>0){d(!0),p(0);let t=e.multiple?[...s,...n]:n;setTimeout(()=>{c(t),r&&r(t)},1e3)}},g=e=>{let t=s.filter((t,n)=>n!==e);c(t),r&&r(t)},_=()=>{m.current?.click()},{"data-obj-id":v,"data-obj-type":y,style:b,...x}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-2 ${e.wrapperClass||``}`,"data-obj-id":v,"data-obj-type":y,style:b,children:[e.label&&(0,o.jsx)(Vn,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(`div`,{className:q(`relative flex flex-col gap-3 group/upload`,t),children:[(0,o.jsx)(`input`,{ref:m,type:`file`,id:e.id,className:`hidden`,accept:e.accept,multiple:e.multiple,onChange:h,...os(x)}),(0,o.jsxs)(`div`,{onClick:_,className:q(`relative overflow-hidden cursor-pointer rounded-lg border-2 border-dashed transition-all duration-300 min-h-[120px] flex flex-col items-center justify-center p-4 sm:p-6 gap-3`,u?`border-cyan-400 bg-cyan-950/30`:`border-slate-700 bg-slate-900/50 hover:bg-slate-900 hover:border-cyan-500/50 hover:shadow-[0_0_20px_-5px_rgba(6,182,212,0.3)]`),children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-5 pointer-events-none`}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[linear-gradient(to_right,#80808012_1px,transparent_1px),linear-gradient(to_bottom,#80808012_1px,transparent_1px)] bg-[size:14px_24px] pointer-events-none`}),(0,o.jsx)(`div`,{className:q(`relative z-10 p-3 rounded-full bg-slate-800 border border-slate-700 transition-all duration-500`,u?`scale-110 shadow-[0_0_30px_cyan] border-cyan-400 animate-bounce`:`group-hover/upload:scale-110 group-hover/upload:shadow-lg group-hover/upload:border-cyan-500`),children:u?(0,o.jsx)(l.Rocket,{className:`w-8 h-8 text-cyan-300 animate-pulse`}):(0,o.jsx)(l.Upload,{className:`w-6 h-6 text-slate-400 group-hover/upload:text-cyan-400`})}),(0,o.jsx)(`div`,{className:`relative z-10 text-center`,children:(0,o.jsx)(`p`,{className:q(`text-xs font-mono uppercase tracking-widest transition-colors`,u?`text-cyan-300`:`text-slate-500 group-hover/upload:text-cyan-200`),children:u?`INITIATING LAUNCH SEQUENCE...`:e.buttonText||`DROP PAYLOAD OR CLICK TO UPLOAD`})}),u&&(0,o.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1 bg-cyan-500 shadow-[0_0_10px_cyan] transition-all duration-75 ease-out`,style:{width:`${f}%`}})]}),s.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-2 mt-1 perspective-1000`,children:s.map((e,t)=>(0,o.jsxs)(`div`,{className:`relative group/file overflow-hidden flex items-center justify-between p-3 border border-border bg-card/80 rounded-sm text-sm transition-all hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 animate-in slide-in-from-bottom-2 fade-in`,children:[(0,o.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-[2px] bg-primary/50 group-hover/file:bg-primary group-hover/file:shadow-[0_0_8px_hsl(var(--primary))]`}),(0,o.jsxs)(`div`,{className:`flex items-center gap-3 z-10`,children:[(0,o.jsx)(l.CheckCircle2,{className:`w-4 h-4 text-emerald-500 rounded-full`}),(0,o.jsx)(`span`,{className:`truncate max-w-[150px] sm:max-w-[200px] md:max-w-[300px] text-muted-foreground group-hover/file:text-foreground font-mono text-xs transition-colors`,children:e.name})]}),(0,o.jsx)(Y,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive`,onClick:()=>g(t),children:(0,o.jsx)(l.X,{className:`h-3 w-3`})}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-transparent via-primary/5 to-transparent -translate-x-full group-hover/file:animate-[shimmer_1s_infinite] pointer-events-none`})]},t))})]})]})},{namespace:`ui`,label:`File Upload`,inputs:[{name:`label`,type:`string`},{name:`buttonText`,type:`string`},{name:`accept`,type:`string`,description:`MIME types (e.g., "image/*,application/pdf")`},{name:`multiple`,type:`boolean`},{name:`id`,type:`string`,required:!0}],defaultProps:{label:`Upload files`,buttonText:`Choose files`,multiple:!0,id:`file-upload-field`}});var Ic=(0,f.cva)(`flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function Lc({className:e,orientation:t,...n}){return(0,o.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:q(Ic({orientation:t}),e),...n})}function Rc({className:e,asChild:t=!1,...n}){return(0,o.jsx)(t?d.Slot:`div`,{className:q(`bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...n})}function zc({className:e,orientation:t=`vertical`,...n}){return(0,o.jsx)(ti,{"data-slot":`button-group-separator`,orientation:t,className:q(`bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto`,e),...n})}function Bc({options:e,value:t,onValueChange:n,placeholder:r=`Select option...`,searchPlaceholder:i=`Search...`,emptyText:s=`No option found.`,className:c,disabled:u,...d}){let[f,p]=a.useState(!1);return(0,o.jsxs)(Lr,{open:f,onOpenChange:p,children:[(0,o.jsx)(Rr,{asChild:!0,children:(0,o.jsxs)(Y,{type:`button`,...d,variant:`outline`,role:`combobox`,"aria-expanded":f,className:q(`w-[200px] min-w-0 justify-between`,c),disabled:u,children:[(0,o.jsx)(`span`,{className:`truncate`,children:t?e.find(e=>e.value===t)?.label:r}),(0,o.jsx)(l.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,o.jsx)(zr,{className:`w-[var(--radix-popover-trigger-width)] min-w-[200px] p-0`,children:(0,o.jsxs)(Wt,{children:[(0,o.jsx)(Kt,{placeholder:i}),(0,o.jsxs)(qt,{children:[(0,o.jsx)(Jt,{children:s}),(0,o.jsx)(Yt,{children:e.map(e=>(0,o.jsxs)(Zt,{value:e.value,keywords:typeof e.label==`string`?[e.label]:void 0,disabled:e.disabled,onSelect:e=>{n?.(e===t?``:e),p(!1)},children:[(0,o.jsx)(l.Check,{className:q(`mr-2 h-4 w-4`,t===e.value?`opacity-100`:`opacity-0`)}),e.label]},e.value))})]})]})})]})}function Vc({label:e,value:t,onClick:n,children:r,className:i}){return(0,o.jsxs)(n?`button`:`div`,{className:q(`flex items-center justify-between py-1.5 min-h-[32px] w-full text-left`,n&&`cursor-pointer hover:bg-accent/50 rounded-sm -mx-1 px-1`,i),onClick:n,type:n?`button`:void 0,children:[(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 max-w-[45%] truncate`,title:e,children:e}),r||(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate ml-4 text-right max-w-[55%]`,title:t,children:t})]})}var Hc=[{value:`equals`,label:`Equals`},{value:`not_equals`,label:`Does not equal`},{value:`contains`,label:`Contains`},{value:`icontains`,label:`Contains (ignore case)`},{value:`not_contains`,label:`Does not contain`},{value:`is_empty`,label:`Is empty`},{value:`is_not_empty`,label:`Is not empty`},{value:`greater_than`,label:`Greater than`},{value:`less_than`,label:`Less than`},{value:`greater_than_or_equal`,label:`Greater than or equal`},{value:`less_than_or_equal`,label:`Less than or equal`},{value:`before`,label:`Before`},{value:`after`,label:`After`},{value:`between`,label:`Between`},{value:`in`,label:`In`},{value:`not_in`,label:`Not in`},{value:`starts_with`,label:`Starts with`},{value:`ends_with`,label:`Ends with`},{value:`is_null`,label:`Is null`},{value:`is_not_null`,label:`Is not null`},{value:`exists`,label:`Is set`},{value:`notExists`,label:`Is not set`}],Uc=new Set([`exists`,`notExists`]),Wc=Hc.map(e=>e.value),Gc=new Set(Wc);function Kc(e){return Gc.has(e)}var qc=new Map([[`containsCaseInsensitive`,`icontains`]]);function Jc(e){let t=qc.get(e);if(t!==void 0)return t;let n=(0,U.normalizeFilterOperator)(e);return typeof n==`string`?n:e}function Yc(e){let t=!1,n=e.conditions.map(e=>{if(!e||typeof e.operator!=`string`)return e;let n=Jc(e.operator);return n===e.operator||!Kc(n)?e:(t=!0,{...e,operator:n})});return t?{...e,conditions:n}:e}var Xc=new Set([`is_empty`,`is_not_empty`,`is_null`,`is_not_null`,`exists`,`notExists`]),Zc=new Set(U.VIEW_FILTER_LIST_VALUE_OPERATORS),Qc=new Set(U.VIEW_FILTER_PAIR_VALUE_OPERATORS);function $c(e){let t=Jc(e);return Zc.has(t)?`list`:Qc.has(t)?`pair`:`scalar`}function el(e,t){switch($c(t)){case`list`:return Array.isArray(e)?e:Pl(e);case`pair`:{let[t=``,n=``]=Pl(e);return t===``&&n===``?[]:[t,n]}default:return Array.isArray(e)?e[0]??``:e}}function tl(e,t){let n=Jc(e);return t.some(e=>Jc(e.value)===n)?e:t[0]?.value??e}function nl(e,t){let n=Jc(e);return t.find(e=>Jc(e.value)===n)?.value??e}function rl(e){let t=e||`text`;return wl.includes(t)?`number`:t===`boolean`?`boolean`:t===`date`?`date`:t===`datetime`?`datetime`:t===`time`?`time`:`text`}var il={text:`text`,number:`number`,date:`date`,datetime:`datetime-local`,time:`time`,boolean:`text`},al=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?$/,ol=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function sl(e,t,n){return Number(e)<=23&&Number(t)<=59&&(n===void 0||Number(n)<=59)}function cl(e,n){if(e===``)return``;switch(n){case`text`:return typeof e==`string`?e:String(e);case`number`:{if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`boolean`)return;let t=e.trim();if(t===``)return``;let n=Number(t);return Number.isFinite(n)?n:void 0}case`boolean`:{if(typeof e==`boolean`)return e;if(typeof e==`number`)return;let t=e.trim().toLowerCase();return t===`true`||t!==`false`&&void 0}case`date`:{if(typeof e!=`string`)return;let n=e.trim(),r=al.exec(n);return r?(0,t.isRealCalendarDate)(r[1])&&sl(r[2],r[3],r[4])?r[1]:void 0:(0,t.isRealCalendarDate)(n)?n:void 0}case`datetime`:{if(typeof e!=`string`)return;let n=e.trim(),r=al.exec(n);return r&&(0,t.isRealCalendarDate)(r[1])&&sl(r[2],r[3],r[4])?n:void 0}case`time`:{if(typeof e!=`string`)return;let t=e.trim(),n=ol.exec(t);return n&&sl(n[1],n[2],n[3])?t:void 0}}}function ll(e,t,n){let r=rl(t);switch($c(n)){case`list`:{let t=[];for(let n of Pl(e)){let e=cl(n,r);e!==void 0&&e!==``&&t.push(e)}return t}case`pair`:{let[t=``,n=``]=Pl(e),i=cl(t,r)??``,a=cl(n,r)??``;return i===``&&a===``?[]:[i,a]}default:return cl(Array.isArray(e)?e[0]??``:e,r)??``}}function ul(e){return(e?.options??[]).map(e=>String(e.value))}function dl(e){let t=e?.options;return Array.isArray(t)&&t.length>0}function fl(e,t){if(!e?.options)return!1;let n=e.type||``;switch($c(t)){case`list`:return!0;case`pair`:return!1;default:return El.includes(n)||Dl.includes(n)}}function pl(e,t,n){if(!dl(t)||!fl(t,n))return e;let r=new Set(ul(t));if($c(n)===`list`)return Pl(e).filter(e=>r.has(String(e)));let i=Array.isArray(e)?e[0]??``:e;return Ml(i)?``:r.has(String(i))?i:``}function ml(e,t){if($c(e)===`pair`){let e=Pl(t??``);return e.length===2&&!Ml(e[0])&&!Ml(e[1])}return!(t==null||t===``||Array.isArray(t)&&t.length===0)}function hl(e){let[t=``,n=``]=Pl(e);return[t,n]}var gl=(0,_.createSafeTranslation)({"filterBuilder.where":`Where`,"filterBuilder.and":`AND`,"filterBuilder.or":`OR`,"filterBuilder.clearAll":`Clear all`,"filterBuilder.selectField":`Select field`,"filterBuilder.operator":`Operator`,"filterBuilder.selectValue":`Select value`,"filterBuilder.value":`Value`,"filterBuilder.addFilter":`Add filter`,"filterBuilder.removeCondition":`Remove condition`,"filterBuilder.trueLabel":`True`,"filterBuilder.falseLabel":`False`,"filterBuilder.noResults":`No results`,"filterBuilder.searchField":`Search {{label}}…`,"filterBuilder.enterId":`Enter {{label}} id`,"filterBuilder.addValue":`Type a value, press Enter`,"filterBuilder.removeValue":`Remove {{value}}`,"filterBuilder.rangeStart":`From`,"filterBuilder.rangeEnd":`To`,"filterBuilder.operators.equals":`Equals`,"filterBuilder.operators.not_equals":`Does not equal`,"filterBuilder.operators.contains":`Contains`,"filterBuilder.operators.icontains":`Contains (ignore case)`,"filterBuilder.operators.not_contains":`Does not contain`,"filterBuilder.operators.is_empty":`Is empty`,"filterBuilder.operators.is_not_empty":`Is not empty`,"filterBuilder.operators.greater_than":`Greater than`,"filterBuilder.operators.less_than":`Less than`,"filterBuilder.operators.greater_than_or_equal":`Greater than or equal`,"filterBuilder.operators.less_than_or_equal":`Less than or equal`,"filterBuilder.operators.before":`Before`,"filterBuilder.operators.after":`After`,"filterBuilder.operators.between":`Between`,"filterBuilder.operators.in":`In`,"filterBuilder.operators.not_in":`Not in`,"filterBuilder.operators.starts_with":`Starts with`,"filterBuilder.operators.ends_with":`Ends with`,"filterBuilder.operators.is_null":`Is null`,"filterBuilder.operators.is_not_null":`Is not null`,"filterBuilder.operators.exists":`Is set`,"filterBuilder.operators.notExists":`Is not set`,"filterBuilder.emptyCheckHint.text":`"{{isEmpty}}" also matches blank text; "{{isNull}}" matches only a missing value.`,"filterBuilder.emptyCheckHint.list":`"{{isEmpty}}" also matches an empty list; "{{isNull}}" matches only a missing value.`,"validation.required":`{{field}} is required`},`filterBuilder.where`),_l=[`is_null`,`is_not_null`,`exists`,`notExists`],vl=[`equals`,`not_equals`,`contains`,`icontains`,`not_contains`,`starts_with`,`ends_with`,`is_empty`,`is_not_empty`,..._l],yl=[`equals`,`not_equals`,`greater_than`,`less_than`,`greater_than_or_equal`,`less_than_or_equal`,`is_empty`,`is_not_empty`,..._l],bl=[`equals`,`not_equals`],xl=[`equals`,`not_equals`,`before`,`after`,`between`,`is_empty`,`is_not_empty`,..._l],Sl=[`equals`,`not_equals`,`in`,`not_in`,`is_empty`,`is_not_empty`,..._l],Cl=[`equals`,`not_equals`,`in`,`not_in`,`is_empty`,`is_not_empty`,..._l],wl=[`number`,`currency`,`percent`,`rating`],Tl=[`date`,`datetime`,`time`],El=[`select`,`status`],Dl=[`lookup`,`master_detail`,`user`];function Ol(e,n=[]){let r=e||`text`,i=(0,t.isRetiredFieldType)(r);i&&(0,t.reportRetiredFieldType)(r);let a=i?vl:wl.includes(r)?yl:r===`boolean`?bl:Tl.includes(r)?xl:El.includes(r)?Sl:Dl.includes(r)?Cl:vl,o=new Set(n);return Hc.filter(e=>a.includes(e.value)&&(!Uc.has(e.value)||o.has(e.value)))}var kl=new Set([`is_null`,`is_not_null`]);function Al(e){return(0,oe.expandEmptyOperator)({type:e||`text`}).arm}function jl(e,t,n){let r=Ol(e,t);if(Al(e)!==`null_only`)return r;let i=Jc(n);return r.filter(e=>!kl.has(e.value)||e.value===i)}function Ml(e){return e==null||e===``}function Nl(e){return Ml(e)?``:String(e)}function Pl(e){return Array.isArray(e)?e:Ml(e)?[]:[e]}function Fl(e){return!!e&&typeof e==`object`&&Array.isArray(e.conditions)&&(e.logic===`and`||e.logic===`or`)}var Il={id:`root`,logic:`and`,conditions:[]};function Ll({fields:e=[],value:n,onChange:r,className:i,showClearAll:s=!0,extraOperators:c}){let{t:u}=gl(),[d,f]=a.useState(Fl(n)?Yc(n):Il);a.useEffect(()=>{if(!Fl(n))return;let e=Yc(n);JSON.stringify(e)!==JSON.stringify(d)&&f(e)},[n]);let p=e=>{f(e),r?.(e)},m=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,operator:`equals`,value:``};p({...d,conditions:[...d.conditions,t]})},h=e=>{p({...d,conditions:d.conditions.filter(t=>t.id!==e)})},g=()=>{p({...d,conditions:[]})},_=(e,t)=>{p({...d,conditions:d.conditions.map(n=>n.id===e?{...n,...t}:n)})},v=(e,t)=>{p({...d,conditions:d.conditions.map(n=>n.id===e?{...n,operator:t,value:el(n.value,t)}:n)})},y=()=>{p({...d,logic:d.logic===`and`?`or`:`and`})},b=t=>Ol(e.find(e=>e.value===t)?.type,c),x=t=>jl(e.find(e=>e.value===t.field)?.type,c,t.operator),S=t=>{let n=new Set(x(t).map(e=>e.value));if(!n.has(`is_empty`)||!n.has(`is_null`))return null;let r=e.find(e=>e.value===t.field),i={isEmpty:u(`filterBuilder.operators.is_empty`),isNull:u(`filterBuilder.operators.is_null`)},a=Al(r?.type);return a===`null_only`?null:(0,o.jsx)(`p`,{className:`mt-1 border-t px-2 pb-1 pt-1.5 text-xs text-muted-foreground`,"data-testid":`filter-empty-check-hint`,children:u(a===`text`?`filterBuilder.emptyCheckHint.text`:`filterBuilder.emptyCheckHint.list`,i)})},C=(t,n)=>{let r=b(n),i=e.find(e=>e.value===n),a=i?.type;p({...d,conditions:d.conditions.map(e=>{if(e.id!==t)return e;let o=tl(e.operator,r),s=Kc(o)?o:e.operator,c=ll(s===e.operator?e.value:el(e.value,s),a,s);return{...e,field:n,operator:s,value:pl(c,i,s)}})})},w=e=>!Xc.has(Jc(e)),T=t=>il[rl(e.find(e=>e.value===t)?.type)],E=n=>{let r=e.find(e=>e.value===n.field),i=$c(n.operator),a=i===`list`,s=(0,t.isRetiredFieldType)(r?.type);if(s&&(0,t.reportRetiredFieldType)(r.type),!s&&Dl.includes(r?.type||``)&&!dl(r)&&(r?.referenceTo||r?.type===`user`))return(0,o.jsx)(Vl,{field:r,value:n.value,multiple:a,onChange:e=>_(n.id,{value:e})});if(r?.options&&a){let e=Pl(n.value),t=ul(r),i=[...new Set(e.map(String).filter(e=>!t.includes(e)))];return(0,o.jsxs)(`div`,{className:`max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2`,children:[i.map(t=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer bg-primary/5 text-primary`,"data-testid":`filter-value-outside-options-${n.field}`,children:[(0,o.jsx)(Ot,{checked:!0,onCheckedChange:()=>_(n.id,{value:e.filter(e=>String(e)!==t)})}),(0,o.jsx)(`span`,{className:`truncate`,children:t})]},`outside-${t}`)),r.options.map(t=>{let r=e.map(String).includes(String(t.value));return(0,o.jsxs)(`label`,{className:q(`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer`,r?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,o.jsx)(Ot,{checked:r,onCheckedChange:r=>{let i=r?[...e,t.value]:e.filter(e=>String(e)!==String(t.value));_(n.id,{value:i})}}),(0,o.jsx)(`span`,{className:`truncate`,children:t.label})]},t.value)})]})}if(a)return(0,o.jsx)(Bl,{values:Pl(n.value),inputType:T(n.field),numeric:wl.includes(r?.type||``),testId:`filter-multi-value-${n.field}`,onChange:e=>_(n.id,{value:e})});let c=rl(r?.type),l=Rl(c),d=c===`date`||c===`datetime`?c:void 0;if(i===`pair`){let e=hl(n.value),t=T(n.field),i=wl.includes(r?.type||``),a=Ml(e[0])===Ml(e[1])?null:+!Ml(e[0]),s=`filter-range-incomplete-${n.id}`,c=u(a===0?`filterBuilder.rangeStart`:`filterBuilder.rangeEnd`),f=e=>a===e||void 0,p=(t,r)=>{let a=[e[0],e[1]];a[t]=i?cl(r,`number`)??``:r,_(n.id,{value:a[0]===``&&a[1]===``?[]:a})},m=i=>{let m=u(i===0?`filterBuilder.rangeStart`:`filterBuilder.rangeEnd`);return l&&d?(0,o.jsx)(zl,{widget:l,family:d,field:r,value:e[i],onChange:e=>p(i,e),label:m,error:a===i?u(`validation.required`,{field:c}):void 0,className:a===i?`border-destructive`:void 0,testId:`filter-range-${n.field}-${i===0?`start`:`end`}`}):(0,o.jsx)(Q,{type:t,className:q(`h-9 text-sm`,a===i&&`border-destructive`),placeholder:m,"aria-label":m,"aria-invalid":f(i),"aria-describedby":a===i?s:void 0,value:Nl(e[i]),onChange:e=>p(i,e.target.value)})};return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-testid":`filter-range-${n.field}`,children:[m(0),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`-`}),m(1)]}),a!==null&&(0,o.jsx)(`p`,{id:s,className:`text-xs text-destructive`,children:u(`validation.required`,{field:c})})]})}if(r?.options&&(El.includes(r.type||``)||Dl.includes(r.type||``))){let e=Nl(n.value),t=e!==``&&!ul(r).includes(e);return(0,o.jsxs)(Gr,{value:e,onValueChange:e=>_(n.id,{value:e}),children:[(0,o.jsx)(Jr,{className:`h-9 text-sm`,children:(0,o.jsx)(qr,{placeholder:u(`filterBuilder.selectValue`)})}),(0,o.jsxs)(Zr,{children:[t&&(0,o.jsx)($r,{value:e,"data-testid":`filter-value-outside-options-${n.field}`,children:e}),r.options.map(e=>(0,o.jsx)($r,{value:e.value,children:e.label},e.value))]})]})}if(r?.type===`boolean`)return(0,o.jsxs)(Gr,{value:Nl(n.value),onValueChange:e=>_(n.id,{value:e===`true`}),children:[(0,o.jsx)(Jr,{className:`h-9 text-sm`,children:(0,o.jsx)(qr,{placeholder:u(`filterBuilder.selectValue`)})}),(0,o.jsxs)(Zr,{children:[(0,o.jsx)($r,{value:`true`,children:u(`filterBuilder.trueLabel`)}),(0,o.jsx)($r,{value:`false`,children:u(`filterBuilder.falseLabel`)})]})]});if(l&&d)return(0,o.jsx)(zl,{widget:l,family:d,field:r,value:n.value,onChange:e=>_(n.id,{value:e}),label:u(`filterBuilder.value`),testId:`filter-value-${n.field}`});let f=T(n.field),p=()=>Ml(n.value)?``:f===`date`&&typeof n.value==`string`?n.value.split(`T`)[0]:Nl(n.value),m=e=>{let t=e;wl.includes(r?.type||``)?t=cl(e,`number`)??``:Tl.includes(r?.type||``)&&(t=e),_(n.id,{value:t})};return(0,o.jsx)(Q,{type:f,className:`h-9 text-sm`,placeholder:u(`filterBuilder.value`),value:p(),onChange:e=>m(e.target.value)})};return(0,o.jsxs)(`div`,{className:q(`space-y-3`,i),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:u(`filterBuilder.where`)}),d.conditions.length>1&&(0,o.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:y,className:`h-7 text-xs`,children:d.logic===`or`?u(`filterBuilder.or`):u(`filterBuilder.and`)})]}),s&&d.conditions.length>0&&(0,o.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,onClick:g,className:`h-7 text-xs text-muted-foreground hover:text-destructive`,children:[(0,o.jsx)(l.Trash2,{className:`h-3 w-3 mr-1`}),u(`filterBuilder.clearAll`)]})]}),(0,o.jsx)(`div`,{className:`space-y-2`,children:d.conditions.map(t=>(0,o.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex-1 grid grid-cols-12 gap-2`,children:[(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Gr,{value:t.field,onValueChange:e=>C(t.id,e),children:[(0,o.jsx)(Jr,{className:`h-9 text-sm`,children:(0,o.jsx)(qr,{placeholder:u(`filterBuilder.selectField`)})}),(0,o.jsx)(Zr,{children:e.map(e=>(0,o.jsx)($r,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Gr,{value:nl(t.operator,x(t)),onValueChange:e=>{Kc(e)&&v(t.id,e)},children:[(0,o.jsx)(Jr,{className:`h-9 text-sm`,children:(0,o.jsx)(qr,{placeholder:u(`filterBuilder.operator`)})}),(0,o.jsxs)(Zr,{children:[x(t).map(e=>(0,o.jsx)($r,{value:e.value,children:u(`filterBuilder.operators.${e.value}`)},e.value)),S(t)]})]})}),w(t.operator)&&(0,o.jsx)(`div`,{className:`col-span-4`,children:E(t)})]}),(0,o.jsxs)(Y,{type:`button`,variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>h(t.id),children:[(0,o.jsx)(l.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:u(`filterBuilder.removeCondition`)})]})]},t.id))}),(0,o.jsxs)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:m,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3`}),u(`filterBuilder.addFilter`)]})]})}Ll.displayName=`FilterBuilder`;function Rl(e){if(e===`date`||e===`datetime`)return t.ComponentRegistry.get(e,`field`)}function zl({widget:e,family:n,field:r,value:i,onChange:s,label:c,error:l,className:u,testId:d}){let f=a.useRef(null),p=a.useId();return a.useEffect(()=>{if(typeof document>`u`)return;let e=e=>{let t=f.current;if(!t)return;let n=document.activeElement;n instanceof HTMLElement&&t.contains(n)&&(e.target instanceof Node&&t.contains(e.target)||n.blur())};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]),(0,o.jsxs)(`div`,{ref:f,className:`min-w-0 flex-1`,"data-testid":d,children:[(0,o.jsx)(`label`,{htmlFor:p,className:`sr-only`,children:c}),(0,o.jsx)(a.Suspense,{fallback:(0,o.jsx)(`div`,{"aria-busy":`true`,"data-testid":`filter-value-loading`,className:`h-9 w-full rounded-md border border-input bg-muted/40`}),children:(0,o.jsx)(e,{id:p,field:{name:r.value,label:r.label,type:n},value:i===void 0?``:Nl(i),onChange:e=>{let r=typeof e==`string`?e:``;s(n===`datetime`?(0,t.toDateTimeInputValue)(r):r)},error:l,className:q(`h-9 text-sm`,u)})})]})}function Bl({values:e,inputType:t,numeric:n,testId:r,onChange:i}){let{t:s}=gl(),[c,u]=a.useState(``),d=t=>{let r=t.trim();if(r===``)return;let a=n?cl(r,`number`):r;a!==void 0&&a!==``&&(u(``),!e.some(e=>String(e)===String(a))&&i([...e,a]))},f=t=>{i(e.filter((e,n)=>n!==t))};return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background p-1.5`,"data-testid":r,children:[e.map((e,t)=>(0,o.jsxs)(Xe,{variant:`secondary`,className:`gap-1`,children:[(0,o.jsx)(`span`,{className:`truncate max-w-[12ch]`,children:String(e)}),(0,o.jsx)(`button`,{type:`button`,onClick:()=>f(t),className:`ml-0.5 rounded-full text-muted-foreground hover:text-foreground`,"aria-label":s(`filterBuilder.removeValue`,{value:String(e)}),children:(0,o.jsx)(l.X,{className:`h-3 w-3`})})]},`${String(e)}-${t}`)),(0,o.jsx)(Q,{type:t,value:c,onChange:e=>u(e.target.value),onKeyDown:t=>{t.key===`Enter`||t.key===`,`?(t.preventDefault(),d(c)):t.key===`Backspace`&&c===``&&e.length>0&&f(e.length-1)},onBlur:()=>d(c),placeholder:e.length===0?s(`filterBuilder.addValue`):``,"aria-label":s(`filterBuilder.addValue`),className:`h-7 flex-1 border-0 bg-transparent p-0 px-1 shadow-none focus-visible:ring-0 min-w-[6ch] text-sm`})]})}Bl.displayName=`MultiValueInput`;function Vl({field:e,value:t,multiple:n,onChange:r}){let{t:s}=gl(),c=a.useContext(i.SchemaRendererContext)?.dataSource??null,u=e.referenceTo||(e.type===`user`?`users`:void 0),d=e.displayField||`name`,f=e.idField||`id`,[p,m]=a.useState(!1),[h,g]=a.useState(``),[_,v]=a.useState([]),[y,b]=a.useState(!1),[x,S]=a.useState(null),[C,w]=a.useState({}),T=a.useRef(null),E=a.useMemo(()=>n?Pl(t).map(e=>String(e)):Ml(t)?[]:[String(t)],[t,n]),D=c!=null&&typeof c.find==`function`&&!!u,O=a.useCallback(e=>{let t=e?.[f]??e?.id??e?._id,n=e?.[d]??e?.label??e?.name??String(t);return{value:t,label:String(n)}},[d,f]),k=a.useCallback(async e=>{if(D){b(!0),S(null);try{let t={$top:50};e&&e.trim()&&(t.$search=e.trim());let n=await c.find(u,t),r=(n?.data??n??[]).map(O);v(r),r.length>0&&w(e=>{let t={...e};for(let e of r)t[String(e.value)]=e.label;return t})}catch(e){S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}}},[c,u,D,O]);a.useEffect(()=>{if(!D||E.length===0)return;let e=E.filter(e=>!(e in C));if(e.length===0)return;let t=!1;return(async()=>{try{let n=await c.find(u,{$top:e.length,$filter:{[f]:{$in:e}}}),r=n?.data??n??[];if(t)return;w(e=>{let t={...e};for(let e of r){let n=O(e);t[String(n.value)]=n.label}return t})}catch{}})(),()=>{t=!0}},[E,D,c,u,f,O,C]),a.useEffect(()=>{p&&D&&_.length===0&&k()},[p]);let A=e=>{g(e),D&&(T.current&&clearTimeout(T.current),T.current=setTimeout(()=>k(e||void 0),300))},j=e=>{if(n){let n=Pl(t);r(n.map(String).includes(String(e))?n.filter(t=>String(t)!==String(e)):[...n,e])}else r(e),m(!1)};return D?(0,o.jsxs)(Lr,{open:p,onOpenChange:m,children:[(0,o.jsx)(Rr,{asChild:!0,children:(0,o.jsxs)(`button`,{type:`button`,className:q(`inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm`,`hover:bg-accent hover:text-accent-foreground`,`focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1`),"data-testid":`lookup-picker-${e.value}`,children:[E.length===0?(0,o.jsx)(`span`,{className:`text-muted-foreground truncate`,children:s(`filterBuilder.searchField`,{label:e.label})}):n?(0,o.jsx)(`span`,{className:`truncate`,children:E.length===1?C[E[0]]||E[0]:`${E.length} selected`}):(0,o.jsx)(`span`,{className:`truncate`,children:C[E[0]]||E[0]}),(0,o.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[E.length>0&&(0,o.jsx)(l.X,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(n?[]:``)}}),(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5 opacity-60`})]})]})}),(0,o.jsxs)(zr,{align:`start`,className:`w-72 p-0`,children:[(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,children:[(0,o.jsx)(l.Search,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,o.jsx)(`input`,{autoFocus:!0,value:h,onChange:e=>A(e.target.value),placeholder:s(`filterBuilder.searchField`,{label:e.label}),className:`flex h-9 w-full bg-transparent px-2 py-1 text-sm outline-none placeholder:text-muted-foreground`,"data-testid":`lookup-search-${e.value}`}),y&&(0,o.jsx)(l.Loader2,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`})]}),(0,o.jsxs)(`div`,{className:`max-h-64 overflow-y-auto p-1`,"data-testid":`lookup-options-${e.value}`,children:[x&&(0,o.jsx)(`div`,{className:`px-3 py-2 text-xs text-destructive`,children:x}),!x&&!y&&_.length===0&&(0,o.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:s(`filterBuilder.noResults`)}),_.map(e=>{let t=E.includes(String(e.value));return(0,o.jsxs)(`label`,{className:q(`flex items-center gap-2 px-2 py-1.5 rounded text-sm cursor-pointer`,t?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[n?(0,o.jsx)(Ot,{checked:t,onCheckedChange:()=>j(e.value)}):(0,o.jsx)(`input`,{type:`radio`,checked:t,onChange:()=>j(e.value),className:`rounded-full border-input`}),(0,o.jsx)(`span`,{className:`truncate flex-1`,children:e.label})]},String(e.value))})]})]})]}):n?(0,o.jsx)(Bl,{values:Pl(t),inputType:`text`,numeric:!1,testId:`lookup-ids-${e.value}`,onChange:r}):(0,o.jsx)(Q,{className:`h-9 text-sm`,placeholder:s(`filterBuilder.enterId`,{label:e.label}),value:E[0]??``,onChange:e=>r(e.target.value)})}var Hl=(0,_.createSafeTranslation)({"sortBuilder.sortBy":`Sort by`,"sortBuilder.thenBy":`Then by`,"sortBuilder.selectField":`Select field`,"sortBuilder.ascending":`A → Z`,"sortBuilder.descending":`Z → A`,"sortBuilder.addSort":`Add sort`,"sortBuilder.removeSort":`Remove sort`},`sortBuilder.sortBy`);function Ul({fields:e=[],value:t=[],onChange:n,className:r}){let{t:i}=Hl(),s=a.useCallback(e=>(e||[]).map((e,t)=>({id:e?.id??(typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`sort-${t}-${e?.field??``}`),field:e?.field??``,order:e?.order??e?.sortOrder??`asc`})),[]),[c,u]=a.useState(()=>s(t));a.useEffect(()=>{let e=s(t),n=e=>e.map(({id:e,...t})=>t);JSON.stringify(n(e))!==JSON.stringify(n(c))&&u(e)},[t,c,s]);let d=e=>{u(e),n?.(e)},f=e.find(e=>!e.disabled),p=()=>{let e={id:crypto.randomUUID(),field:f?.value||``,order:`asc`};d([...c,e])},m=(e,t)=>{d(c.map(n=>n.id===e?{...n,...t}:n))},h=e=>{d(c.filter(t=>t.id!==e))};return(0,o.jsxs)(`div`,{className:q(`space-y-3`,r),children:[(0,o.jsx)(`div`,{className:`space-y-2`,children:c.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium w-16 text-muted-foreground`,children:i(n===0?`sortBuilder.sortBy`:`sortBuilder.thenBy`)}),(0,o.jsx)(`div`,{className:`flex-1`,children:(0,o.jsxs)(Gr,{value:t.field,onValueChange:e=>m(t.id,{field:e}),children:[(0,o.jsx)(Jr,{className:`h-9`,children:(0,o.jsx)(qr,{placeholder:i(`sortBuilder.selectField`)})}),(0,o.jsx)(Zr,{children:e.map(e=>(0,o.jsx)($r,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`w-28`,children:(0,o.jsxs)(Gr,{value:t.order,onValueChange:e=>m(t.id,{order:e}),children:[(0,o.jsx)(Jr,{className:`h-9`,children:(0,o.jsx)(qr,{})}),(0,o.jsxs)(Zr,{children:[(0,o.jsx)($r,{value:`asc`,children:i(`sortBuilder.ascending`)}),(0,o.jsx)($r,{value:`desc`,children:i(`sortBuilder.descending`)})]})]})}),(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>h(t.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`})})]},t.id))}),(0,o.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:p,className:`h-8`,disabled:!f,children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3 mr-2`}),i(`sortBuilder.addSort`)]})]})}var Wl=(0,_.createSafeTranslation)({"common.select":`Select…`},`common.select`);function Gl({field:e,value:t,onChange:n,draft:r,objectDef:i}){let{t:a}=Wl();if(e.visibleWhen&&!e.visibleWhen(r))return null;let s=e.disabled||(e.disabledWhen?e.disabledWhen(r):!1),c=t??e.defaultValue,u=null;switch(e.type){case`input`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsx)(Q,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,value:c??``,placeholder:e.placeholder,disabled:s,onChange:e=>n(e.target.value)})});break;case`textarea`:u=(0,o.jsx)(Vc,{label:e.label,className:`flex-col items-stretch gap-1`,children:(0,o.jsx)(ha,{"data-testid":`config-field-${e.key}`,className:`min-h-[60px] w-full text-xs`,value:c??``,placeholder:e.placeholder,disabled:s,rows:3,onChange:e=>n(e.target.value)})});break;case`switch`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsx)(na,{"data-testid":`config-field-${e.key}`,checked:!!c,disabled:s,onCheckedChange:e=>n(e),className:`scale-75`})});break;case`checkbox`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsx)(Ot,{"data-testid":`config-field-${e.key}`,checked:!!c,disabled:s,onCheckedChange:e=>n(e)})});break;case`select`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsxs)(Gr,{value:String(c??``),onValueChange:e=>n(e),disabled:s,children:[(0,o.jsx)(Jr,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,children:(0,o.jsx)(qr,{placeholder:e.placeholder??a(`common.select`)})}),(0,o.jsx)(Zr,{children:(e.options??[]).map(e=>(0,o.jsx)($r,{value:e.value,children:e.label},e.value))})]})});break;case`slider`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-2 w-32`,children:[(0,o.jsx)(ea,{"data-testid":`config-field-${e.key}`,value:[Number(c??e.min??0)],min:e.min??0,max:e.max??100,step:e.step??1,disabled:s,onValueChange:e=>n(e[0]),"aria-label":e.label}),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground w-6 text-right`,children:c??e.min??0})]})});break;case`color`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsx)(`input`,{"data-testid":`config-field-${e.key}`,type:`color`,className:`h-7 w-10 rounded border cursor-pointer`,value:c??`#000000`,disabled:s,onChange:e=>n(e.target.value)})});break;case`icon-group`:u=(0,o.jsx)(Vc,{label:e.label,children:(0,o.jsx)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`config-field-${e.key}`,children:(e.options??[]).map(e=>(0,o.jsx)(Y,{type:`button`,size:`sm`,variant:c===e.value?`default`:`ghost`,className:q(`h-7 w-7 p-0`,c===e.value&&`ring-1 ring-primary`),disabled:s,onClick:()=>n(e.value),title:e.label,children:e.icon??(0,o.jsx)(`span`,{className:`text-[10px]`,children:e.label.charAt(0)})},e.value))})});break;case`field-picker`:u=(0,o.jsx)(Vc,{label:e.label,value:c??e.placeholder??`Select field…`,onClick:s?void 0:()=>{}});break;case`filter`:u=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(Vc,{label:e.label}),(0,o.jsx)(Ll,{fields:e.fields,value:c,onChange:n,className:`px-1 pb-2`})]});break;case`sort`:u=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(Vc,{label:e.label}),(0,o.jsx)(Ul,{fields:e.fields,value:c,onChange:n,className:`px-1 pb-2`})]});break;case`custom`:e.render&&(u=(0,o.jsx)(o.Fragment,{children:e.render(c,n,r)}));break;case`summary`:u=(0,o.jsx)(Vc,{label:e.label,onClick:e.onSummaryClick,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate max-w-[120px]`,"data-testid":`config-field-${e.key}-text`,children:e.summaryText??c??``}),e.onSummaryClick&&(0,o.jsx)(l.Settings,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`,"aria-hidden":`true`,"data-testid":`config-field-${e.key}-gear`})]})})}return u?e.helpText?(0,o.jsxs)(`div`,{children:[u,(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5 mb-1`,children:e.helpText})]}):(0,o.jsx)(o.Fragment,{children:u}):null}function Kl({title:e,icon:t,collapsible:n,collapsed:r,onToggle:i,testId:a,className:s}){let c=(0,o.jsxs)(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider flex items-center gap-1.5`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,"aria-hidden":`true`,children:t}),e]});return n?(0,o.jsxs)(`button`,{"data-testid":a,className:q(`flex items-center justify-between pt-4 pb-1.5 first:pt-0 w-full text-left`,s),onClick:i,type:`button`,"aria-expanded":!r,children:[c,r?(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3 text-muted-foreground`}):(0,o.jsx)(l.ChevronDown,{className:`h-3 w-3 text-muted-foreground`})]}):(0,o.jsx)(`div`,{className:q(`pt-4 pb-1.5 first:pt-0`,s),"data-testid":a,children:c})}var ql=(0,_.createSafeTranslation)({"common.save":`Save`,"common.discard":`Discard`},`common.save`);function Jl({open:e,onClose:t,schema:n,draft:r,isDirty:i,onFieldChange:s,onSave:c,onDiscard:u,headerExtra:d,objectDef:f,className:p,style:m,saveLabel:h,discardLabel:g,panelRef:_,role:v,ariaLabel:y,tabIndex:b,testId:x,closeTitle:S,footerTestId:C,saveTestId:w,discardTestId:T,expandedSections:E,onUndo:D,onRedo:O,canUndo:k,canRedo:A,undoLabel:j=`Undo`,redoLabel:M=`Redo`}){let[N,P]=(0,a.useState)({}),{t:F}=ql();if(!e)return null;let I=(e,t)=>{P(n=>({...n,[e]:!(n[e]??t??!1)}))},ee=(e,t)=>E&&E.includes(e)?!1:N[e]??t??!1;return(0,o.jsxs)(`div`,{ref:_,"data-testid":x??`config-panel`,role:v,"aria-label":y,tabIndex:b,style:m,className:q(`absolute inset-y-0 right-0 w-full sm:w-[var(--config-panel-width,280px)] sm:relative border-l bg-background flex flex-col shrink-0 z-20`,p),children:[(0,o.jsxs)(`div`,{className:`px-4 py-3 border-b flex items-center justify-between shrink-0`,children:[(0,o.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,o.jsx)(`ol`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:n.breadcrumb.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[t>0&&(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3`}),(0,o.jsx)(`li`,{className:q(t===n.breadcrumb.length-1&&`text-foreground font-medium`),children:e})]},t))})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D&&(0,o.jsx)(Y,{size:`sm`,variant:`ghost`,onClick:D,disabled:!k,className:`h-7 w-7 p-0`,"data-testid":`config-panel-undo`,title:j,children:(0,o.jsx)(l.Undo2,{className:`h-3.5 w-3.5`})}),O&&(0,o.jsx)(Y,{size:`sm`,variant:`ghost`,onClick:O,disabled:!A,className:`h-7 w-7 p-0`,"data-testid":`config-panel-redo`,title:M,children:(0,o.jsx)(l.Redo2,{className:`h-3.5 w-3.5`})}),d,(0,o.jsx)(Y,{size:`sm`,variant:`ghost`,onClick:t,className:`h-7 w-7 p-0`,"data-testid":`config-panel-close`,title:S,children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 overflow-auto px-4 pb-4`,children:n.sections.map((e,t)=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let n=ee(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-section-${e.key}`,children:[t>0&&(0,o.jsx)(ti,{className:`my-3`}),(0,o.jsx)(Kl,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:n,onToggle:()=>I(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`}),e.hint&&(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mb-1`,children:e.hint}),!n&&(0,o.jsxs)(`div`,{className:`space-y-1`,children:[e.fields.map(e=>(0,o.jsx)(Gl,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key)),e.subsections?.map(e=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let t=ee(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-subsection-${e.key}`,className:`ml-1`,role:`group`,"aria-label":e.title,children:[(0,o.jsx)(Kl,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:t,onToggle:()=>I(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`,className:`pt-2 pb-1`}),!t&&(0,o.jsx)(`div`,{className:`space-y-1`,children:e.fields.map(e=>(0,o.jsx)(Gl,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key))})]},e.key)})]})]},e.key)})}),i&&(0,o.jsxs)(`div`,{className:`px-4 py-2 border-t flex gap-2 shrink-0`,"data-testid":C??`config-panel-footer`,children:[(0,o.jsxs)(Y,{size:`sm`,onClick:c,"data-testid":w??`config-panel-save`,children:[(0,o.jsx)(l.Save,{className:`h-3.5 w-3.5 mr-1`}),h??F(`common.save`)]}),(0,o.jsxs)(Y,{size:`sm`,variant:`ghost`,onClick:u,"data-testid":T??`config-panel-discard`,children:[(0,o.jsx)(l.RotateCcw,{className:`h-3.5 w-3.5 mr-1`}),g??F(`common.discard`)]})]})]})}function Yl({date:e,onDateChange:t,placeholder:n=`Pick a date`,className:r,disabled:i}){let a=ft();return(0,o.jsxs)(Lr,{children:[(0,o.jsx)(Rr,{asChild:!0,children:(0,o.jsxs)(Y,{variant:`outline`,className:q(`w-[280px] justify-start text-left font-normal`,!e&&`text-muted-foreground`,r),disabled:i,children:[(0,o.jsx)(l.CalendarIcon,{className:`mr-2 h-4 w-4`}),e?(0,H.format)(e,`PPP`,{locale:a}):(0,o.jsx)(`span`,{children:n})]})}),(0,o.jsx)(zr,{className:`w-auto p-0`,children:(0,o.jsx)(pt,{mode:`single`,defaultMonth:e,selected:e,onSelect:t,autoFocus:!0})})]})}function Xl(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`detail.noValue`);return!t||t===`detail.noValue`?`No value`:t}function Zl({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty`,className:q(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg p-(--empty-padding) [--empty-padding:--spacing(6)] md:[--empty-padding:--spacing(12)] text-center text-balance`,e),...t})}function Ql({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var $l=(0,f.cva)(`flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function eu({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q($l({variant:t,className:e})),...n})}function tu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-lg font-medium tracking-tight`,e),...t})}function nu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function ru({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-content`,className:q(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function iu({className:e,glyph:t=`—`,...n}){let r=Xl();return(0,o.jsx)(`span`,{"data-slot":`empty-value`,"aria-label":r,className:q(`select-none text-muted-foreground/50 no-underline pointer-events-none`,e),...n,children:t})}var au=(0,f.cva)(`space-y-2`),ou=a.forwardRef(({className:e,label:t,description:n,error:r,required:i,htmlFor:s,children:c,...l},u)=>{let f=a.useId(),p=s||f,m=`${p}-description`,h=`${p}-error`;return(0,o.jsxs)(`div`,{ref:u,className:q(au(),e),...l,children:[t&&(0,o.jsxs)(Vn,{htmlFor:p,className:q(r&&`text-destructive`),children:[t,i&&(0,o.jsx)(`span`,{className:`ml-0.5 text-destructive`,"data-required-marker":`true`,"aria-hidden":`true`,children:`*`})]}),(0,o.jsx)(d.Slot,{id:p,"aria-describedby":[n&&m,r&&h].filter(Boolean).join(` `)||void 0,"aria-invalid":!!r,"aria-required":i||void 0,children:c}),n&&!r&&(0,o.jsx)(`p`,{id:m,className:`text-[0.8rem] text-muted-foreground`,children:n}),r&&(0,o.jsx)(`p`,{id:h,className:`text-[0.8rem] font-medium text-destructive`,children:r})]})});ou.displayName=`FieldContainer`;var su=a.forwardRef(({className:e,startContent:t,endContent:n,children:r,...i},a)=>(0,o.jsxs)(`div`,{ref:a,className:q(`flex w-full items-center rounded-md border border-input bg-transparent ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,`has-[[data-invalid]]:border-destructive`,e),...i,children:[t&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-r h-full self-stretch rounded-l-md`,children:t}),(0,o.jsx)(`div`,{className:`flex-1 relative [&_input]:border-0 [&_input]:shadow-none [&_input]:focus-visible:ring-0 [&_input]:bg-transparent`,children:r}),n&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-l h-full self-stretch rounded-r-md`,children:n})]}));su.displayName=`InputGroup`;function cu({className:e,...t}){return(0,o.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:q(`group/item-group flex flex-col`,e),...t})}function lu({className:e,...t}){return(0,o.jsx)(ti,{"data-slot":`item-separator`,orientation:`horizontal`,className:q(`my-0`,e),...t})}var uu=(0,f.cva)(`group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,{variants:{variant:{default:`bg-transparent`,outline:`border-border`,muted:`bg-muted/50`},size:{default:`p-4 gap-4 `,sm:`py-3 px-4 gap-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function du({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,o.jsx)(r?d.Slot:`div`,{"data-slot":`item`,"data-variant":t,"data-size":n,className:q(uu({variant:t,size:n,className:e})),...i})}var fu=(0,f.cva)(`flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5`,{variants:{variant:{default:`bg-transparent`,icon:`size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4`,image:`size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function pu({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:q(fu({variant:t,className:e})),...n})}function mu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-content`,className:q(`flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none`,e),...t})}function hu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-title`,className:q(`flex w-fit items-center gap-2 text-sm leading-snug font-medium`,e),...t})}function gu({className:e,...t}){return(0,o.jsx)(`p`,{"data-slot":`item-description`,className:q(`text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function _u({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-actions`,className:q(`flex items-center gap-2`,e),...t})}function vu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-header`,className:q(`flex basis-full items-center justify-between gap-2`,e),...t})}function yu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-footer`,className:q(`flex basis-full items-center justify-between gap-2`,e),...t})}function bu({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd`,className:q(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,e),...t})}function xu({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-1`,e),...t})}var Su=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(`select`,{className:q(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n,children:t}));Su.displayName=`NativeSelect`;var Cu=`[data-radix-popper-content-wrapper],[data-radix-select-content],[data-radix-select-viewport]`;function wu(e){return!!e?.closest?.(Cu)}function Tu(e){let t=a.useRef(!1);return a.useEffect(()=>{let e=e=>{let n=e.target;t.current=!!document.querySelector(Cu)||!!n?.closest?.(`[role="dialog"]`)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]),a.useCallback(n=>{let r=n.detail?.originalEvent,i=r?.target??null;if(wu(i)||i?.closest?.(`[role="dialog"]`)){n.preventDefault();return}if(r?.type===`pointerdown`&&t.current){n.preventDefault();return}e?.(n)},[e])}var Eu=a.forwardRef(({className:e,children:t,onInteractOutside:n,showCloseButton:r=!0,...i},a)=>{let s=Tu(n);return(0,o.jsxs)(It,{children:[(0,o.jsx)(Rt,{}),(0,o.jsxs)(S.Content,{ref:a,onInteractOutside:s,className:q(`fixed inset-0 z-50 w-full bg-background p-4 shadow-lg duration-200`,`h-[100dvh]`,`sm:inset-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%]`,`sm:max-w-lg sm:h-auto sm:max-h-[90vh] sm:rounded-lg sm:border sm:p-6`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]`,`data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...i,children:[t,r&&(0,o.jsxs)(S.Close,{className:q(`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity`,`hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,`disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 flex items-center justify-center`),children:[(0,o.jsx)(l.X,{className:`h-5 w-5 sm:h-4 sm:w-4`}),(0,o.jsx)(Nt,{})]})]})]})});Eu.displayName=`MobileDialogContent`;var Du=(0,_.createSafeTranslation)({"common.close":`Close`,"common.closePanel":`Close panel`,"common.resizeDrawer":`Resize drawer`,"detail.openAsFullPage":`Open as full page`,"detail.recordDetail":`Record Detail`,"detail.recordDetailOverlay":`Record detail overlay for {{title}}.`},`common.close`);function Ou(e){return`drawer-width:${e}`}function ku(e){return`objectui.drawerWidth.${e}`}function Au(){let e=a.default.useRef(null),t=a.default.useCallback(t=>{let n=t?.target;n&&typeof n.getBoundingClientRect==`function`&&(e.current=n)},[]);return{anchorRef:e,captureAnchor:t,anchorCaptureProps:a.default.useMemo(()=>({onClickCapture:t}),[t])}}function ju(e){if(e!=null)return typeof e==`number`?`${e}px`:e}function Mu(e){let t=ju(e);return t?{"--ov-w":t}:{}}var Nu=360,Pu=.95;function Fu(e,t){let[n,r]=a.default.useState(null),i=a.default.useRef(!1);return a.default.useEffect(()=>{if(!(!e||typeof window>`u`))try{let n=window.localStorage.getItem(`ov:${e}`);if(n){let e=Number(n);Number.isFinite(e)&&e>=Nu&&r(e);return}if(!t)return;let i=window.localStorage.getItem(t);if(!i)return;let a=parseInt(i,10);if(!Number.isFinite(a)||a<Nu)return;r(a),window.localStorage.setItem(`ov:${e}`,String(a)),window.localStorage.removeItem(t)}catch{}},[e,t]),{width:n,handleMouseDown:a.default.useCallback(t=>{if(!e||typeof window>`u`)return;t.preventDefault(),i.current=!0;let n=Math.floor(window.innerWidth*Pu);document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let a=e=>{if(!i.current)return;let t=Math.min(n,Math.max(Nu,window.innerWidth-e.clientX));r(t)},o=()=>{i.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o),r(t=>{if(t!=null)try{window.localStorage.setItem(`ov:${e}`,String(t))}catch{}return t})};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},[e]),handleDoubleClick:a.default.useCallback(()=>{if(!(!e||typeof window>`u`)){r(null);try{window.localStorage.removeItem(`ov:${e}`)}catch{}}},[e]),enabled:!!e}}var Iu=({isOpen:e,selectedRecord:t,mode:n,close:r,setIsOpen:i,width:a,view:s,title:c,description:u,className:d,children:f,renderView:p,mainContent:m,popoverTrigger:h,popoverAnchorRef:g,onExpand:_,expandLabel:v,storageKey:y,legacyStorageKey:b})=>{let x=Mu(a),{t:S}=Du(),C=c||S(`detail.recordDetail`),w=v??S(`detail.openAsFullPage`),T=S(`detail.recordDetailOverlay`,{title:C}),E=Fu(n===`drawer`?y:void 0,n===`drawer`?b:void 0),D=Tu();if(n===`page`||n===`new_window`||n===`none`||!t)return null;let O=ju(a)??`42rem`,k=E.width==null?{"--ov-w":`max(${O}, min(60vw, 880px))`}:{"--ov-w":`${E.width}px`},A=e=>p&&s?p(e,s):f(e);if(n===`drawer`)return(0,o.jsx)(ni,{open:e,onOpenChange:i,children:(0,o.jsxs)(ci,{side:`right`,onInteractOutside:D,onOpenAutoFocus:e=>e.preventDefault(),className:q(`w-screen max-w-none sm:w-full sm:max-w-[var(--ov-w,42rem)] p-0 flex flex-col gap-0 overflow-hidden`,`[&>button:last-of-type]:hidden`,d),style:k,children:[E.enabled&&(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":S(`common.resizeDrawer`),onMouseDown:E.handleMouseDown,onDoubleClick:E.handleDoubleClick,className:`hidden sm:block absolute left-0 top-0 bottom-0 z-30 w-1 cursor-col-resize touch-none bg-transparent hover:bg-primary/40 active:bg-primary/60 transition-colors`}),(0,o.jsxs)(li,{className:`shrink-0 flex-row items-center justify-between gap-2 space-y-0 px-4 py-2 border-b bg-muted/30`,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(di,{className:`truncate text-xs font-medium tracking-wide text-muted-foreground`,children:C}),u?(0,o.jsx)(fi,{className:`truncate text-xs`,children:u}):(0,o.jsx)(fi,{className:`sr-only`,children:T})]}),(0,o.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[_&&(0,o.jsx)(`button`,{type:`button`,onClick:_,"aria-label":w,title:w,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(l.Maximize2,{className:`h-3.5 w-3.5`})}),(0,o.jsx)(ii,{asChild:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":S(`common.close`),title:S(`common.close`),className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`})})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:A(t)})]})});if(n===`modal`)return(0,o.jsx)(Pt,{open:e,onOpenChange:i,children:(0,o.jsxs)(zt,{onInteractOutside:D,className:q(`w-[calc(100vw-1rem)] max-w-none sm:max-w-[var(--ov-w,42rem)] max-h-[90vh] overflow-y-auto`,d),style:x,children:[_&&(0,o.jsx)(`button`,{type:`button`,onClick:_,"aria-label":w,title:w,className:`absolute right-12 top-4 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors`,children:(0,o.jsx)(l.Maximize2,{className:`h-4 w-4`})}),(0,o.jsxs)(Bt,{children:[(0,o.jsx)(Ht,{children:C}),u?(0,o.jsx)(Ut,{children:u}):(0,o.jsx)(Ut,{className:`sr-only`,children:T})]}),(0,o.jsx)(`div`,{className:`mt-4`,children:A(t)})]})});if(n===`split`){if(!e||!m)return null;let n=a&&typeof a==`number`?Math.min(70,Math.max(20,a/1200*100)):40,i=100-n;return(0,o.jsxs)(us,{orientation:`horizontal`,className:q(`h-full`,d),children:[(0,o.jsx)(ds,{defaultSize:i,minSize:30,children:m}),(0,o.jsx)(fs,{withHandle:!0}),(0,o.jsx)(ds,{defaultSize:n,minSize:20,children:(0,o.jsxs)(`div`,{className:`h-full overflow-y-auto p-4`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,o.jsx)(`h3`,{className:`text-lg font-semibold`,children:C}),(0,o.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":S(`common.closePanel`),children:(0,o.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,o.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,o.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),u&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:u}),A(t)]})})]})}return n===`popover`?!h&&!g?e?(0,o.jsx)(Pt,{open:e,onOpenChange:i,children:(0,o.jsxs)(zt,{className:q(`w-96 max-h-[80vh] overflow-y-auto p-4`,d),style:x,children:[(0,o.jsxs)(Bt,{children:[(0,o.jsx)(Ht,{className:`text-sm`,children:C}),u?(0,o.jsx)(Ut,{className:`text-xs`,children:u}):(0,o.jsx)(Ut,{className:`sr-only`,children:T})]}),(0,o.jsx)(`div`,{className:`mt-2`,children:A(t)})]})}):null:(0,o.jsxs)(Lr,{open:e,onOpenChange:i,children:[h?(0,o.jsx)(Rr,{asChild:!0,children:h}):(0,o.jsx)(M.Anchor,{virtualRef:g}),(0,o.jsx)(zr,{className:q(`w-96 max-h-[400px] overflow-y-auto p-4`,d),style:x,children:(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(`h4`,{className:`text-sm font-semibold`,children:C}),u&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u}),A(t)]})})]}):null};Iu.displayName=`NavigationOverlay`;var Lu=(0,_.createSafeTranslation)({"common.loading":`Loading…`},`common.loading`);function Ru({className:e,...t}){let{t:n}=Lu();return(0,o.jsx)(`div`,{role:`status`,"aria-label":n(`common.loading`),className:q(`flex items-center justify-center`,e),...t,children:(0,o.jsx)(l.Loader2,{className:`animate-spin text-muted-foreground w-full h-full min-w-4 min-h-4`})})}var zu={addGroup:`Add group field`,collapseTitle:`Collapsed by default`,removeTitle:`Remove`,ascendingTitle:`Ascending`,descendingTitle:`Descending`};function Bu({value:e,onChange:t,fieldOptions:n,maxLevels:r=3,className:i,labels:a}){let s={...zu,...a||{}},c=e?.fields??[],u=new Set(c.map(e=>e.field)),d=e=>{t(e.length?{fields:e}:void 0)};return(0,o.jsxs)(`div`,{"data-testid":`grouping-editor`,className:q(`flex flex-col gap-1.5 w-full`,i),children:[c.map((e,t)=>{let r=e.field!==``&&!n.some(t=>t.value===e.field);return(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsxs)(Gr,{value:e.field,onValueChange:n=>{let r=[...c];r[t]={...e,field:n},d(r)},children:[(0,o.jsx)(Jr,{"data-testid":`grouping-field-${t}`,className:`h-7 min-w-0 flex-1 px-2 py-0 text-xs`,children:(0,o.jsx)(qr,{})}),(0,o.jsxs)(Zr,{children:[r&&(0,o.jsx)($r,{value:e.field,"data-testid":`grouping-field-outside-options-${t}`,children:e.field}),n.filter(t=>t.value===e.field||!u.has(t.value)).map(e=>(0,o.jsx)($r,{value:e.value,children:e.label},e.value))]})]}),(0,o.jsx)(`button`,{type:`button`,title:e.order===`asc`?s.ascendingTitle:s.descendingTitle,"data-testid":`grouping-order-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-muted`,onClick:()=>{let n=[...c];n[t]={...e,order:e.order===`asc`?`desc`:`asc`},d(n)},children:e.order===`asc`?(0,o.jsx)(l.ArrowUp,{className:`h-3 w-3`}):(0,o.jsx)(l.ArrowDown,{className:`h-3 w-3`})}),(0,o.jsx)(`label`,{title:s.collapseTitle,className:`flex items-center text-xs text-muted-foreground`,children:(0,o.jsx)(`input`,{type:`checkbox`,"data-testid":`grouping-collapsed-${t}`,className:`h-3 w-3`,checked:e.collapsed,onChange:n=>{let r=[...c];r[t]={...e,collapsed:n.target.checked},d(r)}})}),(0,o.jsx)(`button`,{type:`button`,title:s.removeTitle,"data-testid":`grouping-remove-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-muted hover:text-destructive`,onClick:()=>{let e=c.filter((e,n)=>n!==t);d(e)},children:(0,o.jsx)(l.X,{className:`h-3 w-3`})})]},t)}),c.length<r&&(()=>{let e=n.filter(e=>!u.has(e.value));return e.length===0?null:(0,o.jsxs)(`button`,{type:`button`,"data-testid":`grouping-add`,className:`flex h-7 items-center gap-1 self-start rounded-md border border-dashed border-input bg-background px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:()=>{let t=[...c,{field:e[0].value,order:`asc`,collapsed:!1}];d(t)},children:[(0,o.jsx)(l.Plus,{className:`h-3 w-3`}),s.addGroup]})})()]})}function Vu({rows:e=5,columns:t=4,className:n,...r}){return(0,o.jsxs)(`div`,{"data-slot":`grid-skeleton`,className:q(`w-full space-y-2`,n),...r,children:[(0,o.jsx)(`div`,{className:`flex gap-4 px-4 py-2`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)($,{className:`h-4 flex-1 rounded`},t))}),Array.from({length:e}).map((e,n)=>(0,o.jsx)(`div`,{className:`flex gap-4 rounded-md border px-4 py-3`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)($,{className:q(`h-4 flex-1 rounded`,t===0&&`max-w-[40%]`)},t))},n))]})}function Hu({columns:e=3,cardsPerColumn:t=3,className:n,...r}){return(0,o.jsx)(`div`,{"data-slot":`kanban-skeleton`,className:q(`flex gap-4 overflow-x-auto`,n),...r,children:Array.from({length:e}).map((e,n)=>(0,o.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsx)($,{className:`h-5 w-24 rounded`}),Array.from({length:t}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background p-3`,children:[(0,o.jsx)($,{className:`h-4 w-3/4 rounded`}),(0,o.jsx)($,{className:`h-3 w-1/2 rounded`})]},t))]},n))})}function Uu({rows:e=4,className:t,...n}){return(0,o.jsxs)(`div`,{"data-slot":`form-skeleton`,className:q(`w-full max-w-lg space-y-6`,t),...n,children:[Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)($,{className:`h-4 w-28 rounded`}),(0,o.jsx)($,{className:`h-9 w-full rounded-md`})]},t)),(0,o.jsx)($,{className:`h-9 w-24 rounded-md`})]})}function Wu({rows:e=5,className:t,...n}){return(0,o.jsx)(`div`,{"data-slot":`list-skeleton`,className:q(`w-full space-y-3`,t),...n,children:Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border px-4 py-3`,children:[(0,o.jsx)($,{className:`size-8 shrink-0 rounded-full`}),(0,o.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,o.jsx)($,{className:`h-4 w-3/5 rounded`}),(0,o.jsx)($,{className:`h-3 w-2/5 rounded`})]})]},t))})}function Gu({className:e,...t}){return(0,o.jsxs)(`div`,{"data-slot":`chart-skeleton`,className:q(`w-full space-y-4`,e),...t,children:[(0,o.jsx)($,{className:`h-5 w-40 rounded`}),(0,o.jsx)(`div`,{className:`flex h-48 items-end gap-2 rounded-md border p-4`,children:[`h-2/5`,`h-3/5`,`h-1/3`,`h-4/5`,`h-1/2`,`h-3/4`,`h-2/5`].map((e,t)=>(0,o.jsx)($,{className:q(`flex-1 rounded-t`,e)},t))}),(0,o.jsxs)(`div`,{className:`flex gap-4`,children:[(0,o.jsx)($,{className:`h-3 w-16 rounded`}),(0,o.jsx)($,{className:`h-3 w-16 rounded`}),(0,o.jsx)($,{className:`h-3 w-16 rounded`})]})]})}function Ku({variant:e,...t}){switch(e){case`grid`:return(0,o.jsx)(Vu,{...t});case`kanban`:return(0,o.jsx)(Hu,{...t});case`form`:return(0,o.jsx)(Uu,{...t});case`list`:return(0,o.jsx)(Wu,{...t});case`chart`:return(0,o.jsx)(Gu,{...t})}}function qu({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`shimmer-skeleton`,className:q(`rounded-md bg-muted`,`motion-safe:bg-[linear-gradient(90deg,hsl(var(--muted))_0%,hsl(var(--muted-foreground)/0.12)_50%,hsl(var(--muted))_100%)]`,`motion-safe:bg-[length:200%_100%] motion-safe:animate-shimmer`,e),...t})}var Ju=({title:e,icon:t,objectLabel:n,resourceId:r,showCopyId:i=!0,isFavorite:s,onToggleFavorite:c,className:u,inlineExtras:d})=>{let{t:f}=(0,_.useObjectTranslation)(),[p,m]=a.default.useState(!1),[h,g]=a.default.useState(!1),v=s??p,y=a.default.useCallback(()=>{let e=!v;c&&c(e),s===void 0&&m(e)},[v,s,c]),b=a.default.useCallback(()=>{if(r)try{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(r),g(!0),setTimeout(()=>g(!1),1500)}catch{}},[r]),x=f(v?`detail.removeFromFavorites`:`detail.addToFavorites`),S=f(h?`detail.copied`:`detail.copyRecordId`);return(0,o.jsx)(gi,{children:(0,o.jsx)(`div`,{className:q(`flex flex-col min-w-0`,u),children:(0,o.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0 self-center`,"aria-hidden":!0,children:t}),(0,o.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold truncate`,children:e}),n&&(0,o.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground/70 shrink-0`,children:n}),i&&r&&(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground/50 hover:text-foreground`,onClick:b,"aria-label":S,children:h?(0,o.jsx)(l.Check,{className:`h-3 w-3 text-green-600`}):(0,o.jsx)(l.Copy,{className:`h-3 w-3`})})}),(0,o.jsx)(yi,{children:S})]}),c&&(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:y,"aria-label":x,"aria-pressed":v,children:(0,o.jsx)(l.Star,{className:q(`h-4 w-4`,v?`fill-yellow-400 text-yellow-400`:`text-muted-foreground`)})})}),(0,o.jsx)(yi,{children:x})]}),d]})})})},Yu=!1;function Xu(){if(Yu||typeof document>`u`)return;let e=`objui-refresh-indicator-kf`;if(document.getElementById(e)){Yu=!0;return}let t=document.createElement(`style`);t.id=e,t.textContent=`
13
13
  @keyframes objui-refresh-bar {
14
14
  0% { transform: translateX(-100%); }
15
15
  100% { transform: translateX(400%); }
16
16
  }
17
- `,document.head.appendChild(t),du=!0}var pu=({active:e,ariaLabel:t,className:n,...r})=>(a.useEffect(()=>{e&&fu()},[e]),e?(0,o.jsx)(`div`,{className:q(`pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden`,n),role:`progressbar`,"aria-busy":`true`,"aria-label":t,"data-testid":`refresh-indicator`,...r,children:(0,o.jsx)(`div`,{className:`h-full w-1/4 rounded-full bg-primary/70`,style:{animation:`objui-refresh-bar 1.1s ease-in-out infinite`}})}):null);pu.displayName=`RefreshIndicator`;function mu({className:e,message:t=`Loading…`,...n}){return(0,o.jsxs)(`div`,{role:`status`,"aria-label":t,"data-slot":`data-loading-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...n,children:[(0,o.jsx)(l.Loader2,{className:`size-6 animate-spin text-muted-foreground`}),t&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})}function hu({className:e,icon:t,illustration:n,showIcon:r=!0,iconWrapperClassName:i,title:a=`No data`,description:s,action:c,children:u,...d}){let f=r&&(t!=null||!n);return(0,o.jsxs)(`div`,{role:`status`,"data-slot":`data-empty-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-illustration`,className:`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300 [&_svg]:max-h-40 [&_svg]:w-auto`,"aria-hidden":!0,children:n}),f&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-icon`,className:q(i??`flex size-10 items-center justify-center rounded-lg bg-muted`),children:t??(0,o.jsx)(l.InboxIcon,{className:`size-5 text-muted-foreground`})}),a&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:a}),s&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:s}),c,u]})}function gu({className:e,icon:t,showIcon:n=!0,iconWrapperClassName:r,title:i=`Something went wrong`,message:a,onRetry:s,retryLabel:c=`Retry`,children:u,...d}){return(0,o.jsxs)(`div`,{role:`alert`,"data-slot":`data-error-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-error-state-icon`,className:q(r??`flex size-10 items-center justify-center rounded-lg bg-destructive/10`),children:t??(0,o.jsx)(l.AlertCircle,{className:`size-5 text-destructive`})}),i&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:i}),a&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:a}),s&&(0,o.jsx)(X,{variant:`outline`,size:`sm`,onClick:s,children:c}),u]})}t.ComponentRegistry.register(`combobox`,({schema:e,disabled:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:s,...c}=n,l=a.default.useId(),u=e.description?`${l}-description`:void 0,d=[c[`aria-describedby`],u].filter(Boolean).join(` `)||void 0,f=(0,o.jsx)(cc,{options:e.options||[],placeholder:e.placeholder,value:e.value,disabled:t,className:e.className,...Ys(c),"aria-describedby":d,"data-obj-id":r,"data-obj-type":i,style:s});return u?(0,o.jsxs)(`div`,{className:`grid gap-1.5`,children:[f,(0,o.jsx)(`p`,{id:u,className:`text-sm text-muted-foreground`,children:e.description})]}):f},{namespace:`ui`,label:`Combobox`,inputs:[{name:`placeholder`,type:`string`},{name:`value`,type:`string`},{name:`disabled`,type:`boolean`},{name:`className`,type:`string`},{name:`name`,type:`string`},{name:`description`,type:`string`}],defaultProps:{placeholder:`Select option...`,options:[]}}),t.ComponentRegistry.register(`command`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsxs)(Ut,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:[(0,o.jsx)(Gt,{placeholder:e.placeholder||`Type a command or search...`}),(0,o.jsxs)(Kt,{children:[(0,o.jsx)(qt,{children:e.emptyText||`No results found.`}),e.groups?.map((e,t)=>(0,o.jsx)(Jt,{heading:e.heading,children:e.items?.map((e,t)=>{let n=Wa(e.icon);return(0,o.jsxs)(Xt,{value:e.value,children:[n&&(0,o.jsx)(n,{className:`h-4 w-4`}),e.label]},t)})},t))]})]})},{namespace:`ui`,label:`Command`,inputs:[{name:`placeholder`,type:`string`},{name:`emptyText`,type:`string`},{name:`className`,type:`string`}],defaultProps:{placeholder:`Type a command or search...`,emptyText:`No results found.`,groups:[]}});var _u=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let{style:a,...s}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(s),className:n,style:a,children:J(e.children)})});_u.displayName=`BoxRenderer`,t.ComponentRegistry.register(`box`,_u,{namespace:`ui`,label:`Box`,category:`layout`,isContainer:!0,inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}]});var vu=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,l=e.clickable||!!n.onClick,u=e.hoverable||l,d=J(e.header);return(0,o.jsxs)(mt,{ref:r,className:q(t,u&&`transition-colors hover:bg-muted/50`,l&&`cursor-pointer active:bg-muted`),...c,"data-obj-id":i,"data-obj-type":a,style:s,children:[(e.title||e.description||d!==null)&&(0,o.jsxs)(ht,{children:[e.title&&(0,o.jsx)(gt,{children:e.title}),e.description&&(0,o.jsx)(_t,{children:e.description}),d]}),pe(e.children,e=>(0,o.jsx)(vt,{children:J(e)})),pe(e.footer,e=>(0,o.jsx)(yt,{className:`flex justify-between`,children:J(e)}))]})});t.ComponentRegistry.register(`card`,vu,{namespace:`ui`,label:`Card`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{title:`Card Title`,description:`Card description goes here`,className:`w-full`},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`tabs`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i,u=e=>{n&&n(e)},d=e.orientation===`vertical`;return(0,o.jsxs)(ua,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:u,orientation:e.orientation||`horizontal`,className:q(t,d&&`flex gap-2`),...l,"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)(da,{className:q(d&&`flex-col h-auto items-stretch bg-muted/50 p-1`),children:e.items?.map(e=>(0,o.jsx)(fa,{value:e.value,disabled:e.disabled,className:q(d&&`justify-start`),children:e.label},e.value))}),e.items?.map(e=>(0,o.jsx)(pa,{value:e.value,className:q(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,d&&`mt-0 flex-1`),children:J(e.content)},e.value))]})},{namespace:`ui`,label:`Tabs`,inputs:[{name:`defaultValue`,type:`string`,required:!0},{name:`className`,type:`string`},{name:`items`,type:`array`}],defaultProps:{defaultValue:`tab1`,items:[{label:`Tab 1`,value:`tab1`,content:[{type:`text`,content:`Content for Tab 1`}]},{label:`Tab 2`,value:`tab2`,content:[{type:`text`,content:`Content for Tab 2`}]},{label:`Tab 3`,value:`tab3`,content:[{type:`text`,content:`Content for Tab 3`}]}],className:`w-full`}});var yu={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`,7:`grid-cols-7`,8:`grid-cols-8`,9:`grid-cols-9`,10:`grid-cols-10`,11:`grid-cols-11`,12:`grid-cols-12`},bu={1:`sm:grid-cols-1`,2:`sm:grid-cols-2`,3:`sm:grid-cols-3`,4:`sm:grid-cols-4`,5:`sm:grid-cols-5`,6:`sm:grid-cols-6`,7:`sm:grid-cols-7`,8:`sm:grid-cols-8`,9:`sm:grid-cols-9`,10:`sm:grid-cols-10`,11:`sm:grid-cols-11`,12:`sm:grid-cols-12`},xu={1:`md:grid-cols-1`,2:`md:grid-cols-2`,3:`md:grid-cols-3`,4:`md:grid-cols-4`,5:`md:grid-cols-5`,6:`md:grid-cols-6`,7:`md:grid-cols-7`,8:`md:grid-cols-8`,9:`md:grid-cols-9`,10:`md:grid-cols-10`,11:`md:grid-cols-11`,12:`md:grid-cols-12`},Su={1:`lg:grid-cols-1`,2:`lg:grid-cols-2`,3:`lg:grid-cols-3`,4:`lg:grid-cols-4`,5:`lg:grid-cols-5`,6:`lg:grid-cols-6`,7:`lg:grid-cols-7`,8:`lg:grid-cols-8`,9:`lg:grid-cols-9`,10:`lg:grid-cols-10`,11:`lg:grid-cols-11`,12:`lg:grid-cols-12`},Cu={1:`xl:grid-cols-1`,2:`xl:grid-cols-2`,3:`xl:grid-cols-3`,4:`xl:grid-cols-4`,5:`xl:grid-cols-5`,6:`xl:grid-cols-6`,7:`xl:grid-cols-7`,8:`xl:grid-cols-8`,9:`xl:grid-cols-9`,10:`xl:grid-cols-10`,11:`xl:grid-cols-11`,12:`xl:grid-cols-12`},wu={1:`2xl:grid-cols-1`,2:`2xl:grid-cols-2`,3:`2xl:grid-cols-3`,4:`2xl:grid-cols-4`,5:`2xl:grid-cols-5`,6:`2xl:grid-cols-6`,7:`2xl:grid-cols-7`,8:`2xl:grid-cols-8`,9:`2xl:grid-cols-9`,10:`2xl:grid-cols-10`,11:`2xl:grid-cols-11`,12:`2xl:grid-cols-12`},Tu=[{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8},{label:`9`,value:9},{label:`10`,value:10},{label:`11`,value:11},{label:`12`,value:12}],Eu={0:`gap-0`,1:`gap-1`,2:`gap-2`,3:`gap-3`,4:`gap-4`,5:`gap-5`,6:`gap-6`,8:`gap-8`,10:`gap-10`,12:`gap-12`};t.ComponentRegistry.register(`grid`,({schema:e,className:n,...r})=>{let i=2,a,s,c,l,u;typeof e.columns==`number`?i=e.columns:typeof e.columns==`object`&&e.columns!==null&&(i=e.columns.xs??1,a=e.columns.sm,s=e.columns.md,c=e.columns.lg,l=e.columns.xl,u=e.columns[`2xl`]),typeof e.columns==`number`&&i>1&&(s=i,a=Math.min(2,i),i=1);let d=e.gap??4,f=q(`grid`,yu[i],a&&bu[a],s&&xu[s],c&&Su[c],l&&Cu[l],u&&wu[u],Eu[d]||`gap-[${d*.25}rem]`,n),{style:p,...m}=r;return(0,o.jsx)(`div`,{...(0,t.toDomProps)(m),className:f,style:p,children:J(e.children)})},{namespace:`ui`,label:`Grid Layout`,inputs:[{name:`columns`,type:[`enum`,`object`],enum:Tu,of:`enum`,description:`Column count, 1 to 12, or an object of such counts keyed by breakpoint (xs, sm, md, lg, xl, 2xl). Default 2.`},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`8`,value:8},{label:`10`,value:10},{label:`12`,value:12}],description:`Gap step between items; 0 is none. Default 4.`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{columns:{xs:1,md:2,lg:4},gap:4,children:[{type:`card`,title:`Card 1`,description:`First card`},{type:`card`,title:`Card 2`,description:`Second card`},{type:`card`,title:`Card 3`,description:`Third card`},{type:`card`,title:`Card 4`,description:`Fourth card`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`flex`,({schema:e,className:n,...r})=>{let i=e.direction||`row`,a=e.justify||`start`,s=e.align||`start`,c=e.gap??2,l=e.wrap||!1,u=q(`flex`,i===`row`&&`flex-row`,i===`col`&&`flex-col`,i===`row-reverse`&&`flex-row-reverse`,i===`col-reverse`&&`flex-col-reverse`,a===`start`&&`justify-start`,a===`end`&&`justify-end`,a===`center`&&`justify-center`,a===`between`&&`justify-between`,a===`around`&&`justify-around`,a===`evenly`&&`justify-evenly`,s===`start`&&`items-start`,s===`end`&&`items-end`,s===`center`&&`items-center`,s===`baseline`&&`items-baseline`,s===`stretch`&&`items-stretch`,c===0&&`gap-0`,c===1&&`gap-1`,c===2&&`gap-1.5 sm:gap-2`,c===3&&`gap-2 sm:gap-3`,c===4&&`gap-2 sm:gap-3 md:gap-4`,c===5&&`gap-3 sm:gap-4 md:gap-5`,c===6&&`gap-3 sm:gap-4 md:gap-6`,c===7&&`gap-4 sm:gap-5 md:gap-7`,c===8&&`gap-4 sm:gap-6 md:gap-8`,l&&`flex-wrap`,n),{style:d,...f}=r;return(0,o.jsx)(`div`,{...(0,t.toDomProps)(f),className:u,style:d,children:J(e.children)})},{namespace:`ui`,label:`Flex Layout`,inputs:[{name:`direction`,type:`enum`,enum:[`row`,`col`,`row-reverse`,`col-reverse`]},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`]},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`baseline`,`stretch`]},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8}],description:`Gap step between items; 0 is none. Default 2.`},{name:`wrap`,type:`boolean`,description:`Allow flex items to wrap`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{direction:`row`,justify:`start`,align:`start`,gap:2,wrap:!1,children:[{type:`button`,label:`Button 1`},{type:`button`,label:`Button 2`},{type:`button`,label:`Button 3`}]},isContainer:!0});var Du=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let a=e.direction||`col`,s=e.justify||`start`,c=e.align||`stretch`,l=e.gap??2,u=e.wrap||!1,d=q(`flex`,a===`row`&&`flex-row`,a===`col`&&`flex-col`,a===`row-reverse`&&`flex-row-reverse`,a===`col-reverse`&&`flex-col-reverse`,s===`start`&&`justify-start`,s===`end`&&`justify-end`,s===`center`&&`justify-center`,s===`between`&&`justify-between`,s===`around`&&`justify-around`,s===`evenly`&&`justify-evenly`,c===`start`&&`items-start`,c===`end`&&`items-end`,c===`center`&&`items-center`,c===`baseline`&&`items-baseline`,c===`stretch`&&`items-stretch`,l===0&&`gap-0`,l===1&&`gap-1`,l===2&&`gap-1.5 sm:gap-2`,l===3&&`gap-2 sm:gap-3`,l===4&&`gap-2 sm:gap-3 md:gap-4`,l===5&&`gap-3 sm:gap-4 md:gap-5`,l===6&&`gap-3 sm:gap-4 md:gap-6`,l===8&&`gap-4 sm:gap-6 md:gap-8`,l===10&&`gap-5 sm:gap-7 md:gap-10`,u&&`flex-wrap`,n),{style:f,...p}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(p),className:d,style:f,children:J(e.children)})});t.ComponentRegistry.register(`stack`,Du,{namespace:`ui`,label:`Stack`,inputs:[{name:`direction`,type:`enum`,enum:[`col`,`row`,`col-reverse`,`row-reverse`]},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`8`,value:8},{label:`10`,value:10}],description:`Gap step between items; 0 is none. Default 2.`},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`stretch`,`baseline`]},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`]},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{direction:`col`,gap:2,align:`stretch`,children:[]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:100,minHeight:50}});var Ou=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let a=e.maxWidth??`xl`,s=e.padding??4,c=e.centered!==!1,l=q(`w-full`,a===!1&&`max-w-none`,a===`sm`&&`max-w-sm`,a===`md`&&`max-w-md`,a===`lg`&&`max-w-lg`,a===`xl`&&`max-w-xl`,a===`2xl`&&`max-w-2xl`,a===`3xl`&&`max-w-3xl`,a===`4xl`&&`max-w-4xl`,a===`5xl`&&`max-w-5xl`,a===`6xl`&&`max-w-6xl`,a===`7xl`&&`max-w-7xl`,a===`full`&&`max-w-full`,a===`screen`&&`max-w-screen-2xl`,c&&`mx-auto`,s===0&&`p-0`,s===1&&`p-0.5 sm:p-1`,s===2&&`p-1 sm:p-2`,s===3&&`p-2 sm:p-3`,s===4&&`p-2 sm:p-3 md:p-4`,s===5&&`p-3 sm:p-4 md:p-5`,s===6&&`p-3 sm:p-4 md:p-6`,s===7&&`p-4 sm:p-5 md:p-7`,s===8&&`p-4 sm:p-6 md:p-8`,s===10&&`p-5 sm:p-7 md:p-10`,s===12&&`p-6 sm:p-8 md:p-12`,s===16&&`p-8 sm:p-10 md:p-16`,n),{style:u,...d}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(d),className:l,style:u,children:J(e.children)})});t.ComponentRegistry.register(`container`,Ou,{namespace:`ui`,label:`Container`,inputs:[{name:`maxWidth`,type:`enum`,enum:[{label:`None (cancel max-width)`,value:!1},{label:`sm`,value:`sm`},{label:`md`,value:`md`},{label:`lg`,value:`lg`},{label:`xl`,value:`xl`},{label:`2xl`,value:`2xl`},{label:`3xl`,value:`3xl`},{label:`4xl`,value:`4xl`},{label:`5xl`,value:`5xl`},{label:`6xl`,value:`6xl`},{label:`7xl`,value:`7xl`},{label:`full`,value:`full`},{label:`screen`,value:`screen`}]},{name:`padding`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8},{label:`10`,value:10},{label:`12`,value:12},{label:`16`,value:16}],description:`Padding step on the container spacing scale; 0 is none. Default 4.`},{name:`centered`,type:`boolean`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{maxWidth:`xl`,padding:4,centered:!0,children:[{type:`text`,content:`Container content goes here`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}});function ku(e){return e.split(/[-_:]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function Au(){let e={},n=new Set;for(let r of t.ComponentRegistry.getPublicConfigs()){let t=r.type;if(!t||r.isContainer||r.tier===`html`)continue;let o=ku(t);if(n.has(o))continue;n.add(o);let s=({children:e,...n})=>{let r=typeof n.type==`string`&&n.type!==t?n.type:void 0;return a.createElement(i.SchemaRenderer,{schema:{...n,...r?{specType:r}:{},type:t}})};s.displayName=o,e[o]=s}let r=({type:e,children:t,...n})=>a.createElement(i.SchemaRenderer,{schema:{type:e,...n}});return r.displayName=`Block`,e.Block=r,e}function ju(){return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-amber-400/40 bg-amber-50 p-4 text-sm text-amber-900 dark:bg-amber-950/30 dark:text-amber-200`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`React pages are disabled on this deployment`}),(0,o.jsxs)(`p`,{className:`mt-1 leading-relaxed`,children:[(0,o.jsx)(`code`,{children:`kind:'react'`}),` pages execute author JavaScript directly in the application. This deployment has turned the capability off (`,(0,o.jsx)(`code`,{children:`OS_PAGE_REACT=off`}),` / `,(0,o.jsx)(`code`,{children:`disableCapability('react-pages')`}),`). It is ON by default; re-enable it if your page authors are trusted.`]})]})}var Mu=({schema:e})=>{let n=typeof e?.source==`string`?e.source:``,r=(0,i.useAdapter)(),s=(0,t.isCapabilityEnabled)(t.CAP_REACT_PAGES),[c,l]=a.useState(null),[u,d]=a.useState(null);a.useEffect(()=>{if(!s)return;let e=!0;return import(`@object-ui/react-runtime`).then(t=>e&&l(t)).catch(t=>e&&d(t)),()=>{e=!1}},[s]);let f=a.useMemo(()=>({...Au(),useAdapter:i.useAdapter,useDataInvalidation:i.useDataInvalidation,data:e?.data??e?.variables??{},variables:e?.variables??{},page:e??{}}),[e,r]);if(!s)return(0,o.jsx)(ju,{});if(u)return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`Failed to load the react runtime`}),(0,o.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap`,children:String(u)})]});if(!n.trim())return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[`A `,(0,o.jsx)(`code`,{children:`kind:'react'`}),` page requires a non-empty `,(0,o.jsx)(`code`,{children:`source`}),`.`]});if(!c)return(0,o.jsx)(`div`,{className:`m-4 text-sm text-muted-foreground`,children:`Loading react runtime…`});let{ReactRunner:p}=c;return(0,o.jsx)(i.SchemaRendererProvider,{dataSource:r,children:(0,o.jsx)(p,{code:n,scope:f,fallback:e=>(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`React page error`}),(0,o.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap`,children:String(e)})]})})})};function Nu(e){switch(e){case`small`:return`w-64`;case`medium`:return`w-80`;case`large`:return`w-96`;case`full`:return`w-full`;default:return e||`w-full`}}function Pu(e){switch(e){case`small`:return`w-full md:w-64`;case`medium`:return`w-full md:w-80`;case`large`:return`w-full md:w-96`;default:return`w-full`}}function Fu(e){switch(e){case`utility`:return`max-w-4xl`;case`home`:return`max-w-screen-2xl`;case`app`:return`max-w-screen-xl`;default:return`max-w-7xl`}}function Iu(e,t){return e?.find(e=>e.name?.toLowerCase()===t.toLowerCase())}function Lu(e,t){if(!e)return[];let n=new Set(t.map(e=>e.toLowerCase()));return e.filter(e=>!n.has(e.name?.toLowerCase()??``))}var Ru=`page:header`;function zu(e){return e==null?``:typeof e==`string`?e.replace(/\{[a-zA-Z0-9_.]+\}/g,``).replace(/\s+/g,` `).trim():typeof e==`object`?Object.values(e).map(e=>zu(e)).find(e=>e!==``)??``:String(e)}function Bu(e){return e?.type===Ru&&zu(e?.title??e?.properties?.title)!==``}function Vu(e,t=0){return t>6?!1:(Array.isArray(e)?e:e?[e]:[]).some(e=>!!e&&typeof e==`object`&&(Bu(e)||Vu(e.components,t+1)||Vu(e.children,t+1)))}function Hu(e){return Vu((e.regions??[]).flatMap(e=>e?.components??[]))||Vu(e.children)}var Uu=({region:e,className:t})=>{let n=e.components||[];return n.length===0?null:(0,o.jsx)(`div`,{className:q(`space-y-4`,e.className,t),"data-region":e.name,children:n.map((t,n)=>(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(t)},t?.id||`${e.name}-${n}`))})},Wu=({regions:e,pageType:t,className:n})=>{let r=Iu(e,`header`),i=Iu(e,`sidebar`),a=Iu(e,`main`),s=Iu(e,`aside`),c=Iu(e,`footer`),l=Lu(e,[`header`,`sidebar`,`main`,`aside`,`footer`]);return r||i||a||s||c?(0,o.jsxs)(`div`,{className:q(`flex flex-col gap-6`,n),"data-page-layout":t,children:[r&&(0,o.jsx)(Uu,{region:r,className:q(Nu(r.width))}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[i&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,Pu(i.width||`small`)),children:(0,o.jsx)(Uu,{region:i})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[a&&(0,o.jsx)(Uu,{region:a}),l.map((e,t)=>(0,o.jsx)(Uu,{region:e},e.name||`extra-${t}`))]}),s&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,Pu(s.width||`small`),s.className),children:(0,o.jsx)(Uu,{region:s})})]}),c&&(0,o.jsx)(Uu,{region:c,className:q(Nu(c.width))})]}):(0,o.jsx)(`div`,{className:q(`space-y-6`,n),"data-page-layout":t,children:e.map((e,t)=>(0,o.jsx)(Uu,{region:e},e.name||t))})},Gu=({schema:e})=>{let t=e.children,n=Array.isArray(t)?t:t?[t]:[];return n.length===0?null:(0,o.jsx)(`div`,{className:`space-y-6`,children:n.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e?.id||t))})},Ku=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Wu,{regions:e.regions,pageType:e.pageType}):(0,o.jsx)(Gu,{schema:e}),qu={default:Ku,"full-width":Ku,"header-sidebar-main":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Gu,{schema:e});let n=Iu(t,`header`),r=Iu(t,`sidebar`),i=Iu(t,`main`),a=Lu(t,[`header`,`sidebar`,`main`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`header-sidebar-main`,children:[n&&(0,o.jsx)(Uu,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,Pu(r.width||`medium`)),children:(0,o.jsx)(Uu,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)(Uu,{region:i}),a.map((e,t)=>(0,o.jsx)(Uu,{region:e},e.name||`extra-${t}`))]})]})]})},"three-column":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Gu,{schema:e});let n=Iu(t,`header`),r=Iu(t,`sidebar`),i=Iu(t,`main`),a=Iu(t,`aside`),s=Iu(t,`footer`),c=Lu(t,[`header`,`sidebar`,`main`,`aside`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`three-column`,children:[n&&(0,o.jsx)(Uu,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,Pu(r.width||`small`)),children:(0,o.jsx)(Uu,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)(Uu,{region:i}),c.map((e,t)=>(0,o.jsx)(Uu,{region:e},e.name||`extra-${t}`))]}),a&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,Pu(a.width||`small`),a.className),children:(0,o.jsx)(Uu,{region:a})})]}),s&&(0,o.jsx)(Uu,{region:s})]})},dashboard:({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Gu,{schema:e});let n=Iu(t,`header`),r=Iu(t,`footer`),i=Lu(t,[`header`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`dashboard`,children:[n&&(0,o.jsx)(Uu,{region:n}),(0,o.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:i.map((e,t)=>(0,o.jsx)(Uu,{region:e},e.name||`region-${t}`))}),r&&(0,o.jsx)(Uu,{region:r})]})}};function Ju(e){return e.template&&qu[e.template]||null}var Yu=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Wu,{regions:e.regions,pageType:`record`}):(0,o.jsx)(Gu,{schema:e}),Xu=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Wu,{regions:e.regions,pageType:`home`}):(0,o.jsx)(Gu,{schema:e}),Zu=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Wu,{regions:e.regions,pageType:`app`}):(0,o.jsx)(Gu,{schema:e}),Qu=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Wu,{regions:e.regions,pageType:`utility`}):(0,o.jsx)(Gu,{schema:e}),$u=-1,ed=null;function td(){let e=t.ComponentRegistry.getVersion();if(ed===null||$u!==e){let n=t.ComponentRegistry.getKnownTypes().filter(e=>!t.ComponentRegistry.deprecationFor(e,`html`)).map(e=>{let n=t.ComponentRegistry.getMeta(e);return{type:e,namespace:n?.namespace,isContainer:n?.isContainer,inputs:n?.inputs}});ed=(0,s.manifestFromConfigs)(n),$u=e}return ed}function nd(e){if(e.code!==`forbidden-tag`||!e.tag)return e;let n=t.ComponentRegistry.deprecationFor(e.tag,`html`);if(!n)return e;let r=`${e.message}: it is deprecated on kind:'html' pages`;return{...e,message:n.replacement?`${r}. Instead, ${n.replacement}`:r}}var rd=({schema:e,className:n,...r})=>{let c=e.pageType||`record`,[l,u]=a.default.useReducer(e=>e+1,0);a.default.useEffect(()=>t.ComponentRegistry.subscribe(u),[]);let d=e.title??e.label,{"data-obj-id":f,"data-obj-type":p,style:m}=r,h=(0,t.toDomProps)(r),g=(0,_.useDisplayLocale)(),v=(0,i.resolveInlineAriaProps)(e.aria,g),y=(0,a.useMemo)(()=>{let t=e.kind;if(t===`react`)return(0,o.jsx)(Mu,{schema:e});if(t===`html`||t===`jsx`){let t=e.source??``,{tree:n,diagnostics:r}=(0,s.compile)(t,td()),a=r.filter(e=>e.severity===`error`).map(nd);return a.length?(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsxs)(`div`,{className:`font-semibold`,children:[`HTML page failed to compile (`,a.length,`)`]}),(0,o.jsx)(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-5`,children:a.slice(0,8).map((e,t)=>(0,o.jsx)(`li`,{children:e.message},t))})]}):n?(0,o.jsx)(i.SchemaRenderer,{schema:n}):null}let n=Ju(e);if(n)return(0,o.jsx)(n,{schema:e});switch(c){case`home`:return(0,o.jsx)(Xu,{schema:e});case`app`:return(0,o.jsx)(Zu,{schema:e});case`utility`:return(0,o.jsx)(Qu,{schema:e});default:return(0,o.jsx)(Yu,{schema:e})}},[e,c,l]),b=(e.regions??[]).some(e=>e.name?.toLowerCase()===`main`&&e.width===`full`),x=b?`max-w-none`:Fu(c),S=a.default.useMemo(()=>c===`record`||Hu(e),[e,c]),C=!!d&&!S,w=!!e.description&&c!==`record`,T=(0,o.jsx)(`div`,{className:q(`min-h-full w-full bg-background p-3 md:p-4 lg:p-6`,n),"data-page-type":c,"data-obj-id":f,"data-obj-type":p,style:m,...h,...v,children:(0,o.jsxs)(`div`,{className:q(b?`space-y-6`:`mx-auto space-y-6`,x),children:[(C||w)&&(0,o.jsxs)(`div`,{className:`space-y-2`,children:[C&&(0,o.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:d}),w&&(0,o.jsx)(`p`,{className:`text-muted-foreground`,children:e.description})]}),y]})});return e.variables&&e.variables.length>0?(0,o.jsxs)(i.PageVariablesProvider,{definitions:e.variables,children:[(0,o.jsx)(i.PageVariableActionBridge,{}),T]}):T},id={namespace:`ui`,label:`Page`,icon:`panels-top-left`,category:`layout`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`pageType`,type:`string`},{name:`object`,type:`string`},{name:`template`,type:`string`},{name:`regions`,type:`array`,itemType:`object`},{name:`variables`,type:`array`,itemType:`object`},{name:`children`,type:`array`,itemType:`component`}]};t.ComponentRegistry.register(`page`,rd,id),t.ComponentRegistry.register(`app`,rd,{...id,label:`App Page`}),t.ComponentRegistry.register(`utility`,rd,{...id,label:`Utility Page`}),t.ComponentRegistry.register(`home`,rd,{...id,label:`Home Page`}),t.ComponentRegistry.register(`record`,rd,{...id,label:`Record Page`});var ad=new Map,od=new Map,sd=new Set,cd=0;function ld(e,t,n,r){return`${e}::${r===void 0?t??``:`${t??``}#${JSON.stringify(r)}`}::${n??``}`}function ud(){cd+=1;for(let e of sd)e()}function dd(e,t,n,r){return ad.get(ld(e,t,n,r))}function fd(e,t,n,r,i){let a=ld(e,t,n,i);ad.get(a)!==r&&(ad.set(a,r),ud())}async function pd(e,n,r,i,a,o){let s=ld(n,r,i,a),c=ad.get(s);if(c!==void 0)return c;let l=od.get(s);if(l)return l;let u=(async()=>{let c={};if(r){if(!i)return 0;c=(0,t.composeParentScopeFilter)(r,i,o)}let l=a===void 0?c:(0,t.mergeFilterNodes)(c,a)??c;try{let t=await e(n,{$filter:l,$top:1,$count:!0}),o=typeof t?.total==`number`?t.total:Array.isArray(t?.data)?t.data.length:Array.isArray(t)?t.length:0,s=typeof o==`number`?o:0;return fd(n,r,i,s,a),s}catch{return 0}finally{od.delete(s)}})();return od.set(s,u),u}function md(e,t){let n=!1,r=`${e}::`;for(let e of ad.keys())e.startsWith(r)&&(t===void 0||e.endsWith(`::${t}`))&&(ad.delete(e),n=!0);n&&ud()}function hd(){ad.size!==0&&(ad.clear(),ud())}function gd(e){return sd.add(e),()=>{sd.delete(e)}}function _d(){return cd}function vd(e,t,n,r){if((0,a.useSyncExternalStore)(gd,_d,_d),e)return dd(e,t,n,r)}function yd(){return(0,a.useSyncExternalStore)(gd,_d,_d)}var bd={get:dd,set:fd,fetch:pd,invalidate:md,invalidateAll:hd,_reset:()=>{ad.clear(),od.clear(),ud()}};(0,i.subscribeDataChanges)(e=>{e.objectName===`*`?bd.invalidateAll():bd.invalidate(e.objectName)});var xd=[{name:`children`,type:`slot`,description:`Child components rendered inside this container, in order`}],Sd=650,Cd=(0,_.createSafeTranslation)({"common.itemCount":`{{count}} items`,"common.itemCount_one":`{{count}} item`,"common.itemCount_other":`{{count}} items`},`common.itemCount`),wd=e=>{let{"data-obj-id":t,"data-obj-type":n,style:r,...i}=e||{};return{designer:{"data-obj-id":t,"data-obj-type":n,style:r},rest:i}},Td=e=>e==null?``:typeof e==`string`?e:typeof e==`object`?e.default||e.value||``:String(e),Ed={"zh-CN":{Details:`详情`,Related:`相关`,Activity:`活动`,History:`历史`,Notes:`备注`,Files:`文件`,Tasks:`任务`,"Open Tasks":`待办任务`,"Closed Tasks":`已完成任务`,Events:`日程`,Attachments:`附件`,Chatter:`讨论`,Discussion:`讨论`,Comments:`评论`,Overview:`概览`,Summary:`摘要`,Quotes:`报价单`,Products:`产品`,Contacts:`联系人`,Accounts:`客户`,Leads:`线索`,Opportunities:`商机`,Cases:`服务案例`,Campaigns:`营销活动`,Approvals:`审批`,Documents:`文档`,Emails:`邮件`,Calls:`通话`,Meetings:`会议`},"zh-TW":{Details:`詳情`,Related:`相關`,Activity:`活動`,History:`歷史`,Notes:`備註`,Files:`檔案`,Tasks:`任務`,"Open Tasks":`待辦任務`,"Closed Tasks":`已完成任務`,Events:`行程`,Attachments:`附件`,Chatter:`討論`,Discussion:`討論`,Comments:`評論`,Overview:`概覽`,Summary:`摘要`,Quotes:`報價單`,Products:`產品`,Contacts:`聯絡人`,Accounts:`客戶`,Leads:`線索`,Opportunities:`商機`,Cases:`服務案例`,Campaigns:`行銷活動`,Approvals:`審批`,Documents:`文件`,Emails:`郵件`,Calls:`通話`,Meetings:`會議`}},Dd={Details:`detail.details`,Related:`detail.related`,Activity:`detail.activity`,History:`detail.history`,Attachments:`detail.attachments`,Approvals:`detail.approvalsPanelTitle`,Discussion:`detail.discussion`,Comments:`detail.comments`},Od=(e,t,n)=>{if(!e)return e;let r=Ed[t],i=t.split(`-`)[0]===`zh`?Ed[`zh-CN`]:void 0,a=r||i,o=e=>{let t=a?.[e];if(t!==void 0)return t;let r=Dd[e];if(r===void 0)return;let i=n(r,e);return i===e?void 0:i},s=o(e);if(s!==void 0)return s;let c=/\s*(?:&|and|和)\s*/i;if(c.test(e)){let n=e.split(c).map(e=>e.trim()).map(o);if(n.every(e=>e!==void 0)){let e=t.startsWith(`zh`)?`与`:` & `;return n.join(e)}}return e},kd=(e,t,n,r,i)=>{if(!e?.fields||!t||!n)return;let a=(Array.isArray(e.fields)?e.fields.find(e=>e?.name===r):e.fields[r])?.options;if(!Array.isArray(a))return;let o=a.find(e=>String(e?.value??e)===i);return t(n,r,i,o?.label?String(o.label):i)},Ad=(e,t,n,r)=>{if(!e||typeof e!=`object`)return e;let i=e,a;for(let e of Object.keys(i)){let o=i[e];if(o==null||typeof o==`object`)continue;let s=kd(t,n,r,e,String(o));s!==void 0&&(a||={...i},a[e]=s)}return a??i},jd=(e,t,n,r,i)=>!e||typeof e!=`string`?e||``:(e.includes(`{`)?e.replace(/\{([a-zA-Z0-9_.]+)\}/g,(e,a)=>{let o=a.split(`.`).reduce((e,t)=>e==null?e:e[t],t);if(o==null||typeof o==`object`)return``;let s=String(o);if(!a.includes(`.`)){let e=kd(n,r,i,a,s);if(e!==void 0)return e}return s}):e).replace(/\s+/g,` `).trim(),Md=e=>{let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,``)}k`:String(t):String(e)},Nd=(e,t=[])=>{if(!e)return t;let n=Array.isArray(e)?e:[e];for(let e of n){if(!e||typeof e!=`object`)continue;if(e.type===`record:related_list`||e.type===`record_related_list`){t.push(e);continue}let n=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of n)e&&Nd(e,t)}return t},Pd=e=>{if(!e)return!1;let t=Array.isArray(e)?e:[e];for(let e of t){if(!e||typeof e!=`object`)continue;if(e.type===`record:attachments`)return!0;let t=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of t)if(e&&Pd(e))return!0}return!1};t.ComponentRegistry.register(`tabs`,({schema:e,className:n,...r})=>{let{designer:s}=wd(r),c=(0,_.useDisplayLocale)(),l=(0,i.resolveInlineAriaProps)(e?.aria,c),{t:u,language:d}=Cd(),f=(0,_.useSafeTranslate)(),p=e?.items||[],m=e?.properties?.type||e?.tabStyle||`line`,h=(e?.position||`top`)===`left`,g=(0,i.useRecordContext)(),v=g?.data?.id,y=g?.dataSource,b=(0,i.usePredicateScope)(),{variables:x}=(0,i.usePageVariables)(),S=g?.data,C=p.map(n=>n?.visibleWhen===void 0||n?.visibleWhen===null||new t.ExpressionEvaluator({...S&&typeof S==`object`?S:{},...b,current_user:b?.user,record:S,data:S,page:x}).evaluateCondition(n.visibleWhen,{onFault:t=>(0,i.reportUnresolvableVisibilityPredicate)(`page:tabs`,e?.id,`visibleWhen`,n.visibleWhen,t,`page-component`)})),w=C.join(`,`),T=a.default.useMemo(()=>p.filter((e,t)=>C[t]),[p,w]),E=yd(),D=g?.objectName,O=a.default.useMemo(()=>{let e=new Map;return T.forEach((t,n)=>{if(t.count!==void 0&&t.count!==null&&t.count!==``)return;let r=Nd(t.children),i=[];for(let e of r){let t=e?.properties?.objectName||e?.objectName;if(!t)continue;let n=e?.properties?.relationshipField||e?.relationshipField,r=e?.properties?.filter??e?.filter;i.push({objectName:t,relationshipField:n,...r==null?{}:{filter:r}})}D&&Pd(t.children)&&i.push({objectName:`sys_attachment`,relationshipField:`attachments:${D}`,attachments:!0}),i.length>0&&e.set(n,i)}),e},[T,D]),k=a.default.useMemo(()=>JSON.stringify(Array.from(O.entries())),[O]);a.default.useEffect(()=>{if(!y||typeof y.find!=`function`||O.size===0)return;let e=!1;return(async()=>{let t=new Map;if(typeof y.getObjectSchema==`function`){let e=new Set;for(let t of O.values())for(let n of t)n.attachments||e.add(n.objectName);await Promise.all(Array.from(e).map(async e=>{try{t.set(e,(await y.getObjectSchema(e))?.fields)}catch{}}))}if(!e)for(let n of O.values())for(let r of n){let n=r.attachments?(e,t)=>y.find(e,{...t,$filter:{parent_object:D,parent_id:v}}):(e,t)=>y.find(e,t);if(bd.fetch(n,r.objectName,r.relationshipField,v,r.filter,r.attachments?void 0:t.get(r.objectName)).catch(()=>0),e)return}})(),()=>{e=!0}},[y,k,v,E]);let A=e=>{let t=O.get(e);if(!t||t.length===0)return;let n=0,r=!1;for(let e of t){let t=bd.get(e.objectName,e.relationshipField,v,e.filter);t!==void 0&&(n+=t,r=!0)}return r?n:void 0},j=T.map((e,t)=>({...e,value:typeof e.value==`string`&&e.value!==``?e.value:`tab-${t}`,labelStr:Od((0,_.pickLocalized)(e.label,d),d,f),count:e.count!==void 0&&e.count!==null&&e.count!==``?e.count:A(t)})),M=e?.defaultTab,N=(M&&j.some(e=>e.value===M)?M:void 0)??j[0]?.value,ee=e?.onTabChange,[P,F]=a.default.useState(N),I=(P&&j.some(e=>e.value===P)?P:void 0)??j[0]?.value??``,L=q(h&&`flex-col h-auto items-stretch p-1`,m===`card`&&`bg-transparent gap-1`,m===`pill`&&`bg-muted rounded-full p-1 gap-1`,m===`line`&&!h&&`h-auto rounded-none bg-transparent p-0 gap-4 border-b border-border w-full justify-start`,!h&&`sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`),R=()=>q(h&&`justify-start`,m===`card`&&`data-[state=active]:bg-background data-[state=active]:border data-[state=active]:shadow-sm rounded-md`,m===`pill`&&`rounded-full data-[state=active]:bg-background`,m===`line`&&!h&&`rounded-none border-b-2 border-transparent bg-transparent px-1 pb-2.5 -mb-px shadow-none data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:text-foreground`);return(0,o.jsxs)(ua,{value:I,onValueChange:e=>{F(e),ee?.(e)},orientation:h?`vertical`:`horizontal`,className:q(n,h&&`flex gap-4 w-full`),...s,...l,children:[(j.length>1||e?.alwaysShowStrip===!0||e?.properties?.alwaysShowStrip===!0)&&(0,o.jsx)(da,{className:L,children:j.map(e=>(0,o.jsxs)(fa,{value:e.value,className:R(),children:[e.icon&&(0,o.jsx)(ro,{name:e.icon,className:`mr-1.5 h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr}),e.count!==void 0&&e.count!==null&&e.count!==``&&Number(e.count)>0&&(0,o.jsx)(`span`,{className:`ml-1.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground`,"aria-label":u(`common.itemCount`,{count:Number(e.count)<1e3?Number(e.count):Md(e.count)}),children:Md(e.count)})]},e.value))}),j.map(e=>(0,o.jsx)(pa,{value:e.value,className:q(j.length>1?`mt-3`:`mt-0`,h&&`mt-0 flex-1`),children:J(e.children)},e.value))]})},{namespace:`page`,skipFallback:!0,label:`Page Tabs`,category:`layout`,isContainer:!0,inputs:[{name:`items`,type:`array`,of:`object`,required:!0,description:`Tab definitions [{ label, value?, icon?, count?, visibleWhen?, children }] — value is the stable ?tab= URL token, count auto-derives from record:related_list descendants when omitted`},{name:`tabStyle`,type:`enum`,enum:[`line`,`card`,`pill`]},{name:`position`,type:`enum`,enum:[`top`,`left`]},{name:`alwaysShowStrip`,type:`boolean`,description:`Keep the tab strip visible when only one tab survives. Default false: a lone pill is clutter rather than an affordance, so a one-tab strip is hidden and its panel renders bare. Count the tabs AFTER each item visibleWhen predicate has been evaluated — a page authored with four tabs of which three are conditional reaches this rule whenever the other three are false.`}]}),t.ComponentRegistry.register(`card`,({schema:e,className:t,...n})=>{let{designer:r}=wd(n),{language:a}=(0,_.useObjectTranslation)(),s=(0,_.useDisplayLocale)(),c=(0,i.resolveInlineAriaProps)(e?.aria,s),l=(0,_.pickLocalized)(e?.title,a),u=e?.bordered!==!1,d=e?.body??e?.children,f=e?.footer;return(0,o.jsxs)(mt,{className:q(t,!u&&`border-0 shadow-none bg-transparent`),...r,...c,children:[l&&(0,o.jsx)(ht,{children:(0,o.jsx)(gt,{children:l})}),pe(d,e=>(0,o.jsx)(vt,{children:J(e)})),pe(f,e=>(0,o.jsx)(yt,{className:`flex justify-between`,children:J(e)}))]})},{namespace:`page`,skipFallback:!0,label:`Page Card`,category:`layout`,isContainer:!0,inputs:[{name:`title`,type:[`string`,`object`],description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`bordered`,type:`boolean`},{name:`children`,type:`slot`,description:`Card content components, in order (the card body slot)`},{name:`footer`,type:`slot`}]}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>{let{designer:r}=wd(n),{language:a}=(0,_.useObjectTranslation)(),s=(0,_.useDisplayLocale)(),c=(0,i.resolveInlineAriaProps)(e?.aria,s),l=(0,_.useSafeTranslate)(),u=e?.items||[],d=!!e?.allowMultiple,f=(e?.variant??e?.properties?.variant??`flush`)===`flush`?`border-b last:border-b-0`:void 0,p=u.map((e,t)=>({...e,value:`panel-${t}`,labelStr:Od((0,_.pickLocalized)(e.label,a),a,l)})),m=p.filter(e=>e.collapsed===!1).map(e=>e.value),h=p.map(e=>(0,o.jsxs)(Y,{value:e.value,className:f,children:[(0,o.jsx)(De,{className:`text-sm font-semibold tracking-tight hover:no-underline`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.icon&&(0,o.jsx)(ro,{name:e.icon,className:`h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr})]})}),(0,o.jsx)(Oe,{children:J(e.children)})]},e.value));return d?(0,o.jsx)(Ee,{type:`multiple`,defaultValue:m,className:t,...r,...c,children:h}):(0,o.jsx)(Ee,{type:`single`,collapsible:!0,defaultValue:m[0],className:t,...r,...c,children:h})},{namespace:`page`,skipFallback:!0,label:`Page Accordion`,category:`layout`,isContainer:!0,inputs:[{name:`items`,type:`array`,of:`object`,required:!0,description:`Panel definitions [{ label, icon?, collapsed?, children }] — collapsed: false opens a panel by default`},{name:`allowMultiple`,type:`boolean`},{name:`variant`,type:`enum`,enum:[`flush`,`card`]}]}),t.ComponentRegistry.register(`section`,({schema:e,className:t,...n})=>{let{designer:r}=wd(n);return(0,o.jsx)(`section`,{className:q(`space-y-4`,t),...r,children:J(e?.children||e?.body)})},{namespace:`page`,skipFallback:!0,label:`Page Section`,category:`layout`,isContainer:!0,inputs:xd});var Fd=new Set;function Id(e,t,n){if(!n||typeof n!=`object`||Object.keys(n).length===0)return;let r=/\brecord\.([A-Za-z_][A-Za-z0-9_]*)/g,i=[];for(let e=r.exec(t);e;e=r.exec(t))!(e[1]in n)&&!i.includes(e[1])&&i.push(e[1]);if(i.length===0)return;let a=`missing::${String(e)}::${t}`;Fd.has(a)||(Fd.add(a),console.warn(`[page:header] action "${String(e)}" predicate references record field(s) not present in the record payload: ${i.join(`, `)}. Predicate: ${t}. This page bound a record payload that does not carry those key(s) — a projected or partial read ($select, an embedded card, a custom page passing a projected record) will not include them — so the predicate fails closed and the action stays hidden.`))}var Ld=new Set;function Rd(e,t,n,r){let i=`${t??``}::${e}::${n}`;if(Ld.has(i))return;Ld.add(i);let a=n===`no-object`?"this header is not bound to an object (no RecordContext `objectName`), so ids cannot be resolved at all":n===`no-metadata`?`no metadata could be read for object "${String(t)}" (no MetadataProvider in scope, or the object does not exist)`:`object "${String(t)}" declares no action by that name. Declared: ${r.length>0?r.join(`, `):`(none)`}`;console.warn(`[page:header] action id "${e}" did not resolve — ${a}. Nothing is rendered for it. \`PageHeaderProps.actions\` is a list of ACTION IDS (@objectstack/spec: \`z.array(z.string())\`, "Action IDs to show in header"), resolved against the object's own \`actions\` metadata the same way \`record:quick_actions\` resolves them.`)}var zd=new Set;function Bd(e,t){let n=`${e??``}::${t.index}::${t.message}`;zd.has(n)||(zd.add(n),console.error(`[page:header] actions refused at index ${t.index} — ${t.message}. None of the authored actions is rendered. \`PageHeaderProps.actions\` is a list of ACTION IDS (@objectstack/spec: \`z.array(z.string())\`); an inline action object is a transition tolerance that must not share an array with ids.`))}t.ComponentRegistry.register(`header`,({schema:e,className:n,...r})=>{let{designer:s}=wd(r),c=(0,_.useDisplayLocale)(),u=(0,i.resolveInlineAriaProps)(e?.aria,c),d=(0,i.useRecordContext)(),f=!!(0,i.useInlineEdit)()?.editing,p=(0,i.usePredicateScope)(),{execute:m}=(0,i.useAction)(),h=(0,i.useCapabilityGate)(),g=pi(),{objectLabel:v}=(0,_.useObjectLabel)(),y=(0,i.useActionTextLocalizer)(),{fieldOptionLabel:b}=(0,_.useSafeFieldLabel)(),{language:x}=(0,_.useObjectTranslation)(),S=(0,_.useSafeTranslate)(),C=d?.refresh,[w,T]=a.default.useState(!1),E=a.default.useRef(void 0);a.default.useEffect(()=>()=>clearTimeout(E.current),[]);let D=a.default.useCallback(()=>{C&&(C(),T(!0),clearTimeout(E.current),E.current=setTimeout(()=>T(!1),Sd))},[C]),O=e?.title??e?.properties?.title,k=e?.subtitle??e?.properties?.subtitle,A=d?.objectSchema,j=d?.objectName||A?.name,M=jd((0,_.pickLocalized)(O,x),d?.data,A,b,j),N=jd((0,_.pickLocalized)(k,x),d?.data,A,b,j),ee=e?.recordChrome===!1||e?.properties?.recordChrome===!1,P=e?.showStar!==!1&&e?.properties?.showStar!==!1,F=e?.showCopyId!==!1&&e?.properties?.showCopyId!==!1,I=e?.actions??e?.properties?.actions,L=d?.headerSystemActions,R=a.default.useMemo(()=>Array.isArray(I)?I:[],[I]),z=a.default.useMemo(()=>(0,oe.resolveDeclaredActionIds)(R,void 0),[R]),B=z.kind===`ids`&&z.ids.length>0&&!!j,{item:te,loading:ne}=(0,i.useMetadataItem)(`object`,B?j:null),re=a.default.useMemo(()=>{let e=Array.isArray(te?.actions)?te.actions:[],t=(0,oe.resolveDeclaredActionIds)(R,e);if(t.kind===`refused`)return Bd(j,t),[];if(t.kind===`ids`&&(!B||!ne)){let n=Array.from(new Set(e.map(e=>typeof e?.name==`string`?e.name:``).filter(e=>e!==``)));for(let{id:e}of t.unresolved)Rd(e,j,j?te?`not-found`:`no-metadata`:`no-object`,n)}return t.actions},[R,te,ne,B,j]),V=A?.fields,ie=a.default.useMemo(()=>{let e=p?.user,n=(0,t.toPredicateRecord)(d?.data,V);return{...p&&typeof p==`object`?p:{},user:e,os:p?.os??{user:e},ctx:{user:e,record:n,data:n,app:p?.app,features:p?.features}}},[p,d?.data,V]),H=a.default.useCallback((e,n,r)=>(0,t.evalRowPredicate)(e,d?.data??{},{fallback:r,scope:ie,fields:V,warnOnError:!0,label:n}),[d?.data,ie,V]),U=a.default.useMemo(()=>{let e=d?.data,t=t=>{if(!h(t?.requiredPermissions))return!1;let n=t?.visible;if(n!=null){if(typeof n==`boolean`){if(!n)return!1}else{let r=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.source==`string`?n.source:null;if(r&&(Id(t?.name,r,e),!H(n,`page:header action "${String(t?.name)}" visible`,!1)))return!1}}let r=t?.hidden;if(r!=null){if(typeof r==`boolean`){if(r)return!1}else{let n=typeof r==`string`?r:r&&typeof r==`object`&&typeof r.source==`string`?r.source:null;if(n&&(Id(t?.name,n,e),H(r,`page:header action "${String(t?.name)}" hidden`,!1)))return!1}}return!0},n=e=>(0,oe.actionRendersAt)(e,`record_header`)||(0,oe.actionRendersAt)(e,`record_more`),r=re.filter(e=>n(e)&&t(e)),i=Array.isArray(L)?L.filter(t):[],a=new Set,o=[];for(let e of[...r,...i]){let t=e?.name||e?.id||``;t&&a.has(t)||(t&&a.add(t),o.push(e))}return o.some(e=>e?.order!==void 0||e?.variant===`primary`)?[...o].sort((e,t)=>{let n=(e?.order??0)-(t?.order??0);return n===0?(e?.variant===`primary`?0:1)-(t?.variant===`primary`?0:1):n}):o},[re,L,d?.data,H]),ae=a.default.useMemo(()=>U.map((e,t)=>y(d?.objectName,e,{fallbackLabel:typeof e?.id==`string`&&e.id||`Action ${t+1}`})),[U,y,d?.objectName]),se=d?.data,W=a.default.useCallback(e=>{let{params:t,...n}=e??{},r=Array.isArray(t)?void 0:fo({...n,params:t},n.type||n.actionType,`page:header`);if(!se||typeof se!=`object`){m(t!=null&&!Array.isArray(t)&&r===void 0?n:e);return}let i={...n};Array.isArray(t)?(!i.actionParams&&t.length>0&&(i.actionParams=t),i.params={_rowRecord:se}):i.params={...r||{},_rowRecord:se},m(i)},[se,m]),G=()=>{if(ae.length===0)return null;let t=e=>e?.label??``,n=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:void 0,r=g?n(e?.mobileMaxVisible??e?.properties?.mobileMaxVisible)??1:n(e?.maxVisible??e?.properties?.maxVisible)??3,i=e=>Array.isArray(e?.locations)&&e.locations.length>0&&e.locations.includes(`record_more`)&&!e.locations.includes(`record_header`),a=ae.filter(i),s=ae.filter(e=>!i(e)&&e?.component===`action:menu`),c=ae.filter(e=>!i(e)&&e?.component!==`action:menu`),u=c.slice(0,r),d=[...c.slice(r),...s,...a],p=d.length>0,m=(e,t)=>e==null?!1:typeof e==`boolean`?e:(typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`&&e.source)?H(e,`page:header action "${String(t)}" disabled`,!0):!1,h=e=>f&&e?.disableDuringInlineEdit===!0||m(e?.disabled,e?.name??e?.id);return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 shrink-0`,role:`toolbar`,"aria-label":S(`detail.pageHeaderActions`,`Page header actions`),children:[u.map((e,n)=>{let r=t(e),i=e.variant===`primary`?`default`:e.variant||`default`,a=e.size||`sm`,s=h(e),c=typeof e.icon==`string`?e.icon:null;return(0,o.jsxs)(X,{variant:i,size:a,disabled:s,className:`gap-2`,onClick:()=>{if(typeof e.onClick==`function`){e.onClick();return}W(e)},children:[c&&(0,o.jsx)(ro,{name:c,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},e.name||e.id||`header-action-${n}`)}),p&&(0,o.jsxs)(wn,{children:[(0,o.jsx)(Tn,{asChild:!0,children:(0,o.jsx)(X,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,"aria-label":S(`detail.moreActions`,`More actions`),children:(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsx)(Mn,{align:`end`,className:`w-44`,children:d.map((e,n)=>{let r=t(e),i=h(e),a=typeof e.icon==`string`?e.icon:null,s=e.variant===`destructive`||e.name===`sys_delete`;return(0,o.jsxs)(Nn,{disabled:i,onSelect:t=>{if(t.preventDefault(),typeof e.onClick==`function`){e.onClick();return}W(e)},className:q(`gap-2`,s&&`text-destructive focus:text-destructive focus:bg-destructive/10`),children:[a&&(0,o.jsx)(ro,{name:a,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},e.name||e.id||`overflow-action-${n}`)})})]})]})},ce=()=>{if(!C)return null;let e=S(`common.refresh`,`Refresh`);return(0,o.jsx)(hi,{children:(0,o.jsxs)(gi,{children:[(0,o.jsx)(_i,{asChild:!0,children:(0,o.jsx)(X,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,onClick:D,"aria-label":e,"data-page-refresh":!0,children:(0,o.jsx)(l.RefreshCw,{className:q(`h-4 w-4`,w&&`animate-spin`)})})}),(0,o.jsx)(vi,{children:e})]})})},le=e=>{let t=G()??e,n=ce();return n?(0,o.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[t,n]}):t};if(d?.data&&d?.objectSchema&&!ee){let e=d.data,r=d.objectSchema,i=d.objectName||r?.name,a=Td(r?.label)||r?.name||d.objectName||``,c=i?v({name:i,label:a}):a||void 0,l=(0,t.formatTitleTemplate)(r?.titleFormat,Ad(e,r,b,i)),f=e?.id??e?._id,p=e=>e===`Untitled`||f!=null&&e===`Record #${f}`,m=(()=>{let n=(0,t.getRecordDisplayName)(r,e,{deriveFromRecordKeys:!1});return p(n)?``:n})(),h=(()=>{if(m||(0,t.resolveNameField)(r))return``;let n=(0,t.getRecordDisplayName)(r,e);return p(n)?``:n})(),g=(c&&e?.id?`${c} ${String(e.id).slice(0,8)}`:``)||c||``,_=(()=>{let n=(0,t.recordDisplayValueAt)(e,(0,t.declaredNameField)(r));return n&&!p(n)?n:``})(),y=M||_||l||m||h,x=(typeof y==`string`?y.trim()?y:``:(0,t.recordDisplayValueAt)({value:y},`value`)??``)||g;return(0,o.jsxs)(`header`,{className:q(`flex flex-col sm:flex-row sm:flex-wrap items-start sm:items-center justify-between gap-3 sm:gap-4 pb-4 border-b`,n),...s,...u,children:[(0,o.jsxs)(`div`,{className:`flex flex-col min-w-0 sm:min-w-48 flex-1`,children:[(0,o.jsx)(uu,{title:x,objectLabel:c,resourceId:e?.id?String(e.id):void 0,showStar:P,showCopyId:F,isFavorite:d?.isFavorite,onToggleFavorite:d?.onToggleFavorite?()=>d.onToggleFavorite():void 0}),N&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:N})]}),le((0,o.jsx)(`div`,{"data-page-actions-slot":!0,className:`shrink-0`}))]})}return(0,o.jsx)(`header`,{className:q(`flex flex-col gap-2 pb-4 border-b`,n),...s,...u,children:(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[M&&(0,o.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:M}),N&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:N})]}),le((0,o.jsx)(`div`,{"data-page-actions-slot":!0}))]})})},{namespace:`page`,skipFallback:!0,label:`Page Header`,category:`layout`,inputs:[{name:`title`,type:[`string`,`object`],description:`Supports {field} interpolation and inline translation maps; falls back to the record title`},{name:`subtitle`,type:[`string`,`object`],description:`Same interpolation as Title`},{name:`actions`,type:`array`,of:`string`,description:`Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_header nor record_more in its locations renders nowhere.`},{name:`recordChrome`,type:`boolean`,description:`Set false for the bare h1 header on non-record pages`},{name:`showStar`,type:`boolean`},{name:`showCopyId`,type:`boolean`},{name:`maxVisible`,type:`number`,description:`How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer — the contract rejects 0 and fractional values. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu.`},{name:`mobileMaxVisible`,type:`number`,description:`The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1; the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged.`}]}),t.ComponentRegistry.register(`footer`,({schema:e,className:t,...n})=>{let{designer:r}=wd(n);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ei,{className:`my-4`}),(0,o.jsx)(`footer`,{className:q(`flex items-center justify-between text-sm text-muted-foreground`,t),...r,children:J(e?.children||e?.body)})]})},{namespace:`page`,skipFallback:!0,label:`Page Footer`,category:`layout`,isContainer:!0,inputs:xd}),t.ComponentRegistry.register(`sidebar`,({schema:e,className:t,...n})=>{let{designer:r}=wd(n);return(0,o.jsx)(`aside`,{className:q(`flex flex-col gap-4 w-full md:w-80 shrink-0`,t),...r,children:J(e?.children||e?.body)})},{namespace:`page`,skipFallback:!0,label:`Page Sidebar`,category:`layout`,isContainer:!0,inputs:xd}),[`aside`,`main`,`header`,`nav`,`footer`,`section`,`article`].forEach(e=>{let n=(0,a.forwardRef)(({schema:t,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=r;return(0,o.jsx)(e,{ref:i,className:n,...l,"data-obj-id":a,"data-obj-type":s,style:c,children:J(t.children)})});n.displayName=`Semantic${e.charAt(0).toUpperCase()+e.slice(1)}`,t.ComponentRegistry.register(e,n,{namespace:`ui`,label:e.charAt(0).toUpperCase()+e.slice(1),category:`layout`,isContainer:!0,inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}]})}),t.ComponentRegistry.register(`aspect-ratio`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(We,{ratio:e.ratio||16/9,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.image?(0,o.jsx)(`img`,{src:e.image,alt:e.alt||``,loading:`lazy`,className:`rounded-md object-cover w-full h-full`}):J(e.children)})},{namespace:`ui`,label:`Aspect Ratio`,isContainer:!0,inputs:[{name:`ratio`,type:`number`},{name:`image`,type:`string`},{name:`alt`,type:`string`},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Content rendered inside the ratio box when no `image` is set"}],defaultProps:{ratio:16/9}});var Vd={name:`children`,type:`slot`};function Hd(e){if(e===!1)return`none`;if(e!==!0&&e!==void 0)return e}function Ud({schema:e,collapsible:t,...n}){let r=Di(),i=Hd(t),a=(0,o.jsx)(ki,{...n,...i===void 0?{}:{collapsible:i},children:J(e.children)});return r?a:(0,o.jsx)(Oi,{className:`min-h-0`,children:a})}t.ComponentRegistry.register(`sidebar`,Ud,{namespace:`ui`,label:`Sidebar`,inputs:[{name:`collapsible`,type:`boolean`,description:"`false` draws the sidebar in the page flow, not collapsible; `true` or omitted keeps the collapsible app-region form."},{name:`side`,type:`enum`,enum:[`left`,`right`]},{name:`variant`,type:`enum`,enum:[`sidebar`,`floating`,`inset`]},Vd],defaultProps:{side:`left`,variant:`sidebar`}});var Wd=`flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b px-3 sm:px-4`;function Gd({crumb:e,isLast:t}){let n=(0,i.resolveKeyedI18nLabel)(e.label)??``;return e.siblings&&e.siblings.length>0?(0,o.jsxs)(wn,{children:[(0,o.jsxs)(Tn,{className:`flex items-center gap-1`,children:[t?(0,o.jsx)(`span`,{className:`font-semibold`,children:n}):(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(l.ChevronDown,{className:`h-3 w-3`})]}),(0,o.jsx)(Mn,{align:`start`,children:e.siblings.map((e,t)=>(0,o.jsx)(Nn,{asChild:!0,children:(0,o.jsx)(`a`,{href:e.href,children:e.label})},t))})]}):t?(0,o.jsx)(et,{children:n}):(0,o.jsx)($e,{href:e.href||`#`,children:n})}t.ComponentRegistry.register(`header-bar`,({schema:e,className:n,style:r,...s})=>(0,o.jsxs)(`header`,{...(0,t.toDomProps)(s),className:q(Wd,e.className),style:r,children:[(0,o.jsx)(Ai,{}),(0,o.jsx)(ei,{orientation:`vertical`,className:`mr-2 h-4`}),(0,o.jsx)(Xe,{children:(0,o.jsx)(Ze,{children:e.crumbs?.map((t,n)=>{let r=Wa(t.icon);return(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsxs)(Qe,{children:[r&&(0,o.jsx)(r,{className:`h-4 w-4`}),(0,o.jsx)(Gd,{crumb:t,isLast:n===e.crumbs.length-1})]}),n<e.crumbs.length-1&&(0,o.jsx)(tt,{})]},n)})})}),(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[e.search?.enabled&&(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(l.Search,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(Q,{type:`search`,placeholder:e.search.placeholder,className:`pl-8 w-[200px] lg:w-[300px]`}),e.search.shortcut&&(0,o.jsx)(`kbd`,{className:`pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex`,children:e.search.shortcut})]}),e.actions?.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e)},t)),e.rightContent?(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.rightContent)}):null]})]}),{namespace:`ui`,label:`Header Bar`,inputs:[{name:`crumbs`,type:`array`},{name:`search`,type:`object`},{name:`actions`,type:`array`},{name:`rightContent`,type:`object`}],defaultProps:{crumbs:[{label:`Home`,href:`#`},{label:`Current Page`}]}}),t.ComponentRegistry.register(`badge`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Ye,{variant:e.variant,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.label||J(e.children)})},{namespace:`ui`,label:`Badge`,inputs:[{name:`label`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Badge`,variant:`default`}}),t.ComponentRegistry.register(`avatar`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ge,{className:t,...n,children:[(0,o.jsx)(Ke,{src:e.src,alt:e.alt}),(0,o.jsx)(qe,{children:e.fallback})]}),{namespace:`ui`,label:`Avatar`,inputs:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`fallback`,type:`string`},{name:`className`,type:`string`}],defaultProps:{fallback:`CN`,alt:`Avatar`}}),t.ComponentRegistry.register(`alert`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ve,{variant:e.variant,className:t,...n,children:[(0,o.jsx)(He,{children:e.title}),(0,o.jsx)(Ue,{children:e.description||J(e.children)})]}),{namespace:`ui`,label:`Alert`,inputs:[{name:`title`,type:`string`,required:!0},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`destructive`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich description content, rendered when `description` is not set"}],defaultProps:{title:`Alert Title`,description:`This is an alert message.`,variant:`default`}}),t.ComponentRegistry.register(`list`,({schema:e,className:t,...n})=>{let r=(0,i.useDataScope)(e.bind),a=Array.isArray(r)?r:Array.isArray(e.items)?e.items:[],s=e.ordered?`ol`:`ul`,c=e.ordered?`list-decimal`:`list-disc`;return(0,o.jsxs)(`div`,{className:q(`space-y-2`,e.wrapperClass),children:[e.title&&(0,o.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),(0,o.jsx)(s,{className:q(`ml-6 [&>li]:mt-2`,c,t),...n,children:a.map((e,t)=>(0,o.jsx)(`li`,{className:q(typeof e==`object`&&e.className),children:typeof e==`string`?e:J(e.content)},t))})]})},{namespace:`ui`,label:`List`,inputs:[{name:`title`,type:`string`},{name:`ordered`,type:`boolean`},{name:`items`,type:`array`,description:`Array of strings or objects with content`},{name:`className`,type:`string`}],defaultProps:{ordered:!1,items:[`First item`,`Second item`,`Third item`],className:`text-sm`}});var Kd=({node:e,onNodeClick:t})=>{let[n,r]=(0,a.useState)(!1),i=e.children&&e.children.length>0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsxs)(`div`,{className:q(`group flex items-center py-1.5 px-2 rounded-sm cursor-pointer transition-colors`,`hover:bg-accent hover:text-accent-foreground`,n&&i&&`bg-accent/50`),onClick:()=>{t&&t(e)},children:[i?(0,o.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(!n)},className:`mr-2 p-0.5 h-5 w-5 flex items-center justify-center rounded-sm hover:bg-muted text-muted-foreground transition-colors`,children:n?(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4`}):(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})}):(0,o.jsx)(`span`,{className:`mr-2 w-5 flex justify-center`,children:(0,o.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-muted-foreground/50`})}),e.icon===`folder`||i?n?(0,o.jsx)(l.FolderOpen,{className:`h-4 w-4 mr-2 text-primary`}):(0,o.jsx)(l.Folder,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}):(0,o.jsx)(l.File,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}),(0,o.jsx)(`span`,{className:q(`text-sm transition-colors`,n?`font-medium text-foreground`:`text-muted-foreground group-hover:text-foreground`),children:e.label})]}),i&&n&&(0,o.jsx)(`div`,{className:`relative ml-[11px] pl-3 border-l border-border animate-in slide-in-from-left-2 fade-in duration-200`,children:e.children.map(e=>(0,o.jsx)(Kd,{node:e,onNodeClick:t},e.id))})]})};t.ComponentRegistry.register(`tree-view`,({schema:e,className:t,...n})=>{let r=t=>{e.onNodeClick&&e.onNodeClick(t)},a=(0,i.useDataScope)(e.bind)||e.nodes||[],s=Array.isArray(a)?a:[];return(0,o.jsxs)(`div`,{className:q(`relative border rounded-lg p-3 bg-card text-card-foreground`,t),...n,children:[e.title&&(0,o.jsx)(`div`,{className:`flex items-center gap-2 mb-3 pb-2 border-b`,children:(0,o.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title})}),(0,o.jsx)(`div`,{className:`space-y-1`,children:s.map(e=>(0,o.jsx)(Kd,{node:e,onNodeClick:r},e.id))})]})},{namespace:`ui`,label:`Tree View`,inputs:[{name:`title`,type:`string`},{name:`nodes`,type:`array`,description:`Array of { id, label, icon, children, data }`},{name:`className`,type:`string`}],defaultProps:{title:`File Explorer`,nodes:[{id:`1`,label:`Documents`,icon:`folder`,children:[{id:`1-1`,label:`Resume.pdf`,icon:`file`},{id:`1-2`,label:`Cover Letter.docx`,icon:`file`}]},{id:`2`,label:`Photos`,icon:`folder`,children:[{id:`2-1`,label:`Vacation`,icon:`folder`,children:[{id:`2-1-1`,label:`Beach.jpg`,icon:`file`}]},{id:`2-2`,label:`Family.jpg`,icon:`file`}]},{id:`3`,label:`README.md`,icon:`file`}]}});var qd=e=>e?no(e):null;t.ComponentRegistry.register(`statistic`,({schema:e})=>{let t=e.icon?qd(e.icon):null;return(0,o.jsxs)(`div`,{className:q(`group relative flex flex-col p-4 sm:p-5 md:p-6 rounded-xl border bg-card text-card-foreground shadow-sm`,e.className),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[e.label&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),t&&(0,o.jsx)(t,{className:`h-4 w-4 text-muted-foreground`})]}),(0,o.jsx)(`div`,{className:`flex items-baseline gap-2`,children:(0,o.jsx)(`h3`,{className:`text-2xl font-bold tracking-tight`,children:e.value})}),(e.trend||e.description)&&(0,o.jsxs)(`div`,{className:`mt-1 flex items-center text-xs text-muted-foreground`,children:[e.trend===`up`&&(0,o.jsx)(l.TrendingUp,{className:`mr-1 h-3 w-3 text-emerald-500`}),e.trend===`down`&&(0,o.jsx)(l.TrendingDown,{className:`mr-1 h-3 w-3 text-rose-500`}),e.trend===`neutral`&&(0,o.jsx)(l.Minus,{className:`mr-1 h-3 w-3`}),(0,o.jsx)(`span`,{className:q(e.trend===`up`&&`text-emerald-500 font-medium`,e.trend===`down`&&`text-rose-500 font-medium`),children:e.description})]})]})},{namespace:`ui`,label:`Statistic`,category:`data-display`,icon:`Activity`,inputs:[{name:`label`,type:`string`},{name:`value`,type:`string`},{name:`description`,type:`string`},{name:`trend`,type:`enum`,enum:[{label:`Up`,value:`up`},{label:`Down`,value:`down`},{label:`Neutral`,value:`neutral`}]}],defaultProps:{label:`Total Revenue`,value:`$45,231.89`,trend:`up`,description:`+20.1% from last month`}});var Jd=`/`;function Yd(e,t){let n=e.map(e=>({kind:`item`,item:e}));if(typeof t!=`number`||!Number.isFinite(t))return n;let r=Math.floor(t);if(r<1||e.length<=r)return n;let i=Math.min(1,r-1),a=r-i;return[...e.slice(0,i).map(e=>({kind:`item`,item:e})),{kind:`ellipsis`},...e.slice(e.length-a).map(e=>({kind:`item`,item:e}))]}t.ComponentRegistry.register(`breadcrumb`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,...s}=t,c=e.separator??Jd,l=Yd(e.items??[],e.maxItems);return(0,o.jsx)(Xe,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:a,children:(0,o.jsx)(Ze,{children:l.map((e,t)=>{let n=t===l.length-1,r=!n&&(0,o.jsx)(tt,{children:c});if(e.kind===`ellipsis`)return(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsx)(Qe,{children:(0,o.jsx)(nt,{})}),r]},t);let a=e.item,s=Wa(a.icon);return(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsxs)(Qe,{children:[s&&(0,o.jsx)(s,{className:`h-4 w-4`}),n?(0,o.jsx)(et,{children:(0,i.resolveKeyedI18nLabel)(a.label)??``}):(0,o.jsx)($e,{href:a.href,children:(0,i.resolveKeyedI18nLabel)(a.label)??``})]}),r]},t)})})})},{namespace:`ui`,label:`Breadcrumb`,inputs:[{name:`className`,type:`string`},{name:`separator`,type:`string`},{name:`maxItems`,type:`number`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`Products`,href:`/products`},{label:`Product`}]}}),t.ComponentRegistry.register(`kbd`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t,s=Array.isArray(e.keys)?e.keys:[e.keys||e.label||`K`];return(0,o.jsx)(`div`,{className:q(`inline-flex flex-wrap gap-1`,e.className),children:s.map((e,t)=>(0,o.jsx)(`kbd`,{className:`pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100`,...a,...t===0?{"data-obj-id":n,"data-obj-type":r,style:i}:{},children:e},t))})},{namespace:`ui`,label:`Keyboard Key`,inputs:[{name:`label`,type:`string`},{name:`className`,type:`string`}],defaultProps:{label:`K`}}),t.ComponentRegistry.register(`progress`,({schema:e,className:t,...n})=>(0,o.jsx)(zr,{value:e.value,className:t,...n}),{namespace:`ui`,label:`Progress`,inputs:[{name:`value`,type:`number`},{name:`className`,type:`string`}],defaultProps:{value:50,className:`w-full`}}),t.ComponentRegistry.register(`skeleton`,({schema:e,className:t,...n})=>(0,o.jsx)($,{className:t,...n,style:{width:e.width,height:e.height}}),{namespace:`ui`,label:`Skeleton`,inputs:[{name:`width`,type:`string`},{name:`height`,type:`string`},{name:`className`,type:`string`}],defaultProps:{width:`100%`,height:`20px`,className:`rounded-md`}});var Xd={top_left:`top-left`,top_center:`top-center`,top_right:`top-right`,bottom_left:`bottom-left`,bottom_center:`bottom-center`,bottom_right:`bottom-right`,"top-left":`top-left`,"top-center":`top-center`,"top-right":`top-right`,"bottom-left":`bottom-left`,"bottom-center":`bottom-center`,"bottom-right":`bottom-right`};t.ComponentRegistry.register(`toaster`,({schema:e})=>{let t=e?.position?Xd[e.position]:void 0,n=typeof e?.limit==`number`&&e.limit>0?e.limit:void 0;return(0,o.jsx)(ea,{...t?{position:t}:{},...n?{visibleToasts:n}:{}})},{namespace:`ui`,label:`Toaster`,inputs:[{name:`position`,type:`enum`,enum:[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`]},{name:`limit`,type:`number`}],defaultProps:{}}),t.ComponentRegistry.register(`loading`,({schema:e,className:t,...n})=>{let r=e.size||`md`,i=e.fullscreen||!1,a=(0,o.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center gap-2`,t),children:[(0,o.jsx)(eu,{className:q(r===`sm`&&`h-4 w-4`,r===`md`&&`h-8 w-8`,r===`lg`&&`h-12 w-12`,r===`xl`&&`h-16 w-16`)}),e.label&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.label})]});return i?(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,...n,children:a}):(0,o.jsx)(`div`,{className:`flex items-center justify-center p-8`,...n,children:a})},{namespace:`ui`,label:`Loading`,inputs:[{name:`label`,type:`string`},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`]},{name:`fullscreen`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{label:`Loading...`,size:`md`,fullscreen:!1}}),t.ComponentRegistry.register(`toast`,({schema:e})=>(0,o.jsx)(X,{onClick:()=>{(e.variant===`success`?B.toast.success:e.variant===`error`?B.toast.error:e.variant===`warning`?B.toast.warning:e.variant===`info`?B.toast.info:B.toast)(e.title||`Notification`,{description:e.description,duration:e.duration})},variant:e.buttonVariant,className:e.className,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Toast`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`warning`,`error`,`info`]},{name:`duration`,type:`number`},{name:`buttonLabel`,type:`string`},{name:`buttonVariant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],description:"Variant for the trigger button this node renders. Exactly the six keys of the Button variant group: `cva` contributes no variant class for any other value, so an out-of-set value renders a button with no background and no text colour, while an empty string silently renders the default look."},{name:`className`,type:`string`}],defaultProps:{title:`Notification`,buttonLabel:`Show Toast`,variant:`default`,duration:5e3}}),t.ComponentRegistry.register(`spinner`,({schema:e,className:n,...r})=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=r;return(0,o.jsx)(l.Loader2,{className:q(`animate-spin`,{sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`,xl:`h-12 w-12`}[e.size||`md`],e.className,n),...(0,t.toDomProps)(c),"data-obj-id":i,"data-obj-type":a,style:s})},{namespace:`ui`,label:`Spinner`,inputs:[{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`]},{name:`className`,type:`string`}],defaultProps:{size:`md`}}),t.ComponentRegistry.register(`empty`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,action:s,icon:c,...l}=t,u=e.action==null?void 0:(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.action)});return(0,o.jsx)(hu,{title:e.title||`No data`,description:e.description,className:e.className,action:u,...l,"data-obj-id":n,"data-obj-type":r,style:a})},{namespace:`ui`,label:`Empty`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`action`,type:`slot`,description:`Call-to-action node rendered below the description, e.g. a button`},{name:`className`,type:`string`}],defaultProps:{title:`No data`}}),t.ComponentRegistry.register(`sonner`,({schema:e,...t})=>{let{style:n,...r}=t;return(0,o.jsx)(X,{onClick:()=>{(e.variant===`success`?B.toast.success:e.variant===`error`?B.toast.error:e.variant===`warning`?B.toast.warning:e.variant===`info`?B.toast.info:B.toast)(e.message||e.title||`Notification`,{description:e.description})},variant:e.buttonVariant,className:e.className,...Ys(r),style:n,children:e.buttonLabel||`Show Toast`})},{namespace:`ui`,label:`Sonner Toast`,inputs:[{name:`message`,type:`string`},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`error`,`warning`,`info`]},{name:`buttonLabel`,type:`string`},{name:`buttonVariant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],description:"Variant for the trigger button this node renders. Exactly the six keys of the Button variant group: `cva` contributes no variant class for any other value, so an out-of-set value renders a button with no background and no text colour, while an empty string silently renders the default look."},{name:`className`,type:`string`}],defaultProps:{message:`Notification`,buttonLabel:`Show Toast`,variant:`default`}}),t.ComponentRegistry.register(`dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(Nt,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[me(Pt,e.trigger),(0,o.jsxs)(Rt,{className:t,children:[(0,o.jsxs)(zt,{children:[e.title&&(0,o.jsx)(Vt,{children:e.title}),e.description&&(0,o.jsx)(Ht,{children:e.description})]}),J(e.content),pe(e.footer,e=>(0,o.jsx)(Bt,{children:J(e)}))]})]}),{namespace:`ui`,label:`Dialog`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`modal`,type:`boolean`},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`,description:`Element that opens the dialog`},{name:`content`,type:`slot`,description:`Main content of the dialog`},{name:`footer`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Dialog Title`,description:`Dialog description goes here`,modal:!0,trigger:[{type:`button`,label:`Open Dialog`}],content:[{type:`text`,content:`Dialog content goes here`}]}}),t.ComponentRegistry.register(`sheet`,({schema:e,className:t,...n})=>(0,o.jsxs)(ti,{defaultOpen:e.defaultOpen,...n,children:[me(ni,e.trigger),(0,o.jsxs)(si,{side:e.side||`right`,className:t,children:[(0,o.jsxs)(ci,{children:[e.title&&(0,o.jsx)(ui,{children:e.title}),e.description&&(0,o.jsx)(di,{children:e.description})]}),J(e.content),pe(e.footer,e=>(0,o.jsx)(li,{children:J(e)}))]})]}),{namespace:`ui`,label:`Sheet`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`footer`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Sheet Title`,description:`Sheet description`,side:`right`,trigger:[{type:`button`,label:`Open Sheet`}],content:[{type:`text`,content:`Sheet content goes here`}]}}),t.ComponentRegistry.register(`popover`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ir,{defaultOpen:e.defaultOpen,...n,children:[me(Lr,e.trigger),(0,o.jsx)(Rr,{align:e.align,side:e.side,className:t,children:J(e.content)})]}),{namespace:`ui`,label:`Popover`,inputs:[{name:`defaultOpen`,type:`boolean`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Open Popover`,variant:`outline`}],content:[{type:`text`,content:`Popover content goes here`}],align:`center`,side:`bottom`}}),t.ComponentRegistry.register(`tooltip`,({schema:e,className:t,...n})=>(0,o.jsx)(hi,{delayDuration:e.delayDuration,children:(0,o.jsxs)(gi,{...n,children:[me(_i,e.trigger),(0,o.jsx)(vi,{side:e.side,align:e.align,className:t,children:e.content||J(e.children)})]})}),{namespace:`ui`,label:`Tooltip`,inputs:[{name:`delayDuration`,type:`number`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`content`,type:`string`},{name:`children`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`outline`}],content:`Tooltip content`,delayDuration:700,side:`top`}}),t.ComponentRegistry.register(`alert-dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ae,{defaultOpen:e.defaultOpen,...n,children:[me(je,e.trigger),(0,o.jsxs)(Pe,{className:t,children:[(0,o.jsxs)(Fe,{children:[e.title&&(0,o.jsx)(Le,{children:e.title}),e.description&&(0,o.jsx)(Z,{children:e.description})]}),J(e.content),(0,o.jsxs)(Ie,{children:[e.cancelText&&(0,o.jsx)(ze,{children:e.cancelText}),e.actionText&&(0,o.jsx)(Re,{className:e.actionVariant?ke({variant:e.actionVariant}):void 0,onClick:e.onAction,children:e.actionText})]})]})]}),{namespace:`ui`,label:`Alert Dialog`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`cancelText`,type:`string`},{name:`actionText`,type:`string`},{name:`actionVariant`,type:`enum`,enum:[`default`,`destructive`]},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Are you sure?`,description:`This action cannot be undone.`,cancelText:`Cancel`,actionText:`Continue`,trigger:[{type:`button`,label:`Open Alert`,variant:`destructive`}]}}),t.ComponentRegistry.register(`drawer`,({schema:e,className:t,...n})=>(0,o.jsxs)(mn,{defaultOpen:e.defaultOpen,...n,children:[me(hn,e.trigger),(0,o.jsxs)(yn,{className:t,children:[(0,o.jsxs)(bn,{children:[e.title&&(0,o.jsx)(Sn,{children:e.title}),e.description&&(0,o.jsx)(Cn,{children:e.description})]}),J(e.content)]})]}),{namespace:`ui`,label:`Drawer`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Drawer Title`,description:`Drawer description`,trigger:[{type:`button`,label:`Open Drawer`}],content:[{type:`text`,content:`Drawer content goes here`}]}}),t.ComponentRegistry.register(`hover-card`,({schema:e,className:t,...n})=>(0,o.jsxs)(Zn,{openDelay:e.openDelay,closeDelay:e.closeDelay,...n,children:[me(Qn,e.trigger),(0,o.jsx)($n,{align:e.align,side:e.side,className:t,children:J(e.content)})]}),{namespace:`ui`,label:`Hover Card`,inputs:[{name:`openDelay`,type:`number`},{name:`closeDelay`,type:`number`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`link`}],content:[{type:`text`,content:`Hover card content appears on hover`}],side:`top`}});var Zd=e=>e?e.map((e,t)=>{if(e.separator)return(0,o.jsx)(Ln,{},t);let n=Wa(e.icon);return e.children?(0,o.jsxs)(On,{children:[(0,o.jsxs)(An,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(jn,{children:Zd(e.children)})]},t):(0,o.jsxs)(Nn,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(`span`,{className:`ml-auto text-xs tracking-widest opacity-60`,children:e.shortcut})]},t)}):null;t.ComponentRegistry.register(`dropdown-menu`,({schema:e,className:t,...n})=>{let r=(0,_.useDisplayLocale)();return(0,o.jsxs)(wn,{defaultOpen:e.defaultOpen,...n,children:[me(Tn,e.trigger),(0,o.jsxs)(Mn,{align:e.align,side:e.side,className:t,children:[e.label&&(0,o.jsx)(In,{children:(0,ae.resolveI18nLabel)(e.label,r)}),e.label&&(0,o.jsx)(Ln,{}),Zd(e.items)]})]})},{namespace:`ui`,label:`Dropdown Menu`,inputs:[{name:`label`,type:`string`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`items`,type:`array`,description:"Recursive structure: a command item { label, icon, shortcut, disabled, onClick, children: [] } or a divider { separator: true }. `icon` is a kebab-case Lucide icon name resolved against lucide's runtime `icons` record; an unknown or retired spelling renders no glyph."},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Menu`,variant:`outline`}],items:[{label:`Item 1`},{label:`Item 2`},{separator:!0},{label:`Item 3`}],align:`start`,side:`bottom`}});var Qd=e=>e?e.map((e,t)=>{if(e.separator)return(0,o.jsx)(fn,{},t);let n=Wa(e.icon);return e.children?(0,o.jsxs)(nn,{children:[(0,o.jsxs)(an,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(on,{children:Qd(e.children)})]},t):(0,o.jsxs)(cn,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(pn,{children:e.shortcut})]},t)}):null;t.ComponentRegistry.register(`context-menu`,({schema:e,className:t,...n})=>{let r=e.triggerClassName||t||e.className||`h-[120px] w-full sm:h-[150px] sm:w-[300px] border border-dashed text-sm flex items-center justify-center`,i=e.contentClassName;return(0,o.jsxs)(Qt,{modal:e.modal,...n,children:[(0,o.jsx)($t,{asChild:!0,children:(0,o.jsx)(`div`,{className:r,children:J(e.trigger||{type:`text`,content:`Right click here`})})}),(0,o.jsx)(sn,{className:i,children:Qd(e.items)})]})},{namespace:`ui`,label:`Context Menu`,inputs:[{name:`trigger`,type:`slot`},{name:`triggerClassName`,type:`string`},{name:`items`,type:`array`,description:"Recursive structure: a command item { label, icon, shortcut, disabled, onClick, children } or a divider { separator: true }. `icon` is a kebab-case Lucide icon name resolved against lucide's runtime `icons` record; an unknown or retired spelling renders no glyph."},{name:`className`,type:`string`}],defaultProps:{items:[{label:`Action 1`},{label:`Action 2`},{separator:!0},{label:`Action 3`}],trigger:[{type:`text`,content:`Right click here`}]}});var $d=e=>e?.map((e,t)=>{if(e.separator)return(0,o.jsx)(vr,{},t);let n=Wa(e.icon);return e.children?(0,o.jsxs)(cr,{children:[(0,o.jsxs)(dr,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(fr,{children:$d(e.children)})]},t):(0,o.jsxs)(mr,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(yr,{children:e.shortcut})]},t)});t.ComponentRegistry.register(`menubar`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(lr,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.menus?.map((e,t)=>(0,o.jsxs)(ir,{children:[(0,o.jsx)(ur,{children:e.label}),(0,o.jsx)(pr,{children:$d(e.items)})]},t))})},{namespace:`ui`,label:`Menubar`,inputs:[{name:`className`,type:`string`}],defaultProps:{menus:[{label:`File`,items:[{label:`New`},{label:`Open`},{separator:!0},{label:`Exit`}]}]}}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>(0,o.jsx)(Ee,{type:e.accordionType||`single`,collapsible:e.collapsible,className:t,...n,children:e.items?.map((e,t)=>(0,o.jsxs)(Y,{value:e.value||`item-${t}`,disabled:e.disabled,children:[(0,o.jsx)(De,{children:e.title}),(0,o.jsx)(Oe,{children:J(e.content)})]},e.value||t))}),{namespace:`ui`,label:`Accordion`,inputs:[{name:`accordionType`,type:`enum`,enum:[`single`,`multiple`]},{name:`collapsible`,type:`boolean`},{name:`items`,type:`array`,description:`Array of { trigger, content, value }`},{name:`className`,type:`string`}],defaultProps:{accordionType:`single`,collapsible:!0,items:[{label:`Item 1`,value:`item-1`,content:[{type:`text`,content:`Content for item 1`}]},{label:`Item 2`,value:`item-2`,content:[{type:`text`,content:`Content for item 2`}]},{label:`Item 3`,value:`item-3`,content:[{type:`text`,content:`Content for item 3`}]}],className:`w-full`}}),t.ComponentRegistry.register(`collapsible`,({schema:e,className:t,disabled:n,open:r,...i})=>{let s=J(e.trigger);return(0,o.jsxs)(Ot,{defaultOpen:e.defaultOpen,disabled:n,className:t,...i,children:[(0,o.jsx)(kt,{asChild:(0,a.isValidElement)(s),children:s}),(0,o.jsx)(At,{children:J(e.content)})]})},{namespace:`ui`,label:`Collapsible`,inputs:[{name:`defaultOpen`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Toggle`,variant:`outline`}],content:[{type:`text`,content:`Collapsible content goes here`}],className:`w-full`}}),t.ComponentRegistry.register(`toggle-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,type:a,...s}=t;return(0,o.jsx)(va,{type:e.selectionType||`single`,variant:e.variant,size:e.size,value:e.value,className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:e.items?.map((e,t)=>(0,o.jsx)(ya,{value:e.value,"aria-label":e.label,disabled:e.disabled,children:e.label},t))})},{namespace:`ui`,label:`Toggle Group`,inputs:[{name:`selectionType`,type:`enum`,enum:[`single`,`multiple`]},{name:`variant`,type:`enum`,enum:[`default`,`outline`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`]},{name:`className`,type:`string`}],defaultProps:{selectionType:`single`,variant:`default`,size:`default`,items:[{value:`bold`,label:`Bold`},{value:`italic`,label:`Italic`},{value:`underline`,label:`Underline`}]}}),t.ComponentRegistry.register(`carousel`,({schema:e,className:t,...n})=>(0,o.jsxs)(St,{opts:e.opts,orientation:e.orientation||`horizontal`,className:t,...n,children:[(0,o.jsx)(Ct,{children:e.items?.map((t,n)=>(0,o.jsx)(wt,{className:e.itemClassName,children:J(t)},n))}),e.showArrows&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Tt,{}),(0,o.jsx)(Et,{})]})]}),{namespace:`ui`,label:`Carousel`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`showArrows`,type:`boolean`},{name:`items`,type:`array`,description:`Array of content schemas`},{name:`itemClassName`,type:`string`},{name:`className`,type:`string`}],defaultProps:{orientation:`horizontal`,showArrows:!0,items:[[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 1`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 2`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 3`}]}]],className:`w-full max-w-xs`}}),t.ComponentRegistry.register(`filter-builder`,({schema:e,className:t,onChange:n,...r})=>{let i=(0,_.useDisplayLocale)();return(0,o.jsxs)(`div`,{className:e.wrapperClass||``,children:[e.label&&(0,o.jsx)(`label`,{className:`text-sm font-medium mb-2 block`,children:(0,ae.resolveI18nLabel)(e.label,i)}),(0,o.jsx)(nl,{fields:e.fields||[],value:e.value||r.value,onChange:t=>{n&&n({target:{name:e.name,value:t}})},className:t,...r})]})},{namespace:`ui`,label:`Filter Builder`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`,required:!0},{name:`fields`,type:`array`,description:`Array of { value: string, label: string, type?: string } objects`,required:!0},{name:`value`,type:`object`,description:`FilterGroup object with conditions`}],defaultProps:{label:`Filters`,name:`filters`,fields:[{value:`name`,label:`Name`,type:`text`},{value:`email`,label:`Email`,type:`text`},{value:`age`,label:`Age`,type:`number`},{value:`status`,label:`Status`,type:`text`}],value:{id:`root`,logic:`and`,conditions:[]}}}),t.ComponentRegistry.register(`scroll-area`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation||`vertical`;return(0,o.jsxs)(Hr,{className:t,style:{height:e.height,width:e.width,...a},...s,"data-obj-id":r,"data-obj-type":i,children:[J(e.children),(c===`horizontal`||c===`both`)&&(0,o.jsx)(Ur,{orientation:`horizontal`}),(c===`vertical`||c===`both`)&&(0,o.jsx)(Ur,{orientation:`vertical`})]})},{namespace:`ui`,label:`Scroll Area`,inputs:[{name:`height`,type:`string`},{name:`width`,type:`string`},{name:`orientation`,type:`enum`,enum:[`vertical`,`horizontal`,`both`]},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{height:`200px`,width:`100%`,orientation:`vertical`,children:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Scrollable content goes here. Add more content to see scrolling behavior.`}]}],className:`rounded-md border`}}),t.ComponentRegistry.register(`resizable`,({schema:e,className:t,...n})=>{let r=Array.isArray(e.panels)?e.panels:[];return(0,o.jsx)(qo,{orientation:e.direction||`horizontal`,className:t,...n,style:{minHeight:e.minHeight||`200px`},children:r.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(Jo,{defaultSize:t.defaultSize,minSize:t.minSize,maxSize:t.maxSize,children:J(t.content)}),n<r.length-1&&(0,o.jsx)(Yo,{withHandle:e.withHandle})]},n))})},{namespace:`ui`,label:`Resizable Panel Group`,inputs:[{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`minHeight`,type:`string`},{name:`withHandle`,type:`boolean`},{name:`panels`,type:`array`,description:`Array of { defaultSize, minSize, maxSize, content }`},{name:`className`,type:`string`}],defaultProps:{direction:`horizontal`,minHeight:`200px`,withHandle:!0,panels:[{defaultSize:50,content:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Panel 1`}]}]},{defaultSize:50,content:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Panel 2`}]}]}],className:`rounded-lg border`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t,...n})=>(0,o.jsxs)(na,{className:t,...n,children:[e.caption&&(0,o.jsx)(la,{children:e.caption}),(0,o.jsx)(ra,{children:(0,o.jsx)(oa,{children:e.columns?.map((e,t)=>(0,o.jsx)(sa,{className:e.className,style:{width:e.width},children:e.header},t))})}),(0,o.jsx)(ia,{children:e.data?.map((t,n)=>(0,o.jsx)(oa,{children:e.columns?.map((e,n)=>(0,o.jsx)(ca,{className:e.cellClassName,children:t[e.accessorKey]},n))},n))}),pe(e.footer,t=>(0,o.jsx)(aa,{children:(0,o.jsx)(oa,{children:(0,o.jsx)(ca,{colSpan:e.columns?.length,children:J(t)})})}))]}),{namespace:`ui`,label:`Table`,inputs:[{name:`caption`,type:`string`},{name:`footer`,type:`string`},{name:`columns`,type:`array`,description:`Array of { header, accessorKey, className, cellClassName, width }`},{name:`data`,type:`array`,description:`Array of objects`},{name:`className`,type:`string`}],defaultProps:{caption:`Table Caption`,columns:[{header:`Column 1`,accessorKey:`col1`},{header:`Column 2`,accessorKey:`col2`},{header:`Column 3`,accessorKey:`col3`}],data:[{col1:`Row 1, Col 1`,col2:`Row 1, Col 2`,col3:`Row 1, Col 3`},{col1:`Row 2, Col 1`,col2:`Row 2, Col 2`,col3:`Row 2, Col 3`},{col1:`Row 3, Col 1`,col2:`Row 3, Col 2`,col3:`Row 3, Col 3`}]}});var ef=a.default.createContext(null);function tf({value:e,children:t}){return(0,o.jsx)(ef.Provider,{value:e,children:t})}function nf(){return a.default.useContext(ef)}var rf=`[ObjectUI] DataTable bind:`,af=`data`;function of(e){return typeof e==`string`?`'${e}'`:String(e)}function sf({blockType:e,id:t,caption:n}){let r=typeof e==`string`&&e.length>0?e:`data-table`,i=[];return typeof t==`string`&&t.length>0&&i.push(`id: '${t}'`),typeof n==`string`&&n.length>0&&i.push(`caption: '${n}'`),i.length>0?`${r} (${i.join(`, `)})`:r}function cf(e){return e!==void 0}function lf(e,t,n){if(!cf(e))return null;let r=Array.isArray(t)?t.length:0,i=r===0?`This node has no inline rows, so the table renders its header over an empty body`:`The ${r} ${r===1?`row`:`rows`} on screen ${r===1?`comes`:`come`} from \`${af}\`; the \`bind\` contributes nothing`;return`${rf} ${sf(n)} — \`bind: ${of(e)}\` is ignored: data-table does not read \`bind\`; it reads its rows from the inline \`${af}\` array on the node. ${i}.\n Put the rows in \`${af}\`, or author a component that does read \`bind\` (\`list\`, \`tree-view\`, or an \`object-*\` widget — they call \`useDataScope\`). (objectui#6575)`}var uf=`[ObjectUI] DataTable data:`,df=/\$\{[\s\S]*?\}/;function ff(e,t=80){return e.length<=t?e:`${e.slice(0,t)}…`}function pf(e){return e===null?"`null`":Array.isArray(e)?`an array`:typeof e==`string`?`the string ${of(ff(e))}`:typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?`the ${typeof e} \`${String(e)}\``:typeof e==`object`?`an object`:`a ${typeof e}`}function mf(e){return e!==void 0&&!Array.isArray(e)}function hf(e,t){if(!mf(e))return null;let n=sf(t),r=` Resolve the rows in the host and put the array on the node as \`${af}\`. (objectui#6665)`;return typeof e==`string`&&df.test(e)?`${uf} ${n} — \`${af}: ${of(ff(e))}\` was never evaluated: a \`\${...}\` expression written into \`${af}\` at node level is read as a literal string, so \`${af}\` is a string rather than an array and the table renders its header over an empty body.\n${r}`:`${uf} ${n} — \`${af}\` was authored as ${pf(e)}, and data-table takes its rows only from an array: every non-array value is dropped to zero rows, so the table renders its header over an empty body.\n${r}`}var gf=new Set([`number`,`currency`,`percent`]);function _f(e){if(e==null)return``;if(Array.isArray(e))return e.map(e=>typeof e==`object`&&e?_f(e):String(e)).filter(Boolean).join(`, `);if(typeof e==`object`){let t=e;return String(t.name??t.label??t.externalId??t.id??t._id??``)}return String(e)}var vf=(0,_.createSafeTranslation)({"table.rowsPerPage":`Rows per page`,"table.pageInfo":`Page {{current}} of {{total}}`,"table.totalRecords":`{{count}} total`,"table.noResults":`No results found`,"table.noResultsHint":`Try adjusting your filters or search query.`,"table.sortAsc":`Sort ascending`,"table.sortDesc":`Sort descending`,"table.hideColumn":`Hide column`,"table.cancelAll":`Cancel All`,"table.saveAll":`Save All ({{count}})`,"table.exportCSV":`Export CSV`,"table.addRecord":`Add record`,"table.open":`Open`,"table.search":`Search…`,"table.modified":`{{count}} row modified`,"table.modified_one":`{{count}} row modified`,"table.modified_other":`{{count}} rows modified`,"table.saveFailed":`Save failed`,"table.selected":`{{count}} selected`,"table.edit":`Edit`,"table.delete":`Delete`,"common.actions":`Actions`,"fields.date.impossibleDay":`The stored value "{{value}}" is not a real date. Pick a date to replace it.`,"fields.dateTime.impossibleDay":`The stored value "{{value}}" is not a real date. Pick a date and time to replace it.`},`table.rowsPerPage`);function yf(e){if(e&&typeof e==`object`){let t=e,n=t.details&&(t.details.message??t.details.error);if(typeof n==`string`&&n.trim())return n.trim();if(typeof t.message==`string`&&t.message.trim())return t.message.trim()}return typeof e==`string`&&e.trim()?e.trim():`Unknown error`}function bf(e,n,r,i,a){return typeof e==`boolean`?e:e==null||e===``?!1:(0,t.evalRowPredicate)(e,n??{},{fallback:!1,scope:r,warnOnError:!0,label:i,fields:a})}function xf(e,t,n,r){let i=e?.visibleWhen;return i==null||bf(i,n,r,`builtin:${t}:visibleWhen`)}function Sf(e,n,r,i){let a=e?.visible;return!(0,t.hasDeclaredPredicate)(a)||bf(a,n,r,e?.name??`row-action`,i)}function Cf(e){let{row:t,scope:n}=e,r=!!e.onRowEdit&&xf(e.editPredicates,`edit`,t,n),i=!!e.onRowDelete&&xf(e.deletePredicates,`delete`,t,n),a=e.customActions.filter(e=>Sf(e,t,n));return{edit:r,remove:i,custom:a,count:+!!r+ +!!i+a.length}}var wf=({action:e,row:n,onActionDef:r})=>{let s=(0,i.usePredicateScope)(),c=(0,a.useMemo)(()=>Sf(e,n,s),[e,n,s]),l=(0,i.useRowPredicate)(e.disabled,n,{fallback:!0,warnOnError:!0,label:`${e.name}:disabled`}),u=(0,t.hasDeclaredPredicate)(e.disabled)&&l;if(!c)return null;let d=Wa(e.icon);return(0,o.jsxs)(Nn,{disabled:u,onClick:()=>{u||r?.(e,n)},"data-testid":`row-action-${e.name}`,className:q(e.variant===`danger`&&`text-destructive focus:text-destructive`),children:[d&&(0,o.jsx)(d,{className:`mr-2 h-4 w-4`}),e.label||e.name]})},Tf=({name:e,predicates:t,row:n,icon:r,label:s,className:c,onSelect:l})=>{let u=(0,i.usePredicateScope)(),d=(0,a.useMemo)(()=>xf(t,e,n,u),[t,e,n,u]),f=(0,i.useRowPredicate)(t?.disabledWhen,n,{fallback:!1,warnOnError:!0,label:`builtin:${e}:disabledWhen`});if(!d)return null;let p=t?.disabledWhen!=null&&f;return(0,o.jsxs)(Nn,{disabled:p,onClick:()=>{p||l(n)},"data-testid":`row-action-builtin-${e}`,className:c,children:[r,s]})},Ef=({schema:e,row:t,t:n})=>{let r=(0,i.usePredicateScope)(),s=(0,i.useCapabilityGate)(),c=(0,a.useMemo)(()=>Array.isArray(e.rowActionDefs)&&e.onRowActionDef?e.rowActionDefs.filter(e=>s(e.requiredPermissions)):[],[e.rowActionDefs,e.onRowActionDef,s]),u=(0,a.useMemo)(()=>Cf({onRowEdit:e.onRowEdit,onRowDelete:e.onRowDelete,editPredicates:e.rowEditPredicates,deletePredicates:e.rowDeletePredicates,customActions:c,row:t,scope:r}),[e.onRowEdit,e.onRowDelete,e.rowEditPredicates,e.rowDeletePredicates,c,t,r]);return u.count===0?null:(0,o.jsxs)(wn,{children:[(0,o.jsx)(Tn,{asChild:!0,children:(0,o.jsx)(X,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:e=>e.stopPropagation(),"aria-label":`Row actions`,children:(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsxs)(Mn,{align:`end`,onClick:e=>e.stopPropagation(),children:[u.edit&&(0,o.jsx)(Tf,{name:`edit`,predicates:e.rowEditPredicates,row:t,icon:(0,o.jsx)(l.Edit,{className:`mr-2 h-4 w-4`}),label:n(`table.edit`),onSelect:t=>e.onRowEdit?.(t)}),u.custom.length>0&&u.edit&&(0,o.jsx)(Ln,{}),u.custom.map(n=>(0,o.jsx)(wf,{action:n,row:t,onActionDef:e.onRowActionDef},n.name)),u.remove&&(u.edit||u.custom.length>0)&&(0,o.jsx)(Ln,{}),u.remove&&(0,o.jsx)(Tf,{name:`delete`,predicates:e.rowDeletePredicates,row:t,icon:(0,o.jsx)(l.Trash2,{className:`mr-2 h-4 w-4`}),label:n(`table.delete`),className:`text-destructive focus:text-destructive`,onSelect:t=>e.onRowDelete?.(t)})]})]})};function Df(e){return e===`single`?`single`:e===`none`||!e?`none`:`multiple`}var Of=Object.freeze([]),kf=Object.freeze([]);function Af(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];if(e===r)return!0;if(!e||!r||typeof e!=`object`||typeof r!=`object`)return!1;let i=e,a=r,o=Object.keys(i);return o.length===Object.keys(a).length&&o.every(e=>Object.is(i[e],a[e]))})}function jf(e,t){let n=e.find(e=>e?.accessorKey===t);return!n||n.masked===!0}t.ComponentRegistry.register(`data-table`,({schema:e})=>{let{caption:n,columns:r=Of,data:s=kf,pagination:c=!0,pageSize:u=10,pageSizeOptions:d,manualPagination:f=!1,rowCount:p,page:m,onPageChange:h,onPageSizeChange:g,manualSorting:v=!1,sort:y,onSortChange:b,searchable:x=!0,manualSearch:S=!1,search:C,onSearchChange:w,selectable:T=!1,showSelectionCount:E=!0,selectionResetKey:D,sortable:O=!0,exportable:k=!1,rowActions:A=!1,resizableColumns:j=!0,reorderableColumns:M=!0,editable:N=!1,singleClickEdit:ee=!1,keyboardNavigation:P=!1,rowClassName:F,rowStyle:I,className:L,cellClassName:R,frozenColumns:z=0,showRowNumbers:B=!1,showAddRow:te=!1,borderless:ne=!1,disableInnerScroll:re=!1,bind:V}=e,ie=Df(T),H=ie!==`none`,U=nf(),ae=!!U?.onAddColumn,oe=!!U?.onEditColumn,se=M||!!U?.onReorderFields,{t:W}=vf(),G=a.default.useId(),ce=(0,_.useDisplayLocale)(),le=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,ue=a.default.useCallback(e=>{if(typeof e!=`string`||e.length<8||!le.test(e))return e;let n=Date.parse(e);if(Number.isNaN(n))return e;let r=e.includes(`T`);try{return r?(0,t.formatDateTime)(e,{locale:ce}):(0,t.formatDate)(e,void 0,{locale:ce})}catch{return e}},[ce]),de=Array.isArray(s)?s:kf,K=e.type,fe=e.id;(0,a.useEffect)(()=>{let e=lf(V,de,{blockType:K,id:fe,caption:n});e&&console.warn(e)},[V,de,K,fe,n]);let pe=hf(s,{blockType:K,id:fe,caption:n});(0,a.useEffect)(()=>{pe&&console.warn(pe)},[pe]);let J=(0,a.useMemo)(()=>r.map(e=>({...e,accessorKey:e.accessorKey})),[r]),me=(0,a.useMemo)(()=>{let e={},t=r.map(e=>({header:e.header,accessorKey:e.accessorKey,width:e.width,fitContent:e.fitContent,masked:e.masked===!0}));for(let n of t){if(n.width||n.fitContent)continue;let t=(n.header||``).length,r=n.masked?[]:de.slice(0,50);for(let e of r){let r=e[n.accessorKey],i=r==null?0:String(r).length;i>t&&(t=i)}e[n.accessorKey]=Math.min(400,Math.max(80,t*8+48))}return e},[r,de]),[he,ge]=(0,a.useState)(``),[_e,ve]=(0,a.useState)(null),[ye,be]=(0,a.useState)(null),[xe,Se]=(0,a.useState)(new Set),[Ce,we]=(0,a.useState)(1),[Te,Ee]=(0,a.useState)(u),[Y,De]=(0,a.useState)(J),[Oe,ke]=(0,a.useState)({}),Ae=(0,a.useRef)(null),[je,Me]=(0,a.useState)(null),Ne=z>0?+!!H+ +!!B+Math.min(z,Y.length):0;(0,a.useLayoutEffect)(()=>{let e=Ae.current;if(Ne===0||!e){Me(null);return}let t=()=>{let t=Array.from(e.children).slice(0,Ne),n=0,r=t.map(e=>{let t=n;return n+=e.getBoundingClientRect().width,t});Me(e=>e&&e.length===r.length&&e.every((e,t)=>Math.abs(e-r[t])<.5)?e:r)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return Array.from(e.children).slice(0,Ne).forEach(e=>n.observe(e)),()=>n.disconnect()},[Ne,Y]);let[Pe,Fe]=(0,a.useState)(null),[Ie,Le]=(0,a.useState)(null),[Z,Re]=(0,a.useState)(null),ze=(0,a.useRef)(null),[Be,Ve]=(0,a.useState)(``),[He,Ue]=(0,a.useState)(new Map),We=(0,a.useMemo)(()=>{let e=new WeakMap;return{of(t,n){let r=He.get(n);if(!r||typeof t!=`object`||!t)return t;let i=e.get(t);if(i!==void 0)return i;let a={...t,...r};return e.set(t,a),a}}},[He]),[Ge,Ke]=(0,a.useState)(!1),[qe,Je]=(0,a.useState)(null),[Ye,Xe]=(0,a.useState)(new Set),[Ze,Qe]=(0,a.useState)(null),$e=(0,a.useRef)(null),et=(0,a.useRef)(0),tt=(0,a.useRef)(0),nt=(0,a.useRef)(null),rt=(0,a.useRef)(null),it=(0,a.useRef)(!1),at=(0,a.useRef)(null),ot=(0,a.useRef)(null);(0,a.useEffect)(()=>{De(e=>Af(e,J)?e:J)},[J]),(0,a.useEffect)(()=>{D!==void 0&&Se(new Set)},[D]);let st=(0,a.useMemo)(()=>{if(S||!he)return de;let e=Y.filter(e=>!jf(r,e.accessorKey));return de.filter(t=>e.some(e=>t[e.accessorKey]?.toString().toLowerCase().includes(he.toLowerCase())))},[de,he,Y,r,S]),ct=(0,a.useMemo)(()=>{if(v||!_e||!ye||jf(r,_e))return st;let e=st.map(e=>({row:e,key:(0,t.getSortValue)(e[_e])}));return e.sort((e,n)=>{let r=(0,t.compareSortValues)(e.key,n.key);return ye===`asc`?r:-r}),e.map(e=>e.row)},[st,_e,ye,v,r]),lt=f?Math.max(1,m??1):Ce,ut=f?Math.max(1,Math.ceil((p??ct.length)/Te)):Math.ceil(ct.length/Te),dt=c&&!f?ct.slice((Ce-1)*Te,Ce*Te):ct,ft=e=>{let t=Math.min(ut,Math.max(1,e));f?h?.(t):we(t)},pt=e=>{Ee(e),f?(g?.(e),h?.(1)):we(1)},mt=a.default.useMemo(()=>{let e=d&&d.length>0?d:[5,10,20,50,100];return Array.from(new Set([...e,Te])).filter(e=>Number.isFinite(e)&&e>0).sort((e,t)=>e-t)},[d,Te]),ht=(e,t)=>e.id===void 0?`row-${t}`:e.id,gt=v?y??[]:_e&&ye?[{field:_e,order:ye}]:[],_t=O&&(!v||!!b),vt=e=>_t&&e.sortable!==!1&&!jf(r,e.accessorKey),yt=S?C??``:he,bt=x&&(!S||!!w),xt=e=>{if(S){w?.(e);return}ge(e),we(1)},St=(e,t)=>{if(!jf(r,e)){if(v){b?.([{field:e,order:t}]);return}ve(e),be(t)}},Ct=e=>{if(_t&&!jf(r,e)){if(v){let t=gt.find(t=>t.field===e);St(e,t?.order===`asc`?`desc`:`asc`);return}_e===e?ye===`asc`?be(`desc`):ye===`desc`&&(be(null),ve(null)):(ve(e),be(`asc`))}},wt=(e,t)=>{e.preventDefault(),Qe({x:e.clientX,y:e.clientY,columnKey:t})},Tt=Ze?Y.find(e=>e.accessorKey===Ze.columnKey):void 0,Et=e=>{De(t=>t.filter(t=>t.accessorKey!==e)),Qe(null)};(0,a.useEffect)(()=>{if(!Ze)return;let e=()=>Qe(null);return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[Ze]);let Ot=t=>{let n=new Set;if(t&&dt.forEach((e,t)=>{let r=(lt-1)*Te+t,i=ht(e,r);n.add(i)}),Se(n),e.onSelectionChange){let t=ct.filter((e,t)=>{let r=ht(e,t);return n.has(r)});e.onSelectionChange(t)}},kt=(t,n)=>{let r=new Set(ie===`single`?[]:xe);if(n?r.add(t):r.delete(t),Se(r),e.onSelectionChange){let t=ct.filter((e,t)=>{let n=ht(e,t);return r.has(n)});e.onSelectionChange(t)}},At=()=>{let e=Y.filter(e=>!e.masked),t=[e.map(e=>e.header).join(`,`),...ct.map(t=>e.map(e=>JSON.stringify(t[e.accessorKey]||``)).join(`,`))].join(`
18
- `),n=new Blob([t],{type:`text/csv`}),r=window.URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`table-export.csv`,i.click(),window.URL.revokeObjectURL(r)},jt=e=>{let t=gt.findIndex(t=>t.field===e);if(t===-1)return(0,o.jsx)(l.ChevronsUpDown,{className:`h-3 w-3 ml-0.5 opacity-0 group-hover:opacity-50 transition-opacity`});let n=gt[t].order===`asc`?l.ChevronUp:l.ChevronDown;return(0,o.jsxs)(`span`,{className:`inline-flex items-center shrink-0`,children:[(0,o.jsx)(n,{className:`h-3 w-3 ml-0.5 text-primary`}),gt.length>1&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-primary tabular-nums leading-none`,children:t+1})]})},Mt=(e,t)=>{if(!j)return;e.preventDefault(),e.stopPropagation(),$e.current=t,et.current=e.clientX,nt.current=null;let n=e.target.closest(`th`);n&&(tt.current=n.offsetWidth),document.addEventListener(`mousemove`,Nt),document.addEventListener(`mouseup`,Pt)},Nt=e=>{if(!$e.current)return;let t=e.clientX-et.current,n=Math.max(50,tt.current+t);ke(e=>({...e,[$e.current]:n})),nt.current=n},Pt=()=>{let t=$e.current,n=nt.current;$e.current=null,nt.current=null,document.removeEventListener(`mousemove`,Nt),document.removeEventListener(`mouseup`,Pt),t&&n!=null&&e.onColumnResize?.(t,n)},Ft=(e,t)=>{se&&(Fe(t),e.dataTransfer.effectAllowed=`move`)},It=(e,t)=>{se&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Le(t))},Lt=(t,n)=>{if(!se||Pe===null)return;if(t.preventDefault(),Pe===n){Fe(null),Le(null);return}let r=[...Y],[i]=r.splice(Pe,1);r.splice(n,0,i),De(r),Fe(null),Le(null),e.onColumnsReorder&&e.onColumnsReorder(r),U?.onReorderFields?.(r.map(e=>e.accessorKey))},Rt=()=>{Fe(null),Le(null)},zt=(e,t)=>{if(!N)return;let n=ze.current;if(n?.rowIndex===e&&n?.columnKey===t)return;let r=Y.find(e=>e.accessorKey===t);if(r?.editable===!1||r?.masked)return;ze.current={rowIndex:e,columnKey:t},Re({rowIndex:e,columnKey:t});let i=He.get(e),a=dt[e][t],o=i?.[t]??a??``;Ve(o),ot.current=i&&t in i?{had:!0,value:i[t]}:{had:!1,value:void 0}},Bt=(t=!1,n)=>{if(!Z||!t&&Z===null)return;let{rowIndex:r,columnKey:i}=Z,a=(lt-1)*Te+r,o=ct[f?r:a],s=n===void 0?Be:n,c=new Map(He),l=c.get(r)||{};l[i]=s,c.set(r,l),Ue(c),e.onCellChange&&e.onCellChange(a,i,s,o),ot.current=null,ze.current=null,Re(null),Ve(``)},Vt=(0,a.useRef)(Bt);(0,a.useEffect)(()=>{Vt.current=Bt});let Ht=e=>{let t=ze.current,n=ot.current;if(ot.current=null,e&&t&&n){let{rowIndex:e,columnKey:r}=t;Ue(t=>{let i=t.get(e);if(!(i&&r in i)&&!n.had)return t;let a=new Map(t),o={...i||{}};return n.had?o[r]=n.value:delete o[r],Object.keys(o).length>0?a.set(e,o):a.delete(e),a})}ze.current=null,Re(null),Ve(``)},Ut=()=>{it.current=!0,Ht(!0)},Wt=e=>{if(!Z)return;let{rowIndex:t,columnKey:n}=Z;Ve(e),Ue(r=>{let i=new Map(r),a={...i.get(t)||{}};return a[n]=e,i.set(t,a),i})},Gt=()=>{if(it.current){it.current=!1;return}Bt(!0)},Kt=async t=>{let n=(lt-1)*Te+t,r=ct[f?t:n],i=He.get(t);if(i&&Object.keys(i).length!==0){Ke(!0);try{e.onRowSave&&await e.onRowSave(n,i,r);let a=new Map(He);a.delete(t),Ue(a),Z?.rowIndex===t&&(ze.current=null,Re(null),Ve(``)),Xe(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n.size===0&&Je(null),n})}catch(e){console.error(`Failed to save row:`,e),Je(yf(e)),Xe(e=>new Set(e).add(t))}finally{Ke(!1)}}},qt=e=>{let t=new Map(He);t.delete(e),Ue(t),Xe(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n.size===0&&Je(null),n})},Jt=async()=>{if(He.size!==0){Ke(!0);try{let t=Array.from(He.entries()).map(([e,t])=>{let n=(lt-1)*Te+e;return{rowIndex:n,changes:t,row:ct[f?e:n]}});e.onBatchSave&&await e.onBatchSave(t),Ue(new Map),ze.current=null,Re(null),Ve(``),Xe(new Set),Je(null)}catch(e){console.error(`Failed to save batch:`,e),Je(yf(e)),Xe(new Set(He.keys()))}finally{Ke(!1)}}},Yt=()=>{Ue(new Map),Xe(new Set),Je(null)},Xt=(0,a.useRef)(null),[Zt,Qt]=(0,a.useState)({rowIndex:0,colIndex:0}),$t=Math.max(0,Math.min(Zt.rowIndex,dt.length-1)),en=Math.max(0,Math.min(Zt.colIndex,Y.length-1)),tn=(0,a.useRef)(null),nn=(e,t)=>{Qt(n=>n.rowIndex===e&&n.colIndex===t?n:{rowIndex:e,colIndex:t})},rn=(e,t)=>{let n=Xt.current?.querySelector(`[data-grid-cell="${e}:${t}"]`);n&&(nn(e,t),n.focus())};(0,a.useEffect)(()=>{let e=tn.current;e&&!Z&&(tn.current=null,P&&rn(e.rowIndex,e.colIndex))});let an=(e,t,n)=>{if(e.shiftKey||e.altKey||e.metaKey)return null;let r=dt.length-1,i=Y.length-1;if(e.ctrlKey)return e.key===`Home`?{rowIndex:0,colIndex:0}:e.key===`End`?{rowIndex:r,colIndex:i}:null;switch(e.key){case`ArrowUp`:return{rowIndex:Math.max(0,t-1),colIndex:n};case`ArrowDown`:return{rowIndex:Math.min(r,t+1),colIndex:n};case`ArrowLeft`:return{rowIndex:t,colIndex:Math.max(0,n-1)};case`ArrowRight`:return{rowIndex:t,colIndex:Math.min(i,n+1)};case`Home`:return{rowIndex:t,colIndex:0};case`End`:return{rowIndex:t,colIndex:i};default:return null}},on=(e,t,n,r)=>{if(P){if(Z&&ze.current===null&&(e.key===`Enter`||e.key===`Escape`)){tn.current={rowIndex:t,colIndex:n};return}if(!Z&&e.target===e.currentTarget){let r=an(e,t,n);if(r){e.preventDefault(),rn(r.rowIndex,r.colIndex);return}}}if((e.ctrlKey||e.metaKey)&&e.key===`c`&&!Z){if(e.preventDefault(),Y.find(e=>e.accessorKey===r)?.masked)return;let n=(lt-1)*Te+t,i=ct[f?t:n];if(i){let e=i[r],t=e==null?``:String(e);navigator.clipboard.writeText(t).catch(()=>{})}return}N&&Y.find(e=>e.accessorKey===r)?.editable!==!1&&e.key===`Enter`&&!Z&&(e.preventDefault(),zt(t,r))},sn=e=>{e.key===`Enter`?(e.preventDefault(),it.current=!0,Bt(!0)):e.key===`Escape`&&(e.preventDefault(),Ut())};(0,a.useEffect)(()=>{Z&&rt.current&&(rt.current.focus(),rt.current.select())},[Z]),(0,a.useEffect)(()=>{if(!Z)return;let e=e=>{let t=at.current;if(!t)return;let n=e.target;if(n&&!t.contains(n)){if(n instanceof Element){let e=n.closest(`[data-radix-popper-content-wrapper]`);if(e&&!e.contains(t))return;let r=n.closest(`[role="dialog"],[role="alertdialog"]`);if(r&&!r.contains(t))return}Vt.current(!0)}};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[Z]),(0,a.useEffect)(()=>()=>{document.removeEventListener(`mousemove`,Nt),document.removeEventListener(`mouseup`,Pt)},[]);let cn=dt.length>0&&dt.every((e,t)=>{let n=(lt-1)*Te+t,r=ht(e,n);return xe.has(r)}),ln=dt.some((e,t)=>{let n=(lt-1)*Te+t,r=ht(e,n);return xe.has(r)})&&!cn,un=He.size>0,dn=bt||k||E&&H&&xe.size>0||un;return(0,o.jsxs)(`div`,{className:`flex flex-col h-full gap-2 sm:gap-4 ${L||``}`,children:[dn&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-4 flex-none`,children:[(0,o.jsx)(`div`,{className:`flex items-center gap-2 flex-1`,children:bt&&(0,o.jsxs)(`div`,{className:`relative w-full sm:max-w-sm flex-1`,children:[(0,o.jsx)(l.Search,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(Q,{placeholder:W(`table.search`),value:yt,onChange:e=>xt(e.target.value),className:`pl-8`})]})}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[un&&(0,o.jsxs)(o.Fragment,{children:[qe&&(0,o.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-1.5 text-sm text-destructive max-w-[16rem] sm:max-w-sm`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4 flex-none`}),(0,o.jsxs)(`span`,{className:`truncate`,title:`${W(`table.saveFailed`)}: ${qe}`,children:[W(`table.saveFailed`),`: `,qe]})]}),(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:W(`table.modified`,{count:He.size})}),(0,o.jsxs)(X,{variant:`outline`,size:`sm`,onClick:Yt,disabled:Ge,children:[(0,o.jsx)(l.X,{className:`h-4 w-4 mr-2`}),W(`table.cancelAll`)]}),(0,o.jsxs)(X,{variant:`default`,size:`sm`,onClick:Jt,disabled:Ge,children:[(0,o.jsx)(l.Save,{className:`h-4 w-4 mr-2`}),W(`table.saveAll`,{count:He.size})]})]}),k&&(0,o.jsxs)(X,{variant:`outline`,size:`sm`,onClick:At,disabled:ct.length===0,children:[(0,o.jsx)(l.Download,{className:`h-4 w-4 mr-2`}),W(`table.exportCSV`)]}),E&&H&&xe.size>0&&(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:W(`table.selected`,{count:xe.size})})]})]}),(0,o.jsx)(`div`,{className:q(`relative bg-background`,re?`overflow-visible`:`flex-1 min-h-0 overflow-auto [-webkit-overflow-scrolling:touch]`,!ne&&`rounded-md border shadow-[inset_-8px_0_8px_-8px_rgba(0,0,0,0.08)]`),children:(0,o.jsxs)(na,{ref:Xt,containerClassName:`overflow-visible`,role:P?`grid`:void 0,children:[n&&(0,o.jsx)(la,{children:n}),(0,o.jsx)(ra,{className:`sticky top-0 bg-background z-10`,children:(0,o.jsxs)(oa,{ref:Ae,children:[H&&(0,o.jsx)(sa,{className:q(`w-10 bg-background px-3`,z>0&&`sticky left-0 z-20`),children:ie===`multiple`&&(0,o.jsx)(Dt,{checked:cn?!0:ln?`indeterminate`:!1,onCheckedChange:Ot})}),B&&(0,o.jsx)(sa,{className:q(`w-10 bg-background text-center px-3`,z>0&&`sticky z-20`),style:z>0?{left:je?.[+!!H]??(H?40:0)}:void 0,children:(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`#`})}),Y.map((e,t)=>{let n=e.fitContent===!0&&!Oe[e.accessorKey]&&!e.width,r=n?`1%`:Oe[e.accessorKey]||e.width||me[e.accessorKey],i=Pe===t,a=Ie===t,s=z>0&&t<z,c=typeof e.className==`string`&&/\bsticky\b/.test(e.className)&&/\bright-0\b/.test(e.className),u=s?je?.[+!!H+ +!!B+t]??Y.slice(0,t).reduce((e,t,n)=>{if(n<z){let n=Oe[t.accessorKey]||t.width||me[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(H?40:0)+(B?40:0)):void 0;return(0,o.jsx)(sa,{className:q(e.className,vt(e)&&`cursor-pointer select-none`,i&&`opacity-50`,a&&`border-l-2 border-primary`,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,n&&`whitespace-nowrap`,`group bg-background`,!c&&`relative`,c&&`sticky right-0 z-20`,s&&`sticky z-20`,s&&t===z-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:r,minWidth:r,...s&&{left:u}},draggable:se,onDragStart:e=>Ft(e,t),onDragOver:e=>It(e,t),onDrop:e=>Lt(e,t),onDragEnd:Rt,onClick:()=>vt(e)&&Ct(e.accessorKey),onContextMenu:t=>wt(t,e.accessorKey),children:(0,o.jsxs)(`div`,{className:q(`flex items-center`,e.align===`right`?`justify-end`:`justify-between`),children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[se&&(0,o.jsx)(l.GripVertical,{className:`h-4 w-4 opacity-0 group-hover:opacity-50 cursor-grab active:cursor-grabbing shrink-0`}),e.headerIcon&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.headerIcon}),(0,o.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground whitespace-nowrap truncate`,children:e.header}),vt(e)&&jt(e.accessorKey),oe&&(0,o.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),U.onEditColumn(e.accessorKey)},title:U.editColumnLabel??`Edit field`,"aria-label":U.editColumnLabel??`Edit field`,"data-testid":`grid-edit-column-${e.accessorKey}`,className:`ml-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover:opacity-100`,children:(0,o.jsx)(l.Edit,{className:`h-3 w-3`})})]}),j&&e.resizable!==!1&&(0,o.jsx)(`div`,{className:`absolute right-0 top-0 h-full w-1 cursor-col-resize hover:bg-primary opacity-0 hover:opacity-100 transition-opacity`,onMouseDown:t=>Mt(t,e.accessorKey),onClick:e=>e.stopPropagation()})]})},e.accessorKey)}),A&&(0,o.jsx)(sa,{className:`w-24 text-right bg-background`,children:W(`common.actions`)}),ae&&(0,o.jsx)(sa,{className:`w-10 bg-background px-1 text-center`,children:(0,o.jsx)(`button`,{type:`button`,onClick:U.onAddColumn,title:U.addColumnLabel??`Add field`,"aria-label":U.addColumnLabel??`Add field`,"data-testid":`grid-add-column`,className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,o.jsx)(l.Plus,{className:`h-4 w-4`})})})]})}),(0,o.jsx)(ia,{children:dt.length===0?(0,o.jsx)(oa,{className:`hover:bg-transparent`,children:(0,o.jsx)(ca,{colSpan:Y.length+ +!!H+ +!!B+ +!!A+ +!!ae,className:`h-48 text-center text-muted-foreground border-0`,children:(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,o.jsx)(l.Search,{className:`h-8 w-8 text-muted-foreground/50`}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(`p`,{children:W(`table.noResults`)}),(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground/50`,children:W(`table.noResultsHint`)})]}),e.emptyAction?(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.emptyAction)}):null]})})}):(0,o.jsxs)(o.Fragment,{children:[dt.map((n,r)=>{let i=(lt-1)*Te+r,a=ht(n,i),s=xe.has(a),c=He.has(r),u=He.get(r)||{};return(0,o.jsxs)(oa,{"data-state":s?`selected`:void 0,className:q(`bg-background border-b border-border/60 group/row transition-colors`,`hover:bg-muted/40`,`data-[state=selected]:bg-primary/5 data-[state=selected]:hover:bg-primary/10`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset`,e.onRowClick&&`cursor-pointer`,c&&!Ye.has(r)&&`bg-amber-50 dark:bg-amber-950/20`,Ye.has(r)&&`bg-destructive/10 dark:bg-destructive/15 ring-1 ring-inset ring-destructive/40`,F&&F(n,r)),style:I?I(n,r):void 0,onClick:t=>{if(e.onRowClick&&!t.defaultPrevented){let r=t.target;if(r.closest(`button`)||r.closest(`a`)||r.closest(`input, select, textarea, label`)||r.closest(`[role="checkbox"]`)||r.closest(`[role="menu"]`)||r.closest(`[role="menuitem"]`)||r.closest(`[role="menuitemcheckbox"]`)||r.closest(`[role="menuitemradio"]`)||r.closest(`[role="dialog"]`)||r.closest(`[role="alertdialog"]`)||r.closest(`[role="listbox"]`)||r.closest(`[role="option"]`)||r.closest(`[role="tab"]`)||r.closest(`[data-radix-popper-content-wrapper]`))return;e.onRowClick(n,t)}},children:[H&&(0,o.jsx)(ca,{className:q(R,`px-3`,z>0&&`sticky left-0 z-10 bg-background`),children:(0,o.jsx)(Dt,{checked:s,onCheckedChange:e=>kt(a,e)})}),B&&(0,o.jsxs)(ca,{className:q(`text-center w-10 relative`,R,z>0&&`sticky z-10 bg-background`),style:z>0?{left:je?.[+!!H]??(H?40:0)}:void 0,children:[(0,o.jsx)(`span`,{className:q(`text-xs text-muted-foreground tabular-nums select-none`,!H&&e.onRowClick&&`group-hover/row:invisible`),children:i+1}),!H&&e.onRowClick&&(0,o.jsxs)(`button`,{type:`button`,className:`absolute inset-0 hidden group-hover/row:flex items-center justify-center gap-0.5 text-xs font-medium text-primary hover:text-primary/80`,"data-testid":`row-expand-button`,onClick:t=>{t.stopPropagation(),e.onRowClick?.(n,t)},title:`Open record`,children:[(0,o.jsx)(`span`,{children:W(`table.open`)}),(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3`})]})]}),Y.map((i,a)=>{let s=i.fitContent===!0&&!Oe[i.accessorKey]&&!i.width,l=i.wrap===!0&&!s,d=s?`1%`:Oe[i.accessorKey]||i.width||me[i.accessorKey],f=n[i.accessorKey],p=u[i.accessorKey]!==void 0,m=p?u[i.accessorKey]:f,h=Z?.rowIndex===r&&Z?.columnKey===i.accessorKey,g=N&&i.editable!==!1&&!i.masked,_=z>0&&a<z,v=_?je?.[+!!H+ +!!B+a]??Y.slice(0,a).reduce((e,t,n)=>{if(n<z){let n=Oe[t.accessorKey]||t.width||me[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(H?40:0)+(B?40:0)):void 0;return(0,o.jsx)(ca,{className:q(i.cellClassName,i.align===`right`&&`text-right`,i.align===`center`&&`text-center`,s?`whitespace-nowrap`:`overflow-hidden`,g&&!h&&`cursor-text hover:bg-muted/50`,p&&`font-semibold text-amber-700 dark:text-amber-400`,_&&`sticky z-10 bg-background`,_&&a===z-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:d,minWidth:s?void 0:d,maxWidth:s?void 0:d,..._&&{left:v}},onDoubleClick:e=>{g&&!ee&&(e.stopPropagation(),zt(r,i.accessorKey))},onClick:e=>{g&&ee&&(e.stopPropagation(),zt(r,i.accessorKey))},onKeyDown:e=>on(e,r,a,i.accessorKey),tabIndex:P?r===$t&&a===en?0:-1:0,"data-grid-cell":P?`${r}:${a}`:void 0,onFocus:P?()=>nn(r,a):void 0,children:h?(()=>{let a=i.type,s=e.renderCellEditor;if(typeof s==`function`){let e=s({column:i,row:n,pendingRow:c?We.of(n,r):n,value:Be,stage:Wt,commit:e=>Bt(!0,e),cancel:Ut});if(e!=null)return(0,o.jsx)(`div`,{ref:e=>{at.current=e},className:`w-full`,onKeyDown:e=>{e.currentTarget.contains(e.target)&&(e.key===`Enter`&&e.target.tagName===`INPUT`?(e.preventDefault(),Bt(!0)):e.key===`Escape`&&(e.preventDefault(),Ht(!0)))},children:e})}if(a===`date`||a===`datetime`){let e=a===`datetime`,n=(0,t.isImpossibleStoredDay)(Be),r=(0,o.jsx)(Q,{ref:rt,type:e?`datetime-local`:`date`,value:n?``:e?(0,t.toDateTimeInputValue)(Be):(0,t.toDateInputValue)(Be),onChange:n=>Ve(e?(0,t.fromDateTimeInputValue)(n.target.value):n.target.value),onKeyDown:sn,onBlur:Gt,"aria-invalid":n||void 0,"aria-describedby":n?G:void 0,className:`h-8 px-2 py-1`});return n?(0,o.jsxs)(`div`,{className:`space-y-1`,children:[r,(0,o.jsx)(`p`,{id:G,className:`text-xs text-destructive`,"data-testid":e?`datetime-impossible-day`:`date-impossible-day`,children:W(e?`fields.dateTime.impossibleDay`:`fields.date.impossibleDay`,{value:String(Be)})})]}):r}return a&&gf.has(a)?(0,o.jsx)(Q,{ref:rt,type:`number`,value:Be??``,onChange:e=>Ve(e.target.value),onKeyDown:sn,onBlur:Gt,className:`h-8 px-2 py-1`}):typeof Be==`object`&&Be?(0,o.jsx)(Q,{ref:rt,value:_f(Be),readOnly:!0,onKeyDown:sn,onBlur:Ut,className:`h-8 px-2 py-1 text-muted-foreground cursor-default`,title:_f(Be)}):(0,o.jsx)(Q,{ref:rt,value:Be,onChange:e=>Ve(e.target.value),onKeyDown:sn,onBlur:Gt,className:`h-8 px-2 py-1`})})():(0,o.jsx)(`div`,{className:s?`w-full whitespace-nowrap`:l?`w-full whitespace-normal break-words`:`truncate w-full`,title:!s&&!i.masked&&m!=null&&typeof m!=`object`?String(m):void 0,children:typeof i.cell==`function`?i.cell(m,n):typeof m==`object`&&m?String(m):ue(m)})},a)}),A&&(0,o.jsx)(ca,{className:q(`text-right`,R),children:(0,o.jsx)(`div`,{className:`flex items-center justify-end gap-1`,children:c&&(e.onRowSave||e.onBatchSave)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(X,{variant:`ghost`,size:`icon`,onClick:()=>qt(r),disabled:Ge,title:`Cancel changes`,children:(0,o.jsx)(l.X,{className:`h-4 w-4`})}),(0,o.jsx)(X,{variant:`ghost`,size:`icon`,onClick:()=>Kt(r),disabled:Ge,title:`Save row`,children:(0,o.jsx)(l.Save,{className:`h-4 w-4 text-green-600`})})]}):(0,o.jsx)(Ef,{schema:e,row:n,t:W})})}),ae&&(0,o.jsx)(ca,{"aria-hidden":!0,className:`w-10`})]},a)}),te&&(0,o.jsx)(oa,{className:`hover:bg-muted/30 cursor-pointer border-b border-border`,"data-testid":`add-record-row`,onClick:()=>e.onAddRecord?.(),children:(0,o.jsx)(ca,{colSpan:Y.length+ +!!H+ +!!B+ +!!A+ +!!ae,className:`h-9 px-3 py-1.5`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground transition-colors`,children:[(0,o.jsx)(l.Plus,{className:`h-3.5 w-3.5`}),W(`table.addRecord`)]})})})]})})]})}),c&&ct.length>0&&ut>1&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-between gap-2 px-3 sm:px-4 py-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsxs)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:[W(`table.rowsPerPage`),`:`]}),(0,o.jsxs)(Wr,{value:Te.toString(),onValueChange:e=>pt(Number(e)),children:[(0,o.jsx)(qr,{className:`w-20`,children:(0,o.jsx)(Kr,{})}),(0,o.jsx)(Xr,{children:mt.map(e=>(0,o.jsx)(Qr,{value:e.toString(),children:e},e))})]})]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:W(`table.pageInfo`,{current:lt,total:ut})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(X,{variant:`outline`,size:`icon`,onClick:()=>ft(1),disabled:lt===1,children:(0,o.jsx)(l.ChevronsLeft,{className:`h-4 w-4`})}),(0,o.jsx)(X,{variant:`outline`,size:`icon`,onClick:()=>ft(lt-1),disabled:lt===1,children:(0,o.jsx)(l.ChevronLeft,{className:`h-4 w-4`})}),(0,o.jsx)(X,{variant:`outline`,size:`icon`,onClick:()=>ft(lt+1),disabled:lt===ut,children:(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})}),(0,o.jsx)(X,{variant:`outline`,size:`icon`,onClick:()=>ft(ut),disabled:lt===ut,children:(0,o.jsx)(l.ChevronsRight,{className:`h-4 w-4`})})]})]})]}),Ze&&(0,o.jsxs)(`div`,{className:`fixed z-50 min-w-[160px] rounded-md border bg-popover p-1 shadow-md`,style:{left:Ze.x,top:Ze.y},"data-testid":`column-context-menu`,onClick:e=>e.stopPropagation(),children:[Tt&&vt(Tt)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{St(Ze.columnKey,`asc`),Qe(null)},children:[(0,o.jsx)(l.ChevronUp,{className:`h-3.5 w-3.5`}),W(`table.sortAsc`)]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{St(Ze.columnKey,`desc`),Qe(null)},children:[(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5`}),W(`table.sortDesc`)]}),(0,o.jsx)(`div`,{className:`my-1 h-px bg-border`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>Et(Ze.columnKey),children:[(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`}),W(`table.hideColumn`)]})]})]})},{namespace:`ui`,label:`Data Table`,icon:`table`,inputs:[{name:`caption`,type:`string`},{name:`columns`,type:`array`,description:`Array of { header, accessorKey, className, width, sortable, filterable, resizable }`,required:!0},{name:`data`,type:`array`,description:`Array of data objects`,required:!0},{name:`pagination`,type:`boolean`},{name:`pageSize`,type:`number`},{name:`searchable`,type:`boolean`},{name:`selectable`,type:`boolean`},{name:`sortable`,type:`boolean`},{name:`exportable`,type:`boolean`},{name:`rowActions`,type:`boolean`},{name:`resizableColumns`,type:`boolean`},{name:`reorderableColumns`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{caption:`Enterprise Data Table`,pagination:!0,pageSize:10,searchable:!0,selectable:!0,sortable:!0,exportable:!0,rowActions:!0,resizableColumns:!0,reorderableColumns:!0,columns:[{header:`ID`,accessorKey:`id`,width:`80px`},{header:`Name`,accessorKey:`name`},{header:`Email`,accessorKey:`email`},{header:`Status`,accessorKey:`status`},{header:`Role`,accessorKey:`role`}],data:[{id:1,name:`John Doe`,email:`john@example.com`,status:`Active`,role:`Admin`},{id:2,name:`Jane Smith`,email:`jane@example.com`,status:`Active`,role:`User`},{id:3,name:`Bob Johnson`,email:`bob@example.com`,status:`Inactive`,role:`User`},{id:4,name:`Alice Williams`,email:`alice@example.com`,status:`Active`,role:`Manager`},{id:5,name:`Charlie Brown`,email:`charlie@example.com`,status:`Active`,role:`User`},{id:6,name:`Diana Prince`,email:`diana@example.com`,status:`Active`,role:`Admin`},{id:7,name:`Ethan Hunt`,email:`ethan@example.com`,status:`Inactive`,role:`User`},{id:8,name:`Fiona Gallagher`,email:`fiona@example.com`,status:`Active`,role:`User`},{id:9,name:`George Wilson`,email:`george@example.com`,status:`Active`,role:`Manager`},{id:10,name:`Hannah Montana`,email:`hannah@example.com`,status:`Active`,role:`User`},{id:11,name:`Ivan Drago`,email:`ivan@example.com`,status:`Inactive`,role:`User`},{id:12,name:`Julia Roberts`,email:`julia@example.com`,status:`Active`,role:`Admin`}]}});function Mf(e){return e?.autoTrigger===!0}function Nf(e){return`auto-trigger-refused:${e.name??e.label??``}`}function Pf(e,t){if(B.toast.warning(t,{id:Nf(e)}),process.env.NODE_ENV!==`production`){let t=typeof e.visible==`string`?e.visible:JSON.stringify(e.visible);console.warn(`[object-ui] action "${e.name??e.label??``}" carries autoTrigger but was NOT run: its own declared \`visible\` gate evaluated false on this surface, and the author's verdict outranks the flag (objectui#4191). Predicate: ${t}.`)}}function Ff(e,n,r){let{t:i}=(0,_.useObjectTranslation)(),o=(0,a.useRef)(!1),s=(0,a.useRef)(!1),c=Mf(e),l=(0,t.hasDeclaredPredicate)(e.visible)&&!n;(0,a.useEffect)(()=>{if(c&&!o.current){if(l){s.current||(s.current=!0,Pf(e,i(`actions.notAvailableHere`,{defaultValue:`"{{action}}" is not available on the current page.`,action:e.label||e.name||``})));return}o.current=!0,r()}},[c,l,r,i,e])}var If=(0,a.forwardRef)(({schema:e,className:n,context:r,...s},c)=>{let{"data-obj-id":u,"data-obj-type":d,style:f,data:p,disabled:m,...h}=s,{execute:g}=(0,i.useAction)(),[_,v]=(0,a.useState)(!1),y=(0,i.usePredicateRecordContext)(p),b=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),y,{throwOnError:!0,label:`action "${e.name??e.label??`action:button`}" (visible)`}),x=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),y),S=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),y),C=Wa(e.icon),w=e.variant===`primary`?`default`:e.variant||`default`,T=e.size===`md`?`default`:e.size||`default`,E=(0,a.useCallback)(async()=>{if(!_){v(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=co(e,`action:button`),n=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t},i={type:e.actionType,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...n,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,patch:e.patch,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,undoable:e.undoable,recordIdField:e.recordIdField,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName};await g({...i,...r})}finally{v(!1)}}},[e,g,_,r]);return Ff(e,b,E),(0,t.hasDeclaredPredicate)(e.visible)&&!b?null:(0,o.jsxs)(X,{ref:c,type:`button`,variant:w,size:T,className:q(e.className,n),disabled:m||((0,t.hasDeclaredPredicate)(e.disabled)?x:(0,t.hasDeclaredPredicate)(e.enabled)?!S:!1)||_,onClick:E,...Ys(h),"data-obj-id":u,"data-obj-type":d,style:f,children:[_&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!_&&C&&(0,o.jsx)(C,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})});If.displayName=`ActionButtonRenderer`,t.ComponentRegistry.register(`button`,If,{namespace:`action`,skipFallback:!0,label:`Action Button`,inputs:[{name:`name`,type:`string`},{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actionType`,type:`enum`,enum:[`script`,`url`,`modal`,`flow`,`api`]},{name:`target`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`primary`,`secondary`,`destructive`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`md`,`lg`,`icon`],description:"Button size: the Button primitive's `default`, `sm`, `lg` or `icon`, plus `md`, which renders as `default` (default: `default`)"},{name:`className`,type:`string`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the button is not rendered when it is false, nor when the predicate fails to evaluate. Omit for always-visible"},{name:`disabled`,type:[`boolean`,`string`,`object`],description:"Disabled predicate, in the same three shapes as `visible`: the button is shown but cannot be pressed while it holds. Omit for never-disabled"},{name:`params`,type:`array`,description:"The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead"},{name:`description`,type:`string`,description:`Action description — the parameter dialog shows it under its title`},{name:`openIn`,type:`enum`,enum:[`self`,`new-tab`],description:"For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab"},{name:`method`,type:`string`,description:"HTTP method of an `api` action (`POST` when omitted)"},{name:`bodyExtra`,type:`object`,description:"Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name"},{name:`bodyShape`,type:[`enum`,`object`],enum:[`flat`],description:"How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it"},{name:`operation`,type:`enum`,enum:[`update`],description:"`update` declares a single-record field write: the runner dispatches it to the platform action route with `patch` merged under the collected values"},{name:`patch`,type:`object`,description:"For `operation: update`: the field values written, merged UNDER the values the user supplies, so a collected value of the same name wins"},{name:`confirmText`,type:`string`,description:`Confirmation question asked before the action runs; the action runs only if it is confirmed`},{name:`successMessage`,type:`string`,description:"Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`)"},{name:`errorMessage`,type:`string`,description:`Toast text when the action fails, in place of the raw error`},{name:`refreshAfter`,type:`boolean`,description:`Refresh the surrounding data after the action succeeds`},{name:`locations`,type:`array`,of:`string`,description:"The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one"},{name:`toast`,type:`object`,description:"Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast"},{name:`resultDialog`,type:`object`,description:`One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast`},{name:`onSuccess`,type:`object`,description:"Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab`"},{name:`objectName`,type:`string`,description:`Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object`},{name:`recordIdField`,type:`string`,description:"For a `script` action run against a single selected row: the row field whose value is sent as the record id (default `id`)"}],defaultProps:{label:`Action`,actionType:`script`,variant:`default`,size:`md`}});var Lf=(0,a.forwardRef)(({schema:e,className:n,context:r,...s},c)=>{let{"data-obj-id":u,"data-obj-type":d,style:f,data:p,disabled:m,...h}=s,{execute:g}=(0,i.useAction)(),[_,v]=(0,a.useState)(!1),y=(0,i.usePredicateRecordContext)(p),b=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),y,{throwOnError:!0,label:`action "${e.name??e.label??`action:icon`}" (visible)`}),x=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),y),S=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),y),C=Wa(e.icon),w=e.variant===`primary`?`default`:e.variant||`ghost`,T=(0,a.useCallback)(async()=>{if(!_){v(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=co(e,`action:icon`),n=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t},i={type:e.actionType,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...n,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,patch:e.patch,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName};await g({...i,...r})}finally{v(!1)}}},[e,g,_,r]);if(Ff(e,b,T),(0,t.hasDeclaredPredicate)(e.visible)&&!b)return null;let E=(0,o.jsx)(X,{ref:c,type:`button`,variant:w,size:`icon`,className:q(`h-8 w-8`,e.className,n),disabled:m||((0,t.hasDeclaredPredicate)(e.disabled)?x:(0,t.hasDeclaredPredicate)(e.enabled)?!S:!1)||_,onClick:T,"aria-label":e.label||e.name,...Ys(h),"data-obj-id":u,"data-obj-type":d,style:f,children:_?(0,o.jsx)(l.Loader2,{className:`h-4 w-4 animate-spin`}):C?(0,o.jsx)(C,{className:`h-4 w-4`}):(0,o.jsx)(`span`,{className:`text-xs`,children:e.label?.charAt(0)||`?`})});return e.label||e.description?(0,o.jsx)(hi,{delayDuration:300,children:(0,o.jsxs)(gi,{children:[(0,o.jsx)(_i,{asChild:!0,children:E}),(0,o.jsx)(vi,{children:(0,o.jsx)(`p`,{children:e.label||e.description})})]})}):E});Lf.displayName=`ActionIconRenderer`,t.ComponentRegistry.register(`icon`,Lf,{namespace:`action`,skipFallback:!0,label:`Action Icon`,inputs:[{name:`name`,type:`string`},{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actionType`,type:`enum`,enum:[`script`,`url`,`modal`,`flow`,`api`]},{name:`target`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`]},{name:`className`,type:`string`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the icon is not rendered when it is false. Omit for always-visible"},{name:`disabled`,type:[`boolean`,`string`,`object`],description:"Disabled predicate, in the same three shapes as `visible`: the icon is shown but cannot be pressed while it holds. Omit for never-disabled"},{name:`params`,type:`array`,description:"The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead"},{name:`description`,type:`string`,description:"Action description — the tooltip text when there is no `label`, and what the parameter dialog shows under its title"},{name:`openIn`,type:`enum`,enum:[`self`,`new-tab`],description:"For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab"},{name:`method`,type:`string`,description:"HTTP method of an `api` action (`POST` when omitted)"},{name:`bodyExtra`,type:`object`,description:"Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name"},{name:`bodyShape`,type:[`enum`,`object`],enum:[`flat`],description:"How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it"},{name:`operation`,type:`enum`,enum:[`update`],description:"`update` declares a single-record field write: the runner dispatches it to the platform action route with `patch` merged under the collected values"},{name:`patch`,type:`object`,description:"For `operation: update`: the field values written, merged UNDER the values the user supplies, so a collected value of the same name wins"},{name:`confirmText`,type:`string`,description:`Confirmation question asked before the action runs; the action runs only if it is confirmed`},{name:`successMessage`,type:`string`,description:"Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`)"},{name:`errorMessage`,type:`string`,description:`Toast text when the action fails, in place of the raw error`},{name:`refreshAfter`,type:`boolean`,description:`Refresh the surrounding data after the action succeeds`},{name:`locations`,type:`array`,of:`string`,description:"The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one"},{name:`toast`,type:`object`,description:"Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast"},{name:`resultDialog`,type:`object`,description:`One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast`},{name:`onSuccess`,type:`object`,description:"Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab`"},{name:`objectName`,type:`string`,description:`Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object`}],defaultProps:{icon:`play`,actionType:`script`,variant:`ghost`}});function Rf(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`detail.moreActions`);return!t||t===`detail.moreActions`?`More actions`:t}function zf(e,t){let n=(0,i.usePredicateRecordContext)(t);return{recordData:n,isVisible:(0,i.useCondition)((0,i.toPredicateInput)(e.visible),n,{throwOnError:!0,label:`action "${e.name??e.label??`action:menu item`}" (visible)`})}}var Bf=({action:e,onExecute:n,record:r})=>{let{recordData:s,isVisible:c}=zf(e,r),l=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),s),u=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),s),d=(0,a.useMemo)(()=>{let t=Wa(e.icon);return t?(0,o.jsx)(t,{className:`mr-2 h-4 w-4`}):null},[e.icon]);return(0,t.hasDeclaredPredicate)(e.visible)&&!c?null:(0,o.jsxs)(Nn,{disabled:(0,t.hasDeclaredPredicate)(e.disabled)?l:(0,t.hasDeclaredPredicate)(e.enabled)?!u:!1,onSelect:t=>{t.preventDefault(),n(e)},className:q(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[d,(0,o.jsx)(`span`,{children:e.label||e.name})]})};Bf.displayName=`ActionMenuItem`;var Vf=({action:e,onExecute:t,record:n})=>{let{isVisible:r}=zf(e,n);return Ff(e,r,(0,a.useCallback)(()=>t(e),[e,t])),null};Vf.displayName=`ActionAutoTrigger`;var Hf=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":c,style:u,data:d,disabled:f,...p}=n,{execute:m}=(0,i.useAction)(),h=(0,i.useConfigBagEvaluator)(),[g,_]=(0,a.useState)(!1),v=Rf(),y=(0,i.usePredicateRecordContext)(d),b=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),y,{throwOnError:!0,label:`action:menu "${e.label??e.icon??`menu`}" (visible)`}),x=Wa(e.icon)||l.MoreHorizontal,S=e.variant||`ghost`,C=e.size||`icon`,w=(0,a.useCallback)(async e=>{_(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=uo(e,h),n=Array.isArray(e.params)?void 0:fo(e,e.type,`action:menu`),r=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t===void 0?n:t};await m({type:e.type,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...r,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,patch:e.patch,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName})}finally{_(!1)}},[m,h]);if(e.visible&&!b)return null;let T=e.actions||[];return T.length===0?null:(0,o.jsxs)(o.Fragment,{children:[T.map((e,t)=>(0,o.jsx)(Vf,{action:e,onExecute:w,record:d},`auto-trigger:${e.name||t}`)),(0,o.jsxs)(wn,{children:[(0,o.jsx)(Tn,{asChild:!0,children:(0,o.jsx)(X,{ref:r,type:`button`,variant:S,size:C,className:q(C===`icon`&&`h-8 w-8`,e.className,t),disabled:f||g,"aria-label":e.label||v,...p,"data-obj-id":s,"data-obj-type":c,style:u,children:g?(0,o.jsx)(l.Loader2,{className:`h-4 w-4 animate-spin`}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label&&(0,o.jsx)(`span`,{children:e.label})]})})}),(0,o.jsx)(Mn,{align:`end`,children:T.map((e,t)=>{let n=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[n&&(0,o.jsx)(Ln,{}),(0,o.jsx)(Bf,{action:e,onExecute:w,record:d})]},e.name||t)})})]})]})});Hf.displayName=`ActionMenuRenderer`,t.ComponentRegistry.register(`menu`,Hf,{namespace:`action`,skipFallback:!0,label:`Action Menu`,inputs:[{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actions`,type:`array`,of:`object`,description:"The menu's actions, in order. Each member is an action object the menu draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `visible`, `disabled`, `tags`, …); a member's executor is its own `type`"},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],description:"Trigger button size (renderer default: `icon`)"},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate for the whole menu: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; a predicate that fails to evaluate hides it. Omit for always-visible"},{name:`className`,type:`string`}],defaultProps:{variant:`ghost`,actions:[]}});function Uf(e,t){return(0,i.useCondition)((0,i.toPredicateInput)(e.visible),t,{throwOnError:!0,label:`action "${e.name??e.label??`action:group member`}" (visible)`})}var Wf=({action:e,variant:n,size:r,onExecute:s,record:c,hostDisabled:u})=>{let[d,f]=(0,a.useState)(!1),p=(0,i.usePredicateRecordContext)(c),m=Uf(e,p),h=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),p),g=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),p),_=Wa(e.icon),v=e.variant===`primary`?`default`:e.variant||n||`outline`,y=e.size===`md`?`default`:e.size||r||`sm`,b=(0,a.useCallback)(async()=>{if(!d){f(!0);try{await s(e)}finally{f(!1)}}},[e,s,d]);return(0,t.hasDeclaredPredicate)(e.visible)&&!m?null:(0,o.jsxs)(X,{type:`button`,variant:v,size:y,className:e.className,disabled:u||((0,t.hasDeclaredPredicate)(e.disabled)?h:(0,t.hasDeclaredPredicate)(e.enabled)?!g:!1)||d,onClick:b,children:[d&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!d&&_&&(0,o.jsx)(_,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})};Wf.displayName=`InlineActionButton`;var Gf=({action:e,index:n,onSelect:r,record:a})=>{let s=(0,i.usePredicateRecordContext)(a),c=Uf(e,s),l=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),s),u=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),s);if((0,t.hasDeclaredPredicate)(e.visible)&&!c)return null;let d=Wa(e.icon),f=(0,t.hasDeclaredPredicate)(e.disabled)?l:(0,t.hasDeclaredPredicate)(e.enabled)?!u:!1,p=e.tags?.includes(`separator-before`)&&n>0;return(0,o.jsxs)(o.Fragment,{children:[p&&(0,o.jsx)(Ln,{}),(0,o.jsxs)(Nn,{disabled:f,onSelect:async t=>{t.preventDefault(),!f&&await r(e)},className:q(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[d&&(0,o.jsx)(d,{className:`mr-2 h-4 w-4`}),(0,o.jsx)(`span`,{children:e.label||e.name})]})]})};Gf.displayName=`DropdownActionItem`;var Kf=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":c,style:u,data:d,disabled:f,...p}=n,{execute:m}=(0,i.useAction)(),h=(0,i.useConfigBagEvaluator)(),[g,_]=(0,a.useState)(!1),v=(0,i.usePredicateRecordContext)(d),y=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),v,{throwOnError:!0,label:`action:group "${e.label??e.icon??`group`}" (visible)`}),b=(e.actions||[]).filter(t=>(0,oe.actionRendersAt)(t,e.location)),x=(0,a.useCallback)(async e=>{if(typeof e.onClick==`function`){await e.onClick();return}let t=uo(e,h),n=Array.isArray(e.params)?void 0:fo(e,e.type,`action:group`),r=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t===void 0?n:t};await m({type:e.type,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...r,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,patch:e.patch,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName})},[m,h]),S=(0,a.useCallback)(async e=>{_(!0);try{await x(e)}finally{_(!1)}},[x]);if(e.visible&&!y||b.length===0)return null;if((e.display||`inline`)===`dropdown`){let n=Wa(e.icon);return(0,o.jsxs)(wn,{children:[(0,o.jsx)(Tn,{asChild:!0,children:(0,o.jsxs)(X,{type:`button`,variant:e.variant||`outline`,size:e.size===`md`?`default`:e.size||`default`,className:q(e.className,t),disabled:f||g,"data-obj-id":s,"data-obj-type":c,style:u,children:[g&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!g&&n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label||`Actions`,(0,o.jsx)(l.ChevronDown,{className:`ml-2 h-3 w-3 opacity-50`})]})}),(0,o.jsx)(Mn,{align:`end`,children:b.map((e,t)=>(0,o.jsx)(Gf,{action:e,index:t,onSelect:S,record:d},e.name||t))})]})}return(0,o.jsx)(`div`,{ref:r,className:q(`flex items-center gap-2`,e.className,t),...p,"data-obj-id":s,"data-obj-type":c,style:u,children:b.map(t=>(0,o.jsx)(Wf,{action:t,variant:e.variant,size:e.size,onExecute:x,record:d,hostDisabled:f},t.name))})});Kf.displayName=`ActionGroupRenderer`,t.ComponentRegistry.register(`group`,Kf,{namespace:`action`,skipFallback:!0,label:`Action Group`,inputs:[{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actions`,type:`array`,of:`object`,description:"The actions in this group, in order. Each member is an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `locations`, `visible`, `disabled`, …); a member's executor is its own `type`"},{name:`display`,type:`enum`,enum:[`inline`,`dropdown`]},{name:`location`,type:`enum`,enum:[...oe.ACTION_LOCATIONS],description:"Render only the members whose `locations` include this location. Omit to render every member"},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],description:`Button size for the dropdown trigger and for every inline member that sets none`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate for the whole group: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds. Omit for always-visible"},{name:`className`,type:`string`}],defaultProps:{display:`inline`,variant:`outline`,size:`sm`,actions:[]}});function qf(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`common.actions`);return!t||t===`common.actions`?`Actions`:t}var Jf=(0,a.forwardRef)(({schema:e,className:n,...r},s)=>{let c=qf(),{"data-obj-id":l,"data-obj-type":u,style:d,data:f,actions:p,systemActions:m,location:h,maxVisible:g,mobileMaxVisible:_,direction:v,gap:y,variant:b,size:x,visible:S,...C}=r,w=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),void 0,{throwOnError:!0,label:`action:bar${e.location?` (${e.location})`:``} (visible)`}),T=pi(),E=(0,i.useCapabilityGate)(),D=(0,i.useConfigBagEvaluator)(),O=(0,a.useMemo)(()=>{let t=(e.actions||[]).filter(e=>E(e?.requiredPermissions)).filter(t=>(0,oe.actionRendersAt)(t,e.location)),n=new Set,r=t.filter(e=>!e.name||!n.has(e.name)&&(n.add(e.name),!0));return r.some(e=>e.order!==void 0||e.variant===`primary`)?[...r].sort((e,t)=>{let n=(e.order??0)-(t.order??0);return n===0?(e.variant===`primary`?0:1)-(t.variant===`primary`?0:1):n}):r},[e.actions,e.location,E]),k=(0,a.useMemo)(()=>{let t=e.systemActions||[],n=new Set;return t.filter(e=>E(e?.requiredPermissions)?!e.name||!n.has(e.name)&&(n.add(e.name),!0):!1)},[e.systemActions,E]),A=T?e.mobileMaxVisible??1:e.maxVisible??3,{inlineActions:j,overflowActions:M}=(0,a.useMemo)(()=>{let e=O.filter(e=>e.component===`action:menu`),t=O.filter(e=>e.component!==`action:menu`);return{inlineActions:t.slice(0,A),overflowActions:[...t.slice(A),...e]}},[O,A]),N=(0,a.useMemo)(()=>{let e=[];for(let t of j){if(t.component!==`action:group`){e.push(t);continue}let n=e[e.length-1];Array.isArray(n)?n.push(t):e.push([t])}return e},[j]),ee=(0,a.useMemo)(()=>{if(k.length===0)return M;if(M.length===0)return k;let[e,...t]=k,n={...e,tags:[...e.tags||[],`separator-before`]};return[...M,n,...t]},[M,k]);if(e.visible&&!w||O.length===0&&k.length===0)return null;let P=e.direction||`horizontal`,F=e.gap||`gap-2`,I=ee.length>0?t.ComponentRegistry.get(`action:menu`):null,L=I?(0,o.jsx)(I,{schema:{type:`action:menu`,actions:ee,variant:e.variant||`ghost`,size:e.size||`sm`},data:f}):null,R=(n,r)=>{let i=t.ComponentRegistry.get(r);return i?(0,o.jsx)(i,{schema:{...lo(n,D),type:r,actionType:n.type,variant:n.variant||e.variant,size:n.size||e.size},data:f},n.name):null};return(0,o.jsxs)(`div`,{ref:s,className:q(`flex items-center`,P===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap`,F,e.className,n),role:`toolbar`,"aria-label":c,...C,"data-obj-id":l,"data-obj-type":u,style:d,children:[N.map((e,t)=>Array.isArray(e)?(0,o.jsx)(ac,{orientation:P===`vertical`?`vertical`:`horizontal`,className:`empty:hidden`,children:e.map(e=>R(e,`action:button`))},`group:${e[0].name??t}`):R(e,e.component||`action:button`)),ee.length>0&&L]})});Jf.displayName=`ActionBarRenderer`,t.ComponentRegistry.register(`bar`,Jf,{namespace:`action`,skipFallback:!0,label:`Action Bar`,inputs:[{name:`actions`,type:`object`},{name:`systemActions`,type:`object`},{name:`location`,type:`enum`,enum:[...oe.ACTION_LOCATIONS]},{name:`maxVisible`,type:`number`},{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`]},{name:`className`,type:`string`}],defaultProps:{maxVisible:3,direction:`horizontal`,variant:`outline`,size:`sm`,actions:[]}});var Yf=({schema:e,className:t})=>{let n=e.type,r=n.startsWith(`view:`),i=n.startsWith(`widget:`),a=n.startsWith(`field:`);return(0,o.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg bg-muted/30 transition-colors hover:bg-muted/50`,r&&`border-blue-300 bg-blue-50/50 min-h-[200px]`,i&&`border-purple-300 bg-purple-50/50 min-h-[150px]`,a&&`border-yellow-300 bg-yellow-50/50 p-2 min-h-[40px] flex-row gap-2 justify-start`,t),children:[(0,o.jsxs)(`div`,{className:q(`flex items-center gap-2 text-muted-foreground`,a&&`text-sm`),children:[a?(0,o.jsx)(l.Box,{className:`h-4 w-4`}):(0,o.jsx)(l.FileQuestion,{className:`h-8 w-8 mb-2 opacity-50`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,o.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:n}),!a&&(0,o.jsx)(`span`,{className:`text-xs`,children:`Component Placeholder`})]})]}),e.props&&!a&&(0,o.jsxs)(`div`,{className:`mt-4 w-full text-xs text-muted-foreground bg-background/50 p-2 rounded overflow-hidden`,children:[(0,o.jsx)(`div`,{className:`opacity-70`,children:`Properties:`}),(0,o.jsx)(`pre`,{className:`mt-1 truncate`,children:JSON.stringify(e.props,null,0)})]})]})},Xf=`view:grid.view:kanban.view:map.view:calendar.view:gantt.view:timeline.view:gallery.view:simple.view:wizard.view:tabbed.view:drawer.view:modal.view:split.field:text.field:textarea.field:password.field:email.field:url.field:phone.field:markdown.field:html.field:code.field:number.field:currency.field:percent.field:slider.field:boolean.field:checkboxes.field:select.field:multiselect.field:radio.field:date.field:datetime.field:time.field:duration.field:lookup.field:master_detail.field:tree.field:image.field:file.field:video.field:audio.field:avatar.field:color.field:rating.field:signature.field:qrcode.field:progress.field:json.field:address.field:location.page:header.page:footer.page:tabs.page:accordion.page:card.page:sidebar.record:details.record:highlights.record:related_list.record:activity.record:chatter.record:path.app:launcher.nav:menu.nav:breadcrumb.global:search.global:notifications.widget:metric.widget:bar.widget:line.widget:pie.widget:funnel.widget:radar.widget:scatter.widget:heatmap.widget:pivot.widget:table.widget:text.widget:image.ai:input.ai:suggestion.ai:feedback`.split(`.`),Zf=[`nav:menu`,`nav:breadcrumb`,`global:search`,`ai:suggestion`];function Qf(e){t.ComponentRegistry.get(e)||t.ComponentRegistry.register(e,Yf,{namespace:`protocol-placeholder`})}function $f(){Xf.forEach(Qf)}Zf.forEach(Qf);var ep={info:{Icon:l.Info,tone:`border-border bg-muted/50 text-foreground`,iconTone:`text-muted-foreground`},success:{Icon:l.CheckCircle2,tone:`border-emerald-300/70 bg-emerald-50 text-emerald-900 dark:border-emerald-700/60 dark:bg-emerald-950/40 dark:text-emerald-200`,iconTone:`text-emerald-600 dark:text-emerald-400`},warning:{Icon:l.AlertTriangle,tone:`border-amber-300/70 bg-amber-50 text-amber-900 dark:border-amber-700/60 dark:bg-amber-950/40 dark:text-amber-200`,iconTone:`text-amber-600 dark:text-amber-400`},error:{Icon:l.XCircle,tone:`border-destructive/50 bg-destructive/10 text-destructive dark:text-destructive-foreground`,iconTone:`text-destructive`}};function tp(e){return ep[e??`info`]??ep.info}function np(e){return eo(e.icon)?no(e.icon):tp(e.severity).Icon}var rp={primary:`default`,secondary:`secondary`,link:`link`};function ip(e){return rp[e??`primary`]??rp.primary}var ap={top_left:`top-4 left-4`,top_center:`top-4 left-1/2 -translate-x-1/2`,top_right:`top-4 right-4`,bottom_left:`bottom-4 left-4`,bottom_center:`bottom-4 left-1/2 -translate-x-1/2`,bottom_right:`bottom-4 right-4`,"top-left":`top-4 left-4`,"top-center":`top-4 left-1/2 -translate-x-1/2`,"top-right":`top-4 right-4`,"bottom-left":`bottom-4 left-4`,"bottom-center":`bottom-4 left-1/2 -translate-x-1/2`,"bottom-right":`bottom-4 right-4`};function op({className:e}){let t=(0,i.useNotificationsByPresentation)(`banner`),{dismiss:n,config:r}=(0,i.useNotifications)();if(t.length===0)return null;let a=(0,i.visibleNotificationStack)(t,r);return(0,o.jsx)(`div`,{className:q(`flex w-full flex-col`,e),"data-notification-surface":`banner`,children:a.map(e=>{let{tone:t}=tp(e.severity),r=np(e);return(0,o.jsxs)(`div`,{role:`status`,"data-severity":e.severity,className:q(`flex w-full items-center gap-3 border-b px-4 py-2.5 text-sm`,t),children:[(0,o.jsx)(r,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,o.jsx)(`span`,{className:`font-medium`,children:e.title}),e.message?(0,o.jsx)(`span`,{className:`min-w-0 opacity-90`,children:e.message}):null]}),e.actions?.map(e=>(0,o.jsx)(X,{size:`sm`,variant:ip(e.variant),className:`h-7 shrink-0`,onClick:e.onClick,children:e.label},e.label)),e.dismissible===!1?null:(0,o.jsx)(X,{size:`icon`,variant:`ghost`,className:`h-7 w-7 shrink-0`,"aria-label":`Dismiss ${e.title}`,onClick:()=>n(e.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`,"aria-hidden":`true`})})]},e.id)})})}op.displayName=`NotificationBanners`;function sp({className:e}){let t=(0,i.useNotificationsByPresentation)(`snackbar`),{dismiss:n,config:r,pauseAutoDismiss:a,resumeAutoDismiss:s}=(0,i.useNotifications)(),c=t[0];if(!c)return null;let{iconTone:u}=tp(c.severity),d=np(c),f=c.actions?.[0],p=(0,i.resolveNotificationPosition)(c,r),m=p?ap[p]:`bottom-4 left-1/2 -translate-x-1/2`,h=p?.startsWith(`top`)?`motion-safe:slide-in-from-top-4`:`motion-safe:slide-in-from-bottom-4`;return(0,o.jsxs)(`div`,{className:q(`fixed z-50 flex w-[min(28rem,calc(100vw-2rem))]`,m,`items-center gap-3 rounded-md border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-lg`,`motion-safe:animate-in motion-safe:fade-in`,h,e),role:`status`,"aria-live":`polite`,"data-notification-surface":`snackbar`,"data-severity":c.severity,"data-position":p,onPointerEnter:r.pauseOnHover?()=>a(c.id):void 0,onPointerLeave:r.pauseOnHover?()=>s(c.id):void 0,children:[(0,o.jsx)(d,{className:q(`h-4 w-4 shrink-0`,u),"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-medium`,children:c.title}),c.message?(0,o.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:c.message}):null]}),f?(0,o.jsx)(X,{size:`sm`,variant:ip(f.variant),className:`h-7 shrink-0 font-semibold uppercase tracking-wide`,onClick:()=>{f.onClick(),n(c.id)},children:f.label}):null,c.dismissible===!1?null:(0,o.jsx)(X,{size:`icon`,variant:`ghost`,className:`h-7 w-7 shrink-0`,"aria-label":`Dismiss ${c.title}`,onClick:()=>n(c.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`,"aria-hidden":`true`})})]})}sp.displayName=`NotificationSnackbar`;var cp={default:void 0,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,link:`bg-transparent text-primary underline-offset-4 hover:bg-transparent hover:underline`};function lp({className:e,acknowledgeLabel:t=`OK`}){let n=(0,i.useNotificationsByPresentation)(`alert`),{dismiss:r}=(0,i.useNotifications)(),a=n[n.length-1];if(!a)return null;let{iconTone:s}=tp(a.severity),c=np(a),l=()=>r(a.id),u=a.dismissible===!1;return(0,o.jsx)(Ae,{open:!0,onOpenChange:e=>{!e&&!u&&l()},children:(0,o.jsxs)(Pe,{className:e,"data-notification-surface":`alert`,"data-severity":a.severity,onEscapeKeyDown:e=>{u&&e.preventDefault()},children:[(0,o.jsxs)(Fe,{children:[(0,o.jsxs)(Le,{className:`flex items-center gap-2`,children:[(0,o.jsx)(c,{className:q(`h-5 w-5 shrink-0`,s),"aria-hidden":`true`}),a.title]}),a.message?(0,o.jsx)(Z,{children:a.message}):null]}),(0,o.jsxs)(Ie,{children:[a.actions?.map(e=>(0,o.jsx)(Re,{className:q(cp[ip(e.variant)]),onClick:()=>{e.onClick(),l()},children:e.label},e.label)),(0,o.jsx)(Re,{className:q(a.actions?.length?cp.secondary:void 0),onClick:l,children:t})]})]})})}lp.displayName=`NotificationAlerts`;function up({scope:e,className:t}){let n=(0,i.useNotificationsByPresentation)(`inline`,e),{dismiss:r,config:a}=(0,i.useNotifications)();if(n.length===0)return null;let s=(0,i.visibleNotificationStack)(n,a);return(0,o.jsx)(`div`,{className:q(`flex w-full flex-col gap-2`,t),"data-notification-surface":`inline`,"data-scope":e,children:s.map(e=>{let{tone:t}=tp(e.severity),n=np(e);return(0,o.jsxs)(`div`,{role:`status`,"data-severity":e.severity,className:q(`flex items-start gap-3 rounded-md border px-3 py-2 text-sm`,t),children:[(0,o.jsx)(n,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`font-medium`,children:e.title}),e.message?(0,o.jsx)(`div`,{className:`opacity-90`,children:e.message}):null,e.actions?.length?(0,o.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map(e=>(0,o.jsx)(X,{size:`sm`,variant:ip(e.variant),className:`h-7`,onClick:e.onClick,children:e.label},e.label))}):null]}),e.dismissible===!1?null:(0,o.jsx)(X,{size:`icon`,variant:`ghost`,className:`-mr-1 h-6 w-6 shrink-0`,"aria-label":`Dismiss ${e.title}`,onClick:()=>r(e.id),children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})]},e.id)})})}up.displayName=`NotificationInline`;function dp(e,t){let n=t?.maxHistory??50,[r,i]=(0,a.useState)({...e}),[o,s]=(0,a.useState)(t?.mode===`create`),c=(0,a.useRef)([]),l=(0,a.useRef)([]),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{i({...e}),s(t?.mode===`create`),c.current=[],l.current=[]},[e]);let d=(0,a.useCallback)((e,r)=>{i(t=>(c.current=[...c.current.slice(-(n-1)),t],l.current=[],{...t,[e]:r})),s(!0),u(e=>e+1),t?.onUpdate?.(e,r)},[t?.onUpdate,n]),f=(0,a.useCallback)(()=>{c.current.length!==0&&(i(e=>{let t=[...c.current],n=t.pop();return c.current=t,l.current=[e,...l.current],n}),u(e=>e+1))},[]),p=(0,a.useCallback)(()=>{l.current.length!==0&&(i(e=>{let t=[...l.current],n=t.shift();return l.current=t,c.current=[...c.current,e],n}),u(e=>e+1))},[]);return{draft:r,isDirty:o,updateField:d,discard:(0,a.useCallback)(()=>{i({...e}),s(!1),c.current=[],l.current=[],u(e=>e+1)},[e]),setDraft:i,undo:f,redo:p,canUndo:c.current.length>0,canRedo:l.current.length>0}}function fp(e){let[t,n]=a.useState({width:0,height:0});return a.useEffect(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=t.getBoundingClientRect();n(e=>e.width===r.width&&e.height===r.height?e:{width:r.width,height:r.height});let i=new ResizeObserver(e=>{let t=e[0];if(!t)return;let r,i=t.borderBoxSize?.[0];r=i?{width:i.inlineSize,height:i.blockSize}:{width:t.contentRect.width,height:t.contentRect.height},n(e=>e.width===r.width&&e.height===r.height?e:r)});return i.observe(t),()=>i.disconnect()},[e]),t}function pp({schema:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No schema available`})}function mp({dataContext:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No data context available`})}function hp(){let e=(0,a.useMemo)(()=>{try{return t.ComponentRegistry.getAllTypes()}catch{return[]}},[]);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No registered components`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded text-xs font-mono bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-green-500 shrink-0`}),e]},e)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` component`,e.length===1?``:`s`,` registered`]})]})}function gp({flags:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No debug flags`})}function _p(e){let n=t.DebugCollector.getInstance(),[r,i]=(0,a.useState)(()=>n.getEntries(e));return a.default.useEffect(()=>(i(n.getEntries(e)),n.subscribe(()=>{i(n.getEntries(e))})),[n,e]),r}function vp(){let e=_p(`perf`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No performance data collected yet`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:q(`flex items-center justify-between px-2 py-1 rounded text-xs font-mono`,e.durationMs>16?`bg-red-50 text-red-700`:`bg-muted/30`),children:[(0,o.jsxs)(`span`,{className:`truncate mr-2`,children:[e.type,e.id?`:${e.id}`:``]}),(0,o.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[e.durationMs.toFixed(2),`ms`]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` render`,e.length===1?``:`s`,` tracked`]})]})}function yp(){let e=_p(`expr`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No expression evaluations tracked yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsx)(`div`,{className:`text-muted-foreground truncate`,children:e.expression}),(0,o.jsxs)(`div`,{className:`mt-0.5`,children:[`→ `,JSON.stringify(e.result)]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` evaluation`,e.length===1?``:`s`,` tracked`]})]})}function bp(){let e=_p(`event`),t=(0,_.useDisplayLocale)(),n=e.map(e=>e.data);return n.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No events captured yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[n.map((e,n)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsx)(`span`,{className:`font-semibold`,children:e.action}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(t)})]}),e.payload!==void 0&&(0,o.jsx)(`pre`,{className:`mt-0.5 text-[10px] text-muted-foreground truncate`,children:JSON.stringify(e.payload)})]},n)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[n.length,` event`,n.length===1?``:`s`,` captured`]})]})}function xp({open:e,onClose:t,flags:n,schema:r,dataContext:i,extraTabs:s=[],className:c}){let l=(0,a.useMemo)(()=>[{id:`schema`,label:`Schema`,render:()=>(0,o.jsx)(pp,{schema:r})},{id:`data`,label:`Data`,render:()=>(0,o.jsx)(mp,{dataContext:i})},{id:`perf`,label:`Perf`,render:()=>(0,o.jsx)(vp,{})},{id:`expr`,label:`Expr`,render:()=>(0,o.jsx)(yp,{})},{id:`events`,label:`Events`,render:()=>(0,o.jsx)(bp,{})},{id:`registry`,label:`Registry`,render:()=>(0,o.jsx)(hp,{})},{id:`flags`,label:`Flags`,render:()=>(0,o.jsx)(gp,{flags:n})}],[r,i,n]),u=(0,a.useMemo)(()=>[...l,...s],[l,s]),[d,f]=(0,a.useState)(u[0]?.id??`schema`),p=u.find(e=>e.id===d)??u[0],m=(0,a.useCallback)(e=>{f(e)},[]);return e?(0,o.jsxs)(`div`,{className:q(`fixed bottom-4 right-4 z-[9999] w-[420px] max-w-[95vw] rounded-lg border bg-background shadow-2xl`,`flex flex-col overflow-hidden`,c),"data-testid":`debug-panel`,role:`dialog`,"aria-label":`Developer Debug Panel`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`🛠 Debug Panel`}),(0,o.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground text-sm leading-none px-1`,"aria-label":`Close debug panel`,"data-testid":`debug-panel-close`,children:`✕`})]}),(0,o.jsx)(`div`,{className:`flex border-b overflow-x-auto`,role:`tablist`,children:u.map(e=>(0,o.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===p?.id,onClick:()=>m(e.id),className:q(`px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors`,e.id===p?.id?`border-b-2 border-primary text-foreground`:`text-muted-foreground hover:text-foreground`),"data-testid":`debug-tab-${e.id}`,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-1`,children:e.icon}),e.label]},e.id))}),(0,o.jsx)(`div`,{className:`p-3 overflow-auto max-h-[50vh]`,"data-testid":`debug-panel-content`,children:p?.render()})]}):null}var Sp={permission:`view`,audience:`link_only`,expiresInDays:7,password:``,label:``},Cp=[{label:`1 day`,value:1},{label:`7 days`,value:7},{label:`30 days`,value:30},{label:`90 days`,value:90},{label:`Never`,value:null}],wp=[{value:`link_only`,label:`Anyone with the link`,help:`No sign-in required`},{value:`signed_in`,label:`Signed-in users`,help:`Must be logged in to view`}];function Tp(e,t){return`${(e??(typeof window<`u`?`${window.location.origin}/s`:`/s`)).replace(/\/+$/,``)}/${t}`}async function Ep(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document<`u`){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),document.body.removeChild(t),!0}catch{document.body.removeChild(t)}}return!1}function Dp({open:e,onOpenChange:t,objectName:n,recordId:r,recordLabel:i,apiBase:s,publicBaseUrl:c,fetchHeaders:u}){let[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),[y,b]=(0,a.useState)(Sp),[x,S]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{let e={"Content-Type":`application/json`};if(!u)return e;let t=await u();return{...e,...t}},[u]),w=(0,a.useMemo)(()=>`${s.replace(/\/+$/,``)}/v1/share-links?object=${encodeURIComponent(n)}&recordId=${encodeURIComponent(r)}`,[s,n,r]),T=(0,a.useCallback)(async()=>{m(!0),v(null);try{let e=await C(),t=await fetch(w,{headers:e,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(n.links??n.data??[])}catch(e){v(e?.message??`Failed to load share links`)}finally{m(!1)}},[w,C]);(0,a.useEffect)(()=>{e&&(T(),b(Sp))},[e,T]);let E=(0,a.useCallback)(async()=>{g(!0),v(null);try{let e=y.expiresInDays==null?void 0:new Date(Date.now()+y.expiresInDays*24*60*60*1e3).toISOString(),t=await C(),i=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links`,{method:`POST`,headers:t,credentials:`include`,body:JSON.stringify({object:n,recordId:r,permission:y.permission,audience:y.audience,expiresAt:e,password:y.password.trim()||void 0,label:y.label.trim()||void 0})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message||`HTTP ${i.status}`)}let a=await i.json(),o=a.link??a.data;if(!o)throw Error(`Share link create response missing link payload`);f(e=>[o,...e]),await Ep(Tp(c,o.token))&&(S(o.id),setTimeout(()=>S(null),1500)),b(Sp)}catch(e){v(e?.message??`Failed to create share link`)}finally{g(!1)}},[s,C,n,r,y,c]),D=(0,a.useCallback)(async e=>{try{let t=await C(),n=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links/${encodeURIComponent(e.id)}`,{method:`DELETE`,headers:t,credentials:`include`});if(!n.ok&&n.status!==204)throw Error(`HTTP ${n.status}`);f(t=>t.map(t=>t.id===e.id?{...t,revoked_at:new Date().toISOString()}:t))}catch(e){v(e?.message??`Failed to revoke link`)}},[s,C]),O=(0,a.useCallback)(async e=>{await Ep(Tp(c,e.token))&&(S(e.id),setTimeout(()=>S(null),1500))},[c]),k=d.filter(e=>!e.revoked_at),A=d.filter(e=>e.revoked_at);return(0,o.jsx)(Nt,{open:e,onOpenChange:t,children:(0,o.jsxs)(Rt,{className:`max-w-xl`,"data-testid":`share-dialog`,children:[(0,o.jsxs)(zt,{children:[(0,o.jsxs)(Vt,{className:`flex items-center gap-2`,children:[(0,o.jsx)(l.Link2,{className:`h-4 w-4`}),`Share `,i??`this record`]}),(0,o.jsx)(Ht,{children:`Generate a link anyone (or selected people) can use to open this record. Links can be revoked at any time.`})]}),_&&(0,o.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,"data-testid":`share-dialog-error`,children:_}),(0,o.jsxs)(`section`,{className:`space-y-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(Bn,{className:`text-xs`,children:`Who can access`}),(0,o.jsxs)(Wr,{value:y.audience,onValueChange:e=>b(t=>({...t,audience:e})),children:[(0,o.jsx)(qr,{className:`h-8 text-xs`,"data-testid":`share-audience`,children:(0,o.jsx)(Kr,{})}),(0,o.jsx)(Xr,{children:wp.map(e=>(0,o.jsx)(Qr,{value:e.value,className:`text-xs`,children:(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[(0,o.jsx)(`span`,{children:e.label}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.help})]})},e.value))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(Bn,{className:`text-xs`,children:`Expires in`}),(0,o.jsxs)(Wr,{value:y.expiresInDays==null?`never`:String(y.expiresInDays),onValueChange:e=>b(t=>({...t,expiresInDays:e===`never`?null:Number(e)})),children:[(0,o.jsx)(qr,{className:`h-8 text-xs`,"data-testid":`share-expiry`,children:(0,o.jsx)(Kr,{})}),(0,o.jsx)(Xr,{children:Cp.map(e=>(0,o.jsx)(Qr,{value:e.value==null?`never`:String(e.value),className:`text-xs`,children:e.label},String(e.value)))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(Bn,{className:`text-xs`,children:`Password (optional)`}),(0,o.jsx)(Q,{type:`password`,value:y.password,onChange:e=>b(t=>({...t,password:e.target.value})),placeholder:`Require a password to open`,className:`h-8 text-xs`,"data-testid":`share-password`})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(Bn,{className:`text-xs`,children:`Label (only you see this)`}),(0,o.jsx)(Q,{value:y.label,onChange:e=>b(t=>({...t,label:e.target.value})),placeholder:`e.g. Sent to design review`,className:`h-8 text-xs`,"data-testid":`share-label`})]})]}),(0,o.jsx)(`div`,{className:`flex justify-end`,children:(0,o.jsxs)(X,{size:`sm`,onClick:E,disabled:h,"data-testid":`share-create`,children:[h?(0,o.jsx)(l.Loader2,{className:`mr-1 h-3 w-3 animate-spin`}):(0,o.jsx)(l.Link2,{className:`mr-1 h-3 w-3`}),`Create link`]})})]}),(0,o.jsxs)(`section`,{className:`space-y-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:[`Existing links`,k.length?` (${k.length})`:``]}),p&&(0,o.jsx)(l.Loader2,{className:`h-3 w-3 animate-spin text-muted-foreground`})]}),!p&&k.length===0&&A.length===0&&(0,o.jsx)(`p`,{className:`rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground`,children:`No share links yet. Create one above.`}),(0,o.jsxs)(`ul`,{className:`space-y-2`,children:[k.map(e=>(0,o.jsx)(Op,{link:e,copied:x===e.id,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:c},e.id)),A.length>0&&(0,o.jsx)(`li`,{className:`pt-2 text-[10px] uppercase tracking-wide text-muted-foreground`,children:`Revoked`}),A.map(e=>(0,o.jsx)(Op,{link:e,copied:!1,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:c,disabled:!0},e.id))]})]}),(0,o.jsx)(Bt,{children:(0,o.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>t(!1),children:`Done`})})]})})}function Op({link:e,copied:t,onCopy:n,onRevoke:r,publicBaseUrl:i,disabled:a}){let s=Tp(i,e.token);return(0,o.jsxs)(`li`,{className:q(`flex items-center gap-2 rounded-md border bg-card px-2 py-2 text-xs`,a&&`opacity-60`),"data-testid":`share-link-row`,children:[(0,o.jsx)(Ye,{variant:`secondary`,className:`text-[10px] capitalize`,children:e.audience.replace(`_`,` `)}),(0,o.jsx)(Ye,{variant:`outline`,className:`text-[10px] capitalize`,children:e.permission}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-mono text-[11px]`,title:s,children:s}),e.label&&(0,o.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})]}),!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(X,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:n,"data-testid":`share-link-copy`,children:[(0,o.jsx)(l.Copy,{className:`mr-1 h-3 w-3`}),t?`Copied!`:`Copy`]}),(0,o.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive`,onClick:r,"data-testid":`share-link-revoke`,title:`Revoke`,children:(0,o.jsx)(l.Trash2,{className:`h-3 w-3`})})]}),a&&(0,o.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,o.jsx)(l.ShieldOff,{className:`h-3 w-3`}),`revoked`]})]})}function kp(){return!0}e.Accordion=Ee,e.AccordionContent=Oe,e.AccordionItem=Y,e.AccordionTrigger=De,e.Alert=Ve,e.AlertDescription=Ue,e.AlertDialog=Ae,e.AlertDialogAction=Re,e.AlertDialogCancel=ze,e.AlertDialogContent=Pe,e.AlertDialogDescription=Z,e.AlertDialogFooter=Ie,e.AlertDialogHeader=Fe,e.AlertDialogOverlay=Ne,e.AlertDialogPortal=Me,e.AlertDialogTitle=Le,e.AlertDialogTrigger=je,e.AlertTitle=He,e.AspectRatio=We,e.Avatar=Ge,e.AvatarFallback=qe,e.AvatarImage=Ke,e.Badge=Ye,e.Breadcrumb=Xe,e.BreadcrumbEllipsis=nt,e.BreadcrumbItem=Qe,e.BreadcrumbLink=$e,e.BreadcrumbList=Ze,e.BreadcrumbPage=et,e.BreadcrumbSeparator=tt,e.Button=X,e.ButtonGroup=ac,e.ButtonGroupSeparator=sc,e.ButtonGroupText=oc,e.Calendar=ft,e.CalendarDayButton=pt,e.Card=mt,e.CardContent=vt,e.CardDescription=_t,e.CardFooter=yt,e.CardHeader=ht,e.CardTitle=gt,e.Carousel=St,e.CarouselContent=Ct,e.CarouselItem=wt,e.CarouselNext=Et,e.CarouselPrevious=Tt,e.CharacterCount=rs,e.ChartSkeleton=su,e.Checkbox=Dt,e.Collapsible=Ot,e.CollapsibleContent=At,e.CollapsibleTrigger=kt,e.Combobox=cc,e.Command=Ut,e.CommandDialog=Wt,e.CommandEmpty=qt,e.CommandGroup=Jt,e.CommandInput=Gt,e.CommandItem=Xt,e.CommandList=Kt,e.CommandSeparator=Yt,e.CommandShortcut=Zt,e.ConfigFieldRenderer=cl,e.ConfigPanelRenderer=dl,e.ConfigRow=lc,e.ContextMenu=Qt,e.ContextMenuCheckboxItem=ln,e.ContextMenuContent=sn,e.ContextMenuGroup=en,e.ContextMenuItem=cn,e.ContextMenuLabel=dn,e.ContextMenuPortal=tn,e.ContextMenuRadioGroup=rn,e.ContextMenuRadioItem=un,e.ContextMenuSeparator=fn,e.ContextMenuShortcut=pn,e.ContextMenuSub=nn,e.ContextMenuSubContent=on,e.ContextMenuSubTrigger=an,e.ContextMenuTrigger=$t,e.DataEmptyState=hu,e.EmptyState=hu,e.DataErrorState=gu,e.DataLoadingState=mu,e.DatePicker=fl,e.DebugPanel=xp,e.Dialog=Nt,e.DialogClose=It,e.DialogContent=Rt,e.DialogDescription=Ht,e.DialogFooter=Bt,e.DialogHeader=zt,e.DialogOverlay=Lt,e.DialogPortal=Ft,e.DialogTitle=Vt,e.DialogTrigger=Pt,e.Drawer=mn,e.DrawerClose=_n,e.DrawerContent=yn,e.DrawerDescription=Cn,e.DrawerFooter=xn,e.DrawerHeader=bn,e.DrawerOverlay=vn,e.DrawerPortal=gn,e.DrawerTitle=Sn,e.DrawerTrigger=hn,e.DropdownMenu=wn,e.DropdownMenuCheckboxItem=Pn,e.DropdownMenuContent=Mn,e.DropdownMenuGroup=En,e.DropdownMenuItem=Nn,e.DropdownMenuLabel=In,e.DropdownMenuPortal=Dn,e.DropdownMenuRadioGroup=kn,e.DropdownMenuRadioItem=Fn,e.DropdownMenuSeparator=Ln,e.DropdownMenuShortcut=Rn,e.DropdownMenuSub=On,e.DropdownMenuSubContent=jn,e.DropdownMenuSubTrigger=An,e.DropdownMenuTrigger=Tn,e.Empty=ml,e.EmptyContent=bl,e.EmptyDescription=yl,e.EmptyHeader=hl,e.EmptyMedia=_l,e.EmptyTitle=vl,e.EmptyValue=xl,e.FILTER_BUILDER_OPERATORS=fc,e.FieldContainer=Cl,e.FilterBuilder=nl,e.Form=Vn,e.FormControl=Jn,e.FormDescription=Yn,e.FormField=Un,e.FormItem=Kn,e.FormLabel=qn,e.FormMessage=Xn,e.FormSkeleton=au,e.FullscreenEditor=Zo,e.GridFieldAuthoringProvider=tf,e.GridSkeleton=ru,e.GroupingEditor=nu,e.HoverCard=Zn,e.HoverCardContent=$n,e.HoverCardTrigger=Qn,e.Input=Q,e.InputGroup=wl,e.InputOTP=er,e.InputOTPGroup=tr,e.InputOTPSeparator=rr,e.InputOTPSlot=nr,e.Item=Ol,e.ItemActions=Pl,e.ItemContent=jl,e.ItemDescription=Nl,e.ItemFooter=Il,e.ItemGroup=Tl,e.ItemHeader=Fl,e.ItemMedia=Al,e.ItemSeparator=El,e.ItemTitle=Ml,e.KanbanSkeleton=iu,e.Kbd=Ll,e.KbdGroup=Rl,e.Label=Bn,e.LazyIcon=ro,e.ListSkeleton=ou,e.LookupValuePicker=il,e.Menubar=lr,e.MenubarCheckboxItem=hr,e.MenubarContent=pr,e.MenubarGroup=ar,e.MenubarItem=mr,e.MenubarLabel=_r,e.MenubarMenu=ir,e.MenubarPortal=or,e.MenubarRadioGroup=sr,e.MenubarRadioItem=gr,e.MenubarSeparator=vr,e.MenubarShortcut=yr,e.MenubarSub=cr,e.MenubarSubContent=fr,e.MenubarSubTrigger=dr,e.MenubarTrigger=ur,e.MobileDialogContent=Ul,e.NOTIFICATION_ACTION_BUTTON_VARIANTS=rp,e.NOTIFICATION_POSITION_CLASSES=ap,e.NOTIFICATION_SEVERITY_STYLES=ep,e.NativeSelect=zl,e.NavigationMenu=br,e.NavigationMenuContent=Tr,e.NavigationMenuIndicator=Or,e.NavigationMenuItem=Sr,e.NavigationMenuLink=Er,e.NavigationMenuList=xr,e.NavigationMenuTrigger=wr,e.NavigationMenuViewport=Dr,e.NavigationOverlay=$l,e.NotificationAlerts=lp,e.NotificationBanners=op,e.NotificationInline=up,e.NotificationSnackbar=sp,e.Pagination=kr,e.PaginationContent=Ar,e.PaginationEllipsis=Fr,e.PaginationItem=jr,e.PaginationLink=Mr,e.PaginationNext=Pr,e.PaginationPrevious=Nr,e.Popover=Ir,e.PopoverContent=Rr,e.PopoverTrigger=Lr,e.Progress=zr,e.RadioGroup=Br,e.RadioGroupItem=Vr,e.RecordTitleChip=uu,e.RefreshIndicator=pu,e.RelatedCountStore=bd,e.ResizableHandle=Yo,e.ResizablePanel=Jo,e.ResizablePanelGroup=qo,e.ScrollArea=Hr,e.ScrollBar=Ur,e.SectionHeader=ll,e.Select=Wr,e.SelectContent=Xr,e.SelectGroup=Gr,e.SelectItem=Qr,e.SelectLabel=Zr,e.SelectScrollDownButton=Yr,e.SelectScrollUpButton=Jr,e.SelectSeparator=$r,e.SelectTrigger=qr,e.SelectValue=Kr,e.Separator=ei,e.ShareDialog=Dp,e.Sheet=ti,e.SheetClose=ri,e.SheetContent=si,e.SheetDescription=di,e.SheetFooter=li,e.SheetHeader=ci,e.SheetOverlay=ai,e.SheetPortal=ii,e.SheetTitle=ui,e.SheetTrigger=ni,e.ShimmerSkeleton=lu,e.Sidebar=ki,e.SidebarContent=Li,e.SidebarFooter=Fi,e.SidebarGroup=Ri,e.SidebarGroupAction=Bi,e.SidebarGroupContent=Vi,e.SidebarGroupLabel=zi,e.SidebarHeader=Pi,e.SidebarInput=Ni,e.SidebarInset=Mi,e.SidebarMenu=Hi,e.SidebarMenuAction=Ki,e.SidebarMenuBadge=qi,e.SidebarMenuButton=Gi,e.SidebarMenuItem=Ui,e.SidebarMenuSkeleton=Ji,e.SidebarMenuSub=Yi,e.SidebarMenuSubButton=Zi,e.SidebarMenuSubItem=Xi,e.SidebarProvider=Oi,e.SidebarRail=ji,e.SidebarSeparator=Ii,e.SidebarTrigger=Ai,e.Skeleton=$,e.Slider=$i,e.SortBuilder=ol,e.Spinner=eu,e.Switch=ta,e.TOASTER_POSITIONS=Xd,e.Table=na,e.TableBody=ia,e.TableCaption=la,e.TableCell=ca,e.TableFooter=aa,e.TableHead=sa,e.TableHeader=ra,e.TableRow=oa,e.Tabs=ua,e.TabsContent=pa,e.TabsList=da,e.TabsTrigger=fa,e.Textarea=ma,e.Toaster=ea,e.Toggle=ga,e.ToggleGroup=va,e.ToggleGroupItem=ya,e.Tooltip=gi,e.TooltipContent=vi,e.TooltipProvider=hi,e.TooltipTrigger=_i,e.TypographyBlockquote=Ta,e.TypographyH1=ba,e.TypographyH2=xa,e.TypographyH3=Sa,e.TypographyH4=Ca,e.TypographyInlineCode=Da,e.TypographyLarge=ka,e.TypographyLead=Oa,e.TypographyList=Ea,e.TypographyMuted=ja,e.TypographyP=wa,e.TypographySmall=Aa,e.VALUELESS_FILTER_BUILDER_OPERATORS=vc,e.ViewSkeleton=cu,e.badgeVariants=Je,e.buttonGroupVariants=ic,e.buttonVariants=ke,e.cn=q,Object.defineProperty(e,"cva",{enumerable:!0,get:function(){return f.cva}}),e.filterValueArity=xc,e.getLazyIcon=no,Object.defineProperty(e,"hasDeclaredVisibilityGate",{enumerable:!0,get:function(){return t.hasDeclaredPredicate}}),e.initializeComponents=kp,e.isCustomRowActionVisible=Sf,e.isEmptyNodeSlot=fe,e.isFilterValueComplete=Ic,e.isInsidePopperLayer=Vl,e.isLucideIconName=eo,e.legacyRecordDrawerWidthKey=Kl,e.mountedOperatorValue=wc,e.narrowFilterValueToOptions=Fc,e.navigationMenuTriggerStyle=Cr,e.normalizeFilterBuilderOperator=gc,e.notificationActionVariant=ip,e.notificationIcon=np,e.notificationSeverityStyle=tp,e.operatorsForFieldType=Xc,e.reconcileOperatorForField=Cc,e.recordOverlayWidthStorageKey=Gl,e.registerPlaceholders=$f,e.renderChildren=J,e.renderNodeSlot=pe,e.reshapeFilterValue=Sc,e.resolveIcon=Wa,e.retypeFilterValue=jc,e.toKebabIconName=Za,e.toast=B.toast,e.toggleVariants=ha,e.useConfigDraft=dp,e.useFormField=Wn,e.useGridFieldAuthoring=nf,e.useIsMobile=pi,e.useOptionalSidebar=Di,e.useOverlayAnchor=ql,e.usePopperAwareInteractOutside=Hl,e.useRelatedCount=vd,e.useRelatedCountVersion=yd,e.useResizeObserver=fp,e.useSidebar=Ei});
17
+ `,document.head.appendChild(t),Yu=!0}var Zu=({active:e,ariaLabel:t,className:n,...r})=>(a.useEffect(()=>{e&&Xu()},[e]),e?(0,o.jsx)(`div`,{className:q(`pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden`,n),role:`progressbar`,"aria-busy":`true`,"aria-label":t,"data-testid":`refresh-indicator`,...r,children:(0,o.jsx)(`div`,{className:`h-full w-1/4 rounded-full bg-primary/70`,style:{animation:`objui-refresh-bar 1.1s ease-in-out infinite`}})}):null);Zu.displayName=`RefreshIndicator`;function Qu({className:e,message:t=`Loading…`,...n}){return(0,o.jsxs)(`div`,{role:`status`,"aria-label":t,"data-slot":`data-loading-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...n,children:[(0,o.jsx)(l.Loader2,{className:`size-6 animate-spin text-muted-foreground`}),t&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})}function $u({className:e,icon:t,illustration:n,showIcon:r=!0,iconWrapperClassName:i,title:a=`No data`,description:s,action:c,children:u,...d}){let f=r&&(t!=null||!n);return(0,o.jsxs)(`div`,{role:`status`,"data-slot":`data-empty-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-illustration`,className:`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300 [&_svg]:max-h-40 [&_svg]:w-auto`,"aria-hidden":!0,children:n}),f&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-icon`,className:q(i??`flex size-10 items-center justify-center rounded-lg bg-muted`),children:t??(0,o.jsx)(l.InboxIcon,{className:`size-5 text-muted-foreground`})}),a&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:a}),s&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:s}),c,u]})}function ed({className:e,icon:t,showIcon:n=!0,iconWrapperClassName:r,title:i=`Something went wrong`,message:a,onRetry:s,retryLabel:c=`Retry`,children:u,...d}){return(0,o.jsxs)(`div`,{role:`alert`,"data-slot":`data-error-state`,className:q(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-error-state-icon`,className:q(r??`flex size-10 items-center justify-center rounded-lg bg-destructive/10`),children:t??(0,o.jsx)(l.AlertCircle,{className:`size-5 text-destructive`})}),i&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:i}),a&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:a}),s&&(0,o.jsx)(Y,{variant:`outline`,size:`sm`,onClick:s,children:c}),u]})}function td({link:e,displayLocale:t,className:n,"data-testid":r=`empty-state-link`}){let{runner:a}=(0,i.useAction)(),s=(0,U.resolveI18nLabel)(e?.label,t);if(!e||!s)return null;let c=async()=>{let t=await a.execute({type:`url`,target:e.url,toast:{showOnSuccess:!1}});if(!t.success){console.warn(`[EmptyStateLink] link not followed`,t.error);return}t.redirect&&window.location.assign(t.redirect)};return(0,o.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,"data-testid":r,className:q(n),onClick:()=>{c()},children:s})}function nd(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function rd(e,{disabled:t=!1}={}){let[n,r]=a.useState(!1);return a.useLayoutEffect(()=>{let n=e.current;if(t||!n){r(!1);return}let i=()=>r(nd(n));i(),n.addEventListener(`scroll`,i,{passive:!0});let a=null;if(typeof ResizeObserver<`u`){a=new ResizeObserver(i),a.observe(n);for(let e of Array.from(n.children))a.observe(e)}return()=>{n.removeEventListener(`scroll`,i),a?.disconnect()}},[e,t]),n}var id=`[scrollbar-width:thin]! [scrollbar-color:transparent_transparent]! hover:[scrollbar-color:var(--color-muted-foreground)_transparent]! focus-within:[scrollbar-color:var(--color-muted-foreground)_transparent]!`,ad=`before:pointer-events-none before:absolute before:inset-y-0 before:right-full before:w-6 before:bg-gradient-to-l before:from-foreground/10 before:to-transparent before:opacity-0 group-data-[overflow-right=true]/hscroll:before:opacity-100`,od=a.forwardRef(({seam:e=`edge`,outerClassName:t,className:n,children:r,...i},s)=>{let c=a.useRef(null),l=a.useCallback(e=>{c.current=e,typeof s==`function`?s(e):s&&(s.current=e)},[s]),u=rd(c);return(0,o.jsxs)(`div`,{className:q(`relative min-w-0`,t),children:[(0,o.jsx)(`div`,{...i,ref:l,"data-overflow-right":u?`true`:void 0,className:q(`group/hscroll overflow-x-auto`,id,n),children:r}),u&&e===`edge`&&(0,o.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`horizontal-overflow-shadow`,className:`pointer-events-none absolute inset-y-0 right-0 z-30 w-6 bg-gradient-to-l from-foreground/10 to-transparent`})]})});od.displayName=`HorizontalOverflowBox`,t.ComponentRegistry.register(`combobox`,({schema:e,disabled:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:s,...c}=n,l=a.default.useId(),u=e.description?`${l}-description`:void 0,d=[c[`aria-describedby`],u].filter(Boolean).join(` `)||void 0,f=(0,o.jsx)(Bc,{options:e.options||[],placeholder:e.placeholder,value:e.value,disabled:t,className:e.className,...os(c),"aria-describedby":d,"data-obj-id":r,"data-obj-type":i,style:s});return u?(0,o.jsxs)(`div`,{className:`grid gap-1.5`,children:[f,(0,o.jsx)(`p`,{id:u,className:`text-sm text-muted-foreground`,children:e.description})]}):f},{namespace:`ui`,label:`Combobox`,inputs:[{name:`placeholder`,type:`string`},{name:`value`,type:`string`},{name:`disabled`,type:`boolean`},{name:`className`,type:`string`},{name:`name`,type:`string`},{name:`description`,type:`string`}],defaultProps:{placeholder:`Select option...`,options:[]}}),t.ComponentRegistry.register(`command`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsxs)(Wt,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:[(0,o.jsx)(Kt,{placeholder:e.placeholder||`Type a command or search...`}),(0,o.jsxs)(qt,{children:[(0,o.jsx)(Jt,{children:e.emptyText||`No results found.`}),e.groups?.map((e,t)=>(0,o.jsx)(Yt,{heading:e.heading,children:e.items?.map((e,t)=>{let n=Ga(e.icon);return(0,o.jsxs)(Zt,{value:e.value,children:[n&&(0,o.jsx)(n,{className:`h-4 w-4`}),e.label]},t)})},t))]})]})},{namespace:`ui`,label:`Command`,inputs:[{name:`placeholder`,type:`string`},{name:`emptyText`,type:`string`},{name:`className`,type:`string`}],defaultProps:{placeholder:`Type a command or search...`,emptyText:`No results found.`,groups:[]}});var sd=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let{style:a,...s}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(s),className:n,style:a,children:J(e.children)})});sd.displayName=`BoxRenderer`,t.ComponentRegistry.register(`box`,sd,{namespace:`ui`,label:`Box`,category:`layout`,isContainer:!0,inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}]});var cd=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,l=e.clickable||!!n.onClick,u=e.hoverable||l,d=J(e.header);return(0,o.jsxs)(ht,{ref:r,className:q(t,u&&`transition-colors hover:bg-muted/50`,l&&`cursor-pointer active:bg-muted`),...c,"data-obj-id":i,"data-obj-type":a,style:s,children:[(e.title||e.description||d!==null)&&(0,o.jsxs)(gt,{children:[e.title&&(0,o.jsx)(_t,{children:e.title}),e.description&&(0,o.jsx)(vt,{children:e.description}),d]}),me(e.children,e=>(0,o.jsx)(yt,{children:J(e)})),me(e.footer,e=>(0,o.jsx)(bt,{className:`flex justify-between`,children:J(e)}))]})});t.ComponentRegistry.register(`card`,cd,{namespace:`ui`,label:`Card`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{title:`Card Title`,description:`Card description goes here`,className:`w-full`},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`tabs`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i,u=e=>{n&&n(e)},d=e.orientation===`vertical`;return(0,o.jsxs)(da,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:u,orientation:e.orientation||`horizontal`,className:q(t,d&&`flex gap-2`),...l,"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)(fa,{className:q(d&&`flex-col h-auto items-stretch bg-muted/50 p-1`),children:e.items?.map(e=>(0,o.jsx)(pa,{value:e.value,disabled:e.disabled,className:q(d&&`justify-start`),children:e.label},e.value))}),e.items?.map(e=>(0,o.jsx)(ma,{value:e.value,className:q(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,d&&`mt-0 flex-1`),children:J(e.content)},e.value))]})},{namespace:`ui`,label:`Tabs`,inputs:[{name:`defaultValue`,type:`string`,required:!0},{name:`className`,type:`string`},{name:`items`,type:`array`}],defaultProps:{defaultValue:`tab1`,items:[{label:`Tab 1`,value:`tab1`,content:[{type:`text`,content:`Content for Tab 1`}]},{label:`Tab 2`,value:`tab2`,content:[{type:`text`,content:`Content for Tab 2`}]},{label:`Tab 3`,value:`tab3`,content:[{type:`text`,content:`Content for Tab 3`}]}],className:`w-full`}});var ld={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`,7:`grid-cols-7`,8:`grid-cols-8`,9:`grid-cols-9`,10:`grid-cols-10`,11:`grid-cols-11`,12:`grid-cols-12`},ud={1:`sm:grid-cols-1`,2:`sm:grid-cols-2`,3:`sm:grid-cols-3`,4:`sm:grid-cols-4`,5:`sm:grid-cols-5`,6:`sm:grid-cols-6`,7:`sm:grid-cols-7`,8:`sm:grid-cols-8`,9:`sm:grid-cols-9`,10:`sm:grid-cols-10`,11:`sm:grid-cols-11`,12:`sm:grid-cols-12`},dd={1:`md:grid-cols-1`,2:`md:grid-cols-2`,3:`md:grid-cols-3`,4:`md:grid-cols-4`,5:`md:grid-cols-5`,6:`md:grid-cols-6`,7:`md:grid-cols-7`,8:`md:grid-cols-8`,9:`md:grid-cols-9`,10:`md:grid-cols-10`,11:`md:grid-cols-11`,12:`md:grid-cols-12`},fd={1:`lg:grid-cols-1`,2:`lg:grid-cols-2`,3:`lg:grid-cols-3`,4:`lg:grid-cols-4`,5:`lg:grid-cols-5`,6:`lg:grid-cols-6`,7:`lg:grid-cols-7`,8:`lg:grid-cols-8`,9:`lg:grid-cols-9`,10:`lg:grid-cols-10`,11:`lg:grid-cols-11`,12:`lg:grid-cols-12`},pd={1:`xl:grid-cols-1`,2:`xl:grid-cols-2`,3:`xl:grid-cols-3`,4:`xl:grid-cols-4`,5:`xl:grid-cols-5`,6:`xl:grid-cols-6`,7:`xl:grid-cols-7`,8:`xl:grid-cols-8`,9:`xl:grid-cols-9`,10:`xl:grid-cols-10`,11:`xl:grid-cols-11`,12:`xl:grid-cols-12`},md={1:`2xl:grid-cols-1`,2:`2xl:grid-cols-2`,3:`2xl:grid-cols-3`,4:`2xl:grid-cols-4`,5:`2xl:grid-cols-5`,6:`2xl:grid-cols-6`,7:`2xl:grid-cols-7`,8:`2xl:grid-cols-8`,9:`2xl:grid-cols-9`,10:`2xl:grid-cols-10`,11:`2xl:grid-cols-11`,12:`2xl:grid-cols-12`},hd=[{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8},{label:`9`,value:9},{label:`10`,value:10},{label:`11`,value:11},{label:`12`,value:12}],gd={0:`gap-0`,1:`gap-1`,2:`gap-2`,3:`gap-3`,4:`gap-4`,5:`gap-5`,6:`gap-6`,8:`gap-8`,10:`gap-10`,12:`gap-12`};t.ComponentRegistry.register(`grid`,({schema:e,className:n,...r})=>{let i=2,a,s,c,l,u;typeof e.columns==`number`?i=e.columns:typeof e.columns==`object`&&e.columns!==null&&(i=e.columns.xs??1,a=e.columns.sm,s=e.columns.md,c=e.columns.lg,l=e.columns.xl,u=e.columns[`2xl`]),typeof e.columns==`number`&&i>1&&(s=i,a=Math.min(2,i),i=1);let d=e.gap??4,f=q(`grid`,ld[i],a&&ud[a],s&&dd[s],c&&fd[c],l&&pd[l],u&&md[u],gd[d]||`gap-[${d*.25}rem]`,n),{style:p,...m}=r;return(0,o.jsx)(`div`,{...(0,t.toDomProps)(m),className:f,style:p,children:J(e.children)})},{namespace:`ui`,label:`Grid Layout`,inputs:[{name:`columns`,type:[`enum`,`object`],enum:hd,of:`enum`,description:`Column count, 1 to 12, or an object of such counts keyed by breakpoint (xs, sm, md, lg, xl, 2xl). Default 2.`},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`8`,value:8},{label:`10`,value:10},{label:`12`,value:12}],description:`Gap step between items; 0 is none. Default 4.`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{columns:{xs:1,md:2,lg:4},gap:4,children:[{type:`card`,title:`Card 1`,description:`First card`},{type:`card`,title:`Card 2`,description:`Second card`},{type:`card`,title:`Card 3`,description:`Third card`},{type:`card`,title:`Card 4`,description:`Fourth card`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`flex`,({schema:e,className:n,...r})=>{let i=e.direction||`row`,a=e.justify||`start`,s=e.align||`start`,c=e.gap??2,l=e.wrap||!1,u=q(`flex`,i===`row`&&`flex-row`,i===`col`&&`flex-col`,i===`row-reverse`&&`flex-row-reverse`,i===`col-reverse`&&`flex-col-reverse`,a===`start`&&`justify-start`,a===`end`&&`justify-end`,a===`center`&&`justify-center`,a===`between`&&`justify-between`,a===`around`&&`justify-around`,a===`evenly`&&`justify-evenly`,s===`start`&&`items-start`,s===`end`&&`items-end`,s===`center`&&`items-center`,s===`baseline`&&`items-baseline`,s===`stretch`&&`items-stretch`,c===0&&`gap-0`,c===1&&`gap-1`,c===2&&`gap-1.5 sm:gap-2`,c===3&&`gap-2 sm:gap-3`,c===4&&`gap-2 sm:gap-3 md:gap-4`,c===5&&`gap-3 sm:gap-4 md:gap-5`,c===6&&`gap-3 sm:gap-4 md:gap-6`,c===7&&`gap-4 sm:gap-5 md:gap-7`,c===8&&`gap-4 sm:gap-6 md:gap-8`,l&&`flex-wrap`,n),{style:d,...f}=r;return(0,o.jsx)(`div`,{...(0,t.toDomProps)(f),className:u,style:d,children:J(e.children)})},{namespace:`ui`,label:`Flex Layout`,inputs:[{name:`direction`,type:`enum`,enum:[`row`,`col`,`row-reverse`,`col-reverse`]},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`]},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`baseline`,`stretch`]},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8}],description:`Gap step between items; 0 is none. Default 2.`},{name:`wrap`,type:`boolean`,description:`Allow flex items to wrap`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{direction:`row`,justify:`start`,align:`start`,gap:2,wrap:!1,children:[{type:`button`,label:`Button 1`},{type:`button`,label:`Button 2`},{type:`button`,label:`Button 3`}]},isContainer:!0});var _d=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let a=e.direction||`col`,s=e.justify||`start`,c=e.align||`stretch`,l=e.gap??2,u=e.wrap||!1,d=q(`flex`,a===`row`&&`flex-row`,a===`col`&&`flex-col`,a===`row-reverse`&&`flex-row-reverse`,a===`col-reverse`&&`flex-col-reverse`,s===`start`&&`justify-start`,s===`end`&&`justify-end`,s===`center`&&`justify-center`,s===`between`&&`justify-between`,s===`around`&&`justify-around`,s===`evenly`&&`justify-evenly`,c===`start`&&`items-start`,c===`end`&&`items-end`,c===`center`&&`items-center`,c===`baseline`&&`items-baseline`,c===`stretch`&&`items-stretch`,l===0&&`gap-0`,l===1&&`gap-1`,l===2&&`gap-1.5 sm:gap-2`,l===3&&`gap-2 sm:gap-3`,l===4&&`gap-2 sm:gap-3 md:gap-4`,l===5&&`gap-3 sm:gap-4 md:gap-5`,l===6&&`gap-3 sm:gap-4 md:gap-6`,l===8&&`gap-4 sm:gap-6 md:gap-8`,l===10&&`gap-5 sm:gap-7 md:gap-10`,u&&`flex-wrap`,n),{style:f,...p}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(p),className:d,style:f,children:J(e.children)})});t.ComponentRegistry.register(`stack`,_d,{namespace:`ui`,label:`Stack`,inputs:[{name:`direction`,type:`enum`,enum:[`col`,`row`,`col-reverse`,`row-reverse`]},{name:`gap`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`8`,value:8},{label:`10`,value:10}],description:`Gap step between items; 0 is none. Default 2.`},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`stretch`,`baseline`]},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`]},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{direction:`col`,gap:2,align:`stretch`,children:[]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:100,minHeight:50}});var vd=(0,a.forwardRef)(({schema:e,className:n,...r},i)=>{let a=e.maxWidth??`xl`,s=e.padding??4,c=e.centered!==!1,l=q(`w-full`,a===!1&&`max-w-none`,a===`sm`&&`max-w-sm`,a===`md`&&`max-w-md`,a===`lg`&&`max-w-lg`,a===`xl`&&`max-w-xl`,a===`2xl`&&`max-w-2xl`,a===`3xl`&&`max-w-3xl`,a===`4xl`&&`max-w-4xl`,a===`5xl`&&`max-w-5xl`,a===`6xl`&&`max-w-6xl`,a===`7xl`&&`max-w-7xl`,a===`full`&&`max-w-full`,a===`screen`&&`max-w-screen-2xl`,c&&`mx-auto`,s===0&&`p-0`,s===1&&`p-0.5 sm:p-1`,s===2&&`p-1 sm:p-2`,s===3&&`p-2 sm:p-3`,s===4&&`p-2 sm:p-3 md:p-4`,s===5&&`p-3 sm:p-4 md:p-5`,s===6&&`p-3 sm:p-4 md:p-6`,s===7&&`p-4 sm:p-5 md:p-7`,s===8&&`p-4 sm:p-6 md:p-8`,s===10&&`p-5 sm:p-7 md:p-10`,s===12&&`p-6 sm:p-8 md:p-12`,s===16&&`p-8 sm:p-10 md:p-16`,n),{style:u,...d}=r;return(0,o.jsx)(`div`,{ref:i,...(0,t.toDomProps)(d),className:l,style:u,children:J(e.children)})});t.ComponentRegistry.register(`container`,vd,{namespace:`ui`,label:`Container`,inputs:[{name:`maxWidth`,type:`enum`,enum:[{label:`None (cancel max-width)`,value:!1},{label:`sm`,value:`sm`},{label:`md`,value:`md`},{label:`lg`,value:`lg`},{label:`xl`,value:`xl`},{label:`2xl`,value:`2xl`},{label:`3xl`,value:`3xl`},{label:`4xl`,value:`4xl`},{label:`5xl`,value:`5xl`},{label:`6xl`,value:`6xl`},{label:`7xl`,value:`7xl`},{label:`full`,value:`full`},{label:`screen`,value:`screen`}]},{name:`padding`,type:`enum`,enum:[{label:`0 (none)`,value:0},{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6},{label:`7`,value:7},{label:`8`,value:8},{label:`10`,value:10},{label:`12`,value:12},{label:`16`,value:16}],description:`Padding step on the container spacing scale; 0 is none. Default 4.`},{name:`centered`,type:`boolean`},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{maxWidth:`xl`,padding:4,centered:!0,children:[{type:`text`,content:`Container content goes here`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}});function yd(e){return e.split(/[-_:]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function bd(){let e={},n=new Set;for(let r of t.ComponentRegistry.getPublicConfigs()){let t=r.type;if(!t||r.isContainer||r.tier===`html`)continue;let o=yd(t);if(n.has(o))continue;n.add(o);let s=({children:e,...n})=>{let r=typeof n.type==`string`&&n.type!==t?n.type:void 0;return a.createElement(i.SchemaRenderer,{schema:{...n,...r?{specType:r}:{},type:t}})};s.displayName=o,e[o]=s}let r=({type:e,children:t,...n})=>a.createElement(i.SchemaRenderer,{schema:{type:e,...n}});return r.displayName=`Block`,e.Block=r,e}function xd(e){return{...bd(),useAdapter:i.useAdapter,useDataInvalidation:i.useDataInvalidation,data:e?.data??e?.variables??{},variables:e?.variables??{},page:e??{}}}function Sd(e,t,n=new Map){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let r=Object.getPrototypeOf(e);if(r!==Object.getPrototypeOf(t)||r!==Object.prototype&&r!==Array.prototype&&r!==null)return!1;if(n.get(e)===t)return!0;n.set(e,t);let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let r of i)if(!Object.prototype.hasOwnProperty.call(t,r)||!Sd(e[r],t[r],n))return!1;return!0}function Cd(){return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-amber-400/40 bg-amber-50 p-4 text-sm text-amber-900 dark:bg-amber-950/30 dark:text-amber-200`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`React pages are disabled on this deployment`}),(0,o.jsxs)(`p`,{className:`mt-1 leading-relaxed`,children:[(0,o.jsx)(`code`,{children:`kind:'react'`}),` pages execute author JavaScript directly in the application. This deployment has turned the capability off (`,(0,o.jsx)(`code`,{children:`OS_PAGE_REACT=off`}),` / `,(0,o.jsx)(`code`,{children:`disableCapability('react-pages')`}),`). It is ON by default; re-enable it if your page authors are trusted.`]})]})}var wd=({schema:e})=>{let n=typeof e?.source==`string`?e.source:``,r=(0,i.useAdapter)(),s=(0,t.isCapabilityEnabled)(t.CAP_REACT_PAGES),[c,l]=a.useState(null),[u,d]=a.useState(null);a.useEffect(()=>{if(!s)return;let e=!0;return import(`@object-ui/react-runtime`).then(t=>e&&l(t)).catch(t=>e&&d(t)),()=>{e=!1}},[s]);let[f,p]=a.useState(()=>({schema:e,adapter:r,scope:xd(e)})),m=f.scope;if(f.adapter!==r||!Sd(f.schema,e)){let t={schema:e,adapter:r,scope:xd(e)};p(t),m=t.scope}if(!s)return(0,o.jsx)(Cd,{});if(u)return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`Failed to load the react runtime`}),(0,o.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap`,children:String(u)})]});if(!n.trim())return(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[`A `,(0,o.jsx)(`code`,{children:`kind:'react'`}),` page requires a non-empty `,(0,o.jsx)(`code`,{children:`source`}),`.`]});if(!c)return(0,o.jsx)(`div`,{className:`m-4 text-sm text-muted-foreground`,children:`Loading react runtime…`});let{ReactRunner:h}=c;return(0,o.jsx)(i.SchemaRendererProvider,{dataSource:r,children:(0,o.jsx)(h,{code:n,scope:m,fallback:e=>(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:`React page error`}),(0,o.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap`,children:String(e)})]})})})},Td=`data-print-page`,Ed=`data-print-running`,Dd=new Set([`A4`,`A5`,`Letter`,`Legal`]),Od=new Set([`portrait`,`landscape`]),kd=[`top`,`right`,`bottom`,`left`];function Ad(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jd(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?`${e}mm`:null}function Md(e){let t=[`size: ${Dd.has(e.paperSize)?e.paperSize:`A4`} ${Od.has(e.orientation)?e.orientation:`portrait`};`],n=e.margins??{};for(let e of kd){let r=jd(n[e]);r&&t.push(`margin-${e}: ${r};`)}return e.pageNumbers===!0&&t.push(`@bottom-right { content: counter(page) " / " counter(pages); font-size: 9pt; }`),`@page { ${t.join(` `)} }`}function Nd(e,t){if(e.repeatHeader!==!0&&e.repeatFooter!==!0)return[];let n=`${t} table[${Ed}]`;return[`${t} :has(> table[${Ed}]) { display: block !important; }`,`${n} { display: table !important; width: 100%; border-collapse: collapse; }`,`${n} > thead { display: table-header-group !important; }`,`${n} > tbody { display: table-row-group !important; }`,`${n} > tfoot { display: table-footer-group !important; }`,`${n} > * > tr { display: table-row !important; }`,`${n} > * > tr > td { display: table-cell !important; padding: 0 0 4mm 0; vertical-align: top; }`,`${n} > tfoot > tr > td { padding: 4mm 0 0 0; }`]}function Pd(e){let t=`[${Td}]`,n=[Md(e),`body :not(:has(${t})):not(${t}):not(${t} *) { display: none !important; }`,`:has(${t}) { display: block !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; position: static !important; }`,`${t} { padding: 0 !important; min-height: 0 !important; }`,`${t} > div { max-width: none !important; }`,...Nd(e,t),`${t} thead:not(table[${Ed}] > thead) { display: ${e.repeatTableHeaders===!1?`table-row-group`:`table-header-group`} !important; }`];return e.avoidBreakInside===!0&&n.push(`${t} [data-region] > * { break-inside: avoid; }`),`@media print {\n ${n.join(`
18
+ `)}\n}\n`}var Fd=3,Id=6,Ld=new Map([[`element:number`,Fd],[`statistic`,Fd],[`ui:statistic`,Fd],[`object-metric`,Fd],[`plugin-dashboard:object-metric`,Fd],[`plugin-dashboard:metric`,Fd],[`plugin-dashboard:metric-card`,Fd],[`chart`,Id],[`view:chart`,Id],[`plugin-charts:chart`,Id],[`object-chart`,Id],[`plugin-charts:object-chart`,Id],[`bar-chart`,Id],[`plugin-charts:bar-chart`,Id],[`chart:bar`,Id],[`plugin-charts:chart:bar`,Id]]);function Rd(e,t=!1){return t?12:typeof e==`string`&&Ld.get(e)||12}function zd(e,t){if(t===`dashboard`)return!1;let n=typeof e==`string`?e.toLowerCase():``;return n===`sidebar`||n===`aside`&&t!==`header-sidebar-main`}var Bd={3:`col-span-12 md:col-span-6 xl:col-span-3`,6:`col-span-12 xl:col-span-6`,12:`col-span-12`},Vd=a.default.createContext(!1),Hd=({nodes:e,className:t,rail:n,keyPrefix:r=`block`,toSchema:s,attributes:c,gridRef:l})=>{let u=a.default.useContext(Vd),d=!!n||u,f=(0,o.jsx)(`div`,{ref:l,className:q(`grid grid-cols-12 gap-4`,t),...c,children:e.map((e,t)=>{let n=e,a=Rd(n?.type,d);return(0,o.jsx)(`div`,{className:q(`min-w-0 empty:hidden`,Bd[a]),"data-block-span":a,children:(0,o.jsx)(i.SchemaRenderer,{schema:s?s(e):e})},typeof n?.id==`string`&&n.id?n.id:`${r}-${t}`)})});return n&&!u?(0,o.jsx)(Vd.Provider,{value:!0,children:f}):f};function Ud(e,t){return Array.isArray(e)&&e.length>0?(0,o.jsx)(Hd,{nodes:e}):t(e)}var Wd=a.default.createContext(null),Gd=24,Kd=.5;function qd(e,t){return!(e>0)||!(t>0)?null:e<(t-Gd)/2-Kd?`compact`:`full`}function Jd(){let e=0,t=new Set;return{get:()=>e,set:n=>{n!==e&&(e=n,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}var Yd=a.createContext(null),Xd=a.createContext(null),Zd=typeof window<`u`?a.useLayoutEffect:a.useEffect;function Qd(e,t){if(t(e.getBoundingClientRect().width),typeof ResizeObserver>`u`)return()=>{};let n=new ResizeObserver(e=>{let n=e[e.length-1]?.contentRect?.width;typeof n==`number`&&t(n)});return n.observe(e),()=>n.disconnect()}function $d(e){let[t]=a.useState(Jd);return Zd(()=>{let n=e.current;if(n)return Qd(n,e=>t.set(e))},[e,t]),t}var ef=({store:e,children:t})=>(0,o.jsx)(Yd.Provider,{value:e,children:t}),tf=({regionRef:e,children:t})=>{let n=a.useContext(Yd),[r,i]=a.useState(null);return Zd(()=>{let t=e.current;if(!t||!n)return;let r=0,a=()=>i(qd(r,n.get())),o=n.subscribe(a),s=Qd(t,e=>{r=e,a()});return()=>{o(),s()}},[e,n]),(0,o.jsx)(Xd.Provider,{value:r,children:t})};function nf(){return a.useContext(Xd)}function rf(e){switch(e){case`small`:return`w-64`;case`medium`:return`w-80`;case`large`:return`w-96`;case`full`:return`w-full`;default:return e||`w-full`}}function af(e){switch(e){case`small`:return`w-full md:w-64`;case`medium`:return`w-full md:w-80`;case`large`:return`w-full md:w-96`;default:return`w-full`}}function of(e){switch(e){case`utility`:return`max-w-4xl`;case`home`:return`max-w-screen-2xl`;case`app`:return`max-w-screen-xl`;default:return`max-w-7xl`}}function sf(e,t){return e?.find(e=>e.name?.toLowerCase()===t.toLowerCase())}function cf(e,t){if(!e)return[];let n=new Set(t.map(e=>e.toLowerCase()));return e.filter(e=>!n.has(e.name?.toLowerCase()??``))}var lf=`page:header`;function uf(e){return e==null?``:typeof e==`string`?e.replace(/\{[a-zA-Z0-9_.]+\}/g,``).replace(/\s+/g,` `).trim():typeof e==`object`?Object.values(e).map(e=>uf(e)).find(e=>e!==``)??``:String(e)}function df(e){return e?.type===lf&&uf(e?.title??e?.properties?.title)!==``}function ff(e,t=0){return t>6?!1:(Array.isArray(e)?e:e?[e]:[]).some(e=>!!e&&typeof e==`object`&&(df(e)||ff(e.components,t+1)||ff(e.children,t+1)))}function pf(e){return ff((e.regions??[]).flatMap(e=>e?.components??[]))||ff(e.children)}var mf=({region:e,className:t,rail:n})=>{let r=a.default.useRef(null),s=e.components||[];return s.length===0?null:(0,o.jsx)(tf,{regionRef:r,children:(0,o.jsx)(Hd,{nodes:s,className:q(e.className,t),rail:n,keyPrefix:e.name,toSchema:e=>(0,i.toRenderableSchema)(e),attributes:{"data-region":e.name},gridRef:r})})},hf=({header:e,footer:t,children:n})=>{let r=(0,i.usePrintPage)(),a=r?.repeatHeader===!0&&!!e,s=r?.repeatFooter===!0&&!!t;if(!a&&!s)return(0,o.jsxs)(o.Fragment,{children:[e,n,t]});let c=e=>(0,o.jsx)(`tr`,{className:`contents`,children:(0,o.jsx)(`td`,{className:`contents`,children:e})});return(0,o.jsxs)(`table`,{className:`contents`,role:`presentation`,[Ed]:``,children:[a&&(0,o.jsx)(`thead`,{className:`contents`,children:c(e)}),(0,o.jsxs)(`tbody`,{className:`contents`,children:[!a&&e?c(e):null,c(n),!s&&t?c(t):null]}),s&&(0,o.jsx)(`tfoot`,{className:`contents`,children:c(t)})]})},gf=Object.keys(U.PAGE_TEMPLATE_SLOTS).map(e=>`'${e}'`).join(`, `),_f=({kind:e,title:t,items:n})=>(0,o.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,"data-page-refusal":e,children:[(0,o.jsx)(`div`,{className:`font-semibold`,children:t}),(0,o.jsx)(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-5`,children:n.map((e,t)=>(0,o.jsx)(`li`,{children:e},t))})]}),vf=({regions:e,template:t})=>{if(e.length===0)return null;let n=U.PAGE_TEMPLATE_SLOTS[t].join(`, `);return(0,o.jsx)(_f,{kind:`unplaced-region`,title:`Not drawn: the '${t}' template does not place ${e.length===1?`this region`:`these ${e.length} regions`}`,items:e.map((e,r)=>`Region '${e.name??`#${r}`}': '${t}' places only ${n}. Rename it to one of those slots, or choose the 'dashboard' template, which lays every other region out as a grid cell.`)})},yf=({schema:e})=>(0,o.jsx)(_f,{kind:`unregistered-template`,title:`Not drawn: this page's template is not registered`,items:[`Template '${String(e.template)}' is not one of ${gf}. 'full-width' was a second name for 'default'.`]}),bf=({regions:e,pageType:t,className:n,template:r})=>{let i=sf(e,`header`),a=sf(e,`sidebar`),s=sf(e,`main`),c=sf(e,`aside`),l=sf(e,`footer`),u=cf(e,[`header`,`sidebar`,`main`,`aside`,`footer`]),d=r?[]:u,f=r?u:[];return i||a||s||c||l?(0,o.jsx)(`div`,{className:q(`flex flex-col gap-6`,n),"data-page-layout":t,children:(0,o.jsx)(hf,{header:i&&(0,o.jsx)(mf,{region:i,className:q(rf(i.width))}),footer:l&&(0,o.jsx)(mf,{region:l,className:q(rf(l.width))}),children:(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[a&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,af(a.width||`small`)),children:(0,o.jsx)(mf,{region:a,rail:!0})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[s&&(0,o.jsx)(mf,{region:s}),d.map((e,t)=>(0,o.jsx)(mf,{region:e},e.name||`extra-${t}`)),r&&(0,o.jsx)(vf,{regions:f,template:r})]}),c&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,af(c.width||`small`),c.className),children:(0,o.jsx)(mf,{region:c,rail:!0})})]})})}):(0,o.jsx)(`div`,{className:q(`space-y-6`,n),"data-page-layout":t,children:r?(0,o.jsx)(vf,{regions:f,template:r}):e.map((e,t)=>(0,o.jsx)(mf,{region:e},e.name||t))})},xf=({schema:e})=>{let t=e.children,n=Array.isArray(t)?t:t?[t]:[];return n.length===0?null:(0,o.jsx)(`div`,{className:`space-y-6`,children:n.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e?.id||t))})},Sf={default:({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(bf,{regions:e.regions,pageType:e.pageType,template:`default`}):(0,o.jsx)(xf,{schema:e}),"header-sidebar-main":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(xf,{schema:e});let n=sf(t,`header`),r=sf(t,`sidebar`),i=sf(t,`main`),a=cf(t,U.PAGE_TEMPLATE_SLOTS[`header-sidebar-main`]);return(0,o.jsx)(`div`,{className:`flex flex-col gap-6`,"data-template":`header-sidebar-main`,children:(0,o.jsx)(hf,{header:n&&(0,o.jsx)(mf,{region:n}),children:(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,af(r.width||`medium`)),children:(0,o.jsx)(mf,{region:r,rail:!0})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)(mf,{region:i}),(0,o.jsx)(vf,{regions:a,template:`header-sidebar-main`})]})]})})})},"three-column":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(xf,{schema:e});let n=sf(t,`header`),r=sf(t,`sidebar`),i=sf(t,`main`),a=sf(t,`aside`),s=sf(t,`footer`),c=cf(t,U.PAGE_TEMPLATE_SLOTS[`three-column`]);return(0,o.jsx)(`div`,{className:`flex flex-col gap-6`,"data-template":`three-column`,children:(0,o.jsx)(hf,{header:n&&(0,o.jsx)(mf,{region:n}),footer:s&&(0,o.jsx)(mf,{region:s}),children:(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,af(r.width||`small`)),children:(0,o.jsx)(mf,{region:r,rail:!0})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)(mf,{region:i}),(0,o.jsx)(vf,{regions:c,template:`three-column`})]}),a&&(0,o.jsx)(`aside`,{className:q(`md:shrink-0`,af(a.width||`small`),a.className),children:(0,o.jsx)(mf,{region:a,rail:!0})})]})})})},dashboard:({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(xf,{schema:e});let n=sf(t,`header`),r=sf(t,`footer`),i=cf(t,U.PAGE_TEMPLATE_SLOTS.dashboard);return(0,o.jsx)(`div`,{className:`flex flex-col gap-6`,"data-template":`dashboard`,children:(0,o.jsx)(hf,{header:n&&(0,o.jsx)(mf,{region:n}),footer:r&&(0,o.jsx)(mf,{region:r}),children:(0,o.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:i.map((e,t)=>(0,o.jsx)(mf,{region:e},e.name||`region-${t}`))})})})}};function Cf(e){if(!e.template)return null;let t=e.template;return Object.prototype.hasOwnProperty.call(Sf,t)?Sf[t]:yf}function wf(e){return(e.kind??`full`)===`full`?`default`:void 0}var Tf=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(bf,{regions:e.regions,pageType:`record`,template:wf(e)}):(0,o.jsx)(xf,{schema:e}),Ef=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(bf,{regions:e.regions,pageType:`home`,template:wf(e)}):(0,o.jsx)(xf,{schema:e}),Df=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(bf,{regions:e.regions,pageType:`app`,template:wf(e)}):(0,o.jsx)(xf,{schema:e}),Of=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(bf,{regions:e.regions,pageType:`utility`,template:wf(e)}):(0,o.jsx)(xf,{schema:e}),kf=-1,Af=null;function jf(){let e=t.ComponentRegistry.getVersion();if(Af===null||kf!==e){let n=t.ComponentRegistry.getKnownTypes().filter(e=>!t.ComponentRegistry.deprecationFor(e,`html`)).map(e=>{let n=t.ComponentRegistry.getMeta(e);return{type:e,namespace:n?.namespace,isContainer:n?.isContainer,inputs:n?.inputs}});Af=(0,s.manifestFromConfigs)(n,{slotsFor:se.nodeSlotsFor}),kf=e}return Af}function Mf(e){if(e.code!==`forbidden-tag`||!e.tag)return e;let n=t.ComponentRegistry.deprecationFor(e.tag,`html`);if(!n)return e;let r=`${e.message}: it is deprecated on kind:'html' pages`;return{...e,message:n.replacement?`${r}. Instead, ${n.replacement}`:r}}var Nf=({schema:e,className:n,...r})=>{let c=e.pageType||`record`,[l,u]=a.default.useReducer(e=>e+1,0);a.default.useEffect(()=>t.ComponentRegistry.subscribe(u),[]);let d=e.title??e.label,{"data-obj-id":f,"data-obj-type":p,style:m}=r,h=(0,t.toDomProps)(r),g=(0,_.useDisplayLocale)(),v=(0,i.resolveInlineAriaProps)(e.aria,g),y=Ad(e.print)?e.print:null,b=y?Pd(y):null,x=a.default.useRef(null),S=$d(x),C=(0,a.useMemo)(()=>{let t=e.kind;if(t===`react`)return(0,o.jsx)(wd,{schema:e});if(t===`html`){let t=e.source??``,{tree:n,diagnostics:r}=(0,s.compile)(t,jf()),a=r.filter(e=>e.severity===`error`).map(Mf);return a.length?(0,o.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:[(0,o.jsxs)(`div`,{className:`font-semibold`,children:[`HTML page failed to compile (`,a.length,`)`]}),(0,o.jsx)(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-5`,children:a.slice(0,8).map((e,t)=>(0,o.jsx)(`li`,{children:e.message},t))})]}):n?(0,o.jsx)(i.SchemaRenderer,{schema:n}):null}let n=Cf(e);if(n)return(0,o.jsx)(n,{schema:e});switch(c){case`home`:return(0,o.jsx)(Ef,{schema:e});case`app`:return(0,o.jsx)(Df,{schema:e});case`utility`:return(0,o.jsx)(Of,{schema:e});default:return(0,o.jsx)(Tf,{schema:e})}},[e,c,l]),w=(e.regions??[]).some(e=>e.name?.toLowerCase()===`main`&&e.width===`full`),T=w?`max-w-none`:of(c),E=a.default.useMemo(()=>c===`record`||pf(e),[e,c]),D=!!d&&!E,O=!!e.description&&c!==`record`,k=O&&E,A=O&&!k,j=(0,o.jsxs)(`div`,{className:q(`min-h-full w-full bg-background p-3 md:p-4 lg:p-6`,n),"data-page-type":c,"data-obj-id":f,"data-obj-type":p,style:m,...h,...v,...y?{[Td]:``}:{},children:[b&&(0,o.jsx)(`style`,{"data-print-stylesheet":``,dangerouslySetInnerHTML:{__html:b}}),(0,o.jsxs)(`div`,{ref:x,className:q(w?`space-y-6`:`mx-auto space-y-6`,T),children:[(D||A)&&(0,o.jsxs)(`div`,{className:`space-y-2`,children:[D&&(0,o.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:d}),A&&(0,o.jsx)(`p`,{className:`text-muted-foreground`,children:e.description})]}),(0,o.jsx)(Wd.Provider,{value:k?e.description:null,children:(0,o.jsx)(ef,{store:S,children:C})})]})]}),M=y?(0,o.jsx)(i.PrintPageProvider,{value:y,children:j}):j;return e.variables&&e.variables.length>0?(0,o.jsxs)(i.PageVariablesProvider,{definitions:e.variables,children:[(0,o.jsx)(i.PageVariableActionBridge,{}),M]}):M},Pf={namespace:`ui`,label:`Page`,icon:`panels-top-left`,category:`layout`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`pageType`,type:`string`},{name:`object`,type:`string`},{name:`template`,type:`string`},{name:`regions`,type:`array`,itemType:`object`},{name:`variables`,type:`array`,itemType:`object`},{name:`children`,type:`array`,itemType:`component`}]};t.ComponentRegistry.register(`page`,Nf,Pf),t.ComponentRegistry.register(`app`,Nf,{...Pf,label:`App Page`}),t.ComponentRegistry.register(`utility`,Nf,{...Pf,label:`Utility Page`}),t.ComponentRegistry.register(`home`,Nf,{...Pf,label:`Home Page`}),t.ComponentRegistry.register(`record`,Nf,{...Pf,label:`Record Page`});var Ff=new Map,If=new Map,Lf=new Map,Rf=new Map,zf=new Set,Bf=0;function Vf(e,t,n,r){return`${e}::${r===void 0?t??``:`${t??``}#${JSON.stringify(r)}`}::${n??``}`}function Hf(){Bf+=1;for(let e of zf)e()}function Uf(e,t,n,r){return Ff.get(Vf(e,t,n,r))}function Wf(e,t,n,r,i){let a=Vf(e,t,n,i);Ff.get(a)!==r&&(Ff.set(a,r),Hf())}function Gf(e,n,r,i,a,o,s,c){let l=Vf(n,r,i,a),u={read:Promise.resolve({total:0,rows:[]}),top:s,fromRows:c};return u.read=(async()=>{let d={};if(r){if(!i)return{total:0,rows:[]};d=(0,t.composeParentScopeFilter)(r,i,o)}let f=a===void 0?d:(0,t.mergeFilterNodes)(d,a)??d;try{let t=await e(n,{$filter:f,$top:s,$count:!0}),o=typeof t?.total==`number`?t.total:Array.isArray(t?.data)?t.data.length:Array.isArray(t)?t.length:0,d=typeof o==`number`?o:0,p=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];return If.get(l)===u&&Wf(n,r,i,d,a),!c&&a===void 0&&Lf.has(l)&&If.get(l)===u&&Rf.set(l,{total:d,rows:p,top:s}),{total:d,rows:p}}finally{If.get(l)===u&&If.delete(l)}})(),u}async function Kf(e,t,n,r,i,a){let o=Vf(t,n,r,i),s=Ff.get(o);if(s!==void 0)return s;let c=If.get(o);c||(c=Gf(e,t,n,r,i,a,(i===void 0?Lf.get(o):void 0)??1,!1),If.set(o,c));try{return(await c.read).total}catch{return 0}}async function qf(e,t,n,r,i,a){let o=Vf(t,n,r),s=Rf.get(o);if(s&&s.top>=i)return Rf.delete(o),{total:s.total,rows:s.rows.slice(0,i)};let c=If.get(o);if(c&&c.top>=i){let e=await c.read;return Rf.delete(o),{total:e.total,rows:e.rows.slice(0,i)}}let l=Gf(e,t,n,r,void 0,a,i,!0);return c||If.set(o,l),l.read}function Jf(e,t,n,r){let i=Vf(e,t,n),a=Lf.get(i);(a===void 0||a<r)&&Lf.set(i,r)}function Yf(e,t,n){let r=Vf(e,t,n);Lf.delete(r),Rf.delete(r),If.get(r)?.fromRows&&If.delete(r)}function Xf(e,t){let n=!1,r=`${e}::`,i=e=>e.startsWith(r)&&(t===void 0||e.endsWith(`::${t}`));for(let e of[...Rf.keys()])i(e)&&Rf.delete(e);for(let e of[...If.keys()])i(e)&&If.delete(e);for(let e of Ff.keys())i(e)&&(Ff.delete(e),n=!0);n&&Hf()}function Zf(){Rf.clear(),If.clear(),Ff.size!==0&&(Ff.clear(),Hf())}function Qf(e){return zf.add(e),()=>{zf.delete(e)}}function $f(){return Bf}function ep(e,t,n,r){if((0,a.useSyncExternalStore)(Qf,$f,$f),e)return Uf(e,t,n,r)}function tp(){return(0,a.useSyncExternalStore)(Qf,$f,$f)}var np={get:Uf,set:Wf,fetch:Kf,fetchRows:qf,claimRows:Jf,releaseRows:Yf,invalidate:Xf,invalidateAll:Zf,_reset:()=>{Ff.clear(),If.clear(),Lf.clear(),Rf.clear(),Hf()}};(0,i.subscribeDataChanges)(e=>{e.objectName===`*`?np.invalidateAll():np.invalidate(e.objectName)});var rp=[{name:`children`,type:`slot`,description:`Child components rendered inside this container, in order`}],ip=650,ap=(0,_.createSafeTranslation)({"common.itemCount":`{{count}} items`,"common.itemCount_one":`{{count}} item`,"common.itemCount_other":`{{count}} items`},`common.itemCount`),op=e=>{let{"data-obj-id":t,"data-obj-type":n,style:r,...i}=e||{};return{designer:{"data-obj-id":t,"data-obj-type":n,style:r},rest:i}},sp=e=>e==null?``:typeof e==`string`?e:typeof e==`object`?e.default||e.value||``:String(e),cp={"zh-CN":{Details:`详情`,Related:`相关`,Activity:`活动`,History:`历史`,Notes:`备注`,Files:`文件`,Tasks:`任务`,"Open Tasks":`待办任务`,"Closed Tasks":`已完成任务`,Events:`日程`,Attachments:`附件`,Chatter:`讨论`,Discussion:`讨论`,Comments:`评论`,Overview:`概览`,Summary:`摘要`,Quotes:`报价单`,Products:`产品`,Contacts:`联系人`,Accounts:`客户`,Leads:`线索`,Opportunities:`商机`,Cases:`服务案例`,Campaigns:`营销活动`,Approvals:`审批`,Documents:`文档`,Emails:`邮件`,Calls:`通话`,Meetings:`会议`},"zh-TW":{Details:`詳情`,Related:`相關`,Activity:`活動`,History:`歷史`,Notes:`備註`,Files:`檔案`,Tasks:`任務`,"Open Tasks":`待辦任務`,"Closed Tasks":`已完成任務`,Events:`行程`,Attachments:`附件`,Chatter:`討論`,Discussion:`討論`,Comments:`評論`,Overview:`概覽`,Summary:`摘要`,Quotes:`報價單`,Products:`產品`,Contacts:`聯絡人`,Accounts:`客戶`,Leads:`線索`,Opportunities:`商機`,Cases:`服務案例`,Campaigns:`行銷活動`,Approvals:`審批`,Documents:`文件`,Emails:`郵件`,Calls:`通話`,Meetings:`會議`}},lp={Details:`detail.details`,Related:`detail.related`,Activity:`detail.activity`,History:`detail.history`,Attachments:`detail.attachments`,Approvals:`detail.approvalsPanelTitle`,Discussion:`detail.discussion`,Comments:`detail.comments`},up=(e,t,n)=>{if(!e)return e;let r=cp[t],i=t.split(`-`)[0]===`zh`?cp[`zh-CN`]:void 0,a=r||i,o=e=>{let t=a?.[e];if(t!==void 0)return t;let r=lp[e];if(r===void 0)return;let i=n(r,e);return i===e?void 0:i},s=o(e);if(s!==void 0)return s;let c=/\s*(?:&|and|和)\s*/i;if(c.test(e)){let n=e.split(c).map(e=>e.trim()).map(o);if(n.every(e=>e!==void 0)){let e=t.startsWith(`zh`)?`与`:` & `;return n.join(e)}}return e},dp=(e,t,n,r,i)=>{if(!e?.fields||!t||!n)return;let a=(Array.isArray(e.fields)?e.fields.find(e=>e?.name===r):e.fields[r])?.options;if(!Array.isArray(a))return;let o=a.find(e=>String(e?.value??e)===i);return t(n,r,i,o?.label?String(o.label):i)},fp=(e,t,n,r)=>{if(!e||typeof e!=`object`)return e;let i=e,a;for(let e of Object.keys(i)){let o=i[e];if(o==null||typeof o==`object`)continue;let s=dp(t,n,r,e,String(o));s!==void 0&&(a||={...i},a[e]=s)}return a??i},pp=(e,t,n,r,i)=>!e||typeof e!=`string`?e||``:(e.includes(`{`)?e.replace(/\{([a-zA-Z0-9_.]+)\}/g,(e,a)=>{let o=a.split(`.`).reduce((e,t)=>e==null?e:e[t],t);if(o==null||typeof o==`object`)return``;let s=String(o);if(!a.includes(`.`)){let e=dp(n,r,i,a,s);if(e!==void 0)return e}return s}):e).replace(/\s+/g,` `).trim(),mp=e=>{let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,``)}k`:String(t):String(e)},hp=(e,t=[],n=[])=>{if(!e)return t;let r=Array.isArray(e)?e:[e];for(let e of r){if(!e||typeof e!=`object`)continue;let r=e.visibleWhen===void 0?n:[...n,e];if(e.type===`record:related_list`||e.type===`record_related_list`){t.push({node:e,gates:r});continue}let i=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of i)e&&hp(e,t,r)}return t},gp=e=>{if(!e)return!1;let t=Array.isArray(e)?e:[e];for(let e of t){if(!e||typeof e!=`object`)continue;if(e.type===`record:attachments`)return!0;let t=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of t)if(e&&gp(e))return!0}return!1};t.ComponentRegistry.register(`tabs`,({schema:e,className:n,...r})=>{let{designer:s}=op(r),c=(0,_.useDisplayLocale)(),l=(0,i.resolveInlineAriaProps)(e?.aria,c),{t:u,language:d}=ap(),f=(0,_.useSafeTranslate)(),p=e?.items||[],m=e?.properties?.type||e?.tabStyle||`line`,h=(e?.position||`top`)===`left`,g=(0,i.useRecordContext)(),v=g?.recordId??void 0,y=g?.dataSource,b=(0,i.usePredicateScope)(),{variables:x}=(0,i.usePageVariables)(),S=g?.data,C=p.map(n=>n?.visibleWhen===void 0||n?.visibleWhen===null||new t.ExpressionEvaluator({...S&&typeof S==`object`?S:{},...(0,i.buildNodeEvaluationScope)(b,S,x),record:S,data:S}).evaluateCondition(n.visibleWhen,{onFault:t=>(0,i.reportUnresolvableVisibilityPredicate)(`page:tabs`,e?.id,`visibleWhen`,n.visibleWhen,t,`page-component`)})),w=C.join(`,`),T=a.default.useMemo(()=>p.filter((e,t)=>C[t]),[p,w]),E=tp(),D=g?.objectName,O=T.map(e=>e.count!==void 0&&e.count!==null&&e.count!==``?[]:hp(e.children)),k=new Map,A,j=e=>{let n=k.get(e);if(n!==void 0)return n;A??=new t.ExpressionEvaluator((0,i.buildNodeEvaluationScope)(b,S,x));let r=A.evaluateCondition(e.visibleWhen,{onFault:t=>(0,i.reportUnresolvableVisibilityPredicate)(e.type,e.id,`visibleWhen`,e.visibleWhen,t,`page-component`)});return k.set(e,r),r},M=O.map(e=>e.filter(e=>e.gates.every(j))),N=O.map((e,t)=>e.map(e=>M[t].includes(e)?`1`:`0`).join(``)).join(`|`),P=S!=null,F=a.default.useMemo(()=>{let e=new Map;return T.forEach((t,n)=>{if(t.count!==void 0&&t.count!==null&&t.count!==``||t.visibleWhen!==void 0&&!P)return;let r=M[n].filter(e=>P||e.gates.length===0).map(e=>e.node),i=[];for(let e of r){let t=e?.properties?.objectName||e?.objectName;if(!t)continue;let n=e?.properties?.relationshipField||e?.relationshipField,r=e?.properties?.filter??e?.filter;i.push({objectName:t,relationshipField:n,...r==null?{}:{filter:r}})}D&&gp(t.children)&&i.push({objectName:`sys_attachment`,relationshipField:`attachments:${D}`,attachments:!0}),i.length>0&&e.set(n,i)}),e},[T,D,N,P]),I=a.default.useMemo(()=>JSON.stringify(Array.from(F.entries())),[F]);a.default.useEffect(()=>{if(!y||typeof y.find!=`function`||F.size===0)return;let e=!1;return(async()=>{let t=new Map;if(typeof y.getObjectSchema==`function`){let e=new Set;for(let t of F.values())for(let n of t)n.attachments||e.add(n.objectName);await Promise.all(Array.from(e).map(async e=>{try{t.set(e,(await y.getObjectSchema(e))?.fields)}catch{}}))}if(!e)for(let n of F.values())for(let r of n){let n=r.attachments?(e,t)=>y.find(e,{...t,$filter:{parent_object:D,parent_id:v}}):(e,t)=>y.find(e,t);if(np.fetch(n,r.objectName,r.relationshipField,v,r.filter,r.attachments?void 0:t.get(r.objectName)).catch(()=>0),e)return}})(),()=>{e=!0}},[y,I,v,E]);let ee=e=>{let t=F.get(e);if(!t||t.length===0)return;let n=0,r=!1;for(let e of t){let t=np.get(e.objectName,e.relationshipField,v,e.filter);t!==void 0&&(n+=t,r=!0)}return r?n:void 0},L=T.map((e,t)=>({...e,value:typeof e.value==`string`&&e.value!==``?e.value:`tab-${t}`,labelStr:up((0,_.pickLocalized)(e.label,d),d,f),count:e.count!==void 0&&e.count!==null&&e.count!==``?e.count:ee(t)})),R=e?.defaultTab,z=(R&&L.some(e=>e.value===R)?R:void 0)??L[0]?.value,B=e?.onTabChange,[te,ne]=a.default.useState(z),re=(te&&L.some(e=>e.value===te)?te:void 0)??L[0]?.value??``,ie=q(h&&`flex-col h-auto items-stretch p-1`,m===`card`&&`bg-transparent gap-1`,m===`pill`&&`bg-muted rounded-full p-1 gap-1`,m===`line`&&!h&&`h-auto rounded-none bg-transparent p-0 gap-4 border-b border-border w-full justify-start`,!h&&`sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`),ae=()=>q(h&&`justify-start`,m===`card`&&`data-[state=active]:bg-background data-[state=active]:border data-[state=active]:shadow-sm rounded-md`,m===`pill`&&`rounded-full data-[state=active]:bg-background`,m===`line`&&!h&&`rounded-none border-b-2 border-transparent bg-transparent px-1 pb-2.5 -mb-px shadow-none data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:text-foreground`);return(0,o.jsxs)(da,{value:re,onValueChange:e=>{ne(e),B?.(e)},orientation:h?`vertical`:`horizontal`,className:q(n,h&&`flex gap-4 w-full`),...s,...l,children:[(L.length>1||e?.alwaysShowStrip===!0||e?.properties?.alwaysShowStrip===!0)&&(0,o.jsx)(fa,{className:ie,children:L.map(e=>(0,o.jsxs)(pa,{value:e.value,className:ae(),children:[e.icon&&(0,o.jsx)(ao,{name:e.icon,className:`mr-1.5 h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr}),e.count!==void 0&&e.count!==null&&e.count!==``&&Number(e.count)>0&&(0,o.jsx)(`span`,{className:`ml-1.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground`,"aria-label":u(`common.itemCount`,{count:Number(e.count)<1e3?Number(e.count):mp(e.count)}),children:mp(e.count)})]},e.value))}),L.map(e=>(0,o.jsx)(ma,{value:e.value,className:q(L.length>1?`mt-3`:`mt-0`,h&&`mt-0 flex-1`),children:J(e.children)},e.value))]})},{namespace:`page`,skipFallback:!0,label:`Page Tabs`,category:`layout`,isContainer:!0,inputs:[{name:`items`,type:`array`,of:`object`,required:!0,description:`Tab definitions [{ label, value?, icon?, count?, visibleWhen?, children }] — value is the stable ?tab= URL token, count auto-derives from record:related_list descendants when omitted`},{name:`tabStyle`,type:`enum`,enum:[`line`,`card`,`pill`]},{name:`position`,type:`enum`,enum:[`top`,`left`]},{name:`alwaysShowStrip`,type:`boolean`,description:`Keep the tab strip visible when only one tab survives. Default false: a lone pill is clutter rather than an affordance, so a one-tab strip is hidden and its panel renders bare. Count the tabs AFTER each item visibleWhen predicate has been evaluated — a page authored with four tabs of which three are conditional reaches this rule whenever the other three are false.`}]}),t.ComponentRegistry.register(`card`,({schema:e,className:t,...n})=>{let{designer:r}=op(n),{language:a}=(0,_.useObjectTranslation)(),s=(0,_.useDisplayLocale)(),c=(0,i.resolveInlineAriaProps)(e?.aria,s),l=(0,_.pickLocalized)(e?.title,a),u=e?.bordered!==!1,d=e?.body??e?.children,f=e?.footer;return(0,o.jsxs)(ht,{className:q(t,!u&&`border-0 shadow-none bg-transparent`),...r,...c,children:[l&&(0,o.jsx)(gt,{children:(0,o.jsx)(_t,{children:l})}),me(d,e=>(0,o.jsx)(yt,{children:Ud(e,J)})),me(f,e=>(0,o.jsx)(bt,{className:`flex justify-between`,children:J(e)}))]})},{namespace:`page`,skipFallback:!0,label:`Page Card`,category:`layout`,isContainer:!0,inputs:[{name:`title`,type:[`string`,`object`],description:`Accepts an inline translation map ({ en, "zh-CN", … })`},{name:`bordered`,type:`boolean`},{name:`children`,type:`slot`,description:`Card content components, in order (the card body slot)`},{name:`footer`,type:`slot`}]}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>{let{designer:r}=op(n),{language:a}=(0,_.useObjectTranslation)(),s=(0,_.useDisplayLocale)(),c=(0,i.resolveInlineAriaProps)(e?.aria,s),l=(0,_.useSafeTranslate)(),u=e?.items||[],d=!!e?.allowMultiple,f=(e?.variant??e?.properties?.variant??`flush`)===`flush`?`border-b last:border-b-0`:void 0,p=u.map((e,t)=>({...e,value:`panel-${t}`,labelStr:up((0,_.pickLocalized)(e.label,a),a,l)})),m=p.filter(e=>e.collapsed===!1).map(e=>e.value),h=p.map(e=>(0,o.jsxs)(Oe,{value:e.value,className:f,children:[(0,o.jsx)(ke,{className:`text-sm font-semibold tracking-tight hover:no-underline`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.icon&&(0,o.jsx)(ao,{name:e.icon,className:`h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr})]})}),(0,o.jsx)(Ae,{children:J(e.children)})]},e.value));return d?(0,o.jsx)(De,{type:`multiple`,defaultValue:m,className:t,...r,...c,children:h}):(0,o.jsx)(De,{type:`single`,collapsible:!0,defaultValue:m[0],className:t,...r,...c,children:h})},{namespace:`page`,skipFallback:!0,label:`Page Accordion`,category:`layout`,isContainer:!0,inputs:[{name:`items`,type:`array`,of:`object`,required:!0,description:`Panel definitions [{ label, icon?, collapsed?, children }] — collapsed: false opens a panel by default`},{name:`allowMultiple`,type:`boolean`},{name:`variant`,type:`enum`,enum:[`flush`,`card`]}]}),t.ComponentRegistry.register(`section`,({schema:e,className:t,...n})=>{let{designer:r}=op(n);return(0,o.jsx)(`section`,{className:q(`space-y-4`,t),...r,children:Ud(e?.children||e?.body,J)})},{namespace:`page`,skipFallback:!0,label:`Page Section`,category:`layout`,isContainer:!0,inputs:rp});var _p=new Set;function vp(e,t,n){if(!n||typeof n!=`object`||Object.keys(n).length===0)return;let r=/\brecord\.([A-Za-z_][A-Za-z0-9_]*)/g,i=[];for(let e=r.exec(t);e;e=r.exec(t))!(e[1]in n)&&!i.includes(e[1])&&i.push(e[1]);if(i.length===0)return;let a=`missing::${String(e)}::${t}`;_p.has(a)||(_p.add(a),console.warn(`[page:header] action "${String(e)}" predicate references record field(s) not present in the record payload: ${i.join(`, `)}. Predicate: ${t}. This page bound a record payload that does not carry those key(s) — a projected or partial read ($select, an embedded card, a custom page passing a projected record) will not include them — so the predicate fails closed and the action stays hidden.`))}var yp=new Set;function bp(e,t,n,r){let i=`${t??``}::${e}::${n}`;if(yp.has(i))return;yp.add(i);let a=n===`no-object`?"this header is not bound to an object (no RecordContext `objectName`), so ids cannot be resolved at all":n===`no-metadata`?`no metadata could be read for object "${String(t)}" (no MetadataProvider in scope, or the object does not exist)`:`object "${String(t)}" declares no action by that name. Declared: ${r.length>0?r.join(`, `):`(none)`}`;console.warn(`[page:header] action id "${e}" did not resolve — ${a}. Nothing is rendered for it. \`PageHeaderProps.actions\` is a list of ACTION IDS (@objectstack/spec: \`z.array(z.string())\`, "Action IDs to show in header"), resolved against the object's own \`actions\` metadata the same way \`record:quick_actions\` resolves them.`)}var xp=new Set;function Sp(e,t){let n=`${e??``}::${t.index}::${t.message}`;xp.has(n)||(xp.add(n),console.error(`[page:header] actions refused at index ${t.index} — ${t.message}. None of the authored actions is rendered. \`PageHeaderProps.actions\` is a list of ACTION IDS (@objectstack/spec: \`z.array(z.string())\`); an inline action object is a transition tolerance that must not share an array with ids.`))}var Cp=`/api/v1/storage/files/`;function wp(e){for(let t of Array.isArray(e)?e:[e]){if(typeof t==`string`){if(!t)continue;return(0,oe.isFileIdToken)(t)?`${Cp}${encodeURIComponent(t)}`:t}if(typeof t==`object`&&t){let e=t.url;if(typeof e==`string`&&e)return e}}}var Tp=({actions:e,maxVisible:n,mobileMaxVisible:r,emptySlot:s=null})=>{let c=(0,i.useRecordContext)(),u=!!(0,i.useInlineEdit)()?.editing,d=(0,i.usePredicateScope)(),{execute:f}=(0,i.useAction)(),p=(0,i.useCapabilityGate)(),m=mi(),h=(0,i.useActionTextLocalizer)(),g=a.default.useId(),v=(0,_.useSafeTranslate)(),y=c?.objectSchema,b=c?.objectName||y?.name,x=c?.headerSystemActions,S=a.default.useMemo(()=>Array.isArray(e)?e:[],[e]),C=a.default.useMemo(()=>(0,se.resolveDeclaredActionIds)(S,void 0),[S]),w=C.kind===`ids`&&C.ids.length>0&&!!b,{item:T,loading:E}=(0,i.useMetadataItem)(`object`,w?b:null),D=a.default.useMemo(()=>{let e=Array.isArray(T?.actions)?T.actions:[],t=(0,se.resolveDeclaredActionIds)(S,e);if(t.kind===`refused`)return Sp(b,t),[];if(t.kind===`ids`&&(!w||!E)){let n=Array.from(new Set(e.map(e=>typeof e?.name==`string`?e.name:``).filter(e=>e!==``)));for(let{id:e}of t.unresolved)bp(e,b,b?T?`not-found`:`no-metadata`:`no-object`,n)}return t.actions},[S,T,E,w,b]),O=y?.fields,k=a.default.useMemo(()=>{let e=d?.user,n=(0,t.toPredicateRecord)(c?.data,O);return{...d&&typeof d==`object`?d:{},user:e,os:d?.os??{user:e},ctx:{user:e,record:n,data:n,app:d?.app,features:d?.features}}},[d,c?.data,O]),A=a.default.useCallback((e,n,r)=>(0,t.evalRowPredicate)(e,c?.data??{},{fallback:r,scope:k,fields:O,warnOnError:!0,label:n}),[c?.data,k,O]),j=a.default.useMemo(()=>{let e=c?.data,t=t=>{if(!p(t?.requiredPermissions))return!1;let n=t?.visible;if(n!=null){if(typeof n==`boolean`){if(!n)return!1}else{let r=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.source==`string`?n.source:null;if(r&&(vp(t?.name,r,e),!A(n,`page:header action "${String(t?.name)}" visible`,!1)))return!1}}let r=t?.hidden;if(r!=null){if(typeof r==`boolean`){if(r)return!1}else{let n=typeof r==`string`?r:r&&typeof r==`object`&&typeof r.source==`string`?r.source:null;if(n&&(vp(t?.name,n,e),A(r,`page:header action "${String(t?.name)}" hidden`,!1)))return!1}}return!0},n=e=>(0,se.actionRendersAt)(e,`record_header`)||(0,se.actionRendersAt)(e,`record_more`),r=D.filter(e=>n(e)&&t(e)),i=Array.isArray(x)?x.filter(t):[],a=new Set,o=[];for(let e of[...r,...i]){let t=e?.name||e?.id||``;t&&a.has(t)||(t&&a.add(t),o.push(e))}let s=new Set(r.map(e=>e?.name||e?.id||``).filter(e=>e!==``));return o.some(e=>e?.order!==void 0||e?.variant===`primary`)?{actions:[...o].sort((e,t)=>{let n=(e?.order??0)-(t?.order??0);return n===0?(e?.variant===`primary`?0:1)-(t?.variant===`primary`?0:1):n}),authoredKeys:s}:{actions:o,authoredKeys:s}},[D,x,c?.data,A]),M=j.actions,N=j.authoredKeys,P=a.default.useMemo(()=>M.map((e,t)=>h(c?.objectName,e,{fallbackLabel:typeof e?.id==`string`&&e.id||`Action ${t+1}`})),[M,h,c?.objectName]),F=c?.data,I=a.default.useCallback(e=>{let{params:t,...n}=e??{},r=Array.isArray(t)?void 0:So({...n,params:t},n.type||n.actionType,`page:header`);if(!F||typeof F!=`object`){f(t!=null&&!Array.isArray(t)&&r===void 0?n:e);return}let i={...n};Array.isArray(t)?(!i.actionParams&&t.length>0&&(i.actionParams=t),i.params={_rowRecord:F}):i.params={...r||{},_rowRecord:F},f(i)},[F,f]);return(0,o.jsx)(o.Fragment,{children:(()=>{if(P.length===0)return null;let e=e=>e?.label??``,t=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:void 0,i=m?t(r)??1:t(n)??3,s=e=>Array.isArray(e?.locations)&&e.locations.length>0&&e.locations.includes(`record_more`)&&!e.locations.includes(`record_header`),c=P.filter(s),d=P.filter(e=>!s(e)&&e?.component===`action:menu`),f=P.filter(e=>!s(e)&&e?.component!==`action:menu`),p=e=>e?.variant===`danger`||e?.name===`sys_delete`,h=e=>{let t=e?.name||e?.id||``;return t!==``&&!N.has(t)},_=e=>h(e)&&!p(e),y=f.filter(e=>!h(e)||_(e)).filter(e=>!p(e)),b=y.findIndex(e=>e?.variant===`primary`),x=y[b>=0?b:0],S=x?[x,...f.filter(e=>e!==x)]:f,C=S.filter(e=>!h(e)),w=new Set(C.slice(0,i)),T=S.filter(e=>_(e)||w.has(e)),E=[...C.slice(i),...S.filter(e=>h(e)&&!_(e)),...d,...c],D=[...E.filter(e=>!p(e)&&!h(e)),...E.filter(e=>!p(e)&&h(e)),...E.filter(p)],O=D.findIndex(p),k=D.length>0,j=(e,t)=>e==null?!1:typeof e==`boolean`?e:(typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`&&e.source)?A(e,`page:header action "${String(t)}" disabled`,!0):!1,M=e=>u&&e?.disableDuringInlineEdit===!0||j(e?.disabled,e?.name??e?.id),F=e=>{let t=e?.name||e?.id||``;if(t!==``&&N.has(t)&&j(e?.disabled,e?.name??e?.id))return v(`actions.notAvailableForRecord`,`Not available for this record`)};return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 shrink-0`,role:`toolbar`,"aria-label":v(`detail.pageHeaderActions`,`Page header actions`),children:[T.map((t,n)=>{let r=e(t),i=t===x?`default`:p(t)?`destructive`:`outline`,a=t.size||`sm`,s=M(t),c=typeof t.icon==`string`?t.icon:null,l=t.name||t.id||`header-action-${n}`,u=F(t),d=`${g}-reason-${n}`,f=(0,o.jsxs)(Y,{variant:i,size:a,disabled:s,"aria-describedby":u?d:void 0,className:`gap-2`,onClick:()=>{if(typeof t.onClick==`function`){t.onClick();return}I(t)},children:[c&&(0,o.jsx)(ao,{name:c,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},l);return u?(0,o.jsx)(gi,{delayDuration:200,children:(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:(0,o.jsxs)(`span`,{tabIndex:0,"aria-describedby":d,"data-disabled-reason":``,className:`inline-flex rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:[f,(0,o.jsx)(`span`,{id:d,className:`sr-only`,children:u})]})}),(0,o.jsx)(yi,{children:u})]})},l):f}),k&&(0,o.jsxs)(Tn,{children:[(0,o.jsx)(En,{asChild:!0,children:(0,o.jsx)(Y,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,"aria-label":v(`detail.moreActions`,`More actions`),children:(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsx)(Nn,{align:`end`,className:`w-44`,children:D.map((t,n)=>{let r=e(t),i=M(t),s=typeof t.icon==`string`?t.icon:null,c=p(t),l=F(t),u=`${g}-more-label-${n}`,d=`${g}-more-reason-${n}`,f=t.name||t.id||`overflow-action-${n}`;return(0,o.jsxs)(a.default.Fragment,{children:[n===O&&n>0&&(0,o.jsx)(Rn,{}),(0,o.jsxs)(Pn,{disabled:i,"aria-labelledby":l?u:void 0,"aria-describedby":l?d:void 0,onSelect:e=>{if(e.preventDefault(),typeof t.onClick==`function`){t.onClick();return}I(t)},className:q(`gap-2`,c&&`text-destructive focus:text-destructive focus:bg-destructive/10`),children:[s&&(0,o.jsx)(ao,{name:s,className:`h-4 w-4`}),l?(0,o.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,o.jsx)(`span`,{id:u,children:r}),(0,o.jsx)(`span`,{id:d,className:`text-xs text-muted-foreground`,children:l})]}):(0,o.jsx)(`span`,{children:r})]})]},f)})})]})]})})()??s})};t.ComponentRegistry.register(`header`,({schema:e,className:n,...r})=>{let{designer:s}=op(r),c=(0,_.useDisplayLocale)(),u=(0,i.resolveInlineAriaProps)(e?.aria,c),d=(0,i.useRecordContext)(),{objectLabel:f}=(0,_.useObjectLabel)(),{fieldOptionLabel:p}=(0,_.useSafeFieldLabel)(),{language:m}=(0,_.useObjectTranslation)(),h=(0,_.useSafeTranslate)(),g=d?.refresh,[v,y]=a.default.useState(!1),b=a.default.useRef(void 0);a.default.useEffect(()=>()=>clearTimeout(b.current),[]);let x=a.default.useCallback(()=>{g&&(g(),y(!0),clearTimeout(b.current),b.current=setTimeout(()=>y(!1),ip))},[g]),S=e?.title??e?.properties?.title,C=e?.subtitle??e?.properties?.subtitle,w=a.default.useContext(Wd),T=d?.objectSchema,E=d?.objectName||T?.name,D=pp((0,_.pickLocalized)(S,m),d?.data,T,p,E),O=pp((0,_.pickLocalized)(C,m),d?.data,T,p,E),k=e?.recordChrome===!1||e?.properties?.recordChrome===!1,A=e?.showCopyId!==!1&&e?.properties?.showCopyId!==!1,j=e?.actions??e?.properties?.actions,M=()=>{if(!g)return null;let e=h(`common.refresh`,`Refresh`);return(0,o.jsx)(gi,{children:(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:(0,o.jsx)(Y,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,onClick:x,"aria-label":e,"data-page-refresh":!0,children:(0,o.jsx)(l.RefreshCw,{className:q(`h-4 w-4`,v&&`animate-spin`)})})}),(0,o.jsx)(yi,{children:e})]})})},N=t=>{let n=(0,o.jsx)(Tp,{actions:j,maxVisible:e?.maxVisible??e?.properties?.maxVisible,mobileMaxVisible:e?.mobileMaxVisible??e?.properties?.mobileMaxVisible,emptySlot:t}),r=M();return r?(0,o.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[n,r]}):n};if(d?.data&&d?.objectSchema&&!k){let e=d.data,r=d.objectSchema,i=d.objectName||r?.name,a=sp(r?.label)||r?.name||d.objectName||``,c=i?f({name:i,label:a}):a||void 0,l=fp(e,r,p,i),m=(0,t.formatTitleTemplate)(r?.titleFormat,l),h=e?.id??e?._id,g=e=>e===`Untitled`||h!=null&&e===`Record #${h}`,_=(()=>{let n=(0,t.getRecordDisplayName)(r,e,{deriveFromRecordKeys:!1});return g(n)?``:n})(),v=(()=>{if(_||(0,t.resolveNameField)(r))return``;let n=(0,t.getRecordDisplayName)(r,e);return g(n)?``:n})(),y=(c&&e?.id?`${c} ${String(e.id).slice(0,8)}`:``)||c||``,b=(()=>{let e=(0,t.recordDisplayValueAt)(l,(0,t.declaredNameField)(r));return e&&!g(e)?e:``})(),x=D||b||m||_||v,S=(typeof x==`string`?x.trim()?x:``:(0,t.recordDisplayValueAt)({value:x},`value`)??``)||y,C=r?.imageField,T=typeof C==`string`&&C?wp(e?.[C]):void 0,E=T!==void 0&&r?.fields?.[C]?.type===`avatar`,k=T?(0,o.jsx)(qe,{"data-record-picture":``,className:q(`h-8 w-8`,E?`rounded-full`:`rounded-md`),children:(0,o.jsx)(Je,{src:T,alt:``,className:E?`object-cover`:`object-contain`})}):void 0;return(0,o.jsxs)(`header`,{className:q(`flex flex-col sm:flex-row sm:flex-wrap items-start sm:items-center justify-between gap-3 sm:gap-4 pb-4 border-b`,n),...s,...u,children:[(0,o.jsxs)(`div`,{className:`flex flex-col min-w-0 sm:min-w-48 flex-1`,children:[(0,o.jsx)(Ju,{title:S,icon:k,objectLabel:c,resourceId:e?.id?String(e.id):void 0,showCopyId:A,isFavorite:d?.isFavorite,onToggleFavorite:d?.onToggleFavorite?()=>d.onToggleFavorite?.():void 0}),O&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:O}),D&&w&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,"data-page-description":``,children:w})]}),N((0,o.jsx)(`div`,{"data-page-actions-slot":!0,className:`shrink-0`}))]})}return(0,o.jsx)(`header`,{className:q(`flex flex-col gap-2 pb-4 border-b`,n),...s,...u,children:(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[D&&(0,o.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:D}),O&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:O}),D&&w&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-page-description":``,children:w})]}),N((0,o.jsx)(`div`,{"data-page-actions-slot":!0}))]})})},{namespace:`page`,skipFallback:!0,label:`Page Header`,category:`layout`,inputs:[{name:`title`,type:[`string`,`object`],description:`Supports {field} interpolation and inline translation maps; falls back to the record title`},{name:`subtitle`,type:[`string`,`object`],description:`Same interpolation as Title`},{name:`actions`,type:`array`,of:`string`,description:`Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_header nor record_more in its locations renders nowhere.`},{name:`recordChrome`,type:`boolean`,description:`Set false for the bare h1 header on non-record pages`},{name:`showCopyId`,type:`boolean`},{name:`maxVisible`,type:`number`,description:`How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer — the contract rejects 0 and fractional values. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator.`},{name:`mobileMaxVisible`,type:`number`,description:`The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1; the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged.`}]}),t.ComponentRegistry.register(`footer`,({schema:e,className:t,...n})=>{let{designer:r}=op(n);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ti,{className:`my-4`}),(0,o.jsx)(`footer`,{className:q(`flex items-center justify-between text-sm text-muted-foreground`,t),...r,children:J(e?.children||e?.body)})]})},{namespace:`page`,skipFallback:!0,label:`Page Footer`,category:`layout`,isContainer:!0,inputs:rp}),t.ComponentRegistry.register(`sidebar`,({schema:e,className:t,...n})=>{let{designer:r}=op(n);return(0,o.jsx)(`aside`,{className:q(`flex flex-col gap-4 w-full md:w-80 shrink-0`,t),...r,children:J(e?.children||e?.body)})},{namespace:`page`,skipFallback:!0,label:`Page Sidebar`,category:`layout`,isContainer:!0,inputs:rp}),[`aside`,`main`,`header`,`nav`,`footer`,`section`,`article`].forEach(e=>{let n=(0,a.forwardRef)(({schema:t,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=r;return(0,o.jsx)(e,{ref:i,className:n,...l,"data-obj-id":a,"data-obj-type":s,style:c,children:J(t.children)})});n.displayName=`Semantic${e.charAt(0).toUpperCase()+e.slice(1)}`,t.ComponentRegistry.register(e,n,{namespace:`ui`,label:e.charAt(0).toUpperCase()+e.slice(1),category:`layout`,isContainer:!0,inputs:[{name:`className`,type:`string`},{name:`children`,type:`slot`}]})}),t.ComponentRegistry.register(`aspect-ratio`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Ke,{ratio:e.ratio||16/9,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.image?(0,o.jsx)(`img`,{src:e.image,alt:e.alt||``,loading:`lazy`,className:`rounded-md object-cover w-full h-full`}):J(e.children)})},{namespace:`ui`,label:`Aspect Ratio`,isContainer:!0,inputs:[{name:`ratio`,type:`number`},{name:`image`,type:`string`},{name:`alt`,type:`string`},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Content rendered inside the ratio box when no `image` is set"}],defaultProps:{ratio:16/9}});var Ep={name:`children`,type:`slot`};function Dp(e){if(e===!1)return`none`;if(e!==!0&&e!==void 0)return e}function Op({schema:e,collapsible:t,...n}){let r=Oi(),i=Dp(t),a=(0,o.jsx)(Ai,{...n,...i===void 0?{}:{collapsible:i},children:J(e.children)});return r?a:(0,o.jsx)(ki,{className:`min-h-0`,children:a})}t.ComponentRegistry.register(`sidebar`,Op,{namespace:`ui`,label:`Sidebar`,inputs:[{name:`collapsible`,type:`boolean`,description:"`false` draws the sidebar in the page flow, not collapsible; `true` or omitted keeps the collapsible app-region form."},{name:`side`,type:`enum`,enum:[`left`,`right`]},{name:`variant`,type:`enum`,enum:[`sidebar`,`floating`,`inset`]},Ep],defaultProps:{side:`left`,variant:`sidebar`}});var kp=`flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b px-3 sm:px-4`;function Ap({crumb:e,isLast:t}){let n=(0,i.resolveKeyedI18nLabel)(e.label)??``;return e.siblings&&e.siblings.length>0?(0,o.jsxs)(Tn,{children:[(0,o.jsxs)(En,{className:`flex items-center gap-1`,children:[t?(0,o.jsx)(`span`,{className:`font-semibold`,children:n}):(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(l.ChevronDown,{className:`h-3 w-3`})]}),(0,o.jsx)(Nn,{align:`start`,children:e.siblings.map((e,t)=>(0,o.jsx)(Pn,{asChild:!0,children:(0,o.jsx)(`a`,{href:e.href,children:e.label})},t))})]}):t?(0,o.jsx)(tt,{children:n}):(0,o.jsx)(et,{href:e.href||`#`,children:n})}t.ComponentRegistry.register(`header-bar`,({schema:e,className:n,style:r,...s})=>(0,o.jsxs)(`header`,{...(0,t.toDomProps)(s),className:q(kp,e.className),style:r,children:[(0,o.jsx)(ji,{}),(0,o.jsx)(ti,{orientation:`vertical`,className:`mr-2 h-4`}),(0,o.jsx)(Ze,{children:(0,o.jsx)(Qe,{children:e.crumbs?.map((t,n)=>{let r=Ga(t.icon);return(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsxs)($e,{children:[r&&(0,o.jsx)(r,{className:`h-4 w-4`}),(0,o.jsx)(Ap,{crumb:t,isLast:n===e.crumbs.length-1})]}),n<e.crumbs.length-1&&(0,o.jsx)(nt,{})]},n)})})}),(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[e.search?.enabled&&(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(l.Search,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(Q,{type:`search`,placeholder:e.search.placeholder,className:`pl-8 w-[200px] lg:w-[300px]`}),e.search.shortcut&&(0,o.jsx)(`kbd`,{className:`pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex`,children:e.search.shortcut})]}),e.actions?.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e)},t)),e.rightContent?(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.rightContent)}):null]})]}),{namespace:`ui`,label:`Header Bar`,inputs:[{name:`crumbs`,type:`array`},{name:`search`,type:`object`},{name:`actions`,type:`array`},{name:`rightContent`,type:`object`}],defaultProps:{crumbs:[{label:`Home`,href:`#`},{label:`Current Page`}]}}),t.ComponentRegistry.register(`badge`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Xe,{variant:e.variant,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.label||J(e.children)})},{namespace:`ui`,label:`Badge`,inputs:[{name:`label`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich label content, rendered when `label` is not set"}],defaultProps:{label:`Badge`,variant:`default`}}),t.ComponentRegistry.register(`avatar`,({schema:e,className:t,...n})=>(0,o.jsxs)(qe,{className:t,...n,children:[(0,o.jsx)(Je,{src:e.src,alt:e.alt}),(0,o.jsx)(Z,{children:e.fallback})]}),{namespace:`ui`,label:`Avatar`,inputs:[{name:`src`,type:`string`},{name:`alt`,type:`string`},{name:`fallback`,type:`string`},{name:`className`,type:`string`}],defaultProps:{fallback:`CN`,alt:`Avatar`}}),t.ComponentRegistry.register(`alert`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ue,{variant:e.variant,className:t,...n,children:[(0,o.jsx)(We,{children:e.title}),(0,o.jsx)(Ge,{children:e.description||J(e.children)})]}),{namespace:`ui`,label:`Alert`,inputs:[{name:`title`,type:`string`,required:!0},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`destructive`]},{name:`className`,type:`string`},{name:`children`,type:`slot`,description:"Rich description content, rendered when `description` is not set"}],defaultProps:{title:`Alert Title`,description:`This is an alert message.`,variant:`default`}}),t.ComponentRegistry.register(`list`,({schema:e,className:t,...n})=>{let r=(0,i.useDataScope)(e.bind),a=Array.isArray(r)?r:Array.isArray(e.items)?e.items:[],s=e.ordered?`ol`:`ul`,c=e.ordered?`list-decimal`:`list-disc`;return(0,o.jsxs)(`div`,{className:q(`space-y-2`,e.wrapperClass),children:[e.title&&(0,o.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),(0,o.jsx)(s,{className:q(`ml-6 [&>li]:mt-2`,c,t),...n,children:a.map((e,t)=>(0,o.jsx)(`li`,{className:q(typeof e==`object`&&e.className),children:typeof e==`string`?e:J(e.content)},t))})]})},{namespace:`ui`,label:`List`,inputs:[{name:`title`,type:`string`},{name:`ordered`,type:`boolean`},{name:`items`,type:`array`,description:`Array of strings or objects with content`},{name:`className`,type:`string`}],defaultProps:{ordered:!1,items:[`First item`,`Second item`,`Third item`],className:`text-sm`}});var jp=({node:e,onNodeClick:t})=>{let[n,r]=(0,a.useState)(!1),i=e.children&&e.children.length>0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsxs)(`div`,{className:q(`group flex items-center py-1.5 px-2 rounded-sm cursor-pointer transition-colors`,`hover:bg-accent hover:text-accent-foreground`,n&&i&&`bg-accent/50`),onClick:()=>{t&&t(e)},children:[i?(0,o.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(!n)},className:`mr-2 p-0.5 h-5 w-5 flex items-center justify-center rounded-sm hover:bg-muted text-muted-foreground transition-colors`,children:n?(0,o.jsx)(l.ChevronDown,{className:`h-4 w-4`}):(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})}):(0,o.jsx)(`span`,{className:`mr-2 w-5 flex justify-center`,children:(0,o.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-muted-foreground/50`})}),e.icon===`folder`||i?n?(0,o.jsx)(l.FolderOpen,{className:`h-4 w-4 mr-2 text-primary`}):(0,o.jsx)(l.Folder,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}):(0,o.jsx)(l.File,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}),(0,o.jsx)(`span`,{className:q(`text-sm transition-colors`,n?`font-medium text-foreground`:`text-muted-foreground group-hover:text-foreground`),children:e.label})]}),i&&n&&(0,o.jsx)(`div`,{className:`relative ml-[11px] pl-3 border-l border-border animate-in slide-in-from-left-2 fade-in duration-200`,children:e.children.map(e=>(0,o.jsx)(jp,{node:e,onNodeClick:t},e.id))})]})};t.ComponentRegistry.register(`tree-view`,({schema:e,className:t,...n})=>{let r=t=>{e.onNodeClick&&e.onNodeClick(t)},a=(0,i.useDataScope)(e.bind)||e.nodes||[],s=Array.isArray(a)?a:[];return(0,o.jsxs)(`div`,{className:q(`relative border rounded-lg p-3 bg-card text-card-foreground`,t),...n,children:[e.title&&(0,o.jsx)(`div`,{className:`flex items-center gap-2 mb-3 pb-2 border-b`,children:(0,o.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title})}),(0,o.jsx)(`div`,{className:`space-y-1`,children:s.map(e=>(0,o.jsx)(jp,{node:e,onNodeClick:r},e.id))})]})},{namespace:`ui`,label:`Tree View`,inputs:[{name:`title`,type:`string`},{name:`nodes`,type:`array`,description:`Array of { id, label, icon, children, data }`},{name:`className`,type:`string`}],defaultProps:{title:`File Explorer`,nodes:[{id:`1`,label:`Documents`,icon:`folder`,children:[{id:`1-1`,label:`Resume.pdf`,icon:`file`},{id:`1-2`,label:`Cover Letter.docx`,icon:`file`}]},{id:`2`,label:`Photos`,icon:`folder`,children:[{id:`2-1`,label:`Vacation`,icon:`folder`,children:[{id:`2-1-1`,label:`Beach.jpg`,icon:`file`}]},{id:`2-2`,label:`Family.jpg`,icon:`file`}]},{id:`3`,label:`README.md`,icon:`file`}]}});var Mp=e=>e?io(e):null;t.ComponentRegistry.register(`statistic`,({schema:e})=>{let t=e.icon?Mp(e.icon):null;return(0,o.jsxs)(`div`,{className:q(`group relative flex flex-col p-4 sm:p-5 md:p-6 rounded-xl border bg-card text-card-foreground shadow-sm`,e.className),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[e.label&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),t&&(0,o.jsx)(t,{className:`h-4 w-4 text-muted-foreground`})]}),(0,o.jsx)(`div`,{className:`flex items-baseline gap-2`,children:(0,o.jsx)(`h3`,{className:`text-2xl font-bold tracking-tight`,children:e.value})}),(e.trend||e.description)&&(0,o.jsxs)(`div`,{className:`mt-1 flex items-center text-xs text-muted-foreground`,children:[e.trend===`up`&&(0,o.jsx)(l.TrendingUp,{className:`mr-1 h-3 w-3 text-emerald-500`}),e.trend===`down`&&(0,o.jsx)(l.TrendingDown,{className:`mr-1 h-3 w-3 text-rose-500`}),e.trend===`neutral`&&(0,o.jsx)(l.Minus,{className:`mr-1 h-3 w-3`}),(0,o.jsx)(`span`,{className:q(e.trend===`up`&&`text-emerald-500 font-medium`,e.trend===`down`&&`text-rose-500 font-medium`),children:e.description})]})]})},{namespace:`ui`,label:`Statistic`,category:`data-display`,icon:`Activity`,inputs:[{name:`label`,type:`string`},{name:`value`,type:`string`},{name:`description`,type:`string`},{name:`trend`,type:`enum`,enum:[{label:`Up`,value:`up`},{label:`Down`,value:`down`},{label:`Neutral`,value:`neutral`}]}],defaultProps:{label:`Total Revenue`,value:`$45,231.89`,trend:`up`,description:`+20.1% from last month`}});var Np=`/`;function Pp(e,t){let n=e.map(e=>({kind:`item`,item:e}));if(typeof t!=`number`||!Number.isFinite(t))return n;let r=Math.floor(t);if(r<1||e.length<=r)return n;let i=Math.min(1,r-1),a=r-i;return[...e.slice(0,i).map(e=>({kind:`item`,item:e})),{kind:`ellipsis`},...e.slice(e.length-a).map(e=>({kind:`item`,item:e}))]}t.ComponentRegistry.register(`breadcrumb`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,...s}=t,c=e.separator??Np,l=Pp(e.items??[],e.maxItems);return(0,o.jsx)(Ze,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:a,children:(0,o.jsx)(Qe,{children:l.map((e,t)=>{let n=t===l.length-1,r=!n&&(0,o.jsx)(nt,{children:c});if(e.kind===`ellipsis`)return(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsx)($e,{children:(0,o.jsx)(rt,{})}),r]},t);let a=e.item,s=Ga(a.icon);return(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsxs)($e,{children:[s&&(0,o.jsx)(s,{className:`h-4 w-4`}),n?(0,o.jsx)(tt,{children:(0,i.resolveKeyedI18nLabel)(a.label)??``}):(0,o.jsx)(et,{href:a.href,children:(0,i.resolveKeyedI18nLabel)(a.label)??``})]}),r]},t)})})})},{namespace:`ui`,label:`Breadcrumb`,inputs:[{name:`className`,type:`string`},{name:`separator`,type:`string`},{name:`maxItems`,type:`number`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`Products`,href:`/products`},{label:`Product`}]}}),t.ComponentRegistry.register(`kbd`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t,s=Array.isArray(e.keys)?e.keys:[e.keys||e.label||`K`];return(0,o.jsx)(`div`,{className:q(`inline-flex flex-wrap gap-1`,e.className),children:s.map((e,t)=>(0,o.jsx)(`kbd`,{className:`pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100`,...a,...t===0?{"data-obj-id":n,"data-obj-type":r,style:i}:{},children:e},t))})},{namespace:`ui`,label:`Keyboard Key`,inputs:[{name:`label`,type:`string`},{name:`className`,type:`string`}],defaultProps:{label:`K`}}),t.ComponentRegistry.register(`progress`,({schema:e,className:t,...n})=>(0,o.jsx)(Br,{value:e.value,className:t,...n}),{namespace:`ui`,label:`Progress`,inputs:[{name:`value`,type:`number`},{name:`className`,type:`string`}],defaultProps:{value:50,className:`w-full`}}),t.ComponentRegistry.register(`skeleton`,({schema:e,className:t,...n})=>(0,o.jsx)($,{className:t,...n,style:{width:e.width,height:e.height}}),{namespace:`ui`,label:`Skeleton`,inputs:[{name:`width`,type:`string`},{name:`height`,type:`string`},{name:`className`,type:`string`}],defaultProps:{width:`100%`,height:`20px`,className:`rounded-md`}});var Fp={top_left:`top-left`,top_center:`top-center`,top_right:`top-right`,bottom_left:`bottom-left`,bottom_center:`bottom-center`,bottom_right:`bottom-right`,"top-left":`top-left`,"top-center":`top-center`,"top-right":`top-right`,"bottom-left":`bottom-left`,"bottom-center":`bottom-center`,"bottom-right":`bottom-right`};t.ComponentRegistry.register(`toaster`,({schema:e})=>{let t=e?.position?Fp[e.position]:void 0,n=typeof e?.limit==`number`&&e.limit>0?e.limit:void 0;return(0,o.jsx)(ta,{...t?{position:t}:{},...n?{visibleToasts:n}:{}})},{namespace:`ui`,label:`Toaster`,inputs:[{name:`position`,type:`enum`,enum:[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`]},{name:`limit`,type:`number`}],defaultProps:{}}),t.ComponentRegistry.register(`loading`,({schema:e,className:t,...n})=>{let r=e.size||`md`,i=e.fullscreen||!1,a=(0,o.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center gap-2`,t),children:[(0,o.jsx)(Ru,{className:q(r===`sm`&&`h-4 w-4`,r===`md`&&`h-8 w-8`,r===`lg`&&`h-12 w-12`,r===`xl`&&`h-16 w-16`)}),e.label&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.label})]});return i?(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,...n,children:a}):(0,o.jsx)(`div`,{className:`flex items-center justify-center p-8`,...n,children:a})},{namespace:`ui`,label:`Loading`,inputs:[{name:`label`,type:`string`},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`]},{name:`fullscreen`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{label:`Loading...`,size:`md`,fullscreen:!1}}),t.ComponentRegistry.register(`toast`,({schema:e})=>(0,o.jsx)(Y,{onClick:()=>{(e.variant===`success`?B.toast.success:e.variant===`error`?B.toast.error:e.variant===`warning`?B.toast.warning:e.variant===`info`?B.toast.info:B.toast)(e.title||`Notification`,{description:e.description,duration:e.duration})},variant:e.buttonVariant,className:e.className,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Toast`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`warning`,`error`,`info`]},{name:`duration`,type:`number`},{name:`buttonLabel`,type:`string`},{name:`buttonVariant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],description:"Variant for the trigger button this node renders. Exactly the six keys of the Button variant group: `cva` contributes no variant class for any other value, so an out-of-set value renders a button with no background and no text colour, while an empty string silently renders the default look."},{name:`className`,type:`string`}],defaultProps:{title:`Notification`,buttonLabel:`Show Toast`,variant:`default`,duration:5e3}}),t.ComponentRegistry.register(`spinner`,({schema:e,className:n,...r})=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=r;return(0,o.jsx)(l.Loader2,{className:q(`animate-spin`,{sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`,xl:`h-12 w-12`}[e.size||`md`],e.className,n),...(0,t.toDomProps)(c),"data-obj-id":i,"data-obj-type":a,style:s})},{namespace:`ui`,label:`Spinner`,inputs:[{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`]},{name:`className`,type:`string`}],defaultProps:{size:`md`}}),t.ComponentRegistry.register(`empty`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,action:s,icon:c,...l}=t,u=e.action==null?void 0:(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.action)});return(0,o.jsx)($u,{title:e.title||`No data`,description:e.description,className:e.className,action:u,...l,"data-obj-id":n,"data-obj-type":r,style:a})},{namespace:`ui`,label:`Empty`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`action`,type:`slot`,description:`Call-to-action node rendered below the description, e.g. a button`},{name:`className`,type:`string`}],defaultProps:{title:`No data`}}),t.ComponentRegistry.register(`sonner`,({schema:e,...t})=>{let{style:n,...r}=t;return(0,o.jsx)(Y,{onClick:()=>{(e.variant===`success`?B.toast.success:e.variant===`error`?B.toast.error:e.variant===`warning`?B.toast.warning:e.variant===`info`?B.toast.info:B.toast)(e.message||e.title||`Notification`,{description:e.description})},variant:e.buttonVariant,className:e.className,...os(r),style:n,children:e.buttonLabel||`Show Toast`})},{namespace:`ui`,label:`Sonner Toast`,inputs:[{name:`message`,type:`string`},{name:`description`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`error`,`warning`,`info`]},{name:`buttonLabel`,type:`string`},{name:`buttonVariant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],description:"Variant for the trigger button this node renders. Exactly the six keys of the Button variant group: `cva` contributes no variant class for any other value, so an out-of-set value renders a button with no background and no text colour, while an empty string silently renders the default look."},{name:`className`,type:`string`}],defaultProps:{message:`Notification`,buttonLabel:`Show Toast`,variant:`default`}}),t.ComponentRegistry.register(`dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(Pt,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[he(Ft,e.trigger),(0,o.jsxs)(zt,{className:t,children:[(0,o.jsxs)(Bt,{children:[e.title&&(0,o.jsx)(Ht,{children:e.title}),e.description&&(0,o.jsx)(Ut,{children:e.description})]}),J(e.content),me(e.footer,e=>(0,o.jsx)(Vt,{children:J(e)}))]})]}),{namespace:`ui`,label:`Dialog`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`modal`,type:`boolean`},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`,description:`Element that opens the dialog`},{name:`content`,type:`slot`,description:`Main content of the dialog`},{name:`footer`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Dialog Title`,description:`Dialog description goes here`,modal:!0,trigger:[{type:`button`,label:`Open Dialog`}],content:[{type:`text`,content:`Dialog content goes here`}]}}),t.ComponentRegistry.register(`sheet`,({schema:e,className:t,...n})=>(0,o.jsxs)(ni,{defaultOpen:e.defaultOpen,...n,children:[he(ri,e.trigger),(0,o.jsxs)(ci,{side:e.side||`right`,className:t,children:[(0,o.jsxs)(li,{children:[e.title&&(0,o.jsx)(di,{children:e.title}),e.description&&(0,o.jsx)(fi,{children:e.description})]}),J(e.content),me(e.footer,e=>(0,o.jsx)(ui,{children:J(e)}))]})]}),{namespace:`ui`,label:`Sheet`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`footer`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Sheet Title`,description:`Sheet description`,side:`right`,trigger:[{type:`button`,label:`Open Sheet`}],content:[{type:`text`,content:`Sheet content goes here`}]}}),t.ComponentRegistry.register(`popover`,({schema:e,className:t,...n})=>(0,o.jsxs)(Lr,{defaultOpen:e.defaultOpen,...n,children:[he(Rr,e.trigger),(0,o.jsx)(zr,{align:e.align,side:e.side,className:t,children:J(e.content)})]}),{namespace:`ui`,label:`Popover`,inputs:[{name:`defaultOpen`,type:`boolean`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Open Popover`,variant:`outline`}],content:[{type:`text`,content:`Popover content goes here`}],align:`center`,side:`bottom`}}),t.ComponentRegistry.register(`tooltip`,({schema:e,className:t,...n})=>(0,o.jsx)(gi,{delayDuration:e.delayDuration,children:(0,o.jsxs)(_i,{...n,children:[he(vi,e.trigger),(0,o.jsx)(yi,{side:e.side,align:e.align,className:t,children:e.content||J(e.children)})]})}),{namespace:`ui`,label:`Tooltip`,inputs:[{name:`delayDuration`,type:`number`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`content`,type:`string`},{name:`children`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`outline`}],content:`Tooltip content`,delayDuration:700,side:`top`}}),t.ComponentRegistry.register(`alert-dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(X,{defaultOpen:e.defaultOpen,...n,children:[he(Me,e.trigger),(0,o.jsxs)(Fe,{className:t,children:[(0,o.jsxs)(Ie,{children:[e.title&&(0,o.jsx)(Re,{children:e.title}),e.description&&(0,o.jsx)(ze,{children:e.description})]}),J(e.content),(0,o.jsxs)(Le,{children:[e.cancelText&&(0,o.jsx)(Ve,{children:e.cancelText}),e.actionText&&(0,o.jsx)(Be,{className:e.actionVariant?je({variant:e.actionVariant}):void 0,onClick:e.onAction,children:e.actionText})]})]})]}),{namespace:`ui`,label:`Alert Dialog`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`cancelText`,type:`string`},{name:`actionText`,type:`string`},{name:`actionVariant`,type:`enum`,enum:[`default`,`destructive`]},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Are you sure?`,description:`This action cannot be undone.`,cancelText:`Cancel`,actionText:`Continue`,trigger:[{type:`button`,label:`Open Alert`,variant:`destructive`}]}}),t.ComponentRegistry.register(`drawer`,({schema:e,className:t,...n})=>(0,o.jsxs)(hn,{defaultOpen:e.defaultOpen,...n,children:[he(gn,e.trigger),(0,o.jsxs)(bn,{className:t,children:[(0,o.jsxs)(xn,{children:[e.title&&(0,o.jsx)(Cn,{children:e.title}),e.description&&(0,o.jsx)(wn,{children:e.description})]}),J(e.content)]})]}),{namespace:`ui`,label:`Drawer`,inputs:[{name:`title`,type:`string`},{name:`description`,type:`string`},{name:`defaultOpen`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{title:`Drawer Title`,description:`Drawer description`,trigger:[{type:`button`,label:`Open Drawer`}],content:[{type:`text`,content:`Drawer content goes here`}]}}),t.ComponentRegistry.register(`hover-card`,({schema:e,className:t,...n})=>(0,o.jsxs)(Qn,{openDelay:e.openDelay,closeDelay:e.closeDelay,...n,children:[he($n,e.trigger),(0,o.jsx)(er,{align:e.align,side:e.side,className:t,children:J(e.content)})]}),{namespace:`ui`,label:`Hover Card`,inputs:[{name:`openDelay`,type:`number`},{name:`closeDelay`,type:`number`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`link`}],content:[{type:`text`,content:`Hover card content appears on hover`}],side:`top`}});var Ip=e=>e?e.map((e,t)=>{if(e.separator)return(0,o.jsx)(Rn,{},t);let n=Ga(e.icon);return e.children?(0,o.jsxs)(kn,{children:[(0,o.jsxs)(jn,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(Mn,{children:Ip(e.children)})]},t):(0,o.jsxs)(Pn,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(`span`,{className:`ml-auto text-xs tracking-widest opacity-60`,children:e.shortcut})]},t)}):null;t.ComponentRegistry.register(`dropdown-menu`,({schema:e,className:t,...n})=>{let r=(0,_.useDisplayLocale)();return(0,o.jsxs)(Tn,{defaultOpen:e.defaultOpen,...n,children:[he(En,e.trigger),(0,o.jsxs)(Nn,{align:e.align,side:e.side,className:t,children:[e.label&&(0,o.jsx)(Ln,{children:(0,U.resolveI18nLabel)(e.label,r)}),e.label&&(0,o.jsx)(Rn,{}),Ip(e.items)]})]})},{namespace:`ui`,label:`Dropdown Menu`,inputs:[{name:`label`,type:`string`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`]},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`]},{name:`trigger`,type:`slot`},{name:`items`,type:`array`,description:"Recursive structure: a command item { label, icon, shortcut, disabled, onClick, children: [] } or a divider { separator: true }. `icon` is a kebab-case Lucide icon name resolved against lucide's runtime `icons` record; an unknown or retired spelling renders no glyph."},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Menu`,variant:`outline`}],items:[{label:`Item 1`},{label:`Item 2`},{separator:!0},{label:`Item 3`}],align:`start`,side:`bottom`}});var Lp=e=>e?e.map((e,t)=>{if(e.separator)return(0,o.jsx)(pn,{},t);let n=Ga(e.icon);return e.children?(0,o.jsxs)(rn,{children:[(0,o.jsxs)(on,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(sn,{children:Lp(e.children)})]},t):(0,o.jsxs)(ln,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(mn,{children:e.shortcut})]},t)}):null;t.ComponentRegistry.register(`context-menu`,({schema:e,className:t,...n})=>{let r=e.triggerClassName||t||e.className||`h-[120px] w-full sm:h-[150px] sm:w-[300px] border border-dashed text-sm flex items-center justify-center`,i=e.contentClassName;return(0,o.jsxs)($t,{modal:e.modal,...n,children:[(0,o.jsx)(en,{asChild:!0,children:(0,o.jsx)(`div`,{className:r,children:J(e.trigger||{type:`text`,content:`Right click here`})})}),(0,o.jsx)(cn,{className:i,children:Lp(e.items)})]})},{namespace:`ui`,label:`Context Menu`,inputs:[{name:`trigger`,type:`slot`},{name:`triggerClassName`,type:`string`},{name:`items`,type:`array`,description:"Recursive structure: a command item { label, icon, shortcut, disabled, onClick, children } or a divider { separator: true }. `icon` is a kebab-case Lucide icon name resolved against lucide's runtime `icons` record; an unknown or retired spelling renders no glyph."},{name:`className`,type:`string`}],defaultProps:{items:[{label:`Action 1`},{label:`Action 2`},{separator:!0},{label:`Action 3`}],trigger:[{type:`text`,content:`Right click here`}]}});var Rp=e=>e?.map((e,t)=>{if(e.separator)return(0,o.jsx)(yr,{},t);let n=Ga(e.icon);return e.children?(0,o.jsxs)(lr,{children:[(0,o.jsxs)(fr,{children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label]}),(0,o.jsx)(pr,{children:Rp(e.children)})]},t):(0,o.jsxs)(hr,{disabled:e.disabled,onSelect:()=>e.onClick?.(),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label,e.shortcut&&(0,o.jsx)(br,{children:e.shortcut})]},t)});t.ComponentRegistry.register(`menubar`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(ur,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.menus?.map((e,t)=>(0,o.jsxs)(ar,{children:[(0,o.jsx)(dr,{children:e.label}),(0,o.jsx)(mr,{children:Rp(e.items)})]},t))})},{namespace:`ui`,label:`Menubar`,inputs:[{name:`className`,type:`string`}],defaultProps:{menus:[{label:`File`,items:[{label:`New`},{label:`Open`},{separator:!0},{label:`Exit`}]}]}}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>(0,o.jsx)(De,{type:e.accordionType||`single`,collapsible:e.collapsible,className:t,...n,children:e.items?.map((e,t)=>(0,o.jsxs)(Oe,{value:e.value||`item-${t}`,disabled:e.disabled,children:[(0,o.jsx)(ke,{children:e.title}),(0,o.jsx)(Ae,{children:J(e.content)})]},e.value||t))}),{namespace:`ui`,label:`Accordion`,inputs:[{name:`accordionType`,type:`enum`,enum:[`single`,`multiple`]},{name:`collapsible`,type:`boolean`},{name:`items`,type:`array`,description:`Array of { trigger, content, value }`},{name:`className`,type:`string`}],defaultProps:{accordionType:`single`,collapsible:!0,items:[{label:`Item 1`,value:`item-1`,content:[{type:`text`,content:`Content for item 1`}]},{label:`Item 2`,value:`item-2`,content:[{type:`text`,content:`Content for item 2`}]},{label:`Item 3`,value:`item-3`,content:[{type:`text`,content:`Content for item 3`}]}],className:`w-full`}}),t.ComponentRegistry.register(`collapsible`,({schema:e,className:t,disabled:n,open:r,...i})=>{let s=J(e.trigger);return(0,o.jsxs)(kt,{defaultOpen:e.defaultOpen,disabled:n,className:t,...i,children:[(0,o.jsx)(At,{asChild:(0,a.isValidElement)(s),children:s}),(0,o.jsx)(jt,{children:J(e.content)})]})},{namespace:`ui`,label:`Collapsible`,inputs:[{name:`defaultOpen`,type:`boolean`},{name:`disabled`,type:`boolean`},{name:`trigger`,type:`slot`},{name:`content`,type:`slot`},{name:`className`,type:`string`}],defaultProps:{trigger:[{type:`button`,label:`Toggle`,variant:`outline`}],content:[{type:`text`,content:`Collapsible content goes here`}],className:`w-full`}}),t.ComponentRegistry.register(`toggle-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,type:a,...s}=t;return(0,o.jsx)(ya,{type:e.selectionType||`single`,variant:e.variant,size:e.size,value:e.value,className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:e.items?.map((e,t)=>(0,o.jsx)(ba,{value:e.value,"aria-label":e.label,disabled:e.disabled,children:e.label},t))})},{namespace:`ui`,label:`Toggle Group`,inputs:[{name:`selectionType`,type:`enum`,enum:[`single`,`multiple`]},{name:`variant`,type:`enum`,enum:[`default`,`outline`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`]},{name:`className`,type:`string`}],defaultProps:{selectionType:`single`,variant:`default`,size:`default`,items:[{value:`bold`,label:`Bold`},{value:`italic`,label:`Italic`},{value:`underline`,label:`Underline`}]}}),t.ComponentRegistry.register(`carousel`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ct,{opts:e.opts,orientation:e.orientation||`horizontal`,className:t,...n,children:[(0,o.jsx)(wt,{children:e.items?.map((t,n)=>(0,o.jsx)(Tt,{className:e.itemClassName,children:J(t)},n))}),e.showArrows&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Et,{}),(0,o.jsx)(Dt,{})]})]}),{namespace:`ui`,label:`Carousel`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`showArrows`,type:`boolean`},{name:`items`,type:`array`,description:`Array of content schemas`},{name:`itemClassName`,type:`string`},{name:`className`,type:`string`}],defaultProps:{orientation:`horizontal`,showArrows:!0,items:[[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 1`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 2`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,children:[{type:`text`,content:`Slide 3`}]}]],className:`w-full max-w-xs`}}),t.ComponentRegistry.register(`filter-builder`,({schema:e,className:t,onChange:n,...r})=>{let i=(0,_.useDisplayLocale)();return(0,o.jsxs)(`div`,{className:e.wrapperClass||``,children:[e.label&&(0,o.jsx)(`label`,{className:`text-sm font-medium mb-2 block`,children:(0,U.resolveI18nLabel)(e.label,i)}),(0,o.jsx)(Ll,{fields:e.fields||[],value:e.value||r.value,onChange:t=>{n&&n({target:{name:e.name,value:t}})},className:t,...r})]})},{namespace:`ui`,label:`Filter Builder`,inputs:[{name:`label`,type:`string`},{name:`name`,type:`string`,required:!0},{name:`fields`,type:`array`,description:`Array of { value: string, label: string, type?: string } objects`,required:!0},{name:`value`,type:`object`,description:`FilterGroup object with conditions`}],defaultProps:{label:`Filters`,name:`filters`,fields:[{value:`name`,label:`Name`,type:`text`},{value:`email`,label:`Email`,type:`text`},{value:`age`,label:`Age`,type:`number`},{value:`status`,label:`Status`,type:`text`}],value:{id:`root`,logic:`and`,conditions:[]}}}),t.ComponentRegistry.register(`scroll-area`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation||`vertical`;return(0,o.jsxs)(Ur,{className:t,style:{height:e.height,width:e.width,...a},...s,"data-obj-id":r,"data-obj-type":i,children:[J(e.children),(c===`horizontal`||c===`both`)&&(0,o.jsx)(Wr,{orientation:`horizontal`}),(c===`vertical`||c===`both`)&&(0,o.jsx)(Wr,{orientation:`vertical`})]})},{namespace:`ui`,label:`Scroll Area`,inputs:[{name:`height`,type:`string`},{name:`width`,type:`string`},{name:`orientation`,type:`enum`,enum:[`vertical`,`horizontal`,`both`]},{name:`className`,type:`string`},{name:`children`,type:`slot`}],defaultProps:{height:`200px`,width:`100%`,orientation:`vertical`,children:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Scrollable content goes here. Add more content to see scrolling behavior.`}]}],className:`rounded-md border`}}),t.ComponentRegistry.register(`resizable`,({schema:e,className:t,...n})=>{let r=Array.isArray(e.panels)?e.panels:[];return(0,o.jsx)(us,{orientation:e.direction||`horizontal`,className:t,...n,style:{minHeight:e.minHeight||`200px`},children:r.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(ds,{defaultSize:t.defaultSize,minSize:t.minSize,maxSize:t.maxSize,children:J(t.content)}),n<r.length-1&&(0,o.jsx)(fs,{withHandle:e.withHandle})]},n))})},{namespace:`ui`,label:`Resizable Panel Group`,inputs:[{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`minHeight`,type:`string`},{name:`withHandle`,type:`boolean`},{name:`panels`,type:`array`,description:`Array of { defaultSize, minSize, maxSize, content }`},{name:`className`,type:`string`}],defaultProps:{direction:`horizontal`,minHeight:`200px`,withHandle:!0,panels:[{defaultSize:50,content:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Panel 1`}]}]},{defaultSize:50,content:[{type:`div`,className:`p-4`,children:[{type:`text`,content:`Panel 2`}]}]}],className:`rounded-lg border`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t,...n})=>(0,o.jsxs)(ra,{className:t,...n,children:[e.caption&&(0,o.jsx)(ua,{children:e.caption}),(0,o.jsx)(ia,{children:(0,o.jsx)(sa,{children:e.columns?.map((e,t)=>(0,o.jsx)(ca,{className:e.className,style:{width:e.width},children:e.header},t))})}),(0,o.jsx)(aa,{children:e.data?.map((t,n)=>(0,o.jsx)(sa,{children:e.columns?.map((e,n)=>(0,o.jsx)(la,{className:e.cellClassName,children:t[e.accessorKey]},n))},n))}),me(e.footer,t=>(0,o.jsx)(oa,{children:(0,o.jsx)(sa,{children:(0,o.jsx)(la,{colSpan:e.columns?.length,children:J(t)})})}))]}),{namespace:`ui`,label:`Table`,inputs:[{name:`caption`,type:`string`},{name:`footer`,type:`string`},{name:`columns`,type:`array`,description:`Array of { header, accessorKey, className, cellClassName, width }`},{name:`data`,type:`array`,description:`Array of objects`},{name:`className`,type:`string`}],defaultProps:{caption:`Table Caption`,columns:[{header:`Column 1`,accessorKey:`col1`},{header:`Column 2`,accessorKey:`col2`},{header:`Column 3`,accessorKey:`col3`}],data:[{col1:`Row 1, Col 1`,col2:`Row 1, Col 2`,col3:`Row 1, Col 3`},{col1:`Row 2, Col 1`,col2:`Row 2, Col 2`,col3:`Row 2, Col 3`},{col1:`Row 3, Col 1`,col2:`Row 3, Col 2`,col3:`Row 3, Col 3`}]}});var zp=a.default.createContext(null);function Bp({value:e,children:t}){return(0,o.jsx)(zp.Provider,{value:e,children:t})}function Vp(){return a.default.useContext(zp)}var Hp=`[ObjectUI] DataTable bind:`,Up=`data`;function Wp(e){return typeof e==`string`?`'${e}'`:String(e)}function Gp({blockType:e,id:t,caption:n}){let r=typeof e==`string`&&e.length>0?e:`data-table`,i=[];return typeof t==`string`&&t.length>0&&i.push(`id: '${t}'`),typeof n==`string`&&n.length>0&&i.push(`caption: '${n}'`),i.length>0?`${r} (${i.join(`, `)})`:r}function Kp(e){return e!==void 0}function qp(e,t,n){if(!Kp(e))return null;let r=Array.isArray(t)?t.length:0,i=r===0?`This node has no inline rows, so the table renders its header over an empty body`:`The ${r} ${r===1?`row`:`rows`} on screen ${r===1?`comes`:`come`} from \`${Up}\`; the \`bind\` contributes nothing`;return`${Hp} ${Gp(n)} — \`bind: ${Wp(e)}\` is ignored: data-table does not read \`bind\`; it reads its rows from the inline \`${Up}\` array on the node. ${i}.\n Put the rows in \`${Up}\`, or author a component that does read \`bind\` (\`list\`, \`tree-view\`, or an \`object-*\` widget — they call \`useDataScope\`). (objectui#6575)`}var Jp=`[ObjectUI] DataTable data:`,Yp=/\$\{[\s\S]*?\}/;function Xp(e,t=80){return e.length<=t?e:`${e.slice(0,t)}…`}function Zp(e){return e===null?"`null`":Array.isArray(e)?`an array`:typeof e==`string`?`the string ${Wp(Xp(e))}`:typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?`the ${typeof e} \`${String(e)}\``:typeof e==`object`?`an object`:`a ${typeof e}`}function Qp(e){return e!==void 0&&!Array.isArray(e)}function $p(e,t){if(!Qp(e))return null;let n=Gp(t),r=` Resolve the rows in the host and put the array on the node as \`${Up}\`. (objectui#6665)`;return typeof e==`string`&&Yp.test(e)?`${Jp} ${n} — \`${Up}: ${Wp(Xp(e))}\` was never evaluated: a \`\${...}\` expression written into \`${Up}\` at node level is read as a literal string, so \`${Up}\` is a string rather than an array and the table renders its header over an empty body.\n${r}`:`${Jp} ${n} — \`${Up}\` was authored as ${Zp(e)}, and data-table takes its rows only from an array: every non-array value is dropped to zero rows, so the table renders its header over an empty body.\n${r}`}var em=new Set([`number`,`currency`,`percent`]);function tm(e){return typeof e==`object`&&e&&`id`in e&&e.id!=null?e.id:e}var nm=/^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/;function rm(e,t){if(Object.is(e,t))return!0;if(typeof e==`number`&&typeof t==`string`){let n=t.trim();return nm.test(n)&&Number(n)===e}if(typeof t==`number`&&typeof e==`string`)return rm(t,e);if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`)try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}return!1}function im(e,n){if((0,t.isEmptyValue)(e)&&(0,t.isEmptyValue)(n))return!0;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;let t=[...n];return e.every(e=>{let n=t.findIndex(t=>rm(e,t));return n<0?!1:(t.splice(n,1),!0)})}return rm(e,n)}function am(e,t,n,r,i,a){let o=e.get(t),s=!(a&&r in a)&&im(i,n?.[r]);if(s&&!(o&&r in o.changes))return e;let c=new Map(e),l={...o?.changes||{}};return s?delete l[r]:l[r]=i,Object.keys(l).length>0?c.set(t,{row:n,changes:l}):c.delete(t),c}function om(e,t){let n=null;for(let[r,i]of t){let t=e.get(r);if(!t)continue;let a={...t.changes},o=!1;for(let e of Object.keys(i))e in a&&Object.is(a[e],i[e])&&(delete a[e],o=!0);o&&(n??=new Map(e),Object.keys(a).length>0?n.set(r,{row:t.row,changes:a}):n.delete(r))}return n??e}function sm(e){if(e==null)return``;if(Array.isArray(e))return e.map(e=>typeof e==`object`&&e?sm(e):String(e)).filter(Boolean).join(`, `);if(typeof e==`object`){let t=e;return String(t.name??t.label??t.externalId??t.id??t._id??``)}return String(e)}var cm=(0,_.createSafeTranslation)({"table.rowsPerPage":`Rows per page`,"table.pageInfo":`Page {{current}} of {{total}}`,"table.firstPage":`First page`,"table.previousPage":`Previous page`,"table.nextPage":`Next page`,"table.lastPage":`Last page`,"table.totalRecords":`{{count}} total`,"table.noResults":`No results found`,"table.noResultsHint":`Try adjusting your filters or search query.`,"table.sortAsc":`Sort ascending`,"table.sortDesc":`Sort descending`,"table.hideColumn":`Hide column`,"table.cancelAll":`Cancel All`,"table.saveAll":`Save All ({{count}})`,"table.exportCSV":`Export CSV`,"table.addRecord":`Add record`,"table.open":`Open`,"table.search":`Search…`,"table.modified":`{{count}} row modified`,"table.modified_one":`{{count}} row modified`,"table.modified_other":`{{count}} rows modified`,"table.saveFailed":`Save failed`,"table.selected":`{{count}} selected`,"table.selectAllRows":`Select all rows`,"table.selectRow":`Select row`,"table.rowActions":`Row actions`,"table.edit":`Edit`,"table.delete":`Delete`,"common.actions":`Actions`,"fields.date.impossibleDay":`The stored value "{{value}}" is not a real date. Pick a date to replace it.`,"fields.dateTime.impossibleDay":`The stored value "{{value}}" is not a real date. Pick a date and time to replace it.`},`table.rowsPerPage`);function lm(e){if(e&&typeof e==`object`){let t=e,n=t.details&&(t.details.message??t.details.error);if(typeof n==`string`&&n.trim())return n.trim();if(typeof t.message==`string`&&t.message.trim())return t.message.trim()}return typeof e==`string`&&e.trim()?e.trim():`Unknown error`}function um(e,n,r,i,a){return typeof e==`boolean`?e:e==null||e===``?!1:(0,t.evalRowPredicate)(e,n??{},{fallback:!1,scope:r,warnOnError:!0,label:i,fields:a})}function dm(e,t,n,r){let i=e?.visibleWhen;return i==null||um(i,n,r,`builtin:${t}:visibleWhen`)}function fm(e,n,r,i){let a=e?.visible;return!(0,t.hasDeclaredPredicate)(a)||um(a,n,r,e?.name??`row-action`,i)}function pm(e){let{row:t,scope:n}=e,r=!!e.onRowEdit&&dm(e.editPredicates,`edit`,t,n),i=!!e.onRowDelete&&dm(e.deletePredicates,`delete`,t,n),a=e.customActions.filter(e=>fm(e,t,n));return{edit:r,remove:i,custom:a,count:+!!r+ +!!i+a.length}}var mm=({action:e,row:n,onActionDef:r})=>{let s=(0,i.usePredicateScope)(),c=(0,a.useMemo)(()=>fm(e,n,s),[e,n,s]),l=(0,i.useRowPredicate)(e.disabled,n,{fallback:!0,warnOnError:!0,label:`${e.name}:disabled`}),u=(0,t.hasDeclaredPredicate)(e.disabled)&&l;if(!c)return null;let d=Ga(e.icon);return(0,o.jsxs)(Pn,{disabled:u,onClick:()=>{u||r?.(e,n)},"data-testid":`row-action-${e.name}`,className:q(e.variant===`danger`&&`text-destructive focus:text-destructive`),children:[d&&(0,o.jsx)(d,{className:`mr-2 h-4 w-4`}),e.label||e.name]})},hm=({name:e,predicates:t,row:n,icon:r,label:s,className:c,onSelect:l})=>{let u=(0,i.usePredicateScope)(),d=(0,a.useMemo)(()=>dm(t,e,n,u),[t,e,n,u]),f=(0,i.useRowPredicate)(t?.disabledWhen,n,{fallback:!1,warnOnError:!0,label:`builtin:${e}:disabledWhen`});if(!d)return null;let p=t?.disabledWhen!=null&&f;return(0,o.jsxs)(Pn,{disabled:p,onClick:()=>{p||l(n)},"data-testid":`row-action-builtin-${e}`,className:c,children:[r,s]})},gm=({schema:e,row:t,t:n})=>{let r=(0,i.usePredicateScope)(),s=(0,i.useCapabilityGate)(),c=(0,a.useMemo)(()=>Array.isArray(e.rowActionDefs)&&e.onRowActionDef?e.rowActionDefs.filter(e=>s(e.requiredPermissions)):[],[e.rowActionDefs,e.onRowActionDef,s]),u=(0,a.useMemo)(()=>pm({onRowEdit:e.onRowEdit,onRowDelete:e.onRowDelete,editPredicates:e.rowEditPredicates,deletePredicates:e.rowDeletePredicates,customActions:c,row:t,scope:r}),[e.onRowEdit,e.onRowDelete,e.rowEditPredicates,e.rowDeletePredicates,c,t,r]);return u.count===0?null:(0,o.jsxs)(Tn,{children:[(0,o.jsx)(En,{asChild:!0,children:(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,className:`h-8 w-8 opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 group-data-[state=selected]/row:opacity-100 data-[state=open]:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100`,onClick:e=>e.stopPropagation(),"aria-label":n(`table.rowActions`),"data-testid":`data-table-row-actions`,children:(0,o.jsx)(l.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsxs)(Nn,{align:`end`,onClick:e=>e.stopPropagation(),children:[u.edit&&(0,o.jsx)(hm,{name:`edit`,predicates:e.rowEditPredicates,row:t,icon:(0,o.jsx)(l.Edit,{className:`mr-2 h-4 w-4`}),label:n(`table.edit`),onSelect:t=>e.onRowEdit?.(t)}),u.custom.length>0&&u.edit&&(0,o.jsx)(Rn,{}),u.custom.map(n=>(0,o.jsx)(mm,{action:n,row:t,onActionDef:e.onRowActionDef},n.name)),u.remove&&(u.edit||u.custom.length>0)&&(0,o.jsx)(Rn,{}),u.remove&&(0,o.jsx)(hm,{name:`delete`,predicates:e.rowDeletePredicates,row:t,icon:(0,o.jsx)(l.Trash2,{className:`mr-2 h-4 w-4`}),label:n(`table.delete`),className:`text-destructive focus:text-destructive`,onSelect:t=>e.onRowDelete?.(t)})]})]})};function _m(e){return e===`single`?`single`:e===`none`||!e?`none`:`multiple`}var vm=Object.freeze([]),ym=Object.freeze([]);function bm(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];if(e===r)return!0;if(!e||!r||typeof e!=`object`||typeof r!=`object`)return!1;let i=e,a=r,o=Object.keys(i);return o.length===Object.keys(a).length&&o.every(e=>Object.is(i[e],a[e]))})}function xm(e,t){let n=e.find(e=>e?.accessorKey===t);return!n||n.masked===!0}var Sm=`bg-[image:linear-gradient(var(--os-row-tint,transparent),var(--os-row-tint,transparent))]`;function Cm(e){return typeof e.className==`string`&&/\bsticky\b/.test(e.className)&&/\bright-0\b/.test(e.className)}var wm=`data-auto-width-key`;function Tm(e){return(!e.width||e.chips===!0)&&!e.fitContent&&!e.masked?e.accessorKey:void 0}function Em(e,t){return{heads:e?Array.from(e.querySelectorAll(`:scope > th > div > [${wm}]`)):[],cells:t?Array.from(t.querySelectorAll(`:scope > tr > td > [${wm}]`)):[]}}function Dm(e){let t=new Map,n=[];for(let r of e){let e=r.getAttribute(wm)??``,i=r.closest(`th, td`),a=`${i?.tagName??``} ${i?.className??``}`,o=`${i?.tagName??``}:${e}`;t.has(o)||t.set(o,a),n.push(e,r.textContent??``,t.get(o)===a?``:a)}return JSON.stringify([...t.entries(),...n])}function Om(e){let t=e.closest(`th, td`);return{box:t,span:t?.tagName===`TH`?e.parentElement:e}}function km(e,t){let n={};for(let e of t){let t=e.getAttribute(wm)??``,r=(e.textContent??``).length;(!(t in n)||r>n[t])&&(n[t]=r)}let r=[...e,...t],i=r.map(e=>{let{box:t,span:n}=Om(e);if(!t||!n)return 0;let r=t.getBoundingClientRect().width-n.getBoundingClientRect().width;return Number.isFinite(r)&&r>0?r:0}),a=r.map(e=>e.style.width);for(let e of r)e.style.width=`max-content`;let o=r.map(e=>e.getBoundingClientRect().width);if(r.forEach((e,t)=>{e.style.width=a[t]}),!o.some(e=>Number.isFinite(e)&&e>0))return{chars:n,px:null,cellPx:null};let s={},c={};return r.forEach((t,n)=>{let r=t.getAttribute(wm)??``,a=Math.ceil((Number.isFinite(o[n])?o[n]:0)+i[n]);(!(r in s)||a>s[r])&&(s[r]=a),n>=e.length&&(!(r in c)||a>c[r])&&(c[r]=a)}),{chars:n,px:s,cellPx:c}}function Am(e,t){if(e===null||t===null)return e===t;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function jm(e,t){return Am(e.chars,t.chars)&&Am(e.px,t.px)&&Am(e.cellPx,t.cellPx)}t.ComponentRegistry.register(`data-table`,({schema:e})=>{let{caption:n,columns:r=vm,data:s=ym,pagination:c=!0,pageSize:u=10,pageSizeOptions:d,manualPagination:f=!1,rowCount:p,page:m,onPageChange:h,onPageSizeChange:g,manualSorting:v=!1,sort:y,onSortChange:b,searchable:x=!0,manualSearch:S=!1,search:C,onSearchChange:w,selectable:T=!1,showSelectionCount:E=!0,selectionResetKey:D,sortable:O=!0,exportable:k=!1,rowActions:A=!1,resizableColumns:j=!0,reorderableColumns:M=!0,editable:N=!1,singleClickEdit:P=!1,keyboardNavigation:F=!1,rowClassName:I,rowStyle:ee,className:L,cellClassName:R,frozenColumns:z=0,showRowNumbers:B=!1,showAddRow:te=!1,borderless:ne=!1,disableInnerScroll:re=!1,rowGroups:ie,bind:ae}=e,V=_m(T),H=V!==`none`,U=H||B?1:0,oe=Vp(),se=!!oe?.onAddColumn,ce=!!oe?.onEditColumn,W=M||!!oe?.onReorderFields,{t:G}=cm(),le=a.default.useId(),ue=(0,_.useDisplayLocale)(),de=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,fe=a.default.useCallback(e=>{if(typeof e!=`string`||e.length<8||!de.test(e))return e;let n=Date.parse(e);if(Number.isNaN(n))return e;let r=e.includes(`T`);try{return r?(0,t.formatDateTime)(e,{locale:ue}):(0,t.formatDate)(e,void 0,{locale:ue})}catch{return e}},[ue]),K=(0,a.useMemo)(()=>ie?ie.flatMap(e=>e.rows):null,[ie])??(Array.isArray(s)?s:ym),pe=e.type,me=e.id;(0,a.useEffect)(()=>{let e=qp(ae,K,{blockType:pe,id:me,caption:n});e&&console.warn(e)},[ae,K,pe,me,n]);let J=$p(s,{blockType:pe,id:me,caption:n});(0,a.useEffect)(()=>{J&&console.warn(J)},[J]);let he=(0,a.useMemo)(()=>r.map(e=>({...e,accessorKey:e.accessorKey})),[r]),[ge,_e]=(0,a.useState)(null),ve=(0,a.useMemo)(()=>{let e={},t=r.map(e=>({header:e.header,accessorKey:e.accessorKey,width:e.width,fitContent:e.fitContent,masked:e.masked===!0}));for(let n of t){if(n.width||n.fitContent)continue;let t=n.masked?void 0:ge?.px?.[n.accessorKey];if(t!==void 0){e[n.accessorKey]=Math.min(400,Math.max(80,t));continue}let r=(n.header||``).length,i=n.masked?void 0:ge?.chars[n.accessorKey];if(i!==void 0)i>r&&(r=i);else{let e=n.masked?[]:K.slice(0,50);for(let t of e){let e=t[n.accessorKey],i=e==null?0:String(e).length;i>r&&(r=i)}}e[n.accessorKey]=Math.min(400,Math.max(80,r*8+48))}return e},[r,K,ge]),[ye,be]=(0,a.useState)(``),[xe,Se]=(0,a.useState)(null),[Ce,we]=(0,a.useState)(null),[Te,Ee]=(0,a.useState)(new Set),De=Te.size>0,[Oe,ke]=(0,a.useState)(1),[Ae,je]=(0,a.useState)(u),[X,Me]=(0,a.useState)(he),[Ne,Pe]=(0,a.useState)({}),[Fe,Ie]=(0,a.useState)({}),Le=(0,a.useRef)(null),Re=e=>{let t=Ne[e.accessorKey]||e.width||ve[e.accessorKey],n=e.chips===!0?Fe[e.accessorKey]:void 0;return n===void 0||t!==void 0&&typeof t!=`number`?t:Math.max(t??0,n)},ze=(0,a.useRef)(null),[Be,Ve]=(0,a.useState)(null),He=z>0?U+Math.min(z,X.length):0;(0,a.useLayoutEffect)(()=>{let e=ze.current;if(He===0||!e){Ve(null);return}let t=()=>{let t=Array.from(e.children).slice(0,He),n=0,r=t.map(e=>{let t=n;return n+=e.getBoundingClientRect().width,t});Ve(e=>e&&e.length===r.length&&e.every((e,t)=>Math.abs(e-r[t])<.5)?e:r)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return Array.from(e.children).slice(0,He).forEach(e=>n.observe(e)),()=>n.disconnect()},[He,X]);let[Ue,We]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=ze.current,t=U,n=X.map((e,t)=>({key:e.accessorKey,index:t,col:e})).filter(({col:e})=>Cm(e)),r=e?n.map(({index:n})=>e.children[t+n]):[];if(n.length<2||r.some(e=>!e)){We(null);return}let i=()=>{let e={},t=0;for(let i=n.length-1;i>=0;i--)e[n[i].key]=t,t+=r[i].getBoundingClientRect().width;We(t=>Am(t,e)?t:e)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return r.forEach(e=>a.observe(e)),()=>a.disconnect()},[U,X]);let[Ge,Ke]=(0,a.useState)(null),[qe,Je]=(0,a.useState)(null),[Z,Ye]=(0,a.useState)(null),Xe=(0,a.useRef)(null),[Ze,Qe]=(0,a.useState)(``),$e=(0,a.useRef)(``),et=e=>{$e.current=e,Qe(e)},[tt,nt]=(0,a.useState)(new Map),rt=(0,a.useRef)(new Map),it=(0,a.useMemo)(()=>{let e=new WeakMap;return{of(t,n){let r=tt.get(n)?.changes;if(!r||typeof t!=`object`||!t)return t;let i=e.get(t);if(i!==void 0)return i;let a={...t,...r};return e.set(t,a),a}}},[tt]),[at,ot]=(0,a.useState)(!1),[st,ct]=(0,a.useState)(null),[lt,ut]=(0,a.useState)(new Set),[dt,ft]=(0,a.useState)(null),pt=(0,a.useRef)(null),mt=(0,a.useRef)(0),ht=(0,a.useRef)(0),gt=(0,a.useRef)(null),_t=(0,a.useRef)(null),vt=(0,a.useRef)(!1),yt=(0,a.useRef)(null),bt=(0,a.useRef)(null);(0,a.useEffect)(()=>{Me(e=>bm(e,he)?e:he)},[he]),(0,a.useEffect)(()=>{D!==void 0&&Ee(new Set)},[D]);let xt=(0,a.useMemo)(()=>{if(S||!ye)return K;let e=X.filter(e=>!xm(r,e.accessorKey));return K.filter(t=>e.some(e=>t[e.accessorKey]?.toString().toLowerCase().includes(ye.toLowerCase())))},[K,ye,X,r,S]),St=(0,a.useMemo)(()=>{if(v||!xe||!Ce||xm(r,xe))return xt;let e=xt.map(e=>({row:e,key:(0,t.getSortValue)(e[xe])}));return e.sort((e,n)=>{let r=(0,t.compareSortValues)(e.key,n.key);return Ce===`asc`?r:-r}),e.map(e=>e.row)},[xt,xe,Ce,v,r]),Ct=(0,a.useMemo)(()=>{if(!ie)return null;let e=new Map;ie.forEach((t,n)=>{t.rows.forEach(t=>{e.has(t)||e.set(t,n)})});let t=ie.map(()=>[]);for(let n of St){let r=e.get(n);r!==void 0&&t[r].push(n)}let n=[];return{rows:n,layout:ie.map((e,r)=>{let i=n.length;return n.push(...t[r]),{group:e,start:i,length:t[r].length}})}},[ie,St]),wt=Ct?Ct.rows:St,Tt=Ct?.layout??null,Et=f?Math.max(1,m??1):Oe,Dt=f?Math.max(1,Math.ceil((p??wt.length)/Ae)):Math.ceil(wt.length/Ae),kt=c&&!f&&!Tt?wt.slice((Oe-1)*Ae,Oe*Ae):wt,At=(0,a.useMemo)(()=>{let e=new Map;return wt.forEach((t,n)=>{let r=tm(t);e.has(r)||e.set(r,n)}),e},[wt]),jt=e=>{let t=At.get(e);return t===void 0?void 0:wt[t]},Mt=e=>{let t=At.get(e);return t===void 0?-1:f?(Et-1)*Ae+t:t},Nt=e=>{let t=Math.min(Dt,Math.max(1,e));f?h?.(t):ke(t)},Pt=e=>{je(e),f?(g?.(e),h?.(1)):ke(1)},Ft=a.default.useMemo(()=>{let e=d&&d.length>0?d:[5,10,20,50,100];return Array.from(new Set([...e,Ae])).filter(e=>Number.isFinite(e)&&e>0).sort((e,t)=>e-t)},[d,Ae]),It=(e,t)=>e.id===void 0?`row-${t}`:e.id,Lt=v?y??[]:xe&&Ce?[{field:xe,order:Ce}]:[],Rt=O&&(!v||!!b),zt=e=>Rt&&e.sortable!==!1&&!xm(r,e.accessorKey),Bt=S?C??``:ye,Vt=x&&(!S||!!w),Ht=e=>{if(S){w?.(e);return}be(e),ke(1)},Ut=(e,t)=>{if(!xm(r,e)){if(v){b?.([{field:e,order:t}]);return}Se(e),we(t)}},Wt=e=>{if(Rt&&!xm(r,e)){if(v){let t=Lt.find(t=>t.field===e);Ut(e,t?.order===`asc`?`desc`:`asc`);return}xe===e?Ce===`asc`?we(`desc`):Ce===`desc`&&(we(null),Se(null)):(Se(e),we(`asc`))}},Gt=(e,t)=>{e.preventDefault(),ft({x:e.clientX,y:e.clientY,columnKey:t})},Kt=dt?X.find(e=>e.accessorKey===dt.columnKey):void 0,qt=e=>{Me(t=>t.filter(t=>t.accessorKey!==e)),ft(null)};(0,a.useEffect)(()=>{if(!dt)return;let e=()=>ft(null);return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[dt]);let Jt=t=>{let n=new Set;if(t&&kt.forEach((e,t)=>{let r=(Et-1)*Ae+t,i=It(e,r);n.add(i)}),Ee(n),e.onSelectionChange){let t=wt.filter((e,t)=>{let r=It(e,t);return n.has(r)});e.onSelectionChange(t)}},Yt=(t,n)=>{let r=new Set(V===`single`?[]:Te);if(n?r.add(t):r.delete(t),Ee(r),e.onSelectionChange){let t=wt.filter((e,t)=>{let n=It(e,t);return r.has(n)});e.onSelectionChange(t)}},Xt=()=>{let e=X.filter(e=>!e.masked),t=[e.map(e=>e.header).join(`,`),...wt.map(t=>e.map(e=>JSON.stringify(t[e.accessorKey]||``)).join(`,`))].join(`
19
+ `),n=new Blob([t],{type:`text/csv`}),r=window.URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`table-export.csv`,i.click(),window.URL.revokeObjectURL(r)},Zt=e=>{let t=Lt.findIndex(t=>t.field===e);if(t===-1)return(0,o.jsx)(l.ChevronsUpDown,{className:`h-3 w-3 ml-0.5 opacity-0 group-hover:opacity-50 transition-opacity`});let n=Lt[t].order===`asc`?l.ChevronUp:l.ChevronDown;return(0,o.jsxs)(`span`,{className:`inline-flex items-center shrink-0`,children:[(0,o.jsx)(n,{className:`h-3 w-3 ml-0.5 text-primary`}),Lt.length>1&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-primary tabular-nums leading-none`,children:t+1})]})},Qt=(e,t)=>{if(!j)return;e.preventDefault(),e.stopPropagation(),pt.current=t,mt.current=e.clientX,gt.current=null;let n=e.target.closest(`th`);n&&(ht.current=n.offsetWidth),document.addEventListener(`mousemove`,$t),document.addEventListener(`mouseup`,en)},$t=e=>{if(!pt.current)return;let t=e.clientX-mt.current,n=Math.max(50,ht.current+t);Pe(e=>({...e,[pt.current]:n})),gt.current=n},en=()=>{let t=pt.current,n=gt.current;pt.current=null,gt.current=null,document.removeEventListener(`mousemove`,$t),document.removeEventListener(`mouseup`,en),t&&n!=null&&e.onColumnResize?.(t,n)},tn=(e,t)=>{W&&(Ke(t),e.dataTransfer.effectAllowed=`move`)},nn=(e,t)=>{W&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Je(t))},rn=(t,n)=>{if(!W||Ge===null)return;if(t.preventDefault(),Ge===n){Ke(null),Je(null);return}let r=[...X],[i]=r.splice(Ge,1);r.splice(n,0,i),Me(r),Ke(null),Je(null),e.onColumnsReorder&&e.onColumnsReorder(r),oe?.onReorderFields?.(r.map(e=>e.accessorKey))},an=()=>{Ke(null),Je(null)},on=(e,t)=>{if(!N)return;let n=tm(e),r=Xe.current;if(r!==null&&r.rowKey===n&&r.columnKey===t)return;let i=X.find(e=>e.accessorKey===t);if(i?.editable===!1||i?.masked)return;let a={rowKey:n,columnKey:t,row:e};Xe.current=a,Ye(a);let o=tt.get(n)?.changes,s=e[t],c=o?.[t]??s??``;et(c),bt.current=o&&t in o?{had:!0,value:o[t]}:{had:!1,value:void 0}},sn=(t=!1,n)=>{if(!Z||!t&&Z===null)return;let{rowKey:r,columnKey:i}=Z,a=jt(r)??Z.row,o=n===void 0?$e.current:n,s=rt.current.get(r);nt(e=>am(e,r,a,i,o,s)),e.onCellChange&&e.onCellChange(Mt(r),i,o,a),bt.current=null,Xe.current=null,Ye(null),et(``)},cn=(0,a.useRef)(sn);(0,a.useEffect)(()=>{cn.current=sn});let ln=()=>{let e=yt.current;if(!e||typeof document>`u`)return;let t=document.activeElement;t instanceof HTMLElement&&e.contains(t)&&t.blur()},un=e=>{let t=Xe.current,n=bt.current;if(bt.current=null,e&&t&&n){let{rowKey:e,columnKey:r}=t;nt(i=>{let a=i.get(e);if(!(a&&r in a.changes)&&!n.had)return i;let o=new Map(i),s={...a?.changes||{}};return n.had?s[r]=n.value:delete s[r],Object.keys(s).length>0?o.set(e,{row:a?.row??t.row,changes:s}):o.delete(e),o})}Xe.current=null,Ye(null),et(``)},dn=()=>{vt.current=!0,un(!0)},fn=e=>{if(!Z)return;let{rowKey:t,columnKey:n}=Z,r=jt(t)??Z.row,i=rt.current.get(t);et(e),nt(a=>am(a,t,r,n,e,i))},pn=()=>{if(vt.current){vt.current=!1;return}sn(!0)},mn=async(e,t)=>{for(let[t,n]of e)rt.current.set(t,n);try{return await t()}finally{for(let[t,n]of e)rt.current.get(t)===n&&rt.current.delete(t)}},hn=async t=>{let n=tt.get(t);if(!n||Object.keys(n.changes).length===0)return;let r=n.changes,i=jt(t)??n.row,a=new Map([[t,r]]),o=Xe.current;ot(!0);try{await mn(a,async()=>{e.onRowSave&&await e.onRowSave(Mt(t),r,i)}),nt(e=>om(e,a)),o!==null&&o.rowKey===t&&Xe.current===o&&(Xe.current=null,Ye(null),et(``)),ut(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n.size===0&&ct(null),n})}catch(e){console.error(`Failed to save row:`,e),ct(lm(e)),ut(e=>new Set(e).add(t))}finally{ot(!1)}},gn=e=>{let t=new Map(tt);t.delete(e),nt(t),ut(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n.size===0&&ct(null),n})},_n=async()=>{if(tt.size===0)return;let t=new Map(Array.from(tt,([e,t])=>[e,t.changes])),n=Xe.current;ot(!0);try{let r=new Map,i=0,a=Array.from(tt.entries()).map(([e,t])=>{let n=jt(e),a=n===void 0?-++i:Mt(e);return r.set(a,e),{rowIndex:a,changes:t.changes,row:n??t.row}}),o=(e.onBatchSave?await mn(t,async()=>e.onBatchSave?.(a)):void 0)?.failed??[],s=new Set;for(let e of o){let t=r.get(e.rowIndex);if(t===void 0)throw e.error;s.add(t)}if(n!==null&&Xe.current===n&&(Xe.current=null,Ye(null),et(``)),s.size>0){console.error(`Failed to save rows:`,o.map(e=>e.error));let e=new Map(Array.from(t).filter(([e])=>!s.has(e)));nt(t=>om(t,e)),ut(s),ct(lm(o[0].error));return}nt(e=>om(e,t)),ut(new Set),ct(null)}catch(e){console.error(`Failed to save batch:`,e),ct(lm(e)),ut(new Set(t.keys()))}finally{ot(!1)}},vn=()=>{nt(new Map),ut(new Set),ct(null)},yn=(0,a.useRef)(null),bn=(0,a.useRef)(null),xn=rd(bn,{disabled:re}),[Sn,Cn]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=bn.current;if(!xn||!e){Cn(null);return}let t=()=>{let t=typeof getComputedStyle==`function`?getComputedStyle(e):null,n=t?(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0):0,r=t?(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0):0,i=Math.max(0,e.offsetWidth-e.clientWidth-n),a=Math.max(0,e.offsetHeight-e.clientHeight-r),o=0,s=ze.current;s&&X.forEach((e,t)=>{if(!Cm(e))return;let n=s.children[U+t];n&&(o+=n.getBoundingClientRect().width)});let c=Math.round(i+o+(t&&parseFloat(t.borderRightWidth)||0)),l=Math.round(a+(t&&parseFloat(t.borderBottomWidth)||0));Cn(e=>e&&e.right===c&&e.bottom===l?e:{right:c,bottom:l})};t();let n=null;return typeof ResizeObserver<`u`&&(n=new ResizeObserver(t),n.observe(e),yn.current&&n.observe(yn.current)),()=>n?.disconnect()},[xn,X,U,kt.length]);let[wn,Tn]=(0,a.useState)({rowIndex:0,colIndex:0}),En=Math.max(0,Math.min(wn.rowIndex,kt.length-1)),Dn=Math.max(0,Math.min(wn.colIndex,X.length-1)),On=(0,a.useRef)(null),kn=(e,t)=>{Tn(n=>n.rowIndex===e&&n.colIndex===t?n:{rowIndex:e,colIndex:t})},An=(e,t)=>{let n=yn.current?.querySelector(`[data-grid-cell="${e}:${t}"]`);n&&(kn(e,t),n.focus())};(0,a.useEffect)(()=>{let e=On.current;e&&!Z&&(On.current=null,F&&An(e.rowIndex,e.colIndex))});let jn=(e,t,n)=>{if(e.shiftKey||e.altKey||e.metaKey)return null;let r=kt.length-1,i=X.length-1;if(e.ctrlKey)return e.key===`Home`?{rowIndex:0,colIndex:0}:e.key===`End`?{rowIndex:r,colIndex:i}:null;switch(e.key){case`ArrowUp`:return{rowIndex:Math.max(0,t-1),colIndex:n};case`ArrowDown`:return{rowIndex:Math.min(r,t+1),colIndex:n};case`ArrowLeft`:return{rowIndex:t,colIndex:Math.max(0,n-1)};case`ArrowRight`:return{rowIndex:t,colIndex:Math.min(i,n+1)};case`Home`:return{rowIndex:t,colIndex:0};case`End`:return{rowIndex:t,colIndex:i};default:return null}},Mn=(e,t,n,r)=>{if(F){if(Z&&Xe.current===null&&(e.key===`Enter`||e.key===`Escape`)){On.current={rowIndex:t,colIndex:n};return}if(!Z&&e.target===e.currentTarget){let r=jn(e,t,n);if(r){e.preventDefault(),An(r.rowIndex,r.colIndex);return}}}if((e.ctrlKey||e.metaKey)&&e.key===`c`&&!Z){if(e.preventDefault(),X.find(e=>e.accessorKey===r)?.masked)return;let n=(Et-1)*Ae+t,i=wt[f?t:n];if(i){let e=i[r],t=e==null?``:String(e);navigator.clipboard.writeText(t).catch(()=>{})}return}N&&X.find(e=>e.accessorKey===r)?.editable!==!1&&e.key===`Enter`&&!Z&&(e.preventDefault(),on(kt[t],r))},Nn=e=>{e.key===`Enter`?(e.preventDefault(),vt.current=!0,sn(!0)):e.key===`Escape`&&(e.preventDefault(),dn())};(0,a.useEffect)(()=>{Z&&_t.current&&(_t.current.focus(),_t.current.select())},[Z]),(0,a.useEffect)(()=>{if(!Z)return;let e=e=>{let t=yt.current;if(!t)return;let n=e.target;if(n&&!t.contains(n)){if(n instanceof Element){let e=n.closest(`[data-radix-popper-content-wrapper]`);if(e&&!e.contains(t))return;let r=n.closest(`[role="dialog"],[role="alertdialog"]`);if(r&&!r.contains(t))return}ln(),cn.current(!0)}};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[Z]);let Pn=(0,a.useRef)(null),Fn=(0,a.useRef)(null),In=(0,a.useRef)(null),Ln=(0,a.useRef)(()=>{});(0,a.useLayoutEffect)(()=>{Ln.current=(e=!1)=>{let t=Pn.current;if(!t||Xe.current)return;let{heads:n,cells:r}=Em(ze.current,t),i=Dm([...n,...r]);if(!e&&i===Fn.current)return;let a=km(n,r),o=[ie??s,Et,Ae],c=Le.current;if(a.cellPx&&!(c&&o.every((e,t)=>e===c[t]))){Le.current=o;let e={};for(let t of X){let n=t.chips===!0?a.cellPx[t.accessorKey]:void 0;n!==void 0&&(e[t.accessorKey]=n)}Ie(t=>Am(t,e)?t:e)}Fn.current=a.px?i:null,!(In.current&&jm(In.current,a))&&(In.current=a,_e(a))},Ln.current()}),(0,a.useEffect)(()=>{let e=Pn.current;if(!e)return;let t=()=>Ln.current(),n=typeof MutationObserver>`u`?null:new MutationObserver(t);n?.observe(e,{subtree:!0,childList:!0,characterData:!0});let r=yn.current,i=typeof ResizeObserver>`u`||!r?null:new ResizeObserver(t);r&&i?.observe(r);let a=!0;return(typeof document>`u`?void 0:document.fonts)?.ready?.then(()=>{a&&Ln.current(!0)}),()=>{a=!1,n?.disconnect(),i?.disconnect()}},[]),(0,a.useEffect)(()=>()=>{document.removeEventListener(`mousemove`,$t),document.removeEventListener(`mouseup`,en)},[]);let Rn=kt.length>0&&kt.every((e,t)=>{let n=(Et-1)*Ae+t,r=It(e,n);return Te.has(r)}),zn=kt.some((e,t)=>{let n=(Et-1)*Ae+t,r=It(e,n);return Te.has(r)})&&!Rn,Bn=tt.size>0,Vn=!!(e.onRowEdit||e.onRowDelete||Array.isArray(e.rowActionDefs)&&e.rowActionDefs.length>0&&e.onRowActionDef),Hn=N&&!!(e.onRowSave||e.onBatchSave)&&!Vn,Un=Vt||k||E&&H&&Te.size>0||Bn,Wn=X.length+U+ +!!A+ +!!se,Gn=Tt?Tt.flatMap(({group:e,start:t,length:n})=>[{kind:`band`,group:e},...kt.slice(t,t+n).map((e,n)=>({kind:`row`,row:e,rowIndex:t+n})),...e.footer==null?[]:[{kind:`footer`,group:e}]]):kt.map((e,t)=>({kind:`row`,row:e,rowIndex:t}));return(0,o.jsxs)(`div`,{className:`flex flex-col h-full gap-2 sm:gap-4 ${L||``}`,children:[Un&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-4 flex-none`,children:[(0,o.jsx)(`div`,{className:`flex items-center gap-2 flex-1`,children:Vt&&(0,o.jsxs)(`div`,{className:`relative w-full sm:max-w-sm flex-1`,children:[(0,o.jsx)(l.Search,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(Q,{placeholder:G(`table.search`),value:Bt,onChange:e=>Ht(e.target.value),className:`pl-8`})]})}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[Bn&&(0,o.jsxs)(o.Fragment,{children:[st&&(0,o.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-1.5 text-sm text-destructive max-w-[16rem] sm:max-w-sm`,children:[(0,o.jsx)(l.AlertCircle,{className:`h-4 w-4 flex-none`}),(0,o.jsxs)(`span`,{className:`truncate`,title:`${G(`table.saveFailed`)}: ${st}`,children:[G(`table.saveFailed`),`: `,st]})]}),(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:G(`table.modified`,{count:tt.size})}),(0,o.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:vn,disabled:at,children:[(0,o.jsx)(l.X,{className:`h-4 w-4 mr-2`}),G(`table.cancelAll`)]}),(0,o.jsxs)(Y,{variant:`default`,size:`sm`,onClick:_n,disabled:at,children:[(0,o.jsx)(l.Save,{className:`h-4 w-4 mr-2`}),G(`table.saveAll`,{count:tt.size})]})]}),k&&(0,o.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:Xt,disabled:wt.length===0,children:[(0,o.jsx)(l.Download,{className:`h-4 w-4 mr-2`}),G(`table.exportCSV`)]}),E&&H&&Te.size>0&&(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:G(`table.selected`,{count:Te.size})})]})]}),(0,o.jsxs)(`div`,{className:q(`relative`,!re&&`flex flex-col flex-1 min-h-0`),children:[(0,o.jsx)(`div`,{ref:bn,"data-testid":`data-table-scroll-box`,className:q(`relative bg-background`,re?`overflow-visible`:[`flex-1 min-h-0 overflow-auto [-webkit-overflow-scrolling:touch]`,id],!ne&&`rounded-md border`),children:(0,o.jsxs)(ra,{ref:yn,containerClassName:`overflow-visible`,role:F?`grid`:void 0,children:[n&&(0,o.jsx)(ua,{children:n}),(0,o.jsx)(ia,{className:`sticky top-0 bg-background z-10`,children:(0,o.jsxs)(sa,{ref:ze,children:[H&&(0,o.jsx)(ca,{className:q(`w-10 bg-background px-3`,z>0&&`sticky left-0 z-20`),children:V===`multiple`&&(0,o.jsx)(Ot,{checked:Rn?!0:zn?`indeterminate`:!1,onCheckedChange:Jt,"aria-label":G(`table.selectAllRows`)})}),B&&!H&&(0,o.jsx)(ca,{className:q(`w-10 bg-background text-center px-3`,z>0&&`sticky left-0 z-20`),children:(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`#`})}),X.map((e,t)=>{let n=e.fitContent===!0&&!Ne[e.accessorKey]&&!e.width,r=n?`1%`:Re(e),i=Ge===t,a=qe===t,s=z>0&&t<z,c=Cm(e),u=c?Ue?.[e.accessorKey]:void 0,d=s?Be?.[U+t]??X.slice(0,t).reduce((e,t,n)=>{if(n<z){let n=Re(t);return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},U*40):void 0;return(0,o.jsx)(ca,{"data-column-key":e.accessorKey,className:q(e.className,zt(e)&&`cursor-pointer select-none`,i&&`opacity-50`,a&&`border-l-2 border-primary`,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,n&&`whitespace-nowrap`,`group bg-background`,!c&&`relative`,c&&`sticky right-0 z-20`,s&&`sticky z-20`,s&&t===z-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:r,minWidth:r,...s&&{left:d},...u?{right:u}:{}},draggable:W,onDragStart:e=>tn(e,t),onDragOver:e=>nn(e,t),onDrop:e=>rn(e,t),onDragEnd:an,onClick:()=>zt(e)&&Wt(e.accessorKey),onContextMenu:t=>Gt(t,e.accessorKey),children:(0,o.jsxs)(`div`,{className:q(`flex items-center`,e.align===`right`?`justify-end`:`justify-between`),children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,"data-auto-width-key":Tm(e),children:[W&&(0,o.jsx)(l.GripVertical,{className:`h-4 w-4 opacity-0 group-hover:opacity-50 cursor-grab active:cursor-grabbing shrink-0`}),e.headerIcon&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.headerIcon}),(0,o.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground whitespace-nowrap truncate`,children:e.header}),zt(e)&&Zt(e.accessorKey),ce&&(0,o.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),oe.onEditColumn(e.accessorKey)},title:oe.editColumnLabel??`Edit field`,"aria-label":oe.editColumnLabel??`Edit field`,"data-testid":`grid-edit-column-${e.accessorKey}`,className:`ml-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover:opacity-100`,children:(0,o.jsx)(l.Edit,{className:`h-3 w-3`})})]}),j&&e.resizable!==!1&&(0,o.jsx)(`div`,{className:`absolute right-0 top-0 h-full w-1 cursor-col-resize hover:bg-primary opacity-0 hover:opacity-100 transition-opacity`,onMouseDown:t=>Qt(t,e.accessorKey),onClick:e=>e.stopPropagation()})]})},e.accessorKey)}),A&&(Hn?(0,o.jsxs)(ca,{className:`w-24 text-right bg-background`,title:G(`table.edit`),"data-testid":`data-table-edit-column-header`,children:[(0,o.jsx)(l.Pencil,{"aria-hidden":`true`,className:`inline-block h-3.5 w-3.5`}),(0,o.jsx)(`span`,{className:`sr-only`,children:G(`table.edit`)})]}):(0,o.jsx)(ca,{className:`w-24 text-right bg-background`,children:(0,o.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground whitespace-nowrap`,children:G(`common.actions`)})})),se&&(0,o.jsx)(ca,{className:`w-10 bg-background px-1 text-center`,children:(0,o.jsx)(`button`,{type:`button`,onClick:oe.onAddColumn,title:oe.addColumnLabel??`Add field`,"aria-label":oe.addColumnLabel??`Add field`,"data-testid":`grid-add-column`,className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,o.jsx)(l.Plus,{className:`h-4 w-4`})})})]})}),(0,o.jsx)(aa,{ref:Pn,children:kt.length===0&&!Tt?.length?(0,o.jsx)(sa,{className:`hover:bg-transparent`,children:(0,o.jsx)(la,{colSpan:Wn,className:`h-48 text-center text-muted-foreground border-0`,children:(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,o.jsx)(l.Search,{className:`h-8 w-8 text-muted-foreground/50`}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(`p`,{children:G(`table.noResults`)}),(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground/50`,children:G(`table.noResultsHint`)})]}),e.emptyAction?(0,o.jsx)(i.SchemaRenderer,{schema:(0,i.toRenderableSchema)(e.emptyAction)}):null]})})}):(0,o.jsxs)(o.Fragment,{children:[Gn.map(n=>{if(n.kind===`band`)return(0,o.jsx)(sa,{"data-testid":`data-table-group-band`,"data-group-key":n.group.key,"data-group-depth":n.group.depth??0,className:`h-9 bg-muted/30 hover:bg-muted/30 border-b border-border/60`,children:(0,o.jsx)(la,{colSpan:Wn,className:`h-9 px-0 py-0`,children:n.group.band})},`group-band:${n.group.key}`);if(n.kind===`footer`)return(0,o.jsx)(sa,{"data-testid":`data-table-group-footer`,"data-group-key":n.group.key,className:`hover:bg-transparent border-b border-border/60`,children:(0,o.jsx)(la,{colSpan:Wn,className:`px-0 py-0`,children:n.group.footer})},`group-footer:${n.group.key}`);let{row:r,rowIndex:i}=n,a=(Et-1)*Ae+i,s=It(r,a),c=Te.has(s),u=tm(r),d=tt.get(u),f=d!==void 0,p=d?.changes||{},m=lt.has(u);return(0,o.jsxs)(sa,{"data-state":c?`selected`:void 0,className:q(`bg-background border-b border-border/60 group/row transition-colors`,`[--os-row-tint:transparent] hover:[--os-row-tint:transparent] data-[state=selected]:[--os-row-tint:transparent]`,`hover:bg-muted/40`,`data-[state=selected]:bg-primary/5 data-[state=selected]:hover:bg-primary/10`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset`,e.onRowClick&&`cursor-pointer`,f&&!m&&`bg-amber-50 dark:bg-amber-950/20`,m&&`bg-destructive/10 dark:bg-destructive/15 ring-1 ring-inset ring-destructive/40`,I&&I(r,i)),style:ee?ee(r,i):void 0,onClick:t=>{if(e.onRowClick&&!t.defaultPrevented){let n=t.target;if(n.closest(`[data-slot="row-leading-cell"]`)||n.closest(`button`)||n.closest(`a`)||n.closest(`input, select, textarea, label`)||n.closest(`[role="checkbox"]`)||n.closest(`[role="menu"]`)||n.closest(`[role="menuitem"]`)||n.closest(`[role="menuitemcheckbox"]`)||n.closest(`[role="menuitemradio"]`)||n.closest(`[role="dialog"]`)||n.closest(`[role="alertdialog"]`)||n.closest(`[role="listbox"]`)||n.closest(`[role="option"]`)||n.closest(`[role="tab"]`)||n.closest(`[data-radix-popper-content-wrapper]`))return;e.onRowClick(r,t)}},children:[H&&(0,o.jsxs)(la,{"data-slot":`row-leading-cell`,onClick:e=>{e.target.closest(`[role="checkbox"]`)||Yt(s,!c)},className:q(R,`w-10 px-3 relative cursor-pointer`,B&&`text-center`,z>0&&[`sticky left-0 z-10 bg-background`,Sm]),children:[B&&(0,o.jsx)(`span`,{"data-slot":`row-number`,"aria-hidden":De||void 0,className:q(`text-xs text-muted-foreground tabular-nums select-none`,De?`invisible`:`group-hover/row:invisible group-focus-within/row:invisible pointer-coarse:invisible`),children:a+1}),(0,o.jsx)(`span`,{"data-slot":`row-select`,className:q(`flex items-center transition-opacity`,B&&`absolute inset-0 justify-center`,!De&&`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 pointer-coarse:opacity-100`),children:(0,o.jsx)(Ot,{checked:c,onCheckedChange:e=>Yt(s,e),"aria-label":G(`table.selectRow`)})})]}),B&&!H&&(0,o.jsxs)(la,{className:q(`text-center w-10 relative`,R,z>0&&[`sticky left-0 z-10 bg-background`,Sm]),children:[(0,o.jsx)(`span`,{className:q(`text-xs text-muted-foreground tabular-nums select-none`,!H&&e.onRowClick&&`group-hover/row:invisible`),children:a+1}),!H&&e.onRowClick&&(0,o.jsxs)(`button`,{type:`button`,className:`absolute inset-0 hidden group-hover/row:flex items-center justify-center gap-0.5 text-xs font-medium text-primary hover:text-primary/80`,"data-testid":`row-expand-button`,onClick:t=>{t.stopPropagation(),e.onRowClick?.(r,t)},title:`Open record`,children:[(0,o.jsx)(`span`,{children:G(`table.open`)}),(0,o.jsx)(l.ChevronRight,{className:`h-3 w-3`})]})]}),X.map((n,a)=>{let s=n.fitContent===!0&&!Ne[n.accessorKey]&&!n.width,c=n.wrap===!0&&!s,l=Cm(n)?Ue?.[n.accessorKey]:void 0,d=s?`1%`:Re(n),m=r[n.accessorKey],h=p[n.accessorKey]!==void 0,g=h?p[n.accessorKey]:m,_=Z!==null&&Z.rowKey===u&&Z.columnKey===n.accessorKey,v=N&&n.editable!==!1&&!n.masked,y=z>0&&a<z,b=y?Be?.[U+a]??X.slice(0,a).reduce((e,t,n)=>{if(n<z){let n=Re(t);return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},U*40):void 0;return(0,o.jsx)(la,{className:q(n.cellClassName,n.align===`right`&&`text-right`,n.align===`center`&&`text-center`,s?`whitespace-nowrap`:`overflow-hidden`,v&&!_&&`cursor-text hover:bg-muted/50`,h&&`font-semibold text-amber-700 dark:text-amber-400`,y&&[`sticky z-10 bg-background`,Sm],y&&a===z-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:d,minWidth:s?void 0:d,maxWidth:s?void 0:d,...y&&{left:b},...l?{right:l}:{}},onDoubleClick:e=>{v&&!P&&(e.stopPropagation(),on(r,n.accessorKey))},onClick:e=>{v&&P&&(e.stopPropagation(),on(r,n.accessorKey))},onKeyDown:e=>Mn(e,i,a,n.accessorKey),tabIndex:F?i===En&&a===Dn?0:-1:0,"data-grid-cell":F?`${i}:${a}`:void 0,onFocus:F?()=>kn(i,a):void 0,children:_?(()=>{let i=n.type,a=e.renderCellEditor;if(typeof a==`function`){let e=a({column:n,row:r,pendingRow:f?it.of(r,u):r,value:Ze,stage:fn,commit:e=>sn(!0,e),cancel:dn});if(e!=null)return(0,o.jsx)(`div`,{ref:e=>{yt.current=e},className:`w-full`,onKeyDown:e=>{e.currentTarget.contains(e.target)&&(e.key===`Enter`&&e.target.tagName===`INPUT`?(e.preventDefault(),ln(),sn(!0)):e.key===`Escape`&&(e.preventDefault(),un(!0)))},children:e})}if(i===`date`||i===`datetime`){let e=i===`datetime`,n=(0,t.isImpossibleStoredDay)(Ze),r=(0,o.jsx)(Q,{ref:_t,type:e?`datetime-local`:`date`,value:n?``:e?(0,t.toDateTimeInputValue)(Ze):(0,t.toDateInputValue)(Ze),onChange:n=>et(e?(0,t.fromDateTimeInputValue)(n.target.value):n.target.value),onKeyDown:Nn,onBlur:pn,"aria-invalid":n||void 0,"aria-describedby":n?le:void 0,className:`h-8 px-2 py-1`});return n?(0,o.jsxs)(`div`,{className:`space-y-1`,children:[r,(0,o.jsx)(`p`,{id:le,className:`text-xs text-destructive`,"data-testid":e?`datetime-impossible-day`:`date-impossible-day`,children:G(e?`fields.dateTime.impossibleDay`:`fields.date.impossibleDay`,{value:String(Ze)})})]}):r}return i&&em.has(i)?(0,o.jsx)(Q,{ref:_t,type:`number`,value:Ze??``,onChange:e=>et(e.target.value),onKeyDown:Nn,onBlur:pn,className:`h-8 px-2 py-1`}):typeof Ze==`object`&&Ze?(0,o.jsx)(Q,{ref:_t,value:sm(Ze),readOnly:!0,onKeyDown:Nn,onBlur:dn,className:`h-8 px-2 py-1 text-muted-foreground cursor-default`,title:sm(Ze)}):(0,o.jsx)(Q,{ref:_t,value:Ze,onChange:e=>et(e.target.value),onKeyDown:Nn,onBlur:pn,className:`h-8 px-2 py-1`})})():(0,o.jsx)(`div`,{className:s?`w-full whitespace-nowrap`:c?`w-full whitespace-normal break-words`:`truncate w-full`,title:!s&&!n.masked&&g!=null&&typeof g!=`object`?String(g):void 0,"data-auto-width-key":Tm(n),children:typeof n.cell==`function`?n.cell(g,r):typeof g==`object`&&g?String(g):fe(g)})},a)}),A&&(0,o.jsx)(la,{className:q(`text-right`,R),children:(0,o.jsx)(`div`,{className:`flex items-center justify-end gap-1`,children:f&&(e.onRowSave||e.onBatchSave)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>gn(u),disabled:at,title:`Cancel changes`,children:(0,o.jsx)(l.X,{className:`h-4 w-4`})}),(0,o.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>hn(u),disabled:at,title:`Save row`,children:(0,o.jsx)(l.Save,{className:`h-4 w-4 text-green-600`})})]}):(0,o.jsx)(gm,{schema:e,row:r,t:G})})}),se&&(0,o.jsx)(la,{"aria-hidden":!0,className:`w-10`})]},s)}),te&&(0,o.jsx)(sa,{className:`hover:bg-muted/30 cursor-pointer border-b border-border`,"data-testid":`add-record-row`,onClick:()=>e.onAddRecord?.(),children:(0,o.jsx)(la,{colSpan:Wn,className:`h-9 px-3 py-1.5`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground transition-colors`,children:[(0,o.jsx)(l.Plus,{className:`h-3.5 w-3.5`}),G(`table.addRecord`)]})})})]})})]})}),Sn&&(0,o.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`data-table-scroll-shadow-right`,className:`pointer-events-none absolute top-0 z-30 w-6 bg-gradient-to-l from-foreground/10 to-transparent`,style:{right:Sn.right,bottom:Sn.bottom}})]}),c&&!Tt&&wt.length>0&&Dt>1&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-between gap-2 px-3 sm:px-4 py-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsxs)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:[G(`table.rowsPerPage`),`:`]}),(0,o.jsxs)(Gr,{value:Ae.toString(),onValueChange:e=>Pt(Number(e)),children:[(0,o.jsx)(Jr,{className:`w-20`,children:(0,o.jsx)(qr,{})}),(0,o.jsx)(Zr,{children:Ft.map(e=>(0,o.jsx)($r,{value:e.toString(),children:e},e))})]})]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:G(`table.pageInfo`,{current:Et,total:Dt})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(Y,{variant:`outline`,size:`icon`,onClick:()=>Nt(1),disabled:Et===1,"aria-label":G(`table.firstPage`),children:(0,o.jsx)(l.ChevronsLeft,{className:`h-4 w-4`})}),(0,o.jsx)(Y,{variant:`outline`,size:`icon`,onClick:()=>Nt(Et-1),disabled:Et===1,"aria-label":G(`table.previousPage`),children:(0,o.jsx)(l.ChevronLeft,{className:`h-4 w-4`})}),(0,o.jsx)(Y,{variant:`outline`,size:`icon`,onClick:()=>Nt(Et+1),disabled:Et===Dt,"aria-label":G(`table.nextPage`),children:(0,o.jsx)(l.ChevronRight,{className:`h-4 w-4`})}),(0,o.jsx)(Y,{variant:`outline`,size:`icon`,onClick:()=>Nt(Dt),disabled:Et===Dt,"aria-label":G(`table.lastPage`),children:(0,o.jsx)(l.ChevronsRight,{className:`h-4 w-4`})})]})]})]}),dt&&(0,o.jsxs)(`div`,{className:`fixed z-50 min-w-[160px] rounded-md border bg-popover p-1 shadow-md`,style:{left:dt.x,top:dt.y},"data-testid":`column-context-menu`,onClick:e=>e.stopPropagation(),children:[Kt&&zt(Kt)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{Ut(dt.columnKey,`asc`),ft(null)},children:[(0,o.jsx)(l.ChevronUp,{className:`h-3.5 w-3.5`}),G(`table.sortAsc`)]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{Ut(dt.columnKey,`desc`),ft(null)},children:[(0,o.jsx)(l.ChevronDown,{className:`h-3.5 w-3.5`}),G(`table.sortDesc`)]}),(0,o.jsx)(`div`,{className:`my-1 h-px bg-border`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>qt(dt.columnKey),children:[(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`}),G(`table.hideColumn`)]})]})]})},{namespace:`ui`,label:`Data Table`,icon:`table`,inputs:[{name:`caption`,type:`string`},{name:`columns`,type:`array`,description:`Array of { header, accessorKey, className, width, sortable, filterable, resizable }`,required:!0},{name:`data`,type:`array`,description:`Array of data objects`,required:!0},{name:`pagination`,type:`boolean`},{name:`pageSize`,type:`number`},{name:`searchable`,type:`boolean`},{name:`selectable`,type:`boolean`},{name:`sortable`,type:`boolean`},{name:`exportable`,type:`boolean`},{name:`rowActions`,type:`boolean`},{name:`resizableColumns`,type:`boolean`},{name:`reorderableColumns`,type:`boolean`},{name:`className`,type:`string`}],defaultProps:{caption:`Enterprise Data Table`,pagination:!0,pageSize:10,searchable:!0,selectable:!0,sortable:!0,exportable:!0,rowActions:!0,resizableColumns:!0,reorderableColumns:!0,columns:[{header:`ID`,accessorKey:`id`,width:`80px`},{header:`Name`,accessorKey:`name`},{header:`Email`,accessorKey:`email`},{header:`Status`,accessorKey:`status`},{header:`Role`,accessorKey:`role`}],data:[{id:1,name:`John Doe`,email:`john@example.com`,status:`Active`,role:`Admin`},{id:2,name:`Jane Smith`,email:`jane@example.com`,status:`Active`,role:`User`},{id:3,name:`Bob Johnson`,email:`bob@example.com`,status:`Inactive`,role:`User`},{id:4,name:`Alice Williams`,email:`alice@example.com`,status:`Active`,role:`Manager`},{id:5,name:`Charlie Brown`,email:`charlie@example.com`,status:`Active`,role:`User`},{id:6,name:`Diana Prince`,email:`diana@example.com`,status:`Active`,role:`Admin`},{id:7,name:`Ethan Hunt`,email:`ethan@example.com`,status:`Inactive`,role:`User`},{id:8,name:`Fiona Gallagher`,email:`fiona@example.com`,status:`Active`,role:`User`},{id:9,name:`George Wilson`,email:`george@example.com`,status:`Active`,role:`Manager`},{id:10,name:`Hannah Montana`,email:`hannah@example.com`,status:`Active`,role:`User`},{id:11,name:`Ivan Drago`,email:`ivan@example.com`,status:`Inactive`,role:`User`},{id:12,name:`Julia Roberts`,email:`julia@example.com`,status:`Active`,role:`Admin`}]}});function Mm(e){return e?.autoTrigger===!0}function Nm(e){return`auto-trigger-refused:${e.name??e.label??``}`}function Pm(e,t){if(B.toast.warning(t,{id:Nm(e)}),process.env.NODE_ENV!==`production`){let t=typeof e.visible==`string`?e.visible:JSON.stringify(e.visible);console.warn(`[object-ui] action "${e.name??e.label??``}" carries autoTrigger but was NOT run: its own declared \`visible\` gate evaluated false on this surface, and the author's verdict outranks the flag (objectui#4191). Predicate: ${t}.`)}}function Fm(e,n,r){let{t:i}=(0,_.useObjectTranslation)(),o=(0,a.useRef)(!1),s=(0,a.useRef)(!1),c=Mm(e),l=(0,t.hasDeclaredPredicate)(e.visible)&&!n;(0,a.useEffect)(()=>{if(c&&!o.current){if(l){s.current||(s.current=!0,Pm(e,i(`actions.notAvailableHere`,{defaultValue:`"{{action}}" is not available on the current page.`,action:e.label||e.name||``})));return}o.current=!0,r()}},[c,l,r,i,e])}function Im(e){let t=(0,_.useSafeTranslate)(),n=a.default.useId();if(e)return{text:t(`actions.notAvailableForRecord`,`Not available for this record`),id:`${n}-reason`,labelId:`${n}-label`}}function Lm(e,t){let n=[typeof e==`string`?e:``,t?.id??``].map(e=>e.trim()).filter(e=>e!==``);return n.length>0?n.join(` `):void 0}function Rm({reason:e,heading:t,children:n}){return e?(0,o.jsx)(gi,{delayDuration:200,children:(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:(0,o.jsxs)(`span`,{tabIndex:0,"aria-describedby":e.id,"data-disabled-reason":``,className:`inline-flex rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:[n,(0,o.jsx)(`span`,{id:e.id,className:`sr-only`,children:e.text})]})}),(0,o.jsxs)(yi,{children:[t?(0,o.jsx)(`p`,{className:`font-medium`,children:t}):null,(0,o.jsx)(`p`,{children:e.text})]})]})}):n}function zm(e){return e?{"aria-labelledby":e.labelId,"aria-describedby":e.id}:{}}function Bm({reason:e,children:t}){return e?(0,o.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,o.jsx)(`span`,{id:e.labelId,children:t}),(0,o.jsx)(`span`,{id:e.id,className:`text-xs text-muted-foreground`,children:e.text})]}):(0,o.jsx)(`span`,{children:t})}function Vm(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Hm(e,t,n){if(!e.undoable||e.operation!==`update`||!n)return t;let r=t?.recordId??n[e.recordIdField||`id`];return r==null||n.id==null||String(r)!==String(n.id)?t:{...t,_rowRecord:n}}var Um=(0,a.forwardRef)(({schema:e,className:n,context:r,...s},c)=>{let{"data-obj-id":u,"data-obj-type":d,style:f,data:p,disabled:m,...h}=s,{execute:g}=(0,i.useAction)(),[_,v]=(0,a.useState)(!1),y=(0,i.usePredicateRecordContext)(p),b=(0,i.useRecordContext)(),x=Vm(p)??Vm(b?.data),S=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),y,{throwOnError:!0,label:`action "${e.name??e.label??`action:button`}" (visible)`}),C=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),y),w=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),y),T=Im((0,t.hasDeclaredPredicate)(e.disabled)&&C),E=Ga(e.icon),D=e.variant===`primary`?`default`:e.variant||`default`,O=e.size===`md`?`default`:e.size||`default`,k=(0,a.useCallback)(async()=>{if(!_){v(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=Hm(e,bo(e,`action:button`),x),n=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t},i={type:e.actionType,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...n,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,undoable:e.undoable,recordIdField:e.recordIdField,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName};await g({...i,...r})}finally{v(!1)}}},[e,g,_,r,x]);if(Fm(e,S,k),(0,t.hasDeclaredPredicate)(e.visible)&&!S)return null;let A=(0,o.jsxs)(Y,{ref:c,type:`button`,variant:D,size:O,className:q(e.className,n),disabled:m||((0,t.hasDeclaredPredicate)(e.disabled)?C:(0,t.hasDeclaredPredicate)(e.enabled)?!w:!1)||_,onClick:k,...os(h),"aria-describedby":Lm(h[`aria-describedby`],T),"data-obj-id":u,"data-obj-type":d,style:f,children:[_&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!_&&E&&(0,o.jsx)(E,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label]});return(0,o.jsx)(Rm,{reason:T,children:A})});Um.displayName=`ActionButtonRenderer`,t.ComponentRegistry.register(`button`,Um,{namespace:`action`,skipFallback:!0,label:`Action Button`,inputs:[{name:`name`,type:`string`},{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actionType`,type:`enum`,enum:[`script`,`url`,`modal`,`flow`,`api`]},{name:`target`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`primary`,`secondary`,`destructive`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`md`,`lg`,`icon`],description:"Button size: the Button primitive's `default`, `sm`, `lg` or `icon`, plus `md`, which renders as `default` (default: `default`)"},{name:`className`,type:`string`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the button is not rendered when it is false, nor when the predicate fails to evaluate. Omit for always-visible"},{name:`disabled`,type:[`boolean`,`string`,`object`],description:"Disabled predicate, in the same three shapes as `visible`: the button is shown but cannot be pressed while it holds. Omit for never-disabled"},{name:`params`,type:`array`,description:"The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead"},{name:`description`,type:`string`,description:`Action description — the parameter dialog shows it under its title`},{name:`openIn`,type:`enum`,enum:[`self`,`new-tab`],description:"For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab"},{name:`method`,type:`string`,description:"HTTP method of an `api` action (`POST` when omitted)"},{name:`bodyExtra`,type:`object`,description:"Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name"},{name:`bodyShape`,type:[`enum`,`object`],enum:[`flat`],description:"How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it"},{name:`operation`,type:`enum`,enum:[`update`],description:"`update` declares a single-record field write: the row runs the declared action its `name` names, so it needs a `name`. The runner posts the collected values to the platform action route under that name, and the route writes that action's own `patch`"},{name:`confirmText`,type:`string`,description:`Confirmation question asked before the action runs; the action runs only if it is confirmed`},{name:`successMessage`,type:`string`,description:"Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`)"},{name:`errorMessage`,type:`string`,description:`Toast text when the action fails, in place of the raw error`},{name:`refreshAfter`,type:`boolean`,description:`Refresh the surrounding data after the action succeeds`},{name:`locations`,type:`array`,of:`string`,description:"The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one"},{name:`toast`,type:`object`,description:"Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast"},{name:`resultDialog`,type:`object`,description:`One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast`},{name:`onSuccess`,type:`object`,description:"Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab`"},{name:`objectName`,type:`string`,description:`Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object`},{name:`recordIdField`,type:`string`,description:"For a `script` action run against a single selected row: the row field whose value is sent as the record id (default `id`)"},{name:`undoable`,type:`boolean`,description:"Offer an Undo affordance after an update action: once an `operation: update` succeeds, its success toast offers Undo, which writes back the values the fields it wrote held on the record in scope (the record page's record, or the row the host binds), provided that record carries each of them. The one limit: a button with no record in scope (standalone, or writing a record other than the one in scope) offers no Undo, because there is no row to restore"}],defaultProps:{label:`Action`,actionType:`script`,variant:`default`,size:`md`}});var Wm=(0,a.forwardRef)(({schema:e,className:n,context:r,...s},c)=>{let{"data-obj-id":u,"data-obj-type":d,style:f,data:p,disabled:m,...h}=s,{execute:g}=(0,i.useAction)(),[_,v]=(0,a.useState)(!1),y=(0,i.usePredicateRecordContext)(p),b=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),y,{throwOnError:!0,label:`action "${e.name??e.label??`action:icon`}" (visible)`}),x=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),y),S=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),y),C=Im((0,t.hasDeclaredPredicate)(e.disabled)&&x),w=Ga(e.icon),T=e.variant===`primary`?`default`:e.variant||`ghost`,E=(0,a.useCallback)(async()=>{if(!_){v(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=bo(e,`action:icon`),n=Array.isArray(e.params)?{actionParams:e.params,params:t}:{params:t},i={type:e.actionType,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...n,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName};await g({...i,...r})}finally{v(!1)}}},[e,g,_,r]);if(Fm(e,b,E),(0,t.hasDeclaredPredicate)(e.visible)&&!b)return null;let D=(0,o.jsx)(Y,{ref:c,type:`button`,variant:T,size:`icon`,className:q(`h-8 w-8`,e.className,n),disabled:m||((0,t.hasDeclaredPredicate)(e.disabled)?x:(0,t.hasDeclaredPredicate)(e.enabled)?!S:!1)||_,onClick:E,"aria-label":e.label||e.name,...os(h),"aria-describedby":Lm(h[`aria-describedby`],C),"data-obj-id":u,"data-obj-type":d,style:f,children:_?(0,o.jsx)(l.Loader2,{className:`h-4 w-4 animate-spin`}):w?(0,o.jsx)(w,{className:`h-4 w-4`}):(0,o.jsx)(`span`,{className:`text-xs`,children:e.label?.charAt(0)||`?`})});return C?(0,o.jsx)(Rm,{reason:C,heading:e.label||e.description,children:D}):e.label||e.description?(0,o.jsx)(gi,{delayDuration:300,children:(0,o.jsxs)(_i,{children:[(0,o.jsx)(vi,{asChild:!0,children:D}),(0,o.jsx)(yi,{children:(0,o.jsx)(`p`,{children:e.label||e.description})})]})}):D});Wm.displayName=`ActionIconRenderer`,t.ComponentRegistry.register(`icon`,Wm,{namespace:`action`,skipFallback:!0,label:`Action Icon`,inputs:[{name:`name`,type:`string`},{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actionType`,type:`enum`,enum:[`script`,`url`,`modal`,`flow`,`api`]},{name:`target`,type:`string`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`]},{name:`className`,type:`string`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the icon is not rendered when it is false. Omit for always-visible"},{name:`disabled`,type:[`boolean`,`string`,`object`],description:"Disabled predicate, in the same three shapes as `visible`: the icon is shown but cannot be pressed while it holds. Omit for never-disabled"},{name:`params`,type:`array`,description:"The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead"},{name:`description`,type:`string`,description:"Action description — the tooltip text when there is no `label`, and what the parameter dialog shows under its title"},{name:`openIn`,type:`enum`,enum:[`self`,`new-tab`],description:"For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab"},{name:`method`,type:`string`,description:"HTTP method of an `api` action (`POST` when omitted)"},{name:`bodyExtra`,type:`object`,description:"Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name"},{name:`bodyShape`,type:[`enum`,`object`],enum:[`flat`],description:"How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it"},{name:`operation`,type:`enum`,enum:[`update`],description:"`update` declares a single-record field write: the row runs the declared action its `name` names, so it needs a `name`. The runner posts the collected values to the platform action route under that name, and the route writes that action's own `patch`"},{name:`confirmText`,type:`string`,description:`Confirmation question asked before the action runs; the action runs only if it is confirmed`},{name:`successMessage`,type:`string`,description:"Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`)"},{name:`errorMessage`,type:`string`,description:`Toast text when the action fails, in place of the raw error`},{name:`refreshAfter`,type:`boolean`,description:`Refresh the surrounding data after the action succeeds`},{name:`locations`,type:`array`,of:`string`,description:"The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one"},{name:`toast`,type:`object`,description:"Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast"},{name:`resultDialog`,type:`object`,description:`One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast`},{name:`onSuccess`,type:`object`,description:"Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab`"},{name:`objectName`,type:`string`,description:`Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object`}],defaultProps:{icon:`play`,actionType:`script`,variant:`ghost`}});function Gm(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`detail.moreActions`);return!t||t===`detail.moreActions`?`More actions`:t}function Km(e,t){let n=(0,i.usePredicateRecordContext)(t);return{recordData:n,isVisible:(0,i.useCondition)((0,i.toPredicateInput)(e.visible),n,{throwOnError:!0,label:`action "${e.name??e.label??`action:menu item`}" (visible)`})}}var qm=({action:e,onExecute:n,record:r})=>{let{recordData:s,isVisible:c}=Km(e,r),l=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),s),u=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),s),d=Im((0,t.hasDeclaredPredicate)(e.disabled)&&l),f=(0,a.useMemo)(()=>{let t=Ga(e.icon);return t?(0,o.jsx)(t,{className:`mr-2 h-4 w-4`}):null},[e.icon]);return(0,t.hasDeclaredPredicate)(e.visible)&&!c?null:(0,o.jsxs)(Pn,{disabled:(0,t.hasDeclaredPredicate)(e.disabled)?l:(0,t.hasDeclaredPredicate)(e.enabled)?!u:!1,...zm(d),onSelect:t=>{t.preventDefault(),n(e)},className:q(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[f,(0,o.jsx)(Bm,{reason:d,children:e.label||e.name})]})};qm.displayName=`ActionMenuItem`;var Jm=({action:e,onExecute:t,record:n})=>{let{isVisible:r}=Km(e,n);return Fm(e,r,(0,a.useCallback)(()=>t(e),[e,t])),null};Jm.displayName=`ActionAutoTrigger`;var Ym=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":c,style:u,data:d,disabled:f,...p}=n,{execute:m}=(0,i.useAction)(),[h,g]=(0,a.useState)(!1),_=Gm(),v=(0,i.usePredicateRecordContext)(d),y=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),v,{throwOnError:!0,label:`action:menu "${e.label??e.icon??`menu`}" (visible)`}),b=Ga(e.icon)||l.MoreHorizontal,x=e.variant||`ghost`,S=e.size||`icon`,C=(0,a.useCallback)(async e=>{g(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}let t=Array.isArray(e.params)?{actionParams:e.params}:{params:So(e,e.type,`action:menu`)};await m({type:e.type,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...t,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName})}finally{g(!1)}},[m]);if(e.visible&&!y)return null;let w=e.actions||[];return w.length===0?null:(0,o.jsxs)(o.Fragment,{children:[w.map((e,t)=>(0,o.jsx)(Jm,{action:e,onExecute:C,record:d},`auto-trigger:${e.name||t}`)),(0,o.jsxs)(Tn,{children:[(0,o.jsx)(En,{asChild:!0,children:(0,o.jsx)(Y,{ref:r,type:`button`,variant:x,size:S,className:q(S===`icon`&&`h-8 w-8`,e.className,t),disabled:f||h,"aria-label":e.label||_,...p,"data-obj-id":s,"data-obj-type":c,style:u,children:h?(0,o.jsx)(l.Loader2,{className:`h-4 w-4 animate-spin`}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(b,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label&&(0,o.jsx)(`span`,{children:e.label})]})})}),(0,o.jsx)(Nn,{align:`end`,children:w.map((e,t)=>{let n=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[n&&(0,o.jsx)(Rn,{}),(0,o.jsx)(qm,{action:e,onExecute:C,record:d})]},e.name||t)})})]})]})});Ym.displayName=`ActionMenuRenderer`,t.ComponentRegistry.register(`menu`,Ym,{namespace:`action`,skipFallback:!0,label:`Action Menu`,inputs:[{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actions`,type:`array`,of:`object`,description:"The menu's actions, in order. Each member is an action object the menu draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `visible`, `disabled`, `tags`, …); a member's executor is its own `type`"},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],description:"Trigger button size (renderer default: `icon`)"},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate for the whole menu: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; a predicate that fails to evaluate hides it. Omit for always-visible"},{name:`className`,type:`string`}],defaultProps:{variant:`ghost`,actions:[]}});function Xm(e,t){return(0,i.useCondition)((0,i.toPredicateInput)(e.visible),t,{throwOnError:!0,label:`action "${e.name??e.label??`action:group member`}" (visible)`})}var Zm=({action:e,variant:n,size:r,onExecute:s,record:c,hostDisabled:u})=>{let[d,f]=(0,a.useState)(!1),p=(0,i.usePredicateRecordContext)(c),m=Xm(e,p),h=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),p),g=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),p),_=Im((0,t.hasDeclaredPredicate)(e.disabled)&&h),v=Ga(e.icon),y=e.variant===`primary`?`default`:e.variant||n||`outline`,b=e.size===`md`?`default`:e.size||r||`sm`,x=(0,a.useCallback)(async()=>{if(!d){f(!0);try{await s(e)}finally{f(!1)}}},[e,s,d]);if((0,t.hasDeclaredPredicate)(e.visible)&&!m)return null;let S=(0,o.jsxs)(Y,{type:`button`,variant:y,size:b,className:e.className,disabled:u||((0,t.hasDeclaredPredicate)(e.disabled)?h:(0,t.hasDeclaredPredicate)(e.enabled)?!g:!1)||d,"aria-describedby":_?.id,onClick:x,children:[d&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!d&&v&&(0,o.jsx)(v,{className:q(`h-4 w-4`,e.label&&`mr-2`)}),e.label]});return(0,o.jsx)(Rm,{reason:_,children:S})};Zm.displayName=`InlineActionButton`;var Qm=({action:e,index:n,onSelect:r,record:a})=>{let s=(0,i.usePredicateRecordContext)(a),c=Xm(e,s),l=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),s),u=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),s),d=Im((0,t.hasDeclaredPredicate)(e.disabled)&&l);if((0,t.hasDeclaredPredicate)(e.visible)&&!c)return null;let f=Ga(e.icon),p=(0,t.hasDeclaredPredicate)(e.disabled)?l:(0,t.hasDeclaredPredicate)(e.enabled)?!u:!1,m=e.tags?.includes(`separator-before`)&&n>0;return(0,o.jsxs)(o.Fragment,{children:[m&&(0,o.jsx)(Rn,{}),(0,o.jsxs)(Pn,{disabled:p,...zm(d),onSelect:async t=>{t.preventDefault(),!p&&await r(e)},className:q(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[f&&(0,o.jsx)(f,{className:`mr-2 h-4 w-4`}),(0,o.jsx)(Bm,{reason:d,children:e.label||e.name})]})]})};Qm.displayName=`DropdownActionItem`;var $m=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":c,style:u,data:d,disabled:f,...p}=n,{execute:m}=(0,i.useAction)(),[h,g]=(0,a.useState)(!1),_=(0,i.usePredicateRecordContext)(d),v=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),_,{throwOnError:!0,label:`action:group "${e.label??e.icon??`group`}" (visible)`}),y=(e.actions||[]).filter(t=>(0,se.actionRendersAt)(t,e.location)),b=(0,a.useCallback)(async e=>{if(typeof e.onClick==`function`){await e.onClick();return}let t=Array.isArray(e.params)?{actionParams:e.params}:{params:So(e,e.type,`action:group`)};await m({type:e.type,name:e.name,label:e.label,description:e.description,target:e.target,openIn:e.openIn,endpoint:e.endpoint,method:e.method,...t,bodyExtra:e.bodyExtra,bodyShape:e.bodyShape,operation:e.operation,confirmText:e.confirmText,successMessage:e.successMessage,outcomeMessages:e.outcomeMessages,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,locations:e.locations,toast:e.toast,resultDialog:e.resultDialog,onSuccess:e.onSuccess,objectName:e.objectName})},[m]),x=(0,a.useCallback)(async e=>{g(!0);try{await b(e)}finally{g(!1)}},[b]);if(e.visible&&!v||y.length===0)return null;if((e.display||`inline`)===`dropdown`){let n=Ga(e.icon);return(0,o.jsxs)(Tn,{children:[(0,o.jsx)(En,{asChild:!0,children:(0,o.jsxs)(Y,{type:`button`,variant:e.variant||`outline`,size:e.size===`md`?`default`:e.size||`default`,className:q(e.className,t),disabled:f||h,"data-obj-id":s,"data-obj-type":c,style:u,children:[h&&(0,o.jsx)(l.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!h&&n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label||`Actions`,(0,o.jsx)(l.ChevronDown,{className:`ml-2 h-3 w-3 opacity-50`})]})}),(0,o.jsx)(Nn,{align:`end`,children:y.map((e,t)=>(0,o.jsx)(Qm,{action:e,index:t,onSelect:x,record:d},e.name||t))})]})}return(0,o.jsx)(`div`,{ref:r,className:q(`flex items-center gap-2`,e.className,t),...p,"data-obj-id":s,"data-obj-type":c,style:u,children:y.map(t=>(0,o.jsx)(Zm,{action:t,variant:e.variant,size:e.size,onExecute:b,record:d,hostDisabled:f},t.name))})});$m.displayName=`ActionGroupRenderer`,t.ComponentRegistry.register(`group`,$m,{namespace:`action`,skipFallback:!0,label:`Action Group`,inputs:[{name:`label`,type:`string`},{name:`icon`,type:`string`},{name:`actions`,type:`array`,of:`object`,description:"The actions in this group, in order. Each member is an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `locations`, `visible`, `disabled`, …); a member's executor is its own `type`"},{name:`display`,type:`enum`,enum:[`inline`,`dropdown`]},{name:`location`,type:`enum`,enum:[...se.ACTION_LOCATIONS],description:"Render only the members whose `locations` include this location. Omit to render every member"},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],description:`Button size for the dropdown trigger and for every inline member that sets none`},{name:`visible`,type:[`boolean`,`string`,`object`],description:"Visibility predicate for the whole group: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds. Omit for always-visible"},{name:`className`,type:`string`}],defaultProps:{display:`inline`,variant:`outline`,size:`sm`,actions:[]}});function eh(){let{t:e}=(0,_.useObjectTranslation)(),t=e(`common.actions`);return!t||t===`common.actions`?`Actions`:t}var th=(0,a.forwardRef)(({schema:e,className:n,...r},s)=>{let c=eh(),{"data-obj-id":l,"data-obj-type":u,style:d,data:f,actions:p,systemActions:m,location:h,maxVisible:g,mobileMaxVisible:_,direction:v,gap:y,variant:b,size:x,visible:S,...C}=r,w=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),void 0,{throwOnError:!0,label:`action:bar${e.location?` (${e.location})`:``} (visible)`}),T=mi(),E=(0,i.useCapabilityGate)(),D=(0,i.useConfigBagEvaluator)(),O=(0,a.useMemo)(()=>{let t=(e.actions||[]).filter(e=>E(e?.requiredPermissions)).filter(t=>(0,se.actionRendersAt)(t,e.location)),n=new Set,r=t.filter(e=>!e.name||!n.has(e.name)&&(n.add(e.name),!0));return r.some(e=>e.order!==void 0||e.variant===`primary`)?[...r].sort((e,t)=>{let n=(e.order??0)-(t.order??0);return n===0?(e.variant===`primary`?0:1)-(t.variant===`primary`?0:1):n}):r},[e.actions,e.location,E]),k=(0,a.useMemo)(()=>{let t=e.systemActions||[],n=new Set;return t.filter(e=>E(e?.requiredPermissions)?!e.name||!n.has(e.name)&&(n.add(e.name),!0):!1)},[e.systemActions,E]),A=T?e.mobileMaxVisible??1:e.maxVisible??3,{inlineActions:j,overflowActions:M}=(0,a.useMemo)(()=>{let e=O.filter(e=>e.component===`action:menu`),t=O.filter(e=>e.component!==`action:menu`);return{inlineActions:t.slice(0,A),overflowActions:[...t.slice(A),...e]}},[O,A]),N=(0,a.useMemo)(()=>{let e=[];for(let t of j){if(t.component!==`action:group`){e.push(t);continue}let n=e[e.length-1];Array.isArray(n)?n.push(t):e.push([t])}return e},[j]),P=(0,a.useMemo)(()=>{if(k.length===0)return M;if(M.length===0)return k;let[e,...t]=k,n={...e,tags:[...e.tags||[],`separator-before`]};return[...M,n,...t]},[M,k]);if(e.visible&&!w||O.length===0&&k.length===0)return null;let F=e.direction||`horizontal`,I=e.gap||`gap-2`,ee=P.length>0?t.ComponentRegistry.get(`action:menu`):null,L=ee?(0,o.jsx)(ee,{schema:{type:`action:menu`,actions:P,variant:e.variant||`ghost`,size:e.size||`sm`},data:f}):null,R=(n,r)=>{let i=t.ComponentRegistry.get(r);return i?(0,o.jsx)(i,{schema:{...xo(n,D),type:r,actionType:n.type,variant:n.variant||e.variant,size:n.size||e.size},data:f},n.name):null};return(0,o.jsxs)(`div`,{ref:s,className:q(`flex items-center`,F===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap`,I,e.className,n),role:`toolbar`,"aria-label":c,...C,"data-obj-id":l,"data-obj-type":u,style:d,children:[N.map((e,t)=>Array.isArray(e)?(0,o.jsx)(Lc,{orientation:F===`vertical`?`vertical`:`horizontal`,className:`empty:hidden`,children:e.map(e=>R(e,`action:button`))},`group:${e[0].name??t}`):R(e,e.component||`action:button`)),P.length>0&&L]})});th.displayName=`ActionBarRenderer`,t.ComponentRegistry.register(`bar`,th,{namespace:`action`,skipFallback:!0,label:`Action Bar`,inputs:[{name:`actions`,type:`object`},{name:`systemActions`,type:`object`},{name:`location`,type:`enum`,enum:[...se.ACTION_LOCATIONS]},{name:`maxVisible`,type:`number`},{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`]},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`outline`,`ghost`]},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`]},{name:`className`,type:`string`}],defaultProps:{maxVisible:3,direction:`horizontal`,variant:`outline`,size:`sm`,actions:[]}});var nh=({schema:e,className:t})=>{let n=e.type,r=n.startsWith(`view:`),i=n.startsWith(`widget:`),a=n.startsWith(`field:`);return(0,o.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg bg-muted/30 transition-colors hover:bg-muted/50`,r&&`border-blue-300 bg-blue-50/50 min-h-[200px]`,i&&`border-purple-300 bg-purple-50/50 min-h-[150px]`,a&&`border-yellow-300 bg-yellow-50/50 p-2 min-h-[40px] flex-row gap-2 justify-start`,t),children:[(0,o.jsxs)(`div`,{className:q(`flex items-center gap-2 text-muted-foreground`,a&&`text-sm`),children:[a?(0,o.jsx)(l.Box,{className:`h-4 w-4`}):(0,o.jsx)(l.FileQuestion,{className:`h-8 w-8 mb-2 opacity-50`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,o.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:n}),!a&&(0,o.jsx)(`span`,{className:`text-xs`,children:`Component Placeholder`})]})]}),e.props&&!a&&(0,o.jsxs)(`div`,{className:`mt-4 w-full text-xs text-muted-foreground bg-background/50 p-2 rounded overflow-hidden`,children:[(0,o.jsx)(`div`,{className:`opacity-70`,children:`Properties:`}),(0,o.jsx)(`pre`,{className:`mt-1 truncate`,children:JSON.stringify(e.props,null,0)})]})]})},rh=`view:grid.view:kanban.view:map.view:calendar.view:gantt.view:timeline.view:gallery.view:simple.view:wizard.view:tabbed.view:drawer.view:modal.view:split.field:text.field:textarea.field:password.field:email.field:url.field:phone.field:markdown.field:html.field:code.field:number.field:currency.field:percent.field:slider.field:boolean.field:checkboxes.field:select.field:multiselect.field:radio.field:date.field:datetime.field:time.field:duration.field:lookup.field:master_detail.field:tree.field:image.field:file.field:video.field:audio.field:avatar.field:color.field:rating.field:signature.field:qrcode.field:progress.field:json.field:address.field:location.page:header.page:footer.page:tabs.page:accordion.page:card.page:sidebar.record:details.record:highlights.record:related_list.record:activity.record:chatter.record:path.app:launcher.nav:menu.nav:breadcrumb.global:search.global:notifications.widget:metric.widget:bar.widget:line.widget:pie.widget:funnel.widget:radar.widget:scatter.widget:heatmap.widget:pivot.widget:table.widget:text.widget:image.ai:input.ai:suggestion.ai:feedback`.split(`.`),ih=[`nav:menu`,`nav:breadcrumb`,`global:search`,`ai:suggestion`];function ah(e){t.ComponentRegistry.hasLazy(e)||t.ComponentRegistry.get(e)||t.ComponentRegistry.register(e,nh,{namespace:`protocol-placeholder`})}function oh(){rh.forEach(ah)}ih.forEach(ah);var sh={info:{Icon:l.Info,tone:`border-border bg-muted/50 text-foreground`,iconTone:`text-muted-foreground`},success:{Icon:l.CheckCircle2,tone:`border-emerald-300/70 bg-emerald-50 text-emerald-900 dark:border-emerald-700/60 dark:bg-emerald-950/40 dark:text-emerald-200`,iconTone:`text-emerald-600 dark:text-emerald-400`},warning:{Icon:l.AlertTriangle,tone:`border-amber-300/70 bg-amber-50 text-amber-900 dark:border-amber-700/60 dark:bg-amber-950/40 dark:text-amber-200`,iconTone:`text-amber-600 dark:text-amber-400`},error:{Icon:l.XCircle,tone:`border-destructive/50 bg-destructive/10 text-destructive dark:text-destructive-foreground`,iconTone:`text-destructive`}};function ch(e){return sh[e??`info`]??sh.info}function lh(e){return no(e.icon)?io(e.icon):ch(e.severity).Icon}var uh={primary:`default`,secondary:`secondary`,link:`link`};function dh(e){return uh[e??`primary`]??uh.primary}var fh={top_left:`top-4 left-4`,top_center:`top-4 left-1/2 -translate-x-1/2`,top_right:`top-4 right-4`,bottom_left:`bottom-4 left-4`,bottom_center:`bottom-4 left-1/2 -translate-x-1/2`,bottom_right:`bottom-4 right-4`,"top-left":`top-4 left-4`,"top-center":`top-4 left-1/2 -translate-x-1/2`,"top-right":`top-4 right-4`,"bottom-left":`bottom-4 left-4`,"bottom-center":`bottom-4 left-1/2 -translate-x-1/2`,"bottom-right":`bottom-4 right-4`};function ph({className:e}){let t=(0,i.useNotificationsByPresentation)(`banner`),{dismiss:n,config:r}=(0,i.useNotifications)();if(t.length===0)return null;let a=(0,i.visibleNotificationStack)(t,r);return(0,o.jsx)(`div`,{className:q(`flex w-full flex-col`,e),"data-notification-surface":`banner`,children:a.map(e=>{let{tone:t}=ch(e.severity),r=lh(e);return(0,o.jsxs)(`div`,{role:`status`,"data-severity":e.severity,className:q(`flex w-full items-center gap-3 border-b px-4 py-2.5 text-sm`,t),children:[(0,o.jsx)(r,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,o.jsx)(`span`,{className:`font-medium`,children:e.title}),e.message?(0,o.jsx)(`span`,{className:`min-w-0 opacity-90`,children:e.message}):null]}),e.actions?.map(e=>(0,o.jsx)(Y,{size:`sm`,variant:dh(e.variant),className:`h-7 shrink-0`,onClick:e.onClick,children:e.label},e.label)),e.dismissible===!1?null:(0,o.jsx)(Y,{size:`icon`,variant:`ghost`,className:`h-7 w-7 shrink-0`,"aria-label":`Dismiss ${e.title}`,onClick:()=>n(e.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`,"aria-hidden":`true`})})]},e.id)})})}ph.displayName=`NotificationBanners`;function mh({className:e}){let t=(0,i.useNotificationsByPresentation)(`snackbar`),{dismiss:n,config:r,pauseAutoDismiss:a,resumeAutoDismiss:s}=(0,i.useNotifications)(),c=t[0];if(!c)return null;let{iconTone:u}=ch(c.severity),d=lh(c),f=c.actions?.[0],p=(0,i.resolveNotificationPosition)(c,r),m=p?fh[p]:`bottom-4 left-1/2 -translate-x-1/2`,h=p?.startsWith(`top`)?`motion-safe:slide-in-from-top-4`:`motion-safe:slide-in-from-bottom-4`;return(0,o.jsxs)(`div`,{className:q(`fixed z-50 flex w-[min(28rem,calc(100vw-2rem))]`,m,`items-center gap-3 rounded-md border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-lg`,`motion-safe:animate-in motion-safe:fade-in`,h,e),role:`status`,"aria-live":`polite`,"data-notification-surface":`snackbar`,"data-severity":c.severity,"data-position":p,onPointerEnter:r.pauseOnHover?()=>a(c.id):void 0,onPointerLeave:r.pauseOnHover?()=>s(c.id):void 0,children:[(0,o.jsx)(d,{className:q(`h-4 w-4 shrink-0`,u),"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-medium`,children:c.title}),c.message?(0,o.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:c.message}):null]}),f?(0,o.jsx)(Y,{size:`sm`,variant:dh(f.variant),className:`h-7 shrink-0 font-semibold uppercase tracking-wide`,onClick:()=>{f.onClick(),n(c.id)},children:f.label}):null,c.dismissible===!1?null:(0,o.jsx)(Y,{size:`icon`,variant:`ghost`,className:`h-7 w-7 shrink-0`,"aria-label":`Dismiss ${c.title}`,onClick:()=>n(c.id),children:(0,o.jsx)(l.X,{className:`h-4 w-4`,"aria-hidden":`true`})})]})}mh.displayName=`NotificationSnackbar`;var hh={default:void 0,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,link:`bg-transparent text-primary underline-offset-4 hover:bg-transparent hover:underline`};function gh({className:e,acknowledgeLabel:t=`OK`}){let n=(0,i.useNotificationsByPresentation)(`alert`),{dismiss:r}=(0,i.useNotifications)(),a=n[n.length-1];if(!a)return null;let{iconTone:s}=ch(a.severity),c=lh(a),l=()=>r(a.id),u=a.dismissible===!1;return(0,o.jsx)(X,{open:!0,onOpenChange:e=>{!e&&!u&&l()},children:(0,o.jsxs)(Fe,{className:e,"data-notification-surface":`alert`,"data-severity":a.severity,onEscapeKeyDown:e=>{u&&e.preventDefault()},children:[(0,o.jsxs)(Ie,{children:[(0,o.jsxs)(Re,{className:`flex items-center gap-2`,children:[(0,o.jsx)(c,{className:q(`h-5 w-5 shrink-0`,s),"aria-hidden":`true`}),a.title]}),a.message?(0,o.jsx)(ze,{children:a.message}):null]}),(0,o.jsxs)(Le,{children:[a.actions?.map(e=>(0,o.jsx)(Be,{className:q(hh[dh(e.variant)]),onClick:()=>{e.onClick(),l()},children:e.label},e.label)),(0,o.jsx)(Be,{className:q(a.actions?.length?hh.secondary:void 0),onClick:l,children:t})]})]})})}gh.displayName=`NotificationAlerts`;function _h({scope:e,className:t}){let n=(0,i.useNotificationsByPresentation)(`inline`,e),{dismiss:r,config:a}=(0,i.useNotifications)();if(n.length===0)return null;let s=(0,i.visibleNotificationStack)(n,a);return(0,o.jsx)(`div`,{className:q(`flex w-full flex-col gap-2`,t),"data-notification-surface":`inline`,"data-scope":e,children:s.map(e=>{let{tone:t}=ch(e.severity),n=lh(e);return(0,o.jsxs)(`div`,{role:`status`,"data-severity":e.severity,className:q(`flex items-start gap-3 rounded-md border px-3 py-2 text-sm`,t),children:[(0,o.jsx)(n,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`font-medium`,children:e.title}),e.message?(0,o.jsx)(`div`,{className:`opacity-90`,children:e.message}):null,e.actions?.length?(0,o.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map(e=>(0,o.jsx)(Y,{size:`sm`,variant:dh(e.variant),className:`h-7`,onClick:e.onClick,children:e.label},e.label))}):null]}),e.dismissible===!1?null:(0,o.jsx)(Y,{size:`icon`,variant:`ghost`,className:`-mr-1 h-6 w-6 shrink-0`,"aria-label":`Dismiss ${e.title}`,onClick:()=>r(e.id),children:(0,o.jsx)(l.X,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})]},e.id)})})}_h.displayName=`NotificationInline`;function vh(e,t){let n=t?.maxHistory??50,[r,i]=(0,a.useState)({...e}),[o,s]=(0,a.useState)(t?.mode===`create`),c=(0,a.useRef)([]),l=(0,a.useRef)([]),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{i({...e}),s(t?.mode===`create`),c.current=[],l.current=[]},[e]);let d=(0,a.useCallback)((e,r)=>{i(t=>(c.current=[...c.current.slice(-(n-1)),t],l.current=[],{...t,[e]:r})),s(!0),u(e=>e+1),t?.onUpdate?.(e,r)},[t?.onUpdate,n]),f=(0,a.useCallback)(()=>{c.current.length!==0&&(i(e=>{let t=[...c.current],n=t.pop();return c.current=t,l.current=[e,...l.current],n}),u(e=>e+1))},[]),p=(0,a.useCallback)(()=>{l.current.length!==0&&(i(e=>{let t=[...l.current],n=t.shift();return l.current=t,c.current=[...c.current,e],n}),u(e=>e+1))},[]);return{draft:r,isDirty:o,updateField:d,discard:(0,a.useCallback)(()=>{i({...e}),s(!1),c.current=[],l.current=[],u(e=>e+1)},[e]),setDraft:i,undo:f,redo:p,canUndo:c.current.length>0,canRedo:l.current.length>0}}function yh(e){let[t,n]=a.useState({width:0,height:0});return a.useEffect(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=t.getBoundingClientRect();n(e=>e.width===r.width&&e.height===r.height?e:{width:r.width,height:r.height});let i=new ResizeObserver(e=>{let t=e[0];if(!t)return;let r,i=t.borderBoxSize?.[0];r=i?{width:i.inlineSize,height:i.blockSize}:{width:t.contentRect.width,height:t.contentRect.height},n(e=>e.width===r.width&&e.height===r.height?e:r)});return i.observe(t),()=>i.disconnect()},[e]),t}function bh({schema:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No schema available`})}function xh({dataContext:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No data context available`})}function Sh(){let e=(0,a.useMemo)(()=>{try{return t.ComponentRegistry.getAllTypes()}catch{return[]}},[]);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No registered components`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded text-xs font-mono bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-green-500 shrink-0`}),e]},e)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` component`,e.length===1?``:`s`,` registered`]})]})}function Ch({flags:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No debug flags`})}function wh(e){let n=t.DebugCollector.getInstance(),[r,i]=(0,a.useState)(()=>n.getEntries(e));return a.default.useEffect(()=>(i(n.getEntries(e)),n.subscribe(()=>{i(n.getEntries(e))})),[n,e]),r}function Th(){let e=wh(`perf`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No performance data collected yet`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:q(`flex items-center justify-between px-2 py-1 rounded text-xs font-mono`,e.durationMs>16?`bg-red-50 text-red-700`:`bg-muted/30`),children:[(0,o.jsxs)(`span`,{className:`truncate mr-2`,children:[e.type,e.id?`:${e.id}`:``]}),(0,o.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[e.durationMs.toFixed(2),`ms`]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` render`,e.length===1?``:`s`,` tracked`]})]})}function Eh(){let e=wh(`expr`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No expression evaluations tracked yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsx)(`div`,{className:`text-muted-foreground truncate`,children:e.expression}),(0,o.jsxs)(`div`,{className:`mt-0.5`,children:[`→ `,JSON.stringify(e.result)]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` evaluation`,e.length===1?``:`s`,` tracked`]})]})}function Dh(){let e=wh(`event`),t=(0,_.useDisplayLocale)(),n=e.map(e=>e.data);return n.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No events captured yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[n.map((e,n)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsx)(`span`,{className:`font-semibold`,children:e.action}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(t)})]}),e.payload!==void 0&&(0,o.jsx)(`pre`,{className:`mt-0.5 text-[10px] text-muted-foreground truncate`,children:JSON.stringify(e.payload)})]},n)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[n.length,` event`,n.length===1?``:`s`,` captured`]})]})}function Oh({open:e,onClose:t,flags:n,schema:r,dataContext:i,extraTabs:s=[],className:c}){let l=(0,a.useMemo)(()=>[{id:`schema`,label:`Schema`,render:()=>(0,o.jsx)(bh,{schema:r})},{id:`data`,label:`Data`,render:()=>(0,o.jsx)(xh,{dataContext:i})},{id:`perf`,label:`Perf`,render:()=>(0,o.jsx)(Th,{})},{id:`expr`,label:`Expr`,render:()=>(0,o.jsx)(Eh,{})},{id:`events`,label:`Events`,render:()=>(0,o.jsx)(Dh,{})},{id:`registry`,label:`Registry`,render:()=>(0,o.jsx)(Sh,{})},{id:`flags`,label:`Flags`,render:()=>(0,o.jsx)(Ch,{flags:n})}],[r,i,n]),u=(0,a.useMemo)(()=>[...l,...s],[l,s]),[d,f]=(0,a.useState)(u[0]?.id??`schema`),p=u.find(e=>e.id===d)??u[0],m=(0,a.useCallback)(e=>{f(e)},[]);return e?(0,o.jsxs)(`div`,{className:q(`fixed bottom-4 right-4 z-[9999] w-[420px] max-w-[95vw] rounded-lg border bg-background shadow-2xl`,`flex flex-col overflow-hidden`,c),"data-testid":`debug-panel`,role:`dialog`,"aria-label":`Developer Debug Panel`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`🛠 Debug Panel`}),(0,o.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground text-sm leading-none px-1`,"aria-label":`Close debug panel`,"data-testid":`debug-panel-close`,children:`✕`})]}),(0,o.jsx)(`div`,{className:`flex border-b overflow-x-auto`,role:`tablist`,children:u.map(e=>(0,o.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===p?.id,onClick:()=>m(e.id),className:q(`px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors`,e.id===p?.id?`border-b-2 border-primary text-foreground`:`text-muted-foreground hover:text-foreground`),"data-testid":`debug-tab-${e.id}`,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-1`,children:e.icon}),e.label]},e.id))}),(0,o.jsx)(`div`,{className:`p-3 overflow-auto max-h-[50vh]`,"data-testid":`debug-panel-content`,children:p?.render()})]}):null}var kh={permission:`view`,audience:`link_only`,expiresInDays:7,password:``,label:``},Ah=[{label:`1 day`,value:1},{label:`7 days`,value:7},{label:`30 days`,value:30},{label:`90 days`,value:90},{label:`Never`,value:null}],jh=[{value:`link_only`,label:`Anyone with the link`,help:`No sign-in required`},{value:`signed_in`,label:`Signed-in users`,help:`Must be logged in to view`}];function Mh(e,t){return`${(e??(typeof window<`u`?`${window.location.origin}/s`:`/s`)).replace(/\/+$/,``)}/${t}`}async function Nh(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document<`u`){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),document.body.removeChild(t),!0}catch{document.body.removeChild(t)}}return!1}function Ph({open:e,onOpenChange:t,objectName:n,recordId:r,recordLabel:i,apiBase:s,publicBaseUrl:c,fetchHeaders:u}){let[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),[y,b]=(0,a.useState)(kh),[x,S]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{let e={"Content-Type":`application/json`};if(!u)return e;let t=await u();return{...e,...t}},[u]),w=(0,a.useMemo)(()=>`${s.replace(/\/+$/,``)}/v1/share-links?object=${encodeURIComponent(n)}&recordId=${encodeURIComponent(r)}`,[s,n,r]),T=(0,a.useCallback)(async()=>{m(!0),v(null);try{let e=await C(),t=await fetch(w,{headers:e,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(n.links??n.data??[])}catch(e){v(e?.message??`Failed to load share links`)}finally{m(!1)}},[w,C]);(0,a.useEffect)(()=>{e&&(T(),b(kh))},[e,T]);let E=(0,a.useCallback)(async()=>{g(!0),v(null);try{let e=y.expiresInDays==null?void 0:new Date(Date.now()+y.expiresInDays*24*60*60*1e3).toISOString(),t=await C(),i=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links`,{method:`POST`,headers:t,credentials:`include`,body:JSON.stringify({object:n,recordId:r,permission:y.permission,audience:y.audience,expiresAt:e,password:y.password.trim()||void 0,label:y.label.trim()||void 0})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message||`HTTP ${i.status}`)}let a=await i.json(),o=a.link??a.data;if(!o)throw Error(`Share link create response missing link payload`);f(e=>[o,...e]),await Nh(Mh(c,o.token))&&(S(o.id),setTimeout(()=>S(null),1500)),b(kh)}catch(e){v(e?.message??`Failed to create share link`)}finally{g(!1)}},[s,C,n,r,y,c]),D=(0,a.useCallback)(async e=>{try{let t=await C(),n=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links/${encodeURIComponent(e.id)}`,{method:`DELETE`,headers:t,credentials:`include`});if(!n.ok&&n.status!==204)throw Error(`HTTP ${n.status}`);f(t=>t.map(t=>t.id===e.id?{...t,revoked_at:new Date().toISOString()}:t))}catch(e){v(e?.message??`Failed to revoke link`)}},[s,C]),O=(0,a.useCallback)(async e=>{await Nh(Mh(c,e.token))&&(S(e.id),setTimeout(()=>S(null),1500))},[c]),k=d.filter(e=>!e.revoked_at),A=d.filter(e=>e.revoked_at);return(0,o.jsx)(Pt,{open:e,onOpenChange:t,children:(0,o.jsxs)(zt,{className:`max-w-xl`,"data-testid":`share-dialog`,children:[(0,o.jsxs)(Bt,{children:[(0,o.jsxs)(Ht,{className:`flex items-center gap-2`,children:[(0,o.jsx)(l.Link2,{className:`h-4 w-4`}),`Share `,i??`this record`]}),(0,o.jsx)(Ut,{children:`Generate a link anyone (or selected people) can use to open this record. Links can be revoked at any time.`})]}),_&&(0,o.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,"data-testid":`share-dialog-error`,children:_}),(0,o.jsxs)(`section`,{className:`space-y-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(Vn,{className:`text-xs`,children:`Who can access`}),(0,o.jsxs)(Gr,{value:y.audience,onValueChange:e=>b(t=>({...t,audience:e})),children:[(0,o.jsx)(Jr,{className:`h-8 text-xs`,"data-testid":`share-audience`,children:(0,o.jsx)(qr,{})}),(0,o.jsx)(Zr,{children:jh.map(e=>(0,o.jsx)($r,{value:e.value,className:`text-xs`,children:(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[(0,o.jsx)(`span`,{children:e.label}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.help})]})},e.value))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(Vn,{className:`text-xs`,children:`Expires in`}),(0,o.jsxs)(Gr,{value:y.expiresInDays==null?`never`:String(y.expiresInDays),onValueChange:e=>b(t=>({...t,expiresInDays:e===`never`?null:Number(e)})),children:[(0,o.jsx)(Jr,{className:`h-8 text-xs`,"data-testid":`share-expiry`,children:(0,o.jsx)(qr,{})}),(0,o.jsx)(Zr,{children:Ah.map(e=>(0,o.jsx)($r,{value:e.value==null?`never`:String(e.value),className:`text-xs`,children:e.label},String(e.value)))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(Vn,{className:`text-xs`,children:`Password (optional)`}),(0,o.jsx)(Q,{type:`password`,value:y.password,onChange:e=>b(t=>({...t,password:e.target.value})),placeholder:`Require a password to open`,className:`h-8 text-xs`,"data-testid":`share-password`})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(Vn,{className:`text-xs`,children:`Label (only you see this)`}),(0,o.jsx)(Q,{value:y.label,onChange:e=>b(t=>({...t,label:e.target.value})),placeholder:`e.g. Sent to design review`,className:`h-8 text-xs`,"data-testid":`share-label`})]})]}),(0,o.jsx)(`div`,{className:`flex justify-end`,children:(0,o.jsxs)(Y,{size:`sm`,onClick:E,disabled:h,"data-testid":`share-create`,children:[h?(0,o.jsx)(l.Loader2,{className:`mr-1 h-3 w-3 animate-spin`}):(0,o.jsx)(l.Link2,{className:`mr-1 h-3 w-3`}),`Create link`]})})]}),(0,o.jsxs)(`section`,{className:`space-y-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:[`Existing links`,k.length?` (${k.length})`:``]}),p&&(0,o.jsx)(l.Loader2,{className:`h-3 w-3 animate-spin text-muted-foreground`})]}),!p&&k.length===0&&A.length===0&&(0,o.jsx)(`p`,{className:`rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground`,children:`No share links yet. Create one above.`}),(0,o.jsxs)(`ul`,{className:`space-y-2`,children:[k.map(e=>(0,o.jsx)(Fh,{link:e,copied:x===e.id,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:c},e.id)),A.length>0&&(0,o.jsx)(`li`,{className:`pt-2 text-[10px] uppercase tracking-wide text-muted-foreground`,children:`Revoked`}),A.map(e=>(0,o.jsx)(Fh,{link:e,copied:!1,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:c,disabled:!0},e.id))]})]}),(0,o.jsx)(Vt,{children:(0,o.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(!1),children:`Done`})})]})})}function Fh({link:e,copied:t,onCopy:n,onRevoke:r,publicBaseUrl:i,disabled:a}){let s=Mh(i,e.token);return(0,o.jsxs)(`li`,{className:q(`flex items-center gap-2 rounded-md border bg-card px-2 py-2 text-xs`,a&&`opacity-60`),"data-testid":`share-link-row`,children:[(0,o.jsx)(Xe,{variant:`secondary`,className:`text-[10px] capitalize`,children:e.audience.replace(`_`,` `)}),(0,o.jsx)(Xe,{variant:`outline`,className:`text-[10px] capitalize`,children:e.permission}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-mono text-[11px]`,title:s,children:s}),e.label&&(0,o.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})]}),!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(Y,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:n,"data-testid":`share-link-copy`,children:[(0,o.jsx)(l.Copy,{className:`mr-1 h-3 w-3`}),t?`Copied!`:`Copy`]}),(0,o.jsx)(Y,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive`,onClick:r,"data-testid":`share-link-revoke`,title:`Revoke`,children:(0,o.jsx)(l.Trash2,{className:`h-3 w-3`})})]}),a&&(0,o.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,o.jsx)(l.ShieldOff,{className:`h-3 w-3`}),`revoked`]})]})}function Ih(){return!0}e.Accordion=De,e.AccordionContent=Ae,e.AccordionItem=Oe,e.AccordionTrigger=ke,e.Alert=Ue,e.AlertDescription=Ge,e.AlertDialog=X,e.AlertDialogAction=Be,e.AlertDialogCancel=Ve,e.AlertDialogContent=Fe,e.AlertDialogDescription=ze,e.AlertDialogFooter=Le,e.AlertDialogHeader=Ie,e.AlertDialogOverlay=Pe,e.AlertDialogPortal=Ne,e.AlertDialogTitle=Re,e.AlertDialogTrigger=Me,e.AlertTitle=We,e.AspectRatio=Ke,e.Avatar=qe,e.AvatarFallback=Z,e.AvatarImage=Je,e.Badge=Xe,e.Breadcrumb=Ze,e.BreadcrumbEllipsis=rt,e.BreadcrumbItem=$e,e.BreadcrumbLink=et,e.BreadcrumbList=Qe,e.BreadcrumbPage=tt,e.BreadcrumbSeparator=nt,e.Button=Y,e.ButtonGroup=Lc,e.ButtonGroupSeparator=zc,e.ButtonGroupText=Rc,e.Calendar=pt,e.CalendarDayButton=mt,e.Card=ht,e.CardContent=yt,e.CardDescription=vt,e.CardFooter=bt,e.CardHeader=gt,e.CardTitle=_t,e.Carousel=Ct,e.CarouselContent=wt,e.CarouselItem=Tt,e.CarouselNext=Dt,e.CarouselPrevious=Et,e.CharacterCount=xs,e.ChartSkeleton=Gu,e.Checkbox=Ot,e.Collapsible=kt,e.CollapsibleContent=jt,e.CollapsibleTrigger=At,e.Combobox=Bc,e.Command=Wt,e.CommandDialog=Gt,e.CommandEmpty=Jt,e.CommandGroup=Yt,e.CommandInput=Kt,e.CommandItem=Zt,e.CommandList=qt,e.CommandSeparator=Xt,e.CommandShortcut=Qt,e.ConfigFieldRenderer=Gl,e.ConfigPanelRenderer=Jl,e.ConfigRow=Vc,e.ContextMenu=$t,e.ContextMenuCheckboxItem=un,e.ContextMenuContent=cn,e.ContextMenuGroup=tn,e.ContextMenuItem=ln,e.ContextMenuLabel=fn,e.ContextMenuPortal=nn,e.ContextMenuRadioGroup=an,e.ContextMenuRadioItem=dn,e.ContextMenuSeparator=pn,e.ContextMenuShortcut=mn,e.ContextMenuSub=rn,e.ContextMenuSubContent=sn,e.ContextMenuSubTrigger=on,e.ContextMenuTrigger=en,e.DIALOG_VIEWPORT_GUTTER=ps,e.DataEmptyState=$u,e.EmptyState=$u,e.DataErrorState=ed,e.DataLoadingState=Qu,e.DatePicker=Yl,e.DebugPanel=Oh,e.Dialog=Pt,e.DialogClose=Lt,e.DialogContent=zt,e.DialogDescription=Ut,e.DialogFooter=Vt,e.DialogHeader=Bt,e.DialogOverlay=Rt,e.DialogPortal=It,e.DialogTitle=Ht,e.DialogTrigger=Ft,e.Drawer=hn,e.DrawerClose=vn,e.DrawerContent=bn,e.DrawerDescription=wn,e.DrawerFooter=Sn,e.DrawerHeader=xn,e.DrawerOverlay=yn,e.DrawerPortal=_n,e.DrawerTitle=Cn,e.DrawerTrigger=gn,e.DropdownMenu=Tn,e.DropdownMenuCheckboxItem=Fn,e.DropdownMenuContent=Nn,e.DropdownMenuGroup=Dn,e.DropdownMenuItem=Pn,e.DropdownMenuLabel=Ln,e.DropdownMenuPortal=On,e.DropdownMenuRadioGroup=An,e.DropdownMenuRadioItem=In,e.DropdownMenuSeparator=Rn,e.DropdownMenuShortcut=zn,e.DropdownMenuSub=kn,e.DropdownMenuSubContent=Mn,e.DropdownMenuSubTrigger=jn,e.DropdownMenuTrigger=En,e.Empty=Zl,e.EmptyContent=ru,e.EmptyDescription=nu,e.EmptyHeader=Ql,e.EmptyMedia=eu,e.EmptyStateLink=td,e.EmptyTitle=tu,e.EmptyValue=iu,e.FILTER_BUILDER_OPERATORS=Wc,e.FieldContainer=ou,e.FilterBuilder=Ll,e.Form=Hn,e.FormControl=Yn,e.FormDescription=Xn,e.FormField=Wn,e.FormItem=qn,e.FormLabel=Jn,e.FormMessage=Zn,e.FormSkeleton=Uu,e.FullscreenEditor=hs,e.GridFieldAuthoringProvider=Bp,e.GridSkeleton=Vu,e.GroupingEditor=Bu,e.HorizontalOverflowBox=od,e.HoverCard=Qn,e.HoverCardContent=er,e.HoverCardTrigger=$n,e.Input=Q,e.InputGroup=su,e.InputOTP=tr,e.InputOTPGroup=nr,e.InputOTPSeparator=ir,e.InputOTPSlot=rr,e.Item=du,e.ItemActions=_u,e.ItemContent=mu,e.ItemDescription=gu,e.ItemFooter=yu,e.ItemGroup=cu,e.ItemHeader=vu,e.ItemMedia=pu,e.ItemSeparator=lu,e.ItemTitle=hu,e.KanbanSkeleton=Hu,e.Kbd=bu,e.KbdGroup=xu,e.Label=Vn,e.LazyIcon=ao,e.ListSkeleton=Wu,e.LookupValuePicker=Vl,e.Menubar=ur,e.MenubarCheckboxItem=gr,e.MenubarContent=mr,e.MenubarGroup=or,e.MenubarItem=hr,e.MenubarLabel=vr,e.MenubarMenu=ar,e.MenubarPortal=sr,e.MenubarRadioGroup=cr,e.MenubarRadioItem=_r,e.MenubarSeparator=yr,e.MenubarShortcut=br,e.MenubarSub=lr,e.MenubarSubContent=pr,e.MenubarSubTrigger=fr,e.MenubarTrigger=dr,e.MobileDialogContent=Eu,e.NOTIFICATION_ACTION_BUTTON_VARIANTS=uh,e.NOTIFICATION_POSITION_CLASSES=fh,e.NOTIFICATION_SEVERITY_STYLES=sh,e.NativeSelect=Su,e.NavigationMenu=xr,e.NavigationMenuContent=Er,e.NavigationMenuIndicator=kr,e.NavigationMenuItem=Cr,e.NavigationMenuLink=Dr,e.NavigationMenuList=Sr,e.NavigationMenuTrigger=Tr,e.NavigationMenuViewport=Or,e.NavigationOverlay=Iu,e.NotificationAlerts=gh,e.NotificationBanners=ph,e.NotificationInline=_h,e.NotificationSnackbar=mh,e.PAGE_BLOCK_SPANS=Ld,e.PINNED_RIGHT_SEAM_SHADOW_CLASSES=ad,e.PageHeaderActions=Tp,e.Pagination=Ar,e.PaginationContent=jr,e.PaginationEllipsis=Ir,e.PaginationItem=Mr,e.PaginationLink=Nr,e.PaginationNext=Fr,e.PaginationPrevious=Pr,e.Popover=Lr,e.PopoverContent=zr,e.PopoverTrigger=Rr,e.Progress=Br,e.RAW_HTML_CLOSING_TAG=co,e.RAW_HTML_OPEN_TAG=so,e.RadioGroup=Vr,e.RadioGroupItem=Hr,e.RecordTitleChip=Ju,e.RefreshIndicator=Zu,e.RelatedCountStore=np,e.ResizableHandle=fs,e.ResizablePanel=ds,e.ResizablePanelGroup=us,e.ScrollArea=Ur,e.ScrollBar=Wr,e.SectionHeader=Kl,e.Select=Gr,e.SelectContent=Zr,e.SelectGroup=Kr,e.SelectItem=$r,e.SelectLabel=Qr,e.SelectScrollDownButton=Xr,e.SelectScrollUpButton=Yr,e.SelectSeparator=ei,e.SelectTrigger=Jr,e.SelectValue=qr,e.Separator=ti,e.ShareDialog=Ph,e.Sheet=ni,e.SheetClose=ii,e.SheetContent=ci,e.SheetDescription=fi,e.SheetFooter=ui,e.SheetHeader=li,e.SheetOverlay=oi,e.SheetPortal=ai,e.SheetTitle=di,e.SheetTrigger=ri,e.ShimmerSkeleton=qu,e.Sidebar=Ai,e.SidebarContent=Ri,e.SidebarFooter=Ii,e.SidebarGroup=zi,e.SidebarGroupAction=Vi,e.SidebarGroupContent=Hi,e.SidebarGroupLabel=Bi,e.SidebarHeader=Fi,e.SidebarInput=Pi,e.SidebarInset=Ni,e.SidebarMenu=Ui,e.SidebarMenuAction=qi,e.SidebarMenuBadge=Ji,e.SidebarMenuButton=Ki,e.SidebarMenuItem=Wi,e.SidebarMenuSkeleton=Yi,e.SidebarMenuSub=Xi,e.SidebarMenuSubButton=Qi,e.SidebarMenuSubItem=Zi,e.SidebarProvider=ki,e.SidebarRail=Mi,e.SidebarSeparator=Li,e.SidebarTrigger=ji,e.Skeleton=$,e.Slider=ea,e.SortBuilder=Ul,e.Spinner=Ru,e.Switch=na,e.TOASTER_POSITIONS=Fp,e.Table=ra,e.TableBody=aa,e.TableCaption=ua,e.TableCell=la,e.TableFooter=oa,e.TableHead=ca,e.TableHeader=ia,e.TableRow=sa,e.Tabs=da,e.TabsContent=ma,e.TabsList=fa,e.TabsTrigger=pa,e.Textarea=ha,e.Toaster=ta,e.Toggle=_a,e.ToggleGroup=ya,e.ToggleGroupItem=ba,e.Tooltip=_i,e.TooltipContent=yi,e.TooltipProvider=gi,e.TooltipTrigger=vi,e.TypographyBlockquote=Ea,e.TypographyH1=xa,e.TypographyH2=Sa,e.TypographyH3=Ca,e.TypographyH4=wa,e.TypographyInlineCode=Oa,e.TypographyLarge=Aa,e.TypographyLead=ka,e.TypographyList=Da,e.TypographyMuted=Ma,e.TypographyP=Ta,e.TypographySmall=ja,e.VALUELESS_FILTER_BUILDER_OPERATORS=Xc,e.ViewSkeleton=Ku,e.badgeVariants=Ye,e.buttonGroupVariants=Ic,e.buttonVariants=je,e.cn=q,Object.defineProperty(e,"cva",{enumerable:!0,get:function(){return f.cva}}),e.filterValueArity=$c,e.getLazyIcon=io,Object.defineProperty(e,"hasDeclaredVisibilityGate",{enumerable:!0,get:function(){return t.hasDeclaredPredicate}}),e.initializeComponents=Ih,e.isCustomRowActionVisible=fm,e.isEmptyNodeSlot=pe,e.isFilterValueComplete=ml,e.isInsidePopperLayer=wu,e.isLucideIconName=no,e.isPageRailRegion=zd,e.legacyRecordDrawerWidthKey=ku,e.mountedOperatorValue=nl,e.narrowFilterValueToOptions=pl,e.navigationMenuTriggerStyle=wr,e.normalizeFilterBuilderOperator=Jc,e.notificationActionVariant=dh,e.notificationIcon=lh,e.notificationSeverityStyle=ch,e.operatorsForFieldType=Ol,e.pageBlockSpan=Rd,e.reconcileOperatorForField=tl,e.recordOverlayWidthStorageKey=Ou,e.registerPlaceholders=oh,e.renderChildren=J,e.renderInlineMarkdown=ho,e.renderNodeSlot=me,e.reshapeFilterValue=el,e.resolveIcon=Ga,e.retypeFilterValue=ll,e.toKebabIconName=$a,e.toast=B.toast,e.toggleVariants=ga,e.useConfigDraft=vh,e.useFormField=Gn,e.useGridFieldAuthoring=Vp,e.useIsMobile=mi,e.useOptionalSidebar=Oi,e.useOverlayAnchor=Au,e.usePageRegionPosture=nf,e.usePopperAwareInteractOutside=Tu,e.useRelatedCount=ep,e.useRelatedCountVersion=tp,e.useResizeObserver=yh,e.useSidebar=Di});