Files

6 lines
12 KiB
JavaScript

var ot=Object.defineProperty;var G=t=>{throw TypeError(t)};var it=(t,e,n)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var x=(t,e,n)=>it(t,typeof e!="symbol"?e+"":e,n),X=(t,e,n)=>e.has(t)||G("Cannot "+n);var E=(t,e,n)=>(X(t,e,"read from private field"),n?n.call(t):e.get(t)),k=(t,e,n)=>e.has(t)?G("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),I=(t,e,n,r)=>(X(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{bj as st,n as at,b as M,aC as ct,e as ut,be as lt,g as v,k as R,y as ft,a6 as dt,q as J,br as pt,p as Z,h as N,i as C,j as O,m as Q,o as mt,as as ht,v as bt,l as yt}from"./DScGFiBY.js";import{a as gt,b as Et,c as wt,d as vt}from"./BuAKAdPx.js";import"./Bzak7iHL.js";import{c as At}from"./B5gxx3nr.js";import{p as F,r as tt,b as Tt}from"./DoRZqEmo.js";import{h as L,d as Y,b as St,c as xt}from"./BPc-JNDc.js";import{i as kt}from"./BlbL38UD.js";function _t(){return Symbol(st)}function Te(t,e,n){at(()=>{var r=M(()=>e(t,n==null?void 0:n())||{});if(n&&(r!=null&&r.update)){var o=!1,s={};ct(()=>{var i=n();ut(i),o&&lt(s,i)&&(s=i,r.update(i))}),o=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function Ot(t){const e=JSON.parse(t);return e.data&&(e.data=wt(e.data,vt.decoders)),e}function P(t){return HTMLElement.prototype.cloneNode.call(t)}function Se(t,e=()=>{}){const n=async({action:o,result:s,reset:i=!0,invalidateAll:u=!0})=>{s.type==="success"&&(i&&HTMLFormElement.prototype.reset.call(t),u&&await gt()),(location.origin+location.pathname===o.origin+o.pathname||s.type==="redirect"||s.type==="error")&&await Et(s)};async function r(o){var c,a,b;if(((c=o.submitter)!=null&&c.hasAttribute("formmethod")?o.submitter.formMethod:P(t).method)!=="post")return;o.preventDefault();const i=new URL((a=o.submitter)!=null&&a.hasAttribute("formaction")?o.submitter.formAction:P(t).action),u=(b=o.submitter)!=null&&b.hasAttribute("formenctype")?o.submitter.formEnctype:P(t).enctype,f=new FormData(t,o.submitter),d=new AbortController;let p=!1;const m=await e({action:i,cancel:()=>p=!0,controller:d,formData:f,formElement:t,submitter:o.submitter})??n;if(p)return;let l;try{const h=new Headers({accept:"application/json","x-sveltekit-action":"true"});u!=="multipart/form-data"&&h.set("Content-Type",/^(:?application\/x-www-form-urlencoded|text\/plain)$/.test(u)?u:"application/x-www-form-urlencoded");const rt=u==="multipart/form-data"?f:new URLSearchParams(f),D=await fetch(i,{method:"POST",headers:h,cache:"no-store",body:rt,signal:d.signal});l=Ot(await D.text()),l.type==="error"&&(l.status=D.status)}catch(h){if((h==null?void 0:h.name)==="AbortError")return;l={type:"error",error:h}}await m({action:i,formData:f,formElement:t,update:h=>n({action:i,result:l,reset:h==null?void 0:h.reset,invalidateAll:h==null?void 0:h.invalidateAll}),result:l})}return HTMLFormElement.prototype.addEventListener.call(t,"submit",r),{destroy(){HTMLFormElement.prototype.removeEventListener.call(t,"submit",r)}}}function Rt(t){return typeof t=="function"}function jt(t){return t!==null&&typeof t=="object"}const It=["string","number","bigint","boolean"];function H(t){return t==null||It.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>H(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const A=Symbol("box"),U=Symbol("is-writable");function W(t,e){const n=R(t);return e?{[A]:!0,[U]:!0,get current(){return v(n)},set current(r){e(r)}}:{[A]:!0,get current(){return t()}}}function j(t){return jt(t)&&A in t}function et(t){return j(t)&&U in t}function xe(t){return j(t)?t:Rt(t)?W(t):Lt(t)}function ke(t){return Object.entries(t).reduce((e,[n,r])=>j(r)?(et(r)?Object.defineProperty(e,n,{get(){return r.current},set(o){r.current=o}}):Object.defineProperty(e,n,{get(){return r.current}}),e):Object.assign(e,{[n]:r}),{})}function _e(t){return et(t)?{[A]:!0,get current(){return t.current}}:t}function Lt(t){let e=ft(dt(t));return{[A]:!0,[U]:!0,get current(){return v(e)},set current(n){J(e,n,!0)}}}function Pt(...t){return function(e){var n;for(const r of t)if(r){if(e.defaultPrevented)return;typeof r=="function"?r.call(this,e):(n=r.current)==null||n.call(this,e)}}}var $=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Mt=/\n/g,Nt=/^\s*/,Ct=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ft=/^:\s*/,Ht=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Wt=/^[;\s]*/,Bt=/^\s+|\s+$/g,Ut=`
`,z="/",K="*",g="",Vt="comment",Dt="declaration";function Gt(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function o(c){var a=c.match(Mt);a&&(n+=a.length);var b=c.lastIndexOf(Ut);r=~b?c.length-b:r+c.length}function s(){var c={line:n,column:r};return function(a){return a.position=new i(c),d(),a}}function i(c){this.start=c,this.end={line:n,column:r},this.source=e.source}i.prototype.content=t;function u(c){var a=new Error(e.source+":"+n+":"+r+": "+c);if(a.reason=c,a.filename=e.source,a.line=n,a.column=r,a.source=t,!e.silent)throw a}function f(c){var a=c.exec(t);if(a){var b=a[0];return o(b),t=t.slice(b.length),a}}function d(){f(Nt)}function p(c){var a;for(c=c||[];a=y();)a!==!1&&c.push(a);return c}function y(){var c=s();if(!(z!=t.charAt(0)||K!=t.charAt(1))){for(var a=2;g!=t.charAt(a)&&(K!=t.charAt(a)||z!=t.charAt(a+1));)++a;if(a+=2,g===t.charAt(a-1))return u("End of comment missing");var b=t.slice(2,a-2);return r+=2,o(b),t=t.slice(a),r+=2,c({type:Vt,comment:b})}}function m(){var c=s(),a=f(Ct);if(a){if(y(),!f(Ft))return u("property missing ':'");var b=f(Ht),h=c({type:Dt,property:q(a[0].replace($,g)),value:b?q(b[0].replace($,g)):g});return f(Wt),h}}function l(){var c=[];p(c);for(var a;a=m();)a!==!1&&(c.push(a),p(c));return c}return d(),l()}function q(t){return t?t.replace(Bt,g):g}function Xt(t,e){let n=null;if(!t||typeof t!="string")return n;const r=Gt(t),o=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:i,value:u}=s;o?e(i,u,s):u&&(n=n||{},n[i]=u)}),n}const Yt=/\d/,$t=["-","_","/","."];function zt(t=""){if(!Yt.test(t))return t!==t.toLowerCase()}function Kt(t){const e=[];let n="",r,o;for(const s of t){const i=$t.includes(s);if(i===!0){e.push(n),n="",r=void 0;continue}const u=zt(s);if(o===!1){if(r===!1&&u===!0){e.push(n),n=s,r=u;continue}if(r===!0&&u===!1&&n.length>1){const f=n.at(-1);e.push(n.slice(0,Math.max(0,n.length-1))),n=f+s,r=u;continue}}n+=s,r=u,o=i}return e.push(n),e}function nt(t){return t?Kt(t).map(e=>Jt(e)).join(""):""}function qt(t){return Zt(nt(t||""))}function Jt(t){return t?t[0].toUpperCase()+t.slice(1):""}function Zt(t){return t?t[0].toLowerCase()+t.slice(1):""}function _(t){if(!t)return{};const e={};function n(r,o){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){e[nt(r)]=o;return}if(r.startsWith("--")){e[r]=o;return}e[qt(r)]=o}return Xt(t,n),e}function Qt(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function te(t,e){const n=RegExp(t,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,e):r}}const ee=te(/[A-Z]/,t=>`-${t.toLowerCase()}`);function ne(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${ee(e)}: ${t[e]};`).join(`
`)}function re(t={}){return ne(t).replace(`
`," ")}const oe=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],ie=new Set(oe);function se(t){return ie.has(t)}function ae(...t){const e={...t[0]};for(let n=1;n<t.length;n++){const r=t[n];if(r){for(const o of Object.keys(r)){const s=e[o],i=r[o],u=typeof s=="function",f=typeof i=="function";if(u&&se(o)){const d=s,p=i;e[o]=Pt(d,p)}else if(u&&f)e[o]=Qt(s,i);else if(o==="class"){const d=H(s),p=H(i);d&&p?e[o]=L(s,i):d?e[o]=L(s):p&&(e[o]=L(i))}else if(o==="style"){const d=typeof s=="object",p=typeof i=="object",y=typeof s=="string",m=typeof i=="string";if(d&&p)e[o]={...s,...i};else if(d&&m){const l=_(i);e[o]={...s,...l}}else if(y&&p){const l=_(s);e[o]={...l,...i}}else if(y&&m){const l=_(s),c=_(i);e[o]={...l,...c}}else d?e[o]=s:p?e[o]=i:y?e[o]=s:m&&(e[o]=i)}else e[o]=i!==void 0?i:s}for(const o of Object.getOwnPropertySymbols(r)){const s=e[o],i=r[o];e[o]=i!==void 0?i:s}}}return typeof e.style=="object"&&(e.style=re(e.style).replaceAll(`
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}function ce(t,e){return{[_t()]:n=>j(t)?(t.current=n,M(()=>e==null?void 0:e(n)),()=>{"isConnected"in n&&n.isConnected||(t.current=null,e==null||e(null))}):(t(n),M(()=>e==null?void 0:e(n)),()=>{"isConnected"in n&&n.isConnected||(t(null),e==null||e(null))})}}function Oe(t){return t?"true":"false"}function Re(t){return t?"":void 0}function je(t){return t?!0:void 0}function Ie(t){return t?"open":"closed"}function Le(t){return t?"checked":"unchecked"}function Pe(t,e){return t?"true":"false"}var w,T;class ue{constructor(e){k(this,w);k(this,T);x(this,"attrs");I(this,w,e.getVariant?e.getVariant():null),I(this,T,E(this,w)?`data-${E(this,w)}-`:`data-${e.component}-`),this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(n=>[n,this.getAttr(n)]))}getAttr(e,n){return n?`data-${n}-${e}`:`${E(this,T)}${e}`}selector(e,n){return`[${this.getAttr(e,n)}]`}}w=new WeakMap,T=new WeakMap;function le(t){const e=new ue(t);return{...e.attrs,selector:e.selector,getAttr:e.getAttr}}function fe(t,e){return`bits-${t}`}const de=le({component:"label",parts:["root"]});var S;const V=class V{constructor(e){x(this,"opts");x(this,"attachment");k(this,S,R(()=>({id:this.opts.id.current,[de.root]:"",onmousedown:this.onmousedown,...this.attachment})));this.opts=e,this.attachment=ce(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}static create(e){return new V(e)}onmousedown(e){e.detail>1&&e.preventDefault()}get props(){return v(E(this,S))}set props(e){J(E(this,S),e)}};S=new WeakMap;let B=V;var pe=yt("<label><!></label>");function me(t,e){const n=pt();Z(e,!0);let r=F(e,"id",19,()=>fe(n)),o=F(e,"ref",15,null),s=tt(e,["$$slots","$$events","$$legacy","children","child","id","ref","for"]);const i=B.create({id:W(()=>r()),ref:W(()=>o(),m=>o(m))}),u=R(()=>ae(s,i.props,{for:e.for}));var f=N(),d=C(f);{var p=m=>{var l=N(),c=C(l);Y(c,()=>e.child,()=>({props:v(u)})),O(m,l)},y=m=>{var l=pe();St(l,()=>({...v(u),for:e.for}));var c=mt(l);Y(c,()=>e.children??ht),bt(l),O(m,l)};kt(d,m=>{e.child?m(p):m(y,!1)})}O(t,f),Q()}function Me(t,e){Z(e,!0);let n=F(e,"ref",15,null),r=tt(e,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),s=C(o);{let i=R(()=>xt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e.class));At(s,()=>me,(u,f)=>{f(u,Tt({"data-slot":"label",get class(){return v(i)}},()=>r,{get ref(){return n()},set ref(d){n(d)}}))})}O(t,o),Q()}export{A as B,Me as L,Te as a,ce as b,le as c,fe as d,Se as e,W as f,Re as g,Le as h,Oe as i,Pe as j,je as k,Ie as l,ae as m,Lt as n,xe as o,_ as p,U as q,ke as r,re as s,_e as t,j as u,et as v,jt as w,Qt as x,Pt as y};