@opengis/table 0.0.45 → 0.0.46
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/index.mjs +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5970,7 +5970,7 @@ const ml = { class: "py-10 flex flex-col justify-center items-center text-center
|
|
|
5970
5970
|
const S = new URLSearchParams({
|
|
5971
5971
|
table: s.table,
|
|
5972
5972
|
format: l.value,
|
|
5973
|
-
|
|
5973
|
+
cols: E.join(",")
|
|
5974
5974
|
});
|
|
5975
5975
|
o.value && S.set("filter", o.value);
|
|
5976
5976
|
try {
|
package/dist/index.umd.js
CHANGED
|
@@ -6,7 +6,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
|
|
|
6
6
|
`,-1),c())),e.components.length&&(xn(e.components,"component",n),(e.directives.length||e.temps>0)&&c()),e.directives.length&&(xn(e.directives,"directive",n),e.temps>0&&c()),e.filters&&e.filters.length&&(c(),xn(e.filters,"filter",n),c()),e.temps>0){o("let ");for(let B=0;B<e.temps;B++)o(`${B>0?", ":""}_temp${B}`)}return(e.components.length||e.directives.length||e.temps)&&(o(`
|
|
7
7
|
`,0),c()),u||o("return "),e.codegenNode?ie(e.codegenNode,n):o("null"),m&&(a(),o("}")),a(),o("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function ai(e,t){const{ssr:n,prefixIdentifiers:s,push:o,newline:l,runtimeModuleName:i,runtimeGlobalName:a,ssrRuntimeModuleName:c}=t,p=a,u=Array.from(e.helpers);if(u.length>0&&(o(`const _Vue = ${p}
|
|
8
8
|
`,-1),e.hoists.length)){const d=[Jt,Xt,Ve,Yt,Qn].filter(h=>u.includes(h)).map(_r).join(", ");o(`const { ${d} } = _Vue
|
|
9
|
-
`,-1)}ci(e.hoists,t),l(),o("return ")}function xn(e,t,{helper:n,push:s,newline:o,isTS:l}){const i=n(t==="filter"?en:t==="component"?Zt:Vt);for(let a=0;a<e.length;a++){let c=e[a];const p=c.endsWith("__self");p&&(c=c.slice(0,-6)),s(`const ${st(c,t)} = ${i}(${JSON.stringify(c)}${p?", true":""})${l?"!":""}`),a<e.length-1&&o()}}function ci(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:s}=t;s();for(let o=0;o<e.length;o++){const l=e[o];l&&(n(`const _hoisted_${o+1} = `),ie(l,t),s())}t.pure=!1}function di(e){return ne(e)||e.type===4||e.type===2||e.type===5||e.type===8}function wn(e,t){const n=e.length>3||process.env.NODE_ENV!=="production"&&e.some(s=>Se(s)||!di(s));t.push("["),n&&t.indent(),it(e,t,n),n&&t.deindent(),t.push("]")}function it(e,t,n=!1,s=!0){const{push:o,newline:l}=t;for(let i=0;i<e.length;i++){const a=e[i];ne(a)?o(a,-3):Se(a)?wn(a,t):ie(a,t),i<e.length-1&&(n?(s&&o(","),l()):s&&o(", "))}}function ie(e,t){if(ne(e)){t.push(e,-3);return}if(Wt(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&dr(e.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),ie(e.codegenNode,t);break;case 2:fi(e,t);break;case 4:Tr(e,t);break;case 5:pi(e,t);break;case 12:ie(e.codegenNode,t);break;case 8:Br(e,t);break;case 3:hi(e,t);break;case 13:mi(e,t);break;case 14:vi(e,t);break;case 15:yi(e,t);break;case 17:bi(e,t);break;case 18:Ei(e,t);break;case 19:ki(e,t);break;case 20:xi(e,t);break;case 21:it(e.body,t,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return dr(!1,`unhandled codegen node type: ${e.type}`),e}}function fi(e,t){t.push(JSON.stringify(e.content),-3,e)}function Tr(e,t){const{content:n,isStatic:s}=e;t.push(s?JSON.stringify(n):n,-3,e)}function pi(e,t){const{push:n,helper:s,pure:o}=t;o&&n(Bt),n(`${s(gt)}(`),ie(e.content,t),n(")")}function Br(e,t){for(let n=0;n<e.children.length;n++){const s=e.children[n];ne(s)?t.push(s,-3):ie(s,t)}}function ui(e,t){const{push:n}=t;if(e.type===8)n("["),Br(e,t),n("]");else if(e.isStatic){const s=mn(e.content)?e.content:JSON.stringify(e.content);n(s,-2,e)}else n(`[${e.content}]`,-3,e)}function hi(e,t){const{push:n,helper:s,pure:o}=t;o&&n(Bt),n(`${s(Ve)}(${JSON.stringify(e.content)})`,-3,e)}function mi(e,t){const{push:n,helper:s,pure:o}=t,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:p,directives:u,isBlock:d,disableTracking:h,isComponent:m}=e;let y;if(c)if(process.env.NODE_ENV!=="production")if(c<0)y=c+` /* ${Ye[c]} */`;else{const _=Object.keys(Ye).map(Number).filter(S=>S>0&&c&S).map(S=>Ye[S]).join(", ");y=c+` /* ${_} */`}else y=String(c);u&&n(s(tn)+"("),d&&n(`(${s(Me)}(${h?"true":""}), `),o&&n(Bt);const E=d?qe(t.inSSR,m):We(t.inSSR,m);n(s(E)+"(",-2,e),it(gi([l,i,a,y,p]),t),n(")"),d&&n(")"),u&&(n(", "),ie(u,t),n(")"))}function gi(e){let t=e.length;for(;t--&&e[t]==null;);return e.slice(0,t+1).map(n=>n||"null")}function vi(e,t){const{push:n,helper:s,pure:o}=t,l=ne(e.callee)?e.callee:s(e.callee);o&&n(Bt),n(l+"(",-2,e),it(e.arguments,t),n(")")}function yi(e,t){const{push:n,indent:s,deindent:o,newline:l}=t,{properties:i}=e;if(!i.length){n("{}",-2,e);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);n(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:p,value:u}=i[c];ui(p,t),n(": "),ie(u,t),c<i.length-1&&(n(","),l())}a&&o(),n(a?"}":" }")}function bi(e,t){wn(e.elements,t)}function Ei(e,t){const{push:n,indent:s,deindent:o}=t,{params:l,returns:i,body:a,newline:c,isSlot:p}=e;p&&n(`_${Ue[cn]}(`),n("(",-2,e),Se(l)?it(l,t):l&&ie(l,t),n(") => "),(c||a)&&(n("{"),s()),i?(c&&n("return "),Se(i)?wn(i,t):ie(i,t)):a&&ie(a,t),(c||a)&&(o(),n("}")),p&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}function ki(e,t){const{test:n,consequent:s,alternate:o,newline:l}=e,{push:i,indent:a,deindent:c,newline:p}=t;if(n.type===4){const d=!mn(n.content);d&&i("("),Tr(n,t),d&&i(")")}else i("("),ie(n,t),i(")");l&&a(),t.indentLevel++,l||i(" "),i("? "),ie(s,t),t.indentLevel--,l&&p(),l||i(" "),i(": ");const u=o.type===19;u||t.indentLevel++,ie(o,t),u||t.indentLevel--,l&&c(!0)}function xi(e,t){const{push:n,helper:s,indent:o,deindent:l,newline:i}=t,{needPauseTracking:a,needArraySpread:c}=e;c&&n("[...("),n(`_cache[${e.index}] || (`),a&&(o(),n(`${s(yt)}(-1`),e.inVOnce&&n(", true"),n("),"),i(),n("(")),n(`_cache[${e.index}] = `),ie(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),i(),n(`${s(yt)}(1),`),i(),n(`_cache[${e.index}]`),l()),n(")"),c&&n(")]")}const wi=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Ni=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Fe(e,t,n=!1,s=!1){const o=e.content;if(o.trim())try{new Function(s?` ${o} `:`return ${n?`(${o}) => {}`:`(${o})`}`)}catch(l){let i=l.message;const a=o.replace(Ni,"").match(wi);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),t.onError(W(46,e.loc,void 0,i))}}const Si=(e,t)=>{if(e.type===5)e.content=Nn(e.content,t);else if(e.type===1){const n=de(e,"memo");for(let s=0;s<e.props.length;s++){const o=e.props[s];if(o.type===7&&o.name!=="for"){const l=o.exp,i=o.arg;l&&l.type===4&&!(o.name==="on"&&i)&&!(n&&i&&i.type===4&&i.content==="key")&&(o.exp=Nn(l,t,o.name==="slot")),i&&i.type===4&&!i.isStatic&&(o.arg=Nn(i,t))}}}};function Nn(e,t,n=!1,s=!1,o=Object.create(t.identifiers)){return process.env.NODE_ENV!=="production"&&Fe(e,t,n,s),e}const Ci=Cr(/^(?:if|else|else-if)$/,(e,t,n)=>_i(e,t,n,(s,o,l)=>{const i=n.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const p=i[a];p&&p.type===9&&(c+=p.branches.length)}return()=>{if(l)s.codegenNode=Or(o,c,n);else{const p=Bi(s.codegenNode);p.alternate=Or(o,c+s.branches.length-1,n)}}}));function _i(e,t,n,s){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const o=t.exp?t.exp.loc:e.loc;n.onError(W(28,t.loc)),t.exp=I("true",!1,o)}if(process.env.NODE_ENV!=="production"&&t.exp&&Fe(t.exp,n),t.name==="if"){const o=Dr(e,t),l={type:9,loc:Yo(e.loc),branches:[o]};if(n.replaceNode(l),s)return s(l,o,!0)}else{const o=n.parent.children,l=[];let i=o.indexOf(e);for(;i-->=-1;){const a=o[i];if(a&&yn(a)){n.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&l.unshift(a);continue}if(a&&a.type===9){(t.name==="else-if"||t.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&n.onError(W(30,e.loc)),n.removeNode();const c=Dr(e,t);if(process.env.NODE_ENV!=="production"&&l.length&&!(n.parent&&n.parent.type===1&&(n.parent.tag==="transition"||n.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&a.branches.forEach(({userKey:d})=>{Ti(d,u)&&n.onError(W(29,c.userKey.loc))})}a.branches.push(c);const p=s&&s(a,c,!1);Tt(c,n),p&&p(),n.currentNode=null}else n.onError(W(30,e.loc));break}}}function Dr(e,t){const n=e.tagType===3;return{type:10,loc:e.loc,condition:t.name==="else"?void 0:t.exp,children:n&&!de(e,"for")?e.children:[e],userKey:rt(e,"key"),isTemplateIf:n}}function Or(e,t,n){return e.condition?fn(e.condition,Ir(e,t,n),te(n.helper(Ve),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Ir(e,t,n)}function Ir(e,t,n){const{helper:s}=n,o=Z("key",I(`${t}`,!1,he,2)),{children:l}=e,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return wt(c,o,n),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!e.isTemplateIf&&l.filter(p=>p.type!==3).length===1&&(c|=2048),nt(n,s(Ze),ve([o]),l,c,void 0,void 0,!0,!1,!1,e.loc)}else{const c=i.codegenNode,p=zo(c);return p.type===13&&pn(p,n),wt(p,o,n),c}}function Ti(e,t){if(!e||e.type!==t.type)return!1;if(e.type===6){if(e.value.content!==t.value.content)return!1}else{const n=e.exp,s=t.exp;if(n.type!==s.type||n.type!==4||n.isStatic!==s.isStatic||n.content!==s.content)return!1}return!0}function Bi(e){for(;;)if(e.type===19)if(e.alternate.type===19)e=e.alternate;else return e;else e.type===20&&(e=e.value)}const Di=Cr("for",(e,t,n)=>{const{helper:s,removeHelper:o}=n;return Oi(e,t,n,l=>{const i=te(s(nn),[l.source]),a=kt(e),c=de(e,"memo"),p=rt(e,"key",!1,!0);p&&p.type;let u=p&&(p.type===6?p.value?I(p.value.content,!0):void 0:p.exp);const d=p&&u?Z("key",u):null,h=l.source.type===4&&l.source.constType>0,m=h?64:p?128:256;return l.codegenNode=nt(n,s(Ze),void 0,i,m,void 0,void 0,!0,!h,!1,e.loc),()=>{let y;const{children:E}=l;process.env.NODE_ENV!=="production"&&a&&e.children.some(B=>{if(B.type===1){const D=rt(B,"key");if(D)return n.onError(W(33,D.loc)),!0}});const _=E.length!==1||E[0].type!==1,S=xt(e)?e:a&&e.children.length===1&&xt(e.children[0])?e.children[0]:null;if(S?(y=S.codegenNode,a&&d&&wt(y,d,n)):_?y=nt(n,s(Ze),d?ve([d]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(y=E[0].codegenNode,a&&d&&wt(y,d,n),y.isBlock!==!h&&(y.isBlock?(o(Me),o(qe(n.inSSR,y.isComponent))):o(We(n.inSSR,y.isComponent))),y.isBlock=!h,y.isBlock?(s(Me),s(qe(n.inSSR,y.isComponent))):s(We(n.inSSR,y.isComponent))),c){const B=He(Sn(l.parseResult,[I("_cached")]));B.body=To([be(["const _memo = (",c.exp,")"]),be(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(tr)}(_cached, _memo)) return _cached`]),be(["const _item = ",y]),I("_item.memo = _memo"),I("return _item")]),i.arguments.push(B,I("_cache"),I(String(n.cached.length))),n.cached.push(null)}else i.arguments.push(He(Sn(l.parseResult),y,!0))}})});function Oi(e,t,n,s){if(!t.exp){n.onError(W(31,t.loc));return}const o=t.forParseResult;if(!o){n.onError(W(32,t.loc));return}Ar(o,n);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=n,{source:c,value:p,key:u,index:d}=o,h={type:11,loc:t.loc,source:c,valueAlias:p,keyAlias:u,objectIndexAlias:d,parseResult:o,children:kt(e)?e.children:[e]};n.replaceNode(h),a.vFor++;const m=s&&s(h);return()=>{a.vFor--,m&&m()}}function Ar(e,t){e.finalized||(process.env.NODE_ENV!=="production"&&(Fe(e.source,t),e.key&&Fe(e.key,t,!0),e.index&&Fe(e.index,t,!0),e.value&&Fe(e.value,t,!0)),e.finalized=!0)}function Sn({value:e,key:t,index:n},s=[]){return Ii([e,t,n,...s])}function Ii(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((n,s)=>n||I("_".repeat(s+1),!1))}const $r=I("undefined",!1),Ai=(e,t)=>{if(e.type===1&&(e.tagType===1||e.tagType===3)){const n=de(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},$i=(e,t,n,s)=>He(e,n,!1,!0,n.length?n[0].loc:s);function Mi(e,t,n=$i){t.helper(cn);const{children:s,loc:o}=e,l=[],i=[];let a=t.scopes.vSlot>0||t.scopes.vFor>0;const c=de(e,"slot",!0);if(c){const{arg:_,exp:S}=c;_&&!ce(_)&&(a=!0),l.push(Z(_||I("default",!0),n(S,void 0,s,o)))}let p=!1,u=!1;const d=[],h=new Set;let m=0;for(let _=0;_<s.length;_++){const S=s[_];let B;if(!kt(S)||!(B=de(S,"slot",!0))){S.type!==3&&d.push(S);continue}if(c){t.onError(W(37,B.loc));break}p=!0;const{children:D,loc:H}=S,{arg:z=I("default",!0),exp:Q,loc:J}=B;let A;ce(z)?A=z?z.content:"default":a=!0;const N=de(S,"for"),R=n(Q,N,D,H);let L,O;if(L=de(S,"if"))a=!0,i.push(fn(L.exp,Dt(z,R,m++),$r));else if(O=de(S,/^else(?:-if)?$/,!0)){let j=_,q;for(;j--&&(q=s[j],!!yn(q)););if(q&&kt(q)&&de(q,/^(?:else-)?if$/)){let k=i[i.length-1];for(;k.alternate.type===19;)k=k.alternate;k.alternate=O.exp?fn(O.exp,Dt(z,R,m++),$r):Dt(z,R,m++)}else t.onError(W(30,O.loc))}else if(N){a=!0;const j=N.forParseResult;j?(Ar(j,t),i.push(te(t.helper(nn),[j.source,He(Sn(j),Dt(z,R),!0)]))):t.onError(W(32,N.loc))}else{if(A){if(h.has(A)){t.onError(W(38,J));continue}h.add(A),A==="default"&&(u=!0)}l.push(Z(z,R))}}if(!c){const _=(S,B)=>{const D=n(S,void 0,B,o);return t.compatConfig&&(D.isNonScopedSlot=!0),Z("default",D)};p?d.length&&!d.every(vn)&&(u?t.onError(W(39,d[0].loc)):l.push(_(void 0,d))):l.push(_(void 0,s))}const y=a?2:Ot(e.children)?3:1;let E=ve(l.concat(Z("_",I(y+(process.env.NODE_ENV!=="production"?` /* ${io[y]} */`:""),!1))),o);return i.length&&(E=te(t.helper(er),[E,Re(i)])),{slots:E,hasDynamicSlots:a}}function Dt(e,t,n){const s=[Z("name",e),Z("fn",t)];return n!=null&&s.push(Z("key",I(String(n),!0))),ve(s)}function Ot(e){for(let t=0;t<e.length;t++){const n=e[t];switch(n.type){case 1:if(n.tagType===2||Ot(n.children))return!0;break;case 9:if(Ot(n.branches))return!0;break;case 10:case 11:if(Ot(n.children))return!0;break}}return!1}const Mr=new WeakMap,Ri=(e,t)=>function(){if(e=t.currentNode,!(e.type===1&&(e.tagType===0||e.tagType===1)))return;const{tag:s,props:o}=e,l=e.tagType===1;let i=l?Li(e,t):`"${s}"`;const a=no(i)&&i.callee===Qt;let c,p,u=0,d,h,m,y=a||i===Qe||i===Gt||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(o.length>0){const E=Rr(e,t,void 0,l,a);c=E.props,u=E.patchFlag,h=E.dynamicPropNames;const _=E.directives;m=_&&_.length?Re(_.map(S=>Fi(S,t))):void 0,E.shouldUseBlock&&(y=!0)}if(e.children.length>0)if(i===mt&&(y=!0,u|=1024,process.env.NODE_ENV!=="production"&&e.children.length>1&&t.onError(W(47,{start:e.children[0].loc.start,end:e.children[e.children.length-1].loc.end,source:""}))),l&&i!==Qe&&i!==mt){const{slots:_,hasDynamicSlots:S}=Mi(e,t);p=_,S&&(u|=1024)}else if(e.children.length===1&&i!==Qe){const _=e.children[0],S=_.type,B=S===5||S===8;B&&ge(_,t)===0&&(u|=1),B||S===2?p=_:p=e.children}else p=e.children;h&&h.length&&(d=zi(h)),e.codegenNode=nt(t,i,c,p,u===0?void 0:u,d,m,!!y,!1,l,e.loc)};function Li(e,t,n=!1){let{tag:s}=e;const o=Cn(s),l=rt(e,"is",!1,!0);if(l)if(o||Ie("COMPILER_IS_ON_ELEMENT",t)){let a;if(l.type===6?a=l.value&&I(l.value.content,!0):(a=l.exp,a||(a=I("is",!1,l.arg.loc))),a)return te(t.helper(Qt),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=ir(s)||t.isBuiltInComponent(s);return i?(n||t.helper(i),i):(t.helper(Zt),t.components.add(s),st(s,"component"))}function Rr(e,t,n=e.props,s,o,l=!1){const{tag:i,loc:a,children:c}=e;let p=[];const u=[],d=[],h=c.length>0;let m=!1,y=0,E=!1,_=!1,S=!1,B=!1,D=!1,H=!1;const z=[],Q=R=>{p.length&&(u.push(ve(Lr(p),a)),p=[]),R&&u.push(R)},J=()=>{t.scopes.vFor>0&&p.push(Z(I("ref_for",!0),I("true")))},A=({key:R,value:L})=>{if(ce(R)){const O=R.content,j=Ht(O);if(j&&(!s||o)&&O.toLowerCase()!=="onclick"&&O!=="onUpdate:modelValue"&&!Jn(O)&&(B=!0),j&&Jn(O)&&(H=!0),j&&L.type===14&&(L=L.arguments[0]),L.type===20||(L.type===4||L.type===8)&&ge(L,t)>0)return;O==="ref"?E=!0:O==="class"?_=!0:O==="style"?S=!0:O!=="key"&&!z.includes(O)&&z.push(O),s&&(O==="class"||O==="style")&&!z.includes(O)&&z.push(O)}else D=!0};for(let R=0;R<n.length;R++){const L=n[R];if(L.type===6){const{loc:O,name:j,nameLoc:q,value:k}=L;let x=!0;if(j==="ref"&&(E=!0,J()),j==="is"&&(Cn(i)||k&&k.content.startsWith("vue:")||Ie("COMPILER_IS_ON_ELEMENT",t)))continue;p.push(Z(I(j,!0,q),I(k?k.content:"",x,k?k.loc:O)))}else{const{name:O,arg:j,exp:q,loc:k,modifiers:x}=L,C=O==="bind",w=O==="on";if(O==="slot"){s||t.onError(W(40,k));continue}if(O==="once"||O==="memo"||O==="is"||C&&Ae(j,"is")&&(Cn(i)||Ie("COMPILER_IS_ON_ELEMENT",t))||w&&l)continue;if((C&&Ae(j,"key")||w&&h&&Ae(j,"vue:before-update"))&&(m=!0),C&&Ae(j,"ref")&&J(),!j&&(C||w)){if(D=!0,q)if(C){if(Q(),process.env.NODE_ENV!=="production"&&u.some(V=>V.type===15?V.properties.some(({key:ye})=>ye.type!==4||!ye.isStatic?!0:ye.content!=="class"&&ye.content!=="style"&&!Ht(ye.content)):!0)&&Ke("COMPILER_V_BIND_OBJECT_ORDER",t,k),Ie("COMPILER_V_BIND_OBJECT_ORDER",t)){u.unshift(q);continue}J(),Q(),u.push(q)}else Q({type:14,loc:k,callee:t.helper(on),arguments:s?[q]:[q,"true"]});else t.onError(W(C?34:35,k));continue}C&&x.some($=>$.content==="prop")&&(y|=32);const T=t.directiveTransforms[O];if(T){const{props:$,needRuntime:V}=T(L,e,t);!l&&$.forEach(A),w&&j&&!ce(j)?Q(ve($,a)):p.push(...$),V&&(d.push(L),Wt(V)&&Mr.set(L,V))}else ro(O)||(d.push(L),h&&(m=!0))}}let N;if(u.length?(Q(),u.length>1?N=te(t.helper(vt),u,a):N=u[0]):p.length&&(N=ve(Lr(p),a)),D?y|=16:(_&&!s&&(y|=2),S&&!s&&(y|=4),z.length&&(y|=8),B&&(y|=32)),!m&&(y===0||y===32)&&(E||H||d.length>0)&&(y|=512),!t.inSSR&&N)switch(N.type){case 15:let R=-1,L=-1,O=!1;for(let k=0;k<N.properties.length;k++){const x=N.properties[k].key;ce(x)?x.content==="class"?R=k:x.content==="style"&&(L=k):x.isHandlerKey||(O=!0)}const j=N.properties[R],q=N.properties[L];O?N=te(t.helper(et),[N]):(j&&!ce(j.value)&&(j.value=te(t.helper(rn),[j.value])),q&&(S||q.value.type===4&&q.value.content.trim()[0]==="["||q.value.type===17)&&(q.value=te(t.helper(sn),[q.value])));break;case 14:break;default:N=te(t.helper(et),[te(t.helper(tt),[N])]);break}return{props:N,directives:d,patchFlag:y,dynamicPropNames:z,shouldUseBlock:m}}function Lr(e){const t=new Map,n=[];for(let s=0;s<e.length;s++){const o=e[s];if(o.key.type===8||!o.key.isStatic){n.push(o);continue}const l=o.key.content,i=t.get(l);i?(l==="style"||l==="class"||Ht(l))&&Pi(i,o):(t.set(l,o),n.push(o))}return n}function Pi(e,t){e.value.type===17?e.value.elements.push(t.value):e.value=Re([e.value,t.value],e.loc)}function Fi(e,t){const n=[],s=Mr.get(e);s?n.push(t.helperString(s)):(t.helper(Vt),t.directives.add(e.name),n.push(st(e.name,"directive")));const{loc:o}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const l=I("true",!1,o);n.push(ve(e.modifiers.map(i=>Z(i,l)),o))}return Re(n,e.loc)}function zi(e){let t="[";for(let n=0,s=e.length;n<s;n++)t+=JSON.stringify(e[n]),n<s-1&&(t+=", ");return t+"]"}function Cn(e){return e==="component"||e==="Component"}const ji=(e,t)=>{if(xt(e)){const{children:n,loc:s}=e,{slotName:o,slotProps:l}=Ui(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",o,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),n.length&&(i[3]=He([],n,!1,!1,s),a=4),t.scopeId&&!t.slotted&&(a=5),i.splice(a),e.codegenNode=te(t.helper(Vn),i,s)}};function Ui(e,t){let n='"default"',s;const o=[];for(let l=0;l<e.props.length;l++){const i=e.props[l];if(i.type===6)i.value&&(i.name==="name"?n=JSON.stringify(i.value.content):(i.name=De(i.name),o.push(i)));else if(i.name==="bind"&&Ae(i.arg,"name")){if(i.exp)n=i.exp;else if(i.arg&&i.arg.type===4){const a=De(i.arg.content);n=i.exp=I(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&ce(i.arg)&&(i.arg.content=De(i.arg.content)),o.push(i)}if(o.length>0){const{props:l,directives:i}=Rr(e,t,o,!1,!1);s=l,i.length&&t.onError(W(36,i[0].loc))}return{slotName:n,slotProps:s}}const Pr=(e,t,n,s)=>{const{loc:o,modifiers:l,arg:i}=e;!e.exp&&!l.length&&n.onError(W(35,o));let a;if(i.type===4)if(i.isStatic){let d=i.content;process.env.NODE_ENV!=="production"&&d.startsWith("vnode")&&n.onError(W(52,i.loc)),d.startsWith("vue:")&&(d=`vnode-${d.slice(4)}`);const h=t.tagType!==0||d.startsWith("vnode")||!/[A-Z]/.test(d)?oo(De(d)):`on:${d}`;a=I(h,!0,i.loc)}else a=be([`${n.helperString(an)}(`,i,")"]);else a=i,a.children.unshift(`${n.helperString(an)}(`),a.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let p=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const d=cr(c),h=!(d||Ro(c)),m=c.content.includes(";");process.env.NODE_ENV!=="production"&&Fe(c,n,!1,m),(h||p&&d)&&(c=be([`${h?"$event":"(...args)"} => ${m?"{":"("}`,c,m?"}":")"]))}let u={props:[Z(a,c||I("() => {}",!1,o))]};return s&&(u=s(u)),p&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(d=>d.key.isHandlerKey=!0),u},Hi=(e,t,n)=>{const{modifiers:s,loc:o}=e,l=e.arg;let{exp:i}=e;return i&&i.type===4&&!i.content.trim()&&(i=void 0),l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=De(l.content):l.content=`${n.helperString(ln)}(${l.content})`:(l.children.unshift(`${n.helperString(ln)}(`),l.children.push(")"))),n.inSSR||(s.some(a=>a.content==="prop")&&Fr(l,"."),s.some(a=>a.content==="attr")&&Fr(l,"^")),{props:[Z(l,i)]}},Fr=(e,t)=>{e.type===4?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},Wi=(e,t)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{const n=e.children;let s,o=!1;for(let l=0;l<n.length;l++){const i=n[l];if(gn(i)){o=!0;for(let a=l+1;a<n.length;a++){const c=n[a];if(gn(c))s||(s=n[l]=be([i],i.loc)),s.children.push(" + ",c),n.splice(a,1),a--;else{s=void 0;break}}}}if(!(!o||n.length===1&&(e.type===0||e.type===1&&e.tagType===0&&!e.props.find(l=>l.type===7&&!t.directiveTransforms[l.name])&&e.tag!=="template")))for(let l=0;l<n.length;l++){const i=n[l];if(gn(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!t.ssr&&ge(i,t)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Ye[1]} */`:"")),n[l]={type:12,content:i,loc:i.loc,codegenNode:te(t.helper(Yt),a)}}}}},zr=new WeakSet,qi=(e,t)=>{if(e.type===1&&de(e,"once",!0))return zr.has(e)||t.inVOnce||t.inSSR?void 0:(zr.add(e),t.inVOnce=!0,t.helper(yt),()=>{t.inVOnce=!1;const n=t.currentNode;n.codegenNode&&(n.codegenNode=t.cache(n.codegenNode,!0,!0))})},jr=(e,t,n)=>{const{exp:s,arg:o}=e;if(!s)return n.onError(W(41,e.loc)),lt();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=n.bindingMetadata[l];if(a==="props"||a==="props-aliased")return n.onError(W(44,s.loc)),lt();if(a==="literal-const"||a==="setup-const")return n.onError(W(45,s.loc)),lt();if(!i.trim()||!cr(s))return n.onError(W(42,s.loc)),lt();const c=o||I("modelValue",!0),p=o?ce(o)?`onUpdate:${De(o.content)}`:be(['"onUpdate:" + ',o]):"onUpdate:modelValue";let u;const d=n.isTS?"($event: any)":"$event";u=be([`${d} => ((`,s,") = $event)"]);const h=[Z(c,e.exp),Z(p,u)];if(e.modifiers.length&&t.tagType===1){const m=e.modifiers.map(E=>E.content).map(E=>(mn(E)?E:JSON.stringify(E))+": true").join(", "),y=o?ce(o)?`${o.content}Modifiers`:be([o,' + "Modifiers"']):"modelModifiers";h.push(Z(y,I(`{ ${m} }`,!1,e.loc,2)))}return lt(h)};function lt(e=[]){return{props:e}}const Ki=/[\w).+\-_$\]]/,Gi=(e,t)=>{Ie("COMPILER_FILTERS",t)&&(e.type===5?It(e.content,t):e.type===1&&e.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&It(n.exp,t)}))};function It(e,t){if(e.type===4)Ur(e,t);else for(let n=0;n<e.children.length;n++){const s=e.children[n];typeof s=="object"&&(s.type===4?Ur(s,t):s.type===8?It(e,t):s.type===5&&It(s.content,t))}}function Ur(e,t){const n=e.content;let s=!1,o=!1,l=!1,i=!1,a=0,c=0,p=0,u=0,d,h,m,y,E=[];for(m=0;m<n.length;m++)if(h=d,d=n.charCodeAt(m),s)d===39&&h!==92&&(s=!1);else if(o)d===34&&h!==92&&(o=!1);else if(l)d===96&&h!==92&&(l=!1);else if(i)d===47&&h!==92&&(i=!1);else if(d===124&&n.charCodeAt(m+1)!==124&&n.charCodeAt(m-1)!==124&&!a&&!c&&!p)y===void 0?(u=m+1,y=n.slice(0,m).trim()):_();else{switch(d){case 34:o=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:p++;break;case 41:p--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(d===47){let S=m-1,B;for(;S>=0&&(B=n.charAt(S),B===" ");S--);(!B||!Ki.test(B))&&(i=!0)}}y===void 0?y=n.slice(0,m).trim():u!==0&&_();function _(){E.push(n.slice(u,m).trim()),u=m+1}if(E.length){for(process.env.NODE_ENV!=="production"&&Et("COMPILER_FILTERS",t,e.loc),m=0;m<E.length;m++)y=Ji(y,E[m],t);e.content=y,e.ast=void 0}}function Ji(e,t,n){n.helper(en);const s=t.indexOf("(");if(s<0)return n.filters.add(t),`${st(t,"filter")}(${e})`;{const o=t.slice(0,s),l=t.slice(s+1);return n.filters.add(o),`${st(o,"filter")}(${e}${l!==")"?","+l:l}`}}const Hr=new WeakSet,Xi=(e,t)=>{if(e.type===1){const n=de(e,"memo");return!n||Hr.has(e)||t.inSSR?void 0:(Hr.add(e),()=>{const s=e.codegenNode||t.currentNode.codegenNode;s&&s.type===13&&(e.tagType!==1&&pn(s,t),e.codegenNode=te(t.helper(dn),[n.exp,He(void 0,s),"_cache",String(t.cached.length)]),t.cached.push(null))})}},Yi=(e,t)=>{if(e.type===1){for(const n of e.props)if(n.type===7&&n.name==="bind"&&(!n.exp||n.exp.type===4&&!n.exp.content.trim())&&n.arg){const s=n.arg;if(s.type!==4||!s.isStatic)t.onError(W(53,s.loc)),n.exp=I("",!0,s.loc);else{const o=De(s.content);(lr.test(o[0])||o[0]==="-")&&(n.exp=I(o,!1,s.loc))}}}};function Zi(e){return[[Yi,qi,Ci,Xi,Di,Gi,...process.env.NODE_ENV!=="production"?[Si]:[],ji,Ri,Ai,Wi],{on:Pr,bind:Hi,model:jr}]}function Qi(e,t={}){const n=t.onError||hn,s=t.mode==="module";t.prefixIdentifiers===!0?n(W(48)):s&&n(W(49));const o=!1;t.cacheHandlers&&n(W(50)),t.scopeId&&!s&&n(W(51));const l=Be({},t,{prefixIdentifiers:o}),i=ne(e)?Vo(e,l):e,[a,c]=Zi();return ri(i,Be({},l,{nodeTransforms:[...a,...t.nodeTransforms||[]],directiveTransforms:Be({},c,t.directiveTransforms||{})})),li(i,l)}const Vi=()=>({props:[]});const Wr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),qr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Kr=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Gr=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),_n=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Jr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Xr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Yr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Tn=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Zr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");So({[Wr]:"vModelRadio",[qr]:"vModelCheckbox",[Kr]:"vModelText",[Gr]:"vModelSelect",[_n]:"vModelDynamic",[Jr]:"withModifiers",[Xr]:"withKeys",[Yr]:"vShow",[Tn]:"Transition",[Zr]:"TransitionGroup"});let Ge;function el(e,t=!1){return Ge||(Ge=document.createElement("div")),t?(Ge.innerHTML=`<div foo="${e.replace(/"/g,""")}">`,Ge.children[0].getAttribute("foo")):(Ge.innerHTML=e,Ge.textContent)}const tl={parseMode:"html",isVoidTag:bo,isNativeTag:e=>go(e)||vo(e)||yo(e),isPreTag:e=>e==="pre",isIgnoreNewlineTag:e=>e==="pre"||e==="textarea",decodeEntities:el,isBuiltInComponent:e=>{if(e==="Transition"||e==="transition")return Tn;if(e==="TransitionGroup"||e==="transition-group")return Zr},getNamespace(e,t,n){let s=t?t.ns:n;if(t&&s===2)if(t.tag==="annotation-xml"){if(e==="svg")return 1;t.props.some(o=>o.type===6&&o.name==="encoding"&&o.value!=null&&(o.value.content==="text/html"||o.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&e!=="mglyph"&&e!=="malignmark"&&(s=0);else t&&s===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(s=0);if(s===0){if(e==="svg")return 1;if(e==="math")return 2}return s}},nl=e=>{e.type===1&&e.props.forEach((t,n)=>{t.type===6&&t.name==="style"&&t.value&&(e.props[n]={type:7,name:"bind",arg:I("style",!0,t.loc),exp:rl(t.value.content,t.loc),modifiers:[],loc:t.loc})})},rl=(e,t)=>{const n=fo(e);return I(JSON.stringify(n),!1,t,3)};function Ee(e,t){return W(e,t,process.env.NODE_ENV!=="production"?sl:void 0)}const sl={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},ol=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(54,o)),t.children.length&&(n.onError(Ee(55,o)),t.children.length=0),{props:[Z(I("innerHTML",!0,o),s||I("",!0))]}},il=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(56,o)),t.children.length&&(n.onError(Ee(57,o)),t.children.length=0),{props:[Z(I("textContent",!0),s?ge(s,n)>0?s:te(n.helperString(gt),[s],o):I("",!0))]}},ll=(e,t,n)=>{const s=jr(e,t,n);if(!s.props.length||t.tagType===1)return s;e.arg&&n.onError(Ee(59,e.arg.loc));function o(){const a=de(t,"bind");a&&Ae(a.arg,"value")&&n.onError(Ee(61,a.loc))}const{tag:l}=t,i=n.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Kr,c=!1;if(l==="input"||i){const p=rt(t,"type");if(p){if(p.type===7)a=_n;else if(p.value)switch(p.value.content){case"radio":a=Wr;break;case"checkbox":a=qr;break;case"file":c=!0,n.onError(Ee(60,e.loc));break;default:process.env.NODE_ENV!=="production"&&o();break}}else Lo(t)?a=_n:process.env.NODE_ENV!=="production"&&o()}else l==="select"?a=Gr:process.env.NODE_ENV!=="production"&&o();c||(s.needRuntime=n.helper(a))}else n.onError(Ee(58,e.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},al=ke("passive,once,capture"),cl=ke("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),dl=ke("left,right"),Qr=ke("onkeyup,onkeydown,onkeypress"),fl=(e,t,n,s)=>{const o=[],l=[],i=[];for(let a=0;a<t.length;a++){const c=t[a].content;c==="native"&&Ke("COMPILER_V_ON_NATIVE",n,s)||al(c)?i.push(c):dl(c)?ce(e)?Qr(e.content.toLowerCase())?o.push(c):l.push(c):(o.push(c),l.push(c)):cl(c)?l.push(c):o.push(c)}return{keyModifiers:o,nonKeyModifiers:l,eventOptionModifiers:i}},Vr=(e,t)=>ce(e)&&e.content.toLowerCase()==="onclick"?I(t,!0):e.type!==4?be(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,pl=(e,t,n)=>Pr(e,t,n,s=>{const{modifiers:o}=e;if(!o.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:p}=fl(l,o,n,e.loc);if(c.includes("right")&&(l=Vr(l,"onContextmenu")),c.includes("middle")&&(l=Vr(l,"onMouseup")),c.length&&(i=te(n.helper(Jr),[i,JSON.stringify(c)])),a.length&&(!ce(l)||Qr(l.content.toLowerCase()))&&(i=te(n.helper(Xr),[i,JSON.stringify(a)])),p.length){const u=p.map(Kt).join("");l=ce(l)?I(`${l.content}${u}`,!0):be(["(",l,`) + "${u}"`])}return{props:[Z(l,i)]}}),ul=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(62,o)),{props:[],needRuntime:n.helper(Yr)}},hl=(e,t)=>{if(e.type===1&&e.tagType===1&&t.isBuiltInComponent(e.tag)===Tn)return()=>{if(!e.children.length)return;es(e)&&t.onError(Ee(63,{start:e.children[0].loc.start,end:e.children[e.children.length-1].loc.end,source:""}));const s=e.children[0];if(s.type===1)for(const o of s.props)o.type===7&&o.name==="show"&&e.props.push({type:6,name:"persisted",nameLoc:e.loc,value:void 0,loc:e.loc})}};function es(e){const t=e.children=e.children.filter(s=>!yn(s)),n=t[0];return t.length!==1||n.type===11||n.type===9&&n.branches.some(es)}const ml=(e,t)=>{e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style")&&(process.env.NODE_ENV!=="production"&&t.onError(Ee(64,e.loc)),t.removeNode())};function gl(e,t){return e==="template"?!0:e in ts?ts[e].has(t):t in ns?ns[t].has(e):!(e in rs&&rs[e].has(t)||t in ss&&ss[t].has(e))}const Je=new Set(["h1","h2","h3","h4","h5","h6"]),ze=new Set([]),ts={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:ze,iframe:ze,option:ze,textarea:ze,style:ze,title:ze},ns={html:ze,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},rs={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},ss={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Je,h2:Je,h3:Je,h4:Je,h5:Je,h6:Je},vl=(e,t)=>{if(e.type===1&&e.tagType===0&&t.parent&&t.parent.type===1&&t.parent.tagType===0&&!gl(t.parent.tag,e.tag)){const n=new SyntaxError(`<${e.tag}> cannot be child of <${t.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);n.loc=e.loc,t.onWarn(n)}},yl=[nl,...process.env.NODE_ENV!=="production"?[hl,vl]:[]],bl={cloak:Vi,html:ol,text:il,model:ll,on:pl,show:ul};function El(e,t={}){return Qi(e,Be({},tl,t,{nodeTransforms:[ml,...yl,...t.nodeTransforms||[]],directiveTransforms:Be({},bl,t.directiveTransforms||{}),transformHoist:null}))}function kl(e,t){const n=e.trim().startsWith("<")?e:`<span>${e}</span>`,{code:s}=El(n,{mode:"function"}),o=new Function("Vue",`${s}; return render`)(_s);return r.defineComponent({name:"DynamicFromString",props:t?.props??{},emits:t?.emits??[],setup(l,i){return t?.setup?.()??{}},render:o})}const Bn={};function os(e){return Bn[e]||(Bn[e]=kl(e,{props:{row:Object,value:null,data:Object,column:Object}})),Bn[e]}const xl={class:"py-10 flex flex-col justify-center items-center text-center"},wl={class:"max-w-sm mx-auto"},Nl={class:"mt-2 font-medium text-gray-800 dark:text-neutral-200"},Sl={class:"mb-5 text-sm text-gray-500 dark:text-neutral-500"},Cl=r.defineComponent({__name:"nodata",props:{title:{},description:{}},setup(e){const t=dt(),n=e,s=r.computed(()=>n.title??t("table.noData.title")),o=r.computed(()=>n.description??t("table.noData.description"));return(l,i)=>(r.openBlock(),r.createElementBlock("div",xl,[i[0]||(i[0]=r.createStaticVNode('<svg class="w-48 mx-auto mb-4" width="178" height="90" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter19)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter19" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),r.createElementVNode("div",wl,[r.createElementVNode("p",Nl,r.toDisplayString(s.value),1),r.createElementVNode("p",Sl,r.toDisplayString(o.value),1)])]))}}),_l=["aria-checked","data-state"],Tl={key:0,"data-state":"checked","data-slot":"checkbox-indicator",class:"flex items-center justify-center transition-none text-white"},Bl=["onKeydown"],Dl={key:0,class:"hs-dropdown-menu hs-dropdown-open:opacity-100 w-44 transition-[opacity,margin] duration z-11 bg-white rounded-xl shadow-lg dark:bg-neutral-950",role:"menu","aria-orientation":"vertical","aria-labelledby":"hs-pro-inthmtdid1"},Ol={class:"py-2 px-4"},Il={class:"block font-medium text-[13px] text-gray-800 dark:text-neutral-200"},Al={class:"truncate"},$l={class:"p-1 border-t border-gray-200 dark:border-neutral-800"},Ml={class:"space-y-0.5 max-h-48 overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Rl=["onClick"],Ll={key:0,class:"shrink-0 size-3.5 flex justify-center items-center"},Pl={key:1,class:"shrink-0 size-3.5 ms-auto",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fl={key:1,class:"p-4"},zl={class:"text-base font-semibold text-gray-800 mb-3"},jl={class:"mb-4"},Ul={class:"block text-sm font-medium text-gray-700 mb-1"},Hl={key:0,class:"text-xs text-gray-500 mb-2"},Wl=["placeholder"],ql=["placeholder"],Kl=["placeholder"],Gl={disabled:"",value:""},Jl=["value"],Xl={key:0,class:"text-xs text-gray-500"},Yl={class:"flex justify-end gap-2 border-t pt-3"},Zl=r.defineComponent({__name:"EditableCell",props:{row:{},column:{},value:{},format:{},options:{},accent:{},editable:{type:Boolean},color:{},classContent:{},fetchOptions:{type:Function},overflow:{}},emits:["edit","update"],setup(e,{emit:t}){const n=e,s=t,o=r.ref(!1),l=r.ref(null),i=r.ref(null),a=r.ref(n.value),c=r.ref([]),p=r.ref({}),u=ut(),d=r.computed(()=>n.column?.schema?.[n.column?.name]),h=r.computed(()=>pt(n.column||{},u.value)),m=r.computed(()=>Ds(n.column||{},u.value)||""),y=r.computed(()=>Pn(n.column||{},u.value)),E=r.computed(()=>Bs(n.column||{},u.value)),_=r.computed(()=>Ft(d.value,u.value,"placeholder")||m.value||""),S=r.computed(()=>Ft(d.value,u.value,"info")||y.value||null),B=r.computed(()=>Ft(d.value,u.value,"description")||E.value||null),D=r.computed(()=>_.value||"-- виберіть --");r.watch(()=>n.value,w=>{a.value=w});const H=r.computed(()=>{const w=n.column?.schema?.[n.column?.name];if(w?.type)switch(w.type){case"Text":return"text";case"Number":return"number";case"Switcher":return"boolean";case"Autocomplete":return"select";case"Date":return"date";default:return"text"}const $=(n.format||n.column?.format||"text").toLowerCase();return["text","number","date","select","boolean"].includes($)?$:"text"}),z=r.computed(()=>(n.column?.schema?.[n.column?.name]?.options||n.options||c.value||[]).map(T=>({value:T.id??T.value,color:T.color,label:Os(T,u.value)||""}))),Q=r.ref(null);function J(){if(!o.value||!Q.value||!i.value)return;const w=Q.value.getBoundingClientRect(),{left:T,right:$,top:V}=w,ye=window.innerWidth||document.documentElement.clientWidth,xe=window.innerHeight||document.documentElement.clientHeight,le=8;let Te=$+le,we=V;const Ne=i.value.getBoundingClientRect();Te+Ne.width>ye-le&&(Te=T-Ne.width-le),Te=Math.max(le,Math.min(Te,ye-Ne.width-le)),we+Ne.height>xe-le&&(we=xe-Ne.height-le),we=Math.max(le,Math.min(we,xe-Ne.height-le)),p.value={left:`${Math.round(Te)}px`,top:`${Math.round(we)}px`}}function A(){n.editable&&(o.value||document.dispatchEvent(new CustomEvent("close-all-popovers")),o.value=!o.value,o.value&&r.nextTick(()=>{J(),l.value?.focus?.(),l.value?.showPicker?.(),H.value==="select"&&C()}))}function N(){s("edit",n.row,n.column.name,a.value),s("update",n.row,n.column.name,a.value),o.value=!1}function R(){a.value=n.value,o.value=!1}function L(w){if(!o.value)return;const T=w.target;i.value&&i.value.contains(T)||Q.value&&!Q.value.contains(T)&&(o.value=!1)}function O(){o.value=!1}r.onMounted(()=>{document.addEventListener("click",L),document.addEventListener("close-all-popovers",O),window.addEventListener("resize",J),document.addEventListener("scroll",J,!0)}),r.onBeforeUnmount(()=>{document.removeEventListener("click",L),document.removeEventListener("close-all-popovers",O),window.removeEventListener("resize",J),document.removeEventListener("scroll",J,!0)});function j(){n.editable&&(a.value=!a.value,s("update",n.row,n.column.name,a.value))}function q(w){return n.color?n.color.startsWith("#")?w.replace("{c}",`[${n.color}]`):w.replace("{c}",`${n.color}-500`):w.replace("{c}","cyan-500")}const k=r.computed(()=>({border:q("border-{c}"),ring:q("focus:ring-{c}"),text:q("text-{c}"),hover:q("hover:text-{c}"),bg:q("bg-{c} hover:bg-{c}/90")})),x=r.computed(()=>n.overflow==="wrap"?["flex-1","whitespace-normal","break-words"]:["flex-1","truncate","whitespace-nowrap"]);async function C(){if(H.value==="select"&&!(n.options&&n.options.length>0||n.column?.schema?.[n.column?.name]?.options?.length>0)&&c.value.length===0&&n.fetchOptions)try{c.value=await n.fetchOptions(n.column.name)}catch(w){console.error(`Не удалось загрузить options для ${n.column.name}`,w)}}return(w,T)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(e.classContent?e.classContent:"relative group w-full"),ref_key:"cellRef",ref:Q},[H.value==="boolean"&&e.editable?(r.openBlock(),r.createElementBlock("button",{key:0,type:"button",role:"checkbox","aria-checked":a.value?"true":"false","data-state":a.value?"checked":"unchecked",class:r.normalizeClass(["peer size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] h-4 w-4 flex items-center justify-center",a.value?k.value.border:"",k.value.ring,a.value?k.value.bg:""]),onClick:r.withModifiers(j,["stop"])},[a.value?(r.openBlock(),r.createElementBlock("span",Tl,[...T[4]||(T[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-check size-3.5"},[r.createElementVNode("path",{d:"M20 6 9 17l-5-5"})],-1)])])):r.createCommentVNode("",!0)],10,_l)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",{class:"flex items-start justify-between cursor-pointer gap-2",onClick:r.withModifiers(A,["stop"])},[r.createElementVNode("span",{class:r.normalizeClass(x.value)},[r.renderSlot(w.$slots,"default")],2),e.editable?(r.openBlock(),r.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",class:r.normalizeClass(["w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity",k.value.text])},[...T[5]||(T[5]=[r.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L7.5 21H3v-4.5L16.732 3.732z"},null,-1)])],2)):r.createCommentVNode("",!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:i,class:r.normalizeClass(["fixed z-[9999] bg-white border rounded-lg shadow-lg",H.value==="select"?"":"w-[450px]"]),style:r.normalizeStyle(p.value),onKeydown:r.withKeys(r.withModifiers(R,["stop","prevent"]),["esc"])},[H.value==="select"?(r.openBlock(),r.createElementBlock("div",Dl,[r.createElementVNode("div",Ol,[r.createElementVNode("span",Il,[r.createElementVNode("span",Al,r.toDisplayString(h.value),1)])]),r.createElementVNode("div",$l,[r.createElementVNode("div",Ml,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.value,$=>(r.openBlock(),r.createElementBlock("label",{key:$.value.toString(),onClick:r.withModifiers(()=>{a.value=$.value,N()},["prevent"]),class:"py-1.5 px-3 group flex items-center gap-x-3 rounded-lg cursor-pointer text-[13px] text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},[T[8]||(T[8]=r.createElementVNode("input",{type:"radio",class:"hidden",id:"hs-pro-chthuts1op",name:"hs-pro-chthuts1"},null,-1)),$.color?(r.openBlock(),r.createElementBlock("span",Ll,[...T[6]||(T[6]=[r.createElementVNode("span",{class:"shrink-0 size-2 block mx-auto bg-emerald-500 rounded-full"},null,-1)])])):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString($.label)+" ",1),a.value===$.value?(r.openBlock(),r.createElementBlock("svg",Pl,[...T[7]||(T[7]=[r.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])):r.createCommentVNode("",!0)],8,Rl))),128))])])])):(r.openBlock(),r.createElementBlock("div",Fl,[r.createElementVNode("h3",zl," Редагувати "+r.toDisplayString(h.value),1),r.createElementVNode("div",jl,[r.createElementVNode("label",Ul,r.toDisplayString(h.value),1),S.value?(r.openBlock(),r.createElementBlock("p",Hl,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0),H.value==="text"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:1,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[0]||(T[0]=$=>a.value=$),type:"text",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onKeyup:r.withKeys(N,["enter"])},null,42,Wl)),[[r.vModelText,a.value]]):H.value==="number"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[1]||(T[1]=$=>a.value=$),type:"number",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onKeyup:r.withKeys(N,["enter"])},null,42,ql)),[[r.vModelText,a.value,void 0,{number:!0}]]):H.value==="date"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:3,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[2]||(T[2]=$=>a.value=$),type:"date",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onChange:N},null,42,Kl)),[[r.vModelText,a.value]]):H.value==="select"?r.withDirectives((r.openBlock(),r.createElementBlock("select",{key:4,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[3]||(T[3]=$=>a.value=$),class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none bg-white border-gray-300",k.value.ring,k.value.border])},[r.createElementVNode("option",Gl,r.toDisplayString(D.value),1),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.value,$=>(r.openBlock(),r.createElementBlock("option",{key:$.value.toString(),value:$.value},r.toDisplayString($.label),9,Jl))),128))],2)),[[r.vModelSelect,a.value]]):r.createCommentVNode("",!0)]),B.value?(r.openBlock(),r.createElementBlock("p",Xl,r.toDisplayString(B.value),1)):r.createCommentVNode("",!0),r.createElementVNode("div",Yl,[r.createElementVNode("button",{type:"button",class:"px-4 py-1.5 text-sm rounded-md border border-gray-300 text-gray-700 bg-white hover:bg-gray-50",onClick:R}," Скасувати "),r.createElementVNode("button",{type:"button",class:r.normalizeClass(["px-4 py-1.5 text-sm rounded-md text-white",k.value.bg]),onClick:N}," Зберегти ",2)])]))],46,Bl)):r.createCommentVNode("",!0)]))],64))],2))}}),is=typeof window<"u",ls=typeof document<"u",Ql=()=>{if(!ls)throw new Error("Tooltip requires document to be defined");const e=document.createElement("div");return e.className="fixed z-[9999] w-56 p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-200",e.style.opacity="0",e.style.visibility="hidden",document.body.appendChild(e),e},as=(e,t)=>{if(!ls||!is)return;const n=Ql(),s={text:t,tooltipEl:n,show:o=>{if(!s.text||!is)return;n.textContent=s.text;const l=o.currentTarget.getBoundingClientRect(),i=window.innerWidth-n.offsetWidth-12,a=Math.max(12,Math.min(l.left,i));n.style.left=`${a}px`,n.style.top=`${l.bottom+4}px`,n.style.opacity="1",n.style.visibility="visible"},hide:()=>{n.style.opacity="0",n.style.visibility="hidden"}};e.addEventListener("mouseenter",s.show),e.addEventListener("mouseleave",s.hide),e.addEventListener("focus",s.show),e.addEventListener("blur",s.hide),e.tooltipHandlers=s},cs=e=>{e.tooltipHandlers&&(e.removeEventListener("mouseenter",e.tooltipHandlers.show),e.removeEventListener("mouseleave",e.tooltipHandlers.hide),e.removeEventListener("focus",e.tooltipHandlers.show),e.removeEventListener("blur",e.tooltipHandlers.hide),e.tooltipHandlers.tooltipEl.remove(),delete e.tooltipHandlers)},Vl={mounted(e,t){t.value&&as(e,t.value)},updated(e,t){const n=e;if(!t.value){cs(n);return}if(!n.tooltipHandlers){as(n,t.value);return}n.tooltipHandlers.text=t.value},unmounted(e){cs(e)}},ea={key:0,class:"text-center py-8"},ta={class:"inline-flex items-center space-x-2"},na={key:2,class:"overflow-x-auto"},ra={key:0},sa={key:0,style:{width:"48px"}},oa={key:1,style:{width:"100px"}},ia=["checked","indeterminate"],la=["onClick"],aa={class:"flex items-center justify-between"},ca={class:"flex items-center gap-1.5"},da={key:0,class:"relative group"},fa=["onMouseenter"],pa={key:0,class:"ml-1 text-xs"},ua=["onMousedown"],ha=["onClick"],ma=["checked","onChange"],ga=["onClick"],va={key:1,class:"text-center"},ya=["colspan"],Dn=50,ba=180,At=r.defineComponent({name:"DataTable",__name:"DataTable",props:{rows:{default:()=>[]},columns:{default:()=>[]},api:{},router:{},tableStyle:{default:""},size:{default:"medium"},theme:{default:"light"},loading:{type:Boolean,default:!1},classWrapper:{default:""},classTable:{default:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},classTbody:{default:""},classTr:{default:""},classTd:{default:""},classTh:{default:""},classThead:{default:""},classContent:{default:""},classLink:{default:""},selectable:{type:Boolean,default:!1},selectedRows:{default:()=>[]},limit:{default:10},page:{default:1},total:{default:0},showPagination:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},defaultSort:{default:()=>[]},clickable:{type:Boolean,default:!1},hasAction:{type:Boolean,default:!0},getCellData:{type:Function,default:void 0},form:{},color:{default:"blue"},resizableColumnsWidth:{type:Boolean,default:!1},resizableColumnsWidthStorageKey:{default:""}},emits:["update:page","update:selectedRows","row-click","sort","cell-update"],setup(e,{emit:t}){const n=e,s=Vl,o=r.ref({}),l=r.ref(null),i=r.ref(!1);let a=0,c=0,p=null,u=null;const d=t,h=r.ref(n.selectedRows||[]),m=r.ref(n.defaultSort.map(f=>({field:f.name,direction:f.asc?"asc":"desc"}))),y=r.ref([]),E=r.ref([]),_=r.ref(!1),S=r.ref(null),B=r.ref(n.router),D=r.useSlots(),H=r.computed(()=>D.action),z=r.computed(()=>H.value&&n.hasAction);function Q(f){if(B.value){B.value.push(f);return}location.href=f}const J=r.computed(()=>{if(n.api)return y.value;if(n.sortable&&m.value.length>0){const f=[...n.rows];return f.sort((b,g)=>{for(const U of m.value){if(!U.direction)return 0;const v=b[U.field],M=g[U.field];if(v==null)return 1;if(M==null)return-1;let ee=0;typeof v=="string"&&typeof M=="string"?ee=v.localeCompare(M):v<M?ee=-1:v>M?ee=1:ee=0;const Xe=U.direction==="desc"?-ee:ee;if(Xe!==0)return Xe}return 0}),f}return n.rows});r.watch(()=>n.selectedRows,f=>{h.value=f||[]});const A=f=>h.value.some(b=>b===f),N=f=>{const b=h.value.findIndex(g=>g===f);b>-1?h.value.splice(b,1):h.value.push(f),d("update:selectedRows",[...h.value])},R=r.computed(()=>J.value.length>0&&h.value.length===J.value.length),L=r.computed(()=>h.value.length>0&&h.value.length<J.value.length),O=()=>{R.value?h.value=[]:h.value=[...J.value],d("update:selectedRows",[...h.value])},j=(f,b)=>{if(!n.sortable||l.value||i.value)return;if(b?.ctrlKey||b?.metaKey){const v=m.value.findIndex(M=>M.field===f);if(v>=0){const M=m.value[v];M.direction==="asc"?M.direction="desc":M.direction==="desc"&&m.value.splice(v,1)}else m.value.unshift({field:f,direction:"asc"})}else{const v=m.value.find(M=>M.field===f);v?v.direction==="asc"?v.direction="desc":v.direction==="desc"&&(m.value=[]):m.value=[{field:f,direction:"asc"}]}const U=m.value.filter(v=>v.direction).map(v=>({name:v.field,asc:v.direction==="asc"}));d("sort",U),n.api&&Rt()},q=f=>m.value.find(g=>g.field===f)?.direction==="asc",k=f=>{const b=m.value.find(g=>g.field===f);if(!b)return"";switch(b.direction){case"asc":return"↑";case"desc":return"↓";default:return"↕️"}},x=f=>n.sortable&&f.sortable!==!1,C=f=>{n.clickable&&d("row-click",f)},w=f=>f==null||f===""?"":typeof f=="object"?f?.text?String(f.text):f?.label?String(f.label):JSON.stringify(f):String(f),T=f=>f.map(w).filter(b=>b!=="").join(", "),$=(f,b)=>b.format!=="array"&&Array.isArray(f)?T(f):f,V=(f,b)=>{const g=b[f.name];if(n.getCellData||f.getCellData){const M=f.getCellData||n.getCellData;if(M){const ee={name:f.name,row:b,value:g};return $(M(ee),f)}}const v=["_data","_text"].map(M=>{const ee=`${f.name}${M}`;return b[ee]?b[ee]:null}).find(M=>M)||(f.link?g||"-":g);return $(v,f)},ye=f=>Array.isArray(f)?T(f):w(f),xe=(f,b)=>{if(!b?.tooltip)return;const g=V(b,f);if(g!=null)return ye(g)},le=f=>f.width?f.width==="w-full"?"w-full":typeof f.width=="string"?`w-[${f.width}px] max-w-[${f.width}px] min-w-[${f.width}px]`:typeof f.width=="number"?`w-[${f.width}px] max-w-[${f.width}px] min-w-[${f.width}px]`:"":"max-w-[350px]",Te=f=>(typeof f?.overflow=="string"?f.overflow.toLowerCase():"")==="wrap"?"wrap":"clip",we=f=>Te(f)==="wrap"?["whitespace-normal","break-words"]:["truncate","whitespace-nowrap"],Ne=r.ref(n.page),hs=r.ref(n.limit),On=r.ref(n.total),$t=r.ref(1),In=r.ref(10),Mt=r.ref(0),ms=r.computed(()=>n.api?$t.value:Ne.value),gs=r.computed(()=>n.api?In.value:hs.value),vs=r.computed(()=>n.api?Mt.value:On.value),ae=r.computed(()=>{const{theme:f}=n;return f==="dark"?{container:"dark",loading:"text-gray-400",error:"text-red-400",thead:"bg-gray-800",th:"text-gray-300",thHover:"hover:bg-gray-700",tbody:"bg-gray-900 divide-gray-700",tr:"hover:bg-gray-800",td:"text-gray-300",empty:"text-gray-400",checkbox:"border-gray-600 bg-gray-700 text-blue-400"}:f==="light"?{container:"",loading:"text-gray-500",error:"text-red-500",thead:"bg-gray-50",th:"text-gray-500",thHover:"hover:bg-gray-100",tbody:"bg-white divide-gray-200",tr:"hover:bg-gray-50",td:"text-gray-900",empty:"text-gray-500",checkbox:"border-gray-300 bg-white text-blue-600"}:{container:"",loading:"text-gray-500 dark:text-gray-400",error:"text-red-500 dark:text-red-400",thead:"bg-gray-50 dark:bg-gray-800",th:"text-gray-500 dark:text-gray-300",thHover:"hover:bg-gray-100 dark:hover:bg-gray-700",tbody:"bg-white dark:bg-gray-900 divide-gray-200 dark:divide-gray-700",tr:"hover:bg-gray-50 dark:hover:bg-gray-800",td:"text-gray-900 dark:text-gray-300",empty:"text-gray-500 dark:text-gray-400",checkbox:"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400"}});r.watch(()=>n.page,f=>{Ne.value=f}),r.watch(()=>n.limit,f=>{hs.value=f}),r.watch(()=>n.total,f=>{On.value=f});async function Rt(){if(n.api){_.value=!0,S.value=null;try{const f=new URL(n.api,window.location.origin);if(f.searchParams.set("page",ms.value.toString()),f.searchParams.set("limit",gs.value.toString()),m.value.length>0){const U=m.value.filter(v=>v.direction).map(v=>`${v.field}:${v.direction}`).join(",");U&&f.searchParams.set("sort",U)}const b=await fetch(f.toString());if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);const g=await b.json();g.rows&&Array.isArray(g.rows)&&(y.value=g.rows),g.columns&&Array.isArray(g.columns)&&(E.value=g.columns),g.total!==void 0&&(n.api?Mt.value=g.total:On.value=g.total)}catch(f){S.value=f instanceof Error?f.message:"Failed to fetch data",console.error("Error fetching data:",f)}finally{_.value=!1}}}const Ec=f=>{n.api?$t.value=f:(Ne.value=f,d("update:page",f)),n.api&&Rt()},kc=r.computed(()=>n.showPagination&&vs.value>0),at=r.computed(()=>({small:{header:"px-3 py-2 text-xs",cell:"px-3 py-2 text-xs"},medium:{header:"px-6 py-3 text-xs",cell:"px-6 py-4 text-sm"},large:{header:"px-8 py-4 text-sm",cell:"px-8 py-6 text-base"}})[n.size]),xc=f=>{const b=[];return n.classTd?b.push(n.classTd):b.push(ae.value.td,at.value.cell),f.align&&b.push(`text-${f.align}`),!n.resizableColumnsWidth&&le(f)&&b.push(le(f)),b.push(...we(f)),b.filter(Boolean)},wc=dt(),ys=ut();r.onMounted(()=>{n.api&&(n.page&&($t.value=n.page),n.limit&&(In.value=n.limit),n.total&&(Mt.value=n.total),Rt()),n.resizableColumnsWidth&&ks()}),r.watch(()=>n.api,f=>{f&&($t.value=n.page||1,In.value=n.limit||10,Mt.value=n.total||0,Rt())});const bs=r.computed(()=>n.api?E.value:n.columns),An=r.ref([]),Lt=r.ref({});r.provide("registerColumn",(f,b)=>{An.value.push(f),b&&f.slotName&&(Lt.value[f.name]=b)});const $n=r.computed(()=>{const f=bs.value||[],b=[],g=D.default?.();if(g){const U=g.filter(v=>v.type?.name==="Column"||v.type==="Column"||v.type&&typeof v.type=="object"&&v.type.name==="Column").map(v=>{const M=v.props||v.componentProps||{},ee=M.field||M.name||"",Xe=M.header||M.label||"",Ss=v.children&&v.children.body,Rn={name:ee,ua:Xe,format:M.format||"text",slotName:Ss?"body":void 0,...M};return Ss&&Rn.name&&(Lt.value[Rn.name]=v.children.body),Rn});b.push(...U)}if(An.value.length>0&&b.push(...An.value),b.length>0){const U=[],v=new Set(b.map(M=>M.name));return f.forEach(M=>{v.has(M.name)||U.push(M)}),U.push(...b),console.log("Combined columns:",{default:f.length,custom:b.length,combined:U.length}),U}return f.length>0?f:[]}),Pt=r.computed(()=>($n.value||[]).filter(f=>!f.hidden));function Es(f){if(typeof f.width=="number"&&f.width>0)return f.width;if(typeof f.width=="string"){const b=parseInt(f.width.replace(/px$/i,""),10);if(!Number.isNaN(b)&&b>0)return b}return ba}function ks(){if(!n.resizableColumnsWidth)return;const f=Pt.value;let b={};if(n.resizableColumnsWidthStorageKey)try{const g=localStorage.getItem(n.resizableColumnsWidthStorageKey);g&&(b={...JSON.parse(g)})}catch{}f.forEach(g=>{(b[g.name]==null||b[g.name]<Dn)&&(b[g.name]=Es(g))}),o.value=b}r.watch(()=>[$n.value,n.resizableColumnsWidth],()=>{n.resizableColumnsWidth&&ks()});function xs(f){const b=o.value[f.name];return b!=null&&b>=Dn?b:Es(f)}function Nc(f,b){l.value=b.name,a=f.clientX,c=xs(b),p=g=>{const U=g.clientX-a,v=Math.max(Dn,c+U);o.value={...o.value,[b.name]:v}},u=()=>{if(document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",u),document.body.style.userSelect="",n.resizableColumnsWidthStorageKey)try{localStorage.setItem(n.resizableColumnsWidthStorageKey,JSON.stringify(o.value))}catch{}i.value=!0,l.value=null,p=null,u=null,setTimeout(()=>{i.value=!1},100)},document.body.style.userSelect="none",document.addEventListener("mousemove",p),document.addEventListener("mouseup",u)}const Sc=(f="text")=>zt[f.toLowerCase()]||zt.text,je=r.ref({});async function Cc(f){const{data:b,api:g}=$n.value.find(U=>U.name===f);if(je.value[f])return je.value[f];if(b||g){const U=g||`/api/suggest/${b}?json=1`,M=await(await fetch(U)).json();M.data&&Array.isArray(M.data)&&(je.value[f]=M.data.map(ee=>({value:ee.id??ee.value,label:ee.text??ee.label})))}return je.value[f]}function _c(f,b,g,U){const v=U;v!==-1&&(n.rows[v]={...n.rows[v],[b]:g}),d("cell-update",f,b,g)}function ws(f){return Pn(f,ys.value)}function Tc(f){return pt(f,ys.value)}const Mn=r.ref(null),Ns=r.ref({top:"0px",left:"0px"});function Bc(f,b){const g=f.currentTarget.getBoundingClientRect();Mn.value=b,Ns.value={top:`${g.bottom+4}px`,left:`${Math.min(g.left,window.innerWidth-230)}px`}}function Dc(){Mn.value=null}return r.watch(()=>n.form,async f=>{f&&(je.value={})}),r.onMounted(()=>{n.form&&(je.value={})}),(f,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["w-full",ae.value.container])},[_.value||n.loading?(r.openBlock(),r.createElementBlock("div",ea,[r.createElementVNode("div",ta,[b[1]||(b[1]=r.createElementVNode("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"},null,-1)),r.createElementVNode("span",{class:r.normalizeClass(ae.value.loading)},"Loading...",2)])])):S.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["text-center py-8",ae.value.error])},r.toDisplayString(S.value),3)):n.loading?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",na,[r.createElementVNode("div",{class:r.normalizeClass(e.classWrapper?e.classWrapper:"relative w-full overflow-auto")},[r.createElementVNode("table",{class:r.normalizeClass(e.classTable),style:r.normalizeStyle([e.tableStyle,n.resizableColumnsWidth?"table-layout: fixed":""])},[n.resizableColumnsWidth?(r.openBlock(),r.createElementBlock("colgroup",ra,[e.selectable?(r.openBlock(),r.createElementBlock("col",sa)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,g=>(r.openBlock(),r.createElementBlock("col",{key:g.name,style:r.normalizeStyle({width:xs(g)+"px"})},null,4))),128)),z.value?(r.openBlock(),r.createElementBlock("col",oa)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("thead",{class:r.normalizeClass(e.classThead||ae.value.thead)},[r.createElementVNode("tr",null,[e.selectable?(r.openBlock(),r.createElementBlock("th",{key:0,class:r.normalizeClass(["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header,n.classTh,"w-12"])},[r.createElementVNode("input",{type:"checkbox",checked:R.value,indeterminate:L.value,onChange:O,class:r.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",ae.value.checkbox])},null,42,ia)],2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,g=>(r.openBlock(),r.createElementBlock("th",{key:g.name,class:r.normalizeClass([n.resizableColumnsWidth?"relative":"",g.align?`text-${g.align}`:"",x(g)?["cursor-pointer",ae.value.thHover]:"",n.resizableColumnsWidth?"":le(g)].concat(n.classTh||["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header])),onClick:U=>x(g)?j(g.name,U):void 0},[r.createElementVNode("div",aa,[r.createElementVNode("div",ca,[r.createElementVNode("span",null,r.toDisplayString(Tc(g)),1),ws(g)?(r.openBlock(),r.createElementBlock("div",da,[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-gray-400 cursor-help",onMouseenter:U=>Bc(U,g.name),onMouseleave:Dc},[...b[2]||(b[2]=[r.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),r.createElementVNode("path",{d:"M12 16v-4"},null,-1),r.createElementVNode("path",{d:"M12 8h.01"},null,-1)])],40,fa)),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[Mn.value===g.name?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(Ns.value),class:"fixed z-[9999] w-56 p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-200"},r.toDisplayString(ws(g)),5)):r.createCommentVNode("",!0)]))])):r.createCommentVNode("",!0)]),x(g)?(r.openBlock(),r.createElementBlock("span",pa,[r.renderSlot(f.$slots,"sort",{asc:q(g.name)},()=>[r.createTextVNode(r.toDisplayString(k(g.name)),1)])])):r.createCommentVNode("",!0)]),n.resizableColumnsWidth&&!g.action?(r.openBlock(),r.createElementBlock("div",{key:0,class:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400/30",onMousedown:r.withModifiers(U=>Nc(U,g),["prevent"]),onClick:b[0]||(b[0]=r.withModifiers(()=>{},["stop","prevent"]))},null,40,ua)):r.createCommentVNode("",!0)],10,la))),128)),z.value?(r.openBlock(),r.createElementBlock("th",{key:1,class:r.normalizeClass(["w-[100px]",n.classTh||["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header]])},r.toDisplayString(r.unref(wc)("table.actions")),3)):r.createCommentVNode("",!0)])],2),J.value.length?(r.openBlock(),r.createElementBlock("tbody",{key:1,class:r.normalizeClass(e.classTbody||ae.value.tbody)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(J.value,(g,U)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:U},[r.createElementVNode("tr",{class:r.normalizeClass(n.classTr||[ae.value.tr,n.clickable?"cursor-pointer":""]),onClick:v=>n.clickable?C(g):void 0},[e.selectable?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(["whitespace-nowrap",ae.value.td,at.value.cell,n.classTd,"w-12"])},[r.createElementVNode("input",{type:"checkbox",checked:A(g),onChange:v=>N(g),class:r.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",ae.value.checkbox])},null,42,ma)],2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,v=>r.withDirectives((r.openBlock(),r.createElementBlock("td",{key:v.name,class:r.normalizeClass(xc(v))},[(r.openBlock(),r.createBlock(Zl,{"class-content":n.classContent,key:g,editable:v.edit,row:g,column:v,value:g[v.name],format:v.format,options:je.value[v.name]||[],color:e.color,overflow:Te(v),onUpdate:(M,ee,Xe)=>_c(M,ee,Xe,U),"fetch-options":Cc},{default:r.withCtx(()=>[v.action&&H.value?r.renderSlot(f.$slots,"action",{key:0,row:g}):r.unref(D).number&&v.format==="number"?r.renderSlot(f.$slots,"number",{key:1,row:g,value:V(v,g)}):r.unref(D).badge&&v.format==="badge"?r.renderSlot(f.$slots,"badge",{key:2,row:g,value:V(v,g)}):r.unref(D).array&&v.format==="array"?r.renderSlot(f.$slots,"array",{key:3,row:g,value:V(v,g)}):r.unref(D)[v.format]?r.renderSlot(f.$slots,v.format,{key:4,row:g,value:V(v,g),column:v}):v.slotName&&Lt.value[v.name]?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(Lt.value[v.name]),{key:5,data:g,value:V(v,g),row:g,column:v},null,8,["data","value","row","column"])):v.link?(r.openBlock(),r.createElementBlock("a",{key:6,class:r.normalizeClass(e.classLink||"hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),onClick:M=>Q(v.link.replace("{id}",g.id))},[v.slot&&typeof v.slot=="string"?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(os)(v.slot)),{key:0,row:g,value:g,data:g,column:v},null,8,["row","value","data","column"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(V(v,g)),1)],64))],10,ga)):v.slot&&v.format==="slot"&&typeof v.slot=="string"?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(os)(v.slot)),{key:7,row:g,value:V(v,g),data:g,column:v},null,8,["row","value","data","column"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(Sc(v.format)),{key:8,value:V(v,g),row:g,column:v,href:v.link},null,8,["value","row","column","href"]))]),_:2},1032,["class-content","editable","row","column","value","format","options","color","overflow","onUpdate"]))],2)),[[r.unref(s),xe(g,v)]])),128)),z.value?(r.openBlock(),r.createElementBlock("td",va,[r.renderSlot(f.$slots,"action",{row:g})])):r.createCommentVNode("",!0)],10,ha),r.createElementVNode("tr",null,[r.renderSlot(f.$slots,"under-row",{row:g})])],64))),128))],2)):r.createCommentVNode("",!0),J.value.length===0?(r.openBlock(),r.createElementBlock("tbody",{key:2,class:r.normalizeClass(["text-center py-8",ae.value.empty])},[r.createElementVNode("tr",null,[r.createElementVNode("td",{colspan:bs.value.length},[r.createVNode(Cl)],8,ya)])],2)):r.createCommentVNode("",!0)],6)],2)])),kc.value&&!_.value&&!n.loading&&!S.value?(r.openBlock(),r.createBlock(jt,{key:3,page:ms.value,limit:gs.value,total:vs.value,theme:n.theme,size:n.size,"onUpdate:page":Ec},null,8,["page","limit","total","theme","size"])):r.createCommentVNode("",!0)],2))}}),Ea={style:{display:"none"}},ds=r.defineComponent({name:"Column",__name:"Column",props:{field:{},name:{},header:{},label:{},format:{},hidden:{type:Boolean},sortable:{type:Boolean},width:{},align:{},slot:{},slotName:{},link:{},action:{type:Boolean},getCellData:{type:Function},suffix:{},tooltip:{type:Boolean},overflow:{}},setup(e){const t=e,n=r.useSlots(),s=r.inject("registerColumn");return r.onMounted(()=>{if(s){const{field:o,name:l,header:i,label:a,format:c,slotName:p,link:u,action:d,getCellData:h,suffix:m,...y}=t,B={name:o||l||"",ua:i||a||"",format:c||"text",slotName:p||(n.body?"body":void 0),link:u,action:d,getCellData:h,suffix:m,...y};console.log("Registering column:",B);const D=n.body;s(B,D)}}),(o,l)=>(r.openBlock(),r.createElementBlock("div",Ea,[r.renderSlot(o.$slots,"body",{data:{}})]))}}),ka={class:"mt-4"},xa={class:"text-sm text-gray-600 dark:text-gray-300"},fs=r.defineComponent({__name:"SelectionInfo",props:{selectedRows:{},totalCount:{}},setup(e){const t=e,n=r.computed(()=>t.selectedRows.length);return(s,o)=>(r.openBlock(),r.createElementBlock("div",ka,[r.createElementVNode("div",xa," Обрано: "+r.toDisplayString(n.value)+" з "+r.toDisplayString(e.totalCount)+" записів ",1)]))}}),wa={class:"mt-4"},Na={class:"border-b border-gray-200 dark:border-gray-700"},Sa={class:"-mb-px flex space-x-8"},Ca=["onClick"],_a={class:"mt-4"},Ta={class:"bg-gray-900 rounded-lg overflow-hidden"},Ba={class:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700"},Da={class:"text-sm text-gray-300"},Oa=["onClick"],Ia={class:"p-4 text-sm text-gray-100 overflow-x-auto"},ps=r.defineComponent({__name:"CodeTabs",props:{tabs:{},defaultTab:{default:void 0}},setup(e){const t=e,n=r.ref(t.defaultTab||t.tabs[0]?.id||""),s=async o=>{try{await navigator.clipboard.writeText(o),console.log("Код скопійовано!")}catch(l){console.error("Помилка копіювання:",l)}};return(o,l)=>(r.openBlock(),r.createElementBlock("div",wa,[r.createElementVNode("div",Na,[r.createElementVNode("nav",Sa,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.tabs,i=>(r.openBlock(),r.createElementBlock("button",{key:i.id,onClick:a=>n.value=i.id,class:r.normalizeClass(["py-2 px-1 border-b-2 font-medium text-sm transition-colors",n.value===i.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"])},r.toDisplayString(i.label),11,Ca))),128))])]),r.createElementVNode("div",_a,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.tabs,i=>r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:i.id},[r.createElementVNode("div",Ta,[r.createElementVNode("div",Ba,[r.createElementVNode("span",Da,r.toDisplayString(i.label),1),r.createElementVNode("button",{onClick:a=>s(i.content),class:"text-gray-400 hover:text-white transition-colors",title:"Копіювати код"},[...l[0]||(l[0]=[r.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])],8,Oa)]),r.createElementVNode("pre",Ia,[r.createElementVNode("code",null,r.toDisplayString(i.content),1)])])])),[[r.vShow,n.value===i.id]])),128))])]))}}),Aa={key:0,class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},$a={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl md:w-5/12 w-9/12"},Ma={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Ra={class:"font-medium text-gray-800 dark:text-[#ffffff]"},La={class:"sr-only"},Pa={class:"ui-dialog__content p-4 overflow-y-auto flex-1"},Fa={class:"p-4"},za={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},ja={class:"text-sm font-[600] text-gray-500"},Ua={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},Ha={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Wa={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},qa={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Ka={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Ga={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Ja={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Xa={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Ya={class:"flex items-center [&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0"},Za={class:"flex items-center gap-[4px]"},Qa=["id","value"],Va=["for"],ec={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",height:"12",width:"12"},tc={class:"text-[13px] text-gray-500 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},nc={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},rc={class:"text-sm font-[600] text-gray-500"},sc={class:"mt-2 space-y-2"},oc={class:"flex items-center"},ic={for:"json",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},lc={class:"flex items-center"},ac={for:"csv",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},cc={class:"flex items-center"},dc={for:"xlsx",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},fc={key:0,class:"p-3 border rounded-md bg-gray-50 text-sm text-gray-700 whitespace-pre-line mb-4 dark:bg-neutral-800 dark:text-neutral-200"},pc={class:"flex items-center gap-2 mb-2"},uc={class:"flex justify-end gap-x-2"},hc={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},mc=["disabled"],gc={key:0,class:"fixed inset-0 z-[90] flex items-center justify-center bg-black/60"},vc={class:"rounded-lg bg-white p-6 text-center shadow-xl dark:bg-neutral-900 w-[320px]"},yc={class:"text-sm font-medium text-gray-700 dark:text-neutral-200"},bc={class:"mt-2 text-xs text-gray-500 whitespace-pre-line dark:text-neutral-400"},us=r.defineComponent({__name:"Export",props:{table:{},columns:{},filter:{}},setup(e){const t=r.getCurrentInstance(),n=dt(),s=e;function o(k){return Array.isArray(k)?k.join(","):String(k)}const l=r.computed(()=>{const k=s.filter??{};return Object.entries(k).filter(([,x])=>Array.isArray(x)?x.length>0:!!x).map(([x,C])=>`${x}=${o(C)}`).join("|")}),i=r.ref(!1),a=r.ref([]),c=r.ref("json"),p=r.ref(!1),u=r.ref(!1),d=r.ref(""),h=r.ref(!1),m=r.ref("all"),y=r.computed(()=>s.columns??[]),E=r.computed(()=>y.value.filter(k=>k.export!==!1)),_=r.useAttrs();function S(){const k=E.value;a.value=k.map(x=>x.name),m.value=k.length?"all":"none",c.value="json",i.value=!0,h.value=!1}function B(){i.value=!1,h.value=!1}function D(){const k=E.value;a.value=k.map(x=>x.name),m.value=k.length?"all":"none"}function H(){const k=E.value,x=k.filter(w=>!w.hidden).map(w=>w.name),C=x.length?x:k.map(w=>w.name);a.value=C,m.value=C.length?"active":"none"}function z(){a.value=[],m.value="none"}async function Q(){const k=a.value.filter(C=>E.value.some(w=>w.name===C));if(k.length===0)return;p.value=!0,d.value="",u.value=!1;const x=new URLSearchParams({table:s.table,format:c.value,columns:k.join(",")});l.value&&x.set("filter",l.value);try{const C=await fetch(`/api/export?${x.toString()}`,{method:"GET",headers:{Accept:"text/event-stream, */*"}});if(!C.ok)throw new Error("Export failed");if(C.headers.get("content-type")?.includes("text/event-stream")){if(B(),u.value=!0,h.value=!0,!await j(C,$=>{d.value=$}))throw new Error("Failed to process streamed export");d.value=n("table.preparingDownload"),await L(x),u.value=!1,h.value=!1}else await R(C),B()}catch(C){console.error(C);const{$notify:w=console.log}=t?.appContext?.config?.globalProperties||{};w({type:"error",title:"Помилка",message:"Не вдалося єкспортувати файл"}),u.value=!1,h.value=!1}finally{p.value=!1}}const J=ut(),A=k=>pt(k,J.value);function N(k,x){const C=URL.createObjectURL(k),w=document.createElement("a");w.href=C,w.download=x||`${s.table}.${c.value}`,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(C)}async function R(k){const x=await k.blob();N(x,`${s.table}.${c.value}`)}async function L(k){const x=await fetch(`/api/export?${k.toString()}`,{method:"GET",headers:{Accept:"*/*"}});if(!x.ok)throw new Error("Export failed");await R(x)}function O(k){return k.split(/\r?\n/).reduce((x,C)=>{const[w,...T]=C.split(":");if(!w)return x;const $=T.join(":").trimStart();return w==="event"&&(x.event=$),w==="data"&&(x.data=(x.data?`${x.data}
|
|
9
|
+
`,-1)}ci(e.hoists,t),l(),o("return ")}function xn(e,t,{helper:n,push:s,newline:o,isTS:l}){const i=n(t==="filter"?en:t==="component"?Zt:Vt);for(let a=0;a<e.length;a++){let c=e[a];const p=c.endsWith("__self");p&&(c=c.slice(0,-6)),s(`const ${st(c,t)} = ${i}(${JSON.stringify(c)}${p?", true":""})${l?"!":""}`),a<e.length-1&&o()}}function ci(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:s}=t;s();for(let o=0;o<e.length;o++){const l=e[o];l&&(n(`const _hoisted_${o+1} = `),ie(l,t),s())}t.pure=!1}function di(e){return ne(e)||e.type===4||e.type===2||e.type===5||e.type===8}function wn(e,t){const n=e.length>3||process.env.NODE_ENV!=="production"&&e.some(s=>Se(s)||!di(s));t.push("["),n&&t.indent(),it(e,t,n),n&&t.deindent(),t.push("]")}function it(e,t,n=!1,s=!0){const{push:o,newline:l}=t;for(let i=0;i<e.length;i++){const a=e[i];ne(a)?o(a,-3):Se(a)?wn(a,t):ie(a,t),i<e.length-1&&(n?(s&&o(","),l()):s&&o(", "))}}function ie(e,t){if(ne(e)){t.push(e,-3);return}if(Wt(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&dr(e.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),ie(e.codegenNode,t);break;case 2:fi(e,t);break;case 4:Tr(e,t);break;case 5:pi(e,t);break;case 12:ie(e.codegenNode,t);break;case 8:Br(e,t);break;case 3:hi(e,t);break;case 13:mi(e,t);break;case 14:vi(e,t);break;case 15:yi(e,t);break;case 17:bi(e,t);break;case 18:Ei(e,t);break;case 19:ki(e,t);break;case 20:xi(e,t);break;case 21:it(e.body,t,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return dr(!1,`unhandled codegen node type: ${e.type}`),e}}function fi(e,t){t.push(JSON.stringify(e.content),-3,e)}function Tr(e,t){const{content:n,isStatic:s}=e;t.push(s?JSON.stringify(n):n,-3,e)}function pi(e,t){const{push:n,helper:s,pure:o}=t;o&&n(Bt),n(`${s(gt)}(`),ie(e.content,t),n(")")}function Br(e,t){for(let n=0;n<e.children.length;n++){const s=e.children[n];ne(s)?t.push(s,-3):ie(s,t)}}function ui(e,t){const{push:n}=t;if(e.type===8)n("["),Br(e,t),n("]");else if(e.isStatic){const s=mn(e.content)?e.content:JSON.stringify(e.content);n(s,-2,e)}else n(`[${e.content}]`,-3,e)}function hi(e,t){const{push:n,helper:s,pure:o}=t;o&&n(Bt),n(`${s(Ve)}(${JSON.stringify(e.content)})`,-3,e)}function mi(e,t){const{push:n,helper:s,pure:o}=t,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:p,directives:u,isBlock:d,disableTracking:h,isComponent:m}=e;let y;if(c)if(process.env.NODE_ENV!=="production")if(c<0)y=c+` /* ${Ye[c]} */`;else{const _=Object.keys(Ye).map(Number).filter(S=>S>0&&c&S).map(S=>Ye[S]).join(", ");y=c+` /* ${_} */`}else y=String(c);u&&n(s(tn)+"("),d&&n(`(${s(Me)}(${h?"true":""}), `),o&&n(Bt);const E=d?qe(t.inSSR,m):We(t.inSSR,m);n(s(E)+"(",-2,e),it(gi([l,i,a,y,p]),t),n(")"),d&&n(")"),u&&(n(", "),ie(u,t),n(")"))}function gi(e){let t=e.length;for(;t--&&e[t]==null;);return e.slice(0,t+1).map(n=>n||"null")}function vi(e,t){const{push:n,helper:s,pure:o}=t,l=ne(e.callee)?e.callee:s(e.callee);o&&n(Bt),n(l+"(",-2,e),it(e.arguments,t),n(")")}function yi(e,t){const{push:n,indent:s,deindent:o,newline:l}=t,{properties:i}=e;if(!i.length){n("{}",-2,e);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);n(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:p,value:u}=i[c];ui(p,t),n(": "),ie(u,t),c<i.length-1&&(n(","),l())}a&&o(),n(a?"}":" }")}function bi(e,t){wn(e.elements,t)}function Ei(e,t){const{push:n,indent:s,deindent:o}=t,{params:l,returns:i,body:a,newline:c,isSlot:p}=e;p&&n(`_${Ue[cn]}(`),n("(",-2,e),Se(l)?it(l,t):l&&ie(l,t),n(") => "),(c||a)&&(n("{"),s()),i?(c&&n("return "),Se(i)?wn(i,t):ie(i,t)):a&&ie(a,t),(c||a)&&(o(),n("}")),p&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}function ki(e,t){const{test:n,consequent:s,alternate:o,newline:l}=e,{push:i,indent:a,deindent:c,newline:p}=t;if(n.type===4){const d=!mn(n.content);d&&i("("),Tr(n,t),d&&i(")")}else i("("),ie(n,t),i(")");l&&a(),t.indentLevel++,l||i(" "),i("? "),ie(s,t),t.indentLevel--,l&&p(),l||i(" "),i(": ");const u=o.type===19;u||t.indentLevel++,ie(o,t),u||t.indentLevel--,l&&c(!0)}function xi(e,t){const{push:n,helper:s,indent:o,deindent:l,newline:i}=t,{needPauseTracking:a,needArraySpread:c}=e;c&&n("[...("),n(`_cache[${e.index}] || (`),a&&(o(),n(`${s(yt)}(-1`),e.inVOnce&&n(", true"),n("),"),i(),n("(")),n(`_cache[${e.index}] = `),ie(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),i(),n(`${s(yt)}(1),`),i(),n(`_cache[${e.index}]`),l()),n(")"),c&&n(")]")}const wi=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Ni=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Fe(e,t,n=!1,s=!1){const o=e.content;if(o.trim())try{new Function(s?` ${o} `:`return ${n?`(${o}) => {}`:`(${o})`}`)}catch(l){let i=l.message;const a=o.replace(Ni,"").match(wi);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),t.onError(W(46,e.loc,void 0,i))}}const Si=(e,t)=>{if(e.type===5)e.content=Nn(e.content,t);else if(e.type===1){const n=de(e,"memo");for(let s=0;s<e.props.length;s++){const o=e.props[s];if(o.type===7&&o.name!=="for"){const l=o.exp,i=o.arg;l&&l.type===4&&!(o.name==="on"&&i)&&!(n&&i&&i.type===4&&i.content==="key")&&(o.exp=Nn(l,t,o.name==="slot")),i&&i.type===4&&!i.isStatic&&(o.arg=Nn(i,t))}}}};function Nn(e,t,n=!1,s=!1,o=Object.create(t.identifiers)){return process.env.NODE_ENV!=="production"&&Fe(e,t,n,s),e}const Ci=Cr(/^(?:if|else|else-if)$/,(e,t,n)=>_i(e,t,n,(s,o,l)=>{const i=n.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const p=i[a];p&&p.type===9&&(c+=p.branches.length)}return()=>{if(l)s.codegenNode=Or(o,c,n);else{const p=Bi(s.codegenNode);p.alternate=Or(o,c+s.branches.length-1,n)}}}));function _i(e,t,n,s){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const o=t.exp?t.exp.loc:e.loc;n.onError(W(28,t.loc)),t.exp=I("true",!1,o)}if(process.env.NODE_ENV!=="production"&&t.exp&&Fe(t.exp,n),t.name==="if"){const o=Dr(e,t),l={type:9,loc:Yo(e.loc),branches:[o]};if(n.replaceNode(l),s)return s(l,o,!0)}else{const o=n.parent.children,l=[];let i=o.indexOf(e);for(;i-->=-1;){const a=o[i];if(a&&yn(a)){n.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&l.unshift(a);continue}if(a&&a.type===9){(t.name==="else-if"||t.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&n.onError(W(30,e.loc)),n.removeNode();const c=Dr(e,t);if(process.env.NODE_ENV!=="production"&&l.length&&!(n.parent&&n.parent.type===1&&(n.parent.tag==="transition"||n.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&a.branches.forEach(({userKey:d})=>{Ti(d,u)&&n.onError(W(29,c.userKey.loc))})}a.branches.push(c);const p=s&&s(a,c,!1);Tt(c,n),p&&p(),n.currentNode=null}else n.onError(W(30,e.loc));break}}}function Dr(e,t){const n=e.tagType===3;return{type:10,loc:e.loc,condition:t.name==="else"?void 0:t.exp,children:n&&!de(e,"for")?e.children:[e],userKey:rt(e,"key"),isTemplateIf:n}}function Or(e,t,n){return e.condition?fn(e.condition,Ir(e,t,n),te(n.helper(Ve),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Ir(e,t,n)}function Ir(e,t,n){const{helper:s}=n,o=Z("key",I(`${t}`,!1,he,2)),{children:l}=e,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return wt(c,o,n),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!e.isTemplateIf&&l.filter(p=>p.type!==3).length===1&&(c|=2048),nt(n,s(Ze),ve([o]),l,c,void 0,void 0,!0,!1,!1,e.loc)}else{const c=i.codegenNode,p=zo(c);return p.type===13&&pn(p,n),wt(p,o,n),c}}function Ti(e,t){if(!e||e.type!==t.type)return!1;if(e.type===6){if(e.value.content!==t.value.content)return!1}else{const n=e.exp,s=t.exp;if(n.type!==s.type||n.type!==4||n.isStatic!==s.isStatic||n.content!==s.content)return!1}return!0}function Bi(e){for(;;)if(e.type===19)if(e.alternate.type===19)e=e.alternate;else return e;else e.type===20&&(e=e.value)}const Di=Cr("for",(e,t,n)=>{const{helper:s,removeHelper:o}=n;return Oi(e,t,n,l=>{const i=te(s(nn),[l.source]),a=kt(e),c=de(e,"memo"),p=rt(e,"key",!1,!0);p&&p.type;let u=p&&(p.type===6?p.value?I(p.value.content,!0):void 0:p.exp);const d=p&&u?Z("key",u):null,h=l.source.type===4&&l.source.constType>0,m=h?64:p?128:256;return l.codegenNode=nt(n,s(Ze),void 0,i,m,void 0,void 0,!0,!h,!1,e.loc),()=>{let y;const{children:E}=l;process.env.NODE_ENV!=="production"&&a&&e.children.some(B=>{if(B.type===1){const D=rt(B,"key");if(D)return n.onError(W(33,D.loc)),!0}});const _=E.length!==1||E[0].type!==1,S=xt(e)?e:a&&e.children.length===1&&xt(e.children[0])?e.children[0]:null;if(S?(y=S.codegenNode,a&&d&&wt(y,d,n)):_?y=nt(n,s(Ze),d?ve([d]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(y=E[0].codegenNode,a&&d&&wt(y,d,n),y.isBlock!==!h&&(y.isBlock?(o(Me),o(qe(n.inSSR,y.isComponent))):o(We(n.inSSR,y.isComponent))),y.isBlock=!h,y.isBlock?(s(Me),s(qe(n.inSSR,y.isComponent))):s(We(n.inSSR,y.isComponent))),c){const B=He(Sn(l.parseResult,[I("_cached")]));B.body=To([be(["const _memo = (",c.exp,")"]),be(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(tr)}(_cached, _memo)) return _cached`]),be(["const _item = ",y]),I("_item.memo = _memo"),I("return _item")]),i.arguments.push(B,I("_cache"),I(String(n.cached.length))),n.cached.push(null)}else i.arguments.push(He(Sn(l.parseResult),y,!0))}})});function Oi(e,t,n,s){if(!t.exp){n.onError(W(31,t.loc));return}const o=t.forParseResult;if(!o){n.onError(W(32,t.loc));return}Ar(o,n);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=n,{source:c,value:p,key:u,index:d}=o,h={type:11,loc:t.loc,source:c,valueAlias:p,keyAlias:u,objectIndexAlias:d,parseResult:o,children:kt(e)?e.children:[e]};n.replaceNode(h),a.vFor++;const m=s&&s(h);return()=>{a.vFor--,m&&m()}}function Ar(e,t){e.finalized||(process.env.NODE_ENV!=="production"&&(Fe(e.source,t),e.key&&Fe(e.key,t,!0),e.index&&Fe(e.index,t,!0),e.value&&Fe(e.value,t,!0)),e.finalized=!0)}function Sn({value:e,key:t,index:n},s=[]){return Ii([e,t,n,...s])}function Ii(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((n,s)=>n||I("_".repeat(s+1),!1))}const $r=I("undefined",!1),Ai=(e,t)=>{if(e.type===1&&(e.tagType===1||e.tagType===3)){const n=de(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},$i=(e,t,n,s)=>He(e,n,!1,!0,n.length?n[0].loc:s);function Mi(e,t,n=$i){t.helper(cn);const{children:s,loc:o}=e,l=[],i=[];let a=t.scopes.vSlot>0||t.scopes.vFor>0;const c=de(e,"slot",!0);if(c){const{arg:_,exp:S}=c;_&&!ce(_)&&(a=!0),l.push(Z(_||I("default",!0),n(S,void 0,s,o)))}let p=!1,u=!1;const d=[],h=new Set;let m=0;for(let _=0;_<s.length;_++){const S=s[_];let B;if(!kt(S)||!(B=de(S,"slot",!0))){S.type!==3&&d.push(S);continue}if(c){t.onError(W(37,B.loc));break}p=!0;const{children:D,loc:H}=S,{arg:z=I("default",!0),exp:Q,loc:J}=B;let A;ce(z)?A=z?z.content:"default":a=!0;const N=de(S,"for"),R=n(Q,N,D,H);let L,O;if(L=de(S,"if"))a=!0,i.push(fn(L.exp,Dt(z,R,m++),$r));else if(O=de(S,/^else(?:-if)?$/,!0)){let j=_,q;for(;j--&&(q=s[j],!!yn(q)););if(q&&kt(q)&&de(q,/^(?:else-)?if$/)){let k=i[i.length-1];for(;k.alternate.type===19;)k=k.alternate;k.alternate=O.exp?fn(O.exp,Dt(z,R,m++),$r):Dt(z,R,m++)}else t.onError(W(30,O.loc))}else if(N){a=!0;const j=N.forParseResult;j?(Ar(j,t),i.push(te(t.helper(nn),[j.source,He(Sn(j),Dt(z,R),!0)]))):t.onError(W(32,N.loc))}else{if(A){if(h.has(A)){t.onError(W(38,J));continue}h.add(A),A==="default"&&(u=!0)}l.push(Z(z,R))}}if(!c){const _=(S,B)=>{const D=n(S,void 0,B,o);return t.compatConfig&&(D.isNonScopedSlot=!0),Z("default",D)};p?d.length&&!d.every(vn)&&(u?t.onError(W(39,d[0].loc)):l.push(_(void 0,d))):l.push(_(void 0,s))}const y=a?2:Ot(e.children)?3:1;let E=ve(l.concat(Z("_",I(y+(process.env.NODE_ENV!=="production"?` /* ${io[y]} */`:""),!1))),o);return i.length&&(E=te(t.helper(er),[E,Re(i)])),{slots:E,hasDynamicSlots:a}}function Dt(e,t,n){const s=[Z("name",e),Z("fn",t)];return n!=null&&s.push(Z("key",I(String(n),!0))),ve(s)}function Ot(e){for(let t=0;t<e.length;t++){const n=e[t];switch(n.type){case 1:if(n.tagType===2||Ot(n.children))return!0;break;case 9:if(Ot(n.branches))return!0;break;case 10:case 11:if(Ot(n.children))return!0;break}}return!1}const Mr=new WeakMap,Ri=(e,t)=>function(){if(e=t.currentNode,!(e.type===1&&(e.tagType===0||e.tagType===1)))return;const{tag:s,props:o}=e,l=e.tagType===1;let i=l?Li(e,t):`"${s}"`;const a=no(i)&&i.callee===Qt;let c,p,u=0,d,h,m,y=a||i===Qe||i===Gt||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(o.length>0){const E=Rr(e,t,void 0,l,a);c=E.props,u=E.patchFlag,h=E.dynamicPropNames;const _=E.directives;m=_&&_.length?Re(_.map(S=>Fi(S,t))):void 0,E.shouldUseBlock&&(y=!0)}if(e.children.length>0)if(i===mt&&(y=!0,u|=1024,process.env.NODE_ENV!=="production"&&e.children.length>1&&t.onError(W(47,{start:e.children[0].loc.start,end:e.children[e.children.length-1].loc.end,source:""}))),l&&i!==Qe&&i!==mt){const{slots:_,hasDynamicSlots:S}=Mi(e,t);p=_,S&&(u|=1024)}else if(e.children.length===1&&i!==Qe){const _=e.children[0],S=_.type,B=S===5||S===8;B&&ge(_,t)===0&&(u|=1),B||S===2?p=_:p=e.children}else p=e.children;h&&h.length&&(d=zi(h)),e.codegenNode=nt(t,i,c,p,u===0?void 0:u,d,m,!!y,!1,l,e.loc)};function Li(e,t,n=!1){let{tag:s}=e;const o=Cn(s),l=rt(e,"is",!1,!0);if(l)if(o||Ie("COMPILER_IS_ON_ELEMENT",t)){let a;if(l.type===6?a=l.value&&I(l.value.content,!0):(a=l.exp,a||(a=I("is",!1,l.arg.loc))),a)return te(t.helper(Qt),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=ir(s)||t.isBuiltInComponent(s);return i?(n||t.helper(i),i):(t.helper(Zt),t.components.add(s),st(s,"component"))}function Rr(e,t,n=e.props,s,o,l=!1){const{tag:i,loc:a,children:c}=e;let p=[];const u=[],d=[],h=c.length>0;let m=!1,y=0,E=!1,_=!1,S=!1,B=!1,D=!1,H=!1;const z=[],Q=R=>{p.length&&(u.push(ve(Lr(p),a)),p=[]),R&&u.push(R)},J=()=>{t.scopes.vFor>0&&p.push(Z(I("ref_for",!0),I("true")))},A=({key:R,value:L})=>{if(ce(R)){const O=R.content,j=Ht(O);if(j&&(!s||o)&&O.toLowerCase()!=="onclick"&&O!=="onUpdate:modelValue"&&!Jn(O)&&(B=!0),j&&Jn(O)&&(H=!0),j&&L.type===14&&(L=L.arguments[0]),L.type===20||(L.type===4||L.type===8)&&ge(L,t)>0)return;O==="ref"?E=!0:O==="class"?_=!0:O==="style"?S=!0:O!=="key"&&!z.includes(O)&&z.push(O),s&&(O==="class"||O==="style")&&!z.includes(O)&&z.push(O)}else D=!0};for(let R=0;R<n.length;R++){const L=n[R];if(L.type===6){const{loc:O,name:j,nameLoc:q,value:k}=L;let x=!0;if(j==="ref"&&(E=!0,J()),j==="is"&&(Cn(i)||k&&k.content.startsWith("vue:")||Ie("COMPILER_IS_ON_ELEMENT",t)))continue;p.push(Z(I(j,!0,q),I(k?k.content:"",x,k?k.loc:O)))}else{const{name:O,arg:j,exp:q,loc:k,modifiers:x}=L,C=O==="bind",w=O==="on";if(O==="slot"){s||t.onError(W(40,k));continue}if(O==="once"||O==="memo"||O==="is"||C&&Ae(j,"is")&&(Cn(i)||Ie("COMPILER_IS_ON_ELEMENT",t))||w&&l)continue;if((C&&Ae(j,"key")||w&&h&&Ae(j,"vue:before-update"))&&(m=!0),C&&Ae(j,"ref")&&J(),!j&&(C||w)){if(D=!0,q)if(C){if(Q(),process.env.NODE_ENV!=="production"&&u.some(V=>V.type===15?V.properties.some(({key:ye})=>ye.type!==4||!ye.isStatic?!0:ye.content!=="class"&&ye.content!=="style"&&!Ht(ye.content)):!0)&&Ke("COMPILER_V_BIND_OBJECT_ORDER",t,k),Ie("COMPILER_V_BIND_OBJECT_ORDER",t)){u.unshift(q);continue}J(),Q(),u.push(q)}else Q({type:14,loc:k,callee:t.helper(on),arguments:s?[q]:[q,"true"]});else t.onError(W(C?34:35,k));continue}C&&x.some($=>$.content==="prop")&&(y|=32);const T=t.directiveTransforms[O];if(T){const{props:$,needRuntime:V}=T(L,e,t);!l&&$.forEach(A),w&&j&&!ce(j)?Q(ve($,a)):p.push(...$),V&&(d.push(L),Wt(V)&&Mr.set(L,V))}else ro(O)||(d.push(L),h&&(m=!0))}}let N;if(u.length?(Q(),u.length>1?N=te(t.helper(vt),u,a):N=u[0]):p.length&&(N=ve(Lr(p),a)),D?y|=16:(_&&!s&&(y|=2),S&&!s&&(y|=4),z.length&&(y|=8),B&&(y|=32)),!m&&(y===0||y===32)&&(E||H||d.length>0)&&(y|=512),!t.inSSR&&N)switch(N.type){case 15:let R=-1,L=-1,O=!1;for(let k=0;k<N.properties.length;k++){const x=N.properties[k].key;ce(x)?x.content==="class"?R=k:x.content==="style"&&(L=k):x.isHandlerKey||(O=!0)}const j=N.properties[R],q=N.properties[L];O?N=te(t.helper(et),[N]):(j&&!ce(j.value)&&(j.value=te(t.helper(rn),[j.value])),q&&(S||q.value.type===4&&q.value.content.trim()[0]==="["||q.value.type===17)&&(q.value=te(t.helper(sn),[q.value])));break;case 14:break;default:N=te(t.helper(et),[te(t.helper(tt),[N])]);break}return{props:N,directives:d,patchFlag:y,dynamicPropNames:z,shouldUseBlock:m}}function Lr(e){const t=new Map,n=[];for(let s=0;s<e.length;s++){const o=e[s];if(o.key.type===8||!o.key.isStatic){n.push(o);continue}const l=o.key.content,i=t.get(l);i?(l==="style"||l==="class"||Ht(l))&&Pi(i,o):(t.set(l,o),n.push(o))}return n}function Pi(e,t){e.value.type===17?e.value.elements.push(t.value):e.value=Re([e.value,t.value],e.loc)}function Fi(e,t){const n=[],s=Mr.get(e);s?n.push(t.helperString(s)):(t.helper(Vt),t.directives.add(e.name),n.push(st(e.name,"directive")));const{loc:o}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const l=I("true",!1,o);n.push(ve(e.modifiers.map(i=>Z(i,l)),o))}return Re(n,e.loc)}function zi(e){let t="[";for(let n=0,s=e.length;n<s;n++)t+=JSON.stringify(e[n]),n<s-1&&(t+=", ");return t+"]"}function Cn(e){return e==="component"||e==="Component"}const ji=(e,t)=>{if(xt(e)){const{children:n,loc:s}=e,{slotName:o,slotProps:l}=Ui(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",o,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),n.length&&(i[3]=He([],n,!1,!1,s),a=4),t.scopeId&&!t.slotted&&(a=5),i.splice(a),e.codegenNode=te(t.helper(Vn),i,s)}};function Ui(e,t){let n='"default"',s;const o=[];for(let l=0;l<e.props.length;l++){const i=e.props[l];if(i.type===6)i.value&&(i.name==="name"?n=JSON.stringify(i.value.content):(i.name=De(i.name),o.push(i)));else if(i.name==="bind"&&Ae(i.arg,"name")){if(i.exp)n=i.exp;else if(i.arg&&i.arg.type===4){const a=De(i.arg.content);n=i.exp=I(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&ce(i.arg)&&(i.arg.content=De(i.arg.content)),o.push(i)}if(o.length>0){const{props:l,directives:i}=Rr(e,t,o,!1,!1);s=l,i.length&&t.onError(W(36,i[0].loc))}return{slotName:n,slotProps:s}}const Pr=(e,t,n,s)=>{const{loc:o,modifiers:l,arg:i}=e;!e.exp&&!l.length&&n.onError(W(35,o));let a;if(i.type===4)if(i.isStatic){let d=i.content;process.env.NODE_ENV!=="production"&&d.startsWith("vnode")&&n.onError(W(52,i.loc)),d.startsWith("vue:")&&(d=`vnode-${d.slice(4)}`);const h=t.tagType!==0||d.startsWith("vnode")||!/[A-Z]/.test(d)?oo(De(d)):`on:${d}`;a=I(h,!0,i.loc)}else a=be([`${n.helperString(an)}(`,i,")"]);else a=i,a.children.unshift(`${n.helperString(an)}(`),a.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let p=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const d=cr(c),h=!(d||Ro(c)),m=c.content.includes(";");process.env.NODE_ENV!=="production"&&Fe(c,n,!1,m),(h||p&&d)&&(c=be([`${h?"$event":"(...args)"} => ${m?"{":"("}`,c,m?"}":")"]))}let u={props:[Z(a,c||I("() => {}",!1,o))]};return s&&(u=s(u)),p&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(d=>d.key.isHandlerKey=!0),u},Hi=(e,t,n)=>{const{modifiers:s,loc:o}=e,l=e.arg;let{exp:i}=e;return i&&i.type===4&&!i.content.trim()&&(i=void 0),l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=De(l.content):l.content=`${n.helperString(ln)}(${l.content})`:(l.children.unshift(`${n.helperString(ln)}(`),l.children.push(")"))),n.inSSR||(s.some(a=>a.content==="prop")&&Fr(l,"."),s.some(a=>a.content==="attr")&&Fr(l,"^")),{props:[Z(l,i)]}},Fr=(e,t)=>{e.type===4?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},Wi=(e,t)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{const n=e.children;let s,o=!1;for(let l=0;l<n.length;l++){const i=n[l];if(gn(i)){o=!0;for(let a=l+1;a<n.length;a++){const c=n[a];if(gn(c))s||(s=n[l]=be([i],i.loc)),s.children.push(" + ",c),n.splice(a,1),a--;else{s=void 0;break}}}}if(!(!o||n.length===1&&(e.type===0||e.type===1&&e.tagType===0&&!e.props.find(l=>l.type===7&&!t.directiveTransforms[l.name])&&e.tag!=="template")))for(let l=0;l<n.length;l++){const i=n[l];if(gn(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!t.ssr&&ge(i,t)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Ye[1]} */`:"")),n[l]={type:12,content:i,loc:i.loc,codegenNode:te(t.helper(Yt),a)}}}}},zr=new WeakSet,qi=(e,t)=>{if(e.type===1&&de(e,"once",!0))return zr.has(e)||t.inVOnce||t.inSSR?void 0:(zr.add(e),t.inVOnce=!0,t.helper(yt),()=>{t.inVOnce=!1;const n=t.currentNode;n.codegenNode&&(n.codegenNode=t.cache(n.codegenNode,!0,!0))})},jr=(e,t,n)=>{const{exp:s,arg:o}=e;if(!s)return n.onError(W(41,e.loc)),lt();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=n.bindingMetadata[l];if(a==="props"||a==="props-aliased")return n.onError(W(44,s.loc)),lt();if(a==="literal-const"||a==="setup-const")return n.onError(W(45,s.loc)),lt();if(!i.trim()||!cr(s))return n.onError(W(42,s.loc)),lt();const c=o||I("modelValue",!0),p=o?ce(o)?`onUpdate:${De(o.content)}`:be(['"onUpdate:" + ',o]):"onUpdate:modelValue";let u;const d=n.isTS?"($event: any)":"$event";u=be([`${d} => ((`,s,") = $event)"]);const h=[Z(c,e.exp),Z(p,u)];if(e.modifiers.length&&t.tagType===1){const m=e.modifiers.map(E=>E.content).map(E=>(mn(E)?E:JSON.stringify(E))+": true").join(", "),y=o?ce(o)?`${o.content}Modifiers`:be([o,' + "Modifiers"']):"modelModifiers";h.push(Z(y,I(`{ ${m} }`,!1,e.loc,2)))}return lt(h)};function lt(e=[]){return{props:e}}const Ki=/[\w).+\-_$\]]/,Gi=(e,t)=>{Ie("COMPILER_FILTERS",t)&&(e.type===5?It(e.content,t):e.type===1&&e.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&It(n.exp,t)}))};function It(e,t){if(e.type===4)Ur(e,t);else for(let n=0;n<e.children.length;n++){const s=e.children[n];typeof s=="object"&&(s.type===4?Ur(s,t):s.type===8?It(e,t):s.type===5&&It(s.content,t))}}function Ur(e,t){const n=e.content;let s=!1,o=!1,l=!1,i=!1,a=0,c=0,p=0,u=0,d,h,m,y,E=[];for(m=0;m<n.length;m++)if(h=d,d=n.charCodeAt(m),s)d===39&&h!==92&&(s=!1);else if(o)d===34&&h!==92&&(o=!1);else if(l)d===96&&h!==92&&(l=!1);else if(i)d===47&&h!==92&&(i=!1);else if(d===124&&n.charCodeAt(m+1)!==124&&n.charCodeAt(m-1)!==124&&!a&&!c&&!p)y===void 0?(u=m+1,y=n.slice(0,m).trim()):_();else{switch(d){case 34:o=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:p++;break;case 41:p--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(d===47){let S=m-1,B;for(;S>=0&&(B=n.charAt(S),B===" ");S--);(!B||!Ki.test(B))&&(i=!0)}}y===void 0?y=n.slice(0,m).trim():u!==0&&_();function _(){E.push(n.slice(u,m).trim()),u=m+1}if(E.length){for(process.env.NODE_ENV!=="production"&&Et("COMPILER_FILTERS",t,e.loc),m=0;m<E.length;m++)y=Ji(y,E[m],t);e.content=y,e.ast=void 0}}function Ji(e,t,n){n.helper(en);const s=t.indexOf("(");if(s<0)return n.filters.add(t),`${st(t,"filter")}(${e})`;{const o=t.slice(0,s),l=t.slice(s+1);return n.filters.add(o),`${st(o,"filter")}(${e}${l!==")"?","+l:l}`}}const Hr=new WeakSet,Xi=(e,t)=>{if(e.type===1){const n=de(e,"memo");return!n||Hr.has(e)||t.inSSR?void 0:(Hr.add(e),()=>{const s=e.codegenNode||t.currentNode.codegenNode;s&&s.type===13&&(e.tagType!==1&&pn(s,t),e.codegenNode=te(t.helper(dn),[n.exp,He(void 0,s),"_cache",String(t.cached.length)]),t.cached.push(null))})}},Yi=(e,t)=>{if(e.type===1){for(const n of e.props)if(n.type===7&&n.name==="bind"&&(!n.exp||n.exp.type===4&&!n.exp.content.trim())&&n.arg){const s=n.arg;if(s.type!==4||!s.isStatic)t.onError(W(53,s.loc)),n.exp=I("",!0,s.loc);else{const o=De(s.content);(lr.test(o[0])||o[0]==="-")&&(n.exp=I(o,!1,s.loc))}}}};function Zi(e){return[[Yi,qi,Ci,Xi,Di,Gi,...process.env.NODE_ENV!=="production"?[Si]:[],ji,Ri,Ai,Wi],{on:Pr,bind:Hi,model:jr}]}function Qi(e,t={}){const n=t.onError||hn,s=t.mode==="module";t.prefixIdentifiers===!0?n(W(48)):s&&n(W(49));const o=!1;t.cacheHandlers&&n(W(50)),t.scopeId&&!s&&n(W(51));const l=Be({},t,{prefixIdentifiers:o}),i=ne(e)?Vo(e,l):e,[a,c]=Zi();return ri(i,Be({},l,{nodeTransforms:[...a,...t.nodeTransforms||[]],directiveTransforms:Be({},c,t.directiveTransforms||{})})),li(i,l)}const Vi=()=>({props:[]});const Wr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),qr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Kr=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Gr=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),_n=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Jr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Xr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Yr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Tn=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Zr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");So({[Wr]:"vModelRadio",[qr]:"vModelCheckbox",[Kr]:"vModelText",[Gr]:"vModelSelect",[_n]:"vModelDynamic",[Jr]:"withModifiers",[Xr]:"withKeys",[Yr]:"vShow",[Tn]:"Transition",[Zr]:"TransitionGroup"});let Ge;function el(e,t=!1){return Ge||(Ge=document.createElement("div")),t?(Ge.innerHTML=`<div foo="${e.replace(/"/g,""")}">`,Ge.children[0].getAttribute("foo")):(Ge.innerHTML=e,Ge.textContent)}const tl={parseMode:"html",isVoidTag:bo,isNativeTag:e=>go(e)||vo(e)||yo(e),isPreTag:e=>e==="pre",isIgnoreNewlineTag:e=>e==="pre"||e==="textarea",decodeEntities:el,isBuiltInComponent:e=>{if(e==="Transition"||e==="transition")return Tn;if(e==="TransitionGroup"||e==="transition-group")return Zr},getNamespace(e,t,n){let s=t?t.ns:n;if(t&&s===2)if(t.tag==="annotation-xml"){if(e==="svg")return 1;t.props.some(o=>o.type===6&&o.name==="encoding"&&o.value!=null&&(o.value.content==="text/html"||o.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&e!=="mglyph"&&e!=="malignmark"&&(s=0);else t&&s===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(s=0);if(s===0){if(e==="svg")return 1;if(e==="math")return 2}return s}},nl=e=>{e.type===1&&e.props.forEach((t,n)=>{t.type===6&&t.name==="style"&&t.value&&(e.props[n]={type:7,name:"bind",arg:I("style",!0,t.loc),exp:rl(t.value.content,t.loc),modifiers:[],loc:t.loc})})},rl=(e,t)=>{const n=fo(e);return I(JSON.stringify(n),!1,t,3)};function Ee(e,t){return W(e,t,process.env.NODE_ENV!=="production"?sl:void 0)}const sl={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},ol=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(54,o)),t.children.length&&(n.onError(Ee(55,o)),t.children.length=0),{props:[Z(I("innerHTML",!0,o),s||I("",!0))]}},il=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(56,o)),t.children.length&&(n.onError(Ee(57,o)),t.children.length=0),{props:[Z(I("textContent",!0),s?ge(s,n)>0?s:te(n.helperString(gt),[s],o):I("",!0))]}},ll=(e,t,n)=>{const s=jr(e,t,n);if(!s.props.length||t.tagType===1)return s;e.arg&&n.onError(Ee(59,e.arg.loc));function o(){const a=de(t,"bind");a&&Ae(a.arg,"value")&&n.onError(Ee(61,a.loc))}const{tag:l}=t,i=n.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Kr,c=!1;if(l==="input"||i){const p=rt(t,"type");if(p){if(p.type===7)a=_n;else if(p.value)switch(p.value.content){case"radio":a=Wr;break;case"checkbox":a=qr;break;case"file":c=!0,n.onError(Ee(60,e.loc));break;default:process.env.NODE_ENV!=="production"&&o();break}}else Lo(t)?a=_n:process.env.NODE_ENV!=="production"&&o()}else l==="select"?a=Gr:process.env.NODE_ENV!=="production"&&o();c||(s.needRuntime=n.helper(a))}else n.onError(Ee(58,e.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},al=ke("passive,once,capture"),cl=ke("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),dl=ke("left,right"),Qr=ke("onkeyup,onkeydown,onkeypress"),fl=(e,t,n,s)=>{const o=[],l=[],i=[];for(let a=0;a<t.length;a++){const c=t[a].content;c==="native"&&Ke("COMPILER_V_ON_NATIVE",n,s)||al(c)?i.push(c):dl(c)?ce(e)?Qr(e.content.toLowerCase())?o.push(c):l.push(c):(o.push(c),l.push(c)):cl(c)?l.push(c):o.push(c)}return{keyModifiers:o,nonKeyModifiers:l,eventOptionModifiers:i}},Vr=(e,t)=>ce(e)&&e.content.toLowerCase()==="onclick"?I(t,!0):e.type!==4?be(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,pl=(e,t,n)=>Pr(e,t,n,s=>{const{modifiers:o}=e;if(!o.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:p}=fl(l,o,n,e.loc);if(c.includes("right")&&(l=Vr(l,"onContextmenu")),c.includes("middle")&&(l=Vr(l,"onMouseup")),c.length&&(i=te(n.helper(Jr),[i,JSON.stringify(c)])),a.length&&(!ce(l)||Qr(l.content.toLowerCase()))&&(i=te(n.helper(Xr),[i,JSON.stringify(a)])),p.length){const u=p.map(Kt).join("");l=ce(l)?I(`${l.content}${u}`,!0):be(["(",l,`) + "${u}"`])}return{props:[Z(l,i)]}}),ul=(e,t,n)=>{const{exp:s,loc:o}=e;return s||n.onError(Ee(62,o)),{props:[],needRuntime:n.helper(Yr)}},hl=(e,t)=>{if(e.type===1&&e.tagType===1&&t.isBuiltInComponent(e.tag)===Tn)return()=>{if(!e.children.length)return;es(e)&&t.onError(Ee(63,{start:e.children[0].loc.start,end:e.children[e.children.length-1].loc.end,source:""}));const s=e.children[0];if(s.type===1)for(const o of s.props)o.type===7&&o.name==="show"&&e.props.push({type:6,name:"persisted",nameLoc:e.loc,value:void 0,loc:e.loc})}};function es(e){const t=e.children=e.children.filter(s=>!yn(s)),n=t[0];return t.length!==1||n.type===11||n.type===9&&n.branches.some(es)}const ml=(e,t)=>{e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style")&&(process.env.NODE_ENV!=="production"&&t.onError(Ee(64,e.loc)),t.removeNode())};function gl(e,t){return e==="template"?!0:e in ts?ts[e].has(t):t in ns?ns[t].has(e):!(e in rs&&rs[e].has(t)||t in ss&&ss[t].has(e))}const Je=new Set(["h1","h2","h3","h4","h5","h6"]),ze=new Set([]),ts={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:ze,iframe:ze,option:ze,textarea:ze,style:ze,title:ze},ns={html:ze,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},rs={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},ss={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Je,h2:Je,h3:Je,h4:Je,h5:Je,h6:Je},vl=(e,t)=>{if(e.type===1&&e.tagType===0&&t.parent&&t.parent.type===1&&t.parent.tagType===0&&!gl(t.parent.tag,e.tag)){const n=new SyntaxError(`<${e.tag}> cannot be child of <${t.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);n.loc=e.loc,t.onWarn(n)}},yl=[nl,...process.env.NODE_ENV!=="production"?[hl,vl]:[]],bl={cloak:Vi,html:ol,text:il,model:ll,on:pl,show:ul};function El(e,t={}){return Qi(e,Be({},tl,t,{nodeTransforms:[ml,...yl,...t.nodeTransforms||[]],directiveTransforms:Be({},bl,t.directiveTransforms||{}),transformHoist:null}))}function kl(e,t){const n=e.trim().startsWith("<")?e:`<span>${e}</span>`,{code:s}=El(n,{mode:"function"}),o=new Function("Vue",`${s}; return render`)(_s);return r.defineComponent({name:"DynamicFromString",props:t?.props??{},emits:t?.emits??[],setup(l,i){return t?.setup?.()??{}},render:o})}const Bn={};function os(e){return Bn[e]||(Bn[e]=kl(e,{props:{row:Object,value:null,data:Object,column:Object}})),Bn[e]}const xl={class:"py-10 flex flex-col justify-center items-center text-center"},wl={class:"max-w-sm mx-auto"},Nl={class:"mt-2 font-medium text-gray-800 dark:text-neutral-200"},Sl={class:"mb-5 text-sm text-gray-500 dark:text-neutral-500"},Cl=r.defineComponent({__name:"nodata",props:{title:{},description:{}},setup(e){const t=dt(),n=e,s=r.computed(()=>n.title??t("table.noData.title")),o=r.computed(()=>n.description??t("table.noData.description"));return(l,i)=>(r.openBlock(),r.createElementBlock("div",xl,[i[0]||(i[0]=r.createStaticVNode('<svg class="w-48 mx-auto mb-4" width="178" height="90" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter19)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter19" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),r.createElementVNode("div",wl,[r.createElementVNode("p",Nl,r.toDisplayString(s.value),1),r.createElementVNode("p",Sl,r.toDisplayString(o.value),1)])]))}}),_l=["aria-checked","data-state"],Tl={key:0,"data-state":"checked","data-slot":"checkbox-indicator",class:"flex items-center justify-center transition-none text-white"},Bl=["onKeydown"],Dl={key:0,class:"hs-dropdown-menu hs-dropdown-open:opacity-100 w-44 transition-[opacity,margin] duration z-11 bg-white rounded-xl shadow-lg dark:bg-neutral-950",role:"menu","aria-orientation":"vertical","aria-labelledby":"hs-pro-inthmtdid1"},Ol={class:"py-2 px-4"},Il={class:"block font-medium text-[13px] text-gray-800 dark:text-neutral-200"},Al={class:"truncate"},$l={class:"p-1 border-t border-gray-200 dark:border-neutral-800"},Ml={class:"space-y-0.5 max-h-48 overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Rl=["onClick"],Ll={key:0,class:"shrink-0 size-3.5 flex justify-center items-center"},Pl={key:1,class:"shrink-0 size-3.5 ms-auto",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fl={key:1,class:"p-4"},zl={class:"text-base font-semibold text-gray-800 mb-3"},jl={class:"mb-4"},Ul={class:"block text-sm font-medium text-gray-700 mb-1"},Hl={key:0,class:"text-xs text-gray-500 mb-2"},Wl=["placeholder"],ql=["placeholder"],Kl=["placeholder"],Gl={disabled:"",value:""},Jl=["value"],Xl={key:0,class:"text-xs text-gray-500"},Yl={class:"flex justify-end gap-2 border-t pt-3"},Zl=r.defineComponent({__name:"EditableCell",props:{row:{},column:{},value:{},format:{},options:{},accent:{},editable:{type:Boolean},color:{},classContent:{},fetchOptions:{type:Function},overflow:{}},emits:["edit","update"],setup(e,{emit:t}){const n=e,s=t,o=r.ref(!1),l=r.ref(null),i=r.ref(null),a=r.ref(n.value),c=r.ref([]),p=r.ref({}),u=ut(),d=r.computed(()=>n.column?.schema?.[n.column?.name]),h=r.computed(()=>pt(n.column||{},u.value)),m=r.computed(()=>Ds(n.column||{},u.value)||""),y=r.computed(()=>Pn(n.column||{},u.value)),E=r.computed(()=>Bs(n.column||{},u.value)),_=r.computed(()=>Ft(d.value,u.value,"placeholder")||m.value||""),S=r.computed(()=>Ft(d.value,u.value,"info")||y.value||null),B=r.computed(()=>Ft(d.value,u.value,"description")||E.value||null),D=r.computed(()=>_.value||"-- виберіть --");r.watch(()=>n.value,w=>{a.value=w});const H=r.computed(()=>{const w=n.column?.schema?.[n.column?.name];if(w?.type)switch(w.type){case"Text":return"text";case"Number":return"number";case"Switcher":return"boolean";case"Autocomplete":return"select";case"Date":return"date";default:return"text"}const $=(n.format||n.column?.format||"text").toLowerCase();return["text","number","date","select","boolean"].includes($)?$:"text"}),z=r.computed(()=>(n.column?.schema?.[n.column?.name]?.options||n.options||c.value||[]).map(T=>({value:T.id??T.value,color:T.color,label:Os(T,u.value)||""}))),Q=r.ref(null);function J(){if(!o.value||!Q.value||!i.value)return;const w=Q.value.getBoundingClientRect(),{left:T,right:$,top:V}=w,ye=window.innerWidth||document.documentElement.clientWidth,xe=window.innerHeight||document.documentElement.clientHeight,le=8;let Te=$+le,we=V;const Ne=i.value.getBoundingClientRect();Te+Ne.width>ye-le&&(Te=T-Ne.width-le),Te=Math.max(le,Math.min(Te,ye-Ne.width-le)),we+Ne.height>xe-le&&(we=xe-Ne.height-le),we=Math.max(le,Math.min(we,xe-Ne.height-le)),p.value={left:`${Math.round(Te)}px`,top:`${Math.round(we)}px`}}function A(){n.editable&&(o.value||document.dispatchEvent(new CustomEvent("close-all-popovers")),o.value=!o.value,o.value&&r.nextTick(()=>{J(),l.value?.focus?.(),l.value?.showPicker?.(),H.value==="select"&&C()}))}function N(){s("edit",n.row,n.column.name,a.value),s("update",n.row,n.column.name,a.value),o.value=!1}function R(){a.value=n.value,o.value=!1}function L(w){if(!o.value)return;const T=w.target;i.value&&i.value.contains(T)||Q.value&&!Q.value.contains(T)&&(o.value=!1)}function O(){o.value=!1}r.onMounted(()=>{document.addEventListener("click",L),document.addEventListener("close-all-popovers",O),window.addEventListener("resize",J),document.addEventListener("scroll",J,!0)}),r.onBeforeUnmount(()=>{document.removeEventListener("click",L),document.removeEventListener("close-all-popovers",O),window.removeEventListener("resize",J),document.removeEventListener("scroll",J,!0)});function j(){n.editable&&(a.value=!a.value,s("update",n.row,n.column.name,a.value))}function q(w){return n.color?n.color.startsWith("#")?w.replace("{c}",`[${n.color}]`):w.replace("{c}",`${n.color}-500`):w.replace("{c}","cyan-500")}const k=r.computed(()=>({border:q("border-{c}"),ring:q("focus:ring-{c}"),text:q("text-{c}"),hover:q("hover:text-{c}"),bg:q("bg-{c} hover:bg-{c}/90")})),x=r.computed(()=>n.overflow==="wrap"?["flex-1","whitespace-normal","break-words"]:["flex-1","truncate","whitespace-nowrap"]);async function C(){if(H.value==="select"&&!(n.options&&n.options.length>0||n.column?.schema?.[n.column?.name]?.options?.length>0)&&c.value.length===0&&n.fetchOptions)try{c.value=await n.fetchOptions(n.column.name)}catch(w){console.error(`Не удалось загрузить options для ${n.column.name}`,w)}}return(w,T)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(e.classContent?e.classContent:"relative group w-full"),ref_key:"cellRef",ref:Q},[H.value==="boolean"&&e.editable?(r.openBlock(),r.createElementBlock("button",{key:0,type:"button",role:"checkbox","aria-checked":a.value?"true":"false","data-state":a.value?"checked":"unchecked",class:r.normalizeClass(["peer size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] h-4 w-4 flex items-center justify-center",a.value?k.value.border:"",k.value.ring,a.value?k.value.bg:""]),onClick:r.withModifiers(j,["stop"])},[a.value?(r.openBlock(),r.createElementBlock("span",Tl,[...T[4]||(T[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-check size-3.5"},[r.createElementVNode("path",{d:"M20 6 9 17l-5-5"})],-1)])])):r.createCommentVNode("",!0)],10,_l)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",{class:"flex items-start justify-between cursor-pointer gap-2",onClick:r.withModifiers(A,["stop"])},[r.createElementVNode("span",{class:r.normalizeClass(x.value)},[r.renderSlot(w.$slots,"default")],2),e.editable?(r.openBlock(),r.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",class:r.normalizeClass(["w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity",k.value.text])},[...T[5]||(T[5]=[r.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L7.5 21H3v-4.5L16.732 3.732z"},null,-1)])],2)):r.createCommentVNode("",!0)]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:i,class:r.normalizeClass(["fixed z-[9999] bg-white border rounded-lg shadow-lg",H.value==="select"?"":"w-[450px]"]),style:r.normalizeStyle(p.value),onKeydown:r.withKeys(r.withModifiers(R,["stop","prevent"]),["esc"])},[H.value==="select"?(r.openBlock(),r.createElementBlock("div",Dl,[r.createElementVNode("div",Ol,[r.createElementVNode("span",Il,[r.createElementVNode("span",Al,r.toDisplayString(h.value),1)])]),r.createElementVNode("div",$l,[r.createElementVNode("div",Ml,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.value,$=>(r.openBlock(),r.createElementBlock("label",{key:$.value.toString(),onClick:r.withModifiers(()=>{a.value=$.value,N()},["prevent"]),class:"py-1.5 px-3 group flex items-center gap-x-3 rounded-lg cursor-pointer text-[13px] text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},[T[8]||(T[8]=r.createElementVNode("input",{type:"radio",class:"hidden",id:"hs-pro-chthuts1op",name:"hs-pro-chthuts1"},null,-1)),$.color?(r.openBlock(),r.createElementBlock("span",Ll,[...T[6]||(T[6]=[r.createElementVNode("span",{class:"shrink-0 size-2 block mx-auto bg-emerald-500 rounded-full"},null,-1)])])):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString($.label)+" ",1),a.value===$.value?(r.openBlock(),r.createElementBlock("svg",Pl,[...T[7]||(T[7]=[r.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])):r.createCommentVNode("",!0)],8,Rl))),128))])])])):(r.openBlock(),r.createElementBlock("div",Fl,[r.createElementVNode("h3",zl," Редагувати "+r.toDisplayString(h.value),1),r.createElementVNode("div",jl,[r.createElementVNode("label",Ul,r.toDisplayString(h.value),1),S.value?(r.openBlock(),r.createElementBlock("p",Hl,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0),H.value==="text"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:1,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[0]||(T[0]=$=>a.value=$),type:"text",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onKeyup:r.withKeys(N,["enter"])},null,42,Wl)),[[r.vModelText,a.value]]):H.value==="number"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[1]||(T[1]=$=>a.value=$),type:"number",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onKeyup:r.withKeys(N,["enter"])},null,42,ql)),[[r.vModelText,a.value,void 0,{number:!0}]]):H.value==="date"?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:3,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[2]||(T[2]=$=>a.value=$),type:"date",class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none border-gray-300",k.value.ring,k.value.border]),placeholder:_.value,onChange:N},null,42,Kl)),[[r.vModelText,a.value]]):H.value==="select"?r.withDirectives((r.openBlock(),r.createElementBlock("select",{key:4,ref_key:"inputRef",ref:l,"onUpdate:modelValue":T[3]||(T[3]=$=>a.value=$),class:r.normalizeClass(["w-full rounded-md border px-3 py-2 text-sm outline-none bg-white border-gray-300",k.value.ring,k.value.border])},[r.createElementVNode("option",Gl,r.toDisplayString(D.value),1),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.value,$=>(r.openBlock(),r.createElementBlock("option",{key:$.value.toString(),value:$.value},r.toDisplayString($.label),9,Jl))),128))],2)),[[r.vModelSelect,a.value]]):r.createCommentVNode("",!0)]),B.value?(r.openBlock(),r.createElementBlock("p",Xl,r.toDisplayString(B.value),1)):r.createCommentVNode("",!0),r.createElementVNode("div",Yl,[r.createElementVNode("button",{type:"button",class:"px-4 py-1.5 text-sm rounded-md border border-gray-300 text-gray-700 bg-white hover:bg-gray-50",onClick:R}," Скасувати "),r.createElementVNode("button",{type:"button",class:r.normalizeClass(["px-4 py-1.5 text-sm rounded-md text-white",k.value.bg]),onClick:N}," Зберегти ",2)])]))],46,Bl)):r.createCommentVNode("",!0)]))],64))],2))}}),is=typeof window<"u",ls=typeof document<"u",Ql=()=>{if(!ls)throw new Error("Tooltip requires document to be defined");const e=document.createElement("div");return e.className="fixed z-[9999] w-56 p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-200",e.style.opacity="0",e.style.visibility="hidden",document.body.appendChild(e),e},as=(e,t)=>{if(!ls||!is)return;const n=Ql(),s={text:t,tooltipEl:n,show:o=>{if(!s.text||!is)return;n.textContent=s.text;const l=o.currentTarget.getBoundingClientRect(),i=window.innerWidth-n.offsetWidth-12,a=Math.max(12,Math.min(l.left,i));n.style.left=`${a}px`,n.style.top=`${l.bottom+4}px`,n.style.opacity="1",n.style.visibility="visible"},hide:()=>{n.style.opacity="0",n.style.visibility="hidden"}};e.addEventListener("mouseenter",s.show),e.addEventListener("mouseleave",s.hide),e.addEventListener("focus",s.show),e.addEventListener("blur",s.hide),e.tooltipHandlers=s},cs=e=>{e.tooltipHandlers&&(e.removeEventListener("mouseenter",e.tooltipHandlers.show),e.removeEventListener("mouseleave",e.tooltipHandlers.hide),e.removeEventListener("focus",e.tooltipHandlers.show),e.removeEventListener("blur",e.tooltipHandlers.hide),e.tooltipHandlers.tooltipEl.remove(),delete e.tooltipHandlers)},Vl={mounted(e,t){t.value&&as(e,t.value)},updated(e,t){const n=e;if(!t.value){cs(n);return}if(!n.tooltipHandlers){as(n,t.value);return}n.tooltipHandlers.text=t.value},unmounted(e){cs(e)}},ea={key:0,class:"text-center py-8"},ta={class:"inline-flex items-center space-x-2"},na={key:2,class:"overflow-x-auto"},ra={key:0},sa={key:0,style:{width:"48px"}},oa={key:1,style:{width:"100px"}},ia=["checked","indeterminate"],la=["onClick"],aa={class:"flex items-center justify-between"},ca={class:"flex items-center gap-1.5"},da={key:0,class:"relative group"},fa=["onMouseenter"],pa={key:0,class:"ml-1 text-xs"},ua=["onMousedown"],ha=["onClick"],ma=["checked","onChange"],ga=["onClick"],va={key:1,class:"text-center"},ya=["colspan"],Dn=50,ba=180,At=r.defineComponent({name:"DataTable",__name:"DataTable",props:{rows:{default:()=>[]},columns:{default:()=>[]},api:{},router:{},tableStyle:{default:""},size:{default:"medium"},theme:{default:"light"},loading:{type:Boolean,default:!1},classWrapper:{default:""},classTable:{default:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},classTbody:{default:""},classTr:{default:""},classTd:{default:""},classTh:{default:""},classThead:{default:""},classContent:{default:""},classLink:{default:""},selectable:{type:Boolean,default:!1},selectedRows:{default:()=>[]},limit:{default:10},page:{default:1},total:{default:0},showPagination:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},defaultSort:{default:()=>[]},clickable:{type:Boolean,default:!1},hasAction:{type:Boolean,default:!0},getCellData:{type:Function,default:void 0},form:{},color:{default:"blue"},resizableColumnsWidth:{type:Boolean,default:!1},resizableColumnsWidthStorageKey:{default:""}},emits:["update:page","update:selectedRows","row-click","sort","cell-update"],setup(e,{emit:t}){const n=e,s=Vl,o=r.ref({}),l=r.ref(null),i=r.ref(!1);let a=0,c=0,p=null,u=null;const d=t,h=r.ref(n.selectedRows||[]),m=r.ref(n.defaultSort.map(f=>({field:f.name,direction:f.asc?"asc":"desc"}))),y=r.ref([]),E=r.ref([]),_=r.ref(!1),S=r.ref(null),B=r.ref(n.router),D=r.useSlots(),H=r.computed(()=>D.action),z=r.computed(()=>H.value&&n.hasAction);function Q(f){if(B.value){B.value.push(f);return}location.href=f}const J=r.computed(()=>{if(n.api)return y.value;if(n.sortable&&m.value.length>0){const f=[...n.rows];return f.sort((b,g)=>{for(const U of m.value){if(!U.direction)return 0;const v=b[U.field],M=g[U.field];if(v==null)return 1;if(M==null)return-1;let ee=0;typeof v=="string"&&typeof M=="string"?ee=v.localeCompare(M):v<M?ee=-1:v>M?ee=1:ee=0;const Xe=U.direction==="desc"?-ee:ee;if(Xe!==0)return Xe}return 0}),f}return n.rows});r.watch(()=>n.selectedRows,f=>{h.value=f||[]});const A=f=>h.value.some(b=>b===f),N=f=>{const b=h.value.findIndex(g=>g===f);b>-1?h.value.splice(b,1):h.value.push(f),d("update:selectedRows",[...h.value])},R=r.computed(()=>J.value.length>0&&h.value.length===J.value.length),L=r.computed(()=>h.value.length>0&&h.value.length<J.value.length),O=()=>{R.value?h.value=[]:h.value=[...J.value],d("update:selectedRows",[...h.value])},j=(f,b)=>{if(!n.sortable||l.value||i.value)return;if(b?.ctrlKey||b?.metaKey){const v=m.value.findIndex(M=>M.field===f);if(v>=0){const M=m.value[v];M.direction==="asc"?M.direction="desc":M.direction==="desc"&&m.value.splice(v,1)}else m.value.unshift({field:f,direction:"asc"})}else{const v=m.value.find(M=>M.field===f);v?v.direction==="asc"?v.direction="desc":v.direction==="desc"&&(m.value=[]):m.value=[{field:f,direction:"asc"}]}const U=m.value.filter(v=>v.direction).map(v=>({name:v.field,asc:v.direction==="asc"}));d("sort",U),n.api&&Rt()},q=f=>m.value.find(g=>g.field===f)?.direction==="asc",k=f=>{const b=m.value.find(g=>g.field===f);if(!b)return"";switch(b.direction){case"asc":return"↑";case"desc":return"↓";default:return"↕️"}},x=f=>n.sortable&&f.sortable!==!1,C=f=>{n.clickable&&d("row-click",f)},w=f=>f==null||f===""?"":typeof f=="object"?f?.text?String(f.text):f?.label?String(f.label):JSON.stringify(f):String(f),T=f=>f.map(w).filter(b=>b!=="").join(", "),$=(f,b)=>b.format!=="array"&&Array.isArray(f)?T(f):f,V=(f,b)=>{const g=b[f.name];if(n.getCellData||f.getCellData){const M=f.getCellData||n.getCellData;if(M){const ee={name:f.name,row:b,value:g};return $(M(ee),f)}}const v=["_data","_text"].map(M=>{const ee=`${f.name}${M}`;return b[ee]?b[ee]:null}).find(M=>M)||(f.link?g||"-":g);return $(v,f)},ye=f=>Array.isArray(f)?T(f):w(f),xe=(f,b)=>{if(!b?.tooltip)return;const g=V(b,f);if(g!=null)return ye(g)},le=f=>f.width?f.width==="w-full"?"w-full":typeof f.width=="string"?`w-[${f.width}px] max-w-[${f.width}px] min-w-[${f.width}px]`:typeof f.width=="number"?`w-[${f.width}px] max-w-[${f.width}px] min-w-[${f.width}px]`:"":"max-w-[350px]",Te=f=>(typeof f?.overflow=="string"?f.overflow.toLowerCase():"")==="wrap"?"wrap":"clip",we=f=>Te(f)==="wrap"?["whitespace-normal","break-words"]:["truncate","whitespace-nowrap"],Ne=r.ref(n.page),hs=r.ref(n.limit),On=r.ref(n.total),$t=r.ref(1),In=r.ref(10),Mt=r.ref(0),ms=r.computed(()=>n.api?$t.value:Ne.value),gs=r.computed(()=>n.api?In.value:hs.value),vs=r.computed(()=>n.api?Mt.value:On.value),ae=r.computed(()=>{const{theme:f}=n;return f==="dark"?{container:"dark",loading:"text-gray-400",error:"text-red-400",thead:"bg-gray-800",th:"text-gray-300",thHover:"hover:bg-gray-700",tbody:"bg-gray-900 divide-gray-700",tr:"hover:bg-gray-800",td:"text-gray-300",empty:"text-gray-400",checkbox:"border-gray-600 bg-gray-700 text-blue-400"}:f==="light"?{container:"",loading:"text-gray-500",error:"text-red-500",thead:"bg-gray-50",th:"text-gray-500",thHover:"hover:bg-gray-100",tbody:"bg-white divide-gray-200",tr:"hover:bg-gray-50",td:"text-gray-900",empty:"text-gray-500",checkbox:"border-gray-300 bg-white text-blue-600"}:{container:"",loading:"text-gray-500 dark:text-gray-400",error:"text-red-500 dark:text-red-400",thead:"bg-gray-50 dark:bg-gray-800",th:"text-gray-500 dark:text-gray-300",thHover:"hover:bg-gray-100 dark:hover:bg-gray-700",tbody:"bg-white dark:bg-gray-900 divide-gray-200 dark:divide-gray-700",tr:"hover:bg-gray-50 dark:hover:bg-gray-800",td:"text-gray-900 dark:text-gray-300",empty:"text-gray-500 dark:text-gray-400",checkbox:"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400"}});r.watch(()=>n.page,f=>{Ne.value=f}),r.watch(()=>n.limit,f=>{hs.value=f}),r.watch(()=>n.total,f=>{On.value=f});async function Rt(){if(n.api){_.value=!0,S.value=null;try{const f=new URL(n.api,window.location.origin);if(f.searchParams.set("page",ms.value.toString()),f.searchParams.set("limit",gs.value.toString()),m.value.length>0){const U=m.value.filter(v=>v.direction).map(v=>`${v.field}:${v.direction}`).join(",");U&&f.searchParams.set("sort",U)}const b=await fetch(f.toString());if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);const g=await b.json();g.rows&&Array.isArray(g.rows)&&(y.value=g.rows),g.columns&&Array.isArray(g.columns)&&(E.value=g.columns),g.total!==void 0&&(n.api?Mt.value=g.total:On.value=g.total)}catch(f){S.value=f instanceof Error?f.message:"Failed to fetch data",console.error("Error fetching data:",f)}finally{_.value=!1}}}const Ec=f=>{n.api?$t.value=f:(Ne.value=f,d("update:page",f)),n.api&&Rt()},kc=r.computed(()=>n.showPagination&&vs.value>0),at=r.computed(()=>({small:{header:"px-3 py-2 text-xs",cell:"px-3 py-2 text-xs"},medium:{header:"px-6 py-3 text-xs",cell:"px-6 py-4 text-sm"},large:{header:"px-8 py-4 text-sm",cell:"px-8 py-6 text-base"}})[n.size]),xc=f=>{const b=[];return n.classTd?b.push(n.classTd):b.push(ae.value.td,at.value.cell),f.align&&b.push(`text-${f.align}`),!n.resizableColumnsWidth&&le(f)&&b.push(le(f)),b.push(...we(f)),b.filter(Boolean)},wc=dt(),ys=ut();r.onMounted(()=>{n.api&&(n.page&&($t.value=n.page),n.limit&&(In.value=n.limit),n.total&&(Mt.value=n.total),Rt()),n.resizableColumnsWidth&&ks()}),r.watch(()=>n.api,f=>{f&&($t.value=n.page||1,In.value=n.limit||10,Mt.value=n.total||0,Rt())});const bs=r.computed(()=>n.api?E.value:n.columns),An=r.ref([]),Lt=r.ref({});r.provide("registerColumn",(f,b)=>{An.value.push(f),b&&f.slotName&&(Lt.value[f.name]=b)});const $n=r.computed(()=>{const f=bs.value||[],b=[],g=D.default?.();if(g){const U=g.filter(v=>v.type?.name==="Column"||v.type==="Column"||v.type&&typeof v.type=="object"&&v.type.name==="Column").map(v=>{const M=v.props||v.componentProps||{},ee=M.field||M.name||"",Xe=M.header||M.label||"",Ss=v.children&&v.children.body,Rn={name:ee,ua:Xe,format:M.format||"text",slotName:Ss?"body":void 0,...M};return Ss&&Rn.name&&(Lt.value[Rn.name]=v.children.body),Rn});b.push(...U)}if(An.value.length>0&&b.push(...An.value),b.length>0){const U=[],v=new Set(b.map(M=>M.name));return f.forEach(M=>{v.has(M.name)||U.push(M)}),U.push(...b),console.log("Combined columns:",{default:f.length,custom:b.length,combined:U.length}),U}return f.length>0?f:[]}),Pt=r.computed(()=>($n.value||[]).filter(f=>!f.hidden));function Es(f){if(typeof f.width=="number"&&f.width>0)return f.width;if(typeof f.width=="string"){const b=parseInt(f.width.replace(/px$/i,""),10);if(!Number.isNaN(b)&&b>0)return b}return ba}function ks(){if(!n.resizableColumnsWidth)return;const f=Pt.value;let b={};if(n.resizableColumnsWidthStorageKey)try{const g=localStorage.getItem(n.resizableColumnsWidthStorageKey);g&&(b={...JSON.parse(g)})}catch{}f.forEach(g=>{(b[g.name]==null||b[g.name]<Dn)&&(b[g.name]=Es(g))}),o.value=b}r.watch(()=>[$n.value,n.resizableColumnsWidth],()=>{n.resizableColumnsWidth&&ks()});function xs(f){const b=o.value[f.name];return b!=null&&b>=Dn?b:Es(f)}function Nc(f,b){l.value=b.name,a=f.clientX,c=xs(b),p=g=>{const U=g.clientX-a,v=Math.max(Dn,c+U);o.value={...o.value,[b.name]:v}},u=()=>{if(document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",u),document.body.style.userSelect="",n.resizableColumnsWidthStorageKey)try{localStorage.setItem(n.resizableColumnsWidthStorageKey,JSON.stringify(o.value))}catch{}i.value=!0,l.value=null,p=null,u=null,setTimeout(()=>{i.value=!1},100)},document.body.style.userSelect="none",document.addEventListener("mousemove",p),document.addEventListener("mouseup",u)}const Sc=(f="text")=>zt[f.toLowerCase()]||zt.text,je=r.ref({});async function Cc(f){const{data:b,api:g}=$n.value.find(U=>U.name===f);if(je.value[f])return je.value[f];if(b||g){const U=g||`/api/suggest/${b}?json=1`,M=await(await fetch(U)).json();M.data&&Array.isArray(M.data)&&(je.value[f]=M.data.map(ee=>({value:ee.id??ee.value,label:ee.text??ee.label})))}return je.value[f]}function _c(f,b,g,U){const v=U;v!==-1&&(n.rows[v]={...n.rows[v],[b]:g}),d("cell-update",f,b,g)}function ws(f){return Pn(f,ys.value)}function Tc(f){return pt(f,ys.value)}const Mn=r.ref(null),Ns=r.ref({top:"0px",left:"0px"});function Bc(f,b){const g=f.currentTarget.getBoundingClientRect();Mn.value=b,Ns.value={top:`${g.bottom+4}px`,left:`${Math.min(g.left,window.innerWidth-230)}px`}}function Dc(){Mn.value=null}return r.watch(()=>n.form,async f=>{f&&(je.value={})}),r.onMounted(()=>{n.form&&(je.value={})}),(f,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["w-full",ae.value.container])},[_.value||n.loading?(r.openBlock(),r.createElementBlock("div",ea,[r.createElementVNode("div",ta,[b[1]||(b[1]=r.createElementVNode("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"},null,-1)),r.createElementVNode("span",{class:r.normalizeClass(ae.value.loading)},"Loading...",2)])])):S.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["text-center py-8",ae.value.error])},r.toDisplayString(S.value),3)):n.loading?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",na,[r.createElementVNode("div",{class:r.normalizeClass(e.classWrapper?e.classWrapper:"relative w-full overflow-auto")},[r.createElementVNode("table",{class:r.normalizeClass(e.classTable),style:r.normalizeStyle([e.tableStyle,n.resizableColumnsWidth?"table-layout: fixed":""])},[n.resizableColumnsWidth?(r.openBlock(),r.createElementBlock("colgroup",ra,[e.selectable?(r.openBlock(),r.createElementBlock("col",sa)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,g=>(r.openBlock(),r.createElementBlock("col",{key:g.name,style:r.normalizeStyle({width:xs(g)+"px"})},null,4))),128)),z.value?(r.openBlock(),r.createElementBlock("col",oa)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("thead",{class:r.normalizeClass(e.classThead||ae.value.thead)},[r.createElementVNode("tr",null,[e.selectable?(r.openBlock(),r.createElementBlock("th",{key:0,class:r.normalizeClass(["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header,n.classTh,"w-12"])},[r.createElementVNode("input",{type:"checkbox",checked:R.value,indeterminate:L.value,onChange:O,class:r.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",ae.value.checkbox])},null,42,ia)],2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,g=>(r.openBlock(),r.createElementBlock("th",{key:g.name,class:r.normalizeClass([n.resizableColumnsWidth?"relative":"",g.align?`text-${g.align}`:"",x(g)?["cursor-pointer",ae.value.thHover]:"",n.resizableColumnsWidth?"":le(g)].concat(n.classTh||["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header])),onClick:U=>x(g)?j(g.name,U):void 0},[r.createElementVNode("div",aa,[r.createElementVNode("div",ca,[r.createElementVNode("span",null,r.toDisplayString(Tc(g)),1),ws(g)?(r.openBlock(),r.createElementBlock("div",da,[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-gray-400 cursor-help",onMouseenter:U=>Bc(U,g.name),onMouseleave:Dc},[...b[2]||(b[2]=[r.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),r.createElementVNode("path",{d:"M12 16v-4"},null,-1),r.createElementVNode("path",{d:"M12 8h.01"},null,-1)])],40,fa)),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[Mn.value===g.name?(r.openBlock(),r.createElementBlock("div",{key:0,style:r.normalizeStyle(Ns.value),class:"fixed z-[9999] w-56 p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-200"},r.toDisplayString(ws(g)),5)):r.createCommentVNode("",!0)]))])):r.createCommentVNode("",!0)]),x(g)?(r.openBlock(),r.createElementBlock("span",pa,[r.renderSlot(f.$slots,"sort",{asc:q(g.name)},()=>[r.createTextVNode(r.toDisplayString(k(g.name)),1)])])):r.createCommentVNode("",!0)]),n.resizableColumnsWidth&&!g.action?(r.openBlock(),r.createElementBlock("div",{key:0,class:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-blue-400/30",onMousedown:r.withModifiers(U=>Nc(U,g),["prevent"]),onClick:b[0]||(b[0]=r.withModifiers(()=>{},["stop","prevent"]))},null,40,ua)):r.createCommentVNode("",!0)],10,la))),128)),z.value?(r.openBlock(),r.createElementBlock("th",{key:1,class:r.normalizeClass(["w-[100px]",n.classTh||["text-left font-medium uppercase tracking-wider",ae.value.th,at.value.header]])},r.toDisplayString(r.unref(wc)("table.actions")),3)):r.createCommentVNode("",!0)])],2),J.value.length?(r.openBlock(),r.createElementBlock("tbody",{key:1,class:r.normalizeClass(e.classTbody||ae.value.tbody)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(J.value,(g,U)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:U},[r.createElementVNode("tr",{class:r.normalizeClass(n.classTr||[ae.value.tr,n.clickable?"cursor-pointer":""]),onClick:v=>n.clickable?C(g):void 0},[e.selectable?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(["whitespace-nowrap",ae.value.td,at.value.cell,n.classTd,"w-12"])},[r.createElementVNode("input",{type:"checkbox",checked:A(g),onChange:v=>N(g),class:r.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",ae.value.checkbox])},null,42,ma)],2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Pt.value,v=>r.withDirectives((r.openBlock(),r.createElementBlock("td",{key:v.name,class:r.normalizeClass(xc(v))},[(r.openBlock(),r.createBlock(Zl,{"class-content":n.classContent,key:g,editable:v.edit,row:g,column:v,value:g[v.name],format:v.format,options:je.value[v.name]||[],color:e.color,overflow:Te(v),onUpdate:(M,ee,Xe)=>_c(M,ee,Xe,U),"fetch-options":Cc},{default:r.withCtx(()=>[v.action&&H.value?r.renderSlot(f.$slots,"action",{key:0,row:g}):r.unref(D).number&&v.format==="number"?r.renderSlot(f.$slots,"number",{key:1,row:g,value:V(v,g)}):r.unref(D).badge&&v.format==="badge"?r.renderSlot(f.$slots,"badge",{key:2,row:g,value:V(v,g)}):r.unref(D).array&&v.format==="array"?r.renderSlot(f.$slots,"array",{key:3,row:g,value:V(v,g)}):r.unref(D)[v.format]?r.renderSlot(f.$slots,v.format,{key:4,row:g,value:V(v,g),column:v}):v.slotName&&Lt.value[v.name]?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(Lt.value[v.name]),{key:5,data:g,value:V(v,g),row:g,column:v},null,8,["data","value","row","column"])):v.link?(r.openBlock(),r.createElementBlock("a",{key:6,class:r.normalizeClass(e.classLink||"hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),onClick:M=>Q(v.link.replace("{id}",g.id))},[v.slot&&typeof v.slot=="string"?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(os)(v.slot)),{key:0,row:g,value:g,data:g,column:v},null,8,["row","value","data","column"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(V(v,g)),1)],64))],10,ga)):v.slot&&v.format==="slot"&&typeof v.slot=="string"?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(os)(v.slot)),{key:7,row:g,value:V(v,g),data:g,column:v},null,8,["row","value","data","column"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(Sc(v.format)),{key:8,value:V(v,g),row:g,column:v,href:v.link},null,8,["value","row","column","href"]))]),_:2},1032,["class-content","editable","row","column","value","format","options","color","overflow","onUpdate"]))],2)),[[r.unref(s),xe(g,v)]])),128)),z.value?(r.openBlock(),r.createElementBlock("td",va,[r.renderSlot(f.$slots,"action",{row:g})])):r.createCommentVNode("",!0)],10,ha),r.createElementVNode("tr",null,[r.renderSlot(f.$slots,"under-row",{row:g})])],64))),128))],2)):r.createCommentVNode("",!0),J.value.length===0?(r.openBlock(),r.createElementBlock("tbody",{key:2,class:r.normalizeClass(["text-center py-8",ae.value.empty])},[r.createElementVNode("tr",null,[r.createElementVNode("td",{colspan:bs.value.length},[r.createVNode(Cl)],8,ya)])],2)):r.createCommentVNode("",!0)],6)],2)])),kc.value&&!_.value&&!n.loading&&!S.value?(r.openBlock(),r.createBlock(jt,{key:3,page:ms.value,limit:gs.value,total:vs.value,theme:n.theme,size:n.size,"onUpdate:page":Ec},null,8,["page","limit","total","theme","size"])):r.createCommentVNode("",!0)],2))}}),Ea={style:{display:"none"}},ds=r.defineComponent({name:"Column",__name:"Column",props:{field:{},name:{},header:{},label:{},format:{},hidden:{type:Boolean},sortable:{type:Boolean},width:{},align:{},slot:{},slotName:{},link:{},action:{type:Boolean},getCellData:{type:Function},suffix:{},tooltip:{type:Boolean},overflow:{}},setup(e){const t=e,n=r.useSlots(),s=r.inject("registerColumn");return r.onMounted(()=>{if(s){const{field:o,name:l,header:i,label:a,format:c,slotName:p,link:u,action:d,getCellData:h,suffix:m,...y}=t,B={name:o||l||"",ua:i||a||"",format:c||"text",slotName:p||(n.body?"body":void 0),link:u,action:d,getCellData:h,suffix:m,...y};console.log("Registering column:",B);const D=n.body;s(B,D)}}),(o,l)=>(r.openBlock(),r.createElementBlock("div",Ea,[r.renderSlot(o.$slots,"body",{data:{}})]))}}),ka={class:"mt-4"},xa={class:"text-sm text-gray-600 dark:text-gray-300"},fs=r.defineComponent({__name:"SelectionInfo",props:{selectedRows:{},totalCount:{}},setup(e){const t=e,n=r.computed(()=>t.selectedRows.length);return(s,o)=>(r.openBlock(),r.createElementBlock("div",ka,[r.createElementVNode("div",xa," Обрано: "+r.toDisplayString(n.value)+" з "+r.toDisplayString(e.totalCount)+" записів ",1)]))}}),wa={class:"mt-4"},Na={class:"border-b border-gray-200 dark:border-gray-700"},Sa={class:"-mb-px flex space-x-8"},Ca=["onClick"],_a={class:"mt-4"},Ta={class:"bg-gray-900 rounded-lg overflow-hidden"},Ba={class:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700"},Da={class:"text-sm text-gray-300"},Oa=["onClick"],Ia={class:"p-4 text-sm text-gray-100 overflow-x-auto"},ps=r.defineComponent({__name:"CodeTabs",props:{tabs:{},defaultTab:{default:void 0}},setup(e){const t=e,n=r.ref(t.defaultTab||t.tabs[0]?.id||""),s=async o=>{try{await navigator.clipboard.writeText(o),console.log("Код скопійовано!")}catch(l){console.error("Помилка копіювання:",l)}};return(o,l)=>(r.openBlock(),r.createElementBlock("div",wa,[r.createElementVNode("div",Na,[r.createElementVNode("nav",Sa,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.tabs,i=>(r.openBlock(),r.createElementBlock("button",{key:i.id,onClick:a=>n.value=i.id,class:r.normalizeClass(["py-2 px-1 border-b-2 font-medium text-sm transition-colors",n.value===i.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"])},r.toDisplayString(i.label),11,Ca))),128))])]),r.createElementVNode("div",_a,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.tabs,i=>r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:i.id},[r.createElementVNode("div",Ta,[r.createElementVNode("div",Ba,[r.createElementVNode("span",Da,r.toDisplayString(i.label),1),r.createElementVNode("button",{onClick:a=>s(i.content),class:"text-gray-400 hover:text-white transition-colors",title:"Копіювати код"},[...l[0]||(l[0]=[r.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])],8,Oa)]),r.createElementVNode("pre",Ia,[r.createElementVNode("code",null,r.toDisplayString(i.content),1)])])])),[[r.vShow,n.value===i.id]])),128))])]))}}),Aa={key:0,class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},$a={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl md:w-5/12 w-9/12"},Ma={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Ra={class:"font-medium text-gray-800 dark:text-[#ffffff]"},La={class:"sr-only"},Pa={class:"ui-dialog__content p-4 overflow-y-auto flex-1"},Fa={class:"p-4"},za={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},ja={class:"text-sm font-[600] text-gray-500"},Ua={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},Ha={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Wa={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},qa={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Ka={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Ga={class:"h-[14px] w-[14px] border rounded-full flex items-center justify-center"},Ja={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Xa={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Ya={class:"flex items-center [&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0"},Za={class:"flex items-center gap-[4px]"},Qa=["id","value"],Va=["for"],ec={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",height:"12",width:"12"},tc={class:"text-[13px] text-gray-500 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},nc={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},rc={class:"text-sm font-[600] text-gray-500"},sc={class:"mt-2 space-y-2"},oc={class:"flex items-center"},ic={for:"json",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},lc={class:"flex items-center"},ac={for:"csv",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},cc={class:"flex items-center"},dc={for:"xlsx",class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"},fc={key:0,class:"p-3 border rounded-md bg-gray-50 text-sm text-gray-700 whitespace-pre-line mb-4 dark:bg-neutral-800 dark:text-neutral-200"},pc={class:"flex items-center gap-2 mb-2"},uc={class:"flex justify-end gap-x-2"},hc={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},mc=["disabled"],gc={key:0,class:"fixed inset-0 z-[90] flex items-center justify-center bg-black/60"},vc={class:"rounded-lg bg-white p-6 text-center shadow-xl dark:bg-neutral-900 w-[320px]"},yc={class:"text-sm font-medium text-gray-700 dark:text-neutral-200"},bc={class:"mt-2 text-xs text-gray-500 whitespace-pre-line dark:text-neutral-400"},us=r.defineComponent({__name:"Export",props:{table:{},columns:{},filter:{}},setup(e){const t=r.getCurrentInstance(),n=dt(),s=e;function o(k){return Array.isArray(k)?k.join(","):String(k)}const l=r.computed(()=>{const k=s.filter??{};return Object.entries(k).filter(([,x])=>Array.isArray(x)?x.length>0:!!x).map(([x,C])=>`${x}=${o(C)}`).join("|")}),i=r.ref(!1),a=r.ref([]),c=r.ref("json"),p=r.ref(!1),u=r.ref(!1),d=r.ref(""),h=r.ref(!1),m=r.ref("all"),y=r.computed(()=>s.columns??[]),E=r.computed(()=>y.value.filter(k=>k.export!==!1)),_=r.useAttrs();function S(){const k=E.value;a.value=k.map(x=>x.name),m.value=k.length?"all":"none",c.value="json",i.value=!0,h.value=!1}function B(){i.value=!1,h.value=!1}function D(){const k=E.value;a.value=k.map(x=>x.name),m.value=k.length?"all":"none"}function H(){const k=E.value,x=k.filter(w=>!w.hidden).map(w=>w.name),C=x.length?x:k.map(w=>w.name);a.value=C,m.value=C.length?"active":"none"}function z(){a.value=[],m.value="none"}async function Q(){const k=a.value.filter(C=>E.value.some(w=>w.name===C));if(k.length===0)return;p.value=!0,d.value="",u.value=!1;const x=new URLSearchParams({table:s.table,format:c.value,cols:k.join(",")});l.value&&x.set("filter",l.value);try{const C=await fetch(`/api/export?${x.toString()}`,{method:"GET",headers:{Accept:"text/event-stream, */*"}});if(!C.ok)throw new Error("Export failed");if(C.headers.get("content-type")?.includes("text/event-stream")){if(B(),u.value=!0,h.value=!0,!await j(C,$=>{d.value=$}))throw new Error("Failed to process streamed export");d.value=n("table.preparingDownload"),await L(x),u.value=!1,h.value=!1}else await R(C),B()}catch(C){console.error(C);const{$notify:w=console.log}=t?.appContext?.config?.globalProperties||{};w({type:"error",title:"Помилка",message:"Не вдалося єкспортувати файл"}),u.value=!1,h.value=!1}finally{p.value=!1}}const J=ut(),A=k=>pt(k,J.value);function N(k,x){const C=URL.createObjectURL(k),w=document.createElement("a");w.href=C,w.download=x||`${s.table}.${c.value}`,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(C)}async function R(k){const x=await k.blob();N(x,`${s.table}.${c.value}`)}async function L(k){const x=await fetch(`/api/export?${k.toString()}`,{method:"GET",headers:{Accept:"*/*"}});if(!x.ok)throw new Error("Export failed");await R(x)}function O(k){return k.split(/\r?\n/).reduce((x,C)=>{const[w,...T]=C.split(":");if(!w)return x;const $=T.join(":").trimStart();return w==="event"&&(x.event=$),w==="data"&&(x.data=(x.data?`${x.data}
|
|
10
10
|
`:"")+$),x},{})}async function j(k,x){const C=k.body?.getReader();if(!C)return!1;const w=new TextDecoder;let T="",$=!1;for(;;){const{value:V,done:ye}=await C.read();if(ye)break;T+=w.decode(V,{stream:!0});let xe=T.indexOf(`
|
|
11
11
|
|
|
12
12
|
`);for(;xe!==-1;){const le=T.slice(0,xe).trim();if(T=T.slice(xe+2),le){const we=O(le).data?.trim();we&&($=q(we,x)||$)}xe=T.indexOf(`
|