@wpic/ui 0.9.34 → 0.9.35

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.
package/dist/wpic-ui.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("lucide-vue-next"),c1=require("@floating-ui/vue"),m0=require("pinia"),q1=require("@tiptap/vue-3"),h0=require("@tiptap/extension-document"),f0=require("@tiptap/extension-paragraph"),v0=require("@tiptap/extension-text"),b0=require("@tiptap/extension-character-count"),g0=require("@tiptap/starter-kit"),k0=require("@tiptap/extension-placeholder");var H1=typeof document<"u"?document.currentScript:null;const C0={key:0,class:"wpic:absolute wpic:inset-0 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-[inherit]","aria-hidden":"true"},D1=e.defineComponent({__name:"WButton",props:{variant:{},size:{},loading:{type:Boolean},disabled:{type:Boolean},active:{type:Boolean},icon:{type:[Object,Function]},href:{}},emits:["click"],setup(n,{emit:s}){const t=n,l=s;return(o,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.href?"a":"button"),{href:n.href,disabled:n.disabled||n.loading,"data-variant":t.variant??"primary","data-size":t.size??"md","data-active":n.active?"true":void 0,onClick:c[0]||(c[0]=i=>l("click",i)),class:e.normalizeClass(["wpic-button","wpic:relative wpic:inline-flex wpic:items-center wpic:justify-center wpic:font-medium wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:select-none","wpic:focus-visible:outline-none wpic:focus-visible:ring-2 wpic:focus-visible:ring-indigo-500/50 wpic:focus-visible:ring-offset-1","wpic:active:scale-[0.98]",n.disabled||n.loading?"wpic:opacity-40 wpic:cursor-not-allowed wpic:pointer-events-none":"",n.active&&t.variant!=="text"?"wpic-button--active":"",(t.size??"md")==="sm"?"wpic:h-8 wpic:touch-manipulation wpic:px-2.5 wpic:gap-1.5 wpic:rounded-md wpic:text-sm":"",(t.size??"md")==="md"?(t.variant==="subtle"?"wpic:h-11":"wpic:h-9")+" wpic:px-3.5 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="lg"?(t.variant==="subtle"?"wpic:h-12":"wpic:h-11")+" wpic:px-4 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="xs"?"wpic:h-5 wpic:w-5 wpic:p-0 wpic:rounded-full wpic:text-xs":"",t.variant==="text"?n.active?"wpic:bg-transparent wpic:text-indigo-600 wpic:dark:text-indigo-400":"wpic:bg-transparent wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-200":"",(t.variant??"primary")==="primary"?"wpic-btn-primary wpic:text-white":"",(t.variant??"primary")==="secondary"?"wpic:bg-zinc-100 wpic:hover:bg-zinc-200 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="subtle"?"wpic:bg-zinc-100 wpic:border wpic:border-zinc-100 wpic:hover:bg-zinc-200/70 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="destructive"?"wpic:bg-red-500 wpic:hover:bg-red-600 wpic:text-white":"",(t.variant??"primary")==="ghost"?"wpic:bg-transparent wpic:hover:bg-zinc-100 wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-100":"",t.variant==="ghost-transparent"?"wpic:bg-transparent wpic:hover:bg-[#80808026] wpic:text-inherit":"",t.variant==="ghost-transparent"&&!n.disabled&&!n.loading?"wpic:opacity-60 wpic:hover:opacity-100 wpic:focus-visible:opacity-100":"",(t.variant??"primary")==="outline"?"wpic:bg-transparent wpic:border wpic:border-zinc-200 wpic:hover:bg-zinc-50 wpic:text-zinc-700 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-300":""])},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:justify-center wpic:gap-[inherit]",n.loading?"wpic:invisible":""])},[n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?12:((t.size??"md")==="lg",15)},null,8,["size"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")],2),n.loading?(e.openBlock(),e.createElementBlock("span",C0,[e.createVNode(e.unref(k.Loader2),{size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?13:(t.size??"md")==="lg"?17:15,class:"wpic:animate-spin"},null,8,["size"])])):e.createCommentVNode("",!0)]),_:3},8,["href","disabled","data-variant","data-size","data-active","class"]))}}),z0={class:"wpic-button-group wpic:inline-flex"},E2=e.defineComponent({__name:"WButtonGroup",setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("div",z0,[e.renderSlot(s.$slots,"default")]))}}),y0={class:"wpic-filter wpic:flex wpic:items-center wpic:gap-1"},x0=["onClick"],B0=e.defineComponent({__name:"WFilter",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("div",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,(l,o)=>(e.openBlock(),e.createElementBlock("button",{key:o,type:"button",onClick:c=>s.$emit("update:modelValue",l.value),class:e.normalizeClass(["wpic:px-2.5 wpic:py-1 wpic:text-base wpic:font-medium wpic:rounded-full wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:whitespace-nowrap",n.modelValue===l.value?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:border wpic:border-zinc-300 wpic:dark:border-zinc-600":"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:border wpic:border-transparent"])},e.toDisplayString(l.label),11,x0))),128))]))}}),M0={class:"wpic-form-label wpic:block wpic:mb-1 wpic:font-medium wpic:text-zinc-600 wpic:dark:text-zinc-400"},V0={key:0,class:"wpic:ml-0.5",style:{color:"#EF4444"}},r2=e.defineComponent({__name:"WFormLabel",props:{required:{type:Boolean}},setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("label",M0,[e.renderSlot(s.$slots,"default"),n.required?(e.openBlock(),e.createElementBlock("span",V0,"*")):e.createCommentVNode("",!0)]))}}),E0={class:"wpic:relative wpic:flex wpic:items-center wpic:w-full"},N0=["data-size","data-variant","type","placeholder","disabled","required"],S0={key:2,class:"wpic:pointer-events-none wpic:absolute wpic:right-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},s2=e.defineComponent({inheritAttrs:!1,__name:"WInput",props:e.mergeModels({icon:{type:[Object,Function]},label:{},placeholder:{},required:{type:Boolean},type:{},disabled:{type:Boolean},size:{},clearable:{type:Boolean},loading:{type:Boolean},variant:{},prepend:{},append:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const s=e.useModel(n,"modelValue"),t=n,l=e.useSlots(),o=e.computed(()=>t.prepend!==void 0||!!l.prepend),c=e.computed(()=>t.append!==void 0||!!l.append),i=e.computed(()=>{if(t.icon)return t.icon;if(t.type==="date")return k.Calendar;if(t.type==="money")return k.DollarSign}),w=e.computed(()=>({sm:12,md:13,lg:14,xl:16})[t.size??"md"]),u=e.computed(()=>t.type==="money"?"number":t.type??"text"),C=e.ref(),a=e.ref(),B=e.ref(0);let g;e.watch(a,M=>{g?.disconnect(),B.value=M?.getBoundingClientRect().width??0,M&&(g=new ResizeObserver(()=>{B.value=M.getBoundingClientRect().width}),g.observe(M))},{flush:"post"}),e.onBeforeUnmount(()=>g?.disconnect());function z(){t.type==="date"&&C.value?.showPicker()}if(typeof document<"u"){const M="winput-date-no-picker";if(!document.getElementById(M)){const f=document.createElement("style");f.id=M,f.textContent='input[type="date"]::-webkit-calendar-picker-indicator { display: none; }',document.head.appendChild(f)}const v="winput-number-no-spinner";if(!document.getElementById(v)){const f=document.createElement("style");f.id=v,f.textContent="input.winput-number::-webkit-outer-spin-button, input.winput-number::-webkit-inner-spin-button { display: none; } input.winput-number { -moz-appearance: textfield; }",document.head.appendChild(f)}}return(M,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(M.$attrs,{class:"wpic:w-full"}),[t.label?(e.openBlock(),e.createBlock(r2,{key:0,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",E0,[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,size:w.value,class:e.normalizeClass(["wpic:absolute wpic:shrink-0 wpic:text-zinc-400 wpic:dark:text-zinc-500",[t.size==="xl"?"wpic:left-4":"wpic:left-2.5",t.type==="date"?"wpic:cursor-pointer":"wpic:pointer-events-none"]]),onClick:z},null,8,["size","class"])):o.value?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"prependRef",ref:a,class:"wpic:pointer-events-none wpic:absolute wpic:left-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.renderSlot(M.$slots,"prepend",{},()=>[e.createTextVNode(e.toDisplayString(t.prepend),1)])],512)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:C,class:e.normalizeClass(["wpic-control",["wpic:w-full wpic:rounded-lg wpic:outline-none wpic:transition-colors",t.size==="sm"?"wpic:text-sm":"wpic:text-base",u.value==="number"?"winput-number":"",t.size==="sm"?"wpic:h-8":t.size==="lg"?"wpic:h-11":t.size==="xl"?"wpic:h-14":"wpic:h-9",i.value||o.value?t.size==="xl"?"wpic:pl-11":"wpic:pl-9":t.size==="xl"?"wpic:pl-4":"wpic:pl-2.5",c.value&&(t.clearable&&s.value||t.loading)?"wpic:pr-14":c.value?"wpic:pr-9":t.clearable&&s.value||t.loading?t.size==="xl"?"wpic:pr-10":"wpic:pr-7":t.size==="xl"?"wpic:pr-4":"wpic:pr-2.5",t.variant==="plain"?"wpic:bg-transparent wpic:border-0 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:focus-visible:ring-1 wpic:focus-visible:ring-current wpic:disabled:opacity-60 wpic:disabled:cursor-not-allowed":t.disabled?(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":"wpic:bg-zinc-50 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:cursor-text wpic:hover:bg-zinc-200/70 wpic:dark:hover:bg-zinc-700":"wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic-input-field wpic:cursor-text"]]),style:e.normalizeStyle(o.value&&!i.value?{paddingLeft:`calc(${B.value}px + 1.25rem)`}:void 0),"data-size":t.size??"md","data-variant":t.variant??"default","onUpdate:modelValue":v[0]||(v[0]=f=>s.value=f),type:u.value,placeholder:t.placeholder??"",disabled:t.disabled,required:t.required},null,14,N0),[[e.vModelDynamic,s.value]]),c.value?(e.openBlock(),e.createElementBlock("span",S0,[e.renderSlot(M.$slots,"append",{},()=>[e.createTextVNode(e.toDisplayString(t.append),1)])])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(e.unref(k.Loader2),{key:3,size:t.size==="xl"?14:11,class:e.normalizeClass(["wpic:absolute wpic:animate-spin wpic:text-zinc-400 wpic:dark:text-zinc-500",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},null,8,["size","class"])):t.clearable&&s.value?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",onClick:v[1]||(v[1]=f=>s.value=""),class:e.normalizeClass(["wpic:absolute wpic:flex wpic:items-center wpic:justify-center wpic:text-zinc-400 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:transition-colors wpic:cursor-pointer",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},[e.createVNode(e.unref(k.X),{size:t.size==="xl"?14:11},null,8,["size"])],2)):e.createCommentVNode("",!0)])],16))}}),L0=["disabled"],a2=e.defineComponent({__name:"WCheckbox",props:e.mergeModels({disabled:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const s=e.useModel(n,"modelValue");return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["wpic-checkbox wpic:relative wpic:inline-flex wpic:items-center wpic:gap-2 wpic:select-none",n.disabled?"wpic:cursor-not-allowed wpic:opacity-50":"wpic:cursor-pointer"])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=o=>s.value=o),disabled:n.disabled,class:"wpic:peer wpic:sr-only"},null,8,L0),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",{class:e.normalizeClass(["wpic-checkbox-box",["wpic:flex wpic:h-4 wpic:w-4 wpic:shrink-0 wpic:items-center wpic:justify-center wpic:rounded-[4px] wpic:border wpic:transition-all wpic:duration-150","wpic:peer-focus-visible:ring-2 wpic:peer-focus-visible:ring-zinc-400/40 wpic:peer-focus-visible:ring-offset-1 wpic:peer-focus-visible:ring-offset-white wpic:dark:peer-focus-visible:ring-offset-zinc-950",s.value?"wpic:border-zinc-900 wpic:bg-zinc-900 wpic:text-white wpic:dark:border-zinc-100 wpic:dark:bg-zinc-100 wpic:dark:text-zinc-950":"wpic:border-zinc-300 wpic:bg-white wpic:text-transparent wpic:shadow-sm wpic:hover:border-zinc-400 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-900 wpic:dark:hover:border-zinc-500"]])},[e.createVNode(e.unref(k.Check),{size:11,"stroke-width":"2.6"})],2),e.renderSlot(t.$slots,"default")],2))}}),Q1=e.defineComponent({__name:"WSpinner",props:{size:{default:"md"},tone:{default:"muted"}},setup(n){const s=n,t={sm:"wpic:h-4 wpic:w-4 wpic:border-2",md:"wpic:h-5 wpic:w-5 wpic:border-2",lg:"wpic:h-7 wpic:w-7 wpic:border-[3px]"};return(l,o)=>(e.openBlock(),e.createElementBlock("span",{role:"status","aria-live":"polite","aria-label":"Loading",class:e.normalizeClass(["wpic-spinner","wpic:inline-block wpic:shrink-0 wpic:animate-spin wpic:rounded-full wpic:border-current wpic:border-t-transparent",t[s.size],s.tone==="muted"?"wpic:text-zinc-300 wpic:dark:text-zinc-700":"wpic:text-[var(--wpic-primary,#6366f1)]"])},null,2))}}),$0={key:0,class:"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:whitespace-nowrap wpic:shrink-0"},D0={key:1,role:"status","aria-live":"polite",class:"wpic:flex wpic:items-center wpic:justify-center wpic:py-12 wpic:gap-3 wpic:text-base wpic:text-zinc-400 wpic:dark:text-zinc-500"},F0={class:"wpic-table__scroll",style:{"overflow-x":"auto"}},T0={class:"wpic:w-full wpic:border-collapse"},A0={key:0,style:{width:"36px"}},H0={key:1,style:{width:"32px"}},P0={key:0},j0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},W0=["onClick"],I0={key:1},R0={key:0,class:"wpic-table__summary wpic-table__divider wpic:border-b wpic:border-zinc-200 wpic:font-medium wpic:dark:border-zinc-700"},Z0={key:0},U0={key:1},K0=["onClick"],O0=["onClick"],q0={key:0,class:"wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},Y0=["colspan"],Q0={key:2},J0=["colspan"],X0={class:"wpic:flex wpic:flex-col wpic:items-center wpic:gap-2"},G0={class:"wpic:tabular-nums wpic:text-zinc-400 wpic:dark:text-zinc-500"},_0={key:0,class:"wpic-table__pagination wpic:flex wpic:items-center wpic:gap-0.5"},e3=["aria-label","disabled"],n3={key:0,class:"wpic:w-6 wpic:text-center wpic:text-base wpic:select-none wpic:text-zinc-400 wpic:dark:text-zinc-500"},t3=["onClick"],c3=["aria-label","disabled"],i3=e.defineComponent({__name:"WTable",props:{data:{},columns:{},loading:{type:Boolean},loadingSpinner:{type:Boolean,default:!0},labels:{},emptyText:{},pageSize:{},serverTotal:{},serverPage:{},serverSort:{},searchPlaceholder:{default:"Search…"},rowClickable:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedKeys:{},rowKey:{default:"id"},flushEdges:{type:Boolean,default:!1},rowClass:{},rowStyle:{},cellStyle:{},summaryRow:{},compact:{type:Boolean},padding:{},showFooter:{type:Boolean,default:!0},columnDividers:{type:Boolean,default:!1}},emits:["row-click","update:selectedKeys","row-select","update:serverPage","update:serverSort"],setup(n,{expose:s,emit:t}){const l=n,o=t,c=e.ref(new Set);function i(j){c.value.has(j)?c.value.delete(j):c.value.add(j)}const w=e.useSlots(),u=e.computed(()=>l.pageSize??25),C=e.ref({field:null,direction:"asc"}),a=e.computed(()=>(l.serverSort??C.value).field),B=e.computed(()=>(l.serverSort??C.value).direction);function g(j){const D=a.value===j&&B.value==="asc"?"desc":"asc",x={field:j,direction:D};l.serverSort?o("update:serverSort",x):C.value=x}const z=e.ref(""),M=e.computed(()=>l.columns.some(j=>j.searchable)),v=e.computed(()=>{let j=l.data??[];const D=z.value.trim().toLowerCase();if(D){const x=l.columns.filter(I=>I.searchable).map(I=>I.field);j=j.filter(I=>x.some(e1=>String(I[e1]??"").toLowerCase().includes(D)))}if(a.value&&!l.serverSort){const x=a.value;j=[...j].sort((I,e1)=>{const t1=I[x]??"",d1=e1[x]??"",h=typeof t1=="number"&&typeof d1=="number"?t1-d1:String(t1).toLowerCase().localeCompare(String(d1).toLowerCase());return B.value==="asc"?h:-h})}return j}),f=e.ref(1),T=e.computed(()=>l.serverTotal!==void 0),U=e.computed({get:()=>T.value?l.serverPage??1:f.value,set:j=>{T.value?o("update:serverPage",j):f.value=j}}),Y=e.computed(()=>T.value?l.serverTotal??0:v.value.length),Q=e.computed(()=>Math.max(1,Math.ceil(Y.value/u.value)));e.watch([z,()=>l.data],()=>{T.value||(U.value=1),c.value.clear()});const R=e.computed(()=>{if(T.value)return v.value;const j=(U.value-1)*u.value;return v.value.slice(j,j+u.value)});function F(j,D){const x=j[l.rowKey];return typeof x=="string"||typeof x=="number"?x:`${U.value}:${D}`}const N=e.computed(()=>new Set(l.selectedKeys??[])),A=e.computed(()=>R.value.map(F)),m=e.computed(()=>l.selectable&&A.value.length>0&&A.value.every(j=>N.value.has(j)));function W(j,D,x){const I=F(j,D),e1=new Set(l.selectedKeys??[]),t1=x===!0;t1?e1.add(I):e1.delete(I),o("update:selectedKeys",[...e1]),o("row-select",j,t1)}function J(j){const D=new Set(l.selectedKeys??[]),x=j===!0;for(const I of A.value)x?D.add(I):D.delete(I);o("update:selectedKeys",[...D])}const l1=e.computed(()=>Y.value===0?0:(U.value-1)*u.value+1),E=e.computed(()=>Math.min(U.value*u.value,Y.value)),Z=e.computed(()=>{const j=Q.value;if(j<=7)return Array.from({length:j},(t1,d1)=>d1+1);const D=U.value,x=[],I=new Set([1,j,D-1,D,D+1].filter(t1=>t1>=1&&t1<=j));let e1=0;for(const t1 of[...I].sort((d1,h)=>d1-h))t1-e1>1&&x.push("…"),x.push(t1),e1=t1;return x}),H=e.computed(()=>l.padding?`wpic-table--padding-${l.padding}`:l.compact?"wpic-table--padding-sm":"wpic-table--padding-inherit"),a1=j=>j==="right"?"wpic:text-right":j==="center"?"wpic:text-center":"wpic:text-left",i1=(j,D)=>[D,l.flushEdges&&j===0&&!l.expandable&&!l.selectable?"wpic:pl-0":"wpic-table__pad-l",l.flushEdges&&j===l.columns.length-1?"wpic:pr-0":"wpic-table__pad-r"],X=j=>({...j.width?{width:j.width}:{},...j.minWidth?{minWidth:j.minWidth}:{}});return s({filteredCount:e.computed(()=>v.value.length),searchQuery:z}),(j,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wpic-table",[H.value,{"wpic-table--column-dividers":n.columnDividers}]])},[(M.value||e.unref(w).toolbar)&&!n.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:gap-2 wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2"])},[M.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s2,{modelValue:z.value,"onUpdate:modelValue":D[0]||(D[0]=x=>z.value=x),placeholder:n.searchPlaceholder,icon:e.unref(k.Search),class:"wpic:flex-1"},null,8,["modelValue","placeholder","icon"]),z.value?(e.openBlock(),e.createElementBlock("span",$0,e.toDisplayString(v.value.length)+" "+e.toDisplayString(n.labels?.results??"results"),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(j.$slots,"toolbar")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",D0,[n.loadingSpinner?(e.openBlock(),e.createBlock(Q1,{key:0,tone:"muted"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.labels?.loading??"Loading…"),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",F0,[e.createElementVNode("table",T0,[e.createElementVNode("colgroup",null,[n.selectable?(e.openBlock(),e.createElementBlock("col",A0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("col",H0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,x=>(e.openBlock(),e.createElementBlock("col",{key:x.field,style:e.normalizeStyle(X(x))},null,4))),128))]),l.showHeader!==!1?(e.openBlock(),e.createElementBlock("thead",P0,[e.createElementVNode("tr",j0,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges?"wpic:pl-0":"wpic:pl-2"])},[e.createVNode(a2,{"model-value":m.value,onClick:D[1]||(D[1]=e.withModifiers(()=>{},["stop"])),"onUpdate:modelValue":J},null,8,["model-value"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-2"])},null,2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(x,I)=>(e.openBlock(),e.createElementBlock("th",{key:x.field,class:e.normalizeClass([i1(I,n.compact?"wpic:py-1.5":"wpic:py-3"),"wpic:whitespace-nowrap wpic:text-zinc-500 wpic:dark:text-zinc-300 wpic:font-medium",a1(x.align),I===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10":""]),style:e.normalizeStyle({...X(x)})},[e.renderSlot(j.$slots,"th-"+x.field,{col:x,sortField:a.value,sortDir:B.value,toggleSort:g},()=>[x.sortable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:e1=>g(x.field),class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:gap-1 wpic:cursor-pointer wpic:transition-colors wpic:whitespace-nowrap",x.align==="right"?"wpic:ml-auto":""]),style:{color:"inherit"}},[e.createTextVNode(e.toDisplayString(x.label)+" ",1),a.value===x.field&&B.value==="asc"?(e.openBlock(),e.createBlock(e.unref(k.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):a.value===x.field&&B.value==="desc"?(e.openBlock(),e.createBlock(e.unref(k.ChevronDown),{key:1,size:11,style:{color:"#5E6AD2"}})):(e.openBlock(),e.createBlock(e.unref(k.ChevronsUpDown),{key:2,size:10,style:{opacity:"0.3"}}))],10,W0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(x.label),1)],64))])],6))),128))])])):e.createCommentVNode("",!0),n.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",I0,[n.summaryRow?(e.openBlock(),e.createElementBlock("tr",R0,[n.selectable?(e.openBlock(),e.createElementBlock("td",Z0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",U0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(x,I)=>(e.openBlock(),e.createElementBlock("td",{key:x.field,class:e.normalizeClass([i1(I,n.compact?"wpic:py-1":"wpic:py-2.5"),a1(x.align),I===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100":"wpic:text-zinc-700 wpic:dark:text-zinc-200"])},[e.renderSlot(j.$slots,"summary-"+x.field,{row:n.summaryRow,value:n.summaryRow[x.field]},()=>[e.createTextVNode(e.toDisplayString(n.summaryRow[x.field]??"—"),1)])],2))),128))])):e.createCommentVNode("",!0),R.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R.value,(x,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I},[e.createElementVNode("tr",{class:e.normalizeClass(["wpic-table__row wpic:group wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800",[n.expandable&&c.value.has(I)?"wpic:border-b-0":"",n.rowClass?.(x)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(x)??{}}),onClick:e1=>n.expandable?i(I):n.rowClickable&&o("row-click",x)},[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges?"wpic:pl-0":"wpic:pl-2"]),onClick:D[2]||(D[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(a2,{"model-value":N.value.has(F(x,I)),"onUpdate:modelValue":e1=>W(x,I,e1)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-1 wpic:text-zinc-400 wpic:dark:text-zinc-500",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-3"])},[c.value.has(I)?(e.openBlock(),e.createBlock(e.unref(k.ChevronDown),{key:0,size:13,style:{transition:"transform .15s"}})):(e.openBlock(),e.createBlock(e.unref(k.ChevronRight),{key:1,size:13,style:{transition:"transform .15s"}}))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(e1,t1)=>(e.openBlock(),e.createElementBlock("td",{key:e1.field,class:e.normalizeClass([i1(t1,n.compact?"wpic:py-1":"wpic:py-2.5"),a1(e1.align),t1===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:font-medium":"wpic:text-zinc-700 wpic:dark:text-zinc-200"]),style:e.normalizeStyle(n.cellStyle?.(x,e1)),onClick:d1=>n.expandable?(n.rowClickable&&o("row-click",x),d1.stopPropagation()):void 0},[e.renderSlot(j.$slots,e1.field,{row:x,value:x[e1.field]},()=>[e.createTextVNode(e.toDisplayString(x[e1.field]??"—"),1)])],14,O0))),128))],14,K0),n.expandable&&c.value.has(I)?(e.openBlock(),e.createElementBlock("tr",q0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic-table__pad-x wpic:pb-3 wpic:pt-0"},[e.renderSlot(j.$slots,"expand",{row:x})],8,Y0)])):e.createCommentVNode("",!0)],64))),128)):(e.openBlock(),e.createElementBlock("tr",Q0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic:py-16 wpic:text-center wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.createElementVNode("div",X0,[e.renderSlot(j.$slots,"empty-icon"),e.createTextVNode(" "+e.toDisplayString(n.emptyText??"No data"),1)])],8,J0)]))]))])]),n.showFooter&&Y.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic-table__footer",["wpic:flex wpic:items-center wpic:justify-between wpic-table__divider wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2.5"]])},[e.createElementVNode("span",G0,[Q.value>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(l1.value)+"–"+e.toDisplayString(E.value)+" "+e.toDisplayString(n.labels?.of??"of")+" "+e.toDisplayString(Y.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Y.value)+" "+e.toDisplayString(Y.value===1?n.labels?.item??"item":n.labels?.items??"items"),1)],64))]),Q.value>1?(e.openBlock(),e.createElementBlock("div",_0,[e.createElementVNode("button",{"aria-label":n.labels?.previous??"Previous page",onClick:D[3]||(D[3]=x=>U.value--),disabled:U.value===1,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(k.ChevronLeft),{size:13})],8,e3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[x==="…"?(e.openBlock(),e.createElementBlock("span",n3,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:I=>U.value=x,class:e.normalizeClass(["wpic:h-7 wpic:min-w-7 wpic:px-2 wpic:rounded-md wpic:text-sm wpic:font-medium wpic:transition-colors wpic:cursor-pointer",U.value===x?"":"wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"]),style:e.normalizeStyle(U.value===x?"background:rgba(94,106,210,0.1);color:#5E6AD2":void 0)},e.toDisplayString(x),15,t3))],64))),128)),e.createElementVNode("button",{"aria-label":n.labels?.next??"Next page",onClick:D[4]||(D[4]=x=>U.value++),disabled:U.value===Q.value,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(k.ChevronRight),{size:13})],8,c3)])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))],2))}}),l3={key:0,class:"w-spreadsheet-frame__heading"},a3={key:1,class:"w-spreadsheet-frame__status"},o3=["title","aria-label"],r3={key:1,class:"wpic:flex wpic:min-h-64 wpic:items-center wpic:justify-center wpic:gap-3 wpic:text-zinc-400 wpic:dark:text-zinc-500"},s3={key:0,class:"w-spreadsheet__row-axis-col"},p3={key:0},d3={key:0,class:"w-spreadsheet__corner"},w3={key:0,class:"w-spreadsheet__axis"},u3=["colspan","title","tabindex","onClick","onKeydown","onPointerenter","onPointerdown"],m3={key:0,class:"w-spreadsheet__editor"},h3=["type","value","min","placeholder","onInput"],f3=["onPointerdown"],v3=e.defineComponent({__name:"WSpreadsheet",props:{appearance:{},columns:{},rows:{},showAxes:{type:Boolean,default:!0},showColumnLetters:{type:Boolean,default:!0},showRowNumbers:{type:Boolean,default:!0},minWidth:{default:"960px"},maxHeight:{default:"68vh"},sortable:{type:Boolean},expandable:{type:Boolean},showExpandButton:{type:Boolean},actionsOnHover:{type:Boolean},downloadable:{type:Boolean},showDownloadButton:{type:Boolean},downloadFilename:{},fillHandle:{type:Boolean},expanded:{type:Boolean},downloadRequest:{},loading:{type:Boolean}},emits:["update:expanded","cell-change"],setup(n,{expose:s,emit:t}){const l=n,o=t,c=e.computed(()=>l.showAxes&&l.showColumnLetters),i=e.computed(()=>l.showAxes&&l.showRowNumbers),w=e.computed(()=>l.columns.some(h=>h.sticky)),u=e.ref(null),C=e.ref("asc"),a=e.ref(l.expanded??!1),B=e.ref(null),g=e.ref(null),z=e.ref(null),M=e.ref(null),v=e.ref(null);function f(){if(!l.downloadable)return;const h=$=>`"${String($??"").replace(/"/g,'""')}"`,L=F.value.map($=>l.columns.map(P=>h(Q($,P.key))).join(",")).join(`\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("lucide-vue-next"),c1=require("@floating-ui/vue"),m0=require("pinia"),q1=require("@tiptap/vue-3"),h0=require("@tiptap/extension-document"),f0=require("@tiptap/extension-paragraph"),v0=require("@tiptap/extension-text"),b0=require("@tiptap/extension-character-count"),g0=require("@tiptap/starter-kit"),k0=require("@tiptap/extension-placeholder");var H1=typeof document<"u"?document.currentScript:null;const C0={key:0,class:"wpic:absolute wpic:inset-0 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-[inherit]","aria-hidden":"true"},D1=e.defineComponent({__name:"WButton",props:{variant:{},size:{},loading:{type:Boolean},disabled:{type:Boolean},active:{type:Boolean},icon:{type:[Object,Function]},href:{}},emits:["click"],setup(n,{emit:s}){const t=n,l=s;return(o,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.href?"a":"button"),{href:n.href,disabled:n.disabled||n.loading,"data-variant":t.variant??"primary","data-size":t.size??"md","data-active":n.active?"true":void 0,onClick:c[0]||(c[0]=i=>l("click",i)),class:e.normalizeClass(["wpic-button","wpic:relative wpic:inline-flex wpic:items-center wpic:justify-center wpic:font-medium wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:select-none","wpic:focus-visible:outline-none wpic:focus-visible:ring-2 wpic:focus-visible:ring-indigo-500/50 wpic:focus-visible:ring-offset-1","wpic:active:scale-[0.98]",n.disabled||n.loading?"wpic:opacity-40 wpic:cursor-not-allowed wpic:pointer-events-none":"",n.active&&t.variant!=="text"?"wpic-button--active":"",(t.size??"md")==="sm"?"wpic:h-8 wpic:touch-manipulation wpic:px-2.5 wpic:gap-1.5 wpic:rounded-md wpic:text-sm":"",(t.size??"md")==="md"?(t.variant==="subtle"?"wpic:h-11":"wpic:h-9")+" wpic:px-3.5 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="lg"?(t.variant==="subtle"?"wpic:h-12":"wpic:h-11")+" wpic:px-4 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="xs"?"wpic:h-5 wpic:w-5 wpic:p-0 wpic:rounded-full wpic:text-xs":"",t.variant==="text"?n.active?"wpic:bg-transparent wpic:text-indigo-600 wpic:dark:text-indigo-400":"wpic:bg-transparent wpic:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:text-zinc-500 wpic:dark:hover:text-zinc-400":"",(t.variant??"primary")==="primary"?"wpic-btn-primary wpic:text-white":"",(t.variant??"primary")==="secondary"?"wpic:bg-zinc-100 wpic:hover:bg-zinc-200 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="subtle"?"wpic:bg-zinc-100 wpic:border wpic:border-zinc-100 wpic:hover:bg-zinc-200/70 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="destructive"?"wpic:bg-red-500 wpic:hover:bg-red-600 wpic:text-white":"",(t.variant??"primary")==="ghost"?"wpic:bg-transparent wpic:hover:bg-zinc-100 wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-100":"",t.variant==="ghost-transparent"?"wpic:bg-transparent wpic:hover:bg-[#80808026] wpic:text-inherit":"",t.variant==="ghost-transparent"&&!n.disabled&&!n.loading?"wpic:opacity-60 wpic:hover:opacity-100 wpic:focus-visible:opacity-100":"",(t.variant??"primary")==="outline"?"wpic:bg-transparent wpic:border wpic:border-zinc-200 wpic:hover:bg-zinc-50 wpic:text-zinc-700 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-300":""])},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:justify-center wpic:gap-[inherit]",n.loading?"wpic:invisible":""])},[n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?12:((t.size??"md")==="lg",15)},null,8,["size"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")],2),n.loading?(e.openBlock(),e.createElementBlock("span",C0,[e.createVNode(e.unref(k.Loader2),{size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?13:(t.size??"md")==="lg"?17:15,class:"wpic:animate-spin"},null,8,["size"])])):e.createCommentVNode("",!0)]),_:3},8,["href","disabled","data-variant","data-size","data-active","class"]))}}),z0={class:"wpic-button-group wpic:inline-flex"},E2=e.defineComponent({__name:"WButtonGroup",setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("div",z0,[e.renderSlot(s.$slots,"default")]))}}),y0={class:"wpic-filter wpic:flex wpic:items-center wpic:gap-1"},x0=["onClick"],B0=e.defineComponent({__name:"WFilter",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("div",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,(l,o)=>(e.openBlock(),e.createElementBlock("button",{key:o,type:"button",onClick:c=>s.$emit("update:modelValue",l.value),class:e.normalizeClass(["wpic:px-2.5 wpic:py-1 wpic:text-base wpic:font-medium wpic:rounded-full wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:whitespace-nowrap",n.modelValue===l.value?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:border wpic:border-zinc-300 wpic:dark:border-zinc-600":"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:border wpic:border-transparent"])},e.toDisplayString(l.label),11,x0))),128))]))}}),M0={class:"wpic-form-label wpic:block wpic:mb-1 wpic:font-medium wpic:text-zinc-600 wpic:dark:text-zinc-400"},V0={key:0,class:"wpic:ml-0.5",style:{color:"#EF4444"}},r2=e.defineComponent({__name:"WFormLabel",props:{required:{type:Boolean}},setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("label",M0,[e.renderSlot(s.$slots,"default"),n.required?(e.openBlock(),e.createElementBlock("span",V0,"*")):e.createCommentVNode("",!0)]))}}),E0={class:"wpic:relative wpic:flex wpic:items-center wpic:w-full"},N0=["data-size","data-variant","type","placeholder","disabled","required"],S0={key:2,class:"wpic:pointer-events-none wpic:absolute wpic:right-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},s2=e.defineComponent({inheritAttrs:!1,__name:"WInput",props:e.mergeModels({icon:{type:[Object,Function]},label:{},placeholder:{},required:{type:Boolean},type:{},disabled:{type:Boolean},size:{},clearable:{type:Boolean},loading:{type:Boolean},variant:{},prepend:{},append:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const s=e.useModel(n,"modelValue"),t=n,l=e.useSlots(),o=e.computed(()=>t.prepend!==void 0||!!l.prepend),c=e.computed(()=>t.append!==void 0||!!l.append),i=e.computed(()=>{if(t.icon)return t.icon;if(t.type==="date")return k.Calendar;if(t.type==="money")return k.DollarSign}),w=e.computed(()=>({sm:12,md:13,lg:14,xl:16})[t.size??"md"]),u=e.computed(()=>t.type==="money"?"number":t.type??"text"),C=e.ref(),a=e.ref(),B=e.ref(0);let g;e.watch(a,M=>{g?.disconnect(),B.value=M?.getBoundingClientRect().width??0,M&&(g=new ResizeObserver(()=>{B.value=M.getBoundingClientRect().width}),g.observe(M))},{flush:"post"}),e.onBeforeUnmount(()=>g?.disconnect());function z(){t.type==="date"&&C.value?.showPicker()}if(typeof document<"u"){const M="winput-date-no-picker";if(!document.getElementById(M)){const f=document.createElement("style");f.id=M,f.textContent='input[type="date"]::-webkit-calendar-picker-indicator { display: none; }',document.head.appendChild(f)}const v="winput-number-no-spinner";if(!document.getElementById(v)){const f=document.createElement("style");f.id=v,f.textContent="input.winput-number::-webkit-outer-spin-button, input.winput-number::-webkit-inner-spin-button { display: none; } input.winput-number { -moz-appearance: textfield; }",document.head.appendChild(f)}}return(M,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(M.$attrs,{class:"wpic:w-full"}),[t.label?(e.openBlock(),e.createBlock(r2,{key:0,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",E0,[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,size:w.value,class:e.normalizeClass(["wpic:absolute wpic:shrink-0 wpic:text-zinc-400 wpic:dark:text-zinc-500",[t.size==="xl"?"wpic:left-4":"wpic:left-2.5",t.type==="date"?"wpic:cursor-pointer":"wpic:pointer-events-none"]]),onClick:z},null,8,["size","class"])):o.value?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"prependRef",ref:a,class:"wpic:pointer-events-none wpic:absolute wpic:left-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.renderSlot(M.$slots,"prepend",{},()=>[e.createTextVNode(e.toDisplayString(t.prepend),1)])],512)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:C,class:e.normalizeClass(["wpic-control",["wpic:w-full wpic:rounded-lg wpic:outline-none wpic:transition-colors",t.size==="sm"?"wpic:text-sm":"wpic:text-base",u.value==="number"?"winput-number":"",t.size==="sm"?"wpic:h-8":t.size==="lg"?"wpic:h-11":t.size==="xl"?"wpic:h-14":"wpic:h-9",i.value||o.value?t.size==="xl"?"wpic:pl-11":"wpic:pl-9":t.size==="xl"?"wpic:pl-4":"wpic:pl-2.5",c.value&&(t.clearable&&s.value||t.loading)?"wpic:pr-14":c.value?"wpic:pr-9":t.clearable&&s.value||t.loading?t.size==="xl"?"wpic:pr-10":"wpic:pr-7":t.size==="xl"?"wpic:pr-4":"wpic:pr-2.5",t.variant==="plain"?"wpic:bg-transparent wpic:border-0 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:focus-visible:ring-1 wpic:focus-visible:ring-current wpic:disabled:opacity-60 wpic:disabled:cursor-not-allowed":t.disabled?(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":"wpic:bg-zinc-50 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:cursor-text wpic:hover:bg-zinc-200/70 wpic:dark:hover:bg-zinc-700":"wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic-input-field wpic:cursor-text"]]),style:e.normalizeStyle(o.value&&!i.value?{paddingLeft:`calc(${B.value}px + 1.25rem)`}:void 0),"data-size":t.size??"md","data-variant":t.variant??"default","onUpdate:modelValue":v[0]||(v[0]=f=>s.value=f),type:u.value,placeholder:t.placeholder??"",disabled:t.disabled,required:t.required},null,14,N0),[[e.vModelDynamic,s.value]]),c.value?(e.openBlock(),e.createElementBlock("span",S0,[e.renderSlot(M.$slots,"append",{},()=>[e.createTextVNode(e.toDisplayString(t.append),1)])])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(e.unref(k.Loader2),{key:3,size:t.size==="xl"?14:11,class:e.normalizeClass(["wpic:absolute wpic:animate-spin wpic:text-zinc-400 wpic:dark:text-zinc-500",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},null,8,["size","class"])):t.clearable&&s.value?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",onClick:v[1]||(v[1]=f=>s.value=""),class:e.normalizeClass(["wpic:absolute wpic:flex wpic:items-center wpic:justify-center wpic:text-zinc-400 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:transition-colors wpic:cursor-pointer",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},[e.createVNode(e.unref(k.X),{size:t.size==="xl"?14:11},null,8,["size"])],2)):e.createCommentVNode("",!0)])],16))}}),L0=["disabled"],a2=e.defineComponent({__name:"WCheckbox",props:e.mergeModels({disabled:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const s=e.useModel(n,"modelValue");return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["wpic-checkbox wpic:relative wpic:inline-flex wpic:items-center wpic:gap-2 wpic:select-none",n.disabled?"wpic:cursor-not-allowed wpic:opacity-50":"wpic:cursor-pointer"])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=o=>s.value=o),disabled:n.disabled,class:"wpic:peer wpic:sr-only"},null,8,L0),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",{class:e.normalizeClass(["wpic-checkbox-box",["wpic:flex wpic:h-4 wpic:w-4 wpic:shrink-0 wpic:items-center wpic:justify-center wpic:rounded-[4px] wpic:border wpic:transition-all wpic:duration-150","wpic:peer-focus-visible:ring-2 wpic:peer-focus-visible:ring-zinc-400/40 wpic:peer-focus-visible:ring-offset-1 wpic:peer-focus-visible:ring-offset-white wpic:dark:peer-focus-visible:ring-offset-zinc-950",s.value?"wpic:border-zinc-900 wpic:bg-zinc-900 wpic:text-white wpic:dark:border-zinc-100 wpic:dark:bg-zinc-100 wpic:dark:text-zinc-950":"wpic:border-zinc-300 wpic:bg-white wpic:text-transparent wpic:shadow-sm wpic:hover:border-zinc-400 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-900 wpic:dark:hover:border-zinc-500"]])},[e.createVNode(e.unref(k.Check),{size:11,"stroke-width":"2.6"})],2),e.renderSlot(t.$slots,"default")],2))}}),Q1=e.defineComponent({__name:"WSpinner",props:{size:{default:"md"},tone:{default:"muted"}},setup(n){const s=n,t={sm:"wpic:h-4 wpic:w-4 wpic:border-2",md:"wpic:h-5 wpic:w-5 wpic:border-2",lg:"wpic:h-7 wpic:w-7 wpic:border-[3px]"};return(l,o)=>(e.openBlock(),e.createElementBlock("span",{role:"status","aria-live":"polite","aria-label":"Loading",class:e.normalizeClass(["wpic-spinner","wpic:inline-block wpic:shrink-0 wpic:animate-spin wpic:rounded-full wpic:border-current wpic:border-t-transparent",t[s.size],s.tone==="muted"?"wpic:text-zinc-300 wpic:dark:text-zinc-700":"wpic:text-[var(--wpic-primary,#6366f1)]"])},null,2))}}),$0={key:0,class:"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:whitespace-nowrap wpic:shrink-0"},D0={key:1,role:"status","aria-live":"polite",class:"wpic:flex wpic:items-center wpic:justify-center wpic:py-12 wpic:gap-3 wpic:text-base wpic:text-zinc-400 wpic:dark:text-zinc-500"},F0={class:"wpic-table__scroll",style:{"overflow-x":"auto"}},T0={class:"wpic:w-full wpic:border-collapse"},A0={key:0,style:{width:"36px"}},H0={key:1,style:{width:"32px"}},P0={key:0},j0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},W0=["onClick"],I0={key:1},R0={key:0,class:"wpic-table__summary wpic-table__divider wpic:border-b wpic:border-zinc-200 wpic:font-medium wpic:dark:border-zinc-700"},Z0={key:0},U0={key:1},K0=["onClick"],O0=["onClick"],q0={key:0,class:"wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},Y0=["colspan"],Q0={key:2},J0=["colspan"],X0={class:"wpic:flex wpic:flex-col wpic:items-center wpic:gap-2"},G0={class:"wpic:tabular-nums wpic:text-zinc-400 wpic:dark:text-zinc-500"},_0={key:0,class:"wpic-table__pagination wpic:flex wpic:items-center wpic:gap-0.5"},e3=["aria-label","disabled"],n3={key:0,class:"wpic:w-6 wpic:text-center wpic:text-base wpic:select-none wpic:text-zinc-400 wpic:dark:text-zinc-500"},t3=["onClick"],c3=["aria-label","disabled"],i3=e.defineComponent({__name:"WTable",props:{data:{},columns:{},loading:{type:Boolean},loadingSpinner:{type:Boolean,default:!0},labels:{},emptyText:{},pageSize:{},serverTotal:{},serverPage:{},serverSort:{},searchPlaceholder:{default:"Search…"},rowClickable:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedKeys:{},rowKey:{default:"id"},flushEdges:{type:Boolean,default:!1},rowClass:{},rowStyle:{},cellStyle:{},summaryRow:{},compact:{type:Boolean},padding:{},showFooter:{type:Boolean,default:!0},columnDividers:{type:Boolean,default:!1}},emits:["row-click","update:selectedKeys","row-select","update:serverPage","update:serverSort"],setup(n,{expose:s,emit:t}){const l=n,o=t,c=e.ref(new Set);function i(j){c.value.has(j)?c.value.delete(j):c.value.add(j)}const w=e.useSlots(),u=e.computed(()=>l.pageSize??25),C=e.ref({field:null,direction:"asc"}),a=e.computed(()=>(l.serverSort??C.value).field),B=e.computed(()=>(l.serverSort??C.value).direction);function g(j){const D=a.value===j&&B.value==="asc"?"desc":"asc",x={field:j,direction:D};l.serverSort?o("update:serverSort",x):C.value=x}const z=e.ref(""),M=e.computed(()=>l.columns.some(j=>j.searchable)),v=e.computed(()=>{let j=l.data??[];const D=z.value.trim().toLowerCase();if(D){const x=l.columns.filter(I=>I.searchable).map(I=>I.field);j=j.filter(I=>x.some(e1=>String(I[e1]??"").toLowerCase().includes(D)))}if(a.value&&!l.serverSort){const x=a.value;j=[...j].sort((I,e1)=>{const t1=I[x]??"",d1=e1[x]??"",h=typeof t1=="number"&&typeof d1=="number"?t1-d1:String(t1).toLowerCase().localeCompare(String(d1).toLowerCase());return B.value==="asc"?h:-h})}return j}),f=e.ref(1),T=e.computed(()=>l.serverTotal!==void 0),U=e.computed({get:()=>T.value?l.serverPage??1:f.value,set:j=>{T.value?o("update:serverPage",j):f.value=j}}),Y=e.computed(()=>T.value?l.serverTotal??0:v.value.length),Q=e.computed(()=>Math.max(1,Math.ceil(Y.value/u.value)));e.watch([z,()=>l.data],()=>{T.value||(U.value=1),c.value.clear()});const R=e.computed(()=>{if(T.value)return v.value;const j=(U.value-1)*u.value;return v.value.slice(j,j+u.value)});function F(j,D){const x=j[l.rowKey];return typeof x=="string"||typeof x=="number"?x:`${U.value}:${D}`}const N=e.computed(()=>new Set(l.selectedKeys??[])),A=e.computed(()=>R.value.map(F)),m=e.computed(()=>l.selectable&&A.value.length>0&&A.value.every(j=>N.value.has(j)));function W(j,D,x){const I=F(j,D),e1=new Set(l.selectedKeys??[]),t1=x===!0;t1?e1.add(I):e1.delete(I),o("update:selectedKeys",[...e1]),o("row-select",j,t1)}function J(j){const D=new Set(l.selectedKeys??[]),x=j===!0;for(const I of A.value)x?D.add(I):D.delete(I);o("update:selectedKeys",[...D])}const l1=e.computed(()=>Y.value===0?0:(U.value-1)*u.value+1),E=e.computed(()=>Math.min(U.value*u.value,Y.value)),Z=e.computed(()=>{const j=Q.value;if(j<=7)return Array.from({length:j},(t1,d1)=>d1+1);const D=U.value,x=[],I=new Set([1,j,D-1,D,D+1].filter(t1=>t1>=1&&t1<=j));let e1=0;for(const t1 of[...I].sort((d1,h)=>d1-h))t1-e1>1&&x.push("…"),x.push(t1),e1=t1;return x}),H=e.computed(()=>l.padding?`wpic-table--padding-${l.padding}`:l.compact?"wpic-table--padding-sm":"wpic-table--padding-inherit"),a1=j=>j==="right"?"wpic:text-right":j==="center"?"wpic:text-center":"wpic:text-left",i1=(j,D)=>[D,l.flushEdges&&j===0&&!l.expandable&&!l.selectable?"wpic:pl-0":"wpic-table__pad-l",l.flushEdges&&j===l.columns.length-1?"wpic:pr-0":"wpic-table__pad-r"],X=j=>({...j.width?{width:j.width}:{},...j.minWidth?{minWidth:j.minWidth}:{}});return s({filteredCount:e.computed(()=>v.value.length),searchQuery:z}),(j,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wpic-table",[H.value,{"wpic-table--column-dividers":n.columnDividers}]])},[(M.value||e.unref(w).toolbar)&&!n.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:gap-2 wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2"])},[M.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s2,{modelValue:z.value,"onUpdate:modelValue":D[0]||(D[0]=x=>z.value=x),placeholder:n.searchPlaceholder,icon:e.unref(k.Search),class:"wpic:flex-1"},null,8,["modelValue","placeholder","icon"]),z.value?(e.openBlock(),e.createElementBlock("span",$0,e.toDisplayString(v.value.length)+" "+e.toDisplayString(n.labels?.results??"results"),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(j.$slots,"toolbar")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",D0,[n.loadingSpinner?(e.openBlock(),e.createBlock(Q1,{key:0,tone:"muted"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.labels?.loading??"Loading…"),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",F0,[e.createElementVNode("table",T0,[e.createElementVNode("colgroup",null,[n.selectable?(e.openBlock(),e.createElementBlock("col",A0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("col",H0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,x=>(e.openBlock(),e.createElementBlock("col",{key:x.field,style:e.normalizeStyle(X(x))},null,4))),128))]),l.showHeader!==!1?(e.openBlock(),e.createElementBlock("thead",P0,[e.createElementVNode("tr",j0,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges?"wpic:pl-0":"wpic:pl-2"])},[e.createVNode(a2,{"model-value":m.value,onClick:D[1]||(D[1]=e.withModifiers(()=>{},["stop"])),"onUpdate:modelValue":J},null,8,["model-value"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-2"])},null,2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(x,I)=>(e.openBlock(),e.createElementBlock("th",{key:x.field,class:e.normalizeClass([i1(I,n.compact?"wpic:py-1.5":"wpic:py-3"),"wpic:whitespace-nowrap wpic:text-zinc-500 wpic:dark:text-zinc-300 wpic:font-medium",a1(x.align),I===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10":""]),style:e.normalizeStyle({...X(x)})},[e.renderSlot(j.$slots,"th-"+x.field,{col:x,sortField:a.value,sortDir:B.value,toggleSort:g},()=>[x.sortable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:e1=>g(x.field),class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:gap-1 wpic:cursor-pointer wpic:transition-colors wpic:whitespace-nowrap",x.align==="right"?"wpic:ml-auto":""]),style:{color:"inherit"}},[e.createTextVNode(e.toDisplayString(x.label)+" ",1),a.value===x.field&&B.value==="asc"?(e.openBlock(),e.createBlock(e.unref(k.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):a.value===x.field&&B.value==="desc"?(e.openBlock(),e.createBlock(e.unref(k.ChevronDown),{key:1,size:11,style:{color:"#5E6AD2"}})):(e.openBlock(),e.createBlock(e.unref(k.ChevronsUpDown),{key:2,size:10,style:{opacity:"0.3"}}))],10,W0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(x.label),1)],64))])],6))),128))])])):e.createCommentVNode("",!0),n.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",I0,[n.summaryRow?(e.openBlock(),e.createElementBlock("tr",R0,[n.selectable?(e.openBlock(),e.createElementBlock("td",Z0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",U0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(x,I)=>(e.openBlock(),e.createElementBlock("td",{key:x.field,class:e.normalizeClass([i1(I,n.compact?"wpic:py-1":"wpic:py-2.5"),a1(x.align),I===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100":"wpic:text-zinc-700 wpic:dark:text-zinc-200"])},[e.renderSlot(j.$slots,"summary-"+x.field,{row:n.summaryRow,value:n.summaryRow[x.field]},()=>[e.createTextVNode(e.toDisplayString(n.summaryRow[x.field]??"—"),1)])],2))),128))])):e.createCommentVNode("",!0),R.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R.value,(x,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I},[e.createElementVNode("tr",{class:e.normalizeClass(["wpic-table__row wpic:group wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800",[n.expandable&&c.value.has(I)?"wpic:border-b-0":"",n.rowClass?.(x)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(x)??{}}),onClick:e1=>n.expandable?i(I):n.rowClickable&&o("row-click",x)},[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges?"wpic:pl-0":"wpic:pl-2"]),onClick:D[2]||(D[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(a2,{"model-value":N.value.has(F(x,I)),"onUpdate:modelValue":e1=>W(x,I,e1)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-1 wpic:text-zinc-400 wpic:dark:text-zinc-500",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-3"])},[c.value.has(I)?(e.openBlock(),e.createBlock(e.unref(k.ChevronDown),{key:0,size:13,style:{transition:"transform .15s"}})):(e.openBlock(),e.createBlock(e.unref(k.ChevronRight),{key:1,size:13,style:{transition:"transform .15s"}}))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(e1,t1)=>(e.openBlock(),e.createElementBlock("td",{key:e1.field,class:e.normalizeClass([i1(t1,n.compact?"wpic:py-1":"wpic:py-2.5"),a1(e1.align),t1===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:font-medium":"wpic:text-zinc-700 wpic:dark:text-zinc-200"]),style:e.normalizeStyle(n.cellStyle?.(x,e1)),onClick:d1=>n.expandable?(n.rowClickable&&o("row-click",x),d1.stopPropagation()):void 0},[e.renderSlot(j.$slots,e1.field,{row:x,value:x[e1.field]},()=>[e.createTextVNode(e.toDisplayString(x[e1.field]??"—"),1)])],14,O0))),128))],14,K0),n.expandable&&c.value.has(I)?(e.openBlock(),e.createElementBlock("tr",q0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic-table__pad-x wpic:pb-3 wpic:pt-0"},[e.renderSlot(j.$slots,"expand",{row:x})],8,Y0)])):e.createCommentVNode("",!0)],64))),128)):(e.openBlock(),e.createElementBlock("tr",Q0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic:py-16 wpic:text-center wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.createElementVNode("div",X0,[e.renderSlot(j.$slots,"empty-icon"),e.createTextVNode(" "+e.toDisplayString(n.emptyText??"No data"),1)])],8,J0)]))]))])]),n.showFooter&&Y.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic-table__footer",["wpic:flex wpic:items-center wpic:justify-between wpic-table__divider wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2.5"]])},[e.createElementVNode("span",G0,[Q.value>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(l1.value)+"–"+e.toDisplayString(E.value)+" "+e.toDisplayString(n.labels?.of??"of")+" "+e.toDisplayString(Y.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Y.value)+" "+e.toDisplayString(Y.value===1?n.labels?.item??"item":n.labels?.items??"items"),1)],64))]),Q.value>1?(e.openBlock(),e.createElementBlock("div",_0,[e.createElementVNode("button",{"aria-label":n.labels?.previous??"Previous page",onClick:D[3]||(D[3]=x=>U.value--),disabled:U.value===1,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(k.ChevronLeft),{size:13})],8,e3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[x==="…"?(e.openBlock(),e.createElementBlock("span",n3,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:I=>U.value=x,class:e.normalizeClass(["wpic:h-7 wpic:min-w-7 wpic:px-2 wpic:rounded-md wpic:text-sm wpic:font-medium wpic:transition-colors wpic:cursor-pointer",U.value===x?"":"wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"]),style:e.normalizeStyle(U.value===x?"background:rgba(94,106,210,0.1);color:#5E6AD2":void 0)},e.toDisplayString(x),15,t3))],64))),128)),e.createElementVNode("button",{"aria-label":n.labels?.next??"Next page",onClick:D[4]||(D[4]=x=>U.value++),disabled:U.value===Q.value,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(k.ChevronRight),{size:13})],8,c3)])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))],2))}}),l3={key:0,class:"w-spreadsheet-frame__heading"},a3={key:1,class:"w-spreadsheet-frame__status"},o3=["title","aria-label"],r3={key:1,class:"wpic:flex wpic:min-h-64 wpic:items-center wpic:justify-center wpic:gap-3 wpic:text-zinc-400 wpic:dark:text-zinc-500"},s3={key:0,class:"w-spreadsheet__row-axis-col"},p3={key:0},d3={key:0,class:"w-spreadsheet__corner"},w3={key:0,class:"w-spreadsheet__axis"},u3=["colspan","title","tabindex","onClick","onKeydown","onPointerenter","onPointerdown"],m3={key:0,class:"w-spreadsheet__editor"},h3=["type","value","min","placeholder","onInput"],f3=["onPointerdown"],v3=e.defineComponent({__name:"WSpreadsheet",props:{appearance:{},columns:{},rows:{},showAxes:{type:Boolean,default:!0},showColumnLetters:{type:Boolean,default:!0},showRowNumbers:{type:Boolean,default:!0},minWidth:{default:"960px"},maxHeight:{default:"68vh"},sortable:{type:Boolean},expandable:{type:Boolean},showExpandButton:{type:Boolean},actionsOnHover:{type:Boolean},downloadable:{type:Boolean},showDownloadButton:{type:Boolean},downloadFilename:{},fillHandle:{type:Boolean},expanded:{type:Boolean},downloadRequest:{},loading:{type:Boolean}},emits:["update:expanded","cell-change"],setup(n,{expose:s,emit:t}){const l=n,o=t,c=e.computed(()=>l.showAxes&&l.showColumnLetters),i=e.computed(()=>l.showAxes&&l.showRowNumbers),w=e.computed(()=>l.columns.some(h=>h.sticky)),u=e.ref(null),C=e.ref("asc"),a=e.ref(l.expanded??!1),B=e.ref(null),g=e.ref(null),z=e.ref(null),M=e.ref(null),v=e.ref(null);function f(){if(!l.downloadable)return;const h=$=>`"${String($??"").replace(/"/g,'""')}"`,L=F.value.map($=>l.columns.map(P=>h(Q($,P.key))).join(",")).join(`\r
2
2
  `),y=new Blob([`\uFEFF${L}`],{type:"text/csv;charset=utf-8"}),q=URL.createObjectURL(y),_=document.createElement("a");_.href=q,_.download=l.downloadFilename||"spreadsheet.csv",_.click(),URL.revokeObjectURL(q)}function T(h,L=!0){if(a.value===h)return;const y=performance.now();console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} requested`),a.value=h,L&&o("update:expanded",h),requestAnimationFrame(()=>requestAnimationFrame(()=>{console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} painted in ${(performance.now()-y).toFixed(1)}ms`)}))}e.watch(()=>l.expanded,h=>{h!=null&&T(h,!1)}),e.watch(()=>l.downloadRequest,(h,L)=>{h!=null&&h!==L&&f()}),s({expand:()=>{l.expandable&&T(!0)},collapse:()=>{T(!1)},toggleExpanded:()=>{l.expandable&&T(!a.value)},download:f});function U(h){h.key==="Escape"&&a.value&&T(!1)}function Y(h){if(h.target?.closest(".w-spreadsheet__cell")?.querySelector(".w-spreadsheet__input"))return;M.value=null,v.value=null;const q=document.activeElement;q&&B.value?.contains(q)&&q.blur()}e.onMounted(()=>{document.addEventListener("keydown",U),document.addEventListener("pointerdown",Y)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",U),document.removeEventListener("pointerdown",Y),window.removeEventListener("pointerup",x)});function Q(h,L){return h.cells.find(y=>y.key===L)?.value??""}function R(h){if(typeof h=="number")return h;const L=String(h).trim().replace(/[\s,]/g,"");return L!==""&&/^-?\d+(\.\d+)?$/.test(L)?Number(L):String(h).toLocaleLowerCase()}const F=e.computed(()=>{if(!u.value)return l.rows;const h=l.rows.filter(q=>q.sortable!==!1),L=C.value==="asc"?1:-1;h.sort((q,_)=>{const $=R(Q(q,u.value)),P=R(Q(_,u.value));return typeof $=="number"&&typeof P=="number"?($-P)*L:String($).localeCompare(String(P),void 0,{numeric:!0})*L});let y=0;return l.rows.map(q=>q.sortable===!1?q:h[y++])});function N(h){const L=l.columns.find(y=>y.key===h.key);return!!(l.sortable&&h.variant==="header"&&L?.sortable!==!1)}function A(h){N(h)&&(u.value===h.key?C.value=C.value==="asc"?"desc":"asc":(u.value=h.key,C.value="asc"))}function m(h,L){return h.cells.slice(0,L).reduce((y,q)=>y+(q.colspan||1),0)}function W(h,L){return!!l.columns[m(h,L)]?.sticky}function J(h,L){const y=m(h,L);return!!(l.columns[y]?.sticky&&!l.columns.slice(0,y).some(q=>q.sticky))}function l1(h,L){const y=m(h,L);if(!l.columns[y]?.sticky)return;const q=l.columns.slice(0,y).map(_=>_.width||"0px");return{left:q.length?`calc(${q.join(" + ")})`:"0px"}}function E(h,L){return`${h.key}\0${L.key}`}function Z(h,L){!L.editable||g.value||(M.value={rowKey:h.key,cellKey:L.key},v.value=null)}function H(h,L){return M.value?.rowKey===h.key&&M.value?.cellKey===L.key}function a1(h,L,y){const q=F.value[h];!l.fillHandle||!y.editable||!q||!H(q,y)||(v.value=null,g.value={row:h,cell:L,value:String(y.value??"")},z.value={row:h,cell:L},window.addEventListener("pointerup",x,{once:!0}))}function i1(h,L){g.value&&(z.value={row:h,cell:L})}function X(h,L){if(!g.value||!z.value)return!1;const y=Math.min(g.value.row,z.value.row),q=Math.max(g.value.row,z.value.row),_=Math.min(g.value.cell,z.value.cell),$=Math.max(g.value.cell,z.value.cell);return h>=y&&h<=q&&L>=_&&L<=$}function j(h,L){if(!X(h,L)||!g.value||!z.value)return{};const y=Math.min(g.value.row,z.value.row),q=Math.max(g.value.row,z.value.row),_=Math.min(g.value.cell,z.value.cell),$=Math.max(g.value.cell,z.value.cell);return{"w-spreadsheet__cell--fill-range":!0,"w-spreadsheet__cell--fill-top":h===y,"w-spreadsheet__cell--fill-bottom":h===q,"w-spreadsheet__cell--fill-left":L===_,"w-spreadsheet__cell--fill-right":L===$}}function D(h,L){const y=E(h,L);return{"w-spreadsheet__cell--fill-completed":!!v.value?.cells.has(y),"w-spreadsheet__cell--fill-source":v.value?.source===y}}function x(){if(!g.value||!z.value)return;const h=g.value,L=z.value,y=Math.min(h.row,L.row),q=Math.max(h.row,L.row),_=Math.min(h.cell,L.cell),$=Math.max(h.cell,L.cell),P=new Set,K=F.value[h.row],s1=K?.cells[h.cell];for(let m1=y;m1<=q;m1++){const M1=F.value[m1];if(M1)for(let x1=_;x1<=$;x1++){const T1=M1.cells[x1];T1?.editable&&(P.add(E(M1,T1)),o("cell-change",{rowKey:M1.key,cellKey:T1.key,value:h.value,row:M1,cell:T1}))}}g.value=null,z.value=null,v.value=K&&s1?{cells:P,source:E(K,s1)}:null}function I(h){let L=h+1,y="";for(;L>0;)L-=1,y=String.fromCharCode(65+L%26)+y,L=Math.floor(L/26);return y}function e1(h){return[`w-spreadsheet__cell--${h.variant||"default"}`,`w-spreadsheet__cell--${h.align||"left"}`,`w-spreadsheet__cell--tone-${h.tone||"default"}`,{"w-spreadsheet__cell--wrap":!!h.wrap},h.class||""]}function t1(h,L,y){const q=y.target.value;o("cell-change",{rowKey:h.key,cellKey:L.key,value:q,row:h,cell:L})}function d1(h){const y=h.currentTarget.previousElementSibling;y?.focus(),y?.showPicker?.()}return(h,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"frameRef",ref:B,class:e.normalizeClass(["w-spreadsheet-frame",{"w-spreadsheet-frame--expanded":a.value}])},[a.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet-frame__backdrop","aria-label":"Restore spreadsheet",onClick:L[0]||(L[0]=y=>T(!1))})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-spreadsheet-frame__surface",{"w-spreadsheet--plain":n.appearance==="plain"}])},[n.expandable&&(n.showExpandButton!==!1||a.value)||n.downloadable&&(n.showDownloadButton!==!1||a.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-spreadsheet-frame__toolbar",{"w-spreadsheet-frame__toolbar--hover":n.actionsOnHover&&!a.value}])},[a.value&&h.$slots["expanded-header"]?(e.openBlock(),e.createElementBlock("div",l3,[e.renderSlot(h.$slots,"expanded-header")])):e.createCommentVNode("",!0),h.$slots["toolbar-status"]?(e.openBlock(),e.createElementBlock("div",a3,[e.renderSlot(h.$slots,"toolbar-status")])):e.createCommentVNode("",!0),e.renderSlot(h.$slots,"toolbar"),n.downloadable&&(n.showDownloadButton!==!1||a.value)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"w-spreadsheet-frame__expand",title:"Download spreadsheet","aria-label":"Download spreadsheet",onClick:f},[e.createVNode(e.unref(k.Download),{size:16})])):e.createCommentVNode("",!0),n.expandable&&(n.showExpandButton!==!1||a.value)?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"w-spreadsheet-frame__expand",title:a.value?"Restore spreadsheet":"Expand spreadsheet","aria-label":a.value?"Restore spreadsheet":"Expand spreadsheet",onClick:L[1]||(L[1]=y=>T(!a.value))},[a.value?(e.openBlock(),e.createBlock(e.unref(k.Minimize),{key:0,size:16})):(e.openBlock(),e.createBlock(e.unref(k.Expand),{key:1,size:16}))],8,o3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",r3,[e.createVNode(Q1),L[2]||(L[2]=e.createElementVNode("span",null,"Preparing sales estimate…",-1))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["w-spreadsheet",{"w-spreadsheet--with-column-axis":c.value}]),style:e.normalizeStyle({maxHeight:a.value?"calc(100vh - 96px)":n.maxHeight})},[e.createElementVNode("table",{class:e.normalizeClass(["w-spreadsheet__table",{"w-spreadsheet__table--sticky-columns":w.value}]),style:e.normalizeStyle({minWidth:n.minWidth})},[e.createElementVNode("colgroup",null,[i.value?(e.openBlock(),e.createElementBlock("col",s3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,y=>(e.openBlock(),e.createElementBlock("col",{key:y.key,style:e.normalizeStyle({width:y.width})},null,4))),128))]),c.value?(e.openBlock(),e.createElementBlock("thead",p3,[e.createElementVNode("tr",null,[i.value?(e.openBlock(),e.createElementBlock("th",d3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(y,q)=>(e.openBlock(),e.createElementBlock("th",{key:y.key,class:"w-spreadsheet__axis"},e.toDisplayString(y.label||I(q)),1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(y,q)=>(e.openBlock(),e.createElementBlock("tr",{key:y.key,class:e.normalizeClass({"w-spreadsheet__row--sticky":y.sticky})},[i.value?(e.openBlock(),e.createElementBlock("th",w3,e.toDisplayString(q+1),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.cells,(_,$)=>(e.openBlock(),e.createElementBlock("td",{key:_.key,class:e.normalizeClass(["w-spreadsheet__cell",[e1(_),{"w-spreadsheet__cell--sortable":N(_),"w-spreadsheet__cell--sticky":W(y,$),"w-spreadsheet__cell--sticky-first":J(y,$),"w-spreadsheet__cell--active":H(y,_)},j(q,$),D(y,_)]]),colspan:_.colspan||1,title:_.title,style:e.normalizeStyle(l1(y,$)),tabindex:N(_)?0:void 0,onClick:P=>A(_),onKeydown:[e.withKeys(e.withModifiers(P=>A(_),["prevent"]),["enter"]),e.withKeys(e.withModifiers(P=>A(_),["prevent"]),["space"])],onPointerenter:P=>i1(q,$),onPointerdown:P=>Z(y,_)},[e.renderSlot(h.$slots,`cell-${_.key}`,{row:y,cell:_,rowIndex:q},()=>[_.editable?(e.openBlock(),e.createElementBlock("div",m3,[e.createElementVNode("input",{class:e.normalizeClass(["w-spreadsheet__input",{"w-spreadsheet__input--date":_.inputType==="date"}]),type:_.inputType||"text",value:_.value??"",min:_.min,placeholder:_.placeholder,onInput:P=>t1(y,_,P)},null,42,h3),_.inputType==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet__calendar","aria-label":"Choose date",title:"Choose date",onClick:d1},[e.createVNode(e.unref(k.CalendarDays),{size:16})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(_.value??""),1)],64))]),N(_)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value===_.key?C.value==="asc"?e.unref(k.ChevronUp):e.unref(k.ChevronDown):e.unref(k.ChevronsUpDown)),{key:0,class:"w-spreadsheet__sort-icon",size:14})):e.createCommentVNode("",!0),n.fillHandle&&_.editable&&H(y,_)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"w-spreadsheet__fill-handle","aria-label":"Fill adjacent cells",title:"Drag to fill adjacent cells",onPointerdown:e.withModifiers(P=>a1(q,$,_),["stop","prevent"])},null,40,f3)):e.createCommentVNode("",!0)],46,u3))),128))],2))),128))])],6)],6))],2)],2))}}),h1=(n,s)=>{const t=n.__vccOpts||n;for(const[l,o]of s)t[l]=o;return t},b3={},g3={class:"wpic:min-w-40 wpic:rounded-lg wpic:bg-white wpic:p-1.5 wpic:shadow-md wpic:shadow-zinc-900/5 wpic:dark:bg-zinc-700 wpic:dark:shadow-black/20"};function k3(n,s){return e.openBlock(),e.createElementBlock("div",g3,[e.renderSlot(n.$slots,"default")])}const o2=h1(b3,[["render",k3]]),C3=["disabled"],L1=e.defineComponent({__name:"WActionMenuItem",props:{danger:{type:Boolean},disabled:{type:Boolean}},emits:["click"],setup(n,{emit:s}){const t=s;return(l,o)=>(e.openBlock(),e.createElementBlock("button",{type:"button",disabled:n.disabled,onClick:o[0]||(o[0]=c=>t("click",c)),class:e.normalizeClass(["wpic:flex wpic:h-8 wpic:w-full wpic:items-center wpic:gap-2 wpic:rounded-md wpic:px-2 wpic:text-left wpic:font-medium wpic:transition wpic:disabled:cursor-not-allowed wpic:disabled:opacity-40",n.danger?"wpic:text-red-500 wpic:hover:bg-red-50 wpic:dark:hover:bg-red-950/30":"wpic:text-zinc-600 wpic:hover:bg-zinc-100 wpic:hover:text-zinc-900 wpic:dark:text-zinc-100 wpic:dark:hover:bg-zinc-600 wpic:dark:hover:text-white"])},[e.renderSlot(l.$slots,"default")],10,C3))}}),N2={light:{trendPositive:"#15803D",trendNegative:"#DB2777",canvas:"#F8F8F8",surface:"#FFFFFF",input:"#FFFFFF",raised:"#F2F3EF",popover:"#FFFFFF",border:"rgb(32 33 29 / 0.07)",borderHover:"rgb(32 33 29 / 0.16)",text:"#20211D",muted:"#64675C",dim:"#707467",accent:"#85C531",onAccent:"#17210B",primary:"#171717",primaryHover:"#303030",onPrimary:"#FFFFFF",secondary:"#EFEFEF",secondaryHover:"#E3E3E3",onSecondary:"#20211D",secondaryShadow:"none",switchOn:"linear-gradient(35deg, #32dc08 0%, #9de400 48%, #e9e600 100%)",switchOff:"#D4D4D8",switchDisabled:"#E4E4E7",switchThumb:"#FFFFFF",focusRing:"color-mix(in srgb, var(--wpic-accent) 18%, transparent)",positive:"#85C531",negative:"#B94238"},dark:{trendPositive:"#86EFAC",trendNegative:"#FDA4AF",canvas:"#090A05",surface:"#151515",input:"#151515",raised:"#2A2A28",popover:"#1F201D",border:"rgb(255 255 255 / 0.06)",borderHover:"rgb(255 255 255 / 0.14)",text:"#F5F5F5",muted:"#B4B4B4",dim:"#969696",accent:"#85C531",onAccent:"#17210B",primary:"#FFFFFF",primaryHover:"#E8E8E8",onPrimary:"#171717",secondary:"linear-gradient(180deg, #3A3B36, #30312D)",secondaryHover:"linear-gradient(180deg, #40413B, #353630)",onSecondary:"#F5F5F5",secondaryShadow:"inset 0 1px 0 rgb(255 255 255 / 0.15), 0 1px 2px rgb(0 0 0 / 0.12)",switchOn:"linear-gradient(35deg, #32dc08 0%, #9de400 48%, #e9e600 100%)",switchOff:"#343530",switchDisabled:"#252525",switchThumb:"#FFFFFF",focusRing:"color-mix(in srgb, var(--wpic-accent) 18%, transparent)",positive:"#85C531",negative:"#F0A09A"}},z3={light:["#3B73E1","#0891A6","#8B5CD6","#C58A16","#D64D79","#527FA8"],dark:["#7C9FE0","#5FB8C4","#AF94D5","#D8B26A","#D88FA5","#94A8BD"]};function S2(n,s={}){const t={...N2[n],...s},l={};for(const[o,c]of Object.entries(t))l[`--wpic-${o.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`]=c;Object.assign(l,{"--wpic-legacy-bg-main":t.canvas,"--wpic-legacy-bg-card":t.surface,"--wpic-legacy-bg-input":t.input,"--wpic-legacy-border-subtle":t.border,"--wpic-legacy-border-strong":t.border,"--wpic-legacy-border-hover":t.borderHover,"--wpic-legacy-text-main":t.text,"--wpic-legacy-text-muted":t.muted,"--wpic-legacy-text-dim":t.dim,"--wpic-primary":t.accent,"--wpic-primary-hover":t.accent,"--wpic-control-height":"36px","--wpic-table-border":n==="light"?`color-mix(in srgb, ${t.text} 11.5%, ${t.surface})`:t.border,"--wpic-segment-active":n==="dark"?t.secondaryHover:t.surface,"--wpic-segment-shadow":n==="dark"?t.secondaryShadow:`inset 0 0 0 1px ${t.border}, 0 1px 2px rgb(0 0 0 / 0.08)`,"--wpic-button-primary":t.primary,"--wpic-button-primary-hover":t.primaryHover});for(const[o,c]of Object.entries(l))o.startsWith("--wpic-legacy-")&&(l[o.replace("--wpic-legacy-","--")]=c);return l}const L2=Symbol("wpic-theme");function F1(){return e.inject(L2,e.computed(()=>null))}let B2=0,M2="";function $2(){B2++===0&&(M2=document.body.style.overflow,document.body.style.overflow="hidden");let n=!1;return()=>{n||(n=!0,--B2===0&&(document.body.style.overflow=M2))}}const y3=["data-wpic-theme"],x3=["aria-label"],B3={class:"wpic-bottom-sheet-header"},M3=["aria-label"],V3={key:0,class:"wpic-bottom-sheet-footer"},y1=[],i2=new Map,p2=e.defineComponent({__name:"WBottomSheet",props:{returnFocus:{},modelValue:{type:Boolean},title:{},closeLabel:{default:"Close"},noPadding:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:s}){const t=n,l=s,o=F1(),c=e.ref(null),i=Symbol("sheet"),w=e.inject("wpic-overlay-layer",e.ref(9998)),u=e.ref(1e4);e.provide("wpic-overlay-layer",u);const C=e.ref({height:0,top:0}),a=e.computed(()=>C.value.height?{height:`${C.value.height}px`,top:`${C.value.top}px`}:{}),B=Symbol.for("wpic-ui-popover-descendants"),g=e.inject(B,null),z=new Set;e.provide(B,{add(m){z.add(m),g?.add(m)},remove(m){z.delete(m),g?.remove(m)}}),e.provide("wpic-pagination-url-sync",!1),e.watch(c,(m,W)=>{W&&g?.remove(W),m&&g?.add(m)});let M=null,v=!1,f;const T=m=>!!m.getClientRects().length&&getComputedStyle(m).visibility!=="hidden";function U(){return[c.value,...z].filter(m=>!!m&&T(m)).flatMap(m=>[...m.querySelectorAll('a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex="0"]')]).filter(T)}function Y(){l("update:modelValue",!1)}function Q(m){if(!(y1[y1.length-1]!==i||R(m.target))){if(m.key==="Escape"){if([...z].some(T))return;m.preventDefault(),m.stopPropagation(),Y()}else if(m.key==="Tab"){const W=U(),J=W.indexOf(document.activeElement);if(!W.length){m.preventDefault(),c.value?.focus();return}m.shiftKey&&J<=0?(m.preventDefault(),W[W.length-1]?.focus()):!m.shiftKey&&(J<0||J===W.length-1)&&(m.preventDefault(),W[0]?.focus())}}}function R(m){const W=m.closest?.(".wpic-modal-overlay");return!!W&&Number(getComputedStyle(W).zIndex)>u.value}function F(m){if(y1[y1.length-1]!==i||R(m.target))return;const W=m.target;c.value?.contains(W)||[...z].some(J=>J.contains(W))||c.value?.focus({preventScroll:!0})}function N(){const m=window.visualViewport;C.value={height:m?.height??window.innerHeight,top:m?.offsetTop??0}}function A(){if(!v)return;v=!1;const m=y1[y1.length-1]===i;y1.splice(y1.indexOf(i),1),i2.delete(i),f?.(),f=void 0,document.removeEventListener("keydown",Q),document.removeEventListener("focusin",F),window.visualViewport?.removeEventListener("resize",N),window.visualViewport?.removeEventListener("scroll",N),m&&M?.isConnected&&M.focus({preventScroll:!0})}return e.watch(()=>t.modelValue,async m=>{if(!m){A();return}v||(v=!0,M=t.returnFocus??document.activeElement,f=$2(),u.value=Math.max(w.value,9998,...i2.values())+2,y1.push(i),i2.set(i,u.value),N(),document.addEventListener("keydown",Q),document.addEventListener("focusin",F),window.visualViewport?.addEventListener("resize",N),window.visualViewport?.addEventListener("scroll",N),await e.nextTick(),t.modelValue&&c.value?.focus({preventScroll:!0}))},{immediate:!0}),e.onBeforeUnmount(()=>{c.value&&g?.remove(c.value),A()}),(m,W)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[n.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic-bottom-sheet-overlay",{"wpic-theme":e.unref(o),dark:e.unref(o)?.mode==="dark"}]),style:e.normalizeStyle([e.unref(o)?.variables,a.value,{zIndex:u.value}]),"data-wpic-theme":e.unref(o)?.mode,onClick:e.withModifiers(Y,["self"])},[e.createElementVNode("section",{ref_key:"panel",ref:c,role:"dialog","aria-modal":"true","aria-label":n.title||n.closeLabel,tabindex:"-1",class:"wpic-bottom-sheet"},[W[0]||(W[0]=e.createElementVNode("div",{class:"wpic-bottom-sheet-handle","aria-hidden":"true"},null,-1)),e.createElementVNode("header",B3,[e.renderSlot(m.$slots,"header",{},()=>[e.createElementVNode("h2",null,e.toDisplayString(n.title),1)]),e.createElementVNode("button",{type:"button","aria-label":n.closeLabel,onClick:Y},[e.createVNode(e.unref(k.X),{size:20})],8,M3)]),e.createElementVNode("div",{class:e.normalizeClass(["wpic-bottom-sheet-body",{"wpic-bottom-sheet-padded":!n.noPadding}])},[e.renderSlot(m.$slots,"default")],2),m.$slots.footer?(e.openBlock(),e.createElementBlock("footer",V3,[e.renderSlot(m.$slots,"footer")])):e.createCommentVNode("",!0)],8,x3)],14,y3)):e.createCommentVNode("",!0)]))}});function d2(){const n=typeof window<"u"?window.matchMedia("(max-width: 767px)"):null,s=e.ref(n?.matches??!1),t=()=>{s.value=n?.matches??!1};return n?.addEventListener("change",t),e.onBeforeUnmount(()=>n?.removeEventListener("change",t)),s}const E3=["data-wpic-theme"],f1=e.defineComponent({__name:"WPopover",props:{mobileSheet:{type:Boolean},sheetTitle:{},closeLabel:{},open:{type:Boolean},anchor:{},placement:{},width:{},minWidth:{},height:{},minHeight:{},maxHeight:{},panelScroll:{type:Boolean,default:!0},offset:{},matchAnchorWidth:{type:Boolean},fitAnchorContent:{type:Boolean},freezePositionOnOpen:{type:Boolean,default:!0},flip:{type:Boolean,default:!0},autoPlacement:{type:Boolean},shiftCrossAxis:{type:Boolean},zIndex:{default:9999},extraPanels:{}},emits:["close"],setup(n,{emit:s}){const t=n,l=e.inject("wpic-overlay-layer",e.ref(0)),o=e.computed(()=>Math.max(Number(t.zIndex)||9999,l.value+1));e.provide("wpic-overlay-layer",o);const c=F1(),i=d2(),w=e.computed(()=>i.value&&t.mobileSheet),u=s,C=Symbol.for("wpic-ui-popover-descendants"),a=e.inject(C,null),B=new Set;e.provide(C,{add(E){B.add(E),a?.add(E)},remove(E){B.delete(E),a?.remove(E)}});const g=e.computed(()=>{const E=t.anchor;return E?e.isRef(E)?E.value:E:null}),z=e.ref(null),M=e.ref(null),v=e.computed(()=>M.value??t.placement??"bottom-start"),f=e.computed(()=>{const E=[c1.offset(t.offset??6)];return M.value||(t.autoPlacement?E.push(c1.autoPlacement({alignment:"start"})):t.flip&&E.push(c1.flip({crossAxis:!t.shiftCrossAxis}))),E.push(c1.shift({padding:t.autoPlacement?8:4,crossAxis:t.autoPlacement||t.shiftCrossAxis})),E.push(c1.size({padding:8,apply({availableHeight:Z,availableWidth:H,rects:a1,elements:i1}){const X=Math.max(Z-8,50),j=t.maxHeight?`min(${t.maxHeight}, ${X}px)`:`${X}px`,D={maxWidth:`${Math.max(H,0)}px`,maxHeight:j,overflowY:t.panelScroll?"auto":"hidden"};if(t.height&&(D.height=`min(${t.height}, ${X}px)`),t.minHeight&&(D.minHeight=`min(${t.minHeight}, ${X}px)`),t.matchAnchorWidth){const x=`${Math.min(a1.reference.width,Math.max(H,0))}px`;D.width=t.fitAnchorContent?"max-content":x,D.minWidth=x}Object.assign(i1.floating.style,D)}})),E}),{floatingStyles:T,placement:U,update:Y,isPositioned:Q}=c1.useFloating(g,z,{placement:v,strategy:"fixed",open:e.computed(()=>t.open),whileElementsMounted:c1.autoUpdate,middleware:f}),R=e.computed(()=>{const E=U.value;return E.startsWith("top")?"bottom":E.startsWith("bottom")?"top":E.startsWith("left")?"right":E.startsWith("right")?"left":"top"}),F=E=>{if(w.value)return;const Z=E.target,H=g.value,a1=z.value;a1&&a1.contains(Z)||[...B].some(i1=>i1.contains(Z))||H&&H.contains(Z)||t.extraPanels?.some(i1=>i1?.contains(Z))||u("close")},N=E=>{if(w.value||E.key!=="Escape"||!t.open||[...B].some(H=>H.isConnected&&H.style.display!=="none"))return;E.preventDefault(),E.stopImmediatePropagation(),u("close");const Z=g.value;Z?.matches("button, input, [tabindex]")?Z.focus():Z?.querySelector("button, input, [tabindex]")?.focus()};let A=!1,m=!1;function W(){m||(document.addEventListener("pointerdown",F,!0),document.addEventListener("keydown",N,!0),m=!0)}function J(){m&&(document.removeEventListener("pointerdown",F,!0),document.removeEventListener("keydown",N,!0),m=!1)}e.watch(()=>t.open,E=>{E?e.nextTick(()=>{A||!t.open||(t.autoPlacement&&z.value&&(z.value.style.maxHeight=""),Y(),W())}):(M.value=null,J())},{immediate:!0}),e.watch(z,(E,Z)=>{Z&&a?.remove(Z),E&&a?.add(E)}),e.watch(Q,E=>{E&&t.open&&t.freezePositionOnOpen&&!M.value&&(M.value=U.value)}),e.onBeforeUnmount(()=>{A=!0,J(),z.value&&a?.remove(z.value)});const l1=e.computed(()=>({...t.matchAnchorWidth?{}:{width:t.width??"auto"},...t.minWidth?{minWidth:t.minWidth}:{},transformOrigin:R.value,zIndex:o.value}));return(E,Z)=>w.value?(e.openBlock(),e.createBlock(p2,{key:0,"return-focus":g.value,"model-value":n.open,title:n.sheetTitle,"close-label":n.closeLabel,"no-padding":"","onUpdate:modelValue":Z[0]||(Z[0]=H=>!H&&u("close"))},{default:e.withCtx(()=>[e.renderSlot(E.$slots,"default")]),_:3},8,["return-focus","model-value","title","close-label"])):(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:"body",class:"wpic-popover"},[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:z,"data-wpic-theme":e.unref(c)?.mode,class:e.normalizeClass([{"wpic-theme":e.unref(c),dark:e.unref(c)?.mode==="dark"},"wpic-popover-panel wpic:flex wpic:flex-col wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded-xl wpic:shadow-xl wpic:dark:shadow-black/40 wpic:overflow-hidden"]),style:e.normalizeStyle([e.unref(c)?.variables,e.unref(T),l1.value])},[e.renderSlot(E.$slots,"default")],14,E3),[[e.vShow,n.open]])]))}}),N3={key:0,class:"wpic:fixed wpic:right-0 wpic:top-0 wpic:z-[9997] wpic:flex wpic:h-full wpic:w-20 wpic:items-center wpic:justify-center wpic:border-l-2 wpic:border-[var(--wpic-primary)] wpic:bg-[var(--wpic-primary)]/10 wpic:text-[var(--wpic-primary)] wpic:pointer-events-none"},S3=["data-variant","data-maximized","data-docked"],L3=["title"],$3={class:"wpic:min-w-0 wpic:flex-1 wpic:px-2 wpic:text-center"},D3={class:"wpic:truncate wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},F3={key:0,class:"wpic:truncate wpic:text-zinc-500 wpic:dark:text-zinc-400"},T3={class:"wpic:flex wpic:shrink-0 wpic:items-center wpic:gap-1"},A3=["title"],H3=["title"],P3=["title"],j3=["title"],W3={class:"wpic:flex wpic:h-11 wpic:shrink-0 wpic:items-center wpic:justify-between wpic:px-3"},I3={class:"wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},R3=["title"],Z3={class:"wpic:space-y-2 wpic:px-3 wpic:pb-3"},U3={class:"wpic:truncate"},K3={class:"wpic:flex-1 wpic:overflow-y-auto wpic:overflow-x-visible wpic:px-2 wpic:pb-3"},O3={class:"wpic:mb-2 wpic:flex wpic:h-7 wpic:items-center wpic:justify-between wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},q3={class:"wpic:truncate"},Y3=["title"],Q3={class:"wpic:space-y-0.5"},J3={key:0,class:"wpic:rounded-lg wpic:border wpic:border-dashed wpic:border-zinc-200 wpic:px-2 wpic:py-2 wpic:text-zinc-500 wpic:dark:border-zinc-700 wpic:dark:text-zinc-400"},X3=["onMouseenter"],G3=["onClick"],_3={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},e5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},n5={key:0,class:"wpic:px-3 wpic:py-2 wpic:text-zinc-400 wpic:dark:text-zinc-500"},t5=["onPointerdown","onClick"],c5={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},i5={class:"wpic:shrink-0 wpic:text-zinc-400"},l5={class:"wpic:mt-4"},a5={class:"wpic:flex wpic:h-7 wpic:items-center wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},o5={class:"wpic:truncate"},r5={class:"wpic:space-y-0.5"},s5={key:0,class:"wpic:rounded-lg wpic:border wpic:border-dashed wpic:border-zinc-200 wpic:px-2 wpic:py-2 wpic:text-zinc-500 wpic:dark:border-zinc-700 wpic:dark:text-zinc-400"},p5=["onPointerdown","onClick"],d5={class:"wpic:block wpic:truncate"},w5={class:"wpic:shrink-0 wpic:text-zinc-400"},u5=["onClick"],m5=["onPointerenter","onMouseenter"],h5={class:"wpic:truncate"},f5={class:"wpic:flex wpic:min-h-0 wpic:flex-1"},v5={class:"wpic:flex wpic:min-h-0 wpic:min-w-0 wpic:flex-1 wpic:flex-col"},b5={key:0,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center wpic:text-zinc-500 wpic:dark:text-zinc-400"},g5={class:"wpic:font-medium"},k5={key:1,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center"},C5={class:"wpic:mb-3 wpic:flex wpic:h-11 wpic:w-11 wpic:items-center wpic:justify-center wpic:rounded-xl wpic:bg-zinc-100 wpic:text-zinc-500 wpic:dark:bg-zinc-700 wpic:dark:text-zinc-300"},z5={class:"wpic:font-semibold wpic:text-zinc-800 wpic:dark:text-zinc-100"},y5={key:0,class:"wpic:mt-1 wpic:max-w-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},x5={key:2,class:"wpic:space-y-4"},B5={class:"wpic:max-w-[82%]"},M5=["src","alt"],V5={class:"wpic:max-w-40 wpic:truncate"},E5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},N5={key:0,class:"wpic:flex wpic:items-center wpic:gap-2 wpic:text-zinc-500 wpic:dark:text-zinc-400"},S5={key:1,class:"wpic-chat-loading-card",role:"status","aria-label":"Generating image"},L5=["innerHTML","onClick"],$5=["href","onClick"],D5=["src"],F5=["title","aria-label","aria-pressed","onClick"],T5=["title","aria-label","aria-pressed","onClick"],A5=["title","onClick"],H5=["onClick"],P5=["title","onClick"],j5={class:"wpic-chat-panel__footer wpic:shrink-0 wpic:bg-white wpic:p-3 wpic:dark:bg-zinc-800"},W5={key:0,class:"wpic:mb-2 wpic:flex wpic:flex-wrap wpic:justify-end wpic:gap-1.5"},I5=["src","alt"],R5={class:"wpic:max-w-40 wpic:truncate"},Z5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},U5={key:1,class:"wpic:shrink-0 wpic:text-zinc-400"},K5=["title","onClick"],O5={class:"wpic-chat-panel__composer wpic:rounded-xl wpic:border wpic:border-zinc-200 wpic:bg-zinc-50 wpic:transition-colors wpic:focus-within:border-[var(--wpic-primary)]/50 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-700"},q5={key:0,class:"wpic:mx-2 wpic:mt-2 wpic:overflow-hidden wpic:rounded-lg wpic:bg-white wpic:shadow-sm wpic:ring-1 wpic:ring-zinc-200 wpic:dark:bg-zinc-800 wpic:dark:ring-zinc-600"},Y5=["onMousedown"],Q5={class:"wpic:min-w-0 wpic:truncate wpic:font-medium wpic:text-zinc-900 wpic:dark:text-zinc-100"},J5={key:0,class:"wpic:max-w-32 wpic:shrink-0 wpic:truncate wpic:text-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},X5=["accept"],G5=["value","placeholder","disabled"],_5={class:"wpic:flex wpic:items-center wpic:gap-1"},e4=["disabled","title"],n4=["title"],t4=["disabled","title"],V2=80,c4=e.defineComponent({__name:"WChatPanel",props:{open:{type:Boolean},messages:{},mentionItems:{default:()=>[]},projects:{default:()=>[]},sessions:{default:()=>[]},modelValue:{default:""},title:{default:"Chat"},subtitle:{default:""},selectedProjectId:{default:null},selectedSessionId:{default:null},placeholder:{default:"Ask anything..."},emptyTitle:{default:"How can I help?"},emptyDescription:{default:""},noProjectsLabel:{default:"No projects yet"},noConversationsLabel:{default:"No conversations yet"},allLabel:{default:"All"},recentLabel:{default:"Recent"},projectsLabel:{default:"Projects"},conversationsLabel:{default:"Conversations"},sendLabel:{default:"Send"},newLabel:{default:"New chat"},newProjectLabel:{default:"New project"},newConversationLabel:{default:"New conversation"},renameProjectLabel:{default:"Rename project"},renameConversationLabel:{default:"Rename conversation"},deleteProjectLabel:{default:"Delete project"},deleteConversationLabel:{default:"Delete conversation"},clearLabel:{default:"Clear"},copyLabel:{default:"Copy"},copiedLabel:{default:"Copied"},newChatFromMessageLabel:{default:"Start new chat from this message"},attachFilesLabel:{default:"Attach files"},removeAttachmentLabel:{default:"Remove attachment"},stopLabel:{default:"Stop"},applyPromptLabel:{default:"Apply prompt"},applyAllLabel:{default:"Apply all"},applySettingLabel:{default:"Apply setting"},thinkingLabel:{default:"Thinking..."},dockLabel:{default:"Dock"},undockLabel:{default:"Undock"},closeLabel:{default:"Close"},helpfulLabel:{default:"Helpful"},notHelpfulLabel:{default:"Not helpful"},showAttachments:{type:Boolean,default:!0},attachments:{default:()=>[]},accept:{default:""},customAttachmentPicker:{type:Boolean,default:!1},showNavigator:{type:Boolean,default:!0},hideNewConversation:{type:Boolean,default:!1},hideClear:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},cancellable:{type:Boolean,default:!1},docked:{type:Boolean,default:!1},dockedInset:{default:8},maximized:{type:Boolean,default:!1},maximizedMargin:{default:20},width:{default:420},height:{default:560},x:{default:-1},y:{default:-1},topOffset:{default:0},minWidth:{default:340},minHeight:{default:400},zIndex:{default:80},variant:{default:"default"}},emits:["close","send","clear","new","new-project","new-conversation","select-project","select-session","rename-project","rename-session","delete-project","delete-session","move-session","edit-message","new-chat-from-message","message-feedback","apply-message-proposal","navigate","cancel","attach","files-selected","remove-attachment","update:modelValue","update:docked","update:maximized","update:width","update:height","update:x","update:y"],setup(n,{emit:s}){const t=n,l=s,o=e.useSlots(),c=e.ref(null),i=e.ref(null),w=e.ref(null),u=e.ref(null),C=e.ref(null),a=e.ref(0),B=e.ref(0),g=e.ref(!1),z=e.ref(null),M=e.ref(null);let v=null;const f=e.ref(!1),T=e.ref(!1),U=e.ref(!1);e.ref(new Set);const Y=e.ref(null),Q=e.ref(null),R=e.ref({}),F=e.ref(null);let N=null;const A=e.computed(()=>F.value?[]:t.messages.filter(r=>r.role!=="system")),m=e.computed(()=>t.loading||F.value!==null),W=e.computed(()=>t.modelValue.trim().length>0&&!t.loading),J=e.computed(()=>t.attachments.length>0),l1=e.computed(()=>{const r=t.modelValue.slice(0,B.value),p=r.match(/(?:^|\s)@([^\s@]*)$/);return p?{start:r.length-p[0].length+(p[0].startsWith(" ")?1:0),query:p[1].toLowerCase()}:null}),E=e.computed(()=>{const r=l1.value;if(!r)return[];const p=r.query;return t.mentionItems.filter(d=>d.label.toLowerCase().includes(p)).slice(0,6)}),Z=e.computed(()=>t.showNavigator&&g.value),H=e.computed(()=>t.selectedProjectId??null),a1=e.computed(()=>t.sessions.filter(r=>!r.projectId)),i1=e.computed(()=>{const r=new Map;for(const p of t.projects)r.set(p.id,[]);for(const p of t.sessions){if(!p.projectId)continue;const d=r.get(p.projectId);d&&d.push(p)}return r});function X(r){const p=r.toLowerCase();if(p.includes("doubao-seedance-1-5-pro-251215")||p.includes("doubao seedance 1.5")||p.includes("seedance 1.5")||p.includes("seedance video"))return"jimeng:doubao-seedance-1-5-pro-251215";if(p.includes("imagen 4")||p.includes("imagen-4"))return"google:imagen-4.0-generate-001";if(p.includes("gpt-image-1")||p.includes("gpt image 1"))return"openai:gpt-image-1";if(p.includes("gpt-image-2")||p.includes("gpt image 2"))return"openai:gpt-image-2";if(p.includes("doubao-seedream-4-5-251128"))return"jimeng:doubao-seedream-4-5-251128";if(p.includes("doubao-seedream-4-0-250828"))return"jimeng:doubao-seedream-4-0-250828";if(p.includes("doubao seedream 5")||p.includes("seedream 5")||p.includes("doubao seedream 4.5")||p.includes("seedream 4.5"))return"jimeng:doubao-seedream-4-5-251128";if(p.includes("doubao seedream 4")||p.includes("seedream 4"))return"jimeng:doubao-seedream-4-0-250828";if(p.includes("auto"))return"auto";const d=r.match(/\b([a-z][a-z0-9_-]+):([a-z0-9._-]+)\b/i);if(d)return`${d[1].toLowerCase()}:${d[2]}`}function j(r){if(r!=="auto"){if(r.includes("seedance"))return"video";if(r.includes("gpt-image")||r.includes("imagen")||r.includes("seedream")||r.includes("jimeng:"))return"image"}}function D(r){const p=[],d=new Set,V=/\b(gpt[-\s]?image[-\s]?[12]|imagen\s*4|doubao\s+seedance\s+1\.5(?:\s+pro)?|seedance\s+1\.5(?:\s+pro)?|doubao\s+seedream\s+(?:5(?:\.0)?|4\.5|4)|seedream\s+(?:5(?:\.0)?|4\.5|4)|[a-z][a-z0-9_-]+:[a-z0-9._-]+|auto)\b/gi;for(const b of r.matchAll(V)){const S=b[1],O=X(S);!O||d.has(O)||(d.add(O),p.push({label:S,value:O}))}return p}function x(r,p){return r.match(new RegExp(`${p}=["']([^"']+)["']`,"i"))?.[1]}function I(r){const p={};for(const V of r.matchAll(/\[SETTING\s+([^\]]+)\]([\s\S]*?)\[\/SETTING\]/gi)){const b=V[1]??"",S=x(b,"key"),O=x(b,"value")??V[2]?.trim();if(!(!S||!O))if(S==="duration"||S==="fps"||S==="count"){const G=Number(O);Number.isFinite(G)&&(p[S]=G)}else if(S==="model"){const G=X(O)??X(V[2]?.trim()??"");G&&(p.model=G)}else(S==="aspect"||S==="resolution"||S==="format")&&(p[S]=O)}const d=r.split(/\r?\n/).map(V=>V.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const V of d){const b=V.toLowerCase();if(/(supporte|supports?|disponible|available|dur[eé]es?\s*:|ratios?\s*:|jusqu['’]?à|up to)/i.test(b))continue;const S=V.split(":").slice(1).join(":").trim()||V,O=S.match(/\b(\d{1,2}:\d{1,2})\b/);(b.includes("format")||b.includes("aspect")||b.includes("ratio"))&&O&&(p.aspect=O[1]);const G=S.match(/\b([1248]K)\b/i);(b.includes("résolution")||b.includes("resolution"))&&G&&(p.resolution=G[1].toUpperCase());const n1=S.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);(b.includes("durée")||b.includes("duration"))&&n1&&(p.duration=Number(n1[1]));const o1=S.match(/\b(\d{1,3})\s*fps\b/i);b.includes("fps")&&o1&&(p.fps=Number(o1[1]));const r1=S.match(/\b(\d{1,2})\b/);if((b.includes("count")||b.includes("nombre")||b.includes("variantes"))&&r1&&(p.count=Number(r1[1])),b.includes("modèle")||b.includes("modele")||b.includes("model")){const v1=X(S);v1&&(p.model=v1)}b.includes("jpg")||b.includes("jpeg")?p.format="jpg":b.includes("png")?p.format="png":b.includes("webp")&&(p.format="webp")}return Object.keys(p).length?p:void 0}function e1(r){const p=r.match(/\[TASK(?:\s+([^\]]+))?\](?:([\s\S]*?)\[\/TASK\])?/i);if(p){const V=(x(p[1]??"","value")??p[2]?.trim())?.toLowerCase();if(["image","video","audio","text"].includes(String(V)))return V}const d=r.split(/\r?\n/).map(V=>V.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const V of d){const b=V.toLowerCase(),S=V.split(":").slice(1).join(":").trim().toLowerCase()||b;if(/(task|type|mode|surface|format|réglage|reglage|setting)/i.test(b)){if(/\baudio\b|subtitles?|sous-titres?|transcri|tts|voice|voix/.test(S))return"audio";if(/\bvid[eé]o\b|\bvideo\b|\bfps\b|duration|dur[eé]e/.test(S))return"video";if(/\bimage\b|photo|visuel|illustration|aspect|ratio|resolution|résolution/.test(S))return"image";if(/\btext\b|texte|copy|caption|script/.test(S))return"text"}}}function t1(r){const p=r.match(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i)?.[1];if(p){const n1=s1(p).trim().replace(/^["“]|["”]$/g,"");if(n1)return n1}const d=r.replace(/\r\n/g,`
3
3
  `).split(`
4
4
  `),V=[];let b=!1,S=!1,O=!1;for(const n1 of d){const o1=n1.trim().replace(/^[\s>*-]+/,"").replace(/^#{1,6}\s+/,"").replace(/^\*\*|\*\*$/g,"").trim();if(S){if(/^```/.test(o1))break;V.push(n1);continue}if(!b){const r1=o1.match(/^(?:(?:voici|essayez|utilisez|use|try)\s+(?:ce\s+)?(?:prompt)|prompt\s+(?:modifi[eé]|am[eé]lior[eé]|propos[eé]|recommand[eé])|prompt)\s*:\s*(.*)$/i);if(!r1){O||=/\bprompt\b/i.test(o1),O&&/^```/.test(o1)&&(b=!0,S=!0);continue}b=!0,r1[1]?.trim()&&V.push(r1[1].trim());continue}if(/^(?:r[eé]glages?(?:\s+recommand[eé]s?)?|settings?|mod[eè]le|model)\s*:/i.test(o1))break;V.push(n1)}return s1(V.join(`
package/dist/wpic-ui.js CHANGED
@@ -47,7 +47,7 @@ const O3 = {
47
47
  (c.size ?? "md") === "lg" ? (c.variant === "subtle" ? "wpic:h-12" : "wpic:h-11") + " wpic:px-4 wpic:gap-2 wpic:rounded-lg" : "",
48
48
  (c.size ?? "md") === "xs" ? "wpic:h-5 wpic:w-5 wpic:p-0 wpic:rounded-full wpic:text-xs" : "",
49
49
  // Text actions keep both resting and hover states free of a surface.
50
- c.variant === "text" ? n.active ? "wpic:bg-transparent wpic:text-indigo-600 wpic:dark:text-indigo-400" : "wpic:bg-transparent wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-200" : "",
50
+ c.variant === "text" ? n.active ? "wpic:bg-transparent wpic:text-indigo-600 wpic:dark:text-indigo-400" : "wpic:bg-transparent wpic:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:text-zinc-500 wpic:dark:hover:text-zinc-400" : "",
51
51
  // Variant
52
52
  (c.variant ?? "primary") === "primary" ? "wpic-btn-primary wpic:text-white" : "",
53
53
  (c.variant ?? "primary") === "secondary" ? "wpic:bg-zinc-100 wpic:hover:bg-zinc-200 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200" : "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpic/ui",
3
- "version": "0.9.34",
3
+ "version": "0.9.35",
4
4
  "type": "module",
5
5
  "description": "WPIC shared Vue 3 component library",
6
6
  "publishConfig": {