@stonecrop/stonecrop 0.4.0 โ 0.4.2
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/composable.js +16 -18
- package/dist/src/composable.d.ts +1 -2
- package/dist/src/composable.d.ts.map +1 -1
- package/dist/stonecrop.d.ts +1 -2
- package/dist/stonecrop.js +139 -139
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.umd.cjs +6 -6
- package/dist/stonecrop.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/composable.ts +17 -20
package/dist/stonecrop.umd.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(w,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(w=typeof globalThis<"u"?globalThis:w||self,l(w["@stonecrop/stonecrop"]={},w.Vue))})(this,function(w,l){"use strict";var fr=Object.defineProperty;var dr=(w,l,D)=>l in w?fr(w,l,{enumerable:!0,configurable:!0,writable:!0,value:D}):w[l]=D;var b=(w,l,D)=>dr(w,typeof l!="symbol"?l+"":l,D);function D(e){this.message=e||""}D.prototype=Object.create(Error.prototype,{constructor:{value:D},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const J=class J{constructor(t,r,n,o,s){b(this,"name","Stonecrop");b(this,"registry");b(this,"store");b(this,"schema");b(this,"workflow");b(this,"actions");if(J._root)return J._root;J._root=this,this.registry=t,this.store=r,this.schema=n,this.workflow=o,this.actions=s}setup(t){this.getMeta(t),this.getWorkflow(t),this.getActions(t)}getMeta(t){return this.registry.getMeta?this.registry.getMeta(t.doctype):new D(t.doctype)}getWorkflow(t){const r=this.registry.registry[t.slug];this.workflow=r.workflow}getActions(t){const r=this.registry.registry[t.slug];this.actions=r.actions}async getRecords(t,r){this.store.$patch({records:[]});const o=await(await fetch(`/${t.slug}`,r)).json();this.store.$patch({records:o})}async getRecord(t,r){this.store.$patch({record:{}});const o=await(await fetch(`/${t.slug}/${r}`)).json();this.store.$patch({record:o})}runAction(t,r,n){var a;const s=(a=this.registry.registry[t.slug].actions)==null?void 0:a.get(r);if(this.workflow){const{initialState:i}=this.workflow;this.workflow.transition(i,{type:r}),s&&s.length>0&&s.forEach(u=>{new Function(u)(n)})}}};b(J,"_root");let ae=J;var ke=!1;function X(e,t,r){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,r),r):(e[t]=r,r)}function ce(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function
|
|
1
|
+
(function(w,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(w=typeof globalThis<"u"?globalThis:w||self,l(w["@stonecrop/stonecrop"]={},w.Vue))})(this,function(w,l){"use strict";var fr=Object.defineProperty;var dr=(w,l,D)=>l in w?fr(w,l,{enumerable:!0,configurable:!0,writable:!0,value:D}):w[l]=D;var b=(w,l,D)=>dr(w,typeof l!="symbol"?l+"":l,D);function D(e){this.message=e||""}D.prototype=Object.create(Error.prototype,{constructor:{value:D},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const J=class J{constructor(t,r,n,o,s){b(this,"name","Stonecrop");b(this,"registry");b(this,"store");b(this,"schema");b(this,"workflow");b(this,"actions");if(J._root)return J._root;J._root=this,this.registry=t,this.store=r,this.schema=n,this.workflow=o,this.actions=s}setup(t){this.getMeta(t),this.getWorkflow(t),this.getActions(t)}getMeta(t){return this.registry.getMeta?this.registry.getMeta(t.doctype):new D(t.doctype)}getWorkflow(t){const r=this.registry.registry[t.slug];this.workflow=r.workflow}getActions(t){const r=this.registry.registry[t.slug];this.actions=r.actions}async getRecords(t,r){this.store.$patch({records:[]});const o=await(await fetch(`/${t.slug}`,r)).json();this.store.$patch({records:o})}async getRecord(t,r){this.store.$patch({record:{}});const o=await(await fetch(`/${t.slug}/${r}`)).json();this.store.$patch({record:o})}runAction(t,r,n){var a;const s=(a=this.registry.registry[t.slug].actions)==null?void 0:a.get(r);if(this.workflow){const{initialState:i}=this.workflow;this.workflow.transition(i,{type:r}),s&&s.length>0&&s.forEach(u=>{new Function(u)(n)})}}};b(J,"_root");let ae=J;var ke=!1;function X(e,t,r){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,r),r):(e[t]=r,r)}function ce(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function _t(){return Pe().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Pe(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const bt=typeof Proxy=="function",wt="devtools-plugin:setup",Et="plugin:settings:set";let x,ue;function St(){var e;return x!==void 0||(typeof window<"u"&&window.performance?(x=!0,ue=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(x=!0,ue=globalThis.perf_hooks.performance):x=!1),x}function Ot(){return St()?ue.now():Date.now()}class It{constructor(t,r){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r;const n={};if(t.settings)for(const a in t.settings){const i=t.settings[a];n[a]=i.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},n);try{const a=localStorage.getItem(o),i=JSON.parse(a);Object.assign(s,i)}catch{}this.fallbacks={getSettings(){return s},setSettings(a){try{localStorage.setItem(o,JSON.stringify(a))}catch{}s=a},now(){return Ot()}},r&&r.on(Et,(a,i)=>{a===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(a,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(a,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(t){this.target=t;for(const r of this.onQueue)this.target.on[r.method](...r.args);for(const r of this.targetQueue)r.resolve(await this.target[r.method](...r.args))}}function $e(e,t){const r=e,n=Pe(),o=_t(),s=bt&&r.enableEarlyProxy;if(o&&(n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(wt,e,t);else{const a=s?new It(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:t,proxy:a}),a&&t(a.proxiedTarget)}}/*!
|
|
2
2
|
* pinia v2.3.0
|
|
3
3
|
* (c) 2024 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let z;const Q=e=>z=e,Te=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function A(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var $;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})($||($={}));const R=typeof window<"u",Me=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 Nt(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function le(e,t,r){const n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Ce(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function De(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function K(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}const Z=typeof navigator=="object"?navigator:{userAgent:""},Re=/Macintosh/.test(Z.userAgent)&&/AppleWebKit/.test(Z.userAgent)&&!/Safari/.test(Z.userAgent),Ce=R?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Re?kt:"msSaveOrOpenBlob"in Z?Pt:$t:()=>{};function kt(e,t="download",r){const n=document.createElement("a");n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin!==location.origin?De(n.href)?le(e,t,r):(n.target="_blank",K(n)):K(n)):(n.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(n.href)},4e4),setTimeout(function(){K(n)},0))}function Pt(e,t="download",r){if(typeof e=="string")if(De(e))le(e,t,r);else{const n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){K(n)})}else navigator.msSaveOrOpenBlob(Nt(e,r),t)}function $t(e,t,r,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return le(e,t,r);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Me.HTMLElement))||"safari"in Me,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&s||Re)&&typeof FileReader<"u"){const i=new FileReader;i.onloadend=function(){let u=i.result;if(typeof u!="string")throw n=null,new Error("Wrong reader.result type");u=a?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=u:location.assign(u),n=null},i.readAsDataURL(e)}else{const i=URL.createObjectURL(e);n?n.location.assign(i):location.href=i,n=null,setTimeout(function(){URL.revokeObjectURL(i)},4e4)}}function
|
|
5
|
+
*/let z;const Q=e=>z=e,Te=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function A(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var $;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})($||($={}));const R=typeof window<"u",Me=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 Nt(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function le(e,t,r){const n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Ce(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function De(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function K(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}const Z=typeof navigator=="object"?navigator:{userAgent:""},Re=/Macintosh/.test(Z.userAgent)&&/AppleWebKit/.test(Z.userAgent)&&!/Safari/.test(Z.userAgent),Ce=R?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Re?kt:"msSaveOrOpenBlob"in Z?Pt:$t:()=>{};function kt(e,t="download",r){const n=document.createElement("a");n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin!==location.origin?De(n.href)?le(e,t,r):(n.target="_blank",K(n)):K(n)):(n.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(n.href)},4e4),setTimeout(function(){K(n)},0))}function Pt(e,t="download",r){if(typeof e=="string")if(De(e))le(e,t,r);else{const n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){K(n)})}else navigator.msSaveOrOpenBlob(Nt(e,r),t)}function $t(e,t,r,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return le(e,t,r);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Me.HTMLElement))||"safari"in Me,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&s||Re)&&typeof FileReader<"u"){const i=new FileReader;i.onloadend=function(){let u=i.result;if(typeof u!="string")throw n=null,new Error("Wrong reader.result type");u=a?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=u:location.assign(u),n=null},i.readAsDataURL(e)}else{const i=URL.createObjectURL(e);n?n.location.assign(i):location.href=i,n=null,setTimeout(function(){URL.revokeObjectURL(i)},4e4)}}function _(e,t){const r="๐ "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(r,t):t==="error"?console.error(r):t==="warn"?console.warn(r):console.log(r)}function fe(e){return"_a"in e&&"install"in e}function Le(){if(!("clipboard"in navigator))return _("Your browser doesn't support the Clipboard API","error"),!0}function je(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(_('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Tt(e){if(!Le())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),_("Global state copied to clipboard.")}catch(t){if(je(t))return;_("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function Mt(e){if(!Le())try{Ae(e,JSON.parse(await navigator.clipboard.readText())),_("Global state pasted from clipboard.")}catch(t){if(je(t))return;_("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Dt(e){try{Ce(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){_("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let T;function Rt(){T||(T=document.createElement("input"),T.type="file",T.accept=".json");function e(){return new Promise((t,r)=>{T.onchange=async()=>{const n=T.files;if(!n)return t(null);const o=n.item(0);return t(o?{text:await o.text(),file:o}:null)},T.oncancel=()=>t(null),T.onerror=r,T.click()})}return e}async function Ct(e){try{const r=await Rt()();if(!r)return;const{text:n,file:o}=r;Ae(e,JSON.parse(n)),_(`Global state imported from "${o.name}".`)}catch(t){_("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function Ae(e,t){for(const r in t){const n=e.state.value[r];n?Object.assign(n,t[r]):e.state.value[r]=t[r]}}function P(e){return{_custom:{display:e}}}const Ve="๐ Pinia (root)",ee="_root";function Lt(e){return fe(e)?{id:ee,label:Ve}:{id:e.$id,label:e.$id}}function jt(e){if(fe(e)){const r=Array.from(e._s.keys()),n=e._s;return{state:r.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:r.filter(s=>n.get(s)._getters).map(s=>{const a=n.get(s);return{editable:!1,key:s,value:a._getters.reduce((i,u)=>(i[u]=a[u],i),{})}})}}const t={state:Object.keys(e.$state).map(r=>({editable:!0,key:r,value:e.$state[r]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(r=>({editable:!1,key:r,value:e[r]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(r=>({editable:!0,key:r,value:e[r]}))),t}function At(e){return e?Array.isArray(e)?e.reduce((t,r)=>(t.keys.push(r.key),t.operations.push(r.type),t.oldValue[r.key]=r.oldValue,t.newValue[r.key]=r.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:P(e.type),key:P(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Vt(e){switch(e){case $.direct:return"mutation";case $.patchFunction:return"$patch";case $.patchObject:return"$patch";default:return"unknown"}}let U=!0;const te=[],V="pinia:mutations",E="pinia",{assign:Bt}=Object,ne=e=>"๐ "+e;function xt(e,t){$e({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:te,app:e},r=>{typeof r.now!="function"&&_("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."),r.addTimelineLayer({id:V,label:"Pinia ๐",color:15064968}),r.addInspector({id:E,label:"Pinia ๐",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Tt(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Mt(t),r.sendInspectorTree(E),r.sendInspectorState(E)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Dt(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Ct(t),r.sendInspectorTree(E),r.sendInspectorState(E)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:n=>{const o=t._s.get(n);o?typeof o.$reset!="function"?_(`Cannot reset "${n}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),_(`Store "${n}" reset.`)):_(`Cannot reset "${n}" store because it wasn't found.`,"warn")}}]}),r.on.inspectComponent((n,o)=>{const s=n.componentInstance&&n.componentInstance.proxy;if(s&&s._pStores){const a=n.componentInstance.proxy._pStores;Object.values(a).forEach(i=>{n.instanceData.state.push({type:ne(i.$id),key:"state",editable:!0,value:i._isOptionsAPI?{_custom:{value:l.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&&n.instanceData.state.push({type:ne(i.$id),key:"getters",editable:!1,value:i._getters.reduce((u,c)=>{try{u[c]=i[c]}catch(h){u[c]=h}return u},{})})})}}),r.on.getInspectorTree(n=>{if(n.app===e&&n.inspectorId===E){let o=[t];o=o.concat(Array.from(t._s.values())),n.rootNodes=(n.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(n.filter.toLowerCase()):Ve.toLowerCase().includes(n.filter.toLowerCase())):o).map(Lt)}}),globalThis.$pinia=t,r.on.getInspectorState(n=>{if(n.app===e&&n.inspectorId===E){const o=n.nodeId===ee?t:t._s.get(n.nodeId);if(!o)return;o&&(n.nodeId!==ee&&(globalThis.$store=l.toRaw(o)),n.state=jt(o))}}),r.on.editInspectorState((n,o)=>{if(n.app===e&&n.inspectorId===E){const s=n.nodeId===ee?t:t._s.get(n.nodeId);if(!s)return _(`store "${n.nodeId}" not found`,"error");const{path:a}=n;fe(s)?a.unshift("state"):(a.length!==1||!s._customProperties.has(a[0])||a[0]in s.$state)&&a.unshift("$state"),U=!1,n.set(s,a,n.state.value),U=!0}}),r.on.editComponentState(n=>{if(n.type.startsWith("๐")){const o=n.type.replace(/^๐\s*/,""),s=t._s.get(o);if(!s)return _(`store "${o}" not found`,"error");const{path:a}=n;if(a[0]!=="state")return _(`Invalid path for store "${o}":
|
|
6
6
|
${a}
|
|
7
|
-
Only state can be modified.`);a[0]="$state",U=!1,n.set(s,a,n.state.value),U=!0}})})}function Ut(e,t){te.includes(ne(t.$id))||te.push(ne(t.$id)),$e({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:te,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},r=>{const n=typeof r.now=="function"?r.now.bind(r):Date.now;t.$onAction(({after:a,onError:i,name:u,args:c})=>{const
|
|
7
|
+
Only state can be modified.`);a[0]="$state",U=!1,n.set(s,a,n.state.value),U=!0}})})}function Ut(e,t){te.includes(ne(t.$id))||te.push(ne(t.$id)),$e({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:te,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},r=>{const n=typeof r.now=="function"?r.now.bind(r):Date.now;t.$onAction(({after:a,onError:i,name:u,args:c})=>{const h=Be++;r.addTimelineEvent({layerId:V,event:{time:n(),title:"๐ซ "+u,subtitle:"start",data:{store:P(t.$id),action:P(u),args:c},groupId:h}}),a(p=>{C=void 0,r.addTimelineEvent({layerId:V,event:{time:n(),title:"๐ฌ "+u,subtitle:"end",data:{store:P(t.$id),action:P(u),args:c,result:p},groupId:h}})}),i(p=>{C=void 0,r.addTimelineEvent({layerId:V,event:{time:n(),logType:"error",title:"๐ฅ "+u,subtitle:"end",data:{store:P(t.$id),action:P(u),args:c,error:p},groupId:h}})})},!0),t._customProperties.forEach(a=>{l.watch(()=>l.unref(t[a]),(i,u)=>{r.notifyComponentUpdate(),r.sendInspectorState(E),U&&r.addTimelineEvent({layerId:V,event:{time:n(),title:"Change",subtitle:a,data:{newValue:i,oldValue:u},groupId:C}})},{deep:!0})}),t.$subscribe(({events:a,type:i},u)=>{if(r.notifyComponentUpdate(),r.sendInspectorState(E),!U)return;const c={time:n(),title:Vt(i),data:Bt({store:P(t.$id)},At(a)),groupId:C};i===$.patchFunction?c.subtitle="โคต๏ธ":i===$.patchObject?c.subtitle="๐งฉ":a&&!Array.isArray(a)&&(c.subtitle=a.type),a&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:a}}),r.addTimelineEvent({layerId:V,event:c})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=l.markRaw(a=>{o(a),r.addTimelineEvent({layerId:V,event:{time:n(),title:"๐ฅ "+t.$id,subtitle:"HMR update",data:{store:P(t.$id),info:P("HMR update")}}}),r.notifyComponentUpdate(),r.sendInspectorTree(E),r.sendInspectorState(E)});const{$dispose:s}=t;t.$dispose=()=>{s(),r.notifyComponentUpdate(),r.sendInspectorTree(E),r.sendInspectorState(E),r.getSettings().logStoreChanges&&_(`Disposed "${t.$id}" store ๐`)},r.notifyComponentUpdate(),r.sendInspectorTree(E),r.sendInspectorState(E),r.getSettings().logStoreChanges&&_(`"${t.$id}" store installed ๐`)})}let Be=0,C;function xe(e,t,r){const n=t.reduce((o,s)=>(o[s]=l.toRaw(e)[s],o),{});for(const o in n)e[o]=function(){const s=Be,a=r?new Proxy(e,{get(...u){return C=s,Reflect.get(...u)},set(...u){return C=s,Reflect.set(...u)}}):e;C=s;const i=n[o].apply(a,arguments);return C=void 0,i}}function Ft({app:e,store:t,options:r}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!r.state,!t._p._testing){xe(t,Object.keys(r.actions),t._isOptionsAPI);const n=t._hotUpdate;l.toRaw(t)._hotUpdate=function(o){n.apply(this,arguments),xe(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}Ut(e,t)}}function Ht(){const e=l.effectScope(!0),t=e.run(()=>l.ref({}));let r=[],n=[];const o=l.markRaw({install(s){Q(o),o._a=s,s.provide(Te,o),s.config.globalProperties.$pinia=o,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&R&&xt(s,o),n.forEach(a=>r.push(a)),n=[]},use(s){return!this._a&&!ke?n.push(s):r.push(s),this},_p:r,_a:null,_e:e,_s:new Map,state:t});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&R&&typeof Proxy<"u"&&o.use(Ft),o}function Ue(e,t){for(const r in t){const n=t[r];if(!(r in e))continue;const o=e[r];A(o)&&A(n)&&!l.isRef(n)&&!l.isReactive(n)?e[r]=Ue(o,n):e[r]=n}return e}const Fe=()=>{};function He(e,t,r,n=Fe){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),n())};return!r&&l.getCurrentScope()&&l.onScopeDispose(o),o}function F(e,...t){e.slice().forEach(r=>{r(...t)})}const Jt=e=>e(),Je=Symbol(),de=Symbol();function pe(e,t){e instanceof Map&&t instanceof Map?t.forEach((r,n)=>e.set(n,r)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const r in t){if(!t.hasOwnProperty(r))continue;const n=t[r],o=e[r];A(o)&&A(n)&&e.hasOwnProperty(r)&&!l.isRef(n)&&!l.isReactive(n)?e[r]=pe(o,n):e[r]=n}return e}const Gt=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Wt(e){return!A(e)||!e.hasOwnProperty(Gt)}const{assign:O}=Object;function Ge(e){return!!(l.isRef(e)&&e.effect)}function We(e,t,r,n){const{state:o,actions:s,getters:a}=t,i=r.state.value[e];let u;function c(){!i&&(process.env.NODE_ENV==="production"||!n)&&(r.state.value[e]=o?o():{});const h=process.env.NODE_ENV!=="production"&&n?l.toRefs(l.ref(o?o():{}).value):l.toRefs(r.state.value[e]);return O(h,s,Object.keys(a||{}).reduce((p,g)=>(process.env.NODE_ENV!=="production"&&g in h&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${g}" in store "${e}".`),p[g]=l.markRaw(l.computed(()=>{Q(r);const S=r._s.get(e);return a[g].call(S,S)})),p),{}))}return u=he(e,c,t,r,n,!0),u}function he(e,t,r={},n,o,s){let a;const i=O({actions:{}},r);if(process.env.NODE_ENV!=="production"&&!n._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!ke&&(u.onTrigger=d=>{c?S=d:c==!1&&!m._hotUpdating&&(Array.isArray(S)?S.push(d):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,h,p=[],g=[],S;const I=n.state.value[e];!s&&!I&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[e]={});const W=l.ref({});let v;function L(d){let f;c=h=!1,process.env.NODE_ENV!=="production"&&(S=[]),typeof d=="function"?(d(n.state.value[e]),f={type:$.patchFunction,storeId:e,events:S}):(pe(n.state.value[e],d),f={type:$.patchObject,payload:d,storeId:e,events:S});const y=v=Symbol();l.nextTick().then(()=>{v===y&&(c=!0)}),h=!0,F(p,f,n.state.value[e])}const ar=s?function(){const{state:f}=r,y=f?f():{};this.$patch(N=>{O(N,y)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Fe;function cr(){a.stop(),p=[],g=[],n._s.delete(e)}const Ie=(d,f="")=>{if(Je in d)return d[de]=f,d;const y=function(){Q(n);const N=Array.from(arguments),Y=[],Ne=[];function ur(k){Y.push(k)}function lr(k){Ne.push(k)}F(g,{args:N,name:y[de],store:m,after:ur,onError:lr});let q;try{q=d.apply(this&&this.$id===e?this:m,N)}catch(k){throw F(Ne,k),k}return q instanceof Promise?q.then(k=>(F(Y,k),k)).catch(k=>(F(Ne,k),Promise.reject(k))):(F(Y,q),q)};return y[Je]=!0,y[de]=f,y},ie=l.markRaw({actions:{},getters:{},state:[],hotState:W}),vt={_p:n,$id:e,$onAction:He.bind(null,g),$patch:L,$reset:ar,$subscribe(d,f={}){const y=He(p,d,f.detached,()=>N()),N=a.run(()=>l.watch(()=>n.state.value[e],Y=>{(f.flush==="sync"?h:c)&&d({storeId:e,type:$.direct,events:S},Y)},O({},u,f)));return y},$dispose:cr},m=l.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&R?O({_hmrPayload:ie,_customProperties:l.markRaw(new Set)},vt):vt);n._s.set(e,m);const j=(n._a&&n._a.runWithContext||Jt)(()=>n._e.run(()=>(a=l.effectScope()).run(()=>t({action:Ie}))));for(const d in j){const f=j[d];if(l.isRef(f)&&!Ge(f)||l.isReactive(f))process.env.NODE_ENV!=="production"&&o?X(W.value,d,l.toRef(j,d)):s||(I&&Wt(f)&&(l.isRef(f)?f.value=I[d]:pe(f,I[d])),n.state.value[e][d]=f),process.env.NODE_ENV!=="production"&&ie.state.push(d);else if(typeof f=="function"){const y=process.env.NODE_ENV!=="production"&&o?f:Ie(f,d);j[d]=y,process.env.NODE_ENV!=="production"&&(ie.actions[d]=f),i.actions[d]=f}else process.env.NODE_ENV!=="production"&&Ge(f)&&(ie.getters[d]=s?r.getters[d]:f,R&&(j._getters||(j._getters=l.markRaw([]))).push(d))}if(O(m,j),O(l.toRaw(m),j),Object.defineProperty(m,"$state",{get:()=>process.env.NODE_ENV!=="production"&&o?W.value:n.state.value[e],set:d=>{if(process.env.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");L(f=>{O(f,d)})}}),process.env.NODE_ENV!=="production"&&(m._hotUpdate=l.markRaw(d=>{m._hotUpdating=!0,d._hmrPayload.state.forEach(f=>{if(f in m.$state){const y=d.$state[f],N=m.$state[f];typeof y=="object"&&A(y)&&A(N)?Ue(y,N):d.$state[f]=N}X(m,f,l.toRef(d.$state,f))}),Object.keys(m.$state).forEach(f=>{f in d.$state||ce(m,f)}),c=!1,h=!1,n.state.value[e]=l.toRef(d._hmrPayload,"hotState"),h=!0,l.nextTick().then(()=>{c=!0});for(const f in d._hmrPayload.actions){const y=d[f];X(m,f,Ie(y,f))}for(const f in d._hmrPayload.getters){const y=d._hmrPayload.getters[f],N=s?l.computed(()=>(Q(n),y.call(m,m))):y;X(m,f,N)}Object.keys(m._hmrPayload.getters).forEach(f=>{f in d._hmrPayload.getters||ce(m,f)}),Object.keys(m._hmrPayload.actions).forEach(f=>{f in d._hmrPayload.actions||ce(m,f)}),m._hmrPayload=d._hmrPayload,m._getters=d._getters,m._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&R){const d={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(f=>{Object.defineProperty(m,f,O({value:m[f]},d))})}return n._p.forEach(d=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&R){const f=a.run(()=>d({store:m,app:n._a,pinia:n,options:i}));Object.keys(f||{}).forEach(y=>m._customProperties.add(y)),O(m,f)}else O(m,a.run(()=>d({store:m,app:n._a,pinia:n,options:i})))}),process.env.NODE_ENV!=="production"&&m.$state&&typeof m.$state=="object"&&typeof m.$state.constructor=="function"&&!m.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
8
8
|
state: () => new MyClass()
|
|
9
|
-
Found in store "${m.$id}".`),I&&s&&r.hydrate&&r.hydrate(m.$state,I),c=!0,
|
|
9
|
+
Found in store "${m.$id}".`),I&&s&&r.hydrate&&r.hydrate(m.$state,I),c=!0,h=!0,m}/*! #__NO_SIDE_EFFECTS__ */function zt(e,t,r){let n,o;const s=typeof t=="function";n=e,o=s?r:t;function a(i,u){const c=l.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&z&&z._testing?null:i)||(c?l.inject(Te,null):null),i&&Q(i),process.env.NODE_ENV!=="production"&&!z)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=z,i._s.has(n)||(s?he(n,t,o,i):We(n,o,i),process.env.NODE_ENV!=="production"&&(a._pinia=i));const p=i._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const h="__hot:"+n,g=s?he(h,t,o,i,!0):We(h,O({},o),i,!0);u._hotUpdate(g),delete i.state.value[h],i._s.delete(h)}if(process.env.NODE_ENV!=="production"&&R){const h=l.getCurrentInstance();if(h&&h.proxy&&!u){const g=h.proxy,S="_pStores"in g?g._pStores:g._pStores={};S[n]=p}}return p}return a.$id=n,a}const Qt=zt("data",()=>{const e=l.ref([]),t=l.ref({});return{records:e,record:t}});function Yt(e){e||(e=l.inject("$registry"));let t;try{t=Qt()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}const r=l.ref(new ae(e,t)),n=l.ref(!1);return l.onBeforeMount(async()=>{var u,c,p;if(!e||!e.router)return;const o=e.router.currentRoute.value,s=(u=o.params.records)==null?void 0:u.toString().toLowerCase(),a=(c=o.params.record)==null?void 0:c.toString().toLowerCase();if(!s&&!a)return;const i=await((p=e.getMeta)==null?void 0:p.call(e,s));i&&(e.addDoctype(i),r.value.setup(i),s&&(a?await r.value.getRecord(i,a):await r.value.getRecords(i)),r.value.runAction(i,"LOAD",a?[a]:void 0)),n.value=!0}),{stonecrop:r,isReady:n}}class qt{constructor(t,r,n,o,s){b(this,"doctype");b(this,"schema");b(this,"workflow");b(this,"actions");b(this,"component");this.doctype=t,this.schema=r,this.workflow=n,this.actions=o,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}}const G=class G{constructor(t,r){b(this,"name");b(this,"registry");b(this,"router");b(this,"getMeta");if(G._root)return G._root;G._root=this,this.name="Registry",this.registry={},this.router=t,this.getMeta=r}addDoctype(t){t.doctype in Object.keys(this.registry)||(this.registry[t.slug]=t),t.component&&this.router&&!this.router.hasRoute(t.doctype)&&this.router.addRoute({path:`/${t.slug}`,name:t.slug,component:t.component})}};b(G,"_root");let re=G;function Xt(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var B=Promise.resolve();function ze(e,t){return e||(e=0),new Promise(function(r){return setTimeout(function(){return r(t)},e)})}function Kt(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function me(){return Math.random().toString(36).substring(2)}var Qe=0,ge=0;function oe(){var e=new Date().getTime();return e===Qe?(ge++,e*1e3+ge):(Qe=e,ge=0,e*1e3)}var Zt=oe,en="native";function tn(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(r){t.messagesCallback&&t.messagesCallback(r.data)},t}function nn(e){e.bc.close(),e.subFns=[]}function rn(e,t){try{return e.bc.postMessage(t,!1),B}catch(r){return Promise.reject(r)}}function on(e,t){e.messagesCallback=t}function sn(){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 an(){return 150}var cn={create:tn,close:nn,onMessage:on,postMessage:rn,canBeUsed:sn,type:en,averageResponseTime:an,microSeconds:Zt},Ye=function(){function e(t){this.ttl=t,this.map=new Map,this._to=!1}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.add=function(t){var r=this;this.map.set(t,qe()),this._to||(this._to=!0,setTimeout(function(){r._to=!1,un(r)},0))},e.prototype.clear=function(){this.map.clear()},e}();function un(e){for(var t=qe()-e.ttl,r=e.map[Symbol.iterator]();;){var n=r.next().value;if(!n)return;var o=n[0],s=n[1];if(s<t)e.map.delete(o);else return}}function qe(){return new Date().getTime()}function ye(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return typeof t.webWorkerSupport>"u"&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=1e3*45),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&typeof e.idb.onclose=="function"&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=1e3*60),e.methods&&(t.methods=e.methods),t.node||(t.node={}),t.node.ttl||(t.node.ttl=1e3*60*2),t.node.maxParallelWrites||(t.node.maxParallelWrites=2048),typeof t.node.useFastPath>"u"&&(t.node.useFastPath=!0),t}var ln=oe,fn="pubkey.broadcast-channel-0-",M="messages",se={durability:"relaxed"},dn="idb";function Xe(){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 _e(e){e.commit&&e.commit()}function pn(e){var t=Xe(),r=fn+e,n=t.open(r);return n.onupgradeneeded=function(o){var s=o.target.result;s.createObjectStore(M,{keyPath:"id",autoIncrement:!0})},new Promise(function(o,s){n.onerror=function(a){return s(a)},n.onsuccess=function(){o(n.result)}})}function hn(e,t,r){var n=new Date().getTime(),o={uuid:t,time:n,data:r},s=e.transaction([M],"readwrite",se);return new Promise(function(a,i){s.oncomplete=function(){return a()},s.onerror=function(c){return i(c)};var u=s.objectStore(M);u.add(o),_e(s)})}function mn(e,t){var r=e.transaction(M,"readonly",se),n=r.objectStore(M),o=[],s=IDBKeyRange.bound(t+1,1/0);if(n.getAll){var a=n.getAll(s);return new Promise(function(u,c){a.onerror=function(p){return c(p)},a.onsuccess=function(p){u(p.target.result)}})}function i(){try{return s=IDBKeyRange.bound(t+1,1/0),n.openCursor(s)}catch{return n.openCursor()}}return new Promise(function(u,c){var p=i();p.onerror=function(h){return c(h)},p.onsuccess=function(h){var g=h.target.result;g?g.value.id<t+1?g.continue(t+1):(o.push(g.value),g.continue()):(_e(r),u(o))}})}function gn(e,t){if(e.closed)return Promise.resolve([]);var r=e.db.transaction(M,"readwrite",se),n=r.objectStore(M);return Promise.all(t.map(function(o){var s=n.delete(o);return new Promise(function(a){s.onsuccess=function(){return a()}})}))}function yn(e,t){var r=new Date().getTime()-t,n=e.transaction(M,"readonly",se),o=n.objectStore(M),s=[];return new Promise(function(a){o.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<r?(s.push(c),u.continue()):(_e(n),a(s))}else a(s)}})}function _n(e){return yn(e.db,e.options.idb.ttl).then(function(t){return gn(e,t.map(function(r){return r.id}))})}function vn(e,t){return t=ye(t),pn(e).then(function(r){var n={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:me(),eMIs:new Ye(t.idb.ttl*2),writeBlockPromise:B,messagesCallback:null,readQueuePromises:[],db:r};return r.onclose=function(){n.closed=!0,t.idb.onclose&&t.idb.onclose()},Ke(n),n})}function Ke(e){e.closed||Ze(e).then(function(){return ze(e.options.idb.fallbackInterval)}).then(function(){return Ke(e)})}function bn(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function Ze(e){return e.closed||!e.messagesCallback?B:mn(e.db,e.lastCursorId).then(function(t){var r=t.filter(function(n){return!!n}).map(function(n){return n.id>e.lastCursorId&&(e.lastCursorId=n.id),n}).filter(function(n){return bn(n,e)}).sort(function(n,o){return n.time-o.time});return r.forEach(function(n){e.messagesCallback&&(e.eMIs.add(n.id),e.messagesCallback(n.data))}),B})}function wn(e){e.closed=!0,e.db.close()}function En(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return hn(e.db,e.uuid,t)}).then(function(){Kt(0,10)===0&&_n(e)}),e.writeBlockPromise}function Sn(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t,Ze(e)}function On(){return!!Xe()}function In(e){return e.idb.fallbackInterval*2}var Nn={create:vn,close:wn,onMessage:Sn,postMessage:En,canBeUsed:On,type:dn,averageResponseTime:In,microSeconds:ln},kn=oe,Pn="pubkey.broadcastChannel-",$n="localstorage";function et(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function tt(e){return Pn+e}function Tn(e,t){return new Promise(function(r){ze().then(function(){var n=tt(e.channelName),o={token:me(),time:new Date().getTime(),data:t,uuid:e.uuid},s=JSON.stringify(o);et().setItem(n,s);var a=document.createEvent("Event");a.initEvent("storage",!0,!0),a.key=n,a.newValue=s,window.dispatchEvent(a),r()})})}function Mn(e,t){var r=tt(e),n=function(s){s.key===r&&t(JSON.parse(s.newValue))};return window.addEventListener("storage",n),n}function Dn(e){window.removeEventListener("storage",e)}function Rn(e,t){if(t=ye(t),!nt())throw new Error("BroadcastChannel: localstorage cannot be used");var r=me(),n=new Ye(t.localstorage.removeTimeout),o={channelName:e,uuid:r,eMIs:n};return o.listener=Mn(e,function(s){o.messagesCallback&&s.uuid!==r&&(!s.token||n.has(s.token)||s.data.time&&s.data.time<o.messagesCallbackTime||(n.add(s.token),o.messagesCallback(s.data)))}),o}function Cn(e){Dn(e.listener)}function Ln(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t}function nt(){var e=et();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function jn(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var An={create:Rn,close:Cn,onMessage:Ln,postMessage:Tn,canBeUsed:nt,type:$n,averageResponseTime:jn,microSeconds:kn},Vn=oe,Bn="simulate",ve=new Set;function xn(e){var t={name:e,messagesCallback:null};return ve.add(t),t}function Un(e){ve.delete(e)}function Fn(e,t){return new Promise(function(r){return setTimeout(function(){var n=Array.from(ve);n.filter(function(o){return o.name===e.name}).filter(function(o){return o!==e}).filter(function(o){return!!o.messagesCallback}).forEach(function(o){return o.messagesCallback(t)}),r()},5)})}function Hn(e,t){e.messagesCallback=t}function Jn(){return!0}function Gn(){return 5}var Wn={create:xn,close:Un,onMessage:Hn,postMessage:Fn,canBeUsed:Jn,type:Bn,averageResponseTime:Gn,microSeconds:Vn},rt=[cn,Nn,An];function zn(e){var t=[].concat(e.methods,rt).filter(Boolean);if(e.type){if(e.type==="simulate")return Wn;var r=t.find(function(o){return o.type===e.type});if(r)return r;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(o){return o.type!=="idb"}));var n=t.find(function(o){return o.canBeUsed()});if(n)return n;throw new Error("No usable method found in "+JSON.stringify(rt.map(function(o){return o.type})))}var ot=new Set,Qn=0,be=function(t,r){this.id=Qn++,ot.add(this),this.name=t,st&&(r=st),this.options=ye(r),this.method=zn(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Yn(this)};be._pubkey=!0;var st;be.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return it(this,"message",t)},postInternal:function(t){return it(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),r={time:t,fn:e};ut(this,"message",this._onML),e&&typeof e=="function"?(this._onML=r,ct(this,"message",r)):this._onML=null},addEventListener:function(t,r){var n=this.method.microSeconds(),o={time:n,fn:r};ct(this,t,o)},removeEventListener:function(t,r){var n=this._addEL[t].find(function(o){return o.fn===r});ut(this,t,n)},close:function(){var t=this;if(!this.closed){ot.delete(this),this.closed=!0;var r=this._prepP?this._prepP:B;return this._onML=null,this._addEL.message=[],r.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 it(e,t,r){var n=e.method.microSeconds(),o={time:n,type:t,data:r},s=e._prepP?e._prepP:B;return s.then(function(){var a=e.method.postMessage(e._state,o);return e._uMP.add(a),a.catch().then(function(){return e._uMP.delete(a)}),a})}function Yn(e){var t=e.method.create(e.name,e.options);Xt(t)?(e._prepP=t,t.then(function(r){e._state=r})):e._state=t}function at(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function ct(e,t,r){e._addEL[t].push(r),qn(e)}function ut(e,t,r){e._addEL[t]=e._addEL[t].filter(function(n){return n!==r}),Xn(e)}function qn(e){if(!e._iL&&at(e)){var t=function(o){e._addEL[o.type].forEach(function(s){var a=1e5,i=s.time-a;o.time>=i&&s.fn(o.data)})},r=e.method.microSeconds();e._prepP?e._prepP.then(function(){e._iL=!0,e.method.onMessage(e._state,t,r)}):(e._iL=!0,e.method.onMessage(e._state,t,r))}}function Xn(e){if(e._iL&&!at(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class we extends Error{constructor(t,r){super(t),this.name="DevalueError",this.path=r.join("")}}function lt(e){return Object(e)!==e}const Kn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zn(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Kn}function er(e){return Object.prototype.toString.call(e).slice(8,-1)}function tr(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
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 e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function H(e){let t="",r=0;const n=e.length;for(let o=0;o<n;o+=1){const s=e[o],a=tr(s);a&&(t+=e.slice(r,o)+a,r=o+1)}return`"${r===0?e:t+e.slice(r)}"`}const Ee=-1,ft=-2,dt=-3,pt=-4,ht=-5,Se=-6;function mt(e,t){return nr(JSON.parse(e))}function nr(e,t){if(typeof e=="number")return o(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const r=e,n=Array(r.length);function o(s,a=!1){if(s===Ee)return;if(s===dt)return NaN;if(s===pt)return 1/0;if(s===ht)return-1/0;if(s===Se)return-0;if(a)throw new Error("Invalid input");if(s in n)return n[s];const i=r[s];if(!i||typeof i!="object")n[s]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0];switch(u){case"Date":n[s]=new Date(i[1]);break;case"Set":const c=new Set;n[s]=c;for(let g=1;g<i.length;g+=1)c.add(o(i[g]));break;case"Map":const
|
|
11
|
+
This will fail in production.`);i=z,i._s.has(n)||(s?he(n,t,o,i):We(n,o,i),process.env.NODE_ENV!=="production"&&(a._pinia=i));const h=i._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const p="__hot:"+n,g=s?he(p,t,o,i,!0):We(p,O({},o),i,!0);u._hotUpdate(g),delete i.state.value[p],i._s.delete(p)}if(process.env.NODE_ENV!=="production"&&R){const p=l.getCurrentInstance();if(p&&p.proxy&&!u){const g=p.proxy,S="_pStores"in g?g._pStores:g._pStores={};S[n]=h}}return h}return a.$id=n,a}const Qt=zt("data",()=>{const e=l.ref([]),t=l.ref({});return{records:e,record:t}});function Yt(e){const t=l.ref();return l.onMounted(async()=>{var i,u,c;e||(e=l.inject("$registry"));let r;try{r=Qt()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(t.value=new ae(e,r),!e||!e.router)return;const n=e.router.currentRoute.value,o=(i=n.params.records)==null?void 0:i.toString().toLowerCase(),s=(u=n.params.record)==null?void 0:u.toString().toLowerCase();if(!o&&!s)return;const a=await((c=e.getMeta)==null?void 0:c.call(e,o));a&&(e.addDoctype(a),t.value.setup(a),o&&(s?await t.value.getRecord(a,s):await t.value.getRecords(a)),t.value.runAction(a,"LOAD",s?[s]:void 0))}),{stonecrop:t}}class qt{constructor(t,r,n,o,s){b(this,"doctype");b(this,"schema");b(this,"workflow");b(this,"actions");b(this,"component");this.doctype=t,this.schema=r,this.workflow=n,this.actions=o,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}}const G=class G{constructor(t,r){b(this,"name");b(this,"registry");b(this,"router");b(this,"getMeta");if(G._root)return G._root;G._root=this,this.name="Registry",this.registry={},this.router=t,this.getMeta=r}addDoctype(t){t.doctype in Object.keys(this.registry)||(this.registry[t.slug]=t),t.component&&this.router&&!this.router.hasRoute(t.doctype)&&this.router.addRoute({path:`/${t.slug}`,name:t.slug,component:t.component})}};b(G,"_root");let re=G;function Xt(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var B=Promise.resolve();function ze(e,t){return e||(e=0),new Promise(function(r){return setTimeout(function(){return r(t)},e)})}function Kt(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function me(){return Math.random().toString(36).substring(2)}var Qe=0,ge=0;function oe(){var e=new Date().getTime();return e===Qe?(ge++,e*1e3+ge):(Qe=e,ge=0,e*1e3)}var Zt=oe,en="native";function tn(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(r){t.messagesCallback&&t.messagesCallback(r.data)},t}function nn(e){e.bc.close(),e.subFns=[]}function rn(e,t){try{return e.bc.postMessage(t,!1),B}catch(r){return Promise.reject(r)}}function on(e,t){e.messagesCallback=t}function sn(){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 an(){return 150}var cn={create:tn,close:nn,onMessage:on,postMessage:rn,canBeUsed:sn,type:en,averageResponseTime:an,microSeconds:Zt},Ye=function(){function e(t){this.ttl=t,this.map=new Map,this._to=!1}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.add=function(t){var r=this;this.map.set(t,qe()),this._to||(this._to=!0,setTimeout(function(){r._to=!1,un(r)},0))},e.prototype.clear=function(){this.map.clear()},e}();function un(e){for(var t=qe()-e.ttl,r=e.map[Symbol.iterator]();;){var n=r.next().value;if(!n)return;var o=n[0],s=n[1];if(s<t)e.map.delete(o);else return}}function qe(){return new Date().getTime()}function ye(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return typeof t.webWorkerSupport>"u"&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=1e3*45),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&typeof e.idb.onclose=="function"&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=1e3*60),e.methods&&(t.methods=e.methods),t.node||(t.node={}),t.node.ttl||(t.node.ttl=1e3*60*2),t.node.maxParallelWrites||(t.node.maxParallelWrites=2048),typeof t.node.useFastPath>"u"&&(t.node.useFastPath=!0),t}var ln=oe,fn="pubkey.broadcast-channel-0-",M="messages",se={durability:"relaxed"},dn="idb";function Xe(){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 ve(e){e.commit&&e.commit()}function pn(e){var t=Xe(),r=fn+e,n=t.open(r);return n.onupgradeneeded=function(o){var s=o.target.result;s.createObjectStore(M,{keyPath:"id",autoIncrement:!0})},new Promise(function(o,s){n.onerror=function(a){return s(a)},n.onsuccess=function(){o(n.result)}})}function hn(e,t,r){var n=new Date().getTime(),o={uuid:t,time:n,data:r},s=e.transaction([M],"readwrite",se);return new Promise(function(a,i){s.oncomplete=function(){return a()},s.onerror=function(c){return i(c)};var u=s.objectStore(M);u.add(o),ve(s)})}function mn(e,t){var r=e.transaction(M,"readonly",se),n=r.objectStore(M),o=[],s=IDBKeyRange.bound(t+1,1/0);if(n.getAll){var a=n.getAll(s);return new Promise(function(u,c){a.onerror=function(h){return c(h)},a.onsuccess=function(h){u(h.target.result)}})}function i(){try{return s=IDBKeyRange.bound(t+1,1/0),n.openCursor(s)}catch{return n.openCursor()}}return new Promise(function(u,c){var h=i();h.onerror=function(p){return c(p)},h.onsuccess=function(p){var g=p.target.result;g?g.value.id<t+1?g.continue(t+1):(o.push(g.value),g.continue()):(ve(r),u(o))}})}function gn(e,t){if(e.closed)return Promise.resolve([]);var r=e.db.transaction(M,"readwrite",se),n=r.objectStore(M);return Promise.all(t.map(function(o){var s=n.delete(o);return new Promise(function(a){s.onsuccess=function(){return a()}})}))}function yn(e,t){var r=new Date().getTime()-t,n=e.transaction(M,"readonly",se),o=n.objectStore(M),s=[];return new Promise(function(a){o.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<r?(s.push(c),u.continue()):(ve(n),a(s))}else a(s)}})}function vn(e){return yn(e.db,e.options.idb.ttl).then(function(t){return gn(e,t.map(function(r){return r.id}))})}function _n(e,t){return t=ye(t),pn(e).then(function(r){var n={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:me(),eMIs:new Ye(t.idb.ttl*2),writeBlockPromise:B,messagesCallback:null,readQueuePromises:[],db:r};return r.onclose=function(){n.closed=!0,t.idb.onclose&&t.idb.onclose()},Ke(n),n})}function Ke(e){e.closed||Ze(e).then(function(){return ze(e.options.idb.fallbackInterval)}).then(function(){return Ke(e)})}function bn(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function Ze(e){return e.closed||!e.messagesCallback?B:mn(e.db,e.lastCursorId).then(function(t){var r=t.filter(function(n){return!!n}).map(function(n){return n.id>e.lastCursorId&&(e.lastCursorId=n.id),n}).filter(function(n){return bn(n,e)}).sort(function(n,o){return n.time-o.time});return r.forEach(function(n){e.messagesCallback&&(e.eMIs.add(n.id),e.messagesCallback(n.data))}),B})}function wn(e){e.closed=!0,e.db.close()}function En(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return hn(e.db,e.uuid,t)}).then(function(){Kt(0,10)===0&&vn(e)}),e.writeBlockPromise}function Sn(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t,Ze(e)}function On(){return!!Xe()}function In(e){return e.idb.fallbackInterval*2}var Nn={create:_n,close:wn,onMessage:Sn,postMessage:En,canBeUsed:On,type:dn,averageResponseTime:In,microSeconds:ln},kn=oe,Pn="pubkey.broadcastChannel-",$n="localstorage";function et(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function tt(e){return Pn+e}function Tn(e,t){return new Promise(function(r){ze().then(function(){var n=tt(e.channelName),o={token:me(),time:new Date().getTime(),data:t,uuid:e.uuid},s=JSON.stringify(o);et().setItem(n,s);var a=document.createEvent("Event");a.initEvent("storage",!0,!0),a.key=n,a.newValue=s,window.dispatchEvent(a),r()})})}function Mn(e,t){var r=tt(e),n=function(s){s.key===r&&t(JSON.parse(s.newValue))};return window.addEventListener("storage",n),n}function Dn(e){window.removeEventListener("storage",e)}function Rn(e,t){if(t=ye(t),!nt())throw new Error("BroadcastChannel: localstorage cannot be used");var r=me(),n=new Ye(t.localstorage.removeTimeout),o={channelName:e,uuid:r,eMIs:n};return o.listener=Mn(e,function(s){o.messagesCallback&&s.uuid!==r&&(!s.token||n.has(s.token)||s.data.time&&s.data.time<o.messagesCallbackTime||(n.add(s.token),o.messagesCallback(s.data)))}),o}function Cn(e){Dn(e.listener)}function Ln(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t}function nt(){var e=et();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function jn(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var An={create:Rn,close:Cn,onMessage:Ln,postMessage:Tn,canBeUsed:nt,type:$n,averageResponseTime:jn,microSeconds:kn},Vn=oe,Bn="simulate",_e=new Set;function xn(e){var t={name:e,messagesCallback:null};return _e.add(t),t}function Un(e){_e.delete(e)}function Fn(e,t){return new Promise(function(r){return setTimeout(function(){var n=Array.from(_e);n.filter(function(o){return o.name===e.name}).filter(function(o){return o!==e}).filter(function(o){return!!o.messagesCallback}).forEach(function(o){return o.messagesCallback(t)}),r()},5)})}function Hn(e,t){e.messagesCallback=t}function Jn(){return!0}function Gn(){return 5}var Wn={create:xn,close:Un,onMessage:Hn,postMessage:Fn,canBeUsed:Jn,type:Bn,averageResponseTime:Gn,microSeconds:Vn},rt=[cn,Nn,An];function zn(e){var t=[].concat(e.methods,rt).filter(Boolean);if(e.type){if(e.type==="simulate")return Wn;var r=t.find(function(o){return o.type===e.type});if(r)return r;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(o){return o.type!=="idb"}));var n=t.find(function(o){return o.canBeUsed()});if(n)return n;throw new Error("No usable method found in "+JSON.stringify(rt.map(function(o){return o.type})))}var ot=new Set,Qn=0,be=function(t,r){this.id=Qn++,ot.add(this),this.name=t,st&&(r=st),this.options=ye(r),this.method=zn(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Yn(this)};be._pubkey=!0;var st;be.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return it(this,"message",t)},postInternal:function(t){return it(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),r={time:t,fn:e};ut(this,"message",this._onML),e&&typeof e=="function"?(this._onML=r,ct(this,"message",r)):this._onML=null},addEventListener:function(t,r){var n=this.method.microSeconds(),o={time:n,fn:r};ct(this,t,o)},removeEventListener:function(t,r){var n=this._addEL[t].find(function(o){return o.fn===r});ut(this,t,n)},close:function(){var t=this;if(!this.closed){ot.delete(this),this.closed=!0;var r=this._prepP?this._prepP:B;return this._onML=null,this._addEL.message=[],r.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 it(e,t,r){var n=e.method.microSeconds(),o={time:n,type:t,data:r},s=e._prepP?e._prepP:B;return s.then(function(){var a=e.method.postMessage(e._state,o);return e._uMP.add(a),a.catch().then(function(){return e._uMP.delete(a)}),a})}function Yn(e){var t=e.method.create(e.name,e.options);Xt(t)?(e._prepP=t,t.then(function(r){e._state=r})):e._state=t}function at(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function ct(e,t,r){e._addEL[t].push(r),qn(e)}function ut(e,t,r){e._addEL[t]=e._addEL[t].filter(function(n){return n!==r}),Xn(e)}function qn(e){if(!e._iL&&at(e)){var t=function(o){e._addEL[o.type].forEach(function(s){var a=1e5,i=s.time-a;o.time>=i&&s.fn(o.data)})},r=e.method.microSeconds();e._prepP?e._prepP.then(function(){e._iL=!0,e.method.onMessage(e._state,t,r)}):(e._iL=!0,e.method.onMessage(e._state,t,r))}}function Xn(e){if(e._iL&&!at(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class we extends Error{constructor(t,r){super(t),this.name="DevalueError",this.path=r.join("")}}function lt(e){return Object(e)!==e}const Kn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zn(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Kn}function er(e){return Object.prototype.toString.call(e).slice(8,-1)}function tr(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
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 e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function H(e){let t="",r=0;const n=e.length;for(let o=0;o<n;o+=1){const s=e[o],a=tr(s);a&&(t+=e.slice(r,o)+a,r=o+1)}return`"${r===0?e:t+e.slice(r)}"`}const Ee=-1,ft=-2,dt=-3,pt=-4,ht=-5,Se=-6;function mt(e,t){return nr(JSON.parse(e))}function nr(e,t){if(typeof e=="number")return o(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const r=e,n=Array(r.length);function o(s,a=!1){if(s===Ee)return;if(s===dt)return NaN;if(s===pt)return 1/0;if(s===ht)return-1/0;if(s===Se)return-0;if(a)throw new Error("Invalid input");if(s in n)return n[s];const i=r[s];if(!i||typeof i!="object")n[s]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0];switch(u){case"Date":n[s]=new Date(i[1]);break;case"Set":const c=new Set;n[s]=c;for(let g=1;g<i.length;g+=1)c.add(o(i[g]));break;case"Map":const h=new Map;n[s]=h;for(let g=1;g<i.length;g+=2)h.set(o(i[g]),o(i[g+1]));break;case"RegExp":n[s]=new RegExp(i[1],i[2]);break;case"Object":n[s]=Object(i[1]);break;case"BigInt":n[s]=BigInt(i[1]);break;case"null":const p=Object.create(null);n[s]=p;for(let g=1;g<i.length;g+=2)p[i[g]]=o(i[g+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(i.length);n[s]=u;for(let c=0;c<i.length;c+=1){const h=i[c];h!==ft&&(u[c]=o(h))}}else{const u={};n[s]=u;for(const c in i){const h=i[c];u[c]=o(h)}}return n[s]}return o(0)}function gt(e,t){const r=[],n=new Map,o=[];for(const c in t)o.push({key:c,fn:t[c]});const s=[];let a=0;function i(c){if(typeof c=="function")throw new we("Cannot stringify a function",s);if(n.has(c))return n.get(c);if(c===void 0)return Ee;if(Number.isNaN(c))return dt;if(c===1/0)return pt;if(c===-1/0)return ht;if(c===0&&1/c<0)return Se;const h=a++;n.set(c,h);for(const{key:g,fn:S}of o){const I=S(c);if(I)return r[h]=`["${g}",${i(I)}]`,h}let p="";if(lt(c))p=Oe(c);else switch(er(c)){case"Number":case"String":case"Boolean":p=`["Object",${Oe(c)}]`;break;case"BigInt":p=`["BigInt",${c}]`;break;case"Date":p=`["Date","${!isNaN(c.getDate())?c.toISOString():""}"]`;break;case"RegExp":const{source:I,flags:W}=c;p=W?`["RegExp",${H(I)},"${W}"]`:`["RegExp",${H(I)}]`;break;case"Array":p="[";for(let v=0;v<c.length;v+=1)v>0&&(p+=","),v in c?(s.push(`[${v}]`),p+=i(c[v]),s.pop()):p+=ft;p+="]";break;case"Set":p='["Set"';for(const v of c)p+=`,${i(v)}`;p+="]";break;case"Map":p='["Map"';for(const[v,L]of c)s.push(`.get(${lt(v)?Oe(v):"..."})`),p+=`,${i(v)},${i(L)}`,s.pop();p+="]";break;default:if(!Zn(c))throw new we("Cannot stringify arbitrary non-POJOs",s);if(Object.getOwnPropertySymbols(c).length>0)throw new we("Cannot stringify POJOs with symbolic keys",s);if(Object.getPrototypeOf(c)===null){p='["null"';for(const v in c)s.push(`.${v}`),p+=`,${H(v)},${i(c[v])}`,s.pop();p+="]"}else{p="{";let v=!1;for(const L in c)v&&(p+=","),v=!0,s.push(`.${L}`),p+=`${H(L)}:${i(c[L])}`,s.pop();p+="}"}}return r[h]=p,h}const u=i(e);return u<0?`${u}`:`[${r.join(",")}]`}function Oe(e){const t=typeof e;return t==="string"?H(e):e instanceof String?H(e.toString()):e===void 0?Ee.toString():e===0&&1/e<0?Se.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function rr(e,t,{initialize:r,type:n}){let o=`${t.$id}-${e.toString()}`,s=new be(o,{type:n}),a=!1,i=0;l.watch(()=>t[e],h=>{a||(i=Date.now(),s.postMessage({timestamp:i,state:mt(gt(h))})),a=!1},{deep:!0}),s.onmessage=h=>{if(h===void 0){s.postMessage({timestamp:i,state:mt(gt(t[e]))});return}h.timestamp<=i||(a=!0,i=h.timestamp,t[e]=h.state)};let u=()=>s.postMessage(void 0),c=()=>s.close();return r&&u(),{sync:u,unshare:c}}var or=(e,t)=>Object.keys(t).includes(e),sr=({initialize:e=!0,enable:t=!0,type:r})=>({store:n,options:o})=>{var i,u;let s=((i=o==null?void 0:o.share)==null?void 0:i.enable)??t,a=((u=o==null?void 0:o.share)==null?void 0:u.omit)??[];!s||Object.keys(n.$state).forEach(c=>{var h;a.includes(c)||!or(c,n.$state)||rr(c,n,{initialize:((h=o==null?void 0:o.share)==null?void 0:h.initialize)??e,type:r})})};const yt=Ht();yt.use(sr({enable:!0,initialize:!0}));const ir={install:(e,t)=>{const r=e.config.globalProperties.$router,n=r||(t==null?void 0:t.router),o=new re(n,t==null?void 0:t.getMeta);if(!r&&n&&e.use(n),e.use(yt),e.provide("$registry",o),t!=null&&t.components)for(const[s,a]of Object.entries(t.components))e.component(s,a)}};w.DoctypeMeta=qt,w.Registry=re,w.Stonecrop=ir,w.useStonecrop=Yt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
13
13
|
//# sourceMappingURL=stonecrop.umd.cjs.map
|