@stonecrop/stonecrop 0.4.37 → 0.6.0
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/README.md +92 -3
- package/dist/src/composable.d.ts +74 -8
- package/dist/src/composable.d.ts.map +1 -1
- package/dist/src/composable.js +348 -0
- package/dist/src/composables/operation-log.d.ts +136 -0
- package/dist/src/composables/operation-log.d.ts.map +1 -0
- package/dist/src/composables/operation-log.js +221 -0
- package/dist/src/doctype.d.ts +9 -1
- package/dist/src/doctype.d.ts.map +1 -1
- package/dist/{doctype.js → src/doctype.js} +9 -3
- package/dist/src/field-triggers.d.ts +178 -0
- package/dist/src/field-triggers.d.ts.map +1 -0
- package/dist/src/field-triggers.js +564 -0
- package/dist/src/index.d.ts +12 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +18 -0
- package/dist/src/plugins/index.d.ts +11 -13
- package/dist/src/plugins/index.d.ts.map +1 -1
- package/dist/src/plugins/index.js +90 -0
- package/dist/src/registry.d.ts +9 -3
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/{registry.js → src/registry.js} +14 -1
- package/dist/src/stonecrop.d.ts +350 -114
- package/dist/src/stonecrop.d.ts.map +1 -1
- package/dist/src/stonecrop.js +251 -0
- package/dist/src/stores/hst.d.ts +157 -0
- package/dist/src/stores/hst.d.ts.map +1 -0
- package/dist/src/stores/hst.js +483 -0
- package/dist/src/stores/index.d.ts +5 -1
- package/dist/src/stores/index.d.ts.map +1 -1
- package/dist/{stores → src/stores}/index.js +4 -1
- package/dist/src/stores/operation-log.d.ts +268 -0
- package/dist/src/stores/operation-log.d.ts.map +1 -0
- package/dist/src/stores/operation-log.js +571 -0
- package/dist/src/types/field-triggers.d.ts +186 -0
- package/dist/src/types/field-triggers.d.ts.map +1 -0
- package/dist/src/types/field-triggers.js +4 -0
- package/dist/src/types/index.d.ts +13 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +4 -0
- package/dist/src/types/operation-log.d.ts +165 -0
- package/dist/src/types/operation-log.d.ts.map +1 -0
- package/dist/src/types/registry.d.ts +11 -0
- package/dist/src/types/registry.d.ts.map +1 -0
- package/dist/src/types/registry.js +0 -0
- package/dist/stonecrop.d.ts +1555 -159
- package/dist/stonecrop.js +1974 -7028
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.umd.cjs +4 -8
- package/dist/stonecrop.umd.cjs.map +1 -1
- package/dist/tests/setup.d.ts +5 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +15 -0
- package/package.json +6 -5
- package/src/composable.ts +481 -31
- package/src/composables/operation-log.ts +254 -0
- package/src/doctype.ts +9 -3
- package/src/field-triggers.ts +671 -0
- package/src/index.ts +50 -4
- package/src/plugins/index.ts +70 -22
- package/src/registry.ts +18 -3
- package/src/stonecrop.ts +246 -155
- package/src/stores/hst.ts +703 -0
- package/src/stores/index.ts +6 -1
- package/src/stores/operation-log.ts +671 -0
- package/src/types/field-triggers.ts +201 -0
- package/src/types/index.ts +17 -6
- package/src/types/operation-log.ts +205 -0
- package/src/types/registry.ts +10 -0
- package/dist/composable.js +0 -50
- package/dist/index.js +0 -6
- package/dist/plugins/index.js +0 -49
- package/dist/src/stores/data.d.ts +0 -11
- package/dist/src/stores/data.d.ts.map +0 -1
- package/dist/stores/data.js +0 -7
- package/src/stores/data.ts +0 -8
- /package/dist/{exceptions.js → src/exceptions.js} +0 -0
- /package/dist/{types/index.js → src/types/operation-log.js} +0 -0
package/dist/stonecrop.umd.cjs
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
(function(j,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(j=typeof globalThis<"u"?globalThis:j||self,b(j["@stonecrop/stonecrop"]={},j.Vue))})(this,(function(j,b){"use strict";function us(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function as(){const e=us();if(e.__xstate__)return e.__xstate__}const cs=e=>{if(typeof window>"u")return;const t=as();t&&t.register(e)};class fn{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const dn=".",ls="",hn="",fs="#",ds="*",pn="xstate.init",ft="xstate.stop";function hs(e,t){return{type:`xstate.after.${e}.${t}`}}function dt(e,t){return{type:`xstate.done.state.${e}`,output:t}}function ps(e,t){return{type:`xstate.done.actor.${e}`,output:t,actorId:e}}function _s(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function _n(e){return{type:pn,input:e}}function q(e){setTimeout(()=>{throw e})}const gs=typeof Symbol=="function"&&Symbol.observable||"@@observable";function gn(e,t){const n=mn(e),r=mn(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(o=>o in r?gn(n[o],r[o]):!1)}function ht(e){if(vn(e))return e;const t=[];let n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function mn(e){if(Js(e))return e.value;if(typeof e!="string")return e;const t=ht(e);return ms(t)}function ms(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const o=n;n={},o[e[r]]=n}return t}function En(e,t){const n={},r=Object.keys(e);for(let o=0;o<r.length;o++){const s=r[o];n[s]=t(e[s],s,e,o)}return n}function yn(e){return vn(e)?e:[e]}function Z(e){return e===void 0?[]:yn(e)}function pt(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function vn(e){return Array.isArray(e)}function Es(e){return e.type.startsWith("xstate.error.actor")}function he(e){return yn(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function Sn(e){if(!(e===void 0||e===ls))return Z(e)}function _t(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}function bn(e,t){return`${t}.${e}`}function gt(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,o]=n,i=e.getStateNodeById(o).config.invoke;return(Array.isArray(i)?i[r]:i).src}function An(e,t){return`${e.sessionId}.${t}`}let ys=0;function vs(e,t){const n=new Map,r=new Map,o=new WeakMap,s=new Set,i={},{clock:u,logger:a}=t,c={schedule:(f,d,h,m,g=Math.random().toString(36).slice(2))=>{const E={source:f,target:d,event:h,delay:m,id:g,startedAt:Date.now()},O=An(f,g);l._snapshot._scheduledEvents[O]=E;const T=u.setTimeout(()=>{delete i[O],delete l._snapshot._scheduledEvents[O],l._relay(f,d,h)},m);i[O]=T},cancel:(f,d)=>{const h=An(f,d),m=i[h];delete i[h],delete l._snapshot._scheduledEvents[h],m!==void 0&&u.clearTimeout(m)},cancelAll:f=>{for(const d in l._snapshot._scheduledEvents){const h=l._snapshot._scheduledEvents[d];h.source===f&&c.cancel(f,h.id)}}},p=f=>{if(!s.size)return;const d={...f,rootId:e.sessionId};s.forEach(h=>h.next?.(d))},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${ys++}`,_register:(f,d)=>(n.set(f,d),f),_unregister:f=>{n.delete(f.sessionId);const d=o.get(f);d!==void 0&&(r.delete(d),o.delete(f))},get:f=>r.get(f),_set:(f,d)=>{const h=r.get(f);if(h&&h!==d)throw new Error(`Actor with system ID '${f}' already exists.`);r.set(f,d),o.set(d,f)},inspect:f=>{const d=_t(f);return s.add(d),{unsubscribe(){s.delete(d)}}},_sendInspectionEvent:p,_relay:(f,d,h)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:f,actorRef:d,event:h}),d._send(h)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{const f=l._snapshot._scheduledEvents;l._snapshot._scheduledEvents={};for(const d in f){const{source:h,target:m,event:g,delay:E,id:O}=f[d];c.schedule(h,m,g,E,O)}},_clock:u,_logger:a};return l}let mt=!1;const Et=1;let V=(function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e})({});const Ss={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class bs{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new fn(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=V.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...Ss,...n},{clock:o,logger:s,parent:i,syncSnapshot:u,id:a,systemId:c,inspect:p}=r;this.system=i?i.system:vs(this,{clock:o,logger:s}),p&&!i&&this.system.inspect(_t(p)),this.sessionId=this.system._bookId(),this.id=a??this.sessionId,this.logger=n?.logger??this.system._logger,this.clock=n?.clock??this.system._clock,this._parent=i,this._syncSnapshot=u,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:l=>{this._deferred.push(l)},system:this.system,stopChild:l=>{if(l._parent!==this)throw new Error(`Cannot stop child actor ${l.id} of ${this.id} because it is not a child`);l._stop()},emit:l=>{const f=this.eventListeners.get(l.type),d=this.eventListeners.get("*");if(!f&&!d)return;const h=[...f?f.values():[],...d?d.values():[]];for(const m of h)m(l)},actionExecutor:l=>{const f=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:l.type,params:l.params}}),!l.exec)return;const d=mt;try{mt=!0,l.exec(l.info,l.params)}finally{mt=d}};this._processingStatus===V.Running?f():this._deferred.push(f)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this._systemId=c,this.system._set(c,this)),this._initState(n?.snapshot??n?.state),c&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(n){this._snapshot={status:"error",output:void 0,error:n}}}update(t,n){this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(o){this._deferred.length=0,this._snapshot={...t,status:"error",error:o}}switch(this._snapshot.status){case"active":for(const o of this.observers)try{o.next?.(t)}catch(s){q(s)}break;case"done":for(const o of this.observers)try{o.next?.(t)}catch(s){q(s)}this._stopProcedure(),this._complete(),this._doneEvent=ps(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){const o=_t(t,n,r);if(this._processingStatus!==V.Stopped)this.observers.add(o);else switch(this._snapshot.status){case"done":try{o.complete?.()}catch(s){q(s)}break;case"error":{const s=this._snapshot.error;if(!o.error)q(s);else try{o.error(s)}catch(i){q(i)}break}}return{unsubscribe:()=>{this.observers.delete(o)}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));const o=n.bind(void 0);return r.add(o),{unsubscribe:()=>{r.delete(o)}}}start(){if(this._processingStatus===V.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=V.Running;const t=_n(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(o){r={err:o}}if(r){const{err:o}=r;this._snapshot={...this._snapshot,status:"error",error:o},this._error(o);return}this.update(n,t),t.type===ft&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===V.Stopped?this:(this.mailbox.clear(),this._processingStatus===V.NotStarted?(this._processingStatus=V.Stopped,this):(this.mailbox.enqueue({type:ft}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(const t of this.observers)try{t.complete?.()}catch(n){q(n)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||q(t);return}let n=!1;for(const r of this.observers){const o=r.error;n||=!o;try{o?.(t)}catch(s){q(s)}}this.observers.clear(),n&&q(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,_s(this.id,t))}_stopProcedure(){return this._processingStatus!==V.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new fn(this._process.bind(this)),this._processingStatus=V.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==V.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:cs)(this)}toJSON(){return{xstate$$type:Et,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[gs](){return this}getSnapshot(){return this._snapshot}}function xe(e,...[t]){return new bs(e,t)}function As(e,t,n,r,{sendId:o}){const s=typeof o=="function"?o(n,r):o;return[t,{sendId:s},void 0]}function ws(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function Os(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=As,t.execute=ws,t}function Ts(e,t,n,r,{id:o,systemId:s,src:i,input:u,syncSnapshot:a}){const c=typeof i=="string"?gt(t.machine,i):i,p=typeof o=="function"?o(n):o;let l,f;return c&&(f=typeof u=="function"?u({context:t.context,event:n.event,self:e.self}):u,l=xe(c,{id:p,src:i,parent:e.self,syncSnapshot:a,systemId:s,input:f})),[ue(t,{children:{...t.children,[p]:l}}),{id:o,systemId:s,actorRef:l,src:i,input:f},void 0]}function Is(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==V.Stopped&&t.start()})}function ks(...[e,{id:t,systemId:n,input:r,syncSnapshot:o=!1}={}]){function s(i,u){}return s.type="xstate.spawnChild",s.id=t,s.systemId=n,s.src=e,s.input=r,s.syncSnapshot=o,s.resolve=Ts,s.execute=Is,s}function Cs(e,t,n,r,{actorRef:o}){const s=typeof o=="function"?o(n,r):o,i=typeof s=="string"?t.children[s]:s;let u=t.children;return i&&(u={...u},delete u[i.id]),[ue(t,{children:u}),i,void 0]}function Ds(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==V.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function wn(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Cs,t.execute=Ds,t}function yt(e,t,n,r){const{machine:o}=r,s=typeof e=="function",i=s?e:o.implementations.guards[typeof e=="string"?e:e.type];if(!s&&!i)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof i!="function")return yt(i,t,n,r);const u={context:t,event:n},a=s||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in i?i.check(r,u,i):i(u,a)}const vt=e=>e.type==="atomic"||e.type==="final";function pe(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Re(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Ge(e){const t=new Set(e),n=Tn(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))Cn(r).forEach(o=>t.add(o));else if(r.type==="parallel"){for(const o of pe(r))if(o.type!=="history"&&!t.has(o)){const s=Cn(o);for(const i of s)t.add(i)}}for(const r of t){let o=r.parent;for(;o;)t.add(o),o=o.parent}return t}function On(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const o=n[0];if(o){if(vt(o))return o.key}else return{}}const r={};for(const o of n)r[o.key]=On(o,t);return r}function Tn(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function In(e,t){const n=Ge(t);return On(e,Tn(n))}function St(e,t){return t.type==="compound"?pe(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?pe(t).every(n=>St(e,n)):t.type==="final"}const We=e=>e[0]===fs;function xs(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>{if(r===ds)return!0;if(!r.endsWith(".*"))return!1;const o=r.split("."),s=t.split(".");for(let i=0;i<o.length;i++){const u=o[i],a=s[i];if(u==="*")return i===o.length-1;if(u!==a)return!1}return!0}).sort((r,o)=>o.length-r.length).flatMap(r=>e.transitions.get(r))}function Rs(e){const t=e.config.after;if(!t)return[];const n=o=>{const s=hs(o,e.id),i=s.type;return e.entry.push(ii(s,{id:i,delay:o})),e.exit.push(Os(i)),i};return Object.keys(t).flatMap(o=>{const s=t[o],i=typeof s=="string"?{target:s}:s,u=Number.isNaN(+o)?o:+o,a=n(u);return Z(i).map(c=>({...c,event:a,delay:u}))}).map(o=>{const{delay:s}=o;return{...se(e,o.event,o),delay:s}})}function se(e,t,n){const r=Sn(n.target),o=n.reenter??!1,s=Vs(e,r),i={...n,actions:Z(n.actions),guard:n.guard,target:s,source:e,reenter:o,eventType:t,toJSON:()=>({...i,source:`#${e.id}`,target:s?s.map(u=>`#${u.id}`):void 0})};return i}function Ps(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===hn)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,he(r).map(o=>se(e,n,o)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,he(e.config.onDone).map(r=>se(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,he(n.onDone).map(o=>se(e,r,o)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,he(n.onError).map(o=>se(e,r,o)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,he(n.onSnapshot).map(o=>se(e,r,o)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function Ns(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:Z(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function Vs(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(We(n))return e.machine.getStateNodeById(n);const r=n[0]===dn;if(r&&!e.parent)return Ye(e,n.slice(1));const o=r?e.key+n:n;if(e.parent)try{return Ye(e.parent,o)}catch(s){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
2
|
-
${s.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function kn(e){const t=Sn(e.config.target);return t?{target:t.map(n=>typeof n=="string"?Ye(e.parent,n):n)}:e.parent.initial}function ie(e){return e.type==="history"}function Cn(e){const t=Dn(e);for(const n of t)for(const r of Re(n,e))t.add(r);return t}function Dn(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const o of pe(r))n(o)}}return n(e),t}function _e(e,t){if(We(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function Ye(e,t){if(typeof t=="string"&&We(t))try{return e.machine.getStateNodeById(t)}catch{}const n=ht(t).slice();let r=e;for(;n.length;){const o=n.shift();if(!o.length)break;r=_e(r,o)}return r}function qe(e,t){if(typeof t=="string"){const o=e.states[t];if(!o)throw new Error(`State '${t}' does not exist on '${e.id}'`);return[e,o]}const n=Object.keys(t),r=n.map(o=>_e(e,o)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((o,s)=>{const i=_e(e,s);if(!i)return o;const u=qe(i,t[s]);return o.concat(u)},[]))}function Ls(e,t,n,r){const s=_e(e,t).next(n,r);return!s||!s.length?e.next(n,r):s}function Ms(e,t,n,r){const o=Object.keys(t),s=_e(e,o[0]),i=bt(s,t[o[0]],n,r);return!i||!i.length?e.next(n,r):i}function Bs(e,t,n,r){const o=[];for(const s of Object.keys(t)){const i=t[s];if(!i)continue;const u=_e(e,s),a=bt(u,i,n,r);a&&o.push(...a)}return o.length?o:e.next(n,r)}function bt(e,t,n,r){return typeof t=="string"?Ls(e,t,n,r):Object.keys(t).length===1?Ms(e,t,n,r):Bs(e,t,n,r)}function $s(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Q(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function Us(e,t){const n=new Set(e),r=new Set(t);for(const o of n)if(r.has(o))return!0;for(const o of r)if(n.has(o))return!0;return!1}function xn(e,t,n){const r=new Set;for(const o of e){let s=!1;const i=new Set;for(const u of r)if(Us(wt([o],t,n),wt([u],t,n)))if(Q(o.source,u.source))i.add(u);else{s=!0;break}if(!s){for(const u of i)r.delete(u);r.add(o)}}return Array.from(r)}function Fs(e){const[t,...n]=e;for(const r of Re(t,void 0))if(n.every(o=>Q(o,r)))return r}function At(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(ie(r))if(t[r.id])for(const o of t[r.id])n.add(o);else for(const o of At(kn(r),t))n.add(o);else n.add(r);return[...n]}function Rn(e,t){const n=At(e,t);if(!n)return;if(!e.reenter&&n.every(o=>o===e.source||Q(o,e.source)))return e.source;const r=Fs(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function wt(e,t,n){const r=new Set;for(const o of e)if(o.target?.length){const s=Rn(o,n);o.reenter&&o.source===s&&r.add(s);for(const i of t)Q(i,s)&&r.add(i)}return[...r]}function js(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ot(e,t,n,r,o,s){if(!e.length)return t;const i=new Set(t._nodes);let u=t.historyValue;const a=xn(e,i,u);let c=t;o||([c,u]=Gs(c,r,n,a,i,u,s,n.actionExecutor)),c=me(c,r,n,a.flatMap(l=>l.actions),s,void 0),c=zs(c,r,n,a,i,s,u,o);const p=[...i];c.status==="done"&&(c=me(c,r,n,p.sort((l,f)=>f.order-l.order).flatMap(l=>l.exit),s,void 0));try{return u===t.historyValue&&js(t._nodes,i)?c:ue(c,{_nodes:p,historyValue:u})}catch(l){throw l}}function Hs(e,t,n,r,o){if(r.output===void 0)return;const s=dt(o.id,o.output!==void 0&&o.parent?pt(o.output,e.context,t,n.self):void 0);return pt(r.output,e.context,s,n.self)}function zs(e,t,n,r,o,s,i,u){let a=e;const c=new Set,p=new Set;Ks(r,i,p,c),u&&p.add(e.machine.root);const l=new Set;for(const f of[...c].sort((d,h)=>d.order-h.order)){o.add(f);const d=[];d.push(...f.entry);for(const h of f.invoke)d.push(ks(h.src,{...h,syncSnapshot:!!h.onSnapshot}));if(p.has(f)){const h=f.initial.actions;d.push(...h)}if(a=me(a,t,n,d,s,f.invoke.map(h=>h.id)),f.type==="final"){const h=f.parent;let m=h?.type==="parallel"?h:h?.parent,g=m||f;for(h?.type==="compound"&&s.push(dt(h.id,f.output!==void 0?pt(f.output,a.context,t,n.self):void 0));m?.type==="parallel"&&!l.has(m)&&St(o,m);)l.add(m),s.push(dt(m.id)),g=m,m=m.parent;if(m)continue;a=ue(a,{status:"done",output:Hs(a,t,n,a.machine.root,g)})}}return a}function Ks(e,t,n,r){for(const o of e){const s=Rn(o,t);for(const u of o.target||[])!ie(u)&&(o.source!==u||o.source!==s||o.reenter)&&(r.add(u),n.add(u)),ge(u,t,n,r);const i=At(o,t);for(const u of i){const a=Re(u,s);s?.type==="parallel"&&a.push(s),Pn(r,t,n,a,!o.source.parent&&o.reenter?void 0:s)}}}function ge(e,t,n,r){if(ie(e))if(t[e.id]){const o=t[e.id];for(const s of o)r.add(s),ge(s,t,n,r);for(const s of o)Tt(s,e.parent,r,t,n)}else{const o=kn(e);for(const s of o.target)r.add(s),o===e.parent?.initial&&n.add(e.parent),ge(s,t,n,r);for(const s of o.target)Tt(s,e.parent,r,t,n)}else if(e.type==="compound"){const[o]=e.initial.target;ie(o)||(r.add(o),n.add(o)),ge(o,t,n,r),Tt(o,e,r,t,n)}else if(e.type==="parallel")for(const o of pe(e).filter(s=>!ie(s)))[...r].some(s=>Q(s,o))||(ie(o)||(r.add(o),n.add(o)),ge(o,t,n,r))}function Pn(e,t,n,r,o){for(const s of r)if((!o||Q(s,o))&&e.add(s),s.type==="parallel")for(const i of pe(s).filter(u=>!ie(u)))[...e].some(u=>Q(u,i))||(e.add(i),ge(i,t,n,e))}function Tt(e,t,n,r,o){Pn(n,r,o,Re(e,t))}function Gs(e,t,n,r,o,s,i,u){let a=e;const c=wt(r,o,s);c.sort((l,f)=>f.order-l.order);let p;for(const l of c)for(const f of $s(l)){let d;f.history==="deep"?d=h=>vt(h)&&Q(h,l):d=h=>h.parent===l,p??={...s},p[f.id]=Array.from(o).filter(d)}for(const l of c)a=me(a,t,n,[...l.exit,...l.invoke.map(f=>wn(f.id))],i,void 0),o.delete(l);return[a,p||s]}function Ws(e,t){return e.implementations.actions[t]}function Nn(e,t,n,r,o,s){const{machine:i}=e;let u=e;for(const a of r){const c=typeof a=="function",p=c?a:Ws(i,typeof a=="string"?a:a.type),l={context:u.context,event:t,self:n.self,system:n.system},f=c||typeof a=="string"?void 0:"params"in a?typeof a.params=="function"?a.params({context:u.context,event:t}):a.params:void 0;if(!p||!("resolve"in p)){n.actionExecutor({type:typeof a=="string"?a:typeof a=="object"?a.type:a.name||"(anonymous)",info:l,params:f,exec:p});continue}const d=p,[h,m,g]=d.resolve(n,u,l,f,p,o);u=h,"retryResolve"in d&&s?.push([d,m]),"execute"in d&&n.actionExecutor({type:d.type,info:l,params:m,exec:d.execute.bind(null,n,m)}),g&&(u=Nn(u,t,n,g,o,s))}return u}function me(e,t,n,r,o,s){const i=s?[]:void 0,u=Nn(e,t,n,r,{internalQueue:o,deferredActorIds:s},i);return i?.forEach(([a,c])=>{a.retryResolve(n,u,c)}),u}function It(e,t,n,r){let o=e;const s=[];function i(c,p,l){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:p,snapshot:c,_transitions:l}),s.push(c)}if(t.type===ft)return o=ue(Vn(o,t,n),{status:"stopped"}),i(o,t,[]),{snapshot:o,microstates:s};let u=t;if(u.type!==pn){const c=u,p=Es(c),l=Ln(c,o);if(p&&!l.length)return o=ue(e,{status:"error",error:c.error}),i(o,c,[]),{snapshot:o,microstates:s};o=Ot(l,e,n,u,!1,r),i(o,c,l)}let a=!0;for(;o.status==="active";){let c=a?Ys(o,u):[];const p=c.length?o:void 0;if(!c.length){if(!r.length)break;u=r.shift(),c=Ln(u,o)}o=Ot(c,o,n,u,!1,r),a=o!==p,i(o,u,c)}return o.status!=="active"&&Vn(o,u,n),{snapshot:o,microstates:s}}function Vn(e,t,n){return me(e,t,n,Object.values(e.children).map(r=>wn(r)),[],void 0)}function Ln(e,t){return t.machine.getTransitionData(t,e)}function Ys(e,t){const n=new Set,r=e._nodes.filter(vt);for(const o of r)e:for(const s of[o].concat(Re(o,void 0)))if(s.always){for(const i of s.always)if(i.guard===void 0||yt(i.guard,e.context,t,e)){n.add(i);break e}}return xn(Array.from(n),new Set(e._nodes),e.historyValue)}function qs(e,t){const n=Ge(qe(e,t));return In(e,[...n])}function Js(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const Xs=function(t){return gn(t,this.value)},Zs=function(t){return this.tags.has(t)},Qs=function(t){const n=this.machine.getTransitionData(this,t);return!!n?.length&&n.some(r=>r.target!==void 0||r.actions.length)},ei=function(){const{_nodes:t,tags:n,machine:r,getMeta:o,toJSON:s,can:i,hasTag:u,matches:a,...c}=this;return{...c,tags:Array.from(n)}},ti=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Je(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:In(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:Xs,hasTag:Zs,can:Qs,getMeta:ti,toJSON:ei}}function ue(e,t={}){return Je({...e,...t},e.machine)}function ni(e){if(typeof e!="object"||e===null)return{};const t={};for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=r.map(o=>({id:o.id})))}return t}function ri(e,t){const{_nodes:n,tags:r,machine:o,children:s,context:i,can:u,hasTag:a,matches:c,getMeta:p,toJSON:l,...f}=e,d={};for(const m in s){const g=s[m];d[m]={snapshot:g.getPersistedSnapshot(t),src:g.src,systemId:g._systemId,syncSnapshot:g._syncSnapshot}}return{...f,context:Mn(i),children:d,historyValue:ni(f.historyValue)}}function Mn(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??=Array.isArray(e)?e.slice():{...e},t[n]={xstate$$type:Et,id:r.id};else{const o=Mn(r);o!==r&&(t??=Array.isArray(e)?e.slice():{...e},t[n]=o)}}return t??e}function oi(e,t,n,r,{event:o,id:s,delay:i},{internalQueue:u}){const a=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${o}" }) instead`);const c=typeof o=="function"?o(n,r):o;let p;if(typeof i=="string"){const l=a&&a[i];p=typeof l=="function"?l(n,r):l}else p=typeof i=="function"?i(n,r):i;return typeof p!="number"&&u.push(c),[t,{event:c,id:s,delay:p},void 0]}function si(e,t){const{event:n,delay:r,id:o}=t;if(typeof r=="number"){e.defer(()=>{const s=e.self;e.system.scheduler.schedule(s,s,n,r,o)});return}}function ii(e,t){function n(r,o){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=oi,n.execute=si,n}function ui(e,{machine:t,context:n},r,o){const s=(i,u)=>{if(typeof i=="string"){const a=gt(t,i);if(!a)throw new Error(`Actor logic '${i}' not implemented in machine '${t.id}'`);const c=xe(a,{id:u?.id,parent:e.self,syncSnapshot:u?.syncSnapshot,input:typeof u?.input=="function"?u.input({context:n,event:r,self:e.self}):u?.input,src:i,systemId:u?.systemId});return o[c.id]=c,c}else return xe(i,{id:u?.id,parent:e.self,syncSnapshot:u?.syncSnapshot,input:u?.input,src:i,systemId:u?.systemId})};return(i,u)=>{const a=s(i,u);return o[a.id]=a,e.defer(()=>{a._processingStatus!==V.Stopped&&a.start()}),a}}function ai(e,t,n,r,{assignment:o}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const s={},i={context:t.context,event:n.event,spawn:ui(e,t,n.event,s),self:e.self,system:e.system};let u={};if(typeof o=="function")u=o(i,r);else for(const c of Object.keys(o)){const p=o[c];u[c]=typeof p=="function"?p(i,r):p}const a=Object.assign({},t.context,u);return[ue(t,{context:a,children:Object.keys(s).length?{...t.children,...s}:t.children}),void 0,void 0]}function ci(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=ai,t}const Bn=new WeakMap;function Ee(e,t,n){let r=Bn.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Bn.set(e,r)),r[t]}const li={},Pe=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class Xe{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(dn),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?En(this.config.states,(r,o)=>new Xe(r,{_parent:this,_key:o,_machine:this.machine})):li,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=Z(this.config.entry).slice(),this.exit=Z(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=Z(t.tags).slice()}_initialize(){this.transitions=Ps(this),this.config.always&&(this.always=he(this.config.always).map(t=>se(this,hn,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Pe),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Pe),eventType:null})}:void 0,history:this.history,states:En(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(Pe)})),entry:this.entry.map(Pe),exit:this.exit.map(Pe),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Ee(this,"invoke",()=>Z(this.config.invoke).map((t,n)=>{const{src:r,systemId:o}=t,s=t.id??bn(this.id,n),i=typeof r=="string"?r:`xstate.invoke.${bn(this.id,n)}`;return{...t,src:i,id:s,systemId:o,toJSON(){const{onDone:u,onError:a,...c}=t;return{...c,type:"xstate.invoke",src:i,id:s}}}}))}get on(){return Ee(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(o=>[n,o])).reduce((n,[r,o])=>(n[r]=n[r]||[],n[r].push(o),n),{}))}get after(){return Ee(this,"delayedTransitions",()=>Rs(this))}get initial(){return Ee(this,"initial",()=>Ns(this,this.config.initial))}next(t,n){const r=n.type,o=[];let s;const i=Ee(this,`candidates-${r}`,()=>xs(this,r));for(const u of i){const{guard:a}=u,c=t.context;let p=!1;try{p=!a||yt(a,c,n,t)}catch(l){const f=typeof a=="string"?a:typeof a=="object"?a.type:void 0;throw new Error(`Unable to evaluate guard ${f?`'${f}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
3
|
-
${l.message}`)}if(p){o.push(...u.actions),s=u;break}}return s?[s]:void 0}get events(){return Ee(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const o=t[r];if(o.states)for(const s of o.events)n.add(`${s}`)}return Array.from(n)})}get ownEvents(){const t=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(t)}}const fi="#";class kt{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:n?.actors??{},actions:n?.actions??{},delays:n?.delays??{},guards:n?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new Xe(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:o,delays:s}=this.implementations;return new kt(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...o,...t.actors},delays:{...s,...t.delays}})}resolveState(t){const n=qs(this.root,t.value),r=Ge(qe(this.root,n));return Je({_nodes:[...r],context:t.context||{},children:{},status:St(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return It(t,n,r,[]).snapshot}microstep(t,n,r){return It(t,n,r,[]).microstates}getTransitionData(t,n){return bt(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){const{context:o}=this.config,s=Je({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?me(s,n,t,[ci(({spawn:u,event:a,self:c})=>o({spawn:u,input:a.input,self:c}))],r,void 0):s}getInitialSnapshot(t,n){const r=_n(n),o=[],s=this.getPreInitialState(t,r,o),i=Ot([{target:[...Dn(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],s,t,r,!0,o),{snapshot:u}=It(i,r,t,o);return u}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=ht(t),r=n.slice(1),o=We(n[0])?n[0].slice(fi.length):n[0],s=this.idMap.get(o);if(!s)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return Ye(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return ri(t,n)}restoreSnapshot(t,n){const r={},o=t.children;Object.keys(o).forEach(l=>{const f=o[l],d=f.snapshot,h=f.src,m=typeof h=="string"?gt(this,h):h;if(!m)return;const g=xe(m,{id:l,parent:n.self,syncSnapshot:f.syncSnapshot,snapshot:d,src:h,systemId:f.systemId});r[l]=g});function s(l,f){if(f instanceof Xe)return f;try{return l.machine.getStateNodeById(f.id)}catch{}}function i(l,f){if(!f||typeof f!="object")return{};const d={};for(const h in f){const m=f[h];for(const g of m){const E=s(l,g);E&&(d[h]??=[],d[h].push(E))}}return d}const u=i(this.root,t.historyValue),a=Je({...t,children:r,_nodes:Array.from(Ge(qe(this.root,t.value))),historyValue:u},this),c=new Set;function p(l,f){if(!c.has(l)){c.add(l);for(const d in l){const h=l[d];if(h&&typeof h=="object"){if("xstate$$type"in h&&h.xstate$$type===Et){l[d]=f[h.id];continue}p(h,f)}}}}return p(a.context,r),a}}function di(e,t){return new kt(e,t)}class hi extends Error{constructor(t=""){super(t),this.name="NotImplemented"}}class ye{static _root;name="Stonecrop";registry;store;constructor(t,n){if(ye._root)return ye._root;ye._root=this,this.registry=t,this.store=n}setup(t){this.getMeta(t.doctype)}async getMeta(t){if(!this.registry.getMeta)throw new hi(`getMeta function is not implemented for ${t} in the registry`);return await this.registry.getMeta(t)}async getRecords(t,n){this.store.$patch({records:[]});const o=await(await fetch(`/${t.slug}`,n)).json();this.store.$patch({records:o})}async getRecord(t,n){this.store.$patch({record:{}});const o=await(await fetch(`/${t.slug}/${n}`)).json();this.store.$patch({record:o})}runAction(t,n,r){const o=this.registry.registry[t.slug],s=o.actions?.get(n),i=o.workflow;if(i){const u=di(i),a=xe(u);a.start(),a.send({type:n,id:r}),s&&s.length>0&&s.forEach(c=>{new Function(c)(r)})}}}var pi=Object.create,$n=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,Ct=Object.getOwnPropertyNames,gi=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty,Ei=(e,t)=>function(){return e&&(t=(0,e[Ct(e)[0]])(e=0)),t},yi=(e,t)=>function(){return t||(0,e[Ct(e)[0]])((t={exports:{}}).exports,t),t.exports},vi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ct(t))!mi.call(e,o)&&o!==n&&$n(e,o,{get:()=>t[o],enumerable:!(r=_i(t,o))||r.enumerable});return e},Si=(e,t,n)=>(n=e!=null?pi(gi(e)):{},vi($n(n,"default",{value:e,enumerable:!0}),e)),Ne=Ei({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),bi=yi({"../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(e,t){Ne(),t.exports=r;function n(s){return s instanceof Buffer?Buffer.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function r(s){if(s=s||{},s.circles)return o(s);const i=new Map;if(i.set(Date,l=>new Date(l)),i.set(Map,(l,f)=>new Map(a(Array.from(l),f))),i.set(Set,(l,f)=>new Set(a(Array.from(l),f))),s.constructorHandlers)for(const l of s.constructorHandlers)i.set(l[0],l[1]);let u=null;return s.proto?p:c;function a(l,f){const d=Object.keys(l),h=new Array(d.length);for(let m=0;m<d.length;m++){const g=d[m],E=l[g];typeof E!="object"||E===null?h[g]=E:E.constructor!==Object&&(u=i.get(E.constructor))?h[g]=u(E,f):ArrayBuffer.isView(E)?h[g]=n(E):h[g]=f(E)}return h}function c(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return a(l,c);if(l.constructor!==Object&&(u=i.get(l.constructor)))return u(l,c);const f={};for(const d in l){if(Object.hasOwnProperty.call(l,d)===!1)continue;const h=l[d];typeof h!="object"||h===null?f[d]=h:h.constructor!==Object&&(u=i.get(h.constructor))?f[d]=u(h,c):ArrayBuffer.isView(h)?f[d]=n(h):f[d]=c(h)}return f}function p(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return a(l,p);if(l.constructor!==Object&&(u=i.get(l.constructor)))return u(l,p);const f={};for(const d in l){const h=l[d];typeof h!="object"||h===null?f[d]=h:h.constructor!==Object&&(u=i.get(h.constructor))?f[d]=u(h,p):ArrayBuffer.isView(h)?f[d]=n(h):f[d]=p(h)}return f}}function o(s){const i=[],u=[],a=new Map;if(a.set(Date,d=>new Date(d)),a.set(Map,(d,h)=>new Map(p(Array.from(d),h))),a.set(Set,(d,h)=>new Set(p(Array.from(d),h))),s.constructorHandlers)for(const d of s.constructorHandlers)a.set(d[0],d[1]);let c=null;return s.proto?f:l;function p(d,h){const m=Object.keys(d),g=new Array(m.length);for(let E=0;E<m.length;E++){const O=m[E],T=d[O];if(typeof T!="object"||T===null)g[O]=T;else if(T.constructor!==Object&&(c=a.get(T.constructor)))g[O]=c(T,h);else if(ArrayBuffer.isView(T))g[O]=n(T);else{const L=i.indexOf(T);L!==-1?g[O]=u[L]:g[O]=h(T)}}return g}function l(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return p(d,l);if(d.constructor!==Object&&(c=a.get(d.constructor)))return c(d,l);const h={};i.push(d),u.push(h);for(const m in d){if(Object.hasOwnProperty.call(d,m)===!1)continue;const g=d[m];if(typeof g!="object"||g===null)h[m]=g;else if(g.constructor!==Object&&(c=a.get(g.constructor)))h[m]=c(g,l);else if(ArrayBuffer.isView(g))h[m]=n(g);else{const E=i.indexOf(g);E!==-1?h[m]=u[E]:h[m]=l(g)}}return i.pop(),u.pop(),h}function f(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return p(d,f);if(d.constructor!==Object&&(c=a.get(d.constructor)))return c(d,f);const h={};i.push(d),u.push(h);for(const m in d){const g=d[m];if(typeof g!="object"||g===null)h[m]=g;else if(g.constructor!==Object&&(c=a.get(g.constructor)))h[m]=c(g,f);else if(ArrayBuffer.isView(g))h[m]=n(g);else{const E=i.indexOf(g);E!==-1?h[m]=u[E]:h[m]=f(g)}}return i.pop(),u.pop(),h}}}});Ne(),Ne(),Ne();var Un=typeof navigator<"u",y=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof y.chrome<"u"&&y.chrome.devtools,Un&&(y.self,y.top);var Fn;typeof navigator<"u"&&((Fn=navigator.userAgent)==null||Fn.toLowerCase().includes("electron")),Ne();var Ai=Si(bi()),wi=/(?:^|[-_/])(\w)/g;function Oi(e,t){return t?t.toUpperCase():""}function Ti(e){return e&&`${e}`.replace(wi,Oi)}function Ii(e,t){let n=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/");n.endsWith(`index${t}`)&&(n=n.replace(`/index${t}`,t));const r=n.lastIndexOf("/"),o=n.substring(r+1);{const s=o.lastIndexOf(t);return o.substring(0,s)}}var jn=(0,Ai.default)({circles:!0});const ki={trailing:!0};function ve(e,t=25,n={}){if(n={...ki,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,o,s=[],i,u;const a=(c,p)=>(i=Ci(e,c,p),i.finally(()=>{if(i=null,n.trailing&&u&&!o){const l=a(c,u);return u=null,l}}),i);return function(...c){return i?(n.trailing&&(u=c),i):new Promise(p=>{const l=!o&&n.leading;clearTimeout(o),o=setTimeout(()=>{o=null;const f=n.leading?r:a(this,c);for(const d of s)d(f);s=[]},t),l?(r=a(this,c),p(r)):s.push(p)})}}async function Ci(e,t,n){return await e.apply(t,n)}function Dt(e,t={},n){for(const r in e){const o=e[r],s=n?`${n}:${r}`:r;typeof o=="object"&&o!==null?Dt(o,t,s):typeof o=="function"&&(t[s]=o)}return t}const Di={run:e=>e()},xi=()=>Di,Hn=typeof console.createTask<"u"?console.createTask:xi;function Ri(e,t){const n=t.shift(),r=Hn(n);return e.reduce((o,s)=>o.then(()=>r.run(()=>s(...t))),Promise.resolve())}function Pi(e,t){const n=t.shift(),r=Hn(n);return Promise.all(e.map(o=>r.run(()=>o(...t))))}function xt(e,t){for(const n of[...e])n(t)}class Ni{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,n,r={}){if(!t||typeof n!="function")return()=>{};const o=t;let s;for(;this._deprecatedHooks[t];)s=this._deprecatedHooks[t],t=s.to;if(s&&!r.allowDeprecated){let i=s.message;i||(i=`${o} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(n),()=>{n&&(this.removeHook(t,n),n=void 0)}}hookOnce(t,n){let r,o=(...s)=>(typeof r=="function"&&r(),r=void 0,o=void 0,n(...s));return r=this.hook(t,o),r}removeHook(t,n){if(this._hooks[t]){const r=this._hooks[t].indexOf(n);r!==-1&&this._hooks[t].splice(r,1),this._hooks[t].length===0&&delete this._hooks[t]}}deprecateHook(t,n){this._deprecatedHooks[t]=typeof n=="string"?{to:n}:n;const r=this._hooks[t]||[];delete this._hooks[t];for(const o of r)this.hook(t,o)}deprecateHooks(t){Object.assign(this._deprecatedHooks,t);for(const n in t)this.deprecateHook(n,t[n])}addHooks(t){const n=Dt(t),r=Object.keys(n).map(o=>this.hook(o,n[o]));return()=>{for(const o of r.splice(0,r.length))o()}}removeHooks(t){const n=Dt(t);for(const r in n)this.removeHook(r,n[r])}removeAllHooks(){for(const t in this._hooks)delete this._hooks[t]}callHook(t,...n){return n.unshift(t),this.callHookWith(Ri,t,...n)}callHookParallel(t,...n){return n.unshift(t),this.callHookWith(Pi,t,...n)}callHookWith(t,n,...r){const o=this._before||this._after?{name:n,args:r,context:{}}:void 0;this._before&&xt(this._before,o);const s=t(n in this._hooks?[...this._hooks[n]]:[],r);return s instanceof Promise?s.finally(()=>{this._after&&o&&xt(this._after,o)}):(this._after&&o&&xt(this._after,o),s)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const n=this._before.indexOf(t);n!==-1&&this._before.splice(n,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const n=this._after.indexOf(t);n!==-1&&this._after.splice(n,1)}}}}function zn(){return new Ni}var Vi=Object.create,Kn=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyNames,Mi=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty,$i=(e,t)=>function(){return e&&(t=(0,e[Rt(e)[0]])(e=0)),t},Gn=(e,t)=>function(){return t||(0,e[Rt(e)[0]])((t={exports:{}}).exports,t),t.exports},Ui=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rt(t))!Bi.call(e,o)&&o!==n&&Kn(e,o,{get:()=>t[o],enumerable:!(r=Li(t,o))||r.enumerable});return e},Fi=(e,t,n)=>(n=e!=null?Vi(Mi(e)):{},Ui(Kn(n,"default",{value:e,enumerable:!0}),e)),_=$i({"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),ji=Gn({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(e,t){_(),(function(n){var r={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",ا:"a",أ:"a",إ:"i",آ:"aa",ؤ:"u",ئ:"e",ء:"a",ب:"b",ت:"t",ث:"th",ج:"j",ح:"h",خ:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",ش:"sh",ص:"s",ض:"dh",ط:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",ة:"h",ﻻ:"la",ﻷ:"laa",ﻹ:"lai",ﻵ:"laa",گ:"g",چ:"ch",پ:"p",ژ:"zh",ک:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z","စျ":"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw","သြော":"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",ޠ:"t",ޡ:"z",ޢ:"a",ޣ:"gh",ޤ:"q",ޥ:"w","ަ":"a","ާ":"aa","ި":"i","ީ":"ee","ު":"u","ޫ":"oo","ެ":"e","ޭ":"ey","ޮ":"o","ޯ":"oa","ް":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Υ:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",ū:"u",Ā:"A",Ē:"E",Ģ:"G",Ī:"I",Ķ:"k",Ļ:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Ż:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",ţ:"t",Ţ:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",ẳ:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",ơ:"o",Ơ:"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",Ỡ:"O",Ở:"o",ở:"o",ị:"i",Ị:"I",ĩ:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",ủ:"u",Ủ:"U",ụ:"u",Ụ:"U",ũ:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",ự:"u",Ự:"U",ữ:"u",Ữ:"U",ử:"u",Ử:"ư",ỷ:"y",Ỷ:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",Ỵ:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY",元:"CNY",円:"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},o=["်","ް"],s={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်","က်":"et","ိုက်":"aik","ောက်":"auk","င်":"in","ိုင်":"aing","ောင်":"aung","စ်":"it","ည်":"i","တ်":"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it","ဒ်":"d","ိုဒ်":"ok","ုဒ်":"ait","န်":"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un","ပ်":"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut","န်ုပ်":"nub","မ်":"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un","ယ်":"e","ိုလ်":"ol","ဉ်":"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},i={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",š:"s",ť:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Š:"S",Ť:"T",Ů:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",š:"s",ų:"u",ū:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Į:"I",Š:"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",ģ:"g",ī:"i",ķ:"k",ļ:"l",ņ:"n",š:"s",ū:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ģ:"G",Ī:"i",Ķ:"k",Ļ:"L",Ņ:"N",Š:"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Ż:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},u={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},a=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),p=[".","!","~","*","'","(",")"].join(""),l=function(g,E){var O="-",T="",L="",re=!0,U={},A,ze,M,S,v,I,R,F,Ce,z,w,Y,C,De,oe="";if(typeof g!="string")return"";if(typeof E=="string"&&(O=E),R=u.en,F=i.en,typeof E=="object"){A=E.maintainCase||!1,U=E.custom&&typeof E.custom=="object"?E.custom:U,M=+E.truncate>1&&E.truncate||!1,S=E.uric||!1,v=E.uricNoSlash||!1,I=E.mark||!1,re=!(E.symbols===!1||E.lang===!1),O=E.separator||O,S&&(oe+=a),v&&(oe+=c),I&&(oe+=p),R=E.lang&&u[E.lang]&&re?u[E.lang]:re?u.en:{},F=E.lang&&i[E.lang]?i[E.lang]:E.lang===!1||E.lang===!0?{}:i.en,E.titleCase&&typeof E.titleCase.length=="number"&&Array.prototype.toString.call(E.titleCase)?(E.titleCase.forEach(function(K){U[K+""]=K+""}),ze=!0):ze=!!E.titleCase,E.custom&&typeof E.custom.length=="number"&&Array.prototype.toString.call(E.custom)&&E.custom.forEach(function(K){U[K+""]=K+""}),Object.keys(U).forEach(function(K){var Ke;K.length>1?Ke=new RegExp("\\b"+d(K)+"\\b","gi"):Ke=new RegExp(d(K),"gi"),g=g.replace(Ke,U[K])});for(w in U)oe+=w}for(oe+=O,oe=d(oe),g=g.replace(/(^\s+|\s+$)/g,""),C=!1,De=!1,z=0,Y=g.length;z<Y;z++)w=g[z],h(w,U)?C=!1:F[w]?(w=C&&F[w].match(/[A-Za-z0-9]/)?" "+F[w]:F[w],C=!1):w in r?(z+1<Y&&o.indexOf(g[z+1])>=0?(L+=w,w=""):De===!0?(w=s[L]+r[w],L=""):w=C&&r[w].match(/[A-Za-z0-9]/)?" "+r[w]:r[w],C=!1,De=!1):w in s?(L+=w,w="",z===Y-1&&(w=s[L]),De=!0):R[w]&&!(S&&a.indexOf(w)!==-1)&&!(v&&c.indexOf(w)!==-1)?(w=C||T.substr(-1).match(/[A-Za-z0-9]/)?O+R[w]:R[w],w+=g[z+1]!==void 0&&g[z+1].match(/[A-Za-z0-9]/)?O:"",C=!0):(De===!0?(w=s[L]+w,L="",De=!1):C&&(/[A-Za-z0-9]/.test(w)||T.substr(-1).match(/A-Za-z0-9]/))&&(w=" "+w),C=!1),T+=w.replace(new RegExp("[^\\w\\s"+oe+"_-]","g"),O);return ze&&(T=T.replace(/(\w)(\S*)/g,function(K,Ke,is){var ln=Ke.toUpperCase()+(is!==null?is:"");return Object.keys(U).indexOf(ln.toLowerCase())<0?ln:ln.toLowerCase()})),T=T.replace(/\s+/g,O).replace(new RegExp("\\"+O+"+","g"),O).replace(new RegExp("(^\\"+O+"+|\\"+O+"+$)","g"),""),M&&T.length>M&&(Ce=T.charAt(M)===O,T=T.slice(0,M),Ce||(T=T.slice(0,T.lastIndexOf(O)))),!A&&!ze&&(T=T.toLowerCase()),T},f=function(g){return function(O){return l(O,g)}},d=function(g){return g.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},h=function(m,g){for(var E in g)if(g[E]===m)return!0};if(typeof t<"u"&&t.exports)t.exports=l,t.exports.createSlug=f;else if(typeof define<"u"&&define.amd)define([],function(){return l});else try{if(n.getSlug||n.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";n.getSlug=l,n.createSlug=f}catch{}})(e)}}),Hi=Gn({"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(e,t){_(),t.exports=ji()}});_(),_(),_(),_(),_(),_(),_(),_();function zi(e){var t;const n=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return n==="index"&&((t=e.__file)!=null&&t.endsWith("index.vue"))?"":n}function Ki(e){const t=e.__file;if(t)return Ti(Ii(t,".vue"))}function Wn(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function Pt(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function Yn(e){var t,n;const r=(t=e.subTree)==null?void 0:t.type,o=Pt(e);return o?((n=o?.types)==null?void 0:n.Fragment)===r:!1}function Ze(e){var t,n,r;const o=zi(e?.type||{});if(o)return o;if(e?.root===e)return"Root";for(const i in(n=(t=e.parent)==null?void 0:t.type)==null?void 0:n.components)if(e.parent.type.components[i]===e?.type)return Wn(e,i);for(const i in(r=e.appContext)==null?void 0:r.components)if(e.appContext.components[i]===e?.type)return Wn(e,i);const s=Ki(e?.type||{});return s||"Anonymous Component"}function Gi(e){var t,n,r;const o=(r=(n=(t=e?.appContext)==null?void 0:t.app)==null?void 0:n.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?r:0,s=e===e?.root?"root":e.uid;return`${o}:${s}`}function Nt(e,t){return t=t||`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(":root")}function Wi(){const e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var Qe;function Yi(e){return Qe||(Qe=document.createRange()),Qe.selectNode(e),Qe.getBoundingClientRect()}function qi(e){const t=Wi();if(!e.children)return t;for(let n=0,r=e.children.length;n<r;n++){const o=e.children[n];let s;if(o.component)s=ae(o.component);else if(o.el){const i=o.el;i.nodeType===1||i.getBoundingClientRect?s=i.getBoundingClientRect():i.nodeType===3&&i.data.trim()&&(s=Yi(i))}s&&Ji(t,s)}return t}function Ji(e,t){return(!e.top||t.top<e.top)&&(e.top=t.top),(!e.bottom||t.bottom>e.bottom)&&(e.bottom=t.bottom),(!e.left||t.left<e.left)&&(e.left=t.left),(!e.right||t.right>e.right)&&(e.right=t.right),e}var qn={top:0,left:0,right:0,bottom:0,width:0,height:0};function ae(e){const t=e.subTree.el;return typeof window>"u"?qn:Yn(e)?qi(e.subTree):t?.nodeType===1?t?.getBoundingClientRect():e.subTree.component?ae(e.subTree.component):qn}_();function Vt(e){return Yn(e)?Xi(e.subTree):e.subTree?[e.subTree.el]:[]}function Xi(e){if(!e.children)return[];const t=[];return e.children.forEach(n=>{n.component?t.push(...Vt(n.component)):n?.el&&t.push(n.el)}),t}var Jn="__vue-devtools-component-inspector__",Xn="__vue-devtools-component-inspector__card__",Zn="__vue-devtools-component-inspector__name__",Qn="__vue-devtools-component-inspector__indicator__",er={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},Zi={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},Qi={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function Se(){return document.getElementById(Jn)}function eu(){return document.getElementById(Xn)}function tu(){return document.getElementById(Qn)}function nu(){return document.getElementById(Zn)}function Lt(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function Mt(e){var t;const n=document.createElement("div");n.id=(t=e.elementId)!=null?t:Jn,Object.assign(n.style,{...er,...Lt(e.bounds),...e.style});const r=document.createElement("span");r.id=Xn,Object.assign(r.style,{...Zi,top:e.bounds.top<35?0:"-35px"});const o=document.createElement("span");o.id=Zn,o.innerHTML=`<${e.name}> `;const s=document.createElement("i");return s.id=Qn,s.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(s.style,Qi),r.appendChild(o),r.appendChild(s),n.appendChild(r),document.body.appendChild(n),n}function Bt(e){const t=Se(),n=eu(),r=nu(),o=tu();t&&(Object.assign(t.style,{...er,...Lt(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:"-35px"}),r.innerHTML=`<${e.name}> `,o.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function ru(e){const t=ae(e);if(!t.width&&!t.height)return;const n=Ze(e);Se()?Bt({bounds:t,name:n}):Mt({bounds:t,name:n})}function tr(){const e=Se();e&&(e.style.display="none")}var $t=null;function Ut(e){const t=e.target;if(t){const n=t.__vueParentComponent;if(n&&($t=n,n.vnode.el)){const o=ae(n),s=Ze(n);Se()?Bt({bounds:o,name:s}):Mt({bounds:o,name:s})}}}function ou(e,t){if(e.preventDefault(),e.stopPropagation(),$t){const n=Gi($t);t(n)}}var et=null;function su(){tr(),window.removeEventListener("mouseover",Ut),window.removeEventListener("click",et,!0),et=null}function iu(){return window.addEventListener("mouseover",Ut),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),ou(n,r=>{window.removeEventListener("click",t,!0),et=null,window.removeEventListener("mouseover",Ut);const o=Se();o&&(o.style.display="none"),e(JSON.stringify({id:r}))})}et=t,window.addEventListener("click",t,!0)})}function uu(e){const t=Nt(N.value,e.id);if(t){const[n]=Vt(t);if(typeof n.scrollIntoView=="function")n.scrollIntoView({behavior:"smooth"});else{const r=ae(t),o=document.createElement("div"),s={...Lt(r),position:"absolute"};Object.assign(o.style,s),document.body.appendChild(o),o.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(o)},2e3)}setTimeout(()=>{const r=ae(t);if(r.width||r.height){const o=Ze(t),s=Se();s?Bt({...e,name:o,bounds:r}):Mt({...e,name:o,bounds:r}),setTimeout(()=>{s&&(s.style.display="none")},1500)}},1200)}}_();var nr,rr;(rr=(nr=y).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__)!=null||(nr.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function au(e){let t=0;const n=setInterval(()=>{y.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function cu(){const e=y.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function lu(){return new Promise(e=>{function t(){cu(),e(y.__VUE_INSPECTOR__)}y.__VUE_INSPECTOR__?t():au(()=>{t()})})}_(),_();function fu(e){return!!(e&&e.__v_isReadonly)}function or(e){return fu(e)?or(e.__v_raw):!!(e&&e.__v_isReactive)}function Ft(e){return!!(e&&e.__v_isRef===!0)}function Ve(e){const t=e&&e.__v_raw;return t?Ve(t):e}var du=class{constructor(){this.refEditor=new hu}set(e,t,n,r){const o=Array.isArray(t)?t:t.split(".");for(;o.length>1;){const u=o.shift();e instanceof Map?e=e.get(u):e instanceof Set?e=Array.from(e.values())[u]:e=e[u],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}const s=o[0],i=this.refEditor.get(e)[s];r?r(e,s,n):this.refEditor.isRef(i)?this.refEditor.set(i,n):e[s]=n}get(e,t){const n=Array.isArray(t)?t:t.split(".");for(let r=0;r<n.length;r++)if(e instanceof Map?e=e.get(n[r]):e=e[n[r]],this.refEditor.isRef(e)&&(e=this.refEditor.get(e)),!e)return;return e}has(e,t,n=!1){if(typeof e>"u")return!1;const r=Array.isArray(t)?t.slice():t.split("."),o=n?2:1;for(;e&&r.length>o;){const s=r.shift();e=e[s],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,r[0])}createDefaultSetCallback(e){return(t,n,r)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):Ve(t)instanceof Map?t.delete(n):Ve(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){const o=t[e.newKey||n];this.refEditor.isRef(o)?this.refEditor.set(o,r):Ve(t)instanceof Map?t.set(e.newKey||n,r):Ve(t)instanceof Set?t.add(r):t[e.newKey||n]=r}}}},hu=class{set(e,t){if(Ft(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(o=>e.add(o));return}const n=Object.keys(t);if(e instanceof Map){const o=new Set(e.keys());n.forEach(s=>{e.set(s,Reflect.get(t,s)),o.delete(s)}),o.forEach(s=>e.delete(s));return}const r=new Set(Object.keys(e));n.forEach(o=>{Reflect.set(e,o,Reflect.get(t,o)),r.delete(o)}),r.forEach(o=>Reflect.deleteProperty(e,o))}}get(e){return Ft(e)?e.value:e}isRef(e){return Ft(e)||or(e)}};_(),_(),_();var pu="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function _u(){if(!Un||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const e=localStorage.getItem(pu);return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}_(),_(),_();var sr,ir;(ir=(sr=y).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS)!=null||(sr.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var gu=new Proxy(y.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function mu(e,t){D.timelineLayersState[t.id]=!1,gu.push({...e,descriptorId:t.id,appRecord:Pt(t.app)})}var ur,ar;(ar=(ur=y).__VUE_DEVTOOLS_KIT_INSPECTOR__)!=null||(ur.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var jt=new Proxy(y.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),cr=ve(()=>{Ae.hooks.callHook("sendInspectorToClient",lr())});function Eu(e,t){var n,r;jt.push({options:e,descriptor:t,treeFilterPlaceholder:(n=e.treeFilterPlaceholder)!=null?n:"Search tree...",stateFilterPlaceholder:(r=e.stateFilterPlaceholder)!=null?r:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Pt(t.app)}),cr()}function lr(){return jt.filter(e=>e.descriptor.app===N.value.app).filter(e=>e.descriptor.id!=="components").map(e=>{var t;const n=e.descriptor,r=e.options;return{id:r.id,label:r.label,logo:n.logo,icon:`custom-ic-baseline-${(t=r?.icon)==null?void 0:t.replace(/_/g,"-")}`,packageName:n.packageName,homepage:n.homepage,pluginId:n.id}})}function tt(e,t){return jt.find(n=>n.options.id===e&&(t?n.descriptor.app===t:!0))}function yu(){const e=zn();e.hook("addInspector",({inspector:r,plugin:o})=>{Eu(r,o.descriptor)});const t=ve(async({inspectorId:r,plugin:o})=>{var s;if(!r||!((s=o?.descriptor)!=null&&s.app)||D.highPerfModeEnabled)return;const i=tt(r,o.descriptor.app),u={app:o.descriptor.app,inspectorId:r,filter:i?.treeFilter||"",rootNodes:[]};await new Promise(a=>{e.callHookWith(async c=>{await Promise.all(c.map(p=>p(u))),a()},"getInspectorTree")}),e.callHookWith(async a=>{await Promise.all(a.map(c=>c({inspectorId:r,rootNodes:u.rootNodes})))},"sendInspectorTreeToClient")},120);e.hook("sendInspectorTree",t);const n=ve(async({inspectorId:r,plugin:o})=>{var s;if(!r||!((s=o?.descriptor)!=null&&s.app)||D.highPerfModeEnabled)return;const i=tt(r,o.descriptor.app),u={app:o.descriptor.app,inspectorId:r,nodeId:i?.selectedNodeId||"",state:null},a={currentTab:`custom-inspector:${r}`};u.nodeId&&await new Promise(c=>{e.callHookWith(async p=>{await Promise.all(p.map(l=>l(u,a))),c()},"getInspectorState")}),e.callHookWith(async c=>{await Promise.all(c.map(p=>p({inspectorId:r,nodeId:u.nodeId,state:u.state})))},"sendInspectorStateToClient")},120);return e.hook("sendInspectorState",n),e.hook("customInspectorSelectNode",({inspectorId:r,nodeId:o,plugin:s})=>{const i=tt(r,s.descriptor.app);i&&(i.selectedNodeId=o)}),e.hook("timelineLayerAdded",({options:r,plugin:o})=>{mu(r,o.descriptor)}),e.hook("timelineEventAdded",({options:r,plugin:o})=>{var s;const i=["performance","component-event","keyboard","mouse"];D.highPerfModeEnabled||!((s=D.timelineLayersState)!=null&&s[o.descriptor.id])&&!i.includes(r.layerId)||e.callHookWith(async u=>{await Promise.all(u.map(a=>a(r)))},"sendTimelineEventToClient")}),e.hook("getComponentInstances",async({app:r})=>{const o=r.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!o)return null;const s=o.id.toString();return[...o.instanceMap].filter(([u])=>u.split(":")[0]===s).map(([,u])=>u)}),e.hook("getComponentBounds",async({instance:r})=>ae(r)),e.hook("getComponentName",({instance:r})=>Ze(r)),e.hook("componentHighlight",({uid:r})=>{const o=N.value.instanceMap.get(r);o&&ru(o)}),e.hook("componentUnhighlight",()=>{tr()}),e}var fr,dr;(dr=(fr=y).__VUE_DEVTOOLS_KIT_APP_RECORDS__)!=null||(fr.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var hr,pr;(pr=(hr=y).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__)!=null||(hr.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var _r,gr;(gr=(_r=y).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__)!=null||(_r.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var mr,Er;(Er=(mr=y).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__)!=null||(mr.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var yr,vr;(vr=(yr=y).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__)!=null||(yr.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var ce="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function vu(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:_u()}}var Sr,br;(br=(Sr=y)[ce])!=null||(Sr[ce]=vu());var Su=ve(e=>{Ae.hooks.callHook("devtoolsStateUpdated",{state:e})});ve((e,t)=>{Ae.hooks.callHook("devtoolsConnectedUpdated",{state:e,oldState:t})});var nt=new Proxy(y.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t==="value"?y.__VUE_DEVTOOLS_KIT_APP_RECORDS__:y.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),N=new Proxy(y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t==="value"?y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t==="id"?y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function Ar(){Su({...y[ce],appRecords:nt.value,activeAppRecordId:N.id,tabs:y.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:y.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function bu(e){y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,Ar()}function Au(e){y.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,Ar()}var D=new Proxy(y[ce],{get(e,t){return t==="appRecords"?nt:t==="activeAppRecordId"?N.id:t==="tabs"?y.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t==="commands"?y.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:y[ce][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return{...y[ce]},e[t]=n,y[ce][t]=n,!0}});function wu(e={}){var t,n,r;const{file:o,host:s,baseUrl:i=window.location.origin,line:u=0,column:a=0}=e;if(o){if(s==="chrome-extension"){const c=o.replace(/\\/g,"\\\\"),p=(n=(t=window.VUE_DEVTOOLS_CONFIG)==null?void 0:t.openInEditorHost)!=null?n:"/";fetch(`${p}__open-in-editor?file=${encodeURI(o)}`).then(l=>{if(!l.ok){const f=`Opening component ${c} failed`;console.log(`%c${f}`,"color:red")}})}else if(D.vitePluginDetected){const c=(r=y.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?r:i;y.__VUE_INSPECTOR__.openInEditor(c,o,u,a)}}}_(),_(),_(),_(),_();var wr,Or;(Or=(wr=y).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__)!=null||(wr.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var Ht=new Proxy(y.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function zt(e){const t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function Kt(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function Ou(e){var t,n,r;const o=(n=(t=Ht.find(s=>{var i;return s[0].id===e&&!!((i=s[0])!=null&&i.settings)}))==null?void 0:t[0])!=null?n:null;return(r=o?.settings)!=null?r:null}function Tr(e,t){var n,r,o;const s=Kt(e);if(s){const i=localStorage.getItem(s);if(i)return JSON.parse(i)}if(e){const i=(r=(n=Ht.find(u=>u[0].id===e))==null?void 0:n[0])!=null?r:null;return zt((o=i?.settings)!=null?o:{})}return zt(t)}function Tu(e,t){const n=Kt(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(zt(t)))}function Iu(e,t,n){const r=Kt(e),o=localStorage.getItem(r),s=JSON.parse(o||"{}"),i={...s,[t]:n};localStorage.setItem(r,JSON.stringify(i)),Ae.hooks.callHookWith(u=>{u.forEach(a=>a({pluginId:e,key:t,oldValue:s[t],newValue:n,settings:i}))},"setPluginSettings")}_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_();var Ir,kr,B=(kr=(Ir=y).__VUE_DEVTOOLS_HOOK)!=null?kr:Ir.__VUE_DEVTOOLS_HOOK=zn(),ku={vueAppInit(e){B.hook("app:init",e)},vueAppUnmount(e){B.hook("app:unmount",e)},vueAppConnected(e){B.hook("app:connected",e)},componentAdded(e){return B.hook("component:added",e)},componentEmit(e){return B.hook("component:emit",e)},componentUpdated(e){return B.hook("component:updated",e)},componentRemoved(e){return B.hook("component:removed",e)},setupDevtoolsPlugin(e){B.hook("devtools-plugin:setup",e)},perfStart(e){return B.hook("perf:start",e)},perfEnd(e){return B.hook("perf:end",e)}},Cr={on:ku,setupDevToolsPlugin(e,t){return B.callHook("devtools-plugin:setup",e,t)}},Cu=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook("visitComponentTree",e)},inspectComponent:e=>{this.hooks.hook("inspectComponent",e)},editComponentState:e=>{this.hooks.hook("editComponentState",e)},getInspectorTree:e=>{this.hooks.hook("getInspectorTree",e)},getInspectorState:e=>{this.hooks.hook("getInspectorState",e)},editInspectorState:e=>{this.hooks.hook("editInspectorState",e)},inspectTimelineEvent:e=>{this.hooks.hook("inspectTimelineEvent",e)},timelineCleared:e=>{this.hooks.hook("timelineCleared",e)},setPluginSettings:e=>{this.hooks.hook("setPluginSettings",e)}}}notifyComponentUpdate(e){var t;if(D.highPerfModeEnabled)return;const n=lr().find(r=>r.packageName===this.plugin.descriptor.packageName);if(n?.id){if(e){const r=[e.appContext.app,e.uid,(t=e.parent)==null?void 0:t.uid,e];B.callHook("component:updated",...r)}else B.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:n.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook("addInspector",{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&Tu(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){D.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){D.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook("customInspectorSelectNode",{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook("visitComponentTree",e)}now(){return D.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook("timelineLayerAdded",{options:e,plugin:this.plugin})}addTimelineEvent(e){D.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:e,plugin:this.plugin})}getSettings(e){return Tr(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook("getComponentInstances",{app:e})}getComponentBounds(e){return this.hooks.callHook("getComponentBounds",{instance:e})}getComponentName(e){return this.hooks.callHook("getComponentName",{instance:e})}highlightElement(e){const t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:t})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},Du=Cu;_(),_(),_(),_();var xu="__vue_devtool_undefined__",Ru="__vue_devtool_infinity__",Pu="__vue_devtool_negative_infinity__",Nu="__vue_devtool_nan__";_(),_();var Vu={[xu]:"undefined",[Nu]:"NaN",[Ru]:"Infinity",[Pu]:"-Infinity"};Object.entries(Vu).reduce((e,[t,n])=>(e[n]=t,e),{}),_(),_(),_(),_(),_();var Dr,xr;(xr=(Dr=y).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__)!=null||(Dr.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function Rr(e,t){return Cr.setupDevToolsPlugin(e,t)}function Lu(e,t){const[n,r]=e;if(n.app!==t)return;const o=new Du({plugin:{setupFn:r,descriptor:n},ctx:Ae});n.packageName==="vuex"&&o.on.editInspectorState(s=>{o.sendInspectorState(s.inspectorId)}),r(o)}function Pr(e,t){y.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||D.highPerfModeEnabled&&!t?.inspectingComponent||(y.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),Ht.forEach(n=>{Lu(n,e)}))}_(),_();var Le="__VUE_DEVTOOLS_ROUTER__",be="__VUE_DEVTOOLS_ROUTER_INFO__",Nr,Vr;(Vr=(Nr=y)[be])!=null||(Nr[be]={currentRoute:null,routes:[]});var Lr,Mr;(Mr=(Lr=y)[Le])!=null||(Lr[Le]={}),new Proxy(y[be],{get(e,t){return y[be][t]}}),new Proxy(y[Le],{get(e,t){if(t==="value")return y[Le]}});function Mu(e){const t=new Map;return(e?.getRoutes()||[]).filter(n=>!t.has(n.path)&&t.set(n.path,1))}function Gt(e){return e.map(t=>{let{path:n,name:r,children:o,meta:s}=t;return o?.length&&(o=Gt(o)),{path:n,name:r,children:o,meta:s}})}function Bu(e){if(e){const{fullPath:t,hash:n,href:r,path:o,name:s,matched:i,params:u,query:a}=e;return{fullPath:t,hash:n,href:r,path:o,name:s,params:u,query:a,matched:Gt(i)}}return e}function $u(e,t){function n(){var r;const o=(r=e.app)==null?void 0:r.config.globalProperties.$router,s=Bu(o?.currentRoute.value),i=Gt(Mu(o)),u=console.warn;console.warn=()=>{},y[be]={currentRoute:s?jn(s):{},routes:jn(i)},y[Le]=o,console.warn=u}n(),Cr.on.componentUpdated(ve(()=>{var r;((r=t.value)==null?void 0:r.app)===e.app&&(n(),!D.highPerfModeEnabled&&Ae.hooks.callHook("routerInfoUpdated",{state:y[be]}))},200))}function Uu(e){return{async getInspectorTree(t){const n={...t,app:N.value.app,rootNodes:[]};return await new Promise(r=>{e.callHookWith(async o=>{await Promise.all(o.map(s=>s(n))),r()},"getInspectorTree")}),n.rootNodes},async getInspectorState(t){const n={...t,app:N.value.app,state:null},r={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(o=>{e.callHookWith(async s=>{await Promise.all(s.map(i=>i(n,r))),o()},"getInspectorState")}),n.state},editInspectorState(t){const n=new du,r={...t,app:N.value.app,set:(o,s=t.path,i=t.state.value,u)=>{n.set(o,s,i,u||n.createDefaultSetCallback(t.state))}};e.callHookWith(o=>{o.forEach(s=>s(r))},"editInspectorState")},sendInspectorState(t){const n=tt(t);e.callHook("sendInspectorState",{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return iu()},cancelInspectComponentInspector(){return su()},getComponentRenderCode(t){const n=Nt(N.value,t);if(n)return typeof n?.type!="function"?n.render.toString():n.type.toString()},scrollToComponent(t){return uu({id:t})},openInEditor:wu,getVueInspector:lu,toggleApp(t,n){const r=nt.value.find(o=>o.id===t);r&&(Au(t),bu(r),$u(r,N),cr(),Pr(r.app,n))},inspectDOM(t){const n=Nt(N.value,t);if(n){const[r]=Vt(n);r&&(y.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=r)}},updatePluginSettings(t,n,r){Iu(t,n,r)},getPluginSettings(t){return{options:Ou(t),values:Tr(t)}}}}_();var Br,$r;($r=(Br=y).__VUE_DEVTOOLS_ENV__)!=null||(Br.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var Ur=yu(),Fr,jr;(jr=(Fr=y).__VUE_DEVTOOLS_KIT_CONTEXT__)!=null||(Fr.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:Ur,get state(){return{...D,activeAppRecordId:N.id,activeAppRecord:N.value,appRecords:nt.value}},api:Uu(Ur)});var Ae=y.__VUE_DEVTOOLS_KIT_CONTEXT__;_(),Fi(Hi());var Hr,zr;(zr=(Hr=y).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__)!=null||(Hr.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set}),_(),_();function Fu(e){D.highPerfModeEnabled=e??!D.highPerfModeEnabled,!e&&N.value&&Pr(N.value.app)}_(),_(),_();function ju(e){D.devtoolsClientDetected={...D.devtoolsClientDetected,...e};const t=Object.values(D.devtoolsClientDetected).some(Boolean);Fu(!t)}var Kr,Gr;(Gr=(Kr=y).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__)!=null||(Kr.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=ju),_(),_(),_(),_(),_(),_(),_();var Hu=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},Wr=class{constructor(t){this.generateIdentifier=t,this.kv=new Hu}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},zu=class extends Wr{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};_(),_();function Ku(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Gu(e,t){const n=Ku(e);if("find"in n)return n.find(t);const r=n;for(let o=0;o<r.length;o++){const s=r[o];if(t(s))return s}}function we(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function rt(e,t){return e.indexOf(t)!==-1}function Yr(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var Wu=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Gu(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};_(),_();var Yu=e=>Object.prototype.toString.call(e).slice(8,-1),qr=e=>typeof e>"u",qu=e=>e===null,Me=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Wt=e=>Me(e)&&Object.keys(e).length===0,ee=e=>Array.isArray(e),Ju=e=>typeof e=="string",Xu=e=>typeof e=="number"&&!isNaN(e),Zu=e=>typeof e=="boolean",Qu=e=>e instanceof RegExp,Be=e=>e instanceof Map,$e=e=>e instanceof Set,Jr=e=>Yu(e)==="Symbol",ea=e=>e instanceof Date&&!isNaN(e.valueOf()),ta=e=>e instanceof Error,Xr=e=>typeof e=="number"&&isNaN(e),na=e=>Zu(e)||qu(e)||qr(e)||Xu(e)||Ju(e)||Jr(e),ra=e=>typeof e=="bigint",oa=e=>e===1/0||e===-1/0,sa=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),ia=e=>e instanceof URL;_();var Zr=e=>e.replace(/\./g,"\\."),Yt=e=>e.map(String).map(Zr).join("."),Ue=e=>{const t=[];let n="";for(let o=0;o<e.length;o++){let s=e.charAt(o);if(s==="\\"&&e.charAt(o+1)==="."){n+=".",o++;continue}if(s==="."){t.push(n),n="";continue}n+=s}const r=n;return t.push(r),t};_();function G(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var Qr=[G(qr,"undefined",()=>null,()=>{}),G(ra,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),G(ea,"Date",e=>e.toISOString(),e=>new Date(e)),G(ta,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),G(Qu,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),G($e,"set",e=>[...e.values()],e=>new Set(e)),G(Be,"map",e=>[...e.entries()],e=>new Map(e)),G(e=>Xr(e)||oa(e),"number",e=>Xr(e)?"NaN":e>0?"Infinity":"-Infinity",Number),G(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),G(ia,"URL",e=>e.toString(),e=>new URL(e))];function ot(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var eo=ot((e,t)=>Jr(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),ua=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),to=ot(sa,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=ua[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function no(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var ro=ot(no,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(o=>{r[o]=e[o]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),oo=ot((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),aa=[ro,eo,oo,to],so=(e,t)=>{const n=Yr(aa,o=>o.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Yr(Qr,o=>o.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},io={};Qr.forEach(e=>{io[e.annotation]=e});var ca=(e,t,n)=>{if(ee(t))switch(t[0]){case"symbol":return eo.untransform(e,t,n);case"class":return ro.untransform(e,t,n);case"custom":return oo.untransform(e,t,n);case"typed-array":return to.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=io[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}};_();var Oe=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function uo(e){if(rt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(rt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(rt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var la=(e,t)=>{uo(t);for(let n=0;n<t.length;n++){const r=t[n];if($e(e))e=Oe(e,+r);else if(Be(e)){const o=+r,s=+t[++n]==0?"key":"value",i=Oe(e,o);switch(s){case"key":e=i;break;case"value":e=e.get(i);break}}else e=e[r]}return e},qt=(e,t,n)=>{if(uo(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const i=t[s];if(ee(r)){const u=+i;r=r[u]}else if(Me(r))r=r[i];else if($e(r)){const u=+i;r=Oe(r,u)}else if(Be(r)){if(s===t.length-2)break;const a=+i,c=+t[++s]==0?"key":"value",p=Oe(r,a);switch(c){case"key":r=p;break;case"value":r=r.get(p);break}}}const o=t[t.length-1];if(ee(r)?r[+o]=n(r[+o]):Me(r)&&(r[o]=n(r[o])),$e(r)){const s=Oe(r,+o),i=n(s);s!==i&&(r.delete(s),r.add(i))}if(Be(r)){const s=+t[t.length-2],i=Oe(r,s);switch(+o==0?"key":"value"){case"key":{const a=n(i);r.set(a,r.get(i)),a!==i&&r.delete(i);break}case"value":{r.set(i,n(r.get(i)));break}}}return e};function Jt(e,t,n=[]){if(!e)return;if(!ee(e)){we(e,(s,i)=>Jt(s,t,[...n,...Ue(i)]));return}const[r,o]=e;o&&we(o,(s,i)=>{Jt(s,t,[...n,...Ue(i)])}),t(r,n)}function fa(e,t,n){return Jt(t,(r,o)=>{e=qt(e,o,s=>ca(s,r,n))}),e}function da(e,t){function n(r,o){const s=la(e,Ue(o));r.map(Ue).forEach(i=>{e=qt(e,i,()=>s)})}if(ee(t)){const[r,o]=t;r.forEach(s=>{e=qt(e,Ue(s),()=>e)}),o&&we(o,n)}else we(t,n);return e}var ha=(e,t)=>Me(e)||ee(e)||Be(e)||$e(e)||no(e,t);function pa(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function _a(e,t){const n={};let r;return e.forEach(o=>{if(o.length<=1)return;t||(o=o.map(u=>u.map(String)).sort((u,a)=>u.length-a.length));const[s,...i]=o;s.length===0?r=i.map(Yt):n[Yt(s)]=i.map(Yt)}),r?Wt(n)?[r]:[r,n]:Wt(n)?void 0:n}var ao=(e,t,n,r,o=[],s=[],i=new Map)=>{var u;const a=na(e);if(!a){pa(e,o,t);const h=i.get(e);if(h)return r?{transformedValue:null}:h}if(!ha(e,n)){const h=so(e,n),m=h?{transformedValue:h.value,annotations:[h.type]}:{transformedValue:e};return a||i.set(e,m),m}if(rt(s,e))return{transformedValue:null};const c=so(e,n),p=(u=c?.value)!=null?u:e,l=ee(p)?[]:{},f={};we(p,(h,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const g=ao(h,t,n,r,[...o,m],[...s,e],i);l[m]=g.transformedValue,ee(g.annotations)?f[m]=g.annotations:Me(g.annotations)&&we(g.annotations,(E,O)=>{f[Zr(m)+"."+O]=E})});const d=Wt(f)?{transformedValue:l,annotations:c?[c.type]:void 0}:{transformedValue:l,annotations:c?[c.type,f]:f};return a||i.set(e,d),d};_(),_();function co(e){return Object.prototype.toString.call(e).slice(8,-1)}function lo(e){return co(e)==="Array"}function ga(e){if(co(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function ma(e,t,n,r,o){const s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=n),o&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Xt(e,t={}){if(lo(e))return e.map(o=>Xt(o,t));if(!ga(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,s)=>{if(lo(t.props)&&!t.props.includes(s))return o;const i=e[s],u=Xt(i,t);return ma(o,s,u,e,t.nonenumerable),o},{})}var k=class{constructor({dedupe:e=!1}={}){this.classRegistry=new zu,this.symbolRegistry=new Wr(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new Wu,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=ao(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const o=_a(t,this.dedupe);return o&&(r.meta={...r.meta,referentialEqualities:o}),r}deserialize(e){const{json:t,meta:n}=e;let r=Xt(t);return n?.values&&(r=fa(r,n.values,this)),n?.referentialEqualities&&(r=da(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};k.defaultInstance=new k,k.serialize=k.defaultInstance.serialize.bind(k.defaultInstance),k.deserialize=k.defaultInstance.deserialize.bind(k.defaultInstance),k.stringify=k.defaultInstance.stringify.bind(k.defaultInstance),k.parse=k.defaultInstance.parse.bind(k.defaultInstance),k.registerClass=k.defaultInstance.registerClass.bind(k.defaultInstance),k.registerSymbol=k.defaultInstance.registerSymbol.bind(k.defaultInstance),k.registerCustom=k.defaultInstance.registerCustom.bind(k.defaultInstance),k.allowErrorProps=k.defaultInstance.allowErrorProps.bind(k.defaultInstance),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_(),_();var fo,ho;(ho=(fo=y).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__)!=null||(fo.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var po,_o;(_o=(po=y).__VUE_DEVTOOLS_KIT_RPC_CLIENT__)!=null||(po.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var go,mo;(mo=(go=y).__VUE_DEVTOOLS_KIT_RPC_SERVER__)!=null||(go.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var Eo,yo;(yo=(Eo=y).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__)!=null||(Eo.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var vo,So;(So=(vo=y).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__)!=null||(vo.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var bo,Ao;(Ao=(bo=y).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__)!=null||(bo.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null),_(),_(),_(),_(),_(),_(),_();/*!
|
|
1
|
+
(function(C,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(C=typeof globalThis<"u"?globalThis:C||self,a(C["@stonecrop/stonecrop"]={},C.Vue))})(this,(function(C,a){"use strict";/*!
|
|
4
2
|
* pinia v3.0.3
|
|
5
3
|
* (c) 2025 Eduardo San Martin Morote
|
|
6
4
|
* @license MIT
|
|
7
|
-
*/let
|
|
8
|
-
${i}
|
|
9
|
-
Only state can be modified.`);i[0]="$state",Te=!1,r.set(s,i,r.state.value),Te=!0}})})}function Pa(e,t){at.includes(ct(t.$id))||at.push(ct(t.$id)),Rr({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:at,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const r=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:u,name:a,args:c})=>{const p=Po++;n.addTimelineEvent({layerId:fe,event:{time:r(),title:"🛫 "+a,subtitle:"start",data:{store:H(t.$id),action:H(a),args:c},groupId:p}}),i(l=>{ne=void 0,n.addTimelineEvent({layerId:fe,event:{time:r(),title:"🛬 "+a,subtitle:"end",data:{store:H(t.$id),action:H(a),args:c,result:l},groupId:p}})}),u(l=>{ne=void 0,n.addTimelineEvent({layerId:fe,event:{time:r(),logType:"error",title:"💥 "+a,subtitle:"end",data:{store:H(t.$id),action:H(a),args:c,error:l},groupId:p}})})},!0),t._customProperties.forEach(i=>{b.watch(()=>b.unref(t[i]),(u,a)=>{n.notifyComponentUpdate(),n.sendInspectorState(P),Te&&n.addTimelineEvent({layerId:fe,event:{time:r(),title:"Change",subtitle:i,data:{newValue:u,oldValue:a},groupId:ne}})},{deep:!0})}),t.$subscribe(({events:i,type:u},a)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(P),!Te)return;const c={time:r(),title:Da(u),data:xa({store:H(t.$id)},Ca(i)),groupId:ne};u===W.patchFunction?c.subtitle="⤵️":u===W.patchObject?c.subtitle="🧩":i&&!Array.isArray(i)&&(c.subtitle=i.type),i&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:fe,event:c})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=b.markRaw(i=>{o(i),n.addTimelineEvent({layerId:fe,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:H(t.$id),info:H("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`"${t.$id}" store installed 🆕`)})}let Po=0,ne;function No(e,t,n){const r=t.reduce((o,s)=>(o[s]=b.toRaw(e)[s],o),{});for(const o in r)e[o]=function(){const s=Po,i=n?new Proxy(e,{get(...a){return ne=s,Reflect.get(...a)},set(...a){return ne=s,Reflect.set(...a)}}):e;ne=s;const u=r[o].apply(i,arguments);return ne=void 0,u}}function Na({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){No(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;b.toRaw(t)._hotUpdate=function(o){r.apply(this,arguments),No(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}Pa(e,t)}}function Va(){const e=b.effectScope(!0),t=e.run(()=>b.ref({}));let n=[],r=[];const o=b.markRaw({install(s){je(o),o._a=s,s.provide(wo,o),s.config.globalProperties.$pinia=o,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te&&Ra(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return this._a?n.push(s):r.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te&&typeof Proxy<"u"&&o.use(Na),o}function Vo(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];le(o)&&le(r)&&!b.isRef(r)&&!b.isReactive(r)?e[n]=Vo(o,r):e[n]=r}return e}const Lo=()=>{};function Mo(e,t,n,r=Lo){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&b.getCurrentScope()&&b.onScopeDispose(o),o}function Ie(e,...t){e.slice().forEach(n=>{n(...t)})}const La=e=>e(),Bo=Symbol(),en=Symbol();function tn(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];le(o)&&le(r)&&e.hasOwnProperty(n)&&!b.isRef(r)&&!b.isReactive(r)?e[n]=tn(o,r):e[n]=r}return e}const Ma=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Ba(e){return!le(e)||!Object.prototype.hasOwnProperty.call(e,Ma)}const{assign:$}=Object;function $o(e){return!!(b.isRef(e)&&e.effect)}function Uo(e,t,n,r){const{state:o,actions:s,getters:i}=t,u=n.state.value[e];let a;function c(){!u&&(process.env.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const p=process.env.NODE_ENV!=="production"&&r?b.toRefs(b.ref(o?o():{}).value):b.toRefs(n.state.value[e]);return $(p,s,Object.keys(i||{}).reduce((l,f)=>(process.env.NODE_ENV!=="production"&&f in p&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${f}" in store "${e}".`),l[f]=b.markRaw(b.computed(()=>{je(n);const d=n._s.get(e);return i[f].call(d,d)})),l),{}))}return a=nn(e,c,t,n,r,!0),a}function nn(e,t,n={},r,o,s){let i;const u=$({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const a={deep:!0};process.env.NODE_ENV!=="production"&&(a.onTrigger=S=>{c?d=S:c==!1&&!A._hotUpdating&&(Array.isArray(d)?d.push(S):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,p,l=[],f=[],d;const h=r.state.value[e];!s&&!h&&(process.env.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const m=b.ref({});let g;function E(S){let v;c=p=!1,process.env.NODE_ENV!=="production"&&(d=[]),typeof S=="function"?(S(r.state.value[e]),v={type:W.patchFunction,storeId:e,events:d}):(tn(r.state.value[e],S),v={type:W.patchObject,payload:S,storeId:e,events:d});const I=g=Symbol();b.nextTick().then(()=>{g===I&&(c=!0)}),p=!0,Ie(l,v,r.state.value[e])}const O=s?function(){const{state:v}=n,I=v?v():{};this.$patch(R=>{$(R,I)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Lo;function T(){i.stop(),l=[],f=[],r._s.delete(e)}const L=(S,v="")=>{if(Bo in S)return S[en]=v,S;const I=function(){je(r);const R=Array.from(arguments),F=[],Ce=[];function z(C){F.push(C)}function w(C){Ce.push(C)}Ie(f,{args:R,name:I[en],store:A,after:z,onError:w});let Y;try{Y=S.apply(this&&this.$id===e?this:A,R)}catch(C){throw Ie(Ce,C),C}return Y instanceof Promise?Y.then(C=>(Ie(F,C),C)).catch(C=>(Ie(Ce,C),Promise.reject(C))):(Ie(F,Y),Y)};return I[Bo]=!0,I[en]=v,I},re=b.markRaw({actions:{},getters:{},state:[],hotState:m}),U={_p:r,$id:e,$onAction:Mo.bind(null,f),$patch:E,$reset:O,$subscribe(S,v={}){const I=Mo(l,S,v.detached,()=>R()),R=i.run(()=>b.watch(()=>r.state.value[e],F=>{(v.flush==="sync"?p:c)&&S({storeId:e,type:W.direct,events:d},F)},$({},a,v)));return I},$dispose:T},A=b.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te?$({_hmrPayload:re,_customProperties:b.markRaw(new Set)},U):U);r._s.set(e,A);const M=(r._a&&r._a.runWithContext||La)(()=>r._e.run(()=>(i=b.effectScope()).run(()=>t({action:L}))));for(const S in M){const v=M[S];if(b.isRef(v)&&!$o(v)||b.isReactive(v))process.env.NODE_ENV!=="production"&&o?m.value[S]=b.toRef(M,S):s||(h&&Ba(v)&&(b.isRef(v)?v.value=h[S]:tn(v,h[S])),r.state.value[e][S]=v),process.env.NODE_ENV!=="production"&&re.state.push(S);else if(typeof v=="function"){const I=process.env.NODE_ENV!=="production"&&o?v:L(v,S);M[S]=I,process.env.NODE_ENV!=="production"&&(re.actions[S]=v),u.actions[S]=v}else process.env.NODE_ENV!=="production"&&$o(v)&&(re.getters[S]=s?n.getters[S]:v,te&&(M._getters||(M._getters=b.markRaw([]))).push(S))}if($(A,M),$(b.toRaw(A),M),Object.defineProperty(A,"$state",{get:()=>process.env.NODE_ENV!=="production"&&o?m.value:r.state.value[e],set:S=>{if(process.env.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");E(v=>{$(v,S)})}}),process.env.NODE_ENV!=="production"&&(A._hotUpdate=b.markRaw(S=>{A._hotUpdating=!0,S._hmrPayload.state.forEach(v=>{if(v in A.$state){const I=S.$state[v],R=A.$state[v];typeof I=="object"&&le(I)&&le(R)?Vo(I,R):S.$state[v]=R}A[v]=b.toRef(S.$state,v)}),Object.keys(A.$state).forEach(v=>{v in S.$state||delete A[v]}),c=!1,p=!1,r.state.value[e]=b.toRef(S._hmrPayload,"hotState"),p=!0,b.nextTick().then(()=>{c=!0});for(const v in S._hmrPayload.actions){const I=S[v];A[v]=L(I,v)}for(const v in S._hmrPayload.getters){const I=S._hmrPayload.getters[v],R=s?b.computed(()=>(je(r),I.call(A,A))):I;A[v]=R}Object.keys(A._hmrPayload.getters).forEach(v=>{v in S._hmrPayload.getters||delete A[v]}),Object.keys(A._hmrPayload.actions).forEach(v=>{v in S._hmrPayload.actions||delete A[v]}),A._hmrPayload=S._hmrPayload,A._getters=S._getters,A._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te){const S={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(v=>{Object.defineProperty(A,v,$({value:A[v]},S))})}return r._p.forEach(S=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te){const v=i.run(()=>S({store:A,app:r._a,pinia:r,options:u}));Object.keys(v||{}).forEach(I=>A._customProperties.add(I)),$(A,v)}else $(A,i.run(()=>S({store:A,app:r._a,pinia:r,options:u})))}),process.env.NODE_ENV!=="production"&&A.$state&&typeof A.$state=="object"&&typeof A.$state.constructor=="function"&&!A.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
5
|
+
*/let X;const ne=r=>X=r,De=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function J(r){return r&&typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"&&typeof r.toJSON!="function"}var ee;(function(r){r.direct="direct",r.patchObject="patch object",r.patchFunction="patch function"})(ee||(ee={}));const te=typeof window<"u";function me(r,e){for(const t in e){const o=e[t];if(!(t in r))continue;const n=r[t];J(n)&&J(o)&&!a.isRef(o)&&!a.isReactive(o)?r[t]=me(n,o):r[t]=o}return r}const ve=()=>{};function Se(r,e,t,o=ve){r.push(e);const n=()=>{const s=r.indexOf(e);s>-1&&(r.splice(s,1),o())};return!t&&a.getCurrentScope()&&a.onScopeDispose(n),n}function Z(r,...e){r.slice().forEach(t=>{t(...e)})}const $e=r=>r(),be=Symbol(),ue=Symbol();function fe(r,e){r instanceof Map&&e instanceof Map?e.forEach((t,o)=>r.set(o,t)):r instanceof Set&&e instanceof Set&&e.forEach(r.add,r);for(const t in e){if(!e.hasOwnProperty(t))continue;const o=e[t],n=r[t];J(n)&&J(o)&&r.hasOwnProperty(t)&&!a.isRef(o)&&!a.isReactive(o)?r[t]=fe(n,o):r[t]=o}return r}const Ce=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Ae(r){return!J(r)||!Object.prototype.hasOwnProperty.call(r,Ce)}const{assign:U}=Object;function we(r){return!!(a.isRef(r)&&r.effect)}function Ee(r,e,t,o){const{state:n,actions:s,getters:i}=e,c=t.state.value[r];let l;function f(){!c&&(process.env.NODE_ENV==="production"||!o)&&(t.state.value[r]=n?n():{});const b=process.env.NODE_ENV!=="production"&&o?a.toRefs(a.ref(n?n():{}).value):a.toRefs(t.state.value[r]);return U(b,s,Object.keys(i||{}).reduce((E,N)=>(process.env.NODE_ENV!=="production"&&N in b&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${N}" in store "${r}".`),E[N]=a.markRaw(a.computed(()=>{ne(t);const D=t._s.get(r);return i[N].call(D,D)})),E),{}))}return l=de(r,f,e,t,o,!0),l}function de(r,e,t={},o,n,s){let i;const c=U({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const l={deep:!0};process.env.NODE_ENV!=="production"&&(l.onTrigger=u=>{f?D=u:f==!1&&!y._hotUpdating&&(Array.isArray(D)?D.push(u):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let f,b,E=[],N=[],D;const A=o.state.value[r];!s&&!A&&(process.env.NODE_ENV==="production"||!n)&&(o.state.value[r]={});const L=a.ref({});let P;function $(u){let d;f=b=!1,process.env.NODE_ENV!=="production"&&(D=[]),typeof u=="function"?(u(o.state.value[r]),d={type:ee.patchFunction,storeId:r,events:D}):(fe(o.state.value[r],u),d={type:ee.patchObject,payload:u,storeId:r,events:D});const R=P=Symbol();a.nextTick().then(()=>{P===R&&(f=!0)}),b=!0,Z(E,d,o.state.value[r])}const _=s?function(){const{state:d}=t,R=d?d():{};this.$patch(v=>{U(v,R)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${r}" is built using the setup syntax and does not implement $reset().`)}:ve;function w(){i.stop(),E=[],N=[],o._s.delete(r)}const V=(u,d="")=>{if(be in u)return u[ue]=d,u;const R=function(){ne(o);const v=Array.from(arguments),p=[],S=[];function I(F){p.push(F)}function k(F){S.push(F)}Z(N,{args:v,name:R[ue],store:y,after:I,onError:k});let j;try{j=u.apply(this&&this.$id===r?this:y,v)}catch(F){throw Z(S,F),F}return j instanceof Promise?j.then(F=>(Z(p,F),F)).catch(F=>(Z(S,F),Promise.reject(F))):(Z(p,j),j)};return R[be]=!0,R[ue]=d,R},O=a.markRaw({actions:{},getters:{},state:[],hotState:L}),T={_p:o,$id:r,$onAction:Se.bind(null,N),$patch:$,$reset:_,$subscribe(u,d={}){const R=Se(E,u,d.detached,()=>v()),v=i.run(()=>a.watch(()=>o.state.value[r],p=>{(d.flush==="sync"?b:f)&&u({storeId:r,type:ee.direct,events:D},p)},U({},l,d)));return R},$dispose:w},y=a.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te?U({_hmrPayload:O,_customProperties:a.markRaw(new Set)},T):T);o._s.set(r,y);const x=(o._a&&o._a.runWithContext||$e)(()=>o._e.run(()=>(i=a.effectScope()).run(()=>e({action:V}))));for(const u in x){const d=x[u];if(a.isRef(d)&&!we(d)||a.isReactive(d))process.env.NODE_ENV!=="production"&&n?L.value[u]=a.toRef(x,u):s||(A&&Ae(d)&&(a.isRef(d)?d.value=A[u]:fe(d,A[u])),o.state.value[r][u]=d),process.env.NODE_ENV!=="production"&&O.state.push(u);else if(typeof d=="function"){const R=process.env.NODE_ENV!=="production"&&n?d:V(d,u);x[u]=R,process.env.NODE_ENV!=="production"&&(O.actions[u]=d),c.actions[u]=d}else process.env.NODE_ENV!=="production"&&we(d)&&(O.getters[u]=s?t.getters[u]:d,te&&(x._getters||(x._getters=a.markRaw([]))).push(u))}if(U(y,x),U(a.toRaw(y),x),Object.defineProperty(y,"$state",{get:()=>process.env.NODE_ENV!=="production"&&n?L.value:o.state.value[r],set:u=>{if(process.env.NODE_ENV!=="production"&&n)throw new Error("cannot set hotState");$(d=>{U(d,u)})}}),process.env.NODE_ENV!=="production"&&(y._hotUpdate=a.markRaw(u=>{y._hotUpdating=!0,u._hmrPayload.state.forEach(d=>{if(d in y.$state){const R=u.$state[d],v=y.$state[d];typeof R=="object"&&J(R)&&J(v)?me(R,v):u.$state[d]=v}y[d]=a.toRef(u.$state,d)}),Object.keys(y.$state).forEach(d=>{d in u.$state||delete y[d]}),f=!1,b=!1,o.state.value[r]=a.toRef(u._hmrPayload,"hotState"),b=!0,a.nextTick().then(()=>{f=!0});for(const d in u._hmrPayload.actions){const R=u[d];y[d]=V(R,d)}for(const d in u._hmrPayload.getters){const R=u._hmrPayload.getters[d],v=s?a.computed(()=>(ne(o),R.call(y,y))):R;y[d]=v}Object.keys(y._hmrPayload.getters).forEach(d=>{d in u._hmrPayload.getters||delete y[d]}),Object.keys(y._hmrPayload.actions).forEach(d=>{d in u._hmrPayload.actions||delete y[d]}),y._hmrPayload=u._hmrPayload,y._getters=u._getters,y._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te){const u={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(d=>{Object.defineProperty(y,d,U({value:y[d]},u))})}return o._p.forEach(u=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&te){const d=i.run(()=>u({store:y,app:o._a,pinia:o,options:c}));Object.keys(d||{}).forEach(R=>y._customProperties.add(R)),U(y,d)}else U(y,i.run(()=>u({store:y,app:o._a,pinia:o,options:c})))}),process.env.NODE_ENV!=="production"&&y.$state&&typeof y.$state=="object"&&typeof y.$state.constructor=="function"&&!y.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
10
6
|
state: () => new MyClass()
|
|
11
|
-
Found in store "${
|
|
7
|
+
Found in store "${y.$id}".`),A&&s&&t.hydrate&&t.hydrate(y.$state,A),f=!0,b=!0,y}/*! #__NO_SIDE_EFFECTS__ */function Ve(r,e,t){let o;const n=typeof e=="function";o=n?t:e;function s(i,c){const l=a.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&X&&X._testing?null:i)||(l?a.inject(De,null):null),i&&ne(i),process.env.NODE_ENV!=="production"&&!X)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
12
8
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
13
|
-
This will fail in production.`);i=Fe,i._s.has(e)||(o?nn(e,t,r,i):Uo(e,r,i),process.env.NODE_ENV!=="production"&&(s._pinia=i));const c=i._s.get(e);if(process.env.NODE_ENV!=="production"&&u){const p="__hot:"+e,l=o?nn(p,t,r,i,!0):Uo(p,$({},r),i,!0);u._hotUpdate(l),delete i.state.value[p],i._s.delete(p)}if(process.env.NODE_ENV!=="production"&&te){const p=b.getCurrentInstance();if(p&&p.proxy&&!u){const l=p.proxy,f="_pStores"in l?l._pStores:l._pStores={};f[e]=c}}return c}return s.$id=e,s}const Ua=$a("data",()=>{const e=b.ref([]),t=b.ref({});return{records:e,record:t}});function Fa(e){const t=b.ref();return b.onMounted(async()=>{if(e||(e=b.inject("$registry")),!e||!e.router)return;let n;try{n=Ua()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}t.value=new ye(e,n);const r=e.router.currentRoute.value,o=r.params.records?.toString().toLowerCase(),s=r.params.record?.toString().toLowerCase();if(!o&&!s)return;const i=await e.getMeta?.(o);i&&(e.addDoctype(i),t.value.setup(i),o&&(s?await t.value.getRecord(i,s):await t.value.getRecords(i)),t.value.runAction(i,"load",s?[s]:void 0))}),{stonecrop:t}}class ja{doctype;schema;workflow;actions;component;constructor(t,n,r,o,s){this.doctype=t,this.schema=n,this.workflow=r,this.actions=o,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}}class ke{static _root;name;registry;router;constructor(t,n){if(ke._root)return ke._root;ke._root=this,this.name="Registry",this.registry={},this.router=t,this.getMeta=n}getMeta;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})}}function Ha(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var de=Promise.resolve();function Fo(e,t){return e||(e=0),new Promise(function(n){return setTimeout(function(){return n(t)},e)})}function za(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function rn(){return Math.random().toString(36).substring(2)}var on=0;function He(){var e=Date.now()*1e3;return e<=on&&(e=on+1),on=e,e}var Ka=He,Ga="native";function Wa(e){var t={time:He(),messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(n){t.messagesCallback&&t.messagesCallback(n.data)},t}function Ya(e){e.bc.close(),e.subFns=[]}function qa(e,t){try{return e.bc.postMessage(t,!1),de}catch(n){return Promise.reject(n)}}function Ja(e,t){e.messagesCallback=t}function Xa(){if(typeof globalThis<"u"&&globalThis.Deno&&globalThis.Deno.args)return!0;if((typeof window<"u"||typeof self<"u")&&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 Za(){return 150}var Qa={create:Wa,close:Ya,onMessage:Ja,postMessage:qa,canBeUsed:Xa,type:Ga,averageResponseTime:Za,microSeconds:Ka};class jo{ttl;map=new Map;_to=!1;constructor(t){this.ttl=t}has(t){return this.map.has(t)}add(t){this.map.set(t,Ho()),this._to||(this._to=!0,setTimeout(()=>{this._to=!1,ec(this)},0))}clear(){this.map.clear()}}function ec(e){const t=Ho()-e.ttl,n=e.map[Symbol.iterator]();for(;;){const r=n.next().value;if(!r)return;const o=r[0];if(r[1]<t)e.map.delete(o);else return}}function Ho(){return Date.now()}function sn(){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 tc=He,nc="pubkey.broadcast-channel-0-",X="messages",lt={durability:"relaxed"},rc="idb";function zo(){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 un(e){e.commit&&e.commit()}function oc(e){var t=zo(),n=nc+e,r=t.open(n);return r.onupgradeneeded=function(o){var s=o.target.result;s.createObjectStore(X,{keyPath:"id",autoIncrement:!0})},new Promise(function(o,s){r.onerror=function(i){return s(i)},r.onsuccess=function(){o(r.result)}})}function sc(e,t,n){var r=Date.now(),o={uuid:t,time:r,data:n},s=e.transaction([X],"readwrite",lt);return new Promise(function(i,u){s.oncomplete=function(){return i()},s.onerror=function(c){return u(c)};var a=s.objectStore(X);a.add(o),un(s)})}function ic(e,t){var n=e.transaction(X,"readonly",lt),r=n.objectStore(X),o=[],s=IDBKeyRange.bound(t+1,1/0);if(r.getAll){var i=r.getAll(s);return new Promise(function(a,c){i.onerror=function(p){return c(p)},i.onsuccess=function(p){a(p.target.result)}})}function u(){try{return s=IDBKeyRange.bound(t+1,1/0),r.openCursor(s)}catch{return r.openCursor()}}return new Promise(function(a,c){var p=u();p.onerror=function(l){return c(l)},p.onsuccess=function(l){var f=l.target.result;f?f.value.id<t+1?f.continue(t+1):(o.push(f.value),f.continue()):(un(n),a(o))}})}function uc(e,t){if(e.closed)return Promise.resolve([]);var n=e.db.transaction(X,"readwrite",lt),r=n.objectStore(X);return Promise.all(t.map(function(o){var s=r.delete(o);return new Promise(function(i){s.onsuccess=function(){return i()}})}))}function ac(e,t){var n=Date.now()-t,r=e.transaction(X,"readonly",lt),o=r.objectStore(X),s=[];return new Promise(function(i){o.openCursor().onsuccess=function(u){var a=u.target.result;if(a){var c=a.value;c.time<n?(s.push(c),a.continue()):(un(r),i(s))}else i(s)}})}function cc(e){return ac(e.db,e.options.idb.ttl).then(function(t){return uc(e,t.map(function(n){return n.id}))})}function lc(e,t){return t=sn(t),oc(e).then(function(n){var r={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:rn(),eMIs:new jo(t.idb.ttl*2),writeBlockPromise:de,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){r.closed=!0,t.idb.onclose&&t.idb.onclose()},Ko(r),r})}function Ko(e){e.closed||Go(e).then(function(){return Fo(e.options.idb.fallbackInterval)}).then(function(){return Ko(e)})}function fc(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function Go(e){return e.closed||!e.messagesCallback?de:ic(e.db,e.lastCursorId).then(function(t){var n=t.filter(function(r){return!!r}).map(function(r){return r.id>e.lastCursorId&&(e.lastCursorId=r.id),r}).filter(function(r){return fc(r,e)}).sort(function(r,o){return r.time-o.time});return n.forEach(function(r){e.messagesCallback&&(e.eMIs.add(r.id),e.messagesCallback(r.data))}),de})}function dc(e){e.closed=!0,e.db.close()}function hc(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return sc(e.db,e.uuid,t)}).then(function(){za(0,10)===0&&cc(e)}),e.writeBlockPromise}function pc(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,Go(e)}function _c(){return!!zo()}function gc(e){return e.idb.fallbackInterval*2}var mc={create:lc,close:dc,onMessage:pc,postMessage:hc,canBeUsed:_c,type:rc,averageResponseTime:gc,microSeconds:tc},Ec=He,yc="pubkey.broadcastChannel-",vc="localstorage";function Wo(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function Yo(e){return yc+e}function Sc(e,t){return new Promise(function(n){Fo().then(function(){var r=Yo(e.channelName),o={token:rn(),time:Date.now(),data:t,uuid:e.uuid},s=JSON.stringify(o);Wo().setItem(r,s);var i=document.createEvent("Event");i.initEvent("storage",!0,!0),i.key=r,i.newValue=s,window.dispatchEvent(i),n()})})}function bc(e,t){var n=Yo(e),r=function(s){s.key===n&&t(JSON.parse(s.newValue))};return window.addEventListener("storage",r),r}function Ac(e){window.removeEventListener("storage",e)}function wc(e,t){if(t=sn(t),!qo())throw new Error("BroadcastChannel: localstorage cannot be used");var n=rn(),r=new jo(t.localstorage.removeTimeout),o={channelName:e,uuid:n,eMIs:r};return o.listener=bc(e,function(s){o.messagesCallback&&s.uuid!==n&&(!s.token||r.has(s.token)||s.data.time&&s.data.time<o.messagesCallbackTime||(r.add(s.token),o.messagesCallback(s.data)))}),o}function Oc(e){Ac(e.listener)}function Tc(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t}function qo(){var e=Wo();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function Ic(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var kc={create:wc,close:Oc,onMessage:Tc,postMessage:Sc,canBeUsed:qo,type:vc,averageResponseTime:Ic,microSeconds:Ec},Jo=He,Cc="simulate",an=new Set;function Dc(e){var t={time:Jo(),name:e,messagesCallback:null};return an.add(t),t}function xc(e){an.delete(e)}var Xo=5;function Rc(e,t){return new Promise(function(n){return setTimeout(function(){var r=Array.from(an);r.forEach(function(o){o.name===e.name&&o!==e&&o.messagesCallback&&o.time<t.time&&o.messagesCallback(t)}),n()},Xo)})}function Pc(e,t){e.messagesCallback=t}function Nc(){return!0}function Vc(){return Xo}var Lc={create:Dc,close:xc,onMessage:Pc,postMessage:Rc,canBeUsed:Nc,type:Cc,averageResponseTime:Vc,microSeconds:Jo},Zo=[Qa,mc,kc];function Mc(e){var t=[].concat(e.methods,Zo).filter(Boolean);if(e.type){if(e.type==="simulate")return Lc;var n=t.find(function(o){return o.type===e.type});if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(o){return o.type!=="idb"}));var r=t.find(function(o){return o.canBeUsed()});if(r)return r;throw new Error("No usable method found in "+JSON.stringify(Zo.map(function(o){return o.type})))}var Qo=new Set,Bc=0,cn=function(t,n){this.id=Bc++,Qo.add(this),this.name=t,this.options=sn(n),this.method=Mc(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,$c(this)};cn._pubkey=!0,cn.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return es(this,"message",t)},postInternal:function(t){return es(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),n={time:t,fn:e};rs(this,"message",this._onML),e&&typeof e=="function"?(this._onML=n,ns(this,"message",n)):this._onML=null},addEventListener:function(t,n){var r=this.method.microSeconds(),o={time:r,fn:n};ns(this,t,o)},removeEventListener:function(t,n){var r=this._addEL[t].find(function(o){return o.fn===n});rs(this,t,r)},close:function(){var t=this;if(!this.closed){Qo.delete(this),this.closed=!0;var n=this._prepP?this._prepP:de;return this._onML=null,this._addEL.message=[],n.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(r){return r()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function es(e,t,n){var r=e.method.microSeconds(),o={time:r,type:t,data:n},s=e._prepP?e._prepP:de;return s.then(function(){var i=e.method.postMessage(e._state,o);return e._uMP.add(i),i.catch().then(function(){return e._uMP.delete(i)}),i})}function $c(e){var t=e.method.create(e.name,e.options);Ha(t)?(e._prepP=t,t.then(function(n){e._state=n})):e._state=t}function ts(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function ns(e,t,n){e._addEL[t].push(n),Uc(e)}function rs(e,t,n){e._addEL[t]=e._addEL[t].filter(function(r){return r!==n}),Fc(e)}function Uc(e){if(!e._iL&&ts(e)){var t=function(o){e._addEL[o.type].forEach(function(s){o.time>=s.time&&s.fn(o.data)})},n=e.method.microSeconds();e._prepP?e._prepP.then(function(){e._iL=!0,e.method.onMessage(e._state,t,n)}):(e._iL=!0,e.method.onMessage(e._state,t,n))}}function Fc(e){if(e._iL&&!ts(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}function os(e,t={serialize:JSON.stringify,deserialize:JSON.parse}){return t.deserialize(t.serialize(e))}function jc(e,t){return Object.keys(t).includes(e)}function Hc({enable:e=!0,initialize:t=!0,type:n,serializer:r}){return({store:o,options:s})=>{const i=s?.share?.enable??e,u=s?.share?.omit??[];if(!i)return;const a=new cn(o.$id,{type:n});let c=0,p=!1;const l=Object.keys(o.$state).filter(d=>!u.includes(d)&&jc(d,o.$state));a.onmessage=d=>{if(d===void 0){a.postMessage({timestamp:c,state:os(o.$state,r)});return}d.timestamp<=c||(p=!0,c=d.timestamp,o.$patch(h=>{l.forEach(m=>{h[m]=d.state[m]})}))},(s?.share?.initialize??t)&&a.postMessage(void 0),o.$subscribe((d,h)=>{p||(c=Date.now(),a.postMessage({timestamp:c,state:os(h,r)})),p=!1})}}const ss=Va();ss.use(Hc({enable:!0,initialize:!0}));const zc={install:(e,t)=>{const n=e.config.globalProperties.$router,r=n||t?.router,o=new ke(r,t?.getMeta);if(!n&&r&&e.use(r),e.use(ss),e.provide("$registry",o),t?.components)for(const[s,i]of Object.entries(t.components))e.component(s,i)}};j.DoctypeMeta=ja,j.Registry=ke,j.Stonecrop=zc,j.StonecropClass=ye,j.useStonecrop=Fa,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
|
|
9
|
+
This will fail in production.`);i=X,i._s.has(r)||(n?de(r,e,o,i):Ee(r,o,i),process.env.NODE_ENV!=="production"&&(s._pinia=i));const f=i._s.get(r);if(process.env.NODE_ENV!=="production"&&c){const b="__hot:"+r,E=n?de(b,e,o,i,!0):Ee(b,U({},o),i,!0);c._hotUpdate(E),delete i.state.value[b],i._s.delete(b)}if(process.env.NODE_ENV!=="production"&&te){const b=a.getCurrentInstance();if(b&&b.proxy&&!c){const E=b.proxy,N="_pStores"in E?E._pStores:E._pStores={};N[r]=f}}return f}return s.$id=r,s}function Oe(r){const e=a.toRaw(r),t={};for(const o in e){const n=e[o];n.effect?t[o]=a.computed({get:()=>r[o],set(s){r[o]=s}}):(a.isRef(n)||a.isReactive(n))&&(t[o]=a.toRef(r,o))}return t}function ke(r,e){return a.getCurrentScope()?(a.onScopeDispose(r,e),!0):!1}const Fe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Me=Object.prototype.toString,Le=r=>Me.call(r)==="[object Object]",Re=()=>{};function xe(...r){if(r.length!==1)return a.toRef(...r);const e=r[0];return typeof e=="function"?a.readonly(a.customRef(()=>({get:e,set:Re}))):a.ref(e)}function Be(r,e){function t(...o){return new Promise((n,s)=>{Promise.resolve(r(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(n).catch(s)})}return t}const _e=r=>r();function je(r=_e,e={}){const{initialState:t="active"}=e,o=xe(t==="active");function n(){o.value=!1}function s(){o.value=!0}const i=(...c)=>{o.value&&r(...c)};return{isActive:a.readonly(o),pause:n,resume:s,eventFilter:i}}function pe(r){return Array.isArray(r)?r:[r]}function Ue(r){return a.getCurrentInstance()}function We(r,e,t={}){const{eventFilter:o=_e,...n}=t;return a.watch(r,Be(o,e),n)}function ze(r,e,t={}){const{eventFilter:o,initialState:n="active",...s}=t,{eventFilter:i,pause:c,resume:l,isActive:f}=je(o,{initialState:n});return{stop:We(r,e,{...s,eventFilter:i}),pause:c,resume:l,isActive:f}}const He=ze;function Je(r,e=!0,t){Ue()?a.onMounted(r,t):e?r():a.nextTick(r)}function Ge(r,e,t){return a.watch(r,e,{...t,immediate:!0})}function re(r,e,t){return a.watch(r,(n,s,i)=>{n&&e(n,s,i)},{...t,once:!1})}const G=Fe?window:void 0;function Ke(r){var e;const t=a.toValue(r);return(e=t?.$el)!==null&&e!==void 0?e:t}function q(...r){const e=[],t=()=>{e.forEach(c=>c()),e.length=0},o=(c,l,f,b)=>(c.addEventListener(l,f,b),()=>c.removeEventListener(l,f,b)),n=a.computed(()=>{const c=pe(a.toValue(r[0])).filter(l=>l!=null);return c.every(l=>typeof l!="string")?c:void 0}),s=Ge(()=>{var c,l;return[(c=(l=n.value)===null||l===void 0?void 0:l.map(f=>Ke(f)))!==null&&c!==void 0?c:[G].filter(f=>f!=null),pe(a.toValue(n.value?r[1]:r[0])),pe(a.unref(n.value?r[2]:r[1])),a.toValue(n.value?r[3]:r[2])]},([c,l,f,b])=>{if(t(),!c?.length||!l?.length||!f?.length)return;const E=Le(b)?{...b}:b;e.push(...c.flatMap(N=>l.flatMap(D=>f.map(A=>o(N,D,A,E)))))},{flush:"post"}),i=()=>{s(),t()};return ke(t),i}const se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ie="__vueuse_ssr_handlers__",Ze=qe();function qe(){return ie in se||(se[ie]=se[ie]||{}),se[ie]}function Ye(r,e){return Ze[r]||e}function Qe(r){return r==null?"any":r instanceof Set?"set":r instanceof Map?"map":r instanceof Date?"date":typeof r=="boolean"?"boolean":typeof r=="string"?"string":typeof r=="object"?"object":Number.isNaN(r)?"any":"number"}const Xe={boolean:{read:r=>r==="true",write:r=>String(r)},object:{read:r=>JSON.parse(r),write:r=>JSON.stringify(r)},number:{read:r=>Number.parseFloat(r),write:r=>String(r)},any:{read:r=>r,write:r=>String(r)},string:{read:r=>r,write:r=>String(r)},map:{read:r=>new Map(JSON.parse(r)),write:r=>JSON.stringify(Array.from(r.entries()))},set:{read:r=>new Set(JSON.parse(r)),write:r=>JSON.stringify(Array.from(r))},date:{read:r=>new Date(r),write:r=>r.toISOString()}},Pe="vueuse-storage";function et(r,e,t,o={}){var n;const{flush:s="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:l=!0,mergeDefaults:f=!1,shallow:b,window:E=G,eventFilter:N,onError:D=p=>{console.error(p)},initOnMounted:A}=o,L=(b?a.shallowRef:a.ref)(e),P=a.computed(()=>a.toValue(r));if(!t)try{t=Ye("getDefaultStorage",()=>G?.localStorage)()}catch(p){D(p)}if(!t)return L;const $=a.toValue(e),_=Qe($),w=(n=o.serializer)!==null&&n!==void 0?n:Xe[_],{pause:V,resume:O}=He(L,p=>u(p),{flush:s,deep:i,eventFilter:N});a.watch(P,()=>R(),{flush:s});let T=!1;const y=p=>{A&&!T||R(p)},B=p=>{A&&!T||v(p)};E&&c&&(t instanceof Storage?q(E,"storage",y,{passive:!0}):q(E,Pe,B)),A?Je(()=>{T=!0,R()}):R();function x(p,S){if(E){const I={key:P.value,oldValue:p,newValue:S,storageArea:t};E.dispatchEvent(t instanceof Storage?new StorageEvent("storage",I):new CustomEvent(Pe,{detail:I}))}}function u(p){try{const S=t.getItem(P.value);if(p==null)x(S,null),t.removeItem(P.value);else{const I=w.write(p);S!==I&&(t.setItem(P.value,I),x(S,I))}}catch(S){D(S)}}function d(p){const S=p?p.newValue:t.getItem(P.value);if(S==null)return l&&$!=null&&t.setItem(P.value,w.write($)),$;if(!p&&f){const I=w.read(S);return typeof f=="function"?f(I,$):_==="object"&&!Array.isArray(I)?{...$,...I}:I}else return typeof S!="string"?S:w.read(S)}function R(p){if(!(p&&p.storageArea!==t)){if(p&&p.key==null){L.value=$;return}if(!(p&&p.key!==P.value)){V();try{const S=w.write(L.value);(p===void 0||p?.newValue!==S)&&(L.value=d(p))}catch(S){D(S)}finally{p?a.nextTick(O):O()}}}}function v(p){R(p.detail)}return L}function tt(r,e,t={}){const{window:o=G}=t;return et(r,e,o?.localStorage,t)}const rt={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function ot(r={}){const{reactive:e=!1,target:t=G,aliasMap:o=rt,passive:n=!0,onEventFired:s=Re}=r,i=a.reactive(new Set),c={toJSON(){return{}},current:i},l=e?a.reactive(c):c,f=new Set,b=new Map([["Meta",f],["Shift",new Set],["Alt",new Set]]),E=new Set;function N(_,w){_ in l&&(e?l[_]=w:l[_].value=w)}function D(){i.clear();for(const _ of E)N(_,!1)}function A(_,w,V){if(!(!_||typeof w.getModifierState!="function")){for(const[O,T]of b)if(w.getModifierState(O)){V.forEach(y=>T.add(y));break}}}function L(_,w){if(_)return;const V=`${w[0].toUpperCase()}${w.slice(1)}`,O=b.get(V);if(!["shift","alt"].includes(w)||!O)return;const T=Array.from(O),y=T.indexOf(w);T.forEach((B,x)=>{x>=y&&(i.delete(B),N(B,!1))}),O.clear()}function P(_,w){var V,O;const T=(V=_.key)===null||V===void 0?void 0:V.toLowerCase(),y=[(O=_.code)===null||O===void 0?void 0:O.toLowerCase(),T].filter(Boolean);T&&(w?i.add(T):i.delete(T));for(const B of y)E.add(B),N(B,w);A(w,_,[...i,...y]),L(w,T),T==="meta"&&!w&&(f.forEach(B=>{i.delete(B),N(B,!1)}),f.clear())}q(t,"keydown",_=>(P(_,!0),s(_)),{passive:n}),q(t,"keyup",_=>(P(_,!1),s(_)),{passive:n}),q("blur",D,{passive:n}),q("focus",D,{passive:n});const $=new Proxy(l,{get(_,w,V){if(typeof w!="string")return Reflect.get(_,w,V);if(w=w.toLowerCase(),w in o&&(w=o[w]),!(w in l))if(/[+_-]/.test(w)){const T=w.split(/[+_-]/g).map(y=>y.trim());l[w]=a.computed(()=>T.map(y=>a.toValue($[y])).every(Boolean))}else l[w]=a.shallowRef(!1);const O=Reflect.get(_,w,V);return e?a.toValue(O):O}});return $}function he(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ae(r){const e={type:r.type,clientId:r.clientId,timestamp:r.timestamp.toISOString()};return r.operation&&(e.operation={...r.operation,timestamp:r.operation.timestamp.toISOString()}),r.operations&&(e.operations=r.operations.map(t=>({...t,timestamp:t.timestamp.toISOString()}))),e}function nt(r){const e={type:r.type,clientId:r.clientId,timestamp:new Date(r.timestamp)};return r.operation&&(e.operation={...r.operation,timestamp:new Date(r.operation.timestamp)}),r.operations&&(e.operations=r.operations.map(t=>({...t,timestamp:new Date(t.timestamp)}))),e}const Y=Ve("hst-operation-log",()=>{const r=a.ref({maxOperations:100,enableCrossTabSync:!0,autoSyncInterval:3e4,enablePersistence:!1,persistenceKeyPrefix:"stonecrop-ops"}),e=a.ref([]),t=a.ref(-1),o=a.ref(he()),n=a.ref(!1),s=a.ref([]),i=a.ref(null),c=a.computed(()=>t.value<0?!1:e.value[t.value]?.reversible??!1),l=a.computed(()=>t.value<e.value.length-1),f=a.computed(()=>{let h=0;for(let g=t.value;g>=0&&e.value[g]?.reversible;g--)h++;return h}),b=a.computed(()=>e.value.length-1-t.value),E=a.computed(()=>({canUndo:c.value,canRedo:l.value,undoCount:f.value,redoCount:b.value,currentIndex:t.value}));function N(h){r.value={...r.value,...h},r.value.enablePersistence&&(k(),F()),r.value.enableCrossTabSync&&d()}function D(h,g="user"){const m={...h,id:he(),timestamp:new Date,source:g,userId:r.value.userId};if(r.value.operationFilter&&!r.value.operationFilter(m))return m.id;if(n.value)return s.value.push(m),m.id;if(t.value<e.value.length-1&&(e.value=e.value.slice(0,t.value+1)),e.value.push(m),t.value++,r.value.maxOperations&&e.value.length>r.value.maxOperations){const M=e.value.length-r.value.maxOperations;e.value=e.value.slice(M),t.value-=M}return r.value.enableCrossTabSync&&R(m),m.id}function A(){n.value=!0,s.value=[],i.value=he()}function L(h){if(!n.value||s.value.length===0)return n.value=!1,s.value=[],i.value=null,null;const g=i.value,m=s.value.every(W=>W.reversible),M={id:g,type:"batch",path:"",fieldname:"",beforeValue:null,afterValue:null,doctype:s.value[0]?.doctype||"",timestamp:new Date,source:"user",reversible:m,irreversibleReason:m?void 0:"Contains irreversible operations",childOperationIds:s.value.map(W=>W.id),metadata:{description:h}};s.value.forEach(W=>{W.parentOperationId=g}),e.value.push(...s.value,M),t.value=e.value.length-1,r.value.enableCrossTabSync&&v(s.value,M);const z=g;return n.value=!1,s.value=[],i.value=null,z}function P(){n.value=!1,s.value=[],i.value=null}function $(h){if(!c.value)return!1;const g=e.value[t.value];if(!g.reversible)return typeof console<"u"&&g.irreversibleReason&&console.warn("Cannot undo irreversible operation:",g.irreversibleReason),!1;try{if(g.type==="batch"&&g.childOperationIds)for(let m=g.childOperationIds.length-1;m>=0;m--){const M=g.childOperationIds[m],z=e.value.find(W=>W.id===M);z&&w(z,h)}else w(g,h);return t.value--,r.value.enableCrossTabSync&&p(g),!0}catch(m){return typeof console<"u"&&console.error("Undo failed:",m),!1}}function _(h){if(!l.value)return!1;const g=e.value[t.value+1];try{if(g.type==="batch"&&g.childOperationIds)for(const m of g.childOperationIds){const M=e.value.find(z=>z.id===m);M&&V(M,h)}else V(g,h);return t.value++,r.value.enableCrossTabSync&&S(g),!0}catch(m){return typeof console<"u"&&console.error("Redo failed:",m),!1}}function w(h,g){(h.type==="set"||h.type==="delete")&&g&&typeof g.set=="function"&&g.set(h.path,h.beforeValue,"undo")}function V(h,g){(h.type==="set"||h.type==="delete")&&g&&typeof g.set=="function"&&g.set(h.path,h.afterValue,"redo")}function O(){const h=e.value.filter(m=>m.reversible).length,g=e.value.map(m=>m.timestamp);return{operations:[...e.value],currentIndex:t.value,totalOperations:e.value.length,reversibleOperations:h,irreversibleOperations:e.value.length-h,oldestOperation:g.length>0?new Date(Math.min(...g.map(m=>m.getTime()))):void 0,newestOperation:g.length>0?new Date(Math.max(...g.map(m=>m.getTime()))):void 0}}function T(){e.value=[],t.value=-1}function y(h,g){return e.value.filter(m=>m.doctype===h&&(g===void 0||m.recordId===g))}function B(h,g){const m=e.value.find(M=>M.id===h);m&&(m.reversible=!1,m.irreversibleReason=g)}function x(h,g,m,M="success",z){const W={type:"action",path:m&&m.length>0?`${h}.${m[0]}`:h,fieldname:"",beforeValue:null,afterValue:null,doctype:h,recordId:m&&m.length>0?m[0]:void 0,reversible:!1,actionName:g,actionRecordIds:m,actionResult:M,actionError:z};return D(W)}let u=null;function d(){typeof window>"u"||!window.BroadcastChannel||(u=new BroadcastChannel("stonecrop-operation-log"),u.addEventListener("message",h=>{const g=h.data;if(!g||typeof g!="object")return;const m=nt(g);m.clientId!==o.value&&(m.type==="operation"&&m.operation?(e.value.push({...m.operation,source:"sync"}),t.value=e.value.length-1):m.type==="operation"&&m.operations&&(e.value.push(...m.operations.map(M=>({...M,source:"sync"}))),t.value=e.value.length-1))}))}function R(h){if(!u)return;const g={type:"operation",operation:h,clientId:o.value,timestamp:new Date};u.postMessage(ae(g))}function v(h,g){if(!u)return;const m={type:"operation",operations:[...h,g],clientId:o.value,timestamp:new Date};u.postMessage(ae(m))}function p(h){if(!u)return;const g={type:"undo",operation:h,clientId:o.value,timestamp:new Date};u.postMessage(ae(g))}function S(h){if(!u)return;const g={type:"redo",operation:h,clientId:o.value,timestamp:new Date};u.postMessage(ae(g))}const I=tt("stonecrop-ops-operations",null,{serializer:{read:h=>{try{return JSON.parse(h)}catch{return null}},write:h=>h?JSON.stringify(h):""}});function k(){if(!(typeof window>"u"))try{const h=I.value;h&&Array.isArray(h.operations)&&(e.value=h.operations.map(g=>({...g,timestamp:new Date(g.timestamp)})),t.value=h.currentIndex??-1)}catch(h){typeof console<"u"&&console.error("Failed to load operations from persistence:",h)}}function j(){if(!(typeof window>"u"))try{I.value={operations:e.value.map(h=>({...h,timestamp:h.timestamp.toISOString()})),currentIndex:t.value}}catch(h){typeof console<"u"&&console.error("Failed to save operations to persistence:",h)}}function F(){a.watch([e,t],()=>{r.value.enablePersistence&&j()},{deep:!0})}return{operations:e,currentIndex:t,config:r,clientId:o,undoRedoState:E,canUndo:c,canRedo:l,undoCount:f,redoCount:b,configure:N,addOperation:D,startBatch:A,commitBatch:L,cancelBatch:P,undo:$,redo:_,clear:T,getOperationsFor:y,getSnapshot:O,markIrreversible:B,logAction:x}});class oe{static _root;options;doctypeActions=new Map;doctypeTransitions=new Map;fieldRollbackConfig=new Map;globalActions=new Map;globalTransitionActions=new Map;constructor(e={}){if(oe._root)return oe._root;oe._root=this,this.options={defaultTimeout:e.defaultTimeout??5e3,debug:e.debug??!1,enableRollback:e.enableRollback??!0,errorHandler:e.errorHandler}}registerAction(e,t){this.globalActions.set(e,t)}registerTransitionAction(e,t){this.globalTransitionActions.set(e,t)}setFieldRollback(e,t,o){this.fieldRollbackConfig.has(e)||this.fieldRollbackConfig.set(e,new Map),this.fieldRollbackConfig.get(e).set(t,o)}getFieldRollback(e,t){return this.fieldRollbackConfig.get(e)?.get(t)}registerDoctypeActions(e,t){if(!t)return;const o=new Map,n=new Map;if(typeof t.entrySeq=="function")t.entrySeq().forEach(([s,i])=>{this.categorizeAction(s,i,o,n)});else if(t instanceof Map)for(const[s,i]of t)this.categorizeAction(s,i,o,n);else t&&typeof t=="object"&&Object.entries(t).forEach(([s,i])=>{this.categorizeAction(s,i,o,n)});this.doctypeActions.set(e,o),this.doctypeTransitions.set(e,n)}categorizeAction(e,t,o,n){this.isTransitionKey(e)?n.set(e,t):o.set(e,t)}isTransitionKey(e){return/^[A-Z0-9_]+$/.test(e)&&e.length>0}async executeFieldTriggers(e,t={}){const{doctype:o,fieldname:n}=e,s=this.findFieldTriggers(o,n);if(s.length===0)return{path:e.path,actionResults:[],totalExecutionTime:0,allSucceeded:!0,stoppedOnError:!1,rolledBack:!1};const i=performance.now(),c=[];let l=!1,f=!1,b;const E=this.getFieldRollback(o,n),N=t.enableRollback??E??this.options.enableRollback;N&&e.store&&(b=this.captureSnapshot(e));for(const P of s)try{const $=await this.executeAction(P,e,t.timeout);if(c.push($),!$.success){l=!0;break}}catch($){const w={success:!1,error:$ instanceof Error?$:new Error(String($)),executionTime:0,action:P};c.push(w),l=!0;break}if(N&&l&&b&&e.store)try{this.restoreSnapshot(e,b),f=!0}catch(P){console.error("[FieldTriggers] Rollback failed:",P)}const D=performance.now()-i,A=c.filter(P=>!P.success);if(A.length>0&&this.options.errorHandler)for(const P of A)try{this.options.errorHandler(P.error,e,P.action)}catch($){console.error("[FieldTriggers] Error in global error handler:",$)}return{path:e.path,actionResults:c,totalExecutionTime:D,allSucceeded:c.every(P=>P.success),stoppedOnError:l,rolledBack:f,snapshot:this.options.debug&&N?b:void 0}}async executeTransitionActions(e,t={}){const{doctype:o,transition:n}=e,s=this.findTransitionActions(o,n);if(s.length===0)return[];const i=[];for(const l of s)try{const f=await this.executeTransitionAction(l,e,t.timeout);if(i.push(f),!f.success)break}catch(f){const E={success:!1,error:f instanceof Error?f:new Error(String(f)),executionTime:0,action:l,transition:n};i.push(E);break}const c=i.filter(l=>!l.success);if(c.length>0&&this.options.errorHandler)for(const l of c)try{this.options.errorHandler(l.error,e,l.action)}catch(f){console.error("[FieldTriggers] Error in global error handler:",f)}return i}findTransitionActions(e,t){const o=this.doctypeTransitions.get(e);return o?o.get(t)||[]:[]}async executeTransitionAction(e,t,o){const n=performance.now(),s=o??this.options.defaultTimeout;try{let i=this.globalTransitionActions.get(e);if(!i){const l=this.globalActions.get(e);l&&(i=l)}if(!i)throw new Error(`Transition action "${e}" not found in registry`);return await this.executeWithTimeout(i,t,s),{success:!0,executionTime:performance.now()-n,action:e,transition:t.transition}}catch(i){const c=performance.now()-n;return{success:!1,error:i instanceof Error?i:new Error(String(i)),executionTime:c,action:e,transition:t.transition}}}findFieldTriggers(e,t){const o=this.doctypeActions.get(e);if(!o)return[];const n=[];for(const[s,i]of o)this.isFieldTriggerKey(s,t)&&n.push(...i);return n}isFieldTriggerKey(e,t){return e===t?!0:e.includes(".")?this.matchFieldPattern(e,t):e.includes("*")?this.matchFieldPattern(e,t):!1}matchFieldPattern(e,t){const o=e.split("."),n=t.split(".");if(o.length!==n.length)return!1;for(let s=0;s<o.length;s++){const i=o[s],c=n[s];if(i!=="*"&&i!==c)return!1}return!0}async executeAction(e,t,o){const n=performance.now(),s=o??this.options.defaultTimeout;try{const i=this.globalActions.get(e);if(!i)throw new Error(`Action "${e}" not found in registry`);return await this.executeWithTimeout(i,t,s),{success:!0,executionTime:performance.now()-n,action:e}}catch(i){const c=performance.now()-n;return{success:!1,error:i instanceof Error?i:new Error(String(i)),executionTime:c,action:e}}}async executeWithTimeout(e,t,o){return new Promise((n,s)=>{const i=setTimeout(()=>{s(new Error(`Action timeout after ${o}ms`))},o);Promise.resolve(e(t)).then(c=>{clearTimeout(i),n(c)}).catch(c=>{clearTimeout(i),s(c)})})}captureSnapshot(e){if(!(!e.store||!e.doctype||!e.recordId))try{const t=`${e.doctype}.${e.recordId}`,o=e.store.get(t);return!o||typeof o!="object"?void 0:JSON.parse(JSON.stringify(o))}catch(t){this.options.debug&&console.warn("[FieldTriggers] Failed to capture snapshot:",t);return}}restoreSnapshot(e,t){if(!(!e.store||!e.doctype||!e.recordId||!t))try{const o=`${e.doctype}.${e.recordId}`;e.store.set(o,t),this.options.debug&&console.log(`[FieldTriggers] Rolled back ${o} to previous state`)}catch(o){throw console.error("[FieldTriggers] Failed to restore snapshot:",o),o}}}function H(r){return new oe(r)}function st(r,e){H().registerAction(r,e)}function it(r,e){H().registerTransitionAction(r,e)}function at(r,e,t){H().setFieldRollback(r,e,t)}async function ct(r,e,t){const o=H(),n={path:t?.path||(t?.recordId?`${r}.${t.recordId}`:r),fieldname:"",beforeValue:void 0,afterValue:void 0,operation:"set",doctype:r,recordId:t?.recordId,timestamp:new Date,transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext};return await o.executeTransitionActions(n)}function lt(r,e){if(r)try{Y().markIrreversible(r,e)}catch{}}function Ne(){try{return Y()}catch{return null}}class K{static instance;static getInstance(){return K.instance||(K.instance=new K),K.instance}getRegistry(){if(typeof globalThis<"u"){const e=globalThis.Registry?._root;if(e)return e}if(typeof window<"u"){const e=window.Registry?._root;if(e)return e}if(typeof global<"u"&&global){const e=global.Registry?._root;if(e)return e}}getDoctypeMeta(e){const t=this.getRegistry();if(t&&typeof t=="object"&&"registry"in t)return t.registry[e]}}class ce{target;parentPath;rootNode;doctype;parentDoctype;hst;constructor(e,t,o="",n=null,s){return this.target=e,this.parentPath=o,this.rootNode=n||this,this.doctype=t,this.parentDoctype=s,this.hst=K.getInstance(),new Proxy(this,{get(i,c){if(c in i)return i[c];const l=String(c);return i.getNode(l)},set(i,c,l){const f=String(c);return i.set(f,l),!0}})}get(e){return this.resolveValue(e)}getNode(e){const t=this.resolvePath(e),o=this.resolveValue(e),n=t.split(".");let s=this.doctype;return this.doctype==="StonecropStore"&&n.length>=1&&(s=n[0]),typeof o=="object"&&o!==null&&!this.isPrimitive(o)?new ce(o,s,t,this.rootNode,this.parentDoctype):new ce(o,s,t,this.rootNode,this.parentDoctype)}set(e,t,o="user"){const n=this.resolvePath(e),s=this.has(e)?this.get(e):void 0;if(o!=="undo"&&o!=="redo"){const i=Ne();if(i&&typeof i.addOperation=="function"){const c=n.split("."),l=this.doctype==="StonecropStore"&&c.length>=1?c[0]:this.doctype,f=c.length>=2?c[1]:void 0,b=c.slice(2).join(".")||c[c.length-1],N=t===void 0&&s!==void 0?"delete":"set";i.addOperation({type:N,path:n,fieldname:b,beforeValue:s,afterValue:t,doctype:l,recordId:f,reversible:!0},o)}}this.updateValue(e,t),this.triggerFieldActions(n,s,t)}has(e){try{if(e==="")return!0;const t=this.parsePath(e);let o=this.target;for(let n=0;n<t.length;n++){const s=t[n];if(o==null)return!1;if(n===t.length-1)return this.isImmutable(o)?o.has(s):this.isPiniaStore(o)&&o.$state&&s in o.$state||s in o;o=this.getProperty(o,s)}return!1}catch{return!1}}getParent(){if(!this.parentPath)return null;const t=this.parentPath.split(".").slice(0,-1).join(".");return t===""?this.rootNode:this.rootNode.getNode(t)}getRoot(){return this.rootNode}getPath(){return this.parentPath}getDepth(){return this.parentPath?this.parentPath.split(".").length:0}getBreadcrumbs(){return this.parentPath?this.parentPath.split("."):[]}async triggerTransition(e,t){const o=H(),n=this.parentPath.split(".");let s=this.doctype,i;this.doctype==="StonecropStore"&&n.length>=1&&(s=n[0]),n.length>=2&&(i=n[1]);const c={path:this.parentPath,fieldname:"",beforeValue:void 0,afterValue:void 0,operation:"set",doctype:s,recordId:i,timestamp:new Date,store:this.rootNode||void 0,transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext},l=Ne();return l&&typeof l.addOperation=="function"&&l.addOperation({type:"transition",path:this.parentPath,fieldname:e,beforeValue:t?.currentState,afterValue:t?.targetState,doctype:s,recordId:i,reversible:!1,metadata:{transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext}},"user"),await o.executeTransitionActions(c)}resolvePath(e){return e===""?this.parentPath:this.parentPath?`${this.parentPath}.${e}`:e}resolveValue(e){if(e==="")return this.target;const t=this.parsePath(e);let o=this.target;for(const n of t){if(o==null)return;o=this.getProperty(o,n)}return o}updateValue(e,t){if(e==="")throw new Error("Cannot set value on empty path");const o=this.parsePath(e),n=o.pop();let s=this.target;for(const i of o)if(s=this.getProperty(s,i),s==null)throw new Error(`Cannot set property on null/undefined path: ${e}`);this.setProperty(s,n,t)}getProperty(e,t){return this.isImmutable(e)?e.get(t):this.isVueReactive(e)?e[t]:this.isPiniaStore(e)?e.$state?.[t]??e[t]:e[t]}setProperty(e,t,o){if(this.isImmutable(e))throw new Error("Cannot directly mutate immutable objects. Use immutable update methods instead.");if(this.isPiniaStore(e)){e.$patch?e.$patch({[t]:o}):e[t]=o;return}e[t]=o}async triggerFieldActions(e,t,o){try{if(!e||typeof e!="string")return;const n=e.split(".");if(n.length<3)return;const s=H(),i=n.slice(2).join(".")||n[n.length-1];let c=this.doctype;this.doctype==="StonecropStore"&&n.length>=1&&(c=n[0]);let l;n.length>=2&&(l=n[1]);const f={path:e,fieldname:i,beforeValue:t,afterValue:o,operation:"set",doctype:c,recordId:l,timestamp:new Date,store:this.rootNode||void 0};await s.executeFieldTriggers(f)}catch(n){n instanceof Error&&console.warn("Field trigger error:",n.message)}}isVueReactive(e){return e&&typeof e=="object"&&"__v_isReactive"in e&&e.__v_isReactive===!0}isPiniaStore(e){return e&&typeof e=="object"&&("$state"in e||"$patch"in e||"$id"in e)}isImmutable(e){if(!e||typeof e!="object")return!1;const t="get"in e&&typeof e.get=="function",o="set"in e&&typeof e.set=="function",n="has"in e&&typeof e.has=="function",s="__ownerID"in e||"_map"in e||"_list"in e||"_origin"in e||"_capacity"in e||"_defaultValues"in e||"_tail"in e||"_root"in e||"size"in e&&t&&o;let i;try{const l=e;if("constructor"in l&&l.constructor&&typeof l.constructor=="object"&&"name"in l.constructor){const f=l.constructor.name;i=typeof f=="string"?f:void 0}}catch{i=void 0}const c=i&&(i.includes("Map")||i.includes("List")||i.includes("Set")||i.includes("Stack")||i.includes("Seq"))&&(t||o);return!!(t&&o&&n&&s||t&&o&&c)}isPrimitive(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="function"||typeof e=="symbol"||typeof e=="bigint"}parsePath(e){return e?e.split(".").filter(t=>t.length>0):[]}}function Ie(r,e,t){return new ce(r,e,"",null,t)}class ge{hstStore;_operationLogStore;_operationLogConfig;registry;constructor(e,t){this.registry=e,this._operationLogConfig=t,this.initializeHSTStore(),this.setupRegistrySync()}getOperationLogStore(){return this._operationLogStore||(this._operationLogStore=Y(),this._operationLogConfig&&this._operationLogStore.configure(this._operationLogConfig)),this._operationLogStore}initializeHSTStore(){const e={};Object.keys(this.registry.registry).forEach(t=>{e[t]={}}),this.hstStore=Ie(e,"StonecropStore")}setupRegistrySync(){const e=this.registry.addDoctype.bind(this.registry);this.registry.addDoctype=t=>{e(t),this.hstStore.has(t.slug)||this.hstStore.set(t.slug,{})}}records(e){const t=typeof e=="string"?e:e.slug;return this.ensureDoctypeExists(t),this.hstStore.getNode(t)}addRecord(e,t,o){const n=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(n),this.hstStore.set(`${n}.${t}`,o)}getRecordById(e,t){const o=typeof e=="string"?e:e.slug;if(this.ensureDoctypeExists(o),!(!this.hstStore.has(`${o}.${t}`)||this.hstStore.get(`${o}.${t}`)===void 0))return this.hstStore.getNode(`${o}.${t}`)}removeRecord(e,t){const o=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(o),this.hstStore.has(`${o}.${t}`)&&this.hstStore.set(`${o}.${t}`,void 0)}getRecordIds(e){const t=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(t);const o=this.hstStore.get(t);return!o||typeof o!="object"?[]:Object.keys(o).filter(n=>o[n]!==void 0)}clearRecords(e){const t=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(t),this.getRecordIds(t).forEach(n=>{this.hstStore.set(`${t}.${n}`,void 0)})}setup(e){this.ensureDoctypeExists(e.slug)}runAction(e,t,o){const s=this.registry.registry[e.slug]?.actions?.get(t),i=Array.isArray(o)?o.filter(b=>typeof b=="string"):void 0,c=this.getOperationLogStore();let l="success",f;try{s&&s.length>0&&s.forEach(b=>{try{new Function("args",b)(o)}catch(E){throw l="failure",f=E instanceof Error?E.message:"Unknown error",E}})}catch{}finally{c.logAction(e.doctype,t,i,l,f)}}async getRecords(e){(await(await fetch(`/${e.slug}`)).json()).forEach(n=>{n.id&&this.addRecord(e,n.id,n)})}async getRecord(e,t){const n=await(await fetch(`/${e.slug}/${t}`)).json();this.addRecord(e,t,n)}ensureDoctypeExists(e){this.hstStore.has(e)||this.hstStore.set(e,{})}async getMeta(e){if(!this.registry.getMeta)throw new Error("No getMeta function provided to Registry");return await this.registry.getMeta(e)}getStore(){return this.hstStore}}function ut(r){r||(r={});const e=r.registry||a.inject("$registry"),t=a.inject("$stonecrop"),o=a.ref(),n=a.ref(),s=a.ref({}),i=a.ref(),c=a.ref(),l=a.ref([]),f=a.ref(-1),b=a.computed(()=>o.value?.getOperationLogStore().canUndo??!1),E=a.computed(()=>o.value?.getOperationLogStore().canRedo??!1),N=a.computed(()=>o.value?.getOperationLogStore().undoCount??0),D=a.computed(()=>o.value?.getOperationLogStore().redoCount??0),A=a.computed(()=>o.value?.getOperationLogStore().undoRedoState??{canUndo:!1,canRedo:!1,undoCount:0,redoCount:0,currentIndex:-1}),L=v=>o.value?.getOperationLogStore().undo(v)??!1,P=v=>o.value?.getOperationLogStore().redo(v)??!1,$=()=>{o.value?.getOperationLogStore().startBatch()},_=v=>o.value?.getOperationLogStore().commitBatch(v)??null,w=()=>{o.value?.getOperationLogStore().cancelBatch()},V=()=>{o.value?.getOperationLogStore().clear()},O=(v,p)=>o.value?.getOperationLogStore().getOperationsFor(v,p)??[],T=()=>o.value?.getOperationLogStore().getSnapshot()??{operations:[],currentIndex:-1,totalOperations:0,reversibleOperations:0,irreversibleOperations:0},y=(v,p)=>{o.value?.getOperationLogStore().markIrreversible(v,p)},B=(v,p,S,I="success",k)=>o.value?.getOperationLogStore().logAction(v,p,S,I,k)??"",x=v=>{o.value?.getOperationLogStore().configure(v)};a.onMounted(async()=>{if(e){o.value=t||new ge(e);try{const v=o.value.getOperationLogStore(),p=Oe(v);l.value=p.operations.value,f.value=p.currentIndex.value,a.watch(()=>p.operations.value,S=>{l.value=S}),a.watch(()=>p.currentIndex.value,S=>{f.value=S})}catch{}if(!r.doctype&&e.router){const v=e.router.currentRoute.value;if(!v.path)return;const p=v.path.split("/").filter(I=>I.length>0),S=p[1]?.toLowerCase();if(p.length>0){const I={path:v.path,segments:p},k=await e.getMeta?.(I);if(k){if(e.addDoctype(k),o.value.setup(k),i.value=k,c.value=S,n.value=o.value.getStore(),S&&S!=="new"){const j=o.value.getRecordById(k,S);if(j)s.value=j.get("")||{};else try{await o.value.getRecord(k,S);const F=o.value.getRecordById(k,S);F&&(s.value=F.get("")||{})}catch{s.value=le(k)}}else s.value=le(k);n.value&&Te(k,S||"new",s,n.value),o.value.runAction(k,"load",S?[S]:void 0)}}}if(r.doctype){n.value=o.value.getStore();const v=r.doctype,p=r.recordId;if(p&&p!=="new"){const S=o.value.getRecordById(v,p);if(S)s.value=S.get("")||{};else try{await o.value.getRecord(v,p);const I=o.value.getRecordById(v,p);I&&(s.value=I.get("")||{})}catch{s.value=le(v)}}else s.value=le(v);n.value&&Te(v,p||"new",s,n.value)}}});const u=(v,p)=>{const S=r.doctype||i.value;if(!S)return"";const I=p||r.recordId||c.value||"new";return`${S.slug}.${I}.${v}`},d=v=>{const p=r.doctype||i.value;if(!(!n.value||!o.value||!p))try{const S=v.path.split(".");if(S.length>=2){const j=S[0],F=S[1];if(n.value.has(`${j}.${F}`)||o.value.addRecord(p,F,{...s.value}),S.length>3){const h=`${j}.${F}`,g=S.slice(2);let m=h;for(let M=0;M<g.length-1;M++)if(m+=`.${g[M]}`,!n.value.has(m)){const z=g[M+1],W=!isNaN(Number(z));n.value.set(m,W?[]:{})}}}n.value.set(v.path,v.value);const I=v.fieldname.split("."),k={...s.value};I.length===1?k[I[0]]=v.value:ft(k,I,v.value),s.value=k}catch{}};(r.doctype||e?.router)&&(a.provide("hstPathProvider",u),a.provide("hstChangeHandler",d));const R={operations:l,currentIndex:f,undoRedoState:A,canUndo:b,canRedo:E,undoCount:N,redoCount:D,undo:L,redo:P,startBatch:$,commitBatch:_,cancelBatch:w,clear:V,getOperationsFor:O,getSnapshot:T,markIrreversible:y,logAction:B,configure:x};return r.doctype?{stonecrop:o,operationLog:R,provideHSTPath:u,handleHSTChange:d,hstStore:n,formData:s}:!r.doctype&&e?.router?{stonecrop:o,operationLog:R,provideHSTPath:u,handleHSTChange:d,hstStore:n,formData:s}:{stonecrop:o,operationLog:R}}function le(r){const e={};return r.schema&&r.schema.forEach(t=>{switch("fieldtype"in t?t.fieldtype:"Data"){case"Data":case"Text":e[t.fieldname]="";break;case"Check":e[t.fieldname]=!1;break;case"Int":case"Float":e[t.fieldname]=0;break;case"Table":e[t.fieldname]=[];break;case"JSON":e[t.fieldname]={};break;default:e[t.fieldname]=null}}),e}function Te(r,e,t,o){a.watch(t,n=>{const s=`${r.slug}.${e}`;Object.keys(n).forEach(i=>{const c=`${s}.${i}`;try{o.set(c,n[i])}catch{}})},{deep:!0})}function ft(r,e,t){let o=r;for(let s=0;s<e.length-1;s++){const i=e[s];(!(i in o)||typeof o[i]!="object")&&(o[i]=isNaN(Number(e[s+1]))?{}:[]),o=o[i]}const n=e[e.length-1];o[n]=t}function ye(r){const t=a.inject("$operationLogStore",void 0)||Y();r&&t.configure(r);const{operations:o,currentIndex:n,undoRedoState:s,canUndo:i,canRedo:c,undoCount:l,redoCount:f}=Oe(t);function b(O){return t.undo(O)}function E(O){return t.redo(O)}function N(){t.startBatch()}function D(O){return t.commitBatch(O)}function A(){t.cancelBatch()}function L(){t.clear()}function P(O,T){return t.getOperationsFor(O,T)}function $(){return t.getSnapshot()}function _(O,T){t.markIrreversible(O,T)}function w(O,T,y,B="success",x){return t.logAction(O,T,y,B,x)}function V(O){t.configure(O)}return{operations:o,currentIndex:n,undoRedoState:s,canUndo:i,canRedo:c,undoCount:l,redoCount:f,undo:b,redo:E,startBatch:N,commitBatch:D,cancelBatch:A,clear:L,getOperationsFor:P,getSnapshot:$,markIrreversible:_,logAction:w,configure:V}}function dt(r,e=!0){if(!e)return;const{undo:t,redo:o,canUndo:n,canRedo:s}=ye(),i=ot();re(i["Ctrl+Z"],()=>{n.value&&t(r)}),re(i["Meta+Z"],()=>{n.value&&t(r)}),re(i["Ctrl+Shift+Z"],()=>{s.value&&o(r)}),re(i["Meta+Shift+Z"],()=>{s.value&&o(r)}),re(i["Ctrl+Y"],()=>{s.value&&o(r)})}async function pt(r,e){const{startBatch:t,commitBatch:o,cancelBatch:n}=ye();t();try{return await r(),o(e)}catch(s){throw n(),s}}class ht{doctype;schema;workflow;actions;component;constructor(e,t,o,n,s){this.doctype=e,this.schema=t,this.workflow=o,this.actions=n,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}}class Q{static _root;name;registry;router;constructor(e,t){if(Q._root)return Q._root;Q._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=t}getMeta;addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e);const t=H();t.registerDoctypeActions(e.doctype,e.actions),e.slug!==e.doctype&&t.registerDoctypeActions(e.slug,e.actions),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}}async function gt(r,e,t){await a.nextTick();try{await t(r,e)}catch{}}const yt={install:(r,e)=>{const t=r.config.globalProperties.$router,o=e?.router,n=t||o;!t&&o&&r.use(o);const s=new Q(n,e?.getMeta);r.provide("$registry",s),r.config.globalProperties.$registry=s;const i=new ge(s);r.provide("$stonecrop",i),r.config.globalProperties.$stonecrop=i;try{const c=r.config.globalProperties.$pinia;if(c){const l=Y(c);r.provide("$operationLogStore",l),r.config.globalProperties.$operationLogStore=l}}catch(c){console.warn("Pinia not available - operation log features will be disabled:",c)}if(e?.components)for(const[c,l]of Object.entries(e.components))r.component(c,l);e?.autoInitializeRouter&&e.onRouterInitialized&>(s,i,e.onRouterInitialized)}};C.DoctypeMeta=ht,C.HST=K,C.Registry=Q,C.Stonecrop=ge,C.createHST=Ie,C.default=yt,C.getGlobalTriggerEngine=H,C.markOperationIrreversible=lt,C.registerGlobalAction=st,C.registerTransitionAction=it,C.setFieldRollback=at,C.triggerTransition=ct,C.useOperationLog=ye,C.useOperationLogStore=Y,C.useStonecrop=ut,C.useUndoRedoShortcuts=dt,C.withBatch=pt,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
14
10
|
//# sourceMappingURL=stonecrop.umd.cjs.map
|