@wpic/ui 0.9.58 → 0.9.60
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 +1 -1
- package/dist/wpic-ui.css +4 -3
- package/dist/wpic-ui.js +2 -2
- package/package.json +1 -1
- package/src/style.css +4 -3
package/dist/wpic-ui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("lucide-vue-next"),l1=require("@floating-ui/vue"),g0=require("pinia"),J1=require("@tiptap/vue-3"),k0=require("@tiptap/extension-document"),C0=require("@tiptap/extension-paragraph"),z0=require("@tiptap/extension-text"),y0=require("@tiptap/extension-character-count"),x0=require("@tiptap/starter-kit"),B0=require("@tiptap/extension-placeholder");var P1=typeof document<"u"?document.currentScript:null;const M0={key:0,class:"wpic:absolute wpic:inset-0 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-[inherit]","aria-hidden":"true"},x1=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:p}){const t=n,l=p;return(r,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",t.variant==="ghost-transparent"?"wpic:active:scale-95":"wpic:active:scale-[0.98]",n.disabled||n.loading?"wpic:opacity-40 wpic:cursor-not-allowed wpic:pointer-events-none":"",n.active&&!["text","ghost-transparent"].includes(t.variant??"")?"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"?n.active?"wpic:bg-transparent wpic:hover:bg-[#80808026] wpic:text-indigo-600 wpic:dark:text-indigo-400":"wpic:bg-transparent wpic:hover:bg-[#80808026]":"",t.variant==="ghost-transparent"&&!n.active&&!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(r.$slots,"default")],2),n.loading?(e.openBlock(),e.createElementBlock("span",M0,[e.createVNode(e.unref(z.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"]))}}),V0={class:"wpic-button-group wpic:inline-flex"},D2=e.defineComponent({__name:"WButtonGroup",setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",V0,[e.renderSlot(p.$slots,"default")]))}}),E0={class:"wpic-filter wpic:flex wpic:items-center wpic:gap-1"},N0=["onClick"],S0=e.defineComponent({__name:"WFilter",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,(l,r)=>(e.openBlock(),e.createElementBlock("button",{key:r,type:"button",onClick:c=>p.$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,N0))),128))]))}}),L0={class:"wpic-form-label wpic:block wpic:mb-1 wpic:font-medium wpic:text-zinc-600 wpic:dark:text-zinc-400"},$0={key:0,class:"wpic:ml-0.5",style:{color:"#EF4444"}},u2=e.defineComponent({__name:"WFormLabel",props:{required:{type:Boolean}},setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("label",L0,[e.renderSlot(p.$slots,"default"),n.required?(e.openBlock(),e.createElementBlock("span",$0,"*")):e.createCommentVNode("",!0)]))}}),D0={class:"wpic:relative wpic:flex wpic:items-center wpic:w-full"},F0=["data-size","data-variant","type","placeholder","disabled","required"],T0={key:2,class:"wpic:pointer-events-none wpic:absolute wpic:right-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},G1=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 p=e.useModel(n,"modelValue"),t=n,l=e.useSlots(),r=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 z.Calendar;if(t.type==="money")return z.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"),b=e.ref(),a=e.ref(),k=e.ref(0);let g;e.watch(a,x=>{g?.disconnect(),k.value=x?.getBoundingClientRect().width??0,x&&(g=new ResizeObserver(()=>{k.value=x.getBoundingClientRect().width}),g.observe(x))},{flush:"post"}),e.onBeforeUnmount(()=>g?.disconnect());function C(){t.type==="date"&&b.value?.showPicker()}if(typeof document<"u"){const x="winput-date-no-picker";if(!document.getElementById(x)){const m=document.createElement("style");m.id=x,m.textContent='input[type="date"]::-webkit-calendar-picker-indicator { display: none; }',document.head.appendChild(m)}const f="winput-number-no-spinner";if(!document.getElementById(f)){const m=document.createElement("style");m.id=f,m.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(m)}}return(x,f)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(x.$attrs,{class:"wpic:w-full"}),[t.label?(e.openBlock(),e.createBlock(u2,{key:0,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",D0,[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:C},null,8,["size","class"])):r.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(x.$slots,"prepend",{},()=>[e.createTextVNode(e.toDisplayString(t.prepend),1)])],512)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:b,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||r.value?t.size==="xl"?"wpic:pl-11":"wpic:pl-9":t.size==="xl"?"wpic:pl-4":"wpic:pl-2.5",c.value&&(t.clearable&&p.value||t.loading)?"wpic:pr-14":c.value?"wpic:pr-9":t.clearable&&p.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-[var(--wpic-primary,#6366f1)] 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(r.value&&!i.value?{paddingLeft:`calc(${k.value}px + 1.25rem)`}:void 0),"data-size":t.size??"md","data-variant":t.variant??"default","onUpdate:modelValue":f[0]||(f[0]=m=>p.value=m),type:u.value,placeholder:t.placeholder??"",disabled:t.disabled,required:t.required},null,14,F0),[[e.vModelDynamic,p.value]]),c.value?(e.openBlock(),e.createElementBlock("span",T0,[e.renderSlot(x.$slots,"append",{},()=>[e.createTextVNode(e.toDisplayString(t.append),1)])])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(e.unref(z.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&&p.value?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",onClick:f[1]||(f[1]=m=>p.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(z.X),{size:t.size==="xl"?14:11},null,8,["size"])],2)):e.createCommentVNode("",!0)])],16))}}),A0=["disabled"],d2=e.defineComponent({__name:"WCheckbox",props:e.mergeModels({disabled:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=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]=r=>p.value=r),disabled:n.disabled,class:"wpic:peer wpic:sr-only"},null,8,A0),[[e.vModelCheckbox,p.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",p.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(z.Check),{size:11,"stroke-width":"2.6"})],2),e.renderSlot(t.$slots,"default")],2))}}),_1=e.defineComponent({__name:"WSpinner",props:{size:{default:"md"},tone:{default:"muted"}},setup(n){const p=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,r)=>(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[p.size],p.tone==="muted"?"wpic:text-zinc-300 wpic:dark:text-zinc-700":"wpic:text-[var(--wpic-primary,#6366f1)]"])},null,2))}}),H0={key:0,class:"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:whitespace-nowrap wpic:shrink-0"},P0={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"},j0={class:"wpic-table__scroll",style:{"overflow-x":"auto"}},W0={class:"wpic:w-full wpic:border-collapse"},R0={key:0,style:{width:"36px"}},I0={key:1,style:{width:"32px"}},Z0={key:0},U0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},K0=["onClick"],O0={key:1},q0={key:0,class:"wpic-table__summary wpic-table__divider wpic:border-b wpic:border-zinc-200 wpic:font-medium wpic:dark:border-zinc-700"},Y0={key:0},Q0={key:1},J0=["onClick"],X0=["onClick"],G0={key:0,class:"wpic-table__divider wpic:border-b wpic:last:border-b-0 wpic:border-zinc-100 wpic:dark:border-zinc-800"},_0=["colspan"],e3={key:2},n3=["colspan"],t3={class:"wpic:flex wpic:flex-col wpic:items-center wpic:gap-2"},c3={key:0,class:"wpic-table__footer wpic:flex wpic:flex-wrap wpic:min-h-14 wpic:items-center wpic:justify-between wpic:gap-3 wpic-table__divider wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x wpic:py-3"},i3={class:"wpic:tabular-nums wpic:text-zinc-400 wpic:dark:text-zinc-500"},l3={key:0,class:"wpic-table__pagination wpic:flex wpic:items-center wpic:gap-1"},a3=["aria-label","disabled"],o3={key:0,class:"wpic:w-6 wpic:text-center wpic:text-base wpic:select-none wpic:text-zinc-400 wpic:dark:text-zinc-500"},r3=["aria-current","onClick"],s3=["aria-label","disabled"],p3=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:p,emit:t}){const l=n,r=t,c=e.ref(new Set);function i(W){c.value.has(W)?c.value.delete(W):c.value.add(W)}const w=e.useSlots(),u=e.computed(()=>l.pageSize??25),b=e.ref({field:null,direction:"asc"}),a=e.computed(()=>(l.serverSort??b.value).field),k=e.computed(()=>(l.serverSort??b.value).direction);function g(W){const F=a.value===W&&k.value==="asc"?"desc":"asc",B={field:W,direction:F};l.serverSort?r("update:serverSort",B):b.value=B}const C=e.ref(""),x=e.computed(()=>l.columns.some(W=>W.searchable)),f=e.computed(()=>{let W=l.data??[];const F=C.value.trim().toLowerCase();if(F){const B=l.columns.filter(I=>I.searchable).map(I=>I.field);W=W.filter(I=>B.some(c1=>String(I[c1]??"").toLowerCase().includes(F)))}if(a.value&&!l.serverSort){const B=a.value;W=[...W].sort((I,c1)=>{const P=I[B]??"",t1=c1[B]??"",h=typeof P=="number"&&typeof t1=="number"?P-t1:String(P).toLowerCase().localeCompare(String(t1).toLowerCase());return k.value==="asc"?h:-h})}return W}),m=e.ref(1),D=e.computed(()=>l.serverTotal!==void 0),O=e.computed({get:()=>D.value?l.serverPage??1:m.value,set:W=>{D.value?r("update:serverPage",W):m.value=W}}),J=e.computed(()=>D.value?l.serverTotal??0:f.value.length),Y=e.computed(()=>Math.max(1,Math.ceil(J.value/u.value)));e.watch([C,()=>l.data],()=>{D.value||(O.value=1),c.value.clear()});const Z=e.computed(()=>{if(D.value)return f.value;const W=(O.value-1)*u.value;return f.value.slice(W,W+u.value)});function U(W,F){const B=W[l.rowKey];return typeof B=="string"||typeof B=="number"?B:`${O.value}:${F}`}const T=e.computed(()=>new Set(l.selectedKeys??[])),S=e.computed(()=>Z.value.map(U)),y=e.computed(()=>l.selectable&&S.value.length>0&&S.value.every(W=>T.value.has(W)));function V(W,F,B){const I=U(W,F),c1=new Set(l.selectedKeys??[]),P=B===!0;P?c1.add(I):c1.delete(I),r("update:selectedKeys",[...c1]),r("row-select",W,P)}function Q(W){const F=new Set(l.selectedKeys??[]),B=W===!0;for(const I of S.value)B?F.add(I):F.delete(I);r("update:selectedKeys",[...F])}const s1=e.computed(()=>J.value===0?0:(O.value-1)*u.value+1),E=e.computed(()=>Math.min(O.value*u.value,J.value)),R=e.computed(()=>{const W=Y.value;if(W<=7)return Array.from({length:W},(P,t1)=>t1+1);const F=O.value,B=[],I=new Set([1,W,F-1,F,F+1].filter(P=>P>=1&&P<=W));let c1=0;for(const P of[...I].sort((t1,h)=>t1-h))P-c1>1&&B.push("…"),B.push(P),c1=P;return B}),H=e.computed(()=>l.padding?`wpic-table--padding-${l.padding}`:l.compact?"wpic-table--padding-sm":"wpic-table--padding-inherit"),o1=W=>W==="right"?"wpic:text-right":W==="center"?"wpic:text-center":"wpic:text-left",r1=(W,F)=>[F,l.flushEdges&&W===0&&!l.expandable&&!l.selectable?"wpic:pl-0":"wpic-table__pad-l",l.flushEdges&&W===l.columns.length-1?"wpic:pr-0":"wpic-table__pad-r"],X=W=>({...W.width?{width:W.width}:{},...W.minWidth?{minWidth:W.minWidth}:{}});return p({filteredCount:e.computed(()=>f.value.length),searchQuery:C}),(W,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wpic-table",[H.value,{"wpic-table--column-dividers":n.columnDividers}]])},[(x.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"])},[x.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(G1,{modelValue:C.value,"onUpdate:modelValue":F[0]||(F[0]=B=>C.value=B),placeholder:n.searchPlaceholder,icon:e.unref(z.Search),class:"wpic:flex-1"},null,8,["modelValue","placeholder","icon"]),C.value?(e.openBlock(),e.createElementBlock("span",H0,e.toDisplayString(f.value.length)+" "+e.toDisplayString(n.labels?.results??"results"),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(W.$slots,"toolbar")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",P0,[n.loadingSpinner?(e.openBlock(),e.createBlock(_1,{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",j0,[e.createElementVNode("table",W0,[e.createElementVNode("colgroup",null,[n.selectable?(e.openBlock(),e.createElementBlock("col",R0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("col",I0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,B=>(e.openBlock(),e.createElementBlock("col",{key:B.field,style:e.normalizeStyle(X(B))},null,4))),128))]),l.showHeader!==!1?(e.openBlock(),e.createElementBlock("thead",Z0,[e.createElementVNode("tr",U0,[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(d2,{"model-value":y.value,onClick:F[1]||(F[1]=e.withModifiers(()=>{},["stop"])),"onUpdate:modelValue":Q},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,(B,I)=>(e.openBlock(),e.createElementBlock("th",{key:B.field,class:e.normalizeClass([r1(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",o1(B.align),I===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10":""]),style:e.normalizeStyle({...X(B)})},[e.renderSlot(W.$slots,"th-"+B.field,{col:B,sortField:a.value,sortDir:k.value,toggleSort:g},()=>[B.sortable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c1=>g(B.field),class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:gap-1 wpic:cursor-pointer wpic:transition-colors wpic:whitespace-nowrap",B.align==="right"?"wpic:ml-auto":""]),style:{color:"inherit"}},[e.createTextVNode(e.toDisplayString(B.label)+" ",1),a.value===B.field&&k.value==="asc"?(e.openBlock(),e.createBlock(e.unref(z.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):a.value===B.field&&k.value==="desc"?(e.openBlock(),e.createBlock(e.unref(z.ChevronDown),{key:1,size:11,style:{color:"#5E6AD2"}})):(e.openBlock(),e.createBlock(e.unref(z.ChevronsUpDown),{key:2,size:10,style:{opacity:"0.3"}}))],10,K0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(B.label),1)],64))])],6))),128))])])):e.createCommentVNode("",!0),n.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",O0,[n.summaryRow?(e.openBlock(),e.createElementBlock("tr",q0,[n.selectable?(e.openBlock(),e.createElementBlock("td",Y0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",Q0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(B,I)=>(e.openBlock(),e.createElementBlock("td",{key:B.field,class:e.normalizeClass([r1(I,n.compact?"wpic:py-1":"wpic:py-2.5"),o1(B.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(W.$slots,"summary-"+B.field,{row:n.summaryRow,value:n.summaryRow[B.field]},()=>[e.createTextVNode(e.toDisplayString(n.summaryRow[B.field]??"-"),1)])],2))),128))])):e.createCommentVNode("",!0),Z.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Z.value,(B,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:last:border-b-0 wpic:border-zinc-100 wpic:dark:border-zinc-800",[n.expandable&&c.value.has(I)?"wpic:border-b-0":"",n.rowClass?.(B)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(B)??{}}),onClick:c1=>n.expandable?i(I):n.rowClickable&&r("row-click",B)},[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:F[2]||(F[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(d2,{"model-value":T.value.has(U(B,I)),"onUpdate:modelValue":c1=>V(B,I,c1)},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(z.ChevronDown),{key:0,size:13,style:{transition:"transform .15s"}})):(e.openBlock(),e.createBlock(e.unref(z.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,(c1,P)=>(e.openBlock(),e.createElementBlock("td",{key:c1.field,class:e.normalizeClass([r1(P,n.compact?"wpic:py-1":"wpic:py-2.5"),o1(c1.align),P===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?.(B,c1)),onClick:t1=>n.expandable?(n.rowClickable&&r("row-click",B),t1.stopPropagation()):void 0},[e.renderSlot(W.$slots,c1.field,{row:B,value:B[c1.field]},()=>[e.createTextVNode(e.toDisplayString(B[c1.field]??"-"),1)])],14,X0))),128))],14,J0),n.expandable&&c.value.has(I)?(e.openBlock(),e.createElementBlock("tr",G0,[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(W.$slots,"expand",{row:B})],8,_0)])):e.createCommentVNode("",!0)],64))),128)):(e.openBlock(),e.createElementBlock("tr",e3,[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",t3,[e.renderSlot(W.$slots,"empty-icon"),e.createTextVNode(" "+e.toDisplayString(n.emptyText??"No data"),1)])],8,n3)]))]))])]),n.showFooter&&J.value>0?(e.openBlock(),e.createElementBlock("div",c3,[e.createElementVNode("span",i3,[Y.value>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(s1.value)+"–"+e.toDisplayString(E.value)+" "+e.toDisplayString(n.labels?.of??"of")+" "+e.toDisplayString(J.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(J.value)+" "+e.toDisplayString(J.value===1?n.labels?.item??"item":n.labels?.items??"items"),1)],64))]),Y.value>1?(e.openBlock(),e.createElementBlock("div",l3,[e.createElementVNode("button",{type:"button","aria-label":n.labels?.previous??"Previous page",onClick:F[3]||(F[3]=B=>O.value--),disabled:O.value===1,class:"wpic:h-8 wpic:w-8 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-lg 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(z.ChevronLeft),{size:13})],8,a3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B==="…"?(e.openBlock(),e.createElementBlock("span",o3,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button","aria-current":O.value===B?"page":void 0,onClick:I=>O.value=B,class:e.normalizeClass(["wpic:h-8 wpic:min-w-8 wpic:px-2 wpic:rounded-lg wpic:text-sm wpic:font-medium wpic:transition-colors wpic:cursor-pointer",O.value===B?"":"wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"]),style:e.normalizeStyle(O.value===B?"background:rgba(94,106,210,0.1);color:#5E6AD2":void 0)},e.toDisplayString(B),15,r3))],64))),128)),e.createElementVNode("button",{type:"button","aria-label":n.labels?.next??"Next page",onClick:F[4]||(F[4]=B=>O.value++),disabled:O.value===Y.value,class:"wpic:h-8 wpic:w-8 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-lg 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(z.ChevronRight),{size:13})],8,s3)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))],2))}}),d3={key:0,class:"w-spreadsheet-frame__heading"},w3={key:1,class:"w-spreadsheet-frame__status"},u3=["title","aria-label"],m3={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"},h3={key:0,class:"w-spreadsheet__row-axis-col"},f3={key:0},v3={key:0,class:"w-spreadsheet__corner"},b3={key:0,class:"w-spreadsheet__axis"},g3=["colspan","title","tabindex","onClick","onKeydown","onPointerenter","onPointerdown"],k3={key:0,class:"w-spreadsheet__editor"},C3=["type","value","min","placeholder","onInput"],z3=["onPointerdown"],y3=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:p,emit:t}){const l=n,r=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),b=e.ref("asc"),a=e.ref(l.expanded??!1),k=e.ref(null),g=e.ref(null),C=e.ref(null),x=e.ref(null),f=e.ref(null);function m(){if(!l.downloadable)return;const h=$=>`"${String($??"").replace(/"/g,'""')}"`,L=U.value.map($=>l.columns.map(j=>h(Y($,j.key))).join(",")).join(`\r
|
|
2
|
-
`),A=new Blob([`\uFEFF${L}`],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(A),G=document.createElement("a");G.href=_,G.download=l.downloadFilename||"spreadsheet.csv",G.click(),URL.revokeObjectURL(_)}function D(h,L=!0){if(a.value===h)return;const A=performance.now();console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} requested`),a.value=h,L&&r("update:expanded",h),requestAnimationFrame(()=>requestAnimationFrame(()=>{console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} painted in ${(performance.now()-A).toFixed(1)}ms`)}))}e.watch(()=>l.expanded,h=>{h!=null&&D(h,!1)}),e.watch(()=>l.downloadRequest,(h,L)=>{h!=null&&h!==L&&m()}),p({expand:()=>{l.expandable&&D(!0)},collapse:()=>{D(!1)},toggleExpanded:()=>{l.expandable&&D(!a.value)},download:m});function O(h){h.key==="Escape"&&a.value&&D(!1)}function J(h){if(h.target?.closest(".w-spreadsheet__cell")?.querySelector(".w-spreadsheet__input"))return;x.value=null,f.value=null;const _=document.activeElement;_&&k.value?.contains(_)&&_.blur()}e.onMounted(()=>{document.addEventListener("keydown",O),document.addEventListener("pointerdown",J)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",O),document.removeEventListener("pointerdown",J),window.removeEventListener("pointerup",B)});function Y(h,L){return h.cells.find(A=>A.key===L)?.value??""}function Z(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 U=e.computed(()=>{if(!u.value)return l.rows;const h=l.rows.filter(_=>_.sortable!==!1),L=b.value==="asc"?1:-1;h.sort((_,G)=>{const $=Z(Y(_,u.value)),j=Z(Y(G,u.value));return typeof $=="number"&&typeof j=="number"?($-j)*L:String($).localeCompare(String(j),void 0,{numeric:!0})*L});let A=0;return l.rows.map(_=>_.sortable===!1?_:h[A++])});function T(h){const L=l.columns.find(A=>A.key===h.key);return!!(l.sortable&&h.variant==="header"&&L?.sortable!==!1)}function S(h){T(h)&&(u.value===h.key?b.value=b.value==="asc"?"desc":"asc":(u.value=h.key,b.value="asc"))}function y(h,L){return h.cells.slice(0,L).reduce((A,_)=>A+(_.colspan||1),0)}function V(h,L){return!!l.columns[y(h,L)]?.sticky}function Q(h,L){const A=y(h,L);return!!(l.columns[A]?.sticky&&!l.columns.slice(0,A).some(_=>_.sticky))}function s1(h,L){const A=y(h,L);if(!l.columns[A]?.sticky)return;const _=l.columns.slice(0,A).map(G=>G.width||"0px");return{left:_.length?`calc(${_.join(" + ")})`:"0px"}}function E(h,L){return`${h.key}\0${L.key}`}function R(h,L){!L.editable||g.value||(x.value={rowKey:h.key,cellKey:L.key},f.value=null)}function H(h,L){return x.value?.rowKey===h.key&&x.value?.cellKey===L.key}function o1(h,L,A){const _=U.value[h];!l.fillHandle||!A.editable||!_||!H(_,A)||(f.value=null,g.value={row:h,cell:L,value:String(A.value??"")},C.value={row:h,cell:L},window.addEventListener("pointerup",B,{once:!0}))}function r1(h,L){g.value&&(C.value={row:h,cell:L})}function X(h,L){if(!g.value||!C.value)return!1;const A=Math.min(g.value.row,C.value.row),_=Math.max(g.value.row,C.value.row),G=Math.min(g.value.cell,C.value.cell),$=Math.max(g.value.cell,C.value.cell);return h>=A&&h<=_&&L>=G&&L<=$}function W(h,L){if(!X(h,L)||!g.value||!C.value)return{};const A=Math.min(g.value.row,C.value.row),_=Math.max(g.value.row,C.value.row),G=Math.min(g.value.cell,C.value.cell),$=Math.max(g.value.cell,C.value.cell);return{"w-spreadsheet__cell--fill-range":!0,"w-spreadsheet__cell--fill-top":h===A,"w-spreadsheet__cell--fill-bottom":h===_,"w-spreadsheet__cell--fill-left":L===G,"w-spreadsheet__cell--fill-right":L===$}}function F(h,L){const A=E(h,L);return{"w-spreadsheet__cell--fill-completed":!!f.value?.cells.has(A),"w-spreadsheet__cell--fill-source":f.value?.source===A}}function B(){if(!g.value||!C.value)return;const h=g.value,L=C.value,A=Math.min(h.row,L.row),_=Math.max(h.row,L.row),G=Math.min(h.cell,L.cell),$=Math.max(h.cell,L.cell),j=new Set,q=U.value[h.row],p1=q?.cells[h.cell];for(let m1=A;m1<=_;m1++){const V1=U.value[m1];if(V1)for(let B1=G;B1<=$;B1++){const E1=V1.cells[B1];E1?.editable&&(j.add(E(V1,E1)),r("cell-change",{rowKey:V1.key,cellKey:E1.key,value:h.value,row:V1,cell:E1}))}}g.value=null,C.value=null,f.value=q&&p1?{cells:j,source:E(q,p1)}:null}function I(h){let L=h+1,A="";for(;L>0;)L-=1,A=String.fromCharCode(65+L%26)+A,L=Math.floor(L/26);return A}function c1(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 P(h,L,A){const _=A.target.value;r("cell-change",{rowKey:h.key,cellKey:L.key,value:_,row:h,cell:L})}function t1(h){const A=h.currentTarget.previousElementSibling;A?.focus(),A?.showPicker?.()}return(h,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"frameRef",ref:k,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]=A=>D(!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",d3,[e.renderSlot(h.$slots,"expanded-header")])):e.createCommentVNode("",!0),h.$slots["toolbar-status"]?(e.openBlock(),e.createElementBlock("div",w3,[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:m},[e.createVNode(e.unref(z.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]=A=>D(!a.value))},[a.value?(e.openBlock(),e.createBlock(e.unref(z.Minimize),{key:0,size:16})):(e.openBlock(),e.createBlock(e.unref(z.Expand),{key:1,size:16}))],8,u3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",m3,[e.createVNode(_1),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",h3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,A=>(e.openBlock(),e.createElementBlock("col",{key:A.key,style:e.normalizeStyle({width:A.width})},null,4))),128))]),c.value?(e.openBlock(),e.createElementBlock("thead",f3,[e.createElementVNode("tr",null,[i.value?(e.openBlock(),e.createElementBlock("th",v3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(A,_)=>(e.openBlock(),e.createElementBlock("th",{key:A.key,class:"w-spreadsheet__axis"},e.toDisplayString(A.label||I(_)),1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(A,_)=>(e.openBlock(),e.createElementBlock("tr",{key:A.key,class:e.normalizeClass({"w-spreadsheet__row--sticky":A.sticky})},[i.value?(e.openBlock(),e.createElementBlock("th",b3,e.toDisplayString(_+1),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.cells,(G,$)=>(e.openBlock(),e.createElementBlock("td",{key:G.key,class:e.normalizeClass(["w-spreadsheet__cell",[c1(G),{"w-spreadsheet__cell--sortable":T(G),"w-spreadsheet__cell--sticky":V(A,$),"w-spreadsheet__cell--sticky-first":Q(A,$),"w-spreadsheet__cell--active":H(A,G)},W(_,$),F(A,G)]]),colspan:G.colspan||1,title:G.title,style:e.normalizeStyle(s1(A,$)),tabindex:T(G)?0:void 0,onClick:j=>S(G),onKeydown:[e.withKeys(e.withModifiers(j=>S(G),["prevent"]),["enter"]),e.withKeys(e.withModifiers(j=>S(G),["prevent"]),["space"])],onPointerenter:j=>r1(_,$),onPointerdown:j=>R(A,G)},[e.renderSlot(h.$slots,`cell-${G.key}`,{row:A,cell:G,rowIndex:_},()=>[G.editable?(e.openBlock(),e.createElementBlock("div",k3,[e.createElementVNode("input",{class:e.normalizeClass(["w-spreadsheet__input",{"w-spreadsheet__input--date":G.inputType==="date"}]),type:G.inputType||"text",value:G.value??"",min:G.min,placeholder:G.placeholder,onInput:j=>P(A,G,j)},null,42,C3),G.inputType==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet__calendar","aria-label":"Choose date",title:"Choose date",onClick:t1},[e.createVNode(e.unref(z.CalendarDays),{size:16})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(G.value??""),1)],64))]),T(G)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value===G.key?b.value==="asc"?e.unref(z.ChevronUp):e.unref(z.ChevronDown):e.unref(z.ChevronsUpDown)),{key:0,class:"w-spreadsheet__sort-icon",size:14})):e.createCommentVNode("",!0),n.fillHandle&&G.editable&&H(A,G)?(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(j=>o1(_,$,G),["stop","prevent"])},null,40,z3)):e.createCommentVNode("",!0)],46,g3))),128))],2))),128))])],6)],6))],2)],2))}}),h1=(n,p)=>{const t=n.__vccOpts||n;for(const[l,r]of p)t[l]=r;return t},x3={},B3={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 M3(n,p){return e.openBlock(),e.createElementBlock("div",B3,[e.renderSlot(n.$slots,"default")])}const w2=h1(x3,[["render",M3]]),V3=["disabled"],D1=e.defineComponent({__name:"WActionMenuItem",props:{danger:{type:Boolean},disabled:{type:Boolean}},emits:["click"],setup(n,{emit:p}){const t=p;return(l,r)=>(e.openBlock(),e.createElementBlock("button",{type:"button",disabled:n.disabled,onClick:r[0]||(r[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,V3))}}),F2={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"}},E3={light:["#3B73E1","#0891A6","#8B5CD6","#C58A16","#D64D79","#527FA8"],dark:["#7C9FE0","#5FB8C4","#AF94D5","#D8B26A","#D88FA5","#94A8BD"]};function T2(n,p={}){const t={...F2[n],...p},l={};for(const[r,c]of Object.entries(t))l[`--wpic-${r.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-track":n==="dark"?t.raised:"rgb(113 113 122 / 0.10)","--wpic-segment-outline":n==="dark"?"rgb(161 161 170 / 0.18)":"rgb(113 113 122 / 0.16)","--wpic-segment-hover":n==="dark"?t.border:"rgb(113 113 122 / 0.16)","--wpic-segment-muted":n==="dark"?t.muted:"#71717A","--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[r,c]of Object.entries(l))r.startsWith("--wpic-legacy-")&&(l[r.replace("--wpic-legacy-","--")]=c);return l}const A2=Symbol("wpic-theme");function T1(){return e.inject(A2,e.computed(()=>null))}let S2=0,L2="";function H2(){S2++===0&&(L2=document.body.style.overflow,document.body.style.overflow="hidden");let n=!1;return()=>{n||(n=!0,--S2===0&&(document.body.style.overflow=L2))}}const N3=["data-wpic-theme"],S3=["aria-label"],L3={class:"wpic-bottom-sheet-header"},$3=["aria-label"],D3={key:0,class:"wpic-bottom-sheet-footer"},y1=[],s2=new Map,m2=e.defineComponent({__name:"WBottomSheet",props:{returnFocus:{},modelValue:{type:Boolean},title:{},closeLabel:{default:"Close"},noPadding:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:p}){const t=n,l=p,r=T1(),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 b=e.ref({height:0,top:0}),a=e.computed(()=>b.value.height?{height:`${b.value.height}px`,top:`${b.value.top}px`}:{}),k=Symbol.for("wpic-ui-popover-descendants"),g=e.inject(k,null),C=new Set;e.provide(k,{add(y){C.add(y),g?.add(y)},remove(y){C.delete(y),g?.remove(y)}}),e.provide("wpic-pagination-url-sync",!1),e.watch(c,(y,V)=>{V&&g?.remove(V),y&&g?.add(y)});let x=null,f=!1,m;const D=y=>!!y.getClientRects().length&&getComputedStyle(y).visibility!=="hidden";function O(){return[c.value,...C].filter(y=>!!y&&D(y)).flatMap(y=>[...y.querySelectorAll('a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex="0"]')]).filter(D)}function J(){l("update:modelValue",!1)}function Y(y){if(!(y1[y1.length-1]!==i||Z(y.target))){if(y.key==="Escape"){if([...C].some(D))return;y.preventDefault(),y.stopPropagation(),J()}else if(y.key==="Tab"){const V=O(),Q=V.indexOf(document.activeElement);if(!V.length){y.preventDefault(),c.value?.focus();return}y.shiftKey&&Q<=0?(y.preventDefault(),V[V.length-1]?.focus()):!y.shiftKey&&(Q<0||Q===V.length-1)&&(y.preventDefault(),V[0]?.focus())}}}function Z(y){const V=y.closest?.(".wpic-modal-overlay");return!!V&&Number(getComputedStyle(V).zIndex)>u.value}function U(y){if(y1[y1.length-1]!==i||Z(y.target))return;const V=y.target;c.value?.contains(V)||[...C].some(Q=>Q.contains(V))||c.value?.focus({preventScroll:!0})}function T(){const y=window.visualViewport;b.value={height:y?.height??window.innerHeight,top:y?.offsetTop??0}}function S(){if(!f)return;f=!1;const y=y1[y1.length-1]===i;y1.splice(y1.indexOf(i),1),s2.delete(i),m?.(),m=void 0,document.removeEventListener("keydown",Y),document.removeEventListener("focusin",U),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T),y&&x?.isConnected&&x.focus({preventScroll:!0})}return e.watch(()=>t.modelValue,async y=>{if(!y){S();return}f||(f=!0,x=t.returnFocus??document.activeElement,m=H2(),u.value=Math.max(w.value,9998,...s2.values())+2,y1.push(i),s2.set(i,u.value),T(),document.addEventListener("keydown",Y),document.addEventListener("focusin",U),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T),await e.nextTick(),t.modelValue&&c.value?.focus({preventScroll:!0}))},{immediate:!0}),e.onBeforeUnmount(()=>{c.value&&g?.remove(c.value),S()}),(y,V)=>(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(r),dark:e.unref(r)?.mode==="dark"}]),style:e.normalizeStyle([e.unref(r)?.variables,a.value,{zIndex:u.value}]),"data-wpic-theme":e.unref(r)?.mode,onClick:e.withModifiers(J,["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"},[V[0]||(V[0]=e.createElementVNode("div",{class:"wpic-bottom-sheet-handle","aria-hidden":"true"},null,-1)),e.createElementVNode("header",L3,[e.renderSlot(y.$slots,"header",{},()=>[e.createElementVNode("h2",null,e.toDisplayString(n.title),1)]),e.createElementVNode("button",{type:"button","aria-label":n.closeLabel,onClick:J},[e.createVNode(e.unref(z.X),{size:20})],8,$3)]),e.createElementVNode("div",{class:e.normalizeClass(["wpic-bottom-sheet-body",{"wpic-bottom-sheet-padded":!n.noPadding}])},[e.renderSlot(y.$slots,"default")],2),y.$slots.footer?(e.openBlock(),e.createElementBlock("footer",D3,[e.renderSlot(y.$slots,"footer")])):e.createCommentVNode("",!0)],8,S3)],14,N3)):e.createCommentVNode("",!0)]))}});function h2(){const n=typeof window<"u"?window.matchMedia("(max-width: 767px)"):null,p=e.ref(n?.matches??!1),t=()=>{p.value=n?.matches??!1};return n?.addEventListener("change",t),e.onBeforeUnmount(()=>n?.removeEventListener("change",t)),p}const F3=["data-wpic-theme","data-unstyled"],v1=e.defineComponent({__name:"WPopover",props:{unstyled:{type:Boolean},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:p}){const t=n,l=e.inject("wpic-overlay-layer",e.ref(0)),r=e.computed(()=>Math.max(Number(t.zIndex)||9999,l.value+1));e.provide("wpic-overlay-layer",r);const c=T1(),i=h2(),w=e.computed(()=>i.value&&t.mobileSheet),u=p,b=Symbol.for("wpic-ui-popover-descendants"),a=e.inject(b,null),k=new Set;e.provide(b,{add(E){k.add(E),a?.add(E)},remove(E){k.delete(E),a?.remove(E)}});const g=e.computed(()=>{const E=t.anchor;return E?e.isRef(E)?E.value:E:null}),C=e.ref(null),x=e.ref(null),f=e.computed(()=>x.value??t.placement??"bottom-start"),m=e.computed(()=>{const E=[l1.offset(t.offset??6)];return x.value||(t.autoPlacement?E.push(l1.autoPlacement({alignment:"start"})):t.flip&&E.push(l1.flip({crossAxis:!t.shiftCrossAxis}))),E.push(l1.shift({padding:t.autoPlacement?8:4,crossAxis:t.autoPlacement||t.shiftCrossAxis})),E.push(l1.size({padding:8,apply({availableHeight:R,availableWidth:H,rects:o1,elements:r1}){const X=Math.max(R-8,50),W=t.maxHeight?`min(${t.maxHeight}, ${X}px)`:`${X}px`,F={maxWidth:`${Math.max(H,0)}px`,maxHeight:W,overflowY:t.panelScroll?"auto":"hidden"};if(t.height&&(F.height=`min(${t.height}, ${X}px)`),t.minHeight&&(F.minHeight=`min(${t.minHeight}, ${X}px)`),t.matchAnchorWidth){const B=`${Math.min(o1.reference.width,Math.max(H,0))}px`;F.width=t.fitAnchorContent?"max-content":B,F.minWidth=B}Object.assign(r1.floating.style,F)}})),E}),{floatingStyles:D,placement:O,update:J,isPositioned:Y}=l1.useFloating(g,C,{placement:f,strategy:"fixed",open:e.computed(()=>t.open),whileElementsMounted:l1.autoUpdate,middleware:m}),Z=e.computed(()=>{const E=O.value;return E.startsWith("top")?"bottom":E.startsWith("bottom")?"top":E.startsWith("left")?"right":E.startsWith("right")?"left":"top"}),U=E=>{if(w.value)return;const R=E.target,H=g.value,o1=C.value;o1&&o1.contains(R)||[...k].some(r1=>r1.contains(R))||H&&H.contains(R)||t.extraPanels?.some(r1=>r1?.contains(R))||u("close")},T=E=>{if(w.value||E.key!=="Escape"||!t.open||[...k].some(H=>H.isConnected&&H.style.display!=="none"))return;E.preventDefault(),E.stopImmediatePropagation(),u("close");const R=g.value;R?.matches("button, input, [tabindex]")?R.focus():R?.querySelector("button, input, [tabindex]")?.focus()};let S=!1,y=!1;function V(){y||(document.addEventListener("pointerdown",U,!0),document.addEventListener("keydown",T,!0),y=!0)}function Q(){y&&(document.removeEventListener("pointerdown",U,!0),document.removeEventListener("keydown",T,!0),y=!1)}e.watch(()=>t.open,E=>{E?e.nextTick(()=>{S||!t.open||(t.autoPlacement&&C.value&&(C.value.style.maxHeight=""),J(),V())}):(x.value=null,Q())},{immediate:!0}),e.watch(C,(E,R)=>{R&&a?.remove(R),E&&a?.add(E)}),e.watch(Y,E=>{E&&t.open&&t.freezePositionOnOpen&&!x.value&&(x.value=O.value)}),e.onBeforeUnmount(()=>{S=!0,Q(),C.value&&a?.remove(C.value)});const s1=e.computed(()=>({...t.matchAnchorWidth?{}:{width:t.width??"auto"},...t.minWidth?{minWidth:t.minWidth}:{},transformOrigin:Z.value,zIndex:r.value}));return(E,R)=>w.value?(e.openBlock(),e.createBlock(m2,{key:0,"return-focus":g.value,"model-value":n.open,title:n.sheetTitle,"close-label":n.closeLabel,"no-padding":"","onUpdate:modelValue":R[0]||(R[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:C,"data-wpic-theme":e.unref(c)?.mode,"data-unstyled":n.unstyled||void 0,class:e.normalizeClass([[{"wpic-theme":e.unref(c),dark:e.unref(c)?.mode==="dark"},!n.unstyled&&"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"],"wpic-popover-panel wpic:flex wpic:flex-col"]),style:e.normalizeStyle([e.unref(c)?.variables,e.unref(D),s1.value])},[e.renderSlot(E.$slots,"default")],14,F3),[[e.vShow,n.open]])]))}}),T3={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"},A3=["data-variant","data-maximized","data-docked"],H3=["title"],P3={class:"wpic:min-w-0 wpic:flex-1 wpic:px-2 wpic:text-center"},j3={class:"wpic:truncate wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},W3={key:0,class:"wpic:truncate wpic:text-zinc-500 wpic:dark:text-zinc-400"},R3={class:"wpic:flex wpic:shrink-0 wpic:items-center wpic:gap-1"},I3=["title"],Z3=["title"],U3=["title"],K3=["title"],O3={class:"wpic:flex wpic:h-11 wpic:shrink-0 wpic:items-center wpic:justify-between wpic:px-3"},q3={class:"wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},Y3=["title"],Q3={class:"wpic:space-y-2 wpic:px-3 wpic:pb-3"},J3={class:"wpic:truncate"},X3={class:"wpic:flex-1 wpic:overflow-y-auto wpic:overflow-x-visible wpic:px-2 wpic:pb-3"},G3={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"},_3={class:"wpic:truncate"},e5=["title"],n5={class:"wpic:space-y-0.5"},t5={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"},c5=["onMouseenter"],i5=["onClick"],l5={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},a5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},o5={key:0,class:"wpic:px-3 wpic:py-2 wpic:text-zinc-400 wpic:dark:text-zinc-500"},r5=["onPointerdown","onClick"],s5={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},p5={class:"wpic:shrink-0 wpic:text-zinc-400"},d5={class:"wpic:mt-4"},w5={class:"wpic:flex wpic:h-7 wpic:items-center wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},u5={class:"wpic:truncate"},m5={class:"wpic:space-y-0.5"},h5={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"},f5=["onPointerdown","onClick"],v5={class:"wpic:block wpic:truncate"},b5={class:"wpic:shrink-0 wpic:text-zinc-400"},g5=["onClick"],k5=["onPointerenter","onMouseenter"],C5={class:"wpic:truncate"},z5={class:"wpic:flex wpic:min-h-0 wpic:flex-1"},y5={class:"wpic:flex wpic:min-h-0 wpic:min-w-0 wpic:flex-1 wpic:flex-col"},x5={class:"wpic:relative wpic:flex wpic:min-h-0 wpic:flex-1"},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"},M5={class:"wpic:font-medium"},V5={key:1,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center"},E5={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"},N5={class:"wpic:font-semibold wpic:text-zinc-800 wpic:dark:text-zinc-100"},S5={key:0,class:"wpic:mt-1 wpic:max-w-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},L5={key:2,class:"wpic:space-y-4"},$5=["data-chat-message-index"],D5=["datetime"],F5=["src","alt"],T5={class:"wpic:max-w-40 wpic:truncate"},A5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},H5={key:0,class:"wpic:flex wpic:items-center wpic:gap-2 wpic:text-zinc-500 wpic:dark:text-zinc-400"},P5={key:1,class:"wpic-chat-loading-card",role:"status","aria-label":"Generating image"},j5=["innerHTML","onClick"],W5=["href","onClick"],R5=["src"],I5=["title","aria-label","aria-pressed","onClick"],Z5=["title","aria-label","aria-pressed","onClick"],U5=["title","onClick"],K5=["onClick"],O5=["title","onClick"],q5=["aria-label"],Y5=["aria-label","title","aria-current","onClick"],Q5={class:"wpic-chat-panel__footer wpic:shrink-0 wpic:bg-white wpic:p-3 wpic:dark:bg-zinc-800"},J5={key:0,class:"wpic:mb-2 wpic:flex wpic:flex-wrap wpic:justify-end wpic:gap-1.5"},X5=["src","alt"],G5={class:"wpic:max-w-40 wpic:truncate"},_5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},e4={key:1,class:"wpic:shrink-0 wpic:text-zinc-400"},n4=["title","onClick"],t4={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"},c4={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"},i4=["onMousedown"],l4={class:"wpic:min-w-0 wpic:truncate wpic:font-medium wpic:text-zinc-900 wpic:dark:text-zinc-100"},a4={key:0,class:"wpic:max-w-32 wpic:shrink-0 wpic:truncate wpic:text-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},o4=["accept"],r4=["value","placeholder","disabled"],s4={class:"wpic:flex wpic:items-center wpic:gap-1"},p4=["title"],d4=["disabled","title"],$2=80,w4=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},showQuestionRail:{type:Boolean,default:!1},questionRailLabel:{default:"Questions"},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:p}){const t=n,l=p,r=e.useSlots(),c=e.ref(null),i=e.ref(null),w=e.ref(null),u=e.ref(null),b=e.ref(null),a=e.ref(0),k=e.ref(0),g=e.ref(!1),C=e.ref(null),x=e.ref(null);let f=null;const m=e.ref(!1),D=e.ref(!1),O=e.ref(!1);e.ref(new Set);const J=e.ref(null),Y=e.ref(null),Z=e.ref({}),U=e.ref(null);let T=null;const S=e.computed(()=>U.value?[]:t.messages.filter(o=>o.role!=="system")),y=e.computed(()=>t.loading||U.value!==null),V=e.computed(()=>t.modelValue.trim().length>0&&!t.loading),Q=e.computed(()=>t.attachments.length>0),s1=e.computed(()=>{const o=t.modelValue.slice(0,k.value),s=o.match(/(?:^|\s)@([^\s@]*)$/);return s?{start:o.length-s[0].length+(s[0].startsWith(" ")?1:0),query:s[1].toLowerCase()}:null}),E=e.computed(()=>{const o=s1.value;if(!o)return[];const s=o.query;return t.mentionItems.filter(d=>d.label.toLowerCase().includes(s)).slice(0,6)}),R=e.computed(()=>t.showNavigator&&g.value),H=e.computed(()=>t.selectedProjectId??null),o1=e.computed(()=>t.sessions.filter(o=>!o.projectId)),r1=e.computed(()=>{const o=new Map;for(const s of t.projects)o.set(s.id,[]);for(const s of t.sessions){if(!s.projectId)continue;const d=o.get(s.projectId);d&&d.push(s)}return o});function X(o){const s=o.toLowerCase();if(s.includes("doubao-seedance-1-5-pro-251215")||s.includes("doubao seedance 1.5")||s.includes("seedance 1.5")||s.includes("seedance video"))return"jimeng:doubao-seedance-1-5-pro-251215";if(s.includes("imagen 4")||s.includes("imagen-4"))return"google:imagen-4.0-generate-001";if(s.includes("gpt-image-1")||s.includes("gpt image 1"))return"openai:gpt-image-1";if(s.includes("gpt-image-2")||s.includes("gpt image 2"))return"openai:gpt-image-2";if(s.includes("doubao-seedream-4-5-251128"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao-seedream-4-0-250828"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("doubao seedream 5")||s.includes("seedream 5")||s.includes("doubao seedream 4.5")||s.includes("seedream 4.5"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao seedream 4")||s.includes("seedream 4"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("auto"))return"auto";const d=o.match(/\b([a-z][a-z0-9_-]+):([a-z0-9._-]+)\b/i);if(d)return`${d[1].toLowerCase()}:${d[2]}`}function W(o){if(o!=="auto"){if(o.includes("seedance"))return"video";if(o.includes("gpt-image")||o.includes("imagen")||o.includes("seedream")||o.includes("jimeng:"))return"image"}}function F(o){const s=[],d=new Set,M=/\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 v of o.matchAll(M)){const N=v[1],K=X(N);!K||d.has(K)||(d.add(K),s.push({label:N,value:K}))}return s}function B(o,s){return o.match(new RegExp(`${s}=["']([^"']+)["']`,"i"))?.[1]}function I(o){const s={};for(const M of o.matchAll(/\[SETTING\s+([^\]]+)\]([\s\S]*?)\[\/SETTING\]/gi)){const v=M[1]??"",N=B(v,"key"),K=B(v,"value")??M[2]?.trim();if(!(!N||!K))if(N==="duration"||N==="fps"||N==="count"){const n1=Number(K);Number.isFinite(n1)&&(s[N]=n1)}else if(N==="model"){const n1=X(K)??X(M[2]?.trim()??"");n1&&(s.model=n1)}else(N==="aspect"||N==="resolution"||N==="format")&&(s[N]=K)}const d=o.split(/\r?\n/).map(M=>M.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const M of d){const v=M.toLowerCase();if(/(supporte|supports?|disponible|available|dur[eé]es?\s*:|ratios?\s*:|jusqu['’]?à|up to)/i.test(v))continue;const N=M.split(":").slice(1).join(":").trim()||M,K=N.match(/\b(\d{1,2}:\d{1,2})\b/);(v.includes("format")||v.includes("aspect")||v.includes("ratio"))&&K&&(s.aspect=K[1]);const n1=N.match(/\b([1248]K)\b/i);(v.includes("résolution")||v.includes("resolution"))&&n1&&(s.resolution=n1[1].toUpperCase());const e1=N.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);(v.includes("durée")||v.includes("duration"))&&e1&&(s.duration=Number(e1[1]));const i1=N.match(/\b(\d{1,3})\s*fps\b/i);v.includes("fps")&&i1&&(s.fps=Number(i1[1]));const a1=N.match(/\b(\d{1,2})\b/);if((v.includes("count")||v.includes("nombre")||v.includes("variantes"))&&a1&&(s.count=Number(a1[1])),v.includes("modèle")||v.includes("modele")||v.includes("model")){const b1=X(N);b1&&(s.model=b1)}v.includes("jpg")||v.includes("jpeg")?s.format="jpg":v.includes("png")?s.format="png":v.includes("webp")&&(s.format="webp")}return Object.keys(s).length?s:void 0}function c1(o){const s=o.match(/\[TASK(?:\s+([^\]]+))?\](?:([\s\S]*?)\[\/TASK\])?/i);if(s){const M=(B(s[1]??"","value")??s[2]?.trim())?.toLowerCase();if(["image","video","audio","text"].includes(String(M)))return M}const d=o.split(/\r?\n/).map(M=>M.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const M of d){const v=M.toLowerCase(),N=M.split(":").slice(1).join(":").trim().toLowerCase()||v;if(/(task|type|mode|surface|format|réglage|reglage|setting)/i.test(v)){if(/\baudio\b|subtitles?|sous-titres?|transcri|tts|voice|voix/.test(N))return"audio";if(/\bvid[eé]o\b|\bvideo\b|\bfps\b|duration|dur[eé]e/.test(N))return"video";if(/\bimage\b|photo|visuel|illustration|aspect|ratio|resolution|résolution/.test(N))return"image";if(/\btext\b|texte|copy|caption|script/.test(N))return"text"}}}function P(o){const s=o.match(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i)?.[1];if(s){const e1=p1(s).trim().replace(/^["“]|["”]$/g,"");if(e1)return e1}const d=o.replace(/\r\n/g,`
|
|
2
|
+
`),A=new Blob([`\uFEFF${L}`],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(A),G=document.createElement("a");G.href=_,G.download=l.downloadFilename||"spreadsheet.csv",G.click(),URL.revokeObjectURL(_)}function D(h,L=!0){if(a.value===h)return;const A=performance.now();console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} requested`),a.value=h,L&&r("update:expanded",h),requestAnimationFrame(()=>requestAnimationFrame(()=>{console.debug(`[WSpreadsheet] ${h?"expand":"minimize"} painted in ${(performance.now()-A).toFixed(1)}ms`)}))}e.watch(()=>l.expanded,h=>{h!=null&&D(h,!1)}),e.watch(()=>l.downloadRequest,(h,L)=>{h!=null&&h!==L&&m()}),p({expand:()=>{l.expandable&&D(!0)},collapse:()=>{D(!1)},toggleExpanded:()=>{l.expandable&&D(!a.value)},download:m});function O(h){h.key==="Escape"&&a.value&&D(!1)}function J(h){if(h.target?.closest(".w-spreadsheet__cell")?.querySelector(".w-spreadsheet__input"))return;x.value=null,f.value=null;const _=document.activeElement;_&&k.value?.contains(_)&&_.blur()}e.onMounted(()=>{document.addEventListener("keydown",O),document.addEventListener("pointerdown",J)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",O),document.removeEventListener("pointerdown",J),window.removeEventListener("pointerup",B)});function Y(h,L){return h.cells.find(A=>A.key===L)?.value??""}function Z(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 U=e.computed(()=>{if(!u.value)return l.rows;const h=l.rows.filter(_=>_.sortable!==!1),L=b.value==="asc"?1:-1;h.sort((_,G)=>{const $=Z(Y(_,u.value)),j=Z(Y(G,u.value));return typeof $=="number"&&typeof j=="number"?($-j)*L:String($).localeCompare(String(j),void 0,{numeric:!0})*L});let A=0;return l.rows.map(_=>_.sortable===!1?_:h[A++])});function T(h){const L=l.columns.find(A=>A.key===h.key);return!!(l.sortable&&h.variant==="header"&&L?.sortable!==!1)}function S(h){T(h)&&(u.value===h.key?b.value=b.value==="asc"?"desc":"asc":(u.value=h.key,b.value="asc"))}function y(h,L){return h.cells.slice(0,L).reduce((A,_)=>A+(_.colspan||1),0)}function V(h,L){return!!l.columns[y(h,L)]?.sticky}function Q(h,L){const A=y(h,L);return!!(l.columns[A]?.sticky&&!l.columns.slice(0,A).some(_=>_.sticky))}function s1(h,L){const A=y(h,L);if(!l.columns[A]?.sticky)return;const _=l.columns.slice(0,A).map(G=>G.width||"0px");return{left:_.length?`calc(${_.join(" + ")})`:"0px"}}function E(h,L){return`${h.key}\0${L.key}`}function R(h,L){!L.editable||g.value||(x.value={rowKey:h.key,cellKey:L.key},f.value=null)}function H(h,L){return x.value?.rowKey===h.key&&x.value?.cellKey===L.key}function o1(h,L,A){const _=U.value[h];!l.fillHandle||!A.editable||!_||!H(_,A)||(f.value=null,g.value={row:h,cell:L,value:String(A.value??"")},C.value={row:h,cell:L},window.addEventListener("pointerup",B,{once:!0}))}function r1(h,L){g.value&&(C.value={row:h,cell:L})}function X(h,L){if(!g.value||!C.value)return!1;const A=Math.min(g.value.row,C.value.row),_=Math.max(g.value.row,C.value.row),G=Math.min(g.value.cell,C.value.cell),$=Math.max(g.value.cell,C.value.cell);return h>=A&&h<=_&&L>=G&&L<=$}function W(h,L){if(!X(h,L)||!g.value||!C.value)return{};const A=Math.min(g.value.row,C.value.row),_=Math.max(g.value.row,C.value.row),G=Math.min(g.value.cell,C.value.cell),$=Math.max(g.value.cell,C.value.cell);return{"w-spreadsheet__cell--fill-range":!0,"w-spreadsheet__cell--fill-top":h===A,"w-spreadsheet__cell--fill-bottom":h===_,"w-spreadsheet__cell--fill-left":L===G,"w-spreadsheet__cell--fill-right":L===$}}function F(h,L){const A=E(h,L);return{"w-spreadsheet__cell--fill-completed":!!f.value?.cells.has(A),"w-spreadsheet__cell--fill-source":f.value?.source===A}}function B(){if(!g.value||!C.value)return;const h=g.value,L=C.value,A=Math.min(h.row,L.row),_=Math.max(h.row,L.row),G=Math.min(h.cell,L.cell),$=Math.max(h.cell,L.cell),j=new Set,q=U.value[h.row],p1=q?.cells[h.cell];for(let m1=A;m1<=_;m1++){const V1=U.value[m1];if(V1)for(let B1=G;B1<=$;B1++){const E1=V1.cells[B1];E1?.editable&&(j.add(E(V1,E1)),r("cell-change",{rowKey:V1.key,cellKey:E1.key,value:h.value,row:V1,cell:E1}))}}g.value=null,C.value=null,f.value=q&&p1?{cells:j,source:E(q,p1)}:null}function I(h){let L=h+1,A="";for(;L>0;)L-=1,A=String.fromCharCode(65+L%26)+A,L=Math.floor(L/26);return A}function c1(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 P(h,L,A){const _=A.target.value;r("cell-change",{rowKey:h.key,cellKey:L.key,value:_,row:h,cell:L})}function t1(h){const A=h.currentTarget.previousElementSibling;A?.focus(),A?.showPicker?.()}return(h,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"frameRef",ref:k,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]=A=>D(!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",d3,[e.renderSlot(h.$slots,"expanded-header")])):e.createCommentVNode("",!0),h.$slots["toolbar-status"]?(e.openBlock(),e.createElementBlock("div",w3,[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:m},[e.createVNode(e.unref(z.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]=A=>D(!a.value))},[a.value?(e.openBlock(),e.createBlock(e.unref(z.Minimize),{key:0,size:16})):(e.openBlock(),e.createBlock(e.unref(z.Expand),{key:1,size:16}))],8,u3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",m3,[e.createVNode(_1),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",h3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,A=>(e.openBlock(),e.createElementBlock("col",{key:A.key,style:e.normalizeStyle({width:A.width})},null,4))),128))]),c.value?(e.openBlock(),e.createElementBlock("thead",f3,[e.createElementVNode("tr",null,[i.value?(e.openBlock(),e.createElementBlock("th",v3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(A,_)=>(e.openBlock(),e.createElementBlock("th",{key:A.key,class:"w-spreadsheet__axis"},e.toDisplayString(A.label||I(_)),1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(A,_)=>(e.openBlock(),e.createElementBlock("tr",{key:A.key,class:e.normalizeClass({"w-spreadsheet__row--sticky":A.sticky})},[i.value?(e.openBlock(),e.createElementBlock("th",b3,e.toDisplayString(_+1),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.cells,(G,$)=>(e.openBlock(),e.createElementBlock("td",{key:G.key,class:e.normalizeClass(["w-spreadsheet__cell",[c1(G),{"w-spreadsheet__cell--sortable":T(G),"w-spreadsheet__cell--sticky":V(A,$),"w-spreadsheet__cell--sticky-first":Q(A,$),"w-spreadsheet__cell--active":H(A,G)},W(_,$),F(A,G)]]),colspan:G.colspan||1,title:G.title,style:e.normalizeStyle(s1(A,$)),tabindex:T(G)?0:void 0,onClick:j=>S(G),onKeydown:[e.withKeys(e.withModifiers(j=>S(G),["prevent"]),["enter"]),e.withKeys(e.withModifiers(j=>S(G),["prevent"]),["space"])],onPointerenter:j=>r1(_,$),onPointerdown:j=>R(A,G)},[e.renderSlot(h.$slots,`cell-${G.key}`,{row:A,cell:G,rowIndex:_},()=>[G.editable?(e.openBlock(),e.createElementBlock("div",k3,[e.createElementVNode("input",{class:e.normalizeClass(["w-spreadsheet__input",{"w-spreadsheet__input--date":G.inputType==="date"}]),type:G.inputType||"text",value:G.value??"",min:G.min,placeholder:G.placeholder,onInput:j=>P(A,G,j)},null,42,C3),G.inputType==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet__calendar","aria-label":"Choose date",title:"Choose date",onClick:t1},[e.createVNode(e.unref(z.CalendarDays),{size:16})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(G.value??""),1)],64))]),T(G)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value===G.key?b.value==="asc"?e.unref(z.ChevronUp):e.unref(z.ChevronDown):e.unref(z.ChevronsUpDown)),{key:0,class:"w-spreadsheet__sort-icon",size:14})):e.createCommentVNode("",!0),n.fillHandle&&G.editable&&H(A,G)?(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(j=>o1(_,$,G),["stop","prevent"])},null,40,z3)):e.createCommentVNode("",!0)],46,g3))),128))],2))),128))])],6)],6))],2)],2))}}),h1=(n,p)=>{const t=n.__vccOpts||n;for(const[l,r]of p)t[l]=r;return t},x3={},B3={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 M3(n,p){return e.openBlock(),e.createElementBlock("div",B3,[e.renderSlot(n.$slots,"default")])}const w2=h1(x3,[["render",M3]]),V3=["disabled"],D1=e.defineComponent({__name:"WActionMenuItem",props:{danger:{type:Boolean},disabled:{type:Boolean}},emits:["click"],setup(n,{emit:p}){const t=p;return(l,r)=>(e.openBlock(),e.createElementBlock("button",{type:"button",disabled:n.disabled,onClick:r[0]||(r[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,V3))}}),F2={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"}},E3={light:["#3B73E1","#0891A6","#8B5CD6","#C58A16","#D64D79","#527FA8"],dark:["#7C9FE0","#5FB8C4","#AF94D5","#D8B26A","#D88FA5","#94A8BD"]};function T2(n,p={}){const t={...F2[n],...p},l={};for(const[r,c]of Object.entries(t))l[`--wpic-${r.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-track":n==="dark"?t.raised:"rgb(113 113 122 / 0.06)","--wpic-segment-outline":n==="dark"?"rgb(161 161 170 / 0.18)":"rgb(113 113 122 / 0.10)","--wpic-segment-hover":n==="dark"?t.border:"rgb(113 113 122 / 0.16)","--wpic-segment-muted":n==="dark"?t.muted:"#71717A","--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[r,c]of Object.entries(l))r.startsWith("--wpic-legacy-")&&(l[r.replace("--wpic-legacy-","--")]=c);return l}const A2=Symbol("wpic-theme");function T1(){return e.inject(A2,e.computed(()=>null))}let S2=0,L2="";function H2(){S2++===0&&(L2=document.body.style.overflow,document.body.style.overflow="hidden");let n=!1;return()=>{n||(n=!0,--S2===0&&(document.body.style.overflow=L2))}}const N3=["data-wpic-theme"],S3=["aria-label"],L3={class:"wpic-bottom-sheet-header"},$3=["aria-label"],D3={key:0,class:"wpic-bottom-sheet-footer"},y1=[],s2=new Map,m2=e.defineComponent({__name:"WBottomSheet",props:{returnFocus:{},modelValue:{type:Boolean},title:{},closeLabel:{default:"Close"},noPadding:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:p}){const t=n,l=p,r=T1(),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 b=e.ref({height:0,top:0}),a=e.computed(()=>b.value.height?{height:`${b.value.height}px`,top:`${b.value.top}px`}:{}),k=Symbol.for("wpic-ui-popover-descendants"),g=e.inject(k,null),C=new Set;e.provide(k,{add(y){C.add(y),g?.add(y)},remove(y){C.delete(y),g?.remove(y)}}),e.provide("wpic-pagination-url-sync",!1),e.watch(c,(y,V)=>{V&&g?.remove(V),y&&g?.add(y)});let x=null,f=!1,m;const D=y=>!!y.getClientRects().length&&getComputedStyle(y).visibility!=="hidden";function O(){return[c.value,...C].filter(y=>!!y&&D(y)).flatMap(y=>[...y.querySelectorAll('a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex="0"]')]).filter(D)}function J(){l("update:modelValue",!1)}function Y(y){if(!(y1[y1.length-1]!==i||Z(y.target))){if(y.key==="Escape"){if([...C].some(D))return;y.preventDefault(),y.stopPropagation(),J()}else if(y.key==="Tab"){const V=O(),Q=V.indexOf(document.activeElement);if(!V.length){y.preventDefault(),c.value?.focus();return}y.shiftKey&&Q<=0?(y.preventDefault(),V[V.length-1]?.focus()):!y.shiftKey&&(Q<0||Q===V.length-1)&&(y.preventDefault(),V[0]?.focus())}}}function Z(y){const V=y.closest?.(".wpic-modal-overlay");return!!V&&Number(getComputedStyle(V).zIndex)>u.value}function U(y){if(y1[y1.length-1]!==i||Z(y.target))return;const V=y.target;c.value?.contains(V)||[...C].some(Q=>Q.contains(V))||c.value?.focus({preventScroll:!0})}function T(){const y=window.visualViewport;b.value={height:y?.height??window.innerHeight,top:y?.offsetTop??0}}function S(){if(!f)return;f=!1;const y=y1[y1.length-1]===i;y1.splice(y1.indexOf(i),1),s2.delete(i),m?.(),m=void 0,document.removeEventListener("keydown",Y),document.removeEventListener("focusin",U),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T),y&&x?.isConnected&&x.focus({preventScroll:!0})}return e.watch(()=>t.modelValue,async y=>{if(!y){S();return}f||(f=!0,x=t.returnFocus??document.activeElement,m=H2(),u.value=Math.max(w.value,9998,...s2.values())+2,y1.push(i),s2.set(i,u.value),T(),document.addEventListener("keydown",Y),document.addEventListener("focusin",U),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T),await e.nextTick(),t.modelValue&&c.value?.focus({preventScroll:!0}))},{immediate:!0}),e.onBeforeUnmount(()=>{c.value&&g?.remove(c.value),S()}),(y,V)=>(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(r),dark:e.unref(r)?.mode==="dark"}]),style:e.normalizeStyle([e.unref(r)?.variables,a.value,{zIndex:u.value}]),"data-wpic-theme":e.unref(r)?.mode,onClick:e.withModifiers(J,["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"},[V[0]||(V[0]=e.createElementVNode("div",{class:"wpic-bottom-sheet-handle","aria-hidden":"true"},null,-1)),e.createElementVNode("header",L3,[e.renderSlot(y.$slots,"header",{},()=>[e.createElementVNode("h2",null,e.toDisplayString(n.title),1)]),e.createElementVNode("button",{type:"button","aria-label":n.closeLabel,onClick:J},[e.createVNode(e.unref(z.X),{size:20})],8,$3)]),e.createElementVNode("div",{class:e.normalizeClass(["wpic-bottom-sheet-body",{"wpic-bottom-sheet-padded":!n.noPadding}])},[e.renderSlot(y.$slots,"default")],2),y.$slots.footer?(e.openBlock(),e.createElementBlock("footer",D3,[e.renderSlot(y.$slots,"footer")])):e.createCommentVNode("",!0)],8,S3)],14,N3)):e.createCommentVNode("",!0)]))}});function h2(){const n=typeof window<"u"?window.matchMedia("(max-width: 767px)"):null,p=e.ref(n?.matches??!1),t=()=>{p.value=n?.matches??!1};return n?.addEventListener("change",t),e.onBeforeUnmount(()=>n?.removeEventListener("change",t)),p}const F3=["data-wpic-theme","data-unstyled"],v1=e.defineComponent({__name:"WPopover",props:{unstyled:{type:Boolean},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:p}){const t=n,l=e.inject("wpic-overlay-layer",e.ref(0)),r=e.computed(()=>Math.max(Number(t.zIndex)||9999,l.value+1));e.provide("wpic-overlay-layer",r);const c=T1(),i=h2(),w=e.computed(()=>i.value&&t.mobileSheet),u=p,b=Symbol.for("wpic-ui-popover-descendants"),a=e.inject(b,null),k=new Set;e.provide(b,{add(E){k.add(E),a?.add(E)},remove(E){k.delete(E),a?.remove(E)}});const g=e.computed(()=>{const E=t.anchor;return E?e.isRef(E)?E.value:E:null}),C=e.ref(null),x=e.ref(null),f=e.computed(()=>x.value??t.placement??"bottom-start"),m=e.computed(()=>{const E=[l1.offset(t.offset??6)];return x.value||(t.autoPlacement?E.push(l1.autoPlacement({alignment:"start"})):t.flip&&E.push(l1.flip({crossAxis:!t.shiftCrossAxis}))),E.push(l1.shift({padding:t.autoPlacement?8:4,crossAxis:t.autoPlacement||t.shiftCrossAxis})),E.push(l1.size({padding:8,apply({availableHeight:R,availableWidth:H,rects:o1,elements:r1}){const X=Math.max(R-8,50),W=t.maxHeight?`min(${t.maxHeight}, ${X}px)`:`${X}px`,F={maxWidth:`${Math.max(H,0)}px`,maxHeight:W,overflowY:t.panelScroll?"auto":"hidden"};if(t.height&&(F.height=`min(${t.height}, ${X}px)`),t.minHeight&&(F.minHeight=`min(${t.minHeight}, ${X}px)`),t.matchAnchorWidth){const B=`${Math.min(o1.reference.width,Math.max(H,0))}px`;F.width=t.fitAnchorContent?"max-content":B,F.minWidth=B}Object.assign(r1.floating.style,F)}})),E}),{floatingStyles:D,placement:O,update:J,isPositioned:Y}=l1.useFloating(g,C,{placement:f,strategy:"fixed",open:e.computed(()=>t.open),whileElementsMounted:l1.autoUpdate,middleware:m}),Z=e.computed(()=>{const E=O.value;return E.startsWith("top")?"bottom":E.startsWith("bottom")?"top":E.startsWith("left")?"right":E.startsWith("right")?"left":"top"}),U=E=>{if(w.value)return;const R=E.target,H=g.value,o1=C.value;o1&&o1.contains(R)||[...k].some(r1=>r1.contains(R))||H&&H.contains(R)||t.extraPanels?.some(r1=>r1?.contains(R))||u("close")},T=E=>{if(w.value||E.key!=="Escape"||!t.open||[...k].some(H=>H.isConnected&&H.style.display!=="none"))return;E.preventDefault(),E.stopImmediatePropagation(),u("close");const R=g.value;R?.matches("button, input, [tabindex]")?R.focus():R?.querySelector("button, input, [tabindex]")?.focus()};let S=!1,y=!1;function V(){y||(document.addEventListener("pointerdown",U,!0),document.addEventListener("keydown",T,!0),y=!0)}function Q(){y&&(document.removeEventListener("pointerdown",U,!0),document.removeEventListener("keydown",T,!0),y=!1)}e.watch(()=>t.open,E=>{E?e.nextTick(()=>{S||!t.open||(t.autoPlacement&&C.value&&(C.value.style.maxHeight=""),J(),V())}):(x.value=null,Q())},{immediate:!0}),e.watch(C,(E,R)=>{R&&a?.remove(R),E&&a?.add(E)}),e.watch(Y,E=>{E&&t.open&&t.freezePositionOnOpen&&!x.value&&(x.value=O.value)}),e.onBeforeUnmount(()=>{S=!0,Q(),C.value&&a?.remove(C.value)});const s1=e.computed(()=>({...t.matchAnchorWidth?{}:{width:t.width??"auto"},...t.minWidth?{minWidth:t.minWidth}:{},transformOrigin:Z.value,zIndex:r.value}));return(E,R)=>w.value?(e.openBlock(),e.createBlock(m2,{key:0,"return-focus":g.value,"model-value":n.open,title:n.sheetTitle,"close-label":n.closeLabel,"no-padding":"","onUpdate:modelValue":R[0]||(R[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:C,"data-wpic-theme":e.unref(c)?.mode,"data-unstyled":n.unstyled||void 0,class:e.normalizeClass([[{"wpic-theme":e.unref(c),dark:e.unref(c)?.mode==="dark"},!n.unstyled&&"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"],"wpic-popover-panel wpic:flex wpic:flex-col"]),style:e.normalizeStyle([e.unref(c)?.variables,e.unref(D),s1.value])},[e.renderSlot(E.$slots,"default")],14,F3),[[e.vShow,n.open]])]))}}),T3={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"},A3=["data-variant","data-maximized","data-docked"],H3=["title"],P3={class:"wpic:min-w-0 wpic:flex-1 wpic:px-2 wpic:text-center"},j3={class:"wpic:truncate wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},W3={key:0,class:"wpic:truncate wpic:text-zinc-500 wpic:dark:text-zinc-400"},R3={class:"wpic:flex wpic:shrink-0 wpic:items-center wpic:gap-1"},I3=["title"],Z3=["title"],U3=["title"],K3=["title"],O3={class:"wpic:flex wpic:h-11 wpic:shrink-0 wpic:items-center wpic:justify-between wpic:px-3"},q3={class:"wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},Y3=["title"],Q3={class:"wpic:space-y-2 wpic:px-3 wpic:pb-3"},J3={class:"wpic:truncate"},X3={class:"wpic:flex-1 wpic:overflow-y-auto wpic:overflow-x-visible wpic:px-2 wpic:pb-3"},G3={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"},_3={class:"wpic:truncate"},e5=["title"],n5={class:"wpic:space-y-0.5"},t5={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"},c5=["onMouseenter"],i5=["onClick"],l5={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},a5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},o5={key:0,class:"wpic:px-3 wpic:py-2 wpic:text-zinc-400 wpic:dark:text-zinc-500"},r5=["onPointerdown","onClick"],s5={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},p5={class:"wpic:shrink-0 wpic:text-zinc-400"},d5={class:"wpic:mt-4"},w5={class:"wpic:flex wpic:h-7 wpic:items-center wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},u5={class:"wpic:truncate"},m5={class:"wpic:space-y-0.5"},h5={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"},f5=["onPointerdown","onClick"],v5={class:"wpic:block wpic:truncate"},b5={class:"wpic:shrink-0 wpic:text-zinc-400"},g5=["onClick"],k5=["onPointerenter","onMouseenter"],C5={class:"wpic:truncate"},z5={class:"wpic:flex wpic:min-h-0 wpic:flex-1"},y5={class:"wpic:flex wpic:min-h-0 wpic:min-w-0 wpic:flex-1 wpic:flex-col"},x5={class:"wpic:relative wpic:flex wpic:min-h-0 wpic:flex-1"},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"},M5={class:"wpic:font-medium"},V5={key:1,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center"},E5={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"},N5={class:"wpic:font-semibold wpic:text-zinc-800 wpic:dark:text-zinc-100"},S5={key:0,class:"wpic:mt-1 wpic:max-w-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},L5={key:2,class:"wpic:space-y-4"},$5=["data-chat-message-index"],D5=["datetime"],F5=["src","alt"],T5={class:"wpic:max-w-40 wpic:truncate"},A5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},H5={key:0,class:"wpic:flex wpic:items-center wpic:gap-2 wpic:text-zinc-500 wpic:dark:text-zinc-400"},P5={key:1,class:"wpic-chat-loading-card",role:"status","aria-label":"Generating image"},j5=["innerHTML","onClick"],W5=["href","onClick"],R5=["src"],I5=["title","aria-label","aria-pressed","onClick"],Z5=["title","aria-label","aria-pressed","onClick"],U5=["title","onClick"],K5=["onClick"],O5=["title","onClick"],q5=["aria-label"],Y5=["aria-label","title","aria-current","onClick"],Q5={class:"wpic-chat-panel__footer wpic:shrink-0 wpic:bg-white wpic:p-3 wpic:dark:bg-zinc-800"},J5={key:0,class:"wpic:mb-2 wpic:flex wpic:flex-wrap wpic:justify-end wpic:gap-1.5"},X5=["src","alt"],G5={class:"wpic:max-w-40 wpic:truncate"},_5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},e4={key:1,class:"wpic:shrink-0 wpic:text-zinc-400"},n4=["title","onClick"],t4={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"},c4={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"},i4=["onMousedown"],l4={class:"wpic:min-w-0 wpic:truncate wpic:font-medium wpic:text-zinc-900 wpic:dark:text-zinc-100"},a4={key:0,class:"wpic:max-w-32 wpic:shrink-0 wpic:truncate wpic:text-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},o4=["accept"],r4=["value","placeholder","disabled"],s4={class:"wpic:flex wpic:items-center wpic:gap-1"},p4=["title"],d4=["disabled","title"],$2=80,w4=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},showQuestionRail:{type:Boolean,default:!1},questionRailLabel:{default:"Questions"},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:p}){const t=n,l=p,r=e.useSlots(),c=e.ref(null),i=e.ref(null),w=e.ref(null),u=e.ref(null),b=e.ref(null),a=e.ref(0),k=e.ref(0),g=e.ref(!1),C=e.ref(null),x=e.ref(null);let f=null;const m=e.ref(!1),D=e.ref(!1),O=e.ref(!1);e.ref(new Set);const J=e.ref(null),Y=e.ref(null),Z=e.ref({}),U=e.ref(null);let T=null;const S=e.computed(()=>U.value?[]:t.messages.filter(o=>o.role!=="system")),y=e.computed(()=>t.loading||U.value!==null),V=e.computed(()=>t.modelValue.trim().length>0&&!t.loading),Q=e.computed(()=>t.attachments.length>0),s1=e.computed(()=>{const o=t.modelValue.slice(0,k.value),s=o.match(/(?:^|\s)@([^\s@]*)$/);return s?{start:o.length-s[0].length+(s[0].startsWith(" ")?1:0),query:s[1].toLowerCase()}:null}),E=e.computed(()=>{const o=s1.value;if(!o)return[];const s=o.query;return t.mentionItems.filter(d=>d.label.toLowerCase().includes(s)).slice(0,6)}),R=e.computed(()=>t.showNavigator&&g.value),H=e.computed(()=>t.selectedProjectId??null),o1=e.computed(()=>t.sessions.filter(o=>!o.projectId)),r1=e.computed(()=>{const o=new Map;for(const s of t.projects)o.set(s.id,[]);for(const s of t.sessions){if(!s.projectId)continue;const d=o.get(s.projectId);d&&d.push(s)}return o});function X(o){const s=o.toLowerCase();if(s.includes("doubao-seedance-1-5-pro-251215")||s.includes("doubao seedance 1.5")||s.includes("seedance 1.5")||s.includes("seedance video"))return"jimeng:doubao-seedance-1-5-pro-251215";if(s.includes("imagen 4")||s.includes("imagen-4"))return"google:imagen-4.0-generate-001";if(s.includes("gpt-image-1")||s.includes("gpt image 1"))return"openai:gpt-image-1";if(s.includes("gpt-image-2")||s.includes("gpt image 2"))return"openai:gpt-image-2";if(s.includes("doubao-seedream-4-5-251128"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao-seedream-4-0-250828"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("doubao seedream 5")||s.includes("seedream 5")||s.includes("doubao seedream 4.5")||s.includes("seedream 4.5"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao seedream 4")||s.includes("seedream 4"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("auto"))return"auto";const d=o.match(/\b([a-z][a-z0-9_-]+):([a-z0-9._-]+)\b/i);if(d)return`${d[1].toLowerCase()}:${d[2]}`}function W(o){if(o!=="auto"){if(o.includes("seedance"))return"video";if(o.includes("gpt-image")||o.includes("imagen")||o.includes("seedream")||o.includes("jimeng:"))return"image"}}function F(o){const s=[],d=new Set,M=/\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 v of o.matchAll(M)){const N=v[1],K=X(N);!K||d.has(K)||(d.add(K),s.push({label:N,value:K}))}return s}function B(o,s){return o.match(new RegExp(`${s}=["']([^"']+)["']`,"i"))?.[1]}function I(o){const s={};for(const M of o.matchAll(/\[SETTING\s+([^\]]+)\]([\s\S]*?)\[\/SETTING\]/gi)){const v=M[1]??"",N=B(v,"key"),K=B(v,"value")??M[2]?.trim();if(!(!N||!K))if(N==="duration"||N==="fps"||N==="count"){const n1=Number(K);Number.isFinite(n1)&&(s[N]=n1)}else if(N==="model"){const n1=X(K)??X(M[2]?.trim()??"");n1&&(s.model=n1)}else(N==="aspect"||N==="resolution"||N==="format")&&(s[N]=K)}const d=o.split(/\r?\n/).map(M=>M.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const M of d){const v=M.toLowerCase();if(/(supporte|supports?|disponible|available|dur[eé]es?\s*:|ratios?\s*:|jusqu['’]?à|up to)/i.test(v))continue;const N=M.split(":").slice(1).join(":").trim()||M,K=N.match(/\b(\d{1,2}:\d{1,2})\b/);(v.includes("format")||v.includes("aspect")||v.includes("ratio"))&&K&&(s.aspect=K[1]);const n1=N.match(/\b([1248]K)\b/i);(v.includes("résolution")||v.includes("resolution"))&&n1&&(s.resolution=n1[1].toUpperCase());const e1=N.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);(v.includes("durée")||v.includes("duration"))&&e1&&(s.duration=Number(e1[1]));const i1=N.match(/\b(\d{1,3})\s*fps\b/i);v.includes("fps")&&i1&&(s.fps=Number(i1[1]));const a1=N.match(/\b(\d{1,2})\b/);if((v.includes("count")||v.includes("nombre")||v.includes("variantes"))&&a1&&(s.count=Number(a1[1])),v.includes("modèle")||v.includes("modele")||v.includes("model")){const b1=X(N);b1&&(s.model=b1)}v.includes("jpg")||v.includes("jpeg")?s.format="jpg":v.includes("png")?s.format="png":v.includes("webp")&&(s.format="webp")}return Object.keys(s).length?s:void 0}function c1(o){const s=o.match(/\[TASK(?:\s+([^\]]+))?\](?:([\s\S]*?)\[\/TASK\])?/i);if(s){const M=(B(s[1]??"","value")??s[2]?.trim())?.toLowerCase();if(["image","video","audio","text"].includes(String(M)))return M}const d=o.split(/\r?\n/).map(M=>M.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const M of d){const v=M.toLowerCase(),N=M.split(":").slice(1).join(":").trim().toLowerCase()||v;if(/(task|type|mode|surface|format|réglage|reglage|setting)/i.test(v)){if(/\baudio\b|subtitles?|sous-titres?|transcri|tts|voice|voix/.test(N))return"audio";if(/\bvid[eé]o\b|\bvideo\b|\bfps\b|duration|dur[eé]e/.test(N))return"video";if(/\bimage\b|photo|visuel|illustration|aspect|ratio|resolution|résolution/.test(N))return"image";if(/\btext\b|texte|copy|caption|script/.test(N))return"text"}}}function P(o){const s=o.match(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i)?.[1];if(s){const e1=p1(s).trim().replace(/^["“]|["”]$/g,"");if(e1)return e1}const d=o.replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`),M=[];let v=!1,N=!1,K=!1;for(const e1 of d){const i1=e1.trim().replace(/^[\s>*-]+/,"").replace(/^#{1,6}\s+/,"").replace(/^\*\*|\*\*$/g,"").trim();if(N){if(/^```/.test(i1))break;M.push(e1);continue}if(!v){const a1=i1.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(!a1){K||=/\bprompt\b/i.test(i1),K&&/^```/.test(i1)&&(v=!0,N=!0);continue}v=!0,a1[1]?.trim()&&M.push(a1[1].trim());continue}if(/^(?:r[eé]glages?(?:\s+recommand[eé]s?)?|settings?|mod[eè]le|model)\s*:/i.test(i1))break;M.push(e1)}return p1(M.join(`
|
|
5
5
|
`)).trim().replace(/^["“]|["”]$/g,"")||void 0}function t1(o){return/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i.test(o)}function h(o){return/\[TASK(?:\s+[^\]]+)?\]/i.test(o)}function L(o){const s=o.match(/\[TASK(?:\s+([^\]]+))?\]([\s\S]*?)\[\/TASK\]/i),d=`${s?.[1]??""} ${s?.[2]??""}`.toLowerCase();return t1(o)&&(/\bimage\b/.test(d)||!h(o))}function A(o){return/\[(?:TASK|PROMPT|SETTING)\b/i.test(o)}function _(o){const s=M=>Array.isArray(M)?M.flatMap(v=>{if(!v||typeof v!="object")return[];const N=v,K=typeof N.url=="string"?N.url:null;return K?[{type:typeof N.type=="string"?N.type:"image",url:K,posterUrl:typeof N.posterUrl=="string"?N.posterUrl:null,width:typeof N.width=="number"?N.width:null,height:typeof N.height=="number"?N.height:null,generationId:typeof N.generationId=="string"?N.generationId:null,href:typeof N.href=="string"?N.href:null}]:[]}):[],d=o.metadata?.generatedMedia;return s(d).filter(M=>M.type==="image"||!M.type)}function G(o){const s=o.metadata?.attachments;return Array.isArray(s)?s.flatMap((d,M)=>{if(!d||typeof d!="object")return[];const v=d,N=v.metadata&&typeof v.metadata=="object"?v.metadata:{},K=typeof v.name=="string"&&v.name.trim()?v.name.trim():`Attachment ${M+1}`;return[{id:typeof v.id=="string"?v.id:`${o.id??"message"}-attachment-${M}`,name:K,mimeType:typeof v.mimeType=="string"?v.mimeType:null,bytes:typeof v.bytes=="number"?v.bytes:null,status:"ready",displayUrl:typeof v.displayUrl=="string"?v.displayUrl:typeof N.displayUrl=="string"?N.displayUrl:null,publicUrl:typeof v.publicUrl=="string"?v.publicUrl:typeof N.publicUrl=="string"?N.publicUrl:null,assetId:typeof v.assetId=="string"?v.assetId:null,mediaItemId:typeof v.mediaItemId=="string"?v.mediaItemId:null,metadata:N}]}):[]}function $(o){const s=o.metadata&&typeof o.metadata=="object"?o.metadata:{},d=o.mimeType??"",M=typeof s.kind=="string"?s.kind:"",v=o.displayUrl??(typeof s.displayUrl=="string"?s.displayUrl:null);return!v||!d.startsWith("image/")&&M!=="image"?null:v}function j(o){if(o.role!=="assistant"||!o.streaming)return!1;const s=o.content.trim();return s==="Generating image..."||A(s)}function q(o){return o.replace(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/gi,"$1").replace(/\[SETTING\s+[^\]]*\]([\s\S]*?)\[\/SETTING\]/gi,"$1").replace(/\[TASK(?:\s+[^\]]*)?\]([\s\S]*?)\[\/TASK\]/gi,"").replace(/^\s*\[TASK(?:\s+[^\]]*)?\]\s*$/gim,"")}function p1(o){return o.replace(/\[PROMPT\]|\[\/PROMPT\]/gi,"").replace(/\[SETTING\s+[^\]]*\]|\[\/SETTING\]/gi,"").replace(/\[TASK\s+[^\]]*\]|\[\/TASK\]/gi,"").split(`
|
package/dist/wpic-ui.css
CHANGED
|
@@ -430,10 +430,11 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
|
|
|
430
430
|
/* UI5 segmented options and teleported surfaces. */
|
|
431
431
|
/* Outrank the component's legacy dark/subtle rules, regardless of CSS order. */
|
|
432
432
|
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) { background: var(--wpic-segment-track); border: 0; padding: 3px; border-radius: var(--radius-lg, 0.5rem); gap: 2px; box-shadow: inset 0 0 0 1px var(--wpic-segment-outline); }
|
|
433
|
-
.wpic-theme .wpic-segmented-control
|
|
433
|
+
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button { border: 0; color: var(--wpic-segment-muted); background: transparent; }
|
|
434
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button { border-radius: max(0px, calc(var(--radius-lg, 0.5rem) - 3px)); }
|
|
434
435
|
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-hover); }
|
|
435
|
-
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button--active,
|
|
436
|
-
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button--active:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-active); box-shadow: var(--wpic-segment-shadow); }
|
|
436
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button--active,
|
|
437
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button--active:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-active); box-shadow: var(--wpic-segment-shadow); }
|
|
437
438
|
/* Match WButton outer heights and text sizes, including the track padding. */
|
|
438
439
|
.wpic-theme .wpic-segmented-control--xs { height: 24px; }
|
|
439
440
|
.wpic-theme .wpic-segmented-control--sm { height: 32px; }
|
package/dist/wpic-ui.js
CHANGED
|
@@ -1135,8 +1135,8 @@ function _5(n, w = {}) {
|
|
|
1135
1135
|
"--wpic-control-height": "36px",
|
|
1136
1136
|
// Use an opaque light-mode border so row hover cannot change its painted color.
|
|
1137
1137
|
"--wpic-table-border": n === "light" ? `color-mix(in srgb, ${c.text} 11.5%, ${c.surface})` : c.border,
|
|
1138
|
-
"--wpic-segment-track": n === "dark" ? c.raised : "rgb(113 113 122 / 0.
|
|
1139
|
-
"--wpic-segment-outline": n === "dark" ? "rgb(161 161 170 / 0.18)" : "rgb(113 113 122 / 0.
|
|
1138
|
+
"--wpic-segment-track": n === "dark" ? c.raised : "rgb(113 113 122 / 0.06)",
|
|
1139
|
+
"--wpic-segment-outline": n === "dark" ? "rgb(161 161 170 / 0.18)" : "rgb(113 113 122 / 0.10)",
|
|
1140
1140
|
"--wpic-segment-hover": n === "dark" ? c.border : "rgb(113 113 122 / 0.16)",
|
|
1141
1141
|
"--wpic-segment-muted": n === "dark" ? c.muted : "#71717A",
|
|
1142
1142
|
"--wpic-segment-active": n === "dark" ? c.secondaryHover : c.surface,
|
package/package.json
CHANGED
package/src/style.css
CHANGED
|
@@ -429,10 +429,11 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
|
|
|
429
429
|
/* UI5 segmented options and teleported surfaces. */
|
|
430
430
|
/* Outrank the component's legacy dark/subtle rules, regardless of CSS order. */
|
|
431
431
|
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) { background: var(--wpic-segment-track); border: 0; padding: 3px; border-radius: var(--radius-lg, 0.5rem); gap: 2px; box-shadow: inset 0 0 0 1px var(--wpic-segment-outline); }
|
|
432
|
-
.wpic-theme .wpic-segmented-control
|
|
432
|
+
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button { border: 0; color: var(--wpic-segment-muted); background: transparent; }
|
|
433
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button { border-radius: max(0px, calc(var(--radius-lg, 0.5rem) - 3px)); }
|
|
433
434
|
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-hover); }
|
|
434
|
-
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button--active,
|
|
435
|
-
.wpic-theme .wpic-segmented-control .wpic-segmented-control__button--active:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-active); box-shadow: var(--wpic-segment-shadow); }
|
|
435
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button--active,
|
|
436
|
+
.wpic-theme .wpic-segmented-control:is(.wpic-segmented-control--default, .wpic-segmented-control--subtle) .wpic-segmented-control__button--active:hover:not(:disabled) { color: var(--wpic-text); background: var(--wpic-segment-active); box-shadow: var(--wpic-segment-shadow); }
|
|
436
437
|
/* Match WButton outer heights and text sizes, including the track padding. */
|
|
437
438
|
.wpic-theme .wpic-segmented-control--xs { height: 24px; }
|
|
438
439
|
.wpic-theme .wpic-segmented-control--sm { height: 32px; }
|