@stonecrop/desktop 0.4.2 โ 0.4.3
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/desktop.js +74 -74
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.umd.cjs +7 -7
- package/dist/desktop.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/desktop.umd.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
(function(P,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(P=typeof globalThis<"u"?globalThis:P||self,r(P["@stonecrop/desktop"]={},P.Vue))})(this,function(P,r){"use strict";const Un={class:"action-menu-icon"},Wn=["onclick"],Hn={key:1},Fn=["onClick"],zn={class:"dropdown-container"},Jn={class:"dropdown"},Gn=["onclick"],Yn=["href"],Xn={class:"dropdown-item"},Qn=r.defineComponent({__name:"ActionSet",props:{elements:{}},setup(t){const e=r.ref(t.elements),n=r.ref(!1),o=r.ref(null),s=r.ref(!1),a=r.ref(!1);r.onMounted(()=>{l()});const l=()=>{for(const d of e.value)d.type==="dropdown"&&(d.show=!1)},i=()=>{s.value=!0,o.value=setTimeout(()=>{s.value&&(n.value=!0)},500)},u=()=>{s.value=!1,a.value=!1,clearTimeout(o.value),n.value=!1},c=d=>{const f=!e.value[d].show;l(),e.value[d].show=f};return(d,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"open-set":n.value,"hovered-and-closed":a.value},"action-set collapse"]),onMouseover:i,onMouseleave:u},[r.createElementVNode("div",Un,[r.createElementVNode("div",{id:"chevron",onClick:f[0]||(f[0]=p=>a.value=!a.value)},f[1]||(f[1]=[r.createElementVNode("svg",{class:"leftBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"54.2,33.4 29.2,58.8 25,54.6 50,29.2 "})],-1),r.createElementVNode("svg",{class:"rightBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"70.8,58.8 45.8,33.4 50,29.2 75,54.6 "})],-1)]))]),f[2]||(f[2]=r.createElementVNode("div",{style:{"margin-right":"30px"}},null,-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.value,(p,w)=>(r.openBlock(),r.createElementBlock("div",{class:"action-element",key:p.label},[p.type=="button"?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:p.action,class:"button-default"},r.toDisplayString(p.label),9,Wn)):r.createCommentVNode("",!0),p.type=="dropdown"?(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("button",{class:"button-default",onClick:h=>c(w)},r.toDisplayString(p.label),9,Fn),r.withDirectives(r.createElementVNode("div",zn,[r.createElementVNode("div",Jn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actions,h=>(r.openBlock(),r.createElementBlock("div",{key:h.label},[h.action!=null?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:h.action,class:"dropdown-item"},r.toDisplayString(h.label),9,Gn)):h.link!=null?(r.openBlock(),r.createElementBlock("a",{key:1,href:h.link},[r.createElementVNode("button",Xn,r.toDisplayString(h.label),1)],8,Yn)):r.createCommentVNode("",!0)]))),128))])],512),[[r.vShow,p.show]])])):r.createCommentVNode("",!0)]))),128))],34))}}),Tt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ye=Tt(Qn,[["__scopeId","data-v-38e7af34"]]),qn={};function Kn(t,e){return r.openBlock(),r.createElementBlock("dialog")}const we=Tt(qn,[["render",Kn]]),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};function be(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function at(t){return typeof t=="function"?t():r.unref(t)}const Ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const to=Object.prototype.toString,eo=t=>to.call(t)==="[object Object]",_e=()=>{},ve=no();function no(){var t,e;return Ee&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function oo(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:_e}))):r.ref(e)}const ro=Ee?window:void 0;function so(t){var e;const n=at(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ao(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=ro):[e,n,o,s]=t,!e)return _e;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[so(e),at(s)],([d,f])=>{if(l(),!d)return;const p=eo(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return be(c),c}function At(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ke(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ke(n)}}function io(t){const e=t||window.event,n=e.target;return ke(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Bt=new WeakMap;function lo(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(oo(t),i=>{const u=At(at(i));if(u){const c=u;if(Bt.get(c)||Bt.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=At(at(t));!i||n.value||(ve&&(o=ao(i,"touchmove",u=>{io(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=At(at(t));!i||!n.value||(ve&&(o==null||o()),i.style.overflow=s,Bt.delete(i),n.value=!1)};return be(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function co(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=lo(n,o.value);r.watch(e,a=>s.value=a)}}co(),typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uo={class:"aform"},fo=r.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(t.data||{}),s=l=>{let i={};for(const[u,c]of Object.entries(l))["component","fieldtype"].includes(u)||(i[u]=c),u==="rows"&&c&&c.length===0&&(i.rows=o.value[l.fieldname]);return i},a=r.computed({get:()=>t.modelValue.map((l,i)=>r.computed({get(){return l.value},set:u=>{t.modelValue[i].value=u,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(l,i)=>(r.openBlock(),r.createElementBlock("form",uo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.modelValue,(u,c)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.component),r.mergeProps({key:c,schema:u,modelValue:a.value[c].value,"onUpdate:modelValue":d=>a.value[c].value=d,data:o.value[u.fieldname],readonly:l.readonly,ref_for:!0},s(u)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),po=Zn(fo,[["__scopeId","data-v-68845234"]]);var mo=Object.defineProperty,ho=(t,e,n)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);function Rt(t){this.message=t||""}Rt.prototype=Object.create(Error.prototype,{constructor:{value:Rt},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const Se=class Vt{constructor(e,n,o,s,a){if(V(this,"name","Stonecrop"),V(this,"registry"),V(this,"store"),V(this,"schema"),V(this,"workflow"),V(this,"actions"),Vt._root)return Vt._root;Vt._root=this,this.registry=e,this.store=n,this.schema=o,this.workflow=s,this.actions=a}setup(e){this.getMeta(e),this.getWorkflow(e),this.getActions(e)}getMeta(e){return this.registry.getMeta?this.registry.getMeta(e.doctype):new Rt(e.doctype)}getWorkflow(e){const n=this.registry.registry[e.slug];this.workflow=n.workflow}getActions(e){const n=this.registry.registry[e.slug];this.actions=n.actions}async getRecords(e,n){this.store.$patch({records:[]});const o=await(await fetch(`/${e.slug}`,n)).json();this.store.$patch({records:o})}async getRecord(e,n){this.store.$patch({record:{}});const o=await(await fetch(`/${e.slug}/${n}`)).json();this.store.$patch({record:o})}runAction(e,n,o){var s;const a=(s=this.registry.registry[e.slug].actions)==null?void 0:s.get(n);if(this.workflow){const{initialState:l}=this.workflow;this.workflow.transition(l,{type:n}),a&&a.length>0&&a.forEach(i=>{new Function(i)(o)})}}};V(Se,"_root");let go=Se;var $e=!1;function bt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function jt(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function yo(){return Ne().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ne(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const wo=typeof Proxy=="function",bo="devtools-plugin:setup",Eo="plugin:settings:set";let it,Mt;function _o(){var t;return it!==void 0||(typeof window<"u"&&window.performance?(it=!0,Mt=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(it=!0,Mt=globalThis.perf_hooks.performance):it=!1),it}function vo(){return _o()?Mt.now():Date.now()}class ko{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const o={};if(e.settings)for(const l in e.settings){const i=e.settings[l];o[l]=i.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let a=Object.assign({},o);try{const l=localStorage.getItem(s),i=JSON.parse(l);Object.assign(a,i)}catch{}this.fallbacks={getSettings(){return a},setSettings(l){try{localStorage.setItem(s,JSON.stringify(l))}catch{}a=l},now(){return vo()}},n&&n.on(Eo,(l,i)=>{l===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(l,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(l,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function xe(t,e){const n=t,o=Ne(),s=yo(),a=wo&&n.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(bo,t,e);else{const l=a?new ko(n,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:l}),l&&e(l.proxiedTarget)}}/*!
|
|
1
|
+
(function(I,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(I=typeof globalThis<"u"?globalThis:I||self,r(I["@stonecrop/desktop"]={},I.Vue))})(this,function(I,r){"use strict";const Un={class:"action-menu-icon"},Wn=["onclick"],Hn={key:1},Fn=["onClick"],zn={class:"dropdown-container"},Jn={class:"dropdown"},Gn=["onclick"],Yn=["href"],Xn={class:"dropdown-item"},Qn=r.defineComponent({__name:"ActionSet",props:{elements:{}},setup(t){const e=r.ref(t.elements),n=r.ref(!1),o=r.ref(null),s=r.ref(!1),a=r.ref(!1);r.onMounted(()=>{l()});const l=()=>{for(const d of e.value)d.type==="dropdown"&&(d.show=!1)},i=()=>{s.value=!0,o.value=setTimeout(()=>{s.value&&(n.value=!0)},500)},u=()=>{s.value=!1,a.value=!1,clearTimeout(o.value),n.value=!1},c=d=>{const f=!e.value[d].show;l(),e.value[d].show=f};return(d,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"open-set":n.value,"hovered-and-closed":a.value},"action-set collapse"]),onMouseover:i,onMouseleave:u},[r.createElementVNode("div",Un,[r.createElementVNode("div",{id:"chevron",onClick:f[0]||(f[0]=p=>a.value=!a.value)},f[1]||(f[1]=[r.createElementVNode("svg",{class:"leftBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"54.2,33.4 29.2,58.8 25,54.6 50,29.2 "})],-1),r.createElementVNode("svg",{class:"rightBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"70.8,58.8 45.8,33.4 50,29.2 75,54.6 "})],-1)]))]),f[2]||(f[2]=r.createElementVNode("div",{style:{"margin-right":"30px"}},null,-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.value,(p,w)=>(r.openBlock(),r.createElementBlock("div",{class:"action-element",key:p.label},[p.type=="button"?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:p.action,class:"button-default"},r.toDisplayString(p.label),9,Wn)):r.createCommentVNode("",!0),p.type=="dropdown"?(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("button",{class:"button-default",onClick:h=>c(w)},r.toDisplayString(p.label),9,Fn),r.withDirectives(r.createElementVNode("div",zn,[r.createElementVNode("div",Jn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actions,h=>(r.openBlock(),r.createElementBlock("div",{key:h.label},[h.action!=null?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:h.action,class:"dropdown-item"},r.toDisplayString(h.label),9,Gn)):h.link!=null?(r.openBlock(),r.createElementBlock("a",{key:1,href:h.link},[r.createElementVNode("button",Xn,r.toDisplayString(h.label),1)],8,Yn)):r.createCommentVNode("",!0)]))),128))])],512),[[r.vShow,p.show]])])):r.createCommentVNode("",!0)]))),128))],34))}}),At=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ye=At(Qn,[["__scopeId","data-v-38e7af34"]]),qn={};function Kn(t,e){return r.openBlock(),r.createElementBlock("dialog")}const we=At(qn,[["render",Kn]]),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};function be(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function at(t){return typeof t=="function"?t():r.unref(t)}const Ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const to=Object.prototype.toString,eo=t=>to.call(t)==="[object Object]",_e=()=>{},ve=no();function no(){var t,e;return Ee&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function oo(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:_e}))):r.ref(e)}const ro=Ee?window:void 0;function so(t){var e;const n=at(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ao(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=ro):[e,n,o,s]=t,!e)return _e;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[so(e),at(s)],([d,f])=>{if(l(),!d)return;const p=eo(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return be(c),c}function Tt(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ke(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ke(n)}}function io(t){const e=t||window.event,n=e.target;return ke(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Rt=new WeakMap;function lo(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(oo(t),i=>{const u=Tt(at(i));if(u){const c=u;if(Rt.get(c)||Rt.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=Tt(at(t));!i||n.value||(ve&&(o=ao(i,"touchmove",u=>{io(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=Tt(at(t));!i||!n.value||(ve&&(o==null||o()),i.style.overflow=s,Rt.delete(i),n.value=!1)};return be(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function co(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=lo(n,o.value);r.watch(e,a=>s.value=a)}}co(),typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uo={class:"aform"},fo=r.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(t.data||{}),s=l=>{let i={};for(const[u,c]of Object.entries(l))["component","fieldtype"].includes(u)||(i[u]=c),u==="rows"&&c&&c.length===0&&(i.rows=o.value[l.fieldname]);return i},a=r.computed({get:()=>t.modelValue.map((l,i)=>r.computed({get(){return l.value},set:u=>{t.modelValue[i].value=u,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(l,i)=>(r.openBlock(),r.createElementBlock("form",uo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.modelValue,(u,c)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.component),r.mergeProps({key:c,schema:u,modelValue:a.value[c].value,"onUpdate:modelValue":d=>a.value[c].value=d,data:o.value[u.fieldname],readonly:l.readonly,ref_for:!0},s(u)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),po=Zn(fo,[["__scopeId","data-v-68845234"]]);var mo=Object.defineProperty,ho=(t,e,n)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);function Bt(t){this.message=t||""}Bt.prototype=Object.create(Error.prototype,{constructor:{value:Bt},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const $e=class Vt{constructor(e,n,o,s,a){if(V(this,"name","Stonecrop"),V(this,"registry"),V(this,"store"),V(this,"schema"),V(this,"workflow"),V(this,"actions"),Vt._root)return Vt._root;Vt._root=this,this.registry=e,this.store=n,this.schema=o,this.workflow=s,this.actions=a}setup(e){this.getMeta(e),this.getWorkflow(e),this.getActions(e)}getMeta(e){return this.registry.getMeta?this.registry.getMeta(e.doctype):new Bt(e.doctype)}getWorkflow(e){const n=this.registry.registry[e.slug];this.workflow=n.workflow}getActions(e){const n=this.registry.registry[e.slug];this.actions=n.actions}async getRecords(e,n){this.store.$patch({records:[]});const o=await(await fetch(`/${e.slug}`,n)).json();this.store.$patch({records:o})}async getRecord(e,n){this.store.$patch({record:{}});const o=await(await fetch(`/${e.slug}/${n}`)).json();this.store.$patch({record:o})}runAction(e,n,o){var s;const a=(s=this.registry.registry[e.slug].actions)==null?void 0:s.get(n);if(this.workflow){const{initialState:l}=this.workflow;this.workflow.transition(l,{type:n}),a&&a.length>0&&a.forEach(i=>{new Function(i)(o)})}}};V($e,"_root");let go=$e;var Se=!1;function bt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function jt(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function yo(){return Ne().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ne(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const wo=typeof Proxy=="function",bo="devtools-plugin:setup",Eo="plugin:settings:set";let it,Mt;function _o(){var t;return it!==void 0||(typeof window<"u"&&window.performance?(it=!0,Mt=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(it=!0,Mt=globalThis.perf_hooks.performance):it=!1),it}function vo(){return _o()?Mt.now():Date.now()}class ko{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const o={};if(e.settings)for(const l in e.settings){const i=e.settings[l];o[l]=i.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let a=Object.assign({},o);try{const l=localStorage.getItem(s),i=JSON.parse(l);Object.assign(a,i)}catch{}this.fallbacks={getSettings(){return a},setSettings(l){try{localStorage.setItem(s,JSON.stringify(l))}catch{}a=l},now(){return vo()}},n&&n.on(Eo,(l,i)=>{l===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(l,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(l,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function xe(t,e){const n=t,o=Ne(),s=yo(),a=wo&&n.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(bo,t,e);else{const l=a?new ko(n,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:l}),l&&e(l.proxiedTarget)}}/*!
|
|
2
2
|
* pinia v2.3.0
|
|
3
3
|
* (c) 2024 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let lt;const ct=t=>lt=t,Oe=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var M;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(M||(M={}));const z=typeof window<"u",Ce=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function
|
|
5
|
+
*/let lt;const ct=t=>lt=t,Oe=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var M;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(M||(M={}));const z=typeof window<"u",Ce=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function $o(t,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function Lt(t,e,n){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="blob",o.onload=function(){Ve(o.response,e,n)},o.onerror=function(){console.error("could not download file")},o.send()}function Pe(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function Et(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}const _t=typeof navigator=="object"?navigator:{userAgent:""},Ie=/Macintosh/.test(_t.userAgent)&&/AppleWebKit/.test(_t.userAgent)&&!/Safari/.test(_t.userAgent),Ve=z?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Ie?So:"msSaveOrOpenBlob"in _t?No:xo:()=>{};function So(t,e="download",n){const o=document.createElement("a");o.download=e,o.rel="noopener",typeof t=="string"?(o.href=t,o.origin!==location.origin?Pe(o.href)?Lt(t,e,n):(o.target="_blank",Et(o)):Et(o)):(o.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){Et(o)},0))}function No(t,e="download",n){if(typeof t=="string")if(Pe(t))Lt(t,e,n);else{const o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){Et(o)})}else navigator.msSaveOrOpenBlob($o(t,n),e)}function xo(t,e,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof t=="string")return Lt(t,e,n);const s=t.type==="application/octet-stream",a=/constructor/i.test(String(Ce.HTMLElement))||"safari"in Ce,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&a||Ie)&&typeof FileReader<"u"){const i=new FileReader;i.onloadend=function(){let u=i.result;if(typeof u!="string")throw o=null,new Error("Wrong reader.result type");u=l?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=u:location.assign(u),o=null},i.readAsDataURL(t)}else{const i=URL.createObjectURL(t);o?o.location.assign(i):location.href=i,o=null,setTimeout(function(){URL.revokeObjectURL(i)},4e4)}}function x(t,e){const n="๐ "+t;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,e):e==="error"?console.error(n):e==="warn"?console.warn(n):console.log(n)}function Ut(t){return"_a"in t&&"install"in t}function De(){if(!("clipboard"in navigator))return x("Your browser doesn't support the Clipboard API","error"),!0}function Ae(t){return t instanceof Error&&t.message.toLowerCase().includes("document is not focused")?(x('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Oo(t){if(!De())try{await navigator.clipboard.writeText(JSON.stringify(t.state.value)),x("Global state copied to clipboard.")}catch(e){if(Ae(e))return;x("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}}async function Co(t){if(!De())try{Te(t,JSON.parse(await navigator.clipboard.readText())),x("Global state pasted from clipboard.")}catch(e){if(Ae(e))return;x("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(e)}}async function Po(t){try{Ve(new Blob([JSON.stringify(t.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(e){x("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}}let L;function Io(){L||(L=document.createElement("input"),L.type="file",L.accept=".json");function t(){return new Promise((e,n)=>{L.onchange=async()=>{const o=L.files;if(!o)return e(null);const s=o.item(0);return e(s?{text:await s.text(),file:s}:null)},L.oncancel=()=>e(null),L.onerror=n,L.click()})}return t}async function Vo(t){try{const e=await Io()();if(!e)return;const{text:n,file:o}=e;Te(t,JSON.parse(n)),x(`Global state imported from "${o.name}".`)}catch(e){x("Failed to import the state from JSON. Check the console for more details.","error"),console.error(e)}}function Te(t,e){for(const n in e){const o=t.state.value[n];o?Object.assign(o,e[n]):t.state.value[n]=e[n]}}function j(t){return{_custom:{display:t}}}const Re="๐ Pinia (root)",vt="_root";function Do(t){return Ut(t)?{id:vt,label:Re}:{id:t.$id,label:t.$id}}function Ao(t){if(Ut(t)){const n=Array.from(t._s.keys()),o=t._s;return{state:n.map(s=>({editable:!0,key:s,value:t.state.value[s]})),getters:n.filter(s=>o.get(s)._getters).map(s=>{const a=o.get(s);return{editable:!1,key:s,value:a._getters.reduce((l,i)=>(l[i]=a[i],l),{})}})}}const e={state:Object.keys(t.$state).map(n=>({editable:!0,key:n,value:t.$state[n]}))};return t._getters&&t._getters.length&&(e.getters=t._getters.map(n=>({editable:!1,key:n,value:t[n]}))),t._customProperties.size&&(e.customProperties=Array.from(t._customProperties).map(n=>({editable:!0,key:n,value:t[n]}))),e}function To(t){return t?Array.isArray(t)?t.reduce((e,n)=>(e.keys.push(n.key),e.operations.push(n.type),e.oldValue[n.key]=n.oldValue,e.newValue[n.key]=n.newValue,e),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:j(t.type),key:j(t.key),oldValue:t.oldValue,newValue:t.newValue}:{}}function Ro(t){switch(t){case M.direct:return"mutation";case M.patchFunction:return"$patch";case M.patchObject:return"$patch";default:return"unknown"}}let Z=!0;const kt=[],X="pinia:mutations",P="pinia",{assign:Bo}=Object,$t=t=>"๐ "+t;function jo(t,e){xe({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:kt,app:t},n=>{typeof n.now!="function"&&x("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:X,label:"Pinia ๐",color:15064968}),n.addInspector({id:P,label:"Pinia ๐",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Oo(e)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Co(e),n.sendInspectorTree(P),n.sendInspectorState(P)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Po(e)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Vo(e),n.sendInspectorTree(P),n.sendInspectorState(P)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const s=e._s.get(o);s?typeof s.$reset!="function"?x(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(s.$reset(),x(`Store "${o}" reset.`)):x(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((o,s)=>{const a=o.componentInstance&&o.componentInstance.proxy;if(a&&a._pStores){const l=o.componentInstance.proxy._pStores;Object.values(l).forEach(i=>{o.instanceData.state.push({type:$t(i.$id),key:"state",editable:!0,value:i._isOptionsAPI?{_custom:{value:r.toRaw(i.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>i.$reset()}]}}:Object.keys(i.$state).reduce((u,c)=>(u[c]=i.$state[c],u),{})}),i._getters&&i._getters.length&&o.instanceData.state.push({type:$t(i.$id),key:"getters",editable:!1,value:i._getters.reduce((u,c)=>{try{u[c]=i[c]}catch(d){u[c]=d}return u},{})})})}}),n.on.getInspectorTree(o=>{if(o.app===t&&o.inspectorId===P){let s=[e];s=s.concat(Array.from(e._s.values())),o.rootNodes=(o.filter?s.filter(a=>"$id"in a?a.$id.toLowerCase().includes(o.filter.toLowerCase()):Re.toLowerCase().includes(o.filter.toLowerCase())):s).map(Do)}}),globalThis.$pinia=e,n.on.getInspectorState(o=>{if(o.app===t&&o.inspectorId===P){const s=o.nodeId===vt?e:e._s.get(o.nodeId);if(!s)return;s&&(o.nodeId!==vt&&(globalThis.$store=r.toRaw(s)),o.state=Ao(s))}}),n.on.editInspectorState((o,s)=>{if(o.app===t&&o.inspectorId===P){const a=o.nodeId===vt?e:e._s.get(o.nodeId);if(!a)return x(`store "${o.nodeId}" not found`,"error");const{path:l}=o;Ut(a)?l.unshift("state"):(l.length!==1||!a._customProperties.has(l[0])||l[0]in a.$state)&&l.unshift("$state"),Z=!1,o.set(a,l,o.state.value),Z=!0}}),n.on.editComponentState(o=>{if(o.type.startsWith("๐")){const s=o.type.replace(/^๐\s*/,""),a=e._s.get(s);if(!a)return x(`store "${s}" not found`,"error");const{path:l}=o;if(l[0]!=="state")return x(`Invalid path for store "${s}":
|
|
6
6
|
${l}
|
|
7
|
-
Only state can be modified.`);l[0]="$state",Z=!1,o.set(a,l,o.state.value),Z=!0}})})}function Mo(t,e){kt.includes(
|
|
7
|
+
Only state can be modified.`);l[0]="$state",Z=!1,o.set(a,l,o.state.value),Z=!0}})})}function Mo(t,e){kt.includes($t(e.$id))||kt.push($t(e.$id)),xe({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:kt,app:t,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const o=typeof n.now=="function"?n.now.bind(n):Date.now;e.$onAction(({after:l,onError:i,name:u,args:c})=>{const d=Be++;n.addTimelineEvent({layerId:X,event:{time:o(),title:"๐ซ "+u,subtitle:"start",data:{store:j(e.$id),action:j(u),args:c},groupId:d}}),l(f=>{J=void 0,n.addTimelineEvent({layerId:X,event:{time:o(),title:"๐ฌ "+u,subtitle:"end",data:{store:j(e.$id),action:j(u),args:c,result:f},groupId:d}})}),i(f=>{J=void 0,n.addTimelineEvent({layerId:X,event:{time:o(),logType:"error",title:"๐ฅ "+u,subtitle:"end",data:{store:j(e.$id),action:j(u),args:c,error:f},groupId:d}})})},!0),e._customProperties.forEach(l=>{r.watch(()=>r.unref(e[l]),(i,u)=>{n.notifyComponentUpdate(),n.sendInspectorState(P),Z&&n.addTimelineEvent({layerId:X,event:{time:o(),title:"Change",subtitle:l,data:{newValue:i,oldValue:u},groupId:J}})},{deep:!0})}),e.$subscribe(({events:l,type:i},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(P),!Z)return;const c={time:o(),title:Ro(i),data:Bo({store:j(e.$id)},To(l)),groupId:J};i===M.patchFunction?c.subtitle="โคต๏ธ":i===M.patchObject?c.subtitle="๐งฉ":l&&!Array.isArray(l)&&(c.subtitle=l.type),l&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:l}}),n.addTimelineEvent({layerId:X,event:c})},{detached:!0,flush:"sync"});const s=e._hotUpdate;e._hotUpdate=r.markRaw(l=>{s(l),n.addTimelineEvent({layerId:X,event:{time:o(),title:"๐ฅ "+e.$id,subtitle:"HMR update",data:{store:j(e.$id),info:j("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P)});const{$dispose:a}=e;e.$dispose=()=>{a(),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`Disposed "${e.$id}" store ๐`)},n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`"${e.$id}" store installed ๐`)})}let Be=0,J;function je(t,e,n){const o=e.reduce((s,a)=>(s[a]=r.toRaw(t)[a],s),{});for(const s in o)t[s]=function(){const a=Be,l=n?new Proxy(t,{get(...u){return J=a,Reflect.get(...u)},set(...u){return J=a,Reflect.set(...u)}}):t;J=a;const i=o[s].apply(l,arguments);return J=void 0,i}}function Lo({app:t,store:e,options:n}){if(!e.$id.startsWith("__hot:")){if(e._isOptionsAPI=!!n.state,!e._p._testing){je(e,Object.keys(n.actions),e._isOptionsAPI);const o=e._hotUpdate;r.toRaw(e)._hotUpdate=function(s){o.apply(this,arguments),je(e,Object.keys(s._hmrPayload.actions),!!e._isOptionsAPI)}}Mo(t,e)}}function Uo(){const t=r.effectScope(!0),e=t.run(()=>r.ref({}));let n=[],o=[];const s=r.markRaw({install(a){ct(s),s._a=a,a.provide(Oe,s),a.config.globalProperties.$pinia=s,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&z&&jo(a,s),o.forEach(l=>n.push(l)),o=[]},use(a){return!this._a&&!Se?o.push(a):n.push(a),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&z&&typeof Proxy<"u"&&s.use(Lo),s}function Me(t,e){for(const n in e){const o=e[n];if(!(n in t))continue;const s=t[n];Y(s)&&Y(o)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=Me(s,o):t[n]=o}return t}const Le=()=>{};function Ue(t,e,n,o=Le){t.push(e);const s=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),o())};return!n&&r.getCurrentScope()&&r.onScopeDispose(s),s}function tt(t,...e){t.slice().forEach(n=>{n(...e)})}const Wo=t=>t(),We=Symbol(),Wt=Symbol();function Ht(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],s=t[n];Y(s)&&Y(o)&&t.hasOwnProperty(n)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=Ht(s,o):t[n]=o}return t}const Ho=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Fo(t){return!Y(t)||!t.hasOwnProperty(Ho)}const{assign:D}=Object;function He(t){return!!(r.isRef(t)&&t.effect)}function Fe(t,e,n,o){const{state:s,actions:a,getters:l}=e,i=n.state.value[t];let u;function c(){!i&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[t]=s?s():{});const d=process.env.NODE_ENV!=="production"&&o?r.toRefs(r.ref(s?s():{}).value):r.toRefs(n.state.value[t]);return D(d,a,Object.keys(l||{}).reduce((f,p)=>(process.env.NODE_ENV!=="production"&&p in d&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${t}".`),f[p]=r.markRaw(r.computed(()=>{ct(n);const w=n._s.get(t);return l[p].call(w,w)})),f),{}))}return u=Ft(t,c,e,n,o,!0),u}function Ft(t,e,n={},o,s,a){let l;const i=D({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!Se&&(u.onTrigger=b=>{c?w=b:c==!1&&!g._hotUpdating&&(Array.isArray(w)?w.push(b):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,d,f=[],p=[],w;const h=o.state.value[t];!a&&!h&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const E=r.ref({});let _;function $(b){let m;c=d=!1,process.env.NODE_ENV!=="production"&&(w=[]),typeof b=="function"?(b(o.state.value[t]),m={type:M.patchFunction,storeId:t,events:w}):(Ht(o.state.value[t],b),m={type:M.patchObject,payload:b,storeId:t,events:w});const y=_=Symbol();r.nextTick().then(()=>{_===y&&(c=!0)}),d=!0,tt(f,m,o.state.value[t])}const S=a?function(){const{state:b}=n,m=b?b():{};this.$patch(y=>{D(y,m)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:Le;function q(){l.stop(),f=[],p=[],o._s.delete(t)}const R=(b,m="")=>{if(We in b)return b[Wt]=m,b;const y=function(){ct(o);const k=Array.from(arguments),O=[],F=[];function wt(C){O.push(C)}function ge(C){F.push(C)}tt(p,{args:k,name:y[Wt],store:g,after:wt,onError:ge});let K;try{K=b.apply(this&&this.$id===t?this:g,k)}catch(C){throw tt(F,C),C}return K instanceof Promise?K.then(C=>(tt(O,C),C)).catch(C=>(tt(F,C),Promise.reject(C))):(tt(O,K),K)};return y[We]=!0,y[Wt]=m,y},N=r.markRaw({actions:{},getters:{},state:[],hotState:E}),G={_p:o,$id:t,$onAction:Ue.bind(null,p),$patch:$,$reset:S,$subscribe(b,m={}){const y=Ue(f,b,m.detached,()=>k()),k=l.run(()=>r.watch(()=>o.state.value[t],O=>{(m.flush==="sync"?d:c)&&b({storeId:t,type:M.direct,events:w},O)},D({},u,m)));return y},$dispose:q},g=r.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&z?D({_hmrPayload:N,_customProperties:r.markRaw(new Set)},G):G);o._s.set(t,g);const v=(o._a&&o._a.runWithContext||Wo)(()=>o._e.run(()=>(l=r.effectScope()).run(()=>e({action:R}))));for(const b in v){const m=v[b];if(r.isRef(m)&&!He(m)||r.isReactive(m))process.env.NODE_ENV!=="production"&&s?bt(E.value,b,r.toRef(v,b)):a||(h&&Fo(m)&&(r.isRef(m)?m.value=h[b]:Ht(m,h[b])),o.state.value[t][b]=m),process.env.NODE_ENV!=="production"&&N.state.push(b);else if(typeof m=="function"){const y=process.env.NODE_ENV!=="production"&&s?m:R(m,b);v[b]=y,process.env.NODE_ENV!=="production"&&(N.actions[b]=m),i.actions[b]=m}else process.env.NODE_ENV!=="production"&&He(m)&&(N.getters[b]=a?n.getters[b]:m,z&&(v._getters||(v._getters=r.markRaw([]))).push(b))}if(D(g,v),D(r.toRaw(g),v),Object.defineProperty(g,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?E.value:o.state.value[t],set:b=>{if(process.env.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");$(m=>{D(m,b)})}}),process.env.NODE_ENV!=="production"&&(g._hotUpdate=r.markRaw(b=>{g._hotUpdating=!0,b._hmrPayload.state.forEach(m=>{if(m in g.$state){const y=b.$state[m],k=g.$state[m];typeof y=="object"&&Y(y)&&Y(k)?Me(y,k):b.$state[m]=k}bt(g,m,r.toRef(b.$state,m))}),Object.keys(g.$state).forEach(m=>{m in b.$state||jt(g,m)}),c=!1,d=!1,o.state.value[t]=r.toRef(b._hmrPayload,"hotState"),d=!0,r.nextTick().then(()=>{c=!0});for(const m in b._hmrPayload.actions){const y=b[m];bt(g,m,R(y,m))}for(const m in b._hmrPayload.getters){const y=b._hmrPayload.getters[m],k=a?r.computed(()=>(ct(o),y.call(g,g))):y;bt(g,m,k)}Object.keys(g._hmrPayload.getters).forEach(m=>{m in b._hmrPayload.getters||jt(g,m)}),Object.keys(g._hmrPayload.actions).forEach(m=>{m in b._hmrPayload.actions||jt(g,m)}),g._hmrPayload=b._hmrPayload,g._getters=b._getters,g._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&z){const b={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(m=>{Object.defineProperty(g,m,D({value:g[m]},b))})}return o._p.forEach(b=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&z){const m=l.run(()=>b({store:g,app:o._a,pinia:o,options:i}));Object.keys(m||{}).forEach(y=>g._customProperties.add(y)),D(g,m)}else D(g,l.run(()=>b({store:g,app:o._a,pinia:o,options:i})))}),process.env.NODE_ENV!=="production"&&g.$state&&typeof g.$state=="object"&&typeof g.$state.constructor=="function"&&!g.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
8
8
|
state: () => new MyClass()
|
|
9
9
|
Found in store "${g.$id}".`),h&&a&&n.hydrate&&n.hydrate(g.$state,h),c=!0,d=!0,g}/*! #__NO_SIDE_EFFECTS__ */function zo(t,e,n){let o,s;const a=typeof e=="function";o=t,s=a?n:e;function l(i,u){const c=r.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&<&<._testing?null:i)||(c?r.inject(Oe,null):null),i&&ct(i),process.env.NODE_ENV!=="production"&&!lt)throw new Error(`[๐]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
10
10
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
11
|
-
This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,D({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&z){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Jo=zo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){const e=r.ref();return r.onMounted(async()=>{var n,o,s;t||(t=r.inject("$registry"));let a;try{a=Jo()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(e.value=new go(t,a),!t||!t.router)return;const l=t.router.currentRoute.value,i=(n=l.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=l.params.record)==null?void 0:o.toString().toLowerCase();if(!i&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,i));c&&(t.addDoctype(c),e.value.setup(c),i&&(u?await e.value.getRecord(c,u):await e.value.getRecords(c)),e.value.runAction(c,"LOAD",u?[u]:void 0))}),{stonecrop:e}}V(class Dt{constructor(e,n){if(V(this,"name"),V(this,"registry"),V(this,"router"),V(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Go(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Yo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function $t(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Xo=$t,Qo="native";function qo(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Ko(t){t.bc.close(),t.subFns=[]}function Zo(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function tr(t,e){t.messagesCallback=e}function er(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function nr(){return 150}var or={create:qo,close:Ko,onMessage:tr,postMessage:Zo,canBeUsed:er,type:Qo,averageResponseTime:nr,microSeconds:Xo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,rr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function rr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var sr=$t,ar="pubkey.broadcast-channel-0-",U="messages",Nt={durability:"relaxed"},ir="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function lr(t){var e=Qe(),n=ar+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(U,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function cr(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([U],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(U);u.add(s),Yt(a)})}function ur(t,e){var n=t.transaction(U,"readonly",Nt),o=n.objectStore(U),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function dr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(U,"readwrite",Nt),o=n.objectStore(U);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function fr(t,e){var n=new Date().getTime()-e,o=t.transaction(U,"readonly",Nt),s=o.objectStore(U),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function pr(t){return fr(t.db,t.options.idb.ttl).then(function(e){return dr(t,e.map(function(n){return n.id}))})}function mr(t,e){return e=Gt(e),lr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function hr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:ur(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return hr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function gr(t){t.closed=!0,t.db.close()}function yr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return cr(t.db,t.uuid,e)}).then(function(){Yo(0,10)===0&&pr(t)}),t.writeBlockPromise}function wr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function br(){return!!Qe()}function Er(t){return t.idb.fallbackInterval*2}var _r={create:mr,close:gr,onMessage:wr,postMessage:yr,canBeUsed:br,type:ir,averageResponseTime:Er,microSeconds:sr},vr=$t,kr="pubkey.broadcastChannel-",Sr="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return kr+t}function $r(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function Nr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function xr(t){window.removeEventListener("storage",t)}function Or(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=Nr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Cr(t){xr(t.listener)}function Ir(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Pr(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Vr={create:Or,close:Cr,onMessage:Ir,postMessage:$r,canBeUsed:en,type:Sr,averageResponseTime:Pr,microSeconds:vr},Dr=$t,Tr="simulate",Xt=new Set;function Ar(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Br(t){Xt.delete(t)}function Rr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function jr(t,e){t.messagesCallback=e}function Mr(){return!0}function Lr(){return 5}var Ur={create:Ar,close:Br,onMessage:jr,postMessage:Rr,canBeUsed:Mr,type:Tr,averageResponseTime:Lr,microSeconds:Dr},nn=[or,_r,Vr];function Wr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Ur;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Hr=0,Qt=function(t,e){this.id=Hr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Wr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Fr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function Fr(t){var e=t.method.create(t.name,t.options);Go(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),zr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Jr(t)}function zr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Jr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Gr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Gr}function Xr(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
11
|
+
This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,D({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&z){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Jo=zo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){const e=r.ref();return r.onMounted(async()=>{var n,o,s;t||(t=r.inject("$registry"));let a;try{a=Jo()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(e.value=new go(t,a),!t||!t.router)return;const l=t.router.currentRoute.value,i=(n=l.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=l.params.record)==null?void 0:o.toString().toLowerCase();if(!i&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,i));c&&(t.addDoctype(c),e.value.setup(c),i&&(u?await e.value.getRecord(c,u):await e.value.getRecords(c)),e.value.runAction(c,"LOAD",u?[u]:void 0))}),{stonecrop:e}}V(class Dt{constructor(e,n){if(V(this,"name"),V(this,"registry"),V(this,"router"),V(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Go(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Yo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function St(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Xo=St,Qo="native";function qo(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Ko(t){t.bc.close(),t.subFns=[]}function Zo(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function tr(t,e){t.messagesCallback=e}function er(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function nr(){return 150}var or={create:qo,close:Ko,onMessage:tr,postMessage:Zo,canBeUsed:er,type:Qo,averageResponseTime:nr,microSeconds:Xo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,rr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function rr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var sr=St,ar="pubkey.broadcast-channel-0-",U="messages",Nt={durability:"relaxed"},ir="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function lr(t){var e=Qe(),n=ar+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(U,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function cr(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([U],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(U);u.add(s),Yt(a)})}function ur(t,e){var n=t.transaction(U,"readonly",Nt),o=n.objectStore(U),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function dr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(U,"readwrite",Nt),o=n.objectStore(U);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function fr(t,e){var n=new Date().getTime()-e,o=t.transaction(U,"readonly",Nt),s=o.objectStore(U),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function pr(t){return fr(t.db,t.options.idb.ttl).then(function(e){return dr(t,e.map(function(n){return n.id}))})}function mr(t,e){return e=Gt(e),lr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function hr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:ur(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return hr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function gr(t){t.closed=!0,t.db.close()}function yr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return cr(t.db,t.uuid,e)}).then(function(){Yo(0,10)===0&&pr(t)}),t.writeBlockPromise}function wr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function br(){return!!Qe()}function Er(t){return t.idb.fallbackInterval*2}var _r={create:mr,close:gr,onMessage:wr,postMessage:yr,canBeUsed:br,type:ir,averageResponseTime:Er,microSeconds:sr},vr=St,kr="pubkey.broadcastChannel-",$r="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return kr+t}function Sr(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function Nr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function xr(t){window.removeEventListener("storage",t)}function Or(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=Nr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Cr(t){xr(t.listener)}function Pr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Ir(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Vr={create:Or,close:Cr,onMessage:Pr,postMessage:Sr,canBeUsed:en,type:$r,averageResponseTime:Ir,microSeconds:vr},Dr=St,Ar="simulate",Xt=new Set;function Tr(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Rr(t){Xt.delete(t)}function Br(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function jr(t,e){t.messagesCallback=e}function Mr(){return!0}function Lr(){return 5}var Ur={create:Tr,close:Rr,onMessage:jr,postMessage:Br,canBeUsed:Mr,type:Ar,averageResponseTime:Lr,microSeconds:Dr},nn=[or,_r,Vr];function Wr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Ur;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Hr=0,Qt=function(t,e){this.id=Hr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Wr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Fr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function Fr(t){var e=t.method.create(t.name,t.options);Go(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),zr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Jr(t)}function zr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Jr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Gr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Gr}function Xr(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
12
12
|
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function nt(t){let e="",n=0;const o=t.length;for(let s=0;s<o;s+=1){const a=t[s],l=Qr(a);l&&(e+=t.slice(n,s)+l,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Kt=-1,un=-2,dn=-3,fn=-4,pn=-5,Zt=-6;function mn(t,e){return qr(JSON.parse(t))}function qr(t,e){if(typeof t=="number")return s(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,o=Array(n.length);function s(a,l=!1){if(a===Kt)return;if(a===dn)return NaN;if(a===fn)return 1/0;if(a===pn)return-1/0;if(a===Zt)return-0;if(l)throw new Error("Invalid input");if(a in o)return o[a];const i=n[a];if(!i||typeof i!="object")o[a]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0];switch(u){case"Date":o[a]=new Date(i[1]);break;case"Set":const c=new Set;o[a]=c;for(let p=1;p<i.length;p+=1)c.add(s(i[p]));break;case"Map":const d=new Map;o[a]=d;for(let p=1;p<i.length;p+=2)d.set(s(i[p]),s(i[p+1]));break;case"RegExp":o[a]=new RegExp(i[1],i[2]);break;case"Object":o[a]=Object(i[1]);break;case"BigInt":o[a]=BigInt(i[1]);break;case"null":const f=Object.create(null);o[a]=f;for(let p=1;p<i.length;p+=2)f[i[p]]=s(i[p+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(i.length);o[a]=u;for(let c=0;c<i.length;c+=1){const d=i[c];d!==un&&(u[c]=s(d))}}else{const u={};o[a]=u;for(const c in i){const d=i[c];u[c]=s(d)}}return o[a]}return s(0)}function hn(t,e){const n=[],o=new Map,s=[];for(const c in e)s.push({key:c,fn:e[c]});const a=[];let l=0;function i(c){if(typeof c=="function")throw new qt("Cannot stringify a function",a);if(o.has(c))return o.get(c);if(c===void 0)return Kt;if(Number.isNaN(c))return dn;if(c===1/0)return fn;if(c===-1/0)return pn;if(c===0&&1/c<0)return Zt;const d=l++;o.set(c,d);for(const{key:p,fn:w}of s){const h=w(c);if(h)return n[d]=`["${p}",${i(h)}]`,d}let f="";if(cn(c))f=te(c);else switch(Xr(c)){case"Number":case"String":case"Boolean":f=`["Object",${te(c)}]`;break;case"BigInt":f=`["BigInt",${c}]`;break;case"Date":f=`["Date","${isNaN(c.getDate())?"":c.toISOString()}"]`;break;case"RegExp":const{source:p,flags:w}=c;f=w?`["RegExp",${nt(p)},"${w}"]`:`["RegExp",${nt(p)}]`;break;case"Array":f="[";for(let h=0;h<c.length;h+=1)h>0&&(f+=","),h in c?(a.push(`[${h}]`),f+=i(c[h]),a.pop()):f+=un;f+="]";break;case"Set":f='["Set"';for(const h of c)f+=`,${i(h)}`;f+="]";break;case"Map":f='["Map"';for(const[h,E]of c)a.push(`.get(${cn(h)?te(h):"..."})`),f+=`,${i(h)},${i(E)}`,a.pop();f+="]";break;default:if(!Yr(c))throw new qt("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(c).length>0)throw new qt("Cannot stringify POJOs with symbolic keys",a);if(Object.getPrototypeOf(c)===null){f='["null"';for(const h in c)a.push(`.${h}`),f+=`,${nt(h)},${i(c[h])}`,a.pop();f+="]"}else{f="{";let h=!1;for(const E in c)h&&(f+=","),h=!0,a.push(`.${E}`),f+=`${nt(E)}:${i(c[E])}`,a.pop();f+="}"}}return n[d]=f,d}const u=i(t);return u<0?`${u}`:`[${n.join(",")}]`}function te(t){const e=typeof t;return e==="string"?nt(t):t instanceof String?nt(t.toString()):t===void 0?Kt.toString():t===0&&1/t<0?Zt.toString():e==="bigint"?`["BigInt","${t}"]`:String(t)}function Kr(t,e,{initialize:n,type:o}){let s=`${e.$id}-${t.toString()}`,a=new Qt(s,{type:o}),l=!1,i=0;r.watch(()=>e[t],d=>{l||(i=Date.now(),a.postMessage({timestamp:i,state:mn(hn(d))})),l=!1},{deep:!0}),a.onmessage=d=>{if(d===void 0){a.postMessage({timestamp:i,state:mn(hn(e[t]))});return}d.timestamp<=i||(l=!0,i=d.timestamp,e[t]=d.state)};let u=()=>a.postMessage(void 0),c=()=>a.close();return n&&u(),{sync:u,unshare:c}}var Zr=(t,e)=>Object.keys(e).includes(t),ts=({initialize:t=!0,enable:e=!0,type:n})=>({store:o,options:s})=>{var a,l;let i=((a=s==null?void 0:s.share)==null?void 0:a.enable)??e,u=((l=s==null?void 0:s.share)==null?void 0:l.omit)??[];!i||Object.keys(o.$state).forEach(c=>{var d;u.includes(c)||!Zr(c,o.$state)||Kr(c,o,{initialize:((d=s==null?void 0:s.share)==null?void 0:d.initialize)??t,type:n})})};Uo().use(ts({enable:!0,initialize:!0}));const gn=r.defineComponent({__name:"Doctype",setup(t){const{stonecrop:e,isReady:n}=ze(),o=r.ref([]);return r.watch(n,()=>{if(n.value){let s=e.value.schema.schema.toArray();s.forEach((a,l)=>{const u=e.value.store.record[a.fieldname];s[l].value=u}),o.value=s}}),(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(po),{key:0,class:"aform-main",modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l)},null,8,["modelValue"])):r.createCommentVNode("",!0)}});var es=!1;function xt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function ee(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}/*!
|
|
13
13
|
* pinia v2.3.0
|
|
14
14
|
* (c) 2024 Eduardo San Martin Morote
|
|
15
15
|
* @license MIT
|
|
16
|
-
*/let ut;const Ot=t=>ut=t,ns=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Q(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var dt;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(dt||(dt={}));const ft=typeof window<"u";function yn(t,e){for(const n in e){const o=e[n];if(!(n in t))continue;const s=t[n];Q(s)&&Q(o)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=yn(s,o):t[n]=o}return t}const wn=()=>{};function bn(t,e,n,o=wn){t.push(e);const s=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),o())};return!n&&r.getCurrentScope()&&r.onScopeDispose(s),s}function ot(t,...e){t.slice().forEach(n=>{n(...e)})}const os=t=>t(),En=Symbol(),ne=Symbol();function oe(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],s=t[n];Q(s)&&Q(o)&&t.hasOwnProperty(n)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=oe(s,o):t[n]=o}return t}const rs=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function ss(t){return!Q(t)||!t.hasOwnProperty(rs)}const{assign:
|
|
16
|
+
*/let ut;const Ot=t=>ut=t,ns=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Q(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var dt;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(dt||(dt={}));const ft=typeof window<"u";function yn(t,e){for(const n in e){const o=e[n];if(!(n in t))continue;const s=t[n];Q(s)&&Q(o)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=yn(s,o):t[n]=o}return t}const wn=()=>{};function bn(t,e,n,o=wn){t.push(e);const s=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),o())};return!n&&r.getCurrentScope()&&r.onScopeDispose(s),s}function ot(t,...e){t.slice().forEach(n=>{n(...e)})}const os=t=>t(),En=Symbol(),ne=Symbol();function oe(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],s=t[n];Q(s)&&Q(o)&&t.hasOwnProperty(n)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=oe(s,o):t[n]=o}return t}const rs=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function ss(t){return!Q(t)||!t.hasOwnProperty(rs)}const{assign:A}=Object;function _n(t){return!!(r.isRef(t)&&t.effect)}function vn(t,e,n,o){const{state:s,actions:a,getters:l}=e,i=n.state.value[t];let u;function c(){!i&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[t]=s?s():{});const d=process.env.NODE_ENV!=="production"&&o?r.toRefs(r.ref(s?s():{}).value):r.toRefs(n.state.value[t]);return A(d,a,Object.keys(l||{}).reduce((f,p)=>(process.env.NODE_ENV!=="production"&&p in d&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${t}".`),f[p]=r.markRaw(r.computed(()=>{Ot(n);const w=n._s.get(t);return l[p].call(w,w)})),f),{}))}return u=re(t,c,e,n,o,!0),u}function re(t,e,n={},o,s,a){let l;const i=A({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!es&&(u.onTrigger=m=>{c?w=m:c==!1&&!g._hotUpdating&&(Array.isArray(w)?w.push(m):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,d,f=[],p=[],w;const h=o.state.value[t];!a&&!h&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const E=r.ref({});let _;function $(m){let y;c=d=!1,process.env.NODE_ENV!=="production"&&(w=[]),typeof m=="function"?(m(o.state.value[t]),y={type:dt.patchFunction,storeId:t,events:w}):(oe(o.state.value[t],m),y={type:dt.patchObject,payload:m,storeId:t,events:w});const k=_=Symbol();r.nextTick().then(()=>{_===k&&(c=!0)}),d=!0,ot(f,y,o.state.value[t])}const S=a?function(){const{state:y}=n,k=y?y():{};this.$patch(O=>{A(O,k)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:wn;function q(){l.stop(),f=[],p=[],o._s.delete(t)}const R=(m,y="")=>{if(En in m)return m[ne]=y,m;const k=function(){Ot(o);const O=Array.from(arguments),F=[],wt=[];function ge(B){F.push(B)}function K(B){wt.push(B)}ot(p,{args:O,name:k[ne],store:g,after:ge,onError:K});let C;try{C=m.apply(this&&this.$id===t?this:g,O)}catch(B){throw ot(wt,B),B}return C instanceof Promise?C.then(B=>(ot(F,B),B)).catch(B=>(ot(wt,B),Promise.reject(B))):(ot(F,C),C)};return k[En]=!0,k[ne]=y,k},N=r.markRaw({actions:{},getters:{},state:[],hotState:E}),G={_p:o,$id:t,$onAction:bn.bind(null,p),$patch:$,$reset:S,$subscribe(m,y={}){const k=bn(f,m,y.detached,()=>O()),O=l.run(()=>r.watch(()=>o.state.value[t],F=>{(y.flush==="sync"?d:c)&&m({storeId:t,type:dt.direct,events:w},F)},A({},u,y)));return k},$dispose:q},g=r.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft?A({_hmrPayload:N,_customProperties:r.markRaw(new Set)},G):G);o._s.set(t,g);const b=(o._a&&o._a.runWithContext||os)(()=>o._e.run(()=>(l=r.effectScope()).run(()=>e({action:R}))));for(const m in b){const y=b[m];if(r.isRef(y)&&!_n(y)||r.isReactive(y))process.env.NODE_ENV!=="production"&&s?xt(E.value,m,r.toRef(b,m)):a||(h&&ss(y)&&(r.isRef(y)?y.value=h[m]:oe(y,h[m])),o.state.value[t][m]=y),process.env.NODE_ENV!=="production"&&N.state.push(m);else if(typeof y=="function"){const k=process.env.NODE_ENV!=="production"&&s?y:R(y,m);b[m]=k,process.env.NODE_ENV!=="production"&&(N.actions[m]=y),i.actions[m]=y}else process.env.NODE_ENV!=="production"&&_n(y)&&(N.getters[m]=a?n.getters[m]:y,ft&&(b._getters||(b._getters=r.markRaw([]))).push(m))}if(A(g,b),A(r.toRaw(g),b),Object.defineProperty(g,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?E.value:o.state.value[t],set:m=>{if(process.env.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");$(y=>{A(y,m)})}}),process.env.NODE_ENV!=="production"&&(g._hotUpdate=r.markRaw(m=>{g._hotUpdating=!0,m._hmrPayload.state.forEach(y=>{if(y in g.$state){const k=m.$state[y],O=g.$state[y];typeof k=="object"&&Q(k)&&Q(O)?yn(k,O):m.$state[y]=O}xt(g,y,r.toRef(m.$state,y))}),Object.keys(g.$state).forEach(y=>{y in m.$state||ee(g,y)}),c=!1,d=!1,o.state.value[t]=r.toRef(m._hmrPayload,"hotState"),d=!0,r.nextTick().then(()=>{c=!0});for(const y in m._hmrPayload.actions){const k=m[y];xt(g,y,R(k,y))}for(const y in m._hmrPayload.getters){const k=m._hmrPayload.getters[y],O=a?r.computed(()=>(Ot(o),k.call(g,g))):k;xt(g,y,O)}Object.keys(g._hmrPayload.getters).forEach(y=>{y in m._hmrPayload.getters||ee(g,y)}),Object.keys(g._hmrPayload.actions).forEach(y=>{y in m._hmrPayload.actions||ee(g,y)}),g._hmrPayload=m._hmrPayload,g._getters=m._getters,g._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft){const m={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(y=>{Object.defineProperty(g,y,A({value:g[y]},m))})}return o._p.forEach(m=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft){const y=l.run(()=>m({store:g,app:o._a,pinia:o,options:i}));Object.keys(y||{}).forEach(k=>g._customProperties.add(k)),A(g,y)}else A(g,l.run(()=>m({store:g,app:o._a,pinia:o,options:i})))}),process.env.NODE_ENV!=="production"&&g.$state&&typeof g.$state=="object"&&typeof g.$state.constructor=="function"&&!g.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
17
17
|
state: () => new MyClass()
|
|
18
18
|
Found in store "${g.$id}".`),h&&a&&n.hydrate&&n.hydrate(g.$state,h),c=!0,d=!0,g}/*! #__NO_SIDE_EFFECTS__ */function as(t,e,n){let o,s;const a=typeof e=="function";if(typeof t=="string")o=t,s=a?n:e;else if(s=t,o=t.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[๐]: "defineStore()" must be passed a store id as its first argument.');function l(i,u){const c=r.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&ut&&ut._testing?null:i)||(c?r.inject(ns,null):null),i&&Ot(i),process.env.NODE_ENV!=="production"&&!ut)throw new Error(`[๐]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
19
19
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
20
|
-
This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?re(f,e,s,i,!0):vn(f,T({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&ft){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}function kn(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function se(t){return typeof t=="function"?t():r.unref(t)}const is=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ls=t=>t!=null,cs=Object.prototype.toString,us=t=>cs.call(t)==="[object Object]",ds=()=>{},pt=is?window:void 0;function mt(t){var e;const n=se(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ht(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=pt):[e,n,o,s]=t,!e)return ds;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[mt(e),se(s)],([d,f])=>{if(l(),!d)return;const p=us(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return kn(c),c}function fs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function ps(t){const e=fs();return r.computed(()=>(e.value,!!t()))}function ms(t,e,n={}){const{window:o=pt,...s}=n;let a;const l=ps(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=se(t),w=(Array.isArray(p)?p:[p]).map(mt).filter(ls);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return kn(f),{isSupported:l,stop:f,takeRecords:d}}function hs(t={}){var e;const{window:n=pt,deep:o=!0,triggerOnRemoval:s=!1}=t,a=(e=t.document)!=null?e:n==null?void 0:n.document,l=()=>{var c;let d=a==null?void 0:a.activeElement;if(o)for(;d!=null&&d.shadowRoot;)d=(c=d==null?void 0:d.shadowRoot)==null?void 0:c.activeElement;return d},i=r.ref(),u=()=>{i.value=l()};return n&&(ht(n,"blur",c=>{c.relatedTarget===null&&u()},!0),ht(n,"focus",u,!0)),s&&ms(a,c=>{c.filter(d=>d.removedNodes.length).map(d=>Array.from(d.removedNodes)).flat().forEach(d=>{d===i.value&&u()})},{childList:!0,subtree:!0}),u(),i}const gs="focusin",ys="focusout";function ws(t,e={}){const{window:n=pt}=e,o=r.computed(()=>mt(t)),s=r.ref(!1),a=r.computed(()=>s.value),l=hs(e);return!n||!l.value?{focused:a}:(ht(o,gs,()=>s.value=!0),ht(o,ys,()=>s.value=!1),{focused:a})}function bs(t,{window:e=pt,scrollTarget:n}={}){const o=r.ref(!1),s=()=>{if(!e)return;const a=e.document,l=mt(t);if(!l)o.value=!1;else{const i=l.getBoundingClientRect();o.value=i.top<=(e.innerHeight||a.documentElement.clientHeight)&&i.left<=(e.innerWidth||a.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return r.watch(()=>mt(t),()=>s(),{immediate:!0,flush:"post"}),e&&ht(n||e,"scroll",s,{capture:!1,passive:!0}),o}const W=t=>{let e=bs(t).value;return e=e&&t.offsetHeight>0,e},H=t=>t.tabIndex>=0,Sn=t=>{const e=t.target;return ae(e)},ae=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.previousElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ae(n):n},Es=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.firstElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.firstElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ie(o):o},$n=t=>{const e=t.target;return ie(e)},ie=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.nextElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ie(n):n},_s=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.lastElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.lastElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ae(o):o},Nn=t=>{const e=t.target;return le(e)},le=t=>{var e;let n;if(t.previousElementSibling)n=t.previousElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;n=o==null?void 0:o.lastElementChild}return n&&(!H(n)||!W(n))?le(n):n},xn=t=>{const e=t.target;return ce(e)},ce=t=>{var e;let n;if(t.nextElementSibling)n=t.nextElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;n=o==null?void 0:o.firstElementChild}return n&&(!H(n)||!W(n))?ce(n):n},On=t=>{const e=t.target.parentElement,n=e==null?void 0:e.firstElementChild;return n&&(!H(n)||!W(n))?ce(n):n},Cn=t=>{const e=t.target.parentElement,n=e==null?void 0:e.lastElementChild;return n&&(!H(n)||!W(n))?le(n):n},Ct=["alt","control","shift","meta"],vs={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const e=Sn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.down":t=>{const e=$n(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.left":t=>{const e=Nn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.right":t=>{const e=xn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.control.up":t=>{const e=Es(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.down":t=>{const e=_s(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.left":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.right":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.end":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=$n(t);e&&e.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=Sn(t);e&&e.focus()}},"keydown.home":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.tab":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.shift.tab":t=>{const e=Nn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())}};function In(t){const e=l=>{let i=null;return l.parent&&(typeof l.parent=="string"?i=document.querySelector(l.parent):l.parent instanceof HTMLElement?i=l.parent:i=l.parent.value),i},n=l=>{var i;const u=e(l);let c=[];if(typeof l.selectors=="string")c=u?Array.from(u.querySelectorAll(l.selectors)):Array.from(document.querySelectorAll(l.selectors));else if(Array.isArray(l.selectors))for(const d of l.selectors)d instanceof HTMLElement?c.push(d):c.push(d.$el);else if(l.selectors instanceof HTMLElement)c.push(l.selectors);else if((i=l.selectors)!=null&&i.value)if(Array.isArray(l.selectors.value))for(const d of l.selectors.value)d instanceof HTMLElement?c.push(d):c.push(d.$el);else c.push(l.selectors.value);return c},o=l=>{const i=e(l);let u=[];return l.selectors?u=n(l):i&&(u=Array.from(i.children).filter(c=>H(c)&&W(c))),u},s=l=>i=>{const u=vs[i.key]||i.key.toLowerCase();if(Ct.includes(u))return;const c=l.handlers||ue;for(const d of Object.keys(c)){const[f,...p]=d.split(".");if(f==="keydown"&&p.includes(u)){const w=c[d],h=p.filter(_=>Ct.includes(_)),E=Ct.some(_=>{const S=_.charAt(0).toUpperCase()+_.slice(1);return i.getModifierState(S)});if(h.length>0){if(E){for(const _ of Ct)if(p.includes(_)){const S=_.charAt(0).toUpperCase()+_.slice(1);i.getModifierState(S)&&w(i)}}}else E||w(i)}}},a=[];r.onMounted(()=>{for(const l of t){const i=e(l),u=o(l),c=s(l),d=i?[i]:u;for(const f of d){const{focused:p}=ws(r.ref(f)),w=r.watch(p,h=>{h?f.addEventListener("keydown",c):f.removeEventListener("keydown",c)});a.push(w)}}}),r.onBeforeUnmount(()=>{for(const l of a)l()})}function gt(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function A(t){return typeof t=="function"?t():r.unref(t)}const de=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ks=t=>t!=null,Ss=Object.prototype.toString,Pn=t=>Ss.call(t)==="[object Object]",rt=()=>{},fe=$s();function $s(){var t,e;return de&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ns(t){return r.getCurrentInstance()}function xs(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:rt}))):r.ref(e)}function Os(t,e=!0,n){Ns()?r.onMounted(t,n):e?t():r.nextTick(t)}const It=de?window:void 0;function st(t){var e;const n=A(t);return(e=n==null?void 0:n.$el)!=null?e:n}function pe(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=It):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[st(e),A(s)],([d,f])=>{if(l(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}function Cs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function Vn(t){const e=Cs();return r.computed(()=>(e.value,!!t()))}function Dn(t,e,n={}){const{window:o=It,...s}=n;let a;const l=Vn(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=A(t),w=(Array.isArray(p)?p:[p]).map(st).filter(ks);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return gt(f),{isSupported:l,stop:f,takeRecords:d}}function Is(t,e,n={}){const{window:o=It,...s}=n;let a;const l=Vn(()=>o&&"ResizeObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const f=A(t);return Array.isArray(f)?f.map(p=>st(p)):[st(f)]}),c=r.watch(u,f=>{if(i(),l.value&&o){a=new ResizeObserver(e);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),d=()=>{i(),c()};return gt(d),{isSupported:l,stop:d}}function Tn(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:s=!0,immediate:a=!0,updateTiming:l="sync"}=e,i=r.ref(0),u=r.ref(0),c=r.ref(0),d=r.ref(0),f=r.ref(0),p=r.ref(0),w=r.ref(0),h=r.ref(0);function E(){const S=st(t);if(!S){n&&(i.value=0,u.value=0,c.value=0,d.value=0,f.value=0,p.value=0,w.value=0,h.value=0);return}const $=S.getBoundingClientRect();i.value=$.height,u.value=$.bottom,c.value=$.left,d.value=$.right,f.value=$.top,p.value=$.width,w.value=$.x,h.value=$.y}function _(){l==="sync"?E():l==="next-frame"&&requestAnimationFrame(()=>E())}return Is(t,_),r.watch(()=>st(t),S=>!S&&_()),Dn(t,_,{attributeFilter:["style","class"]}),s&&pe("scroll",_,{capture:!0,passive:!0}),o&&pe("resize",_,{passive:!0}),Os(()=>{a&&_()}),{height:i,bottom:u,left:c,right:d,top:f,width:p,x:w,y:h,update:_}}function Ps(t={}){const{window:e=It,behavior:n="auto"}=t;if(!e)return{x:r.ref(0),y:r.ref(0)};const o=r.ref(e.scrollX),s=r.ref(e.scrollY),a=r.computed({get(){return o.value},set(i){scrollTo({left:i,behavior:n})}}),l=r.computed({get(){return s.value},set(i){scrollTo({top:i,behavior:n})}});return pe(e,"scroll",()=>{o.value=e.scrollX,s.value=e.scrollY},{capture:!1,passive:!0}),{x:a,y:l}}const Vs=t=>{const e=new DOMParser().parseFromString(t,"text/html");return Array.from(e.body.childNodes).some(n=>n.nodeType===1)},Ds=(t=8)=>Array.from({length:t},()=>Math.floor(Math.random()*16).toString(16)).join(""),Ts=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],As=["innerHTML"],Bs={key:2},Rs=r.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean}},emits:["cellInput"],setup(t,{emit:e}){const n=e,o=r.useTemplateRef("cell"),s=t.store.getCellData(t.colIndex,t.rowIndex),a=r.ref(""),l=r.ref(!1),i=t.store.columns[t.colIndex],u=t.store.rows[t.rowIndex],c=i.align||"center",d=i.width||"40ch",f=r.computed(()=>t.store.getCellDisplayValue(t.colIndex,t.rowIndex)),p=r.computed(()=>typeof f.value=="string"?Vs(f.value):!1),w=r.computed(()=>{var S;return{textAlign:c,width:d,backgroundColor:l.value?"var(--sc-cell-changed-color)":"inherit",fontWeight:l.value?"bold":"inherit",paddingLeft:t.store.getIndent(t.colIndex,(S=t.store.display[t.rowIndex])==null?void 0:S.indent)}}),h=()=>{const{left:S,bottom:$,width:q,height:B}=Tn(o);i.mask,i.modalComponent&&t.store.$patch(N=>{N.modal.visible=!0,N.modal.colIndex=t.colIndex,N.modal.rowIndex=t.rowIndex,N.modal.left=S,N.modal.bottom=$,N.modal.width=q,N.modal.height=B,typeof i.modalComponent=="function"?N.modal.component=i.modalComponent({table:N.table,row:u,column:i}):N.modal.component=i.modalComponent,N.modal.componentProps=i.modalComponentExtraProps})};if(t.addNavigation){let S={...ue,"keydown.f2":h,"keydown.alt.up":h,"keydown.alt.down":h,"keydown.alt.left":h,"keydown.alt.right":h};typeof t.addNavigation=="object"&&(S={...S,...t.addNavigation}),In([{selectors:o,handlers:S}])}const E=()=>{o.value&&(a.value=o.value.textContent)},_=S=>{const $=S.target;$.textContent!==a.value&&(n("cellInput",t.colIndex,t.rowIndex,$.textContent,a.value),a.value=$.textContent,i.format?(l.value=$.textContent!==t.store.getFormattedValue(t.colIndex,t.rowIndex,s),t.store.setCellText(t.colIndex,t.rowIndex,$.textContent)):(l.value=$.textContent!==s,t.store.setCellData(t.colIndex,t.rowIndex,$.textContent)))};return(S,$)=>(r.openBlock(),r.createElementBlock("td",{ref:"cell","data-colindex":S.colIndex,"data-rowindex":S.rowIndex,"data-editable":r.unref(i).edit,contenteditable:r.unref(i).edit,tabindex:S.tabIndex,spellcheck:!1,style:r.normalizeStyle(w.value),onFocus:E,onPaste:_,onInput:_,onClick:h,class:r.normalizeClass(["atable-cell",S.pinned?"sticky-column":""])},[r.unref(i).cellComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(i).cellComponent),r.mergeProps({key:0,value:f.value},r.unref(i).cellComponentProps),null,16,["value"])):p.value?(r.openBlock(),r.createElementBlock("span",{key:1,innerHTML:f.value},null,8,As)):(r.openBlock(),r.createElementBlock("span",Bs,r.toDisplayString(f.value),1))],46,Ts))}}),js=["tabindex"],Ms=r.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(t){const e=r.useTemplateRef("rowEl"),n=r.computed(()=>t.store.isRowVisible(t.rowIndex)),o=r.computed(()=>t.store.getRowExpandSymbol(t.rowIndex));if(t.addNavigation){let s=ue;typeof t.addNavigation=="object"&&(s={...s,...t.addNavigation}),In([{selectors:e,handlers:s}])}return(s,a)=>r.withDirectives((r.openBlock(),r.createElementBlock("tr",{ref:"rowEl",tabindex:s.tabIndex,class:"table-row"},[s.store.config.view!=="uncounted"?r.renderSlot(s.$slots,"index",{key:0},()=>[s.store.config.view==="list"?(r.openBlock(),r.createElementBlock("td",{key:0,tabIndex:-1,class:r.normalizeClass(["list-index",s.store.hasPinnedColumns?"sticky-index":""])},r.toDisplayString(s.rowIndex+1),3)):s.store.config.view==="tree"?(r.openBlock(),r.createElementBlock("td",{key:1,tabIndex:-1,class:r.normalizeClass(["tree-index",s.store.hasPinnedColumns?"sticky-index":""]),onClick:a[0]||(a[0]=l=>s.store.toggleRowExpand(s.rowIndex))},r.toDisplayString(o.value),3)):r.createCommentVNode("",!0)]):r.createCommentVNode("",!0),r.renderSlot(s.$slots,"default")],8,js)),[[r.vShow,n.value]])}}),An=de?window:void 0;function yt(t){var e;const n=A(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Pt(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=An):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[yt(e),A(s)],([d,f])=>{if(l(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}let Bn=!1;function Rn(t,e,n={}){const{window:o=An,ignore:s=[],capture:a=!0,detectIframe:l=!1}=n;if(!o)return rt;fe&&!Bn&&(Bn=!0,Array.from(o.document.body.children).forEach(h=>h.addEventListener("click",rt)),o.document.documentElement.addEventListener("click",rt));let i=!0;const u=h=>A(s).some(E=>{if(typeof E=="string")return Array.from(o.document.querySelectorAll(E)).some(_=>_===h.target||h.composedPath().includes(_));{const _=yt(E);return _&&(h.target===_||h.composedPath().includes(_))}});function c(h){const E=A(h);return E&&E.$.subTree.shapeFlag===16}function d(h,E){const _=A(h),S=_.$.subTree&&_.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some($=>$.el===E.target||E.composedPath().includes($.el))}const f=h=>{const E=yt(t);if(h.target!=null&&!(!(E instanceof Element)&&c(t)&&d(t,h))&&!(!E||E===h.target||h.composedPath().includes(E))){if(h.detail===0&&(i=!u(h)),!i){i=!0;return}e(h)}};let p=!1;const w=[Pt(o,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(h))},{passive:!0,capture:a}),Pt(o,"pointerdown",h=>{const E=yt(t);i=!u(h)&&!!(E&&!h.composedPath().includes(E))},{passive:!0}),l&&Pt(o,"blur",h=>{setTimeout(()=>{var E;const _=yt(t);((E=o.document.activeElement)==null?void 0:E.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>w.forEach(h=>h())}const Ls={mounted(t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=Rn(t,e.value,{capture:n});else{const[o,s]=e.value;t.__onClickOutside_stop=Rn(t,o,Object.assign({capture:n},s))}},unmounted(t){t.__onClickOutside_stop()}};function me(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function jn(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:jn(n)}}function Us(t){const e=t||window.event,n=e.target;return jn(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const he=new WeakMap;function Ws(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(xs(t),i=>{const u=me(A(i));if(u){const c=u;if(he.get(c)||he.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=me(A(t));!i||n.value||(fe&&(o=Pt(i,"touchmove",u=>{Us(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=me(A(t));!i||!n.value||(fe&&(o==null||o()),i.style.overflow=s,he.delete(i),n.value=!1)};return gt(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function Hs(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=Ws(n,o.value);r.watch(e,a=>s.value=a)}}Hs();const Fs={key:0,id:"resizable"},zs={class:"atable-header-row",tabindex:"-1"},Js=r.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(t){return(e,n)=>e.columns.length?(r.openBlock(),r.createElementBlock("thead",Fs,[r.createElementVNode("tr",zs,[e.store.zeroColumn?(r.openBlock(),r.createElementBlock("th",{key:0,id:"header-index",class:r.normalizeClass([[e.store.hasPinnedColumns?"sticky-index":"",e.store.config.view==="tree"?"tree-index":"",e.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.columns,(o,s)=>(r.openBlock(),r.createElementBlock("th",{key:o.name,tabindex:"-1",style:r.normalizeStyle(e.store.getHeaderCellStyle(o)),class:r.normalizeClass(o.pinned?"sticky-column":"")},[r.renderSlot(e.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(o.label||String.fromCharCode(s+97).toUpperCase()),1)])],6))),128))])])):r.createCommentVNode("",!0)}}),Gs=r.defineComponent({__name:"ATableModal",props:{store:{}},setup(t){const e=r.useTemplateRef("amodal"),{width:n,height:o}=Tn(e),{y:s}=Ps(),a=r.computed(()=>{if(!(t.store.modal.height&&t.store.modal.width&&t.store.modal.left&&t.store.modal.bottom))return;const i=document.body,u=document.documentElement,c=Math.max(i.scrollHeight,i.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),d=Math.max(i.scrollWidth,i.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),f=t.store.modal.bottom+o.value+s.value<=c?t.store.modal.bottom:t.store.modal.bottom-o.value-t.store.modal.height;return{left:`${t.store.modal.left+n.value<=d?t.store.modal.left:t.store.modal.left-(n.value-t.store.modal.width)}px`,top:`${f}px`}}),l=i=>{i.stopPropagation()};return(i,u)=>(r.openBlock(),r.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:l,onInput:l,style:r.normalizeStyle(a.value)},[r.renderSlot(i.$slots,"default")],36))}}),Ys=t=>{const e=t.id||Ds();return as(`table-${e}`,()=>{const n=()=>{const g={};for(const[v,b]of s.value.entries())for(const[m,y]of a.value.entries())g[`${v}:${m}`]=y[b.name];return g},o=g=>{const v=[Object.assign({},{rowModified:!1})];if(g&&"0:0"in g)return g;const b=new Set;for(let m=a.value.length-1;m>=0;m--){const y=a.value[m];y.parent&&b.add(y.parent),v[m]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:b.has(m),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return v},s=r.ref(t.columns),a=r.ref(t.rows),l=r.ref(t.config||{}),i=r.ref(t.table||n()),u=r.ref(o(t.display)),c=r.ref(t.modal||{visible:!1}),d=r.ref({}),f=r.computed(()=>s.value.some(g=>g.pinned)),p=r.computed(()=>`${Math.ceil(a.value.length/100+1)}ch`),w=r.computed(()=>l.value.view?["list","tree","list-expansion"].includes(l.value.view):!1),h=(g,v)=>i.value[`${g}:${v}`],E=(g,v,b)=>{const m=`${g}:${v}`,y=s.value[g];i.value[m]!==b&&(u.value[v].rowModified=!0),i.value[m]=b,a.value[v][y.name]=b},_=(g,v,b)=>{const m=`${g}:${v}`;i.value[m]!==b&&(u.value[v].rowModified=!0,d.value[m]=b)},S=g=>({minWidth:g.width||"40ch",textAlign:g.align||"center",width:l.value.fullWidth?"auto":void 0}),$=g=>l.value.view!=="tree"||u.value[g].isRoot||u.value[g].open,q=g=>l.value.view!=="tree"?"":u.value[g].isRoot||u.value[g].isParent?u.value[g].childrenOpen?"-":"+":"",B=g=>{if(l.value.view==="tree"){u.value[g].childrenOpen=!u.value[g].childrenOpen;for(let v=a.value.length-1;v>=0;v--)u.value[v].parent===g&&(u.value[v].open=!u.value[v].open,u.value[v].childrenOpen&&B(v))}else l.value.view==="list-expansion"&&(u.value[g].expanded=!u.value[g].expanded)},N=(g,v)=>{const b=h(g,v);return G(g,v,b)},G=(g,v,b)=>{const m=s.value[g],y=a.value[v],k=m.format;return k?typeof k=="function"?k(b,{table:i.value,row:y,column:m}):typeof k=="string"?Function(`"use strict";return (${k})`)()(b,{table:i.value,row:y,column:m}):b:b};return{columns:s,config:l,display:u,modal:c,rows:a,table:i,updates:d,hasPinnedColumns:f,numberedRowWidth:p,zeroColumn:w,closeModal:g=>{var v;g.target instanceof Node&&(v=c.value.parent)!=null&&v.contains(g.target)||c.value.visible&&(c.value.visible=!1)},getCellData:h,getCellDisplayValue:N,getFormattedValue:G,getHeaderCellStyle:S,getIndent:(g,v)=>v&&g===0&&v>0?`${v}ch`:"inherit",getRowExpandSymbol:q,isRowVisible:$,setCellData:E,setCellText:_,toggleRowExpand:B}})()},Xs=r.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(t,{expose:e,emit:n}){const o=n,s=r.useTemplateRef("table"),a=t.modelValue?t.modelValue:t.rows,l=Ys({columns:t.columns,rows:a,id:t.id,config:t.config});l.$onAction(({name:c,store:d,args:f,after:p})=>{if(c==="setCellData"){const[w,h,E]=f,_=d.getCellData(w,h);p(()=>{o("cellUpdate",w,h,E,_)})}}),r.watch(()=>l.rows,c=>{o("update:modelValue",c)},{deep:!0}),r.onMounted(()=>{t.columns.some(c=>c.pinned)&&(u(),l.config.view==="tree"&&Dn(s,u,{childList:!0,subtree:!0}))});const i=(c,d,f,p)=>{o("cellUpdate",c,d,f,p)},u=()=>{const c=s.value,d=c==null?void 0:c.rows[0],f=c==null?void 0:c.rows[1],p=d?Array.from(d.cells):[];for(const[w,h]of p.entries()){const E=f==null?void 0:f.cells[w];E&&(h.style.width=`${E.offsetWidth}px`)}for(const w of(c==null?void 0:c.rows)||[]){let h=0;const E=[];for(const _ of w.cells)(_.classList.contains("sticky-column")||_.classList.contains("sticky-index"))&&(_.style.left=`${h}px`,h+=_.offsetWidth,E.push(_));E.length>0&&E[E.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",c=>{if(c.key==="Escape"&&l.modal.visible){l.modal.visible=!1;const d=l.modal.parent;d&&r.nextTick().then(()=>{d.focus()})}}),e({store:l}),(c,d)=>r.withDirectives((r.openBlock(),r.createElementBlock("table",{ref:"table",class:"atable",style:r.normalizeStyle({width:r.unref(l).config.fullWidth?"100%":"auto"})},[r.renderSlot(c.$slots,"header",{data:r.unref(l)},()=>[r.createVNode(Js,{columns:r.unref(l).columns,store:r.unref(l)},null,8,["columns","store"])],!0),r.createElementVNode("tbody",null,[r.renderSlot(c.$slots,"body",{data:r.unref(l)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).rows,(f,p)=>(r.openBlock(),r.createBlock(Ms,{key:f.id,row:f,rowIndex:p,store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).columns,(w,h)=>(r.openBlock(),r.createBlock(Rs,{key:w.name,store:r.unref(l),col:w,spellcheck:"false",pinned:w.pinned,rowIndex:p,colIndex:h,component:w.cellComponent,style:r.normalizeStyle({textAlign:(w==null?void 0:w.align)||"center",minWidth:(w==null?void 0:w.width)||"40ch",width:r.unref(l).config.fullWidth?"auto":null}),onCellInput:i},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),r.renderSlot(c.$slots,"footer",{data:r.unref(l)},void 0,!0),r.renderSlot(c.$slots,"modal",{data:r.unref(l)},()=>[r.withDirectives(r.createVNode(Gs,{store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(l).modal.component),r.mergeProps({key:`${r.unref(l).modal.rowIndex}:${r.unref(l).modal.colIndex}`,colIndex:r.unref(l).modal.colIndex,rowIndex:r.unref(l).modal.rowIndex,store:r.unref(l)},r.unref(l).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[r.vShow,r.unref(l).modal.visible]])],!0)],4)),[[r.unref(Ls),r.unref(l).closeModal]])}}),Qs=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},qs=Qs(Xs,[["__scopeId","data-v-bd5101d3"]]),Mn=r.defineComponent({__name:"Records",setup(t){const{stonecrop:e,isReady:n}=ze(),o={view:"list"};return(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(qs),{key:0,columns:r.unref(e).schema.schema.toArray(),rows:r.unref(e).store.records,config:o},null,8,["columns","rows"])):r.createCommentVNode("",!0)}}),Ks={class:"tabs"},Zs={tabindex:"0"},ta={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 424.098 424.098",style:{"enable-background":"new 0 0 424.098 424.098"},"xml:space":"preserve"},ea={tabindex:"0"},na={style:{width:"11pt"}},Ln=Tt(r.defineComponent({__name:"SheetNav",props:{breadcrumbs:{default:()=>[]}},setup(t){const e=r.ref(!0),n=r.ref(!1),o=r.ref(""),s=r.useTemplateRef("searchinput"),a=r.computed(()=>e.value?"unrotated":"rotated"),l=()=>{e.value=!e.value},i=async()=>{n.value=!n.value,await r.nextTick(()=>{s.value.focus()})},u=f=>{f.preventDefault(),f.stopPropagation()},c=async f=>{f.preventDefault(),f.stopPropagation(),await i()},d=()=>{};return(f,p)=>{const w=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("footer",null,[r.createElementVNode("ul",Ks,[r.createElementVNode("li",{class:"hidebreadcrumbs",onClick:l,onKeydown:r.withKeys(l,["enter"])},[r.createElementVNode("a",Zs,[r.createElementVNode("div",{class:r.normalizeClass(a.value)},"ร",2)])],32),r.createElementVNode("li",{class:"hometab",onClick:d,onKeydown:r.withKeys(d,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{to:"/home",tabindex:"0"},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",ta,p[5]||(p[5]=[r.createElementVNode("g",null,[r.createElementVNode("path",{style:{fill:"#010002"},d:`M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
|
|
20
|
+
This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?re(f,e,s,i,!0):vn(f,A({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&ft){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}function kn(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function se(t){return typeof t=="function"?t():r.unref(t)}const is=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ls=t=>t!=null,cs=Object.prototype.toString,us=t=>cs.call(t)==="[object Object]",ds=()=>{},pt=is?window:void 0;function mt(t){var e;const n=se(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ht(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=pt):[e,n,o,s]=t,!e)return ds;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[mt(e),se(s)],([d,f])=>{if(l(),!d)return;const p=us(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return kn(c),c}function fs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function ps(t){const e=fs();return r.computed(()=>(e.value,!!t()))}function ms(t,e,n={}){const{window:o=pt,...s}=n;let a;const l=ps(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=se(t),w=(Array.isArray(p)?p:[p]).map(mt).filter(ls);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return kn(f),{isSupported:l,stop:f,takeRecords:d}}function hs(t={}){var e;const{window:n=pt,deep:o=!0,triggerOnRemoval:s=!1}=t,a=(e=t.document)!=null?e:n==null?void 0:n.document,l=()=>{var c;let d=a==null?void 0:a.activeElement;if(o)for(;d!=null&&d.shadowRoot;)d=(c=d==null?void 0:d.shadowRoot)==null?void 0:c.activeElement;return d},i=r.ref(),u=()=>{i.value=l()};return n&&(ht(n,"blur",c=>{c.relatedTarget===null&&u()},!0),ht(n,"focus",u,!0)),s&&ms(a,c=>{c.filter(d=>d.removedNodes.length).map(d=>Array.from(d.removedNodes)).flat().forEach(d=>{d===i.value&&u()})},{childList:!0,subtree:!0}),u(),i}const gs="focusin",ys="focusout";function ws(t,e={}){const{window:n=pt}=e,o=r.computed(()=>mt(t)),s=r.ref(!1),a=r.computed(()=>s.value),l=hs(e);return!n||!l.value?{focused:a}:(ht(o,gs,()=>s.value=!0),ht(o,ys,()=>s.value=!1),{focused:a})}function bs(t,{window:e=pt,scrollTarget:n}={}){const o=r.ref(!1),s=()=>{if(!e)return;const a=e.document,l=mt(t);if(!l)o.value=!1;else{const i=l.getBoundingClientRect();o.value=i.top<=(e.innerHeight||a.documentElement.clientHeight)&&i.left<=(e.innerWidth||a.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return r.watch(()=>mt(t),()=>s(),{immediate:!0,flush:"post"}),e&&ht(n||e,"scroll",s,{capture:!1,passive:!0}),o}const W=t=>{let e=bs(t).value;return e=e&&t.offsetHeight>0,e},H=t=>t.tabIndex>=0,$n=t=>{const e=t.target;return ae(e)},ae=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.previousElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ae(n):n},Es=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.firstElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.firstElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ie(o):o},Sn=t=>{const e=t.target;return ie(e)},ie=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.nextElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ie(n):n},_s=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.lastElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.lastElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ae(o):o},Nn=t=>{const e=t.target;return le(e)},le=t=>{var e;let n;if(t.previousElementSibling)n=t.previousElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;n=o==null?void 0:o.lastElementChild}return n&&(!H(n)||!W(n))?le(n):n},xn=t=>{const e=t.target;return ce(e)},ce=t=>{var e;let n;if(t.nextElementSibling)n=t.nextElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;n=o==null?void 0:o.firstElementChild}return n&&(!H(n)||!W(n))?ce(n):n},On=t=>{const e=t.target.parentElement,n=e==null?void 0:e.firstElementChild;return n&&(!H(n)||!W(n))?ce(n):n},Cn=t=>{const e=t.target.parentElement,n=e==null?void 0:e.lastElementChild;return n&&(!H(n)||!W(n))?le(n):n},Ct=["alt","control","shift","meta"],vs={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const e=$n(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.down":t=>{const e=Sn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.left":t=>{const e=Nn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.right":t=>{const e=xn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.control.up":t=>{const e=Es(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.down":t=>{const e=_s(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.left":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.right":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.end":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=Sn(t);e&&e.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=$n(t);e&&e.focus()}},"keydown.home":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.tab":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.shift.tab":t=>{const e=Nn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())}};function Pn(t){const e=l=>{let i=null;return l.parent&&(typeof l.parent=="string"?i=document.querySelector(l.parent):l.parent instanceof HTMLElement?i=l.parent:i=l.parent.value),i},n=l=>{var i;const u=e(l);let c=[];if(typeof l.selectors=="string")c=u?Array.from(u.querySelectorAll(l.selectors)):Array.from(document.querySelectorAll(l.selectors));else if(Array.isArray(l.selectors))for(const d of l.selectors)d instanceof HTMLElement?c.push(d):c.push(d.$el);else if(l.selectors instanceof HTMLElement)c.push(l.selectors);else if((i=l.selectors)!=null&&i.value)if(Array.isArray(l.selectors.value))for(const d of l.selectors.value)d instanceof HTMLElement?c.push(d):c.push(d.$el);else c.push(l.selectors.value);return c},o=l=>{const i=e(l);let u=[];return l.selectors?u=n(l):i&&(u=Array.from(i.children).filter(c=>H(c)&&W(c))),u},s=l=>i=>{const u=vs[i.key]||i.key.toLowerCase();if(Ct.includes(u))return;const c=l.handlers||ue;for(const d of Object.keys(c)){const[f,...p]=d.split(".");if(f==="keydown"&&p.includes(u)){const w=c[d],h=p.filter(_=>Ct.includes(_)),E=Ct.some(_=>{const $=_.charAt(0).toUpperCase()+_.slice(1);return i.getModifierState($)});if(h.length>0){if(E){for(const _ of Ct)if(p.includes(_)){const $=_.charAt(0).toUpperCase()+_.slice(1);i.getModifierState($)&&w(i)}}}else E||w(i)}}},a=[];r.onMounted(()=>{for(const l of t){const i=e(l),u=o(l),c=s(l),d=i?[i]:u;for(const f of d){const{focused:p}=ws(r.ref(f)),w=r.watch(p,h=>{h?f.addEventListener("keydown",c):f.removeEventListener("keydown",c)});a.push(w)}}}),r.onBeforeUnmount(()=>{for(const l of a)l()})}function gt(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function T(t){return typeof t=="function"?t():r.unref(t)}const de=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ks=t=>t!=null,$s=Object.prototype.toString,In=t=>$s.call(t)==="[object Object]",rt=()=>{},fe=Ss();function Ss(){var t,e;return de&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ns(t){return r.getCurrentInstance()}function xs(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:rt}))):r.ref(e)}function Os(t,e=!0,n){Ns()?r.onMounted(t,n):e?t():r.nextTick(t)}const Pt=de?window:void 0;function st(t){var e;const n=T(t);return(e=n==null?void 0:n.$el)!=null?e:n}function pe(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=Pt):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[st(e),T(s)],([d,f])=>{if(l(),!d)return;const p=In(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}function Cs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function Vn(t){const e=Cs();return r.computed(()=>(e.value,!!t()))}function Dn(t,e,n={}){const{window:o=Pt,...s}=n;let a;const l=Vn(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=T(t),w=(Array.isArray(p)?p:[p]).map(st).filter(ks);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return gt(f),{isSupported:l,stop:f,takeRecords:d}}function Ps(t,e,n={}){const{window:o=Pt,...s}=n;let a;const l=Vn(()=>o&&"ResizeObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const f=T(t);return Array.isArray(f)?f.map(p=>st(p)):[st(f)]}),c=r.watch(u,f=>{if(i(),l.value&&o){a=new ResizeObserver(e);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),d=()=>{i(),c()};return gt(d),{isSupported:l,stop:d}}function An(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:s=!0,immediate:a=!0,updateTiming:l="sync"}=e,i=r.ref(0),u=r.ref(0),c=r.ref(0),d=r.ref(0),f=r.ref(0),p=r.ref(0),w=r.ref(0),h=r.ref(0);function E(){const $=st(t);if(!$){n&&(i.value=0,u.value=0,c.value=0,d.value=0,f.value=0,p.value=0,w.value=0,h.value=0);return}const S=$.getBoundingClientRect();i.value=S.height,u.value=S.bottom,c.value=S.left,d.value=S.right,f.value=S.top,p.value=S.width,w.value=S.x,h.value=S.y}function _(){l==="sync"?E():l==="next-frame"&&requestAnimationFrame(()=>E())}return Ps(t,_),r.watch(()=>st(t),$=>!$&&_()),Dn(t,_,{attributeFilter:["style","class"]}),s&&pe("scroll",_,{capture:!0,passive:!0}),o&&pe("resize",_,{passive:!0}),Os(()=>{a&&_()}),{height:i,bottom:u,left:c,right:d,top:f,width:p,x:w,y:h,update:_}}function Is(t={}){const{window:e=Pt,behavior:n="auto"}=t;if(!e)return{x:r.ref(0),y:r.ref(0)};const o=r.ref(e.scrollX),s=r.ref(e.scrollY),a=r.computed({get(){return o.value},set(i){scrollTo({left:i,behavior:n})}}),l=r.computed({get(){return s.value},set(i){scrollTo({top:i,behavior:n})}});return pe(e,"scroll",()=>{o.value=e.scrollX,s.value=e.scrollY},{capture:!1,passive:!0}),{x:a,y:l}}const Vs=t=>{const e=new DOMParser().parseFromString(t,"text/html");return Array.from(e.body.childNodes).some(n=>n.nodeType===1)},Ds=(t=8)=>Array.from({length:t},()=>Math.floor(Math.random()*16).toString(16)).join(""),As=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],Ts=["innerHTML"],Rs={key:2},Bs=r.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean}},emits:["cellInput"],setup(t,{emit:e}){const n=e,o=r.useTemplateRef("cell"),s=t.store.getCellData(t.colIndex,t.rowIndex),a=r.ref(""),l=r.ref(!1),i=t.store.columns[t.colIndex],u=t.store.rows[t.rowIndex],c=i.align||"center",d=i.width||"40ch",f=r.computed(()=>t.store.getCellDisplayValue(t.colIndex,t.rowIndex)),p=r.computed(()=>typeof f.value=="string"?Vs(f.value):!1),w=r.computed(()=>{var $;return{textAlign:c,width:d,backgroundColor:l.value?"var(--sc-cell-changed-color)":"inherit",fontWeight:l.value?"bold":"inherit",paddingLeft:t.store.getIndent(t.colIndex,($=t.store.display[t.rowIndex])==null?void 0:$.indent)}}),h=()=>{const{left:$,bottom:S,width:q,height:R}=An(o);i.mask,i.modalComponent&&t.store.$patch(N=>{N.modal.visible=!0,N.modal.colIndex=t.colIndex,N.modal.rowIndex=t.rowIndex,N.modal.left=$,N.modal.bottom=S,N.modal.width=q,N.modal.height=R,typeof i.modalComponent=="function"?N.modal.component=i.modalComponent({table:N.table,row:u,column:i}):N.modal.component=i.modalComponent,N.modal.componentProps=i.modalComponentExtraProps})};if(t.addNavigation){let $={...ue,"keydown.f2":h,"keydown.alt.up":h,"keydown.alt.down":h,"keydown.alt.left":h,"keydown.alt.right":h};typeof t.addNavigation=="object"&&($={...$,...t.addNavigation}),Pn([{selectors:o,handlers:$}])}const E=()=>{o.value&&(a.value=o.value.textContent)},_=$=>{const S=$.target;S.textContent!==a.value&&(n("cellInput",t.colIndex,t.rowIndex,S.textContent,a.value),a.value=S.textContent,i.format?(l.value=S.textContent!==t.store.getFormattedValue(t.colIndex,t.rowIndex,s),t.store.setCellText(t.colIndex,t.rowIndex,S.textContent)):(l.value=S.textContent!==s,t.store.setCellData(t.colIndex,t.rowIndex,S.textContent)))};return($,S)=>(r.openBlock(),r.createElementBlock("td",{ref:"cell","data-colindex":$.colIndex,"data-rowindex":$.rowIndex,"data-editable":r.unref(i).edit,contenteditable:r.unref(i).edit,tabindex:$.tabIndex,spellcheck:!1,style:r.normalizeStyle(w.value),onFocus:E,onPaste:_,onInput:_,onClick:h,class:r.normalizeClass(["atable-cell",$.pinned?"sticky-column":""])},[r.unref(i).cellComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(i).cellComponent),r.mergeProps({key:0,value:f.value},r.unref(i).cellComponentProps),null,16,["value"])):p.value?(r.openBlock(),r.createElementBlock("span",{key:1,innerHTML:f.value},null,8,Ts)):(r.openBlock(),r.createElementBlock("span",Rs,r.toDisplayString(f.value),1))],46,As))}}),js=["tabindex"],Ms=r.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(t){const e=r.useTemplateRef("rowEl"),n=r.computed(()=>t.store.isRowVisible(t.rowIndex)),o=r.computed(()=>t.store.getRowExpandSymbol(t.rowIndex));if(t.addNavigation){let s=ue;typeof t.addNavigation=="object"&&(s={...s,...t.addNavigation}),Pn([{selectors:e,handlers:s}])}return(s,a)=>r.withDirectives((r.openBlock(),r.createElementBlock("tr",{ref:"rowEl",tabindex:s.tabIndex,class:"table-row"},[s.store.config.view!=="uncounted"?r.renderSlot(s.$slots,"index",{key:0},()=>[s.store.config.view==="list"?(r.openBlock(),r.createElementBlock("td",{key:0,tabIndex:-1,class:r.normalizeClass(["list-index",s.store.hasPinnedColumns?"sticky-index":""])},r.toDisplayString(s.rowIndex+1),3)):s.store.config.view==="tree"?(r.openBlock(),r.createElementBlock("td",{key:1,tabIndex:-1,class:r.normalizeClass(["tree-index",s.store.hasPinnedColumns?"sticky-index":""]),onClick:a[0]||(a[0]=l=>s.store.toggleRowExpand(s.rowIndex))},r.toDisplayString(o.value),3)):r.createCommentVNode("",!0)]):r.createCommentVNode("",!0),r.renderSlot(s.$slots,"default")],8,js)),[[r.vShow,n.value]])}}),Tn=de?window:void 0;function yt(t){var e;const n=T(t);return(e=n==null?void 0:n.$el)!=null?e:n}function It(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=Tn):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[yt(e),T(s)],([d,f])=>{if(l(),!d)return;const p=In(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}let Rn=!1;function Bn(t,e,n={}){const{window:o=Tn,ignore:s=[],capture:a=!0,detectIframe:l=!1}=n;if(!o)return rt;fe&&!Rn&&(Rn=!0,Array.from(o.document.body.children).forEach(h=>h.addEventListener("click",rt)),o.document.documentElement.addEventListener("click",rt));let i=!0;const u=h=>T(s).some(E=>{if(typeof E=="string")return Array.from(o.document.querySelectorAll(E)).some(_=>_===h.target||h.composedPath().includes(_));{const _=yt(E);return _&&(h.target===_||h.composedPath().includes(_))}});function c(h){const E=T(h);return E&&E.$.subTree.shapeFlag===16}function d(h,E){const _=T(h),$=_.$.subTree&&_.$.subTree.children;return $==null||!Array.isArray($)?!1:$.some(S=>S.el===E.target||E.composedPath().includes(S.el))}const f=h=>{const E=yt(t);if(h.target!=null&&!(!(E instanceof Element)&&c(t)&&d(t,h))&&!(!E||E===h.target||h.composedPath().includes(E))){if(h.detail===0&&(i=!u(h)),!i){i=!0;return}e(h)}};let p=!1;const w=[It(o,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(h))},{passive:!0,capture:a}),It(o,"pointerdown",h=>{const E=yt(t);i=!u(h)&&!!(E&&!h.composedPath().includes(E))},{passive:!0}),l&&It(o,"blur",h=>{setTimeout(()=>{var E;const _=yt(t);((E=o.document.activeElement)==null?void 0:E.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>w.forEach(h=>h())}const Ls={mounted(t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=Bn(t,e.value,{capture:n});else{const[o,s]=e.value;t.__onClickOutside_stop=Bn(t,o,Object.assign({capture:n},s))}},unmounted(t){t.__onClickOutside_stop()}};function me(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function jn(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:jn(n)}}function Us(t){const e=t||window.event,n=e.target;return jn(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const he=new WeakMap;function Ws(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(xs(t),i=>{const u=me(T(i));if(u){const c=u;if(he.get(c)||he.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=me(T(t));!i||n.value||(fe&&(o=It(i,"touchmove",u=>{Us(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=me(T(t));!i||!n.value||(fe&&(o==null||o()),i.style.overflow=s,he.delete(i),n.value=!1)};return gt(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function Hs(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=Ws(n,o.value);r.watch(e,a=>s.value=a)}}Hs();const Fs={key:0,id:"resizable"},zs={class:"atable-header-row",tabindex:"-1"},Js=r.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(t){return(e,n)=>e.columns.length?(r.openBlock(),r.createElementBlock("thead",Fs,[r.createElementVNode("tr",zs,[e.store.zeroColumn?(r.openBlock(),r.createElementBlock("th",{key:0,id:"header-index",class:r.normalizeClass([[e.store.hasPinnedColumns?"sticky-index":"",e.store.config.view==="tree"?"tree-index":"",e.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.columns,(o,s)=>(r.openBlock(),r.createElementBlock("th",{key:o.name,tabindex:"-1",style:r.normalizeStyle(e.store.getHeaderCellStyle(o)),class:r.normalizeClass(o.pinned?"sticky-column":"")},[r.renderSlot(e.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(o.label||String.fromCharCode(s+97).toUpperCase()),1)])],6))),128))])])):r.createCommentVNode("",!0)}}),Gs=r.defineComponent({__name:"ATableModal",props:{store:{}},setup(t){const e=r.useTemplateRef("amodal"),{width:n,height:o}=An(e),{y:s}=Is(),a=r.computed(()=>{if(!(t.store.modal.height&&t.store.modal.width&&t.store.modal.left&&t.store.modal.bottom))return;const i=document.body,u=document.documentElement,c=Math.max(i.scrollHeight,i.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),d=Math.max(i.scrollWidth,i.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),f=t.store.modal.bottom+o.value+s.value<=c?t.store.modal.bottom:t.store.modal.bottom-o.value-t.store.modal.height;return{left:`${t.store.modal.left+n.value<=d?t.store.modal.left:t.store.modal.left-(n.value-t.store.modal.width)}px`,top:`${f}px`}}),l=i=>{i.stopPropagation()};return(i,u)=>(r.openBlock(),r.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:l,onInput:l,style:r.normalizeStyle(a.value)},[r.renderSlot(i.$slots,"default")],36))}}),Ys=t=>{const e=t.id||Ds();return as(`table-${e}`,()=>{const n=()=>{const g={};for(const[v,b]of s.value.entries())for(const[m,y]of a.value.entries())g[`${v}:${m}`]=y[b.name];return g},o=g=>{const v=[Object.assign({},{rowModified:!1})];if(g&&"0:0"in g)return g;const b=new Set;for(let m=a.value.length-1;m>=0;m--){const y=a.value[m];y.parent&&b.add(y.parent),v[m]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:b.has(m),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return v},s=r.ref(t.columns),a=r.ref(t.rows),l=r.ref(t.config||{}),i=r.ref(t.table||n()),u=r.ref(o(t.display)),c=r.ref(t.modal||{visible:!1}),d=r.ref({}),f=r.computed(()=>s.value.some(g=>g.pinned)),p=r.computed(()=>`${Math.ceil(a.value.length/100+1)}ch`),w=r.computed(()=>l.value.view?["list","tree","list-expansion"].includes(l.value.view):!1),h=(g,v)=>i.value[`${g}:${v}`],E=(g,v,b)=>{const m=`${g}:${v}`,y=s.value[g];i.value[m]!==b&&(u.value[v].rowModified=!0),i.value[m]=b,a.value[v][y.name]=b},_=(g,v,b)=>{const m=`${g}:${v}`;i.value[m]!==b&&(u.value[v].rowModified=!0,d.value[m]=b)},$=g=>({minWidth:g.width||"40ch",textAlign:g.align||"center",width:l.value.fullWidth?"auto":void 0}),S=g=>l.value.view!=="tree"||u.value[g].isRoot||u.value[g].open,q=g=>l.value.view!=="tree"?"":u.value[g].isRoot||u.value[g].isParent?u.value[g].childrenOpen?"-":"+":"",R=g=>{if(l.value.view==="tree"){u.value[g].childrenOpen=!u.value[g].childrenOpen;for(let v=a.value.length-1;v>=0;v--)u.value[v].parent===g&&(u.value[v].open=!u.value[v].open,u.value[v].childrenOpen&&R(v))}else l.value.view==="list-expansion"&&(u.value[g].expanded=!u.value[g].expanded)},N=(g,v)=>{const b=h(g,v);return G(g,v,b)},G=(g,v,b)=>{const m=s.value[g],y=a.value[v],k=m.format;return k?typeof k=="function"?k(b,{table:i.value,row:y,column:m}):typeof k=="string"?Function(`"use strict";return (${k})`)()(b,{table:i.value,row:y,column:m}):b:b};return{columns:s,config:l,display:u,modal:c,rows:a,table:i,updates:d,hasPinnedColumns:f,numberedRowWidth:p,zeroColumn:w,closeModal:g=>{var v;g.target instanceof Node&&(v=c.value.parent)!=null&&v.contains(g.target)||c.value.visible&&(c.value.visible=!1)},getCellData:h,getCellDisplayValue:N,getFormattedValue:G,getHeaderCellStyle:$,getIndent:(g,v)=>v&&g===0&&v>0?`${v}ch`:"inherit",getRowExpandSymbol:q,isRowVisible:S,setCellData:E,setCellText:_,toggleRowExpand:R}})()},Xs=r.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(t,{expose:e,emit:n}){const o=n,s=r.useTemplateRef("table"),a=t.modelValue?t.modelValue:t.rows,l=Ys({columns:t.columns,rows:a,id:t.id,config:t.config});l.$onAction(({name:c,store:d,args:f,after:p})=>{if(c==="setCellData"){const[w,h,E]=f,_=d.getCellData(w,h);p(()=>{o("cellUpdate",w,h,E,_)})}}),r.watch(()=>l.rows,c=>{o("update:modelValue",c)},{deep:!0}),r.onMounted(()=>{t.columns.some(c=>c.pinned)&&(u(),l.config.view==="tree"&&Dn(s,u,{childList:!0,subtree:!0}))});const i=(c,d,f,p)=>{o("cellUpdate",c,d,f,p)},u=()=>{const c=s.value,d=c==null?void 0:c.rows[0],f=c==null?void 0:c.rows[1],p=d?Array.from(d.cells):[];for(const[w,h]of p.entries()){const E=f==null?void 0:f.cells[w];E&&(h.style.width=`${E.offsetWidth}px`)}for(const w of(c==null?void 0:c.rows)||[]){let h=0;const E=[];for(const _ of w.cells)(_.classList.contains("sticky-column")||_.classList.contains("sticky-index"))&&(_.style.left=`${h}px`,h+=_.offsetWidth,E.push(_));E.length>0&&E[E.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",c=>{if(c.key==="Escape"&&l.modal.visible){l.modal.visible=!1;const d=l.modal.parent;d&&r.nextTick().then(()=>{d.focus()})}}),e({store:l}),(c,d)=>r.withDirectives((r.openBlock(),r.createElementBlock("table",{ref:"table",class:"atable",style:r.normalizeStyle({width:r.unref(l).config.fullWidth?"100%":"auto"})},[r.renderSlot(c.$slots,"header",{data:r.unref(l)},()=>[r.createVNode(Js,{columns:r.unref(l).columns,store:r.unref(l)},null,8,["columns","store"])],!0),r.createElementVNode("tbody",null,[r.renderSlot(c.$slots,"body",{data:r.unref(l)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).rows,(f,p)=>(r.openBlock(),r.createBlock(Ms,{key:f.id,row:f,rowIndex:p,store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).columns,(w,h)=>(r.openBlock(),r.createBlock(Bs,{key:w.name,store:r.unref(l),col:w,spellcheck:"false",pinned:w.pinned,rowIndex:p,colIndex:h,component:w.cellComponent,style:r.normalizeStyle({textAlign:(w==null?void 0:w.align)||"center",minWidth:(w==null?void 0:w.width)||"40ch",width:r.unref(l).config.fullWidth?"auto":null}),onCellInput:i},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),r.renderSlot(c.$slots,"footer",{data:r.unref(l)},void 0,!0),r.renderSlot(c.$slots,"modal",{data:r.unref(l)},()=>[r.withDirectives(r.createVNode(Gs,{store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(l).modal.component),r.mergeProps({key:`${r.unref(l).modal.rowIndex}:${r.unref(l).modal.colIndex}`,colIndex:r.unref(l).modal.colIndex,rowIndex:r.unref(l).modal.rowIndex,store:r.unref(l)},r.unref(l).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[r.vShow,r.unref(l).modal.visible]])],!0)],4)),[[r.unref(Ls),r.unref(l).closeModal]])}}),Qs=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},qs=Qs(Xs,[["__scopeId","data-v-bd5101d3"]]),Mn=r.defineComponent({__name:"Records",setup(t){const{stonecrop:e,isReady:n}=ze(),o={view:"list"};return(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(qs),{key:0,columns:r.unref(e).schema.schema.toArray(),rows:r.unref(e).store.records,config:o},null,8,["columns","rows"])):r.createCommentVNode("",!0)}}),Ks={class:"tabs"},Zs={tabindex:"0"},ta={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 424.098 424.098",style:{"enable-background":"new 0 0 424.098 424.098"},"xml:space":"preserve"},ea={tabindex:"0"},na={style:{width:"11pt"}},Ln=At(r.defineComponent({__name:"SheetNav",props:{breadcrumbs:{default:()=>[]}},setup(t){const e=r.ref(!0),n=r.ref(!1),o=r.ref(""),s=r.useTemplateRef("searchinput"),a=r.computed(()=>e.value?"unrotated":"rotated"),l=()=>{e.value=!e.value},i=async()=>{n.value=!n.value,await r.nextTick(()=>{s.value.focus()})},u=f=>{f.preventDefault(),f.stopPropagation()},c=async f=>{f.preventDefault(),f.stopPropagation(),await i()},d=()=>{};return(f,p)=>{const w=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("footer",null,[r.createElementVNode("ul",Ks,[r.createElementVNode("li",{class:"hidebreadcrumbs",onClick:l,onKeydown:r.withKeys(l,["enter"])},[r.createElementVNode("a",Zs,[r.createElementVNode("div",{class:r.normalizeClass(a.value)},"ร",2)])],32),r.createElementVNode("li",{class:"hometab",onClick:d,onKeydown:r.withKeys(d,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{to:"/home",tabindex:"0"},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",ta,p[5]||(p[5]=[r.createElementVNode("g",null,[r.createElementVNode("path",{style:{fill:"#010002"},d:`M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
|
|
21
21
|
c-3.284-0.008-6.243-1.992-7.495-5.023c-1.252-3.04-0.553-6.527,1.764-8.852L206.104,24.546c1.853-1.845,4.503-2.666,7.047-2.276
|
|
22
22
|
c2.414,0.39,4.511,1.845,5.731,3.942l47.43,47.43V58.499c0-4.487,3.633-8.129,8.129-8.129h47.755c4.495,0,8.129,3.642,8.129,8.129
|
|
23
23
|
v79.156l91.39,91.398c2.325,2.325,3.024,5.828,1.764,8.868c-1.26,3.032-4.227,5.007-7.511,5.007c-0.008,0-0.008,0-0.016,0
|
|
@@ -25,5 +25,5 @@ This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),proce
|
|
|
25
25
|
c0-2.162,0.854-4.235,2.39-5.755c1.528-1.52,3.585-2.374,5.739-2.374c0.008,0,0.008,0,0.016,0l45.105,0.089l-79.855-79.863
|
|
26
26
|
c-1.528-1.528-2.382-3.593-2.382-5.747V66.628h-31.498v26.645c0,3.284-1.975,6.251-5.015,7.511
|
|
27
27
|
c-3.032,1.268-6.527,0.569-8.86-1.764l-57.038-57.038l-183.95,183.95l45.203,0.089c4.487,0.008,8.112,3.642,8.112,8.129
|
|
28
|
-
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1)])))]),_:1})],36),r.createElementVNode("li",{class:"searchtab",onClick:i,onKeydown:r.withKeys(i,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createElementVNode("a",ea,[r.createElementVNode("span",{style:r.normalizeStyle({display:n.value?"none":"block"})},[(r.openBlock(),r.createElementBlock("svg",na,p[6]||(p[6]=[r.createElementVNode("g",{transform:"matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)"},[r.createElementVNode("path",{d:"M 93.148438,80.832031 C 109.5,57.742188 104.03125,25.769531 80.941406,9.421875 57.851562,-6.925781 25.878906,-1.460938 9.53125,21.632812 -6.816406,44.722656 -1.351562,76.691406 21.742188,93.039062 38.222656,104.70703 60.011719,105.60547 77.394531,95.339844 l 37.769529,37.542966 c 4.07813,4.29297 10.86328,4.46485 15.15625,0.38672 4.29297,-4.07422 4.46485,-10.85937 0.39063,-15.15234 -0.12891,-0.13672 -0.25391,-0.26172 -0.39063,-0.39063 z m -41.839844,3.5 C 33.0625,84.335938 18.269531,69.554688 18.257812,51.308594 18.253906,33.0625 33.035156,18.269531 51.285156,18.261719 c 18.222656,-0.0078 33.007813,14.75 33.042969,32.972656 0.03125,18.25 -14.742187,33.066406 -32.996094,33.097656 -0.0078,0 -0.01172,0 -0.02344,0 z m 0,0",style:{fill:"#000000","fill-opacity":"1","fill-rule":"nonzero",stroke:"none"},id:"path2"})],-1)])))],4),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=h=>o.value=h),ref:"searchinput",style:r.normalizeStyle({display:n.value?"block":"none"}),onClick:p[1]||(p[1]=h=>u(h)),onInput:p[2]||(p[2]=h=>u(h)),onBlur:p[3]||(p[3]=h=>c(h)),onKeydown:p[4]||(p[4]=r.withKeys(h=>c(h),["enter"])),type:"text"},null,36),[[r.vModelText,o.value]])])],36),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.breadcrumbs,h=>(r.openBlock(),r.createElementBlock("li",{key:h.title,style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{tabindex:"0",to:h.to},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),[["__scopeId","data-v-a650f215"]]),oa={install:t=>{t.component("ActionSet",ye),t.component("CommandPalette",we),t.component("Doctype",gn),t.component("Records",Mn),t.component("SheetNav",Ln)}};
|
|
28
|
+
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1)])))]),_:1})],36),r.createElementVNode("li",{class:"searchtab",onClick:i,onKeydown:r.withKeys(i,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createElementVNode("a",ea,[r.createElementVNode("span",{style:r.normalizeStyle({display:n.value?"none":"block"})},[(r.openBlock(),r.createElementBlock("svg",na,p[6]||(p[6]=[r.createElementVNode("g",{transform:"matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)"},[r.createElementVNode("path",{d:"M 93.148438,80.832031 C 109.5,57.742188 104.03125,25.769531 80.941406,9.421875 57.851562,-6.925781 25.878906,-1.460938 9.53125,21.632812 -6.816406,44.722656 -1.351562,76.691406 21.742188,93.039062 38.222656,104.70703 60.011719,105.60547 77.394531,95.339844 l 37.769529,37.542966 c 4.07813,4.29297 10.86328,4.46485 15.15625,0.38672 4.29297,-4.07422 4.46485,-10.85937 0.39063,-15.15234 -0.12891,-0.13672 -0.25391,-0.26172 -0.39063,-0.39063 z m -41.839844,3.5 C 33.0625,84.335938 18.269531,69.554688 18.257812,51.308594 18.253906,33.0625 33.035156,18.269531 51.285156,18.261719 c 18.222656,-0.0078 33.007813,14.75 33.042969,32.972656 0.03125,18.25 -14.742187,33.066406 -32.996094,33.097656 -0.0078,0 -0.01172,0 -0.02344,0 z m 0,0",style:{fill:"#000000","fill-opacity":"1","fill-rule":"nonzero",stroke:"none"},id:"path2"})],-1)])))],4),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=h=>o.value=h),ref:"searchinput",style:r.normalizeStyle({display:n.value?"block":"none"}),onClick:p[1]||(p[1]=h=>u(h)),onInput:p[2]||(p[2]=h=>u(h)),onBlur:p[3]||(p[3]=h=>c(h)),onKeydown:p[4]||(p[4]=r.withKeys(h=>c(h),["enter"])),type:"text"},null,36),[[r.vModelText,o.value]])])],36),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.breadcrumbs,h=>(r.openBlock(),r.createElementBlock("li",{key:h.title,style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{tabindex:"0",to:h.to},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),[["__scopeId","data-v-a650f215"]]),oa={install:t=>{t.component("ActionSet",ye),t.component("CommandPalette",we),t.component("Doctype",gn),t.component("Records",Mn),t.component("SheetNav",Ln)}};I.ActionSet=ye,I.CommandPalette=we,I.Doctype=gn,I.Records=Mn,I.SheetNav=Ln,I.StonecropDesktop=oa,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
29
29
|
//# sourceMappingURL=desktop.umd.cjs.map
|