@tempots/beatui 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/auth/index.cjs.js +1 -1
  2. package/dist/auth/index.es.js +1 -1
  3. package/dist/auth-divider-CjcrgXmq.cjs +1 -0
  4. package/dist/{auth-divider-qnJuYK-x.js → auth-divider-D9KnNeyF.js} +239 -230
  5. package/dist/better-auth/index.cjs.js +1 -1
  6. package/dist/better-auth/index.es.js +396 -347
  7. package/dist/{custom-validation-BetUqAEz.js → custom-validation-7por5nJN.js} +1 -1
  8. package/dist/{deep-merge-ZVigk5Qf.js → deep-merge-DT2H9AGq.js} +1 -1
  9. package/dist/{duration-input-GMBmT1BE.js → duration-input-D4V_PHIg.js} +1 -1
  10. package/dist/index.cjs.js +4 -4
  11. package/dist/index.es.js +4926 -4861
  12. package/dist/json-schema/index.es.js +5 -5
  13. package/dist/json-structure/index.es.js +3 -3
  14. package/dist/{notice-B6ojfenv.js → notice-CQGJyZ8o.js} +1 -1
  15. package/dist/types/better-auth/callbacks.d.ts +4 -4
  16. package/dist/types/better-auth/components/authenticated.d.ts +27 -2
  17. package/dist/types/better-auth/components/better-auth-container.d.ts +6 -0
  18. package/dist/types/better-auth/index.d.ts +2 -1
  19. package/dist/types/better-auth/provider.d.ts +1 -1
  20. package/dist/types/better-auth/types.d.ts +22 -0
  21. package/dist/types/components/auth/auth-email-prop.d.ts +6 -12
  22. package/dist/types/components/auth/types.d.ts +7 -6
  23. package/dist/types/components/auth/utils.d.ts +4 -2
  24. package/dist/types/components/data/data-source.d.ts +2 -0
  25. package/dist/types/components/query/index.d.ts +2 -0
  26. package/dist/types/components/query/query-data-source.d.ts +73 -0
  27. package/dist/types/components/query/query-data-table.d.ts +62 -0
  28. package/dist/types/index.d.ts +1 -0
  29. package/dist/{use-form-NfobsGNl.js → use-form-8NnZ-KHk.js} +9 -9
  30. package/dist/{widget-customization-BtkexHgm.js → widget-customization-BIBva3f-.js} +2 -2
  31. package/package.json +1 -1
  32. package/dist/auth-divider-DewHpITQ.cjs +0 -1
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var yr=Object.create;var Aa=Object.defineProperty;var kr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var wr=Object.getPrototypeOf,Cr=Object.prototype.hasOwnProperty;var Sr=(t,a,n,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of _r(a))!Cr.call(t,l)&&l!==n&&Aa(t,l,{get:()=>a[l],enumerable:!(r=kr(a,l))||r.enumerable});return t};var Vr=(t,a,n)=>(n=t!=null?yr(wr(t)):{},Sr(a||!t||!t.__esModule?Aa(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tempots/dom"),Ce=require("@tempots/ui"),C=require("./translations-EwEmHe3v.cjs"),be=require("./colors-DPCHjRMj.cjs"),A=require("./index-DeUj-5ph.cjs"),se=require("./use-form-Dcra7GeE.cjs"),we=require("@tempots/std"),He=require("./use-animated-toggle-cKcuItmz.cjs"),Ct=require("./theme-DogY9oT1.cjs"),en=require("./tailwind/preset.cjs.js"),G=require("./widget-customization-pqmtsraC.cjs"),Te=require("./session-id-B5lJMzbB.cjs"),Ee=require("./custom-validation-CLscGHY4.cjs"),ne=require("./input-container-CyOgiiQD.cjs"),ae=require("./deep-merge-D90SW1Ci.cjs"),Je=require("./stack-dwLevGa2.cjs"),Ve=require("./menu-B60Q9j3-.cjs"),Fe=require("./text-input-DS5zlXb2.cjs"),je=require("./duration-input-4AQnQpyo.cjs"),$t=require("./utils-DmEuG3Np.cjs"),ga=require("./notice-p2IqXS5-.cjs"),Ir=require("./link-portal-_tiDFZqh.cjs"),xt=require("./toolbar-BBwfe8U9.cjs");function $r(t,a=0,n=()=>!0){let r=null,l;const s=e.prop(t.value);return t.on(c=>{l=c,n(c)?r==null&&(r=setTimeout(()=>{r=null,s.set(l)},a)):s.set(c)}),t.onDispose(()=>{r!=null&&clearTimeout(r)}),s}const ba=async(t,a="")=>{try{const r=await(await fetch(t)).blob(),l=URL.createObjectURL(r),s=document.createElement("a");s.href=l,s.download=a,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(l)}catch{window.open(t,"_blank")}},xr=(t,a,n="application/octet-stream")=>{const r=new Blob([t],{type:n});ba(URL.createObjectURL(r),a),URL.revokeObjectURL(URL.createObjectURL(r))},Dr=t=>{const a=new AbortController,n=e.prop({type:"progress",value:0});let r=!1;return(async()=>{try{const l=await fetch(t,{signal:a.signal});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const s=l.headers.get("content-length"),c=s?parseInt(s,10):void 0,o=(async()=>{if(c===void 0||isNaN(c))return n.set({type:"undetermined"}),await l.blob();{const f=new Uint8Array(c);if(l.body==null)throw new Error("Response body is null");const h=l.body.getReader();let d=0;for(;;){const{done:g,value:p}=await h.read();if(g)break;f.set(p,d),d+=p.length,n.set({type:"progress",value:Math.min(d/c,1)})}return new Blob([f],{type:l.headers.get("content-type")??void 0})}})(),i=t.split("/").pop()||"download",u=await o,m=new File([u],i,{type:u.type});r=!0,n.set({type:"done",file:m})}catch(l){n.set({type:"error",error:l})}finally{r=!0,n.dispose()}})(),{signal:n,cancel:()=>{r||a.abort()}}},Or=t=>{ba(URL.createObjectURL(t),t.name)},Kt=["xs","sm","md","lg","xl"];function Tr(t,a=1){const n=Kt.indexOf(t);if(n===-1)throw new Error(`Invalid size: ${t}`);const r=Math.min(Math.max(n+a,0),Kt.length-1);return Kt[r]}const Pr={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl","2xl":"xl"};function Er(t){const a=t.trim().split(/\s+/);return a.length===1?a[0][0].toUpperCase():(a[0][0]+a[a.length-1][0]).toUpperCase()}function Fr(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--avatar-bg: ${a.backgroundColor}`,`--avatar-text: ${a.textColor}`,`--avatar-bg-dark: ${n.backgroundColor}`,`--avatar-text-dark: ${n.textColor}`].join("; ")}function Lr(t,a,n){const r=["bc-avatar",`bc-avatar--size-${t}`,`bc-avatar--${a}`];return n&&r.push("bc-avatar--bordered"),r.join(" ")}function Ar({src:t,name:a,icon:n,size:r="md",variant:l="circle",color:s="base",bordered:c=!1,borderColor:o},...i){const u=e.Value.map(e.Value.toSignal(r),f=>Pr[f??"md"]),m=e.html.span(e.attr.class("bc-avatar__icon"),C.Icon({icon:"mdi:account",size:u}));return e.html.div(e.attr.class(e.computedOf(r,l,c,o)((f,h,d,g)=>Lr(f??"md",h??"circle",(d??!1)||g!=null))),e.attr.style(e.computedOf(s,o)((f,h)=>{const d=Fr(f??"base");if(h==null)return d;const g=be.getColorVar(h,500),p=be.getColorVar(h,400);return`${d}; --avatar-border-color: ${g}; --avatar-border-color-dark: ${p}`})),e.Ensure(t,f=>e.html.img(e.attr.class("bc-avatar__image"),e.attr.src(f),e.attr.alt(a!=null?e.Value.map(a,h=>h??"Avatar"):"Avatar")),()=>e.Ensure(a,f=>e.html.span(e.attr.class("bc-avatar__initials"),f.map(Er)),()=>e.Ensure(n,f=>e.html.span(e.attr.class("bc-avatar__icon"),C.Icon({icon:f,size:u})),()=>m))),...i)}const Qe=20,lt=7;function Br(t,a){const n=["bc-date-picker",`bc-date-picker--size-${t}`];return a&&n.push("bc-date-picker--disabled"),n.join(" ")}function Mr(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark"),r=C.backgroundValue(t,"light","light"),l=C.backgroundValue(t,"light","dark");return[`--cal-selected-bg: ${a.backgroundColor}`,`--cal-selected-text: ${a.textColor}`,`--cal-selected-bg-dark: ${n.backgroundColor}`,`--cal-selected-text-dark: ${n.textColor}`,`--cal-today-bg: ${r.backgroundColor}`,`--cal-today-text: ${r.textColor}`,`--cal-today-bg-dark: ${l.backgroundColor}`,`--cal-today-text-dark: ${l.textColor}`].join("; ")}function tn(t,a,n,r,l,s){const c=t.PlainDate.from({year:a,month:n,day:1}),o=c.daysInMonth,u=(c.dayOfWeek%7-r+lt)%lt,m=c.subtract({months:1}),f=m.daysInMonth,h=[],d=(p,b,y)=>{h.push({day:b,date:p,inMonth:y,isToday:p.equals(l),isDisabled:s?.(p)??!1})};for(let p=u-1;p>=0;p--){const b=f-p;d(m.with({day:b}),b,!1)}for(let p=1;p<=o;p++)d(t.PlainDate.from({year:a,month:n,day:p}),p,!0);const g=lt-h.length%lt;if(g<lt){const p=c.add({months:1});for(let b=1;b<=g;b++)d(p.with({day:b}),b,!1)}return h}function an(t,a,n,r,l,s){const c=t.Now.plainDateISO(),o=e.prop(a),i=e.prop(n),u=e.prop("days"),m=e.prop(Math.floor(a/Qe)*Qe),f=e.computedOf(l,s)((h,d)=>{const g=[];for(let p=0;p<lt;p++)g.push(d[(p+h)%lt]);return g});return{today:c,currentYear:o,currentMonth:i,view:u,yearPageStart:m,shiftedDayNames:f,prevMonth:()=>{if(e.Value.get(r))return;const h=i.value,d=o.value;h===1?(i.set(12),o.set(d-1)):i.set(h-1)},nextMonth:()=>{if(e.Value.get(r))return;const h=i.value,d=o.value;h===12?(i.set(1),o.set(d+1)):i.set(h+1)},prevYear:()=>{e.Value.get(r)||o.update(h=>h-1)},nextYear:()=>{e.Value.get(r)||o.update(h=>h+1)},prevYearPage:()=>{e.Value.get(r)||m.update(h=>h-Qe)},nextYearPage:()=>{e.Value.get(r)||m.update(h=>h+Qe)},switchToMonthsView:()=>{e.Value.get(r)||u.set("months")},switchToYearsView:()=>{if(e.Value.get(r))return;const h=o.value;m.set(Math.floor(h/Qe)*Qe),u.set("years")},selectMonth:h=>{e.Value.get(r)||(i.set(h),u.set("days"))},selectYear:h=>{e.Value.get(r)||(o.set(h),u.set("months"))}}}function nn(t,a,n){const{size:r,disabled:l,color:s,ariaLabel:c}=a,{today:o,currentYear:i,currentMonth:u,view:m,yearPageStart:f,prevMonth:h,nextMonth:d,prevYear:g,nextYear:p,prevYearPage:b,nextYearPage:y,switchToMonthsView:k,switchToYearsView:_,selectMonth:v,selectYear:w}=t;return e.Use(C.BeatUII18n,I=>{const S=I.$.datePicker;return e.html.div(e.attr.class(e.computedOf(r,l)(Br)),e.attr.style(e.Value.map(s,Mr)),e.attr.role("grid"),e.aria.label(c),e.OneOfValue(m,{days:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYear),e.on.click(V=>{V.preventDefault(),g()}),"«"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousMonth),e.on.click(V=>{V.preventDefault(),h()}),"‹"),e.html.div(e.attr.class("bc-date-picker__title"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__title-btn"),e.attr.disabled(l),e.aria.label(S.$.selectMonth),e.on.click(V=>{V.preventDefault(),k()}),e.computedOf(u,S.$.monthNames)((V,D)=>D[V-1])),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__title-btn"),e.attr.disabled(l),e.aria.label(S.$.selectYear),e.on.click(V=>{V.preventDefault(),_()}),e.Value.map(i,String))),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextMonth),e.on.click(V=>{V.preventDefault(),d()}),"›"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYear),e.on.click(V=>{V.preventDefault(),p()}),"»")),months:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYear),e.on.click(V=>{V.preventDefault(),g()}),"«"),e.html.span(e.attr.class("bc-date-picker__title"),e.Value.map(i,String)),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYear),e.on.click(V=>{V.preventDefault(),p()}),"»")),years:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYears.map(V=>V(Qe))),e.on.click(V=>{V.preventDefault(),b()}),"«"),e.html.span(e.attr.class("bc-date-picker__title"),e.Value.map(f,V=>`${V} – ${V+Qe-1}`)),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYears.map(V=>V(Qe))),e.on.click(V=>{V.preventDefault(),y()}),"»"))}),e.OneOfValue(m,{days:()=>e.html.div(e.attr.class("bc-date-picker__days-view"),e.html.div(e.attr.class("bc-date-picker__weekdays"),e.ForEach(t.shiftedDayNames,V=>e.html.div(e.attr.class("bc-date-picker__weekday"),V))),n()),months:()=>e.html.div(e.attr.class("bc-date-picker__picker-grid bc-date-picker__picker-grid--months"),...Array.from({length:12},(V,D)=>{const $=D+1;return e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(u,i)((x,U)=>{const z=["bc-date-picker__month-cell"];return x===$&&z.push("bc-date-picker__month-cell--current"),o.month===$&&o.year===U&&z.push("bc-date-picker__month-cell--active"),z.join(" ")})),e.attr.disabled(l),e.on.click(x=>{x.preventDefault(),v($)}),S.$.shortMonthNames.map(x=>x[D]))})),years:()=>e.html.div(e.attr.class("bc-date-picker__picker-grid bc-date-picker__picker-grid--years"),e.ForEach(e.Value.map(f,V=>{const D=[];for(let $=0;$<Qe;$++)D.push(V+$);return D}),V=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(i,V)((D,$)=>{const x=["bc-date-picker__year-cell"];return D===$&&x.push("bc-date-picker__year-cell--current"),o.year===$&&x.push("bc-date-picker__year-cell--active"),x.join(" ")})),e.attr.disabled(l),e.on.click(D=>{D.preventDefault(),w(e.Value.get(V))}),e.Value.map(V,String))))}))})}function Nr(t,{value:a=null,onSelect:n,isDateDisabled:r,color:l="primary",size:s="md",disabled:c=!1,weekStartsOn:o=0}){return e.Use(C.BeatUII18n,i=>{const u=a!=null?e.Value.get(a):null,m=an(t,u?.year??t.Now.plainDateISO().year,u?.month??t.Now.plainDateISO().month,c,o,i.$.datePicker.$.dayNames),f=e.Value.toSignal(o),h=e.computedOf(m.currentYear,m.currentMonth,a,f)((d,g,p,b)=>tn(t,d,g,b,m.today,r).map(y=>({...y,isSelected:p!=null&&y.date.equals(p)})));return nn(m,{size:s,disabled:c,color:l,ariaLabel:i.$.datePicker.$.label},()=>e.html.div(e.attr.class("bc-date-picker__grid"),e.ForEach(h,d=>{const g=d.map(y=>{const k=["bc-date-picker__day"];return y.inMonth||k.push("bc-date-picker__day--outside"),y.isToday&&k.push("bc-date-picker__day--today"),y.isSelected&&k.push("bc-date-picker__day--selected"),y.isDisabled&&k.push("bc-date-picker__day--disabled"),k.join(" ")}),p=d.map(y=>y.isDisabled),b=d.map(y=>String(y.day));return e.html.button(e.attr.type("button"),e.attr.class(g),e.attr.disabled(e.computedOf(p,c)((y,k)=>y||k)),e.on.click(y=>{y.preventDefault();const k=e.Value.get(d);!k.isDisabled&&!e.Value.get(c)&&(k.inMonth||(m.currentYear.set(k.date.year),m.currentMonth.set(k.date.month)),n?.(k.date))}),b)})))})}function st(t){return ae.WithTemporal(a=>Nr(a,t??{}))}function Wr(t,{value:a=null,onChange:n,isDateDisabled:r,color:l="primary",size:s="md",disabled:c=!1,weekStartsOn:o=0}){return e.Use(C.BeatUII18n,i=>{const u=a!=null?e.Value.get(a):null,m=an(t,u?.[0]?.year??t.Now.plainDateISO().year,u?.[0]?.month??t.Now.plainDateISO().month,c,o,i.$.datePicker.$.dayNames),f=e.Value.toSignal(o),h=e.prop(null),d=e.prop(null);a!=null&&e.Value.on(a,()=>{h.set(null)});const g=e.computedOf(m.currentYear,m.currentMonth,a,h,d,f)((p,b,y,k,_,v)=>{let w=null,I=null,S=!1;if(k!=null&&_!=null){const V=t.PlainDate.compare(k,_);w=V<=0?k:_,I=V<=0?_:k,S=!0}else y!=null&&(w=y[0],I=y[1]);return tn(t,p,b,v,m.today,r).map(V=>{let D=!1,$=!1,x=!1;return w!=null&&I!=null&&(D=V.date.equals(w),$=V.date.equals(I),x=t.PlainDate.compare(V.date,w)>0&&t.PlainDate.compare(V.date,I)<0),{...V,isRangeStart:D,isRangeEnd:$,isInRange:x,isPreview:S}})});return nn(m,{size:s,disabled:c,color:l,ariaLabel:i.$.datePicker.$.dateRangePickerLabel},()=>e.html.div(e.attr.class("bc-date-picker__grid"),e.on.mouseleave(()=>{d.set(null)}),e.ForEach(g,p=>{const b=p.map(_=>{const v=["bc-date-picker__day"];return _.inMonth||v.push("bc-date-picker__day--outside"),_.isToday&&v.push("bc-date-picker__day--today"),_.isDisabled&&v.push("bc-date-picker__day--disabled"),_.isRangeStart&&v.push("bc-date-picker__day--range-start"),_.isRangeEnd&&v.push("bc-date-picker__day--range-end"),_.isInRange&&v.push("bc-date-picker__day--in-range"),_.isPreview&&(_.isRangeStart||_.isRangeEnd||_.isInRange)&&v.push("bc-date-picker__day--preview"),v.join(" ")}),y=p.map(_=>_.isDisabled),k=p.map(_=>String(_.day));return e.html.button(e.attr.type("button"),e.attr.class(b),e.attr.disabled(e.computedOf(y,c)((_,v)=>_||v)),e.on.mouseenter(()=>{const _=e.Value.get(p);!_.isDisabled&&!e.Value.get(c)&&d.set(_.date)}),e.on.click(_=>{_.preventDefault();const v=e.Value.get(p);if(v.isDisabled||e.Value.get(c))return;v.inMonth||(m.currentYear.set(v.date.year),m.currentMonth.set(v.date.month));const w=h.value;if(w==null)h.set(v.date);else{const S=t.PlainDate.compare(w,v.date)<=0?[w,v.date]:[v.date,w];h.set(null),d.set(null),n?.(S)}}),k)})))})}function rn(t){return ae.WithTemporal(a=>Wr(a,t??{}))}function Ur(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--avatar-bg: ${a.backgroundColor}`,`--avatar-text: ${a.textColor}`,`--avatar-bg-dark: ${n.backgroundColor}`,`--avatar-text-dark: ${n.textColor}`].join("; ")}function Rr({size:t="md",spacing:a="tight"},...n){return e.html.div(e.attr.class(e.computedOf(t,a)((r,l)=>["bc-avatar-group",`bc-avatar-group--size-${r??"md"}`,`bc-avatar-group--spacing-${l??"tight"}`].join(" "))),...n)}function zr({count:t,size:a="md",color:n="base"}){return e.html.div(e.attr.class(e.Value.map(a,r=>["bc-avatar",`bc-avatar--size-${r??"md"}`,"bc-avatar--circle","bc-avatar-group__overflow"].join(" "))),e.attr.style(e.Value.map(n,r=>Ur(r??"base"))),e.html.span(e.attr.class("bc-avatar__initials"),e.Value.map(t,r=>`+${r??0}`)))}const Ba={min:0,max:360},Ma={min:50,max:80},Na={min:40,max:65};function Hr(t){let a=5381;for(let n=0;n<t.length;n++)a=(a<<5)+a+t.charCodeAt(n)|0;return a>>>0}function Zt(t,a,n,r){const l=(t*2654435761+a*2246822519>>>0)%1e4;return n+l/1e4*(r-n)}function jr(t){return t>56?"#000":"#fff"}function Gr(t,a,n,r){const l=t.trim();if(l==="")return"";const s=Hr(l),c=Zt(s,1,a.min,a.max),o=Zt(s,2,n.min,n.max),i=Zt(s,3,r.min,r.max),u=jr(i);return`background-color: hsl(${c.toFixed(1)} ${o.toFixed(1)}% ${i.toFixed(1)}%); color: ${u}`}function qr(t,a){return["bc-auto-color-badge",`bc-badge--size-${t}`,`bc-control--rounded-${a}`].join(" ")}function Yr(t={},...a){const{size:n="md",roundedness:r="full",text:l,hue:s=Ba,saturation:c=Ma,lightness:o=Na}=t,i=l??e.prop(""),u=e.computedOf(i,s,c,o)((m,f,h,d)=>Gr(m??"",f??Ba,h??Ma,d??Na));return e.html.span(e.attr.class(e.computedOf(n,r)((m,f)=>qr(m??"md",f??"full"))),e.attr.style(u),e.html.span(e.attr.class("bc-badge__content"),...a),e.When(e.Value.map(l,m=>m==null),()=>e.WithElement(m=>{const f=i;f.set(m.textContent??"");const h=new MutationObserver(()=>{f.set(m.textContent??"")});return h.observe(m,{childList:!0,subtree:!0,characterData:!0}),e.OnDispose(()=>h.disconnect())})))}function ln(t,a,n,r,l){const s=["bc-badge",`bc-badge--size-${t}`,`bc-control--rounded-${a}`];return n&&s.push("bc-badge--circle"),r&&s.push("bc-badge--full-width"),l&&s.push("bc-badge--disabled"),s.join(" ")}function on(t,a){const n=new Map,r=(l,s,c,o)=>{n.set("--badge-bg-hover",l),n.set("--badge-text-hover",c),n.set("--badge-bg-hover-dark",s),n.set("--badge-text-hover-dark",o)};switch(t){case"filled":{const l=C.backgroundValue(a,"solid","light"),s=C.backgroundValue(a,"solid","dark"),c=C.hoverBackgroundValue(a,"soft","light"),o=C.hoverBackgroundValue(a,"soft","dark");n.set("--badge-bg",l.backgroundColor),n.set("--badge-text",l.textColor),n.set("--badge-bg-dark",s.backgroundColor),n.set("--badge-text-dark",s.textColor),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}case"light":{const l=C.backgroundValue(a,"light","light"),s=C.backgroundValue(a,"light","dark"),c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg",l.backgroundColor),n.set("--badge-text",l.textColor),n.set("--badge-bg-dark",s.backgroundColor),n.set("--badge-text-dark",s.textColor),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}case"outline":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),c=C.borderColorValue(a,"light"),o=C.borderColorValue(a,"dark"),i=C.hoverBackgroundValue(a,"light","light"),u=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border",c),n.set("--badge-border-dark",o),r(i.backgroundColor,u.backgroundColor,i.textColor,u.textColor);break}case"default":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","var(--bg-background-light)"),n.set("--badge-text",l),n.set("--badge-bg-dark","var(--bg-background-dark)"),n.set("--badge-text-dark",s),n.set("--badge-border","var(--border-border-light)"),n.set("--badge-border-dark","var(--border-border-dark)"),r(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}case"dashed":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),c=C.borderColorValue(a,"light"),o=C.borderColorValue(a,"dark"),i=C.hoverBackgroundValue(a,"light","light"),u=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border",c),n.set("--badge-border-dark",o),n.set("--badge-border-style","dashed"),r(i.backgroundColor,u.backgroundColor,i.textColor,u.textColor);break}case"subtle":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}case"text":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}}return Array.from(n.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function it({variant:t="filled",size:a="md",color:n="base",roundedness:r="full",circle:l=!1,fullWidth:s=!1,onClose:c,disabled:o=!1},...i){return e.html.span(e.attr.class(e.computedOf(a,r,l,s,o)((u,m,f,h,d)=>ln(u??"md",m??"sm",f??!1,h??!1,d??!1))),e.attr.style(e.computedOf(t,n)((u,m)=>on(u??"filled",m??"base"))),e.html.span(e.attr.class("bc-badge__content"),...i),c!=null?e.Use(C.BeatUII18n,u=>e.html.button(e.attr.class("bc-badge__close"),e.attr.type("button"),e.attr.disabled(o),e.aria.label(u.$.removeItem),e.on.click(m=>{m.stopPropagation(),c()}),"×")):e.Empty)}function Kr(t){const{entries:a,filters:n}=t,r=e.prop("all"),l=e.computedOf(a,r)((o,i)=>i==="all"?o:o.filter(u=>{const m=u.action.toLowerCase();switch(i){case"deletions":return m.includes("delet");case"edits":return m.includes("edit");case"schema":return m.includes("schema");case"restorable":return u.restorable===!0;default:return!0}})),c=n??[{value:"all",label:"All"},{value:"deletions",label:"Deletions"},{value:"edits",label:"Edits"},{value:"schema",label:"Schema changes"},{value:"restorable",label:"Restorable"}];return e.html.div(e.attr.class("bc-history-timeline"),e.html.div(e.attr.class("bc-history-timeline__filters"),...c.map(o=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(r)(i=>i===o.value?"bc-history-timeline__filter bc-history-timeline__filter--active":"bc-history-timeline__filter")),e.on.click(()=>r.set(o.value)),o.label))),e.html.div(e.attr.class("bc-history-timeline__list"),e.ForEach(l,o=>e.html.div(e.attr.class("bc-history-timeline__entry"),e.html.div(e.attr.class("bc-history-timeline__line"),e.html.div(e.attr.class("bc-history-timeline__dot"),e.attr.style(o.map(i=>`background: ${i.actionColor}`)))),e.html.div(e.attr.class("bc-history-timeline__content"),e.html.div(e.attr.class("bc-history-timeline__content-header"),e.html.span(e.attr.class("bc-history-timeline__action"),e.attr.style(o.map(i=>`color: ${i.actionColor}`)),o.$.action),e.html.span(e.attr.class("bc-history-timeline__time"),o.$.time)),e.html.div(e.attr.class("bc-history-timeline__target"),C.Icon({icon:o.$.targetIcon,size:"xs"}),e.html.span(o.$.target)),e.html.div(e.attr.class("bc-history-timeline__detail"),o.$.detail),e.html.div(e.attr.class("bc-history-timeline__footer"),e.html.div(e.attr.class("bc-history-timeline__actor"),e.html.div(e.attr.class("bc-history-timeline__avatar"),o.$.actor.$.initials),e.html.span(o.$.actor.$.name)),e.When(o.map(i=>i.restorable===!0&&i.onRestore!=null),()=>ne.Button({variant:"outline",size:"xs",onClick:()=>o.value.onRestore?.()},C.Icon({icon:"lucide:rotate-ccw",size:"xs"}),"Restore")))))),e.When(e.computedOf(l)(o=>o.length===0),()=>e.html.div(e.attr.class("bc-history-timeline__empty"),"No matching history entries"))))}function Zr(t,a,n){const r=["bc-indicator__badge",`bc-indicator--${t}`,`bc-indicator--size-${a}`];return n?r.push("bc-indicator--dot"):r.push("bc-indicator--count"),r.join(" ")}function Xr(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--indicator-bg: ${a.backgroundColor}`,`--indicator-text: ${a.textColor}`,`--indicator-bg-dark: ${n.backgroundColor}`,`--indicator-text-dark: ${n.textColor}`].join("; ")}function Qr({show:t=!0,count:a,maxCount:n=9,color:r="danger",placement:l="top-right",size:s="sm"},...c){const o=e.computedOf(t,a??0)((m,f)=>(m??!0)||f>0),i=e.computedOf(a??0)(m=>m<=0),u=e.computedOf(a??0,n)((m,f)=>m<=0?"":m>(f??9)?`${f??9}+`:String(m));return e.html.span(e.attr.class("bc-indicator"),...c,e.When(o,()=>e.html.span(e.attr.class(e.computedOf(l,s,i)((m,f,h)=>Zr(m??"top-right",f??"sm",h??!0))),e.attr.style(e.computedOf(r)(m=>Xr(m??"danger"))),u)))}function Jr({onChange:t,accept:a="*/*",onDragContent:n,content:r,onInvalidSelection:l,disabled:s=!1}){const c=e.prop(!1),o=e.prop([]);let i=null,u=0;const m=_=>_.dataTransfer?.types.includes("Files")??!1,f=(_,v)=>v==="*/*"?!0:v.split(",").map(I=>I.trim()).some(I=>{if(I==="*/*")return!0;if(I.endsWith("/*")){const S=I.slice(0,-2);return _.type.startsWith(S+"/")}return _.type===I||_.name.endsWith(I)}),h=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),u++,u===1&&(c.value=!0))},d=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),_.dataTransfer!=null&&(_.dataTransfer.dropEffect="copy"))},g=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),u--,u===0&&(c.value=!1))},p=_=>{if(e.Value.get(s)||!m(_))return;_.preventDefault(),_.stopPropagation(),u=0,c.value=!1;const v=Array.from(_.dataTransfer?.files??[]);if(v.length>0){const w=e.Value.get(a),I=v.filter(V=>f(V,w)),S=v.filter(V=>!I.includes(V));I.length>0&&(o.value=I,t(I,"dragdrop")),S.length>0&&l?.(v)}};typeof document<"u"&&(document.addEventListener("dragenter",h),document.addEventListener("dragover",d),document.addEventListener("dragleave",g),document.addEventListener("drop",p));const b=()=>{typeof document<"u"&&(document.removeEventListener("dragenter",h),document.removeEventListener("dragover",d),document.removeEventListener("dragleave",g),document.removeEventListener("drop",p)),u=0},y=()=>{i?.click()},k=_=>{const v=_.target,w=Array.from(v.files??[]);w.length>0&&(o.value=w,t(w,"click")),v.value=""};return e.Fragment(e.OnDispose(b),e.html.input(e.attr.type("file"),e.attr.name("bui-page-drop-zone"),e.attr.multiple(!0),e.attr.accept(a),e.style.position("absolute"),e.style.opacity("0"),e.style.pointerEvents("none"),e.style.width("0"),e.style.height("0"),e.on.change(k),e.WithElement(_=>(i=_,e.OnDispose(()=>{i!=null&&(i.value="")})))),n!=null?e.When(c,()=>n({files:o})):null,r!=null?r({isDragging:c,files:o,selectFiles:y}):null)}function sn(t){const{author:a,color:n}=t;return e.html.span(e.attr.class("bc-presence-cursor"),e.attr.style(`--presence-color: ${n}`),e.html.span(e.attr.class("bc-presence-cursor__bar")),e.html.span(e.attr.class("bc-presence-cursor__label"),a))}function el(t,...a){return e.html.span(e.attr.class("bc-presence-highlight"),e.attr.style(`--presence-color: ${t.color}`),...a)}function tl(t,...a){const{author:n,color:r}=t;return e.html.span(e.attr.class("bc-presence-selection"),e.attr.style(`--presence-color: ${r}`),e.html.span(e.attr.class("bc-presence-highlight"),...a),sn({author:n,color:r}))}function cn(t,a,n){const r=["bc-progress-bar",`bc-progress-bar--size-${t}`,`bc-control--rounded-${n}`];return a&&r.push("bc-progress-bar--indeterminate"),r.join(" ")}function un(t){const a=new Map,n=C.backgroundValue(t,"solid","light"),r=C.backgroundValue(t,"solid","dark");return a.set("--progress-fill",n.backgroundColor),a.set("--progress-fill-dark",r.backgroundColor),Array.from(a.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function al({value:t=0,max:a=100,size:n="md",color:r="primary",indeterminate:l=!1,showLabel:s=!1,roundedness:c="full"}){const o=e.computedOf(t,a)((m,f)=>{const h=m??0,d=f??100;return d>0?Math.min(Math.max(h/d*100,0),100):0}),i=e.Value.map(o,m=>`${Math.round(m)}%`),u=e.computedOf(o,l)((m,f)=>f??!1?"":`${m}%`);return e.html.div(e.attr.class("bc-progress-bar-wrapper"),e.html.div(e.attr.class(e.computedOf(n,l,c)((m,f,h)=>cn(m??"md",f??!1,h??"full"))),e.attr.style(e.Value.map(r,m=>un(m??"primary"))),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(a),e.aria.valuenow(t),e.aria.valuetext(i),e.html.div(e.attr.class("bc-progress-bar__track"),e.html.div(e.attr.class("bc-progress-bar__fill"),e.style.width(u)))),e.When(s,()=>e.html.div(e.attr.class("bc-progress-bar__label"),e.aria.hidden(!0),i),()=>{}))}function ia(t,a,n){const r=["bc-skeleton",`bc-skeleton--${t}`,`bc-control--rounded-${n}`];return a&&r.push("bc-skeleton--animate"),t==="circle"&&r.push("bc-skeleton--circle"),r.join(" ")}function dn(t,a,n){const r=[];return t!==void 0&&r.push(`width: ${t}`),a!==void 0?r.push(`height: ${a}`):n==="text"?r.push("height: 1em"):n==="circle"&&t!==void 0&&r.push(`height: ${t}`),r.join("; ")}function nl({variant:t="text",width:a,height:n,lines:r=1,animate:l=!0,roundedness:s="sm"}){const c=e.computedOf(t,r)((o,i)=>o==="text"&&(i??1)>1);return e.When(c,()=>e.html.div(e.attr.class("bc-skeleton__lines-container"),e.Repeat(r,o=>e.html.div(e.attr.class(e.computedOf(l,s)((i,u)=>ia("text",i??!0,u??"sm")+" bc-skeleton__line")),e.style.width(e.computedOf(o.isLast,a)((i,u)=>i&&u===void 0?"80%":u!==void 0?u:""))))),()=>e.html.div(e.attr.class(e.computedOf(t,l,s)((o,i,u)=>ia(o??"text",i??!0,u??"sm"))),e.attr.style(e.computedOf(a,n,t)((o,i,u)=>dn(o,i,u??"text"))),e.aria.hidden(!0)))}function rl(t,a,n,r,l,s){const c=["bc-table"];return t!=="md"&&c.push(`bc-table--size-${t}`),a&&c.push("bc-table--hoverable"),n&&c.push("bc-table--sticky-header"),r&&c.push("bc-table--with-striped-rows"),l&&c.push("bc-table--with-column-borders"),s&&c.push("bc-table--with-row-borders"),c.join(" ")}function ll(t){if(t!=null)return t==="none"?"--table-border-radius: 0":`--table-border-radius: var(--radius-${t})`}function pn({size:t="md",hoverable:a=!1,stickyHeader:n=!1,fullWidth:r=!1,withStripedRows:l=!1,withTableBorder:s=!0,withColumnBorders:c=!1,withRowBorders:o=!0,borderRadius:i}={},...u){const m=e.computedOf(t,a,n,l,c,o)((d,g,p,b,y,k)=>rl(d??"md",g??!1,p??!1,b??!1,y??!1,k??!0)),f=e.computedOf(n,r,s)((d,g,p)=>{const b=["bc-table-container"];return d&&b.push("bc-table-container--sticky"),g&&b.push("bc-table-container--full-width"),p&&b.push("bc-table-container--with-table-border"),b.join(" ")}),h=e.computedOf(i)(d=>ll(d));return e.html.div(e.attr.class(f),e.attr.style(h),e.html.table(e.attr.class(m),...u))}const ol=new Set(["text","compare","range","set","boolean","null","composite"]);function Dt(t){return ol.has(t.kind)}function va(t){if(t instanceof Date)return"date";switch(typeof t){case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"boolean":return"boolean";default:return"string"}}function Xt(t,a,n){if(t==null&&a==null)return 0;if(t==null)return-1;if(a==null)return 1;switch(n){case"string":return String(t).localeCompare(String(a));case"number":return t-a;case"bigint":{const r=t-a;return r<0n?-1:r>0n?1:0}case"date":return t.getTime()-a.getTime();case"boolean":return(t?1:0)-(a?1:0);default:return String(t).localeCompare(String(a))}}function Qt(t,a,n){return n==="date"&&t instanceof Date&&a instanceof Date?t.getTime()===a.getTime():t===a}function zt(t,a){switch(t.kind){case"text":{const n=t.caseSensitive??!1,r=a==null?"":String(a),l=t.value,s=n?r:r.toLowerCase(),c=n?l:l.toLowerCase();switch(t.operator){case"contains":return s.includes(c);case"notContains":return!s.includes(c);case"equals":return s===c;case"notEquals":return s!==c;case"startsWith":return s.startsWith(c);case"endsWith":return s.endsWith(c)}return!1}case"compare":{if(a==null)return!1;const n=Xt(a,t.value,t.valueType);switch(t.operator){case"eq":return Qt(a,t.value,t.valueType);case"neq":return!Qt(a,t.value,t.valueType);case"gt":return n>0;case"gte":return n>=0;case"lt":return n<0;case"lte":return n<=0}return!1}case"range":{if(a==null)return!1;const n=t.exclusive??!1;if(t.min!=null){const r=Xt(a,t.min,t.valueType);if(n?r<=0:r<0)return!1}if(t.max!=null){const r=Xt(a,t.max,t.valueType);if(n?r>=0:r>0)return!1}return!0}case"set":{const n=t.values.some(r=>Qt(a,r,t.valueType));return t.mode==="include"?n:!n}case"boolean":return a===t.value;case"null":return t.operator==="isNull"?a==null:a!=null;case"composite":return(t.mode==="and"?Array.prototype.every:Array.prototype.some).call(t.filters,r=>zt(r,a))}}function Wt(t,a,n,r){if(t.kind==="and")return t.filters.every(s=>Wt(s,a,n,r));if(t.kind==="or")return t.filters.some(s=>Wt(s,a,n,r));if(t.kind==="not")return!Wt(t.filter,a,n,r);const l=t;if(Dt(l)){const s=n(l.column,a);return zt(l,s)}return r?.evaluateFilter?r.evaluateFilter(l,a):!0}function Re(t){return t instanceof Date?t.toLocaleDateString():typeof t=="bigint"?t.toString():String(t)}const sl={contains:"contains",notContains:"does not contain",equals:"equals",notEquals:"does not equal",startsWith:"starts with",endsWith:"ends with"},il={eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤"};function ya(t){const a=t.column;switch(t.kind){case"text":return`${a} ${sl[t.operator]} "${t.value}"`;case"compare":return`${a} ${il[t.operator]} ${Re(t.value)}`;case"range":{const n=[];return t.min!=null&&n.push(`${Re(t.min)}`),n.push(a),t.max!=null&&n.push(Re(t.max)),n.length===3?`${n[0]} ${t.exclusive?"<":"≤"} ${n[1]} ${t.exclusive?"<":"≤"} ${n[2]}`:t.min!=null?`${a} ${t.exclusive?">":"≥"} ${Re(t.min)}`:`${a} ${t.exclusive?"<":"≤"} ${Re(t.max)}`}case"set":return t.mode==="include"?`${a} in [${t.values.map(Re).join(", ")}]`:`${a} not in [${t.values.map(Re).join(", ")}]`;case"boolean":return`${a} is ${t.value}`;case"null":return t.operator==="isNull"?`${a} is null`:`${a} is not null`;case"composite":{const n=t.mode==="and"?" AND ":" OR ";return t.filters.length===0?`${a}: (empty)`:t.filters.map(r=>ya(r)).join(n)}}}function ka(t,a){return Dt(t)?ya(t):a?.describeFilter?a.describeFilter(t):`${t.column}: [${t.kind}]`}function _a(t,a){const n=t.column;switch(t.kind){case"text":{const r=t.value;return{contains:a.textContains,notContains:a.textNotContains,equals:a.textEquals,notEquals:a.textNotEquals,startsWith:a.textStartsWith,endsWith:a.textEndsWith}[t.operator](n,r)}case"compare":{const r=Re(t.value);return{eq:a.compareEq,neq:a.compareNeq,gt:a.compareGt,gte:a.compareGte,lt:a.compareLt,lte:a.compareLte}[t.operator](n,r)}case"range":return t.min!=null&&t.max!=null?a.rangeBetween(n,Re(t.min),Re(t.max)):t.min!=null?a.rangeGte(n,Re(t.min)):a.rangeLte(n,Re(t.max));case"set":{const r=t.values.map(Re).join(", ");return t.mode==="include"?a.setIn(n,r):a.setNotIn(n,r)}case"boolean":return a.booleanIs(n,String(t.value));case"null":return t.operator==="isNull"?a.isNull(n):a.isNotNull(n);case"composite":{const r=t.filters.map(l=>_a(l,a));return t.mode==="and"?a.compositeAnd(r):a.compositeOr(r)}}}function Ht(t,a,n){return Dt(t)?_a(t,a):n?.describeFilter?n.describeFilter(t):`${t.column}: [${t.kind}]`}function ut(t){if(t instanceof Date)return{valueType:"date",value:t};switch(typeof t){case"number":return{valueType:"number",value:t};case"bigint":return{valueType:"bigint",value:t};case"boolean":return{valueType:"boolean",value:t};default:return{valueType:"string",value:String(t)}}}function cl(t,a){const n=t??a;if(n==null)return{valueType:"string"};const l={valueType:va(n)};return t!=null&&(l.min=t),a!=null&&(l.max=a),l}function Wa(t){return{valueType:t.length>0?va(t[0]):"string",values:t}}const Oe={text:(t,a,n,r)=>({kind:"text",column:t,operator:a,value:n,...r!=null?{caseSensitive:r}:{}}),contains:(t,a,n)=>Oe.text(t,"contains",a,n),notContains:(t,a,n)=>Oe.text(t,"notContains",a,n),equals:(t,a,n)=>Oe.text(t,"equals",a,n),notEquals:(t,a,n)=>Oe.text(t,"notEquals",a,n),startsWith:(t,a,n)=>Oe.text(t,"startsWith",a,n),endsWith:(t,a,n)=>Oe.text(t,"endsWith",a,n),eq:(t,a)=>({kind:"compare",column:t,operator:"eq",...ut(a)}),neq:(t,a)=>({kind:"compare",column:t,operator:"neq",...ut(a)}),gt:(t,a)=>({kind:"compare",column:t,operator:"gt",...ut(a)}),gte:(t,a)=>({kind:"compare",column:t,operator:"gte",...ut(a)}),lt:(t,a)=>({kind:"compare",column:t,operator:"lt",...ut(a)}),lte:(t,a)=>({kind:"compare",column:t,operator:"lte",...ut(a)}),between:(t,a,n,r)=>({kind:"range",column:t,...r!=null?{exclusive:r}:{},...cl(a,n)}),oneOf:(t,a)=>({kind:"set",column:t,mode:"include",...Wa(a)}),noneOf:(t,a)=>({kind:"set",column:t,mode:"exclude",...Wa(a)}),isTrue:t=>({kind:"boolean",column:t,value:!0}),isFalse:t=>({kind:"boolean",column:t,value:!1}),isNull:t=>({kind:"null",column:t,operator:"isNull"}),isNotNull:t=>({kind:"null",column:t,operator:"isNotNull"}),composite:(t,a,n)=>({kind:"composite",column:t,mode:a,filters:n}),and:(...t)=>({kind:"and",filters:t}),or:(...t)=>({kind:"or",filters:t}),not:t=>({kind:"not",filter:t})};function ul(t,a){return t==null&&a==null?0:t==null?-1:a==null?1:typeof t=="string"&&typeof a=="string"?t.localeCompare(a):typeof t=="number"&&typeof a=="number"?t-a:typeof t=="boolean"&&typeof a=="boolean"?(t?1:0)-(a?1:0):t instanceof Date&&a instanceof Date?t.getTime()-a.getTime():String(t).localeCompare(String(a))}function dl(t,a){return t[a]}function mn(t){const{data:a,rowId:n,accessors:r={},comparators:l={},initialSort:s=[],initialFilters:c=[],pageSize:o,multiSort:i=!1,serverSide:u=!1,groupBy:m,onSortChange:f,onFilterChange:h,onPageChange:d,onSelectionChange:g,onGroupByChange:p,evaluateFilter:b}=t,y=[],k=e.prop(s),_=e.prop(c),v=e.prop(new Set),w=e.prop(1),I=e.prop(o!=null?e.Value.get(o):0);if(y.push(()=>k.dispose(),()=>_.dispose(),()=>v.dispose(),()=>w.dispose(),()=>I.dispose()),o!=null){const M=e.Value.toSignal(o),K=e.Value.on(M,re=>{I.set(re),w.set(1)});y.push(K),y.push(()=>M.dispose())}const S=e.prop([]);y.push(()=>S.dispose());const V=M=>r[M]??(K=>dl(K,M)),D=M=>l[M]??ul,$=e.Value.toSignal(a);y.push(()=>$.dispose());const x=$.map(M=>M.length);y.push(()=>x.dispose());const U=e.computedOf($,S)((M,K)=>{if(K.length===0)return M;const re=new Map(M.map(he=>[n(he),he])),ce=[];for(const he of K){const ge=re.get(he);ge!=null&&(ce.push(ge),re.delete(he))}for(const he of re.values())ce.push(he);return ce});y.push(()=>U.dispose());const z=u?U:e.computedOf(U,_)((M,K)=>K.length===0?M:M.filter(re=>K.every(ce=>{if(Dt(ce)){if(ce.kind==="text"&&ce.value==="")return!0;const he=V(ce.column);return zt(ce,he(re))}return b?b(ce,re):!0})));u||y.push(()=>z.dispose());const T=z.map(M=>M.length);y.push(()=>T.dispose());const W=u?z:e.computedOf(z,k)((M,K)=>{if(K.length===0)return M;const re=[...M];return re.sort((ce,he)=>{for(const ge of K){const xe=V(ge.column),Et=D(ge.column)(xe(ce),xe(he));if(Et!==0)return ge.direction==="desc"?-Et:Et}return 0}),re});u||y.push(()=>W.dispose());const L=e.prop(m!=null?e.Value.get(m):void 0);if(y.push(()=>L.dispose()),m!=null){const M=e.Value.toSignal(m),K=e.Value.on(M,re=>{L.set(re)});y.push(K),y.push(()=>M.dispose())}const J=e.computedOf(W,L)((M,K)=>{if(K==null)return[];const re=V(K),ce=new Map,he=[];for(const ge of M){const xe=String(re(ge)??"");ce.has(xe)||(ce.set(xe,[]),he.push(xe)),ce.get(xe).push(ge)}return he.map(ge=>({key:ge,rows:ce.get(ge)}))});y.push(()=>J.dispose());const P=o!=null,N=P?e.computedOf(T,I)((M,K)=>K>0?Math.max(1,Math.ceil(M/K)):1):e.prop(1);if(y.push(()=>N.dispose()),P){const M=e.Value.on(N,K=>{w.value>K&&w.set(Math.max(1,K))});y.push(M)}const H=u||!P?W:e.computedOf(W,w,I)((M,K,re)=>{if(re<=0)return M;const ce=(K-1)*re;return M.slice(ce,ce+re)});!u&&P&&y.push(()=>H.dispose());const X=v.map(M=>M.size);y.push(()=>X.dispose());const F=e.computedOf(v,z)((M,K)=>K.length===0?!1:K.every(re=>M.has(n(re))));y.push(()=>F.dispose());const O=e.computedOf(v,F)((M,K)=>M.size>0&&!K);y.push(()=>O.dispose());const R=new Map,Z=new Map,ie=new Map,ye=(M,K)=>{const re=K?.multi??e.Value.get(i),ce=k.value,he=ce.find(xe=>xe.column===M);let ge;he?he.direction==="asc"?ge=ce.map(xe=>xe.column===M?{...xe,direction:"desc"}:xe):ge=ce.filter(xe=>xe.column!==M):ge=re?[...ce,{column:M,direction:"asc"}]:[{column:M,direction:"asc"}],k.set(ge),f?.(ge)},Q=M=>{k.set(M),f?.(M)},oe=()=>{k.set([]),f?.([])},le=M=>{let K=R.get(M);if(!K){const re=e.untracked(()=>e.prop(k.value.find(he=>he.column===M)?.direction)),ce=k.on(he=>{re.set(he.find(ge=>ge.column===M)?.direction)},{noAutoDispose:!0});K=re,R.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},ke=M=>{const re=[..._.value.filter(ce=>ce.column!==M.column),M];_.set(re),w.set(1),h?.(re)},me=M=>{const K=[..._.value,M];_.set(K),w.set(1),h?.(K)},Ie=M=>{const K=_.value.filter(re=>re.column!==M);_.set(K),w.set(1),h?.(K)},j=()=>{_.set([]),w.set(1),h?.([])},B=M=>{let K=Z.get(M);if(!K){const re=e.untracked(()=>e.prop(_.value.filter(he=>he.column===M))),ce=_.on(he=>{re.set(he.filter(ge=>ge.column===M))},{noAutoDispose:!0});K=re,Z.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},ee=M=>{let K=ie.get(M);if(!K){const re=e.untracked(()=>e.prop(_.value.find(ge=>ge.column===M&&ge.kind==="text")?.value??"")),ce=_.on(he=>{const ge=he.find(xe=>xe.column===M&&xe.kind==="text");re.set(ge?.value??"")},{noAutoDispose:!0});K=re,ie.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},ue=M=>{v.set(M),g?.(M)},te=M=>{const K=new Set(v.value);K.has(M)?K.delete(M):K.add(M),ue(K)},_e=M=>{const K=new Set(v.value);for(const re of M)K.add(re);ue(K)},De=M=>{const K=new Set(v.value);for(const re of M)K.delete(re);ue(K)},Pe=()=>{const M=z.value.map(K=>n(K));ue(new Set(M))},E=()=>{ue(new Set)};return{rows:H,totalRows:x,totalFilteredRows:T,sort:k,toggleSort:ye,setSort:Q,getSortDirection:le,resetSort:oe,filters:_,setFilter:ke,addFilter:me,removeFilter:Ie,getColumnFilters:B,getTextFilterValue:ee,resetFilters:j,selected:v,toggleSelect:te,select:_e,deselect:De,selectAll:Pe,deselectAll:E,isAllSelected:F,isSomeSelected:O,selectedCount:X,currentPage:w,totalPages:N,pageSize:I,setPage:M=>{const K=Math.max(1,Math.min(M,N.value));w.set(K),d?.(K)},setPageSize:M=>{I.set(M),w.set(1),d?.(1)},groupBy:L,setGroupBy:M=>{L.set(M),p?.(M)},groups:J,allFilteredRows:W,moveRow:(M,K)=>{if(M===K||k.value.length>0)return;const re=$.value,ce=S.value.length>0?[...S.value]:re.map(xe=>n(xe)),he=ce.indexOf(M),ge=ce.indexOf(K);he<0||ge<0||(ce.splice(he,1),ce.splice(ge,0,M),S.set(ce))},resetAll:()=>{oe(),j(),E(),w.set(1),S.set([]),L.set(void 0)},dispose:()=>{for(const M of y)M();y.length=0,R.clear(),Z.clear(),ie.clear()}}}function hn(t,a,n){const r=[],l=Math.max(1,t-n),s=Math.min(a,t+n);l>1&&(r.push(1),l>2&&r.push("dots"));for(let c=l;c<=s;c++)r.push(c);return s<a&&(s<a-1&&r.push("dots"),r.push(a)),r}function fn(t,a){const n=new Map;switch(t){case"filled":case"pill":{const s=C.backgroundValue(a,"solid","light"),c=C.backgroundValue(a,"solid","dark");n.set("--pagination-active-bg",s.backgroundColor),n.set("--pagination-active-text",s.textColor),n.set("--pagination-active-bg-dark",c.backgroundColor),n.set("--pagination-active-text-dark",c.textColor);break}case"outline":{n.set("--pagination-active-bg","transparent"),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-border",C.borderColorValue(a,"light")),n.set("--pagination-active-bg-dark","transparent"),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark")),n.set("--pagination-active-border-dark",C.borderColorValue(a,"dark")),n.set("--pagination-item-border",be.getColorVar("base",300)),n.set("--pagination-item-border-dark",be.getColorVar("base",600));break}case"light":{const s=C.backgroundValue(a,"light","light"),c=C.backgroundValue(a,"light","dark");n.set("--pagination-active-bg",s.backgroundColor),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-bg-dark",c.backgroundColor),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark")),n.set("--pagination-item-bg",be.getColorVar("base",100)),n.set("--pagination-item-bg-dark",be.getColorVar("base",800));break}case"subtle":{n.set("--pagination-active-bg","transparent"),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-bg-dark","transparent"),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark"));break}}const r=be.getColorVar("base",100),l=be.getColorVar("base",700);return n.set("--pagination-hover-bg",r),n.set("--pagination-hover-bg-dark",l),Array.from(n.entries()).map(([s,c])=>`${s}: ${c}`).join("; ")}function gn({currentPage:t,totalPages:a,onChange:n,siblings:r=1,showPrevNext:l=!0,showFirstLast:s=!1,size:c="md",variant:o="filled",color:i="primary",justify:u=!1,responsive:m=!1}){const f=e.Value.deriveProp(r),h=e.computedOf(m,f,r)((d,g,p)=>d?g:p);return e.Use(C.BeatUII18n,d=>e.html.nav(e.attr.class(e.computedOf(c,o,u)((g,p,b)=>{const y=["bc-pagination",`bc-pagination--size-${g}`,`bc-pagination--variant-${p}`];return b&&y.push("bc-pagination--justify"),y.join(" ")})),e.attr.style(e.computedOf(o,i)((g,p)=>fn(g,p))),e.aria.label(d.$.paginationLabel),e.When(m,()=>e.WithElement(g=>{const p=()=>{const y=g.clientWidth;if(y===0)return;const k=g.querySelector(".bc-pagination__item");if(!k)return;const _=k.offsetWidth,v=parseFloat(getComputedStyle(g).gap)||0,w=_+v,I=Math.floor((y+v)/w),S=(e.Value.get(l)?2:0)+(e.Value.get(s)?2:0),V=e.Value.get(a),D=I-S,$=Math.max(0,Math.floor((D-5)/2)),x=Math.floor((V-3)/2);f.set(Math.min($,Math.max(0,x)))},b=new ResizeObserver(p);return b.observe(g),we.delayedAnimationFrame(p),e.OnDispose(()=>b.disconnect())})),e.When(s,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g<=1||p<=1)),e.aria.label(d.$.firstPage),e.on.click(g=>{g.preventDefault(),e.Value.get(a)>1&&n(1)}),"«")),e.When(l,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g<=1||p<=1)),e.aria.label(d.$.previousPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(t);p>1&&n(p-1)}),"‹")),e.ForEach(e.computedOf(t,a,h)((g,p,b)=>hn(g,p,b)),g=>{const p=g.map(y=>y==="dots"),b=e.computedOf(g,t)((y,k)=>y===k);return e.When(p,()=>e.html.span(e.attr.class("bc-pagination__dots"),"…"),()=>e.html.button(e.attr.class(e.Value.map(b,y=>y?"bc-pagination__item bc-pagination__item--active":"bc-pagination__item")),e.WithElement(y=>{e.Value.on(b,k=>{k?y.setAttribute("aria-current","page"):y.removeAttribute("aria-current")})}),e.on.click(y=>{y.preventDefault();const k=e.Value.get(g);k!=="dots"&&k!==e.Value.get(t)&&n(k)}),g.map(y=>String(y))))}),e.When(l,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g>=p||p<=1)),e.aria.label(d.$.nextPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(t),b=e.Value.get(a);p<b&&n(p+1)}),"›")),e.When(s,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g>=p||p<=1)),e.aria.label(d.$.lastPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(a);p>1&&n(p)}),"»"))))}function bn({dataSource:t,showSort:a=!0,showFilters:n=!0,showSelection:r=!0,bulkActions:l=[],resetLabel:s,describeFilter:c}){const o=e.computedOf(t.sort,t.filters,t.selectedCount)((h,d,g)=>h.length>0||d.length>0||g>0),i=e.Value.toSignal(r),u=e.computedOf(i,t.selectedCount)((h,d)=>h&&d>0),m=c?{describeFilter:c}:void 0;function f(h,d){return d?Ht(h,d,m):ka(h,m)}return e.Fragment(e.OnDispose(()=>{o.dispose(),i.dispose(),u.dispose()}),e.Use(C.BeatUII18n,h=>e.When(o,()=>e.html.div(e.attr.class("bc-data-toolbar"),e.When(a,()=>e.ForEach(t.sort,d=>it({variant:"light",color:"green",size:"sm",onClose:()=>{const g=d.value,p=t.sort.value.filter(b=>b.column!==g.column);t.setSort(p)}},d.map(g=>`${g.column} ${g.direction==="asc"?"↑":"↓"}`)))),e.When(n,()=>e.ForEach(t.filters,d=>it({variant:"light",color:"violet",size:"sm",onClose:()=>{t.removeFilter(d.value.column)}},d.map(g=>f(g,h.value.dataTable.describeFilter))))),e.When(u,()=>e.html.div(e.attr.class("bc-data-toolbar__selection"),e.html.span(e.attr.class("bc-data-toolbar__selection-count"),t.selectedCount.map(d=>h.value.dataTable.selectedCount(d))),...l.map(d=>e.html.button(e.attr.class("bc-data-toolbar__action"),e.on.click(()=>d.onClick(t.selected.value)),d.icon!=null?C.Icon({icon:d.icon,size:"sm"}):null,d.label)),e.html.button(e.attr.class("bc-data-toolbar__action bc-data-toolbar__action--secondary"),e.on.click(()=>t.deselectAll()),h.$.dataTable.map(d=>d.deselectAll)))),e.html.button(e.attr.class("bc-data-toolbar__reset"),e.on.click(()=>t.resetAll()),C.Icon({icon:"line-md:close-small",size:"sm"}),s??h.$.dataTable.map(d=>d.resetAll))))))}const We={value:(t,a,{disabled:n,before:r,after:l}={})=>({type:"value",value:t,label:a,disabled:n,before:r,after:l}),group:(t,a,{disabled:n,before:r,after:l}={})=>({type:"group",group:t,options:a,disabled:n,before:r,after:l}),break:{type:"break"},getValues:t=>t.flatMap(a=>a.type==="group"?We.getValues(a.options):a.type==="break"?[]:[a.value]),contains:(t,a,n=(r,l)=>r===l)=>We.getValues(t).some(r=>n(r,a))};function wa(t,a,n){return t.some(l=>n(l,a))?t.filter(l=>!n(l,a)):[...t,a]}function Ca(t,a,n){return t.filter(r=>!n(r,a))}function Rt(t,a,n){return t.some(r=>n(r,a))}function vn(t,a,n){for(const r of t)if(r.type==="value"){if(n(r.value,a))return{label:r.label}}else if(r.type==="group"){const l=vn(r.options,a,n);if(l!=null)return l}}function yn(t,a,n){return vn(t,a,n)?.label??String(a)}function Sa(t,a,n){const r=a.trim().toLowerCase(),l=n??((c,o)=>o.label.toLowerCase().includes(c));if(r==="")return t;const s=[];for(const c of t)if(c.type==="value")l(r,{label:c.label})&&s.push(c);else if(c.type==="group"){const o=Sa(c.options,r,l);o.length>0&&s.push({...c,options:o})}return s}function jt(t){const{value:a,options:n,equality:r=(F,O)=>F===O,placeholder:l,searchPlaceholder:s,filter:c,loadOptions:o,loadDebounce:i=300,maxSelection:u,showActions:m=!1,selectAllLabel:f,clearAllLabel:h,renderOption:d}=t,g=e.prop(!1),p=e.prop(""),b=e.prop(-1),y=e.prop(!1),k=e.prop(null),_=Te.sessionId("multi-select"),v=Te.sessionId("multi-select-listbox");let w,I,S,V;const D=e.computedOf(n,k,p)((F,O,R)=>o&&O!=null?O:Sa(F,R,c)),$=D.map(F=>We.getValues(F));g.onChange(F=>{F||(b.set(-1),p.set(""),k.set(null))});const x=F=>{const O=e.Value.get(a);t.onChange?.(Ca(O,F,r))},U=F=>{const O=e.Value.get(a),R=e.Value.get(u);R!=null&&!Rt(O,F,r)&&O.length>=R||t.onChange?.(wa(O,F,r))},z=()=>{const F=e.Value.get(u),O=$.value,R=F!=null?O.slice(0,F):O;t.onChange?.(R)},T=()=>{t.onChange?.([])},W=F=>e.computedOf(a)(O=>Rt(O,F,r)),L=F=>{p.set(F),o&&(V!=null&&clearTimeout(V),V=setTimeout(()=>{y.set(!0),o(F).then(O=>{k.set(O)}).finally(()=>{y.set(!1)})},i))},J=F=>{const O=$.value;switch(F.key){case"ArrowDown":{F.preventDefault(),g.value?b.set(Math.min(b.value+1,O.length-1)):(g.set(!0),O.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}case"ArrowUp":{F.preventDefault(),g.value&&b.set(Math.max(b.value-1,0));break}case"Enter":{if(F.preventDefault(),g.value&&b.value>=0){const R=O[b.value];R!=null&&U(R)}else g.value||(g.set(!0),O.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}case"Escape":{g.value&&(F.preventDefault(),g.set(!1),w?.focus());break}case"Backspace":{if(p.value===""){const R=e.Value.get(a);R.length>0&&t.onChange?.(R.slice(0,-1))}break}case" ":{document.activeElement!==I&&(F.preventDefault(),g.set(!g.value),g.value&&setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}}},P=e.computedOf(b,$)((F,O)=>O[F]??null),N=(F,O)=>{const R=W(F.value),Z=e.computedOf(a,u)((Q,oe)=>oe!=null&&Q.length>=oe),ie=e.computedOf(R,Z)((Q,oe)=>F.disabled===!0||!Q&&oe),ye=P.map(Q=>Q!=null?r(Q,F.value):!1);return d?e.html.div(e.attr.role("option"),e.attr.id(`multi-select-option-${String(F.value)}`),e.aria.selected(R),e.aria.disabled(ie),e.attr.class(e.computedOf(ye,R)((Q,oe)=>{const le=["bc-multi-select__option"];return Q&&le.push("bc-multi-select__option--focused"),oe&&le.push("bc-multi-select__option--selected"),O>0&&le.push("bc-multi-select__option--grouped"),le.join(" ")})),e.on.click(()=>U(F.value)),d(F,R)):e.html.div(e.attr.role("option"),e.attr.id(`multi-select-option-${String(F.value)}`),e.aria.selected(R),e.aria.disabled(ie),e.attr.class(e.computedOf(ye,R)((Q,oe)=>{const le=["bc-multi-select__option"];return Q&&le.push("bc-multi-select__option--focused"),oe&&le.push("bc-multi-select__option--selected"),O>0&&le.push("bc-multi-select__option--grouped"),le.join(" ")})),e.on.click(()=>U(F.value)),e.html.span(e.attr.class("bc-multi-select__option-check"),e.When(R,()=>C.Icon({icon:"ph:check-bold",size:"xs",color:"primary"}))),e.html.span(e.attr.class("bc-multi-select__option-label"),F.label))},H=F=>e.Ensure(F,O=>e.OneOfType(O,{value:R=>N({value:R.value.value,label:R.value.label,disabled:R.value.disabled},0),group:R=>e.html.div(e.attr.class("bc-multi-select__group"),e.html.div(e.attr.class("bc-multi-select__group-label"),R.$.group),e.ForEach(R.$.options,Z=>e.Ensure(Z,ie=>e.OneOfType(ie,{value:ye=>N({value:ye.value.value,label:ye.value.label,disabled:ye.value.disabled},1),group:()=>e.Empty,break:()=>e.html.div(e.attr.class("bc-multi-select__separator"))})))),break:()=>e.html.div(e.attr.class("bc-multi-select__separator"))})),X=e.NotEmpty(a,()=>e.ForEach(a,F=>it({variant:"light",size:t.size,onClose:()=>x(F.value),disabled:t.disabled},e.computedOf(F,n)((O,R)=>yn(R,O,r)))),()=>e.html.span(e.attr.class("bc-multi-select__placeholder"),l));return ne.InputContainer({...t,input:e.html.div(e.attr.class("bc-multi-select__badge-container"),X),after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(F=>e.Fragment(e.WithElement(O=>{w=O;const R=()=>{g.value?g.set(!1):(g.set(!0),$.value.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0))};return O.addEventListener("keydown",J),O.addEventListener("click",R),e.OnDispose(()=>{O.removeEventListener("keydown",J),O.removeEventListener("click",R),V!=null&&clearTimeout(V)})}),Fe.CommonInputAttributes(t),e.attr.id(_),e.attr.tabindex(0),e.aria.controls(v),e.aria.expanded(g),e.attr.class("bc-multi-select"),e.attr.role("combobox"),e.aria.activedescendant(e.computedOf(g,P)((O,R)=>O&&R!=null?`multi-select-option-${String(R)}`:"")),t.onBlur!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!S?.contains(document.activeElement)&&!w?.contains(document.activeElement)&&(g.set(!1),t.onBlur())})}):e.Empty,Ve.Flyout({content:()=>e.html.div(e.WithElement(O=>{S=O}),e.style.minWidth(F.$.width.map(O=>`${O-10}px`)),e.attr.class("bc-multi-select__dropdown"),e.html.input(e.WithElement(O=>{I=O}),e.attr.type("text"),e.attr.class("bc-multi-select__search"),e.attr.placeholder(e.computedOf(s,l)((O,R)=>O??R??"Search...")),e.attr.value(p),e.on.input(O=>{const R=O.target;L(R.value)}),e.on.keydown(O=>{(O.key==="ArrowUp"||O.key==="ArrowDown"||O.key==="Enter"||O.key==="Escape"||O.key==="Backspace"&&p.value==="")&&J(O)})),e.When(m,()=>e.html.div(e.attr.class("bc-multi-select__actions"),e.html.button(e.attr.type("button"),e.attr.class("bc-multi-select__action"),e.on.click(O=>{O.stopPropagation(),z()}),f??"Select all"),e.html.span(e.attr.class("bc-multi-select__action-sep"),"|"),e.html.button(e.attr.type("button"),e.attr.class("bc-multi-select__action"),e.on.click(O=>{O.stopPropagation(),T()}),h??"Clear all"))),e.When(y,()=>e.html.div(e.attr.class("bc-multi-select__loading"),e.Use(C.BeatUII18n,O=>O.$.loadingShort))),e.html.div(e.attr.role("listbox"),e.attr.id(v),e.aria.labelledby(_),e.WithElement(O=>{O.setAttribute("aria-multiselectable","true")}),e.attr.class("bc-multi-select__listbox"),e.When(e.computedOf(D,y)((O,R)=>!R&&O.length===0),()=>e.html.div(e.attr.class("bc-multi-select__empty"),e.Use(C.BeatUII18n,O=>O.$.noResults))),e.ForEach(D,H)),e.When(e.computedOf(a)(O=>O.length>0),()=>e.html.div(e.attr.class("bc-multi-select__footer"),e.computedOf(a,u)((O,R)=>R!=null?`${O.length} / ${R} selected`:`${O.length} selected`)))),mainAxisOffset:0,placement:"bottom-start",hasPopup:"listbox",open:g,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function pl(t){return se.BaseControl(jt,t)}function ml(t){return se.Control(jt,t)}function Ua(t){for(const a of t)if(a.kind==="set"&&a.mode==="include")return a.values.map(String);return[]}function ot(t){const{dataSource:a,column:n,size:r="sm"}=t;if(t.type==="tags"){const{options:m,placeholder:f}=t,h=a.getColumnFilters(n),d=e.prop(Ua(h.value)),g=h.on(b=>{d.set(Ua(b))}),p=m.map(b=>We.value(b.value,b.label));return e.Fragment(e.OnDispose(()=>{g(),d.dispose()}),e.Use(C.BeatUII18n,b=>jt({value:d,options:p,size:r,placeholder:f??b.$.dataTable.map(y=>y.filterTagsPlaceholder),showActions:!0,onChange:y=>{d.set(y),y.length===0?a.removeFilter(n):a.setFilter(Oe.oneOf(n,y))}})))}if(t.type==="select"){const{options:m,allLabel:f}=t,d=a.getColumnFilters(n).map(g=>g.find(b=>b.kind==="text")?.value??"");return e.Use(C.BeatUII18n,g=>{const p=f??g.value.dataTable.selectAll,b=[We.value("",p),...m.map(y=>We.value(y.value,y.label))];return ae.NativeSelect({value:d,options:b,size:r,class:"bc-column-filter",onChange:y=>{y===""?a.removeFilter(n):a.setFilter(Oe.equals(n,y))}})})}const l=a.getTextFilterValue(n),{placeholder:s,operator:c="contains",debounce:o=300}=t;let i;const u=l.map(m=>m===""?null:m);return e.Fragment(e.OnDispose(()=>{i!=null&&clearTimeout(i),u.dispose()}),e.Use(C.BeatUII18n,m=>Fe.TextInput({value:l,size:r,class:"bc-column-filter",placeholder:s??m.$.dataTable.map(f=>f.filterPlaceholder),onInput:f=>{i!=null&&clearTimeout(i),i=setTimeout(()=>{f===""?a.removeFilter(n):a.setFilter(Oe.text(n,c,f))},o)},after:ae.NullableResetAfter(u,void 0,()=>{i!=null&&clearTimeout(i),a.removeFilter(n)})})))}function hl(t){const a={up:"M0 16 L8 10 L16 16 Z",down:"M0 0 L8 6 L16 0 Z",left:"M16 0 L10 8 L16 16 Z",right:"M0 0 L6 8 L0 16 Z"};return e.svg.svg(e.svgAttr.viewBox("0 0 16 16"),e.svg.path(e.svgAttr.d(t.map(n=>a[n]))))}function ft(t){const{content:a,placement:n="top",showDelay:r=250,hideDelay:l=500,mainAxisOffset:s=8,crossAxisOffset:c=0,showOn:o="hover-focus"}=t,i=Te.sessionId("tooltip");return e.Fragment(e.aria.describedby(i),Ve.Flyout({content:()=>e.Fragment(e.attr.class("bc-tooltip"),e.attr.role("tooltip"),e.attr.id(i),a),placement:n,showDelay:r,hideDelay:l,mainAxisOffset:s,crossAxisOffset:c,showOn:o,closable:!0,role:"tooltip",arrow:u=>{const m=u.map(({placement:f})=>f.includes("top")?"down":f.includes("bottom")?"up":f.includes("left")?"right":f.includes("right")?"left":"up");return e.Fragment(e.attr.class("bc-tooltip__arrow"),e.attr.class(m.map(f=>`bc-tooltip__arrow-${f}`)),e.style.transform(u.map(({x:f,y:h})=>f==null&&h==null?"":f!=null?`translate(${f}px, 0)`:`translate(0, ${h}px)`)),hl(m))}}))}function Ot({open:t},...a){return e.WithElement(n=>{const{status:r,setOpen:l,dispose:s}=He.useAnimatedElementToggle({initialStatus:e.Value.get(t)?"opened":"closed",element:n});return e.Value.on(t,l),Ce.ElementRect(c=>{const o=e.prop(null);return e.computedOf(r,c.$.height)((u,m)=>u==="opened"&&m>0?m:null).on(u=>{u!=null&&o.set(u)}),r.on(u=>{if(n&&u==="start-opening"){const m=n.style.height,f=n.style.transition;n.style.transition="none",n.style.height="auto",n.offsetHeight;const h=n.scrollHeight;h>0&&o.set(h),n.style.height=m,n.style.transition=f,n.offsetHeight}}),e.Fragment(e.OnDispose(s),e.attr.style(o.map(u=>`--collapse-height: ${u!=null?`${u}px`:"auto"}`)),e.attr.class(r.map(u=>`bc-collapse bc-collapse--${u}`)),...a)})})}function fl(t,a){return["bc-accordion",`bc-accordion--size-${t}`,`bc-accordion--${a}`].join(" ")}function gl({items:t,multiple:a=!1,size:n="md",variant:r="default"}){const l=Te.sessionId("accordion"),s=new Map;for(const o of t)s.set(o.key,e.prop(o.defaultOpen??!1));const c=o=>{const i=s.get(o);if(i!=null){if(!e.Value.get(a))for(const[u,m]of s)u!==o&&m.set(!1);i.update(u=>!u)}};return e.html.div(e.attr.class(e.computedOf(n,r)(fl)),e.attr.role("presentation"),...t.map((o,i)=>{const u=s.get(o.key),m=`${l}-header-${i}`,f=`${l}-panel-${i}`;return e.html.div(e.attr.class("bc-accordion__item"),e.attr.class(u.map(h=>h?"bc-accordion__item--open":"bc-accordion__item--closed")),o.disabled?e.attr.class("bc-accordion__item--disabled"):e.Empty,e.html.button(e.attr.type("button"),e.attr.class("bc-accordion__header"),e.attr.id(m),e.aria.expanded(u),e.aria.controls(f),e.attr.disabled(o.disabled??!1),e.on.click(h=>{h.preventDefault(),o.disabled||c(o.key)}),e.html.span(e.attr.class("bc-accordion__header-content"),o.header),e.html.span(e.attr.class("bc-accordion__chevron"),e.attr.class(u.map(h=>h?"bc-accordion__chevron--open":"bc-accordion__chevron--closed")),e.html.span(e.attr.class("bc-accordion__chevron-icon")))),e.html.div(e.attr.id(f),e.attr.role("region"),e.aria.labelledby(m),e.html.div(Ot({open:u},e.html.div(e.attr.class("bc-accordion__body"),o.body)))))}))}function bl(t,a,n,r){const l=["bc-action-card"];return t&&l.push("bc-action-card--active"),a&&l.push("bc-action-card--disabled"),n!=="md"&&l.push(`bc-action-card--${n}`),r&&!a&&l.push("bc-action-card--clickable"),l.join(" ")}function vl(t,a,n,r){const l=new Map;if(t!=null&&l.set("--action-card-bg",t),a!=null&&l.set("--action-card-border",a),n!=null&&l.set("--action-card-title-color",n),r!=null&&l.set("--action-card-description-color",r),l.size!==0)return Array.from(l.entries()).map(([s,c])=>`${s}: ${c}`).join("; ")}function yl({icon:t,title:a,description:n,active:r=!1,disabled:l=!1,onClick:s,size:c="md",iconColor:o="primary",iconSize:i="md",backgroundColor:u,borderColor:m,titleColor:f,descriptionColor:h}){const d=s!=null;return e.html.div(e.attr.class(e.computedOf(r,l,c)((g,p,b)=>bl(g??!1,p??!1,b??"md",d))),e.attr.style(e.computedOf(u,m,f,h)((g,p,b,y)=>vl(g,p,b,y))),e.When(d,()=>e.Fragment(e.Unless(l,()=>e.Fragment(e.on.click(()=>s?.()),e.attr.tabindex(0))),e.attr.role("button"))),e.aria.disabled(l),e.html.div(e.attr.class("bc-action-card__icon"),C.Icon({icon:t,size:i,color:o})),e.html.div(e.attr.class("bc-action-card__content"),e.html.div(e.attr.class("bc-action-card__title"),a),e.html.div(e.attr.class("bc-action-card__description"),n)))}const kl=["!=","<=",">=","<",">","="];function _l(t){for(const a of kl)if(typeof t=="string"&&t.startsWith(a))return[a,t.slice(a.length)];return["=",t]}function kn(t,a,n){const[r,l]=_l(a),s=t.findIndex(i=>i[1]===l);if(s===-1)throw new Error(`Breakpoint ${String(l)} not found`);const c=t[s][0],o=s<t.length-1?t[s+1][0]:1/0;switch(r){case"=":return n>=c&&n<o;case"!=":return!(n>=c&&n<o);case"<=":return n<=c;case">=":return n>=c;case"<":return n<c;case">":return n>c;default:return!1}}function wl(t,a){const n=t.findIndex(r=>r[0]>a);return n===-1?t[t.length-1][1]:n===0?t[0][1]:t[n-1][1]}function Va(t,{breakpoints:a,mode:n="viewport"}){const l=[...Object.entries(a).map(([c,o])=>[o,c])].sort((c,o)=>c[0]-o[0]),s=c=>{const o=c.map(({width:u})=>{const m=l.findIndex(f=>f[0]>u);return m===-1?{width:u,breakpoint:l[l.length-1][1]}:m===0?{width:u,breakpoint:l[0][1]}:{width:u,breakpoint:l[m-1][1]}});return t({value:o,breakpoints:a,asList:l,is:(u,m)=>kn(l,u,m)})};return n==="element"?Ce.ElementRect(s):Ce.WindowSize(s)}let Jt=NaN;function Cl(t,a){return t?(isNaN(Jt)&&(Jt=parseFloat(getComputedStyle(document.documentElement).fontSize)),parseFloat(t)*Jt):a}function Ae(t,a,n){return Cl(t.getPropertyValue(a),n)}function _n(t){return e.WithElement(a=>{const n=getComputedStyle(a),r={zero:0,xs:Ae(n,"--breakpoint-xs",640),sm:Ae(n,"--breakpoint-sm",768),md:Ae(n,"--breakpoint-md",1024),lg:Ae(n,"--breakpoint-lg",1280),xl:Ae(n,"--breakpoint-xl",1536)};return Va(t,{breakpoints:r})})}function Sl(t){return e.WithElement(a=>{const n=getComputedStyle(a),r={zero:0,"3xs":Ae(n,"--container-3xs",256),"2xs":Ae(n,"--container-2xs",288),xs:Ae(n,"--container-xs",320),sm:Ae(n,"--container-sm",384),md:Ae(n,"--container-md",448),lg:Ae(n,"--container-lg",512),xl:Ae(n,"--container-xl",640),"2xl":Ae(n,"--container-2xl",768),"3xl":Ae(n,"--container-3xl",1024),"4xl":Ae(n,"--container-4xl",1280),"5xl":Ae(n,"--container-5xl",1536),"6xl":Ae(n,"--container-6xl",2048)};return Va(t,{breakpoints:r,mode:"element"})})}async function Vl(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const a=document.createElement("textarea");return a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a),!0}catch{return!1}}}function Il({text:t,size:a="sm",color:n="base",variant:r="subtle",roundedness:l="sm",disabled:s=!1,timeout:c=2e3},...o){const i=e.prop("idle");let u;return e.Use(C.BeatUII18n,m=>{const f=e.Value.map(i,g=>g==="copied"),h=e.computedOf(i,m.$.copyButton.$.copied,m.$.copyButton.$.copyToClipboard)((g,p,b)=>g==="copied"?p:b),d=async()=>{if(e.Value.get(s))return;await Vl(e.Value.get(t))&&(u!=null&&clearTimeout(u),i.set("copied"),u=setTimeout(()=>i.set("idle"),e.Value.get(c)))};return e.html.span(e.attr.class(e.Value.map(i,g=>g==="copied"?"bc-copy-button bc-copy-button--copied":"bc-copy-button")),e.OnDispose(()=>{u!=null&&clearTimeout(u)}),ne.Button({variant:r,size:a,roundedness:l,disabled:s,color:n,onClick:d},e.aria.label(h),e.attr.title(h),e.When(f,()=>C.Icon({icon:"lucide:check",size:a}),()=>C.Icon({icon:"lucide:copy",size:a})),...o))})}function $l(t,a,n,r){const l=["bc-toggle-button",`bc-toggle-button--size-${t}`,`bc-control--padding-${t}`,`bc-control--rounded-${a}`];return n&&l.push("bc-toggle-button--full-width"),r&&l.push("bc-toggle-button--pressed"),l.join(" ")}function xl(t,a,n,r){const l=new Map;l.set("--toggle-text-shadow","var(--text-shadow-none)"),l.set("--toggle-text-shadow-dark","var(--text-shadow-none)");const s=(c,o,i,u)=>{r||(l.set("--toggle-bg-hover",c),l.set("--toggle-text-hover",i),l.set("--toggle-bg-hover-dark",o),l.set("--toggle-text-hover-dark",u))};if(n){const c=C.backgroundValue(a,"solid","light"),o=C.backgroundValue(a,"solid","dark");l.set("--toggle-bg",c.backgroundColor),l.set("--toggle-text",c.textColor),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",o.textColor),l.set("--toggle-border",c.backgroundColor),l.set("--toggle-border-dark",o.backgroundColor),l.set("--toggle-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),l.set("--toggle-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const i=C.hoverBackgroundValue(a,"solid","light"),u=C.hoverBackgroundValue(a,"solid","dark");s(i.backgroundColor,u.backgroundColor,i.textColor,u.textColor)}else switch(t){case"outline":case"dashed":{l.set("--toggle-bg","transparent"),l.set("--toggle-bg-dark","transparent"),l.set("--toggle-border",C.borderColorValue(a,"light")),l.set("--toggle-border-dark",C.borderColorValue(a,"dark")),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-text-dark",C.textColorValue(a,"dark")),t==="dashed"&&l.set("--toggle-border-style","dashed");const c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");s(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}case"light":{const c=C.backgroundValue(a,"light","light"),o=C.backgroundValue(a,"light","dark");l.set("--toggle-bg",c.backgroundColor),l.set("--toggle-text",c.textColor),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",o.textColor);const i=C.hoverBackgroundValue(a,"light","light"),u=C.hoverBackgroundValue(a,"light","dark");s(i.backgroundColor,u.backgroundColor,i.textColor,u.textColor);break}case"filled":{const c=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",c.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const i=C.hoverBackgroundValue("base","light","light"),u=C.hoverBackgroundValue("base","light","dark");s(i.backgroundColor,u.backgroundColor,l.get("--toggle-text")??c.textColor,l.get("--toggle-text-dark")??o.textColor);break}case"default":{const c=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",c.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark")),l.set("--toggle-border",be.getColorVar("neutral",300)),l.set("--toggle-border-dark",be.getColorVar("neutral",700));const i=C.hoverBackgroundValue("base","light","light"),u=C.hoverBackgroundValue("base","light","dark");s(i.backgroundColor,u.backgroundColor,l.get("--toggle-text")??c.textColor,l.get("--toggle-text-dark")??o.textColor);break}case"subtle":{l.set("--toggle-bg","transparent"),l.set("--toggle-bg-dark","transparent"),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const c=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");s(c.backgroundColor,o.backgroundColor,c.textColor,o.textColor);break}default:{const c=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",c.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const i=C.hoverBackgroundValue("base","light","light"),u=C.hoverBackgroundValue("base","light","dark");s(i.backgroundColor,u.backgroundColor,l.get("--toggle-text")??c.textColor,l.get("--toggle-text-dark")??o.textColor);break}}return Array.from(l.entries()).map(([c,o])=>`${c}: ${o}`).join("; ")}function wn({pressed:t,onChange:a,disabled:n=!1,variant:r="outline",size:l="md",color:s="primary",roundedness:c="sm",fullWidth:o=!1},...i){return e.html.button(e.attr.type("button"),e.attr.disabled(n),e.aria.pressed(t),e.attr.class(e.computedOf(l,c,o,t)($l)),e.attr.style(e.computedOf(r,s,t,n)(xl)),e.on.click(u=>{u.preventDefault(),u.stopPropagation(),e.Value.get(n)||a?.(!e.Value.get(t))}),...i)}function Dl(t,a){return["bc-toggle-button-group",`bc-toggle-button-group--${t}`,`bc-toggle-button-group--rounded-${a}`].join(" ")}function Ol({items:t,value:a,onChange:n,multiple:r=!1,disabled:l=!1,variant:s="outline",size:c="md",color:o="primary",roundedness:i="sm",orientation:u="horizontal"}){const m=(f,h)=>{const d=e.Value.get(a),g=e.Value.get(r);let p;g?p=h?[...d,f]:d.filter(b=>b!==f):p=h?[f]:[],n?.(p)};return e.html.div(e.attr.role("group"),e.attr.class(e.computedOf(u,i)(Dl)),e.aria.orientation(u),...t.map(f=>{const h=e.Value.map(a,g=>g.includes(f.key)),d=f.disabled?e.Value.map(l,g=>g||f.disabled):l;return wn({pressed:h,onChange:g=>m(f.key,g),disabled:d,variant:s,size:c,color:o,roundedness:"none",fullWidth:!1},f.label)}))}function qe(t,a){return`bc-panel ${(Array.isArray(t)?t:[t]).map(r=>`bc-panel--side-${r}`).join(" ")} bc-panel--shadow-${a}`}function nt(t){const a=e.Value.toSignal(t).map(r=>C.backgroundValue(r,"lighter","light")),n=e.Value.toSignal(t).map(r=>C.backgroundValue(r,"lighter","dark"));return e.Fragment(e.style.variable("--panel-bg",a.$.backgroundColor),e.style.variable("--panel-text",a.$.textColor),e.style.variable("--panel-bg-dark",n.$.backgroundColor),e.style.variable("--panel-text-dark",n.$.textColor))}const Xe={banner:{zero:32,xs:32,sm:32,md:32,lg:32,xl:32},header:{zero:60,xs:60,sm:60,md:60,lg:60,xl:60},mainHeader:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},mainFooter:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},footer:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},menu:{zero:300,xs:300,sm:300,md:300,lg:300,xl:300},aside:{zero:280,xs:280,sm:280,md:280,lg:280,xl:280}};function Ra(t,a){if(typeof t=="number")return{zero:t,xs:t,sm:t,md:t,lg:t,xl:t};const n={zero:t.zero??a.zero,xs:t.xs??a.xs,sm:t.sm??a.sm,md:t.md??a.md,lg:t.lg??a.lg,xl:t.xl??a.xl};return n.xs<n.zero&&(n.xs=n.zero),n.sm<n.xs&&(n.sm=n.xs),n.md<n.sm&&(n.md=n.sm),n.lg<n.md&&(n.lg=n.md),n.xl<n.lg&&(n.xl=n.lg),n}function ea(t){t=t.filter(a=>a.some(n=>n!=null&&!n.startsWith("?")));for(let a=0;a<t[0].length;a++)t.every(n=>n[a]==null||n[a].startsWith("?"))&&(t=t.map(n=>n.filter((r,l)=>l!==a)),a--);return t=t.map(a=>a.map(n=>n?.startsWith("?")?n.slice(1):n)),t}function Tl({smallBreakpoint:t,mediumBreakpoint:a,vertical:n,horizontal:r,is:l}){function s(i){let u=[[null],[null],[null],[null],[null],[null]];const m=[];m.push("1fr");const f=[];return r.banner&&(f.push(r.banner[i]+"px"),u[0][1]="banner"),(r.header||n.menu||n.aside)&&(f.push((r.header?.[i]??Xe.header[i])+"px"),u[1][1]="header"),r.mainHeader&&(f.push(r.mainHeader[i]+"px"),u[2][1]="mainHeader"),f.push("1fr"),u[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[i]+"px"),u[4][1]="mainFooter"),r.footer&&(f.push(r.footer[i]+"px"),u[5][1]="footer"),u=ea(u),{columns:m.join(" "),rows:f.join(" "),areas:u.map(d=>`"${d.join(" ")}"`).join(`
2
- `),displayMenu:!1,displayAside:!1,menuWidth:Xe.menu[i]+"px",asideWidth:Xe.aside[i]+"px"}}function c(i){let u=[[null,null],[null,null],[null,null],[null,null],[null,null],[null,null]];const m=[];n.menu&&(m.push(n.menu[i]+"px"),u[2][0]="?menu",u[3][0]="menu",u[4][0]="?menu"),m.push("1fr");const f=[];return r.banner&&(f.push(r.banner[i]+"px"),u[0][0]="?banner",u[0][1]="banner"),(r.header||n.aside)&&(f.push((r.header?.[i]??Xe.header[i])+"px"),u[1][0]="?header",u[1][1]="header"),r.mainHeader&&(f.push(r.mainHeader[i]+"px"),u[2][1]="mainHeader"),f.push("1fr"),u[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[i]+"px"),u[4][1]="mainFooter"),r.footer&&(f.push(r.footer[i]+"px"),u[5][0]="?footer",u[5][1]="footer"),u=ea(u),{columns:m.join(" "),rows:f.join(" "),areas:u.map(d=>`"${d.join(" ")}"`).join(`
3
- `),displayMenu:!0,displayAside:!1,menuWidth:Xe.menu[i]+"px",asideWidth:Xe.aside[i]+"px"}}function o(i){let u=[[null,null,null],[null,null,null],[null,null,null],[null,null,null],[null,null,null],[null,null,null]];const m=[];n.menu&&(m.push(n.menu[i]+"px"),u[2][0]="?menu",u[3][0]="menu",u[4][0]="?menu"),m.push("1fr"),n.aside&&(m.push(n.aside[i]+"px"),u[2][2]="?aside",u[3][2]="aside",u[4][2]="?aside");const f=[];return r.banner&&(f.push(r.banner[i]+"px"),u[0][0]="?banner",u[0][1]="banner",u[0][2]="?banner"),r.header&&(f.push(r.header[i]+"px"),u[1][0]="?header",u[1][1]="header",u[1][2]="?header"),r.mainHeader&&(f.push(r.mainHeader[i]+"px"),u[2][1]="mainHeader"),f.push("1fr"),u[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[i]+"px"),u[4][1]="mainFooter"),r.footer&&(f.push(r.footer[i]+"px"),u[5][0]="?footer",u[5][1]="footer",u[5][2]="?footer"),u=ea(u),{columns:m.join(" "),rows:f.join(" "),areas:u.map(d=>`"${d.join(" ")}"`).join(`
4
- `),displayMenu:!0,displayAside:!0,menuWidth:Xe.menu[i]+"px",asideWidth:Xe.aside[i]+"px"}}return({width:i,breakpoint:u})=>l(`<=${t}`,i)?s(u):l(`<=${a}`,i)?c(u):o(u)}const Pl=["menu","aside"],El=["banner","header","mainHeader","mainFooter","footer"];function Fl(t,{displayMenu:a},n){return t?a?"block":n?"float":"none":"none"}function Ll(t,{displayAside:a},n){return t?a?"block":n?"float":"none":"none"}function Al({smallBreakpoint:t="sm",mediumBreakpoint:a="md",...n}){const r=Object.fromEntries(Pl.filter(s=>n[s]).map(s=>[s,Ra(n[s].width??{},Xe[s])])),l=Object.fromEntries(El.filter(s=>n[s]).map(s=>[s,Ra(n[s].height??{},Xe[s])]));return e.Use(C.BeatUII18n,s=>_n(({value:c,is:o})=>{const i=Tl({smallBreakpoint:t,mediumBreakpoint:a,vertical:r,horizontal:l,is:o}),u=c.map(i),m=l.header!=null||r.menu!=null||r.aside!=null,f=e.computedOf(r.aside!=null,u)((k,{displayAside:_})=>k&&!_),h=e.computedOf(r.menu!=null,u)((k,{displayMenu:_})=>k&&!_),d=He.useAnimatedElementToggle(),g=He.useAnimatedElementToggle(),p=e.prop(0),b=e.computedOf(r.menu!=null,u,d.display)(Fl),y=e.computedOf(r.aside!=null,u,g.display)(Ll);return e.html.div(e.style.display("grid"),e.style.height("100%"),e.style.width("100%"),e.style.gridTemplateColumns(u.$.columns),e.style.gridTemplateRows(u.$.rows),e.style.gridTemplateAreas(u.$.areas),e.style.gridColumnGap("0"),e.style.gridRowGap("0"),n.banner?e.html.header(e.attr.class(qe("none",n.banner.shadow??"none")),nt(n.banner.color??"white"),e.style.height("100%"),e.style.gridArea("banner"),n.banner.content):null,e.html.header(e.attr.class(qe("bottom",n.header?.shadow??"none")),nt(n.header?.color??"white"),e.style.zIndex("20"),e.style.display(m?"block":"none"),e.style.gridArea("header"),Ce.ElementRect(k=>(k.$.bottom.feedProp(p),null)),e.html.div(e.style.display("flex"),e.style.height("100%"),e.html.div(e.style.display(h.map(k=>k?"flex":"none")),e.style.alignItems("center"),e.style.justifyContent("center"),e.style.height("100%"),e.style.width("60px"),ne.Button({onClick:()=>d.toggle(),variant:"light",color:"base"},e.aria.label(s.$.toggleMenu),C.Icon({icon:d.display.map(k=>k?"line-md/menu-to-close-alt-transition":"line-md/close-to-menu-alt-transition")}))),e.html.div(e.style.height("100%"),e.style.flexGrow("1"),n.header?.content),e.html.div(e.style.alignItems("center"),e.style.justifyContent("center"),e.style.height("100%"),e.style.width("60px"),e.style.display(f.map(k=>k?"flex":"none")),ne.Button({onClick:()=>g.toggle(),roundedness:"full",variant:"light",color:"base"},e.aria.label(s.$.toggleAside),C.Icon({icon:"line-md/chevron-left"},e.attr.style("transition: transform 0.2s ease-in-out"),e.attr.style(g.display.map(k=>`transform: rotate(${k?180:0}deg)`))))))),n.menu?e.html.nav(e.WithElement(k=>d.setElement(k)),e.style.zIndex("10"),e.aria.label(s.$.mainNavigation),e.attr.role("navigation"),e.style.overflow("hidden"),e.attr.class(b.map(k=>k==="float"?qe("right",n.menu?.shadow??"md"):qe("right",n.menu?.shadow??"none"))),nt(n.menu?.color??"white"),e.style.height(b.map(k=>k==="float"?"auto":"100%")),e.style.overflow("hidden"),e.style.gridArea("menu"),e.style.display(e.computedOf(b,d.status)((k,_)=>k==="none"&&_==="closed"?"none":"block")),e.style.position(e.computedOf(b,d.status)((k,_)=>k==="float"||k==="none"&&_!=="closed"?"fixed":"initial")),e.style.top(p.map(k=>`${k}px`)),e.WithElement(k=>{k.style.setProperty("--slide-distance","100%")}),He.AnimatedToggleClass({animation:{slide:"right"},status:e.computedOf(b,d.status)((k,_)=>k==="block"?"opened":_)}),e.style.width(e.coalesce(n.menu?.width,u.$.menuWidth)),e.style.bottom("0"),n.menu?.content):null,n.mainHeader?e.html.header(e.style.height("100%"),e.style.gridArea("mainHeader"),e.attr.class(qe("none",n.mainHeader?.shadow??"none")),nt(n.mainHeader?.color??"white"),n.mainHeader.content):null,e.html.main(e.style.height("100%"),e.style.overflow("hidden"),e.style.gridArea("main"),e.attr.class(qe("none",n.main?.shadow??"none")),nt(n.main?.color??"white"),n.main.content),n.mainFooter?e.html.footer(e.style.height("100%"),e.style.gridArea("mainFooter"),e.attr.class(qe("none",n.mainFooter?.shadow??"none")),nt(n.mainFooter?.color??"white"),n.mainFooter.content):null,n.aside?e.html.aside(e.WithElement(k=>{g.setElement(k)}),e.style.zIndex("10"),e.aria.label(s.$.sidebar),e.attr.role("complementary"),e.attr.class(y.map(k=>k==="float"?qe("left","md"):qe("left","none"))),nt("white"),e.style.height("100%"),e.style.gridArea("aside"),e.style.display(e.computedOf(y,g.status)((k,_)=>k==="none"&&_==="closed"?"none":"block")),e.style.position(e.computedOf(y,g.status)((k,_)=>k==="float"||k==="none"&&_!=="closed"?"fixed":"initial")),e.style.top(p.map(k=>`${k}px`)),e.WithElement(k=>{k.style.setProperty("--slide-distance","100%")}),He.AnimatedToggleClass({animation:{slide:"left"},status:e.computedOf(y,g.status)((k,_)=>k==="block"?"opened":_)}),e.style.width(e.coalesce(n.aside?.width,u.$.asideWidth)),e.style.bottom(p.map(k=>`${k}px`)),n.aside.content):null,n.footer?e.html.footer(e.attr.class(qe("top","none")),nt("white"),e.style.height("100%"),e.style.gridArea("footer"),n.footer.content):null)}))}function Bl(...t){return e.html.div(e.attr.class("bc-center-h"),e.html.div(e.attr.class("bc-center__content"),...t))}function Ml(t){const a=["bc-center"];return t!=="lg"&&a.push(`bc-center--gap-${t}`),a.join(" ")}function Nl({gap:t="lg"}={},...a){return e.html.div(e.attr.class(e.computedOf(t)(n=>Ml(n??"lg"))),...a)}function za(t,a,n,r,l){const s=["bc-divider"];return t==="vertical"&&s.push("bc-divider--vertical"),a!=="solid"&&s.push(`bc-divider--${a}`),n!=="default"&&s.push(`bc-divider--tone-${n}`),r&&(s.push("bc-divider--labeled"),l!=="center"&&s.push(`bc-divider--labeled-${l}`)),s.join(" ")}function Wl({orientation:t="horizontal",variant:a="solid",tone:n="default",label:r,labelAlign:l="center"}={}){return r!=null?e.html.div(e.attr.class(e.computedOf(t,a,n,l)((c,o,i,u)=>za(c??"horizontal",o??"solid",i??"default",!0,u??"center"))),e.attr.role("separator"),e.html.span(e.attr.class("bc-divider__line")),e.html.span(e.attr.class("bc-divider__label"),r),e.html.span(e.attr.class("bc-divider__line"))):e.html.hr(e.attr.class(e.computedOf(t,a,n)((c,o,i)=>za(c??"horizontal",o??"solid",i??"default",!1,"center"))),e.attr.role("separator"))}const Ft=12,Lt=40;function ca(t){return`${t}px`}function _t(t){return e.Value.map(t,ca)}function Me(t,a){return we.biMin(we.biMax(0n,a),we.biMax(0n,t))}function Ul({body:t,contentWidth:a,contentHeight:n,header:r,headerHeight:l=0,topStart:s,topEnd:c,footer:o,footerHeight:i=0,bottomStart:u,bottomEnd:m,sidebarStart:f,sidebarStartWidth:h=0,sidebarEnd:d,sidebarEndWidth:g=0,anchorMode:p="container-edge"}){const b=e.prop(0n),y=e.prop(0n),k=_t(l),_=_t(i),v=_t(h),w=_t(g);return e.Use(C.BeatUII18n,I=>e.html.div(e.attr.class("bc-nine-slice-container"),e.attr.tabindex(0),e.attr.role("group"),e.aria.label(I.$.scrollableGridView),Ce.ElementRect(S=>{const V=e.computedOf(S.$.width,h,g)((E,q,de)=>E-q-de),D=e.computedOf(S.$.height,l,i)((E,q,de)=>E-q-de),$=e.computedOf(a,V)((E,q)=>E>BigInt(Math.max(0,q))),x=e.computedOf(n,D)((E,q)=>E>BigInt(Math.max(0,q))),U=e.computedOf(V,x)((E,q)=>q?E-Ft:E),z=e.computedOf(D,$)((E,q)=>q?E-Ft:E),T=U.map(ca),W=z.map(ca),L=e.computedOf(n,z)((E,q)=>we.biMax(0n,E-BigInt(Math.max(1,q)))),J=e.computedOf(a,U)((E,q)=>we.biMax(0n,E-BigInt(Math.max(1,q)))),P=e.Value.map(p,E=>E==="body-end"||E==="body-end-bottom"),N=e.When(P,()=>e.style.left(e.computedOf(h,a,U,g)((E,q,de,pe)=>{const Le=E+Number(q),$e=E+de,Ue=Math.min(Le,$e);return`${Math.max(E+pe,Ue)}px`})),()=>e.style.right("0")),H=e.Value.map(p,E=>E==="body-bottom"||E==="body-end-bottom"),X=e.When(H,()=>e.style.top(e.computedOf(l,n,z,i)((E,q,de,pe)=>{const Le=E+Number(q),$e=E+de,Ue=Math.min(Le,$e);return`${Math.max(E+pe,Ue)}px`})),()=>e.style.bottom("0")),F=e.computedOf(x)(E=>E?`${Ft}px`:"0"),O=e.computedOf($)(E=>E?`${Ft}px`:"0"),R=e.style.transform(e.computedOf(y,b,$,x)((E,q,de,pe)=>{const Le=de?`translateX(-${E}px)`:"",$e=pe?`translateY(-${q}px)`:"";return`${Le} ${$e}`.trim()||"none"})),Z=e.style.transform(y.map(E=>`translateX(-${E}px)`)),ie=e.style.transform(b.map(E=>`translateY(-${E}px)`));let ye=null,Q=0,oe=0;const le=()=>{const E=L.value,q=J.value,de=x.value,pe=$.value;de&&oe!==0&&b.set(Me(b.value+BigInt(Math.round(oe)),E)),pe&&Q!==0&&y.set(Me(y.value+BigInt(Math.round(Q)),q)),Q=0,oe=0,ye=null};J.on(E=>{y.value>E&&y.set(we.biMax(0n,E))}),L.on(E=>{b.value>E&&b.set(we.biMax(0n,E))}),$.on(E=>{E||y.set(0n)}),x.on(E=>{E||b.set(0n)});const ke=e.createInertiaHandler((E,q)=>{const de=J.value,pe=L.value;$.value&&y.set(Me(y.value-BigInt(Math.round(E)),de)),x.value&&b.set(Me(b.value-BigInt(Math.round(q)),pe))},{friction:.92,minVelocity:.5});let me=null;const Ie=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,j=e.computedOf(U,a)((E,q)=>{const de=Number(q);return de>0?Math.max(24,E*E/de):0}),B=e.computedOf(U,j)((E,q)=>Math.max(1,E-q)),ee=e.computedOf(y,J,B)((E,q,de)=>{const pe=Number(q);return pe>0?Number(E)/pe*de:0}),ue=e.computedOf(z,n)((E,q)=>{const de=Number(q);return de>0?Math.max(24,E*E/de):0}),te=e.computedOf(z,ue)((E,q)=>Math.max(1,E-q)),_e=e.computedOf(b,L,te)((E,q,de)=>{const pe=Number(q);return pe>0?Number(E)/pe*de:0});function De(E,q,de,pe){return e.on.pointerdown(Le=>{Le.preventDefault(),Le.stopPropagation();const $e=E==="horizontal"?Le.clientX:Le.clientY,Ue=Number(q.value),M=re=>{const ce=E==="horizontal"?re.clientX-$e:re.clientY-$e,he=e.Value.get(pe),ge=Number(e.Value.get(de));if(he>0&&ge>0){const xe=Ue+ce/he*ge;q.set(Me(BigInt(Math.round(xe)),e.Value.get(de)))}},K=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",K)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",K)})}function Pe(E,q,de,pe,Le){return e.on.pointerdown($e=>{const Ue=$e.target;if(!Ue.classList.contains("bc-nine-slice-scrollbar-track"))return;$e.preventDefault();const M=Ue.getBoundingClientRect(),K=E==="horizontal"?$e.clientX-M.left:$e.clientY-M.top,re=e.Value.get(Le)/2,ce=e.Value.get(pe),he=Number(e.Value.get(de));if(ce>0&&he>0){const ge=Math.max(0,Math.min(1,(K-re)/ce));q.set(Me(BigInt(Math.round(ge*he)),e.Value.get(de)))}})}return e.Fragment(e.OnDispose(()=>{ye&&clearTimeout(ye),me&&me.dispose()}),e.on.wheel(E=>{E.preventDefault(),Q+=E.deltaX,oe+=E.deltaY,ye||(ye=setTimeout(le,16))}),e.on.keydown(E=>{const q=$.value,de=x.value;let pe=!1;switch(E.key){case"ArrowUp":de&&(b.set(Me(b.value-BigInt(Lt),L.value)),pe=!0);break;case"ArrowDown":de&&(b.set(Me(b.value+BigInt(Lt),L.value)),pe=!0);break;case"ArrowLeft":q&&(y.set(Me(y.value-BigInt(Lt),J.value)),pe=!0);break;case"ArrowRight":q&&(y.set(Me(y.value+BigInt(Lt),J.value)),pe=!0);break;case"PageUp":de&&(b.set(Me(b.value-BigInt(Math.round(z.value)),L.value)),pe=!0);break;case"PageDown":de&&(b.set(Me(b.value+BigInt(Math.round(z.value)),L.value)),pe=!0);break;case"Home":de&&(b.set(0n),pe=!0),q&&(y.set(0n),pe=!0);break;case"End":de&&(b.set(L.value),pe=!0),q&&(y.set(J.value),pe=!0);break}pe&&E.preventDefault()}),e.html.div(e.attr.class("bc-nine-slice-pane-container"),e.style.right(F),e.style.bottom(O),s!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-top-start"),e.style.top("0"),e.style.left("0"),e.style.width(v),e.style.height(k),s):null,r!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-header"),e.style.top("0"),e.style.left(v),e.style.width(T),e.style.height(k),e.html.div(e.attr.class("bc-nine-slice-pane-content"),Z,r)):null,c!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-top-end"),e.style.top("0"),N,e.style.width(w),e.style.height(k),c):null,f!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-sidebar-start"),e.style.left("0"),e.style.top(k),e.style.width(v),e.style.height(W),e.html.div(e.attr.class("bc-nine-slice-pane-content"),ie,f)):null,e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-body"),e.style.left(v),e.style.top(k),e.style.width(T),e.style.height(W),e.on.pointerdown(E=>{if(E.button!==0)return;me&&(me.dispose(),me=null),ke.track(E.clientX,E.clientY);const q=$e=>{const Ue=$e.clientX-de,M=$e.clientY-pe;de=$e.clientX,pe=$e.clientY,ke.track($e.clientX,$e.clientY);const K=J.value,re=L.value;$.value&&y.set(Me(y.value-BigInt(Math.round(Ue)),K)),x.value&&b.set(Me(b.value-BigInt(Math.round(M)),re))};let de=E.clientX,pe=E.clientY;const Le=()=>{Ie?.matches||(me=ke.release()),window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",Le)};window.addEventListener("pointermove",q),window.addEventListener("pointerup",Le)}),e.style.cursor(e.computedOf($,x)((E,q)=>E||q?"grab":"default")),e.html.div(e.attr.class("bc-nine-slice-pane-content"),R,t)),d!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-sidebar-end"),N,e.style.top(k),e.style.width(w),e.style.height(W),e.html.div(e.attr.class("bc-nine-slice-pane-content"),ie,d)):null,u!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-bottom-start"),e.style.left("0"),X,e.style.width(v),e.style.height(_),u):null,o!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-footer"),e.style.left(v),X,e.style.width(T),e.style.height(_),e.html.div(e.attr.class("bc-nine-slice-pane-content"),Z,o)):null,m!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-bottom-end"),N,X,e.style.width(w),e.style.height(_),m):null),e.html.div(e.attr.class($.map(E=>`bc-nine-slice-scrollbar bc-nine-slice-scrollbar--horizontal${E?"":" bc-nine-slice-scrollbar--hidden"}`)),e.style.left(_t(h)),e.style.right(F),Pe("horizontal",y,J,B,j),e.WithElement(E=>(e.Value.on(J,q=>{E.setAttribute("aria-valuemax",String(q))}),e.Value.on(y,q=>{E.setAttribute("aria-valuenow",String(q))}),e.Fragment(e.attr.role("scrollbar"),e.aria.orientation("horizontal"),e.aria.valuemin(0),e.html.div(e.attr.class("bc-nine-slice-scrollbar-track"),e.html.div(e.attr.class("bc-nine-slice-scrollbar-thumb"),e.style.width(j.map(q=>`${q}px`)),e.style.transform(ee.map(q=>`translateX(${q}px)`)),De("horizontal",y,J,B))))))),e.html.div(e.attr.class(x.map(E=>`bc-nine-slice-scrollbar bc-nine-slice-scrollbar--vertical${E?"":" bc-nine-slice-scrollbar--hidden"}`)),e.style.top(k),e.style.bottom(O),Pe("vertical",b,L,te,ue),e.WithElement(E=>(e.Value.on(L,q=>{E.setAttribute("aria-valuemax",String(q))}),e.Value.on(b,q=>{E.setAttribute("aria-valuenow",String(q))}),e.Fragment(e.attr.role("scrollbar"),e.aria.orientation("vertical"),e.aria.valuemin(0),e.html.div(e.attr.class("bc-nine-slice-scrollbar-track"),e.html.div(e.attr.class("bc-nine-slice-scrollbar-thumb"),e.style.height(ue.map(q=>`${q}px`)),e.style.transform(_e.map(q=>`translateY(${q}px)`)),De("vertical",b,L,te))))))))})))}function Rl(t){return e.attr.class(`bc-flex--gap-${t}`)}function zl(t){return e.attr.class(`bc-flex--align-${t}`)}function Hl(t){return e.attr.class(`bc-flex--justify-${t}`)}const jl=e.attr.class("bc-flex--wrap"),Gl=e.attr.class("bc-flex--nowrap"),ql=e.attr.class("bc-flex--grow");function ua({header:t,footer:a,body:n,shadowOnScroll:r=!0},...l){const s=e.prop("none");function c(i){const u=i.scrollTop<=1,m=i.scrollTop+i.clientHeight>=i.scrollHeight-2;u&&m?s.set("none"):u?s.set("bottom"):m?s.set("top"):s.set("both")}return e.html.div(e.attr.class(e.computedOf(s,r)((i,u)=>{const m=["bc-scrollable-panel"];return u&&((i==="top"||i==="both")&&m.push("bc-scrollable-panel--scrolled-down"),(i==="bottom"||i==="both")&&m.push("bc-scrollable-panel--scrolled-up")),m.join(" ")})),t&&e.html.div(e.attr.class("bc-scrollable-panel__header"),t),e.html.div(e.attr.class("bc-scrollable-panel--header-shadow"),e.html.div()),e.html.div(e.attr.class("bc-scrollable-panel__body"),e.WithElement(i=>{c(i);const u=new ResizeObserver(()=>c(i));u.observe(i);const m=new MutationObserver(()=>{requestAnimationFrame(()=>c(i))});return m.observe(i,{childList:!0,subtree:!0}),e.OnDispose(()=>{u.disconnect(),m.disconnect()})}),e.on.scroll(i=>{const u=i.target;c(u)}),n),e.html.div(e.attr.class("bc-scrollable-panel--footer-shadow"),e.html.div()),a&&e.html.div(e.attr.class("bc-scrollable-panel__footer"),a),...l)}function Yl(t,a,n){const r=["bc-sink"];return t!=="default"&&r.push(`bc-sink--${t}`),a!=="md"&&r.push(`bc-sink--padding-${a}`),n!=="lg"&&r.push(`bc-sink--rounded-${n}`),r.join(" ")}function Kl({variant:t="default",size:a="md",roundedness:n="lg"}={},...r){return e.html.div(e.attr.class(e.computedOf(t,a,n)((l,s,c)=>Yl(l??"default",s??"md",c??"lg"))),...r)}const Zl=[{value:"contains",labelKey:"filterPanelContains"},{value:"notContains",labelKey:"filterPanelNotContains"},{value:"equals",labelKey:"filterPanelEquals"},{value:"notEquals",labelKey:"filterPanelNotEquals"},{value:"startsWith",labelKey:"filterPanelStartsWith"},{value:"endsWith",labelKey:"filterPanelEndsWith"},{value:"isNull",labelKey:"filterPanelIsNull"},{value:"isNotNull",labelKey:"filterPanelIsNotNull"}],Xl=[{value:"eq",labelKey:"filterPanelEquals"},{value:"neq",labelKey:"filterPanelNotEquals"},{value:"gt",labelKey:"filterPanelGt"},{value:"gte",labelKey:"filterPanelGte"},{value:"lt",labelKey:"filterPanelLt"},{value:"lte",labelKey:"filterPanelLte"},{value:"between",labelKey:"filterPanelBetween"},{value:"isNull",labelKey:"filterPanelIsNull"},{value:"isNotNull",labelKey:"filterPanelIsNotNull"}],Ql=new Set(["isNull","isNotNull"]);function Jl(t,a,n){const r=a.operator;if(r==="isNull")return Oe.isNull(t);if(r==="isNotNull")return Oe.isNotNull(t);if(a.value==="")return null;if(n==="number"){if(r==="between"){const s=a.value.split(",").map(Number);return s.length===2&&!s.some(isNaN)?Oe.between(t,s[0],s[1]):null}const l=Number(a.value);if(Number.isNaN(l))return null;switch(r){case"eq":return Oe.eq(t,l);case"neq":return Oe.neq(t,l);case"gt":return Oe.gt(t,l);case"gte":return Oe.gte(t,l);case"lt":return Oe.lt(t,l);case"lte":return Oe.lte(t,l);default:return null}}return Oe.text(t,r,a.value)}function da(t,a){switch(t.kind){case"text":return[{id:a(),operator:t.operator,value:t.value}];case"compare":return[{id:a(),operator:t.operator,value:String(t.value)}];case"range":return[{id:a(),operator:"between",value:`${t.min},${t.max}`}];case"null":return[{id:a(),operator:t.operator,value:""}];case"composite":return t.filters.flatMap(n=>da(n,a));default:return[]}}function eo(){let t=0;return()=>++t}function to(t,a,n=""){return{opProp:e.prop(t),valProp:e.prop(a),val2Prop:e.prop(n)}}function Ha(t){t.opProp.dispose(),t.valProp.dispose(),t.val2Prop.dispose()}function St(t){const{dataSource:a,column:n,columnType:r="text",size:l="sm",embedded:s=!1}=t,c=eo(),o=a.getColumnFilters(n),i=o.map(S=>S.length>0),u=new Map,m=e.prop([]),f=e.prop("and");function h(){return r==="number"?"eq":"contains"}function d(){return r==="number"?"0":""}function g(S,V,D=""){const $=c();return u.set($,to(S,V,D)),$}function p(){for(const S of u.values())Ha(S);u.clear()}function b(){p();const S=o.value;let V;if(S.length===0)V=[{id:0,operator:h(),value:d()}],f.set("and");else{const $=S.find(x=>x.kind==="composite");$?(f.set($.mode),V=da($,c)):(f.set("and"),V=S.flatMap(x=>x.kind==="text"||x.kind==="compare"||x.kind==="range"||x.kind==="null"||x.kind==="composite"?da(x,c):[])),V.length===0&&(V=[{id:0,operator:h(),value:d()}])}const D=[];for(const $ of V)if($.operator==="between"&&$.value.includes(",")){const[x,U]=$.value.split(",");D.push(g($.operator,x,U))}else D.push(g($.operator,$.value));m.set(D)}function y(){const S=g(h(),d());m.set([...m.value,S])}function k(S){const V=u.get(S);V&&(Ha(V),u.delete(S));const D=m.value.filter($=>$!==S);D.length===0?y():m.set(D)}function _(){const V=m.value.map(D=>{const $=u.get(D);if(!$)return null;const x=$.opProp.value;if(x==="between"){const U=Number($.valProp.value),z=Number($.val2Prop.value);return Number.isNaN(U)||Number.isNaN(z)?null:Oe.between(n,U,z)}return Jl(n,{operator:x,value:$.valProp.value},r)}).filter(D=>D!=null);V.length===0?a.removeFilter(n):V.length===1?a.setFilter(V[0]):a.setFilter(Oe.composite(n,f.value,V))}function v(){a.removeFilter(n),p();const S=g(h(),d());m.set([S]),f.set("and")}const w=r==="number"?Xl:Zl,I=()=>e.Use(C.BeatUII18n,S=>{b();const V=S.$.dataTable,D=w.map($=>We.value($.value,V.value[$.labelKey]));return e.html.div(e.attr.class("bc-column-filter-panel"),e.on.click($=>$.stopPropagation()),e.When(m.map($=>$.length>=2),()=>e.html.div(e.attr.class("bc-column-filter-panel__mode"),ae.SegmentedInput({options:{and:V.map($=>$.filterPanelAnd),or:V.map($=>$.filterPanelOr)},value:f,onChange:$=>f.set($),size:"xs"}))),e.html.div(e.attr.class("bc-column-filter-panel__conditions"),e.ForEach(m,$=>e.MapSignal($,x=>{const U=u.get(x);if(!U)return null;const z=V.map(J=>J.filterPanelValuePlaceholder),T=(J,P)=>ae.NumberInput({value:J.map(N=>N===""?0:Number(N)),size:"xs",class:"bc-column-filter-panel__value",placeholder:z,onChange:N=>J.set(String(N))}),W=J=>Fe.TextInput({value:J,size:"xs",class:"bc-column-filter-panel__value",placeholder:z,onInput:P=>J.set(P)}),L=()=>{if(r==="number"){const J=U.opProp.map(P=>P==="between");return e.Fragment(T(U.valProp),e.When(J,()=>T(U.val2Prop)))}return W(U.valProp)};return e.html.div(e.attr.class("bc-column-filter-panel__row"),e.html.div(e.attr.class("bc-column-filter-panel__row-header"),ae.NativeSelect({value:U.opProp,options:D,size:"xs",class:"bc-column-filter-panel__operator",onChange:J=>U.opProp.set(J)}),se.CloseButton({size:"xs",onClick:()=>k(x)})),e.html.div(e.attr.class(U.opProp.map(J=>Ql.has(J)?"bc-column-filter-panel__value-wrap bc-column-filter-panel__value-wrap--hidden":"bc-column-filter-panel__value-wrap")),L()))}))),e.html.div(e.attr.class("bc-column-filter-panel__add"),e.html.button(e.attr.type("button"),e.attr.class("bc-column-filter-panel__add-btn"),e.on.click(()=>y()),"+ ",V.map($=>$.filterPanelAddCondition))),e.html.div(e.attr.class("bc-column-filter-panel__actions"),ne.Button({size:"xs",variant:"light",color:"danger",onClick:()=>v()},C.Icon({icon:"lucide:trash-2",size:"xs"}),V.map($=>$.filterPanelClear)),ne.Button({size:"xs",variant:"filled",onClick:()=>_()},V.map($=>$.filterPanelApply))))});if(s){const S=o.on(()=>{b()});return e.Fragment(e.OnDispose(()=>{S(),p(),m.dispose(),f.dispose()}),I())}return e.Fragment(e.OnDispose(()=>{p(),m.dispose(),f.dispose()}),e.html.div(e.attr.class("bc-column-filter-panel__trigger-wrap"),e.html.button(e.attr.class(i.map(S=>S?"bc-column-filter-panel__trigger bc-column-filter-panel__trigger--active":"bc-column-filter-panel__trigger")),e.attr.type("button"),C.Icon({icon:"lucide:filter",size:l}),e.When(i,()=>e.html.span(e.attr.class("bc-column-filter-panel__active-dot"))),e.When(i,()=>e.Use(C.BeatUII18n,S=>{const V=S.value.dataTable.describeFilter;return ft({content:o.map(D=>{if(D.length===0)return"";const $=D[0];return V?Ht($,V):ka($)}),showDelay:500})})),Ve.Flyout({content:()=>I(),placement:"bottom-start",showOn:"click",showDelay:0,hideDelay:0}))))}function ao(t){return t===!0?{}:t===!1||t==null?!1:t}function no(t,a,n){if(a<=0)return[t];const r=[];let l=[],s=0;for(const c of t){const o=n.has(c.key)?1:c.rows.length;if(o<=a)s>0&&s+o>a&&(r.push(l),l=[],s=0),l.push(c),s+=o;else{s>0&&(r.push(l),l=[],s=0);let i=0;for(;i<c.rows.length;){const u=c.rows.slice(i,i+a);l.push({key:c.key,rows:u}),s=u.length,i+a<c.rows.length&&(r.push(l),l=[],s=0),i+=a}}}return l.length>0&&r.push(l),r.length>0?r:[[]]}function ro(t){return t===!0?{pageSize:10}:t===!1||t==null?!1:t}function lo(t,a,n,r){if(t==null||t===!1)return null;if(t===!0||t==="text")return e.html.div(e.attr.class("bc-column-filter-panel"),ot({dataSource:a,column:n,size:r}));if(t==="number")return St({dataSource:a,column:n,columnType:"number",size:r,embedded:!0});if(typeof t=="object"&&"render"in t)return t.render({dataSource:a,column:n,size:r});if(typeof t=="object"&&"input"in t)return Cn(t,a,n,r);if(typeof t=="object"&&"type"in t)switch(t.type){case"select":return e.html.div(e.attr.class("bc-column-filter-panel"),ot({dataSource:a,column:n,type:"select",options:t.options,size:r}));case"tags":return e.html.div(e.attr.class("bc-column-filter-panel"),ot({dataSource:a,column:n,type:"tags",options:t.options,size:r}));case"panel":return St({dataSource:a,column:n,columnType:t.valueType,size:r,embedded:!0})}return null}function Cn(t,a,n,r){const l=a.getTextFilterValue(n),s=e.prop(l.value);let c=!1;return l.on(o=>{!c&&s.value!==o&&(c=!0,s.set(o),c=!1)}),s.on(o=>{!c&&l.value!==o&&(c=!0,o===""?a.removeFilter(n):a.setFilter(Oe.text(n,"contains",o)),c=!1)}),t.input(s,r)}function oo(t,a,n,r){if(t==null||t===!1)return e.html.th();if(t===!0||t==="text")return e.html.th(ot({dataSource:a,column:n,size:r}));if(t==="number")return e.html.th(St({dataSource:a,column:n,columnType:"number",size:r}));if(typeof t=="object"&&"render"in t)return e.html.th(t.render({dataSource:a,column:n,size:r}));if(typeof t=="object"&&"input"in t)return e.html.th(Cn(t,a,n,r));if(typeof t=="object"&&"type"in t)switch(t.type){case"select":return e.html.th(ot({dataSource:a,column:n,type:"select",options:t.options,size:r}));case"tags":return e.html.th(ot({dataSource:a,column:n,type:"tags",options:t.options,size:r}));case"panel":return e.html.th(St({dataSource:a,column:n,columnType:t.valueType,size:r}))}return e.html.th()}function Sn(t){if(t.filter!=null)return e.Value.get(t.filter)}function Vn(t){return t.filter!=null}function so(t){const{data:a,columns:n,rowId:r,sortable:l=!1,filterable:s=!1,selectable:c=!1,reorderableColumns:o=!1,onColumnOrderChange:i,pagination:u,toolbar:m,size:f="md",hoverable:h=!1,onSortChange:d,onFilterChange:g,onSelectionChange:p,onGroupByChange:b,onRowClick:y,serverSide:k=!1,loading:_=!1,groupBy:v,groupCollapsible:w=!0,showFooter:I=!1,groupSummary:S,emptyContent:V,hiddenColumns:D=[],onDataSource:$,rowDetails:x}=t,U=e.Value.map(l,Y=>!!Y),z=e.Value.map(l,Y=>Y==="multi"),T=e.Value.map(s,Y=>!!Y),W=e.Value.map(s,Y=>Y==="row"?"row":"header"),L=e.Value.map(c,Y=>!!Y),J=e.Value.map(c,Y=>typeof Y=="object"?Y.position==="after":!1),P=e.Value.map(c,Y=>typeof Y=="object"?Y.selectOnRowClick??!1:!1),N=e.Value.deriveProp(D),H=e.Value.map(u??!1,Y=>ro(Y??!1)),X=e.Value.toSignal(m??!1).map(ao),F=n.filter(Y=>{const ve=Y.hideable;return ve==null?!1:typeof ve=="boolean"?ve:ve.value}),O=e.Value.map(N??[],Y=>Y.length>0),R=e.prop(n.map(Y=>Y.id)),Z=new Map(n.map(Y=>[Y.id,Y])),ie=Y=>Z.get(Y),ye=e.computedOf(o,N,R)((Y,ve,ze)=>Y?ze.filter(et=>!ve.includes(et)&&Z.has(et)):n.filter(et=>!ve.includes(et.id)).map(et=>et.id)),Q=Y=>{const ve=new Set(N.value);ve.has(Y)?ve.delete(Y):ve.add(Y),N.set(Array.from(ve))},oe=()=>{N.set(Array.from(n.map(Y=>Y.id)))},le={},ke={};for(const Y of n)Y.value&&(le[Y.id]=Y.value),Y.comparator&&(ke[Y.id]=Y.comparator);const me=mn({data:a,rowId:r,accessors:le,comparators:ke,...u!=null?{pageSize:e.Value.map(H,Y=>Y===!1?0:Y?.pageSize??10)}:{},multiSort:z,serverSide:k,groupBy:v,onSortChange:d,onFilterChange:g,onSelectionChange:p,onGroupByChange:b});$?.(me);const Ie=e.Value.toSignal(h),j=e.Value.toSignal(P),B=e.Value.toSignal(L),ee=e.computedOf(Ie,j,B)((Y,ve,ze)=>Y||ve&&ze||y!=null),ue=e.computedOf(j,B)((Y,ve)=>Y&&ve||y!=null),_e=n.some(Y=>Y.filter!=null)?e.Value.map(T,Y=>!!Y):!1,De=n.some(Y=>Y.footer!=null),Pe=e.Value.toSignal(e.Value.map(H,Y=>Y!==!1)),E=e.prop(new Set),q=e.Value.toSignal(e.Value.map(H,Y=>Y===!1?0:Y?.pageSize??10)),de=e.Value.toSignal(k),pe=e.prop(1),Le=e.computedOf(me.groups,q,E,de)((Y,ve,ze,et)=>et?[Y]:no(Y,ve,ze)),$e=Le.map(Y=>Y.length),Ue=e.Value.on($e,Y=>{pe.value>Y&&pe.set(Math.max(1,Y))}),M=e.computedOf(Le,pe)((Y,ve)=>{const ze=Math.max(0,Math.min(ve-1,Y.length-1));return Y[ze]??[]}),K=e.computedOf(me.groupBy,me.totalPages,$e)((Y,ve,ze)=>Y!=null?ze:ve),re=e.computedOf(me.groupBy,me.currentPage,pe)((Y,ve,ze)=>Y!=null?ze:ve),ce=Y=>{if(me.groupBy.value!=null){const ve=Math.max(1,Math.min(Y,$e.value));pe.set(ve)}else me.setPage(Y)},he=e.computedOf(Pe,K)((Y,ve)=>Y&&ve>1),ge=x!=null&&(x.defaultState??"collapsed")!=="always-visible",xe=x!=null&&ge?(()=>{const Y=x.defaultState??"collapsed",ve=e.prop(new Set);return{toggledIds:ve,renderedOnce:new Set,isExpanded:kt=>{const at=ve.value.has(kt);return Y==="expanded"?!at:at},toggle:kt=>{const at=new Set(ve.value);at.has(kt)?at.delete(kt):at.add(kt),ve.set(at),x.onExpandedChange?.(at)}}})():void 0,Yt=e.computedOf(ye,B)((Y,ve)=>Y.length+(ve?1:0)+(ge?1:0));return{ds:me,columns:n,columnMap:Z,getCol:ie,rowId:r,visibleColumns:ye,hiddenColumns:N,hideableColumns:F,hasColumnVisibility:O,toggleColumnVisibility:Q,showAllColumns:oe,columnOrder:R,reorderableColumns:o,onColumnOrderChange:i,dragState:{columnId:null},selectable:L,selectableSignal:B,selectOnRowClickSignal:j,selectionAfter:J,sortable:U,multiSort:z,size:f,onRowClick:y,filterLayout:W,hasFilters:_e,loading:_,showFooter:I,emptyContent:V,groupCollapsible:w,groupSummary:S,hasFooter:De,rowClickable:ue,effectiveHoverable:ee,totalColSpan:Yt,collapsedGroups:E,currentGroupPageGroups:M,toolbarConfig:X,paginationConfig:H,paginationEnabledSignal:Pe,pageSizeSignal:q,effectiveTotalPages:K,effectiveCurrentPage:re,setEffectivePage:ce,showPagination:he,rowDetails:x,hasToggleColumn:ge,expandedRows:xe,dispose:()=>{me.dispose(),N.dispose(),ye.dispose(),Yt.dispose(),R.dispose(),E.dispose(),Ie.dispose(),j.dispose(),B.dispose(),ee.dispose(),ue.dispose(),Pe.dispose(),q.dispose(),de.dispose(),pe.dispose(),Ue(),Le.dispose(),$e.dispose(),M.dispose(),K.dispose(),re.dispose(),he.dispose(),X.dispose(),xe?.toggledIds.dispose()}}}function In({dataSource:t,column:a,size:n,actions:r,menu:l,hideInactiveIcon:s=!1,multiSort:c=!0,draggable:o,onDragStart:i,onDragOver:u,onDrop:m,onDragEnd:f},...h){const d=t.getSortDirection(a),g=d.map(b=>{switch(b){case"asc":return"line-md:arrow-small-up";case"desc":return"line-md:arrow-small-down";default:return"line-md:arrows-vertical"}}),p=d.map(b=>{const y="bc-sortable-header";return b==="asc"?`${y} ${y}--asc`:b==="desc"?`${y} ${y}--desc`:y});return e.html.th(e.attr.class(p),e.attr.role("columnheader"),o!=null?e.attr.draggable(e.Value.map(o,b=>b?"true":void 0)):null,i!=null?e.on.dragstart(i):null,u!=null?e.on.dragover(u):null,m!=null?e.on.drop(m):null,f!=null?e.on.dragend(f):null,e.aria.sort(d.map(b=>b==="asc"?"ascending":b==="desc"?"descending":"none")),e.on.click(b=>t.toggleSort(a,{multi:b.shiftKey})),e.html.div(e.attr.class("bc-sortable-header__content"),e.html.span(e.attr.class("bc-sortable-header__label"),...h),e.html.span(e.attr.class("bc-sortable-header__icons"),s?e.When(d.map(b=>b!=null),()=>e.html.span(e.attr.class("bc-sortable-header__icon bc-sortable-header__icon--active"),C.Icon({icon:g,size:n??"md"}),e.When(c,()=>e.Use(C.BeatUII18n,b=>ft({content:b.$.dataTable.map(y=>y.sortMultiHint),showDelay:800}))))):e.html.span(e.attr.class(d.map(b=>b!=null?"bc-sortable-header__icon bc-sortable-header__icon--active":"bc-sortable-header__icon")),C.Icon({icon:g,size:n??"md"}),e.When(c,()=>e.Use(C.BeatUII18n,b=>ft({content:b.$.dataTable.map(y=>y.sortMultiHint),showDelay:800})))),r??null,l!=null?e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(b=>b.stopPropagation()),l):null)))}function $n(t){return t.hasToggleColumn?e.html.th(e.attr.class("bc-data-table__toggle-header")):null}function xn(t){return t.hasToggleColumn?e.html.th(e.attr.class("bc-data-table__toggle-header")):null}function Ia(t,a,n){if(!n.hasToggleColumn||!n.expandedRows||!n.rowDetails)return null;if(!(n.rowDetails.hasDetails?n.rowDetails.hasDetails(t):!0))return e.html.td(e.attr.class("bc-data-table__toggle-cell"));const l=n.expandedRows.toggledIds.map(()=>n.expandedRows.isExpanded(a));return e.html.td(e.attr.class("bc-data-table__toggle-cell"),e.html.button(e.attr.class(l.map(s=>s?"bc-data-table__group-toggle":"bc-data-table__group-toggle bc-data-table__group-toggle--collapsed")),e.attr.type("button"),e.on.click(s=>{s.stopPropagation(),n.expandedRows.toggle(a)}),C.Icon({icon:"lucide:chevron-down",size:"sm"})))}function $a(t,a,n){if(!n.rowDetails||!(n.rowDetails.hasDetails?n.rowDetails.hasDetails(t):!0))return null;const l=n.rowDetails.defaultState??"collapsed";if(l==="always-visible")return e.html.tr(e.attr.class("bc-data-table__detail-row"),e.html.td(e.attr.class("bc-data-table__detail-cell"),e.attr.colspan(n.totalColSpan),e.html.div(n.rowDetails.render(t))));if(!n.expandedRows)return null;const s=n.expandedRows,c=s.toggledIds.map(()=>s.isExpanded(a)),o=e.prop(l==="expanded"||s.renderedOnce.has(a));if(l==="expanded"&&s.renderedOnce.add(a),!o.value){const i=e.Value.on(c,u=>{u&&!o.value&&(s.renderedOnce.add(a),o.set(!0),i())})}return e.html.tr(e.attr.class("bc-data-table__detail-row"),e.style.display(c.map(i=>i?"":"none")),e.html.td(e.attr.class("bc-data-table__detail-cell"),e.attr.colspan(n.totalColSpan),e.When(o,()=>e.html.div(n.rowDetails.render(t)))))}function Dn(t){const{dataSource:a,column:n,sortable:r=!1,hideable:l=!1,size:s="md",onHideColumn:c,hideableColumns:o,hiddenColumns:i,onToggleColumn:u,onResetColumns:m,filterContent:f,hasActiveFilter:h,onClearFilter:d}=t,g=r?a.getSortDirection(n):void 0;return e.Use(C.BeatUII18n,p=>{const b=p.$.dataTable;return Ve.Menu({items:()=>{const y=[],k=g?.value;if(r){const v=[Ve.MenuItem({key:"sort-asc",content:b.map(w=>w.menuSortAsc),before:C.Icon({icon:"line-md:arrow-small-up",size:s}),disabled:g?.map(w=>w==="asc"),onClick:()=>a.setSort([{column:n,direction:"asc"}])}),Ve.MenuItem({key:"sort-desc",content:b.map(w=>w.menuSortDesc),before:C.Icon({icon:"line-md:arrow-small-down",size:s}),disabled:g?.map(w=>w==="desc"),onClick:()=>a.setSort([{column:n,direction:"desc"}])})];k!=null&&v.push(Ve.MenuItem({key:"clear-sort",content:b.map(w=>w.menuClearSort),before:C.Icon({icon:"line-md:arrows-vertical",size:s}),onClick:()=>{const w=a.sort.value.filter(I=>I.column!==n);a.setSort(w)}})),y.push(v)}if(f!=null){const v=[Ve.MenuItem({key:"filter",content:b.map(w=>w.menuFilter??"Filter"),before:C.Icon({icon:"lucide:filter",size:s}),submenu:()=>[e.html.div(e.on.click(w=>w.stopPropagation()),f)]})];d&&h&&v.push(e.When(h,()=>Ve.MenuItem({key:"clear-filter",content:b.map(w=>w.clearFilter),before:C.Icon({icon:"lucide:filter-x",size:s}),onClick:d}))),y.push(v)}if(l&&c&&y.push([Ve.MenuItem({key:"hide-column",content:b.map(v=>v.menuHideColumn),before:C.Icon({icon:"lucide:eye-off",size:s}),onClick:c})]),o&&o.length>0&&i&&u){const v=[Ve.MenuItem({key:"choose-columns",content:b.map(w=>w.menuChooseColumns),before:C.Icon({icon:"lucide:columns-3",size:s}),submenu:()=>[e.html.div(e.attr.class("bc-data-table__column-toggle-panel"),e.on.click(w=>w.stopPropagation()),...o.map(w=>se.CheckboxInput({value:i.map(I=>!I.has(w.id)),onChange:()=>u(w.id),placeholder:w.label})),e.When(i.map(w=>w.size>0),()=>m?ne.Button({size:"xs",variant:"outline",onClick:()=>m()},b.$.showAllColumns):null))]})];m&&v.push(e.When(i.map(w=>w.size>0),()=>Ve.MenuItem({key:"reset-columns",content:b.map(w=>w.menuResetColumns),before:C.Icon({icon:"lucide:rotate-ccw",size:s}),onClick:m}))),y.push(v)}const _=[];for(let v=0;v<y.length;v++)v>0&&_.push(Ve.MenuSeparator()),_.push(...y[v]);return _},placement:"bottom-end",showOn:"click"})})}function io(t){return t==="checked"?!0:t==="indeterminate"?"mixed":!1}function co(t){return t==="unchecked"?"checked":t==="checked"?"indeterminate":"unchecked"}const On=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,placeholder:s,disabled:c,id:o,activeIcon:i,inactiveIcon:u,indeterminateIcon:m,size:f="md"}=t,h=o??Te.sessionId("tri-state-checkbox"),d=`${h}-label`,g=()=>{if(e.Value.get(c??!1))return;const _=e.Value.get(a),v=co(_);r?.(v),l?.(v)},p=_=>{e.Value.get(c??!1)||(_.key===" "||_.key==="Enter")&&(_.preventDefault(),g())},b=e.Value.map(a,_=>_==="checked"?"bc-checkbox-input__checkbox--checked":_==="indeterminate"?"bc-checkbox-input__checkbox--indeterminate":"bc-checkbox-input__checkbox--unchecked"),y=e.Value.map(a,_=>io(_)),k=e.computedOf(a,i,u,m)((_,v,w,I)=>_==="checked"?v??"ri:checkbox-fill":_==="indeterminate"?I??"mdi:checkbox-indeterminate-outline":w??"mdi:checkbox-blank-outline");return ne.InputContainer({baseContainer:!0,growInput:!1,...t,input:e.html.span(e.attr.class("bc-checkbox-input"),e.html.span(e.attr.class("bc-checkbox-input__checkbox"),e.attr.class(b),e.attr.class(e.Value.map(c??!1,_=>_?"bc-checkbox-input__checkbox--disabled":"")),e.attr.id(h),e.attr.role("checkbox"),e.attr.tabindex(e.Value.map(c??!1,_=>_?-1:0)),e.aria.checked(y),e.aria.disabled(c),s!=null?e.aria.labelledby(d):e.Empty,e.on.keydown(p),n!=null?e.on.blur(n):e.Empty,C.Icon({icon:k,accessibility:"decorative",size:f})),s!=null?e.html.label(e.attr.class("bc-checkbox-input__label"),e.attr.id(d),e.attr.for(h),Je.MutedLabel(s)):e.Empty)},e.on.click(g))};function xa({dataSource:t,rowId:a,isSelected:n,size:r="md"}){return se.CheckboxInput({size:r,value:n,onChange:()=>t.toggleSelect(e.Value.get(a))})}function Tn({dataSource:t,size:a="md"}){const n=e.computedOf(t.isAllSelected,t.isSomeSelected)((r,l)=>r?"checked":l?"indeterminate":"unchecked");return On({size:a,value:n,onChange:()=>{t.isAllSelected.value?t.deselectAll():t.selectAll()}})}function uo(t,a){if(!Vn(t))return;const n=Sn(t);return lo(n,a.ds,t.id,a.size)??void 0}function po(t,a,n){const r=n.ds.getColumnFilters(t.id),l=r.map(d=>d.length>0),s=t.sortable!=null?t.sortable:!1,c=t.hideable!=null?typeof t.hideable=="boolean"?t.hideable:t.hideable.value:!1,o=Vn(t),i=e.computedOf(n.sortable,s)((d,g)=>!!d&&!!g),u=o?e.computedOf(a,l)((d,g)=>d&&g):!1,m=o?uo(t,n):void 0,f=o?a:!1,h=e.computedOf(i,f)((d,g)=>d||g||c);return e.html.span(e.attr.class("bc-column-header-menu"),e.When(u,()=>e.html.span(e.attr.class("bc-sortable-header__icon bc-sortable-header__icon--active"),e.on.click(d=>d.stopPropagation()),C.Icon({icon:"lucide:filter",size:n.size}),Ve.Flyout({content:()=>e.html.div(e.attr.class("bc-column-filter-panel"),e.on.click(d=>d.stopPropagation()),m??null),placement:"bottom-end",showOn:"click",showDelay:0,hideDelay:0}),e.Use(C.BeatUII18n,d=>{const g=e.computedOf(d.$.dataTable.$.describeFilter,r)((p,b)=>b.map(y=>Ht(y,p)).join(", "));return ft({content:g,showDelay:300})}))),e.When(h,()=>e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(d=>d.stopPropagation()),C.Icon({icon:"lucide:ellipsis-vertical",size:n.size}),e.MapSignal(e.computedOf(i,f)((d,g)=>({s:d,f:g})),({s:d,f:g})=>Dn({dataSource:n.ds,column:t.id,sortable:d,hideable:c,size:n.size,onHideColumn:c?()=>n.toggleColumnVisibility(t.id):void 0,filterContent:g?m:void 0,hasActiveFilter:g?l:void 0,onClearFilter:g&&o?()=>n.ds.removeFilter(t.id):void 0})))))}function mo(t,a){return{reorderable:a.reorderableColumns,onDragStart:n=>{if(!e.Value.get(a.reorderableColumns))return;a.dragState.columnId=t,n.dataTransfer&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",t)),n.currentTarget.classList.add("bc-data-table__header--dragging")},onDragOver:n=>{if(!e.Value.get(a.reorderableColumns)||a.dragState.columnId==null||a.dragState.columnId===t)return;n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.currentTarget.classList.add("bc-data-table__header--drag-over")},onDrop:n=>{if(!e.Value.get(a.reorderableColumns)||(n.preventDefault(),n.currentTarget.classList.remove("bc-data-table__header--drag-over"),a.dragState.columnId==null||a.dragState.columnId===t))return;const l=[...a.columnOrder.value],s=l.indexOf(a.dragState.columnId),c=l.indexOf(t);s<0||c<0||(l.splice(s,1),l.splice(c,0,a.dragState.columnId),a.columnOrder.set(l),a.onColumnOrderChange?.(l),a.dragState.columnId=null)},onDragEnd:n=>{if(!e.Value.get(a.reorderableColumns))return;a.dragState.columnId=null;const r=n.currentTarget;r.classList.remove("bc-data-table__header--dragging"),r.closest("tr")?.querySelectorAll(".bc-data-table__header--drag-over").forEach(l=>l.classList.remove("bc-data-table__header--drag-over"))}}}function ho(t,a){return e.MapSignal(t,n=>{const r=a.getCol(n),l=typeof r.header=="string"?r.header:r.header(),s=e.computedOf(a.hasFilters,a.filterLayout)((m,f)=>m&&f==="header"),c=po(r,s,a),o=mo(r.id,a),i=r.sortable!=null?r.sortable:!1,u=e.computedOf(a.sortable,i)((m,f)=>!!m&&!!f);return e.When(u,()=>In({dataSource:a.ds,column:r.id,size:a.size,menu:c,multiSort:a.multiSort,draggable:o.reorderable,onDragStart:o.onDragStart,onDragOver:o.onDragOver,onDrop:o.onDrop,onDragEnd:o.onDragEnd},l),()=>e.html.th(e.attr.draggable(e.Value.map(o.reorderable,m=>m?"true":void 0)),e.on.dragstart(o.onDragStart),e.on.dragover(o.onDragOver),e.on.drop(o.onDrop),e.on.dragend(o.onDragEnd),r.width!=null?e.style.width(r.width):null,r.minWidth!=null?e.style.minWidth(r.minWidth):null,r.maxWidth!=null?e.style.maxWidth(r.maxWidth):null,r.align!=null?e.style.textAlign(e.Value.map(r.align,m=>m)):null,e.html.div(e.attr.class("bc-sortable-header__content"),e.html.span(e.attr.class("bc-sortable-header__label"),l),c!=null?e.html.span(e.attr.class("bc-sortable-header__icons"),e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(m=>m.stopPropagation()),c)):null)))})}function fo(t,a){return e.MapSignal(t,n=>{const r=a.getCol(n),l=Sn(r);return oo(l,a.ds,n,a.size)})}function ja(t){return e.When(t.selectable,()=>e.html.th(e.attr.class("bc-data-table__selection-header"),e.html.div(e.attr.class("bc-data-table__selection-cell"),Tn({dataSource:t.ds,size:t.size}))))}function Ga(t){return e.When(t.selectable,()=>e.html.th())}function go(t){return e.html.tr($n(t),e.When(e.Value.map(t.selectionAfter,a=>!a),()=>ja(t)),e.ForEach(t.visibleColumns,a=>ho(a,t)),e.When(t.selectionAfter,()=>ja(t)))}function bo(t){const a=e.computedOf(t.hasFilters,t.filterLayout)((n,r)=>n&&r==="row");return e.When(a,()=>e.html.tr(e.attr.class("bc-data-table__filter-row"),xn(t),e.When(e.Value.map(t.selectionAfter,n=>!n),()=>Ga(t)),e.ForEach(t.visibleColumns,n=>fo(n,t)),e.When(t.selectionAfter,()=>Ga(t))))}function Pn(t){const{visible:a,message:n,size:r="lg"}=t;return e.When(a,()=>e.html.div(e.attr.class("bc-loading-overlay"),e.html.div(e.attr.class("bc-loading-overlay__content"),C.Icon({icon:"line-md:loading-twotone-loop",size:r}),n!=null?e.html.span(e.attr.class("bc-loading-overlay__message"),n):e.Empty)))}function En(t,a,n,r){return e.MapSignal(t,l=>{const s=r.getCol(l);return e.html.td(s.align!=null?e.style.textAlign(e.Value.map(s.align,c=>c)):null,s.width!=null?e.style.width(s.width):null,s.maxWidth!=null?e.style.maxWidth(s.maxWidth):null,s.cell(n,a))})}function vo(t){return e.ForEach(t.ds.rows,a=>{const n=a.map(t.rowId),r=e.computedOf(n,t.ds.selected)((o,i)=>i.has(o)),l=()=>e.When(t.selectable,()=>e.html.td(e.on.click(o=>o.stopPropagation()),e.html.div(e.attr.class("bc-data-table__selection-cell"),xa({dataSource:t.ds,rowId:n,isSelected:r,size:t.size})))),s=e.computedOf(r,t.rowClickable)((o,i)=>{let u="bc-data-table__row";return o&&(u+=" bc-data-table__row--selected"),i&&(u+=" bc-data-table__row--clickable"),u}),c=t.rowId(a.value);return e.Fragment(e.html.tr(e.attr.class(s),e.on.click(()=>{t.selectOnRowClickSignal.value&&t.selectableSignal.value&&t.ds.toggleSelect(n.value),t.onRowClick?.(a.value)}),Ia(a,c,t),e.When(e.Value.map(t.selectionAfter,o=>!o),()=>l()),e.ForEach(t.visibleColumns,(o,i)=>En(o,i.index,a,t)),e.When(t.selectionAfter,()=>l())),$a(a,c,t))})}function yo(t,a){const n=a.rowId(t),r=e.computedOf(n,a.ds.selected)((o,i)=>i.has(o)),l=e.Value.toSignal(t),s=()=>e.When(a.selectable,()=>e.html.td(e.on.click(o=>o.stopPropagation()),e.html.div(e.attr.class("bc-data-table__selection-cell"),xa({dataSource:a.ds,rowId:n,isSelected:r,size:a.size})))),c=e.computedOf(r,a.rowClickable)((o,i)=>{let u="bc-data-table__row";return o&&(u+=" bc-data-table__row--selected"),i&&(u+=" bc-data-table__row--clickable"),u});return e.Fragment(e.html.tr(e.attr.class(c),e.on.click(()=>{a.selectOnRowClickSignal.value&&a.selectableSignal.value&&a.ds.toggleSelect(n),a.onRowClick?.(t)}),Ia(l,n,a),e.When(e.Value.map(a.selectionAfter,o=>!o),()=>s()),e.ForEach(a.visibleColumns,(o,i)=>En(o,i.index,l,a)),e.When(a.selectionAfter,()=>s())),$a(l,n,a))}function ko(t){const a=e.computedOf(t.visibleColumns,t.selectableSignal)((l,s)=>l.length+(s?1:0)+(t.hasToggleColumn?1:0)),n=e.computedOf(t.visibleColumns,t.selectableSignal)((l,s)=>{const c=l.findIndex(o=>t.getCol(o).footer!=null);return c<0?l.length+(s?1:0)+(t.hasToggleColumn?1:0):c+(s?1:0)+(t.hasToggleColumn?1:0)}),r=t.hasFooter;return e.MapSignal(t.currentGroupPageGroups,l=>e.Fragment(...l.map(s=>{const c=t.collapsedGroups.map(i=>i.has(s.key)),o=()=>{const i=new Set(t.collapsedGroups.value);i.has(s.key)?i.delete(s.key):i.add(s.key),t.collapsedGroups.set(i)};return e.Fragment(e.Use(C.BeatUII18n,i=>e.html.tr(e.attr.class("bc-data-table__group-header"),e.on.click(()=>{t.groupCollapsible&&o()}),e.html.td(e.When(c,()=>e.attr.colspan(n),()=>e.attr.colspan(a)),e.html.div(e.attr.class("bc-data-table__group-header-content"),t.groupCollapsible?e.html.span(e.attr.class(c.map(u=>u?"bc-data-table__group-toggle bc-data-table__group-toggle--collapsed":"bc-data-table__group-toggle")),e.aria.label(e.computedOf(c,i.$.dataTable)((u,m)=>u?m.expandGroup:m.collapseGroup)),C.Icon({icon:"lucide:chevron-down",size:"sm"})):null,e.html.span(e.attr.class("bc-data-table__group-label"),s.key),e.html.span(e.attr.class("bc-data-table__group-count"),(()=>{const u=i.value.dataTable.groupCount;return u?u(s.rows.length):`(${s.rows.length})`})()),t.groupSummary!=null?e.When(c,()=>e.html.span(e.attr.class("bc-data-table__group-footer-summary"),t.groupSummary(s.key,s.rows))):null)),e.When(c,()=>r?e.When(t.showFooter,()=>e.ForEach(t.visibleColumns,(u,m)=>e.MapSignal(u,f=>{const h=t.getCol(f);return h.footer?e.html.td(e.attr.class("bc-data-table__footer-row bc-data-table__group-footer-row"),h.align!=null?e.style.textAlign(e.Value.map(h.align,d=>d)):null,h.footer(e.Value.toSignal(s.rows))):e.When(n.map(d=>d<m.index),()=>e.html.td())}))):null))),e.When(c.map(i=>!i),()=>e.Fragment(...s.rows.map(i=>yo(i,t)),r?e.When(t.showFooter,()=>e.html.tr(e.attr.class("bc-data-table__footer-row bc-data-table__group-footer-row"),t.hasToggleColumn?e.html.td():null,e.When(t.selectable,()=>e.html.td()),e.ForEach(t.visibleColumns,i=>e.MapSignal(i,u=>{const m=t.getCol(u);return m.footer?e.html.td(m.align!=null?e.style.textAlign(e.Value.map(m.align,f=>f)):null,m.footer(e.Value.toSignal(s.rows))):e.html.td()})))):null)))})))}function qa(t){return e.When(t.ds.rows.map(a=>a.length===0),()=>e.Use(C.BeatUII18n,a=>e.html.tr(e.html.td(e.attr.colspan(t.totalColSpan),e.attr.class("bc-data-table__empty"),t.emptyContent??a.$.dataTable.map(n=>n.noResults)))))}function _o(t){return e.Use(C.BeatUII18n,a=>Pn({visible:t.loading,message:a.$.dataTable.map(n=>n.loading),size:"lg"}))}function wo(t){return t.hasFooter?e.When(t.showFooter,()=>e.html.tr(e.attr.class("bc-data-table__footer-row"),t.hasToggleColumn?e.html.td():null,e.When(t.selectable,()=>e.html.td()),e.ForEach(t.visibleColumns,a=>e.MapSignal(a,n=>{const r=t.getCol(n);return r.footer?e.html.td(r.align!=null?e.style.textAlign(e.Value.map(r.align,l=>l)):null,r.footer(t.ds.allFilteredRows)):e.html.td()})))):null}function Co(t){if(t.hideableColumns.length===0)return null;const a=t.hiddenColumns.map(n=>n.length>0);return e.Use(C.BeatUII18n,n=>e.html.div(e.attr.class("bc-data-table__column-toggle"),e.html.button(e.attr.type("button"),e.attr.class(a.map(r=>r?"bc-data-table__column-toggle-btn bc-data-table__column-toggle-btn--active":"bc-data-table__column-toggle-btn")),C.Icon({icon:"lucide:columns-3",size:t.size}),e.html.span(e.attr.class("bc-data-table__column-toggle-label"),n.$.dataTable.map(r=>r.columnVisibility)),Ve.Flyout({content:()=>e.html.div(e.attr.class("bc-data-table__column-toggle-panel"),e.on.click(r=>r.stopPropagation()),...t.hideableColumns.map(r=>se.CheckboxInput({value:t.hiddenColumns.map(l=>!l.includes(r.id)),onChange:()=>t.toggleColumnVisibility(r.id),placeholder:typeof r.header=="string"?r.header:r.id,size:"sm"})),e.When(a,()=>ne.Button({size:"xs",variant:"outline",onClick:()=>t.showAllColumns()},n.$.dataTable.map(r=>r.showAllColumns)))),placement:"bottom-end",showOn:"click",showDelay:0,hideDelay:0}))))}function So(t){const{size:a="md",stickyHeader:n=!1,fullWidth:r=!1,withStripedRows:l=!1,withTableBorder:s=!0,withColumnBorders:c=!1,withRowBorders:o=!0}=t,i=so(t),u=e.computedOf(i.ds.totalFilteredRows,i.ds.totalRows)((b,y)=>({filtered:b,total:y})),m=Co(i),f=e.MapSignal(i.toolbarConfig,b=>b===!1?null:bn({dataSource:i.ds,showSort:b.showSort??!0,showFilters:b.showFilters??!0,showSelection:b.showSelection??!0,bulkActions:b.bulkActions??[]})),h=e.html.div(e.attr.class("bc-data-table__wrapper"),_o(i),pn({size:a,hoverable:i.effectiveHoverable,stickyHeader:n,fullWidth:r,withStripedRows:l,withTableBorder:s,withColumnBorders:c,withRowBorders:o},e.html.thead(go(i),bo(i)),e.html.tbody(e.When(i.ds.groupBy.map(b=>b!=null),()=>e.Fragment(ko(i),qa(i)),()=>e.Fragment(vo(i),qa(i)))),e.html.tfoot(wo(i)))),d=e.When(i.showPagination,()=>e.html.div(e.attr.class("bc-data-table__pagination"),e.Use(C.BeatUII18n,b=>e.html.div(e.attr.class("bc-data-table__row-count"),e.computedOf(i.pageSizeSignal,i.effectiveCurrentPage,u.$.filtered,u.$.total)((y,k,_,v)=>{const w=(k-1)*y+1,I=Math.min(k*y,_);return b.value.paginationRange(w,I,_,v)}))),gn({currentPage:i.effectiveCurrentPage,totalPages:i.effectiveTotalPages,onChange:b=>i.setEffectivePage(b),siblings:e.Value.map(i.paginationConfig,b=>b===!1?1:b.siblings??1),showFirstLast:e.Value.map(i.paginationConfig,b=>b===!1?!1:b.showFirstLast??!1),showPrevNext:!0,size:a,responsive:e.Value.map(i.paginationConfig,b=>b===!1?!1:b.responsive??!1)}))),g=e.Fragment(m,f,h,d);return e.Value.get(n)?e.html.div(e.attr.class("bc-data-table"),e.OnDispose(()=>{i.dispose(),u.dispose()}),g):e.Fragment(e.OnDispose(()=>{i.dispose(),u.dispose()}),g)}function Fn(t){const a=t.hour%12||12,n=String(t.minute).padStart(2,"0"),r=t.hour>=12?"PM":"AM";return`${a}:${n} ${r}`}function Ln(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`}function An(t){const a=t.hour%12||12,n=String(t.minute).padStart(2,"0"),r=String(t.second).padStart(2,"0"),l=t.hour>=12?"PM":"AM";return`${a}:${n}:${r} ${l}`}function Bn(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`}function Tt(t,a,n){return a?n?An(t):Fn(t):n?Bn(t):Ln(t)}function bt(t){try{const a=new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions();return a.hourCycle?a.hourCycle==="h11"||a.hourCycle==="h12":a.hour12===!0}catch{return!1}}function ta(t){return String(t).padStart(2,"0")}function Vo(t,a){const n=["bc-time-picker",`bc-time-picker--size-${t}`];return a&&n.push("bc-time-picker--disabled"),n.join(" ")}function Io(t,{value:a=null,onSelect:n,showSeconds:r=!1,use12Hour:l,color:s="primary",size:c="md",disabled:o=!1,minuteStep:i=1,secondStep:u=1,showNow:m=!1}){return e.Use(C.Locale,({locale:f})=>e.Use(C.BeatUII18n,h=>{const d=l??f.map(bt),g=e.Value.map(s,P=>`--color-${P}-500`),p=(P,N,H)=>{if(e.Value.get(o))return;const X=t.PlainTime.from({hour:P,minute:N,second:H});n?.(X)},b=e.Value.map(a,P=>P?.hour??null),y=e.Value.map(a,P=>P?.minute??null),k=e.Value.map(a,P=>P?.second??null),_=e.Value.map(a,P=>P?.hour??0),v=e.Value.map(a,P=>P?.minute??0),w=e.Value.map(a,P=>P?.second??0),I=e.Value.toSignal(r),S=e.Value.toSignal(d),V=e.Value.toSignal(m),D=e.computedOf(S)(P=>P?Array.from({length:12},(N,H)=>({value:H+1,label:String(H+1)})):Array.from({length:24},(N,H)=>({value:H,label:ta(H)}))),$=aa({items:D,selected:e.computedOf(b,S)((P,N)=>{if(P==null)return null;if(N){const H=P%12;return H===0?12:H}return P}),disabled:o,colorVar:g,onItemClick:P=>{const N=e.Value.get(d);let H=P;if(N){const X=e.Value.get(a),F=X!=null&&X.hour>=12;P===12?H=F?12:0:H=F?P+12:P}p(H,e.Value.get(v),e.Value.get(w))},ariaLabel:h.$.timePicker.$.selectHours}),U=e.Value.toSignal(i).map(P=>{const N=[];for(let H=0;H<60;H+=P)N.push({value:H,label:ta(H)});return N}),z=aa({items:U,selected:y,disabled:o,colorVar:g,onItemClick:P=>{p(e.Value.get(_),P,e.Value.get(w))},ariaLabel:h.$.timePicker.$.selectMinutes}),W=e.Value.toSignal(u).map(P=>{const N=[];for(let H=0;H<60;H+=P)N.push({value:H,label:ta(H)});return N}),L=aa({items:W,selected:k,disabled:o,colorVar:g,onItemClick:P=>{p(e.Value.get(_),e.Value.get(v),P)},ariaLabel:h.$.timePicker.$.selectSeconds}),J=e.html.div(e.attr.class("bc-time-picker__column"),e.aria.label(h.$.timePicker.$.selectPeriod),e.attr.role("listbox"),...[{label:"AM",isAm:!0},{label:"PM",isAm:!1}].map(({label:P,isAm:N})=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(b,g)((H,X)=>{const F=H!=null&&(N?H<12:H>=12),O=["bc-time-picker__item"];return F&&O.push("bc-time-picker__item--selected"),O.join(" ")})),e.attr.style(e.computedOf(b,g)((H,X)=>H!=null&&(N?H<12:H>=12)?`--tp-selected-bg: var(${X})`:"")),e.attr.disabled(o),e.attr.role("option"),e.aria.selected(e.Value.map(b,H=>H!=null?N?H<12:H>=12:!1)),e.on.click(()=>{if(e.Value.get(o))return;const H=e.Value.get(_);let X;N?X=H>=12?H-12:H:X=H<12?H+12:H,p(X,e.Value.get(v),e.Value.get(w))}),P)));return e.html.div(e.attr.class(e.computedOf(c,o)(Vo)),e.aria.label(h.$.timePicker.$.label),e.attr.role("group"),e.html.div(e.attr.class("bc-time-picker__columns"),e.html.div(e.attr.class("bc-time-picker__header"),e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.hoursLabel),e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.minutesLabel),e.When(I,()=>e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.secondsLabel),()=>e.Empty),e.When(S,()=>e.html.span(e.attr.class("bc-time-picker__header-label"),""),()=>e.Empty)),e.html.div(e.attr.class("bc-time-picker__body"),$,e.html.span(e.attr.class("bc-time-picker__separator"),":"),z,e.When(I,()=>e.Fragment(e.html.span(e.attr.class("bc-time-picker__separator"),":"),L),()=>e.Empty),e.When(S,()=>J,()=>e.Empty)),e.When(V,()=>e.html.div(e.attr.class("bc-time-picker__footer"),e.html.button(e.attr.type("button"),e.attr.class("bc-time-picker__now-btn"),e.attr.disabled(o),e.on.click(()=>{if(e.Value.get(o))return;const P=t.Now.plainTimeISO();n?.(P)}),h.$.timePicker.$.nowLabel)),()=>e.Empty)))}))}function aa(t){const{items:a,selected:n,disabled:r,colorVar:l,onItemClick:s,ariaLabel:c}=t;return e.html.div(e.attr.class("bc-time-picker__column"),e.aria.label(c),e.attr.role("listbox"),e.MapSignal(e.Value.toSignal(a),o=>e.Fragment(...o.map(i=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(n,l)((u,m)=>{const f=["bc-time-picker__item"];return u===i.value&&f.push("bc-time-picker__item--selected"),f.join(" ")})),e.attr.style(e.computedOf(n,l)((u,m)=>u===i.value?`--tp-selected-bg: var(${m})`:"")),e.attr.disabled(r),e.attr.role("option"),e.aria.selected(e.Value.map(n,u=>u===i.value)),e.on.click(()=>s(i.value)),i.label)))))}function gt(t){return ae.WithTemporal(a=>Io(a,t??{}))}function $o(t,a){const n=["bc-stat-card"];return t!=="default"&&n.push(`bc-stat-card--${t}`),a!=="md"&&n.push(`bc-stat-card--padding-${a}`),n.join(" ")}function xo({variant:t="default",size:a="md",color:n="primary"}={},...r){return e.html.div(e.attr.role("group"),e.attr.class(e.computedOf(t,a)($o)),e.attr.style(e.Value.map(n,l=>`--stat-card-accent: var(--color-${l}-500)`)),...r)}function Do({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__value"),e.attr.class(t),...a)}function Oo({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__label"),e.attr.class(t),...a)}function To(t){const{value:a,direction:n,color:r}=t;return e.Use(C.BeatUII18n,l=>{const s=r??e.Value.map(n,i=>i==="up"?"success":i==="down"?"danger":"neutral"),c=e.Value.map(n,i=>i==="up"?"lucide:trending-up":i==="down"?"lucide:trending-down":"lucide:minus"),o=e.computedOf(n,a,l.$.statCard.$.trendUp,l.$.statCard.$.trendDown,l.$.statCard.$.trendFlat)((i,u,m,f,h)=>`${i==="up"?m:i==="down"?f:h}: ${u}`);return e.html.span(e.attr.role("status"),e.attr.class(e.Value.map(n,i=>`bc-stat-card__trend bc-stat-card__trend--${i}`)),e.attr.style(e.Value.map(s,i=>`--stat-card-trend-color: var(--color-${i}-600); --stat-card-trend-color-dark: var(--color-${i}-400)`)),e.aria.label(o),C.Icon({icon:c,size:"xs"}),e.html.span(e.attr.class("bc-stat-card__trend-value"),e.Value.map(a,String)))})}function Po({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__icon"),e.attr.class(t),...a)}function Eo({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__sparkline"),e.attr.class(t),...a)}function Fo(t,a){const n=new Array(t+1);n[0]=0;for(let r=0;r<t;r++)n[r+1]=n[r]+a(r);return n}function Lo(t,a){let n=0,r=t.length-2;for(;n<r;){const l=n+r>>1;t[l+1]<=a?n=l+1:r=l}return n}function Ao(t,a,n,r,l){const s=Math.floor(t/r)-l,c=Math.ceil((t+a)/r)+l,o=Math.max(0,s),i=Math.min(n-1,c),u=o*r;return{startIndex:o,endIndex:i,offset:u}}function Bo(t,a,n,r,l){const s=Lo(r,t)-l,c=Math.max(0,s);let o=c;const i=t+a;for(;o<n&&r[o]<i;)o++;const u=Math.min(n-1,o+l),m=r[c]??0;return{startIndex:c,endIndex:u,offset:m}}function Mo({items:t,renderItem:a,itemHeight:n,overscan:r=5,containerHeight:l,class:s}){const c=typeof n=="number",o=r,i=e.prop(0),u=e.Value.get(l),m=e.prop(typeof u=="number"?u:400),f=e.computedOf(t)(v=>v.length),h=e.computedOf(f)(v=>{if(c)return v*n;const w=n;let I=0;for(let S=0;S<v;S++)I+=w(S);return I}),d=c?null:e.computedOf(f)(v=>Fo(v,n)),g=(v,w)=>v==null||w==null?v===w:v.startIndex===w.startIndex&&v.endIndex===w.endIndex&&v.offset===w.offset,p=c?e.computedOf(i,m,f,o)((v,w,I,S)=>Ao(v,w,I,n,S),g):e.computedOf(i,m,f,d,o)((v,w,I,S,V)=>Bo(v,w,I,S,V),g),b=e.computedOf(p,t)((v,w)=>{const{startIndex:I,endIndex:S}=v,V=[];for(let D=I;D<=S&&D<w.length;D++)V.push({item:w[D],index:D});return V}),y=e.computedOf(p)(v=>`translateY(${v.offset}px)`),k=e.computedOf(l)(v=>typeof v=="number"?`${v}px`:v),_=e.computedOf(s??"")(v=>v?`bc-virtual-list ${v}`:"bc-virtual-list");return e.Use(C.BeatUII18n,v=>e.html.div(e.attr.class(_),e.style.height(k),e.aria.label(v.$.virtualList.$.listLabel),e.attr.role("list"),e.WithElement(w=>{const I=()=>{i.set(w.scrollTop)};m.set(w.clientHeight||m.value),w.addEventListener("scroll",I,{passive:!0});const S=new ResizeObserver(D=>{for(const $ of D)m.set($.contentRect.height||m.value)});S.observe(w);const V=e.Value.on(h,()=>{requestAnimationFrame(()=>{w.scrollTop!==i.value&&i.set(w.scrollTop)})});return e.OnDispose(()=>{w.removeEventListener("scroll",I),S.disconnect(),V()})}),e.html.div(e.attr.class("bc-virtual-list__spacer"),e.style.height(e.Value.map(h,w=>`${w}px`))),e.html.div(e.attr.class("bc-virtual-list__viewport"),e.style.transform(y),e.MapSignal(b,w=>e.Fragment(...w.map(({item:I,index:S})=>e.html.div(e.attr.role("listitem"),a(I,S))))))))}function Mn({value:t,onChange:a,disabled:n,size:r="md"}){return e.Use(C.BeatUII18n,l=>ae.SegmentedInput({size:r,variant:"squared",value:t,disabled:n,options:{system:e.html.span(e.attr.title(l.$.appearanceSystem),C.Icon({icon:"line-md:laptop",color:"gray"})),light:e.html.span(e.attr.title(l.$.appearanceLight),C.Icon({icon:"line-md:sunny-twotone-loop",color:"yellow"})),dark:e.html.span(e.attr.title(l.$.appearanceDark),C.Icon({icon:"line-md:sunny-outline-to-moon-alt-loop-transition",color:"blue"}))},onChange:a}))}function No(t){return e.Use(Ct.Theme,({appearancePreference:a,setAppearancePreference:n})=>Mn({value:a,onChange:n,size:t?.size}))}function Wo({value:t,onChange:a,onInput:n}){return e.html.div(e.attr.class("bc-color-input__swatch-container"),e.html.span(e.attr.class("bc-color-input__swatch"),e.input.color(e.attr.class("bc-color-input__swatch-native"),e.attr.value(t),a!=null?e.on.change(e.emitValue(a)):e.Empty,n!=null?e.on.input(e.emitValue(n)):e.Empty),e.attr.style(e.Value.map(t,r=>`background-color: ${r}`))))}function Nn(t){const{value:a="#000000",onBlur:n,onChange:r,onInput:l,swatchSize:s,...c}=t;return ne.InputContainer({...c,input:e.input.text(Fe.CommonInputAttributes(t),e.attr.value(a),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(r)):e.Empty,l!=null?e.on.input(e.emitValue(l)):e.Empty)},e.attr.class("bc-color-input"),Wo({value:a,onChange:t.onChange,onInput:t.onInput}))}function Gt({ctx:t,width:a,height:n}){const r=t.createLinearGradient(0,0,a,0);for(const l of[0,60,120,180,240,300,360])r.addColorStop(l/360,G.vt(G.k(l,1,.5)));t.fillStyle=r,t.fillRect(0,0,a,n)}function ct(t,a,n,r=8){for(let l=0;l<n;l+=r)for(let s=0;s<a;s+=r)t.fillStyle=(s+l)%(r*2)<r?"#e5e5e5":"#ffffff",t.fillRect(s,l,r,r)}function Uo(t){return`bc-kbd bc-kbd--size-${t}`}function Ro({size:t="sm"}={},...a){return e.html.kbd(e.attr.class(e.Value.map(t,n=>Uo(n??"sm"))),...a)}function zo(t){return Ee.Overlay((a,n)=>{let r=n;const l=()=>r();return t(o=>{const{size:i="md",side:u="right",dismissable:m=!0,showCloseButton:f=!0,onClose:h,overlayEffect:d="opaque",container:g="body",header:p,body:b,footer:y}=o;r=n;const k=e.prop("capturing");e.Value.on(m,w=>{k.set(w?"capturing":"non-capturing")});const _=e.computedOf(p!=null,f)((w,I)=>w||I),v=e.WithElement(w=>{const I=He.useAnimatedElementToggle({initialStatus:"closed",element:w});I.listenOnClosed(()=>{n()}),r=()=>{I.close()},we.delayedAnimationFrame(()=>I.open());const V=Te.sessionId("drawer"),D=p!=null?`${V}-header`:void 0,$=`${V}-body`;return e.html.div(e.attr.class(e.computedOf(i,u,I.status)((x,U,z)=>`bc-drawer bc-drawer--size-${x} bc-drawer--container-${g} bc-drawer--side-${U} bc-drawer--status-${z}`)),e.attr.role("dialog"),e.aria.modal(!0),...D?[e.aria.labelledby(D)]:[],e.aria.describedby($),e.attr.tabindex(-1),e.attr.id(V),e.dataAttr("focus-trap","true"),Ee.FocusTrap({active:!0,escapeDeactivates:!1,initialFocus:()=>document.querySelector(`#${V} [aria-label="Close drawer"]`)||null}),e.on.mousedown(x=>x.stopPropagation()),e.When(_,()=>ua({header:e.html.div(e.attr.class("bc-drawer__header"),e.html.div(e.attr.id(D),p),e.When(f,()=>e.Use(C.BeatUII18n,x=>se.CloseButton({size:"sm",onClick:l,label:x.$.closeDrawer})))),body:e.html.div(e.attr.class("bc-drawer__body"),e.attr.id($),b),footer:y&&e.html.div(e.attr.class("bc-drawer__footer"),y)}),()=>ua({body:e.html.div(e.attr.class("bc-drawer__body"),e.attr.id($),b),footer:y&&e.html.div(e.attr.class("bc-drawer__footer"),y)})))});a({mode:k,effect:d??"opaque",container:g,content:v,onClickOutside:()=>{h?.(),l()},onEscape:()=>{h?.(),l()}})},()=>{l()})})}function Ho(t){const{content:a,placement:n="bottom",showDelay:r=0,hideDelay:l=0,mainAxisOffset:s=8,crossAxisOffset:c=0,showOn:o="click",closable:i=!0,role:u="dialog",hasPopup:m="dialog"}=t,f=Te.sessionId("popover"),h=typeof a=="function"?a:()=>a;return e.Fragment(e.aria.describedby(f),Ve.Flyout({content:()=>e.Fragment(e.attr.class("bc-popover"),e.attr.role(u),e.attr.id(f),h()),placement:n,showDelay:r,hideDelay:l,mainAxisOffset:s,crossAxisOffset:c,showOn:o,closable:i,role:u,hasPopup:m}))}function jo(t,a,n,r,l,s){const c=C.backgroundValue(t,"solid","light"),o=C.backgroundValue(t,"solid","dark");return[`--ribbon-bg: ${c.backgroundColor}`,`--ribbon-text: ${c.textColor}`,`--ribbon-bg-dark: ${o.backgroundColor}`,`--ribbon-text-dark: ${o.textColor}`,`--ribbon-inset: ${na(a)}`,`--ribbon-offset: ${na(n)}`,`--ribbon-width: ${na(r)}`,`--ribbon-angle: ${l}deg`,`--ribbon-corner: ${s}`].join("; ")}function na(t){return t==null?null:typeof t=="number"?`${t}px`:t}function Go({color:t="primary",class:a,inset:n=0,offset:r=40,width:l=100,angle:s=45,corner:c="top-end"},...o){return e.html.div(e.attr.class("bc-ribbon"),e.attr.style(e.computedOf(t,n,r,l,s,c)(jo)),e.attr.class(a),...o)}function qo(t,a){const{dismissable:n=!0,showCloseButton:r=!0,overlayEffect:l="opaque",container:s="body",padding:c=32}=t;return Ee.Overlay((o,i)=>{let u=()=>{};return a(h=>{u=i;const d=e.prop(typeof n!="boolean"||n?"capturing":"non-capturing");let g=typeof n=="boolean"?n:!0;e.Value.on(n,b=>{g=b,d.set(b?"capturing":"non-capturing")});const p=e.html.div(e.attr.class("bc-lightbox"),e.When(r,()=>e.Use(C.BeatUII18n,b=>e.html.div(e.attr.class("bc-lightbox__close"),se.CloseButton({size:"md",label:b.$.closeModal,onClick:()=>{u(),i()}}))),()=>null),e.html.div(e.attr.class("bc-lightbox__viewport"),e.attr.style(e.computedOf(c)(b=>`padding:${typeof b=="number"?b+"px":b}`)),e.html.div(e.attr.class("bc-lightbox__content"),h)));o({mode:d,effect:l??"opaque",container:s,content:p,onClickOutside:()=>{g&&(u(),i())},onEscape:()=>{g&&(u(),i())}})},()=>{u(),i()})})}function Yo(t,a){const n=["bc-announcement-bar"];return t&&n.push("bc-announcement-bar--dismissible"),a&&a.length>0&&n.push(a),n.join(" ")}function Ko(t){return`--announcement-bar-bg-color: ${be.getColorVar(t,600)}`}function Zo({color:t="primary",icon:a,closable:n=!1,onClose:r,class:l,portal:s=!1},...c){const o=e.prop(!0),i=e.When(o,()=>{const u=e.Value.map(n,m=>!!m||r!=null);return e.html.div(e.attr.class(e.computedOf(u,l)((m,f)=>Yo(m,f))),e.attr.style(e.Value.map(t,m=>Ko(m))),e.html.div(e.attr.class("bc-announcement-bar__content"),e.When(e.Value.map(a,m=>m!=null),()=>e.html.div(e.attr.class("bc-announcement-bar__icon"),C.Icon({icon:a,size:"sm",accessibility:"decorative"}))),e.html.div(e.attr.class("bc-announcement-bar__text"),...c),e.When(u,()=>e.html.div(e.attr.class("bc-announcement-bar__close"),se.CloseButton({size:"xs",color:"white",onClick:()=>{o.set(!1),r?.()}})))))});return s===!1?i:e.Portal(s===!0?"body":s,i)}function Xo(t,a){const n=a.toLowerCase();return(a?t.filter(l=>l.label.toLowerCase().includes(n)||(l.description?.toLowerCase().includes(n)??!1)):t).map((l,s)=>({item:l,index:s}))}function Qo(t){const{items:a,onClose:n,position:r}=t,l=e.prop(""),s=e.prop(0);l.on(()=>s.set(0));const c=e.computedOf(a,l)((u,m)=>Xo(u,m??"")),o=u=>{const m=e.Value.get(c),f=e.Value.get(s);switch(u.key){case"ArrowDown":u.preventDefault(),s.set(Math.min(f+1,m.length-1));break;case"ArrowUp":u.preventDefault(),s.set(Math.max(f-1,0));break;case"Enter":u.preventDefault();{const h=m.find(d=>d.index===f);h&&(h.item.onSelect(),n())}break;case"Escape":u.preventDefault(),n();break}},i=r?e.computedOf(r)(u=>u?`position: absolute; left: ${u.x}px; top: ${u.y}px;`:""):void 0;return e.Use(C.BeatUII18n,u=>e.html.div(e.attr.class("bc-block-command-palette"),i?e.attr.style(i):e.Empty,e.on.keydown(o),e.html.div(e.attr.class("bc-block-command-palette__search"),e.html.span(e.attr.class("bc-block-command-palette__search-prefix"),"/"),e.html.input(e.attr.class("bc-block-command-palette__search-input"),e.attr.type("text"),e.attr.placeholder(u.$.typeACommand),e.attr.autofocus(!0),e.attr.value(l),e.on.input(m=>{l.set(m.target.value),s.set(0)}))),e.html.div(e.attr.class("bc-block-command-palette__list"),e.ForEach(c,m=>{const f=e.computedOf(s,m)((h,d)=>h===d.index);return e.html.div(e.attr.class(e.Value.map(f,h=>`bc-block-command-palette__item${h?" bc-block-command-palette__item--selected":""}`)),e.on.click(()=>{e.Value.get(m).item.onSelect(),n()}),e.on.mouseenter(()=>{s.set(e.Value.get(m).index)}),e.html.span(e.attr.class("bc-block-command-palette__item-icon"),C.Icon({icon:m.map(h=>h.item.icon),size:"sm",accessibility:"decorative"})),e.html.div(e.attr.class("bc-block-command-palette__item-content"),e.html.span(e.attr.class("bc-block-command-palette__item-label"),m.map(h=>h.item.label)),e.When(m.map(h=>h.item.description!=null),()=>e.html.span(e.attr.class("bc-block-command-palette__item-desc"),m.map(h=>h.item.description??"")))),e.When(m.map(h=>h.item.shortcut!=null),()=>e.html.span(e.attr.class("bc-block-command-palette__item-shortcut"),m.map(h=>h.item.shortcut??""))))})),e.When(e.computedOf(c)(m=>m.length===0),()=>e.html.div(e.attr.class("bc-block-command-palette__empty"),u.$.noMatchingCommands))))}function Jo(t,a){const{title:n,body:r,icon:l="lucide:alert-triangle",color:s="danger",consequences:c,confirmText:o,cancelText:i,onConfirm:u,onCancel:m,dismissable:f=!0}=t,h={size:"sm",showCloseButton:!1,dismissable:f,onClose:m};return e.Use(C.BeatUII18n,d=>Ee.Modal(h,(g,p)=>{const b=()=>{u?.(),p()},y=()=>{m?.(),p()};return a(()=>{g({header:e.html.div(e.attr.class("bc-dialog__header-row"),e.html.div(e.attr.class("bc-dialog__icon"),e.style.backgroundColor(e.Value.map(s,_=>be.getColorVar(_,100))),e.style.color(e.Value.map(s,_=>be.getColorVar(_,600))),C.Icon({icon:l,size:"sm"})),e.html.span(e.attr.class("bc-dialog__title"),n)),body:e.html.div(e.attr.class("bc-dialog__body"),e.html.p(e.attr.class("bc-dialog__description"),r),e.NotEmpty(c??[],_=>e.html.ul(e.attr.class("bc-dialog__consequences"),e.ForEach(_,v=>e.html.li(v))))),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({variant:"light",size:"sm",onClick:y},e.coalesce(i,d.$.cancel)),ne.Button({color:s,variant:"filled",size:"sm",onClick:b},e.coalesce(o,d.$.confirm)))})},p)}))}const es={info:{icon:"lucide:info",color:"info"},success:{icon:"lucide:check-circle",color:"success"},warning:{icon:"lucide:alert-triangle",color:"warning"},danger:{icon:"lucide:alert-circle",color:"danger"}};function ts(t,a){const{title:n,body:r,variant:l="info",icon:s,okText:c,onOk:o,dismissable:i=!0}=t,u=es[l],m=s??u.icon,f=u.color,h={size:"sm",showCloseButton:!1,dismissable:i,onClose:o};return e.Use(C.BeatUII18n,d=>Ee.Modal(h,(g,p)=>{const b=()=>{o?.(),p()};return a(()=>{g({header:e.html.div(e.attr.class("bc-dialog__header-row"),e.html.div(e.attr.class("bc-dialog__icon"),e.style.backgroundColor(be.getColorVar(f,100)),e.style.color(be.getColorVar(f,600)),C.Icon({icon:m,size:"sm"})),e.html.span(e.attr.class("bc-dialog__title"),n)),body:e.html.div(e.attr.class("bc-dialog__body"),r),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({color:f,variant:"filled",size:"sm",onClick:b},e.coalesce(c,d.$.ok)))})},p)}))}function as(t,a){const{title:n,body:r,placeholder:l,defaultValue:s="",confirmText:c,cancelText:o,onConfirm:i,onCancel:u,dismissable:m=!0}=t,f={size:"sm",showCloseButton:!1,dismissable:m,onClose:u};return e.Use(C.BeatUII18n,h=>Ee.Modal(f,(d,g)=>{const p=e.prop(""),b=()=>{i?.(p.value),g()},y=()=>{u?.(),g()};return a(()=>{p.set(e.Value.get(s)),d({header:e.html.span(e.attr.class("bc-dialog__title"),n),body:e.html.div(e.attr.class("bc-dialog__body"),r??e.Empty,e.html.input(e.attr.class("bc-dialog__input"),e.attr.type("text"),e.attr.value(s),e.attr.placeholder(l??""),e.on.input(e.emitValue(_=>p.set(_))),e.on.keydown(_=>{_.key==="Enter"&&(_.preventDefault(),b())}))),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({variant:"light",size:"sm",onClick:y},e.coalesce(o,h.$.cancel)),ne.Button({color:"primary",variant:"filled",size:"sm",onClick:b},e.coalesce(c,h.$.confirm)))})},g)}))}function Ya(t){return typeof t=="string"?document.querySelector(t):t}function ns(t,a){const n=t.getBoundingClientRect();return{top:n.top-a,left:n.left-a,width:n.width+a*2,height:n.height+a*2}}function rs(t,a,n,r){const s=window.innerWidth,c=window.innerHeight;let o=a;if(o==="auto"){const m=t.top,f=c-(t.top+t.height),h=t.left,d=s-(t.left+t.width),g=Math.max(m,f,h,d);g===f?o="bottom":g===m?o="top":g===d?o="right":o="left"}let i,u;switch(o){case"bottom":i=t.top+t.height+12,u=t.left+t.width/2-n/2;break;case"top":i=t.top-r-12,u=t.left+t.width/2-n/2;break;case"right":i=t.top+t.height/2-r/2,u=t.left+t.width+12;break;case"left":i=t.top+t.height/2-r/2,u=t.left-n-12;break}return u=Math.max(8,Math.min(u,s-n-8)),i=Math.max(8,Math.min(i,c-r-8)),{top:`${i}px`,left:`${u}px`,actualPlacement:o}}function ls(t){const{steps:a,backdropAction:n="ignore",spotlightPadding:r=8,spotlightRadius:l=8,showStepIndicator:s=!0,showSkipButton:c=!0,onStart:o,onStepChange:i,onComplete:u,onSkip:m,container:f="body"}=t,h=e.prop(!1),d=e.prop(!1),g=e.prop(0),p=e.prop(0),b=e.prop("0px"),y=e.prop("0px"),k=e.prop("0px"),_=e.prop("0px"),v=e.prop("0px"),w=e.prop("0px"),I=e.prop("bottom"),S=Te.sessionId("onboarding-tour");let V=null;function D(){const Q=p.value;if(Q<0||Q>=a.length)return;const oe=a[Q],le=Ya(oe.target);if(!le)return;const ke=ns(le,r);b.set(`${ke.top}px`),y.set(`${ke.left}px`),k.set(`${ke.width}px`),_.set(`${ke.height}px`);const j=rs(ke,oe.placement??"auto",320,200);v.set(j.top),w.set(j.left),I.set(j.actualPlacement)}function $(){const Q=p.value;if(Q<0||Q>=a.length)return;const oe=a[Q],le=Ya(oe.target);le&&(le.scrollIntoView({behavior:"smooth",block:"nearest"}),requestAnimationFrame(D))}function x(){a.length!==0&&(p.set(0),D(),h.set(!0),d.set(!0),o?.(),i?.(0),requestAnimationFrame(()=>g.set(1)))}async function U(){const Q=p.value,oe=a[Q];if(!(oe.beforeNext&&!await oe.beforeNext()))if(Q>=a.length-1)L(),u?.();else{const le=Q+1;p.set(le),i?.(le),$()}}function z(){const Q=p.value;if(Q>0){const oe=Q-1;p.set(oe),i?.(oe),$()}}function T(){L(),m?.()}const W=200;function L(){h.set(!1),g.set(0),setTimeout(()=>{d.set(!1),p.set(0)},W)}function J(Q){Q<0||Q>=a.length||(p.set(Q),i?.(Q),h.value&&$())}const P={startTour:x,goToStep:J,endTour:L,isActive:h,currentStep:p},N=e.Value.map(p,Q=>Q<a.length?a[Q].title??"":""),H=e.Value.map(p,Q=>Q<a.length?a[Q].description??"":""),X=p.map(Q=>Q<a.length?a[Q].content!=null:!1),F=e.Value.map(p,Q=>Q===0),O=e.Value.map(p,Q=>Q>=a.length-1),R=e.Value.map(p,Q=>Q<a.length?a[Q].allowInteraction??!1:!1),Z=e.computedOf(b,y,k,_)((Q,oe,le,ke)=>{const me=parseFloat(Q),Ie=parseFloat(oe),j=parseFloat(le),B=parseFloat(ke),ee=l;return`M0,0 H${window.innerWidth} V${window.innerHeight} H0 Z M${Ie+ee},${me} H${Ie+j-ee} Q${Ie+j},${me} ${Ie+j},${me+ee} V${me+B-ee} Q${Ie+j},${me+B} ${Ie+j-ee},${me+B} H${Ie+ee} Q${Ie},${me+B} ${Ie},${me+B-ee} V${me+ee} Q${Ie},${me} ${Ie+ee},${me} Z`}),ie=()=>e.Use(C.BeatUII18n,Q=>{const oe=e.computedOf(p,Q.$.onboardingTour.$.stepIndicator)((le,ke)=>ke(le+1,a.length));return e.html.div(e.attr.class("bc-onboarding-tour"),e.attr.id(S),e.attr.role("dialog"),e.aria.modal(!0),e.aria.label(Q.$.onboardingTour.$.label),e.style.opacity(g.map(String)),e.svg.svg(e.attr.class(e.computedOf(R)(le=>`bc-onboarding-tour__backdrop${le?" bc-onboarding-tour__backdrop--interactive":""}`)),e.svgAttr.width("100%"),e.svgAttr.height("100%"),e.on.click(()=>{n==="close"?T():n==="advance"&&U()}),e.svg.path(e.svgAttr.d(Z),e.svgAttr["fill-rule"]("evenodd"),e.attr.class("bc-onboarding-tour__mask"))),e.html.div(e.attr.class(e.Value.map(I,le=>`bc-onboarding-tour__tooltip bc-onboarding-tour__tooltip--${le}`)),e.style.top(v),e.style.left(w),e.html.div(e.attr.class("bc-onboarding-tour__arrow")),e.html.div(e.attr.class("bc-onboarding-tour__content"),s?e.html.div(e.attr.class("bc-onboarding-tour__step-indicator"),oe):e.Empty,e.When(e.Value.map(N,le=>le.length>0),()=>e.html.h3(e.attr.class("bc-onboarding-tour__title"),e.attr.id(`${S}-title`),N),()=>{}),e.When(X,()=>{const le=p.value;return e.html.div(e.attr.class("bc-onboarding-tour__body"),le<a.length?a[le].content:void 0)},()=>e.When(e.Value.map(H,le=>le.length>0),()=>e.html.p(e.attr.class("bc-onboarding-tour__description"),H),()=>{})),e.html.div(e.attr.class("bc-onboarding-tour__nav"),e.html.div(e.attr.class("bc-onboarding-tour__nav-left"),c?ne.Button({variant:"default",size:"sm",onClick:T},Q.$.onboardingTour.$.skip):e.Empty),e.html.div(e.attr.class("bc-onboarding-tour__nav-right"),e.When(F,()=>e.Empty,()=>ne.Button({variant:"outline",size:"sm",onClick:z},Q.$.onboardingTour.$.previous)),e.When(O,()=>ne.Button({variant:"filled",color:"primary",size:"sm",onClick:()=>U()},Q.$.onboardingTour.$.finish),()=>ne.Button({variant:"filled",color:"primary",size:"sm",onClick:()=>U()},Q.$.onboardingTour.$.next))))),Ee.FocusTrap({escapeDeactivates:!0,onEscape:T})),e.WithElement(()=>{const le=ke=>{ke.key==="ArrowRight"?(ke.preventDefault(),U()):ke.key==="ArrowLeft"&&(ke.preventDefault(),z())};return V=()=>$(),document.addEventListener("keydown",le),window.addEventListener("resize",V),e.OnDispose(()=>{document.removeEventListener("keydown",le),V&&(window.removeEventListener("resize",V),V=null)})}))});return[e.When(d,()=>f==="body"?e.Portal("body",ie()):ie()),P]}function os(t,a){if(!t)return 0;const n=a.toLowerCase(),r=t.toLowerCase();let l=0,s=-1,c=0;for(let o=0;o<r.length;o++){const i=r[o],u=n.indexOf(i,l);if(u===-1)return-1;s!==-1&&(c+=u-s-1),s=u,l=u+1}return c}function ss(t,a,n,r){if(!a){if(n.length>0){const o=[];for(let i=0;i<n.length;i++)o.push({item:n[i],globalIndex:i,sectionStart:i===0?r:void 0});return o}return is(t,0)}const l=[];for(const o of t){const i=[o.label,o.description??"",...o.keywords??[]].join(" "),u=os(a,i);u!==-1&&l.push({item:o,score:u})}l.sort((o,i)=>o.score-i.score);const s=[];let c=0;for(const{item:o}of l)s.push({item:o,globalIndex:c++,sectionStart:void 0});return s}function is(t,a){const n=new Map;for(const s of t){const c=s.section??"";n.has(c)||n.set(c,[]),n.get(c).push(s)}const r=[];let l=a;for(const[s,c]of n)for(let o=0;o<c.length;o++)r.push({item:c[o],globalIndex:l++,sectionStart:o===0&&s?s:void 0});return r}function Wn(t,a){const{items:n,onSelect:r,placeholder:l,emptyMessage:s,size:c="md",recentItems:o,hotkey:i="mod+k",container:u="body",overlayEffect:m="opaque"}=t,f=e.prop(!1);let h=null,d=null;const g={open:b=>h?.(b),close:()=>d?.(),isOpen:f};return[e.Use(C.BeatUII18n,b=>Ee.Overlay((y,k)=>{const _=l??b.$.spotlight.map(V=>V.placeholder),v=s??b.$.spotlight.map(V=>V.noResults),w=b.$.spotlight.map(V=>V.recentItems),I=V=>{f.set(!0),V??e.Value.get(n),o&&e.Value.get(o);const D=e.prop(""),$=e.prop(0);D.on(()=>$.set(0));const U=`${Te.sessionId("spotlight")}-input`,z=e.computedOf(D,n,o??e.prop([]),w)((L,J,P,N)=>ss(V??J,L??"",P,N)),T=z.map(L=>L.length===0),W=e.html.div(e.attr.class(e.Value.map(c,L=>`bc-spotlight bc-spotlight--size-${L??"md"}`)),e.attr.role("dialog"),e.aria.modal(!0),e.aria.label(_),e.on.mousedown(L=>L.stopPropagation()),Ee.FocusTrap({escapeDeactivates:!1,initialFocus:()=>document.getElementById(U)}),e.html.div(e.attr.class("bc-spotlight__header"),e.html.span(e.attr.class("bc-spotlight__search-icon"),C.Icon({icon:"mdi:magnify",size:"md",accessibility:"decorative"})),e.html.input(e.attr.class("bc-spotlight__input"),e.attr.type("text"),e.attr.id(U),e.attr.placeholder(_),e.attr.autocomplete("off"),e.on.input(L=>{D.set(L.target.value)}),e.on.keydown(L=>{const J=e.Value.get(z),P=e.Value.get($);switch(L.key){case"ArrowDown":L.preventDefault(),$.set(Math.min(P+1,J.length-1));break;case"ArrowUp":L.preventDefault(),$.set(Math.max(P-1,0));break;case"Enter":L.preventDefault();{const N=J.find(H=>H.globalIndex===P);N&&(r?.(N.item),N.item.onSelect(),k(),f.set(!1))}break;case"Escape":L.preventDefault(),k(),f.set(!1);break}})),e.html.span(e.attr.class("bc-spotlight__close-hint"),e.html.kbd(e.attr.class("bc-kbd bc-kbd--size-xs"),"Esc"))),e.html.div(e.attr.class("bc-spotlight__results"),e.attr.role("listbox"),e.When(T,()=>e.html.div(e.attr.class("bc-spotlight__empty"),v),()=>e.ForEach(z,L=>{const J=e.computedOf($,L)((P,N)=>P===N.globalIndex);return e.html.div(e.attr.class("bc-spotlight__section"),e.When(L.map(P=>P.sectionStart!=null),()=>e.html.div(e.attr.class("bc-spotlight__section-title"),L.map(P=>P.sectionStart??""))),e.html.div(e.attr.class(e.Value.map(J,P=>`bc-spotlight__item${P?" bc-spotlight__item--active":""}`)),e.attr.role("option"),e.aria.selected(J),e.on.click(()=>{const P=e.Value.get(L);r?.(P.item),P.item.onSelect(),k(),f.set(!1)}),e.on.mouseenter(()=>{$.set(e.Value.get(L).globalIndex)}),e.When(L.map(P=>P.item.icon!=null),()=>e.html.span(e.attr.class("bc-spotlight__item-icon"),C.Icon({icon:L.map(P=>P.item.icon??""),size:"sm",accessibility:"decorative"}))),e.html.span(e.attr.class("bc-spotlight__item-content"),e.html.span(e.attr.class("bc-spotlight__item-label"),L.map(P=>P.item.label)),e.When(L.map(P=>P.item.description!=null),()=>e.html.span(e.attr.class("bc-spotlight__item-description"),L.map(P=>P.item.description??"")))),e.When(L.map(P=>P.item.shortcut!=null&&P.item.shortcut.length>0),()=>e.html.span(e.attr.class("bc-spotlight__item-shortcut"),e.ForEach(L.map(P=>P.item.shortcut??[]),P=>e.html.kbd(e.attr.class("bc-kbd bc-kbd--size-xs"),P))))))}))));y({mode:"capturing",effect:m,container:u,content:W,onClickOutside:()=>{k(),f.set(!1)},onEscape:()=>{f.set(!1),k()}})};return h=I,d=()=>{k(),f.set(!1)},[e.WithElement(()=>{const V=i.startsWith("mod+")||i.startsWith("ctrl+"),D=i.split("+").pop()??"k",$=x=>{const U=x.metaKey||x.ctrlKey;V&&U&&x.key.toLowerCase()===D.toLowerCase()&&(x.preventDefault(),e.Value.get(f)?(k(),f.set(!1)):I())};return document.addEventListener("keydown",$),e.OnDispose(()=>{document.removeEventListener("keydown",$)})}),a(g)]})),g]}function cs(t,a){const[n]=Wn(t,a);return n}function Be(t){const{value:a,onChange:n,onInput:r,draw:l,dependencies:s=[],min:c,max:o,step:i=1,handleColor:u,disabled:m=!1,label:f,unit:h}=t,d=e.Value.toSignal(e.Value.map(a,v=>(v-e.Value.get(c))/(e.Value.get(o)-e.Value.get(c))*100)),g=e.prop({w:0,h:0}),p=[...s,g],b=e.prop(!1);let y=null;function k(v,w){if(!e.Value.get(b)&&!w||e.Value.get(m))return;const I=y?.getBoundingClientRect();if(!I)return;const S=v.clientX-I.left,V=e.Value.get(o)-e.Value.get(c),D=Math.max(e.Value.get(c),Math.min(e.Value.get(o),e.Value.get(c)+S/I.width*V));n?.(D),r?.(D)}const _=e.html.div(e.attr.class("bc-color-picker__strip-wrap"),Ce.ElementRect(v=>(v.on(w=>g.set({w:w.width,h:w.height})),e.Empty)),e.html.div(e.attr.class("bc-color-picker__canvas-wrap"),e.html.canvas(e.attr.class("bc-color-picker__canvas"),e.attr.width(e.Value.map(g.$.w,String)),e.attr.height(e.Value.map(g.$.h,String)),e.on.pointerdown(v=>{const w=v;w.target.setPointerCapture(w.pointerId),b.set(!0),k(w,!0)}),e.on.pointerup(v=>{const w=v;w.target.releasePointerCapture(w.pointerId),b.set(!1)}),e.on.pointermove(v=>k(v)),e.WithElement(v=>{y=v;const w=v.getContext("2d");w&&e.effectOf(...p)(()=>{l({canvas:v,ctx:w,width:v.width,height:v.height})})}))),e.html.div(e.attr.class("bc-color-picker__handle"),e.style.left(d.map(v=>`${v.toFixed(1)}%`)),e.style.backgroundColor(u)));return e.Fragment(Ce.ElementRect(v=>e.When(v.$.width.map(w=>w>400),()=>Je.Label(e.attr.class("bc-color-picker__label"),f),()=>e.Fragment(e.attr.class("bc-color-picker__compact"),Je.Label(e.attr.class("bc-color-picker__label"),e.Value.map(f,w=>w.slice(0,1)),ft({content:f}))))),e.html.div(e.attr.class("bc-color-picker__channel__strip"),_),e.html.div(e.attr.class("bc-color-picker__channel__input"),ae.NumberInput({value:a,onChange:n,onInput:r,min:c,max:o,step:i,disabled:m,unit:h,formatted:!0})))}const Ka=t=>{if(t!=null)return a=>{t(a)}};function vt(t){const{value:a,color:n,onChange:r,onInput:l,dependencies:s,disabled:c,label:o="Alpha"}=t;return Be({label:o,value:a,onChange:Ka(r),onInput:Ka(l),draw:({ctx:i,width:u,height:m})=>{ct(i,u,m,m/2);const f=i.createLinearGradient(0,0,u,0),h=we.colorToString(we.withColor(n.value,{alpha:0})),d=we.colorToString(we.withColor(n.value,{alpha:1}));f.addColorStop(0,h),f.addColorStop(1,d),i.fillStyle=f,i.fillRect(0,0,u,m)},dependencies:s,min:0,max:100,unit:"%",disabled:c})}function yt(t){const{render:a,dependencies:n,handlePosition:r,handleColor:l,disabled:s=!1,onChange:c,onInput:o}=t,i=e.prop({w:0,h:0}),u=e.prop(!1),m=[...n??[],i];let f=null;function h(d,g){if(!e.Value.get(u)&&!g||e.Value.get(s))return;const p=f?.getBoundingClientRect();if(!p)return;const b=d.clientX-p.left,y=d.clientY-p.top,k={x:Math.max(0,Math.min(1,b/p.width)),y:Math.max(0,Math.min(1,y/p.height))};c?.(k),o?.(k)}return e.html.div(e.attr.class("bc-color-picker__field-container"),e.html.canvas(e.attr.width(e.Value.map(i.$.w,String)),e.attr.height(e.Value.map(i.$.h,String)),e.attr.class("bc-color-picker__field"),Ce.ElementRect(d=>(d.on(g=>i.set({w:g.width,h:g.height})),e.Empty)),e.Ensure(r,()=>e.Fragment(e.on.pointerdown(d=>{const g=d;g.target.setPointerCapture(g.pointerId),u.set(!0),h(g,!0)}),e.on.pointerup(d=>{const g=d;g.target.releasePointerCapture(g.pointerId),u.set(!1)}),e.on.pointermove(d=>h(d)))),e.WithElement(d=>{f=d;const g=d.getContext("2d");g&&e.effectOf(...m)(()=>{a({canvas:d,ctx:g,width:d.width,height:d.height})})})),e.Ensure(r,d=>e.Fragment(e.attr.class("bc-color-picker__field-interactive"),e.html.div(e.attr.class("bc-color-picker__handle"),e.style.left(d.$.x.map(g=>`${(g*100).toFixed(1)}%`)),e.style.top(d.$.y.map(g=>`${(g*100).toFixed(1)}%`)),e.style.backgroundColor(l)))))}const fe=(t,a)=>{switch(t.space){case"rgb":{const n={...t,...a};return G.tt(n.r,n.g,n.b,n.alpha)}case"rgb8":{const n={...t,...a};return G.b(n.r,n.g,n.b,n.alpha)}case"hsl":{const n={...t,...a};return G.k(n.h,n.s,n.l,n.alpha)}case"hsv":{const n={...t,...a};return G.H(n.h,n.s,n.v,n.alpha)}case"hwb":{const n={...t,...a};return G.ts(n.h,n.w,n.b,n.alpha)}case"lab":{const n={...t,...a};return G.I(n.l,n.a,n.b,n.alpha)}case"lch":{const n={...t,...a};return G.as(n.l,n.c,n.h,n.alpha)}case"oklab":{const n={...t,...a};return G.F(n.l,n.a,n.b,n.alpha)}case"oklch":{const n={...t,...a};return G.rs(n.l,n.c,n.h,n.alpha)}}};function us(t){return we.roundTo(t*100,2)}function ds(t){return we.roundTo(t/100,4)}function ps(t){try{return G.Tt(G.kt(t),"rgb")}catch{return G.tt(0,0,0,1)}}function Za(t,a){const n=l=>Math.round(Math.max(0,Math.min(1,l))*255).toString(16).padStart(2,"0"),r=`#${n(t.r)}${n(t.g)}${n(t.b)}`;return a&&t.alpha<1?r+n(t.alpha):r}function ms(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:c=!0}=t,o=e.Value.toSignal(a).map(ps),i=o.$.alpha.map(us),u=o.map(y=>fe(y,{alpha:1})).map(G.vt),m=(y,k)=>{k?.(Za(y,e.Value.get(l)))},f=o.map(y=>{const{r:k,g:_,b:v}=y,w=Math.max(k,_,v),I=Math.min(k,_,v),S=w-I;if(S<1e-10)return 0;const V=w===k?((_-v)/S+(_<v?6:0))*60:w===_?((v-k)/S+2)*60:((k-_)/S+4)*60;return isNaN(V)?0:V}),h=o.map(y=>Za(y,e.Value.get(l))),d=(y,k,_,v)=>{const w=(y%360+360)%360,I=_*k,S=I*(1-Math.abs(w/60%2-1)),V=_-I;let D,$,x;return w<60?[D,$,x]=[I,S,0]:w<120?[D,$,x]=[S,I,0]:w<180?[D,$,x]=[0,I,S]:w<240?[D,$,x]=[0,S,I]:w<300?[D,$,x]=[S,0,I]:[D,$,x]=[I,0,S],G.tt(D+V,$+V,x+V,v)},g=(y,k)=>{k!=null&&m(d(f.value,y.x,1-y.y,o.value.alpha),k)},p=(y,k)=>{if(k==null)return;const _=o.value,v=Math.max(_.r,_.g,_.b),w=Math.min(_.r,_.g,_.b),I=v,S=v===0?0:(v-w)/v;m(d(y,S,I,_.alpha),k)},b=y=>{if(y!=null)return k=>{m(fe(o.value,{alpha:ds(k)}),y)}};return e.Use(C.BeatUII18n,y=>e.html.div(e.attr.class("bc-color-picker__container"),yt({handlePosition:o.map(k=>{const _=Math.max(k.r,k.g,k.b),v=Math.min(k.r,k.g,k.b),w=_;return{x:_===0?0:(_-v)/_,y:1-w}}),disabled:s,onChange:k=>g(k,n),onInput:k=>g(k,r),handleColor:u,render:({ctx:k,width:_,height:v})=>{const w=d(f.value,1,1,1),I=k.createLinearGradient(0,0,_,0);I.addColorStop(0,"#ffffff"),I.addColorStop(1,G.vt(w)),k.fillStyle=I,k.fillRect(0,0,_,v);const S=k.createLinearGradient(0,0,0,v);S.addColorStop(0,"rgba(0,0,0,0)"),S.addColorStop(1,"rgba(0,0,0,1)"),k.fillStyle=S,k.fillRect(0,0,_,v)},dependencies:[f]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Be({label:y.$.colorPicker.$.hue,value:f,onChange:k=>p(k,n),onInput:k=>p(k,r),draw:Gt,min:0,max:360,handleColor:f.map(k=>G.vt(d(k,1,1,1))),unit:"°",disabled:s}),e.When(l,()=>vt({label:y.$.colorPicker.$.alpha,value:i,color:o,onChange:b(n),onInput:b(r),dependencies:[o.$.r,o.$.g,o.$.b],disabled:s})),Je.Label(e.attr.class("bc-color-picker__label"),y.$.colorPicker.$.hex),e.html.div(e.attr.class("bc-color-picker__channel__input"),Fe.TextInput({value:h,disabled:s,onChange:k=>{n&&n(k.startsWith("#")?k:`#${k}`)}})))),e.When(c,()=>{const k=e.prop({w:0,h:0}),_=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(k.$.w,String)),e.attr.height(e.Value.map(k.$.h,String)),Ce.ElementRect(v=>(v.on(w=>k.set({w:w.width,h:w.height})),e.Empty)),e.WithElement(v=>{const w=v.getContext("2d");w&&e.effectOf(k,o)(()=>{const I=k.value.w,S=k.value.h;I===0||S===0||(o.value.alpha<1&&ct(w,I,S,_),w.fillStyle=G.vt(o.value),w.fillRect(0,0,I,S))})})))}))))}function At(t){return we.roundTo(t*100,2)}function rt(t){return Math.round(t*100)/1e4}function hs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:c=!0}=t,o=e.Value.toSignal(a),i=o.$.r.map(At),u=o.$.g.map(At),m=o.$.b.map(At),f=o.$.alpha.map(At),h=o.map(g=>fe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return y=>{b&&(y=b(y)),p(fe(o.value,{[g]:y}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),yt({handlePosition:o.map(p=>({x:p.r,y:1-p.g})),disabled:s,onChange:p=>{n?.(fe(o.value,{r:Math.round(p.x*1e4)/1e4,g:Math.round((1-p.y)*1e4)/1e4}))},onInput:p=>{r?.(fe(o.value,{r:Math.round(p.x*1e4)/1e4,g:Math.round((1-p.y)*1e4)/1e4}))},handleColor:h,render:({ctx:p,width:b,height:y})=>{for(let k=0;k<y;k++){const _=1-k/(y-1),v=p.createLinearGradient(0,0,b,0);v.addColorStop(0,G.vt(fe(o.value,{r:0,g:_}))),v.addColorStop(1,G.vt(fe(o.value,{r:1,g:_}))),p.fillStyle=v,p.fillRect(0,k,b,1)}},dependencies:[m]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Be({label:g.$.colorPicker.$.red,value:i,onChange:d("r",n,rt),onInput:d("r",r,rt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0);k.addColorStop(0,G.vt(fe(o.value,{r:0}))),k.addColorStop(1,G.vt(fe(o.value,{r:1}))),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[u,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Be({label:g.$.colorPicker.$.green,value:u,onChange:d("g",n,rt),onInput:d("g",r,rt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0);k.addColorStop(0,G.vt(fe(o.value,{g:0}))),k.addColorStop(1,G.vt(fe(o.value,{g:1}))),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Be({label:g.$.colorPicker.$.blue,value:m,onChange:d("b",n,rt),onInput:d("b",r,rt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0);k.addColorStop(0,G.vt(fe(o.value,{b:0}))),k.addColorStop(1,G.vt(fe(o.value,{b:1}))),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,u],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>vt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,rt),onInput:d("alpha",r,rt),dependencies:[i,u,m],disabled:s})))),e.When(c,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(y=>(y.on(k=>p.set({w:k.width,h:k.height})),e.Empty)),e.WithElement(y=>{const k=y.getContext("2d");k&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ct(k,_,v,b),k.fillStyle=G.vt(o.value),k.fillRect(0,0,_,v))})})))}))))}function ra(t){return we.roundTo(t*100,2)}function dt(t){return we.roundTo(t/100,4)}function fs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:c=!0}=t,o=e.Value.toSignal(a),i=o.$.h,u=o.$.s.map(ra),m=o.$.l.map(ra),f=o.$.alpha.map(ra),h=o.map(g=>fe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return y=>{b&&(y=b(y)),p(fe(o.value,{[g]:y}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),yt({handlePosition:o.map(p=>({x:p.s,y:1-p.l})),disabled:s,onChange:p=>{n?.(fe(o.value,{s:p.x,l:1-p.y}))},onInput:p=>{r?.(fe(o.value,{s:p.x,l:1-p.y}))},handleColor:h,render:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0);k.addColorStop(0,G.vt(fe(o.value,{s:0,l:.5}))),k.addColorStop(1,G.vt(fe(o.value,{s:1,l:.5}))),p.fillStyle=k,p.fillRect(0,0,b,y);const _=p.createLinearGradient(0,0,0,y);_.addColorStop(0,"rgba(255, 255, 255, 1)"),_.addColorStop(.5,"rgba(255, 255, 255, 0)"),p.fillStyle=_,p.fillRect(0,0,b,y);const v=p.createLinearGradient(0,0,0,y);v.addColorStop(.5,"rgba(0, 0, 0, 0)"),v.addColorStop(1,"rgba(0, 0, 0, 1)"),p.fillStyle=v,p.fillRect(0,0,b,y)},dependencies:[i]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Be({label:g.$.colorPicker.$.hue,value:i,onChange:d("h",n),onInput:d("h",r),draw:Gt,min:0,max:360,handleColor:h,unit:"°",disabled:s}),Be({label:g.$.colorPicker.$.saturation,value:u,onChange:d("s",n,dt),onInput:d("s",r,dt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0),_=G.vt(fe(o.value,{s:0})),v=G.vt(fe(o.value,{s:1}));k.addColorStop(0,_),k.addColorStop(1,v),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Be({label:g.$.colorPicker.$.lightness,value:m,onChange:d("l",n,dt),onInput:d("l",r,dt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0),_=G.vt(fe(o.value,{l:0})),v=G.vt(fe(o.value,{l:.5})),w=G.vt(fe(o.value,{l:1}));k.addColorStop(0,_),k.addColorStop(.5,v),k.addColorStop(1,w),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,u],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>vt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,dt),onInput:d("alpha",r,dt),dependencies:[i,u,m],disabled:s})))),e.When(c,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(y=>(y.on(k=>p.set({w:k.width,h:k.height})),e.Empty)),e.WithElement(y=>{const k=y.getContext("2d");k&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ct(k,_,v,b),k.fillStyle=G.vt(o.value),k.fillRect(0,0,_,v))})})))}))))}function la(t){return we.roundTo(t*100,2)}function pt(t){return we.roundTo(t/100,4)}function gs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:c=!0}=t,o=e.Value.toSignal(a),i=o.$.h,u=o.$.w.map(la),m=o.$.b.map(la),f=o.$.alpha.map(la),h=o.map(g=>fe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return y=>{b&&(y=b(y)),p(fe(o.value,{[g]:y}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),yt({handlePosition:o.map(p=>({x:p.w,y:p.b})),disabled:s,onChange:p=>{n?.(fe(o.value,{w:we.roundTo(p.x,4),b:we.roundTo(p.y,4)}))},onInput:p=>{r?.(fe(o.value,{w:we.roundTo(p.x,4),b:we.roundTo(p.y,4)}))},handleColor:h,render:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0);k.addColorStop(0,G.vt(fe(o.value,{w:0,b:0}))),k.addColorStop(1,"white"),p.fillStyle=k,p.fillRect(0,0,b,y);const _=p.createLinearGradient(0,0,0,y);_.addColorStop(0,"rgba(0,0,0,0)"),_.addColorStop(1,"black"),p.fillStyle=_,p.fillRect(0,0,b,y)},dependencies:[i]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Be({label:g.$.colorPicker.$.hue,value:i,onChange:d("h",n),onInput:d("h",r),draw:Gt,min:0,max:360,handleColor:i.map(p=>G.vt(fe(o.value,{w:0,b:0}))),unit:"°",disabled:s}),Be({label:g.$.colorPicker.$.whiteness,value:u,onChange:d("w",n,pt),onInput:d("w",r,pt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0),_=G.vt(fe(o.value,{w:0})),v=G.vt(fe(o.value,{w:1}));k.addColorStop(0,_),k.addColorStop(1,v),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Be({label:g.$.colorPicker.$.blackness,value:m,onChange:d("b",n,pt),onInput:d("b",r,pt),draw:({ctx:p,width:b,height:y})=>{const k=p.createLinearGradient(0,0,b,0),_=G.vt(fe(o.value,{b:0})),v=G.vt(fe(o.value,{b:1}));k.addColorStop(0,_),k.addColorStop(1,v),p.fillStyle=k,p.fillRect(0,0,b,y)},dependencies:[i,u],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>vt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,pt),onInput:d("alpha",r,pt),dependencies:[i,u,m],disabled:s})))),e.When(c,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(y=>(y.on(k=>p.set({w:k.width,h:k.height})),e.Empty)),e.WithElement(y=>{const k=y.getContext("2d");k&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ct(k,_,v,b),k.fillStyle=G.vt(o.value),k.fillRect(0,0,_,v))})})))}))))}function Xa(t){return we.roundTo(t*100,2)}function Bt(t){return we.roundTo(t/100,4)}function bs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:c=!0}=t,o=e.Value.toSignal(a),i=o.$.l.map(Xa),u=o.$.c,m=o.$.h,f=o.$.alpha.map(Xa),h=o.map(g=>fe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return y=>{b&&(y=b(y)),p(fe(o.value,{[g]:y}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),yt({handlePosition:o.map(p=>({x:p.c/.4,y:1-p.l})),disabled:s,onChange:p=>{n?.(fe(o.value,{c:Math.round(p.x*.4*1e4)/1e4,l:Math.round((1-p.y)*1e4)/1e4}))},onInput:p=>{r?.(fe(o.value,{c:Math.round(p.x*.4*1e4)/1e4,l:Math.round((1-p.y)*1e4)/1e4}))},handleColor:h,render:({ctx:p,width:b,height:y})=>{const k=o.value.h,_=5;for(let v=0;v<b;v++){const w=v/(b-1)*.4,I=p.createLinearGradient(0,0,0,y);for(let S=0;S<=_;S++){const V=1-S/_;I.addColorStop(S/_,`oklch(${V} ${w} ${k})`)}p.fillStyle=I,p.fillRect(v,0,1,y)}},dependencies:[m]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Be({label:g.$.colorPicker.$.lightness,value:i,onChange:d("l",n,Bt),onInput:d("l",r,Bt),draw:({ctx:p,width:b,height:y})=>{const{c:k,h:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1);p.fillStyle=`oklch(${w} ${k} ${_})`,p.fillRect(v,0,1,y)}},dependencies:[u,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Be({label:g.$.colorPicker.$.chroma,value:u.map(p=>we.roundTo(p*1e3,0)),onChange:d("c",n,p=>p/1e3),onInput:d("c",r,p=>p/1e3),draw:({ctx:p,width:b,height:y})=>{const{l:k,h:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1)*.4;p.fillStyle=`oklch(${k} ${w} ${_})`,p.fillRect(v,0,1,y)}},dependencies:[i,m],handleColor:h,min:0,max:400,step:1,disabled:s}),Be({label:g.$.colorPicker.$.hue,value:m,onChange:d("h",n),onInput:d("h",r),draw:({ctx:p,width:b,height:y})=>{const{l:k,c:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1)*360;p.fillStyle=`oklch(${k} ${_} ${w})`,p.fillRect(v,0,1,y)}},dependencies:[i,u],handleColor:m.map(p=>G.vt(fe(o.value,{l:.7,c:.3}))),min:0,max:360,unit:"°",disabled:s}),e.When(l,()=>vt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,Bt),onInput:d("alpha",r,Bt),dependencies:[i,u,m],disabled:s})))),e.When(c,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(y=>(y.on(k=>p.set({w:k.width,h:k.height})),e.Empty)),e.WithElement(y=>{const k=y.getContext("2d");k&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ct(k,_,v,b),k.fillStyle=G.vt(o.value),k.fillRect(0,0,_,v))})})))}))))}const vs=t=>{const{value:a,onChange:n,onInput:r,onBlur:l,after:s,disabled:c,...o}=t,i=ae.NullableResetAfter(a,c,n??r);return Nn({...o,disabled:c,value:e.Value.map(a,G.nullToEmpty),onChange:n!=null?u=>n(G.emptyToNull(u)):void 0,onInput:r!=null?u=>r(G.emptyToNull(u)):void 0,onBlur:l,after:s!=null?e.Fragment(i,s):i})},ys=t=>{const{value:a,onChange:n,onInput:r,onBlur:l,after:s,disabled:c,...o}=t,i=ae.NullableResetAfter(a,c,n??r);return G.ColorSwatchInput({...o,disabled:c,value:e.Value.map(a,G.nullToEmpty),onChange:n!=null?u=>n(G.emptyToNull(u)):void 0,onInput:r!=null?u=>r(G.emptyToNull(u)):void 0,onBlur:l,after:s!=null?e.Fragment(i,s):i})},Da=t=>{const{onChange:a,onInput:n,onBlur:r,role:l,display:s,optionsSource:c,allowSpaceToggle:o=!1,onBeforeOpen:i,onAfterOpen:u,buildListboxContent:m}=t,f=e.prop(!1),h=e.prop(-1),d=e.prop(null),g=Te.sessionId("dropdown"),p=Te.sessionId("listbox");let b,y;f.onChange(v=>{v||(h.set(-1),d.set(null))});const k=v=>{a?.(v),n?.(v),f.set(!1),b?.focus()},_=v=>{const w=We.getValues(e.Value.get(c));switch(v.key){case"ArrowDown":{if(v.preventDefault(),!f.value)f.set(!0),w.length>0&&(h.set(0),d.set(w[0]));else{const I=Math.min(h.value+1,w.length-1);h.set(I),d.set(w[I]??null)}break}case"ArrowUp":{if(v.preventDefault(),f.value){const I=Math.max(h.value-1,0);h.set(I),d.set(w[I]??null)}break}case"Enter":{if(v.preventDefault(),f.value&&h.value>=0){const I=w[h.value];I!=null&&k(I)}else{i?.();const I=We.getValues(e.Value.get(c));f.set(!0),I.length>0&&(h.set(0),d.set(I[0])),setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{u?.()})})},0)}break}case"Escape":{f.value&&(v.preventDefault(),f.set(!1),b?.focus());break}case" ":{if(e.Value.get(o)){v.preventDefault();const I=We.getValues(e.Value.get(c));f.set(!f.value),f.value&&I.length>0&&(h.set(0),d.set(I[0]))}break}}};return ne.InputContainer({...t,input:ae.Group(e.attr.class("bc-dropdown__trigger"),e.html.span(e.attr.class("bc-dropdown__display"),s)),after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(v=>e.Fragment(e.WithElement(w=>{b=w;const I=()=>{if(f.value)f.set(!1);else{i?.();const S=We.getValues(e.Value.get(c));f.set(!0),S.length>0&&(h.set(0),d.set(S[0])),setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{u?.()})})},0)}};return w.addEventListener("keydown",_),w.addEventListener("click",I),e.OnDispose(()=>{w.removeEventListener("keydown",_),w.removeEventListener("click",I)})}),Fe.CommonInputAttributes(t),e.attr.id(g),e.attr.tabindex(0),e.aria.controls(p),e.aria.expanded(f),e.attr.class("bc-dropdown"),e.attr.role(l),e.aria.activedescendant(e.computedOf(f,d)((w,I)=>w&&I!=null?`dropdown-option-${String(I)}`:"")),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!y?.contains(document.activeElement)&&!b?.contains(document.activeElement)&&(f.set(!1),r())})}):e.Empty,Ve.Flyout({content:()=>e.html.div(e.WithElement(w=>{y=w}),e.style.minWidth(v.$.width.map(w=>`${w-10}px`)),e.attr.class("bc-dropdown__listbox"),e.attr.role("listbox"),e.attr.id(p),e.aria.labelledby(g),m({dropdownId:g,listboxId:p,focusedValue:d,handleKeyDown:_,onSelect:k})),mainAxisOffset:0,placement:"bottom-start",hasPopup:"listbox",open:f,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))},Un=(t,a,n,r,l)=>e.Ensure(t,s=>e.OneOfType(s,{value:c=>{const o=e.computedOf(c,n)((u,m)=>a(u.value,m)),i=e.computedOf(c,l)((u,m)=>m!=null&&a(u.value,m));return e.html.div(e.attr.class("bc-dropdown__option"),e.attr.class(e.computedOf(o,i,c)((u,m,f)=>{const h=[];return u&&h.push("bc-dropdown__option--selected"),m&&h.push("bc-dropdown__option--focused"),f.disabled&&h.push("bc-dropdown__option--disabled"),h.join(" ")})),e.attr.role("option"),e.attr.id(c.map(u=>`dropdown-option-${String(u.value)}`)),e.aria.selected(o),ae.Expando("value",c.$.value),e.When(c.map(u=>!u.disabled),()=>e.on.click(()=>r(c.value.value)),()=>e.Empty),e.html.div(e.attr.class("bc-dropdown__option-content"),c.value.before&&e.html.span(e.attr.class("bc-dropdown__option-before"),c.value.before),e.html.span(e.attr.class("bc-dropdown__option-label"),c.$.label),c.value.after&&e.html.span(e.attr.class("bc-dropdown__option-after"),c.value.after)))},group:c=>e.html.div(e.attr.class("bc-dropdown__group"),e.attr.role("group"),e.aria.label(c.$.group),e.html.div(e.attr.class("bc-dropdown__group-label"),c.$.group),e.ForEach(c.$.options,o=>Un(o,a,n,r,l))),break:()=>e.html.hr(e.attr.class("bc-dropdown__separator"))})),Rn=t=>{const{value:a,options:n,unselectedLabel:r,equality:l=(u,m)=>u===m,placeholder:s,searchable:c=!1}=t,o=e.computedOf(a,n)((u,m)=>{if(u==null)return"";const f=h=>{for(const d of h){if(d.type==="value"&&l(d.value,u))return d.label;if(d.type==="group"){const g=f(d.options);if(g)return g}}};return f(m)||String(u)}),i=e.computedOf(c)(u=>!u);return Da({...t,role:"dropdown",display:e.When(o.map(u=>u.length>0),()=>o,()=>e.Use(C.BeatUII18n,u=>e.coalesce(s,r,u.$.selectOne))),optionsSource:n,allowSpaceToggle:i,buildListboxContent:({focusedValue:u,onSelect:m})=>e.ForEach(n,f=>Un(f,l,a,m,u))})},zn=t=>{const{controller:a,onChange:n,onBlur:r,...l}=t;return Rn({...l,value:a.signal,onChange:se.makeOnChangeHandler(a,n),onBlur:se.makeOnBlurHandler(a,r)})},ks=t=>se.Field({...t,content:zn(t)}),Hn=(t,a,n,r,l,s)=>e.Ensure(t,c=>e.OneOfType(c,{value:o=>{const i=e.computedOf(o,n)((m,f)=>f!=null&&a(m.value,f)),u=e.computedOf(o,l)((m,f)=>f!=null&&a(m.value,f));return e.html.div(e.attr.class("bc-dropdown__option"),e.attr.class(e.computedOf(i,u,o)((m,f,h)=>{const d=[];return m&&d.push("bc-dropdown__option--selected"),f&&d.push("bc-dropdown__option--focused"),h.disabled&&d.push("bc-dropdown__option--disabled"),d.join(" ")})),e.attr.role("option"),e.attr.id(o.map(m=>`dropdown-option-${String(m.value)}`)),e.aria.selected(i),e.When(o.map(m=>!m.disabled),()=>e.on.click(()=>r(o.value.value)),()=>e.Empty),e.html.div(e.attr.class("bc-dropdown__option-content"),o.value.before&&e.html.span(e.attr.class("bc-dropdown__option-before"),o.value.before),e.html.span(e.attr.class("bc-dropdown__option-label"),s(o.$.value)),o.value.after&&e.html.span(e.attr.class("bc-dropdown__option-after"),o.value.after)))},group:o=>e.html.div(e.attr.class("bc-dropdown__group"),e.attr.role("group"),e.aria.label(o.$.group),e.html.div(e.attr.class("bc-dropdown__group-label"),o.$.group),e.ForEach(o.$.options,i=>Hn(i,a,n,r,l,s))),break:()=>e.html.hr(e.attr.class("bc-dropdown__separator"))})),jn=t=>{const{value:a,loadOptions:n,renderOption:r,renderValue:l,equality:s=(_,v)=>_===v,placeholder:c,searchPlaceholder:o,debounceMs:i=150,autoFocusSearch:u=!0}=t,m=e.prop(""),f=e.prop(!1),h=e.prop([]);let d;const g=e.Value.toSignal(a),p=()=>(l??r)(g);let b=null;const y=_=>{f.set(!0),Promise.resolve(n(_)).then(v=>{h.set(v??[])}).catch(()=>{h.set([])}).finally(()=>f.set(!1))},k=_=>{b!=null&&(clearTimeout(b),b=null),b=setTimeout(()=>{y(_)},Math.max(0,i))};return Da({...t,role:"combobox",display:e.When(e.computedOf(a)(_=>_!=null),p,()=>e.Use(C.BeatUII18n,_=>_.$.selectOne)),optionsSource:h,onBeforeOpen:()=>{const _=e.Value.get(m);k(_)},onAfterOpen:()=>{u&&d?.focus()},buildListboxContent:({focusedValue:_,handleKeyDown:v,onSelect:w})=>e.Use(C.BeatUII18n,I=>e.Fragment(e.html.div(e.attr.class("bc-dropdown__search"),e.html.input(e.attr.type("text"),e.attr.class("bc-dropdown__search-input"),e.attr.placeholder(e.computedOf(o,c,I.$.searchPlaceholder)((S,V,D)=>S??V??D)),e.attr.value(m),e.WithElement(S=>(d=S,e.Empty)),e.on.input(S=>{const V=S.target;m.set(V.value),k(V.value)}),e.on.keydown(v))),e.When(f,()=>e.html.div(e.attr.class("bc-dropdown__loading"),C.Icon({icon:"ph:spinner-bold",color:"neutral"})),()=>e.ForEach(h,S=>Hn(S,s,g,w,_,r)))))})},Gn=t=>{const{controller:a,onChange:n,onBlur:r,...l}=t;return jn({...l,value:a.signal,onChange:se.makeOnChangeHandler(a,n),onBlur:se.makeOnBlurHandler(a,r)})},_s=t=>se.Field({...t,content:Gn(t)});function Oa(t){const{values:a,options:n,equality:r,disabled:l,onRemove:s}=t;return e.NotEmpty(a,()=>e.ForEach(a,c=>it({variant:"light",onClose:()=>s(c.value),disabled:l},e.computedOf(c,n)((o,i)=>yn(i,o,r)))),()=>e.html.span(e.attr.class("bc-input-container__placeholder"),t.placeholder))}function Ta(t){const{value:a,options:n,equality:r=(u,m)=>u===m,placeholder:l}=t,s=u=>{const m=e.Value.get(a);t.onChange?.(Ca(m,u,r))},c=u=>{const m=e.Value.get(a);t.onChange?.(wa(m,u,r))},o=u=>e.computedOf(a)(m=>Rt(m,u,r)),i=Ve.Menu({items:()=>{const u=e.Value.get(n),m=[];for(const f of u)if(f.type==="value"){const h=o(f.value);m.push(e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(f.disabled===!0),e.aria.checked(h),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),f.label),e.on.click(()=>c(f.value))))}else f.type==="group"?m.push(e.html.div(e.attr.class("bc-menu-group"),e.html.div(e.attr.class("bc-menu-group__label"),f.group),...f.options.map(h=>{if(h.type==="value"){const d=o(h.value);return e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(h.disabled===!0),e.aria.checked(d),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),h.label),e.on.click(()=>c(h.value)))}return e.Empty}))):m.push(Ve.MenuSeparator());return m},placement:"bottom-start",showDelay:0,hideDelay:100,showOn:"click",closable:!0});return ne.InputContainer({...t,before:t.before??ne.InputIcon({icon:"tabler:tags",color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),i,Oa({values:a,placeholder:l,options:n,equality:r,disabled:t.disabled,onRemove:s})),after:ne.InputIcon({icon:"line-md:plus",color:"neutral",size:"sm"})})}function ws(t){return se.BaseControl(Ta,t)}function Cs(t){return se.Control(Ta,t)}function Pa(t){const{value:a,options:n,equality:r=(d,g)=>d===g,placeholder:l,searchPlaceholder:s,filter:c}=t,o=e.prop(""),i=d=>{const g=e.Value.get(a);t.onChange?.(Ca(g,d,r))},u=d=>{const g=e.Value.get(a);t.onChange?.(wa(g,d,r))},m=e.computedOf(n,o)((d,g)=>Sa(d,g,c)),f=d=>e.Ensure(d,g=>e.OneOfType(g,{value:p=>{const b=e.computedOf(a,p)((y,k)=>Rt(y,k.value,r));return e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(p.map(y=>y.disabled===!0)),e.aria.checked(b),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),p.$.label),e.on.click(()=>u(p.value.value)))},group:p=>e.html.div(e.attr.class("bc-menu-group"),e.html.div(e.attr.class("bc-menu-group__label"),p.$.group),e.ForEach(p.$.options,f)),break:()=>Ve.MenuSeparator()})),h=Ve.Menu({items:()=>[e.When(m.map(d=>d.length===0),()=>e.html.div(e.attr.class("bc-dropdown__empty"),e.Use(C.BeatUII18n,d=>d.$.noResults))),e.ForEach(m,f)],placement:"bottom-start",showDelay:0,hideDelay:100,showOn:d=>e.WithElement(g=>{const p=g.querySelector(".bc-dropdown__search-input");if(p){const b=()=>d.set(!0);return p.addEventListener("focus",b),e.OnDispose(()=>{p.removeEventListener("focus",b)})}return e.Empty}),closable:!0});return ne.InputContainer({...t,before:t.before??ne.InputIcon({icon:"tabler:tags",color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),Oa({values:a,options:n,placeholder:l,equality:r,disabled:t.disabled,onRemove:i}),e.html.div(e.attr.class("bc-input-container__tags-selector"),e.html.input(e.attr.type("text"),e.attr.class("bc-dropdown__search-input"),e.attr.placeholder(e.computedOf(s,l)((d,g)=>d??g??"")),e.attr.value(o),e.on.input(d=>{const g=d.target;o.set(g.value)}),e.on.keydown(d=>{(d.key==="ArrowUp"||d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&d.stopPropagation()})),h))})}function Ss(t){return se.BaseControl(Pa,t)}function Vs(t){return se.Control(Pa,t)}const Is=t=>{const{value:a,onBlur:n,onChange:r}=t;return ne.InputContainer({...t,input:e.input.date(Fe.CommonInputAttributes(t),e.attr.valueAsDate(a),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValueAsDate(r)):e.Empty)})};function Pt(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),c=Te.sessionId("date-range-select"),o=Te.sessionId("date-range-panel");let i,u;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),i?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-date-select ${h}`):"bc-date-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:calendar",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{i=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(c),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-date-range-select"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!u?.contains(document.activeElement)&&!i?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ve.Flyout({content:()=>e.html.div(e.WithElement(d=>{u=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-date-range-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),i?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function $s(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:c=u=>u.toString(),...o}=t,i=e.computedOf(a)(u=>`${c(u[0])} → ${c(u[1])}`);return Pt({...o,displayText:i,panelContent:rn({value:e.Value.map(a,u=>u),onChange:n,isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})})}function xs(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:c=p=>p.toString(),startLabel:o=C.defaultMessages.dateRangeStart,endLabel:i=C.defaultMessages.dateRangeEnd,emptyPlaceholder:u=C.defaultMessages.dateRangeNoLimit,...m}=t,f=e.computedOf(a)(p=>{const b=p[0]!=null?c(p[0]):u,y=p[1]!=null?c(p[1]):u;return`${b} → ${y}`}),h=e.Value.map(a,p=>p[0]??null),d=e.Value.map(a,p=>p[1]??null),g=C.defaultMessages.clearValue;return Pt({...m,displayText:f,panelContent:e.html.div(e.attr.class("bc-date-range-select__pickers"),e.html.div(e.attr.class("bc-date-range-select__picker"),e.html.div(e.attr.class("bc-date-range-select__picker-header"),e.html.span(e.attr.class("bc-date-range-select__picker-label"),o),e.When(e.Value.map(h,p=>p!=null),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-date-range-select__clear-btn"),e.attr.title(g),e.on.click(p=>{p.preventDefault(),p.stopPropagation();const b=e.Value.get(a);n?.([null,b[1]])}),g))),st({value:h,onSelect:p=>{const b=e.Value.get(a);n?.([p,b[1]])},isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})),e.html.div(e.attr.class("bc-date-range-select__picker"),e.html.div(e.attr.class("bc-date-range-select__picker-header"),e.html.span(e.attr.class("bc-date-range-select__picker-label"),i),e.When(e.Value.map(d,p=>p!=null),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-date-range-select__clear-btn"),e.attr.title(g),e.on.click(p=>{p.preventDefault(),p.stopPropagation();const b=e.Value.get(a);n?.([b[0],null])}),g))),st({value:d,onSelect:p=>{const b=e.Value.get(a);n?.([b[0],p])},isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})))})}function Ds(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:c=u=>u.toString(),...o}=t,i=e.Value.map(a,u=>c(u));return Pt({...o,displayText:i,panelContent:st({value:e.Value.map(a,u=>u),onSelect:u=>n?.(u),isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})})}function Os(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:c=h=>h.toString(),placeholder:o=C.defaultMessages.dateRangeSelectDate,disabled:i,...u}=t,m=e.Value.map(a,h=>h!=null?c(h):o),f=ae.NullableResetAfter(a,i,n);return Pt({...u,disabled:i,displayText:m,after:u.after!=null?e.Fragment(f,u.after):f,panelContent:st({value:a,onSelect:h=>n?.(h),isDateDisabled:r,color:l,size:t.size,disabled:i,weekStartsOn:s})})}const Ts=t=>{const a=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),l=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0");return`${a}-${n}-${r}T${l}:${s}`},Ps=t=>{const{value:a,onBlur:n,onChange:r}=t;return ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,Ts)),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(l=>r(new Date(l)))):e.Empty)})};function Es(t,...a){const{size:n="md",filled:r=!1}=t;return e.html.span(e.attr.class("bc-input-adornment"),e.attr.class(e.Value.map(n,l=>`bc-input-adornment--size-${l}`)),e.attr.class(e.Value.map(r,l=>l?"bc-input-adornment--filled":"")),e.html.span(e.attr.class("bc-input-adornment__content"),...a))}const Fs=t=>Ce.Query({request:t.request,load:t.load,convertError:String,success:({value:a})=>{const n=a.map(r=>r.map(l=>typeof l=="object"&&"id"in l&&"label"in l?We.value(l.id,l.label):l));return ae.NativeSelect({...t,options:n,unselectedLabel:t.unselectedLabel,equality:t.equality})},pending:()=>ne.InputContainer({...t,disabled:!0,after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after),input:e.html.select(e.attr.class("bc-native-select bc-input"),e.attr.disabled(!0),e.Use(C.BeatUII18n,a=>e.html.option(a.$.loadingShort)))})}),Ls=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:c,...o}=t,i=ae.NullableResetAfter(a,c,r??l);return ae.MaskInput({...o,value:e.Value.map(a,G.nullToEmpty),onChange:r!=null?u=>r(G.emptyToNull(u)):void 0,onInput:l!=null?u=>l(G.emptyToNull(u)):void 0,onBlur:n,after:s!=null?e.Fragment(i,s):i})};function As(t,a,n){const r=["bc-number-stepper",`bc-number-stepper--size-${t}`,`bc-number-stepper--${n}`];return a&&r.push("bc-number-stepper--disabled"),r.join(" ")}function Bs(t){const{value:a,onChange:n,min:r,max:l,step:s=1,size:c="md",disabled:o=!1,orientation:i="horizontal"}=t;return e.Use(C.BeatUII18n,u=>{const m=e.computedOf(r,a,o)((b,y,k)=>k?!1:b!=null?y>b:!0),f=e.computedOf(l,a,o)((b,y,k)=>k?!1:b!=null?y<b:!0),h=()=>{if(e.Value.get(o))return;const b=e.Value.get(a),y=e.Value.get(s),k=r!=null?e.Value.get(r):void 0,_=b-y;k!=null&&_<k||n(_)},d=()=>{if(e.Value.get(o))return;const b=e.Value.get(a),y=e.Value.get(s),k=l!=null?e.Value.get(l):void 0,_=b+y;k!=null&&_>k||n(_)},g=e.Value.map(c,b=>{switch(b){case"xs":return"xs";case"sm":return"xs";case"md":return"sm";case"lg":return"sm";case"xl":return"md";default:return"sm"}}),p=(b,y,k,_,v)=>e.html.button(e.attr.type("button"),e.attr.class(`bc-number-stepper__button bc-number-stepper__button--${v}`),e.attr.disabled(e.Value.map(k,w=>!w)),e.aria.label(b),e.on.click(w=>{w.stopPropagation(),_()}),C.Icon({icon:y,size:g}));return e.html.div(e.attr.class(e.computedOf(c,o,i)(As)),e.attr.role("group"),e.aria.label(u.$.numberStepper.$.value),e.aria.valuemin(r),e.aria.valuemax(l),e.aria.valuenow(a),p(u.$.numberStepper.$.decrement,"lucide:minus",m,h,"decrement"),e.html.span(e.attr.class("bc-number-stepper__value"),e.aria.live("polite"),e.Value.map(a,String)),p(u.$.numberStepper.$.increment,"lucide:plus",f,d,"increment"))})}function Ms(t,a,n,r,l){const s=["bc-sortable-list",`bc-sortable-list--size-${t}`,`bc-sortable-list--variant-${n}`,`bc-sortable-list--gap-${r}`];return a&&s.push("bc-sortable-list--disabled"),l&&s.push(l),s.join(" ")}function Ns(t){const{items:a,onChange:n,renderItem:r,keyOf:l,disabled:s=!1,size:c="md",class:o="",variant:i="bordered",gap:u="md",handleIcon:m="lucide:grip-vertical"}=t,f=e.prop(null),h=e.prop(null),d=e.prop(null);let g=null,p=null;function b(y,k){const _=e.Value.get(a);if(k<0||k>=_.length)return;const v=[..._],[w]=v.splice(y,1);v.splice(k,0,w),p=l(w),n(v),requestAnimationFrame(()=>{if(g&&p){const I=g.querySelectorAll("[data-key]");for(const S of I)if(S.getAttribute("data-key")===p){S.focus();break}p=null}})}return e.Use(C.BeatUII18n,y=>e.html.div(e.attr.class(e.computedOf(c,s,i,u,o)(Ms)),e.attr.role("list"),e.aria.label(y.$.sortableList.$.dragHandle),e.WithElement(k=>{g=k;const _=()=>d.set(null);return document.addEventListener("mouseup",_),e.OnDispose(()=>{g=null,document.removeEventListener("mouseup",_)})}),e.MapSignal(e.Value.toSignal(a),k=>e.Fragment(...k.map((_,v)=>{const w=l(_),I=e.Value.map(f,$=>$===v),S=e.Value.map(h,$=>$===v),V=e.computedOf(I,S)(($,x)=>{const U=["bc-sortable-list__item"];return $&&U.push("bc-sortable-list__item--dragging"),x&&U.push("bc-sortable-list__item--drop-target"),U.join(" ")}),D=e.html.span(e.attr.class("bc-sortable-list__handle"),e.attr.title(y.$.sortableList.$.dragHandle),e.on.mousedown($=>{e.Value.get(s)||($.stopPropagation(),d.set(v))}),C.Icon({icon:m,size:"sm"}));return e.html.div(e.attr.class(V),e.attr.role("listitem"),e.attr.tabindex(e.Value.map(s,$=>$?-1:0)),e.attr.draggable(e.computedOf(s,e.Value.map(d,$=>$===v))(($,x)=>$?void 0:x?"true":void 0)),e.dataAttr("key",w),e.on.keydown($=>{e.Value.get(s)||($.altKey&&$.key==="ArrowUp"?($.preventDefault(),b(v,v-1)):$.altKey&&$.key==="ArrowDown"&&($.preventDefault(),b(v,v+1)))}),e.on.dragstart($=>{e.Value.get(s)||(f.set(v),$.dataTransfer&&($.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",String(v))))}),e.on.dragover($=>{$.preventDefault(),$.dataTransfer&&($.dataTransfer.dropEffect="move"),h.set(v)}),e.on.dragleave(()=>{h.value===v&&h.set(null)}),e.on.drop($=>{$.preventDefault();const x=f.value;if(x!=null&&x!==v){const U=[...e.Value.get(a)],[z]=U.splice(x,1);U.splice(v,0,z),n(U)}f.set(null),h.set(null)}),e.on.dragend(()=>{f.set(null),h.set(null),d.set(null)}),r(_,D))})))))}function Ws(t,a){const n=["bc-transfer-list",`bc-transfer-list--size-${t}`];return a&&n.push("bc-transfer-list--disabled"),n.join(" ")}function Us(t){const{available:a,selected:n,onChange:r,renderItem:l,keyOf:s,searchField:c,searchable:o=!1,disabled:i=!1,size:u="md",color:m="primary"}=t,f=e.prop(new Set),h=e.prop(new Set),d=e.prop(""),g=e.prop(""),p=(y,k)=>{const _=new Set(y.value);_.has(k)?_.delete(k):_.add(k),y.set(_)},b=c??s;return e.Use(C.BeatUII18n,y=>{const k=()=>{if(e.Value.get(i))return;const x=f.value;if(x.size===0)return;const U=e.Value.get(a),z=e.Value.get(n),T=U.filter(W=>x.has(s(W)));r([...z,...T]),f.set(new Set)},_=()=>{if(e.Value.get(i))return;const x=e.Value.get(I),U=e.Value.get(n);r([...U,...x]),f.set(new Set)},v=()=>{if(e.Value.get(i))return;const x=h.value;if(x.size===0)return;const U=e.Value.get(n);r(U.filter(z=>!x.has(s(z)))),h.set(new Set)},w=()=>{if(e.Value.get(i))return;const x=new Set(e.Value.get(S).map(s)),U=e.Value.get(n);r(U.filter(z=>!x.has(s(z)))),h.set(new Set)},I=e.computedOf(a,n,d)((x,U,z)=>{const T=new Set(U.map(s)),W=x.filter(J=>!T.has(s(J)));if(!z)return W;const L=z.toLowerCase();return W.filter(J=>b(J).toLowerCase().includes(L))}),S=e.computedOf(n,g)((x,U)=>{if(!U)return x;const z=U.toLowerCase();return x.filter(T=>b(T).toLowerCase().includes(z))}),V=e.Value.map(f,x=>x.size>0),D=e.Value.map(h,x=>x.size>0),$=(x,U,z,T,W)=>e.html.div(e.attr.class("bc-transfer-list__panel"),e.html.div(e.attr.class("bc-transfer-list__panel-header"),e.html.span(e.attr.class("bc-transfer-list__panel-title"),x)),e.When(o,()=>e.html.div(e.attr.class("bc-transfer-list__search"),Fe.TextInput({value:W,onInput:L=>W.set(L),placeholder:U,size:"xs"}))),e.html.div(e.attr.class("bc-transfer-list__items"),e.attr.role("listbox"),e.aria.label(x),e.ForEach(z,L=>{const J=e.Value.get(L),P=s(J),N=e.Value.map(T,H=>H.has(P));return e.html.div(e.attr.class(e.Value.map(N,H=>H?"bc-transfer-list__item bc-transfer-list__item--selected":"bc-transfer-list__item")),e.attr.role("option"),e.aria.selected(e.Value.map(N,H=>H?!0:"undefined")),e.on.click(()=>{e.Value.get(i)||p(T,P)}),e.html.span(e.attr.class("bc-transfer-list__item-check"),C.Icon({icon:e.Value.map(N,H=>H?"ri:checkbox-fill":"mdi:checkbox-blank-outline"),size:"sm",accessibility:"decorative"})),e.html.span(e.attr.class("bc-transfer-list__item-content"),l(J)))})));return e.html.div(e.attr.class(e.computedOf(u,i)(Ws)),e.attr.role("group"),$(y.$.transferList.$.available,y.$.transferList.$.searchAvailable,I,f,d),e.html.div(e.attr.class("bc-transfer-list__actions"),ne.Button({variant:"outline",size:"sm",color:m,disabled:e.Value.map(V,x=>!x),onClick:k},e.aria.label(y.$.transferList.$.moveRight),C.Icon({icon:"lucide:chevron-right",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:i,onClick:_},e.aria.label(y.$.transferList.$.moveAllRight),C.Icon({icon:"lucide:chevrons-right",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:i,onClick:w},e.aria.label(y.$.transferList.$.moveAllLeft),C.Icon({icon:"lucide:chevrons-left",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:e.Value.map(D,x=>!x),onClick:v},e.aria.label(y.$.transferList.$.moveLeft),C.Icon({icon:"lucide:chevron-left",size:"xs"}))),$(y.$.transferList.$.selected,y.$.transferList.$.searchSelected,S,h,g))})}function Rs(t,a){return t.length===a.length&&t.every((n,r)=>n===a[r])}function zs(t,a,n){const r=["bc-segmented-input",`bc-segmented-input--size-${t}`];return n==="squared"&&r.push("bc-segmented-input--squared"),a&&r.push("bc-segmented-input--disabled"),r.join(" ")}function Hs(t){if(t==null)return"";const a=new Map,n=C.backgroundValue(t,"solid","light"),r=C.backgroundValue(t,"solid","dark");return a.set("--si-indicator-bg",n.backgroundColor),a.set("--si-active-text",n.textColor),a.set("--si-indicator-bg-dark",r.backgroundColor),a.set("--si-active-text-dark",r.textColor),Array.from(a.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function qn(t){return t.flatMap(a=>a.type==="value"?[a]:a.type==="group"?qn(a.options):[])}function js({options:t,value:a,onChange:n,equality:r=(u,m)=>u===m,size:l="md",disabled:s=!1,variant:c="squared",color:o},...i){const u=e.Value.map(t,qn),m=e.Value.toSignal(a),f=e.prop([],Rs);return e.html.div(e.attr.class(e.computedOf(l,s,c)((h,d,g)=>zs(h??"md",d??!1,g??"squared"))),e.attr.style(o!=null?e.Value.map(o,h=>Hs(h)):""),e.html.div(e.attr.class("bc-segmented-input__container"),e.html.div(e.attr.class("bc-segmented-input__indicator"),e.style.width(e.computedOf(m,f,u)((h,d,g)=>{const p=g.findIndex(y=>r(y.value,h)),b=d[p];return b!=null?`${b.width}px`:"0px"})),e.style.left(e.computedOf(m,f,u)((h,d,g)=>{const p=g.findIndex(y=>r(y.value,h)),b=d[p];return b!=null?`${b.left}px`:"0px"}))),e.ForEach(u,(h,{index:d})=>e.html.button(e.attr.type("button"),e.on.click(g=>{g.preventDefault();const p=e.Value.get(h);p.disabled||e.Value.get(s)||n?.(p.value)}),e.attr.disabled(e.computedOf(s,h)((g,p)=>(g??!1)||(p.disabled??!1))),e.attr.class(e.computedOf(m,h)((g,p)=>r(p.value,g)?"bc-segmented-input__segment bc-segmented-input__segment--active":"bc-segmented-input__segment bc-segmented-input__segment--inactive")),Ce.ElementRect(g=>{function p(){f.update(y=>{const k=[...y];for(;k.length<=d;)k.push({left:0,width:0});return k[d]={width:g.value.width,left:g.value.localLeft},k})}const b=we.delayedAnimationFrame(p);return e.OnDispose(b,g.on(p))}),h.$.before!=null?e.html.span(e.attr.class("bc-segmented-input__segment-before"),h.$.before):null,h.$.label,h.$.after!=null?e.html.span(e.attr.class("bc-segmented-input__segment-after"),h.$.after):null))),...i)}function Gs(t,a,n){const r=["bc-tag-input",`bc-tag-input--${t}`];return a&&r.push("bc-tag-input--disabled"),n&&r.push("bc-tag-input--error"),r.join(" ")}function qs(t){const{values:a,onChange:n,placeholder:r="Add...",size:l="md",disabled:s=!1,maxTags:c,hasError:o=!1}=t,i=e.prop(""),u=h=>{const g=e.Value.get(a).filter(p=>p!==h);n?.(g)},m=h=>{const d=h.trim();if(!d)return;const g=e.Value.get(a),p=e.Value.get(c??1/0);g.includes(d)||g.length>=p||(n?.([...g,d]),i.set(""))},f=h=>{if(h.key==="Enter"||h.key===",")h.preventDefault(),m(i.value);else if(h.key==="Backspace"&&i.value===""){const d=e.Value.get(a);d.length>0&&u(d[d.length-1])}};return e.html.div(e.attr.class(e.computedOf(l,s,o)((h,d,g)=>Gs(h??"md",d??!1,g??!1))),e.ForEach(a,h=>e.html.span(e.attr.class("bc-tag-input__tag"),e.html.span(e.attr.class("bc-tag-input__tag-text"),h),e.When(e.computedOf(s)(d=>!(d??!1)),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-tag-input__tag-remove"),e.on.click(d=>{d.stopPropagation(),u(h.value)}),"×"),()=>e.Empty))),e.html.input(e.attr.class("bc-tag-input__input"),e.attr.type("text"),e.attr.placeholder(e.computedOf(a,r)((h,d)=>h.length===0?d??"Add...":"")),e.attr.disabled(s),e.attr.value(i),e.on.input(h=>{const d=h.target;i.set(d.value)}),e.on.keydown(f),e.on.blur(()=>{i.value.trim()&&m(i.value)})))}const Ys=t=>{const{value:a,onChange:n,onBlur:r,before:l}=t,s=e.prop(""),c=i=>{n?.(e.Value.get(a).filter(u=>u!==i))},o=()=>{const i=s.value.trim(),u=e.Value.get(a);i===""||u.includes(i)||(s.set(""),n?.([...u,i]))};return ne.InputContainer({...t,before:l??ne.InputIcon({icon:"tabler:tag",size:t.size,color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),e.ForEach(a,i=>it({variant:"light",onClose:()=>c(i.value),disabled:t.disabled},i)),e.input.text(Fe.CommonInputAttributes(t),e.attr.value(s),e.attr.class("bc-input bc-input-container__tags-input"),e.on.input(e.emitValue(i=>s.set(i))),n!=null?e.on.change(o):e.Empty,r!=null?e.on.blur(r):e.Empty))})};function Ks(t,a){const n=["bc-radio-group",`bc-radio-group--${t}`];return a&&a.length>0&&n.push(a),n.join(" ")}function Zs(t,a,n){const r=["bc-radio-group__item",`bc-radio-group__item--size-${t}`];return(a||n)&&r.push("bc-radio-group__item--disabled"),r.join(" ")}function Xs({options:t,value:a,onChange:n,name:r,disabled:l=!1,orientation:s="vertical",size:c="md",class:o}){const i=r??Te.sessionId("radio-group");return e.html.div(e.attr.class(e.computedOf(s,o)((u,m)=>Ks(u??"vertical",m))),e.attr.role("radiogroup"),e.ForEach(t,u=>{const m=u.map(h=>h.disabled??!1),f=Te.sessionId("radio");return e.html.label(e.attr.class(e.computedOf(c,l,m)((h,d,g)=>Zs(h??"md",g??!1,d??!1))),e.html.input(e.attr.type("radio"),e.attr.name(i),e.attr.id(f),e.attr.value(u.map(h=>String(h.value))),e.attr.class("bc-radio-group__input"),e.attr.checked(e.computedOf(a,u)((h,d)=>h===d.value)),e.attr.disabled(e.computedOf(l,m)((h,d)=>(h??!1)||(d??!1))),e.on.change(()=>{e.Value.get(l)||(e.Value.get(u).disabled??!1)||n?.(e.Value.get(u).value)}),e.aria.disabled(e.computedOf(l,m)((h,d)=>(h??!1)||(d??!1)))),e.html.span(e.attr.class("bc-radio-group__indicator")),e.html.span(e.attr.class("bc-radio-group__label-container"),e.html.span(e.attr.class("bc-radio-group__label"),u.map(h=>h.label)),e.html.span(e.attr.class("bc-radio-group__description"),u.map(h=>h.description??""))))}))}function wt(t,a,n){return Math.min(Math.max(t,a),n)}function Qs(t,a,n){return ae.roundToStep(Math.round((t-a)/n)*n+a,n)}function Ge(t,a,n){return n===a?0:(t-a)/(n-a)*100}function Js(t,a,n,r){const l=["bc-range-slider",`bc-range-slider--size-${t}`];return a&&l.push("bc-range-slider--disabled"),n&&l.push("bc-range-slider--readonly"),r==="vertical"&&l.push("bc-range-slider--vertical"),l.join(" ")}function ei(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return`--rs-color: ${a.backgroundColor}; --rs-color-dark: ${n.backgroundColor}`}function ti({min:t=0,max:a=100,step:n=1,disabled:r=!1,readonly:l=!1,size:s="md",color:c="primary",value:o,onChange:i,range:u,onRangeChange:m,points:f,onPointsChange:h,ticks:d,markers:g,showValue:p=!1,formatValue:b=v=>String(v),segmentStyles:y,renderThumb:k,orientation:_="horizontal"}){const v=f!=null?"multi":u!=null?"range":"single",w=v==="multi"?e.Value.get(f).length:v==="range"?2:1,I=e.Value.get(_)==="vertical",S=v==="multi"?e.Value.map(f,T=>[...T]):v==="range"?e.Value.map(u,T=>[T[0],T[1]]):e.Value.map(o??0,T=>[T]),V=e.prop(null);function D(T){if(v==="multi")h?.(T);else if(v==="range"){const W=[T[0],T[1]];W[0]>W[1]&&W.reverse(),m?.(W)}else i?.(T[0])}function $(){return!e.Value.get(r)&&!e.Value.get(l)}function x(T,W,L,J){const P=e.Value.get(t),N=e.Value.get(a),H=e.Value.get(n),X=T.getBoundingClientRect();let F;I?F=wt(1-(L-X.top)/X.height,0,1):F=wt((W-X.left)/X.width,0,1);const O=P+F*(N-P),R=wt(Qs(O,P,H),P,N),Z=e.Value.get(S);if(J!=null){const ie=[...Z];ie[J]=R,D(ie)}else{let ie=0,ye=Math.abs(Z[0]-R);for(let oe=1;oe<Z.length;oe++){const le=Math.abs(Z[oe]-R);le<ye&&(ie=oe,ye=le)}const Q=[...Z];Q[ie]=R,V.set(ie),D(Q)}}function U(T){return e.computedOf(S,t)((W,L)=>W[T]??L)}function z(T,W){const L=U(T),J=e.computedOf(L,t,a)((P,N,H)=>`${Ge(P,N,H)}%`);return e.html.div(e.attr.class("bc-range-slider__thumb-container"),I?e.style.bottom(J):e.style.left(J),e.When(p,()=>e.html.div(e.attr.class("bc-range-slider__value-label"),e.Value.map(L,P=>b(P))),()=>e.Empty),e.html.div(e.attr.class(k?"bc-range-slider__thumb-custom":"bc-range-slider__thumb"),e.attr.role("slider"),e.attr.tabindex(0),e.aria.valuemin(t),e.aria.valuemax(a),e.aria.valuenow(L),e.aria.label(`Thumb ${T+1}`),I?e.aria.orientation("vertical"):e.Empty,e.on.keydown(P=>{if(!$())return;const N=e.Value.get(t),H=e.Value.get(a),X=e.Value.get(n),F=e.Value.get(S),O=F[T];let R;switch(P.key){case"ArrowRight":case"ArrowUp":P.preventDefault(),R=wt(ae.roundToStep(O+X,X),N,H);break;case"ArrowLeft":case"ArrowDown":P.preventDefault(),R=wt(ae.roundToStep(O-X,X),N,H);break;case"Home":P.preventDefault(),R=N;break;case"End":P.preventDefault(),R=H;break;default:return}const Z=[...F];Z[T]=R,D(Z)}),e.on.pointerdown(P=>{if(P.stopPropagation(),P.preventDefault(),!$())return;V.set(T);const N=X=>{x(W,X.clientX,X.clientY,T)},H=()=>{V.set(null),window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",H)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",H)}),k?k(T,L):e.Empty))}return e.WithElement(T=>{const W=X=>{if(!$())return;X.preventDefault(),x(T,X.clientX,X.clientY,null);const F=R=>{x(T,R.clientX,R.clientY,V.value)},O=()=>{V.set(null),window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",O)},L=e.computedOf(S,t,a)((X,F,O)=>{if(I){if((v==="range"||v==="multi")&&X.length>=2){const Z=[...X].sort((Q,oe)=>Q-oe),ie=Ge(Z[0],F,O),ye=Ge(Z[Z.length-1],F,O);return`bottom: ${ie}%; height: ${ye-ie}%`}return`bottom: 0%; height: ${Ge(X[0]??F,F,O)}%`}else{if((v==="range"||v==="multi")&&X.length>=2){const Z=[...X].sort((Q,oe)=>Q-oe),ie=Ge(Z[0],F,O),ye=Ge(Z[Z.length-1],F,O);return`left: ${ie}%; width: ${ye-ie}%`}return`left: 0%; width: ${Ge(X[0]??F,F,O)}%`}}),J=y!=null?e.MapSignal(e.computedOf(S,t,a,y,c)((X,F,O,R,Z)=>({vals:X,mn:F,mx:O,styles:R,clr:Z})),({vals:X,mn:F,mx:O,styles:R,clr:Z})=>{const ie=[...X].sort((Q,oe)=>Q-oe),ye=[F,...ie,O];return e.Fragment(...ye.slice(0,-1).map((Q,oe)=>{const le=ye[oe+1],ke=R[oe],me=Ge(Q,F,O),Ie=Ge(le,F,O),j=ke?.color??Z,B=C.backgroundValue(j,"solid","light"),ee=C.backgroundValue(j,"solid","dark"),ue=ke?.thickness,te=ke?.pattern??"solid",_e=ue?`height: ${ue};`:"",De=te!=="solid"?`border-style: ${te}; background: none; border-color: ${B.backgroundColor};`:"";let Pe;I?Pe=`bottom: ${me}%; height: ${Ie-me}%;`:Pe=`left: ${me}%; width: ${Ie-me}%;`;const E=`${Pe} --rs-color: ${B.backgroundColor}; --rs-color-dark: ${ee.backgroundColor}; ${_e} ${De}`;return e.html.div(e.attr.class("bc-range-slider__fill bc-range-slider__segment"),e.attr.style(E))}))}):e.html.div(e.attr.class("bc-range-slider__fill"),e.attr.style(L)),P=Array.from({length:w},(X,F)=>z(F,T)),N=d?e.MapSignal(e.computedOf(d,t,a,n)((X,F,O,R)=>{if(X===!0){const Z=[];for(let ie=F;ie<=O;ie+=R)Z.push({value:ie});return{marks:Z,mn:F,mx:O}}return Array.isArray(X)?{marks:X,mn:F,mx:O}:{marks:[],mn:F,mx:O}}),({marks:X,mn:F,mx:O})=>X.length===0?e.Empty:e.html.div(e.attr.class("bc-range-slider__ticks"),...X.map(R=>{const Z=Ge(R.value,F,O);return e.html.div(e.attr.class("bc-range-slider__tick"),I?e.style.bottom(`${Z}%`):e.style.left(`${Z}%`),R.label!=null?e.html.span(e.attr.class("bc-range-slider__tick-label"),R.label):e.Empty)}))):e.Empty,H=g?e.MapSignal(e.computedOf(g,t,a,n)((X,F,O,R)=>{if(X===!0){const Z=[];for(let ie=F;ie<=O;ie+=R)Z.push({value:ie});return{dots:Z,mn:F,mx:O}}return Array.isArray(X)?{dots:X,mn:F,mx:O}:{dots:[],mn:F,mx:O}}),({dots:X,mn:F,mx:O})=>X.length===0?e.Empty:e.html.div(e.attr.class("bc-range-slider__markers"),...X.map(R=>{const Z=Ge(R.value,F,O);return e.html.div(e.attr.class("bc-range-slider__marker"),I?e.style.bottom(`${Z}%`):e.style.left(`${Z}%`),R.label!=null?e.html.span(e.attr.class("bc-range-slider__marker-label"),R.label):e.Empty)}))):e.Empty;return e.Fragment(e.attr.class(e.computedOf(s,r,l,_)(Js)),e.attr.style(e.Value.map(c,ei)),e.attr.role("group"),e.aria.label(v==="multi"?"Multi-point slider":v==="range"?"Range slider":"Slider"),e.on.pointerdown(W),e.html.div(e.attr.class("bc-range-slider__track"),J,H,N,...P))})}function ai(t,a){const n=["bc-otp-input",`bc-otp-input--size-${t}`];return a&&n.push("bc-otp-input--disabled"),n.join(" ")}function ni(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark"),r=new Map;return r.set("--otp-focus-color",a.backgroundColor),r.set("--otp-focus-color-dark",n.backgroundColor),r.set("--otp-focus-border",C.borderColorValue(t,"light")),r.set("--otp-focus-border-dark",C.borderColorValue(t,"dark")),Array.from(r.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function ri(t,a){return a==="numeric"?/^\d$/.test(t):/^[a-zA-Z0-9]$/.test(t)}function li({length:t=6,value:a="",onChange:n,onComplete:r,disabled:l=!1,mask:s=!1,type:c="numeric",size:o="md",color:i="primary",placeholder:u="",autoFocus:m=!1}={}){const f=Te.sessionId("otp"),h=e.computedOf(t,a)((v,w)=>{const I=new Array(v).fill("");for(let S=0;S<Math.min(w.length,v);S++)I[S]=w[S];return I}).deriveProp(),d=e.prop(null),g=[];function p(v){const w=g[v];w!=null&&(w.focus(),w.select())}function b(){const v=h.value.join("");n?.(v),v.length===t&&v.split("").every(w=>w!=="")&&r?.(v)}function y(v,w){if(e.Value.get(l))return;const I=e.Value.get(c),S=w.split("").filter(V=>ri(V,I));if(S.length>1){const V=[...h.value];for(let $=0;$<S.length&&v+$<e.Value.get(t);$++)V[v+$]=S[$];h.set(V),b();const D=Math.min(v+S.length,e.Value.get(t)-1);p(D);return}if(S.length===1){const V=[...h.value];V[v]=S[0],h.set(V),b(),v<e.Value.get(t)-1&&p(v+1)}}function k(v,w){if(!e.Value.get(l))switch(w.key){case"Backspace":{w.preventDefault();const I=[...h.value];I[v]!==""?(I[v]="",h.set(I),b()):v>0&&(I[v-1]="",h.set(I),b(),p(v-1));break}case"ArrowLeft":w.preventDefault(),v>0&&p(v-1);break;case"ArrowRight":w.preventDefault(),v<e.Value.get(t)-1&&p(v+1);break;case"Delete":{w.preventDefault();const I=[...h.value];I[v]="",h.set(I),b();break}case"Home":w.preventDefault(),p(0);break;case"End":w.preventDefault(),p(e.Value.get(t)-1);break}}function _(v,w){w.preventDefault();const I=w.clipboardData?.getData("text")??"";y(v,I)}return e.Use(C.BeatUII18n,v=>e.html.div(e.attr.class(e.computedOf(o,l)(ai)),e.attr.style(e.Value.map(i,ni)),e.attr.role("group"),e.aria.label(v.$.otpInputLabel),e.Repeat(t,w=>{const I=w.index,S=`${f}-cell-${I}`;return e.html.input(e.WithElement(V=>(g[I]=V,m&&I===0&&we.delayedAnimationFrame(()=>V.focus()),e.Empty)),e.attr.id(S),e.attr.type(e.Value.map(s,V=>V?"password":"text")),e.attr.inputmode(e.Value.map(c,V=>V==="numeric"?"numeric":"text")),e.attr.maxlength(1),e.attr.autocomplete("one-time-code"),e.attr.class("bc-otp-input__cell"),e.attr.class(d.map(V=>V===I?"bc-otp-input__cell--focused":"")),e.attr.placeholder(u),e.attr.disabled(l),e.aria.label(v.$.otpDigitLabel.map(V=>V(I+1,e.Value.get(t)))),e.attr.value(h.map(V=>V[I]??"")),e.on.focus(()=>{d.set(I);const V=g[I];V?.select()}),e.on.blur(()=>{d.set(null)}),e.on.input(V=>{const D=V.target;y(I,D.value)}),e.on.keydown(V=>k(I,V)),e.on.paste(V=>_(I,V)))})))}function Vt(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),c=Te.sessionId("time-select"),o=Te.sessionId("time-select-panel");let i,u;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),i?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-time-select ${h}`):"bc-time-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:clock",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{i=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(c),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-time-select__trigger"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!u?.contains(document.activeElement)&&!i?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ve.Flyout({content:()=>e.html.div(e.WithElement(d=>{u=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-time-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),i?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function oi(t){const{value:a,onChange:n,color:r="primary",showSeconds:l=!1,use12Hour:s,minuteStep:c,secondStep:o,showNow:i,formatTime:u,...m}=t;if(u!=null){const f=e.Value.map(a,h=>u(h));return Vt({...m,displayText:f,panelContent:gt({value:e.Value.map(a,h=>h),onSelect:h=>n?.(h),color:r,size:t.size,disabled:t.disabled,showSeconds:l,use12Hour:s,minuteStep:c,secondStep:o,showNow:i})})}return e.Use(C.Locale,({locale:f})=>{const h=s!=null?e.Value.toSignal(s):f.map(bt),d=e.Value.toSignal(l),g=e.computedOf(a,h,d)((p,b,y)=>Tt(p,b,y));return Vt({...m,displayText:g,panelContent:gt({value:e.Value.map(a,p=>p),onSelect:p=>n?.(p),color:r,size:t.size,disabled:t.disabled,showSeconds:l,use12Hour:s,minuteStep:c,secondStep:o,showNow:i})})})}function si(t){const{value:a,onChange:n,color:r="primary",showSeconds:l=!1,use12Hour:s,minuteStep:c,secondStep:o,showNow:i,formatTime:u,placeholder:m=C.defaultMessages.timeSelectTime,disabled:f,...h}=t,d=ae.NullableResetAfter(a,f,n),g=h.after!=null?e.Fragment(d,h.after):d,p=()=>gt({value:a,onSelect:b=>n?.(b),color:r,size:t.size,disabled:f,showSeconds:l,use12Hour:s,minuteStep:c,secondStep:o,showNow:i});if(u!=null){const b=e.Value.map(a,y=>y!=null?u(y):m);return Vt({...h,disabled:f,displayText:b,after:g,panelContent:p()})}return e.Use(C.Locale,({locale:b})=>{const y=s!=null?e.Value.toSignal(s):b.map(bt),k=e.Value.toSignal(l),_=e.computedOf(a,y,k)((v,w,I)=>v!=null?Tt(v,w,I):m);return Vt({...h,disabled:f,displayText:_,after:g,panelContent:p()})})}function It(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),c=Te.sessionId("date-time-select"),o=Te.sessionId("date-time-panel");let i,u;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),i?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-date-time-select ${h}`):"bc-date-time-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:calendar-clock",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{i=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(c),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-date-time-select__trigger"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!u?.contains(document.activeElement)&&!i?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ve.Flyout({content:()=>e.html.div(e.WithElement(d=>{u=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-date-time-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),i?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function ii(t){return`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function ci(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,showSeconds:c=!1,use12Hour:o,minuteStep:i,secondStep:u,showNow:m,formatDateTime:f,...h}=t;return ae.WithTemporal(d=>{const g=_=>{const v=e.Value.get(a),w=d.PlainDateTime.from({year:_.year,month:_.month,day:_.day,hour:v.hour,minute:v.minute,second:v.second});n?.(w)},p=_=>{const v=e.Value.get(a),w=d.PlainDateTime.from({year:v.year,month:v.month,day:v.day,hour:_.hour,minute:_.minute,second:_.second});n?.(w)},b=e.Value.map(a,_=>d.PlainDate.from({year:_.year,month:_.month,day:_.day})),y=e.Value.map(a,_=>d.PlainTime.from({hour:_.hour,minute:_.minute,second:_.second})),k=e.html.div(e.attr.class("bc-date-time-select__pickers"),st({value:b,onSelect:g,isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s}),e.html.div(e.attr.class("bc-date-time-select__separator")),gt({value:y,onSelect:p,color:l,size:t.size,disabled:t.disabled,showSeconds:c,use12Hour:o,minuteStep:i,secondStep:u,showNow:m}));if(f!=null){const _=e.Value.map(a,v=>f(v));return It({...h,displayText:_,panelContent:k})}return e.Use(C.Locale,({locale:_})=>{const v=o!=null?e.Value.toSignal(o):_.map(bt),w=e.Value.toSignal(c),I=e.computedOf(a,v,w)((S,V,D)=>{const $=ii(S),x=Tt(S,V,D);return`${$} · ${x}`});return It({...h,displayText:I,panelContent:k})})})}function ui(t){return`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function di(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,showSeconds:c=!1,use12Hour:o,minuteStep:i,secondStep:u,showNow:m,formatDateTime:f,placeholder:h=C.defaultMessages.dateTimeSelectDateTime,disabled:d,...g}=t,p=ae.NullableResetAfter(a,d,n),b=g.after!=null?e.Fragment(p,g.after):p;return ae.WithTemporal(y=>{const k=S=>{const V=e.Value.get(a)??y.Now.plainDateTimeISO(),D=y.PlainDateTime.from({year:S.year,month:S.month,day:S.day,hour:V.hour,minute:V.minute,second:V.second});n?.(D)},_=S=>{const V=e.Value.get(a)??y.Now.plainDateTimeISO(),D=y.PlainDateTime.from({year:V.year,month:V.month,day:V.day,hour:S.hour,minute:S.minute,second:S.second});n?.(D)},v=e.Value.map(a,S=>S!=null?y.PlainDate.from({year:S.year,month:S.month,day:S.day}):null),w=e.Value.map(a,S=>S!=null?y.PlainTime.from({hour:S.hour,minute:S.minute,second:S.second}):null),I=e.html.div(e.attr.class("bc-date-time-select__pickers"),st({value:v,onSelect:k,isDateDisabled:r,color:l,size:t.size,disabled:d,weekStartsOn:s}),e.html.div(e.attr.class("bc-date-time-select__separator")),gt({value:w,onSelect:_,color:l,size:t.size,disabled:d,showSeconds:c,use12Hour:o,minuteStep:i,secondStep:u,showNow:m}));if(f!=null){const S=e.Value.map(a,V=>V!=null?f(V):h);return It({...g,disabled:d,displayText:S,after:b,panelContent:I})}return e.Use(C.Locale,({locale:S})=>{const V=o!=null?e.Value.toSignal(o):S.map(bt),D=e.Value.toSignal(c),$=e.computedOf(a,V,D)((x,U,z)=>{if(x==null)return h;const T=ui(x),W=Tt(x,U,z);return`${T} · ${W}`});return It({...g,disabled:d,displayText:$,after:b,panelContent:I})})})}const pi=t=>{const a=new Date(t),n=a.getFullYear().toString().padStart(4,"0"),r=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0"),s=a.getHours().toString().padStart(2,"0"),c=a.getMinutes().toString().padStart(2,"0");return`${n}-${r}-${l}T${s}:${c}`},mi=t=>{const{value:a,onBlur:n,onChange:r}=t;return ae.WithTemporal(l=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,s=>pi(Number(s.epochMilliseconds)))),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(s=>r(l.Instant.from(new Date(s).toISOString())))):e.Empty)}))},hi=t=>{const a=new Date(t),n=a.getFullYear().toString().padStart(4,"0"),r=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0"),s=a.getHours().toString().padStart(2,"0"),c=a.getMinutes().toString().padStart(2,"0");return`${n}-${r}-${l}T${s}:${c}`},fi=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:c}=t,o=ae.NullableResetAfter(a,c,r??l);return ae.WithTemporal(i=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,u=>u==null?null:hi(Number(u.epochMilliseconds)))),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(u=>r(u===""?null:i.Instant.from(new Date(u).toISOString())))):e.Empty,l!=null?e.on.input(e.emitValue(u=>l(u===""?null:i.Instant.from(new Date(u).toISOString())))):e.Empty),after:s!=null?e.Fragment(o,s):o}))},gi=t=>{const{value:a,onBlur:n,onChange:r}=t;return ae.WithTemporal(l=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,s=>s.toJSON())),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(s=>{const c=l.PlainDateTime.from(s),o=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return r(l.ZonedDateTime.from({...c,timeZone:o}))})):e.Empty)}))},bi=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:c}=t,o=ae.NullableResetAfter(a,c,r??l);return ae.WithTemporal(i=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,u=>u?.toJSON())),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(u=>{if(u==="")return r(null);const m=i.PlainDateTime.from(u),f=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return r(i.ZonedDateTime.from({...m,timeZone:f}))})):e.Empty,l!=null?e.on.input(e.emitValue(u=>{if(u==="")return l(null);const m=i.PlainDateTime.from(u),f=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return l(i.ZonedDateTime.from({...m,timeZone:f}))})):e.Empty),after:s!=null?e.Fragment(o,s):o}))},vi=je.createTemporalInput({inputType:"month",valueToString:t=>t.toString(),parseValue:(t,a)=>t.PlainYearMonth.from(a)}),yi=je.createNullableTemporalInput({inputType:"month",valueToString:t=>t.toString(),parseValue:(t,a)=>t.PlainYearMonth.from(a)}),ki=t=>{const{value:a,onChange:n}=t;return ae.WithTemporal(r=>ae.MaskInput({...t,value:e.Value.map(a,l=>l.toString()),onChange:n!=null?l=>n(r.PlainMonthDay.from(`--${l}`)):void 0,onInput:void 0,mask:"99-99",placeholder:"MM-DD"}))},_i=t=>{const{after:a,disabled:n}=t,r=ae.NullableResetAfter(t.value,n,t.onChange??t.onInput);return ae.WithTemporal(l=>{const s=Fe.mapInputOptions(t,c=>c?.toString()??"",c=>c===""?null:l.PlainMonthDay.from(`--${c}`));return ae.MaskInput({...s,mask:"99-99",placeholder:"MM-DD",after:a!=null?e.Fragment(r,a):r})})};function wi(t,a,n){return e.Ensure(t.signal,()=>{const r=t.transform(l=>l,l=>l);return a(r)},n)}const Ci={filling:{type:"filling"},submitting:{type:"submitting"},error:t=>({type:"error",error:t}),success:{type:"success"}};function Si(t){return G.Mt(t)}function pa(t){return G.os(t)==="rgb8"}function mt(t){try{return pa(t)?G.vt(G.kt(t)):null}catch{return null}}class Yn extends se.Controller{constructor(a,n,r,l,s){super(a,n,r,l,s)}isValidColor=this.signal.map(Si);isValidHex=this.signal.map(pa);normalizedHex=this.signal.map(a=>mt(a)??a);setColor=a=>{if(pa(a)){const n=mt(a);if(n){this.change(n);return}}this.change(a)};setHex=a=>{const n=mt(a);n&&this.change(n)};setRgb=(a,n,r)=>{const l=c=>{const o=Math.round(Math.max(0,Math.min(255,c))).toString(16);return o.length===1?"0"+o:o},s=`#${l(a)}${l(n)}${l(r)}`;this.change(s)};getRgb=()=>{const a=this.signal.value,n=mt(a);if(!n)return null;const r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null};withFormat=a=>{const n=l=>{switch(a){case"hex":return mt(l)??l;case"rgb":const s=this.getRgb();return s?`rgb(${s.r}, ${s.g}, ${s.b})`:l;case"hsl":return l;default:return l}},r=l=>mt(l)??l;return this.transform(n,r,[`format-${a}`])}}function Vi(t){return new Yn(t.path,t.change,t.signal,t.status,{disabled:t.disabled})}function Ii(t){return{id:t.name,disabled:t.disabled,value:t.normalizedHex,hasError:t.errorVisible,onChange:t.setColor,onInput:t.setColor}}function $i(t){const a={xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)"};return a[t]??a.md}function xi({legend:t,description:a,variant:n="plain",collapsible:r=!1,defaultCollapsed:l=!1,disabled:s=!1,layout:c,labelWidth:o,size:i,gap:u="md",columns:m,minFieldWidth:f,compact:h},...d){const g=e.prop(!e.Value.get(l)),p=e.Value.map(n,y=>`bc-fieldset bc-fieldset--${y}`),b={};return c!==void 0&&(b.layout=c),o!==void 0&&(b.labelWidth=o),i!==void 0&&(b.size=i),u!==void 0&&(b.gap=u),m!==void 0&&(b.columns=m),f!==void 0&&(b.minFieldWidth=f),h!==void 0&&(b.compact=h),e.html.fieldset(e.attr.class(p),e.attr.disabled(s),t!=null?e.html.legend(e.attr.class("bc-fieldset__legend"),e.When(r,()=>e.html.button(e.attr.type("button"),e.attr.class("bc-fieldset__legend-toggle"),e.on.click(()=>g.update(y=>!y)),e.html.span(e.attr.class("bc-fieldset__legend-text"),t),C.Icon({icon:"lucide:chevron-down",size:"sm",color:"neutral"},e.attr.class(g.map(y=>`bc-fieldset__collapse-icon${y?"":" bc-fieldset__collapse-icon--collapsed"}`)))),()=>e.html.span(e.attr.class("bc-fieldset__legend-text"),t))):e.Empty,a!=null?e.html.div(e.attr.class("bc-fieldset__description"),a):e.Empty,e.Provide(se.FieldLayout,b,()=>{const y=e.html.div(e.attr.class("bc-fieldset__content"),e.attr.style(e.computedOf(u,m??void 0,f??void 0)((k,_,v)=>{const I=[`--fieldset-gap: ${$i(e.Value.get(k)??"md")}`],S=e.Value.get(_),V=e.Value.get(v);return S!=null&&S>1?I.push(`grid-template-columns: repeat(${S}, minmax(0, 1fr))`):V!=null&&I.push(`grid-template-columns: repeat(auto-fit, minmax(${V}, 1fr))`),I.join("; ")})),...d);return e.When(r,()=>e.html.div(Ot({open:g},y)),()=>y)}))}function Di({locales:t,onChange:a,updateLocale:n=!0}){return e.Use(C.BeatUII18n,r=>e.Use(C.Locale,({locale:l,setLocale:s})=>se.Field({layout:"horizontal",content:ae.Group(e.attr.class("bc-group--align-center bc-group--gap-2"),C.Icon({icon:"ic:twotone-language",size:"lg",color:"neutral",title:r.$.locale}),ae.NativeSelect({ariaLabel:r.$.locale,options:e.computedOf(t,r)((c,o)=>c.map(i=>{let m=o[i.code]??i.name;return i.nativeName!=null&&i.nativeName!==m&&(m+=` (${i.nativeName})`),We.value(i.code,m)})),value:l,onChange:c=>{n&&s(c),a?.(c)}}))})))}const Oi=()=>e.Use(C.Locale,({direction:t})=>e.Portal("body",e.attr.class(t.map(a=>`b-${a}`))));function Kn(t,a,n,r,l){const s=["bc-notification"];return t&&s.push("bc-notification--bordered"),a&&s.push("bc-notification--has-icon"),n&&s.push("bc-notification--closable"),r&&s.push("bc-notification--loading"),l&&l.length>0&&s.push(l),s.join(" ")}function Zn(t,a){return[`--notification-accent-color: ${be.getColorVar(t,500)}`,`--notification-radius: ${A.getRadiusVar(a)}`].join("; ")}function Xn({loading:t=!1,showCloseButton:a=!1,showBorder:n=!1,color:r="primary",roundedness:l="md",title:s,icon:c,onClose:o,class:i}={},...u){const m=e.Value.map(c,f=>f!=null);return e.html.section(e.attr.class(e.computedOf(n,m,a,t,i)((f,h,d,g,p)=>[Kn(f,h,d,g,p)].join(" "))),e.attr.style(e.computedOf(r,l)((f,h)=>Zn(f,h))),e.aria.live("polite"),e.aria.busy(t),e.When(t,()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__loader"),C.Icon({icon:"line-md:loading-twotone-loop",size:"lg",color:r,accessibility:"decorative"})),()=>e.When(m,()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__icon"),C.Icon({icon:c,size:"md"})),()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__accent"),e.aria.hidden(!0)))),e.html.div(e.attr.class("bc-notification__body"),s!=null?e.html.div(e.attr.class("bc-notification__title"),s):null,e.html.div(e.attr.class("bc-notification__content"),...u)),e.When(a,()=>e.html.div(e.attr.class("bc-notification__meta"),se.CloseButton({size:"sm",color:r,onClick:o}))))}let Ti=0;class Pi{handles=[];attach(a){return this.detach(a),this.handles.push(a),()=>this.detach(a)}detach(a){const n=this.handles.lastIndexOf(a);n>=0&&this.handles.splice(n,1)}get current(){const a=this.handles[this.handles.length-1];if(!a)throw new Error("NotificationService: no provider attached. Ensure BeatUI includes notifications or attach the provider manually.");return a}show(a,...n){return this.current.show(a,...n)}clear(){this.current.clear()}}const Qn=new Pi,Ea={mark:e.makeProviderMark("NotificationProvider"),create:({position:t="bottom-end"}={})=>{const a=e.prop(0),n=e.prop([]),r=[];function l(m){return r.push(m),()=>{const f=r.lastIndexOf(m);f>=0&&r.splice(f,1)}}const s=m=>{n.update(f=>f.filter(h=>h.id!==m)),a.update(f=>Math.max(0,f-1))},c=[],o=({dismissAfter:m,onClose:f,animation:h={fade:!0},...d},...g)=>{const p=`notification-${++Ti}`;a.update(k=>k+1);const b=m!=null?typeof m=="number"?we.sleep(m*1e3):m:void 0,y={id:p,animation:h,class:e.Value.toSignal(d.class),loading:e.Value.toSignal(d.loading??!1),showCloseButton:e.Value.toSignal(d.showCloseButton==null&&m==null?!0:d.showCloseButton??!0),showBorder:e.Value.toSignal(d.showBorder??!1),color:e.Value.toSignal(d.color??"primary"),roundedness:e.Value.toSignal(d.roundedness??"md"),title:d.title??e.Empty,icon:e.Value.toSignal(d.icon),children:g,listenRequestClose:k=>(c.push(k),f?.(),()=>{}),delayedClose:b};n.update(k=>[...k,y]),r.forEach(k=>k(y))},i=()=>{c.forEach(m=>m()),c.length=0,n.set([]),a.set(0)},u=Qn.attach({show:o,clear:i});return{value:{activeNotifications:a,entries:n,removeEntry:s,show:o,clear:i,position:t,listenOnShow:l},dispose:()=>{u(),i()}}}};function Jn(){return e.Use(Ea,({listenOnShow:t,position:a})=>e.Portal("body",e.html.div(e.attr.class("bc-notification-viewport"),e.attr.class(`bc-notification-viewport--${a}`),e.WithBrowserCtx(n=>e.OnDispose(t(r=>{const l=[],s=e.html.div(He.AnimatedToggle({animation:r.animation,initialStatus:"start-opening"},({close:c,listenOnClosed:o})=>(r.delayedClose?.finally(c),o(()=>{l.forEach(i=>i())}),Xn({class:r.class,loading:r.loading,showCloseButton:r.showCloseButton,showBorder:r.showBorder,color:r.color,roundedness:r.roundedness,title:r.title,icon:r.icon,onClose:c},...r.children))));l.push(e.renderWithContext(s,n))}))))))}function Ei({includeAuthI18n:t=!1,enableAppearance:a=!0,defaultAppearance:n="system",appearancePreferenceKey:r="bui-appearance",includeNotifications:l=!0,notificationPosition:s="bottom-end"},...c){return e.WithProvider(({set:o,use:i})=>{o(Ce.Location,{}),o(C.Locale,{}),o(C.BeatUII18n,{}),o(Ct.Theme,{defaultAppearance:a?n:"light",appearancePreferenceKey:r}),o(e.ReducedMotion,void 0),l&&o(Ea,{position:s}),Ce.NavigationService.attach(i(Ce.Location));const u=e.Fragment(a?Ct.ThemeAppearance():e.Empty,Oi(),l?Jn():e.Empty,...c);return t?e.Task(()=>Promise.resolve().then(()=>require("./translations-BqWc0ZHz.cjs")).then(m=>m.translations),({AuthI18n:m})=>e.Provide(m,{},()=>u)):u})}function Fi({content:t,toolbar:a=!0,page:n,zoom:r,view:l,pagemode:s,scrollbar:c=!0,navpanes:o=!0,search:i,nameddest:u,viewrect:m,highlight:f,allowfullscreen:h=!1}){const d=e.Value.toSignal(t).mapAsync(async p=>{if(p instanceof Blob){const b=await p.arrayBuffer(),y=new Blob([b],{type:"application/pdf"});return URL.createObjectURL(y)}else{if(p instanceof ArrayBuffer)return URL.createObjectURL(new Blob([p],{type:"application/pdf"}));if(p instanceof Uint8Array)return URL.createObjectURL(new Blob([new Uint8Array(p)],{type:"application/pdf"}));if(typeof p=="string"){const y=await(await fetch(p)).arrayBuffer(),k=new Blob([y],{type:"application/pdf"});return URL.createObjectURL(k)}}},null),g=e.computedOf(d,a,n,r,l,s,c,o,i,u,m,f)((p,b,y,k,_,v,w,I,S,V,D,$)=>{if(p==null)return null;const x=[];b===!1&&x.push("toolbar=0"),y!=null&&y>0&&x.push(`page=${y}`),k!=null&&k>0&&x.push(`zoom=${k}`),_!=null&&x.push(`view=${_}`),v!=null&&x.push(`pagemode=${v}`),w===!1&&x.push("scrollbar=0"),I===!1&&x.push("navpanes=0"),S!=null&&x.push(`search=${encodeURIComponent(S)}`),V!=null&&x.push(`nameddest=${encodeURIComponent(V)}`),D!=null&&x.push(`viewrect=${encodeURIComponent(D)}`),$!=null&&x.push(`highlight=${encodeURIComponent($)}`);const U=x.join("&");return U?`${p}#${U}`:p});return d.on((p,b)=>{b!=null&&URL.revokeObjectURL(b)}),e.Use(C.BeatUII18n,p=>e.html.div(e.OnDispose(()=>{const b=d.value;b!=null&&URL.revokeObjectURL(b)}),e.attr.class("h-full w-full"),e.html.iframe(e.attr.class("h-full w-full"),e.attr.allowfullscreen(h),e.attr.title(p.$.pdfPreview),e.attr.loading("lazy"),e.WithElement(b=>{const y=b;let k=!0;return g.on(_=>{_!=null&&(k?(y.src=_,k=!1):(y.src="about:blank",setTimeout(()=>{y.src=_},50)))}),e.Empty}))))}function Li({content:t,page:a,zoom:n,pagemode:r,nameddest:l,search:s,textLayerMode:c,sidebarViewOnLoad:o,scrollModeOnLoad:i,spreadModeOnLoad:u,enableScripting:m,enablePrinting:f,viewerUrl:h=null,allowfullscreen:d=!0,class:g=null}){const p=e.Value.toSignal(t).mapAsync(async y=>{if(y instanceof Blob)return URL.createObjectURL(y);if(y instanceof ArrayBuffer)return URL.createObjectURL(new Blob([y],{type:"application/pdf"}));if(y instanceof Uint8Array)return URL.createObjectURL(new Blob([new Uint8Array(y)],{type:"application/pdf"}));if(typeof y=="string")return y},null),b=e.computedOf(p,h,a,n,r,l,s,c,o,i,u,m,f)((y,k,_,v,w,I,S,V,D,$,x,U,z)=>{if(y==null)return null;const T=k??"https://mozilla.github.io/pdf.js/web/viewer.html",W=new URLSearchParams;W.set("file",y);const L=[];_!=null&&_>0&&L.push(`page=${_}`),v!=null&&(typeof v=="string"?L.push(`zoom=${v}`):L.push(`zoom=${v}`)),w!=null&&L.push(`pagemode=${w}`),I!=null&&L.push(`nameddest=${encodeURIComponent(I)}`),S!=null&&L.push(`search=${encodeURIComponent(S)}`),V!=null&&L.push(`textLayer=${V}`),D!=null&&L.push(`sidebar=${D}`),$!=null&&L.push(`scrollMode=${$}`),x!=null&&L.push(`spreadMode=${x}`),U!=null&&L.push(`enableScripting=${U?"1":"0"}`),z!=null&&L.push(`enablePrinting=${z?"1":"0"}`);const J=L.length>0?`#${L.join("&")}`:"";return`${T}?${W.toString()}${J}`});return p.on((y,k)=>{k!=null&&k.startsWith("blob:")&&URL.revokeObjectURL(k)}),e.Use(C.BeatUII18n,y=>e.html.div(e.OnDispose(()=>{const k=p.value;k!=null&&k.startsWith("blob:")&&URL.revokeObjectURL(k)}),e.attr.class("bc-pdfjs-preview h-full w-full"),e.attr.class(g),e.html.iframe(e.attr.class("h-full w-full"),e.attr.allowfullscreen(d),e.attr.title(y.$.pdfPreview),e.attr.loading("lazy"),e.attr.src(b))))}function Ne(t){return t!==void 0?e.Value.get(t):void 0}function Ai(t){const a={},n=Ne(t.style),r=Ne(t.currency),l=Ne(t.currencyDisplay),s=Ne(t.signDisplay),c=Ne(t.notation),o=Ne(t.compactDisplay),i=Ne(t.unit),u=Ne(t.unitDisplay),m=Ne(t.useGrouping),f=Ne(t.minimumIntegerDigits),h=Ne(t.minimumFractionDigits),d=Ne(t.maximumFractionDigits),g=Ne(t.minimumSignificantDigits),p=Ne(t.maximumSignificantDigits);return n!==void 0&&(a.style=n),r!==void 0&&(a.currency=r),l!==void 0&&(a.currencyDisplay=l),s!==void 0&&(a.signDisplay=s),c!==void 0&&(a.notation=c),o!==void 0&&(a.compactDisplay=o),i!==void 0&&(a.unit=i),u!==void 0&&(a.unitDisplay=u),m!==void 0&&(a.useGrouping=m),f!==void 0&&(a.minimumIntegerDigits=f),h!==void 0&&(a.minimumFractionDigits=h),d!==void 0&&(a.maximumFractionDigits=d),g!==void 0&&(a.minimumSignificantDigits=g),p!==void 0&&(a.maximumSignificantDigits=p),a}function Bi(t,a,n){return new Intl.NumberFormat(a,n).format(t)}function Mi(t){const{value:a,locale:n}=t,r=(l,s)=>{const c=Ai(t);return new Intl.NumberFormat(l,c).format(s)};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-number"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-number"),s)})}function Ye(t){return t!==void 0?e.Value.get(t):void 0}function Ni(t){const a={},n=Ye(t.style),r=Ye(t.currency),l=Ye(t.currencyDisplay),s=Ye(t.signDisplay),c=Ye(t.unit),o=Ye(t.unitDisplay),i=Ye(t.useGrouping),u=Ye(t.minimumIntegerDigits),m=Ye(t.minimumFractionDigits),f=Ye(t.maximumFractionDigits);return n!==void 0&&(a.style=n),r!==void 0&&(a.currency=r),l!==void 0&&(a.currencyDisplay=l),s!==void 0&&(a.signDisplay=s),c!==void 0&&(a.unit=c),o!==void 0&&(a.unitDisplay=o),i!==void 0&&(a.useGrouping=i),u!==void 0&&(a.minimumIntegerDigits=u),m!==void 0&&(a.minimumFractionDigits=m),f!==void 0&&(a.maximumFractionDigits=f),a}function Wi(t,a,n){return new Intl.NumberFormat(a,n).format(t)}function Ui(t){const{value:a,locale:n}=t,r=(l,s)=>{const c=Ni(t);return new Intl.NumberFormat(l,c).format(s)};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-bigint"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-bigint"),s)})}function er(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function tr(t){return t instanceof Date?t:new Date(t)}function tt(t){return t!==void 0?e.Value.get(t):void 0}function Ri(t){const a={},n=tt(t.dateStyle),r=tt(t.calendar),l=tt(t.numberingSystem),s=tt(t.timeZone),c=tt(t.weekday),o=tt(t.year),i=tt(t.month),u=tt(t.day),m=tt(t.era);return c!==void 0||o!==void 0||i!==void 0||u!==void 0||m!==void 0?(c!==void 0&&(a.weekday=c),o!==void 0&&(a.year=o),i!==void 0&&(a.month=i),u!==void 0&&(a.day=u),m!==void 0&&(a.era=m)):a.dateStyle=n??"medium",r!==void 0&&(a.calendar=r),l!==void 0&&(a.numberingSystem=l),s!==void 0&&(a.timeZone=s),a}function zi(t,a,n){return er(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(tr(t))}function Hi(t){const{value:a,locale:n}=t,r=(l,s)=>{const c=Ri(t);return er(s)?s.toLocaleString(l,c):new Intl.DateTimeFormat(l,c).format(tr(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-date"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-date"),s)})}function ar(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function nr(t){return t instanceof Date?t:new Date(t)}function Ke(t){return t!==void 0?e.Value.get(t):void 0}function ji(t){const a={},n=Ke(t.timeStyle),r=Ke(t.timeZone),l=Ke(t.hour12),s=Ke(t.hourCycle),c=Ke(t.hour),o=Ke(t.minute),i=Ke(t.second),u=Ke(t.fractionalSecondDigits),m=Ke(t.timeZoneName),f=Ke(t.dayPeriod);return c!==void 0||o!==void 0||i!==void 0||u!==void 0||m!==void 0||f!==void 0?(c!==void 0&&(a.hour=c),o!==void 0&&(a.minute=o),i!==void 0&&(a.second=i),u!==void 0&&(a.fractionalSecondDigits=u),m!==void 0&&(a.timeZoneName=m),f!==void 0&&(a.dayPeriod=f)):a.timeStyle=n??"medium",r!==void 0&&(a.timeZone=r),l!==void 0&&(a.hour12=l),s!==void 0&&(a.hourCycle=s),a}function Gi(t,a,n){return ar(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(nr(t))}function qi(t){const{value:a,locale:n}=t,r=(l,s)=>{const c=ji(t);return ar(s)?s.toLocaleString(l,c):new Intl.DateTimeFormat(l,c).format(nr(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-time"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-time"),s)})}function rr(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function lr(t){return t instanceof Date?t:new Date(t)}function ht(t){return t!==void 0?e.Value.get(t):void 0}function Yi(t){const a=ht(t.dateStyle),n=ht(t.timeStyle),r=ht(t.timeZone),l=ht(t.calendar),s=ht(t.hour12),c=ht(t.hourCycle),o={dateStyle:a??"medium",timeStyle:n??"short"};return r!==void 0&&(o.timeZone=r),l!==void 0&&(o.calendar=l),s!==void 0&&(o.hour12=s),c!==void 0&&(o.hourCycle=c),o}function Ki(t,a,n){return rr(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(lr(t))}function Zi(t){const{value:a,locale:n}=t,r=(l,s)=>{const c=Yi(t);return rr(s)?s.toLocaleString(l,c):new Intl.DateTimeFormat(l,c).format(lr(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-date-time"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-date-time"),s)})}function Xi(t,a,n,r){return new Intl.RelativeTimeFormat(n,r).format(t,a)}function Qi(t){const{value:a,unit:n,locale:r}=t,l=c=>c!==void 0?e.Value.get(c):void 0,s=(c,o,i)=>{const u={},m=l(t.numeric),f=l(t.style);return m!==void 0&&(u.numeric=m),f!==void 0&&(u.style=f),new Intl.RelativeTimeFormat(c,u).format(o,i)};if(r!==void 0){const c=e.computedOf(r,a,n)(s);return e.html.span(e.attr.class("bc-format-relative-time"),c)}return e.Use(C.Locale,({locale:c})=>{const o=e.computedOf(c,a,n)(s);return e.html.span(e.attr.class("bc-format-relative-time"),o)})}const or=Intl.ListFormat;function Ji(t,a,n){return new or(a,n).format(t)}function ec(t){const{value:a,locale:n}=t,r=s=>s!==void 0?e.Value.get(s):void 0,l=(s,c)=>{const o={},i=r(t.type),u=r(t.style);return i!==void 0&&(o.type=i),u!==void 0&&(o.style=u),new or(s,o).format(c)};if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-list"),s)}return e.Use(C.Locale,({locale:s})=>{const c=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-list"),c)})}function tc(t,a,n,r){return new Intl.DisplayNames(n,{type:a,style:r?.style,languageDisplay:a==="language"?r?.languageDisplay:void 0,fallback:r?.fallback}).of(t)??t}function ac(t){const{value:a,locale:n}=t,r=s=>s!==void 0?e.Value.get(s):void 0,l=(s,c)=>{const o=e.Value.get(t.type),i=r(t.style),u=r(t.languageDisplay),m=r(t.fallback);return new Intl.DisplayNames(s,{type:o,style:i,languageDisplay:o==="language"?u:void 0,fallback:m}).of(c)??c};if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-display-name"),s)}return e.Use(C.Locale,({locale:s})=>{const c=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-display-name"),c)})}function sr(t,a,n){return new Intl.PluralRules(a,n).select(t)}function nc(t,a,n,r){const l=sr(t,n,r),s=a[l]??a.other,c=new Intl.NumberFormat(n).format(t);return s.replace(/\{count\}/g,c)}function rc(t){const{value:a,messages:n,locale:r}=t,l=c=>c!==void 0?e.Value.get(c):void 0,s=(c,o)=>{const i={},u=l(t.type),m=l(t.minimumIntegerDigits),f=l(t.minimumFractionDigits),h=l(t.maximumFractionDigits),d=l(t.minimumSignificantDigits),g=l(t.maximumSignificantDigits);u!==void 0&&(i.type=u),m!==void 0&&(i.minimumIntegerDigits=m),f!==void 0&&(i.minimumFractionDigits=f),h!==void 0&&(i.maximumFractionDigits=h),d!==void 0&&(i.minimumSignificantDigits=d),g!==void 0&&(i.maximumSignificantDigits=g);const p=new Intl.PluralRules(c,i).select(o),b=n[p]??n.other,y=new Intl.NumberFormat(c).format(o);return b.replace(/\{count\}/g,y)};if(r!==void 0){const c=e.computedOf(r,a)(s);return e.html.span(e.attr.class("bc-format-plural"),c)}return e.Use(C.Locale,({locale:c})=>{const o=e.computedOf(c,a)(s);return e.html.span(e.attr.class("bc-format-plural"),o)})}function lc(t){const{value:a,locale:n,units:r}=t,l=(s,c)=>C.formatFileSize(c,{locale:s,units:r,decimalPlaces:t.decimalPlaces!==void 0?e.Value.get(t.decimalPlaces):void 0});if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-file-size"),s)}return e.Use(C.Locale,({locale:s})=>{const c=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-file-size"),c)})}function oc(t,a){const n=["bc-empty-state",`bc-empty-state--size-${t}`];return a&&a.length>0&&n.push(a),n.join(" ")}function sc({icon:t,title:a,description:n,size:r="md",action:l,class:s}){return e.html.div(e.attr.class(e.computedOf(r,s)((c,o)=>oc(c??"md",o))),e.Ensure(t,c=>e.html.div(e.attr.class("bc-empty-state__icon"),C.Icon({icon:c,size:e.Value.map(r,o=>{const i=o??"md";return i==="sm"?"lg":"xl"}),accessibility:"decorative"}))),e.html.h3(e.attr.class("bc-empty-state__title"),a),e.Ensure(n,c=>e.html.p(e.attr.class("bc-empty-state__description"),c)),l!=null?e.html.div(e.attr.class("bc-empty-state__action"),l):e.Empty)}const ic=({id:t,css:a})=>e.Portal("head",e.html.style(e.attr.id(t),e.attr.innerHTML(a)));function Ze(t,a){return a==null?null:e.html.meta(e.attr.name(t),e.attr.content(e.Value.map(a,n=>String(n))))}function Se(t,a){return a==null?null:e.html.meta(e.attr.property(t),e.attr.content(e.Value.map(a,n=>String(n))))}function Ut(t,a){return a==null?null:e.ForEach(a,n=>Se(t,n))}function cc(t,a){return a==null?null:e.When(e.Value.map(a,n=>Array.isArray(n)),()=>Ut(t,a),()=>Se(t,a))}const uc=t=>{const a=[];if(a.push(Se("og:title",t.title)),a.push(Se("og:type",t.type)),a.push(Se("og:url",t.url)),a.push(Se("og:image",t.image)),a.push(Se("og:description",t.description)),a.push(Se("og:site_name",t.siteName)),a.push(Se("og:locale",t.locale)),t.localeAlternate!=null){const n=Ut("og:locale:alternate",t.localeAlternate);n!=null&&a.push(n)}if(a.push(Se("og:image:alt",t.imageAlt)),a.push(Se("og:image:width",t.imageWidth)),a.push(Se("og:image:height",t.imageHeight)),a.push(Se("og:image:type",t.imageType)),t.images!=null){const n=Ut("og:image",t.images);n!=null&&a.push(n)}if(a.push(Se("og:video",t.video)),a.push(Se("og:video:type",t.videoType)),a.push(Se("og:video:width",t.videoWidth)),a.push(Se("og:video:height",t.videoHeight)),a.push(Se("og:video:secure_url",t.videoSecureUrl)),a.push(Se("og:audio",t.audio)),a.push(Se("og:audio:type",t.audioType)),a.push(Se("og:audio:secure_url",t.audioSecureUrl)),a.push(Se("article:published_time",t.publishedTime)),a.push(Se("article:modified_time",t.modifiedTime)),a.push(Se("article:expiration_time",t.expirationTime)),a.push(cc("article:author",t.author)),a.push(Se("article:section",t.section)),t.tags!=null){const n=Ut("article:tag",t.tags);n!=null&&a.push(n)}return a.push(Se("profile:first_name",t.firstName)),a.push(Se("profile:last_name",t.lastName)),a.push(Se("profile:username",t.username)),a.push(Se("profile:gender",t.gender)),a.push(Ze("twitter:card",t.twitterCard)),a.push(Ze("twitter:site",t.twitterSite)),a.push(Ze("twitter:creator",t.twitterCreator)),a.push(Ze("twitter:title",e.coalesce(t.twitterTitle,t.title))),a.push(Ze("twitter:description",e.coalesce(t.twitterDescription,t.description))),a.push(Ze("twitter:image",e.coalesce(t.twitterImage,t.image))),a.push(Ze("twitter:image:alt",e.coalesce(t.twitterImageAlt,t.imageAlt))),t.canonical!=null&&e.Value.get(t.canonical)!=null&&a.push(e.html.link(e.attr.rel("canonical"),e.attr.href(t.canonical))),a.push(Ze("robots",t.robots)),a.push(Ze("keywords",t.keywords)),a.push(Ze("author",t.metaAuthor)),e.Portal("head",a.filter(n=>n!=null).flat())};function dc(t){const{items:a,onMarkAllRead:n,onClose:r}=t,l=e.computedOf(a)(s=>s.filter(c=>!c.read).length);return e.Use(C.BeatUII18n,s=>e.html.div(e.attr.class("bc-notification-panel"),e.html.div(e.attr.class("bc-notification-panel__header"),e.html.div(e.attr.class("bc-notification-panel__header-title"),e.html.span(s.$.notifications),e.When(e.computedOf(l)(c=>c>0),()=>it({color:"primary",size:"xs",circle:!0},l.map(String)))),e.html.div(e.attr.class("bc-notification-panel__header-actions"),n?e.html.button(e.attr.class("bc-notification-panel__mark-read-btn"),e.attr.type("button"),e.on.click(()=>n()),s.$.markAllAsRead):e.Empty,r?e.html.button(e.attr.class("bc-notification-panel__close-btn"),e.attr.type("button"),e.on.click(()=>r()),C.Icon({icon:"lucide:x",size:"sm"})):e.Empty)),e.html.div(e.attr.class("bc-notification-panel__list"),e.ForEach(a,c=>e.html.div(e.attr.class(c.map(o=>o.read?"bc-notification-panel__item":"bc-notification-panel__item bc-notification-panel__item--unread")),e.on.click(()=>c.value.onClick?.()),e.html.div(e.attr.class("bc-notification-panel__item-icon"),e.attr.style(c.map(o=>o.iconColor?`background: ${o.iconColor}14; color: ${o.iconColor}`:"")),C.Icon({icon:c.$.icon,size:"sm"})),e.html.div(e.attr.class("bc-notification-panel__item-content"),e.html.div(e.attr.class("bc-notification-panel__item-title"),c.$.title),e.html.div(e.attr.class("bc-notification-panel__item-body"),c.$.body),e.html.div(e.attr.class("bc-notification-panel__item-meta"),e.html.span(c.$.time),e.When(c.map(o=>o.source!==void 0),()=>e.html.span(e.attr.class("bc-notification-panel__item-source"),c.map(o=>o.source?.label??""))))),e.When(c.map(o=>!o.read),()=>e.html.span(e.attr.class("bc-notification-panel__item-dot"))))),e.When(e.computedOf(a)(c=>c.length===0),()=>e.html.div(e.attr.class("bc-notification-panel__empty"),C.Icon({icon:"lucide:bell-off",size:"lg"}),e.html.div(s.$.noNotifications))))))}function pc(t){return["bc-breadcrumbs",`bc-breadcrumbs--size-${t}`].join(" ")}function mc(t,a){if(t.length<=a)return t;const n=t[0],r=t.slice(-(a-1));return[n,{isEllipsis:!0},...r]}function hc({items:t,separator:a="›",maxItems:n,size:r="md"}){const l=n!=null?e.computedOf(t,n)((s,c)=>c&&c>0?mc(s,c):s):e.Value.map(t,s=>s);return e.Use(C.BeatUII18n,s=>e.html.nav(e.attr.class(e.Value.map(r,c=>pc(c??"md"))),e.aria.label(s.$.breadcrumbs),e.html.ol(e.attr.class("bc-breadcrumbs__list"),e.ForEach(l,c=>{const o=c.map(u=>"isEllipsis"in u&&u.isEllipsis===!0),i=c.map(u=>!("isEllipsis"in u)&&u.current===!0);return e.When(o,()=>e.html.li(e.attr.class("bc-breadcrumbs__item bc-breadcrumbs__ellipsis"),e.aria.hidden(!0),"..."),()=>{const u=c.map(d=>!("isEllipsis"in d)&&d.href!=null),m=c.map(d=>!("isEllipsis"in d)&&d.href==null&&d.onClick!=null),f=c.map(d=>!("isEllipsis"in d)&&d.icon!=null),h=d=>[e.attr.class(d),e.When(f,()=>C.Icon({icon:c.map(g=>"isEllipsis"in g?"":g.icon??""),size:r,accessibility:"decorative"})),e.html.span(c.map(g=>"isEllipsis"in g?"":g.label))];return e.html.li(e.attr.class(e.Value.map(i,d=>d?"bc-breadcrumbs__item bc-breadcrumbs__item--current":"bc-breadcrumbs__item")),e.When(i,()=>e.aria.current("page")),e.When(u,()=>e.html.a(e.attr.href(c.map(d=>"isEllipsis"in d?"":d.href??"")),...h("bc-breadcrumbs__link")),()=>e.When(m,()=>e.html.button(e.attr.type("button"),e.on.click(()=>{const d=e.Value.get(c);"isEllipsis"in d||d.onClick?.()}),...h("bc-breadcrumbs__button")),()=>e.html.span(...h("bc-breadcrumbs__text")))))})},()=>e.html.li(e.attr.class("bc-breadcrumbs__separator"),e.aria.hidden(!0),a)))))}const Fa=({viewTransition:t,state:a,scroll:n,replace:r})=>{const l={};return a!==void 0&&(l.state=a),n!==void 0&&(l.scroll=n),r!==void 0&&(l.replace=r),t!==void 0&&(l.viewTransition=t),l};function ma(t,a){const n=["bc-link"];if(a)n.push("bc-link--disabled");else switch(t){case"plain":n.push("bc-link--plain");break;case"hover":n.push("bc-link--hover");break;default:n.push("bc-link--default");break}return n.join(" ")}function ha(t){const a=C.textColorValue(t,"light"),n=C.textColorValue(t,"dark");return[`--link-color: ${a}`,`--link-color-dark: ${n}`,`--link-hover-color: ${a}`,`--link-hover-color-dark: ${n}`].join("; ")}function ir({href:t,variant:a="default",color:n="primary",colorDisabled:r="base",disabled:l=!1,viewTransition:s=!0,state:c,scroll:o,replace:i,target:u,rel:m},...f){return e.When(l,()=>e.html.span(e.attr.class(e.computedOf(a,l)((h,d)=>ma(h,d))),e.attr.style(e.computedOf(r)(h=>ha(h??"base"))),...f),()=>Ce.Anchor({href:t,...Fa({viewTransition:s,state:c,scroll:o,replace:i})},e.attr.class(e.computedOf(a,l)((h,d)=>ma(h,d))),e.attr.style(e.computedOf(n)(h=>ha(h??"primary"))),u?e.attr.target(u):null,m?e.attr.rel(m):null,...f))}const fc=t=>t?t.startsWith("#")?t:`#${t}`:"",gc=t=>{if(!t)return new URLSearchParams;if(typeof t=="string"){const a=t.startsWith("?")?t.slice(1):t;return new URLSearchParams(a)}return t instanceof URLSearchParams?new URLSearchParams(t):new URLSearchParams(t)};function cr(t,a,n){const r=gc(t.search),l=r.toString(),s=l?`?${l}`:"",c=fc(t.hash);switch(n){case"exact":return t.pathname+s+c===a;case"prefix":return t.pathname.startsWith(a)||(t.pathname+s).startsWith(a);case"params":try{const o=typeof document<"u"&&document.baseURI?document.baseURI:"http://localhost/",i=new URL(a,o);if(t.pathname!==i.pathname)return!1;const u=Array.from(new URLSearchParams(i.search).entries()).sort(),m=Array.from(r.entries()).sort();return u.length!==m.length?!1:u.every(([f,h],d)=>{const[g,p]=m[d];return f===g&&h===p})}catch{return t.pathname===a}default:return!1}}function qt(t,a){return a==="exact"?e.computedOf(t)(n=>n):e.computedOf(t)(n=>r=>cr(r,n,a))}function bc({href:t,matchMode:a="exact",disableWhenActive:n=!0,...r},...l){return e.Use(Ce.Location,s=>{const c=s.matchSignal(qt(t,a)),o=e.computedOf(c,n)((i,u)=>u??!0?i:!1);return ir({...r,href:t,disabled:o},...l)})}function vc({href:t,viewTransition:a=!0,state:n,scroll:r,replace:l,target:s,rel:c,matchMode:o,disableWhenActive:i,variant:u="filled",size:m="md",color:f="base",roundedness:h="sm",disabled:d=!1},...g){return o!==void 0||i!==void 0?e.Use(Ce.Location,p=>{const b=o!==void 0?p.matchSignal(qt(t,o)):e.computedOf(p.location)(()=>!1),y=e.computedOf(b,i)((_,v)=>!(v??!0)||!o?!1:_),k=e.computedOf(d,y)((_,v)=>_||v);return Qa({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:c,variant:u,size:m,color:f,roundedness:h,disabled:k},...g)}):Qa({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:c,variant:u,size:m,color:f,roundedness:h,disabled:d},...g)}function Qa({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:c,variant:o="default",size:i="md",color:u="base",roundedness:m="sm",disabled:f=!1,fullWidth:h=!1,loading:d=!1},...g){return e.When(f??!1,()=>e.html.span(e.attr.class(e.computedOf(i,m,d,h)(ne.generateButtonClasses)),e.attr.style(e.computedOf(o,u,f)((p,b,y)=>ne.generateButtonStyles(p??"filled",b??"base",y))),...g),()=>Ce.Anchor({href:t,...Fa({viewTransition:a,state:n,scroll:r,replace:l})},e.attr.class(e.computedOf(i,m,d,h)(ne.generateButtonClasses)),e.attr.style(e.computedOf(o,u,f)((p,b,y)=>ne.generateButtonStyles(p??"filled",b??"base",y))),s?e.attr.target(s):null,c?e.attr.rel(c):null,...g))}const ur={mark:e.makeProviderMark("SidebarContext"),create:t=>({value:{backgroundMode:"light"},dispose:()=>{}})};function yc({backgroundMode:t="light"},...a){return e.Provide(ur,e.Value.map(t,n=>({backgroundMode:n})),()=>e.html.div(e.attr.class("bc-sidebar"),e.attr.class(e.Value.map(t,n=>n==="dark"?"bc-sidebar--dark-bg":"")),...a))}function fa({rail:t,header:a},...n){return Je.Stack(a!=null?e.html.div(e.attr.class("bc-sidebar-group__header"),a):null,e.html.div(e.attr.class(e.Value.map(t??!1,r=>r?"bc-sidebar-group--rail":"")),e.attr.class("bc-sidebar-group"),...n))}function dr(t,...a){const n=Fa({viewTransition:t.viewTransition??!0,state:t.state,scroll:t.scroll,replace:t.replace});return Ce.Anchor({href:t.href,...n},...a)}function pr(...t){return e.html.span(...t)}function mr(t,...a){return e.html.button(e.attr.type("button"),e.on.click(t.onClick),t.ariaExpanded!=null?e.aria.expanded(e.Value.map(t.ariaExpanded,n=>n)):null,t.ariaControls!=null?e.aria.controls(t.ariaControls):null,t.ariaLabel!=null?e.aria.label(t.ariaLabel):null,...a)}function hr(t){const a=[e.attr.class("bc-sidebar-link")];return t.icon!=null&&a.push(e.html.span(e.attr.class("bc-sidebar-link--icon"),C.Icon({icon:t.icon}))),a.push(e.html.span(e.attr.class("bc-sidebar-link__content"),t.content)),t.after!=null&&a.push(e.html.span(e.attr.class("bc-sidebar-link__right"),t.after)),t.action!=null&&a.push(e.html.button(e.attr.type("button"),e.attr.class("bc-sidebar-link--action"),e.on.click((n,r)=>{t.action?.onClick?.(r)}),C.Icon({icon:t.action?.icon}))),"onClick"in t?mr(t,...a):e.Use(Ce.Location,n=>{const r=n.matchSignal(qt(t.href,"exact"),{includeSearch:!1,includeHash:!1});return e.When(r,()=>pr(...a),()=>dr(t,...a))})}function kc({rail:t=!0,icon:a,header:n,startOpen:r=!0},...l){const s=e.Value.deriveProp(r),c=Te.sessionId("sidebar-group"),o=`${c}-content`;return fa({},e.attr.class("bc-sidebar-group-collapsible"),e.attr.class(s.map(i=>i?"bc-sidebar-group-collapsible--open":"bc-sidebar-group-collapsible--closed")),e.attr.role("group"),e.attr.id(c),hr({icon:a,onClick:()=>s.update(i=>!i),ariaExpanded:s,ariaControls:o,after:e.html.span(e.attr.class("bc-sidebar-group-collapsible-indicator"),C.Icon({icon:"lucide:chevron-down",color:"base",size:"xs"})),content:n}),fa({rail:t},e.attr.id(o),Ot({open:s},...l)))}function _c(){return e.html.hr(e.attr.class("bc-sidebar-separator"))}function wc(t,a,n,r){const l=["bc-tabs",`bc-tabs--${t}`,`bc-tabs--${a}`];return n&&l.push("bc-tabs--disabled"),r!=null&&r!=="default"&&l.push(`bc-tabs--variant-${r}`),l.join(" ")}function Cc(t,a){const n=new Map,r=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-600)":be.getColorVar(a,600),l=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-400)":be.getColorVar(a,400),s=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-500)":be.getColorVar(a,500),c=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-400)":be.getColorVar(a,400);if(n.set("--tabs-active-color",r),n.set("--tabs-active-color-dark",l),n.set("--tabs-indicator-color",s),n.set("--tabs-indicator-color-dark",c),t==="filled"){const o=C.backgroundValue(a,"solid","light"),i=C.backgroundValue(a,"solid","dark");n.set("--tabs-filled-inactive-bg",o.backgroundColor),n.set("--tabs-filled-inactive-text","var(--color-white)");const u=C.hoverBackgroundValue(a,"solid","light");n.set("--tabs-filled-inactive-bg-hover",u.backgroundColor);const m=C.hoverBackgroundValue(a,"solid","dark");n.set("--tabs-filled-inactive-bg-dark-hover",m.backgroundColor),n.set("--tabs-filled-inactive-bg-dark",i.backgroundColor),n.set("--tabs-filled-inactive-text-dark",i.textColor),n.set("--tabs-filled-active-bg","var(--color-white)"),n.set("--tabs-filled-active-text","var(--color-base-800)"),n.set("--tabs-filled-active-bg-dark","var(--color-base-900)"),n.set("--tabs-filled-active-text-dark",l)}return t==="outline"&&(n.set("--tabs-outline-active-border",c),n.set("--tabs-outline-active-border-dark",be.getColorVar(a==="white"||a==="black"||a==="transparent"?"primary":a,600))),Array.from(n.entries()).map(([o,i])=>`${o}: ${i}`).join("; ")}function Sc(t,a,n){const r=["bc-tab",`bc-tab--${t}`];return a&&r.push("bc-tab--active"),n&&r.push("bc-tab--disabled"),r.join(" ")}function Mt(t,a,n){const r=a.length;let l=t+n;l>=r?l=0:l<0&&(l=r-1);let s=0;for(;s<r;){const c=a[l];if(!e.Value.get(c.disabled??!1))return l;l+=n,l>=r?l=0:l<0&&(l=r-1),s++}return t}function Vc(t){const{items:a,value:n,onChange:r,size:l="md",variant:s="default",color:c="primary",disabled:o=!1,orientation:i="horizontal",showContent:u=!0,ariaLabel:m}=t,f=Te.sessionId("tablist"),h=e.prop(-1),d=a.map((p,b)=>{const y=e.computedOf(n)(w=>w===p.key),k=e.computedOf(o,p.disabled)((w,I)=>w||I),_=`${f}-tab-${p.key}`,v=`${f}-panel-${p.key}`;return{item:p,index:b,isActive:y,isTabDisabled:k,tabId:_,panelId:v}}),g=p=>{if(e.Value.get(o))return;const y=h.value,k=e.Value.get(i)==="horizontal";let _=y;switch(p.key){case(k?"ArrowRight":"ArrowDown"):p.preventDefault(),_=Mt(y,a,1);break;case(k?"ArrowLeft":"ArrowUp"):p.preventDefault(),_=Mt(y,a,-1);break;case"Home":p.preventDefault(),_=Mt(-1,a,1);break;case"End":p.preventDefault(),_=Mt(a.length,a,-1);break;case"Enter":case" ":if(p.preventDefault(),y>=0&&y<a.length){const v=a[y];e.Value.get(v.disabled??!1)||r?.(v.key)}break}_!==y&&_>=0&&_<a.length&&(h.set(_),setTimeout(()=>{const v=document.querySelector(`[data-tab-index="${_}"]`);v&&v.focus()},0))};return e.html.div(e.attr.class(e.computedOf(l,i,o,s)((p,b,y,k)=>wc(p??"md",b??"horizontal",y??!1,k??"default"))),e.attr.style(e.computedOf(s,c)((p,b)=>Cc(p??"default",b??"primary"))),e.html.div(e.attr.class("bc-tabs__list"),e.attr.role("tablist"),e.attr.id(f),e.aria.orientation(i??"horizontal"),e.aria.label(m),e.on.keydown(g),...d.map(({item:p,index:b,isActive:y,isTabDisabled:k,tabId:_,panelId:v})=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(l,y,k)((w,I,S)=>Sc(w??"md",I??!1,S??!1))),e.attr.id(_),e.attr.role("tab"),e.attr.tabindex(e.computedOf(y,h)((w,I)=>w||I===b?0:-1)),e.aria.selected(y),e.aria.controls(v),e.aria.disabled(k),e.attr.disabled(k),e.dataAttr("tab-index",String(b)),e.aria.label(p.ariaLabel),e.on.click(w=>{w.preventDefault(),e.Value.get(p.disabled??!1)||e.Value.get(o)||(r?.(p.key),h.set(b))}),e.on.focus(()=>{h.set(b)}),p.label))),e.When(u??!0,()=>e.html.div(e.attr.class("bc-tabs__panels"),...d.map(({item:p,isActive:b,tabId:y,panelId:k})=>e.When(b,()=>e.html.div(e.attr.class("bc-tabs__panel"),e.attr.id(k),e.attr.role("tabpanel"),e.attr.tabindex(0),e.aria.labelledby(y),p.content()))))))}function Ic(t){return t<20?10:t<50?3:t<80?2:t<99?.5:0}function $c(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return`--nav-progress-fill: ${a.backgroundColor}; --nav-progress-fill-dark: ${n.backgroundColor}`}function xc(t={}){const{color:a="primary",height:n=3,position:r="top",showSpinner:l=!1,trickleSpeed:s=200,minimumDuration:c=300,animationSpeed:o=200}=t,i=e.prop(0),u=e.prop(!1),m=e.prop(!1);let f=null,h=null,d=0;function g(){f!=null&&(clearInterval(f),f=null)}function p(){h!=null&&(clearTimeout(h),h=null)}function b(){g(),f=setInterval(()=>{const z=i.value,T=Ic(z);T>0&&i.set(Math.min(z+Math.random()*T,99.5))},e.Value.get(s))}function y(){p(),i.set(0),u.set(!0),m.set(!0),d=Date.now(),requestAnimationFrame(()=>{i.set(Math.random()*5+2),b()})}function k(z){const T=Math.max(0,Math.min(100,z));i.set(T),!u.value&&T<100&&(u.set(!0),m.set(!0))}function _(){g(),i.set(100);const z=e.Value.get(o);h=setTimeout(()=>{u.set(!1),h=setTimeout(()=>{m.set(!1),i.set(0)},z)},z)}function v(){p();const z=Date.now()-d,W=e.Value.get(c)-z;W>0?h=setTimeout(_,W):_()}function w(){g(),p(),u.set(!1),m.set(!1),i.set(0)}const I={start:y,set:k,done:v,reset:w,isActive:u},S=e.Value.map(r,z=>`bc-navigation-progress bc-navigation-progress--${z??"top"}`),V=e.Value.map(a,z=>$c(z??"primary")),D=e.Value.map(n,z=>`${z??3}px`),$=e.Value.map(i,z=>`translateX(${-100+z}%)`),x=e.Value.map(o,z=>`transform ${z??200}ms var(--motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))`);return[e.When(m,()=>e.Portal("body",e.Fragment(e.html.div(e.attr.class(S),e.attr.style(V),e.style.height(D),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(100),e.aria.valuenow(i),e.html.div(e.attr.class(e.Value.map(u,z=>`bc-navigation-progress__bar${z?"":" bc-navigation-progress__bar--done"}`)),e.style.transform($),e.style.transition(x),e.html.div(e.attr.class("bc-navigation-progress__peg")))),e.When(l,()=>e.html.div(e.attr.class(e.Value.map(S,z=>`bc-navigation-progress__spinner${z.includes("--bottom")?" bc-navigation-progress__spinner--bottom":""}`)),e.attr.style(V),e.html.div(e.attr.class("bc-navigation-progress__spinner-icon"))),()=>{}),e.OnDispose(()=>{g(),p()})))),I]}function fr(t,a,n,r,l,s,c){const o=t.map(d=>d.children!=null&&d.children.length>0),i=e.computedOf(r,t)((d,g)=>d.has(g.id)),u=e.computedOf(n,t)((d,g)=>d===g.id),m=t.map(d=>d.children??[]),f=()=>{l?.(e.Value.get(t).id)},h=d=>{d.stopPropagation(),s(e.Value.get(t).id)};return e.html.div(e.attr.class("bc-tree-item"),e.html.div(e.attr.class(e.computedOf(u,c)((d,g)=>["bc-tree-item__row",`bc-tree-item__row--size-${g??"md"}`,d?"bc-tree-item__row--selected":""].filter(Boolean).join(" "))),e.attr.style(`padding-left: ${a*20+8}px`),e.attr.role("treeitem"),e.attr.tabindex(0),e.aria.selected(u),e.WithElement(d=>{const g=e.computedOf(o,i)((p,b)=>p?String(b):null);e.Value.on(g,p=>{p!=null?d.setAttribute("aria-expanded",p):d.removeAttribute("aria-expanded")})}),e.on.click(f),e.When(o,()=>e.html.span(e.attr.class(e.Value.map(i,d=>["bc-tree-item__toggle",d?"bc-tree-item__toggle--expanded":""].filter(Boolean).join(" "))),e.on.click(h),C.Icon({icon:"mdi:chevron-right",size:"sm",accessibility:"decorative"})),()=>e.html.span(e.attr.class("bc-tree-item__toggle-spacer"))),e.When(t.map(d=>d.icon!=null),()=>e.html.span(e.attr.class("bc-tree-item__icon"),C.Icon({icon:t.map(d=>d.icon??""),size:"sm",accessibility:"decorative"})),()=>e.Empty),e.html.span(e.attr.class("bc-tree-item__label"),t.map(d=>d.label)),e.When(t.map(d=>d.badge!=null),()=>e.html.span(e.attr.class("bc-tree-item__badge"),t.map(d=>d.badge??"")),()=>e.Empty)),e.When(o,()=>e.html.div(Ot({open:i},e.html.div(e.attr.class("bc-tree-item__children"),e.attr.role("group"),e.ForEach(m,d=>fr(d,a+1,n,r,l,s,c))))),()=>e.Empty))}function Dc({items:t,selectedId:a,onSelect:n,expandedIds:r,onToggle:l,size:s="md"},...c){const o=e.prop(new Set),i=r??o,u=a??e.prop(void 0),m=f=>{const h=e.Value.get(i),d=!h.has(f);if(r==null){const g=new Set(h);d?g.add(f):g.delete(f),o.set(g)}l?.(f,d)};return e.html.div(e.attr.class(e.Value.map(s,f=>`bc-tree-view bc-tree-view--size-${f??"md"}`)),e.attr.role("tree"),e.ForEach(t,f=>fr(f,0,u,i,n,m,s)),...c)}function Oc(t,a,n,r){const l=["bc-stepper",`bc-stepper--${t}`,`bc-stepper--size-${n}`];return a!=="default"&&l.push(`bc-stepper--${a}`),r&&l.push("bc-stepper--disabled"),l.join(" ")}function gr(t){const{steps:a,value:n=0,onChange:r,orientation:l="horizontal",variant:s="default",size:c="md",color:o="primary",disabled:i=!1,showNavigation:u=!0}=t,m=e.prop(e.Value.get(n)),f=e.Value.on(n,S=>m.set(S)),h=e.prop(new Set),d=S=>{m.set(S),r?.(S)},g=async(S,V)=>{for(let D=S;D<V;D++){const $=a[D].beforeNext;if($&&!await $())return!1}return!0},p=async S=>{if(S<0||S>=a.length||e.Value.get(i))return!1;const V=m.value;return S===V?!0:S<V||await g(V,S)?(d(S),!0):!1},b=async()=>{if(e.Value.get(i))return!1;const S=m.value;if(S>=a.length-1)return!1;const V=a[S];return V.beforeNext&&!await V.beforeNext()?!1:(d(S+1),!0)},y=()=>{const S=m.value;S>0&&d(S-1)},k=async()=>{if(e.Value.get(i))return!1;const S=m.value;return await g(S,a.length)?(d(a.length),!0):!1},w={goTo:p,next:b,prev:y,complete:k,currentStep:m,setError:S=>{const V=new Set(h.value);V.add(S),h.set(V)},clearError:S=>{const V=new Set(h.value);V.delete(S),h.set(V)}};return[e.Use(C.BeatUII18n,S=>{const V=(D,$,x)=>x.has(D)?"error":D<$?"completed":D===$?"active":"pending";return e.html.div(e.OnDispose(f),e.attr.class(e.computedOf(l,s,c,i)(Oc)),e.attr.style(e.Value.map(o,D=>`--stepper-color: var(--color-${D}-500); --stepper-color-dark: var(--color-${D}-400)`)),e.attr.role("group"),e.aria.label(e.computedOf(S.$.stepper.$.step)(D=>`${D} progress`)),e.html.div(e.attr.class("bc-stepper__indicators"),...a.map((D,$)=>{const x=e.computedOf(m,h)((T,W)=>V($,T,W)),U=e.Value.map(x,T=>`bc-stepper__step bc-stepper__step--${T}`),z=D.icon?C.Icon({icon:D.icon,size:"xs"}):e.When(e.Value.map(x,T=>T==="completed"),()=>C.Icon({icon:"lucide:check",size:"xs"}),()=>e.When(e.Value.map(x,T=>T==="error"),()=>C.Icon({icon:"lucide:alert-triangle",size:"xs"}),()=>e.html.span(String($+1))));return[...$>0?[e.html.div(e.attr.class(e.computedOf(m,h)((T,W)=>V($-1,T,W)==="completed"?"bc-stepper__connector bc-stepper__connector--completed":"bc-stepper__connector")))]:[],e.html.div(e.attr.class(U),e.on.click(()=>{e.Value.get(i)||p($)}),e.attr.role("button"),e.attr.tabindex(0),e.aria.label(e.computedOf(S.$.stepper.$.stepOfTotal)(T=>`${D.label} - ${T($+1,a.length)}`)),e.on.keydown(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),e.Value.get(i)||p($))}),e.html.div(e.attr.class("bc-stepper__circle"),z),e.html.div(e.attr.class("bc-stepper__label"),e.html.span(e.attr.class("bc-stepper__label-text"),D.label),D.description?e.html.span(e.attr.class("bc-stepper__label-description"),D.description):null))]}).flat()),e.html.div(e.attr.class("bc-stepper__content"),...a.map((D,$)=>D.content?e.When(e.Value.map(m,x=>x===$),D.content,()=>null):null)),e.When(u,()=>e.html.div(e.attr.class("bc-stepper__navigation"),e.When(e.Value.map(m,D=>D>0),()=>ne.Button({variant:"outline",size:c,color:o,disabled:i,onClick:y},S.$.stepper.$.previous),()=>null),e.html.span(e.attr.class("bc-stepper__spacer")),e.When(e.Value.map(m,D=>D<a.length-1),()=>ne.Button({variant:"filled",size:c,color:o,disabled:i,onClick:()=>{b()}},S.$.stepper.$.next),()=>ne.Button({variant:"filled",size:c,color:o,disabled:i,onClick:()=>{k()}},S.$.stepper.$.complete))),()=>null))}),w]}function Tc(t){const[a]=gr(t);return a}function Pc(t){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\//i.test(t)}let Nt=null;function Ec(){return typeof window<"u"&&window.YT?.Player?Promise.resolve(window.YT):Nt||(Nt=new Promise(t=>{const a=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{a?.(),t(window.YT)};const n=document.createElement("script");n.src="https://www.youtube.com/iframe_api",n.async=!0,document.head.appendChild(n)}),Nt)}function Fc(t){const{url:a,playing:n=!1,loop:r=!1,controls:l=!1,volume:s=1,muted:c=!1,playbackRate:o=1,pip:i=!1,playsinline:u=!0,width:m,height:f,progressInterval:h=1e3,seekTo:d,config:g,onReady:p,onStart:b,onPlay:y,onPause:k,onBuffer:_,onBufferEnd:v,onEnded:w,onError:I,onDuration:S,onSeek:V,onProgress:D,onPlaybackRateChange:$,onPlaybackQualityChange:x}=t;function U(j){return/\.m3u8(\?|$)/i.test(j)}function z(j){try{const B=j.canPlayType("application/vnd.apple.mpegurl");return B==="probably"||B==="maybe"}catch{return!1}}const T=e.prop("file");let W=null,L=null,J=null;function P(){try{J?.destroy()}catch{}J=null}const N=[];async function H(){const j=W;if(!j)return;const B=e.Value.get(a);if(typeof B!="string"||B.length===0)return;P();const ee=g?.file?.forceHLS??!1;if(U(B)||ee){if(z(j)){j.setAttribute("src",B);try{j.load()}catch{}return}if(typeof window>"u")return;try{const ue=await import("hls.js/dist/hls.light.min.js"),te=ue;let _e=te.default??te.Hls??ue;for(let De=0;De<3&&(typeof _e=="object"&&_e!=null&&"default"in _e);De++)_e=_e.default;if(typeof _e=="function"){const De=_e;if(typeof De.isSupported=="function"&&De.isSupported()){j.removeAttribute("src");try{j.load()}catch{}const Pe=new De(g?.hls);J=Pe,Pe.attachMedia(j),Pe.loadSource(B)}else{j.setAttribute("src",B);try{j.load()}catch{}}}else{j.setAttribute("src",B);try{j.load()}catch{}}}catch(ue){I?.(ue),j.setAttribute("src",B);try{j.load()}catch{}}return}j.setAttribute("src",B);try{j.load()}catch{}}function X(){L?.();const j=e.Value.get(h)??1e3;L=we.interval(()=>{const B=W;if(!B)return;const ee=B.duration||0,ue=B.currentTime||0,te=B.buffered?.length?B.buffered.end(B.buffered.length-1):0;D?.({played:ee>0?ue/ee:0,playedSeconds:ue,loaded:ee>0?Math.min(te,ee)/ee:0,loadedSeconds:Math.min(te,ee)})},j)}function F(j){if(j!=null)return typeof j=="number"?`${j}px`:j}const O=e.html.video(e.WithElement(j=>{W=j,p?.();try{W.playbackRate=e.Value.get(o)??1}catch{}W.muted=!!(e.Value.get(c)??!1),W.loop=!!(e.Value.get(r)??!1),W.controls=!!(e.Value.get(l)??!1),W.playsInline!=null&&(!!(e.Value.get(u)??!0)?W.setAttribute("playsinline",""):W.removeAttribute("playsinline"));try{const B=!!(e.Value.get(i)??!1),ee=document,ue=W;B?typeof ue.requestPictureInPicture=="function"&&ee.pictureInPictureElement!==W&&ue.requestPictureInPicture().catch(()=>{}):ee.pictureInPictureElement===W&&typeof ee.exitPictureInPicture=="function"&&ee.exitPictureInPicture().catch(()=>{})}catch{}X(),H()}),e.style.width(e.Value.map(m,F)),e.style.height(e.Value.map(f,F)),e.on.play(()=>y?.()),e.on.playing(()=>{b?.(),v?.()}),e.on.pause(()=>k?.()),e.on.waiting(()=>_?.()),e.on.canplay(()=>{const j=W?.duration;j!=null&&Number.isFinite(j)&&S?.(j),e.Value.get(n)&&W&&W.paused&&W.play?.().catch(()=>{})}),e.on.ended(()=>w?.()),e.on.error(j=>{J||I?.(j)}));let R=null,Z=null,ie=null;function ye(){const j=e.Value.get(a);!R||typeof j!="string"||Ec().then(B=>{const ee=br(j);if(ee){if(Z){Z.loadVideoById({videoId:ee});return}Z=new B.Player(R,{videoId:ee,playerVars:Lc(t),events:{onReady:()=>{p?.(),oe(),e.Value.get(n)&&b?.(),Q()},onStateChange:ue=>{switch(ue.data){case B.PlayerState.PLAYING:y?.(),v?.();break;case B.PlayerState.PAUSED:k?.();break;case B.PlayerState.BUFFERING:_?.();break;case B.PlayerState.ENDED:w?.();break}},onError:ue=>I?.(ue),onPlaybackRateChange:ue=>$?.(ue.data),onPlaybackQualityChange:ue=>x?.(ue.data)}})}})}function Q(){ie?.();const j=e.Value.get(h)??1e3;ie=we.interval(()=>{if(!Z)return;const B=Z.getDuration?.()??0,ee=Z.getCurrentTime?.()??0,ue=Z.getVideoLoadedFraction?.()??0;D?.({played:B>0?ee/B:0,playedSeconds:ee,loaded:ue,loadedSeconds:ue*B})},j)}function oe(){if(!Z)return;try{const ee=e.Value.get(o)??1;Z.setPlaybackRate?.(ee)}catch{}try{const ee=Math.round(Math.min(Math.max(e.Value.get(s)??1,0),1)*100);Z.setVolume?.(ee)}catch{}try{e.Value.get(c)??!1?Z.mute?.():Z.unMute?.()}catch{}e.Value.get(n)??!1?Z.playVideo?.():Z.pauseVideo?.();const B=e.Value.get(d);typeof B=="number"&&Number.isFinite(B)&&(Z.seekTo?.(B,!0),V?.(B))}const le=e.html.div(e.WithElement(j=>{R=j,T.value==="youtube"&&ye()}));N.push(e.Value.on(a,j=>{const B=typeof j=="string"&&j.length>0&&Pc(j),ee=B?"youtube":"file";T.set(ee),B?ye():W&&H()})),N.push(e.Value.on(n,()=>{T.value==="file"&&W?e.Value.get(n)?W.play?.().catch(()=>{}):W.pause?.():T.value==="youtube"&&Z&&(e.Value.get(n)?Z.playVideo?.():Z.pauseVideo?.())})),N.push(e.Value.on(s,()=>{if(T.value==="file"&&W)W.volume=Math.min(Math.max(e.Value.get(s)??1,0),1);else if(T.value==="youtube"&&Z){const j=Math.round(Math.min(Math.max(e.Value.get(s)??1,0),1)*100);Z.setVolume?.(j)}})),N.push(e.Value.on(c,()=>{T.value==="file"&&W?W.muted=!!e.Value.get(c):T.value==="youtube"&&Z&&(e.Value.get(c)?Z.mute?.():Z.unMute?.())})),N.push(e.Value.on(o,()=>{if(T.value==="file"&&W)try{W.playbackRate=e.Value.get(o)??1}catch{}else T.value==="youtube"&&Z&&Z.setPlaybackRate?.(e.Value.get(o)??1)})),N.push(e.Value.on(i,async()=>{if(!(T.value!=="file"||!W))try{const j=!!(e.Value.get(i)??!1),B=document,ee=W;j?typeof ee.requestPictureInPicture=="function"&&B.pictureInPictureElement!==W&&await ee.requestPictureInPicture()?.catch(()=>{}):B.pictureInPictureElement===W&&typeof B.exitPictureInPicture=="function"&&await B.exitPictureInPicture()?.catch(()=>{})}catch{}})),N.push(e.Value.on(l,()=>{T.value==="file"&&W&&(W.controls=!!e.Value.get(l))})),N.push(e.Value.on(r,()=>{T.value==="file"&&W&&(W.loop=!!e.Value.get(r))})),N.push(e.Value.on(u,()=>{T.value==="file"&&W&&(!!e.Value.get(u)?W.setAttribute("playsinline",""):W.removeAttribute("playsinline"))})),N.push(e.Value.on(d??null,()=>{const j=e.Value.get(d);if(j!=null)if(T.value==="file"&&W)try{W.currentTime=j,V?.(j)}catch{}else T.value==="youtube"&&Z&&(Z.seekTo?.(j,!0),V?.(j))})),N.push(()=>{L?.(),ie?.(),P();try{Z?.destroy()}catch{}});const ke=e.Value.map(T,j=>j==="file"),me=e.Value.map(T,j=>j==="youtube"),Ie=e.html.div(e.attr.class("bc-base-video"),e.style.width(e.Value.map(m,F)),e.style.height(e.Value.map(f,F)),e.html.div(e.style.display(e.Value.map(ke,j=>j?"block":"none")),O),e.html.div(e.style.display(e.Value.map(me,j=>j?"block":"none")),le));return e.Fragment(e.OnDispose(...N),Ie)}function br(t){const a=/[?&]v=([^&#]+)/.exec(t);if(a)return a[1];const n=/youtu\.be\/([^?&#]+)/.exec(t);if(n)return n[1];const r=/youtube\.com\/embed\/([^?&#]+)/.exec(t);return r?r[1]:null}function Lc(t){const a={autoplay:e.Value.get(t.playing)??!1?1:0,controls:e.Value.get(t.controls)??!1?1:0,rel:0,playsinline:e.Value.get(t.playsinline)??!0?1:0,modestbranding:1},n=e.Value.get(t.loop)??!1,r=e.Value.get(t.url),l=typeof r=="string"?br(r):null;return n&&l&&(a.loop=1,a.playlist=l),a}function vr(t,...a){const n=a.length;if(n===0){const B={goTo:()=>{},next:()=>{},prev:()=>{},play:()=>{},pause:()=>{},isPlaying:e.prop(!1),currentIndex:e.prop(0),totalSlides:0};return[e.Empty,B]}const r=e.prop(e.Value.get(t.currentIndex??0)),l=e.Value.toSignal(t.autoPlay??!1),s=e.Value.toSignal(t.interval??3e3),c=e.Value.toSignal(t.loop??!1),o=e.Value.toSignal(t.slidesPerView??1),i=e.Value.toSignal(t.transition??"slide"),u=e.Value.toSignal(t.transitionDuration??300),m=e.Value.toSignal(t.showArrows??!0),f=e.Value.toSignal(t.pauseOnHover??!0),h=e.Value.toSignal(t.keyboard??!0),d=e.Value.toSignal(t.gap??"0px"),g=e.Value.toSignal(t.peekAmount??"0px"),p=e.Value.toSignal(t.align??"start"),b=e.Value.toSignal(t.easing??"cubic-bezier(0.2, 0, 0, 1)"),y=e.Value.toSignal(t.dragThreshold??50),k=e.Value.toSignal(t.indicator??"dots"),_=e.prop(!1),v=e.prop(e.Value.get(l));l.on(B=>v.set(B));const w=e.prop(Math.max(0,n-e.Value.get(o)));o.on(B=>{w.set(Math.max(0,n-B))});const I=e.computedOf(r,c)((B,ee)=>!ee&&B===0),S=e.computedOf(r,c,w)((B,ee,ue)=>!ee&&B>=ue);function V(B){const ee=w.value;return ee===0?0:e.Value.get(c)?(B%n+n)%n:Math.max(0,Math.min(B,ee))}function D(B){const ee=V(B);ee!==r.value&&(r.set(ee),t.onSlideChange?.(ee))}function $(){const B=r.value+1;(e.Value.get(c)||B<=w.value)&&D(B)}function x(){const B=r.value-1;(e.Value.get(c)||B>=0)&&D(B)}function U(){v.set(!0),t.onAutoPlayToggle?.(!0)}function z(){v.set(!1),t.onAutoPlayToggle?.(!1)}let T=null;function W(){L(),T=setInterval(()=>{_.value&&e.Value.get(f)||$()},e.Value.get(s))}function L(){T!=null&&(clearInterval(T),T=null)}v.on(B=>{B?W():L()}),s.on(()=>{v.value&&W()});let J=0,P=0,N=0;const H=50;let X=!1,F=0,O=0,R=!1;const Z=e.prop("0%");function ie(B){if(e.Value.get(i)==="fade")return"0%";const ee=e.Value.get(o),ue=e.Value.get(d),te=-(B*(100/ee));return ue==="0px"||ue==="0"?`${te}%`:`calc(${te}% - ${B} * ${ue})`}r.on(B=>{Z.set(ie(B))}),i.on(()=>{Z.set(ie(r.value))}),Z.set(ie(e.Value.get(r)));const ye=t.prevIcon??"lucide:chevron-left",Q=t.nextIcon??"lucide:chevron-right",oe=t.arrowIconSize??"md",le=e.computedOf(o,d)((B,ee)=>ee==="0px"||ee==="0"?`${100/B}%`:`calc((100% - ${B-1} * ${ee}) / ${B})`),ke=i.map(B=>B==="fade"),me=p.map(B=>{switch(B){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}}),Ie={goTo:D,next:$,prev:x,play:U,pause:z,isPlaying:v,currentIndex:r,totalSlides:n};return[e.Use(C.BeatUII18n,B=>{const ee=a.map((te,_e)=>{const De=e.computedOf(ke,r)((q,de)=>q?de===_e?"1":"0":""),Pe=ke.map(q=>q?_e===0?"relative":"absolute":""),E=ke.map(q=>q&&_e!==0?"0":"");return e.html.div(e.attr.class("bc-carousel__slide"),e.attr.class(r.map(q=>q===_e?"bc-carousel__slide--active":"")),e.attr.role("tabpanel"),e.aria.roledescription("slide"),e.aria.label(B.$.carousel.$.slideOfTotal.map(q=>q(_e+1,n))),e.style.minWidth(le),e.style.flexShrink("0"),e.style.opacity(De),e.style.position(Pe),e.style.inset(E),te)}),ue=Array.from({length:n},(te,_e)=>e.html.button(e.attr.class(r.map(De=>`bc-carousel__dot${De===_e?" bc-carousel__dot--active":""}`)),e.attr.type("button"),e.aria.label(B.$.carousel.$.goToSlide.map(De=>De(_e+1))),e.on.click(()=>D(_e))));return e.html.div(e.attr.class(i.map(te=>`bc-carousel bc-carousel--${te}`)),e.attr.role("region"),e.aria.roledescription("carousel"),e.aria.label(t.ariaLabel!=null?t.ariaLabel:B.$.carousel.$.label),e.attr.tabindex(0),e.WithElement(te=>{const _e=E=>{e.Value.get(h)&&(E.key==="ArrowLeft"?(E.preventDefault(),x()):E.key==="ArrowRight"&&(E.preventDefault(),$()))};te.addEventListener("keydown",_e);const De=E=>{X&&(O=E.clientX-F)},Pe=()=>{X&&(X=!1,te.classList.remove("bc-carousel--dragging"),Math.abs(O)>=e.Value.get(y)?(R=!0,O>0?x():$()):Math.abs(O)>5&&(R=!0),R&&requestAnimationFrame(()=>{R=!1}))};return window.addEventListener("mousemove",De),window.addEventListener("mouseup",Pe),e.OnDispose(()=>{te.removeEventListener("keydown",_e),window.removeEventListener("mousemove",De),window.removeEventListener("mouseup",Pe),L()})}),e.on.mouseenter(()=>_.set(!0)),e.on.mouseleave(()=>_.set(!1)),e.on.touchstart(te=>{J=te.touches[0].clientX,P=te.touches[0].clientY,N=0}),e.on.touchmove(te=>{N=te.touches[0].clientX-J;const _e=Math.abs(te.touches[0].clientY-P);Math.abs(N)>_e&&te.preventDefault()}),e.on.touchend(()=>{Math.abs(N)>=H&&(N>0?x():$())}),e.html.div(e.attr.class("bc-carousel__viewport"),e.style.paddingLeft(g),e.style.paddingRight(g),e.WithElement(te=>(i.on(_e=>{_e==="fade"?te.style.minWidth=`${te.offsetWidth}px`:te.style.minWidth=""}),e.OnDispose(()=>{}))),e.on.mousedown(te=>{X=!0,F=te.clientX,O=0,R=!1,te.preventDefault()}),e.on.click(te=>{R&&(te.preventDefault(),te.stopPropagation())}),e.html.div(e.attr.class("bc-carousel__track"),e.style.position(ke.map(te=>te?"relative":"")),e.style.transform(Z.map(te=>`translateX(${te})`)),e.style.transitionDuration(u.map(te=>`${te}ms`)),e.style.transitionTimingFunction(b),e.style.gap(d),e.style.justifyContent(me),...ee)),e.When(m,()=>e.html.button(e.attr.class("bc-carousel__arrow bc-carousel__arrow--prev"),e.attr.class(I.map(te=>te?"bc-carousel__arrow--disabled":"")),e.attr.type("button"),e.attr.disabled(I),e.aria.label(B.$.carousel.$.previousSlide),e.on.click(()=>x()),C.Icon({icon:ye,size:oe,accessibility:"decorative"}))),e.When(m,()=>e.html.button(e.attr.class("bc-carousel__arrow bc-carousel__arrow--next"),e.attr.class(S.map(te=>te?"bc-carousel__arrow--disabled":"")),e.attr.type("button"),e.attr.disabled(S),e.aria.label(B.$.carousel.$.nextSlide),e.on.click(()=>$()),C.Icon({icon:Q,size:oe,accessibility:"decorative"}))),e.When(k.map(te=>te==="dots"),()=>e.html.div(e.attr.class("bc-carousel__dots"),e.attr.role("tablist"),e.aria.label(B.$.carousel.$.slideNavigation),...ue)),e.When(k.map(te=>te==="progress"),()=>e.html.div(e.attr.class("bc-carousel__progress"),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(100),e.aria.valuenow(r.map(te=>Math.round((te+1)/n*100))),e.html.div(e.attr.class("bc-carousel__progress-fill"),e.style.width(r.map(te=>`${(te+1)/n*100}%`))))),e.When(k.map(te=>te==="fraction"),()=>e.html.div(e.attr.class("bc-carousel__fraction"),e.aria.live("polite"),r.map(te=>`${te+1} / ${n}`))))}),Ie]}function Ac(t,...a){return vr(t,...a)[0]}const La="https://cdn.jsdelivr.net/npm/pdfjs-dist@5.4.394/",Bc=t=>{if(!t||typeof t!="object")return!1;const a=t;return!!(a.getDocument&&typeof a.getDocument=="function")};function Mc(){if(typeof window>"u")return;const a=window.pdfjsLib;a?.GlobalWorkerOptions?.workerSrc||a?.GlobalWorkerOptions&&(a.GlobalWorkerOptions.workerSrc=`${La}build/pdf.worker.min.mjs`)}const Nc=t=>new Promise((a,n)=>{const r=document.createElement("script");r.type="module",r.src=t,r.onload=()=>a(),r.onerror=()=>n(new Error(`Failed to load script: ${t}`)),document.head.appendChild(r)}),Wc=async()=>{const t=window;if(t.pdfjsLib&&Bc(t.pdfjsLib))return t.pdfjsLib;if(await Nc(`${La}build/pdf.min.mjs`),await new Promise(a=>setTimeout(a,100)),!t.pdfjsLib)throw new Error("PDF.js failed to initialize after loading");return t.pdfjsLib};let oa=null,Ja=!1;async function Uc(){if(oa)return oa;!Ja&&typeof window<"u"&&(Mc(),Ja=!0);const t=await Wc();return oa=t,t.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=`${La}build/pdf.worker.min.mjs`),t}function Rc(t,a){if(t.byteLength!==a.byteLength)return!1;const n=t.byteLength,r=new DataView(t.buffer,t.byteOffset,n),l=new DataView(a.buffer,a.byteOffset,n),s=n>>>2,c=n&3;for(let o=0;o<s;o++)if(r.getUint32(o*4)!==l.getUint32(o*4))return!1;for(let o=n-c;o<n;o++)if(t[o]!==a[o])return!1;return!0}function zc(t,a){if(t.byteLength!==a.byteLength)return!1;const n=t.byteLength,r=n>>>2,l=new Uint32Array(t,0,r),s=new Uint32Array(a,0,r);for(let u=0;u<r;u++)if(l[u]!==s[u])return!1;const c=n&3,o=new Uint8Array(t,r*4,c),i=new Uint8Array(a,r*4,c);for(let u=0;u<c;u++)if(o[u]!==i[u])return!1;return!0}function Hc(t,a){try{return typeof t=="string"&&typeof a=="string"?t===a:t instanceof Uint8Array&&a instanceof Uint8Array?Rc(t,a):t instanceof ArrayBuffer&&a instanceof ArrayBuffer?zc(t,a):!1}catch{return!1}}function sa(t){return typeof t=="string"?t:t instanceof Uint8Array?t.slice():t instanceof ArrayBuffer?t.slice(0):t}function jc({source:t,page:a=1,fit:n="width",scale:r=1,rotation:l=0,quality:s=2,renderTextLayer:c=!0,renderAnnotationLayer:o=!1,onPageChange:i,onLoadComplete:u},...m){const f=Uc();let h=sa(e.Value.get(t)),d=null,g=e.Value.get(a),p=null;return e.Use(C.BeatUII18n,b=>e.Fragment(e.OnDispose(()=>{if(p){try{p.cancel()}catch{}p=null}d!=null&&(d.destroy(),d=null)}),Ce.ElementRect(y=>{const k=e.delaySignal(y.map(_=>_==null?null:{width:_.width,height:_.height},(_,v)=>_!=null&&v!=null&&_.width===v.width&&_.height===v.height),100);return e.Ensure(k,_=>Ce.Query({request:e.computedOf(t,a,n,r,l,s,c,o,_)((v,w,I,S,V,D,$,x,U)=>({source:v,page:w??1,fit:I??"width",scale:Math.max(.1,S??1),rotation:V??0,quality:Math.max(1,D??2),renderTextLayer:$??!0,renderAnnotationLayer:x??!1,containerWidth:U.width,containerHeight:U.height})),load:async({request:v})=>{const w=await f,I=v.source,S=sa(I),V=sa(I);(d==null||!Hc(h,S))&&(d!=null&&(d.destroy(),d=null),h=S,d=await w.getDocument(V).promise,u?.({pdfDoc:d}));const D=v.page<1||v.page>d.numPages?1:v.page;i!=null&&D!==g&&(g=D,i(D));const $=await d.getPage(D);let x;if(v.fit==="none")x=v.scale;else{const T=$.getViewport({scale:1,rotation:v.rotation}),W=T.width/T.height,L=v.containerWidth/v.containerHeight;switch(v.fit){case"width":x=v.containerWidth/T.width;break;case"height":x=v.containerHeight/T.height;break;case"contain":x=Math.min(v.containerWidth/T.width,v.containerHeight/T.height);break;case"cover":W>L?x=v.containerHeight/T.height:x=v.containerWidth/T.width;break}}const U=$.getViewport({scale:x,rotation:v.rotation}),z=$.getViewport({scale:x*v.quality,rotation:v.rotation});return{pdfWidth:U.width,pdfHeight:U.height,canvasWidth:Math.floor(U.width),canvasHeight:Math.floor(U.height),highResWidth:Math.floor(z.width),highResHeight:Math.floor(z.height),render:async(T,W,L)=>{if(p)try{p.cancel(),await p.promise.catch(()=>{})}catch{}T.width=z.width,T.height=z.height,T.style.width=`${U.width}px`,T.style.height=`${U.height}px`;const J=T.getContext("2d");if(!J)throw new Error("Failed to get canvas context");const P=$.render({canvasContext:J,canvas:T,viewport:z});p=P;try{await P.promise}catch(N){if((N instanceof Error?N.name:N?.name)!=="RenderingCancelledException")throw N;return}finally{p===P&&(p=null)}if(v.renderTextLayer&&W!=null){W.innerHTML="";try{const N=await $.getTextContent(),H=w.TextLayer;H!=null&&await new H({textContentSource:N,container:W,viewport:U}).render()}catch(N){console.warn("Failed to render text layer:",N)}}if(v.renderAnnotationLayer&&L!=null){L.innerHTML="",L.style.width=`${U.width}px`,L.style.height=`${U.height}px`;try{const N=await $.getAnnotations(),H=w.AnnotationLayer;if(H!=null&&N.length>0){const X={getDestinationHash:()=>"",getAnchorUrl:O=>O,executeNamedAction:()=>{},executeSetOCGState:()=>{},cachePageRef:()=>{}};await new H({div:L,page:$,viewport:U,linkService:X,annotationStorage:null}).render({viewport:U,div:L,annotations:N,page:$,linkService:X,renderForms:!0})}}catch(N){console.warn("Failed to render annotation layer:",N)}}}}},convertError:v=>v instanceof Error?v.message:JSON.stringify(v),pending:()=>e.html.div(e.attr.class("bc-pdf-page-viewer__loading"),C.Icon({icon:"line-md:loading-twotone-loop",size:"lg"}),e.html.span(e.attr.class("bc-pdf-page-viewer__loading-text"),b.map(v=>v.pdfPageViewer.loading))),failure:({error:v})=>e.html.div(e.attr.class("bc-pdf-page-viewer__error"),C.Icon({icon:"line-md:alert-circle",size:"lg",color:"danger"}),e.html.span(e.attr.class("bc-pdf-page-viewer__error-text"),v)),success:({value:v})=>e.html.div(e.attr.class(e.Value.map(n,w=>{const I=w??"width";return I==="none"?"bc-pdf-page-viewer":`bc-pdf-page-viewer bc-pdf-page-viewer--fit-${I}`})),e.html.div(e.attr.class("bc-pdf-page-viewer__content"),e.When(e.Value.map(n,w=>(w??"width")==="none"),()=>e.attr.style(v.$.canvasWidth.map(w=>`width: ${w}px; height: ${v.value.canvasHeight}px;`))),e.html.canvas(e.attr.class("bc-pdf-page-viewer__canvas"),e.attr.width(v.$.canvasWidth.map(String)),e.attr.height(v.$.canvasHeight.map(String)),...m),e.html.div(e.attr.class("bc-pdf-page-viewer__text-layer")),e.html.div(e.attr.class("bc-pdf-page-viewer__annotation-layer"))),e.WithElement(w=>{const I=w.querySelector(".bc-pdf-page-viewer__canvas"),S=w.querySelector(".bc-pdf-page-viewer__text-layer"),V=w.querySelector(".bc-pdf-page-viewer__annotation-layer");return e.Value.on(v,async D=>{await D.render(I,S,V)}),e.Empty}))}))})))}Object.defineProperty(exports,"Use",{enumerable:!0,get:()=>e.Use});exports.BeatUII18n=C.BeatUII18n;exports.Icon=C.Icon;exports.LOGICAL_PROPERTY_MAP=C.LOGICAL_PROPERTY_MAP;exports.Locale=C.Locale;exports.defaultLocale=C.defaultLocale;exports.defaultMessages=C.defaultMessages;exports.formatFileSize=C.formatFileSize;exports.getDirectionClassName=C.getDirectionClassName;exports.getDirectionFromLocale=C.getDirectionFromLocale;exports.getIconLocally=C.getIconLocally;exports.getOppositeDirection=C.getOppositeDirection;exports.getPhysicalProperty=C.getPhysicalProperty;exports.isIndexedDBAvailable=C.isIndexedDBAvailable;exports.isRTLLocale=C.isRTLLocale;exports.makeI18nProvider=C.makeI18nProvider;exports.makeMessages=C.makeMessages;exports.resolveDirection=C.resolveDirection;exports.storeIconLocally=C.storeIconLocally;exports.backgroundConfig=be.backgroundConfig;exports.bgColors=be.bgColors;exports.borderColors=be.borderColors;exports.colorShades=be.colorShades;exports.colors=be.colors;exports.generateColorVariables=be.generateColorVariables;exports.generateCoreColorVariables=be.generateCoreColorVariables;exports.generateSemanticColorVariables=be.generateSemanticColorVariables;exports.getColorVar=be.getColorVar;exports.getColorVarName=be.getColorVarName;exports.interactiveColors=be.interactiveColors;exports.normalizeColorName=be.normalizeColorName;exports.resolveSemanticColorMap=be.resolveSemanticColorMap;exports.semanticColorNames=be.semanticColorNames;exports.semanticColors=be.semanticColors;exports.textColors=be.textColors;exports.themeColorNames=be.themeColorNames;exports.baseFontSize=A.baseFontSize;exports.baseMotionDuration=A.baseMotionDuration;exports.baseSpacing=A.baseSpacing;exports.borderWidth=A.borderWidth;exports.breakpoints=A.breakpoints;exports.changeFontSize=A.changeFontSize;exports.controlGap=A.controlGap;exports.controlHeight=A.controlHeight;exports.controlPaddingBlock=A.controlPaddingBlock;exports.controlPaddingInline=A.controlPaddingInline;exports.fontFamily=A.fontFamily;exports.fontSize=A.fontSize;exports.fontWeight=A.fontWeight;exports.generateAllTokenVariables=A.generateAllTokenVariables;exports.generateBorderWidthVariables=A.generateBorderWidthVariables;exports.generateBreakpointVariables=A.generateBreakpointVariables;exports.generateControlGapVariables=A.generateControlGapVariables;exports.generateControlHeightVariables=A.generateControlHeightVariables;exports.generateControlPaddingVariables=A.generateControlPaddingVariables;exports.generateControlTokenVariables=A.generateControlTokenVariables;exports.generateCoreTokenVariables=A.generateCoreTokenVariables;exports.generateFontFamilyOverrideVariables=A.generateFontFamilyOverrideVariables;exports.generateMotionVariables=A.generateMotionVariables;exports.generateOutlineWidthVariables=A.generateOutlineWidthVariables;exports.generateOverlayWidthVariables=A.generateOverlayWidthVariables;exports.generateRadiusVariables=A.generateRadiusVariables;exports.generateSemanticFontVariables=A.generateSemanticFontVariables;exports.generateSemanticMotionVariables=A.generateSemanticMotionVariables;exports.generateSemanticRadiusVariables=A.generateSemanticRadiusVariables;exports.generateSemanticShadowVariables=A.generateSemanticShadowVariables;exports.generateSemanticSpacingVariables=A.generateSemanticSpacingVariables;exports.generateSemanticTextShadowVariables=A.generateSemanticTextShadowVariables;exports.generateSemanticTokenVariables=A.generateSemanticTokenVariables;exports.generateShadowVariables=A.generateShadowVariables;exports.generateSpacingVariables=A.generateSpacingVariables;exports.generateTextShadowVariables=A.generateTextShadowVariables;exports.generateTypographyVariables=A.generateTypographyVariables;exports.generateZIndexVariables=A.generateZIndexVariables;exports.getBaseFontSizeVar=A.getBaseFontSizeVar;exports.getBaseFontSizeVarName=A.getBaseFontSizeVarName;exports.getBaseMotionDurationVar=A.getBaseMotionDurationVar;exports.getBaseMotionDurationVarName=A.getBaseMotionDurationVarName;exports.getBorderWidthVar=A.getBorderWidthVar;exports.getBorderWidthVarName=A.getBorderWidthVarName;exports.getBreakpointMediaQuery=A.getBreakpointMediaQuery;exports.getBreakpointVar=A.getBreakpointVar;exports.getBreakpointVarName=A.getBreakpointVarName;exports.getControlGapVar=A.getControlGapVar;exports.getControlGapVarName=A.getControlGapVarName;exports.getControlHeightVar=A.getControlHeightVar;exports.getControlHeightVarName=A.getControlHeightVarName;exports.getControlPaddingBlockVar=A.getControlPaddingBlockVar;exports.getControlPaddingBlockVarName=A.getControlPaddingBlockVarName;exports.getControlPaddingInlineVar=A.getControlPaddingInlineVar;exports.getControlPaddingInlineVarName=A.getControlPaddingInlineVarName;exports.getFontFamilyVar=A.getFontFamilyVar;exports.getFontFamilyVarName=A.getFontFamilyVarName;exports.getFontSizeLineHeightVar=A.getFontSizeLineHeightVar;exports.getFontSizeLineHeightVarName=A.getFontSizeLineHeightVarName;exports.getFontSizeVar=A.getFontSizeVar;exports.getFontSizeVarName=A.getFontSizeVarName;exports.getFontWeightVar=A.getFontWeightVar;exports.getFontWeightVarName=A.getFontWeightVarName;exports.getLetterSpacingVar=A.getLetterSpacingVar;exports.getLetterSpacingVarName=A.getLetterSpacingVarName;exports.getLineHeightVar=A.getLineHeightVar;exports.getLineHeightVarName=A.getLineHeightVarName;exports.getMotionDurationVar=A.getMotionDurationVar;exports.getMotionDurationVarName=A.getMotionDurationVarName;exports.getMotionEasingVar=A.getMotionEasingVar;exports.getMotionEasingVarName=A.getMotionEasingVarName;exports.getOutlineWidthVar=A.getOutlineWidthVar;exports.getOutlineWidthVarName=A.getOutlineWidthVarName;exports.getOverlayWidthVar=A.getOverlayWidthVar;exports.getOverlayWidthVarName=A.getOverlayWidthVarName;exports.getRadiusMediaQuery=A.getRadiusMediaQuery;exports.getRadiusVar=A.getRadiusVar;exports.getRadiusVarName=A.getRadiusVarName;exports.getSemanticFontVar=A.getSemanticFontVar;exports.getSemanticFontVarName=A.getSemanticFontVarName;exports.getSemanticMotionVarName=A.getSemanticMotionVarName;exports.getSemanticRadiusVarName=A.getSemanticRadiusVarName;exports.getSemanticShadowVarName=A.getSemanticShadowVarName;exports.getSemanticSpacingVarName=A.getSemanticSpacingVarName;exports.getSemanticTextShadowVarName=A.getSemanticTextShadowVarName;exports.getShadowVar=A.getShadowVar;exports.getShadowVarName=A.getShadowVarName;exports.getSpacingVar=A.getSpacingVar;exports.getSpacingVarName=A.getSpacingVarName;exports.getTextShadowVar=A.getTextShadowVar;exports.getTextShadowVarName=A.getTextShadowVarName;exports.getTokenValue=A.getTokenValue;exports.getZIndexVar=A.getZIndexVar;exports.getZIndexVarName=A.getZIndexVarName;exports.letterSpacing=A.letterSpacing;exports.lineHeight=A.lineHeight;exports.motionDurations=A.motionDurations;exports.motionEasings=A.motionEasings;exports.outlineWidth=A.outlineWidth;exports.overlayWidth=A.overlayWidth;exports.radius=A.radius;exports.semanticFontNames=A.semanticFontNames;exports.semanticMotionNames=A.semanticMotionNames;exports.semanticRadiusNames=A.semanticRadiusNames;exports.semanticShadowNames=A.semanticShadowNames;exports.semanticSpacingNames=A.semanticSpacingNames;exports.semanticTextShadowNames=A.semanticTextShadowNames;exports.shadows=A.shadows;exports.spacing=A.spacing;exports.textShadows=A.textShadows;exports.zIndex=A.zIndex;exports.ArrayController=se.ArrayController;exports.BaseControl=se.BaseControl;exports.BaseMappedControl=se.BaseMappedControl;exports.CheckboxInput=se.CheckboxInput;exports.CloseButton=se.CloseButton;exports.Control=se.Control;exports.Controller=se.Controller;exports.ControllerValidation=se.ControllerValidation;exports.FIELD_LAYOUT_DEFAULTS=se.FIELD_LAYOUT_DEFAULTS;exports.Field=se.Field;exports.FieldLayout=se.FieldLayout;exports.MappedControl=se.MappedControl;exports.ObjectController=se.ObjectController;exports.RequiredSymbol=se.RequiredSymbol;exports.connectCommonAttributes=se.connectCommonAttributes;exports.connectNumberInput=se.connectNumberInput;exports.connectStringInput=se.connectStringInput;exports.convertStandardSchemaIssues=se.convertStandardSchemaIssues;exports.convertStandardSchemaPathToPath=se.convertStandardSchemaPathToPath;exports.makeMapValidation=se.makeMapValidation;exports.makeOnBlurHandler=se.makeOnBlurHandler;exports.makeOnChangeHandler=se.makeOnChangeHandler;exports.parsePath=se.parsePath;exports.pathToString=se.pathToString;exports.standardSchemaResultToValidation=se.standardSchemaResultToValidation;exports.taskToValidation=se.taskToValidation;exports.useController=se.useController;exports.useForm=se.useForm;exports.wrapSegment=se.wrapSegment;exports.AnimatedToggle=He.AnimatedToggle;exports.AnimatedToggleClass=He.AnimatedToggleClass;exports.useAnimatedElementToggle=He.useAnimatedElementToggle;exports.useAnimatedToggle=He.useAnimatedToggle;exports.useTimedToggle=He.useTimedToggle;exports.Theme=Ct.Theme;exports.ThemeAppearance=Ct.ThemeAppearance;exports.beatuiPreset=en.beatuiPreset;exports.createBeatuiPreset=en.createBeatuiPreset;exports.Base64Input=G.Base64Input;exports.Base64sInput=G.Base64sInput;exports.ColorSwatchInput=G.ColorSwatchInput;exports.EditableText=G.EditableText;exports.NullableDateInput=G.NullableDateInput;exports.NullableDateTimeInput=G.NullableDateTimeInput;exports.NullableEmailInput=G.NullableEmailInput;exports.NullablePasswordInput=G.NullablePasswordInput;exports.NullableRatingInput=G.NullableRatingInput;exports.NullableSliderInput=G.NullableSliderInput;exports.NullableTextArea=G.NullableTextArea;exports.NullableTextInput=G.NullableTextInput;exports.NullableUrlInput=G.NullableUrlInput;exports.NullableUuidInput=G.NullableUuidInput;exports.RatingInput=G.RatingInput;exports.SliderInput=G.SliderInput;exports.Switch=G.Switch;exports.emptyToNull=G.emptyToNull;exports.fileToBase64=G.fileToBase64;exports.forFormat=G.forFormat;exports.forTypeAndFormat=G.forTypeAndFormat;exports.forXUI=G.forXUI;exports.nullToEmpty=G.nullToEmpty;exports.sessionId=Te.sessionId;exports.BooleanValidator=Ee.BooleanValidator;exports.ConfirmModal=Ee.ConfirmModal;exports.FocusTrap=Ee.FocusTrap;exports.Modal=Ee.Modal;exports.ObjectValidator=Ee.ObjectValidator;exports.Overlay=Ee.Overlay;exports.StringValidator=Ee.StringValidator;exports.boolean=Ee.boolean;exports.createStandardSchema=Ee.createStandardSchema;exports.object=Ee.object;exports.string=Ee.string;exports.useFocusTrap=Ee.useFocusTrap;exports.Button=ne.Button;exports.InputContainer=ne.InputContainer;exports.InputIcon=ne.InputIcon;exports.generateButtonClasses=ne.generateButtonClasses;exports.generateButtonStyles=ne.generateButtonStyles;exports.generateInputContainerInputClasses=ne.generateInputContainerInputClasses;exports.BaseListControl=ae.BaseListControl;exports.BaseNativeSelectControl=ae.BaseNativeSelectControl;exports.Expando=ae.Expando;exports.FilesInput=ae.FilesInput;exports.Group=ae.Group;exports.ListControl=ae.ListControl;exports.ListInput=ae.ListInput;exports.ListItemControls=ae.ListItemControls;exports.MaskInput=ae.MaskInput;exports.NativeSelect=ae.NativeSelect;exports.NativeSelectControl=ae.NativeSelectControl;exports.NullableDurationInput=ae.NullableDurationInput;exports.NullableNumberInput=ae.NullableNumberInput;exports.NumberInput=ae.NumberInput;exports.SegmentedInput=ae.SegmentedInput;exports.TextArea=ae.TextArea;exports.UnionController=ae.UnionController;exports.UnstyledDropZone=ae.UnstyledDropZone;exports.UrlInput=ae.UrlInput;exports.UuidInput=ae.UuidInput;exports.WithTemporal=ae.WithTemporal;exports.deepMergeDefaults=ae.deepMergeDefaults;exports.emitExpando=ae.emitExpando;exports.emitOptionExpando=ae.emitOptionExpando;exports.ensureTemporal=ae.ensureTemporal;exports.transformEmptyStringToUndefined=ae.transformEmptyStringToUndefined;exports.transformNullToUndefined=ae.transformNullToUndefined;exports.transformUndefinedToNull=ae.transformUndefinedToNull;exports.DangerLabel=Je.DangerLabel;exports.EmphasisLabel=Je.EmphasisLabel;exports.Label=Je.Label;exports.MutedLabel=Je.MutedLabel;exports.Stack=Je.Stack;exports.Flyout=Ve.Flyout;exports.Menu=Ve.Menu;exports.MenuItem=Ve.MenuItem;exports.MenuSeparator=Ve.MenuSeparator;exports.CommonInputAttributes=Fe.CommonInputAttributes;exports.TextInput=Fe.TextInput;exports.mapInputOptions=Fe.mapInputOptions;exports.BigintInput=je.BigintInput;exports.DurationInput=je.DurationInput;exports.FileInput=je.FileInput;exports.NullableBigintInput=je.NullableBigintInput;exports.NullablePlainDateInput=je.NullablePlainDateInput;exports.NullablePlainDateTimeInput=je.NullablePlainDateTimeInput;exports.NullablePlainTimeInput=je.NullablePlainTimeInput;exports.PlainDateInput=je.PlainDateInput;exports.PlainDateTimeInput=je.PlainDateTimeInput;exports.PlainTimeInput=je.PlainTimeInput;exports.Card=$t.Card;exports.CardBody=$t.CardBody;exports.CardCoverImage=$t.CardCoverImage;exports.CardFooter=$t.CardFooter;exports.CardHeader=$t.CardHeader;exports.EmailInput=ga.EmailInput;exports.Notice=ga.Notice;exports.PasswordInput=ga.PasswordInput;exports.LinkPortal=Ir.LinkPortal;exports.Toolbar=xt.Toolbar;exports.ToolbarButton=xt.ToolbarButton;exports.ToolbarDivider=xt.ToolbarDivider;exports.ToolbarGroup=xt.ToolbarGroup;exports.ToolbarSpacer=xt.ToolbarSpacer;exports.Accordion=gl;exports.ActionCard=yl;exports.AlertDialog=ts;exports.Align=zl;exports.AlphaChannelPicker=vt;exports.AnnouncementBar=Zo;exports.AppShell=Al;exports.AppearanceSelector=Mn;exports.AutoColorBadge=Yr;exports.Avatar=Ar;exports.AvatarGroup=Rr;exports.AvatarGroupOverflow=zr;exports.Badge=it;exports.BaseComboboxControl=Gn;exports.BaseComboboxTagsControl=Ss;exports.BaseDropdownControl=zn;exports.BaseMultiSelectControl=pl;exports.BaseSelectTagsControl=ws;exports.BaseVideoPlayer=Fc;exports.BeatUI=Ei;exports.BlockCommandPalette=Qo;exports.Breadcrumbs=hc;exports.ButtonLink=vc;exports.Carousel=Ac;exports.Center=Nl;exports.CenterH=Bl;exports.ChannelPicker=Be;exports.Chips=Oa;exports.Collapse=Ot;exports.CollapsibleSidebarGroup=kc;exports.ColorController=Yn;exports.ColorField=yt;exports.ColorInput=Nn;exports.ColumnFilter=ot;exports.ColumnFilterPanel=St;exports.ColumnHeaderMenu=Dn;exports.ComboboxControl=_s;exports.ComboboxInput=jn;exports.ComboboxTagsControl=Vs;exports.ComboboxTagsInput=Pa;exports.ConfirmationDialog=Jo;exports.CopyButton=Il;exports.DataTable=So;exports.DataToolbar=bn;exports.DateInput=Is;exports.DatePicker=st;exports.DateRangePicker=rn;exports.DateRangeSelect=$s;exports.DateRangeSelectShell=Pt;exports.DateSelect=Ds;exports.DateTimeInput=Ps;exports.DateTimeSelect=ci;exports.DateTimeSelectShell=It;exports.Divider=Wl;exports.Drawer=zo;exports.DropdownBase=Da;exports.DropdownControl=ks;exports.DropdownInput=Rn;exports.EmptyState=sc;exports.EnsureControl=wi;exports.Fieldset=xi;exports.Filter=Oe;exports.FormStatus=Ci;exports.FormatBigInt=Ui;exports.FormatDate=Hi;exports.FormatDateTime=Zi;exports.FormatDisplayName=ac;exports.FormatFileSize=lc;exports.FormatList=ec;exports.FormatNumber=Mi;exports.FormatPlural=rc;exports.FormatRelativeTime=Qi;exports.FormatTime=qi;exports.Gap=Rl;exports.Grow=ql;exports.HexColorPicker=ms;exports.HistoryTimeline=Kr;exports.HslColorPicker=fs;exports.HwbColorPicker=gs;exports.Indicator=Qr;exports.InputAdornment=Es;exports.InstantInput=mi;exports.Justify=Hl;exports.Kbd=Ro;exports.LazyNativeSelect=Fs;exports.Lightbox=qo;exports.Link=ir;exports.LoadingOverlay=Pn;exports.LocaleSelector=Di;exports.MultiSelect=jt;exports.MultiSelectControl=ml;exports.NativePdfPreview=Fi;exports.NavigationLink=bc;exports.NavigationProgress=xc;exports.NineSliceScrollView=Ul;exports.NoWrap=Gl;exports.Notification=Xn;exports.NotificationPanel=dc;exports.NotificationProvider=Ea;exports.NotificationService=Qn;exports.NotificationViewport=Jn;exports.NullableColorInput=vs;exports.NullableColorSwatchInput=ys;exports.NullableDateSelect=Os;exports.NullableDateTimeSelect=di;exports.NullableInstantInput=fi;exports.NullableMaskInput=Ls;exports.NullablePlainMonthDayInput=_i;exports.NullablePlainYearMonthInput=yi;exports.NullableTimeSelect=si;exports.NullableZonedDateTimeInput=bi;exports.NumberStepper=Bs;exports.OklchColorPicker=bs;exports.OnboardingTour=ls;exports.OpenDateRangeSelect=xs;exports.OpenGraph=uc;exports.Option=We;exports.OtpInput=li;exports.PDFJSPreview=Li;exports.PageDropZone=Jr;exports.Pagination=gn;exports.PdfPageViewer=jc;exports.PlainMonthDayInput=ki;exports.PlainYearMonthInput=vi;exports.Popover=Ho;exports.PresenceCursor=sn;exports.PresenceHighlight=el;exports.PresenceSelectionMark=tl;exports.ProgressBar=al;exports.PromptDialog=as;exports.RadioGroup=Xs;exports.RangeSlider=ti;exports.RgbColorPicker=hs;exports.Ribbon=Go;exports.ScrollablePanel=ua;exports.SegmentedSelect=js;exports.SelectAllCheckbox=Tn;exports.SelectTagsControl=Cs;exports.SelectTagsInput=Ta;exports.SelectionCheckbox=xa;exports.Sidebar=yc;exports.SidebarActiveLink=pr;exports.SidebarClickLink=mr;exports.SidebarContext=ur;exports.SidebarGroup=fa;exports.SidebarLink=hr;exports.SidebarSeparator=_c;exports.SidebarUrlLink=dr;exports.Sink=Kl;exports.Skeleton=nl;exports.SortableHeader=In;exports.SortableList=Ns;exports.Spotlight=cs;exports.StandaloneAppearanceSelector=No;exports.StatCard=xo;exports.StatCardIcon=Po;exports.StatCardLabel=Oo;exports.StatCardSparkline=Eo;exports.StatCardTrend=To;exports.StatCardValue=Do;exports.Stepper=Tc;exports.StylePortal=ic;exports.Table=pn;exports.Tabs=Vc;exports.TagInput=qs;exports.TagsInput=Ys;exports.TimePicker=gt;exports.TimeSelect=oi;exports.TimeSelectShell=Vt;exports.ToggleButton=wn;exports.ToggleButtonGroup=Ol;exports.Tooltip=ft;exports.TransferList=Us;exports.TreeView=Dc;exports.TriStateCheckboxInput=On;exports.VirtualList=Mo;exports.WithBeatUIBreakpoint=_n;exports.WithBeatUIElementBreakpoint=Sl;exports.WithBreakpoint=Va;exports.Wrap=jl;exports.ZonedDateTimeInput=gi;exports.colorInputOptionsFromController=Ii;exports.compareBreakpoint=kn;exports.createCarousel=vr;exports.createColorController=Vi;exports.createDataSource=mn;exports.createLocationMatcher=qt;exports.createSpotlight=Wn;exports.createStepper=gr;exports.delaySignal=$r;exports.describeBuiltinFilter=ya;exports.describeBuiltinFilterLocalized=_a;exports.describeFilter=ka;exports.describeFilterLocalized=Ht;exports.downloadContent=xr;exports.downloadFile=Or;exports.downloadUrl=ba;exports.downloadUrlAndMonitor=Dr;exports.drawCheckerboard=ct;exports.drawHueCanvas=Gt;exports.evaluateBuiltinFilter=zt;exports.evaluateFilterExpr=Wt;exports.findBreakpoint=wl;exports.formatBigInt=Wi;exports.formatDate=zi;exports.formatDateTime=Ki;exports.formatDisplayName=tc;exports.formatList=Ji;exports.formatNumber=Bi;exports.formatPlural=nc;exports.formatRelativeTime=Xi;exports.formatTime=Gi;exports.formatTime12=Fn;exports.formatTime12WithSeconds=An;exports.formatTime24=Ln;exports.formatTime24WithSeconds=Bn;exports.formatTimeAuto=Tt;exports.generateBadgeClasses=ln;exports.generateBadgeStyles=on;exports.generateLinkClasses=ma;exports.generateLinkStyles=ha;exports.generateNotificationClasses=Kn;exports.generateNotificationStyles=Zn;exports.generatePaginationRange=hn;exports.generatePaginationStyles=fn;exports.generateProgressBarClasses=cn;exports.generateProgressBarStyles=un;exports.generateSkeletonClasses=ia;exports.generateSkeletonStyles=dn;exports.increaseSize=Tr;exports.inferValueType=va;exports.isBuiltinFilter=Dt;exports.isUrlMatch=cr;exports.localeUses12Hour=bt;exports.renderDetailRow=$a;exports.renderToggleCell=Ia;exports.renderToggleFilterCell=xn;exports.renderToggleHeaderCell=$n;exports.resolvePluralCategory=sr;
1
+ "use strict";var wr=Object.create;var Ba=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Vr=Object.getPrototypeOf,Ir=Object.prototype.hasOwnProperty;var $r=(t,a,n,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of Sr(a))!Ir.call(t,l)&&l!==n&&Ba(t,l,{get:()=>a[l],enumerable:!(r=Cr(a,l))||r.enumerable});return t};var xr=(t,a,n)=>(n=t!=null?wr(Vr(t)):{},$r(a||!t||!t.__esModule?Ba(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tempots/dom"),Ce=require("@tempots/ui"),C=require("./translations-EwEmHe3v.cjs"),fe=require("./colors-DPCHjRMj.cjs"),L=require("./index-DeUj-5ph.cjs"),oe=require("./use-form-Dcra7GeE.cjs"),we=require("@tempots/std"),He=require("./use-animated-toggle-cKcuItmz.cjs"),St=require("./theme-DogY9oT1.cjs"),tn=require("./tailwind/preset.cjs.js"),G=require("./widget-customization-pqmtsraC.cjs"),Pe=require("./session-id-B5lJMzbB.cjs"),Ee=require("./custom-validation-CLscGHY4.cjs"),ne=require("./input-container-CyOgiiQD.cjs"),ae=require("./deep-merge-D90SW1Ci.cjs"),et=require("./stack-dwLevGa2.cjs"),Ie=require("./menu-B60Q9j3-.cjs"),Fe=require("./text-input-DS5zlXb2.cjs"),je=require("./duration-input-4AQnQpyo.cjs"),xt=require("./utils-DmEuG3Np.cjs"),ba=require("./notice-p2IqXS5-.cjs"),Dr=require("./link-portal-_tiDFZqh.cjs"),Dt=require("./toolbar-BBwfe8U9.cjs");function Or(t,a=0,n=()=>!0){let r=null,l;const s=e.prop(t.value);return t.on(u=>{l=u,n(u)?r==null&&(r=setTimeout(()=>{r=null,s.set(l)},a)):s.set(u)}),t.onDispose(()=>{r!=null&&clearTimeout(r)}),s}const va=async(t,a="")=>{try{const r=await(await fetch(t)).blob(),l=URL.createObjectURL(r),s=document.createElement("a");s.href=l,s.download=a,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(l)}catch{window.open(t,"_blank")}},Tr=(t,a,n="application/octet-stream")=>{const r=new Blob([t],{type:n});va(URL.createObjectURL(r),a),URL.revokeObjectURL(URL.createObjectURL(r))},Pr=t=>{const a=new AbortController,n=e.prop({type:"progress",value:0});let r=!1;return(async()=>{try{const l=await fetch(t,{signal:a.signal});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const s=l.headers.get("content-length"),u=s?parseInt(s,10):void 0,o=(async()=>{if(u===void 0||isNaN(u))return n.set({type:"undetermined"}),await l.blob();{const f=new Uint8Array(u);if(l.body==null)throw new Error("Response body is null");const h=l.body.getReader();let d=0;for(;;){const{done:g,value:p}=await h.read();if(g)break;f.set(p,d),d+=p.length,n.set({type:"progress",value:Math.min(d/u,1)})}return new Blob([f],{type:l.headers.get("content-type")??void 0})}})(),c=t.split("/").pop()||"download",i=await o,m=new File([i],c,{type:i.type});r=!0,n.set({type:"done",file:m})}catch(l){n.set({type:"error",error:l})}finally{r=!0,n.dispose()}})(),{signal:n,cancel:()=>{r||a.abort()}}},Er=t=>{va(URL.createObjectURL(t),t.name)},Zt=["xs","sm","md","lg","xl"];function Fr(t,a=1){const n=Zt.indexOf(t);if(n===-1)throw new Error(`Invalid size: ${t}`);const r=Math.min(Math.max(n+a,0),Zt.length-1);return Zt[r]}const Lr={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl","2xl":"xl"};function Ar(t){const a=t.trim().split(/\s+/);return a.length===1?a[0][0].toUpperCase():(a[0][0]+a[a.length-1][0]).toUpperCase()}function Br(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--avatar-bg: ${a.backgroundColor}`,`--avatar-text: ${a.textColor}`,`--avatar-bg-dark: ${n.backgroundColor}`,`--avatar-text-dark: ${n.textColor}`].join("; ")}function Mr(t,a,n){const r=["bc-avatar",`bc-avatar--size-${t}`,`bc-avatar--${a}`];return n&&r.push("bc-avatar--bordered"),r.join(" ")}function Nr({src:t,name:a,icon:n,size:r="md",variant:l="circle",color:s="base",bordered:u=!1,borderColor:o},...c){const i=e.Value.map(e.Value.toSignal(r),f=>Lr[f??"md"]),m=e.html.span(e.attr.class("bc-avatar__icon"),C.Icon({icon:"mdi:account",size:i}));return e.html.div(e.attr.class(e.computedOf(r,l,u,o)((f,h,d,g)=>Mr(f??"md",h??"circle",(d??!1)||g!=null))),e.attr.style(e.computedOf(s,o)((f,h)=>{const d=Br(f??"base");if(h==null)return d;const g=fe.getColorVar(h,500),p=fe.getColorVar(h,400);return`${d}; --avatar-border-color: ${g}; --avatar-border-color-dark: ${p}`})),e.Ensure(t,f=>e.html.img(e.attr.class("bc-avatar__image"),e.attr.src(f),e.attr.alt(a!=null?e.Value.map(a,h=>h??"Avatar"):"Avatar")),()=>e.Ensure(a,f=>e.html.span(e.attr.class("bc-avatar__initials"),f.map(Ar)),()=>e.Ensure(n,f=>e.html.span(e.attr.class("bc-avatar__icon"),C.Icon({icon:f,size:i})),()=>m))),...c)}const Je=20,ot=7;function Wr(t,a){const n=["bc-date-picker",`bc-date-picker--size-${t}`];return a&&n.push("bc-date-picker--disabled"),n.join(" ")}function Ur(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark"),r=C.backgroundValue(t,"light","light"),l=C.backgroundValue(t,"light","dark");return[`--cal-selected-bg: ${a.backgroundColor}`,`--cal-selected-text: ${a.textColor}`,`--cal-selected-bg-dark: ${n.backgroundColor}`,`--cal-selected-text-dark: ${n.textColor}`,`--cal-today-bg: ${r.backgroundColor}`,`--cal-today-text: ${r.textColor}`,`--cal-today-bg-dark: ${l.backgroundColor}`,`--cal-today-text-dark: ${l.textColor}`].join("; ")}function an(t,a,n,r,l,s){const u=t.PlainDate.from({year:a,month:n,day:1}),o=u.daysInMonth,i=(u.dayOfWeek%7-r+ot)%ot,m=u.subtract({months:1}),f=m.daysInMonth,h=[],d=(p,b,k)=>{h.push({day:b,date:p,inMonth:k,isToday:p.equals(l),isDisabled:s?.(p)??!1})};for(let p=i-1;p>=0;p--){const b=f-p;d(m.with({day:b}),b,!1)}for(let p=1;p<=o;p++)d(t.PlainDate.from({year:a,month:n,day:p}),p,!0);const g=ot-h.length%ot;if(g<ot){const p=u.add({months:1});for(let b=1;b<=g;b++)d(p.with({day:b}),b,!1)}return h}function nn(t,a,n,r,l,s){const u=t.Now.plainDateISO(),o=e.prop(a),c=e.prop(n),i=e.prop("days"),m=e.prop(Math.floor(a/Je)*Je),f=e.computedOf(l,s)((h,d)=>{const g=[];for(let p=0;p<ot;p++)g.push(d[(p+h)%ot]);return g});return{today:u,currentYear:o,currentMonth:c,view:i,yearPageStart:m,shiftedDayNames:f,prevMonth:()=>{if(e.Value.get(r))return;const h=c.value,d=o.value;h===1?(c.set(12),o.set(d-1)):c.set(h-1)},nextMonth:()=>{if(e.Value.get(r))return;const h=c.value,d=o.value;h===12?(c.set(1),o.set(d+1)):c.set(h+1)},prevYear:()=>{e.Value.get(r)||o.update(h=>h-1)},nextYear:()=>{e.Value.get(r)||o.update(h=>h+1)},prevYearPage:()=>{e.Value.get(r)||m.update(h=>h-Je)},nextYearPage:()=>{e.Value.get(r)||m.update(h=>h+Je)},switchToMonthsView:()=>{e.Value.get(r)||i.set("months")},switchToYearsView:()=>{if(e.Value.get(r))return;const h=o.value;m.set(Math.floor(h/Je)*Je),i.set("years")},selectMonth:h=>{e.Value.get(r)||(c.set(h),i.set("days"))},selectYear:h=>{e.Value.get(r)||(o.set(h),i.set("months"))}}}function rn(t,a,n){const{size:r,disabled:l,color:s,ariaLabel:u}=a,{today:o,currentYear:c,currentMonth:i,view:m,yearPageStart:f,prevMonth:h,nextMonth:d,prevYear:g,nextYear:p,prevYearPage:b,nextYearPage:k,switchToMonthsView:y,switchToYearsView:_,selectMonth:v,selectYear:w}=t;return e.Use(C.BeatUII18n,I=>{const S=I.$.datePicker;return e.html.div(e.attr.class(e.computedOf(r,l)(Wr)),e.attr.style(e.Value.map(s,Ur)),e.attr.role("grid"),e.aria.label(u),e.OneOfValue(m,{days:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYear),e.on.click(V=>{V.preventDefault(),g()}),"«"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousMonth),e.on.click(V=>{V.preventDefault(),h()}),"‹"),e.html.div(e.attr.class("bc-date-picker__title"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__title-btn"),e.attr.disabled(l),e.aria.label(S.$.selectMonth),e.on.click(V=>{V.preventDefault(),y()}),e.computedOf(i,S.$.monthNames)((V,D)=>D[V-1])),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__title-btn"),e.attr.disabled(l),e.aria.label(S.$.selectYear),e.on.click(V=>{V.preventDefault(),_()}),e.Value.map(c,String))),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextMonth),e.on.click(V=>{V.preventDefault(),d()}),"›"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYear),e.on.click(V=>{V.preventDefault(),p()}),"»")),months:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYear),e.on.click(V=>{V.preventDefault(),g()}),"«"),e.html.span(e.attr.class("bc-date-picker__title"),e.Value.map(c,String)),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYear),e.on.click(V=>{V.preventDefault(),p()}),"»")),years:()=>e.html.div(e.attr.class("bc-date-picker__nav"),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.previousYears.map(V=>V(Je))),e.on.click(V=>{V.preventDefault(),b()}),"«"),e.html.span(e.attr.class("bc-date-picker__title"),e.Value.map(f,V=>`${V} – ${V+Je-1}`)),e.html.button(e.attr.type("button"),e.attr.class("bc-date-picker__nav-btn"),e.attr.disabled(l),e.aria.label(S.$.nextYears.map(V=>V(Je))),e.on.click(V=>{V.preventDefault(),k()}),"»"))}),e.OneOfValue(m,{days:()=>e.html.div(e.attr.class("bc-date-picker__days-view"),e.html.div(e.attr.class("bc-date-picker__weekdays"),e.ForEach(t.shiftedDayNames,V=>e.html.div(e.attr.class("bc-date-picker__weekday"),V))),n()),months:()=>e.html.div(e.attr.class("bc-date-picker__picker-grid bc-date-picker__picker-grid--months"),...Array.from({length:12},(V,D)=>{const $=D+1;return e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(i,c)((x,N)=>{const H=["bc-date-picker__month-cell"];return x===$&&H.push("bc-date-picker__month-cell--current"),o.month===$&&o.year===N&&H.push("bc-date-picker__month-cell--active"),H.join(" ")})),e.attr.disabled(l),e.on.click(x=>{x.preventDefault(),v($)}),S.$.shortMonthNames.map(x=>x[D]))})),years:()=>e.html.div(e.attr.class("bc-date-picker__picker-grid bc-date-picker__picker-grid--years"),e.ForEach(e.Value.map(f,V=>{const D=[];for(let $=0;$<Je;$++)D.push(V+$);return D}),V=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(c,V)((D,$)=>{const x=["bc-date-picker__year-cell"];return D===$&&x.push("bc-date-picker__year-cell--current"),o.year===$&&x.push("bc-date-picker__year-cell--active"),x.join(" ")})),e.attr.disabled(l),e.on.click(D=>{D.preventDefault(),w(e.Value.get(V))}),e.Value.map(V,String))))}))})}function Rr(t,{value:a=null,onSelect:n,isDateDisabled:r,color:l="primary",size:s="md",disabled:u=!1,weekStartsOn:o=0}){return e.Use(C.BeatUII18n,c=>{const i=a!=null?e.Value.get(a):null,m=nn(t,i?.year??t.Now.plainDateISO().year,i?.month??t.Now.plainDateISO().month,u,o,c.$.datePicker.$.dayNames),f=e.Value.toSignal(o),h=e.computedOf(m.currentYear,m.currentMonth,a,f)((d,g,p,b)=>an(t,d,g,b,m.today,r).map(k=>({...k,isSelected:p!=null&&k.date.equals(p)})));return rn(m,{size:s,disabled:u,color:l,ariaLabel:c.$.datePicker.$.label},()=>e.html.div(e.attr.class("bc-date-picker__grid"),e.ForEach(h,d=>{const g=d.map(k=>{const y=["bc-date-picker__day"];return k.inMonth||y.push("bc-date-picker__day--outside"),k.isToday&&y.push("bc-date-picker__day--today"),k.isSelected&&y.push("bc-date-picker__day--selected"),k.isDisabled&&y.push("bc-date-picker__day--disabled"),y.join(" ")}),p=d.map(k=>k.isDisabled),b=d.map(k=>String(k.day));return e.html.button(e.attr.type("button"),e.attr.class(g),e.attr.disabled(e.computedOf(p,u)((k,y)=>k||y)),e.on.click(k=>{k.preventDefault();const y=e.Value.get(d);!y.isDisabled&&!e.Value.get(u)&&(y.inMonth||(m.currentYear.set(y.date.year),m.currentMonth.set(y.date.month)),n?.(y.date))}),b)})))})}function it(t){return ae.WithTemporal(a=>Rr(a,t??{}))}function zr(t,{value:a=null,onChange:n,isDateDisabled:r,color:l="primary",size:s="md",disabled:u=!1,weekStartsOn:o=0}){return e.Use(C.BeatUII18n,c=>{const i=a!=null?e.Value.get(a):null,m=nn(t,i?.[0]?.year??t.Now.plainDateISO().year,i?.[0]?.month??t.Now.plainDateISO().month,u,o,c.$.datePicker.$.dayNames),f=e.Value.toSignal(o),h=e.prop(null),d=e.prop(null);a!=null&&e.Value.on(a,()=>{h.set(null)});const g=e.computedOf(m.currentYear,m.currentMonth,a,h,d,f)((p,b,k,y,_,v)=>{let w=null,I=null,S=!1;if(y!=null&&_!=null){const V=t.PlainDate.compare(y,_);w=V<=0?y:_,I=V<=0?_:y,S=!0}else k!=null&&(w=k[0],I=k[1]);return an(t,p,b,v,m.today,r).map(V=>{let D=!1,$=!1,x=!1;return w!=null&&I!=null&&(D=V.date.equals(w),$=V.date.equals(I),x=t.PlainDate.compare(V.date,w)>0&&t.PlainDate.compare(V.date,I)<0),{...V,isRangeStart:D,isRangeEnd:$,isInRange:x,isPreview:S}})});return rn(m,{size:s,disabled:u,color:l,ariaLabel:c.$.datePicker.$.dateRangePickerLabel},()=>e.html.div(e.attr.class("bc-date-picker__grid"),e.on.mouseleave(()=>{d.set(null)}),e.ForEach(g,p=>{const b=p.map(_=>{const v=["bc-date-picker__day"];return _.inMonth||v.push("bc-date-picker__day--outside"),_.isToday&&v.push("bc-date-picker__day--today"),_.isDisabled&&v.push("bc-date-picker__day--disabled"),_.isRangeStart&&v.push("bc-date-picker__day--range-start"),_.isRangeEnd&&v.push("bc-date-picker__day--range-end"),_.isInRange&&v.push("bc-date-picker__day--in-range"),_.isPreview&&(_.isRangeStart||_.isRangeEnd||_.isInRange)&&v.push("bc-date-picker__day--preview"),v.join(" ")}),k=p.map(_=>_.isDisabled),y=p.map(_=>String(_.day));return e.html.button(e.attr.type("button"),e.attr.class(b),e.attr.disabled(e.computedOf(k,u)((_,v)=>_||v)),e.on.mouseenter(()=>{const _=e.Value.get(p);!_.isDisabled&&!e.Value.get(u)&&d.set(_.date)}),e.on.click(_=>{_.preventDefault();const v=e.Value.get(p);if(v.isDisabled||e.Value.get(u))return;v.inMonth||(m.currentYear.set(v.date.year),m.currentMonth.set(v.date.month));const w=h.value;if(w==null)h.set(v.date);else{const S=t.PlainDate.compare(w,v.date)<=0?[w,v.date]:[v.date,w];h.set(null),d.set(null),n?.(S)}}),y)})))})}function ln(t){return ae.WithTemporal(a=>zr(a,t??{}))}function Hr(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--avatar-bg: ${a.backgroundColor}`,`--avatar-text: ${a.textColor}`,`--avatar-bg-dark: ${n.backgroundColor}`,`--avatar-text-dark: ${n.textColor}`].join("; ")}function jr({size:t="md",spacing:a="tight"},...n){return e.html.div(e.attr.class(e.computedOf(t,a)((r,l)=>["bc-avatar-group",`bc-avatar-group--size-${r??"md"}`,`bc-avatar-group--spacing-${l??"tight"}`].join(" "))),...n)}function qr({count:t,size:a="md",color:n="base"}){return e.html.div(e.attr.class(e.Value.map(a,r=>["bc-avatar",`bc-avatar--size-${r??"md"}`,"bc-avatar--circle","bc-avatar-group__overflow"].join(" "))),e.attr.style(e.Value.map(n,r=>Hr(r??"base"))),e.html.span(e.attr.class("bc-avatar__initials"),e.Value.map(t,r=>`+${r??0}`)))}const Ma={min:0,max:360},Na={min:50,max:80},Wa={min:40,max:65};function Gr(t){let a=5381;for(let n=0;n<t.length;n++)a=(a<<5)+a+t.charCodeAt(n)|0;return a>>>0}function Xt(t,a,n,r){const l=(t*2654435761+a*2246822519>>>0)%1e4;return n+l/1e4*(r-n)}function Yr(t){return t>56?"#000":"#fff"}function Kr(t,a,n,r){const l=t.trim();if(l==="")return"";const s=Gr(l),u=Xt(s,1,a.min,a.max),o=Xt(s,2,n.min,n.max),c=Xt(s,3,r.min,r.max),i=Yr(c);return`background-color: hsl(${u.toFixed(1)} ${o.toFixed(1)}% ${c.toFixed(1)}%); color: ${i}`}function Zr(t,a){return["bc-auto-color-badge",`bc-badge--size-${t}`,`bc-control--rounded-${a}`].join(" ")}function Xr(t={},...a){const{size:n="md",roundedness:r="full",text:l,hue:s=Ma,saturation:u=Na,lightness:o=Wa}=t,c=l??e.prop(""),i=e.computedOf(c,s,u,o)((m,f,h,d)=>Kr(m??"",f??Ma,h??Na,d??Wa));return e.html.span(e.attr.class(e.computedOf(n,r)((m,f)=>Zr(m??"md",f??"full"))),e.attr.style(i),e.html.span(e.attr.class("bc-badge__content"),...a),e.When(e.Value.map(l,m=>m==null),()=>e.WithElement(m=>{const f=c;f.set(m.textContent??"");const h=new MutationObserver(()=>{f.set(m.textContent??"")});return h.observe(m,{childList:!0,subtree:!0,characterData:!0}),e.OnDispose(()=>h.disconnect())})))}function on(t,a,n,r,l){const s=["bc-badge",`bc-badge--size-${t}`,`bc-control--rounded-${a}`];return n&&s.push("bc-badge--circle"),r&&s.push("bc-badge--full-width"),l&&s.push("bc-badge--disabled"),s.join(" ")}function sn(t,a){const n=new Map,r=(l,s,u,o)=>{n.set("--badge-bg-hover",l),n.set("--badge-text-hover",u),n.set("--badge-bg-hover-dark",s),n.set("--badge-text-hover-dark",o)};switch(t){case"filled":{const l=C.backgroundValue(a,"solid","light"),s=C.backgroundValue(a,"solid","dark"),u=C.hoverBackgroundValue(a,"soft","light"),o=C.hoverBackgroundValue(a,"soft","dark");n.set("--badge-bg",l.backgroundColor),n.set("--badge-text",l.textColor),n.set("--badge-bg-dark",s.backgroundColor),n.set("--badge-text-dark",s.textColor),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}case"light":{const l=C.backgroundValue(a,"light","light"),s=C.backgroundValue(a,"light","dark"),u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg",l.backgroundColor),n.set("--badge-text",l.textColor),n.set("--badge-bg-dark",s.backgroundColor),n.set("--badge-text-dark",s.textColor),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}case"outline":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),u=C.borderColorValue(a,"light"),o=C.borderColorValue(a,"dark"),c=C.hoverBackgroundValue(a,"light","light"),i=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border",u),n.set("--badge-border-dark",o),r(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor);break}case"default":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","var(--bg-background-light)"),n.set("--badge-text",l),n.set("--badge-bg-dark","var(--bg-background-dark)"),n.set("--badge-text-dark",s),n.set("--badge-border","var(--border-border-light)"),n.set("--badge-border-dark","var(--border-border-dark)"),r(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}case"dashed":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),u=C.borderColorValue(a,"light"),o=C.borderColorValue(a,"dark"),c=C.hoverBackgroundValue(a,"light","light"),i=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border",u),n.set("--badge-border-dark",o),n.set("--badge-border-style","dashed"),r(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor);break}case"subtle":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}case"text":{const l=C.textColorValue(a,"light"),s=C.textColorValue(a,"dark"),u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");n.set("--badge-bg","transparent"),n.set("--badge-text",l),n.set("--badge-bg-dark","transparent"),n.set("--badge-text-dark",s),n.set("--badge-border","transparent"),n.set("--badge-border-dark","transparent"),r(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}}return Array.from(n.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function ct({variant:t="filled",size:a="md",color:n="base",roundedness:r="full",circle:l=!1,fullWidth:s=!1,onClose:u,disabled:o=!1},...c){return e.html.span(e.attr.class(e.computedOf(a,r,l,s,o)((i,m,f,h,d)=>on(i??"md",m??"sm",f??!1,h??!1,d??!1))),e.attr.style(e.computedOf(t,n)((i,m)=>sn(i??"filled",m??"base"))),e.html.span(e.attr.class("bc-badge__content"),...c),u!=null?e.Use(C.BeatUII18n,i=>e.html.button(e.attr.class("bc-badge__close"),e.attr.type("button"),e.attr.disabled(o),e.aria.label(i.$.removeItem),e.on.click(m=>{m.stopPropagation(),u()}),"×")):e.Empty)}function Qr(t){const{entries:a,filters:n}=t,r=e.prop("all"),l=e.computedOf(a,r)((o,c)=>c==="all"?o:o.filter(i=>{const m=i.action.toLowerCase();switch(c){case"deletions":return m.includes("delet");case"edits":return m.includes("edit");case"schema":return m.includes("schema");case"restorable":return i.restorable===!0;default:return!0}})),u=n??[{value:"all",label:"All"},{value:"deletions",label:"Deletions"},{value:"edits",label:"Edits"},{value:"schema",label:"Schema changes"},{value:"restorable",label:"Restorable"}];return e.html.div(e.attr.class("bc-history-timeline"),e.html.div(e.attr.class("bc-history-timeline__filters"),...u.map(o=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(r)(c=>c===o.value?"bc-history-timeline__filter bc-history-timeline__filter--active":"bc-history-timeline__filter")),e.on.click(()=>r.set(o.value)),o.label))),e.html.div(e.attr.class("bc-history-timeline__list"),e.ForEach(l,o=>e.html.div(e.attr.class("bc-history-timeline__entry"),e.html.div(e.attr.class("bc-history-timeline__line"),e.html.div(e.attr.class("bc-history-timeline__dot"),e.attr.style(o.map(c=>`background: ${c.actionColor}`)))),e.html.div(e.attr.class("bc-history-timeline__content"),e.html.div(e.attr.class("bc-history-timeline__content-header"),e.html.span(e.attr.class("bc-history-timeline__action"),e.attr.style(o.map(c=>`color: ${c.actionColor}`)),o.$.action),e.html.span(e.attr.class("bc-history-timeline__time"),o.$.time)),e.html.div(e.attr.class("bc-history-timeline__target"),C.Icon({icon:o.$.targetIcon,size:"xs"}),e.html.span(o.$.target)),e.html.div(e.attr.class("bc-history-timeline__detail"),o.$.detail),e.html.div(e.attr.class("bc-history-timeline__footer"),e.html.div(e.attr.class("bc-history-timeline__actor"),e.html.div(e.attr.class("bc-history-timeline__avatar"),o.$.actor.$.initials),e.html.span(o.$.actor.$.name)),e.When(o.map(c=>c.restorable===!0&&c.onRestore!=null),()=>ne.Button({variant:"outline",size:"xs",onClick:()=>o.value.onRestore?.()},C.Icon({icon:"lucide:rotate-ccw",size:"xs"}),"Restore")))))),e.When(e.computedOf(l)(o=>o.length===0),()=>e.html.div(e.attr.class("bc-history-timeline__empty"),"No matching history entries"))))}function Jr(t,a,n){const r=["bc-indicator__badge",`bc-indicator--${t}`,`bc-indicator--size-${a}`];return n?r.push("bc-indicator--dot"):r.push("bc-indicator--count"),r.join(" ")}function el(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return[`--indicator-bg: ${a.backgroundColor}`,`--indicator-text: ${a.textColor}`,`--indicator-bg-dark: ${n.backgroundColor}`,`--indicator-text-dark: ${n.textColor}`].join("; ")}function tl({show:t=!0,count:a,maxCount:n=9,color:r="danger",placement:l="top-right",size:s="sm"},...u){const o=e.computedOf(t,a??0)((m,f)=>(m??!0)||f>0),c=e.computedOf(a??0)(m=>m<=0),i=e.computedOf(a??0,n)((m,f)=>m<=0?"":m>(f??9)?`${f??9}+`:String(m));return e.html.span(e.attr.class("bc-indicator"),...u,e.When(o,()=>e.html.span(e.attr.class(e.computedOf(l,s,c)((m,f,h)=>Jr(m??"top-right",f??"sm",h??!0))),e.attr.style(e.computedOf(r)(m=>el(m??"danger"))),i)))}function al({onChange:t,accept:a="*/*",onDragContent:n,content:r,onInvalidSelection:l,disabled:s=!1}){const u=e.prop(!1),o=e.prop([]);let c=null,i=0;const m=_=>_.dataTransfer?.types.includes("Files")??!1,f=(_,v)=>v==="*/*"?!0:v.split(",").map(I=>I.trim()).some(I=>{if(I==="*/*")return!0;if(I.endsWith("/*")){const S=I.slice(0,-2);return _.type.startsWith(S+"/")}return _.type===I||_.name.endsWith(I)}),h=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),i++,i===1&&(u.value=!0))},d=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),_.dataTransfer!=null&&(_.dataTransfer.dropEffect="copy"))},g=_=>{e.Value.get(s)||m(_)&&(_.preventDefault(),_.stopPropagation(),i--,i===0&&(u.value=!1))},p=_=>{if(e.Value.get(s)||!m(_))return;_.preventDefault(),_.stopPropagation(),i=0,u.value=!1;const v=Array.from(_.dataTransfer?.files??[]);if(v.length>0){const w=e.Value.get(a),I=v.filter(V=>f(V,w)),S=v.filter(V=>!I.includes(V));I.length>0&&(o.value=I,t(I,"dragdrop")),S.length>0&&l?.(v)}};typeof document<"u"&&(document.addEventListener("dragenter",h),document.addEventListener("dragover",d),document.addEventListener("dragleave",g),document.addEventListener("drop",p));const b=()=>{typeof document<"u"&&(document.removeEventListener("dragenter",h),document.removeEventListener("dragover",d),document.removeEventListener("dragleave",g),document.removeEventListener("drop",p)),i=0},k=()=>{c?.click()},y=_=>{const v=_.target,w=Array.from(v.files??[]);w.length>0&&(o.value=w,t(w,"click")),v.value=""};return e.Fragment(e.OnDispose(b),e.html.input(e.attr.type("file"),e.attr.name("bui-page-drop-zone"),e.attr.multiple(!0),e.attr.accept(a),e.style.position("absolute"),e.style.opacity("0"),e.style.pointerEvents("none"),e.style.width("0"),e.style.height("0"),e.on.change(y),e.WithElement(_=>(c=_,e.OnDispose(()=>{c!=null&&(c.value="")})))),n!=null?e.When(u,()=>n({files:o})):null,r!=null?r({isDragging:u,files:o,selectFiles:k}):null)}function cn(t){const{author:a,color:n}=t;return e.html.span(e.attr.class("bc-presence-cursor"),e.attr.style(`--presence-color: ${n}`),e.html.span(e.attr.class("bc-presence-cursor__bar")),e.html.span(e.attr.class("bc-presence-cursor__label"),a))}function nl(t,...a){return e.html.span(e.attr.class("bc-presence-highlight"),e.attr.style(`--presence-color: ${t.color}`),...a)}function rl(t,...a){const{author:n,color:r}=t;return e.html.span(e.attr.class("bc-presence-selection"),e.attr.style(`--presence-color: ${r}`),e.html.span(e.attr.class("bc-presence-highlight"),...a),cn({author:n,color:r}))}function un(t,a,n){const r=["bc-progress-bar",`bc-progress-bar--size-${t}`,`bc-control--rounded-${n}`];return a&&r.push("bc-progress-bar--indeterminate"),r.join(" ")}function dn(t){const a=new Map,n=C.backgroundValue(t,"solid","light"),r=C.backgroundValue(t,"solid","dark");return a.set("--progress-fill",n.backgroundColor),a.set("--progress-fill-dark",r.backgroundColor),Array.from(a.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function ll({value:t=0,max:a=100,size:n="md",color:r="primary",indeterminate:l=!1,showLabel:s=!1,roundedness:u="full"}){const o=e.computedOf(t,a)((m,f)=>{const h=m??0,d=f??100;return d>0?Math.min(Math.max(h/d*100,0),100):0}),c=e.Value.map(o,m=>`${Math.round(m)}%`),i=e.computedOf(o,l)((m,f)=>f??!1?"":`${m}%`);return e.html.div(e.attr.class("bc-progress-bar-wrapper"),e.html.div(e.attr.class(e.computedOf(n,l,u)((m,f,h)=>un(m??"md",f??!1,h??"full"))),e.attr.style(e.Value.map(r,m=>dn(m??"primary"))),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(a),e.aria.valuenow(t),e.aria.valuetext(c),e.html.div(e.attr.class("bc-progress-bar__track"),e.html.div(e.attr.class("bc-progress-bar__fill"),e.style.width(i)))),e.When(s,()=>e.html.div(e.attr.class("bc-progress-bar__label"),e.aria.hidden(!0),c),()=>{}))}function ca(t,a,n){const r=["bc-skeleton",`bc-skeleton--${t}`,`bc-control--rounded-${n}`];return a&&r.push("bc-skeleton--animate"),t==="circle"&&r.push("bc-skeleton--circle"),r.join(" ")}function pn(t,a,n){const r=[];return t!==void 0&&r.push(`width: ${t}`),a!==void 0?r.push(`height: ${a}`):n==="text"?r.push("height: 1em"):n==="circle"&&t!==void 0&&r.push(`height: ${t}`),r.join("; ")}function ol({variant:t="text",width:a,height:n,lines:r=1,animate:l=!0,roundedness:s="sm"}){const u=e.computedOf(t,r)((o,c)=>o==="text"&&(c??1)>1);return e.When(u,()=>e.html.div(e.attr.class("bc-skeleton__lines-container"),e.Repeat(r,o=>e.html.div(e.attr.class(e.computedOf(l,s)((c,i)=>ca("text",c??!0,i??"sm")+" bc-skeleton__line")),e.style.width(e.computedOf(o.isLast,a)((c,i)=>c&&i===void 0?"80%":i!==void 0?i:""))))),()=>e.html.div(e.attr.class(e.computedOf(t,l,s)((o,c,i)=>ca(o??"text",c??!0,i??"sm"))),e.attr.style(e.computedOf(a,n,t)((o,c,i)=>pn(o,c,i??"text"))),e.aria.hidden(!0)))}function sl(t,a,n,r,l,s){const u=["bc-table"];return t!=="md"&&u.push(`bc-table--size-${t}`),a&&u.push("bc-table--hoverable"),n&&u.push("bc-table--sticky-header"),r&&u.push("bc-table--with-striped-rows"),l&&u.push("bc-table--with-column-borders"),s&&u.push("bc-table--with-row-borders"),u.join(" ")}function il(t){if(t!=null)return t==="none"?"--table-border-radius: 0":`--table-border-radius: var(--radius-${t})`}function mn({size:t="md",hoverable:a=!1,stickyHeader:n=!1,fullWidth:r=!1,withStripedRows:l=!1,withTableBorder:s=!0,withColumnBorders:u=!1,withRowBorders:o=!0,borderRadius:c}={},...i){const m=e.computedOf(t,a,n,l,u,o)((d,g,p,b,k,y)=>sl(d??"md",g??!1,p??!1,b??!1,k??!1,y??!0)),f=e.computedOf(n,r,s)((d,g,p)=>{const b=["bc-table-container"];return d&&b.push("bc-table-container--sticky"),g&&b.push("bc-table-container--full-width"),p&&b.push("bc-table-container--with-table-border"),b.join(" ")}),h=e.computedOf(c)(d=>il(d));return e.html.div(e.attr.class(f),e.attr.style(h),e.html.table(e.attr.class(m),...i))}const cl=new Set(["text","compare","range","set","boolean","null","composite"]);function Ot(t){return cl.has(t.kind)}function ya(t){if(t instanceof Date)return"date";switch(typeof t){case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"boolean":return"boolean";default:return"string"}}function Qt(t,a,n){if(t==null&&a==null)return 0;if(t==null)return-1;if(a==null)return 1;switch(n){case"string":return String(t).localeCompare(String(a));case"number":return t-a;case"bigint":{const r=t-a;return r<0n?-1:r>0n?1:0}case"date":return t.getTime()-a.getTime();case"boolean":return(t?1:0)-(a?1:0);default:return String(t).localeCompare(String(a))}}function Jt(t,a,n){return n==="date"&&t instanceof Date&&a instanceof Date?t.getTime()===a.getTime():t===a}function Ht(t,a){switch(t.kind){case"text":{const n=t.caseSensitive??!1,r=a==null?"":String(a),l=t.value,s=n?r:r.toLowerCase(),u=n?l:l.toLowerCase();switch(t.operator){case"contains":return s.includes(u);case"notContains":return!s.includes(u);case"equals":return s===u;case"notEquals":return s!==u;case"startsWith":return s.startsWith(u);case"endsWith":return s.endsWith(u)}return!1}case"compare":{if(a==null)return!1;const n=Qt(a,t.value,t.valueType);switch(t.operator){case"eq":return Jt(a,t.value,t.valueType);case"neq":return!Jt(a,t.value,t.valueType);case"gt":return n>0;case"gte":return n>=0;case"lt":return n<0;case"lte":return n<=0}return!1}case"range":{if(a==null)return!1;const n=t.exclusive??!1;if(t.min!=null){const r=Qt(a,t.min,t.valueType);if(n?r<=0:r<0)return!1}if(t.max!=null){const r=Qt(a,t.max,t.valueType);if(n?r>=0:r>0)return!1}return!0}case"set":{const n=t.values.some(r=>Jt(a,r,t.valueType));return t.mode==="include"?n:!n}case"boolean":return a===t.value;case"null":return t.operator==="isNull"?a==null:a!=null;case"composite":return(t.mode==="and"?Array.prototype.every:Array.prototype.some).call(t.filters,r=>Ht(r,a))}}function Ut(t,a,n,r){if(t.kind==="and")return t.filters.every(s=>Ut(s,a,n,r));if(t.kind==="or")return t.filters.some(s=>Ut(s,a,n,r));if(t.kind==="not")return!Ut(t.filter,a,n,r);const l=t;if(Ot(l)){const s=n(l.column,a);return Ht(l,s)}return r?.evaluateFilter?r.evaluateFilter(l,a):!0}function Re(t){return t instanceof Date?t.toLocaleDateString():typeof t=="bigint"?t.toString():String(t)}const ul={contains:"contains",notContains:"does not contain",equals:"equals",notEquals:"does not equal",startsWith:"starts with",endsWith:"ends with"},dl={eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤"};function ka(t){const a=t.column;switch(t.kind){case"text":return`${a} ${ul[t.operator]} "${t.value}"`;case"compare":return`${a} ${dl[t.operator]} ${Re(t.value)}`;case"range":{const n=[];return t.min!=null&&n.push(`${Re(t.min)}`),n.push(a),t.max!=null&&n.push(Re(t.max)),n.length===3?`${n[0]} ${t.exclusive?"<":"≤"} ${n[1]} ${t.exclusive?"<":"≤"} ${n[2]}`:t.min!=null?`${a} ${t.exclusive?">":"≥"} ${Re(t.min)}`:`${a} ${t.exclusive?"<":"≤"} ${Re(t.max)}`}case"set":return t.mode==="include"?`${a} in [${t.values.map(Re).join(", ")}]`:`${a} not in [${t.values.map(Re).join(", ")}]`;case"boolean":return`${a} is ${t.value}`;case"null":return t.operator==="isNull"?`${a} is null`:`${a} is not null`;case"composite":{const n=t.mode==="and"?" AND ":" OR ";return t.filters.length===0?`${a}: (empty)`:t.filters.map(r=>ka(r)).join(n)}}}function _a(t,a){return Ot(t)?ka(t):a?.describeFilter?a.describeFilter(t):`${t.column}: [${t.kind}]`}function wa(t,a){const n=t.column;switch(t.kind){case"text":{const r=t.value;return{contains:a.textContains,notContains:a.textNotContains,equals:a.textEquals,notEquals:a.textNotEquals,startsWith:a.textStartsWith,endsWith:a.textEndsWith}[t.operator](n,r)}case"compare":{const r=Re(t.value);return{eq:a.compareEq,neq:a.compareNeq,gt:a.compareGt,gte:a.compareGte,lt:a.compareLt,lte:a.compareLte}[t.operator](n,r)}case"range":return t.min!=null&&t.max!=null?a.rangeBetween(n,Re(t.min),Re(t.max)):t.min!=null?a.rangeGte(n,Re(t.min)):a.rangeLte(n,Re(t.max));case"set":{const r=t.values.map(Re).join(", ");return t.mode==="include"?a.setIn(n,r):a.setNotIn(n,r)}case"boolean":return a.booleanIs(n,String(t.value));case"null":return t.operator==="isNull"?a.isNull(n):a.isNotNull(n);case"composite":{const r=t.filters.map(l=>wa(l,a));return t.mode==="and"?a.compositeAnd(r):a.compositeOr(r)}}}function jt(t,a,n){return Ot(t)?wa(t,a):n?.describeFilter?n.describeFilter(t):`${t.column}: [${t.kind}]`}function dt(t){if(t instanceof Date)return{valueType:"date",value:t};switch(typeof t){case"number":return{valueType:"number",value:t};case"bigint":return{valueType:"bigint",value:t};case"boolean":return{valueType:"boolean",value:t};default:return{valueType:"string",value:String(t)}}}function pl(t,a){const n=t??a;if(n==null)return{valueType:"string"};const l={valueType:ya(n)};return t!=null&&(l.min=t),a!=null&&(l.max=a),l}function Ua(t){return{valueType:t.length>0?ya(t[0]):"string",values:t}}const Te={text:(t,a,n,r)=>({kind:"text",column:t,operator:a,value:n,...r!=null?{caseSensitive:r}:{}}),contains:(t,a,n)=>Te.text(t,"contains",a,n),notContains:(t,a,n)=>Te.text(t,"notContains",a,n),equals:(t,a,n)=>Te.text(t,"equals",a,n),notEquals:(t,a,n)=>Te.text(t,"notEquals",a,n),startsWith:(t,a,n)=>Te.text(t,"startsWith",a,n),endsWith:(t,a,n)=>Te.text(t,"endsWith",a,n),eq:(t,a)=>({kind:"compare",column:t,operator:"eq",...dt(a)}),neq:(t,a)=>({kind:"compare",column:t,operator:"neq",...dt(a)}),gt:(t,a)=>({kind:"compare",column:t,operator:"gt",...dt(a)}),gte:(t,a)=>({kind:"compare",column:t,operator:"gte",...dt(a)}),lt:(t,a)=>({kind:"compare",column:t,operator:"lt",...dt(a)}),lte:(t,a)=>({kind:"compare",column:t,operator:"lte",...dt(a)}),between:(t,a,n,r)=>({kind:"range",column:t,...r!=null?{exclusive:r}:{},...pl(a,n)}),oneOf:(t,a)=>({kind:"set",column:t,mode:"include",...Ua(a)}),noneOf:(t,a)=>({kind:"set",column:t,mode:"exclude",...Ua(a)}),isTrue:t=>({kind:"boolean",column:t,value:!0}),isFalse:t=>({kind:"boolean",column:t,value:!1}),isNull:t=>({kind:"null",column:t,operator:"isNull"}),isNotNull:t=>({kind:"null",column:t,operator:"isNotNull"}),composite:(t,a,n)=>({kind:"composite",column:t,mode:a,filters:n}),and:(...t)=>({kind:"and",filters:t}),or:(...t)=>({kind:"or",filters:t}),not:t=>({kind:"not",filter:t})};function ml(t,a){return t==null&&a==null?0:t==null?-1:a==null?1:typeof t=="string"&&typeof a=="string"?t.localeCompare(a):typeof t=="number"&&typeof a=="number"?t-a:typeof t=="boolean"&&typeof a=="boolean"?(t?1:0)-(a?1:0):t instanceof Date&&a instanceof Date?t.getTime()-a.getTime():String(t).localeCompare(String(a))}function hl(t,a){return t[a]}function hn(t){const{data:a,rowId:n,accessors:r={},comparators:l={},initialSort:s=[],initialFilters:u=[],pageSize:o,multiSort:c=!1,serverSide:i=!1,totalRows:m,groupBy:f,onSortChange:h,onFilterChange:d,onPageChange:g,onSelectionChange:p,onGroupByChange:b,evaluateFilter:k}=t,y=[],_=e.prop(s),v=e.prop(u),w=e.prop(new Set),I=e.prop(1),S=e.prop(o!=null?e.Value.get(o):0);if(y.push(()=>_.dispose(),()=>v.dispose(),()=>w.dispose(),()=>I.dispose(),()=>S.dispose()),o!=null){const M=e.Value.toSignal(o),K=e.Value.on(M,re=>{S.set(re),I.set(1)});y.push(K),y.push(()=>M.dispose())}const V=e.prop([]);y.push(()=>V.dispose());const D=M=>r[M]??(K=>hl(K,M)),$=M=>l[M]??ml,x=e.Value.toSignal(a);y.push(()=>x.dispose());const N=i&&m!=null?e.Value.toSignal(m):x.map(M=>M.length);y.push(()=>N.dispose());const H=e.computedOf(x,V)((M,K)=>{if(K.length===0)return M;const re=new Map(M.map(me=>[n(me),me])),ce=[];for(const me of K){const ge=re.get(me);ge!=null&&(ce.push(ge),re.delete(me))}for(const me of re.values())ce.push(me);return ce});y.push(()=>H.dispose());const T=i?H:e.computedOf(H,v)((M,K)=>K.length===0?M:M.filter(re=>K.every(ce=>{if(Ot(ce)){if(ce.kind==="text"&&ce.value==="")return!0;const me=D(ce.column);return Ht(ce,me(re))}return k?k(ce,re):!0})));i||y.push(()=>T.dispose());const W=i&&m!=null?e.Value.toSignal(m):T.map(M=>M.length);y.push(()=>W.dispose());const B=i?T:e.computedOf(T,_)((M,K)=>{if(K.length===0)return M;const re=[...M];return re.sort((ce,me)=>{for(const ge of K){const Oe=D(ge.column),Ft=$(ge.column)(Oe(ce),Oe(me));if(Ft!==0)return ge.direction==="desc"?-Ft:Ft}return 0}),re});i||y.push(()=>B.dispose());const X=e.prop(f!=null?e.Value.get(f):void 0);if(y.push(()=>X.dispose()),f!=null){const M=e.Value.toSignal(f),K=e.Value.on(M,re=>{X.set(re)});y.push(K),y.push(()=>M.dispose())}const P=e.computedOf(B,X)((M,K)=>{if(K==null)return[];const re=D(K),ce=new Map,me=[];for(const ge of M){const Oe=String(re(ge)??"");ce.has(Oe)||(ce.set(Oe,[]),me.push(Oe)),ce.get(Oe).push(ge)}return me.map(ge=>({key:ge,rows:ce.get(ge)}))});y.push(()=>P.dispose());const U=o!=null,R=U?e.computedOf(W,S)((M,K)=>K>0?Math.max(1,Math.ceil(M/K)):1):e.prop(1);if(y.push(()=>R.dispose()),U){const M=e.Value.on(R,K=>{I.value>K&&I.set(Math.max(1,K))});y.push(M)}const Q=i||!U?B:e.computedOf(B,I,S)((M,K,re)=>{if(re<=0)return M;const ce=(K-1)*re;return M.slice(ce,ce+re)});!i&&U&&y.push(()=>Q.dispose());const F=w.map(M=>M.size);y.push(()=>F.dispose());const O=e.computedOf(w,T)((M,K)=>K.length===0?!1:K.every(re=>M.has(n(re))));y.push(()=>O.dispose());const z=e.computedOf(w,O)((M,K)=>M.size>0&&!K);y.push(()=>z.dispose());const Z=new Map,ie=new Map,ve=new Map,J=(M,K)=>{const re=K?.multi??e.Value.get(c),ce=_.value,me=ce.find(Oe=>Oe.column===M);let ge;me?me.direction==="asc"?ge=ce.map(Oe=>Oe.column===M?{...Oe,direction:"desc"}:Oe):ge=ce.filter(Oe=>Oe.column!==M):ge=re?[...ce,{column:M,direction:"asc"}]:[{column:M,direction:"asc"}],_.set(ge),h?.(ge)},se=M=>{_.set(M),h?.(M)},le=()=>{_.set([]),h?.([])},ye=M=>{let K=Z.get(M);if(!K){const re=e.untracked(()=>e.prop(_.value.find(me=>me.column===M)?.direction)),ce=_.on(me=>{re.set(me.find(ge=>ge.column===M)?.direction)},{noAutoDispose:!0});K=re,Z.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},_e=M=>{const re=[...v.value.filter(ce=>ce.column!==M.column),M];v.set(re),I.set(1),d?.(re)},ke=M=>{const K=[...v.value,M];v.set(K),I.set(1),d?.(K)},j=M=>{const K=v.value.filter(re=>re.column!==M);v.set(K),I.set(1),d?.(K)},A=()=>{v.set([]),I.set(1),d?.([])},te=M=>{let K=ie.get(M);if(!K){const re=e.untracked(()=>e.prop(v.value.filter(me=>me.column===M))),ce=v.on(me=>{re.set(me.filter(ge=>ge.column===M))},{noAutoDispose:!0});K=re,ie.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},de=M=>{let K=ve.get(M);if(!K){const re=e.untracked(()=>e.prop(v.value.find(ge=>ge.column===M&&ge.kind==="text")?.value??"")),ce=v.on(me=>{const ge=me.find(Oe=>Oe.column===M&&Oe.kind==="text");re.set(ge?.value??"")},{noAutoDispose:!0});K=re,ve.set(M,K),y.push(()=>{ce(),re.dispose()})}return K},ee=M=>{w.set(M),p?.(M)},Se=M=>{const K=new Set(w.value);K.has(M)?K.delete(M):K.add(M),ee(K)},xe=M=>{const K=new Set(w.value);for(const re of M)K.add(re);ee(K)},Le=M=>{const K=new Set(w.value);for(const re of M)K.delete(re);ee(K)},E=()=>{const M=T.value.map(K=>n(K));ee(new Set(M))},q=()=>{ee(new Set)};return{rows:Q,totalRows:N,totalFilteredRows:W,sort:_,toggleSort:J,setSort:se,getSortDirection:ye,resetSort:le,filters:v,setFilter:_e,addFilter:ke,removeFilter:j,getColumnFilters:te,getTextFilterValue:de,resetFilters:A,selected:w,toggleSelect:Se,select:xe,deselect:Le,selectAll:E,deselectAll:q,isAllSelected:O,isSomeSelected:z,selectedCount:F,currentPage:I,totalPages:R,pageSize:S,setPage:M=>{const K=Math.max(1,Math.min(M,R.value));I.set(K),g?.(K)},setPageSize:M=>{S.set(M),I.set(1),g?.(1)},groupBy:X,setGroupBy:M=>{X.set(M),b?.(M)},groups:P,allFilteredRows:B,moveRow:(M,K)=>{if(M===K||_.value.length>0)return;const re=x.value,ce=V.value.length>0?[...V.value]:re.map(Oe=>n(Oe)),me=ce.indexOf(M),ge=ce.indexOf(K);me<0||ge<0||(ce.splice(me,1),ce.splice(ge,0,M),V.set(ce))},resetAll:()=>{le(),A(),q(),I.set(1),V.set([]),X.set(void 0)},dispose:()=>{for(const M of y)M();y.length=0,Z.clear(),ie.clear(),ve.clear()}}}function fn(t,a,n){const r=[],l=Math.max(1,t-n),s=Math.min(a,t+n);l>1&&(r.push(1),l>2&&r.push("dots"));for(let u=l;u<=s;u++)r.push(u);return s<a&&(s<a-1&&r.push("dots"),r.push(a)),r}function gn(t,a){const n=new Map;switch(t){case"filled":case"pill":{const s=C.backgroundValue(a,"solid","light"),u=C.backgroundValue(a,"solid","dark");n.set("--pagination-active-bg",s.backgroundColor),n.set("--pagination-active-text",s.textColor),n.set("--pagination-active-bg-dark",u.backgroundColor),n.set("--pagination-active-text-dark",u.textColor);break}case"outline":{n.set("--pagination-active-bg","transparent"),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-border",C.borderColorValue(a,"light")),n.set("--pagination-active-bg-dark","transparent"),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark")),n.set("--pagination-active-border-dark",C.borderColorValue(a,"dark")),n.set("--pagination-item-border",fe.getColorVar("base",300)),n.set("--pagination-item-border-dark",fe.getColorVar("base",600));break}case"light":{const s=C.backgroundValue(a,"light","light"),u=C.backgroundValue(a,"light","dark");n.set("--pagination-active-bg",s.backgroundColor),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-bg-dark",u.backgroundColor),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark")),n.set("--pagination-item-bg",fe.getColorVar("base",100)),n.set("--pagination-item-bg-dark",fe.getColorVar("base",800));break}case"subtle":{n.set("--pagination-active-bg","transparent"),n.set("--pagination-active-text",C.textColorValue(a,"light")),n.set("--pagination-active-bg-dark","transparent"),n.set("--pagination-active-text-dark",C.textColorValue(a,"dark"));break}}const r=fe.getColorVar("base",100),l=fe.getColorVar("base",700);return n.set("--pagination-hover-bg",r),n.set("--pagination-hover-bg-dark",l),Array.from(n.entries()).map(([s,u])=>`${s}: ${u}`).join("; ")}function bn({currentPage:t,totalPages:a,onChange:n,siblings:r=1,showPrevNext:l=!0,showFirstLast:s=!1,size:u="md",variant:o="filled",color:c="primary",justify:i=!1,responsive:m=!1}){const f=e.Value.deriveProp(r),h=e.computedOf(m,f,r)((d,g,p)=>d?g:p);return e.Use(C.BeatUII18n,d=>e.html.nav(e.attr.class(e.computedOf(u,o,i)((g,p,b)=>{const k=["bc-pagination",`bc-pagination--size-${g}`,`bc-pagination--variant-${p}`];return b&&k.push("bc-pagination--justify"),k.join(" ")})),e.attr.style(e.computedOf(o,c)((g,p)=>gn(g,p))),e.aria.label(d.$.paginationLabel),e.When(m,()=>e.WithElement(g=>{const p=()=>{const k=g.clientWidth;if(k===0)return;const y=g.querySelector(".bc-pagination__item");if(!y)return;const _=y.offsetWidth,v=parseFloat(getComputedStyle(g).gap)||0,w=_+v,I=Math.floor((k+v)/w),S=(e.Value.get(l)?2:0)+(e.Value.get(s)?2:0),V=e.Value.get(a),D=I-S,$=Math.max(0,Math.floor((D-5)/2)),x=Math.floor((V-3)/2);f.set(Math.min($,Math.max(0,x)))},b=new ResizeObserver(p);return b.observe(g),we.delayedAnimationFrame(p),e.OnDispose(()=>b.disconnect())})),e.When(s,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g<=1||p<=1)),e.aria.label(d.$.firstPage),e.on.click(g=>{g.preventDefault(),e.Value.get(a)>1&&n(1)}),"«")),e.When(l,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g<=1||p<=1)),e.aria.label(d.$.previousPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(t);p>1&&n(p-1)}),"‹")),e.ForEach(e.computedOf(t,a,h)((g,p,b)=>fn(g,p,b)),g=>{const p=g.map(k=>k==="dots"),b=e.computedOf(g,t)((k,y)=>k===y);return e.When(p,()=>e.html.span(e.attr.class("bc-pagination__dots"),"…"),()=>e.html.button(e.attr.class(e.Value.map(b,k=>k?"bc-pagination__item bc-pagination__item--active":"bc-pagination__item")),e.WithElement(k=>{e.Value.on(b,y=>{y?k.setAttribute("aria-current","page"):k.removeAttribute("aria-current")})}),e.on.click(k=>{k.preventDefault();const y=e.Value.get(g);y!=="dots"&&y!==e.Value.get(t)&&n(y)}),g.map(k=>String(k))))}),e.When(l,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g>=p||p<=1)),e.aria.label(d.$.nextPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(t),b=e.Value.get(a);p<b&&n(p+1)}),"›")),e.When(s,()=>e.html.button(e.attr.class("bc-pagination__item"),e.attr.disabled(e.computedOf(t,a)((g,p)=>g>=p||p<=1)),e.aria.label(d.$.lastPage),e.on.click(g=>{g.preventDefault();const p=e.Value.get(a);p>1&&n(p)}),"»"))))}function vn({dataSource:t,showSort:a=!0,showFilters:n=!0,showSelection:r=!0,bulkActions:l=[],resetLabel:s,describeFilter:u}){const o=e.computedOf(t.sort,t.filters,t.selectedCount)((h,d,g)=>h.length>0||d.length>0||g>0),c=e.Value.toSignal(r),i=e.computedOf(c,t.selectedCount)((h,d)=>h&&d>0),m=u?{describeFilter:u}:void 0;function f(h,d){return d?jt(h,d,m):_a(h,m)}return e.Fragment(e.OnDispose(()=>{o.dispose(),c.dispose(),i.dispose()}),e.Use(C.BeatUII18n,h=>e.When(o,()=>e.html.div(e.attr.class("bc-data-toolbar"),e.When(a,()=>e.ForEach(t.sort,d=>ct({variant:"light",color:"green",size:"sm",onClose:()=>{const g=d.value,p=t.sort.value.filter(b=>b.column!==g.column);t.setSort(p)}},d.map(g=>`${g.column} ${g.direction==="asc"?"↑":"↓"}`)))),e.When(n,()=>e.ForEach(t.filters,d=>ct({variant:"light",color:"violet",size:"sm",onClose:()=>{t.removeFilter(d.value.column)}},d.map(g=>f(g,h.value.dataTable.describeFilter))))),e.When(i,()=>e.html.div(e.attr.class("bc-data-toolbar__selection"),e.html.span(e.attr.class("bc-data-toolbar__selection-count"),t.selectedCount.map(d=>h.value.dataTable.selectedCount(d))),...l.map(d=>e.html.button(e.attr.class("bc-data-toolbar__action"),e.on.click(()=>d.onClick(t.selected.value)),d.icon!=null?C.Icon({icon:d.icon,size:"sm"}):null,d.label)),e.html.button(e.attr.class("bc-data-toolbar__action bc-data-toolbar__action--secondary"),e.on.click(()=>t.deselectAll()),h.$.dataTable.map(d=>d.deselectAll)))),e.html.button(e.attr.class("bc-data-toolbar__reset"),e.on.click(()=>t.resetAll()),C.Icon({icon:"line-md:close-small",size:"sm"}),s??h.$.dataTable.map(d=>d.resetAll))))))}const Ue={value:(t,a,{disabled:n,before:r,after:l}={})=>({type:"value",value:t,label:a,disabled:n,before:r,after:l}),group:(t,a,{disabled:n,before:r,after:l}={})=>({type:"group",group:t,options:a,disabled:n,before:r,after:l}),break:{type:"break"},getValues:t=>t.flatMap(a=>a.type==="group"?Ue.getValues(a.options):a.type==="break"?[]:[a.value]),contains:(t,a,n=(r,l)=>r===l)=>Ue.getValues(t).some(r=>n(r,a))};function Ca(t,a,n){return t.some(l=>n(l,a))?t.filter(l=>!n(l,a)):[...t,a]}function Sa(t,a,n){return t.filter(r=>!n(r,a))}function zt(t,a,n){return t.some(r=>n(r,a))}function yn(t,a,n){for(const r of t)if(r.type==="value"){if(n(r.value,a))return{label:r.label}}else if(r.type==="group"){const l=yn(r.options,a,n);if(l!=null)return l}}function kn(t,a,n){return yn(t,a,n)?.label??String(a)}function Va(t,a,n){const r=a.trim().toLowerCase(),l=n??((u,o)=>o.label.toLowerCase().includes(u));if(r==="")return t;const s=[];for(const u of t)if(u.type==="value")l(r,{label:u.label})&&s.push(u);else if(u.type==="group"){const o=Va(u.options,r,l);o.length>0&&s.push({...u,options:o})}return s}function qt(t){const{value:a,options:n,equality:r=(F,O)=>F===O,placeholder:l,searchPlaceholder:s,filter:u,loadOptions:o,loadDebounce:c=300,maxSelection:i,showActions:m=!1,selectAllLabel:f,clearAllLabel:h,renderOption:d}=t,g=e.prop(!1),p=e.prop(""),b=e.prop(-1),k=e.prop(!1),y=e.prop(null),_=Pe.sessionId("multi-select"),v=Pe.sessionId("multi-select-listbox");let w,I,S,V;const D=e.computedOf(n,y,p)((F,O,z)=>o&&O!=null?O:Va(F,z,u)),$=D.map(F=>Ue.getValues(F));g.onChange(F=>{F||(b.set(-1),p.set(""),y.set(null))});const x=F=>{const O=e.Value.get(a);t.onChange?.(Sa(O,F,r))},N=F=>{const O=e.Value.get(a),z=e.Value.get(i);z!=null&&!zt(O,F,r)&&O.length>=z||t.onChange?.(Ca(O,F,r))},H=()=>{const F=e.Value.get(i),O=$.value,z=F!=null?O.slice(0,F):O;t.onChange?.(z)},T=()=>{t.onChange?.([])},W=F=>e.computedOf(a)(O=>zt(O,F,r)),B=F=>{p.set(F),o&&(V!=null&&clearTimeout(V),V=setTimeout(()=>{k.set(!0),o(F).then(O=>{y.set(O)}).finally(()=>{k.set(!1)})},c))},X=F=>{const O=$.value;switch(F.key){case"ArrowDown":{F.preventDefault(),g.value?b.set(Math.min(b.value+1,O.length-1)):(g.set(!0),O.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}case"ArrowUp":{F.preventDefault(),g.value&&b.set(Math.max(b.value-1,0));break}case"Enter":{if(F.preventDefault(),g.value&&b.value>=0){const z=O[b.value];z!=null&&N(z)}else g.value||(g.set(!0),O.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}case"Escape":{g.value&&(F.preventDefault(),g.set(!1),w?.focus());break}case"Backspace":{if(p.value===""){const z=e.Value.get(a);z.length>0&&t.onChange?.(z.slice(0,-1))}break}case" ":{document.activeElement!==I&&(F.preventDefault(),g.set(!g.value),g.value&&setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0));break}}},P=e.computedOf(b,$)((F,O)=>O[F]??null),U=(F,O)=>{const z=W(F.value),Z=e.computedOf(a,i)((J,se)=>se!=null&&J.length>=se),ie=e.computedOf(z,Z)((J,se)=>F.disabled===!0||!J&&se),ve=P.map(J=>J!=null?r(J,F.value):!1);return d?e.html.div(e.attr.role("option"),e.attr.id(`multi-select-option-${String(F.value)}`),e.aria.selected(z),e.aria.disabled(ie),e.attr.class(e.computedOf(ve,z)((J,se)=>{const le=["bc-multi-select__option"];return J&&le.push("bc-multi-select__option--focused"),se&&le.push("bc-multi-select__option--selected"),O>0&&le.push("bc-multi-select__option--grouped"),le.join(" ")})),e.on.click(()=>N(F.value)),d(F,z)):e.html.div(e.attr.role("option"),e.attr.id(`multi-select-option-${String(F.value)}`),e.aria.selected(z),e.aria.disabled(ie),e.attr.class(e.computedOf(ve,z)((J,se)=>{const le=["bc-multi-select__option"];return J&&le.push("bc-multi-select__option--focused"),se&&le.push("bc-multi-select__option--selected"),O>0&&le.push("bc-multi-select__option--grouped"),le.join(" ")})),e.on.click(()=>N(F.value)),e.html.span(e.attr.class("bc-multi-select__option-check"),e.When(z,()=>C.Icon({icon:"ph:check-bold",size:"xs",color:"primary"}))),e.html.span(e.attr.class("bc-multi-select__option-label"),F.label))},R=F=>e.Ensure(F,O=>e.OneOfType(O,{value:z=>U({value:z.value.value,label:z.value.label,disabled:z.value.disabled},0),group:z=>e.html.div(e.attr.class("bc-multi-select__group"),e.html.div(e.attr.class("bc-multi-select__group-label"),z.$.group),e.ForEach(z.$.options,Z=>e.Ensure(Z,ie=>e.OneOfType(ie,{value:ve=>U({value:ve.value.value,label:ve.value.label,disabled:ve.value.disabled},1),group:()=>e.Empty,break:()=>e.html.div(e.attr.class("bc-multi-select__separator"))})))),break:()=>e.html.div(e.attr.class("bc-multi-select__separator"))})),Q=e.NotEmpty(a,()=>e.ForEach(a,F=>ct({variant:"light",size:t.size,onClose:()=>x(F.value),disabled:t.disabled},e.computedOf(F,n)((O,z)=>kn(z,O,r)))),()=>e.html.span(e.attr.class("bc-multi-select__placeholder"),l));return ne.InputContainer({...t,input:e.html.div(e.attr.class("bc-multi-select__badge-container"),Q),after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(F=>e.Fragment(e.WithElement(O=>{w=O;const z=()=>{g.value?g.set(!1):(g.set(!0),$.value.length>0&&b.set(0),setTimeout(()=>{requestAnimationFrame(()=>I?.focus())},0))};return O.addEventListener("keydown",X),O.addEventListener("click",z),e.OnDispose(()=>{O.removeEventListener("keydown",X),O.removeEventListener("click",z),V!=null&&clearTimeout(V)})}),Fe.CommonInputAttributes(t),e.attr.id(_),e.attr.tabindex(0),e.aria.controls(v),e.aria.expanded(g),e.attr.class("bc-multi-select"),e.attr.role("combobox"),e.aria.activedescendant(e.computedOf(g,P)((O,z)=>O&&z!=null?`multi-select-option-${String(z)}`:"")),t.onBlur!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!S?.contains(document.activeElement)&&!w?.contains(document.activeElement)&&(g.set(!1),t.onBlur())})}):e.Empty,Ie.Flyout({content:()=>e.html.div(e.WithElement(O=>{S=O}),e.style.minWidth(F.$.width.map(O=>`${O-10}px`)),e.attr.class("bc-multi-select__dropdown"),e.html.input(e.WithElement(O=>{I=O}),e.attr.type("text"),e.attr.class("bc-multi-select__search"),e.attr.placeholder(e.computedOf(s,l)((O,z)=>O??z??"Search...")),e.attr.value(p),e.on.input(O=>{const z=O.target;B(z.value)}),e.on.keydown(O=>{(O.key==="ArrowUp"||O.key==="ArrowDown"||O.key==="Enter"||O.key==="Escape"||O.key==="Backspace"&&p.value==="")&&X(O)})),e.When(m,()=>e.html.div(e.attr.class("bc-multi-select__actions"),e.html.button(e.attr.type("button"),e.attr.class("bc-multi-select__action"),e.on.click(O=>{O.stopPropagation(),H()}),f??"Select all"),e.html.span(e.attr.class("bc-multi-select__action-sep"),"|"),e.html.button(e.attr.type("button"),e.attr.class("bc-multi-select__action"),e.on.click(O=>{O.stopPropagation(),T()}),h??"Clear all"))),e.When(k,()=>e.html.div(e.attr.class("bc-multi-select__loading"),e.Use(C.BeatUII18n,O=>O.$.loadingShort))),e.html.div(e.attr.role("listbox"),e.attr.id(v),e.aria.labelledby(_),e.WithElement(O=>{O.setAttribute("aria-multiselectable","true")}),e.attr.class("bc-multi-select__listbox"),e.When(e.computedOf(D,k)((O,z)=>!z&&O.length===0),()=>e.html.div(e.attr.class("bc-multi-select__empty"),e.Use(C.BeatUII18n,O=>O.$.noResults))),e.ForEach(D,R)),e.When(e.computedOf(a)(O=>O.length>0),()=>e.html.div(e.attr.class("bc-multi-select__footer"),e.computedOf(a,i)((O,z)=>z!=null?`${O.length} / ${z} selected`:`${O.length} selected`)))),mainAxisOffset:0,placement:"bottom-start",hasPopup:"listbox",open:g,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function fl(t){return oe.BaseControl(qt,t)}function gl(t){return oe.Control(qt,t)}function Ra(t){for(const a of t)if(a.kind==="set"&&a.mode==="include")return a.values.map(String);return[]}function st(t){const{dataSource:a,column:n,size:r="sm"}=t;if(t.type==="tags"){const{options:m,placeholder:f}=t,h=a.getColumnFilters(n),d=e.prop(Ra(h.value)),g=h.on(b=>{d.set(Ra(b))}),p=m.map(b=>Ue.value(b.value,b.label));return e.Fragment(e.OnDispose(()=>{g(),d.dispose()}),e.Use(C.BeatUII18n,b=>qt({value:d,options:p,size:r,placeholder:f??b.$.dataTable.map(k=>k.filterTagsPlaceholder),showActions:!0,onChange:k=>{d.set(k),k.length===0?a.removeFilter(n):a.setFilter(Te.oneOf(n,k))}})))}if(t.type==="select"){const{options:m,allLabel:f}=t,d=a.getColumnFilters(n).map(g=>g.find(b=>b.kind==="text")?.value??"");return e.Use(C.BeatUII18n,g=>{const p=f??g.value.dataTable.selectAll,b=[Ue.value("",p),...m.map(k=>Ue.value(k.value,k.label))];return ae.NativeSelect({value:d,options:b,size:r,class:"bc-column-filter",onChange:k=>{k===""?a.removeFilter(n):a.setFilter(Te.equals(n,k))}})})}const l=a.getTextFilterValue(n),{placeholder:s,operator:u="contains",debounce:o=300}=t;let c;const i=l.map(m=>m===""?null:m);return e.Fragment(e.OnDispose(()=>{c!=null&&clearTimeout(c),i.dispose()}),e.Use(C.BeatUII18n,m=>Fe.TextInput({value:l,size:r,class:"bc-column-filter",placeholder:s??m.$.dataTable.map(f=>f.filterPlaceholder),onInput:f=>{c!=null&&clearTimeout(c),c=setTimeout(()=>{f===""?a.removeFilter(n):a.setFilter(Te.text(n,u,f))},o)},after:ae.NullableResetAfter(i,void 0,()=>{c!=null&&clearTimeout(c),a.removeFilter(n)})})))}function bl(t){const a={up:"M0 16 L8 10 L16 16 Z",down:"M0 0 L8 6 L16 0 Z",left:"M16 0 L10 8 L16 16 Z",right:"M0 0 L6 8 L0 16 Z"};return e.svg.svg(e.svgAttr.viewBox("0 0 16 16"),e.svg.path(e.svgAttr.d(t.map(n=>a[n]))))}function gt(t){const{content:a,placement:n="top",showDelay:r=250,hideDelay:l=500,mainAxisOffset:s=8,crossAxisOffset:u=0,showOn:o="hover-focus"}=t,c=Pe.sessionId("tooltip");return e.Fragment(e.aria.describedby(c),Ie.Flyout({content:()=>e.Fragment(e.attr.class("bc-tooltip"),e.attr.role("tooltip"),e.attr.id(c),a),placement:n,showDelay:r,hideDelay:l,mainAxisOffset:s,crossAxisOffset:u,showOn:o,closable:!0,role:"tooltip",arrow:i=>{const m=i.map(({placement:f})=>f.includes("top")?"down":f.includes("bottom")?"up":f.includes("left")?"right":f.includes("right")?"left":"up");return e.Fragment(e.attr.class("bc-tooltip__arrow"),e.attr.class(m.map(f=>`bc-tooltip__arrow-${f}`)),e.style.transform(i.map(({x:f,y:h})=>f==null&&h==null?"":f!=null?`translate(${f}px, 0)`:`translate(0, ${h}px)`)),bl(m))}}))}function Tt({open:t},...a){return e.WithElement(n=>{const{status:r,setOpen:l,dispose:s}=He.useAnimatedElementToggle({initialStatus:e.Value.get(t)?"opened":"closed",element:n});return e.Value.on(t,l),Ce.ElementRect(u=>{const o=e.prop(null);return e.computedOf(r,u.$.height)((i,m)=>i==="opened"&&m>0?m:null).on(i=>{i!=null&&o.set(i)}),r.on(i=>{if(n&&i==="start-opening"){const m=n.style.height,f=n.style.transition;n.style.transition="none",n.style.height="auto",n.offsetHeight;const h=n.scrollHeight;h>0&&o.set(h),n.style.height=m,n.style.transition=f,n.offsetHeight}}),e.Fragment(e.OnDispose(s),e.attr.style(o.map(i=>`--collapse-height: ${i!=null?`${i}px`:"auto"}`)),e.attr.class(r.map(i=>`bc-collapse bc-collapse--${i}`)),...a)})})}function vl(t,a){return["bc-accordion",`bc-accordion--size-${t}`,`bc-accordion--${a}`].join(" ")}function yl({items:t,multiple:a=!1,size:n="md",variant:r="default"}){const l=Pe.sessionId("accordion"),s=new Map;for(const o of t)s.set(o.key,e.prop(o.defaultOpen??!1));const u=o=>{const c=s.get(o);if(c!=null){if(!e.Value.get(a))for(const[i,m]of s)i!==o&&m.set(!1);c.update(i=>!i)}};return e.html.div(e.attr.class(e.computedOf(n,r)(vl)),e.attr.role("presentation"),...t.map((o,c)=>{const i=s.get(o.key),m=`${l}-header-${c}`,f=`${l}-panel-${c}`;return e.html.div(e.attr.class("bc-accordion__item"),e.attr.class(i.map(h=>h?"bc-accordion__item--open":"bc-accordion__item--closed")),o.disabled?e.attr.class("bc-accordion__item--disabled"):e.Empty,e.html.button(e.attr.type("button"),e.attr.class("bc-accordion__header"),e.attr.id(m),e.aria.expanded(i),e.aria.controls(f),e.attr.disabled(o.disabled??!1),e.on.click(h=>{h.preventDefault(),o.disabled||u(o.key)}),e.html.span(e.attr.class("bc-accordion__header-content"),o.header),e.html.span(e.attr.class("bc-accordion__chevron"),e.attr.class(i.map(h=>h?"bc-accordion__chevron--open":"bc-accordion__chevron--closed")),e.html.span(e.attr.class("bc-accordion__chevron-icon")))),e.html.div(e.attr.id(f),e.attr.role("region"),e.aria.labelledby(m),e.html.div(Tt({open:i},e.html.div(e.attr.class("bc-accordion__body"),o.body)))))}))}function kl(t,a,n,r){const l=["bc-action-card"];return t&&l.push("bc-action-card--active"),a&&l.push("bc-action-card--disabled"),n!=="md"&&l.push(`bc-action-card--${n}`),r&&!a&&l.push("bc-action-card--clickable"),l.join(" ")}function _l(t,a,n,r){const l=new Map;if(t!=null&&l.set("--action-card-bg",t),a!=null&&l.set("--action-card-border",a),n!=null&&l.set("--action-card-title-color",n),r!=null&&l.set("--action-card-description-color",r),l.size!==0)return Array.from(l.entries()).map(([s,u])=>`${s}: ${u}`).join("; ")}function wl({icon:t,title:a,description:n,active:r=!1,disabled:l=!1,onClick:s,size:u="md",iconColor:o="primary",iconSize:c="md",backgroundColor:i,borderColor:m,titleColor:f,descriptionColor:h}){const d=s!=null;return e.html.div(e.attr.class(e.computedOf(r,l,u)((g,p,b)=>kl(g??!1,p??!1,b??"md",d))),e.attr.style(e.computedOf(i,m,f,h)((g,p,b,k)=>_l(g,p,b,k))),e.When(d,()=>e.Fragment(e.Unless(l,()=>e.Fragment(e.on.click(()=>s?.()),e.attr.tabindex(0))),e.attr.role("button"))),e.aria.disabled(l),e.html.div(e.attr.class("bc-action-card__icon"),C.Icon({icon:t,size:c,color:o})),e.html.div(e.attr.class("bc-action-card__content"),e.html.div(e.attr.class("bc-action-card__title"),a),e.html.div(e.attr.class("bc-action-card__description"),n)))}const Cl=["!=","<=",">=","<",">","="];function Sl(t){for(const a of Cl)if(typeof t=="string"&&t.startsWith(a))return[a,t.slice(a.length)];return["=",t]}function _n(t,a,n){const[r,l]=Sl(a),s=t.findIndex(c=>c[1]===l);if(s===-1)throw new Error(`Breakpoint ${String(l)} not found`);const u=t[s][0],o=s<t.length-1?t[s+1][0]:1/0;switch(r){case"=":return n>=u&&n<o;case"!=":return!(n>=u&&n<o);case"<=":return n<=u;case">=":return n>=u;case"<":return n<u;case">":return n>u;default:return!1}}function Vl(t,a){const n=t.findIndex(r=>r[0]>a);return n===-1?t[t.length-1][1]:n===0?t[0][1]:t[n-1][1]}function Ia(t,{breakpoints:a,mode:n="viewport"}){const l=[...Object.entries(a).map(([u,o])=>[o,u])].sort((u,o)=>u[0]-o[0]),s=u=>{const o=u.map(({width:i})=>{const m=l.findIndex(f=>f[0]>i);return m===-1?{width:i,breakpoint:l[l.length-1][1]}:m===0?{width:i,breakpoint:l[0][1]}:{width:i,breakpoint:l[m-1][1]}});return t({value:o,breakpoints:a,asList:l,is:(i,m)=>_n(l,i,m)})};return n==="element"?Ce.ElementRect(s):Ce.WindowSize(s)}let ea=NaN;function Il(t,a){return t?(isNaN(ea)&&(ea=parseFloat(getComputedStyle(document.documentElement).fontSize)),parseFloat(t)*ea):a}function Ae(t,a,n){return Il(t.getPropertyValue(a),n)}function wn(t){return e.WithElement(a=>{const n=getComputedStyle(a),r={zero:0,xs:Ae(n,"--breakpoint-xs",640),sm:Ae(n,"--breakpoint-sm",768),md:Ae(n,"--breakpoint-md",1024),lg:Ae(n,"--breakpoint-lg",1280),xl:Ae(n,"--breakpoint-xl",1536)};return Ia(t,{breakpoints:r})})}function $l(t){return e.WithElement(a=>{const n=getComputedStyle(a),r={zero:0,"3xs":Ae(n,"--container-3xs",256),"2xs":Ae(n,"--container-2xs",288),xs:Ae(n,"--container-xs",320),sm:Ae(n,"--container-sm",384),md:Ae(n,"--container-md",448),lg:Ae(n,"--container-lg",512),xl:Ae(n,"--container-xl",640),"2xl":Ae(n,"--container-2xl",768),"3xl":Ae(n,"--container-3xl",1024),"4xl":Ae(n,"--container-4xl",1280),"5xl":Ae(n,"--container-5xl",1536),"6xl":Ae(n,"--container-6xl",2048)};return Ia(t,{breakpoints:r,mode:"element"})})}async function xl(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const a=document.createElement("textarea");return a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a),!0}catch{return!1}}}function Dl({text:t,size:a="sm",color:n="base",variant:r="subtle",roundedness:l="sm",disabled:s=!1,timeout:u=2e3},...o){const c=e.prop("idle");let i;return e.Use(C.BeatUII18n,m=>{const f=e.Value.map(c,g=>g==="copied"),h=e.computedOf(c,m.$.copyButton.$.copied,m.$.copyButton.$.copyToClipboard)((g,p,b)=>g==="copied"?p:b),d=async()=>{if(e.Value.get(s))return;await xl(e.Value.get(t))&&(i!=null&&clearTimeout(i),c.set("copied"),i=setTimeout(()=>c.set("idle"),e.Value.get(u)))};return e.html.span(e.attr.class(e.Value.map(c,g=>g==="copied"?"bc-copy-button bc-copy-button--copied":"bc-copy-button")),e.OnDispose(()=>{i!=null&&clearTimeout(i)}),ne.Button({variant:r,size:a,roundedness:l,disabled:s,color:n,onClick:d},e.aria.label(h),e.attr.title(h),e.When(f,()=>C.Icon({icon:"lucide:check",size:a}),()=>C.Icon({icon:"lucide:copy",size:a})),...o))})}function Ol(t,a,n,r){const l=["bc-toggle-button",`bc-toggle-button--size-${t}`,`bc-control--padding-${t}`,`bc-control--rounded-${a}`];return n&&l.push("bc-toggle-button--full-width"),r&&l.push("bc-toggle-button--pressed"),l.join(" ")}function Tl(t,a,n,r){const l=new Map;l.set("--toggle-text-shadow","var(--text-shadow-none)"),l.set("--toggle-text-shadow-dark","var(--text-shadow-none)");const s=(u,o,c,i)=>{r||(l.set("--toggle-bg-hover",u),l.set("--toggle-text-hover",c),l.set("--toggle-bg-hover-dark",o),l.set("--toggle-text-hover-dark",i))};if(n){const u=C.backgroundValue(a,"solid","light"),o=C.backgroundValue(a,"solid","dark");l.set("--toggle-bg",u.backgroundColor),l.set("--toggle-text",u.textColor),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",o.textColor),l.set("--toggle-border",u.backgroundColor),l.set("--toggle-border-dark",o.backgroundColor),l.set("--toggle-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),l.set("--toggle-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const c=C.hoverBackgroundValue(a,"solid","light"),i=C.hoverBackgroundValue(a,"solid","dark");s(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor)}else switch(t){case"outline":case"dashed":{l.set("--toggle-bg","transparent"),l.set("--toggle-bg-dark","transparent"),l.set("--toggle-border",C.borderColorValue(a,"light")),l.set("--toggle-border-dark",C.borderColorValue(a,"dark")),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-text-dark",C.textColorValue(a,"dark")),t==="dashed"&&l.set("--toggle-border-style","dashed");const u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");s(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}case"light":{const u=C.backgroundValue(a,"light","light"),o=C.backgroundValue(a,"light","dark");l.set("--toggle-bg",u.backgroundColor),l.set("--toggle-text",u.textColor),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",o.textColor);const c=C.hoverBackgroundValue(a,"light","light"),i=C.hoverBackgroundValue(a,"light","dark");s(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor);break}case"filled":{const u=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",u.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const c=C.hoverBackgroundValue("base","light","light"),i=C.hoverBackgroundValue("base","light","dark");s(c.backgroundColor,i.backgroundColor,l.get("--toggle-text")??u.textColor,l.get("--toggle-text-dark")??o.textColor);break}case"default":{const u=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",u.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark")),l.set("--toggle-border",fe.getColorVar("neutral",300)),l.set("--toggle-border-dark",fe.getColorVar("neutral",700));const c=C.hoverBackgroundValue("base","light","light"),i=C.hoverBackgroundValue("base","light","dark");s(c.backgroundColor,i.backgroundColor,l.get("--toggle-text")??u.textColor,l.get("--toggle-text-dark")??o.textColor);break}case"subtle":{l.set("--toggle-bg","transparent"),l.set("--toggle-bg-dark","transparent"),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const u=C.hoverBackgroundValue(a,"light","light"),o=C.hoverBackgroundValue(a,"light","dark");s(u.backgroundColor,o.backgroundColor,u.textColor,o.textColor);break}default:{const u=C.backgroundValue("neutral","light","light"),o=C.backgroundValue("neutral","light","dark");l.set("--toggle-bg",u.backgroundColor),l.set("--toggle-text",C.textColorValue(a,"light")),l.set("--toggle-bg-dark",o.backgroundColor),l.set("--toggle-text-dark",C.textColorValue(a,"dark"));const c=C.hoverBackgroundValue("base","light","light"),i=C.hoverBackgroundValue("base","light","dark");s(c.backgroundColor,i.backgroundColor,l.get("--toggle-text")??u.textColor,l.get("--toggle-text-dark")??o.textColor);break}}return Array.from(l.entries()).map(([u,o])=>`${u}: ${o}`).join("; ")}function Cn({pressed:t,onChange:a,disabled:n=!1,variant:r="outline",size:l="md",color:s="primary",roundedness:u="sm",fullWidth:o=!1},...c){return e.html.button(e.attr.type("button"),e.attr.disabled(n),e.aria.pressed(t),e.attr.class(e.computedOf(l,u,o,t)(Ol)),e.attr.style(e.computedOf(r,s,t,n)(Tl)),e.on.click(i=>{i.preventDefault(),i.stopPropagation(),e.Value.get(n)||a?.(!e.Value.get(t))}),...c)}function Pl(t,a){return["bc-toggle-button-group",`bc-toggle-button-group--${t}`,`bc-toggle-button-group--rounded-${a}`].join(" ")}function El({items:t,value:a,onChange:n,multiple:r=!1,disabled:l=!1,variant:s="outline",size:u="md",color:o="primary",roundedness:c="sm",orientation:i="horizontal"}){const m=(f,h)=>{const d=e.Value.get(a),g=e.Value.get(r);let p;g?p=h?[...d,f]:d.filter(b=>b!==f):p=h?[f]:[],n?.(p)};return e.html.div(e.attr.role("group"),e.attr.class(e.computedOf(i,c)(Pl)),e.aria.orientation(i),...t.map(f=>{const h=e.Value.map(a,g=>g.includes(f.key)),d=f.disabled?e.Value.map(l,g=>g||f.disabled):l;return Cn({pressed:h,onChange:g=>m(f.key,g),disabled:d,variant:s,size:u,color:o,roundedness:"none",fullWidth:!1},f.label)}))}function Ye(t,a){return`bc-panel ${(Array.isArray(t)?t:[t]).map(r=>`bc-panel--side-${r}`).join(" ")} bc-panel--shadow-${a}`}function rt(t){const a=e.Value.toSignal(t).map(r=>C.backgroundValue(r,"lighter","light")),n=e.Value.toSignal(t).map(r=>C.backgroundValue(r,"lighter","dark"));return e.Fragment(e.style.variable("--panel-bg",a.$.backgroundColor),e.style.variable("--panel-text",a.$.textColor),e.style.variable("--panel-bg-dark",n.$.backgroundColor),e.style.variable("--panel-text-dark",n.$.textColor))}const Qe={banner:{zero:32,xs:32,sm:32,md:32,lg:32,xl:32},header:{zero:60,xs:60,sm:60,md:60,lg:60,xl:60},mainHeader:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},mainFooter:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},footer:{zero:48,xs:48,sm:48,md:48,lg:48,xl:48},menu:{zero:300,xs:300,sm:300,md:300,lg:300,xl:300},aside:{zero:280,xs:280,sm:280,md:280,lg:280,xl:280}};function za(t,a){if(typeof t=="number")return{zero:t,xs:t,sm:t,md:t,lg:t,xl:t};const n={zero:t.zero??a.zero,xs:t.xs??a.xs,sm:t.sm??a.sm,md:t.md??a.md,lg:t.lg??a.lg,xl:t.xl??a.xl};return n.xs<n.zero&&(n.xs=n.zero),n.sm<n.xs&&(n.sm=n.xs),n.md<n.sm&&(n.md=n.sm),n.lg<n.md&&(n.lg=n.md),n.xl<n.lg&&(n.xl=n.lg),n}function ta(t){t=t.filter(a=>a.some(n=>n!=null&&!n.startsWith("?")));for(let a=0;a<t[0].length;a++)t.every(n=>n[a]==null||n[a].startsWith("?"))&&(t=t.map(n=>n.filter((r,l)=>l!==a)),a--);return t=t.map(a=>a.map(n=>n?.startsWith("?")?n.slice(1):n)),t}function Fl({smallBreakpoint:t,mediumBreakpoint:a,vertical:n,horizontal:r,is:l}){function s(c){let i=[[null],[null],[null],[null],[null],[null]];const m=[];m.push("1fr");const f=[];return r.banner&&(f.push(r.banner[c]+"px"),i[0][1]="banner"),(r.header||n.menu||n.aside)&&(f.push((r.header?.[c]??Qe.header[c])+"px"),i[1][1]="header"),r.mainHeader&&(f.push(r.mainHeader[c]+"px"),i[2][1]="mainHeader"),f.push("1fr"),i[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[c]+"px"),i[4][1]="mainFooter"),r.footer&&(f.push(r.footer[c]+"px"),i[5][1]="footer"),i=ta(i),{columns:m.join(" "),rows:f.join(" "),areas:i.map(d=>`"${d.join(" ")}"`).join(`
2
+ `),displayMenu:!1,displayAside:!1,menuWidth:Qe.menu[c]+"px",asideWidth:Qe.aside[c]+"px"}}function u(c){let i=[[null,null],[null,null],[null,null],[null,null],[null,null],[null,null]];const m=[];n.menu&&(m.push(n.menu[c]+"px"),i[2][0]="?menu",i[3][0]="menu",i[4][0]="?menu"),m.push("1fr");const f=[];return r.banner&&(f.push(r.banner[c]+"px"),i[0][0]="?banner",i[0][1]="banner"),(r.header||n.aside)&&(f.push((r.header?.[c]??Qe.header[c])+"px"),i[1][0]="?header",i[1][1]="header"),r.mainHeader&&(f.push(r.mainHeader[c]+"px"),i[2][1]="mainHeader"),f.push("1fr"),i[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[c]+"px"),i[4][1]="mainFooter"),r.footer&&(f.push(r.footer[c]+"px"),i[5][0]="?footer",i[5][1]="footer"),i=ta(i),{columns:m.join(" "),rows:f.join(" "),areas:i.map(d=>`"${d.join(" ")}"`).join(`
3
+ `),displayMenu:!0,displayAside:!1,menuWidth:Qe.menu[c]+"px",asideWidth:Qe.aside[c]+"px"}}function o(c){let i=[[null,null,null],[null,null,null],[null,null,null],[null,null,null],[null,null,null],[null,null,null]];const m=[];n.menu&&(m.push(n.menu[c]+"px"),i[2][0]="?menu",i[3][0]="menu",i[4][0]="?menu"),m.push("1fr"),n.aside&&(m.push(n.aside[c]+"px"),i[2][2]="?aside",i[3][2]="aside",i[4][2]="?aside");const f=[];return r.banner&&(f.push(r.banner[c]+"px"),i[0][0]="?banner",i[0][1]="banner",i[0][2]="?banner"),r.header&&(f.push(r.header[c]+"px"),i[1][0]="?header",i[1][1]="header",i[1][2]="?header"),r.mainHeader&&(f.push(r.mainHeader[c]+"px"),i[2][1]="mainHeader"),f.push("1fr"),i[3][1]="main",r.mainFooter&&(f.push(r.mainFooter[c]+"px"),i[4][1]="mainFooter"),r.footer&&(f.push(r.footer[c]+"px"),i[5][0]="?footer",i[5][1]="footer",i[5][2]="?footer"),i=ta(i),{columns:m.join(" "),rows:f.join(" "),areas:i.map(d=>`"${d.join(" ")}"`).join(`
4
+ `),displayMenu:!0,displayAside:!0,menuWidth:Qe.menu[c]+"px",asideWidth:Qe.aside[c]+"px"}}return({width:c,breakpoint:i})=>l(`<=${t}`,c)?s(i):l(`<=${a}`,c)?u(i):o(i)}const Ll=["menu","aside"],Al=["banner","header","mainHeader","mainFooter","footer"];function Bl(t,{displayMenu:a},n){return t?a?"block":n?"float":"none":"none"}function Ml(t,{displayAside:a},n){return t?a?"block":n?"float":"none":"none"}function Nl({smallBreakpoint:t="sm",mediumBreakpoint:a="md",...n}){const r=Object.fromEntries(Ll.filter(s=>n[s]).map(s=>[s,za(n[s].width??{},Qe[s])])),l=Object.fromEntries(Al.filter(s=>n[s]).map(s=>[s,za(n[s].height??{},Qe[s])]));return e.Use(C.BeatUII18n,s=>wn(({value:u,is:o})=>{const c=Fl({smallBreakpoint:t,mediumBreakpoint:a,vertical:r,horizontal:l,is:o}),i=u.map(c),m=l.header!=null||r.menu!=null||r.aside!=null,f=e.computedOf(r.aside!=null,i)((y,{displayAside:_})=>y&&!_),h=e.computedOf(r.menu!=null,i)((y,{displayMenu:_})=>y&&!_),d=He.useAnimatedElementToggle(),g=He.useAnimatedElementToggle(),p=e.prop(0),b=e.computedOf(r.menu!=null,i,d.display)(Bl),k=e.computedOf(r.aside!=null,i,g.display)(Ml);return e.html.div(e.style.display("grid"),e.style.height("100%"),e.style.width("100%"),e.style.gridTemplateColumns(i.$.columns),e.style.gridTemplateRows(i.$.rows),e.style.gridTemplateAreas(i.$.areas),e.style.gridColumnGap("0"),e.style.gridRowGap("0"),n.banner?e.html.header(e.attr.class(Ye("none",n.banner.shadow??"none")),rt(n.banner.color??"white"),e.style.height("100%"),e.style.gridArea("banner"),n.banner.content):null,e.html.header(e.attr.class(Ye("bottom",n.header?.shadow??"none")),rt(n.header?.color??"white"),e.style.zIndex("20"),e.style.display(m?"block":"none"),e.style.gridArea("header"),Ce.ElementRect(y=>(y.$.bottom.feedProp(p),null)),e.html.div(e.style.display("flex"),e.style.height("100%"),e.html.div(e.style.display(h.map(y=>y?"flex":"none")),e.style.alignItems("center"),e.style.justifyContent("center"),e.style.height("100%"),e.style.width("60px"),ne.Button({onClick:()=>d.toggle(),variant:"light",color:"base"},e.aria.label(s.$.toggleMenu),C.Icon({icon:d.display.map(y=>y?"line-md/menu-to-close-alt-transition":"line-md/close-to-menu-alt-transition")}))),e.html.div(e.style.height("100%"),e.style.flexGrow("1"),n.header?.content),e.html.div(e.style.alignItems("center"),e.style.justifyContent("center"),e.style.height("100%"),e.style.width("60px"),e.style.display(f.map(y=>y?"flex":"none")),ne.Button({onClick:()=>g.toggle(),roundedness:"full",variant:"light",color:"base"},e.aria.label(s.$.toggleAside),C.Icon({icon:"line-md/chevron-left"},e.attr.style("transition: transform 0.2s ease-in-out"),e.attr.style(g.display.map(y=>`transform: rotate(${y?180:0}deg)`))))))),n.menu?e.html.nav(e.WithElement(y=>d.setElement(y)),e.style.zIndex("10"),e.aria.label(s.$.mainNavigation),e.attr.role("navigation"),e.style.overflow("hidden"),e.attr.class(b.map(y=>y==="float"?Ye("right",n.menu?.shadow??"md"):Ye("right",n.menu?.shadow??"none"))),rt(n.menu?.color??"white"),e.style.height(b.map(y=>y==="float"?"auto":"100%")),e.style.overflow("hidden"),e.style.gridArea("menu"),e.style.display(e.computedOf(b,d.status)((y,_)=>y==="none"&&_==="closed"?"none":"block")),e.style.position(e.computedOf(b,d.status)((y,_)=>y==="float"||y==="none"&&_!=="closed"?"fixed":"initial")),e.style.top(p.map(y=>`${y}px`)),e.WithElement(y=>{y.style.setProperty("--slide-distance","100%")}),He.AnimatedToggleClass({animation:{slide:"right"},status:e.computedOf(b,d.status)((y,_)=>y==="block"?"opened":_)}),e.style.width(e.coalesce(n.menu?.width,i.$.menuWidth)),e.style.bottom("0"),n.menu?.content):null,n.mainHeader?e.html.header(e.style.height("100%"),e.style.gridArea("mainHeader"),e.attr.class(Ye("none",n.mainHeader?.shadow??"none")),rt(n.mainHeader?.color??"white"),n.mainHeader.content):null,e.html.main(e.style.height("100%"),e.style.overflow("hidden"),e.style.gridArea("main"),e.attr.class(Ye("none",n.main?.shadow??"none")),rt(n.main?.color??"white"),n.main.content),n.mainFooter?e.html.footer(e.style.height("100%"),e.style.gridArea("mainFooter"),e.attr.class(Ye("none",n.mainFooter?.shadow??"none")),rt(n.mainFooter?.color??"white"),n.mainFooter.content):null,n.aside?e.html.aside(e.WithElement(y=>{g.setElement(y)}),e.style.zIndex("10"),e.aria.label(s.$.sidebar),e.attr.role("complementary"),e.attr.class(k.map(y=>y==="float"?Ye("left","md"):Ye("left","none"))),rt("white"),e.style.height("100%"),e.style.gridArea("aside"),e.style.display(e.computedOf(k,g.status)((y,_)=>y==="none"&&_==="closed"?"none":"block")),e.style.position(e.computedOf(k,g.status)((y,_)=>y==="float"||y==="none"&&_!=="closed"?"fixed":"initial")),e.style.top(p.map(y=>`${y}px`)),e.WithElement(y=>{y.style.setProperty("--slide-distance","100%")}),He.AnimatedToggleClass({animation:{slide:"left"},status:e.computedOf(k,g.status)((y,_)=>y==="block"?"opened":_)}),e.style.width(e.coalesce(n.aside?.width,i.$.asideWidth)),e.style.bottom(p.map(y=>`${y}px`)),n.aside.content):null,n.footer?e.html.footer(e.attr.class(Ye("top","none")),rt("white"),e.style.height("100%"),e.style.gridArea("footer"),n.footer.content):null)}))}function Wl(...t){return e.html.div(e.attr.class("bc-center-h"),e.html.div(e.attr.class("bc-center__content"),...t))}function Ul(t){const a=["bc-center"];return t!=="lg"&&a.push(`bc-center--gap-${t}`),a.join(" ")}function Rl({gap:t="lg"}={},...a){return e.html.div(e.attr.class(e.computedOf(t)(n=>Ul(n??"lg"))),...a)}function Ha(t,a,n,r,l){const s=["bc-divider"];return t==="vertical"&&s.push("bc-divider--vertical"),a!=="solid"&&s.push(`bc-divider--${a}`),n!=="default"&&s.push(`bc-divider--tone-${n}`),r&&(s.push("bc-divider--labeled"),l!=="center"&&s.push(`bc-divider--labeled-${l}`)),s.join(" ")}function zl({orientation:t="horizontal",variant:a="solid",tone:n="default",label:r,labelAlign:l="center"}={}){return r!=null?e.html.div(e.attr.class(e.computedOf(t,a,n,l)((u,o,c,i)=>Ha(u??"horizontal",o??"solid",c??"default",!0,i??"center"))),e.attr.role("separator"),e.html.span(e.attr.class("bc-divider__line")),e.html.span(e.attr.class("bc-divider__label"),r),e.html.span(e.attr.class("bc-divider__line"))):e.html.hr(e.attr.class(e.computedOf(t,a,n)((u,o,c)=>Ha(u??"horizontal",o??"solid",c??"default",!1,"center"))),e.attr.role("separator"))}const Lt=12,At=40;function ua(t){return`${t}px`}function wt(t){return e.Value.map(t,ua)}function Ne(t,a){return we.biMin(we.biMax(0n,a),we.biMax(0n,t))}function Hl({body:t,contentWidth:a,contentHeight:n,header:r,headerHeight:l=0,topStart:s,topEnd:u,footer:o,footerHeight:c=0,bottomStart:i,bottomEnd:m,sidebarStart:f,sidebarStartWidth:h=0,sidebarEnd:d,sidebarEndWidth:g=0,anchorMode:p="container-edge"}){const b=e.prop(0n),k=e.prop(0n),y=wt(l),_=wt(c),v=wt(h),w=wt(g);return e.Use(C.BeatUII18n,I=>e.html.div(e.attr.class("bc-nine-slice-container"),e.attr.tabindex(0),e.attr.role("group"),e.aria.label(I.$.scrollableGridView),Ce.ElementRect(S=>{const V=e.computedOf(S.$.width,h,g)((E,q,ue)=>E-q-ue),D=e.computedOf(S.$.height,l,c)((E,q,ue)=>E-q-ue),$=e.computedOf(a,V)((E,q)=>E>BigInt(Math.max(0,q))),x=e.computedOf(n,D)((E,q)=>E>BigInt(Math.max(0,q))),N=e.computedOf(V,x)((E,q)=>q?E-Lt:E),H=e.computedOf(D,$)((E,q)=>q?E-Lt:E),T=N.map(ua),W=H.map(ua),B=e.computedOf(n,H)((E,q)=>we.biMax(0n,E-BigInt(Math.max(1,q)))),X=e.computedOf(a,N)((E,q)=>we.biMax(0n,E-BigInt(Math.max(1,q)))),P=e.Value.map(p,E=>E==="body-end"||E==="body-end-bottom"),U=e.When(P,()=>e.style.left(e.computedOf(h,a,N,g)((E,q,ue,he)=>{const De=E+Number(q),$e=E+ue,Be=Math.min(De,$e);return`${Math.max(E+he,Be)}px`})),()=>e.style.right("0")),R=e.Value.map(p,E=>E==="body-bottom"||E==="body-end-bottom"),Q=e.When(R,()=>e.style.top(e.computedOf(l,n,H,c)((E,q,ue,he)=>{const De=E+Number(q),$e=E+ue,Be=Math.min(De,$e);return`${Math.max(E+he,Be)}px`})),()=>e.style.bottom("0")),F=e.computedOf(x)(E=>E?`${Lt}px`:"0"),O=e.computedOf($)(E=>E?`${Lt}px`:"0"),z=e.style.transform(e.computedOf(k,b,$,x)((E,q,ue,he)=>{const De=ue?`translateX(-${E}px)`:"",$e=he?`translateY(-${q}px)`:"";return`${De} ${$e}`.trim()||"none"})),Z=e.style.transform(k.map(E=>`translateX(-${E}px)`)),ie=e.style.transform(b.map(E=>`translateY(-${E}px)`));let ve=null,J=0,se=0;const le=()=>{const E=B.value,q=X.value,ue=x.value,he=$.value;ue&&se!==0&&b.set(Ne(b.value+BigInt(Math.round(se)),E)),he&&J!==0&&k.set(Ne(k.value+BigInt(Math.round(J)),q)),J=0,se=0,ve=null};X.on(E=>{k.value>E&&k.set(we.biMax(0n,E))}),B.on(E=>{b.value>E&&b.set(we.biMax(0n,E))}),$.on(E=>{E||k.set(0n)}),x.on(E=>{E||b.set(0n)});const ye=e.createInertiaHandler((E,q)=>{const ue=X.value,he=B.value;$.value&&k.set(Ne(k.value-BigInt(Math.round(E)),ue)),x.value&&b.set(Ne(b.value-BigInt(Math.round(q)),he))},{friction:.92,minVelocity:.5});let _e=null;const ke=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,j=e.computedOf(N,a)((E,q)=>{const ue=Number(q);return ue>0?Math.max(24,E*E/ue):0}),A=e.computedOf(N,j)((E,q)=>Math.max(1,E-q)),te=e.computedOf(k,X,A)((E,q,ue)=>{const he=Number(q);return he>0?Number(E)/he*ue:0}),de=e.computedOf(H,n)((E,q)=>{const ue=Number(q);return ue>0?Math.max(24,E*E/ue):0}),ee=e.computedOf(H,de)((E,q)=>Math.max(1,E-q)),Se=e.computedOf(b,B,ee)((E,q,ue)=>{const he=Number(q);return he>0?Number(E)/he*ue:0});function xe(E,q,ue,he){return e.on.pointerdown(De=>{De.preventDefault(),De.stopPropagation();const $e=E==="horizontal"?De.clientX:De.clientY,Be=Number(q.value),Ge=K=>{const re=E==="horizontal"?K.clientX-$e:K.clientY-$e,ce=e.Value.get(he),me=Number(e.Value.get(ue));if(ce>0&&me>0){const ge=Be+re/ce*me;q.set(Ne(BigInt(Math.round(ge)),e.Value.get(ue)))}},M=()=>{window.removeEventListener("pointermove",Ge),window.removeEventListener("pointerup",M)};window.addEventListener("pointermove",Ge),window.addEventListener("pointerup",M)})}function Le(E,q,ue,he,De){return e.on.pointerdown($e=>{const Be=$e.target;if(!Be.classList.contains("bc-nine-slice-scrollbar-track"))return;$e.preventDefault();const Ge=Be.getBoundingClientRect(),M=E==="horizontal"?$e.clientX-Ge.left:$e.clientY-Ge.top,K=e.Value.get(De)/2,re=e.Value.get(he),ce=Number(e.Value.get(ue));if(re>0&&ce>0){const me=Math.max(0,Math.min(1,(M-K)/re));q.set(Ne(BigInt(Math.round(me*ce)),e.Value.get(ue)))}})}return e.Fragment(e.OnDispose(()=>{ve&&clearTimeout(ve),_e&&_e.dispose()}),e.on.wheel(E=>{E.preventDefault(),J+=E.deltaX,se+=E.deltaY,ve||(ve=setTimeout(le,16))}),e.on.keydown(E=>{const q=$.value,ue=x.value;let he=!1;switch(E.key){case"ArrowUp":ue&&(b.set(Ne(b.value-BigInt(At),B.value)),he=!0);break;case"ArrowDown":ue&&(b.set(Ne(b.value+BigInt(At),B.value)),he=!0);break;case"ArrowLeft":q&&(k.set(Ne(k.value-BigInt(At),X.value)),he=!0);break;case"ArrowRight":q&&(k.set(Ne(k.value+BigInt(At),X.value)),he=!0);break;case"PageUp":ue&&(b.set(Ne(b.value-BigInt(Math.round(H.value)),B.value)),he=!0);break;case"PageDown":ue&&(b.set(Ne(b.value+BigInt(Math.round(H.value)),B.value)),he=!0);break;case"Home":ue&&(b.set(0n),he=!0),q&&(k.set(0n),he=!0);break;case"End":ue&&(b.set(B.value),he=!0),q&&(k.set(X.value),he=!0);break}he&&E.preventDefault()}),e.html.div(e.attr.class("bc-nine-slice-pane-container"),e.style.right(F),e.style.bottom(O),s!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-top-start"),e.style.top("0"),e.style.left("0"),e.style.width(v),e.style.height(y),s):null,r!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-header"),e.style.top("0"),e.style.left(v),e.style.width(T),e.style.height(y),e.html.div(e.attr.class("bc-nine-slice-pane-content"),Z,r)):null,u!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-top-end"),e.style.top("0"),U,e.style.width(w),e.style.height(y),u):null,f!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-sidebar-start"),e.style.left("0"),e.style.top(y),e.style.width(v),e.style.height(W),e.html.div(e.attr.class("bc-nine-slice-pane-content"),ie,f)):null,e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-body"),e.style.left(v),e.style.top(y),e.style.width(T),e.style.height(W),e.on.pointerdown(E=>{if(E.button!==0)return;_e&&(_e.dispose(),_e=null),ye.track(E.clientX,E.clientY);const q=$e=>{const Be=$e.clientX-ue,Ge=$e.clientY-he;ue=$e.clientX,he=$e.clientY,ye.track($e.clientX,$e.clientY);const M=X.value,K=B.value;$.value&&k.set(Ne(k.value-BigInt(Math.round(Be)),M)),x.value&&b.set(Ne(b.value-BigInt(Math.round(Ge)),K))};let ue=E.clientX,he=E.clientY;const De=()=>{ke?.matches||(_e=ye.release()),window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",De)};window.addEventListener("pointermove",q),window.addEventListener("pointerup",De)}),e.style.cursor(e.computedOf($,x)((E,q)=>E||q?"grab":"default")),e.html.div(e.attr.class("bc-nine-slice-pane-content"),z,t)),d!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-sidebar-end"),U,e.style.top(y),e.style.width(w),e.style.height(W),e.html.div(e.attr.class("bc-nine-slice-pane-content"),ie,d)):null,i!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-bottom-start"),e.style.left("0"),Q,e.style.width(v),e.style.height(_),i):null,o!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-footer"),e.style.left(v),Q,e.style.width(T),e.style.height(_),e.html.div(e.attr.class("bc-nine-slice-pane-content"),Z,o)):null,m!=null?e.html.div(e.attr.class("bc-nine-slice-pane bc-nine-slice-bottom-end"),U,Q,e.style.width(w),e.style.height(_),m):null),e.html.div(e.attr.class($.map(E=>`bc-nine-slice-scrollbar bc-nine-slice-scrollbar--horizontal${E?"":" bc-nine-slice-scrollbar--hidden"}`)),e.style.left(wt(h)),e.style.right(F),Le("horizontal",k,X,A,j),e.WithElement(E=>(e.Value.on(X,q=>{E.setAttribute("aria-valuemax",String(q))}),e.Value.on(k,q=>{E.setAttribute("aria-valuenow",String(q))}),e.Fragment(e.attr.role("scrollbar"),e.aria.orientation("horizontal"),e.aria.valuemin(0),e.html.div(e.attr.class("bc-nine-slice-scrollbar-track"),e.html.div(e.attr.class("bc-nine-slice-scrollbar-thumb"),e.style.width(j.map(q=>`${q}px`)),e.style.transform(te.map(q=>`translateX(${q}px)`)),xe("horizontal",k,X,A))))))),e.html.div(e.attr.class(x.map(E=>`bc-nine-slice-scrollbar bc-nine-slice-scrollbar--vertical${E?"":" bc-nine-slice-scrollbar--hidden"}`)),e.style.top(y),e.style.bottom(O),Le("vertical",b,B,ee,de),e.WithElement(E=>(e.Value.on(B,q=>{E.setAttribute("aria-valuemax",String(q))}),e.Value.on(b,q=>{E.setAttribute("aria-valuenow",String(q))}),e.Fragment(e.attr.role("scrollbar"),e.aria.orientation("vertical"),e.aria.valuemin(0),e.html.div(e.attr.class("bc-nine-slice-scrollbar-track"),e.html.div(e.attr.class("bc-nine-slice-scrollbar-thumb"),e.style.height(de.map(q=>`${q}px`)),e.style.transform(Se.map(q=>`translateY(${q}px)`)),xe("vertical",b,B,ee))))))))})))}function jl(t){return e.attr.class(`bc-flex--gap-${t}`)}function ql(t){return e.attr.class(`bc-flex--align-${t}`)}function Gl(t){return e.attr.class(`bc-flex--justify-${t}`)}const Yl=e.attr.class("bc-flex--wrap"),Kl=e.attr.class("bc-flex--nowrap"),Zl=e.attr.class("bc-flex--grow");function da({header:t,footer:a,body:n,shadowOnScroll:r=!0},...l){const s=e.prop("none");function u(c){const i=c.scrollTop<=1,m=c.scrollTop+c.clientHeight>=c.scrollHeight-2;i&&m?s.set("none"):i?s.set("bottom"):m?s.set("top"):s.set("both")}return e.html.div(e.attr.class(e.computedOf(s,r)((c,i)=>{const m=["bc-scrollable-panel"];return i&&((c==="top"||c==="both")&&m.push("bc-scrollable-panel--scrolled-down"),(c==="bottom"||c==="both")&&m.push("bc-scrollable-panel--scrolled-up")),m.join(" ")})),t&&e.html.div(e.attr.class("bc-scrollable-panel__header"),t),e.html.div(e.attr.class("bc-scrollable-panel--header-shadow"),e.html.div()),e.html.div(e.attr.class("bc-scrollable-panel__body"),e.WithElement(c=>{u(c);const i=new ResizeObserver(()=>u(c));i.observe(c);const m=new MutationObserver(()=>{requestAnimationFrame(()=>u(c))});return m.observe(c,{childList:!0,subtree:!0}),e.OnDispose(()=>{i.disconnect(),m.disconnect()})}),e.on.scroll(c=>{const i=c.target;u(i)}),n),e.html.div(e.attr.class("bc-scrollable-panel--footer-shadow"),e.html.div()),a&&e.html.div(e.attr.class("bc-scrollable-panel__footer"),a),...l)}function Xl(t,a,n){const r=["bc-sink"];return t!=="default"&&r.push(`bc-sink--${t}`),a!=="md"&&r.push(`bc-sink--padding-${a}`),n!=="lg"&&r.push(`bc-sink--rounded-${n}`),r.join(" ")}function Ql({variant:t="default",size:a="md",roundedness:n="lg"}={},...r){return e.html.div(e.attr.class(e.computedOf(t,a,n)((l,s,u)=>Xl(l??"default",s??"md",u??"lg"))),...r)}const Jl=[{value:"contains",labelKey:"filterPanelContains"},{value:"notContains",labelKey:"filterPanelNotContains"},{value:"equals",labelKey:"filterPanelEquals"},{value:"notEquals",labelKey:"filterPanelNotEquals"},{value:"startsWith",labelKey:"filterPanelStartsWith"},{value:"endsWith",labelKey:"filterPanelEndsWith"},{value:"isNull",labelKey:"filterPanelIsNull"},{value:"isNotNull",labelKey:"filterPanelIsNotNull"}],eo=[{value:"eq",labelKey:"filterPanelEquals"},{value:"neq",labelKey:"filterPanelNotEquals"},{value:"gt",labelKey:"filterPanelGt"},{value:"gte",labelKey:"filterPanelGte"},{value:"lt",labelKey:"filterPanelLt"},{value:"lte",labelKey:"filterPanelLte"},{value:"between",labelKey:"filterPanelBetween"},{value:"isNull",labelKey:"filterPanelIsNull"},{value:"isNotNull",labelKey:"filterPanelIsNotNull"}],to=new Set(["isNull","isNotNull"]);function ao(t,a,n){const r=a.operator;if(r==="isNull")return Te.isNull(t);if(r==="isNotNull")return Te.isNotNull(t);if(a.value==="")return null;if(n==="number"){if(r==="between"){const s=a.value.split(",").map(Number);return s.length===2&&!s.some(isNaN)?Te.between(t,s[0],s[1]):null}const l=Number(a.value);if(Number.isNaN(l))return null;switch(r){case"eq":return Te.eq(t,l);case"neq":return Te.neq(t,l);case"gt":return Te.gt(t,l);case"gte":return Te.gte(t,l);case"lt":return Te.lt(t,l);case"lte":return Te.lte(t,l);default:return null}}return Te.text(t,r,a.value)}function pa(t,a){switch(t.kind){case"text":return[{id:a(),operator:t.operator,value:t.value}];case"compare":return[{id:a(),operator:t.operator,value:String(t.value)}];case"range":return[{id:a(),operator:"between",value:`${t.min},${t.max}`}];case"null":return[{id:a(),operator:t.operator,value:""}];case"composite":return t.filters.flatMap(n=>pa(n,a));default:return[]}}function no(){let t=0;return()=>++t}function ro(t,a,n=""){return{opProp:e.prop(t),valProp:e.prop(a),val2Prop:e.prop(n)}}function ja(t){t.opProp.dispose(),t.valProp.dispose(),t.val2Prop.dispose()}function Vt(t){const{dataSource:a,column:n,columnType:r="text",size:l="sm",embedded:s=!1}=t,u=no(),o=a.getColumnFilters(n),c=o.map(S=>S.length>0),i=new Map,m=e.prop([]),f=e.prop("and");function h(){return r==="number"?"eq":"contains"}function d(){return r==="number"?"0":""}function g(S,V,D=""){const $=u();return i.set($,ro(S,V,D)),$}function p(){for(const S of i.values())ja(S);i.clear()}function b(){p();const S=o.value;let V;if(S.length===0)V=[{id:0,operator:h(),value:d()}],f.set("and");else{const $=S.find(x=>x.kind==="composite");$?(f.set($.mode),V=pa($,u)):(f.set("and"),V=S.flatMap(x=>x.kind==="text"||x.kind==="compare"||x.kind==="range"||x.kind==="null"||x.kind==="composite"?pa(x,u):[])),V.length===0&&(V=[{id:0,operator:h(),value:d()}])}const D=[];for(const $ of V)if($.operator==="between"&&$.value.includes(",")){const[x,N]=$.value.split(",");D.push(g($.operator,x,N))}else D.push(g($.operator,$.value));m.set(D)}function k(){const S=g(h(),d());m.set([...m.value,S])}function y(S){const V=i.get(S);V&&(ja(V),i.delete(S));const D=m.value.filter($=>$!==S);D.length===0?k():m.set(D)}function _(){const V=m.value.map(D=>{const $=i.get(D);if(!$)return null;const x=$.opProp.value;if(x==="between"){const N=Number($.valProp.value),H=Number($.val2Prop.value);return Number.isNaN(N)||Number.isNaN(H)?null:Te.between(n,N,H)}return ao(n,{operator:x,value:$.valProp.value},r)}).filter(D=>D!=null);V.length===0?a.removeFilter(n):V.length===1?a.setFilter(V[0]):a.setFilter(Te.composite(n,f.value,V))}function v(){a.removeFilter(n),p();const S=g(h(),d());m.set([S]),f.set("and")}const w=r==="number"?eo:Jl,I=()=>e.Use(C.BeatUII18n,S=>{b();const V=S.$.dataTable,D=w.map($=>Ue.value($.value,V.value[$.labelKey]));return e.html.div(e.attr.class("bc-column-filter-panel"),e.on.click($=>$.stopPropagation()),e.When(m.map($=>$.length>=2),()=>e.html.div(e.attr.class("bc-column-filter-panel__mode"),ae.SegmentedInput({options:{and:V.map($=>$.filterPanelAnd),or:V.map($=>$.filterPanelOr)},value:f,onChange:$=>f.set($),size:"xs"}))),e.html.div(e.attr.class("bc-column-filter-panel__conditions"),e.ForEach(m,$=>e.MapSignal($,x=>{const N=i.get(x);if(!N)return null;const H=V.map(X=>X.filterPanelValuePlaceholder),T=(X,P)=>ae.NumberInput({value:X.map(U=>U===""?0:Number(U)),size:"xs",class:"bc-column-filter-panel__value",placeholder:H,onChange:U=>X.set(String(U))}),W=X=>Fe.TextInput({value:X,size:"xs",class:"bc-column-filter-panel__value",placeholder:H,onInput:P=>X.set(P)}),B=()=>{if(r==="number"){const X=N.opProp.map(P=>P==="between");return e.Fragment(T(N.valProp),e.When(X,()=>T(N.val2Prop)))}return W(N.valProp)};return e.html.div(e.attr.class("bc-column-filter-panel__row"),e.html.div(e.attr.class("bc-column-filter-panel__row-header"),ae.NativeSelect({value:N.opProp,options:D,size:"xs",class:"bc-column-filter-panel__operator",onChange:X=>N.opProp.set(X)}),oe.CloseButton({size:"xs",onClick:()=>y(x)})),e.html.div(e.attr.class(N.opProp.map(X=>to.has(X)?"bc-column-filter-panel__value-wrap bc-column-filter-panel__value-wrap--hidden":"bc-column-filter-panel__value-wrap")),B()))}))),e.html.div(e.attr.class("bc-column-filter-panel__add"),e.html.button(e.attr.type("button"),e.attr.class("bc-column-filter-panel__add-btn"),e.on.click(()=>k()),"+ ",V.map($=>$.filterPanelAddCondition))),e.html.div(e.attr.class("bc-column-filter-panel__actions"),ne.Button({size:"xs",variant:"light",color:"danger",onClick:()=>v()},C.Icon({icon:"lucide:trash-2",size:"xs"}),V.map($=>$.filterPanelClear)),ne.Button({size:"xs",variant:"filled",onClick:()=>_()},V.map($=>$.filterPanelApply))))});if(s){const S=o.on(()=>{b()});return e.Fragment(e.OnDispose(()=>{S(),p(),m.dispose(),f.dispose()}),I())}return e.Fragment(e.OnDispose(()=>{p(),m.dispose(),f.dispose()}),e.html.div(e.attr.class("bc-column-filter-panel__trigger-wrap"),e.html.button(e.attr.class(c.map(S=>S?"bc-column-filter-panel__trigger bc-column-filter-panel__trigger--active":"bc-column-filter-panel__trigger")),e.attr.type("button"),C.Icon({icon:"lucide:filter",size:l}),e.When(c,()=>e.html.span(e.attr.class("bc-column-filter-panel__active-dot"))),e.When(c,()=>e.Use(C.BeatUII18n,S=>{const V=S.value.dataTable.describeFilter;return gt({content:o.map(D=>{if(D.length===0)return"";const $=D[0];return V?jt($,V):_a($)}),showDelay:500})})),Ie.Flyout({content:()=>I(),placement:"bottom-start",showOn:"click",showDelay:0,hideDelay:0}))))}function lo(t){return t===!0?{}:t===!1||t==null?!1:t}function oo(t,a,n){if(a<=0)return[t];const r=[];let l=[],s=0;for(const u of t){const o=n.has(u.key)?1:u.rows.length;if(o<=a)s>0&&s+o>a&&(r.push(l),l=[],s=0),l.push(u),s+=o;else{s>0&&(r.push(l),l=[],s=0);let c=0;for(;c<u.rows.length;){const i=u.rows.slice(c,c+a);l.push({key:u.key,rows:i}),s=i.length,c+a<u.rows.length&&(r.push(l),l=[],s=0),c+=a}}}return l.length>0&&r.push(l),r.length>0?r:[[]]}function so(t){return t===!0?{pageSize:10}:t===!1||t==null?!1:t}function io(t,a,n,r){if(t==null||t===!1)return null;if(t===!0||t==="text")return e.html.div(e.attr.class("bc-column-filter-panel"),st({dataSource:a,column:n,size:r}));if(t==="number")return Vt({dataSource:a,column:n,columnType:"number",size:r,embedded:!0});if(typeof t=="object"&&"render"in t)return t.render({dataSource:a,column:n,size:r});if(typeof t=="object"&&"input"in t)return Sn(t,a,n,r);if(typeof t=="object"&&"type"in t)switch(t.type){case"select":return e.html.div(e.attr.class("bc-column-filter-panel"),st({dataSource:a,column:n,type:"select",options:t.options,size:r}));case"tags":return e.html.div(e.attr.class("bc-column-filter-panel"),st({dataSource:a,column:n,type:"tags",options:t.options,size:r}));case"panel":return Vt({dataSource:a,column:n,columnType:t.valueType,size:r,embedded:!0})}return null}function Sn(t,a,n,r){const l=a.getTextFilterValue(n),s=e.prop(l.value);let u=!1;return l.on(o=>{!u&&s.value!==o&&(u=!0,s.set(o),u=!1)}),s.on(o=>{!u&&l.value!==o&&(u=!0,o===""?a.removeFilter(n):a.setFilter(Te.text(n,"contains",o)),u=!1)}),t.input(s,r)}function co(t,a,n,r){if(t==null||t===!1)return e.html.th();if(t===!0||t==="text")return e.html.th(st({dataSource:a,column:n,size:r}));if(t==="number")return e.html.th(Vt({dataSource:a,column:n,columnType:"number",size:r}));if(typeof t=="object"&&"render"in t)return e.html.th(t.render({dataSource:a,column:n,size:r}));if(typeof t=="object"&&"input"in t)return e.html.th(Sn(t,a,n,r));if(typeof t=="object"&&"type"in t)switch(t.type){case"select":return e.html.th(st({dataSource:a,column:n,type:"select",options:t.options,size:r}));case"tags":return e.html.th(st({dataSource:a,column:n,type:"tags",options:t.options,size:r}));case"panel":return e.html.th(Vt({dataSource:a,column:n,columnType:t.valueType,size:r}))}return e.html.th()}function Vn(t){if(t.filter!=null)return e.Value.get(t.filter)}function In(t){return t.filter!=null}function uo(t){const{data:a,columns:n,rowId:r,sortable:l=!1,filterable:s=!1,selectable:u=!1,reorderableColumns:o=!1,onColumnOrderChange:c,pagination:i,toolbar:m,size:f="md",hoverable:h=!1,onSortChange:d,onFilterChange:g,onSelectionChange:p,onGroupByChange:b,onRowClick:k,serverSide:y=!1,totalRows:_,loading:v=!1,groupBy:w,groupCollapsible:I=!0,showFooter:S=!1,groupSummary:V,emptyContent:D,hiddenColumns:$=[],onDataSource:x,rowDetails:N}=t,H=e.Value.map(l,Y=>!!Y),T=e.Value.map(l,Y=>Y==="multi"),W=e.Value.map(s,Y=>!!Y),B=e.Value.map(s,Y=>Y==="row"?"row":"header"),X=e.Value.map(u,Y=>!!Y),P=e.Value.map(u,Y=>typeof Y=="object"?Y.position==="after":!1),U=e.Value.map(u,Y=>typeof Y=="object"?Y.selectOnRowClick??!1:!1),R=e.Value.deriveProp($),Q=e.Value.map(i??!1,Y=>so(Y??!1)),F=e.Value.toSignal(m??!1).map(lo),O=n.filter(Y=>{const be=Y.hideable;return be==null?!1:typeof be=="boolean"?be:be.value}),z=e.Value.map(R??[],Y=>Y.length>0),Z=e.prop(n.map(Y=>Y.id)),ie=new Map(n.map(Y=>[Y.id,Y])),ve=Y=>ie.get(Y),J=e.computedOf(o,R,Z)((Y,be,ze)=>Y?ze.filter(tt=>!be.includes(tt)&&ie.has(tt)):n.filter(tt=>!be.includes(tt.id)).map(tt=>tt.id)),se=Y=>{const be=new Set(R.value);be.has(Y)?be.delete(Y):be.add(Y),R.set(Array.from(be))},le=()=>{R.set(Array.from(n.map(Y=>Y.id)))},ye={},_e={};for(const Y of n)Y.value&&(ye[Y.id]=Y.value),Y.comparator&&(_e[Y.id]=Y.comparator);const ke=hn({data:a,rowId:r,accessors:ye,comparators:_e,...i!=null?{pageSize:e.Value.map(Q,Y=>Y===!1?0:Y?.pageSize??10)}:{},multiSort:T,serverSide:y,totalRows:_,groupBy:w,onSortChange:d,onFilterChange:g,onSelectionChange:p,onGroupByChange:b});x?.(ke);const j=e.Value.toSignal(h),A=e.Value.toSignal(U),te=e.Value.toSignal(X),de=e.computedOf(j,A,te)((Y,be,ze)=>Y||be&&ze||k!=null),ee=e.computedOf(A,te)((Y,be)=>Y&&be||k!=null),xe=n.some(Y=>Y.filter!=null)?e.Value.map(W,Y=>!!Y):!1,Le=n.some(Y=>Y.footer!=null),E=e.Value.toSignal(e.Value.map(Q,Y=>Y!==!1)),q=e.prop(new Set),ue=e.Value.toSignal(e.Value.map(Q,Y=>Y===!1?0:Y?.pageSize??10)),he=e.Value.toSignal(y),De=e.prop(1),$e=e.computedOf(ke.groups,ue,q,he)((Y,be,ze,tt)=>tt?[Y]:oo(Y,be,ze)),Be=$e.map(Y=>Y.length),Ge=e.Value.on(Be,Y=>{De.value>Y&&De.set(Math.max(1,Y))}),M=e.computedOf($e,De)((Y,be)=>{const ze=Math.max(0,Math.min(be-1,Y.length-1));return Y[ze]??[]}),K=e.computedOf(ke.groupBy,ke.totalPages,Be)((Y,be,ze)=>Y!=null?ze:be),re=e.computedOf(ke.groupBy,ke.currentPage,De)((Y,be,ze)=>Y!=null?ze:be),ce=Y=>{if(ke.groupBy.value!=null){const be=Math.max(1,Math.min(Y,Be.value));De.set(be)}else ke.setPage(Y)},me=e.computedOf(E,K)((Y,be)=>Y&&be>1),ge=N!=null&&(N.defaultState??"collapsed")!=="always-visible",Oe=N!=null&&ge?(()=>{const Y=N.defaultState??"collapsed",be=e.prop(new Set);return{toggledIds:be,renderedOnce:new Set,isExpanded:_t=>{const nt=be.value.has(_t);return Y==="expanded"?!nt:nt},toggle:_t=>{const nt=new Set(be.value);nt.has(_t)?nt.delete(_t):nt.add(_t),be.set(nt),N.onExpandedChange?.(nt)}}})():void 0,Kt=e.computedOf(J,te)((Y,be)=>Y.length+(be?1:0)+(ge?1:0));return{ds:ke,columns:n,columnMap:ie,getCol:ve,rowId:r,visibleColumns:J,hiddenColumns:R,hideableColumns:O,hasColumnVisibility:z,toggleColumnVisibility:se,showAllColumns:le,columnOrder:Z,reorderableColumns:o,onColumnOrderChange:c,dragState:{columnId:null},selectable:X,selectableSignal:te,selectOnRowClickSignal:A,selectionAfter:P,sortable:H,multiSort:T,size:f,onRowClick:k,filterLayout:B,hasFilters:xe,loading:v,showFooter:S,emptyContent:D,groupCollapsible:I,groupSummary:V,hasFooter:Le,rowClickable:ee,effectiveHoverable:de,totalColSpan:Kt,collapsedGroups:q,currentGroupPageGroups:M,toolbarConfig:F,paginationConfig:Q,paginationEnabledSignal:E,pageSizeSignal:ue,effectiveTotalPages:K,effectiveCurrentPage:re,setEffectivePage:ce,showPagination:me,rowDetails:N,hasToggleColumn:ge,expandedRows:Oe,dispose:()=>{ke.dispose(),R.dispose(),J.dispose(),Kt.dispose(),Z.dispose(),q.dispose(),j.dispose(),A.dispose(),te.dispose(),de.dispose(),ee.dispose(),E.dispose(),ue.dispose(),he.dispose(),De.dispose(),Ge(),$e.dispose(),Be.dispose(),M.dispose(),K.dispose(),re.dispose(),me.dispose(),F.dispose(),Oe?.toggledIds.dispose()}}}function $n({dataSource:t,column:a,size:n,actions:r,menu:l,hideInactiveIcon:s=!1,multiSort:u=!0,draggable:o,onDragStart:c,onDragOver:i,onDrop:m,onDragEnd:f},...h){const d=t.getSortDirection(a),g=d.map(b=>{switch(b){case"asc":return"line-md:arrow-small-up";case"desc":return"line-md:arrow-small-down";default:return"line-md:arrows-vertical"}}),p=d.map(b=>{const k="bc-sortable-header";return b==="asc"?`${k} ${k}--asc`:b==="desc"?`${k} ${k}--desc`:k});return e.html.th(e.attr.class(p),e.attr.role("columnheader"),o!=null?e.attr.draggable(e.Value.map(o,b=>b?"true":void 0)):null,c!=null?e.on.dragstart(c):null,i!=null?e.on.dragover(i):null,m!=null?e.on.drop(m):null,f!=null?e.on.dragend(f):null,e.aria.sort(d.map(b=>b==="asc"?"ascending":b==="desc"?"descending":"none")),e.on.click(b=>t.toggleSort(a,{multi:b.shiftKey})),e.html.div(e.attr.class("bc-sortable-header__content"),e.html.span(e.attr.class("bc-sortable-header__label"),...h),e.html.span(e.attr.class("bc-sortable-header__icons"),s?e.When(d.map(b=>b!=null),()=>e.html.span(e.attr.class("bc-sortable-header__icon bc-sortable-header__icon--active"),C.Icon({icon:g,size:n??"md"}),e.When(u,()=>e.Use(C.BeatUII18n,b=>gt({content:b.$.dataTable.map(k=>k.sortMultiHint),showDelay:800}))))):e.html.span(e.attr.class(d.map(b=>b!=null?"bc-sortable-header__icon bc-sortable-header__icon--active":"bc-sortable-header__icon")),C.Icon({icon:g,size:n??"md"}),e.When(u,()=>e.Use(C.BeatUII18n,b=>gt({content:b.$.dataTable.map(k=>k.sortMultiHint),showDelay:800})))),r??null,l!=null?e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(b=>b.stopPropagation()),l):null)))}function xn(t){return t.hasToggleColumn?e.html.th(e.attr.class("bc-data-table__toggle-header")):null}function Dn(t){return t.hasToggleColumn?e.html.th(e.attr.class("bc-data-table__toggle-header")):null}function $a(t,a,n){if(!n.hasToggleColumn||!n.expandedRows||!n.rowDetails)return null;if(!(n.rowDetails.hasDetails?n.rowDetails.hasDetails(t):!0))return e.html.td(e.attr.class("bc-data-table__toggle-cell"));const l=n.expandedRows.toggledIds.map(()=>n.expandedRows.isExpanded(a));return e.html.td(e.attr.class("bc-data-table__toggle-cell"),e.html.button(e.attr.class(l.map(s=>s?"bc-data-table__group-toggle":"bc-data-table__group-toggle bc-data-table__group-toggle--collapsed")),e.attr.type("button"),e.on.click(s=>{s.stopPropagation(),n.expandedRows.toggle(a)}),C.Icon({icon:"lucide:chevron-down",size:"sm"})))}function xa(t,a,n){if(!n.rowDetails||!(n.rowDetails.hasDetails?n.rowDetails.hasDetails(t):!0))return null;const l=n.rowDetails.defaultState??"collapsed";if(l==="always-visible")return e.html.tr(e.attr.class("bc-data-table__detail-row"),e.html.td(e.attr.class("bc-data-table__detail-cell"),e.attr.colspan(n.totalColSpan),e.html.div(n.rowDetails.render(t))));if(!n.expandedRows)return null;const s=n.expandedRows,u=s.toggledIds.map(()=>s.isExpanded(a)),o=e.prop(l==="expanded"||s.renderedOnce.has(a));if(l==="expanded"&&s.renderedOnce.add(a),!o.value){const c=e.Value.on(u,i=>{i&&!o.value&&(s.renderedOnce.add(a),o.set(!0),c())})}return e.html.tr(e.attr.class("bc-data-table__detail-row"),e.style.display(u.map(c=>c?"":"none")),e.html.td(e.attr.class("bc-data-table__detail-cell"),e.attr.colspan(n.totalColSpan),e.When(o,()=>e.html.div(n.rowDetails.render(t)))))}function On(t){const{dataSource:a,column:n,sortable:r=!1,hideable:l=!1,size:s="md",onHideColumn:u,hideableColumns:o,hiddenColumns:c,onToggleColumn:i,onResetColumns:m,filterContent:f,hasActiveFilter:h,onClearFilter:d}=t,g=r?a.getSortDirection(n):void 0;return e.Use(C.BeatUII18n,p=>{const b=p.$.dataTable;return Ie.Menu({items:()=>{const k=[],y=g?.value;if(r){const v=[Ie.MenuItem({key:"sort-asc",content:b.map(w=>w.menuSortAsc),before:C.Icon({icon:"line-md:arrow-small-up",size:s}),disabled:g?.map(w=>w==="asc"),onClick:()=>a.setSort([{column:n,direction:"asc"}])}),Ie.MenuItem({key:"sort-desc",content:b.map(w=>w.menuSortDesc),before:C.Icon({icon:"line-md:arrow-small-down",size:s}),disabled:g?.map(w=>w==="desc"),onClick:()=>a.setSort([{column:n,direction:"desc"}])})];y!=null&&v.push(Ie.MenuItem({key:"clear-sort",content:b.map(w=>w.menuClearSort),before:C.Icon({icon:"line-md:arrows-vertical",size:s}),onClick:()=>{const w=a.sort.value.filter(I=>I.column!==n);a.setSort(w)}})),k.push(v)}if(f!=null){const v=[Ie.MenuItem({key:"filter",content:b.map(w=>w.menuFilter??"Filter"),before:C.Icon({icon:"lucide:filter",size:s}),submenu:()=>[e.html.div(e.on.click(w=>w.stopPropagation()),f)]})];d&&h&&v.push(e.When(h,()=>Ie.MenuItem({key:"clear-filter",content:b.map(w=>w.clearFilter),before:C.Icon({icon:"lucide:filter-x",size:s}),onClick:d}))),k.push(v)}if(l&&u&&k.push([Ie.MenuItem({key:"hide-column",content:b.map(v=>v.menuHideColumn),before:C.Icon({icon:"lucide:eye-off",size:s}),onClick:u})]),o&&o.length>0&&c&&i){const v=[Ie.MenuItem({key:"choose-columns",content:b.map(w=>w.menuChooseColumns),before:C.Icon({icon:"lucide:columns-3",size:s}),submenu:()=>[e.html.div(e.attr.class("bc-data-table__column-toggle-panel"),e.on.click(w=>w.stopPropagation()),...o.map(w=>oe.CheckboxInput({value:c.map(I=>!I.has(w.id)),onChange:()=>i(w.id),placeholder:w.label})),e.When(c.map(w=>w.size>0),()=>m?ne.Button({size:"xs",variant:"outline",onClick:()=>m()},b.$.showAllColumns):null))]})];m&&v.push(e.When(c.map(w=>w.size>0),()=>Ie.MenuItem({key:"reset-columns",content:b.map(w=>w.menuResetColumns),before:C.Icon({icon:"lucide:rotate-ccw",size:s}),onClick:m}))),k.push(v)}const _=[];for(let v=0;v<k.length;v++)v>0&&_.push(Ie.MenuSeparator()),_.push(...k[v]);return _},placement:"bottom-end",showOn:"click"})})}function po(t){return t==="checked"?!0:t==="indeterminate"?"mixed":!1}function mo(t){return t==="unchecked"?"checked":t==="checked"?"indeterminate":"unchecked"}const Tn=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,placeholder:s,disabled:u,id:o,activeIcon:c,inactiveIcon:i,indeterminateIcon:m,size:f="md"}=t,h=o??Pe.sessionId("tri-state-checkbox"),d=`${h}-label`,g=()=>{if(e.Value.get(u??!1))return;const _=e.Value.get(a),v=mo(_);r?.(v),l?.(v)},p=_=>{e.Value.get(u??!1)||(_.key===" "||_.key==="Enter")&&(_.preventDefault(),g())},b=e.Value.map(a,_=>_==="checked"?"bc-checkbox-input__checkbox--checked":_==="indeterminate"?"bc-checkbox-input__checkbox--indeterminate":"bc-checkbox-input__checkbox--unchecked"),k=e.Value.map(a,_=>po(_)),y=e.computedOf(a,c,i,m)((_,v,w,I)=>_==="checked"?v??"ri:checkbox-fill":_==="indeterminate"?I??"mdi:checkbox-indeterminate-outline":w??"mdi:checkbox-blank-outline");return ne.InputContainer({baseContainer:!0,growInput:!1,...t,input:e.html.span(e.attr.class("bc-checkbox-input"),e.html.span(e.attr.class("bc-checkbox-input__checkbox"),e.attr.class(b),e.attr.class(e.Value.map(u??!1,_=>_?"bc-checkbox-input__checkbox--disabled":"")),e.attr.id(h),e.attr.role("checkbox"),e.attr.tabindex(e.Value.map(u??!1,_=>_?-1:0)),e.aria.checked(k),e.aria.disabled(u),s!=null?e.aria.labelledby(d):e.Empty,e.on.keydown(p),n!=null?e.on.blur(n):e.Empty,C.Icon({icon:y,accessibility:"decorative",size:f})),s!=null?e.html.label(e.attr.class("bc-checkbox-input__label"),e.attr.id(d),e.attr.for(h),et.MutedLabel(s)):e.Empty)},e.on.click(g))};function Da({dataSource:t,rowId:a,isSelected:n,size:r="md"}){return oe.CheckboxInput({size:r,value:n,onChange:()=>t.toggleSelect(e.Value.get(a))})}function Pn({dataSource:t,size:a="md"}){const n=e.computedOf(t.isAllSelected,t.isSomeSelected)((r,l)=>r?"checked":l?"indeterminate":"unchecked");return Tn({size:a,value:n,onChange:()=>{t.isAllSelected.value?t.deselectAll():t.selectAll()}})}function ho(t,a){if(!In(t))return;const n=Vn(t);return io(n,a.ds,t.id,a.size)??void 0}function fo(t,a,n){const r=n.ds.getColumnFilters(t.id),l=r.map(d=>d.length>0),s=t.sortable!=null?t.sortable:!1,u=t.hideable!=null?typeof t.hideable=="boolean"?t.hideable:t.hideable.value:!1,o=In(t),c=e.computedOf(n.sortable,s)((d,g)=>!!d&&!!g),i=o?e.computedOf(a,l)((d,g)=>d&&g):!1,m=o?ho(t,n):void 0,f=o?a:!1,h=e.computedOf(c,f)((d,g)=>d||g||u);return e.html.span(e.attr.class("bc-column-header-menu"),e.When(i,()=>e.html.span(e.attr.class("bc-sortable-header__icon bc-sortable-header__icon--active"),e.on.click(d=>d.stopPropagation()),C.Icon({icon:"lucide:filter",size:n.size}),Ie.Flyout({content:()=>e.html.div(e.attr.class("bc-column-filter-panel"),e.on.click(d=>d.stopPropagation()),m??null),placement:"bottom-end",showOn:"click",showDelay:0,hideDelay:0}),e.Use(C.BeatUII18n,d=>{const g=e.computedOf(d.$.dataTable.$.describeFilter,r)((p,b)=>b.map(k=>jt(k,p)).join(", "));return gt({content:g,showDelay:300})}))),e.When(h,()=>e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(d=>d.stopPropagation()),C.Icon({icon:"lucide:ellipsis-vertical",size:n.size}),e.MapSignal(e.computedOf(c,f)((d,g)=>({s:d,f:g})),({s:d,f:g})=>On({dataSource:n.ds,column:t.id,sortable:d,hideable:u,size:n.size,onHideColumn:u?()=>n.toggleColumnVisibility(t.id):void 0,filterContent:g?m:void 0,hasActiveFilter:g?l:void 0,onClearFilter:g&&o?()=>n.ds.removeFilter(t.id):void 0})))))}function go(t,a){return{reorderable:a.reorderableColumns,onDragStart:n=>{if(!e.Value.get(a.reorderableColumns))return;a.dragState.columnId=t,n.dataTransfer&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",t)),n.currentTarget.classList.add("bc-data-table__header--dragging")},onDragOver:n=>{if(!e.Value.get(a.reorderableColumns)||a.dragState.columnId==null||a.dragState.columnId===t)return;n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.currentTarget.classList.add("bc-data-table__header--drag-over")},onDrop:n=>{if(!e.Value.get(a.reorderableColumns)||(n.preventDefault(),n.currentTarget.classList.remove("bc-data-table__header--drag-over"),a.dragState.columnId==null||a.dragState.columnId===t))return;const l=[...a.columnOrder.value],s=l.indexOf(a.dragState.columnId),u=l.indexOf(t);s<0||u<0||(l.splice(s,1),l.splice(u,0,a.dragState.columnId),a.columnOrder.set(l),a.onColumnOrderChange?.(l),a.dragState.columnId=null)},onDragEnd:n=>{if(!e.Value.get(a.reorderableColumns))return;a.dragState.columnId=null;const r=n.currentTarget;r.classList.remove("bc-data-table__header--dragging"),r.closest("tr")?.querySelectorAll(".bc-data-table__header--drag-over").forEach(l=>l.classList.remove("bc-data-table__header--drag-over"))}}}function bo(t,a){return e.MapSignal(t,n=>{const r=a.getCol(n),l=typeof r.header=="string"?r.header:r.header(),s=e.computedOf(a.hasFilters,a.filterLayout)((m,f)=>m&&f==="header"),u=fo(r,s,a),o=go(r.id,a),c=r.sortable!=null?r.sortable:!1,i=e.computedOf(a.sortable,c)((m,f)=>!!m&&!!f);return e.When(i,()=>$n({dataSource:a.ds,column:r.id,size:a.size,menu:u,multiSort:a.multiSort,draggable:o.reorderable,onDragStart:o.onDragStart,onDragOver:o.onDragOver,onDrop:o.onDrop,onDragEnd:o.onDragEnd},l),()=>e.html.th(e.attr.draggable(e.Value.map(o.reorderable,m=>m?"true":void 0)),e.on.dragstart(o.onDragStart),e.on.dragover(o.onDragOver),e.on.drop(o.onDrop),e.on.dragend(o.onDragEnd),r.width!=null?e.style.width(r.width):null,r.minWidth!=null?e.style.minWidth(r.minWidth):null,r.maxWidth!=null?e.style.maxWidth(r.maxWidth):null,r.align!=null?e.style.textAlign(e.Value.map(r.align,m=>m)):null,e.html.div(e.attr.class("bc-sortable-header__content"),e.html.span(e.attr.class("bc-sortable-header__label"),l),u!=null?e.html.span(e.attr.class("bc-sortable-header__icons"),e.html.span(e.attr.class("bc-sortable-header__menu"),e.on.click(m=>m.stopPropagation()),u)):null)))})}function vo(t,a){return e.MapSignal(t,n=>{const r=a.getCol(n),l=Vn(r);return co(l,a.ds,n,a.size)})}function qa(t){return e.When(t.selectable,()=>e.html.th(e.attr.class("bc-data-table__selection-header"),e.html.div(e.attr.class("bc-data-table__selection-cell"),Pn({dataSource:t.ds,size:t.size}))))}function Ga(t){return e.When(t.selectable,()=>e.html.th())}function yo(t){return e.html.tr(xn(t),e.When(e.Value.map(t.selectionAfter,a=>!a),()=>qa(t)),e.ForEach(t.visibleColumns,a=>bo(a,t)),e.When(t.selectionAfter,()=>qa(t)))}function ko(t){const a=e.computedOf(t.hasFilters,t.filterLayout)((n,r)=>n&&r==="row");return e.When(a,()=>e.html.tr(e.attr.class("bc-data-table__filter-row"),Dn(t),e.When(e.Value.map(t.selectionAfter,n=>!n),()=>Ga(t)),e.ForEach(t.visibleColumns,n=>vo(n,t)),e.When(t.selectionAfter,()=>Ga(t))))}function En(t){const{visible:a,message:n,size:r="lg"}=t;return e.When(a,()=>e.html.div(e.attr.class("bc-loading-overlay"),e.html.div(e.attr.class("bc-loading-overlay__content"),C.Icon({icon:"line-md:loading-twotone-loop",size:r}),n!=null?e.html.span(e.attr.class("bc-loading-overlay__message"),n):e.Empty)))}function Fn(t,a,n,r){return e.MapSignal(t,l=>{const s=r.getCol(l);return e.html.td(s.align!=null?e.style.textAlign(e.Value.map(s.align,u=>u)):null,s.width!=null?e.style.width(s.width):null,s.maxWidth!=null?e.style.maxWidth(s.maxWidth):null,s.cell(n,a))})}function _o(t){return e.ForEach(t.ds.rows,a=>{const n=a.map(t.rowId),r=e.computedOf(n,t.ds.selected)((o,c)=>c.has(o)),l=()=>e.When(t.selectable,()=>e.html.td(e.on.click(o=>o.stopPropagation()),e.html.div(e.attr.class("bc-data-table__selection-cell"),Da({dataSource:t.ds,rowId:n,isSelected:r,size:t.size})))),s=e.computedOf(r,t.rowClickable)((o,c)=>{let i="bc-data-table__row";return o&&(i+=" bc-data-table__row--selected"),c&&(i+=" bc-data-table__row--clickable"),i}),u=t.rowId(a.value);return e.Fragment(e.html.tr(e.attr.class(s),e.on.click(()=>{t.selectOnRowClickSignal.value&&t.selectableSignal.value&&t.ds.toggleSelect(n.value),t.onRowClick?.(a.value)}),$a(a,u,t),e.When(e.Value.map(t.selectionAfter,o=>!o),()=>l()),e.ForEach(t.visibleColumns,(o,c)=>Fn(o,c.index,a,t)),e.When(t.selectionAfter,()=>l())),xa(a,u,t))})}function wo(t,a){const n=a.rowId(t),r=e.computedOf(n,a.ds.selected)((o,c)=>c.has(o)),l=e.Value.toSignal(t),s=()=>e.When(a.selectable,()=>e.html.td(e.on.click(o=>o.stopPropagation()),e.html.div(e.attr.class("bc-data-table__selection-cell"),Da({dataSource:a.ds,rowId:n,isSelected:r,size:a.size})))),u=e.computedOf(r,a.rowClickable)((o,c)=>{let i="bc-data-table__row";return o&&(i+=" bc-data-table__row--selected"),c&&(i+=" bc-data-table__row--clickable"),i});return e.Fragment(e.html.tr(e.attr.class(u),e.on.click(()=>{a.selectOnRowClickSignal.value&&a.selectableSignal.value&&a.ds.toggleSelect(n),a.onRowClick?.(t)}),$a(l,n,a),e.When(e.Value.map(a.selectionAfter,o=>!o),()=>s()),e.ForEach(a.visibleColumns,(o,c)=>Fn(o,c.index,l,a)),e.When(a.selectionAfter,()=>s())),xa(l,n,a))}function Co(t){const a=e.computedOf(t.visibleColumns,t.selectableSignal)((l,s)=>l.length+(s?1:0)+(t.hasToggleColumn?1:0)),n=e.computedOf(t.visibleColumns,t.selectableSignal)((l,s)=>{const u=l.findIndex(o=>t.getCol(o).footer!=null);return u<0?l.length+(s?1:0)+(t.hasToggleColumn?1:0):u+(s?1:0)+(t.hasToggleColumn?1:0)}),r=t.hasFooter;return e.MapSignal(t.currentGroupPageGroups,l=>e.Fragment(...l.map(s=>{const u=t.collapsedGroups.map(c=>c.has(s.key)),o=()=>{const c=new Set(t.collapsedGroups.value);c.has(s.key)?c.delete(s.key):c.add(s.key),t.collapsedGroups.set(c)};return e.Fragment(e.Use(C.BeatUII18n,c=>e.html.tr(e.attr.class("bc-data-table__group-header"),e.on.click(()=>{t.groupCollapsible&&o()}),e.html.td(e.When(u,()=>e.attr.colspan(n),()=>e.attr.colspan(a)),e.html.div(e.attr.class("bc-data-table__group-header-content"),t.groupCollapsible?e.html.span(e.attr.class(u.map(i=>i?"bc-data-table__group-toggle bc-data-table__group-toggle--collapsed":"bc-data-table__group-toggle")),e.aria.label(e.computedOf(u,c.$.dataTable)((i,m)=>i?m.expandGroup:m.collapseGroup)),C.Icon({icon:"lucide:chevron-down",size:"sm"})):null,e.html.span(e.attr.class("bc-data-table__group-label"),s.key),e.html.span(e.attr.class("bc-data-table__group-count"),(()=>{const i=c.value.dataTable.groupCount;return i?i(s.rows.length):`(${s.rows.length})`})()),t.groupSummary!=null?e.When(u,()=>e.html.span(e.attr.class("bc-data-table__group-footer-summary"),t.groupSummary(s.key,s.rows))):null)),e.When(u,()=>r?e.When(t.showFooter,()=>e.ForEach(t.visibleColumns,(i,m)=>e.MapSignal(i,f=>{const h=t.getCol(f);return h.footer?e.html.td(e.attr.class("bc-data-table__footer-row bc-data-table__group-footer-row"),h.align!=null?e.style.textAlign(e.Value.map(h.align,d=>d)):null,h.footer(e.Value.toSignal(s.rows))):e.When(n.map(d=>d<m.index),()=>e.html.td())}))):null))),e.When(u.map(c=>!c),()=>e.Fragment(...s.rows.map(c=>wo(c,t)),r?e.When(t.showFooter,()=>e.html.tr(e.attr.class("bc-data-table__footer-row bc-data-table__group-footer-row"),t.hasToggleColumn?e.html.td():null,e.When(t.selectable,()=>e.html.td()),e.ForEach(t.visibleColumns,c=>e.MapSignal(c,i=>{const m=t.getCol(i);return m.footer?e.html.td(m.align!=null?e.style.textAlign(e.Value.map(m.align,f=>f)):null,m.footer(e.Value.toSignal(s.rows))):e.html.td()})))):null)))})))}function Ya(t){return e.When(t.ds.rows.map(a=>a.length===0),()=>e.Use(C.BeatUII18n,a=>e.html.tr(e.html.td(e.attr.colspan(t.totalColSpan),e.attr.class("bc-data-table__empty"),t.emptyContent??a.$.dataTable.map(n=>n.noResults)))))}function So(t){return e.Use(C.BeatUII18n,a=>En({visible:t.loading,message:a.$.dataTable.map(n=>n.loading),size:"lg"}))}function Vo(t){return t.hasFooter?e.When(t.showFooter,()=>e.html.tr(e.attr.class("bc-data-table__footer-row"),t.hasToggleColumn?e.html.td():null,e.When(t.selectable,()=>e.html.td()),e.ForEach(t.visibleColumns,a=>e.MapSignal(a,n=>{const r=t.getCol(n);return r.footer?e.html.td(r.align!=null?e.style.textAlign(e.Value.map(r.align,l=>l)):null,r.footer(t.ds.allFilteredRows)):e.html.td()})))):null}function Io(t){if(t.hideableColumns.length===0)return null;const a=t.hiddenColumns.map(n=>n.length>0);return e.Use(C.BeatUII18n,n=>e.html.div(e.attr.class("bc-data-table__column-toggle"),e.html.button(e.attr.type("button"),e.attr.class(a.map(r=>r?"bc-data-table__column-toggle-btn bc-data-table__column-toggle-btn--active":"bc-data-table__column-toggle-btn")),C.Icon({icon:"lucide:columns-3",size:t.size}),e.html.span(e.attr.class("bc-data-table__column-toggle-label"),n.$.dataTable.map(r=>r.columnVisibility)),Ie.Flyout({content:()=>e.html.div(e.attr.class("bc-data-table__column-toggle-panel"),e.on.click(r=>r.stopPropagation()),...t.hideableColumns.map(r=>oe.CheckboxInput({value:t.hiddenColumns.map(l=>!l.includes(r.id)),onChange:()=>t.toggleColumnVisibility(r.id),placeholder:typeof r.header=="string"?r.header:r.id,size:"sm"})),e.When(a,()=>ne.Button({size:"xs",variant:"outline",onClick:()=>t.showAllColumns()},n.$.dataTable.map(r=>r.showAllColumns)))),placement:"bottom-end",showOn:"click",showDelay:0,hideDelay:0}))))}function Ln(t){const{size:a="md",stickyHeader:n=!1,fullWidth:r=!1,withStripedRows:l=!1,withTableBorder:s=!0,withColumnBorders:u=!1,withRowBorders:o=!0}=t,c=uo(t),i=e.computedOf(c.ds.totalFilteredRows,c.ds.totalRows)((b,k)=>({filtered:b,total:k})),m=Io(c),f=e.MapSignal(c.toolbarConfig,b=>b===!1?null:vn({dataSource:c.ds,showSort:b.showSort??!0,showFilters:b.showFilters??!0,showSelection:b.showSelection??!0,bulkActions:b.bulkActions??[]})),h=e.html.div(e.attr.class("bc-data-table__wrapper"),So(c),mn({size:a,hoverable:c.effectiveHoverable,stickyHeader:n,fullWidth:r,withStripedRows:l,withTableBorder:s,withColumnBorders:u,withRowBorders:o},e.html.thead(yo(c),ko(c)),e.html.tbody(e.When(c.ds.groupBy.map(b=>b!=null),()=>e.Fragment(Co(c),Ya(c)),()=>e.Fragment(_o(c),Ya(c)))),e.html.tfoot(Vo(c)))),d=e.When(c.showPagination,()=>e.html.div(e.attr.class("bc-data-table__pagination"),e.Use(C.BeatUII18n,b=>e.html.div(e.attr.class("bc-data-table__row-count"),e.computedOf(c.pageSizeSignal,c.effectiveCurrentPage,i.$.filtered,i.$.total)((k,y,_,v)=>{const w=(y-1)*k+1,I=Math.min(y*k,_);return b.value.paginationRange(w,I,_,v)}))),bn({currentPage:c.effectiveCurrentPage,totalPages:c.effectiveTotalPages,onChange:b=>c.setEffectivePage(b),siblings:e.Value.map(c.paginationConfig,b=>b===!1?1:b.siblings??1),showFirstLast:e.Value.map(c.paginationConfig,b=>b===!1?!1:b.showFirstLast??!1),showPrevNext:!0,size:a,responsive:e.Value.map(c.paginationConfig,b=>b===!1?!1:b.responsive??!1)}))),g=e.Fragment(m,f,h,d);return e.Value.get(n)?e.html.div(e.attr.class("bc-data-table"),e.OnDispose(()=>{c.dispose(),i.dispose()}),g):e.Fragment(e.OnDispose(()=>{c.dispose(),i.dispose()}),g)}function An(t){const a=t.hour%12||12,n=String(t.minute).padStart(2,"0"),r=t.hour>=12?"PM":"AM";return`${a}:${n} ${r}`}function Bn(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}`}function Mn(t){const a=t.hour%12||12,n=String(t.minute).padStart(2,"0"),r=String(t.second).padStart(2,"0"),l=t.hour>=12?"PM":"AM";return`${a}:${n}:${r} ${l}`}function Nn(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`}function Pt(t,a,n){return a?n?Mn(t):An(t):n?Nn(t):Bn(t)}function vt(t){try{const a=new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions();return a.hourCycle?a.hourCycle==="h11"||a.hourCycle==="h12":a.hour12===!0}catch{return!1}}function aa(t){return String(t).padStart(2,"0")}function $o(t,a){const n=["bc-time-picker",`bc-time-picker--size-${t}`];return a&&n.push("bc-time-picker--disabled"),n.join(" ")}function xo(t,{value:a=null,onSelect:n,showSeconds:r=!1,use12Hour:l,color:s="primary",size:u="md",disabled:o=!1,minuteStep:c=1,secondStep:i=1,showNow:m=!1}){return e.Use(C.Locale,({locale:f})=>e.Use(C.BeatUII18n,h=>{const d=l??f.map(vt),g=e.Value.map(s,P=>`--color-${P}-500`),p=(P,U,R)=>{if(e.Value.get(o))return;const Q=t.PlainTime.from({hour:P,minute:U,second:R});n?.(Q)},b=e.Value.map(a,P=>P?.hour??null),k=e.Value.map(a,P=>P?.minute??null),y=e.Value.map(a,P=>P?.second??null),_=e.Value.map(a,P=>P?.hour??0),v=e.Value.map(a,P=>P?.minute??0),w=e.Value.map(a,P=>P?.second??0),I=e.Value.toSignal(r),S=e.Value.toSignal(d),V=e.Value.toSignal(m),D=e.computedOf(S)(P=>P?Array.from({length:12},(U,R)=>({value:R+1,label:String(R+1)})):Array.from({length:24},(U,R)=>({value:R,label:aa(R)}))),$=na({items:D,selected:e.computedOf(b,S)((P,U)=>{if(P==null)return null;if(U){const R=P%12;return R===0?12:R}return P}),disabled:o,colorVar:g,onItemClick:P=>{const U=e.Value.get(d);let R=P;if(U){const Q=e.Value.get(a),F=Q!=null&&Q.hour>=12;P===12?R=F?12:0:R=F?P+12:P}p(R,e.Value.get(v),e.Value.get(w))},ariaLabel:h.$.timePicker.$.selectHours}),N=e.Value.toSignal(c).map(P=>{const U=[];for(let R=0;R<60;R+=P)U.push({value:R,label:aa(R)});return U}),H=na({items:N,selected:k,disabled:o,colorVar:g,onItemClick:P=>{p(e.Value.get(_),P,e.Value.get(w))},ariaLabel:h.$.timePicker.$.selectMinutes}),W=e.Value.toSignal(i).map(P=>{const U=[];for(let R=0;R<60;R+=P)U.push({value:R,label:aa(R)});return U}),B=na({items:W,selected:y,disabled:o,colorVar:g,onItemClick:P=>{p(e.Value.get(_),e.Value.get(v),P)},ariaLabel:h.$.timePicker.$.selectSeconds}),X=e.html.div(e.attr.class("bc-time-picker__column"),e.aria.label(h.$.timePicker.$.selectPeriod),e.attr.role("listbox"),...[{label:"AM",isAm:!0},{label:"PM",isAm:!1}].map(({label:P,isAm:U})=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(b,g)((R,Q)=>{const F=R!=null&&(U?R<12:R>=12),O=["bc-time-picker__item"];return F&&O.push("bc-time-picker__item--selected"),O.join(" ")})),e.attr.style(e.computedOf(b,g)((R,Q)=>R!=null&&(U?R<12:R>=12)?`--tp-selected-bg: var(${Q})`:"")),e.attr.disabled(o),e.attr.role("option"),e.aria.selected(e.Value.map(b,R=>R!=null?U?R<12:R>=12:!1)),e.on.click(()=>{if(e.Value.get(o))return;const R=e.Value.get(_);let Q;U?Q=R>=12?R-12:R:Q=R<12?R+12:R,p(Q,e.Value.get(v),e.Value.get(w))}),P)));return e.html.div(e.attr.class(e.computedOf(u,o)($o)),e.aria.label(h.$.timePicker.$.label),e.attr.role("group"),e.html.div(e.attr.class("bc-time-picker__columns"),e.html.div(e.attr.class("bc-time-picker__header"),e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.hoursLabel),e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.minutesLabel),e.When(I,()=>e.html.span(e.attr.class("bc-time-picker__header-label"),h.$.timePicker.$.secondsLabel),()=>e.Empty),e.When(S,()=>e.html.span(e.attr.class("bc-time-picker__header-label"),""),()=>e.Empty)),e.html.div(e.attr.class("bc-time-picker__body"),$,e.html.span(e.attr.class("bc-time-picker__separator"),":"),H,e.When(I,()=>e.Fragment(e.html.span(e.attr.class("bc-time-picker__separator"),":"),B),()=>e.Empty),e.When(S,()=>X,()=>e.Empty)),e.When(V,()=>e.html.div(e.attr.class("bc-time-picker__footer"),e.html.button(e.attr.type("button"),e.attr.class("bc-time-picker__now-btn"),e.attr.disabled(o),e.on.click(()=>{if(e.Value.get(o))return;const P=t.Now.plainTimeISO();n?.(P)}),h.$.timePicker.$.nowLabel)),()=>e.Empty)))}))}function na(t){const{items:a,selected:n,disabled:r,colorVar:l,onItemClick:s,ariaLabel:u}=t;return e.html.div(e.attr.class("bc-time-picker__column"),e.aria.label(u),e.attr.role("listbox"),e.MapSignal(e.Value.toSignal(a),o=>e.Fragment(...o.map(c=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(n,l)((i,m)=>{const f=["bc-time-picker__item"];return i===c.value&&f.push("bc-time-picker__item--selected"),f.join(" ")})),e.attr.style(e.computedOf(n,l)((i,m)=>i===c.value?`--tp-selected-bg: var(${m})`:"")),e.attr.disabled(r),e.attr.role("option"),e.aria.selected(e.Value.map(n,i=>i===c.value)),e.on.click(()=>s(c.value)),c.label)))))}function bt(t){return ae.WithTemporal(a=>xo(a,t??{}))}function Do(t,a){const n=["bc-stat-card"];return t!=="default"&&n.push(`bc-stat-card--${t}`),a!=="md"&&n.push(`bc-stat-card--padding-${a}`),n.join(" ")}function Oo({variant:t="default",size:a="md",color:n="primary"}={},...r){return e.html.div(e.attr.role("group"),e.attr.class(e.computedOf(t,a)(Do)),e.attr.style(e.Value.map(n,l=>`--stat-card-accent: var(--color-${l}-500)`)),...r)}function To({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__value"),e.attr.class(t),...a)}function Po({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__label"),e.attr.class(t),...a)}function Eo(t){const{value:a,direction:n,color:r}=t;return e.Use(C.BeatUII18n,l=>{const s=r??e.Value.map(n,c=>c==="up"?"success":c==="down"?"danger":"neutral"),u=e.Value.map(n,c=>c==="up"?"lucide:trending-up":c==="down"?"lucide:trending-down":"lucide:minus"),o=e.computedOf(n,a,l.$.statCard.$.trendUp,l.$.statCard.$.trendDown,l.$.statCard.$.trendFlat)((c,i,m,f,h)=>`${c==="up"?m:c==="down"?f:h}: ${i}`);return e.html.span(e.attr.role("status"),e.attr.class(e.Value.map(n,c=>`bc-stat-card__trend bc-stat-card__trend--${c}`)),e.attr.style(e.Value.map(s,c=>`--stat-card-trend-color: var(--color-${c}-600); --stat-card-trend-color-dark: var(--color-${c}-400)`)),e.aria.label(o),C.Icon({icon:u,size:"xs"}),e.html.span(e.attr.class("bc-stat-card__trend-value"),e.Value.map(a,String)))})}function Fo({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__icon"),e.attr.class(t),...a)}function Lo({class:t}={},...a){return e.html.div(e.attr.class("bc-stat-card__sparkline"),e.attr.class(t),...a)}function Ao(t,a){const n=new Array(t+1);n[0]=0;for(let r=0;r<t;r++)n[r+1]=n[r]+a(r);return n}function Bo(t,a){let n=0,r=t.length-2;for(;n<r;){const l=n+r>>1;t[l+1]<=a?n=l+1:r=l}return n}function Mo(t,a,n,r,l){const s=Math.floor(t/r)-l,u=Math.ceil((t+a)/r)+l,o=Math.max(0,s),c=Math.min(n-1,u),i=o*r;return{startIndex:o,endIndex:c,offset:i}}function No(t,a,n,r,l){const s=Bo(r,t)-l,u=Math.max(0,s);let o=u;const c=t+a;for(;o<n&&r[o]<c;)o++;const i=Math.min(n-1,o+l),m=r[u]??0;return{startIndex:u,endIndex:i,offset:m}}function Wo({items:t,renderItem:a,itemHeight:n,overscan:r=5,containerHeight:l,class:s}){const u=typeof n=="number",o=r,c=e.prop(0),i=e.Value.get(l),m=e.prop(typeof i=="number"?i:400),f=e.computedOf(t)(v=>v.length),h=e.computedOf(f)(v=>{if(u)return v*n;const w=n;let I=0;for(let S=0;S<v;S++)I+=w(S);return I}),d=u?null:e.computedOf(f)(v=>Ao(v,n)),g=(v,w)=>v==null||w==null?v===w:v.startIndex===w.startIndex&&v.endIndex===w.endIndex&&v.offset===w.offset,p=u?e.computedOf(c,m,f,o)((v,w,I,S)=>Mo(v,w,I,n,S),g):e.computedOf(c,m,f,d,o)((v,w,I,S,V)=>No(v,w,I,S,V),g),b=e.computedOf(p,t)((v,w)=>{const{startIndex:I,endIndex:S}=v,V=[];for(let D=I;D<=S&&D<w.length;D++)V.push({item:w[D],index:D});return V}),k=e.computedOf(p)(v=>`translateY(${v.offset}px)`),y=e.computedOf(l)(v=>typeof v=="number"?`${v}px`:v),_=e.computedOf(s??"")(v=>v?`bc-virtual-list ${v}`:"bc-virtual-list");return e.Use(C.BeatUII18n,v=>e.html.div(e.attr.class(_),e.style.height(y),e.aria.label(v.$.virtualList.$.listLabel),e.attr.role("list"),e.WithElement(w=>{const I=()=>{c.set(w.scrollTop)};m.set(w.clientHeight||m.value),w.addEventListener("scroll",I,{passive:!0});const S=new ResizeObserver(D=>{for(const $ of D)m.set($.contentRect.height||m.value)});S.observe(w);const V=e.Value.on(h,()=>{requestAnimationFrame(()=>{w.scrollTop!==c.value&&c.set(w.scrollTop)})});return e.OnDispose(()=>{w.removeEventListener("scroll",I),S.disconnect(),V()})}),e.html.div(e.attr.class("bc-virtual-list__spacer"),e.style.height(e.Value.map(h,w=>`${w}px`))),e.html.div(e.attr.class("bc-virtual-list__viewport"),e.style.transform(k),e.MapSignal(b,w=>e.Fragment(...w.map(({item:I,index:S})=>e.html.div(e.attr.role("listitem"),a(I,S))))))))}function Wn({value:t,onChange:a,disabled:n,size:r="md"}){return e.Use(C.BeatUII18n,l=>ae.SegmentedInput({size:r,variant:"squared",value:t,disabled:n,options:{system:e.html.span(e.attr.title(l.$.appearanceSystem),C.Icon({icon:"line-md:laptop",color:"gray"})),light:e.html.span(e.attr.title(l.$.appearanceLight),C.Icon({icon:"line-md:sunny-twotone-loop",color:"yellow"})),dark:e.html.span(e.attr.title(l.$.appearanceDark),C.Icon({icon:"line-md:sunny-outline-to-moon-alt-loop-transition",color:"blue"}))},onChange:a}))}function Uo(t){return e.Use(St.Theme,({appearancePreference:a,setAppearancePreference:n})=>Wn({value:a,onChange:n,size:t?.size}))}function Ro({value:t,onChange:a,onInput:n}){return e.html.div(e.attr.class("bc-color-input__swatch-container"),e.html.span(e.attr.class("bc-color-input__swatch"),e.input.color(e.attr.class("bc-color-input__swatch-native"),e.attr.value(t),a!=null?e.on.change(e.emitValue(a)):e.Empty,n!=null?e.on.input(e.emitValue(n)):e.Empty),e.attr.style(e.Value.map(t,r=>`background-color: ${r}`))))}function Un(t){const{value:a="#000000",onBlur:n,onChange:r,onInput:l,swatchSize:s,...u}=t;return ne.InputContainer({...u,input:e.input.text(Fe.CommonInputAttributes(t),e.attr.value(a),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(r)):e.Empty,l!=null?e.on.input(e.emitValue(l)):e.Empty)},e.attr.class("bc-color-input"),Ro({value:a,onChange:t.onChange,onInput:t.onInput}))}function Gt({ctx:t,width:a,height:n}){const r=t.createLinearGradient(0,0,a,0);for(const l of[0,60,120,180,240,300,360])r.addColorStop(l/360,G.vt(G.k(l,1,.5)));t.fillStyle=r,t.fillRect(0,0,a,n)}function ut(t,a,n,r=8){for(let l=0;l<n;l+=r)for(let s=0;s<a;s+=r)t.fillStyle=(s+l)%(r*2)<r?"#e5e5e5":"#ffffff",t.fillRect(s,l,r,r)}function zo(t){return`bc-kbd bc-kbd--size-${t}`}function Ho({size:t="sm"}={},...a){return e.html.kbd(e.attr.class(e.Value.map(t,n=>zo(n??"sm"))),...a)}function jo(t){return Ee.Overlay((a,n)=>{let r=n;const l=()=>r();return t(o=>{const{size:c="md",side:i="right",dismissable:m=!0,showCloseButton:f=!0,onClose:h,overlayEffect:d="opaque",container:g="body",header:p,body:b,footer:k}=o;r=n;const y=e.prop("capturing");e.Value.on(m,w=>{y.set(w?"capturing":"non-capturing")});const _=e.computedOf(p!=null,f)((w,I)=>w||I),v=e.WithElement(w=>{const I=He.useAnimatedElementToggle({initialStatus:"closed",element:w});I.listenOnClosed(()=>{n()}),r=()=>{I.close()},we.delayedAnimationFrame(()=>I.open());const V=Pe.sessionId("drawer"),D=p!=null?`${V}-header`:void 0,$=`${V}-body`;return e.html.div(e.attr.class(e.computedOf(c,i,I.status)((x,N,H)=>`bc-drawer bc-drawer--size-${x} bc-drawer--container-${g} bc-drawer--side-${N} bc-drawer--status-${H}`)),e.attr.role("dialog"),e.aria.modal(!0),...D?[e.aria.labelledby(D)]:[],e.aria.describedby($),e.attr.tabindex(-1),e.attr.id(V),e.dataAttr("focus-trap","true"),Ee.FocusTrap({active:!0,escapeDeactivates:!1,initialFocus:()=>document.querySelector(`#${V} [aria-label="Close drawer"]`)||null}),e.on.mousedown(x=>x.stopPropagation()),e.When(_,()=>da({header:e.html.div(e.attr.class("bc-drawer__header"),e.html.div(e.attr.id(D),p),e.When(f,()=>e.Use(C.BeatUII18n,x=>oe.CloseButton({size:"sm",onClick:l,label:x.$.closeDrawer})))),body:e.html.div(e.attr.class("bc-drawer__body"),e.attr.id($),b),footer:k&&e.html.div(e.attr.class("bc-drawer__footer"),k)}),()=>da({body:e.html.div(e.attr.class("bc-drawer__body"),e.attr.id($),b),footer:k&&e.html.div(e.attr.class("bc-drawer__footer"),k)})))});a({mode:y,effect:d??"opaque",container:g,content:v,onClickOutside:()=>{h?.(),l()},onEscape:()=>{h?.(),l()}})},()=>{l()})})}function qo(t){const{content:a,placement:n="bottom",showDelay:r=0,hideDelay:l=0,mainAxisOffset:s=8,crossAxisOffset:u=0,showOn:o="click",closable:c=!0,role:i="dialog",hasPopup:m="dialog"}=t,f=Pe.sessionId("popover"),h=typeof a=="function"?a:()=>a;return e.Fragment(e.aria.describedby(f),Ie.Flyout({content:()=>e.Fragment(e.attr.class("bc-popover"),e.attr.role(i),e.attr.id(f),h()),placement:n,showDelay:r,hideDelay:l,mainAxisOffset:s,crossAxisOffset:u,showOn:o,closable:c,role:i,hasPopup:m}))}function Go(t,a,n,r,l,s){const u=C.backgroundValue(t,"solid","light"),o=C.backgroundValue(t,"solid","dark");return[`--ribbon-bg: ${u.backgroundColor}`,`--ribbon-text: ${u.textColor}`,`--ribbon-bg-dark: ${o.backgroundColor}`,`--ribbon-text-dark: ${o.textColor}`,`--ribbon-inset: ${ra(a)}`,`--ribbon-offset: ${ra(n)}`,`--ribbon-width: ${ra(r)}`,`--ribbon-angle: ${l}deg`,`--ribbon-corner: ${s}`].join("; ")}function ra(t){return t==null?null:typeof t=="number"?`${t}px`:t}function Yo({color:t="primary",class:a,inset:n=0,offset:r=40,width:l=100,angle:s=45,corner:u="top-end"},...o){return e.html.div(e.attr.class("bc-ribbon"),e.attr.style(e.computedOf(t,n,r,l,s,u)(Go)),e.attr.class(a),...o)}function Ko(t,a){const{dismissable:n=!0,showCloseButton:r=!0,overlayEffect:l="opaque",container:s="body",padding:u=32}=t;return Ee.Overlay((o,c)=>{let i=()=>{};return a(h=>{i=c;const d=e.prop(typeof n!="boolean"||n?"capturing":"non-capturing");let g=typeof n=="boolean"?n:!0;e.Value.on(n,b=>{g=b,d.set(b?"capturing":"non-capturing")});const p=e.html.div(e.attr.class("bc-lightbox"),e.When(r,()=>e.Use(C.BeatUII18n,b=>e.html.div(e.attr.class("bc-lightbox__close"),oe.CloseButton({size:"md",label:b.$.closeModal,onClick:()=>{i(),c()}}))),()=>null),e.html.div(e.attr.class("bc-lightbox__viewport"),e.attr.style(e.computedOf(u)(b=>`padding:${typeof b=="number"?b+"px":b}`)),e.html.div(e.attr.class("bc-lightbox__content"),h)));o({mode:d,effect:l??"opaque",container:s,content:p,onClickOutside:()=>{g&&(i(),c())},onEscape:()=>{g&&(i(),c())}})},()=>{i(),c()})})}function Zo(t,a){const n=["bc-announcement-bar"];return t&&n.push("bc-announcement-bar--dismissible"),a&&a.length>0&&n.push(a),n.join(" ")}function Xo(t){return`--announcement-bar-bg-color: ${fe.getColorVar(t,600)}`}function Qo({color:t="primary",icon:a,closable:n=!1,onClose:r,class:l,portal:s=!1},...u){const o=e.prop(!0),c=e.When(o,()=>{const i=e.Value.map(n,m=>!!m||r!=null);return e.html.div(e.attr.class(e.computedOf(i,l)((m,f)=>Zo(m,f))),e.attr.style(e.Value.map(t,m=>Xo(m))),e.html.div(e.attr.class("bc-announcement-bar__content"),e.When(e.Value.map(a,m=>m!=null),()=>e.html.div(e.attr.class("bc-announcement-bar__icon"),C.Icon({icon:a,size:"sm",accessibility:"decorative"}))),e.html.div(e.attr.class("bc-announcement-bar__text"),...u),e.When(i,()=>e.html.div(e.attr.class("bc-announcement-bar__close"),oe.CloseButton({size:"xs",color:"white",onClick:()=>{o.set(!1),r?.()}})))))});return s===!1?c:e.Portal(s===!0?"body":s,c)}function Jo(t,a){const n=a.toLowerCase();return(a?t.filter(l=>l.label.toLowerCase().includes(n)||(l.description?.toLowerCase().includes(n)??!1)):t).map((l,s)=>({item:l,index:s}))}function es(t){const{items:a,onClose:n,position:r}=t,l=e.prop(""),s=e.prop(0);l.on(()=>s.set(0));const u=e.computedOf(a,l)((i,m)=>Jo(i,m??"")),o=i=>{const m=e.Value.get(u),f=e.Value.get(s);switch(i.key){case"ArrowDown":i.preventDefault(),s.set(Math.min(f+1,m.length-1));break;case"ArrowUp":i.preventDefault(),s.set(Math.max(f-1,0));break;case"Enter":i.preventDefault();{const h=m.find(d=>d.index===f);h&&(h.item.onSelect(),n())}break;case"Escape":i.preventDefault(),n();break}},c=r?e.computedOf(r)(i=>i?`position: absolute; left: ${i.x}px; top: ${i.y}px;`:""):void 0;return e.Use(C.BeatUII18n,i=>e.html.div(e.attr.class("bc-block-command-palette"),c?e.attr.style(c):e.Empty,e.on.keydown(o),e.html.div(e.attr.class("bc-block-command-palette__search"),e.html.span(e.attr.class("bc-block-command-palette__search-prefix"),"/"),e.html.input(e.attr.class("bc-block-command-palette__search-input"),e.attr.type("text"),e.attr.placeholder(i.$.typeACommand),e.attr.autofocus(!0),e.attr.value(l),e.on.input(m=>{l.set(m.target.value),s.set(0)}))),e.html.div(e.attr.class("bc-block-command-palette__list"),e.ForEach(u,m=>{const f=e.computedOf(s,m)((h,d)=>h===d.index);return e.html.div(e.attr.class(e.Value.map(f,h=>`bc-block-command-palette__item${h?" bc-block-command-palette__item--selected":""}`)),e.on.click(()=>{e.Value.get(m).item.onSelect(),n()}),e.on.mouseenter(()=>{s.set(e.Value.get(m).index)}),e.html.span(e.attr.class("bc-block-command-palette__item-icon"),C.Icon({icon:m.map(h=>h.item.icon),size:"sm",accessibility:"decorative"})),e.html.div(e.attr.class("bc-block-command-palette__item-content"),e.html.span(e.attr.class("bc-block-command-palette__item-label"),m.map(h=>h.item.label)),e.When(m.map(h=>h.item.description!=null),()=>e.html.span(e.attr.class("bc-block-command-palette__item-desc"),m.map(h=>h.item.description??"")))),e.When(m.map(h=>h.item.shortcut!=null),()=>e.html.span(e.attr.class("bc-block-command-palette__item-shortcut"),m.map(h=>h.item.shortcut??""))))})),e.When(e.computedOf(u)(m=>m.length===0),()=>e.html.div(e.attr.class("bc-block-command-palette__empty"),i.$.noMatchingCommands))))}function ts(t,a){const{title:n,body:r,icon:l="lucide:alert-triangle",color:s="danger",consequences:u,confirmText:o,cancelText:c,onConfirm:i,onCancel:m,dismissable:f=!0}=t,h={size:"sm",showCloseButton:!1,dismissable:f,onClose:m};return e.Use(C.BeatUII18n,d=>Ee.Modal(h,(g,p)=>{const b=()=>{i?.(),p()},k=()=>{m?.(),p()};return a(()=>{g({header:e.html.div(e.attr.class("bc-dialog__header-row"),e.html.div(e.attr.class("bc-dialog__icon"),e.style.backgroundColor(e.Value.map(s,_=>fe.getColorVar(_,100))),e.style.color(e.Value.map(s,_=>fe.getColorVar(_,600))),C.Icon({icon:l,size:"sm"})),e.html.span(e.attr.class("bc-dialog__title"),n)),body:e.html.div(e.attr.class("bc-dialog__body"),e.html.p(e.attr.class("bc-dialog__description"),r),e.NotEmpty(u??[],_=>e.html.ul(e.attr.class("bc-dialog__consequences"),e.ForEach(_,v=>e.html.li(v))))),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({variant:"light",size:"sm",onClick:k},e.coalesce(c,d.$.cancel)),ne.Button({color:s,variant:"filled",size:"sm",onClick:b},e.coalesce(o,d.$.confirm)))})},p)}))}const as={info:{icon:"lucide:info",color:"info"},success:{icon:"lucide:check-circle",color:"success"},warning:{icon:"lucide:alert-triangle",color:"warning"},danger:{icon:"lucide:alert-circle",color:"danger"}};function ns(t,a){const{title:n,body:r,variant:l="info",icon:s,okText:u,onOk:o,dismissable:c=!0}=t,i=as[l],m=s??i.icon,f=i.color,h={size:"sm",showCloseButton:!1,dismissable:c,onClose:o};return e.Use(C.BeatUII18n,d=>Ee.Modal(h,(g,p)=>{const b=()=>{o?.(),p()};return a(()=>{g({header:e.html.div(e.attr.class("bc-dialog__header-row"),e.html.div(e.attr.class("bc-dialog__icon"),e.style.backgroundColor(fe.getColorVar(f,100)),e.style.color(fe.getColorVar(f,600)),C.Icon({icon:m,size:"sm"})),e.html.span(e.attr.class("bc-dialog__title"),n)),body:e.html.div(e.attr.class("bc-dialog__body"),r),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({color:f,variant:"filled",size:"sm",onClick:b},e.coalesce(u,d.$.ok)))})},p)}))}function rs(t,a){const{title:n,body:r,placeholder:l,defaultValue:s="",confirmText:u,cancelText:o,onConfirm:c,onCancel:i,dismissable:m=!0}=t,f={size:"sm",showCloseButton:!1,dismissable:m,onClose:i};return e.Use(C.BeatUII18n,h=>Ee.Modal(f,(d,g)=>{const p=e.prop(""),b=()=>{c?.(p.value),g()},k=()=>{i?.(),g()};return a(()=>{p.set(e.Value.get(s)),d({header:e.html.span(e.attr.class("bc-dialog__title"),n),body:e.html.div(e.attr.class("bc-dialog__body"),r??e.Empty,e.html.input(e.attr.class("bc-dialog__input"),e.attr.type("text"),e.attr.value(s),e.attr.placeholder(l??""),e.on.input(e.emitValue(_=>p.set(_))),e.on.keydown(_=>{_.key==="Enter"&&(_.preventDefault(),b())}))),footer:e.Fragment(e.attr.class("bc-dialog__actions"),ne.Button({variant:"light",size:"sm",onClick:k},e.coalesce(o,h.$.cancel)),ne.Button({color:"primary",variant:"filled",size:"sm",onClick:b},e.coalesce(u,h.$.confirm)))})},g)}))}function Ka(t){return typeof t=="string"?document.querySelector(t):t}function ls(t,a){const n=t.getBoundingClientRect();return{top:n.top-a,left:n.left-a,width:n.width+a*2,height:n.height+a*2}}function os(t,a,n,r){const s=window.innerWidth,u=window.innerHeight;let o=a;if(o==="auto"){const m=t.top,f=u-(t.top+t.height),h=t.left,d=s-(t.left+t.width),g=Math.max(m,f,h,d);g===f?o="bottom":g===m?o="top":g===d?o="right":o="left"}let c,i;switch(o){case"bottom":c=t.top+t.height+12,i=t.left+t.width/2-n/2;break;case"top":c=t.top-r-12,i=t.left+t.width/2-n/2;break;case"right":c=t.top+t.height/2-r/2,i=t.left+t.width+12;break;case"left":c=t.top+t.height/2-r/2,i=t.left-n-12;break}return i=Math.max(8,Math.min(i,s-n-8)),c=Math.max(8,Math.min(c,u-r-8)),{top:`${c}px`,left:`${i}px`,actualPlacement:o}}function ss(t){const{steps:a,backdropAction:n="ignore",spotlightPadding:r=8,spotlightRadius:l=8,showStepIndicator:s=!0,showSkipButton:u=!0,onStart:o,onStepChange:c,onComplete:i,onSkip:m,container:f="body"}=t,h=e.prop(!1),d=e.prop(!1),g=e.prop(0),p=e.prop(0),b=e.prop("0px"),k=e.prop("0px"),y=e.prop("0px"),_=e.prop("0px"),v=e.prop("0px"),w=e.prop("0px"),I=e.prop("bottom"),S=Pe.sessionId("onboarding-tour");let V=null;function D(){const J=p.value;if(J<0||J>=a.length)return;const se=a[J],le=Ka(se.target);if(!le)return;const ye=ls(le,r);b.set(`${ye.top}px`),k.set(`${ye.left}px`),y.set(`${ye.width}px`),_.set(`${ye.height}px`);const j=os(ye,se.placement??"auto",320,200);v.set(j.top),w.set(j.left),I.set(j.actualPlacement)}function $(){const J=p.value;if(J<0||J>=a.length)return;const se=a[J],le=Ka(se.target);le&&(le.scrollIntoView({behavior:"smooth",block:"nearest"}),requestAnimationFrame(D))}function x(){a.length!==0&&(p.set(0),D(),h.set(!0),d.set(!0),o?.(),c?.(0),requestAnimationFrame(()=>g.set(1)))}async function N(){const J=p.value,se=a[J];if(!(se.beforeNext&&!await se.beforeNext()))if(J>=a.length-1)B(),i?.();else{const le=J+1;p.set(le),c?.(le),$()}}function H(){const J=p.value;if(J>0){const se=J-1;p.set(se),c?.(se),$()}}function T(){B(),m?.()}const W=200;function B(){h.set(!1),g.set(0),setTimeout(()=>{d.set(!1),p.set(0)},W)}function X(J){J<0||J>=a.length||(p.set(J),c?.(J),h.value&&$())}const P={startTour:x,goToStep:X,endTour:B,isActive:h,currentStep:p},U=e.Value.map(p,J=>J<a.length?a[J].title??"":""),R=e.Value.map(p,J=>J<a.length?a[J].description??"":""),Q=p.map(J=>J<a.length?a[J].content!=null:!1),F=e.Value.map(p,J=>J===0),O=e.Value.map(p,J=>J>=a.length-1),z=e.Value.map(p,J=>J<a.length?a[J].allowInteraction??!1:!1),Z=e.computedOf(b,k,y,_)((J,se,le,ye)=>{const _e=parseFloat(J),ke=parseFloat(se),j=parseFloat(le),A=parseFloat(ye),te=l;return`M0,0 H${window.innerWidth} V${window.innerHeight} H0 Z M${ke+te},${_e} H${ke+j-te} Q${ke+j},${_e} ${ke+j},${_e+te} V${_e+A-te} Q${ke+j},${_e+A} ${ke+j-te},${_e+A} H${ke+te} Q${ke},${_e+A} ${ke},${_e+A-te} V${_e+te} Q${ke},${_e} ${ke+te},${_e} Z`}),ie=()=>e.Use(C.BeatUII18n,J=>{const se=e.computedOf(p,J.$.onboardingTour.$.stepIndicator)((le,ye)=>ye(le+1,a.length));return e.html.div(e.attr.class("bc-onboarding-tour"),e.attr.id(S),e.attr.role("dialog"),e.aria.modal(!0),e.aria.label(J.$.onboardingTour.$.label),e.style.opacity(g.map(String)),e.svg.svg(e.attr.class(e.computedOf(z)(le=>`bc-onboarding-tour__backdrop${le?" bc-onboarding-tour__backdrop--interactive":""}`)),e.svgAttr.width("100%"),e.svgAttr.height("100%"),e.on.click(()=>{n==="close"?T():n==="advance"&&N()}),e.svg.path(e.svgAttr.d(Z),e.svgAttr["fill-rule"]("evenodd"),e.attr.class("bc-onboarding-tour__mask"))),e.html.div(e.attr.class(e.Value.map(I,le=>`bc-onboarding-tour__tooltip bc-onboarding-tour__tooltip--${le}`)),e.style.top(v),e.style.left(w),e.html.div(e.attr.class("bc-onboarding-tour__arrow")),e.html.div(e.attr.class("bc-onboarding-tour__content"),s?e.html.div(e.attr.class("bc-onboarding-tour__step-indicator"),se):e.Empty,e.When(e.Value.map(U,le=>le.length>0),()=>e.html.h3(e.attr.class("bc-onboarding-tour__title"),e.attr.id(`${S}-title`),U),()=>{}),e.When(Q,()=>{const le=p.value;return e.html.div(e.attr.class("bc-onboarding-tour__body"),le<a.length?a[le].content:void 0)},()=>e.When(e.Value.map(R,le=>le.length>0),()=>e.html.p(e.attr.class("bc-onboarding-tour__description"),R),()=>{})),e.html.div(e.attr.class("bc-onboarding-tour__nav"),e.html.div(e.attr.class("bc-onboarding-tour__nav-left"),u?ne.Button({variant:"default",size:"sm",onClick:T},J.$.onboardingTour.$.skip):e.Empty),e.html.div(e.attr.class("bc-onboarding-tour__nav-right"),e.When(F,()=>e.Empty,()=>ne.Button({variant:"outline",size:"sm",onClick:H},J.$.onboardingTour.$.previous)),e.When(O,()=>ne.Button({variant:"filled",color:"primary",size:"sm",onClick:()=>N()},J.$.onboardingTour.$.finish),()=>ne.Button({variant:"filled",color:"primary",size:"sm",onClick:()=>N()},J.$.onboardingTour.$.next))))),Ee.FocusTrap({escapeDeactivates:!0,onEscape:T})),e.WithElement(()=>{const le=ye=>{ye.key==="ArrowRight"?(ye.preventDefault(),N()):ye.key==="ArrowLeft"&&(ye.preventDefault(),H())};return V=()=>$(),document.addEventListener("keydown",le),window.addEventListener("resize",V),e.OnDispose(()=>{document.removeEventListener("keydown",le),V&&(window.removeEventListener("resize",V),V=null)})}))});return[e.When(d,()=>f==="body"?e.Portal("body",ie()):ie()),P]}function is(t,a){if(!t)return 0;const n=a.toLowerCase(),r=t.toLowerCase();let l=0,s=-1,u=0;for(let o=0;o<r.length;o++){const c=r[o],i=n.indexOf(c,l);if(i===-1)return-1;s!==-1&&(u+=i-s-1),s=i,l=i+1}return u}function cs(t,a,n,r){if(!a){if(n.length>0){const o=[];for(let c=0;c<n.length;c++)o.push({item:n[c],globalIndex:c,sectionStart:c===0?r:void 0});return o}return us(t,0)}const l=[];for(const o of t){const c=[o.label,o.description??"",...o.keywords??[]].join(" "),i=is(a,c);i!==-1&&l.push({item:o,score:i})}l.sort((o,c)=>o.score-c.score);const s=[];let u=0;for(const{item:o}of l)s.push({item:o,globalIndex:u++,sectionStart:void 0});return s}function us(t,a){const n=new Map;for(const s of t){const u=s.section??"";n.has(u)||n.set(u,[]),n.get(u).push(s)}const r=[];let l=a;for(const[s,u]of n)for(let o=0;o<u.length;o++)r.push({item:u[o],globalIndex:l++,sectionStart:o===0&&s?s:void 0});return r}function Rn(t,a){const{items:n,onSelect:r,placeholder:l,emptyMessage:s,size:u="md",recentItems:o,hotkey:c="mod+k",container:i="body",overlayEffect:m="opaque"}=t,f=e.prop(!1);let h=null,d=null;const g={open:b=>h?.(b),close:()=>d?.(),isOpen:f};return[e.Use(C.BeatUII18n,b=>Ee.Overlay((k,y)=>{const _=l??b.$.spotlight.map(V=>V.placeholder),v=s??b.$.spotlight.map(V=>V.noResults),w=b.$.spotlight.map(V=>V.recentItems),I=V=>{f.set(!0),V??e.Value.get(n),o&&e.Value.get(o);const D=e.prop(""),$=e.prop(0);D.on(()=>$.set(0));const N=`${Pe.sessionId("spotlight")}-input`,H=e.computedOf(D,n,o??e.prop([]),w)((B,X,P,U)=>cs(V??X,B??"",P,U)),T=H.map(B=>B.length===0),W=e.html.div(e.attr.class(e.Value.map(u,B=>`bc-spotlight bc-spotlight--size-${B??"md"}`)),e.attr.role("dialog"),e.aria.modal(!0),e.aria.label(_),e.on.mousedown(B=>B.stopPropagation()),Ee.FocusTrap({escapeDeactivates:!1,initialFocus:()=>document.getElementById(N)}),e.html.div(e.attr.class("bc-spotlight__header"),e.html.span(e.attr.class("bc-spotlight__search-icon"),C.Icon({icon:"mdi:magnify",size:"md",accessibility:"decorative"})),e.html.input(e.attr.class("bc-spotlight__input"),e.attr.type("text"),e.attr.id(N),e.attr.placeholder(_),e.attr.autocomplete("off"),e.on.input(B=>{D.set(B.target.value)}),e.on.keydown(B=>{const X=e.Value.get(H),P=e.Value.get($);switch(B.key){case"ArrowDown":B.preventDefault(),$.set(Math.min(P+1,X.length-1));break;case"ArrowUp":B.preventDefault(),$.set(Math.max(P-1,0));break;case"Enter":B.preventDefault();{const U=X.find(R=>R.globalIndex===P);U&&(r?.(U.item),U.item.onSelect(),y(),f.set(!1))}break;case"Escape":B.preventDefault(),y(),f.set(!1);break}})),e.html.span(e.attr.class("bc-spotlight__close-hint"),e.html.kbd(e.attr.class("bc-kbd bc-kbd--size-xs"),"Esc"))),e.html.div(e.attr.class("bc-spotlight__results"),e.attr.role("listbox"),e.When(T,()=>e.html.div(e.attr.class("bc-spotlight__empty"),v),()=>e.ForEach(H,B=>{const X=e.computedOf($,B)((P,U)=>P===U.globalIndex);return e.html.div(e.attr.class("bc-spotlight__section"),e.When(B.map(P=>P.sectionStart!=null),()=>e.html.div(e.attr.class("bc-spotlight__section-title"),B.map(P=>P.sectionStart??""))),e.html.div(e.attr.class(e.Value.map(X,P=>`bc-spotlight__item${P?" bc-spotlight__item--active":""}`)),e.attr.role("option"),e.aria.selected(X),e.on.click(()=>{const P=e.Value.get(B);r?.(P.item),P.item.onSelect(),y(),f.set(!1)}),e.on.mouseenter(()=>{$.set(e.Value.get(B).globalIndex)}),e.When(B.map(P=>P.item.icon!=null),()=>e.html.span(e.attr.class("bc-spotlight__item-icon"),C.Icon({icon:B.map(P=>P.item.icon??""),size:"sm",accessibility:"decorative"}))),e.html.span(e.attr.class("bc-spotlight__item-content"),e.html.span(e.attr.class("bc-spotlight__item-label"),B.map(P=>P.item.label)),e.When(B.map(P=>P.item.description!=null),()=>e.html.span(e.attr.class("bc-spotlight__item-description"),B.map(P=>P.item.description??"")))),e.When(B.map(P=>P.item.shortcut!=null&&P.item.shortcut.length>0),()=>e.html.span(e.attr.class("bc-spotlight__item-shortcut"),e.ForEach(B.map(P=>P.item.shortcut??[]),P=>e.html.kbd(e.attr.class("bc-kbd bc-kbd--size-xs"),P))))))}))));k({mode:"capturing",effect:m,container:i,content:W,onClickOutside:()=>{y(),f.set(!1)},onEscape:()=>{f.set(!1),y()}})};return h=I,d=()=>{y(),f.set(!1)},[e.WithElement(()=>{const V=c.startsWith("mod+")||c.startsWith("ctrl+"),D=c.split("+").pop()??"k",$=x=>{const N=x.metaKey||x.ctrlKey;V&&N&&x.key.toLowerCase()===D.toLowerCase()&&(x.preventDefault(),e.Value.get(f)?(y(),f.set(!1)):I())};return document.addEventListener("keydown",$),e.OnDispose(()=>{document.removeEventListener("keydown",$)})}),a(g)]})),g]}function ds(t,a){const[n]=Rn(t,a);return n}function Me(t){const{value:a,onChange:n,onInput:r,draw:l,dependencies:s=[],min:u,max:o,step:c=1,handleColor:i,disabled:m=!1,label:f,unit:h}=t,d=e.Value.toSignal(e.Value.map(a,v=>(v-e.Value.get(u))/(e.Value.get(o)-e.Value.get(u))*100)),g=e.prop({w:0,h:0}),p=[...s,g],b=e.prop(!1);let k=null;function y(v,w){if(!e.Value.get(b)&&!w||e.Value.get(m))return;const I=k?.getBoundingClientRect();if(!I)return;const S=v.clientX-I.left,V=e.Value.get(o)-e.Value.get(u),D=Math.max(e.Value.get(u),Math.min(e.Value.get(o),e.Value.get(u)+S/I.width*V));n?.(D),r?.(D)}const _=e.html.div(e.attr.class("bc-color-picker__strip-wrap"),Ce.ElementRect(v=>(v.on(w=>g.set({w:w.width,h:w.height})),e.Empty)),e.html.div(e.attr.class("bc-color-picker__canvas-wrap"),e.html.canvas(e.attr.class("bc-color-picker__canvas"),e.attr.width(e.Value.map(g.$.w,String)),e.attr.height(e.Value.map(g.$.h,String)),e.on.pointerdown(v=>{const w=v;w.target.setPointerCapture(w.pointerId),b.set(!0),y(w,!0)}),e.on.pointerup(v=>{const w=v;w.target.releasePointerCapture(w.pointerId),b.set(!1)}),e.on.pointermove(v=>y(v)),e.WithElement(v=>{k=v;const w=v.getContext("2d");w&&e.effectOf(...p)(()=>{l({canvas:v,ctx:w,width:v.width,height:v.height})})}))),e.html.div(e.attr.class("bc-color-picker__handle"),e.style.left(d.map(v=>`${v.toFixed(1)}%`)),e.style.backgroundColor(i)));return e.Fragment(Ce.ElementRect(v=>e.When(v.$.width.map(w=>w>400),()=>et.Label(e.attr.class("bc-color-picker__label"),f),()=>e.Fragment(e.attr.class("bc-color-picker__compact"),et.Label(e.attr.class("bc-color-picker__label"),e.Value.map(f,w=>w.slice(0,1)),gt({content:f}))))),e.html.div(e.attr.class("bc-color-picker__channel__strip"),_),e.html.div(e.attr.class("bc-color-picker__channel__input"),ae.NumberInput({value:a,onChange:n,onInput:r,min:u,max:o,step:c,disabled:m,unit:h,formatted:!0})))}const Za=t=>{if(t!=null)return a=>{t(a)}};function yt(t){const{value:a,color:n,onChange:r,onInput:l,dependencies:s,disabled:u,label:o="Alpha"}=t;return Me({label:o,value:a,onChange:Za(r),onInput:Za(l),draw:({ctx:c,width:i,height:m})=>{ut(c,i,m,m/2);const f=c.createLinearGradient(0,0,i,0),h=we.colorToString(we.withColor(n.value,{alpha:0})),d=we.colorToString(we.withColor(n.value,{alpha:1}));f.addColorStop(0,h),f.addColorStop(1,d),c.fillStyle=f,c.fillRect(0,0,i,m)},dependencies:s,min:0,max:100,unit:"%",disabled:u})}function kt(t){const{render:a,dependencies:n,handlePosition:r,handleColor:l,disabled:s=!1,onChange:u,onInput:o}=t,c=e.prop({w:0,h:0}),i=e.prop(!1),m=[...n??[],c];let f=null;function h(d,g){if(!e.Value.get(i)&&!g||e.Value.get(s))return;const p=f?.getBoundingClientRect();if(!p)return;const b=d.clientX-p.left,k=d.clientY-p.top,y={x:Math.max(0,Math.min(1,b/p.width)),y:Math.max(0,Math.min(1,k/p.height))};u?.(y),o?.(y)}return e.html.div(e.attr.class("bc-color-picker__field-container"),e.html.canvas(e.attr.width(e.Value.map(c.$.w,String)),e.attr.height(e.Value.map(c.$.h,String)),e.attr.class("bc-color-picker__field"),Ce.ElementRect(d=>(d.on(g=>c.set({w:g.width,h:g.height})),e.Empty)),e.Ensure(r,()=>e.Fragment(e.on.pointerdown(d=>{const g=d;g.target.setPointerCapture(g.pointerId),i.set(!0),h(g,!0)}),e.on.pointerup(d=>{const g=d;g.target.releasePointerCapture(g.pointerId),i.set(!1)}),e.on.pointermove(d=>h(d)))),e.WithElement(d=>{f=d;const g=d.getContext("2d");g&&e.effectOf(...m)(()=>{a({canvas:d,ctx:g,width:d.width,height:d.height})})})),e.Ensure(r,d=>e.Fragment(e.attr.class("bc-color-picker__field-interactive"),e.html.div(e.attr.class("bc-color-picker__handle"),e.style.left(d.$.x.map(g=>`${(g*100).toFixed(1)}%`)),e.style.top(d.$.y.map(g=>`${(g*100).toFixed(1)}%`)),e.style.backgroundColor(l)))))}const pe=(t,a)=>{switch(t.space){case"rgb":{const n={...t,...a};return G.tt(n.r,n.g,n.b,n.alpha)}case"rgb8":{const n={...t,...a};return G.b(n.r,n.g,n.b,n.alpha)}case"hsl":{const n={...t,...a};return G.k(n.h,n.s,n.l,n.alpha)}case"hsv":{const n={...t,...a};return G.H(n.h,n.s,n.v,n.alpha)}case"hwb":{const n={...t,...a};return G.ts(n.h,n.w,n.b,n.alpha)}case"lab":{const n={...t,...a};return G.I(n.l,n.a,n.b,n.alpha)}case"lch":{const n={...t,...a};return G.as(n.l,n.c,n.h,n.alpha)}case"oklab":{const n={...t,...a};return G.F(n.l,n.a,n.b,n.alpha)}case"oklch":{const n={...t,...a};return G.rs(n.l,n.c,n.h,n.alpha)}}};function ps(t){return we.roundTo(t*100,2)}function ms(t){return we.roundTo(t/100,4)}function hs(t){try{return G.Tt(G.kt(t),"rgb")}catch{return G.tt(0,0,0,1)}}function Xa(t,a){const n=l=>Math.round(Math.max(0,Math.min(1,l))*255).toString(16).padStart(2,"0"),r=`#${n(t.r)}${n(t.g)}${n(t.b)}`;return a&&t.alpha<1?r+n(t.alpha):r}function fs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:u=!0}=t,o=e.Value.toSignal(a).map(hs),c=o.$.alpha.map(ps),i=o.map(k=>pe(k,{alpha:1})).map(G.vt),m=(k,y)=>{y?.(Xa(k,e.Value.get(l)))},f=o.map(k=>{const{r:y,g:_,b:v}=k,w=Math.max(y,_,v),I=Math.min(y,_,v),S=w-I;if(S<1e-10)return 0;const V=w===y?((_-v)/S+(_<v?6:0))*60:w===_?((v-y)/S+2)*60:((y-_)/S+4)*60;return isNaN(V)?0:V}),h=o.map(k=>Xa(k,e.Value.get(l))),d=(k,y,_,v)=>{const w=(k%360+360)%360,I=_*y,S=I*(1-Math.abs(w/60%2-1)),V=_-I;let D,$,x;return w<60?[D,$,x]=[I,S,0]:w<120?[D,$,x]=[S,I,0]:w<180?[D,$,x]=[0,I,S]:w<240?[D,$,x]=[0,S,I]:w<300?[D,$,x]=[S,0,I]:[D,$,x]=[I,0,S],G.tt(D+V,$+V,x+V,v)},g=(k,y)=>{y!=null&&m(d(f.value,k.x,1-k.y,o.value.alpha),y)},p=(k,y)=>{if(y==null)return;const _=o.value,v=Math.max(_.r,_.g,_.b),w=Math.min(_.r,_.g,_.b),I=v,S=v===0?0:(v-w)/v;m(d(k,S,I,_.alpha),y)},b=k=>{if(k!=null)return y=>{m(pe(o.value,{alpha:ms(y)}),k)}};return e.Use(C.BeatUII18n,k=>e.html.div(e.attr.class("bc-color-picker__container"),kt({handlePosition:o.map(y=>{const _=Math.max(y.r,y.g,y.b),v=Math.min(y.r,y.g,y.b),w=_;return{x:_===0?0:(_-v)/_,y:1-w}}),disabled:s,onChange:y=>g(y,n),onInput:y=>g(y,r),handleColor:i,render:({ctx:y,width:_,height:v})=>{const w=d(f.value,1,1,1),I=y.createLinearGradient(0,0,_,0);I.addColorStop(0,"#ffffff"),I.addColorStop(1,G.vt(w)),y.fillStyle=I,y.fillRect(0,0,_,v);const S=y.createLinearGradient(0,0,0,v);S.addColorStop(0,"rgba(0,0,0,0)"),S.addColorStop(1,"rgba(0,0,0,1)"),y.fillStyle=S,y.fillRect(0,0,_,v)},dependencies:[f]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Me({label:k.$.colorPicker.$.hue,value:f,onChange:y=>p(y,n),onInput:y=>p(y,r),draw:Gt,min:0,max:360,handleColor:f.map(y=>G.vt(d(y,1,1,1))),unit:"°",disabled:s}),e.When(l,()=>yt({label:k.$.colorPicker.$.alpha,value:c,color:o,onChange:b(n),onInput:b(r),dependencies:[o.$.r,o.$.g,o.$.b],disabled:s})),et.Label(e.attr.class("bc-color-picker__label"),k.$.colorPicker.$.hex),e.html.div(e.attr.class("bc-color-picker__channel__input"),Fe.TextInput({value:h,disabled:s,onChange:y=>{n&&n(y.startsWith("#")?y:`#${y}`)}})))),e.When(u,()=>{const y=e.prop({w:0,h:0}),_=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(y.$.w,String)),e.attr.height(e.Value.map(y.$.h,String)),Ce.ElementRect(v=>(v.on(w=>y.set({w:w.width,h:w.height})),e.Empty)),e.WithElement(v=>{const w=v.getContext("2d");w&&e.effectOf(y,o)(()=>{const I=y.value.w,S=y.value.h;I===0||S===0||(o.value.alpha<1&&ut(w,I,S,_),w.fillStyle=G.vt(o.value),w.fillRect(0,0,I,S))})})))}))))}function Bt(t){return we.roundTo(t*100,2)}function lt(t){return Math.round(t*100)/1e4}function gs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:u=!0}=t,o=e.Value.toSignal(a),c=o.$.r.map(Bt),i=o.$.g.map(Bt),m=o.$.b.map(Bt),f=o.$.alpha.map(Bt),h=o.map(g=>pe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return k=>{b&&(k=b(k)),p(pe(o.value,{[g]:k}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),kt({handlePosition:o.map(p=>({x:p.r,y:1-p.g})),disabled:s,onChange:p=>{n?.(pe(o.value,{r:Math.round(p.x*1e4)/1e4,g:Math.round((1-p.y)*1e4)/1e4}))},onInput:p=>{r?.(pe(o.value,{r:Math.round(p.x*1e4)/1e4,g:Math.round((1-p.y)*1e4)/1e4}))},handleColor:h,render:({ctx:p,width:b,height:k})=>{for(let y=0;y<k;y++){const _=1-y/(k-1),v=p.createLinearGradient(0,0,b,0);v.addColorStop(0,G.vt(pe(o.value,{r:0,g:_}))),v.addColorStop(1,G.vt(pe(o.value,{r:1,g:_}))),p.fillStyle=v,p.fillRect(0,y,b,1)}},dependencies:[m]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Me({label:g.$.colorPicker.$.red,value:c,onChange:d("r",n,lt),onInput:d("r",r,lt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0);y.addColorStop(0,G.vt(pe(o.value,{r:0}))),y.addColorStop(1,G.vt(pe(o.value,{r:1}))),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[i,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Me({label:g.$.colorPicker.$.green,value:i,onChange:d("g",n,lt),onInput:d("g",r,lt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0);y.addColorStop(0,G.vt(pe(o.value,{g:0}))),y.addColorStop(1,G.vt(pe(o.value,{g:1}))),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Me({label:g.$.colorPicker.$.blue,value:m,onChange:d("b",n,lt),onInput:d("b",r,lt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0);y.addColorStop(0,G.vt(pe(o.value,{b:0}))),y.addColorStop(1,G.vt(pe(o.value,{b:1}))),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,i],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>yt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,lt),onInput:d("alpha",r,lt),dependencies:[c,i,m],disabled:s})))),e.When(u,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(k=>(k.on(y=>p.set({w:y.width,h:y.height})),e.Empty)),e.WithElement(k=>{const y=k.getContext("2d");y&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ut(y,_,v,b),y.fillStyle=G.vt(o.value),y.fillRect(0,0,_,v))})})))}))))}function la(t){return we.roundTo(t*100,2)}function pt(t){return we.roundTo(t/100,4)}function bs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:u=!0}=t,o=e.Value.toSignal(a),c=o.$.h,i=o.$.s.map(la),m=o.$.l.map(la),f=o.$.alpha.map(la),h=o.map(g=>pe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return k=>{b&&(k=b(k)),p(pe(o.value,{[g]:k}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),kt({handlePosition:o.map(p=>({x:p.s,y:1-p.l})),disabled:s,onChange:p=>{n?.(pe(o.value,{s:p.x,l:1-p.y}))},onInput:p=>{r?.(pe(o.value,{s:p.x,l:1-p.y}))},handleColor:h,render:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0);y.addColorStop(0,G.vt(pe(o.value,{s:0,l:.5}))),y.addColorStop(1,G.vt(pe(o.value,{s:1,l:.5}))),p.fillStyle=y,p.fillRect(0,0,b,k);const _=p.createLinearGradient(0,0,0,k);_.addColorStop(0,"rgba(255, 255, 255, 1)"),_.addColorStop(.5,"rgba(255, 255, 255, 0)"),p.fillStyle=_,p.fillRect(0,0,b,k);const v=p.createLinearGradient(0,0,0,k);v.addColorStop(.5,"rgba(0, 0, 0, 0)"),v.addColorStop(1,"rgba(0, 0, 0, 1)"),p.fillStyle=v,p.fillRect(0,0,b,k)},dependencies:[c]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Me({label:g.$.colorPicker.$.hue,value:c,onChange:d("h",n),onInput:d("h",r),draw:Gt,min:0,max:360,handleColor:h,unit:"°",disabled:s}),Me({label:g.$.colorPicker.$.saturation,value:i,onChange:d("s",n,pt),onInput:d("s",r,pt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0),_=G.vt(pe(o.value,{s:0})),v=G.vt(pe(o.value,{s:1}));y.addColorStop(0,_),y.addColorStop(1,v),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Me({label:g.$.colorPicker.$.lightness,value:m,onChange:d("l",n,pt),onInput:d("l",r,pt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0),_=G.vt(pe(o.value,{l:0})),v=G.vt(pe(o.value,{l:.5})),w=G.vt(pe(o.value,{l:1}));y.addColorStop(0,_),y.addColorStop(.5,v),y.addColorStop(1,w),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,i],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>yt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,pt),onInput:d("alpha",r,pt),dependencies:[c,i,m],disabled:s})))),e.When(u,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(k=>(k.on(y=>p.set({w:y.width,h:y.height})),e.Empty)),e.WithElement(k=>{const y=k.getContext("2d");y&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ut(y,_,v,b),y.fillStyle=G.vt(o.value),y.fillRect(0,0,_,v))})})))}))))}function oa(t){return we.roundTo(t*100,2)}function mt(t){return we.roundTo(t/100,4)}function vs(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:u=!0}=t,o=e.Value.toSignal(a),c=o.$.h,i=o.$.w.map(oa),m=o.$.b.map(oa),f=o.$.alpha.map(oa),h=o.map(g=>pe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return k=>{b&&(k=b(k)),p(pe(o.value,{[g]:k}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),kt({handlePosition:o.map(p=>({x:p.w,y:p.b})),disabled:s,onChange:p=>{n?.(pe(o.value,{w:we.roundTo(p.x,4),b:we.roundTo(p.y,4)}))},onInput:p=>{r?.(pe(o.value,{w:we.roundTo(p.x,4),b:we.roundTo(p.y,4)}))},handleColor:h,render:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0);y.addColorStop(0,G.vt(pe(o.value,{w:0,b:0}))),y.addColorStop(1,"white"),p.fillStyle=y,p.fillRect(0,0,b,k);const _=p.createLinearGradient(0,0,0,k);_.addColorStop(0,"rgba(0,0,0,0)"),_.addColorStop(1,"black"),p.fillStyle=_,p.fillRect(0,0,b,k)},dependencies:[c]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Me({label:g.$.colorPicker.$.hue,value:c,onChange:d("h",n),onInput:d("h",r),draw:Gt,min:0,max:360,handleColor:c.map(p=>G.vt(pe(o.value,{w:0,b:0}))),unit:"°",disabled:s}),Me({label:g.$.colorPicker.$.whiteness,value:i,onChange:d("w",n,mt),onInput:d("w",r,mt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0),_=G.vt(pe(o.value,{w:0})),v=G.vt(pe(o.value,{w:1}));y.addColorStop(0,_),y.addColorStop(1,v),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Me({label:g.$.colorPicker.$.blackness,value:m,onChange:d("b",n,mt),onInput:d("b",r,mt),draw:({ctx:p,width:b,height:k})=>{const y=p.createLinearGradient(0,0,b,0),_=G.vt(pe(o.value,{b:0})),v=G.vt(pe(o.value,{b:1}));y.addColorStop(0,_),y.addColorStop(1,v),p.fillStyle=y,p.fillRect(0,0,b,k)},dependencies:[c,i],handleColor:h,min:0,max:100,unit:"%",disabled:s}),e.When(l,()=>yt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,mt),onInput:d("alpha",r,mt),dependencies:[c,i,m],disabled:s})))),e.When(u,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(k=>(k.on(y=>p.set({w:y.width,h:y.height})),e.Empty)),e.WithElement(k=>{const y=k.getContext("2d");y&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ut(y,_,v,b),y.fillStyle=G.vt(o.value),y.fillRect(0,0,_,v))})})))}))))}function Qa(t){return we.roundTo(t*100,2)}function Mt(t){return we.roundTo(t/100,4)}function ys(t){const{value:a,onChange:n,onInput:r,withAlpha:l=!1,disabled:s=!1,displayColorSwatch:u=!0}=t,o=e.Value.toSignal(a),c=o.$.l.map(Qa),i=o.$.c,m=o.$.h,f=o.$.alpha.map(Qa),h=o.map(g=>pe(g,{alpha:1})).map(G.vt),d=(g,p,b)=>{if(p!=null)return k=>{b&&(k=b(k)),p(pe(o.value,{[g]:k}))}};return e.Use(C.BeatUII18n,g=>e.html.div(e.attr.class("bc-color-picker__container"),kt({handlePosition:o.map(p=>({x:p.c/.4,y:1-p.l})),disabled:s,onChange:p=>{n?.(pe(o.value,{c:Math.round(p.x*.4*1e4)/1e4,l:Math.round((1-p.y)*1e4)/1e4}))},onInput:p=>{r?.(pe(o.value,{c:Math.round(p.x*.4*1e4)/1e4,l:Math.round((1-p.y)*1e4)/1e4}))},handleColor:h,render:({ctx:p,width:b,height:k})=>{const y=o.value.h,_=5;for(let v=0;v<b;v++){const w=v/(b-1)*.4,I=p.createLinearGradient(0,0,0,k);for(let S=0;S<=_;S++){const V=1-S/_;I.addColorStop(S/_,`oklch(${V} ${w} ${y})`)}p.fillStyle=I,p.fillRect(v,0,1,k)}},dependencies:[m]}),e.html.div(e.attr.class("bc-color-picker__controls"),e.html.div(e.attr.class("bc-color-picker__channels-container"),e.html.div(e.attr.class("bc-color-picker__channels"),Me({label:g.$.colorPicker.$.lightness,value:c,onChange:d("l",n,Mt),onInput:d("l",r,Mt),draw:({ctx:p,width:b,height:k})=>{const{c:y,h:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1);p.fillStyle=`oklch(${w} ${y} ${_})`,p.fillRect(v,0,1,k)}},dependencies:[i,m],handleColor:h,min:0,max:100,unit:"%",disabled:s}),Me({label:g.$.colorPicker.$.chroma,value:i.map(p=>we.roundTo(p*1e3,0)),onChange:d("c",n,p=>p/1e3),onInput:d("c",r,p=>p/1e3),draw:({ctx:p,width:b,height:k})=>{const{l:y,h:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1)*.4;p.fillStyle=`oklch(${y} ${w} ${_})`,p.fillRect(v,0,1,k)}},dependencies:[c,m],handleColor:h,min:0,max:400,step:1,disabled:s}),Me({label:g.$.colorPicker.$.hue,value:m,onChange:d("h",n),onInput:d("h",r),draw:({ctx:p,width:b,height:k})=>{const{l:y,c:_}=o.value;for(let v=0;v<b;v++){const w=v/(b-1)*360;p.fillStyle=`oklch(${y} ${_} ${w})`,p.fillRect(v,0,1,k)}},dependencies:[c,i],handleColor:m.map(p=>G.vt(pe(o.value,{l:.7,c:.3}))),min:0,max:360,unit:"°",disabled:s}),e.When(l,()=>yt({label:g.$.colorPicker.$.alpha,value:f,color:o,onChange:d("alpha",n,Mt),onInput:d("alpha",r,Mt),dependencies:[c,i,m],disabled:s})))),e.When(u,()=>{const p=e.prop({w:0,h:0}),b=8;return e.html.div(e.attr.class("bc-color-picker__swatch-container"),e.html.canvas(e.attr.class("bc-color-picker__swatch"),e.attr.width(e.Value.map(p.$.w,String)),e.attr.height(e.Value.map(p.$.h,String)),Ce.ElementRect(k=>(k.on(y=>p.set({w:y.width,h:y.height})),e.Empty)),e.WithElement(k=>{const y=k.getContext("2d");y&&e.effectOf(p,o)(()=>{const _=p.value.w,v=p.value.h;_===0||v===0||(o.value.alpha<1&&ut(y,_,v,b),y.fillStyle=G.vt(o.value),y.fillRect(0,0,_,v))})})))}))))}const ks=t=>{const{value:a,onChange:n,onInput:r,onBlur:l,after:s,disabled:u,...o}=t,c=ae.NullableResetAfter(a,u,n??r);return Un({...o,disabled:u,value:e.Value.map(a,G.nullToEmpty),onChange:n!=null?i=>n(G.emptyToNull(i)):void 0,onInput:r!=null?i=>r(G.emptyToNull(i)):void 0,onBlur:l,after:s!=null?e.Fragment(c,s):c})},_s=t=>{const{value:a,onChange:n,onInput:r,onBlur:l,after:s,disabled:u,...o}=t,c=ae.NullableResetAfter(a,u,n??r);return G.ColorSwatchInput({...o,disabled:u,value:e.Value.map(a,G.nullToEmpty),onChange:n!=null?i=>n(G.emptyToNull(i)):void 0,onInput:r!=null?i=>r(G.emptyToNull(i)):void 0,onBlur:l,after:s!=null?e.Fragment(c,s):c})},Oa=t=>{const{onChange:a,onInput:n,onBlur:r,role:l,display:s,optionsSource:u,allowSpaceToggle:o=!1,onBeforeOpen:c,onAfterOpen:i,buildListboxContent:m}=t,f=e.prop(!1),h=e.prop(-1),d=e.prop(null),g=Pe.sessionId("dropdown"),p=Pe.sessionId("listbox");let b,k;f.onChange(v=>{v||(h.set(-1),d.set(null))});const y=v=>{a?.(v),n?.(v),f.set(!1),b?.focus()},_=v=>{const w=Ue.getValues(e.Value.get(u));switch(v.key){case"ArrowDown":{if(v.preventDefault(),!f.value)f.set(!0),w.length>0&&(h.set(0),d.set(w[0]));else{const I=Math.min(h.value+1,w.length-1);h.set(I),d.set(w[I]??null)}break}case"ArrowUp":{if(v.preventDefault(),f.value){const I=Math.max(h.value-1,0);h.set(I),d.set(w[I]??null)}break}case"Enter":{if(v.preventDefault(),f.value&&h.value>=0){const I=w[h.value];I!=null&&y(I)}else{c?.();const I=Ue.getValues(e.Value.get(u));f.set(!0),I.length>0&&(h.set(0),d.set(I[0])),setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{i?.()})})},0)}break}case"Escape":{f.value&&(v.preventDefault(),f.set(!1),b?.focus());break}case" ":{if(e.Value.get(o)){v.preventDefault();const I=Ue.getValues(e.Value.get(u));f.set(!f.value),f.value&&I.length>0&&(h.set(0),d.set(I[0]))}break}}};return ne.InputContainer({...t,input:ae.Group(e.attr.class("bc-dropdown__trigger"),e.html.span(e.attr.class("bc-dropdown__display"),s)),after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(v=>e.Fragment(e.WithElement(w=>{b=w;const I=()=>{if(f.value)f.set(!1);else{c?.();const S=Ue.getValues(e.Value.get(u));f.set(!0),S.length>0&&(h.set(0),d.set(S[0])),setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{i?.()})})},0)}};return w.addEventListener("keydown",_),w.addEventListener("click",I),e.OnDispose(()=>{w.removeEventListener("keydown",_),w.removeEventListener("click",I)})}),Fe.CommonInputAttributes(t),e.attr.id(g),e.attr.tabindex(0),e.aria.controls(p),e.aria.expanded(f),e.attr.class("bc-dropdown"),e.attr.role(l),e.aria.activedescendant(e.computedOf(f,d)((w,I)=>w&&I!=null?`dropdown-option-${String(I)}`:"")),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!k?.contains(document.activeElement)&&!b?.contains(document.activeElement)&&(f.set(!1),r())})}):e.Empty,Ie.Flyout({content:()=>e.html.div(e.WithElement(w=>{k=w}),e.style.minWidth(v.$.width.map(w=>`${w-10}px`)),e.attr.class("bc-dropdown__listbox"),e.attr.role("listbox"),e.attr.id(p),e.aria.labelledby(g),m({dropdownId:g,listboxId:p,focusedValue:d,handleKeyDown:_,onSelect:y})),mainAxisOffset:0,placement:"bottom-start",hasPopup:"listbox",open:f,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))},zn=(t,a,n,r,l)=>e.Ensure(t,s=>e.OneOfType(s,{value:u=>{const o=e.computedOf(u,n)((i,m)=>a(i.value,m)),c=e.computedOf(u,l)((i,m)=>m!=null&&a(i.value,m));return e.html.div(e.attr.class("bc-dropdown__option"),e.attr.class(e.computedOf(o,c,u)((i,m,f)=>{const h=[];return i&&h.push("bc-dropdown__option--selected"),m&&h.push("bc-dropdown__option--focused"),f.disabled&&h.push("bc-dropdown__option--disabled"),h.join(" ")})),e.attr.role("option"),e.attr.id(u.map(i=>`dropdown-option-${String(i.value)}`)),e.aria.selected(o),ae.Expando("value",u.$.value),e.When(u.map(i=>!i.disabled),()=>e.on.click(()=>r(u.value.value)),()=>e.Empty),e.html.div(e.attr.class("bc-dropdown__option-content"),u.value.before&&e.html.span(e.attr.class("bc-dropdown__option-before"),u.value.before),e.html.span(e.attr.class("bc-dropdown__option-label"),u.$.label),u.value.after&&e.html.span(e.attr.class("bc-dropdown__option-after"),u.value.after)))},group:u=>e.html.div(e.attr.class("bc-dropdown__group"),e.attr.role("group"),e.aria.label(u.$.group),e.html.div(e.attr.class("bc-dropdown__group-label"),u.$.group),e.ForEach(u.$.options,o=>zn(o,a,n,r,l))),break:()=>e.html.hr(e.attr.class("bc-dropdown__separator"))})),Hn=t=>{const{value:a,options:n,unselectedLabel:r,equality:l=(i,m)=>i===m,placeholder:s,searchable:u=!1}=t,o=e.computedOf(a,n)((i,m)=>{if(i==null)return"";const f=h=>{for(const d of h){if(d.type==="value"&&l(d.value,i))return d.label;if(d.type==="group"){const g=f(d.options);if(g)return g}}};return f(m)||String(i)}),c=e.computedOf(u)(i=>!i);return Oa({...t,role:"dropdown",display:e.When(o.map(i=>i.length>0),()=>o,()=>e.Use(C.BeatUII18n,i=>e.coalesce(s,r,i.$.selectOne))),optionsSource:n,allowSpaceToggle:c,buildListboxContent:({focusedValue:i,onSelect:m})=>e.ForEach(n,f=>zn(f,l,a,m,i))})},jn=t=>{const{controller:a,onChange:n,onBlur:r,...l}=t;return Hn({...l,value:a.signal,onChange:oe.makeOnChangeHandler(a,n),onBlur:oe.makeOnBlurHandler(a,r)})},ws=t=>oe.Field({...t,content:jn(t)}),qn=(t,a,n,r,l,s)=>e.Ensure(t,u=>e.OneOfType(u,{value:o=>{const c=e.computedOf(o,n)((m,f)=>f!=null&&a(m.value,f)),i=e.computedOf(o,l)((m,f)=>f!=null&&a(m.value,f));return e.html.div(e.attr.class("bc-dropdown__option"),e.attr.class(e.computedOf(c,i,o)((m,f,h)=>{const d=[];return m&&d.push("bc-dropdown__option--selected"),f&&d.push("bc-dropdown__option--focused"),h.disabled&&d.push("bc-dropdown__option--disabled"),d.join(" ")})),e.attr.role("option"),e.attr.id(o.map(m=>`dropdown-option-${String(m.value)}`)),e.aria.selected(c),e.When(o.map(m=>!m.disabled),()=>e.on.click(()=>r(o.value.value)),()=>e.Empty),e.html.div(e.attr.class("bc-dropdown__option-content"),o.value.before&&e.html.span(e.attr.class("bc-dropdown__option-before"),o.value.before),e.html.span(e.attr.class("bc-dropdown__option-label"),s(o.$.value)),o.value.after&&e.html.span(e.attr.class("bc-dropdown__option-after"),o.value.after)))},group:o=>e.html.div(e.attr.class("bc-dropdown__group"),e.attr.role("group"),e.aria.label(o.$.group),e.html.div(e.attr.class("bc-dropdown__group-label"),o.$.group),e.ForEach(o.$.options,c=>qn(c,a,n,r,l,s))),break:()=>e.html.hr(e.attr.class("bc-dropdown__separator"))})),Gn=t=>{const{value:a,loadOptions:n,renderOption:r,renderValue:l,equality:s=(_,v)=>_===v,placeholder:u,searchPlaceholder:o,debounceMs:c=150,autoFocusSearch:i=!0}=t,m=e.prop(""),f=e.prop(!1),h=e.prop([]);let d;const g=e.Value.toSignal(a),p=()=>(l??r)(g);let b=null;const k=_=>{f.set(!0),Promise.resolve(n(_)).then(v=>{h.set(v??[])}).catch(()=>{h.set([])}).finally(()=>f.set(!1))},y=_=>{b!=null&&(clearTimeout(b),b=null),b=setTimeout(()=>{k(_)},Math.max(0,c))};return Oa({...t,role:"combobox",display:e.When(e.computedOf(a)(_=>_!=null),p,()=>e.Use(C.BeatUII18n,_=>_.$.selectOne)),optionsSource:h,onBeforeOpen:()=>{const _=e.Value.get(m);y(_)},onAfterOpen:()=>{i&&d?.focus()},buildListboxContent:({focusedValue:_,handleKeyDown:v,onSelect:w})=>e.Use(C.BeatUII18n,I=>e.Fragment(e.html.div(e.attr.class("bc-dropdown__search"),e.html.input(e.attr.type("text"),e.attr.class("bc-dropdown__search-input"),e.attr.placeholder(e.computedOf(o,u,I.$.searchPlaceholder)((S,V,D)=>S??V??D)),e.attr.value(m),e.WithElement(S=>(d=S,e.Empty)),e.on.input(S=>{const V=S.target;m.set(V.value),y(V.value)}),e.on.keydown(v))),e.When(f,()=>e.html.div(e.attr.class("bc-dropdown__loading"),C.Icon({icon:"ph:spinner-bold",color:"neutral"})),()=>e.ForEach(h,S=>qn(S,s,g,w,_,r)))))})},Yn=t=>{const{controller:a,onChange:n,onBlur:r,...l}=t;return Gn({...l,value:a.signal,onChange:oe.makeOnChangeHandler(a,n),onBlur:oe.makeOnBlurHandler(a,r)})},Cs=t=>oe.Field({...t,content:Yn(t)});function Ta(t){const{values:a,options:n,equality:r,disabled:l,onRemove:s}=t;return e.NotEmpty(a,()=>e.ForEach(a,u=>ct({variant:"light",onClose:()=>s(u.value),disabled:l},e.computedOf(u,n)((o,c)=>kn(c,o,r)))),()=>e.html.span(e.attr.class("bc-input-container__placeholder"),t.placeholder))}function Pa(t){const{value:a,options:n,equality:r=(i,m)=>i===m,placeholder:l}=t,s=i=>{const m=e.Value.get(a);t.onChange?.(Sa(m,i,r))},u=i=>{const m=e.Value.get(a);t.onChange?.(Ca(m,i,r))},o=i=>e.computedOf(a)(m=>zt(m,i,r)),c=Ie.Menu({items:()=>{const i=e.Value.get(n),m=[];for(const f of i)if(f.type==="value"){const h=o(f.value);m.push(e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(f.disabled===!0),e.aria.checked(h),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),f.label),e.on.click(()=>u(f.value))))}else f.type==="group"?m.push(e.html.div(e.attr.class("bc-menu-group"),e.html.div(e.attr.class("bc-menu-group__label"),f.group),...f.options.map(h=>{if(h.type==="value"){const d=o(h.value);return e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(h.disabled===!0),e.aria.checked(d),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),h.label),e.on.click(()=>u(h.value)))}return e.Empty}))):m.push(Ie.MenuSeparator());return m},placement:"bottom-start",showDelay:0,hideDelay:100,showOn:"click",closable:!0});return ne.InputContainer({...t,before:t.before??ne.InputIcon({icon:"tabler:tags",color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),c,Ta({values:a,placeholder:l,options:n,equality:r,disabled:t.disabled,onRemove:s})),after:ne.InputIcon({icon:"line-md:plus",color:"neutral",size:"sm"})})}function Ss(t){return oe.BaseControl(Pa,t)}function Vs(t){return oe.Control(Pa,t)}function Ea(t){const{value:a,options:n,equality:r=(d,g)=>d===g,placeholder:l,searchPlaceholder:s,filter:u}=t,o=e.prop(""),c=d=>{const g=e.Value.get(a);t.onChange?.(Sa(g,d,r))},i=d=>{const g=e.Value.get(a);t.onChange?.(Ca(g,d,r))},m=e.computedOf(n,o)((d,g)=>Va(d,g,u)),f=d=>e.Ensure(d,g=>e.OneOfType(g,{value:p=>{const b=e.computedOf(a,p)((k,y)=>zt(k,y.value,r));return e.html.div(e.attr.role("menuitem"),e.attr.tabindex(-1),e.aria.disabled(p.map(k=>k.disabled===!0)),e.aria.checked(b),e.attr.class("bc-menu-item"),e.html.span(e.attr.class("bc-menu-item__content"),p.$.label),e.on.click(()=>i(p.value.value)))},group:p=>e.html.div(e.attr.class("bc-menu-group"),e.html.div(e.attr.class("bc-menu-group__label"),p.$.group),e.ForEach(p.$.options,f)),break:()=>Ie.MenuSeparator()})),h=Ie.Menu({items:()=>[e.When(m.map(d=>d.length===0),()=>e.html.div(e.attr.class("bc-dropdown__empty"),e.Use(C.BeatUII18n,d=>d.$.noResults))),e.ForEach(m,f)],placement:"bottom-start",showDelay:0,hideDelay:100,showOn:d=>e.WithElement(g=>{const p=g.querySelector(".bc-dropdown__search-input");if(p){const b=()=>d.set(!0);return p.addEventListener("focus",b),e.OnDispose(()=>{p.removeEventListener("focus",b)})}return e.Empty}),closable:!0});return ne.InputContainer({...t,before:t.before??ne.InputIcon({icon:"tabler:tags",color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),Ta({values:a,options:n,placeholder:l,equality:r,disabled:t.disabled,onRemove:c}),e.html.div(e.attr.class("bc-input-container__tags-selector"),e.html.input(e.attr.type("text"),e.attr.class("bc-dropdown__search-input"),e.attr.placeholder(e.computedOf(s,l)((d,g)=>d??g??"")),e.attr.value(o),e.on.input(d=>{const g=d.target;o.set(g.value)}),e.on.keydown(d=>{(d.key==="ArrowUp"||d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&d.stopPropagation()})),h))})}function Is(t){return oe.BaseControl(Ea,t)}function $s(t){return oe.Control(Ea,t)}const xs=t=>{const{value:a,onBlur:n,onChange:r}=t;return ne.InputContainer({...t,input:e.input.date(Fe.CommonInputAttributes(t),e.attr.valueAsDate(a),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValueAsDate(r)):e.Empty)})};function Et(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),u=Pe.sessionId("date-range-select"),o=Pe.sessionId("date-range-panel");let c,i;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),c?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-date-select ${h}`):"bc-date-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:calendar",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{c=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(u),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-date-range-select"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!i?.contains(document.activeElement)&&!c?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ie.Flyout({content:()=>e.html.div(e.WithElement(d=>{i=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-date-range-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),c?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function Ds(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:u=i=>i.toString(),...o}=t,c=e.computedOf(a)(i=>`${u(i[0])} → ${u(i[1])}`);return Et({...o,displayText:c,panelContent:ln({value:e.Value.map(a,i=>i),onChange:n,isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})})}function Os(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:u=p=>p.toString(),startLabel:o=C.defaultMessages.dateRangeStart,endLabel:c=C.defaultMessages.dateRangeEnd,emptyPlaceholder:i=C.defaultMessages.dateRangeNoLimit,...m}=t,f=e.computedOf(a)(p=>{const b=p[0]!=null?u(p[0]):i,k=p[1]!=null?u(p[1]):i;return`${b} → ${k}`}),h=e.Value.map(a,p=>p[0]??null),d=e.Value.map(a,p=>p[1]??null),g=C.defaultMessages.clearValue;return Et({...m,displayText:f,panelContent:e.html.div(e.attr.class("bc-date-range-select__pickers"),e.html.div(e.attr.class("bc-date-range-select__picker"),e.html.div(e.attr.class("bc-date-range-select__picker-header"),e.html.span(e.attr.class("bc-date-range-select__picker-label"),o),e.When(e.Value.map(h,p=>p!=null),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-date-range-select__clear-btn"),e.attr.title(g),e.on.click(p=>{p.preventDefault(),p.stopPropagation();const b=e.Value.get(a);n?.([null,b[1]])}),g))),it({value:h,onSelect:p=>{const b=e.Value.get(a);n?.([p,b[1]])},isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})),e.html.div(e.attr.class("bc-date-range-select__picker"),e.html.div(e.attr.class("bc-date-range-select__picker-header"),e.html.span(e.attr.class("bc-date-range-select__picker-label"),c),e.When(e.Value.map(d,p=>p!=null),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-date-range-select__clear-btn"),e.attr.title(g),e.on.click(p=>{p.preventDefault(),p.stopPropagation();const b=e.Value.get(a);n?.([b[0],null])}),g))),it({value:d,onSelect:p=>{const b=e.Value.get(a);n?.([b[0],p])},isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})))})}function Ts(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:u=i=>i.toString(),...o}=t,c=e.Value.map(a,i=>u(i));return Et({...o,displayText:c,panelContent:it({value:e.Value.map(a,i=>i),onSelect:i=>n?.(i),isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s})})}function Ps(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,formatDate:u=h=>h.toString(),placeholder:o=C.defaultMessages.dateRangeSelectDate,disabled:c,...i}=t,m=e.Value.map(a,h=>h!=null?u(h):o),f=ae.NullableResetAfter(a,c,n);return Et({...i,disabled:c,displayText:m,after:i.after!=null?e.Fragment(f,i.after):f,panelContent:it({value:a,onSelect:h=>n?.(h),isDateDisabled:r,color:l,size:t.size,disabled:c,weekStartsOn:s})})}const Es=t=>{const a=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),l=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0");return`${a}-${n}-${r}T${l}:${s}`},Fs=t=>{const{value:a,onBlur:n,onChange:r}=t;return ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,Es)),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(l=>r(new Date(l)))):e.Empty)})};function Ls(t,...a){const{size:n="md",filled:r=!1}=t;return e.html.span(e.attr.class("bc-input-adornment"),e.attr.class(e.Value.map(n,l=>`bc-input-adornment--size-${l}`)),e.attr.class(e.Value.map(r,l=>l?"bc-input-adornment--filled":"")),e.html.span(e.attr.class("bc-input-adornment__content"),...a))}const As=t=>Ce.Query({request:t.request,load:t.load,convertError:String,success:({value:a})=>{const n=a.map(r=>r.map(l=>typeof l=="object"&&"id"in l&&"label"in l?Ue.value(l.id,l.label):l));return ae.NativeSelect({...t,options:n,unselectedLabel:t.unselectedLabel,equality:t.equality})},pending:()=>ne.InputContainer({...t,disabled:!0,after:e.Fragment(ne.InputIcon({icon:"ph:caret-up-down-bold",color:"neutral",size:"sm"}),t.after),input:e.html.select(e.attr.class("bc-native-select bc-input"),e.attr.disabled(!0),e.Use(C.BeatUII18n,a=>e.html.option(a.$.loadingShort)))})}),Bs=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:u,...o}=t,c=ae.NullableResetAfter(a,u,r??l);return ae.MaskInput({...o,value:e.Value.map(a,G.nullToEmpty),onChange:r!=null?i=>r(G.emptyToNull(i)):void 0,onInput:l!=null?i=>l(G.emptyToNull(i)):void 0,onBlur:n,after:s!=null?e.Fragment(c,s):c})};function Ms(t,a,n){const r=["bc-number-stepper",`bc-number-stepper--size-${t}`,`bc-number-stepper--${n}`];return a&&r.push("bc-number-stepper--disabled"),r.join(" ")}function Ns(t){const{value:a,onChange:n,min:r,max:l,step:s=1,size:u="md",disabled:o=!1,orientation:c="horizontal"}=t;return e.Use(C.BeatUII18n,i=>{const m=e.computedOf(r,a,o)((b,k,y)=>y?!1:b!=null?k>b:!0),f=e.computedOf(l,a,o)((b,k,y)=>y?!1:b!=null?k<b:!0),h=()=>{if(e.Value.get(o))return;const b=e.Value.get(a),k=e.Value.get(s),y=r!=null?e.Value.get(r):void 0,_=b-k;y!=null&&_<y||n(_)},d=()=>{if(e.Value.get(o))return;const b=e.Value.get(a),k=e.Value.get(s),y=l!=null?e.Value.get(l):void 0,_=b+k;y!=null&&_>y||n(_)},g=e.Value.map(u,b=>{switch(b){case"xs":return"xs";case"sm":return"xs";case"md":return"sm";case"lg":return"sm";case"xl":return"md";default:return"sm"}}),p=(b,k,y,_,v)=>e.html.button(e.attr.type("button"),e.attr.class(`bc-number-stepper__button bc-number-stepper__button--${v}`),e.attr.disabled(e.Value.map(y,w=>!w)),e.aria.label(b),e.on.click(w=>{w.stopPropagation(),_()}),C.Icon({icon:k,size:g}));return e.html.div(e.attr.class(e.computedOf(u,o,c)(Ms)),e.attr.role("group"),e.aria.label(i.$.numberStepper.$.value),e.aria.valuemin(r),e.aria.valuemax(l),e.aria.valuenow(a),p(i.$.numberStepper.$.decrement,"lucide:minus",m,h,"decrement"),e.html.span(e.attr.class("bc-number-stepper__value"),e.aria.live("polite"),e.Value.map(a,String)),p(i.$.numberStepper.$.increment,"lucide:plus",f,d,"increment"))})}function Ws(t,a,n,r,l){const s=["bc-sortable-list",`bc-sortable-list--size-${t}`,`bc-sortable-list--variant-${n}`,`bc-sortable-list--gap-${r}`];return a&&s.push("bc-sortable-list--disabled"),l&&s.push(l),s.join(" ")}function Us(t){const{items:a,onChange:n,renderItem:r,keyOf:l,disabled:s=!1,size:u="md",class:o="",variant:c="bordered",gap:i="md",handleIcon:m="lucide:grip-vertical"}=t,f=e.prop(null),h=e.prop(null),d=e.prop(null);let g=null,p=null;function b(k,y){const _=e.Value.get(a);if(y<0||y>=_.length)return;const v=[..._],[w]=v.splice(k,1);v.splice(y,0,w),p=l(w),n(v),requestAnimationFrame(()=>{if(g&&p){const I=g.querySelectorAll("[data-key]");for(const S of I)if(S.getAttribute("data-key")===p){S.focus();break}p=null}})}return e.Use(C.BeatUII18n,k=>e.html.div(e.attr.class(e.computedOf(u,s,c,i,o)(Ws)),e.attr.role("list"),e.aria.label(k.$.sortableList.$.dragHandle),e.WithElement(y=>{g=y;const _=()=>d.set(null);return document.addEventListener("mouseup",_),e.OnDispose(()=>{g=null,document.removeEventListener("mouseup",_)})}),e.MapSignal(e.Value.toSignal(a),y=>e.Fragment(...y.map((_,v)=>{const w=l(_),I=e.Value.map(f,$=>$===v),S=e.Value.map(h,$=>$===v),V=e.computedOf(I,S)(($,x)=>{const N=["bc-sortable-list__item"];return $&&N.push("bc-sortable-list__item--dragging"),x&&N.push("bc-sortable-list__item--drop-target"),N.join(" ")}),D=e.html.span(e.attr.class("bc-sortable-list__handle"),e.attr.title(k.$.sortableList.$.dragHandle),e.on.mousedown($=>{e.Value.get(s)||($.stopPropagation(),d.set(v))}),C.Icon({icon:m,size:"sm"}));return e.html.div(e.attr.class(V),e.attr.role("listitem"),e.attr.tabindex(e.Value.map(s,$=>$?-1:0)),e.attr.draggable(e.computedOf(s,e.Value.map(d,$=>$===v))(($,x)=>$?void 0:x?"true":void 0)),e.dataAttr("key",w),e.on.keydown($=>{e.Value.get(s)||($.altKey&&$.key==="ArrowUp"?($.preventDefault(),b(v,v-1)):$.altKey&&$.key==="ArrowDown"&&($.preventDefault(),b(v,v+1)))}),e.on.dragstart($=>{e.Value.get(s)||(f.set(v),$.dataTransfer&&($.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",String(v))))}),e.on.dragover($=>{$.preventDefault(),$.dataTransfer&&($.dataTransfer.dropEffect="move"),h.set(v)}),e.on.dragleave(()=>{h.value===v&&h.set(null)}),e.on.drop($=>{$.preventDefault();const x=f.value;if(x!=null&&x!==v){const N=[...e.Value.get(a)],[H]=N.splice(x,1);N.splice(v,0,H),n(N)}f.set(null),h.set(null)}),e.on.dragend(()=>{f.set(null),h.set(null),d.set(null)}),r(_,D))})))))}function Rs(t,a){const n=["bc-transfer-list",`bc-transfer-list--size-${t}`];return a&&n.push("bc-transfer-list--disabled"),n.join(" ")}function zs(t){const{available:a,selected:n,onChange:r,renderItem:l,keyOf:s,searchField:u,searchable:o=!1,disabled:c=!1,size:i="md",color:m="primary"}=t,f=e.prop(new Set),h=e.prop(new Set),d=e.prop(""),g=e.prop(""),p=(k,y)=>{const _=new Set(k.value);_.has(y)?_.delete(y):_.add(y),k.set(_)},b=u??s;return e.Use(C.BeatUII18n,k=>{const y=()=>{if(e.Value.get(c))return;const x=f.value;if(x.size===0)return;const N=e.Value.get(a),H=e.Value.get(n),T=N.filter(W=>x.has(s(W)));r([...H,...T]),f.set(new Set)},_=()=>{if(e.Value.get(c))return;const x=e.Value.get(I),N=e.Value.get(n);r([...N,...x]),f.set(new Set)},v=()=>{if(e.Value.get(c))return;const x=h.value;if(x.size===0)return;const N=e.Value.get(n);r(N.filter(H=>!x.has(s(H)))),h.set(new Set)},w=()=>{if(e.Value.get(c))return;const x=new Set(e.Value.get(S).map(s)),N=e.Value.get(n);r(N.filter(H=>!x.has(s(H)))),h.set(new Set)},I=e.computedOf(a,n,d)((x,N,H)=>{const T=new Set(N.map(s)),W=x.filter(X=>!T.has(s(X)));if(!H)return W;const B=H.toLowerCase();return W.filter(X=>b(X).toLowerCase().includes(B))}),S=e.computedOf(n,g)((x,N)=>{if(!N)return x;const H=N.toLowerCase();return x.filter(T=>b(T).toLowerCase().includes(H))}),V=e.Value.map(f,x=>x.size>0),D=e.Value.map(h,x=>x.size>0),$=(x,N,H,T,W)=>e.html.div(e.attr.class("bc-transfer-list__panel"),e.html.div(e.attr.class("bc-transfer-list__panel-header"),e.html.span(e.attr.class("bc-transfer-list__panel-title"),x)),e.When(o,()=>e.html.div(e.attr.class("bc-transfer-list__search"),Fe.TextInput({value:W,onInput:B=>W.set(B),placeholder:N,size:"xs"}))),e.html.div(e.attr.class("bc-transfer-list__items"),e.attr.role("listbox"),e.aria.label(x),e.ForEach(H,B=>{const X=e.Value.get(B),P=s(X),U=e.Value.map(T,R=>R.has(P));return e.html.div(e.attr.class(e.Value.map(U,R=>R?"bc-transfer-list__item bc-transfer-list__item--selected":"bc-transfer-list__item")),e.attr.role("option"),e.aria.selected(e.Value.map(U,R=>R?!0:"undefined")),e.on.click(()=>{e.Value.get(c)||p(T,P)}),e.html.span(e.attr.class("bc-transfer-list__item-check"),C.Icon({icon:e.Value.map(U,R=>R?"ri:checkbox-fill":"mdi:checkbox-blank-outline"),size:"sm",accessibility:"decorative"})),e.html.span(e.attr.class("bc-transfer-list__item-content"),l(X)))})));return e.html.div(e.attr.class(e.computedOf(i,c)(Rs)),e.attr.role("group"),$(k.$.transferList.$.available,k.$.transferList.$.searchAvailable,I,f,d),e.html.div(e.attr.class("bc-transfer-list__actions"),ne.Button({variant:"outline",size:"sm",color:m,disabled:e.Value.map(V,x=>!x),onClick:y},e.aria.label(k.$.transferList.$.moveRight),C.Icon({icon:"lucide:chevron-right",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:c,onClick:_},e.aria.label(k.$.transferList.$.moveAllRight),C.Icon({icon:"lucide:chevrons-right",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:c,onClick:w},e.aria.label(k.$.transferList.$.moveAllLeft),C.Icon({icon:"lucide:chevrons-left",size:"xs"})),ne.Button({variant:"outline",size:"sm",color:m,disabled:e.Value.map(D,x=>!x),onClick:v},e.aria.label(k.$.transferList.$.moveLeft),C.Icon({icon:"lucide:chevron-left",size:"xs"}))),$(k.$.transferList.$.selected,k.$.transferList.$.searchSelected,S,h,g))})}function Hs(t,a){return t.length===a.length&&t.every((n,r)=>n===a[r])}function js(t,a,n){const r=["bc-segmented-input",`bc-segmented-input--size-${t}`];return n==="squared"&&r.push("bc-segmented-input--squared"),a&&r.push("bc-segmented-input--disabled"),r.join(" ")}function qs(t){if(t==null)return"";const a=new Map,n=C.backgroundValue(t,"solid","light"),r=C.backgroundValue(t,"solid","dark");return a.set("--si-indicator-bg",n.backgroundColor),a.set("--si-active-text",n.textColor),a.set("--si-indicator-bg-dark",r.backgroundColor),a.set("--si-active-text-dark",r.textColor),Array.from(a.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function Kn(t){return t.flatMap(a=>a.type==="value"?[a]:a.type==="group"?Kn(a.options):[])}function Gs({options:t,value:a,onChange:n,equality:r=(i,m)=>i===m,size:l="md",disabled:s=!1,variant:u="squared",color:o},...c){const i=e.Value.map(t,Kn),m=e.Value.toSignal(a),f=e.prop([],Hs);return e.html.div(e.attr.class(e.computedOf(l,s,u)((h,d,g)=>js(h??"md",d??!1,g??"squared"))),e.attr.style(o!=null?e.Value.map(o,h=>qs(h)):""),e.html.div(e.attr.class("bc-segmented-input__container"),e.html.div(e.attr.class("bc-segmented-input__indicator"),e.style.width(e.computedOf(m,f,i)((h,d,g)=>{const p=g.findIndex(k=>r(k.value,h)),b=d[p];return b!=null?`${b.width}px`:"0px"})),e.style.left(e.computedOf(m,f,i)((h,d,g)=>{const p=g.findIndex(k=>r(k.value,h)),b=d[p];return b!=null?`${b.left}px`:"0px"}))),e.ForEach(i,(h,{index:d})=>e.html.button(e.attr.type("button"),e.on.click(g=>{g.preventDefault();const p=e.Value.get(h);p.disabled||e.Value.get(s)||n?.(p.value)}),e.attr.disabled(e.computedOf(s,h)((g,p)=>(g??!1)||(p.disabled??!1))),e.attr.class(e.computedOf(m,h)((g,p)=>r(p.value,g)?"bc-segmented-input__segment bc-segmented-input__segment--active":"bc-segmented-input__segment bc-segmented-input__segment--inactive")),Ce.ElementRect(g=>{function p(){f.update(k=>{const y=[...k];for(;y.length<=d;)y.push({left:0,width:0});return y[d]={width:g.value.width,left:g.value.localLeft},y})}const b=we.delayedAnimationFrame(p);return e.OnDispose(b,g.on(p))}),h.$.before!=null?e.html.span(e.attr.class("bc-segmented-input__segment-before"),h.$.before):null,h.$.label,h.$.after!=null?e.html.span(e.attr.class("bc-segmented-input__segment-after"),h.$.after):null))),...c)}function Ys(t,a,n){const r=["bc-tag-input",`bc-tag-input--${t}`];return a&&r.push("bc-tag-input--disabled"),n&&r.push("bc-tag-input--error"),r.join(" ")}function Ks(t){const{values:a,onChange:n,placeholder:r="Add...",size:l="md",disabled:s=!1,maxTags:u,hasError:o=!1}=t,c=e.prop(""),i=h=>{const g=e.Value.get(a).filter(p=>p!==h);n?.(g)},m=h=>{const d=h.trim();if(!d)return;const g=e.Value.get(a),p=e.Value.get(u??1/0);g.includes(d)||g.length>=p||(n?.([...g,d]),c.set(""))},f=h=>{if(h.key==="Enter"||h.key===",")h.preventDefault(),m(c.value);else if(h.key==="Backspace"&&c.value===""){const d=e.Value.get(a);d.length>0&&i(d[d.length-1])}};return e.html.div(e.attr.class(e.computedOf(l,s,o)((h,d,g)=>Ys(h??"md",d??!1,g??!1))),e.ForEach(a,h=>e.html.span(e.attr.class("bc-tag-input__tag"),e.html.span(e.attr.class("bc-tag-input__tag-text"),h),e.When(e.computedOf(s)(d=>!(d??!1)),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-tag-input__tag-remove"),e.on.click(d=>{d.stopPropagation(),i(h.value)}),"×"),()=>e.Empty))),e.html.input(e.attr.class("bc-tag-input__input"),e.attr.type("text"),e.attr.placeholder(e.computedOf(a,r)((h,d)=>h.length===0?d??"Add...":"")),e.attr.disabled(s),e.attr.value(c),e.on.input(h=>{const d=h.target;c.set(d.value)}),e.on.keydown(f),e.on.blur(()=>{c.value.trim()&&m(c.value)})))}const Zs=t=>{const{value:a,onChange:n,onBlur:r,before:l}=t,s=e.prop(""),u=c=>{n?.(e.Value.get(a).filter(i=>i!==c))},o=()=>{const c=s.value.trim(),i=e.Value.get(a);c===""||i.includes(c)||(s.set(""),n?.([...i,c]))};return ne.InputContainer({...t,before:l??ne.InputIcon({icon:"tabler:tag",size:t.size,color:"neutral"}),input:e.Fragment(e.attr.class("bc-input-container__tags"),e.ForEach(a,c=>ct({variant:"light",onClose:()=>u(c.value),disabled:t.disabled},c)),e.input.text(Fe.CommonInputAttributes(t),e.attr.value(s),e.attr.class("bc-input bc-input-container__tags-input"),e.on.input(e.emitValue(c=>s.set(c))),n!=null?e.on.change(o):e.Empty,r!=null?e.on.blur(r):e.Empty))})};function Xs(t,a){const n=["bc-radio-group",`bc-radio-group--${t}`];return a&&a.length>0&&n.push(a),n.join(" ")}function Qs(t,a,n){const r=["bc-radio-group__item",`bc-radio-group__item--size-${t}`];return(a||n)&&r.push("bc-radio-group__item--disabled"),r.join(" ")}function Js({options:t,value:a,onChange:n,name:r,disabled:l=!1,orientation:s="vertical",size:u="md",class:o}){const c=r??Pe.sessionId("radio-group");return e.html.div(e.attr.class(e.computedOf(s,o)((i,m)=>Xs(i??"vertical",m))),e.attr.role("radiogroup"),e.ForEach(t,i=>{const m=i.map(h=>h.disabled??!1),f=Pe.sessionId("radio");return e.html.label(e.attr.class(e.computedOf(u,l,m)((h,d,g)=>Qs(h??"md",g??!1,d??!1))),e.html.input(e.attr.type("radio"),e.attr.name(c),e.attr.id(f),e.attr.value(i.map(h=>String(h.value))),e.attr.class("bc-radio-group__input"),e.attr.checked(e.computedOf(a,i)((h,d)=>h===d.value)),e.attr.disabled(e.computedOf(l,m)((h,d)=>(h??!1)||(d??!1))),e.on.change(()=>{e.Value.get(l)||(e.Value.get(i).disabled??!1)||n?.(e.Value.get(i).value)}),e.aria.disabled(e.computedOf(l,m)((h,d)=>(h??!1)||(d??!1)))),e.html.span(e.attr.class("bc-radio-group__indicator")),e.html.span(e.attr.class("bc-radio-group__label-container"),e.html.span(e.attr.class("bc-radio-group__label"),i.map(h=>h.label)),e.html.span(e.attr.class("bc-radio-group__description"),i.map(h=>h.description??""))))}))}function Ct(t,a,n){return Math.min(Math.max(t,a),n)}function ei(t,a,n){return ae.roundToStep(Math.round((t-a)/n)*n+a,n)}function qe(t,a,n){return n===a?0:(t-a)/(n-a)*100}function ti(t,a,n,r){const l=["bc-range-slider",`bc-range-slider--size-${t}`];return a&&l.push("bc-range-slider--disabled"),n&&l.push("bc-range-slider--readonly"),r==="vertical"&&l.push("bc-range-slider--vertical"),l.join(" ")}function ai(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return`--rs-color: ${a.backgroundColor}; --rs-color-dark: ${n.backgroundColor}`}function ni({min:t=0,max:a=100,step:n=1,disabled:r=!1,readonly:l=!1,size:s="md",color:u="primary",value:o,onChange:c,range:i,onRangeChange:m,points:f,onPointsChange:h,ticks:d,markers:g,showValue:p=!1,formatValue:b=v=>String(v),segmentStyles:k,renderThumb:y,orientation:_="horizontal"}){const v=f!=null?"multi":i!=null?"range":"single",w=v==="multi"?e.Value.get(f).length:v==="range"?2:1,I=e.Value.get(_)==="vertical",S=v==="multi"?e.Value.map(f,T=>[...T]):v==="range"?e.Value.map(i,T=>[T[0],T[1]]):e.Value.map(o??0,T=>[T]),V=e.prop(null);function D(T){if(v==="multi")h?.(T);else if(v==="range"){const W=[T[0],T[1]];W[0]>W[1]&&W.reverse(),m?.(W)}else c?.(T[0])}function $(){return!e.Value.get(r)&&!e.Value.get(l)}function x(T,W,B,X){const P=e.Value.get(t),U=e.Value.get(a),R=e.Value.get(n),Q=T.getBoundingClientRect();let F;I?F=Ct(1-(B-Q.top)/Q.height,0,1):F=Ct((W-Q.left)/Q.width,0,1);const O=P+F*(U-P),z=Ct(ei(O,P,R),P,U),Z=e.Value.get(S);if(X!=null){const ie=[...Z];ie[X]=z,D(ie)}else{let ie=0,ve=Math.abs(Z[0]-z);for(let se=1;se<Z.length;se++){const le=Math.abs(Z[se]-z);le<ve&&(ie=se,ve=le)}const J=[...Z];J[ie]=z,V.set(ie),D(J)}}function N(T){return e.computedOf(S,t)((W,B)=>W[T]??B)}function H(T,W){const B=N(T),X=e.computedOf(B,t,a)((P,U,R)=>`${qe(P,U,R)}%`);return e.html.div(e.attr.class("bc-range-slider__thumb-container"),I?e.style.bottom(X):e.style.left(X),e.When(p,()=>e.html.div(e.attr.class("bc-range-slider__value-label"),e.Value.map(B,P=>b(P))),()=>e.Empty),e.html.div(e.attr.class(y?"bc-range-slider__thumb-custom":"bc-range-slider__thumb"),e.attr.role("slider"),e.attr.tabindex(0),e.aria.valuemin(t),e.aria.valuemax(a),e.aria.valuenow(B),e.aria.label(`Thumb ${T+1}`),I?e.aria.orientation("vertical"):e.Empty,e.on.keydown(P=>{if(!$())return;const U=e.Value.get(t),R=e.Value.get(a),Q=e.Value.get(n),F=e.Value.get(S),O=F[T];let z;switch(P.key){case"ArrowRight":case"ArrowUp":P.preventDefault(),z=Ct(ae.roundToStep(O+Q,Q),U,R);break;case"ArrowLeft":case"ArrowDown":P.preventDefault(),z=Ct(ae.roundToStep(O-Q,Q),U,R);break;case"Home":P.preventDefault(),z=U;break;case"End":P.preventDefault(),z=R;break;default:return}const Z=[...F];Z[T]=z,D(Z)}),e.on.pointerdown(P=>{if(P.stopPropagation(),P.preventDefault(),!$())return;V.set(T);const U=Q=>{x(W,Q.clientX,Q.clientY,T)},R=()=>{V.set(null),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",R)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",R)}),y?y(T,B):e.Empty))}return e.WithElement(T=>{const W=Q=>{if(!$())return;Q.preventDefault(),x(T,Q.clientX,Q.clientY,null);const F=z=>{x(T,z.clientX,z.clientY,V.value)},O=()=>{V.set(null),window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",O)},B=e.computedOf(S,t,a)((Q,F,O)=>{if(I){if((v==="range"||v==="multi")&&Q.length>=2){const Z=[...Q].sort((J,se)=>J-se),ie=qe(Z[0],F,O),ve=qe(Z[Z.length-1],F,O);return`bottom: ${ie}%; height: ${ve-ie}%`}return`bottom: 0%; height: ${qe(Q[0]??F,F,O)}%`}else{if((v==="range"||v==="multi")&&Q.length>=2){const Z=[...Q].sort((J,se)=>J-se),ie=qe(Z[0],F,O),ve=qe(Z[Z.length-1],F,O);return`left: ${ie}%; width: ${ve-ie}%`}return`left: 0%; width: ${qe(Q[0]??F,F,O)}%`}}),X=k!=null?e.MapSignal(e.computedOf(S,t,a,k,u)((Q,F,O,z,Z)=>({vals:Q,mn:F,mx:O,styles:z,clr:Z})),({vals:Q,mn:F,mx:O,styles:z,clr:Z})=>{const ie=[...Q].sort((J,se)=>J-se),ve=[F,...ie,O];return e.Fragment(...ve.slice(0,-1).map((J,se)=>{const le=ve[se+1],ye=z[se],_e=qe(J,F,O),ke=qe(le,F,O),j=ye?.color??Z,A=C.backgroundValue(j,"solid","light"),te=C.backgroundValue(j,"solid","dark"),de=ye?.thickness,ee=ye?.pattern??"solid",Se=de?`height: ${de};`:"",xe=ee!=="solid"?`border-style: ${ee}; background: none; border-color: ${A.backgroundColor};`:"";let Le;I?Le=`bottom: ${_e}%; height: ${ke-_e}%;`:Le=`left: ${_e}%; width: ${ke-_e}%;`;const E=`${Le} --rs-color: ${A.backgroundColor}; --rs-color-dark: ${te.backgroundColor}; ${Se} ${xe}`;return e.html.div(e.attr.class("bc-range-slider__fill bc-range-slider__segment"),e.attr.style(E))}))}):e.html.div(e.attr.class("bc-range-slider__fill"),e.attr.style(B)),P=Array.from({length:w},(Q,F)=>H(F,T)),U=d?e.MapSignal(e.computedOf(d,t,a,n)((Q,F,O,z)=>{if(Q===!0){const Z=[];for(let ie=F;ie<=O;ie+=z)Z.push({value:ie});return{marks:Z,mn:F,mx:O}}return Array.isArray(Q)?{marks:Q,mn:F,mx:O}:{marks:[],mn:F,mx:O}}),({marks:Q,mn:F,mx:O})=>Q.length===0?e.Empty:e.html.div(e.attr.class("bc-range-slider__ticks"),...Q.map(z=>{const Z=qe(z.value,F,O);return e.html.div(e.attr.class("bc-range-slider__tick"),I?e.style.bottom(`${Z}%`):e.style.left(`${Z}%`),z.label!=null?e.html.span(e.attr.class("bc-range-slider__tick-label"),z.label):e.Empty)}))):e.Empty,R=g?e.MapSignal(e.computedOf(g,t,a,n)((Q,F,O,z)=>{if(Q===!0){const Z=[];for(let ie=F;ie<=O;ie+=z)Z.push({value:ie});return{dots:Z,mn:F,mx:O}}return Array.isArray(Q)?{dots:Q,mn:F,mx:O}:{dots:[],mn:F,mx:O}}),({dots:Q,mn:F,mx:O})=>Q.length===0?e.Empty:e.html.div(e.attr.class("bc-range-slider__markers"),...Q.map(z=>{const Z=qe(z.value,F,O);return e.html.div(e.attr.class("bc-range-slider__marker"),I?e.style.bottom(`${Z}%`):e.style.left(`${Z}%`),z.label!=null?e.html.span(e.attr.class("bc-range-slider__marker-label"),z.label):e.Empty)}))):e.Empty;return e.Fragment(e.attr.class(e.computedOf(s,r,l,_)(ti)),e.attr.style(e.Value.map(u,ai)),e.attr.role("group"),e.aria.label(v==="multi"?"Multi-point slider":v==="range"?"Range slider":"Slider"),e.on.pointerdown(W),e.html.div(e.attr.class("bc-range-slider__track"),X,R,U,...P))})}function ri(t,a){const n=["bc-otp-input",`bc-otp-input--size-${t}`];return a&&n.push("bc-otp-input--disabled"),n.join(" ")}function li(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark"),r=new Map;return r.set("--otp-focus-color",a.backgroundColor),r.set("--otp-focus-color-dark",n.backgroundColor),r.set("--otp-focus-border",C.borderColorValue(t,"light")),r.set("--otp-focus-border-dark",C.borderColorValue(t,"dark")),Array.from(r.entries()).map(([l,s])=>`${l}: ${s}`).join("; ")}function oi(t,a){return a==="numeric"?/^\d$/.test(t):/^[a-zA-Z0-9]$/.test(t)}function si({length:t=6,value:a="",onChange:n,onComplete:r,disabled:l=!1,mask:s=!1,type:u="numeric",size:o="md",color:c="primary",placeholder:i="",autoFocus:m=!1}={}){const f=Pe.sessionId("otp"),h=e.computedOf(t,a)((v,w)=>{const I=new Array(v).fill("");for(let S=0;S<Math.min(w.length,v);S++)I[S]=w[S];return I}).deriveProp(),d=e.prop(null),g=[];function p(v){const w=g[v];w!=null&&(w.focus(),w.select())}function b(){const v=h.value.join("");n?.(v),v.length===t&&v.split("").every(w=>w!=="")&&r?.(v)}function k(v,w){if(e.Value.get(l))return;const I=e.Value.get(u),S=w.split("").filter(V=>oi(V,I));if(S.length>1){const V=[...h.value];for(let $=0;$<S.length&&v+$<e.Value.get(t);$++)V[v+$]=S[$];h.set(V),b();const D=Math.min(v+S.length,e.Value.get(t)-1);p(D);return}if(S.length===1){const V=[...h.value];V[v]=S[0],h.set(V),b(),v<e.Value.get(t)-1&&p(v+1)}}function y(v,w){if(!e.Value.get(l))switch(w.key){case"Backspace":{w.preventDefault();const I=[...h.value];I[v]!==""?(I[v]="",h.set(I),b()):v>0&&(I[v-1]="",h.set(I),b(),p(v-1));break}case"ArrowLeft":w.preventDefault(),v>0&&p(v-1);break;case"ArrowRight":w.preventDefault(),v<e.Value.get(t)-1&&p(v+1);break;case"Delete":{w.preventDefault();const I=[...h.value];I[v]="",h.set(I),b();break}case"Home":w.preventDefault(),p(0);break;case"End":w.preventDefault(),p(e.Value.get(t)-1);break}}function _(v,w){w.preventDefault();const I=w.clipboardData?.getData("text")??"";k(v,I)}return e.Use(C.BeatUII18n,v=>e.html.div(e.attr.class(e.computedOf(o,l)(ri)),e.attr.style(e.Value.map(c,li)),e.attr.role("group"),e.aria.label(v.$.otpInputLabel),e.Repeat(t,w=>{const I=w.index,S=`${f}-cell-${I}`;return e.html.input(e.WithElement(V=>(g[I]=V,m&&I===0&&we.delayedAnimationFrame(()=>V.focus()),e.Empty)),e.attr.id(S),e.attr.type(e.Value.map(s,V=>V?"password":"text")),e.attr.inputmode(e.Value.map(u,V=>V==="numeric"?"numeric":"text")),e.attr.maxlength(1),e.attr.autocomplete("one-time-code"),e.attr.class("bc-otp-input__cell"),e.attr.class(d.map(V=>V===I?"bc-otp-input__cell--focused":"")),e.attr.placeholder(i),e.attr.disabled(l),e.aria.label(v.$.otpDigitLabel.map(V=>V(I+1,e.Value.get(t)))),e.attr.value(h.map(V=>V[I]??"")),e.on.focus(()=>{d.set(I);const V=g[I];V?.select()}),e.on.blur(()=>{d.set(null)}),e.on.input(V=>{const D=V.target;k(I,D.value)}),e.on.keydown(V=>y(I,V)),e.on.paste(V=>_(I,V)))})))}function It(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),u=Pe.sessionId("time-select"),o=Pe.sessionId("time-select-panel");let c,i;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),c?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-time-select ${h}`):"bc-time-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:clock",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{c=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(u),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-time-select__trigger"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!i?.contains(document.activeElement)&&!c?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ie.Flyout({content:()=>e.html.div(e.WithElement(d=>{i=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-time-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),c?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function ii(t){const{value:a,onChange:n,color:r="primary",showSeconds:l=!1,use12Hour:s,minuteStep:u,secondStep:o,showNow:c,formatTime:i,...m}=t;if(i!=null){const f=e.Value.map(a,h=>i(h));return It({...m,displayText:f,panelContent:bt({value:e.Value.map(a,h=>h),onSelect:h=>n?.(h),color:r,size:t.size,disabled:t.disabled,showSeconds:l,use12Hour:s,minuteStep:u,secondStep:o,showNow:c})})}return e.Use(C.Locale,({locale:f})=>{const h=s!=null?e.Value.toSignal(s):f.map(vt),d=e.Value.toSignal(l),g=e.computedOf(a,h,d)((p,b,k)=>Pt(p,b,k));return It({...m,displayText:g,panelContent:bt({value:e.Value.map(a,p=>p),onSelect:p=>n?.(p),color:r,size:t.size,disabled:t.disabled,showSeconds:l,use12Hour:s,minuteStep:u,secondStep:o,showNow:c})})})}function ci(t){const{value:a,onChange:n,color:r="primary",showSeconds:l=!1,use12Hour:s,minuteStep:u,secondStep:o,showNow:c,formatTime:i,placeholder:m=C.defaultMessages.timeSelectTime,disabled:f,...h}=t,d=ae.NullableResetAfter(a,f,n),g=h.after!=null?e.Fragment(d,h.after):d,p=()=>bt({value:a,onSelect:b=>n?.(b),color:r,size:t.size,disabled:f,showSeconds:l,use12Hour:s,minuteStep:u,secondStep:o,showNow:c});if(i!=null){const b=e.Value.map(a,k=>k!=null?i(k):m);return It({...h,disabled:f,displayText:b,after:g,panelContent:p()})}return e.Use(C.Locale,({locale:b})=>{const k=s!=null?e.Value.toSignal(s):b.map(vt),y=e.Value.toSignal(l),_=e.computedOf(a,k,y)((v,w,I)=>v!=null?Pt(v,w,I):m);return It({...h,disabled:f,displayText:_,after:g,panelContent:p()})})}function $t(t){const{displayText:a,panelContent:n,onBlur:r,disabled:l=!1}=t,s=e.prop(!1),u=Pe.sessionId("date-time-select"),o=Pe.sessionId("date-time-panel");let c,i;const m=h=>{switch(h.key){case"Enter":case" ":{h.preventDefault(),s.set(!s.value);break}case"Escape":{s.value&&(h.preventDefault(),s.set(!1),c?.focus());break}}},f=t.class?e.Value.map(t.class,h=>`bc-date-time-select ${h}`):"bc-date-time-select";return ne.InputContainer({...t,class:f,input:e.html.span(e.attr.class("bc-dropdown__trigger"),a),after:e.Fragment(ne.InputIcon({icon:"lucide:calendar-clock",color:"neutral",size:"sm"}),t.after)},Ce.ElementRect(h=>e.Fragment(e.WithElement(d=>{c=d;const g=()=>{e.Value.get(l)||s.set(!s.value)};return d.addEventListener("keydown",m),d.addEventListener("click",g),e.OnDispose(()=>{d.removeEventListener("keydown",m),d.removeEventListener("click",g)})}),Fe.CommonInputAttributes(t),e.attr.id(u),e.attr.tabindex(0),e.aria.controls(o),e.aria.expanded(s),e.attr.class("bc-dropdown bc-date-time-select__trigger"),e.attr.role("combobox"),r!=null?e.on.blur(()=>{requestAnimationFrame(()=>{!i?.contains(document.activeElement)&&!c?.contains(document.activeElement)&&(s.set(!1),r())})}):e.Empty,Ie.Flyout({content:()=>e.html.div(e.WithElement(d=>{i=d}),e.style.minWidth(h.$.width.map(d=>`${d}px`)),e.attr.class("bc-date-time-select__panel"),e.attr.id(o),e.on.keydown(d=>{d.key==="Escape"&&(s.set(!1),c?.focus())}),n),mainAxisOffset:0,placement:"bottom-start",hasPopup:"dialog",open:s,showOn:"never",showDelay:0,hideDelay:0,closable:!0}))))}function ui(t){return`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function di(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,showSeconds:u=!1,use12Hour:o,minuteStep:c,secondStep:i,showNow:m,formatDateTime:f,...h}=t;return ae.WithTemporal(d=>{const g=_=>{const v=e.Value.get(a),w=d.PlainDateTime.from({year:_.year,month:_.month,day:_.day,hour:v.hour,minute:v.minute,second:v.second});n?.(w)},p=_=>{const v=e.Value.get(a),w=d.PlainDateTime.from({year:v.year,month:v.month,day:v.day,hour:_.hour,minute:_.minute,second:_.second});n?.(w)},b=e.Value.map(a,_=>d.PlainDate.from({year:_.year,month:_.month,day:_.day})),k=e.Value.map(a,_=>d.PlainTime.from({hour:_.hour,minute:_.minute,second:_.second})),y=e.html.div(e.attr.class("bc-date-time-select__pickers"),it({value:b,onSelect:g,isDateDisabled:r,color:l,size:t.size,disabled:t.disabled,weekStartsOn:s}),e.html.div(e.attr.class("bc-date-time-select__separator")),bt({value:k,onSelect:p,color:l,size:t.size,disabled:t.disabled,showSeconds:u,use12Hour:o,minuteStep:c,secondStep:i,showNow:m}));if(f!=null){const _=e.Value.map(a,v=>f(v));return $t({...h,displayText:_,panelContent:y})}return e.Use(C.Locale,({locale:_})=>{const v=o!=null?e.Value.toSignal(o):_.map(vt),w=e.Value.toSignal(u),I=e.computedOf(a,v,w)((S,V,D)=>{const $=ui(S),x=Pt(S,V,D);return`${$} · ${x}`});return $t({...h,displayText:I,panelContent:y})})})}function pi(t){return`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function mi(t){const{value:a,onChange:n,isDateDisabled:r,color:l="primary",weekStartsOn:s=0,showSeconds:u=!1,use12Hour:o,minuteStep:c,secondStep:i,showNow:m,formatDateTime:f,placeholder:h=C.defaultMessages.dateTimeSelectDateTime,disabled:d,...g}=t,p=ae.NullableResetAfter(a,d,n),b=g.after!=null?e.Fragment(p,g.after):p;return ae.WithTemporal(k=>{const y=S=>{const V=e.Value.get(a)??k.Now.plainDateTimeISO(),D=k.PlainDateTime.from({year:S.year,month:S.month,day:S.day,hour:V.hour,minute:V.minute,second:V.second});n?.(D)},_=S=>{const V=e.Value.get(a)??k.Now.plainDateTimeISO(),D=k.PlainDateTime.from({year:V.year,month:V.month,day:V.day,hour:S.hour,minute:S.minute,second:S.second});n?.(D)},v=e.Value.map(a,S=>S!=null?k.PlainDate.from({year:S.year,month:S.month,day:S.day}):null),w=e.Value.map(a,S=>S!=null?k.PlainTime.from({hour:S.hour,minute:S.minute,second:S.second}):null),I=e.html.div(e.attr.class("bc-date-time-select__pickers"),it({value:v,onSelect:y,isDateDisabled:r,color:l,size:t.size,disabled:d,weekStartsOn:s}),e.html.div(e.attr.class("bc-date-time-select__separator")),bt({value:w,onSelect:_,color:l,size:t.size,disabled:d,showSeconds:u,use12Hour:o,minuteStep:c,secondStep:i,showNow:m}));if(f!=null){const S=e.Value.map(a,V=>V!=null?f(V):h);return $t({...g,disabled:d,displayText:S,after:b,panelContent:I})}return e.Use(C.Locale,({locale:S})=>{const V=o!=null?e.Value.toSignal(o):S.map(vt),D=e.Value.toSignal(u),$=e.computedOf(a,V,D)((x,N,H)=>{if(x==null)return h;const T=pi(x),W=Pt(x,N,H);return`${T} · ${W}`});return $t({...g,disabled:d,displayText:$,after:b,panelContent:I})})})}const hi=t=>{const a=new Date(t),n=a.getFullYear().toString().padStart(4,"0"),r=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0"),s=a.getHours().toString().padStart(2,"0"),u=a.getMinutes().toString().padStart(2,"0");return`${n}-${r}-${l}T${s}:${u}`},fi=t=>{const{value:a,onBlur:n,onChange:r}=t;return ae.WithTemporal(l=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,s=>hi(Number(s.epochMilliseconds)))),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(s=>r(l.Instant.from(new Date(s).toISOString())))):e.Empty)}))},gi=t=>{const a=new Date(t),n=a.getFullYear().toString().padStart(4,"0"),r=(a.getMonth()+1).toString().padStart(2,"0"),l=a.getDate().toString().padStart(2,"0"),s=a.getHours().toString().padStart(2,"0"),u=a.getMinutes().toString().padStart(2,"0");return`${n}-${r}-${l}T${s}:${u}`},bi=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:u}=t,o=ae.NullableResetAfter(a,u,r??l);return ae.WithTemporal(c=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,i=>i==null?null:gi(Number(i.epochMilliseconds)))),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(i=>r(i===""?null:c.Instant.from(new Date(i).toISOString())))):e.Empty,l!=null?e.on.input(e.emitValue(i=>l(i===""?null:c.Instant.from(new Date(i).toISOString())))):e.Empty),after:s!=null?e.Fragment(o,s):o}))},vi=t=>{const{value:a,onBlur:n,onChange:r}=t;return ae.WithTemporal(l=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,s=>s.toJSON())),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(s=>{const u=l.PlainDateTime.from(s),o=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return r(l.ZonedDateTime.from({...u,timeZone:o}))})):e.Empty)}))},yi=t=>{const{value:a,onBlur:n,onChange:r,onInput:l,after:s,disabled:u}=t,o=ae.NullableResetAfter(a,u,r??l);return ae.WithTemporal(c=>ne.InputContainer({...t,input:e.input["datetime-local"](Fe.CommonInputAttributes(t),e.attr.value(e.Value.map(a,i=>i?.toJSON())),e.attr.class("bc-input"),n!=null?e.on.blur(e.emitValue(n)):e.Empty,r!=null?e.on.change(e.emitValue(i=>{if(i==="")return r(null);const m=c.PlainDateTime.from(i),f=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return r(c.ZonedDateTime.from({...m,timeZone:f}))})):e.Empty,l!=null?e.on.input(e.emitValue(i=>{if(i==="")return l(null);const m=c.PlainDateTime.from(i),f=e.Value.get(t.placeholder)??Intl.DateTimeFormat().resolvedOptions().timeZone;return l(c.ZonedDateTime.from({...m,timeZone:f}))})):e.Empty),after:s!=null?e.Fragment(o,s):o}))},ki=je.createTemporalInput({inputType:"month",valueToString:t=>t.toString(),parseValue:(t,a)=>t.PlainYearMonth.from(a)}),_i=je.createNullableTemporalInput({inputType:"month",valueToString:t=>t.toString(),parseValue:(t,a)=>t.PlainYearMonth.from(a)}),wi=t=>{const{value:a,onChange:n}=t;return ae.WithTemporal(r=>ae.MaskInput({...t,value:e.Value.map(a,l=>l.toString()),onChange:n!=null?l=>n(r.PlainMonthDay.from(`--${l}`)):void 0,onInput:void 0,mask:"99-99",placeholder:"MM-DD"}))},Ci=t=>{const{after:a,disabled:n}=t,r=ae.NullableResetAfter(t.value,n,t.onChange??t.onInput);return ae.WithTemporal(l=>{const s=Fe.mapInputOptions(t,u=>u?.toString()??"",u=>u===""?null:l.PlainMonthDay.from(`--${u}`));return ae.MaskInput({...s,mask:"99-99",placeholder:"MM-DD",after:a!=null?e.Fragment(r,a):r})})};function Si(t,a,n){return e.Ensure(t.signal,()=>{const r=t.transform(l=>l,l=>l);return a(r)},n)}const Vi={filling:{type:"filling"},submitting:{type:"submitting"},error:t=>({type:"error",error:t}),success:{type:"success"}};function Ii(t){return G.Mt(t)}function ma(t){return G.os(t)==="rgb8"}function ht(t){try{return ma(t)?G.vt(G.kt(t)):null}catch{return null}}class Zn extends oe.Controller{constructor(a,n,r,l,s){super(a,n,r,l,s)}isValidColor=this.signal.map(Ii);isValidHex=this.signal.map(ma);normalizedHex=this.signal.map(a=>ht(a)??a);setColor=a=>{if(ma(a)){const n=ht(a);if(n){this.change(n);return}}this.change(a)};setHex=a=>{const n=ht(a);n&&this.change(n)};setRgb=(a,n,r)=>{const l=u=>{const o=Math.round(Math.max(0,Math.min(255,u))).toString(16);return o.length===1?"0"+o:o},s=`#${l(a)}${l(n)}${l(r)}`;this.change(s)};getRgb=()=>{const a=this.signal.value,n=ht(a);if(!n)return null;const r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null};withFormat=a=>{const n=l=>{switch(a){case"hex":return ht(l)??l;case"rgb":const s=this.getRgb();return s?`rgb(${s.r}, ${s.g}, ${s.b})`:l;case"hsl":return l;default:return l}},r=l=>ht(l)??l;return this.transform(n,r,[`format-${a}`])}}function $i(t){return new Zn(t.path,t.change,t.signal,t.status,{disabled:t.disabled})}function xi(t){return{id:t.name,disabled:t.disabled,value:t.normalizedHex,hasError:t.errorVisible,onChange:t.setColor,onInput:t.setColor}}function Di(t){const a={xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)"};return a[t]??a.md}function Oi({legend:t,description:a,variant:n="plain",collapsible:r=!1,defaultCollapsed:l=!1,disabled:s=!1,layout:u,labelWidth:o,size:c,gap:i="md",columns:m,minFieldWidth:f,compact:h},...d){const g=e.prop(!e.Value.get(l)),p=e.Value.map(n,k=>`bc-fieldset bc-fieldset--${k}`),b={};return u!==void 0&&(b.layout=u),o!==void 0&&(b.labelWidth=o),c!==void 0&&(b.size=c),i!==void 0&&(b.gap=i),m!==void 0&&(b.columns=m),f!==void 0&&(b.minFieldWidth=f),h!==void 0&&(b.compact=h),e.html.fieldset(e.attr.class(p),e.attr.disabled(s),t!=null?e.html.legend(e.attr.class("bc-fieldset__legend"),e.When(r,()=>e.html.button(e.attr.type("button"),e.attr.class("bc-fieldset__legend-toggle"),e.on.click(()=>g.update(k=>!k)),e.html.span(e.attr.class("bc-fieldset__legend-text"),t),C.Icon({icon:"lucide:chevron-down",size:"sm",color:"neutral"},e.attr.class(g.map(k=>`bc-fieldset__collapse-icon${k?"":" bc-fieldset__collapse-icon--collapsed"}`)))),()=>e.html.span(e.attr.class("bc-fieldset__legend-text"),t))):e.Empty,a!=null?e.html.div(e.attr.class("bc-fieldset__description"),a):e.Empty,e.Provide(oe.FieldLayout,b,()=>{const k=e.html.div(e.attr.class("bc-fieldset__content"),e.attr.style(e.computedOf(i,m??void 0,f??void 0)((y,_,v)=>{const I=[`--fieldset-gap: ${Di(e.Value.get(y)??"md")}`],S=e.Value.get(_),V=e.Value.get(v);return S!=null&&S>1?I.push(`grid-template-columns: repeat(${S}, minmax(0, 1fr))`):V!=null&&I.push(`grid-template-columns: repeat(auto-fit, minmax(${V}, 1fr))`),I.join("; ")})),...d);return e.When(r,()=>e.html.div(Tt({open:g},k)),()=>k)}))}function Ti({locales:t,onChange:a,updateLocale:n=!0}){return e.Use(C.BeatUII18n,r=>e.Use(C.Locale,({locale:l,setLocale:s})=>oe.Field({layout:"horizontal",content:ae.Group(e.attr.class("bc-group--align-center bc-group--gap-2"),C.Icon({icon:"ic:twotone-language",size:"lg",color:"neutral",title:r.$.locale}),ae.NativeSelect({ariaLabel:r.$.locale,options:e.computedOf(t,r)((u,o)=>u.map(c=>{let m=o[c.code]??c.name;return c.nativeName!=null&&c.nativeName!==m&&(m+=` (${c.nativeName})`),Ue.value(c.code,m)})),value:l,onChange:u=>{n&&s(u),a?.(u)}}))})))}const Pi=()=>e.Use(C.Locale,({direction:t})=>e.Portal("body",e.attr.class(t.map(a=>`b-${a}`))));function Xn(t,a,n,r,l){const s=["bc-notification"];return t&&s.push("bc-notification--bordered"),a&&s.push("bc-notification--has-icon"),n&&s.push("bc-notification--closable"),r&&s.push("bc-notification--loading"),l&&l.length>0&&s.push(l),s.join(" ")}function Qn(t,a){return[`--notification-accent-color: ${fe.getColorVar(t,500)}`,`--notification-radius: ${L.getRadiusVar(a)}`].join("; ")}function Jn({loading:t=!1,showCloseButton:a=!1,showBorder:n=!1,color:r="primary",roundedness:l="md",title:s,icon:u,onClose:o,class:c}={},...i){const m=e.Value.map(u,f=>f!=null);return e.html.section(e.attr.class(e.computedOf(n,m,a,t,c)((f,h,d,g,p)=>[Xn(f,h,d,g,p)].join(" "))),e.attr.style(e.computedOf(r,l)((f,h)=>Qn(f,h))),e.aria.live("polite"),e.aria.busy(t),e.When(t,()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__loader"),C.Icon({icon:"line-md:loading-twotone-loop",size:"lg",color:r,accessibility:"decorative"})),()=>e.When(m,()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__icon"),C.Icon({icon:u,size:"md"})),()=>e.html.div(e.attr.class("bc-notification__visual bc-notification__accent"),e.aria.hidden(!0)))),e.html.div(e.attr.class("bc-notification__body"),s!=null?e.html.div(e.attr.class("bc-notification__title"),s):null,e.html.div(e.attr.class("bc-notification__content"),...i)),e.When(a,()=>e.html.div(e.attr.class("bc-notification__meta"),oe.CloseButton({size:"sm",color:r,onClick:o}))))}let Ei=0;class Fi{handles=[];attach(a){return this.detach(a),this.handles.push(a),()=>this.detach(a)}detach(a){const n=this.handles.lastIndexOf(a);n>=0&&this.handles.splice(n,1)}get current(){const a=this.handles[this.handles.length-1];if(!a)throw new Error("NotificationService: no provider attached. Ensure BeatUI includes notifications or attach the provider manually.");return a}show(a,...n){return this.current.show(a,...n)}clear(){this.current.clear()}}const er=new Fi,Fa={mark:e.makeProviderMark("NotificationProvider"),create:({position:t="bottom-end"}={})=>{const a=e.prop(0),n=e.prop([]),r=[];function l(m){return r.push(m),()=>{const f=r.lastIndexOf(m);f>=0&&r.splice(f,1)}}const s=m=>{n.update(f=>f.filter(h=>h.id!==m)),a.update(f=>Math.max(0,f-1))},u=[],o=({dismissAfter:m,onClose:f,animation:h={fade:!0},...d},...g)=>{const p=`notification-${++Ei}`;a.update(y=>y+1);const b=m!=null?typeof m=="number"?we.sleep(m*1e3):m:void 0,k={id:p,animation:h,class:e.Value.toSignal(d.class),loading:e.Value.toSignal(d.loading??!1),showCloseButton:e.Value.toSignal(d.showCloseButton==null&&m==null?!0:d.showCloseButton??!0),showBorder:e.Value.toSignal(d.showBorder??!1),color:e.Value.toSignal(d.color??"primary"),roundedness:e.Value.toSignal(d.roundedness??"md"),title:d.title??e.Empty,icon:e.Value.toSignal(d.icon),children:g,listenRequestClose:y=>(u.push(y),f?.(),()=>{}),delayedClose:b};n.update(y=>[...y,k]),r.forEach(y=>y(k))},c=()=>{u.forEach(m=>m()),u.length=0,n.set([]),a.set(0)},i=er.attach({show:o,clear:c});return{value:{activeNotifications:a,entries:n,removeEntry:s,show:o,clear:c,position:t,listenOnShow:l},dispose:()=>{i(),c()}}}};function tr(){return e.Use(Fa,({listenOnShow:t,position:a})=>e.Portal("body",e.html.div(e.attr.class("bc-notification-viewport"),e.attr.class(`bc-notification-viewport--${a}`),e.WithBrowserCtx(n=>e.OnDispose(t(r=>{const l=[],s=e.html.div(He.AnimatedToggle({animation:r.animation,initialStatus:"start-opening"},({close:u,listenOnClosed:o})=>(r.delayedClose?.finally(u),o(()=>{l.forEach(c=>c())}),Jn({class:r.class,loading:r.loading,showCloseButton:r.showCloseButton,showBorder:r.showBorder,color:r.color,roundedness:r.roundedness,title:r.title,icon:r.icon,onClose:u},...r.children))));l.push(e.renderWithContext(s,n))}))))))}function Li({includeAuthI18n:t=!1,enableAppearance:a=!0,defaultAppearance:n="system",appearancePreferenceKey:r="bui-appearance",includeNotifications:l=!0,notificationPosition:s="bottom-end"},...u){return e.WithProvider(({set:o,use:c})=>{o(Ce.Location,{}),o(C.Locale,{}),o(C.BeatUII18n,{}),o(St.Theme,{defaultAppearance:a?n:"light",appearancePreferenceKey:r}),o(e.ReducedMotion,void 0),l&&o(Fa,{position:s}),Ce.NavigationService.attach(c(Ce.Location));const i=e.Fragment(a?St.ThemeAppearance():e.Empty,Pi(),l?tr():e.Empty,...u);return t?e.Task(()=>Promise.resolve().then(()=>require("./translations-BqWc0ZHz.cjs")).then(m=>m.translations),({AuthI18n:m})=>e.Provide(m,{},()=>i)):i})}function Ai({content:t,toolbar:a=!0,page:n,zoom:r,view:l,pagemode:s,scrollbar:u=!0,navpanes:o=!0,search:c,nameddest:i,viewrect:m,highlight:f,allowfullscreen:h=!1}){const d=e.Value.toSignal(t).mapAsync(async p=>{if(p instanceof Blob){const b=await p.arrayBuffer(),k=new Blob([b],{type:"application/pdf"});return URL.createObjectURL(k)}else{if(p instanceof ArrayBuffer)return URL.createObjectURL(new Blob([p],{type:"application/pdf"}));if(p instanceof Uint8Array)return URL.createObjectURL(new Blob([new Uint8Array(p)],{type:"application/pdf"}));if(typeof p=="string"){const k=await(await fetch(p)).arrayBuffer(),y=new Blob([k],{type:"application/pdf"});return URL.createObjectURL(y)}}},null),g=e.computedOf(d,a,n,r,l,s,u,o,c,i,m,f)((p,b,k,y,_,v,w,I,S,V,D,$)=>{if(p==null)return null;const x=[];b===!1&&x.push("toolbar=0"),k!=null&&k>0&&x.push(`page=${k}`),y!=null&&y>0&&x.push(`zoom=${y}`),_!=null&&x.push(`view=${_}`),v!=null&&x.push(`pagemode=${v}`),w===!1&&x.push("scrollbar=0"),I===!1&&x.push("navpanes=0"),S!=null&&x.push(`search=${encodeURIComponent(S)}`),V!=null&&x.push(`nameddest=${encodeURIComponent(V)}`),D!=null&&x.push(`viewrect=${encodeURIComponent(D)}`),$!=null&&x.push(`highlight=${encodeURIComponent($)}`);const N=x.join("&");return N?`${p}#${N}`:p});return d.on((p,b)=>{b!=null&&URL.revokeObjectURL(b)}),e.Use(C.BeatUII18n,p=>e.html.div(e.OnDispose(()=>{const b=d.value;b!=null&&URL.revokeObjectURL(b)}),e.attr.class("h-full w-full"),e.html.iframe(e.attr.class("h-full w-full"),e.attr.allowfullscreen(h),e.attr.title(p.$.pdfPreview),e.attr.loading("lazy"),e.WithElement(b=>{const k=b;let y=!0;return g.on(_=>{_!=null&&(y?(k.src=_,y=!1):(k.src="about:blank",setTimeout(()=>{k.src=_},50)))}),e.Empty}))))}function Bi({content:t,page:a,zoom:n,pagemode:r,nameddest:l,search:s,textLayerMode:u,sidebarViewOnLoad:o,scrollModeOnLoad:c,spreadModeOnLoad:i,enableScripting:m,enablePrinting:f,viewerUrl:h=null,allowfullscreen:d=!0,class:g=null}){const p=e.Value.toSignal(t).mapAsync(async k=>{if(k instanceof Blob)return URL.createObjectURL(k);if(k instanceof ArrayBuffer)return URL.createObjectURL(new Blob([k],{type:"application/pdf"}));if(k instanceof Uint8Array)return URL.createObjectURL(new Blob([new Uint8Array(k)],{type:"application/pdf"}));if(typeof k=="string")return k},null),b=e.computedOf(p,h,a,n,r,l,s,u,o,c,i,m,f)((k,y,_,v,w,I,S,V,D,$,x,N,H)=>{if(k==null)return null;const T=y??"https://mozilla.github.io/pdf.js/web/viewer.html",W=new URLSearchParams;W.set("file",k);const B=[];_!=null&&_>0&&B.push(`page=${_}`),v!=null&&(typeof v=="string"?B.push(`zoom=${v}`):B.push(`zoom=${v}`)),w!=null&&B.push(`pagemode=${w}`),I!=null&&B.push(`nameddest=${encodeURIComponent(I)}`),S!=null&&B.push(`search=${encodeURIComponent(S)}`),V!=null&&B.push(`textLayer=${V}`),D!=null&&B.push(`sidebar=${D}`),$!=null&&B.push(`scrollMode=${$}`),x!=null&&B.push(`spreadMode=${x}`),N!=null&&B.push(`enableScripting=${N?"1":"0"}`),H!=null&&B.push(`enablePrinting=${H?"1":"0"}`);const X=B.length>0?`#${B.join("&")}`:"";return`${T}?${W.toString()}${X}`});return p.on((k,y)=>{y!=null&&y.startsWith("blob:")&&URL.revokeObjectURL(y)}),e.Use(C.BeatUII18n,k=>e.html.div(e.OnDispose(()=>{const y=p.value;y!=null&&y.startsWith("blob:")&&URL.revokeObjectURL(y)}),e.attr.class("bc-pdfjs-preview h-full w-full"),e.attr.class(g),e.html.iframe(e.attr.class("h-full w-full"),e.attr.allowfullscreen(d),e.attr.title(k.$.pdfPreview),e.attr.loading("lazy"),e.attr.src(b))))}function ar(t){const a=e.prop([]),n=Ce.makeQueryResource({request:t.request,load:t.load,convertError:t.convertError,onSuccess:t.onSuccess,onError:t.onError,onSettled:t.onSettled}),r=e.Value.on(n.value,l=>{l!==void 0&&a.set(l)});return{data:a,loading:n.loading,error:n.error,reload:n.reload,dispose:()=>{r(),n.dispose()}}}function Mi(t){const{request:a,load:n,convertError:r,onSuccess:l,onError:s,onSettled:u,errorContent:o,...c}=t,i=ar({request:a,load:n,convertError:r,onSuccess:l,onError:s,onSettled:u}),m=i.data.map(g=>g.length>0),f=e.computedOf(i.error,m)((g,p)=>g!==void 0&&!p),h=e.When(f,()=>o?o(i.error,i.reload):e.html.div(e.attr.class("bc-query-data-table__error"),e.html.p("Failed to load data."),e.html.button(e.attr.class("bc-query-data-table__retry"),e.on.click(()=>i.reload()),"Retry"))),d=Ln({...c,data:i.data,loading:i.loading});return e.Fragment(e.OnDispose(()=>i.dispose()),h,d)}function We(t){return t!==void 0?e.Value.get(t):void 0}function Ni(t){const a={},n=We(t.style),r=We(t.currency),l=We(t.currencyDisplay),s=We(t.signDisplay),u=We(t.notation),o=We(t.compactDisplay),c=We(t.unit),i=We(t.unitDisplay),m=We(t.useGrouping),f=We(t.minimumIntegerDigits),h=We(t.minimumFractionDigits),d=We(t.maximumFractionDigits),g=We(t.minimumSignificantDigits),p=We(t.maximumSignificantDigits);return n!==void 0&&(a.style=n),r!==void 0&&(a.currency=r),l!==void 0&&(a.currencyDisplay=l),s!==void 0&&(a.signDisplay=s),u!==void 0&&(a.notation=u),o!==void 0&&(a.compactDisplay=o),c!==void 0&&(a.unit=c),i!==void 0&&(a.unitDisplay=i),m!==void 0&&(a.useGrouping=m),f!==void 0&&(a.minimumIntegerDigits=f),h!==void 0&&(a.minimumFractionDigits=h),d!==void 0&&(a.maximumFractionDigits=d),g!==void 0&&(a.minimumSignificantDigits=g),p!==void 0&&(a.maximumSignificantDigits=p),a}function Wi(t,a,n){return new Intl.NumberFormat(a,n).format(t)}function Ui(t){const{value:a,locale:n}=t,r=(l,s)=>{const u=Ni(t);return new Intl.NumberFormat(l,u).format(s)};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-number"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-number"),s)})}function Ke(t){return t!==void 0?e.Value.get(t):void 0}function Ri(t){const a={},n=Ke(t.style),r=Ke(t.currency),l=Ke(t.currencyDisplay),s=Ke(t.signDisplay),u=Ke(t.unit),o=Ke(t.unitDisplay),c=Ke(t.useGrouping),i=Ke(t.minimumIntegerDigits),m=Ke(t.minimumFractionDigits),f=Ke(t.maximumFractionDigits);return n!==void 0&&(a.style=n),r!==void 0&&(a.currency=r),l!==void 0&&(a.currencyDisplay=l),s!==void 0&&(a.signDisplay=s),u!==void 0&&(a.unit=u),o!==void 0&&(a.unitDisplay=o),c!==void 0&&(a.useGrouping=c),i!==void 0&&(a.minimumIntegerDigits=i),m!==void 0&&(a.minimumFractionDigits=m),f!==void 0&&(a.maximumFractionDigits=f),a}function zi(t,a,n){return new Intl.NumberFormat(a,n).format(t)}function Hi(t){const{value:a,locale:n}=t,r=(l,s)=>{const u=Ri(t);return new Intl.NumberFormat(l,u).format(s)};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-bigint"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-bigint"),s)})}function nr(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function rr(t){return t instanceof Date?t:new Date(t)}function at(t){return t!==void 0?e.Value.get(t):void 0}function ji(t){const a={},n=at(t.dateStyle),r=at(t.calendar),l=at(t.numberingSystem),s=at(t.timeZone),u=at(t.weekday),o=at(t.year),c=at(t.month),i=at(t.day),m=at(t.era);return u!==void 0||o!==void 0||c!==void 0||i!==void 0||m!==void 0?(u!==void 0&&(a.weekday=u),o!==void 0&&(a.year=o),c!==void 0&&(a.month=c),i!==void 0&&(a.day=i),m!==void 0&&(a.era=m)):a.dateStyle=n??"medium",r!==void 0&&(a.calendar=r),l!==void 0&&(a.numberingSystem=l),s!==void 0&&(a.timeZone=s),a}function qi(t,a,n){return nr(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(rr(t))}function Gi(t){const{value:a,locale:n}=t,r=(l,s)=>{const u=ji(t);return nr(s)?s.toLocaleString(l,u):new Intl.DateTimeFormat(l,u).format(rr(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-date"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-date"),s)})}function lr(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function or(t){return t instanceof Date?t:new Date(t)}function Ze(t){return t!==void 0?e.Value.get(t):void 0}function Yi(t){const a={},n=Ze(t.timeStyle),r=Ze(t.timeZone),l=Ze(t.hour12),s=Ze(t.hourCycle),u=Ze(t.hour),o=Ze(t.minute),c=Ze(t.second),i=Ze(t.fractionalSecondDigits),m=Ze(t.timeZoneName),f=Ze(t.dayPeriod);return u!==void 0||o!==void 0||c!==void 0||i!==void 0||m!==void 0||f!==void 0?(u!==void 0&&(a.hour=u),o!==void 0&&(a.minute=o),c!==void 0&&(a.second=c),i!==void 0&&(a.fractionalSecondDigits=i),m!==void 0&&(a.timeZoneName=m),f!==void 0&&(a.dayPeriod=f)):a.timeStyle=n??"medium",r!==void 0&&(a.timeZone=r),l!==void 0&&(a.hour12=l),s!==void 0&&(a.hourCycle=s),a}function Ki(t,a,n){return lr(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(or(t))}function Zi(t){const{value:a,locale:n}=t,r=(l,s)=>{const u=Yi(t);return lr(s)?s.toLocaleString(l,u):new Intl.DateTimeFormat(l,u).format(or(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-time"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-time"),s)})}function sr(t){return typeof t=="object"&&t!==null&&!(t instanceof Date)&&"toLocaleString"in t}function ir(t){return t instanceof Date?t:new Date(t)}function ft(t){return t!==void 0?e.Value.get(t):void 0}function Xi(t){const a=ft(t.dateStyle),n=ft(t.timeStyle),r=ft(t.timeZone),l=ft(t.calendar),s=ft(t.hour12),u=ft(t.hourCycle),o={dateStyle:a??"medium",timeStyle:n??"short"};return r!==void 0&&(o.timeZone=r),l!==void 0&&(o.calendar=l),s!==void 0&&(o.hour12=s),u!==void 0&&(o.hourCycle=u),o}function Qi(t,a,n){return sr(t)?t.toLocaleString(a,n):new Intl.DateTimeFormat(a,n).format(ir(t))}function Ji(t){const{value:a,locale:n}=t,r=(l,s)=>{const u=Xi(t);return sr(s)?s.toLocaleString(l,u):new Intl.DateTimeFormat(l,u).format(ir(s))};if(n!==void 0){const l=e.computedOf(n,a)(r);return e.html.span(e.attr.class("bc-format-date-time"),l)}return e.Use(C.Locale,({locale:l})=>{const s=e.computedOf(l,a)(r);return e.html.span(e.attr.class("bc-format-date-time"),s)})}function ec(t,a,n,r){return new Intl.RelativeTimeFormat(n,r).format(t,a)}function tc(t){const{value:a,unit:n,locale:r}=t,l=u=>u!==void 0?e.Value.get(u):void 0,s=(u,o,c)=>{const i={},m=l(t.numeric),f=l(t.style);return m!==void 0&&(i.numeric=m),f!==void 0&&(i.style=f),new Intl.RelativeTimeFormat(u,i).format(o,c)};if(r!==void 0){const u=e.computedOf(r,a,n)(s);return e.html.span(e.attr.class("bc-format-relative-time"),u)}return e.Use(C.Locale,({locale:u})=>{const o=e.computedOf(u,a,n)(s);return e.html.span(e.attr.class("bc-format-relative-time"),o)})}const cr=Intl.ListFormat;function ac(t,a,n){return new cr(a,n).format(t)}function nc(t){const{value:a,locale:n}=t,r=s=>s!==void 0?e.Value.get(s):void 0,l=(s,u)=>{const o={},c=r(t.type),i=r(t.style);return c!==void 0&&(o.type=c),i!==void 0&&(o.style=i),new cr(s,o).format(u)};if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-list"),s)}return e.Use(C.Locale,({locale:s})=>{const u=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-list"),u)})}function rc(t,a,n,r){return new Intl.DisplayNames(n,{type:a,style:r?.style,languageDisplay:a==="language"?r?.languageDisplay:void 0,fallback:r?.fallback}).of(t)??t}function lc(t){const{value:a,locale:n}=t,r=s=>s!==void 0?e.Value.get(s):void 0,l=(s,u)=>{const o=e.Value.get(t.type),c=r(t.style),i=r(t.languageDisplay),m=r(t.fallback);return new Intl.DisplayNames(s,{type:o,style:c,languageDisplay:o==="language"?i:void 0,fallback:m}).of(u)??u};if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-display-name"),s)}return e.Use(C.Locale,({locale:s})=>{const u=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-display-name"),u)})}function ur(t,a,n){return new Intl.PluralRules(a,n).select(t)}function oc(t,a,n,r){const l=ur(t,n,r),s=a[l]??a.other,u=new Intl.NumberFormat(n).format(t);return s.replace(/\{count\}/g,u)}function sc(t){const{value:a,messages:n,locale:r}=t,l=u=>u!==void 0?e.Value.get(u):void 0,s=(u,o)=>{const c={},i=l(t.type),m=l(t.minimumIntegerDigits),f=l(t.minimumFractionDigits),h=l(t.maximumFractionDigits),d=l(t.minimumSignificantDigits),g=l(t.maximumSignificantDigits);i!==void 0&&(c.type=i),m!==void 0&&(c.minimumIntegerDigits=m),f!==void 0&&(c.minimumFractionDigits=f),h!==void 0&&(c.maximumFractionDigits=h),d!==void 0&&(c.minimumSignificantDigits=d),g!==void 0&&(c.maximumSignificantDigits=g);const p=new Intl.PluralRules(u,c).select(o),b=n[p]??n.other,k=new Intl.NumberFormat(u).format(o);return b.replace(/\{count\}/g,k)};if(r!==void 0){const u=e.computedOf(r,a)(s);return e.html.span(e.attr.class("bc-format-plural"),u)}return e.Use(C.Locale,({locale:u})=>{const o=e.computedOf(u,a)(s);return e.html.span(e.attr.class("bc-format-plural"),o)})}function ic(t){const{value:a,locale:n,units:r}=t,l=(s,u)=>C.formatFileSize(u,{locale:s,units:r,decimalPlaces:t.decimalPlaces!==void 0?e.Value.get(t.decimalPlaces):void 0});if(n!==void 0){const s=e.computedOf(n,a)(l);return e.html.span(e.attr.class("bc-format-file-size"),s)}return e.Use(C.Locale,({locale:s})=>{const u=e.computedOf(s,a)(l);return e.html.span(e.attr.class("bc-format-file-size"),u)})}function cc(t,a){const n=["bc-empty-state",`bc-empty-state--size-${t}`];return a&&a.length>0&&n.push(a),n.join(" ")}function uc({icon:t,title:a,description:n,size:r="md",action:l,class:s}){return e.html.div(e.attr.class(e.computedOf(r,s)((u,o)=>cc(u??"md",o))),e.Ensure(t,u=>e.html.div(e.attr.class("bc-empty-state__icon"),C.Icon({icon:u,size:e.Value.map(r,o=>{const c=o??"md";return c==="sm"?"lg":"xl"}),accessibility:"decorative"}))),e.html.h3(e.attr.class("bc-empty-state__title"),a),e.Ensure(n,u=>e.html.p(e.attr.class("bc-empty-state__description"),u)),l!=null?e.html.div(e.attr.class("bc-empty-state__action"),l):e.Empty)}const dc=({id:t,css:a})=>e.Portal("head",e.html.style(e.attr.id(t),e.attr.innerHTML(a)));function Xe(t,a){return a==null?null:e.html.meta(e.attr.name(t),e.attr.content(e.Value.map(a,n=>String(n))))}function Ve(t,a){return a==null?null:e.html.meta(e.attr.property(t),e.attr.content(e.Value.map(a,n=>String(n))))}function Rt(t,a){return a==null?null:e.ForEach(a,n=>Ve(t,n))}function pc(t,a){return a==null?null:e.When(e.Value.map(a,n=>Array.isArray(n)),()=>Rt(t,a),()=>Ve(t,a))}const mc=t=>{const a=[];if(a.push(Ve("og:title",t.title)),a.push(Ve("og:type",t.type)),a.push(Ve("og:url",t.url)),a.push(Ve("og:image",t.image)),a.push(Ve("og:description",t.description)),a.push(Ve("og:site_name",t.siteName)),a.push(Ve("og:locale",t.locale)),t.localeAlternate!=null){const n=Rt("og:locale:alternate",t.localeAlternate);n!=null&&a.push(n)}if(a.push(Ve("og:image:alt",t.imageAlt)),a.push(Ve("og:image:width",t.imageWidth)),a.push(Ve("og:image:height",t.imageHeight)),a.push(Ve("og:image:type",t.imageType)),t.images!=null){const n=Rt("og:image",t.images);n!=null&&a.push(n)}if(a.push(Ve("og:video",t.video)),a.push(Ve("og:video:type",t.videoType)),a.push(Ve("og:video:width",t.videoWidth)),a.push(Ve("og:video:height",t.videoHeight)),a.push(Ve("og:video:secure_url",t.videoSecureUrl)),a.push(Ve("og:audio",t.audio)),a.push(Ve("og:audio:type",t.audioType)),a.push(Ve("og:audio:secure_url",t.audioSecureUrl)),a.push(Ve("article:published_time",t.publishedTime)),a.push(Ve("article:modified_time",t.modifiedTime)),a.push(Ve("article:expiration_time",t.expirationTime)),a.push(pc("article:author",t.author)),a.push(Ve("article:section",t.section)),t.tags!=null){const n=Rt("article:tag",t.tags);n!=null&&a.push(n)}return a.push(Ve("profile:first_name",t.firstName)),a.push(Ve("profile:last_name",t.lastName)),a.push(Ve("profile:username",t.username)),a.push(Ve("profile:gender",t.gender)),a.push(Xe("twitter:card",t.twitterCard)),a.push(Xe("twitter:site",t.twitterSite)),a.push(Xe("twitter:creator",t.twitterCreator)),a.push(Xe("twitter:title",e.coalesce(t.twitterTitle,t.title))),a.push(Xe("twitter:description",e.coalesce(t.twitterDescription,t.description))),a.push(Xe("twitter:image",e.coalesce(t.twitterImage,t.image))),a.push(Xe("twitter:image:alt",e.coalesce(t.twitterImageAlt,t.imageAlt))),t.canonical!=null&&e.Value.get(t.canonical)!=null&&a.push(e.html.link(e.attr.rel("canonical"),e.attr.href(t.canonical))),a.push(Xe("robots",t.robots)),a.push(Xe("keywords",t.keywords)),a.push(Xe("author",t.metaAuthor)),e.Portal("head",a.filter(n=>n!=null).flat())};function hc(t){const{items:a,onMarkAllRead:n,onClose:r}=t,l=e.computedOf(a)(s=>s.filter(u=>!u.read).length);return e.Use(C.BeatUII18n,s=>e.html.div(e.attr.class("bc-notification-panel"),e.html.div(e.attr.class("bc-notification-panel__header"),e.html.div(e.attr.class("bc-notification-panel__header-title"),e.html.span(s.$.notifications),e.When(e.computedOf(l)(u=>u>0),()=>ct({color:"primary",size:"xs",circle:!0},l.map(String)))),e.html.div(e.attr.class("bc-notification-panel__header-actions"),n?e.html.button(e.attr.class("bc-notification-panel__mark-read-btn"),e.attr.type("button"),e.on.click(()=>n()),s.$.markAllAsRead):e.Empty,r?e.html.button(e.attr.class("bc-notification-panel__close-btn"),e.attr.type("button"),e.on.click(()=>r()),C.Icon({icon:"lucide:x",size:"sm"})):e.Empty)),e.html.div(e.attr.class("bc-notification-panel__list"),e.ForEach(a,u=>e.html.div(e.attr.class(u.map(o=>o.read?"bc-notification-panel__item":"bc-notification-panel__item bc-notification-panel__item--unread")),e.on.click(()=>u.value.onClick?.()),e.html.div(e.attr.class("bc-notification-panel__item-icon"),e.attr.style(u.map(o=>o.iconColor?`background: ${o.iconColor}14; color: ${o.iconColor}`:"")),C.Icon({icon:u.$.icon,size:"sm"})),e.html.div(e.attr.class("bc-notification-panel__item-content"),e.html.div(e.attr.class("bc-notification-panel__item-title"),u.$.title),e.html.div(e.attr.class("bc-notification-panel__item-body"),u.$.body),e.html.div(e.attr.class("bc-notification-panel__item-meta"),e.html.span(u.$.time),e.When(u.map(o=>o.source!==void 0),()=>e.html.span(e.attr.class("bc-notification-panel__item-source"),u.map(o=>o.source?.label??""))))),e.When(u.map(o=>!o.read),()=>e.html.span(e.attr.class("bc-notification-panel__item-dot"))))),e.When(e.computedOf(a)(u=>u.length===0),()=>e.html.div(e.attr.class("bc-notification-panel__empty"),C.Icon({icon:"lucide:bell-off",size:"lg"}),e.html.div(s.$.noNotifications))))))}function fc(t){return["bc-breadcrumbs",`bc-breadcrumbs--size-${t}`].join(" ")}function gc(t,a){if(t.length<=a)return t;const n=t[0],r=t.slice(-(a-1));return[n,{isEllipsis:!0},...r]}function bc({items:t,separator:a="›",maxItems:n,size:r="md"}){const l=n!=null?e.computedOf(t,n)((s,u)=>u&&u>0?gc(s,u):s):e.Value.map(t,s=>s);return e.Use(C.BeatUII18n,s=>e.html.nav(e.attr.class(e.Value.map(r,u=>fc(u??"md"))),e.aria.label(s.$.breadcrumbs),e.html.ol(e.attr.class("bc-breadcrumbs__list"),e.ForEach(l,u=>{const o=u.map(i=>"isEllipsis"in i&&i.isEllipsis===!0),c=u.map(i=>!("isEllipsis"in i)&&i.current===!0);return e.When(o,()=>e.html.li(e.attr.class("bc-breadcrumbs__item bc-breadcrumbs__ellipsis"),e.aria.hidden(!0),"..."),()=>{const i=u.map(d=>!("isEllipsis"in d)&&d.href!=null),m=u.map(d=>!("isEllipsis"in d)&&d.href==null&&d.onClick!=null),f=u.map(d=>!("isEllipsis"in d)&&d.icon!=null),h=d=>[e.attr.class(d),e.When(f,()=>C.Icon({icon:u.map(g=>"isEllipsis"in g?"":g.icon??""),size:r,accessibility:"decorative"})),e.html.span(u.map(g=>"isEllipsis"in g?"":g.label))];return e.html.li(e.attr.class(e.Value.map(c,d=>d?"bc-breadcrumbs__item bc-breadcrumbs__item--current":"bc-breadcrumbs__item")),e.When(c,()=>e.aria.current("page")),e.When(i,()=>e.html.a(e.attr.href(u.map(d=>"isEllipsis"in d?"":d.href??"")),...h("bc-breadcrumbs__link")),()=>e.When(m,()=>e.html.button(e.attr.type("button"),e.on.click(()=>{const d=e.Value.get(u);"isEllipsis"in d||d.onClick?.()}),...h("bc-breadcrumbs__button")),()=>e.html.span(...h("bc-breadcrumbs__text")))))})},()=>e.html.li(e.attr.class("bc-breadcrumbs__separator"),e.aria.hidden(!0),a)))))}const La=({viewTransition:t,state:a,scroll:n,replace:r})=>{const l={};return a!==void 0&&(l.state=a),n!==void 0&&(l.scroll=n),r!==void 0&&(l.replace=r),t!==void 0&&(l.viewTransition=t),l};function ha(t,a){const n=["bc-link"];if(a)n.push("bc-link--disabled");else switch(t){case"plain":n.push("bc-link--plain");break;case"hover":n.push("bc-link--hover");break;default:n.push("bc-link--default");break}return n.join(" ")}function fa(t){const a=C.textColorValue(t,"light"),n=C.textColorValue(t,"dark");return[`--link-color: ${a}`,`--link-color-dark: ${n}`,`--link-hover-color: ${a}`,`--link-hover-color-dark: ${n}`].join("; ")}function dr({href:t,variant:a="default",color:n="primary",colorDisabled:r="base",disabled:l=!1,viewTransition:s=!0,state:u,scroll:o,replace:c,target:i,rel:m},...f){return e.When(l,()=>e.html.span(e.attr.class(e.computedOf(a,l)((h,d)=>ha(h,d))),e.attr.style(e.computedOf(r)(h=>fa(h??"base"))),...f),()=>Ce.Anchor({href:t,...La({viewTransition:s,state:u,scroll:o,replace:c})},e.attr.class(e.computedOf(a,l)((h,d)=>ha(h,d))),e.attr.style(e.computedOf(n)(h=>fa(h??"primary"))),i?e.attr.target(i):null,m?e.attr.rel(m):null,...f))}const vc=t=>t?t.startsWith("#")?t:`#${t}`:"",yc=t=>{if(!t)return new URLSearchParams;if(typeof t=="string"){const a=t.startsWith("?")?t.slice(1):t;return new URLSearchParams(a)}return t instanceof URLSearchParams?new URLSearchParams(t):new URLSearchParams(t)};function pr(t,a,n){const r=yc(t.search),l=r.toString(),s=l?`?${l}`:"",u=vc(t.hash);switch(n){case"exact":return t.pathname+s+u===a;case"prefix":return t.pathname.startsWith(a)||(t.pathname+s).startsWith(a);case"params":try{const o=typeof document<"u"&&document.baseURI?document.baseURI:"http://localhost/",c=new URL(a,o);if(t.pathname!==c.pathname)return!1;const i=Array.from(new URLSearchParams(c.search).entries()).sort(),m=Array.from(r.entries()).sort();return i.length!==m.length?!1:i.every(([f,h],d)=>{const[g,p]=m[d];return f===g&&h===p})}catch{return t.pathname===a}default:return!1}}function Yt(t,a){return a==="exact"?e.computedOf(t)(n=>n):e.computedOf(t)(n=>r=>pr(r,n,a))}function kc({href:t,matchMode:a="exact",disableWhenActive:n=!0,...r},...l){return e.Use(Ce.Location,s=>{const u=s.matchSignal(Yt(t,a)),o=e.computedOf(u,n)((c,i)=>i??!0?c:!1);return dr({...r,href:t,disabled:o},...l)})}function _c({href:t,viewTransition:a=!0,state:n,scroll:r,replace:l,target:s,rel:u,matchMode:o,disableWhenActive:c,variant:i="filled",size:m="md",color:f="base",roundedness:h="sm",disabled:d=!1},...g){return o!==void 0||c!==void 0?e.Use(Ce.Location,p=>{const b=o!==void 0?p.matchSignal(Yt(t,o)):e.computedOf(p.location)(()=>!1),k=e.computedOf(b,c)((_,v)=>!(v??!0)||!o?!1:_),y=e.computedOf(d,k)((_,v)=>_||v);return Ja({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:u,variant:i,size:m,color:f,roundedness:h,disabled:y},...g)}):Ja({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:u,variant:i,size:m,color:f,roundedness:h,disabled:d},...g)}function Ja({href:t,viewTransition:a,state:n,scroll:r,replace:l,target:s,rel:u,variant:o="default",size:c="md",color:i="base",roundedness:m="sm",disabled:f=!1,fullWidth:h=!1,loading:d=!1},...g){return e.When(f??!1,()=>e.html.span(e.attr.class(e.computedOf(c,m,d,h)(ne.generateButtonClasses)),e.attr.style(e.computedOf(o,i,f)((p,b,k)=>ne.generateButtonStyles(p??"filled",b??"base",k))),...g),()=>Ce.Anchor({href:t,...La({viewTransition:a,state:n,scroll:r,replace:l})},e.attr.class(e.computedOf(c,m,d,h)(ne.generateButtonClasses)),e.attr.style(e.computedOf(o,i,f)((p,b,k)=>ne.generateButtonStyles(p??"filled",b??"base",k))),s?e.attr.target(s):null,u?e.attr.rel(u):null,...g))}const mr={mark:e.makeProviderMark("SidebarContext"),create:t=>({value:{backgroundMode:"light"},dispose:()=>{}})};function wc({backgroundMode:t="light"},...a){return e.Provide(mr,e.Value.map(t,n=>({backgroundMode:n})),()=>e.html.div(e.attr.class("bc-sidebar"),e.attr.class(e.Value.map(t,n=>n==="dark"?"bc-sidebar--dark-bg":"")),...a))}function ga({rail:t,header:a},...n){return et.Stack(a!=null?e.html.div(e.attr.class("bc-sidebar-group__header"),a):null,e.html.div(e.attr.class(e.Value.map(t??!1,r=>r?"bc-sidebar-group--rail":"")),e.attr.class("bc-sidebar-group"),...n))}function hr(t,...a){const n=La({viewTransition:t.viewTransition??!0,state:t.state,scroll:t.scroll,replace:t.replace});return Ce.Anchor({href:t.href,...n},...a)}function fr(...t){return e.html.span(...t)}function gr(t,...a){return e.html.button(e.attr.type("button"),e.on.click(t.onClick),t.ariaExpanded!=null?e.aria.expanded(e.Value.map(t.ariaExpanded,n=>n)):null,t.ariaControls!=null?e.aria.controls(t.ariaControls):null,t.ariaLabel!=null?e.aria.label(t.ariaLabel):null,...a)}function br(t){const a=[e.attr.class("bc-sidebar-link")];return t.icon!=null&&a.push(e.html.span(e.attr.class("bc-sidebar-link--icon"),C.Icon({icon:t.icon}))),a.push(e.html.span(e.attr.class("bc-sidebar-link__content"),t.content)),t.after!=null&&a.push(e.html.span(e.attr.class("bc-sidebar-link__right"),t.after)),t.action!=null&&a.push(e.html.button(e.attr.type("button"),e.attr.class("bc-sidebar-link--action"),e.on.click((n,r)=>{t.action?.onClick?.(r)}),C.Icon({icon:t.action?.icon}))),"onClick"in t?gr(t,...a):e.Use(Ce.Location,n=>{const r=n.matchSignal(Yt(t.href,"exact"),{includeSearch:!1,includeHash:!1});return e.When(r,()=>fr(...a),()=>hr(t,...a))})}function Cc({rail:t=!0,icon:a,header:n,startOpen:r=!0},...l){const s=e.Value.deriveProp(r),u=Pe.sessionId("sidebar-group"),o=`${u}-content`;return ga({},e.attr.class("bc-sidebar-group-collapsible"),e.attr.class(s.map(c=>c?"bc-sidebar-group-collapsible--open":"bc-sidebar-group-collapsible--closed")),e.attr.role("group"),e.attr.id(u),br({icon:a,onClick:()=>s.update(c=>!c),ariaExpanded:s,ariaControls:o,after:e.html.span(e.attr.class("bc-sidebar-group-collapsible-indicator"),C.Icon({icon:"lucide:chevron-down",color:"base",size:"xs"})),content:n}),ga({rail:t},e.attr.id(o),Tt({open:s},...l)))}function Sc(){return e.html.hr(e.attr.class("bc-sidebar-separator"))}function Vc(t,a,n,r){const l=["bc-tabs",`bc-tabs--${t}`,`bc-tabs--${a}`];return n&&l.push("bc-tabs--disabled"),r!=null&&r!=="default"&&l.push(`bc-tabs--variant-${r}`),l.join(" ")}function Ic(t,a){const n=new Map,r=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-600)":fe.getColorVar(a,600),l=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-400)":fe.getColorVar(a,400),s=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-500)":fe.getColorVar(a,500),u=a==="white"||a==="black"||a==="transparent"?"var(--color-primary-400)":fe.getColorVar(a,400);if(n.set("--tabs-active-color",r),n.set("--tabs-active-color-dark",l),n.set("--tabs-indicator-color",s),n.set("--tabs-indicator-color-dark",u),t==="filled"){const o=C.backgroundValue(a,"solid","light"),c=C.backgroundValue(a,"solid","dark");n.set("--tabs-filled-inactive-bg",o.backgroundColor),n.set("--tabs-filled-inactive-text","var(--color-white)");const i=C.hoverBackgroundValue(a,"solid","light");n.set("--tabs-filled-inactive-bg-hover",i.backgroundColor);const m=C.hoverBackgroundValue(a,"solid","dark");n.set("--tabs-filled-inactive-bg-dark-hover",m.backgroundColor),n.set("--tabs-filled-inactive-bg-dark",c.backgroundColor),n.set("--tabs-filled-inactive-text-dark",c.textColor),n.set("--tabs-filled-active-bg","var(--color-white)"),n.set("--tabs-filled-active-text","var(--color-base-800)"),n.set("--tabs-filled-active-bg-dark","var(--color-base-900)"),n.set("--tabs-filled-active-text-dark",l)}return t==="outline"&&(n.set("--tabs-outline-active-border",u),n.set("--tabs-outline-active-border-dark",fe.getColorVar(a==="white"||a==="black"||a==="transparent"?"primary":a,600))),Array.from(n.entries()).map(([o,c])=>`${o}: ${c}`).join("; ")}function $c(t,a,n){const r=["bc-tab",`bc-tab--${t}`];return a&&r.push("bc-tab--active"),n&&r.push("bc-tab--disabled"),r.join(" ")}function Nt(t,a,n){const r=a.length;let l=t+n;l>=r?l=0:l<0&&(l=r-1);let s=0;for(;s<r;){const u=a[l];if(!e.Value.get(u.disabled??!1))return l;l+=n,l>=r?l=0:l<0&&(l=r-1),s++}return t}function xc(t){const{items:a,value:n,onChange:r,size:l="md",variant:s="default",color:u="primary",disabled:o=!1,orientation:c="horizontal",showContent:i=!0,ariaLabel:m}=t,f=Pe.sessionId("tablist"),h=e.prop(-1),d=a.map((p,b)=>{const k=e.computedOf(n)(w=>w===p.key),y=e.computedOf(o,p.disabled)((w,I)=>w||I),_=`${f}-tab-${p.key}`,v=`${f}-panel-${p.key}`;return{item:p,index:b,isActive:k,isTabDisabled:y,tabId:_,panelId:v}}),g=p=>{if(e.Value.get(o))return;const k=h.value,y=e.Value.get(c)==="horizontal";let _=k;switch(p.key){case(y?"ArrowRight":"ArrowDown"):p.preventDefault(),_=Nt(k,a,1);break;case(y?"ArrowLeft":"ArrowUp"):p.preventDefault(),_=Nt(k,a,-1);break;case"Home":p.preventDefault(),_=Nt(-1,a,1);break;case"End":p.preventDefault(),_=Nt(a.length,a,-1);break;case"Enter":case" ":if(p.preventDefault(),k>=0&&k<a.length){const v=a[k];e.Value.get(v.disabled??!1)||r?.(v.key)}break}_!==k&&_>=0&&_<a.length&&(h.set(_),setTimeout(()=>{const v=document.querySelector(`[data-tab-index="${_}"]`);v&&v.focus()},0))};return e.html.div(e.attr.class(e.computedOf(l,c,o,s)((p,b,k,y)=>Vc(p??"md",b??"horizontal",k??!1,y??"default"))),e.attr.style(e.computedOf(s,u)((p,b)=>Ic(p??"default",b??"primary"))),e.html.div(e.attr.class("bc-tabs__list"),e.attr.role("tablist"),e.attr.id(f),e.aria.orientation(c??"horizontal"),e.aria.label(m),e.on.keydown(g),...d.map(({item:p,index:b,isActive:k,isTabDisabled:y,tabId:_,panelId:v})=>e.html.button(e.attr.type("button"),e.attr.class(e.computedOf(l,k,y)((w,I,S)=>$c(w??"md",I??!1,S??!1))),e.attr.id(_),e.attr.role("tab"),e.attr.tabindex(e.computedOf(k,h)((w,I)=>w||I===b?0:-1)),e.aria.selected(k),e.aria.controls(v),e.aria.disabled(y),e.attr.disabled(y),e.dataAttr("tab-index",String(b)),e.aria.label(p.ariaLabel),e.on.click(w=>{w.preventDefault(),e.Value.get(p.disabled??!1)||e.Value.get(o)||(r?.(p.key),h.set(b))}),e.on.focus(()=>{h.set(b)}),p.label))),e.When(i??!0,()=>e.html.div(e.attr.class("bc-tabs__panels"),...d.map(({item:p,isActive:b,tabId:k,panelId:y})=>e.When(b,()=>e.html.div(e.attr.class("bc-tabs__panel"),e.attr.id(y),e.attr.role("tabpanel"),e.attr.tabindex(0),e.aria.labelledby(k),p.content()))))))}function Dc(t){return t<20?10:t<50?3:t<80?2:t<99?.5:0}function Oc(t){const a=C.backgroundValue(t,"solid","light"),n=C.backgroundValue(t,"solid","dark");return`--nav-progress-fill: ${a.backgroundColor}; --nav-progress-fill-dark: ${n.backgroundColor}`}function Tc(t={}){const{color:a="primary",height:n=3,position:r="top",showSpinner:l=!1,trickleSpeed:s=200,minimumDuration:u=300,animationSpeed:o=200}=t,c=e.prop(0),i=e.prop(!1),m=e.prop(!1);let f=null,h=null,d=0;function g(){f!=null&&(clearInterval(f),f=null)}function p(){h!=null&&(clearTimeout(h),h=null)}function b(){g(),f=setInterval(()=>{const H=c.value,T=Dc(H);T>0&&c.set(Math.min(H+Math.random()*T,99.5))},e.Value.get(s))}function k(){p(),c.set(0),i.set(!0),m.set(!0),d=Date.now(),requestAnimationFrame(()=>{c.set(Math.random()*5+2),b()})}function y(H){const T=Math.max(0,Math.min(100,H));c.set(T),!i.value&&T<100&&(i.set(!0),m.set(!0))}function _(){g(),c.set(100);const H=e.Value.get(o);h=setTimeout(()=>{i.set(!1),h=setTimeout(()=>{m.set(!1),c.set(0)},H)},H)}function v(){p();const H=Date.now()-d,W=e.Value.get(u)-H;W>0?h=setTimeout(_,W):_()}function w(){g(),p(),i.set(!1),m.set(!1),c.set(0)}const I={start:k,set:y,done:v,reset:w,isActive:i},S=e.Value.map(r,H=>`bc-navigation-progress bc-navigation-progress--${H??"top"}`),V=e.Value.map(a,H=>Oc(H??"primary")),D=e.Value.map(n,H=>`${H??3}px`),$=e.Value.map(c,H=>`translateX(${-100+H}%)`),x=e.Value.map(o,H=>`transform ${H??200}ms var(--motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))`);return[e.When(m,()=>e.Portal("body",e.Fragment(e.html.div(e.attr.class(S),e.attr.style(V),e.style.height(D),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(100),e.aria.valuenow(c),e.html.div(e.attr.class(e.Value.map(i,H=>`bc-navigation-progress__bar${H?"":" bc-navigation-progress__bar--done"}`)),e.style.transform($),e.style.transition(x),e.html.div(e.attr.class("bc-navigation-progress__peg")))),e.When(l,()=>e.html.div(e.attr.class(e.Value.map(S,H=>`bc-navigation-progress__spinner${H.includes("--bottom")?" bc-navigation-progress__spinner--bottom":""}`)),e.attr.style(V),e.html.div(e.attr.class("bc-navigation-progress__spinner-icon"))),()=>{}),e.OnDispose(()=>{g(),p()})))),I]}function vr(t,a,n,r,l,s,u){const o=t.map(d=>d.children!=null&&d.children.length>0),c=e.computedOf(r,t)((d,g)=>d.has(g.id)),i=e.computedOf(n,t)((d,g)=>d===g.id),m=t.map(d=>d.children??[]),f=()=>{l?.(e.Value.get(t).id)},h=d=>{d.stopPropagation(),s(e.Value.get(t).id)};return e.html.div(e.attr.class("bc-tree-item"),e.html.div(e.attr.class(e.computedOf(i,u)((d,g)=>["bc-tree-item__row",`bc-tree-item__row--size-${g??"md"}`,d?"bc-tree-item__row--selected":""].filter(Boolean).join(" "))),e.attr.style(`padding-left: ${a*20+8}px`),e.attr.role("treeitem"),e.attr.tabindex(0),e.aria.selected(i),e.WithElement(d=>{const g=e.computedOf(o,c)((p,b)=>p?String(b):null);e.Value.on(g,p=>{p!=null?d.setAttribute("aria-expanded",p):d.removeAttribute("aria-expanded")})}),e.on.click(f),e.When(o,()=>e.html.span(e.attr.class(e.Value.map(c,d=>["bc-tree-item__toggle",d?"bc-tree-item__toggle--expanded":""].filter(Boolean).join(" "))),e.on.click(h),C.Icon({icon:"mdi:chevron-right",size:"sm",accessibility:"decorative"})),()=>e.html.span(e.attr.class("bc-tree-item__toggle-spacer"))),e.When(t.map(d=>d.icon!=null),()=>e.html.span(e.attr.class("bc-tree-item__icon"),C.Icon({icon:t.map(d=>d.icon??""),size:"sm",accessibility:"decorative"})),()=>e.Empty),e.html.span(e.attr.class("bc-tree-item__label"),t.map(d=>d.label)),e.When(t.map(d=>d.badge!=null),()=>e.html.span(e.attr.class("bc-tree-item__badge"),t.map(d=>d.badge??"")),()=>e.Empty)),e.When(o,()=>e.html.div(Tt({open:c},e.html.div(e.attr.class("bc-tree-item__children"),e.attr.role("group"),e.ForEach(m,d=>vr(d,a+1,n,r,l,s,u))))),()=>e.Empty))}function Pc({items:t,selectedId:a,onSelect:n,expandedIds:r,onToggle:l,size:s="md"},...u){const o=e.prop(new Set),c=r??o,i=a??e.prop(void 0),m=f=>{const h=e.Value.get(c),d=!h.has(f);if(r==null){const g=new Set(h);d?g.add(f):g.delete(f),o.set(g)}l?.(f,d)};return e.html.div(e.attr.class(e.Value.map(s,f=>`bc-tree-view bc-tree-view--size-${f??"md"}`)),e.attr.role("tree"),e.ForEach(t,f=>vr(f,0,i,c,n,m,s)),...u)}function Ec(t,a,n,r){const l=["bc-stepper",`bc-stepper--${t}`,`bc-stepper--size-${n}`];return a!=="default"&&l.push(`bc-stepper--${a}`),r&&l.push("bc-stepper--disabled"),l.join(" ")}function yr(t){const{steps:a,value:n=0,onChange:r,orientation:l="horizontal",variant:s="default",size:u="md",color:o="primary",disabled:c=!1,showNavigation:i=!0}=t,m=e.prop(e.Value.get(n)),f=e.Value.on(n,S=>m.set(S)),h=e.prop(new Set),d=S=>{m.set(S),r?.(S)},g=async(S,V)=>{for(let D=S;D<V;D++){const $=a[D].beforeNext;if($&&!await $())return!1}return!0},p=async S=>{if(S<0||S>=a.length||e.Value.get(c))return!1;const V=m.value;return S===V?!0:S<V||await g(V,S)?(d(S),!0):!1},b=async()=>{if(e.Value.get(c))return!1;const S=m.value;if(S>=a.length-1)return!1;const V=a[S];return V.beforeNext&&!await V.beforeNext()?!1:(d(S+1),!0)},k=()=>{const S=m.value;S>0&&d(S-1)},y=async()=>{if(e.Value.get(c))return!1;const S=m.value;return await g(S,a.length)?(d(a.length),!0):!1},w={goTo:p,next:b,prev:k,complete:y,currentStep:m,setError:S=>{const V=new Set(h.value);V.add(S),h.set(V)},clearError:S=>{const V=new Set(h.value);V.delete(S),h.set(V)}};return[e.Use(C.BeatUII18n,S=>{const V=(D,$,x)=>x.has(D)?"error":D<$?"completed":D===$?"active":"pending";return e.html.div(e.OnDispose(f),e.attr.class(e.computedOf(l,s,u,c)(Ec)),e.attr.style(e.Value.map(o,D=>`--stepper-color: var(--color-${D}-500); --stepper-color-dark: var(--color-${D}-400)`)),e.attr.role("group"),e.aria.label(e.computedOf(S.$.stepper.$.step)(D=>`${D} progress`)),e.html.div(e.attr.class("bc-stepper__indicators"),...a.map((D,$)=>{const x=e.computedOf(m,h)((T,W)=>V($,T,W)),N=e.Value.map(x,T=>`bc-stepper__step bc-stepper__step--${T}`),H=D.icon?C.Icon({icon:D.icon,size:"xs"}):e.When(e.Value.map(x,T=>T==="completed"),()=>C.Icon({icon:"lucide:check",size:"xs"}),()=>e.When(e.Value.map(x,T=>T==="error"),()=>C.Icon({icon:"lucide:alert-triangle",size:"xs"}),()=>e.html.span(String($+1))));return[...$>0?[e.html.div(e.attr.class(e.computedOf(m,h)((T,W)=>V($-1,T,W)==="completed"?"bc-stepper__connector bc-stepper__connector--completed":"bc-stepper__connector")))]:[],e.html.div(e.attr.class(N),e.on.click(()=>{e.Value.get(c)||p($)}),e.attr.role("button"),e.attr.tabindex(0),e.aria.label(e.computedOf(S.$.stepper.$.stepOfTotal)(T=>`${D.label} - ${T($+1,a.length)}`)),e.on.keydown(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),e.Value.get(c)||p($))}),e.html.div(e.attr.class("bc-stepper__circle"),H),e.html.div(e.attr.class("bc-stepper__label"),e.html.span(e.attr.class("bc-stepper__label-text"),D.label),D.description?e.html.span(e.attr.class("bc-stepper__label-description"),D.description):null))]}).flat()),e.html.div(e.attr.class("bc-stepper__content"),...a.map((D,$)=>D.content?e.When(e.Value.map(m,x=>x===$),D.content,()=>null):null)),e.When(i,()=>e.html.div(e.attr.class("bc-stepper__navigation"),e.When(e.Value.map(m,D=>D>0),()=>ne.Button({variant:"outline",size:u,color:o,disabled:c,onClick:k},S.$.stepper.$.previous),()=>null),e.html.span(e.attr.class("bc-stepper__spacer")),e.When(e.Value.map(m,D=>D<a.length-1),()=>ne.Button({variant:"filled",size:u,color:o,disabled:c,onClick:()=>{b()}},S.$.stepper.$.next),()=>ne.Button({variant:"filled",size:u,color:o,disabled:c,onClick:()=>{y()}},S.$.stepper.$.complete))),()=>null))}),w]}function Fc(t){const[a]=yr(t);return a}function Lc(t){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\//i.test(t)}let Wt=null;function Ac(){return typeof window<"u"&&window.YT?.Player?Promise.resolve(window.YT):Wt||(Wt=new Promise(t=>{const a=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{a?.(),t(window.YT)};const n=document.createElement("script");n.src="https://www.youtube.com/iframe_api",n.async=!0,document.head.appendChild(n)}),Wt)}function Bc(t){const{url:a,playing:n=!1,loop:r=!1,controls:l=!1,volume:s=1,muted:u=!1,playbackRate:o=1,pip:c=!1,playsinline:i=!0,width:m,height:f,progressInterval:h=1e3,seekTo:d,config:g,onReady:p,onStart:b,onPlay:k,onPause:y,onBuffer:_,onBufferEnd:v,onEnded:w,onError:I,onDuration:S,onSeek:V,onProgress:D,onPlaybackRateChange:$,onPlaybackQualityChange:x}=t;function N(j){return/\.m3u8(\?|$)/i.test(j)}function H(j){try{const A=j.canPlayType("application/vnd.apple.mpegurl");return A==="probably"||A==="maybe"}catch{return!1}}const T=e.prop("file");let W=null,B=null,X=null;function P(){try{X?.destroy()}catch{}X=null}const U=[];async function R(){const j=W;if(!j)return;const A=e.Value.get(a);if(typeof A!="string"||A.length===0)return;P();const te=g?.file?.forceHLS??!1;if(N(A)||te){if(H(j)){j.setAttribute("src",A);try{j.load()}catch{}return}if(typeof window>"u")return;try{const de=await import("hls.js/dist/hls.light.min.js"),ee=de;let Se=ee.default??ee.Hls??de;for(let xe=0;xe<3&&(typeof Se=="object"&&Se!=null&&"default"in Se);xe++)Se=Se.default;if(typeof Se=="function"){const xe=Se;if(typeof xe.isSupported=="function"&&xe.isSupported()){j.removeAttribute("src");try{j.load()}catch{}const Le=new xe(g?.hls);X=Le,Le.attachMedia(j),Le.loadSource(A)}else{j.setAttribute("src",A);try{j.load()}catch{}}}else{j.setAttribute("src",A);try{j.load()}catch{}}}catch(de){I?.(de),j.setAttribute("src",A);try{j.load()}catch{}}return}j.setAttribute("src",A);try{j.load()}catch{}}function Q(){B?.();const j=e.Value.get(h)??1e3;B=we.interval(()=>{const A=W;if(!A)return;const te=A.duration||0,de=A.currentTime||0,ee=A.buffered?.length?A.buffered.end(A.buffered.length-1):0;D?.({played:te>0?de/te:0,playedSeconds:de,loaded:te>0?Math.min(ee,te)/te:0,loadedSeconds:Math.min(ee,te)})},j)}function F(j){if(j!=null)return typeof j=="number"?`${j}px`:j}const O=e.html.video(e.WithElement(j=>{W=j,p?.();try{W.playbackRate=e.Value.get(o)??1}catch{}W.muted=!!(e.Value.get(u)??!1),W.loop=!!(e.Value.get(r)??!1),W.controls=!!(e.Value.get(l)??!1),W.playsInline!=null&&(!!(e.Value.get(i)??!0)?W.setAttribute("playsinline",""):W.removeAttribute("playsinline"));try{const A=!!(e.Value.get(c)??!1),te=document,de=W;A?typeof de.requestPictureInPicture=="function"&&te.pictureInPictureElement!==W&&de.requestPictureInPicture().catch(()=>{}):te.pictureInPictureElement===W&&typeof te.exitPictureInPicture=="function"&&te.exitPictureInPicture().catch(()=>{})}catch{}Q(),R()}),e.style.width(e.Value.map(m,F)),e.style.height(e.Value.map(f,F)),e.on.play(()=>k?.()),e.on.playing(()=>{b?.(),v?.()}),e.on.pause(()=>y?.()),e.on.waiting(()=>_?.()),e.on.canplay(()=>{const j=W?.duration;j!=null&&Number.isFinite(j)&&S?.(j),e.Value.get(n)&&W&&W.paused&&W.play?.().catch(()=>{})}),e.on.ended(()=>w?.()),e.on.error(j=>{X||I?.(j)}));let z=null,Z=null,ie=null;function ve(){const j=e.Value.get(a);!z||typeof j!="string"||Ac().then(A=>{const te=kr(j);if(te){if(Z){Z.loadVideoById({videoId:te});return}Z=new A.Player(z,{videoId:te,playerVars:Mc(t),events:{onReady:()=>{p?.(),se(),e.Value.get(n)&&b?.(),J()},onStateChange:de=>{switch(de.data){case A.PlayerState.PLAYING:k?.(),v?.();break;case A.PlayerState.PAUSED:y?.();break;case A.PlayerState.BUFFERING:_?.();break;case A.PlayerState.ENDED:w?.();break}},onError:de=>I?.(de),onPlaybackRateChange:de=>$?.(de.data),onPlaybackQualityChange:de=>x?.(de.data)}})}})}function J(){ie?.();const j=e.Value.get(h)??1e3;ie=we.interval(()=>{if(!Z)return;const A=Z.getDuration?.()??0,te=Z.getCurrentTime?.()??0,de=Z.getVideoLoadedFraction?.()??0;D?.({played:A>0?te/A:0,playedSeconds:te,loaded:de,loadedSeconds:de*A})},j)}function se(){if(!Z)return;try{const te=e.Value.get(o)??1;Z.setPlaybackRate?.(te)}catch{}try{const te=Math.round(Math.min(Math.max(e.Value.get(s)??1,0),1)*100);Z.setVolume?.(te)}catch{}try{e.Value.get(u)??!1?Z.mute?.():Z.unMute?.()}catch{}e.Value.get(n)??!1?Z.playVideo?.():Z.pauseVideo?.();const A=e.Value.get(d);typeof A=="number"&&Number.isFinite(A)&&(Z.seekTo?.(A,!0),V?.(A))}const le=e.html.div(e.WithElement(j=>{z=j,T.value==="youtube"&&ve()}));U.push(e.Value.on(a,j=>{const A=typeof j=="string"&&j.length>0&&Lc(j),te=A?"youtube":"file";T.set(te),A?ve():W&&R()})),U.push(e.Value.on(n,()=>{T.value==="file"&&W?e.Value.get(n)?W.play?.().catch(()=>{}):W.pause?.():T.value==="youtube"&&Z&&(e.Value.get(n)?Z.playVideo?.():Z.pauseVideo?.())})),U.push(e.Value.on(s,()=>{if(T.value==="file"&&W)W.volume=Math.min(Math.max(e.Value.get(s)??1,0),1);else if(T.value==="youtube"&&Z){const j=Math.round(Math.min(Math.max(e.Value.get(s)??1,0),1)*100);Z.setVolume?.(j)}})),U.push(e.Value.on(u,()=>{T.value==="file"&&W?W.muted=!!e.Value.get(u):T.value==="youtube"&&Z&&(e.Value.get(u)?Z.mute?.():Z.unMute?.())})),U.push(e.Value.on(o,()=>{if(T.value==="file"&&W)try{W.playbackRate=e.Value.get(o)??1}catch{}else T.value==="youtube"&&Z&&Z.setPlaybackRate?.(e.Value.get(o)??1)})),U.push(e.Value.on(c,async()=>{if(!(T.value!=="file"||!W))try{const j=!!(e.Value.get(c)??!1),A=document,te=W;j?typeof te.requestPictureInPicture=="function"&&A.pictureInPictureElement!==W&&await te.requestPictureInPicture()?.catch(()=>{}):A.pictureInPictureElement===W&&typeof A.exitPictureInPicture=="function"&&await A.exitPictureInPicture()?.catch(()=>{})}catch{}})),U.push(e.Value.on(l,()=>{T.value==="file"&&W&&(W.controls=!!e.Value.get(l))})),U.push(e.Value.on(r,()=>{T.value==="file"&&W&&(W.loop=!!e.Value.get(r))})),U.push(e.Value.on(i,()=>{T.value==="file"&&W&&(!!e.Value.get(i)?W.setAttribute("playsinline",""):W.removeAttribute("playsinline"))})),U.push(e.Value.on(d??null,()=>{const j=e.Value.get(d);if(j!=null)if(T.value==="file"&&W)try{W.currentTime=j,V?.(j)}catch{}else T.value==="youtube"&&Z&&(Z.seekTo?.(j,!0),V?.(j))})),U.push(()=>{B?.(),ie?.(),P();try{Z?.destroy()}catch{}});const ye=e.Value.map(T,j=>j==="file"),_e=e.Value.map(T,j=>j==="youtube"),ke=e.html.div(e.attr.class("bc-base-video"),e.style.width(e.Value.map(m,F)),e.style.height(e.Value.map(f,F)),e.html.div(e.style.display(e.Value.map(ye,j=>j?"block":"none")),O),e.html.div(e.style.display(e.Value.map(_e,j=>j?"block":"none")),le));return e.Fragment(e.OnDispose(...U),ke)}function kr(t){const a=/[?&]v=([^&#]+)/.exec(t);if(a)return a[1];const n=/youtu\.be\/([^?&#]+)/.exec(t);if(n)return n[1];const r=/youtube\.com\/embed\/([^?&#]+)/.exec(t);return r?r[1]:null}function Mc(t){const a={autoplay:e.Value.get(t.playing)??!1?1:0,controls:e.Value.get(t.controls)??!1?1:0,rel:0,playsinline:e.Value.get(t.playsinline)??!0?1:0,modestbranding:1},n=e.Value.get(t.loop)??!1,r=e.Value.get(t.url),l=typeof r=="string"?kr(r):null;return n&&l&&(a.loop=1,a.playlist=l),a}function _r(t,...a){const n=a.length;if(n===0){const A={goTo:()=>{},next:()=>{},prev:()=>{},play:()=>{},pause:()=>{},isPlaying:e.prop(!1),currentIndex:e.prop(0),totalSlides:0};return[e.Empty,A]}const r=e.prop(e.Value.get(t.currentIndex??0)),l=e.Value.toSignal(t.autoPlay??!1),s=e.Value.toSignal(t.interval??3e3),u=e.Value.toSignal(t.loop??!1),o=e.Value.toSignal(t.slidesPerView??1),c=e.Value.toSignal(t.transition??"slide"),i=e.Value.toSignal(t.transitionDuration??300),m=e.Value.toSignal(t.showArrows??!0),f=e.Value.toSignal(t.pauseOnHover??!0),h=e.Value.toSignal(t.keyboard??!0),d=e.Value.toSignal(t.gap??"0px"),g=e.Value.toSignal(t.peekAmount??"0px"),p=e.Value.toSignal(t.align??"start"),b=e.Value.toSignal(t.easing??"cubic-bezier(0.2, 0, 0, 1)"),k=e.Value.toSignal(t.dragThreshold??50),y=e.Value.toSignal(t.indicator??"dots"),_=e.prop(!1),v=e.prop(e.Value.get(l));l.on(A=>v.set(A));const w=e.prop(Math.max(0,n-e.Value.get(o)));o.on(A=>{w.set(Math.max(0,n-A))});const I=e.computedOf(r,u)((A,te)=>!te&&A===0),S=e.computedOf(r,u,w)((A,te,de)=>!te&&A>=de);function V(A){const te=w.value;return te===0?0:e.Value.get(u)?(A%n+n)%n:Math.max(0,Math.min(A,te))}function D(A){const te=V(A);te!==r.value&&(r.set(te),t.onSlideChange?.(te))}function $(){const A=r.value+1;(e.Value.get(u)||A<=w.value)&&D(A)}function x(){const A=r.value-1;(e.Value.get(u)||A>=0)&&D(A)}function N(){v.set(!0),t.onAutoPlayToggle?.(!0)}function H(){v.set(!1),t.onAutoPlayToggle?.(!1)}let T=null;function W(){B(),T=setInterval(()=>{_.value&&e.Value.get(f)||$()},e.Value.get(s))}function B(){T!=null&&(clearInterval(T),T=null)}v.on(A=>{A?W():B()}),s.on(()=>{v.value&&W()});let X=0,P=0,U=0;const R=50;let Q=!1,F=0,O=0,z=!1;const Z=e.prop("0%");function ie(A){if(e.Value.get(c)==="fade")return"0%";const te=e.Value.get(o),de=e.Value.get(d),ee=-(A*(100/te));return de==="0px"||de==="0"?`${ee}%`:`calc(${ee}% - ${A} * ${de})`}r.on(A=>{Z.set(ie(A))}),c.on(()=>{Z.set(ie(r.value))}),Z.set(ie(e.Value.get(r)));const ve=t.prevIcon??"lucide:chevron-left",J=t.nextIcon??"lucide:chevron-right",se=t.arrowIconSize??"md",le=e.computedOf(o,d)((A,te)=>te==="0px"||te==="0"?`${100/A}%`:`calc((100% - ${A-1} * ${te}) / ${A})`),ye=c.map(A=>A==="fade"),_e=p.map(A=>{switch(A){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}}),ke={goTo:D,next:$,prev:x,play:N,pause:H,isPlaying:v,currentIndex:r,totalSlides:n};return[e.Use(C.BeatUII18n,A=>{const te=a.map((ee,Se)=>{const xe=e.computedOf(ye,r)((q,ue)=>q?ue===Se?"1":"0":""),Le=ye.map(q=>q?Se===0?"relative":"absolute":""),E=ye.map(q=>q&&Se!==0?"0":"");return e.html.div(e.attr.class("bc-carousel__slide"),e.attr.class(r.map(q=>q===Se?"bc-carousel__slide--active":"")),e.attr.role("tabpanel"),e.aria.roledescription("slide"),e.aria.label(A.$.carousel.$.slideOfTotal.map(q=>q(Se+1,n))),e.style.minWidth(le),e.style.flexShrink("0"),e.style.opacity(xe),e.style.position(Le),e.style.inset(E),ee)}),de=Array.from({length:n},(ee,Se)=>e.html.button(e.attr.class(r.map(xe=>`bc-carousel__dot${xe===Se?" bc-carousel__dot--active":""}`)),e.attr.type("button"),e.aria.label(A.$.carousel.$.goToSlide.map(xe=>xe(Se+1))),e.on.click(()=>D(Se))));return e.html.div(e.attr.class(c.map(ee=>`bc-carousel bc-carousel--${ee}`)),e.attr.role("region"),e.aria.roledescription("carousel"),e.aria.label(t.ariaLabel!=null?t.ariaLabel:A.$.carousel.$.label),e.attr.tabindex(0),e.WithElement(ee=>{const Se=E=>{e.Value.get(h)&&(E.key==="ArrowLeft"?(E.preventDefault(),x()):E.key==="ArrowRight"&&(E.preventDefault(),$()))};ee.addEventListener("keydown",Se);const xe=E=>{Q&&(O=E.clientX-F)},Le=()=>{Q&&(Q=!1,ee.classList.remove("bc-carousel--dragging"),Math.abs(O)>=e.Value.get(k)?(z=!0,O>0?x():$()):Math.abs(O)>5&&(z=!0),z&&requestAnimationFrame(()=>{z=!1}))};return window.addEventListener("mousemove",xe),window.addEventListener("mouseup",Le),e.OnDispose(()=>{ee.removeEventListener("keydown",Se),window.removeEventListener("mousemove",xe),window.removeEventListener("mouseup",Le),B()})}),e.on.mouseenter(()=>_.set(!0)),e.on.mouseleave(()=>_.set(!1)),e.on.touchstart(ee=>{X=ee.touches[0].clientX,P=ee.touches[0].clientY,U=0}),e.on.touchmove(ee=>{U=ee.touches[0].clientX-X;const Se=Math.abs(ee.touches[0].clientY-P);Math.abs(U)>Se&&ee.preventDefault()}),e.on.touchend(()=>{Math.abs(U)>=R&&(U>0?x():$())}),e.html.div(e.attr.class("bc-carousel__viewport"),e.style.paddingLeft(g),e.style.paddingRight(g),e.WithElement(ee=>(c.on(Se=>{Se==="fade"?ee.style.minWidth=`${ee.offsetWidth}px`:ee.style.minWidth=""}),e.OnDispose(()=>{}))),e.on.mousedown(ee=>{Q=!0,F=ee.clientX,O=0,z=!1,ee.preventDefault()}),e.on.click(ee=>{z&&(ee.preventDefault(),ee.stopPropagation())}),e.html.div(e.attr.class("bc-carousel__track"),e.style.position(ye.map(ee=>ee?"relative":"")),e.style.transform(Z.map(ee=>`translateX(${ee})`)),e.style.transitionDuration(i.map(ee=>`${ee}ms`)),e.style.transitionTimingFunction(b),e.style.gap(d),e.style.justifyContent(_e),...te)),e.When(m,()=>e.html.button(e.attr.class("bc-carousel__arrow bc-carousel__arrow--prev"),e.attr.class(I.map(ee=>ee?"bc-carousel__arrow--disabled":"")),e.attr.type("button"),e.attr.disabled(I),e.aria.label(A.$.carousel.$.previousSlide),e.on.click(()=>x()),C.Icon({icon:ve,size:se,accessibility:"decorative"}))),e.When(m,()=>e.html.button(e.attr.class("bc-carousel__arrow bc-carousel__arrow--next"),e.attr.class(S.map(ee=>ee?"bc-carousel__arrow--disabled":"")),e.attr.type("button"),e.attr.disabled(S),e.aria.label(A.$.carousel.$.nextSlide),e.on.click(()=>$()),C.Icon({icon:J,size:se,accessibility:"decorative"}))),e.When(y.map(ee=>ee==="dots"),()=>e.html.div(e.attr.class("bc-carousel__dots"),e.attr.role("tablist"),e.aria.label(A.$.carousel.$.slideNavigation),...de)),e.When(y.map(ee=>ee==="progress"),()=>e.html.div(e.attr.class("bc-carousel__progress"),e.attr.role("progressbar"),e.aria.valuemin(0),e.aria.valuemax(100),e.aria.valuenow(r.map(ee=>Math.round((ee+1)/n*100))),e.html.div(e.attr.class("bc-carousel__progress-fill"),e.style.width(r.map(ee=>`${(ee+1)/n*100}%`))))),e.When(y.map(ee=>ee==="fraction"),()=>e.html.div(e.attr.class("bc-carousel__fraction"),e.aria.live("polite"),r.map(ee=>`${ee+1} / ${n}`))))}),ke]}function Nc(t,...a){return _r(t,...a)[0]}const Aa="https://cdn.jsdelivr.net/npm/pdfjs-dist@5.4.394/",Wc=t=>{if(!t||typeof t!="object")return!1;const a=t;return!!(a.getDocument&&typeof a.getDocument=="function")};function Uc(){if(typeof window>"u")return;const a=window.pdfjsLib;a?.GlobalWorkerOptions?.workerSrc||a?.GlobalWorkerOptions&&(a.GlobalWorkerOptions.workerSrc=`${Aa}build/pdf.worker.min.mjs`)}const Rc=t=>new Promise((a,n)=>{const r=document.createElement("script");r.type="module",r.src=t,r.onload=()=>a(),r.onerror=()=>n(new Error(`Failed to load script: ${t}`)),document.head.appendChild(r)}),zc=async()=>{const t=window;if(t.pdfjsLib&&Wc(t.pdfjsLib))return t.pdfjsLib;if(await Rc(`${Aa}build/pdf.min.mjs`),await new Promise(a=>setTimeout(a,100)),!t.pdfjsLib)throw new Error("PDF.js failed to initialize after loading");return t.pdfjsLib};let sa=null,en=!1;async function Hc(){if(sa)return sa;!en&&typeof window<"u"&&(Uc(),en=!0);const t=await zc();return sa=t,t.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=`${Aa}build/pdf.worker.min.mjs`),t}function jc(t,a){if(t.byteLength!==a.byteLength)return!1;const n=t.byteLength,r=new DataView(t.buffer,t.byteOffset,n),l=new DataView(a.buffer,a.byteOffset,n),s=n>>>2,u=n&3;for(let o=0;o<s;o++)if(r.getUint32(o*4)!==l.getUint32(o*4))return!1;for(let o=n-u;o<n;o++)if(t[o]!==a[o])return!1;return!0}function qc(t,a){if(t.byteLength!==a.byteLength)return!1;const n=t.byteLength,r=n>>>2,l=new Uint32Array(t,0,r),s=new Uint32Array(a,0,r);for(let i=0;i<r;i++)if(l[i]!==s[i])return!1;const u=n&3,o=new Uint8Array(t,r*4,u),c=new Uint8Array(a,r*4,u);for(let i=0;i<u;i++)if(o[i]!==c[i])return!1;return!0}function Gc(t,a){try{return typeof t=="string"&&typeof a=="string"?t===a:t instanceof Uint8Array&&a instanceof Uint8Array?jc(t,a):t instanceof ArrayBuffer&&a instanceof ArrayBuffer?qc(t,a):!1}catch{return!1}}function ia(t){return typeof t=="string"?t:t instanceof Uint8Array?t.slice():t instanceof ArrayBuffer?t.slice(0):t}function Yc({source:t,page:a=1,fit:n="width",scale:r=1,rotation:l=0,quality:s=2,renderTextLayer:u=!0,renderAnnotationLayer:o=!1,onPageChange:c,onLoadComplete:i},...m){const f=Hc();let h=ia(e.Value.get(t)),d=null,g=e.Value.get(a),p=null;return e.Use(C.BeatUII18n,b=>e.Fragment(e.OnDispose(()=>{if(p){try{p.cancel()}catch{}p=null}d!=null&&(d.destroy(),d=null)}),Ce.ElementRect(k=>{const y=e.delaySignal(k.map(_=>_==null?null:{width:_.width,height:_.height},(_,v)=>_!=null&&v!=null&&_.width===v.width&&_.height===v.height),100);return e.Ensure(y,_=>Ce.Query({request:e.computedOf(t,a,n,r,l,s,u,o,_)((v,w,I,S,V,D,$,x,N)=>({source:v,page:w??1,fit:I??"width",scale:Math.max(.1,S??1),rotation:V??0,quality:Math.max(1,D??2),renderTextLayer:$??!0,renderAnnotationLayer:x??!1,containerWidth:N.width,containerHeight:N.height})),load:async({request:v})=>{const w=await f,I=v.source,S=ia(I),V=ia(I);(d==null||!Gc(h,S))&&(d!=null&&(d.destroy(),d=null),h=S,d=await w.getDocument(V).promise,i?.({pdfDoc:d}));const D=v.page<1||v.page>d.numPages?1:v.page;c!=null&&D!==g&&(g=D,c(D));const $=await d.getPage(D);let x;if(v.fit==="none")x=v.scale;else{const T=$.getViewport({scale:1,rotation:v.rotation}),W=T.width/T.height,B=v.containerWidth/v.containerHeight;switch(v.fit){case"width":x=v.containerWidth/T.width;break;case"height":x=v.containerHeight/T.height;break;case"contain":x=Math.min(v.containerWidth/T.width,v.containerHeight/T.height);break;case"cover":W>B?x=v.containerHeight/T.height:x=v.containerWidth/T.width;break}}const N=$.getViewport({scale:x,rotation:v.rotation}),H=$.getViewport({scale:x*v.quality,rotation:v.rotation});return{pdfWidth:N.width,pdfHeight:N.height,canvasWidth:Math.floor(N.width),canvasHeight:Math.floor(N.height),highResWidth:Math.floor(H.width),highResHeight:Math.floor(H.height),render:async(T,W,B)=>{if(p)try{p.cancel(),await p.promise.catch(()=>{})}catch{}T.width=H.width,T.height=H.height,T.style.width=`${N.width}px`,T.style.height=`${N.height}px`;const X=T.getContext("2d");if(!X)throw new Error("Failed to get canvas context");const P=$.render({canvasContext:X,canvas:T,viewport:H});p=P;try{await P.promise}catch(U){if((U instanceof Error?U.name:U?.name)!=="RenderingCancelledException")throw U;return}finally{p===P&&(p=null)}if(v.renderTextLayer&&W!=null){W.innerHTML="";try{const U=await $.getTextContent(),R=w.TextLayer;R!=null&&await new R({textContentSource:U,container:W,viewport:N}).render()}catch(U){console.warn("Failed to render text layer:",U)}}if(v.renderAnnotationLayer&&B!=null){B.innerHTML="",B.style.width=`${N.width}px`,B.style.height=`${N.height}px`;try{const U=await $.getAnnotations(),R=w.AnnotationLayer;if(R!=null&&U.length>0){const Q={getDestinationHash:()=>"",getAnchorUrl:O=>O,executeNamedAction:()=>{},executeSetOCGState:()=>{},cachePageRef:()=>{}};await new R({div:B,page:$,viewport:N,linkService:Q,annotationStorage:null}).render({viewport:N,div:B,annotations:U,page:$,linkService:Q,renderForms:!0})}}catch(U){console.warn("Failed to render annotation layer:",U)}}}}},convertError:v=>v instanceof Error?v.message:JSON.stringify(v),pending:()=>e.html.div(e.attr.class("bc-pdf-page-viewer__loading"),C.Icon({icon:"line-md:loading-twotone-loop",size:"lg"}),e.html.span(e.attr.class("bc-pdf-page-viewer__loading-text"),b.map(v=>v.pdfPageViewer.loading))),failure:({error:v})=>e.html.div(e.attr.class("bc-pdf-page-viewer__error"),C.Icon({icon:"line-md:alert-circle",size:"lg",color:"danger"}),e.html.span(e.attr.class("bc-pdf-page-viewer__error-text"),v)),success:({value:v})=>e.html.div(e.attr.class(e.Value.map(n,w=>{const I=w??"width";return I==="none"?"bc-pdf-page-viewer":`bc-pdf-page-viewer bc-pdf-page-viewer--fit-${I}`})),e.html.div(e.attr.class("bc-pdf-page-viewer__content"),e.When(e.Value.map(n,w=>(w??"width")==="none"),()=>e.attr.style(v.$.canvasWidth.map(w=>`width: ${w}px; height: ${v.value.canvasHeight}px;`))),e.html.canvas(e.attr.class("bc-pdf-page-viewer__canvas"),e.attr.width(v.$.canvasWidth.map(String)),e.attr.height(v.$.canvasHeight.map(String)),...m),e.html.div(e.attr.class("bc-pdf-page-viewer__text-layer")),e.html.div(e.attr.class("bc-pdf-page-viewer__annotation-layer"))),e.WithElement(w=>{const I=w.querySelector(".bc-pdf-page-viewer__canvas"),S=w.querySelector(".bc-pdf-page-viewer__text-layer"),V=w.querySelector(".bc-pdf-page-viewer__annotation-layer");return e.Value.on(v,async D=>{await D.render(I,S,V)}),e.Empty}))}))})))}Object.defineProperty(exports,"Use",{enumerable:!0,get:()=>e.Use});exports.BeatUII18n=C.BeatUII18n;exports.Icon=C.Icon;exports.LOGICAL_PROPERTY_MAP=C.LOGICAL_PROPERTY_MAP;exports.Locale=C.Locale;exports.defaultLocale=C.defaultLocale;exports.defaultMessages=C.defaultMessages;exports.formatFileSize=C.formatFileSize;exports.getDirectionClassName=C.getDirectionClassName;exports.getDirectionFromLocale=C.getDirectionFromLocale;exports.getIconLocally=C.getIconLocally;exports.getOppositeDirection=C.getOppositeDirection;exports.getPhysicalProperty=C.getPhysicalProperty;exports.isIndexedDBAvailable=C.isIndexedDBAvailable;exports.isRTLLocale=C.isRTLLocale;exports.makeI18nProvider=C.makeI18nProvider;exports.makeMessages=C.makeMessages;exports.resolveDirection=C.resolveDirection;exports.storeIconLocally=C.storeIconLocally;exports.backgroundConfig=fe.backgroundConfig;exports.bgColors=fe.bgColors;exports.borderColors=fe.borderColors;exports.colorShades=fe.colorShades;exports.colors=fe.colors;exports.generateColorVariables=fe.generateColorVariables;exports.generateCoreColorVariables=fe.generateCoreColorVariables;exports.generateSemanticColorVariables=fe.generateSemanticColorVariables;exports.getColorVar=fe.getColorVar;exports.getColorVarName=fe.getColorVarName;exports.interactiveColors=fe.interactiveColors;exports.normalizeColorName=fe.normalizeColorName;exports.resolveSemanticColorMap=fe.resolveSemanticColorMap;exports.semanticColorNames=fe.semanticColorNames;exports.semanticColors=fe.semanticColors;exports.textColors=fe.textColors;exports.themeColorNames=fe.themeColorNames;exports.baseFontSize=L.baseFontSize;exports.baseMotionDuration=L.baseMotionDuration;exports.baseSpacing=L.baseSpacing;exports.borderWidth=L.borderWidth;exports.breakpoints=L.breakpoints;exports.changeFontSize=L.changeFontSize;exports.controlGap=L.controlGap;exports.controlHeight=L.controlHeight;exports.controlPaddingBlock=L.controlPaddingBlock;exports.controlPaddingInline=L.controlPaddingInline;exports.fontFamily=L.fontFamily;exports.fontSize=L.fontSize;exports.fontWeight=L.fontWeight;exports.generateAllTokenVariables=L.generateAllTokenVariables;exports.generateBorderWidthVariables=L.generateBorderWidthVariables;exports.generateBreakpointVariables=L.generateBreakpointVariables;exports.generateControlGapVariables=L.generateControlGapVariables;exports.generateControlHeightVariables=L.generateControlHeightVariables;exports.generateControlPaddingVariables=L.generateControlPaddingVariables;exports.generateControlTokenVariables=L.generateControlTokenVariables;exports.generateCoreTokenVariables=L.generateCoreTokenVariables;exports.generateFontFamilyOverrideVariables=L.generateFontFamilyOverrideVariables;exports.generateMotionVariables=L.generateMotionVariables;exports.generateOutlineWidthVariables=L.generateOutlineWidthVariables;exports.generateOverlayWidthVariables=L.generateOverlayWidthVariables;exports.generateRadiusVariables=L.generateRadiusVariables;exports.generateSemanticFontVariables=L.generateSemanticFontVariables;exports.generateSemanticMotionVariables=L.generateSemanticMotionVariables;exports.generateSemanticRadiusVariables=L.generateSemanticRadiusVariables;exports.generateSemanticShadowVariables=L.generateSemanticShadowVariables;exports.generateSemanticSpacingVariables=L.generateSemanticSpacingVariables;exports.generateSemanticTextShadowVariables=L.generateSemanticTextShadowVariables;exports.generateSemanticTokenVariables=L.generateSemanticTokenVariables;exports.generateShadowVariables=L.generateShadowVariables;exports.generateSpacingVariables=L.generateSpacingVariables;exports.generateTextShadowVariables=L.generateTextShadowVariables;exports.generateTypographyVariables=L.generateTypographyVariables;exports.generateZIndexVariables=L.generateZIndexVariables;exports.getBaseFontSizeVar=L.getBaseFontSizeVar;exports.getBaseFontSizeVarName=L.getBaseFontSizeVarName;exports.getBaseMotionDurationVar=L.getBaseMotionDurationVar;exports.getBaseMotionDurationVarName=L.getBaseMotionDurationVarName;exports.getBorderWidthVar=L.getBorderWidthVar;exports.getBorderWidthVarName=L.getBorderWidthVarName;exports.getBreakpointMediaQuery=L.getBreakpointMediaQuery;exports.getBreakpointVar=L.getBreakpointVar;exports.getBreakpointVarName=L.getBreakpointVarName;exports.getControlGapVar=L.getControlGapVar;exports.getControlGapVarName=L.getControlGapVarName;exports.getControlHeightVar=L.getControlHeightVar;exports.getControlHeightVarName=L.getControlHeightVarName;exports.getControlPaddingBlockVar=L.getControlPaddingBlockVar;exports.getControlPaddingBlockVarName=L.getControlPaddingBlockVarName;exports.getControlPaddingInlineVar=L.getControlPaddingInlineVar;exports.getControlPaddingInlineVarName=L.getControlPaddingInlineVarName;exports.getFontFamilyVar=L.getFontFamilyVar;exports.getFontFamilyVarName=L.getFontFamilyVarName;exports.getFontSizeLineHeightVar=L.getFontSizeLineHeightVar;exports.getFontSizeLineHeightVarName=L.getFontSizeLineHeightVarName;exports.getFontSizeVar=L.getFontSizeVar;exports.getFontSizeVarName=L.getFontSizeVarName;exports.getFontWeightVar=L.getFontWeightVar;exports.getFontWeightVarName=L.getFontWeightVarName;exports.getLetterSpacingVar=L.getLetterSpacingVar;exports.getLetterSpacingVarName=L.getLetterSpacingVarName;exports.getLineHeightVar=L.getLineHeightVar;exports.getLineHeightVarName=L.getLineHeightVarName;exports.getMotionDurationVar=L.getMotionDurationVar;exports.getMotionDurationVarName=L.getMotionDurationVarName;exports.getMotionEasingVar=L.getMotionEasingVar;exports.getMotionEasingVarName=L.getMotionEasingVarName;exports.getOutlineWidthVar=L.getOutlineWidthVar;exports.getOutlineWidthVarName=L.getOutlineWidthVarName;exports.getOverlayWidthVar=L.getOverlayWidthVar;exports.getOverlayWidthVarName=L.getOverlayWidthVarName;exports.getRadiusMediaQuery=L.getRadiusMediaQuery;exports.getRadiusVar=L.getRadiusVar;exports.getRadiusVarName=L.getRadiusVarName;exports.getSemanticFontVar=L.getSemanticFontVar;exports.getSemanticFontVarName=L.getSemanticFontVarName;exports.getSemanticMotionVarName=L.getSemanticMotionVarName;exports.getSemanticRadiusVarName=L.getSemanticRadiusVarName;exports.getSemanticShadowVarName=L.getSemanticShadowVarName;exports.getSemanticSpacingVarName=L.getSemanticSpacingVarName;exports.getSemanticTextShadowVarName=L.getSemanticTextShadowVarName;exports.getShadowVar=L.getShadowVar;exports.getShadowVarName=L.getShadowVarName;exports.getSpacingVar=L.getSpacingVar;exports.getSpacingVarName=L.getSpacingVarName;exports.getTextShadowVar=L.getTextShadowVar;exports.getTextShadowVarName=L.getTextShadowVarName;exports.getTokenValue=L.getTokenValue;exports.getZIndexVar=L.getZIndexVar;exports.getZIndexVarName=L.getZIndexVarName;exports.letterSpacing=L.letterSpacing;exports.lineHeight=L.lineHeight;exports.motionDurations=L.motionDurations;exports.motionEasings=L.motionEasings;exports.outlineWidth=L.outlineWidth;exports.overlayWidth=L.overlayWidth;exports.radius=L.radius;exports.semanticFontNames=L.semanticFontNames;exports.semanticMotionNames=L.semanticMotionNames;exports.semanticRadiusNames=L.semanticRadiusNames;exports.semanticShadowNames=L.semanticShadowNames;exports.semanticSpacingNames=L.semanticSpacingNames;exports.semanticTextShadowNames=L.semanticTextShadowNames;exports.shadows=L.shadows;exports.spacing=L.spacing;exports.textShadows=L.textShadows;exports.zIndex=L.zIndex;exports.ArrayController=oe.ArrayController;exports.BaseControl=oe.BaseControl;exports.BaseMappedControl=oe.BaseMappedControl;exports.CheckboxInput=oe.CheckboxInput;exports.CloseButton=oe.CloseButton;exports.Control=oe.Control;exports.Controller=oe.Controller;exports.ControllerValidation=oe.ControllerValidation;exports.FIELD_LAYOUT_DEFAULTS=oe.FIELD_LAYOUT_DEFAULTS;exports.Field=oe.Field;exports.FieldLayout=oe.FieldLayout;exports.MappedControl=oe.MappedControl;exports.ObjectController=oe.ObjectController;exports.RequiredSymbol=oe.RequiredSymbol;exports.connectCommonAttributes=oe.connectCommonAttributes;exports.connectNumberInput=oe.connectNumberInput;exports.connectStringInput=oe.connectStringInput;exports.convertStandardSchemaIssues=oe.convertStandardSchemaIssues;exports.convertStandardSchemaPathToPath=oe.convertStandardSchemaPathToPath;exports.makeMapValidation=oe.makeMapValidation;exports.makeOnBlurHandler=oe.makeOnBlurHandler;exports.makeOnChangeHandler=oe.makeOnChangeHandler;exports.parsePath=oe.parsePath;exports.pathToString=oe.pathToString;exports.standardSchemaResultToValidation=oe.standardSchemaResultToValidation;exports.taskToValidation=oe.taskToValidation;exports.useController=oe.useController;exports.useForm=oe.useForm;exports.wrapSegment=oe.wrapSegment;exports.AnimatedToggle=He.AnimatedToggle;exports.AnimatedToggleClass=He.AnimatedToggleClass;exports.useAnimatedElementToggle=He.useAnimatedElementToggle;exports.useAnimatedToggle=He.useAnimatedToggle;exports.useTimedToggle=He.useTimedToggle;exports.Theme=St.Theme;exports.ThemeAppearance=St.ThemeAppearance;exports.beatuiPreset=tn.beatuiPreset;exports.createBeatuiPreset=tn.createBeatuiPreset;exports.Base64Input=G.Base64Input;exports.Base64sInput=G.Base64sInput;exports.ColorSwatchInput=G.ColorSwatchInput;exports.EditableText=G.EditableText;exports.NullableDateInput=G.NullableDateInput;exports.NullableDateTimeInput=G.NullableDateTimeInput;exports.NullableEmailInput=G.NullableEmailInput;exports.NullablePasswordInput=G.NullablePasswordInput;exports.NullableRatingInput=G.NullableRatingInput;exports.NullableSliderInput=G.NullableSliderInput;exports.NullableTextArea=G.NullableTextArea;exports.NullableTextInput=G.NullableTextInput;exports.NullableUrlInput=G.NullableUrlInput;exports.NullableUuidInput=G.NullableUuidInput;exports.RatingInput=G.RatingInput;exports.SliderInput=G.SliderInput;exports.Switch=G.Switch;exports.emptyToNull=G.emptyToNull;exports.fileToBase64=G.fileToBase64;exports.forFormat=G.forFormat;exports.forTypeAndFormat=G.forTypeAndFormat;exports.forXUI=G.forXUI;exports.nullToEmpty=G.nullToEmpty;exports.sessionId=Pe.sessionId;exports.BooleanValidator=Ee.BooleanValidator;exports.ConfirmModal=Ee.ConfirmModal;exports.FocusTrap=Ee.FocusTrap;exports.Modal=Ee.Modal;exports.ObjectValidator=Ee.ObjectValidator;exports.Overlay=Ee.Overlay;exports.StringValidator=Ee.StringValidator;exports.boolean=Ee.boolean;exports.createStandardSchema=Ee.createStandardSchema;exports.object=Ee.object;exports.string=Ee.string;exports.useFocusTrap=Ee.useFocusTrap;exports.Button=ne.Button;exports.InputContainer=ne.InputContainer;exports.InputIcon=ne.InputIcon;exports.generateButtonClasses=ne.generateButtonClasses;exports.generateButtonStyles=ne.generateButtonStyles;exports.generateInputContainerInputClasses=ne.generateInputContainerInputClasses;exports.BaseListControl=ae.BaseListControl;exports.BaseNativeSelectControl=ae.BaseNativeSelectControl;exports.Expando=ae.Expando;exports.FilesInput=ae.FilesInput;exports.Group=ae.Group;exports.ListControl=ae.ListControl;exports.ListInput=ae.ListInput;exports.ListItemControls=ae.ListItemControls;exports.MaskInput=ae.MaskInput;exports.NativeSelect=ae.NativeSelect;exports.NativeSelectControl=ae.NativeSelectControl;exports.NullableDurationInput=ae.NullableDurationInput;exports.NullableNumberInput=ae.NullableNumberInput;exports.NumberInput=ae.NumberInput;exports.SegmentedInput=ae.SegmentedInput;exports.TextArea=ae.TextArea;exports.UnionController=ae.UnionController;exports.UnstyledDropZone=ae.UnstyledDropZone;exports.UrlInput=ae.UrlInput;exports.UuidInput=ae.UuidInput;exports.WithTemporal=ae.WithTemporal;exports.deepMergeDefaults=ae.deepMergeDefaults;exports.emitExpando=ae.emitExpando;exports.emitOptionExpando=ae.emitOptionExpando;exports.ensureTemporal=ae.ensureTemporal;exports.transformEmptyStringToUndefined=ae.transformEmptyStringToUndefined;exports.transformNullToUndefined=ae.transformNullToUndefined;exports.transformUndefinedToNull=ae.transformUndefinedToNull;exports.DangerLabel=et.DangerLabel;exports.EmphasisLabel=et.EmphasisLabel;exports.Label=et.Label;exports.MutedLabel=et.MutedLabel;exports.Stack=et.Stack;exports.Flyout=Ie.Flyout;exports.Menu=Ie.Menu;exports.MenuItem=Ie.MenuItem;exports.MenuSeparator=Ie.MenuSeparator;exports.CommonInputAttributes=Fe.CommonInputAttributes;exports.TextInput=Fe.TextInput;exports.mapInputOptions=Fe.mapInputOptions;exports.BigintInput=je.BigintInput;exports.DurationInput=je.DurationInput;exports.FileInput=je.FileInput;exports.NullableBigintInput=je.NullableBigintInput;exports.NullablePlainDateInput=je.NullablePlainDateInput;exports.NullablePlainDateTimeInput=je.NullablePlainDateTimeInput;exports.NullablePlainTimeInput=je.NullablePlainTimeInput;exports.PlainDateInput=je.PlainDateInput;exports.PlainDateTimeInput=je.PlainDateTimeInput;exports.PlainTimeInput=je.PlainTimeInput;exports.Card=xt.Card;exports.CardBody=xt.CardBody;exports.CardCoverImage=xt.CardCoverImage;exports.CardFooter=xt.CardFooter;exports.CardHeader=xt.CardHeader;exports.EmailInput=ba.EmailInput;exports.Notice=ba.Notice;exports.PasswordInput=ba.PasswordInput;exports.LinkPortal=Dr.LinkPortal;exports.Toolbar=Dt.Toolbar;exports.ToolbarButton=Dt.ToolbarButton;exports.ToolbarDivider=Dt.ToolbarDivider;exports.ToolbarGroup=Dt.ToolbarGroup;exports.ToolbarSpacer=Dt.ToolbarSpacer;exports.Accordion=yl;exports.ActionCard=wl;exports.AlertDialog=ns;exports.Align=ql;exports.AlphaChannelPicker=yt;exports.AnnouncementBar=Qo;exports.AppShell=Nl;exports.AppearanceSelector=Wn;exports.AutoColorBadge=Xr;exports.Avatar=Nr;exports.AvatarGroup=jr;exports.AvatarGroupOverflow=qr;exports.Badge=ct;exports.BaseComboboxControl=Yn;exports.BaseComboboxTagsControl=Is;exports.BaseDropdownControl=jn;exports.BaseMultiSelectControl=fl;exports.BaseSelectTagsControl=Ss;exports.BaseVideoPlayer=Bc;exports.BeatUI=Li;exports.BlockCommandPalette=es;exports.Breadcrumbs=bc;exports.ButtonLink=_c;exports.Carousel=Nc;exports.Center=Rl;exports.CenterH=Wl;exports.ChannelPicker=Me;exports.Chips=Ta;exports.Collapse=Tt;exports.CollapsibleSidebarGroup=Cc;exports.ColorController=Zn;exports.ColorField=kt;exports.ColorInput=Un;exports.ColumnFilter=st;exports.ColumnFilterPanel=Vt;exports.ColumnHeaderMenu=On;exports.ComboboxControl=Cs;exports.ComboboxInput=Gn;exports.ComboboxTagsControl=$s;exports.ComboboxTagsInput=Ea;exports.ConfirmationDialog=ts;exports.CopyButton=Dl;exports.DataTable=Ln;exports.DataToolbar=vn;exports.DateInput=xs;exports.DatePicker=it;exports.DateRangePicker=ln;exports.DateRangeSelect=Ds;exports.DateRangeSelectShell=Et;exports.DateSelect=Ts;exports.DateTimeInput=Fs;exports.DateTimeSelect=di;exports.DateTimeSelectShell=$t;exports.Divider=zl;exports.Drawer=jo;exports.DropdownBase=Oa;exports.DropdownControl=ws;exports.DropdownInput=Hn;exports.EmptyState=uc;exports.EnsureControl=Si;exports.Fieldset=Oi;exports.Filter=Te;exports.FormStatus=Vi;exports.FormatBigInt=Hi;exports.FormatDate=Gi;exports.FormatDateTime=Ji;exports.FormatDisplayName=lc;exports.FormatFileSize=ic;exports.FormatList=nc;exports.FormatNumber=Ui;exports.FormatPlural=sc;exports.FormatRelativeTime=tc;exports.FormatTime=Zi;exports.Gap=jl;exports.Grow=Zl;exports.HexColorPicker=fs;exports.HistoryTimeline=Qr;exports.HslColorPicker=bs;exports.HwbColorPicker=vs;exports.Indicator=tl;exports.InputAdornment=Ls;exports.InstantInput=fi;exports.Justify=Gl;exports.Kbd=Ho;exports.LazyNativeSelect=As;exports.Lightbox=Ko;exports.Link=dr;exports.LoadingOverlay=En;exports.LocaleSelector=Ti;exports.MultiSelect=qt;exports.MultiSelectControl=gl;exports.NativePdfPreview=Ai;exports.NavigationLink=kc;exports.NavigationProgress=Tc;exports.NineSliceScrollView=Hl;exports.NoWrap=Kl;exports.Notification=Jn;exports.NotificationPanel=hc;exports.NotificationProvider=Fa;exports.NotificationService=er;exports.NotificationViewport=tr;exports.NullableColorInput=ks;exports.NullableColorSwatchInput=_s;exports.NullableDateSelect=Ps;exports.NullableDateTimeSelect=mi;exports.NullableInstantInput=bi;exports.NullableMaskInput=Bs;exports.NullablePlainMonthDayInput=Ci;exports.NullablePlainYearMonthInput=_i;exports.NullableTimeSelect=ci;exports.NullableZonedDateTimeInput=yi;exports.NumberStepper=Ns;exports.OklchColorPicker=ys;exports.OnboardingTour=ss;exports.OpenDateRangeSelect=Os;exports.OpenGraph=mc;exports.Option=Ue;exports.OtpInput=si;exports.PDFJSPreview=Bi;exports.PageDropZone=al;exports.Pagination=bn;exports.PdfPageViewer=Yc;exports.PlainMonthDayInput=wi;exports.PlainYearMonthInput=ki;exports.Popover=qo;exports.PresenceCursor=cn;exports.PresenceHighlight=nl;exports.PresenceSelectionMark=rl;exports.ProgressBar=ll;exports.PromptDialog=rs;exports.QueryDataTable=Mi;exports.RadioGroup=Js;exports.RangeSlider=ni;exports.RgbColorPicker=gs;exports.Ribbon=Yo;exports.ScrollablePanel=da;exports.SegmentedSelect=Gs;exports.SelectAllCheckbox=Pn;exports.SelectTagsControl=Vs;exports.SelectTagsInput=Pa;exports.SelectionCheckbox=Da;exports.Sidebar=wc;exports.SidebarActiveLink=fr;exports.SidebarClickLink=gr;exports.SidebarContext=mr;exports.SidebarGroup=ga;exports.SidebarLink=br;exports.SidebarSeparator=Sc;exports.SidebarUrlLink=hr;exports.Sink=Ql;exports.Skeleton=ol;exports.SortableHeader=$n;exports.SortableList=Us;exports.Spotlight=ds;exports.StandaloneAppearanceSelector=Uo;exports.StatCard=Oo;exports.StatCardIcon=Fo;exports.StatCardLabel=Po;exports.StatCardSparkline=Lo;exports.StatCardTrend=Eo;exports.StatCardValue=To;exports.Stepper=Fc;exports.StylePortal=dc;exports.Table=mn;exports.Tabs=xc;exports.TagInput=Ks;exports.TagsInput=Zs;exports.TimePicker=bt;exports.TimeSelect=ii;exports.TimeSelectShell=It;exports.ToggleButton=Cn;exports.ToggleButtonGroup=El;exports.Tooltip=gt;exports.TransferList=zs;exports.TreeView=Pc;exports.TriStateCheckboxInput=Tn;exports.VirtualList=Wo;exports.WithBeatUIBreakpoint=wn;exports.WithBeatUIElementBreakpoint=$l;exports.WithBreakpoint=Ia;exports.Wrap=Yl;exports.ZonedDateTimeInput=vi;exports.colorInputOptionsFromController=xi;exports.compareBreakpoint=_n;exports.createCarousel=_r;exports.createColorController=$i;exports.createDataSource=hn;exports.createLocationMatcher=Yt;exports.createQueryDataSource=ar;exports.createSpotlight=Rn;exports.createStepper=yr;exports.delaySignal=Or;exports.describeBuiltinFilter=ka;exports.describeBuiltinFilterLocalized=wa;exports.describeFilter=_a;exports.describeFilterLocalized=jt;exports.downloadContent=Tr;exports.downloadFile=Er;exports.downloadUrl=va;exports.downloadUrlAndMonitor=Pr;exports.drawCheckerboard=ut;exports.drawHueCanvas=Gt;exports.evaluateBuiltinFilter=Ht;exports.evaluateFilterExpr=Ut;exports.findBreakpoint=Vl;exports.formatBigInt=zi;exports.formatDate=qi;exports.formatDateTime=Qi;exports.formatDisplayName=rc;exports.formatList=ac;exports.formatNumber=Wi;exports.formatPlural=oc;exports.formatRelativeTime=ec;exports.formatTime=Ki;exports.formatTime12=An;exports.formatTime12WithSeconds=Mn;exports.formatTime24=Bn;exports.formatTime24WithSeconds=Nn;exports.formatTimeAuto=Pt;exports.generateBadgeClasses=on;exports.generateBadgeStyles=sn;exports.generateLinkClasses=ha;exports.generateLinkStyles=fa;exports.generateNotificationClasses=Xn;exports.generateNotificationStyles=Qn;exports.generatePaginationRange=fn;exports.generatePaginationStyles=gn;exports.generateProgressBarClasses=un;exports.generateProgressBarStyles=dn;exports.generateSkeletonClasses=ca;exports.generateSkeletonStyles=pn;exports.increaseSize=Fr;exports.inferValueType=ya;exports.isBuiltinFilter=Ot;exports.isUrlMatch=pr;exports.localeUses12Hour=vt;exports.renderDetailRow=xa;exports.renderToggleCell=$a;exports.renderToggleFilterCell=Dn;exports.renderToggleHeaderCell=xn;exports.resolvePluralCategory=ur;