@kitelev/exocortex-cli 15.27.0 → 15.28.1

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.
Files changed (2) hide show
  1. package/dist/index.js +40 -40
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- // @kitelev/exocortex-cli v15.27.0
2
+ // @kitelev/exocortex-cli v15.28.1
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
6
- "use strict";var XC=Object.create;var Fc=Object.defineProperty;var JC=Object.getOwnPropertyDescriptor;var ZC=Object.getOwnPropertyNames;var eI=Object.getPrototypeOf,tI=Object.prototype.hasOwnProperty;var o=(n,e)=>Fc(n,"name",{value:e,configurable:!0});var rI=(n,e)=>()=>(n&&(e=n(n=0)),e);var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Qv=(n,e)=>{for(var t in e)Fc(n,t,{get:e[t],enumerable:!0})},Yv=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ZC(e))!tI.call(n,i)&&i!==t&&Fc(n,i,{get:()=>e[i],enumerable:!(r=JC(e,i))||r.enumerable});return n};var te=(n,e,t)=>(t=n!=null?XC(eI(n)):{},Yv(e||!n||!n.__esModule?Fc(t,"default",{value:n,enumerable:!0}):t,n)),Op=n=>Yv(Fc({},"__esModule",{value:!0}),n);var Ou=v(()=>{var Kv;(function(n){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),r=i(n);typeof t.Reflect<"u"&&(r=i(t.Reflect,r)),e(r,t),typeof t.Reflect>"u"&&(t.Reflect=n);function i(l,u){return function(f,h){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:h}),u&&u(f,h)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(a,"indirectEvalThis");function c(){return s()||a()}o(c,"sloppyModeThis")})(function(e,t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,u=!c&&!l,f={create:c?function(){return Pe(Object.create(null))}:l?function(){return Pe({__proto__:null})}:function(){return Pe({})},has:u?function(b,w){return r.call(b,w)}:function(b,w){return w in b},get:u?function(b,w){return r.call(b,w)?b[w]:void 0}:function(b,w){return b[w]}},h=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:me(),p=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ge(),_=typeof WeakMap=="function"?WeakMap:$e(),S=i?Symbol.for("@reflect-metadata:registry"):void 0,E=he(),A=de(E);function C(b,w,T,P){if(B(T)){if(!Fe(b))throw new TypeError;if(!De(w))throw new TypeError;return dt(b,w)}else{if(!Fe(b))throw new TypeError;if(!X(w))throw new TypeError;if(!X(P)&&!B(P)&&!Ee(P))throw new TypeError;return Ee(P)&&(P=void 0),T=ye(T),nt(b,w,T,P)}}o(C,"decorate"),e("decorate",C);function k(b,w){function T(P,Y){if(!X(P))throw new TypeError;if(!B(Y)&&!je(Y))throw new TypeError;Z(b,w,P,Y)}return o(T,"decorator"),T}o(k,"metadata"),e("metadata",k);function G(b,w,T,P){if(!X(T))throw new TypeError;return B(P)||(P=ye(P)),Z(b,w,T,P)}o(G,"defineMetadata"),e("defineMetadata",G);function Q(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),yt(b,w,T)}o(Q,"hasMetadata"),e("hasMetadata",Q);function H(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Ke(b,w,T)}o(H,"hasOwnMetadata"),e("hasOwnMetadata",H);function re(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Je(b,w,T)}o(re,"getMetadata"),e("getMetadata",re);function Ie(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Ue(b,w,T)}o(Ie,"getOwnMetadata"),e("getOwnMetadata",Ie);function N(b,w){if(!X(b))throw new TypeError;return B(w)||(w=ye(w)),$(b,w)}o(N,"getMetadataKeys"),e("getMetadataKeys",N);function K(b,w){if(!X(b))throw new TypeError;return B(w)||(w=ye(w)),Ze(b,w)}o(K,"getOwnMetadataKeys"),e("getOwnMetadataKeys",K);function ge(b,w,T){if(!X(w))throw new TypeError;if(B(T)||(T=ye(T)),!X(w))throw new TypeError;B(T)||(T=ye(T));var P=ne(w,T,!1);return B(P)?!1:P.OrdinaryDeleteMetadata(b,w,T)}o(ge,"deleteMetadata"),e("deleteMetadata",ge);function dt(b,w){for(var T=b.length-1;T>=0;--T){var P=b[T],Y=P(w);if(!B(Y)&&!Ee(Y)){if(!De(Y))throw new TypeError;w=Y}}return w}o(dt,"DecorateConstructor");function nt(b,w,T,P){for(var Y=b.length-1;Y>=0;--Y){var at=b[Y],pt=at(w,T,P);if(!B(pt)&&!Ee(pt)){if(!X(pt))throw new TypeError;P=pt}}return P}o(nt,"DecorateProperty");function yt(b,w,T){var P=Ke(b,w,T);if(P)return!0;var Y=ie(w);return Ee(Y)?!1:yt(b,Y,T)}o(yt,"OrdinaryHasMetadata");function Ke(b,w,T){var P=ne(w,T,!1);return B(P)?!1:Re(P.OrdinaryHasOwnMetadata(b,w,T))}o(Ke,"OrdinaryHasOwnMetadata");function Je(b,w,T){var P=Ke(b,w,T);if(P)return Ue(b,w,T);var Y=ie(w);if(!Ee(Y))return Je(b,Y,T)}o(Je,"OrdinaryGetMetadata");function Ue(b,w,T){var P=ne(w,T,!1);if(!B(P))return P.OrdinaryGetOwnMetadata(b,w,T)}o(Ue,"OrdinaryGetOwnMetadata");function Z(b,w,T,P){var Y=ne(T,P,!0);Y.OrdinaryDefineOwnMetadata(b,w,T,P)}o(Z,"OrdinaryDefineOwnMetadata");function $(b,w){var T=Ze(b,w),P=ie(b);if(P===null)return T;var Y=$(P,w);if(Y.length<=0)return T;if(T.length<=0)return Y;for(var at=new p,pt=[],Ae=0,V=T;Ae<V.length;Ae++){var U=V[Ae],q=at.has(U);q||(at.add(U),pt.push(U))}for(var z=0,we=Y;z<we.length;z++){var U=we[z],q=at.has(U);q||(at.add(U),pt.push(U))}return pt}o($,"OrdinaryMetadataKeys");function Ze(b,w){var T=ne(b,w,!1);return T?T.OrdinaryOwnMetadataKeys(b,w):[]}o(Ze,"OrdinaryOwnMetadataKeys");function it(b){if(b===null)return 1;switch(typeof b){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return b===null?1:6;default:return 6}}o(it,"Type");function B(b){return b===void 0}o(B,"IsUndefined");function Ee(b){return b===null}o(Ee,"IsNull");function Ne(b){return typeof b=="symbol"}o(Ne,"IsSymbol");function X(b){return typeof b=="object"?b!==null:typeof b=="function"}o(X,"IsObject");function Le(b,w){switch(it(b)){case 0:return b;case 1:return b;case 2:return b;case 3:return b;case 4:return b;case 5:return b}var T=w===3?"string":w===5?"number":"default",P=le(b,s);if(P!==void 0){var Y=P.call(b,T);if(X(Y))throw new TypeError;return Y}return Me(b,T==="default"?"number":T)}o(Le,"ToPrimitive");function Me(b,w){if(w==="string"){var T=b.toString;if(Te(T)){var P=T.call(b);if(!X(P))return P}var Y=b.valueOf;if(Te(Y)){var P=Y.call(b);if(!X(P))return P}}else{var Y=b.valueOf;if(Te(Y)){var P=Y.call(b);if(!X(P))return P}var at=b.toString;if(Te(at)){var P=at.call(b);if(!X(P))return P}}throw new TypeError}o(Me,"OrdinaryToPrimitive");function Re(b){return!!b}o(Re,"ToBoolean");function ke(b){return""+b}o(ke,"ToString");function ye(b){var w=Le(b,3);return Ne(w)?w:ke(w)}o(ye,"ToPropertyKey");function Fe(b){return Array.isArray?Array.isArray(b):b instanceof Object?b instanceof Array:Object.prototype.toString.call(b)==="[object Array]"}o(Fe,"IsArray");function Te(b){return typeof b=="function"}o(Te,"IsCallable");function De(b){return typeof b=="function"}o(De,"IsConstructor");function je(b){switch(it(b)){case 3:return!0;case 4:return!0;default:return!1}}o(je,"IsPropertyKey");function se(b,w){return b===w||b!==b&&w!==w}o(se,"SameValueZero");function le(b,w){var T=b[w];if(T!=null){if(!Te(T))throw new TypeError;return T}}o(le,"GetMethod");function ue(b){var w=le(b,a);if(!Te(w))throw new TypeError;var T=w.call(b);if(!X(T))throw new TypeError;return T}o(ue,"GetIterator");function ae(b){return b.value}o(ae,"IteratorValue");function oe(b){var w=b.next();return w.done?!1:w}o(oe,"IteratorStep");function ce(b){var w=b.return;w&&w.call(b)}o(ce,"IteratorClose");function ie(b){var w=Object.getPrototypeOf(b);if(typeof b!="function"||b===h||w!==h)return w;var T=b.prototype,P=T&&Object.getPrototypeOf(T);if(P==null||P===Object.prototype)return w;var Y=P.constructor;return typeof Y!="function"||Y===b?w:Y}o(ie,"OrdinaryGetPrototypeOf");function fe(){var b;!B(S)&&typeof t.Reflect<"u"&&!(S in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(b=pe(t.Reflect));var w,T,P,Y=new _,at={registerProvider:pt,getProvider:V,setProvider:q};return at;function pt(z){if(!Object.isExtensible(at))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case b===z:break;case B(w):w=z;break;case w===z:break;case B(T):T=z;break;case T===z:break;default:P===void 0&&(P=new p),P.add(z);break}}function Ae(z,we){if(!B(w)){if(w.isProviderFor(z,we))return w;if(!B(T)){if(T.isProviderFor(z,we))return w;if(!B(P))for(var We=ue(P);;){var He=oe(We);if(!He)return;var Jt=ae(He);if(Jt.isProviderFor(z,we))return ce(We),Jt}}}if(!B(b)&&b.isProviderFor(z,we))return b}function V(z,we){var We=Y.get(z),He;return B(We)||(He=We.get(we)),B(He)&&(He=Ae(z,we),B(He)||(B(We)&&(We=new d,Y.set(z,We)),We.set(we,He))),He}function U(z){if(B(z))throw new TypeError;return w===z||T===z||!B(P)&&P.has(z)}function q(z,we,We){if(!U(We))throw new Error("Metadata provider not registered.");var He=V(z,we);if(He!==We){if(!B(He))return!1;var Jt=Y.get(z);B(Jt)&&(Jt=new d,Y.set(z,Jt)),Jt.set(we,We)}return!0}}o(fe,"CreateMetadataRegistry");function he(){var b;return!B(S)&&X(t.Reflect)&&Object.isExtensible(t.Reflect)&&(b=t.Reflect[S]),B(b)&&(b=fe()),!B(S)&&X(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,S,{enumerable:!1,configurable:!1,writable:!1,value:b}),b}o(he,"GetOrCreateMetadataRegistry");function de(b){var w=new _,T={isProviderFor:o(function(U,q){var z=w.get(U);return B(z)?!1:z.has(q)},"isProviderFor"),OrdinaryDefineOwnMetadata:pt,OrdinaryHasOwnMetadata:Y,OrdinaryGetOwnMetadata:at,OrdinaryOwnMetadataKeys:Ae,OrdinaryDeleteMetadata:V};return E.registerProvider(T),T;function P(U,q,z){var we=w.get(U),We=!1;if(B(we)){if(!z)return;we=new d,w.set(U,we),We=!0}var He=we.get(q);if(B(He)){if(!z)return;if(He=new d,we.set(q,He),!b.setProvider(U,q,T))throw we.delete(q),We&&w.delete(U),new Error("Wrong provider for target.")}return He}o(P,"GetOrCreateMetadataMap");function Y(U,q,z){var we=P(q,z,!1);return B(we)?!1:Re(we.has(U))}o(Y,"OrdinaryHasOwnMetadata");function at(U,q,z){var we=P(q,z,!1);if(!B(we))return we.get(U)}o(at,"OrdinaryGetOwnMetadata");function pt(U,q,z,we){var We=P(z,we,!0);We.set(U,q)}o(pt,"OrdinaryDefineOwnMetadata");function Ae(U,q){var z=[],we=P(U,q,!1);if(B(we))return z;for(var We=we.keys(),He=ue(We),Jt=0;;){var Vr=oe(He);if(!Vr)return z.length=Jt,z;var Xr=ae(Vr);try{z[Jt]=Xr}catch(wr){try{ce(He)}finally{throw wr}}Jt++}}o(Ae,"OrdinaryOwnMetadataKeys");function V(U,q,z){var we=P(q,z,!1);if(B(we)||!we.delete(U))return!1;if(we.size===0){var We=w.get(q);B(We)||(We.delete(z),We.size===0&&w.delete(We))}return!0}o(V,"OrdinaryDeleteMetadata")}o(de,"CreateMetadataProvider");function pe(b){var w=b.defineMetadata,T=b.hasOwnMetadata,P=b.getOwnMetadata,Y=b.getOwnMetadataKeys,at=b.deleteMetadata,pt=new _,Ae={isProviderFor:o(function(V,U){var q=pt.get(V);return!B(q)&&q.has(U)?!0:Y(V,U).length?(B(q)&&(q=new p,pt.set(V,q)),q.add(U),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:w,OrdinaryHasOwnMetadata:T,OrdinaryGetOwnMetadata:P,OrdinaryOwnMetadataKeys:Y,OrdinaryDeleteMetadata:at};return Ae}o(pe,"CreateFallbackProvider");function ne(b,w,T){var P=E.getProvider(b,w);if(!B(P))return P;if(T){if(E.setProvider(b,w,A))return A;throw new Error("Illegal state.")}}o(ne,"GetMetadataProvider");function me(){var b={},w=[],T=(function(){function Ae(V,U,q){this._index=0,this._keys=V,this._values=U,this._selector=q}return o(Ae,"MapIterator"),Ae.prototype["@@iterator"]=function(){return this},Ae.prototype[a]=function(){return this},Ae.prototype.next=function(){var V=this._index;if(V>=0&&V<this._keys.length){var U=this._selector(this._keys[V],this._values[V]);return V+1>=this._keys.length?(this._index=-1,this._keys=w,this._values=w):this._index++,{value:U,done:!1}}return{value:void 0,done:!0}},Ae.prototype.throw=function(V){throw this._index>=0&&(this._index=-1,this._keys=w,this._values=w),V},Ae.prototype.return=function(V){return this._index>=0&&(this._index=-1,this._keys=w,this._values=w),{value:V,done:!0}},Ae})(),P=(function(){function Ae(){this._keys=[],this._values=[],this._cacheKey=b,this._cacheIndex=-2}return o(Ae,"Map"),Object.defineProperty(Ae.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),Ae.prototype.has=function(V){return this._find(V,!1)>=0},Ae.prototype.get=function(V){var U=this._find(V,!1);return U>=0?this._values[U]:void 0},Ae.prototype.set=function(V,U){var q=this._find(V,!0);return this._values[q]=U,this},Ae.prototype.delete=function(V){var U=this._find(V,!1);if(U>=0){for(var q=this._keys.length,z=U+1;z<q;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,se(V,this._cacheKey)&&(this._cacheKey=b,this._cacheIndex=-2),!0}return!1},Ae.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=b,this._cacheIndex=-2},Ae.prototype.keys=function(){return new T(this._keys,this._values,Y)},Ae.prototype.values=function(){return new T(this._keys,this._values,at)},Ae.prototype.entries=function(){return new T(this._keys,this._values,pt)},Ae.prototype["@@iterator"]=function(){return this.entries()},Ae.prototype[a]=function(){return this.entries()},Ae.prototype._find=function(V,U){if(!se(this._cacheKey,V)){this._cacheIndex=-1;for(var q=0;q<this._keys.length;q++)if(se(this._keys[q],V)){this._cacheIndex=q;break}}return this._cacheIndex<0&&U&&(this._cacheIndex=this._keys.length,this._keys.push(V),this._values.push(void 0)),this._cacheIndex},Ae})();return P;function Y(Ae,V){return Ae}function at(Ae,V){return V}function pt(Ae,V){return[Ae,V]}}o(me,"CreateMapPolyfill");function Ge(){var b=(function(){function w(){this._map=new d}return o(w,"Set"),Object.defineProperty(w.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),w.prototype.has=function(T){return this._map.has(T)},w.prototype.add=function(T){return this._map.set(T,T),this},w.prototype.delete=function(T){return this._map.delete(T)},w.prototype.clear=function(){this._map.clear()},w.prototype.keys=function(){return this._map.keys()},w.prototype.values=function(){return this._map.keys()},w.prototype.entries=function(){return this._map.entries()},w.prototype["@@iterator"]=function(){return this.keys()},w.prototype[a]=function(){return this.keys()},w})();return b}o(Ge,"CreateSetPolyfill");function $e(){var b=16,w=f.create(),T=P();return(function(){function V(){this._key=P()}return o(V,"WeakMap"),V.prototype.has=function(U){var q=Y(U,!1);return q!==void 0?f.has(q,this._key):!1},V.prototype.get=function(U){var q=Y(U,!1);return q!==void 0?f.get(q,this._key):void 0},V.prototype.set=function(U,q){var z=Y(U,!0);return z[this._key]=q,this},V.prototype.delete=function(U){var q=Y(U,!1);return q!==void 0?delete q[this._key]:!1},V.prototype.clear=function(){this._key=P()},V})();function P(){var V;do V="@@WeakMap@@"+Ae();while(f.has(w,V));return w[V]=!0,V}function Y(V,U){if(!r.call(V,T)){if(!U)return;Object.defineProperty(V,T,{value:f.create()})}return V[T]}function at(V,U){for(var q=0;q<U;++q)V[q]=Math.random()*255|0;return V}function pt(V){if(typeof Uint8Array=="function"){var U=new Uint8Array(V);return typeof crypto<"u"?crypto.getRandomValues(U):typeof msCrypto<"u"?msCrypto.getRandomValues(U):at(U,V),U}return at(new Array(V),V)}function Ae(){var V=pt(b);V[6]=V[6]&79|64,V[8]=V[8]&191|128;for(var U="",q=0;q<b;++q){var z=V[q];(q===4||q===6||q===8)&&(U+="-"),z<16&&(U+="0"),U+=z.toString(16).toLowerCase()}return U}}o($e,"CreateWeakMapPolyfill");function Pe(b){return b.__=void 0,delete b.__,b}o(Pe,"MakeDictionary")})})(Kv||(Kv={}))});var Dc=v(Rp=>{var Pu=class extends Error{static{o(this,"CommanderError")}constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Pp=class extends Pu{static{o(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Rp.CommanderError=Pu;Rp.InvalidArgumentError=Pp});var Ru=v(Dp=>{var{InvalidArgumentError:nI}=Dc(),Fp=class{static{o(this,"Argument")}constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new nI(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function iI(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}o(iI,"humanReadableArgName");Dp.Argument=Fp;Dp.humanReadableArgName=iI});var Mp=v(Lp=>{var{humanReadableArgName:sI}=Ru(),Np=class{static{o(this,"Help")}constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let r=o(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!i&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>sI(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[])}),t.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[]),i.get(a).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(h,d){return t.formatItem(h,r,d,t)}o(s,"callFormatItem");let a=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(h=>s(t.styleArgumentTerm(t.argumentTerm(h)),t.styleArgumentDescription(t.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),h=>h.helpGroupHeading??"Options:").forEach((h,d)=>{let p=h.map(_=>s(t.styleOptionTerm(t.optionTerm(_)),t.styleOptionDescription(t.optionDescription(_))));a=a.concat(this.formatItemList(d,p,t))}),t.showGlobalOptions){let h=t.visibleGlobalOptions(e).map(d=>s(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));a=a.concat(this.formatItemList("Global Options:",h,t))}return this.groupItems(e.commands,t.visibleCommands(e),h=>h.helpGroup()||"Commands:").forEach((h,d)=>{let p=h.map(_=>s(t.styleSubcommandTerm(t.subcommandTerm(_)),t.styleSubcommandDescription(t.subcommandDescription(_))));a=a.concat(this.formatItemList(d,p,t))}),a.join(`
6
+ "use strict";var XC=Object.create;var Fc=Object.defineProperty;var JC=Object.getOwnPropertyDescriptor;var ZC=Object.getOwnPropertyNames;var eI=Object.getPrototypeOf,tI=Object.prototype.hasOwnProperty;var o=(n,e)=>Fc(n,"name",{value:e,configurable:!0});var rI=(n,e)=>()=>(n&&(e=n(n=0)),e);var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Qv=(n,e)=>{for(var t in e)Fc(n,t,{get:e[t],enumerable:!0})},Yv=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ZC(e))!tI.call(n,i)&&i!==t&&Fc(n,i,{get:()=>e[i],enumerable:!(r=JC(e,i))||r.enumerable});return n};var te=(n,e,t)=>(t=n!=null?XC(eI(n)):{},Yv(e||!n||!n.__esModule?Fc(t,"default",{value:n,enumerable:!0}):t,n)),Op=n=>Yv(Fc({},"__esModule",{value:!0}),n);var Ou=v(()=>{var Kv;(function(n){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),r=i(n);typeof t.Reflect<"u"&&(r=i(t.Reflect,r)),e(r,t),typeof t.Reflect>"u"&&(t.Reflect=n);function i(l,u){return function(f,h){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:h}),u&&u(f,h)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(a,"indirectEvalThis");function c(){return s()||a()}o(c,"sloppyModeThis")})(function(e,t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,u=!c&&!l,f={create:c?function(){return Pe(Object.create(null))}:l?function(){return Pe({__proto__:null})}:function(){return Pe({})},has:u?function(b,w){return r.call(b,w)}:function(b,w){return w in b},get:u?function(b,w){return r.call(b,w)?b[w]:void 0}:function(b,w){return b[w]}},h=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:me(),p=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ge(),_=typeof WeakMap=="function"?WeakMap:$e(),S=i?Symbol.for("@reflect-metadata:registry"):void 0,E=he(),A=de(E);function C(b,w,T,P){if(B(T)){if(!Fe(b))throw new TypeError;if(!De(w))throw new TypeError;return dt(b,w)}else{if(!Fe(b))throw new TypeError;if(!X(w))throw new TypeError;if(!X(P)&&!B(P)&&!Ee(P))throw new TypeError;return Ee(P)&&(P=void 0),T=ye(T),nt(b,w,T,P)}}o(C,"decorate"),e("decorate",C);function k(b,w){function T(P,Y){if(!X(P))throw new TypeError;if(!B(Y)&&!je(Y))throw new TypeError;Z(b,w,P,Y)}return o(T,"decorator"),T}o(k,"metadata"),e("metadata",k);function G(b,w,T,P){if(!X(T))throw new TypeError;return B(P)||(P=ye(P)),Z(b,w,T,P)}o(G,"defineMetadata"),e("defineMetadata",G);function Q(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),yt(b,w,T)}o(Q,"hasMetadata"),e("hasMetadata",Q);function H(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Ke(b,w,T)}o(H,"hasOwnMetadata"),e("hasOwnMetadata",H);function re(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Je(b,w,T)}o(re,"getMetadata"),e("getMetadata",re);function Ie(b,w,T){if(!X(w))throw new TypeError;return B(T)||(T=ye(T)),Ue(b,w,T)}o(Ie,"getOwnMetadata"),e("getOwnMetadata",Ie);function N(b,w){if(!X(b))throw new TypeError;return B(w)||(w=ye(w)),$(b,w)}o(N,"getMetadataKeys"),e("getMetadataKeys",N);function K(b,w){if(!X(b))throw new TypeError;return B(w)||(w=ye(w)),Ze(b,w)}o(K,"getOwnMetadataKeys"),e("getOwnMetadataKeys",K);function ge(b,w,T){if(!X(w))throw new TypeError;if(B(T)||(T=ye(T)),!X(w))throw new TypeError;B(T)||(T=ye(T));var P=ne(w,T,!1);return B(P)?!1:P.OrdinaryDeleteMetadata(b,w,T)}o(ge,"deleteMetadata"),e("deleteMetadata",ge);function dt(b,w){for(var T=b.length-1;T>=0;--T){var P=b[T],Y=P(w);if(!B(Y)&&!Ee(Y)){if(!De(Y))throw new TypeError;w=Y}}return w}o(dt,"DecorateConstructor");function nt(b,w,T,P){for(var Y=b.length-1;Y>=0;--Y){var at=b[Y],pt=at(w,T,P);if(!B(pt)&&!Ee(pt)){if(!X(pt))throw new TypeError;P=pt}}return P}o(nt,"DecorateProperty");function yt(b,w,T){var P=Ke(b,w,T);if(P)return!0;var Y=ie(w);return Ee(Y)?!1:yt(b,Y,T)}o(yt,"OrdinaryHasMetadata");function Ke(b,w,T){var P=ne(w,T,!1);return B(P)?!1:Re(P.OrdinaryHasOwnMetadata(b,w,T))}o(Ke,"OrdinaryHasOwnMetadata");function Je(b,w,T){var P=Ke(b,w,T);if(P)return Ue(b,w,T);var Y=ie(w);if(!Ee(Y))return Je(b,Y,T)}o(Je,"OrdinaryGetMetadata");function Ue(b,w,T){var P=ne(w,T,!1);if(!B(P))return P.OrdinaryGetOwnMetadata(b,w,T)}o(Ue,"OrdinaryGetOwnMetadata");function Z(b,w,T,P){var Y=ne(T,P,!0);Y.OrdinaryDefineOwnMetadata(b,w,T,P)}o(Z,"OrdinaryDefineOwnMetadata");function $(b,w){var T=Ze(b,w),P=ie(b);if(P===null)return T;var Y=$(P,w);if(Y.length<=0)return T;if(T.length<=0)return Y;for(var at=new p,pt=[],Ae=0,V=T;Ae<V.length;Ae++){var U=V[Ae],q=at.has(U);q||(at.add(U),pt.push(U))}for(var z=0,we=Y;z<we.length;z++){var U=we[z],q=at.has(U);q||(at.add(U),pt.push(U))}return pt}o($,"OrdinaryMetadataKeys");function Ze(b,w){var T=ne(b,w,!1);return T?T.OrdinaryOwnMetadataKeys(b,w):[]}o(Ze,"OrdinaryOwnMetadataKeys");function it(b){if(b===null)return 1;switch(typeof b){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return b===null?1:6;default:return 6}}o(it,"Type");function B(b){return b===void 0}o(B,"IsUndefined");function Ee(b){return b===null}o(Ee,"IsNull");function Ne(b){return typeof b=="symbol"}o(Ne,"IsSymbol");function X(b){return typeof b=="object"?b!==null:typeof b=="function"}o(X,"IsObject");function Le(b,w){switch(it(b)){case 0:return b;case 1:return b;case 2:return b;case 3:return b;case 4:return b;case 5:return b}var T=w===3?"string":w===5?"number":"default",P=le(b,s);if(P!==void 0){var Y=P.call(b,T);if(X(Y))throw new TypeError;return Y}return Me(b,T==="default"?"number":T)}o(Le,"ToPrimitive");function Me(b,w){if(w==="string"){var T=b.toString;if(Te(T)){var P=T.call(b);if(!X(P))return P}var Y=b.valueOf;if(Te(Y)){var P=Y.call(b);if(!X(P))return P}}else{var Y=b.valueOf;if(Te(Y)){var P=Y.call(b);if(!X(P))return P}var at=b.toString;if(Te(at)){var P=at.call(b);if(!X(P))return P}}throw new TypeError}o(Me,"OrdinaryToPrimitive");function Re(b){return!!b}o(Re,"ToBoolean");function ke(b){return""+b}o(ke,"ToString");function ye(b){var w=Le(b,3);return Ne(w)?w:ke(w)}o(ye,"ToPropertyKey");function Fe(b){return Array.isArray?Array.isArray(b):b instanceof Object?b instanceof Array:Object.prototype.toString.call(b)==="[object Array]"}o(Fe,"IsArray");function Te(b){return typeof b=="function"}o(Te,"IsCallable");function De(b){return typeof b=="function"}o(De,"IsConstructor");function je(b){switch(it(b)){case 3:return!0;case 4:return!0;default:return!1}}o(je,"IsPropertyKey");function se(b,w){return b===w||b!==b&&w!==w}o(se,"SameValueZero");function le(b,w){var T=b[w];if(T!=null){if(!Te(T))throw new TypeError;return T}}o(le,"GetMethod");function ue(b){var w=le(b,a);if(!Te(w))throw new TypeError;var T=w.call(b);if(!X(T))throw new TypeError;return T}o(ue,"GetIterator");function ae(b){return b.value}o(ae,"IteratorValue");function oe(b){var w=b.next();return w.done?!1:w}o(oe,"IteratorStep");function ce(b){var w=b.return;w&&w.call(b)}o(ce,"IteratorClose");function ie(b){var w=Object.getPrototypeOf(b);if(typeof b!="function"||b===h||w!==h)return w;var T=b.prototype,P=T&&Object.getPrototypeOf(T);if(P==null||P===Object.prototype)return w;var Y=P.constructor;return typeof Y!="function"||Y===b?w:Y}o(ie,"OrdinaryGetPrototypeOf");function fe(){var b;!B(S)&&typeof t.Reflect<"u"&&!(S in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(b=pe(t.Reflect));var w,T,P,Y=new _,at={registerProvider:pt,getProvider:V,setProvider:q};return at;function pt(z){if(!Object.isExtensible(at))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case b===z:break;case B(w):w=z;break;case w===z:break;case B(T):T=z;break;case T===z:break;default:P===void 0&&(P=new p),P.add(z);break}}function Ae(z,we){if(!B(w)){if(w.isProviderFor(z,we))return w;if(!B(T)){if(T.isProviderFor(z,we))return w;if(!B(P))for(var We=ue(P);;){var He=oe(We);if(!He)return;var Jt=ae(He);if(Jt.isProviderFor(z,we))return ce(We),Jt}}}if(!B(b)&&b.isProviderFor(z,we))return b}function V(z,we){var We=Y.get(z),He;return B(We)||(He=We.get(we)),B(He)&&(He=Ae(z,we),B(He)||(B(We)&&(We=new d,Y.set(z,We)),We.set(we,He))),He}function U(z){if(B(z))throw new TypeError;return w===z||T===z||!B(P)&&P.has(z)}function q(z,we,We){if(!U(We))throw new Error("Metadata provider not registered.");var He=V(z,we);if(He!==We){if(!B(He))return!1;var Jt=Y.get(z);B(Jt)&&(Jt=new d,Y.set(z,Jt)),Jt.set(we,We)}return!0}}o(fe,"CreateMetadataRegistry");function he(){var b;return!B(S)&&X(t.Reflect)&&Object.isExtensible(t.Reflect)&&(b=t.Reflect[S]),B(b)&&(b=fe()),!B(S)&&X(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,S,{enumerable:!1,configurable:!1,writable:!1,value:b}),b}o(he,"GetOrCreateMetadataRegistry");function de(b){var w=new _,T={isProviderFor:o(function(U,q){var z=w.get(U);return B(z)?!1:z.has(q)},"isProviderFor"),OrdinaryDefineOwnMetadata:pt,OrdinaryHasOwnMetadata:Y,OrdinaryGetOwnMetadata:at,OrdinaryOwnMetadataKeys:Ae,OrdinaryDeleteMetadata:V};return E.registerProvider(T),T;function P(U,q,z){var we=w.get(U),We=!1;if(B(we)){if(!z)return;we=new d,w.set(U,we),We=!0}var He=we.get(q);if(B(He)){if(!z)return;if(He=new d,we.set(q,He),!b.setProvider(U,q,T))throw we.delete(q),We&&w.delete(U),new Error("Wrong provider for target.")}return He}o(P,"GetOrCreateMetadataMap");function Y(U,q,z){var we=P(q,z,!1);return B(we)?!1:Re(we.has(U))}o(Y,"OrdinaryHasOwnMetadata");function at(U,q,z){var we=P(q,z,!1);if(!B(we))return we.get(U)}o(at,"OrdinaryGetOwnMetadata");function pt(U,q,z,we){var We=P(z,we,!0);We.set(U,q)}o(pt,"OrdinaryDefineOwnMetadata");function Ae(U,q){var z=[],we=P(U,q,!1);if(B(we))return z;for(var We=we.keys(),He=ue(We),Jt=0;;){var Vr=oe(He);if(!Vr)return z.length=Jt,z;var Xr=ae(Vr);try{z[Jt]=Xr}catch(Er){try{ce(He)}finally{throw Er}}Jt++}}o(Ae,"OrdinaryOwnMetadataKeys");function V(U,q,z){var we=P(q,z,!1);if(B(we)||!we.delete(U))return!1;if(we.size===0){var We=w.get(q);B(We)||(We.delete(z),We.size===0&&w.delete(We))}return!0}o(V,"OrdinaryDeleteMetadata")}o(de,"CreateMetadataProvider");function pe(b){var w=b.defineMetadata,T=b.hasOwnMetadata,P=b.getOwnMetadata,Y=b.getOwnMetadataKeys,at=b.deleteMetadata,pt=new _,Ae={isProviderFor:o(function(V,U){var q=pt.get(V);return!B(q)&&q.has(U)?!0:Y(V,U).length?(B(q)&&(q=new p,pt.set(V,q)),q.add(U),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:w,OrdinaryHasOwnMetadata:T,OrdinaryGetOwnMetadata:P,OrdinaryOwnMetadataKeys:Y,OrdinaryDeleteMetadata:at};return Ae}o(pe,"CreateFallbackProvider");function ne(b,w,T){var P=E.getProvider(b,w);if(!B(P))return P;if(T){if(E.setProvider(b,w,A))return A;throw new Error("Illegal state.")}}o(ne,"GetMetadataProvider");function me(){var b={},w=[],T=(function(){function Ae(V,U,q){this._index=0,this._keys=V,this._values=U,this._selector=q}return o(Ae,"MapIterator"),Ae.prototype["@@iterator"]=function(){return this},Ae.prototype[a]=function(){return this},Ae.prototype.next=function(){var V=this._index;if(V>=0&&V<this._keys.length){var U=this._selector(this._keys[V],this._values[V]);return V+1>=this._keys.length?(this._index=-1,this._keys=w,this._values=w):this._index++,{value:U,done:!1}}return{value:void 0,done:!0}},Ae.prototype.throw=function(V){throw this._index>=0&&(this._index=-1,this._keys=w,this._values=w),V},Ae.prototype.return=function(V){return this._index>=0&&(this._index=-1,this._keys=w,this._values=w),{value:V,done:!0}},Ae})(),P=(function(){function Ae(){this._keys=[],this._values=[],this._cacheKey=b,this._cacheIndex=-2}return o(Ae,"Map"),Object.defineProperty(Ae.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),Ae.prototype.has=function(V){return this._find(V,!1)>=0},Ae.prototype.get=function(V){var U=this._find(V,!1);return U>=0?this._values[U]:void 0},Ae.prototype.set=function(V,U){var q=this._find(V,!0);return this._values[q]=U,this},Ae.prototype.delete=function(V){var U=this._find(V,!1);if(U>=0){for(var q=this._keys.length,z=U+1;z<q;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,se(V,this._cacheKey)&&(this._cacheKey=b,this._cacheIndex=-2),!0}return!1},Ae.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=b,this._cacheIndex=-2},Ae.prototype.keys=function(){return new T(this._keys,this._values,Y)},Ae.prototype.values=function(){return new T(this._keys,this._values,at)},Ae.prototype.entries=function(){return new T(this._keys,this._values,pt)},Ae.prototype["@@iterator"]=function(){return this.entries()},Ae.prototype[a]=function(){return this.entries()},Ae.prototype._find=function(V,U){if(!se(this._cacheKey,V)){this._cacheIndex=-1;for(var q=0;q<this._keys.length;q++)if(se(this._keys[q],V)){this._cacheIndex=q;break}}return this._cacheIndex<0&&U&&(this._cacheIndex=this._keys.length,this._keys.push(V),this._values.push(void 0)),this._cacheIndex},Ae})();return P;function Y(Ae,V){return Ae}function at(Ae,V){return V}function pt(Ae,V){return[Ae,V]}}o(me,"CreateMapPolyfill");function Ge(){var b=(function(){function w(){this._map=new d}return o(w,"Set"),Object.defineProperty(w.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),w.prototype.has=function(T){return this._map.has(T)},w.prototype.add=function(T){return this._map.set(T,T),this},w.prototype.delete=function(T){return this._map.delete(T)},w.prototype.clear=function(){this._map.clear()},w.prototype.keys=function(){return this._map.keys()},w.prototype.values=function(){return this._map.keys()},w.prototype.entries=function(){return this._map.entries()},w.prototype["@@iterator"]=function(){return this.keys()},w.prototype[a]=function(){return this.keys()},w})();return b}o(Ge,"CreateSetPolyfill");function $e(){var b=16,w=f.create(),T=P();return(function(){function V(){this._key=P()}return o(V,"WeakMap"),V.prototype.has=function(U){var q=Y(U,!1);return q!==void 0?f.has(q,this._key):!1},V.prototype.get=function(U){var q=Y(U,!1);return q!==void 0?f.get(q,this._key):void 0},V.prototype.set=function(U,q){var z=Y(U,!0);return z[this._key]=q,this},V.prototype.delete=function(U){var q=Y(U,!1);return q!==void 0?delete q[this._key]:!1},V.prototype.clear=function(){this._key=P()},V})();function P(){var V;do V="@@WeakMap@@"+Ae();while(f.has(w,V));return w[V]=!0,V}function Y(V,U){if(!r.call(V,T)){if(!U)return;Object.defineProperty(V,T,{value:f.create()})}return V[T]}function at(V,U){for(var q=0;q<U;++q)V[q]=Math.random()*255|0;return V}function pt(V){if(typeof Uint8Array=="function"){var U=new Uint8Array(V);return typeof crypto<"u"?crypto.getRandomValues(U):typeof msCrypto<"u"?msCrypto.getRandomValues(U):at(U,V),U}return at(new Array(V),V)}function Ae(){var V=pt(b);V[6]=V[6]&79|64,V[8]=V[8]&191|128;for(var U="",q=0;q<b;++q){var z=V[q];(q===4||q===6||q===8)&&(U+="-"),z<16&&(U+="0"),U+=z.toString(16).toLowerCase()}return U}}o($e,"CreateWeakMapPolyfill");function Pe(b){return b.__=void 0,delete b.__,b}o(Pe,"MakeDictionary")})})(Kv||(Kv={}))});var Dc=v(Rp=>{var Pu=class extends Error{static{o(this,"CommanderError")}constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Pp=class extends Pu{static{o(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Rp.CommanderError=Pu;Rp.InvalidArgumentError=Pp});var Ru=v(Dp=>{var{InvalidArgumentError:nI}=Dc(),Fp=class{static{o(this,"Argument")}constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new nI(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function iI(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}o(iI,"humanReadableArgName");Dp.Argument=Fp;Dp.humanReadableArgName=iI});var Mp=v(Lp=>{var{humanReadableArgName:sI}=Ru(),Np=class{static{o(this,"Help")}constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let r=o(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!i&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>sI(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[])}),t.forEach(s=>{let a=r(s);i.has(a)||i.set(a,[]),i.get(a).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(h,d){return t.formatItem(h,r,d,t)}o(s,"callFormatItem");let a=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(h=>s(t.styleArgumentTerm(t.argumentTerm(h)),t.styleArgumentDescription(t.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),h=>h.helpGroupHeading??"Options:").forEach((h,d)=>{let p=h.map(_=>s(t.styleOptionTerm(t.optionTerm(_)),t.styleOptionDescription(t.optionDescription(_))));a=a.concat(this.formatItemList(d,p,t))}),t.showGlobalOptions){let h=t.visibleGlobalOptions(e).map(d=>s(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));a=a.concat(this.formatItemList("Global Options:",h,t))}return this.groupItems(e.commands,t.visibleCommands(e),h=>h.helpGroup()||"Commands:").forEach((h,d)=>{let p=h.map(_=>s(t.styleSubcommandTerm(t.subcommandTerm(_)),t.styleSubcommandDescription(t.subcommandDescription(_))));a=a.concat(this.formatItemList(d,p,t))}),a.join(`
7
7
  `)}displayWidth(e){return Xv(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,i){let a=" ".repeat(2);if(!r)return a+e;let c=e.padEnd(t+e.length-i.displayWidth(e)),l=2,f=(this.helpWidth??80)-t-l-2,h;return f<this.minWidthToWrap||i.preformatted(r)?h=r:h=i.boxWrap(r,f).replace(/\n/g,`
8
8
  `+" ".repeat(t+l)),a+c+" ".repeat(l)+h.replace(/\n/g,`
9
9
  ${a}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return r.forEach(a=>{let c=a.match(i);if(c===null){s.push("");return}let l=[c.shift()],u=this.displayWidth(l[0]);c.forEach(f=>{let h=this.displayWidth(f);if(u+h<=t){l.push(f),u+=h;return}s.push(l.join(""));let d=f.trimStart();l=[d],u=this.displayWidth(d)}),s.push(l.join(""))}),s.join(`
@@ -28,9 +28,9 @@ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
28
28
  `),this.outputHelp({error:!0}));let r=t||{},i=r.exitCode||1,s=r.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Qe.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Qe.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new mI(this.options),t=o(r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r)),"hasCustomOptionValue");this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=o(a=>{let c=a.attributeName(),l=this.getOptionValue(c),u=this.options.find(h=>h.negate&&c===h.attributeName()),f=this.options.find(h=>!h.negate&&c===h.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:f||a},"findBestOptionFromValue"),i=o(a=>{let c=r(a),l=c.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${c.envVar}'`:`option '${c.flags}'`},"getErrorMessage"),s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let a=s.createHelp().visibleOptions(s).filter(c=>c.long).map(c=>c.long);i=i.concat(a),s=s.parent}while(s&&!s._enablePositionalOptions);t=r_(e,i)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=r_(e,i)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let i=this.createOption(t,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
29
29
  `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>hI(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Gi.basename(e,Gi.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=t.formatHelp(this,t);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,r,i,s;return t?(r=o(c=>this._outputConfiguration.writeErr(c),"baseWrite"),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=o(c=>this._outputConfiguration.writeOut(c),"baseWrite"),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:o(c=>(i||(c=this._outputConfiguration.stripColor(c)),r(c)),"write"),hasColors:i,helpWidth:s}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(Qe.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
30
30
  Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let a;typeof t=="function"?a=t({error:s.error,command:s.command}):a=t,a&&s.write(`${a}
31
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function n_(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}o(n_,"incrementNodeInspectorPort");function Gp(){if(Qe.env.NO_COLOR||Qe.env.FORCE_COLOR==="0"||Qe.env.FORCE_COLOR==="false")return!1;if(Qe.env.FORCE_COLOR||Qe.env.CLICOLOR_FORCE!==void 0)return!0}o(Gp,"useColor");Wp.Command=qp;Wp.useColor=Gp});var c_=v(fn=>{var{Argument:s_}=Ru(),{Command:Hp}=i_(),{CommanderError:gI,InvalidArgumentError:a_}=Dc(),{Help:yI}=Mp(),{Option:o_}=Vp();fn.program=new Hp;fn.createCommand=n=>new Hp(n);fn.createOption=(n,e)=>new o_(n,e);fn.createArgument=(n,e)=>new s_(n,e);fn.Command=Hp;fn.Option=o_;fn.Argument=s_;fn.Help=yI;fn.CommanderError=gI;fn.InvalidArgumentError=a_;fn.InvalidOptionArgumentError=a_});var zp=v(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.AssetClass=void 0;var u_;(function(n){n.AREA="ems__Area",n.TASK="ems__Task",n.PROJECT="ems__Project",n.MEETING="ems__Meeting",n.INITIATIVE="ems__Initiative",n.TASK_PROTOTYPE="ems__TaskPrototype",n.TASK_PROTOTYPE_UID="75302770-279e-4a59-ba85-09df29725713",n.MEETING_PROTOTYPE="ems__MeetingPrototype",n.EVENT_PROTOTYPE="exo__EventPrototype",n.PROJECT_PROTOTYPE="ems__ProjectPrototype",n.EVENT="exo__Event",n.DAILY_NOTE="pn__DailyNote",n.CONCEPT="ims__Concept",n.SESSION_START_EVENT="ems__SessionStartEvent",n.SESSION_END_EVENT="ems__SessionEndEvent",n.PROTOTYPE="exo__Prototype",n.CLASS="exo__Class",n.FLEETING_NOTE="ztlk__FleetingNote",n.FLEETING_NOTE_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7"})(u_||(Du.AssetClass=u_={}))});var Qp=v(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.EffortStatus=void 0;var f_;(function(n){n.DRAFT="ems__EffortStatusDraft",n.BACKLOG="ems__EffortStatusBacklog",n.ANALYSIS="ems__EffortStatusAnalysis",n.TODO="ems__EffortStatusToDo",n.DOING="ems__EffortStatusDoing",n.DONE="ems__EffortStatusDone",n.TRASHED="ems__EffortStatusTrashed"})(f_||(Nu.EffortStatus=f_={}))});var h_=v(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.hasPosition=vI;Lu.isFixed=_I;function vI(n){return typeof n.x=="number"&&typeof n.y=="number"}o(vI,"hasPosition");function _I(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}o(_I,"isFixed")});var d_=v(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.createEmptyGraphData=SI;Mu.mergeGraphData=bI;function SI(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}o(SI,"createEmptyGraphData");function bI(n,e){let t=new Map,r=new Set,i=[];for(let s of n.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of n.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}for(let s of e.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}o(bI,"mergeGraphData")});var Yp=v(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.createEdgeId=wI;ku.edgesEqual=EI;function wI(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}o(wI,"createEdgeId");function EI(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}o(EI,"edgesEqual")});var Kp=v(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.BUILT_IN_EDGE_STYLES=Tt.BUILT_IN_NODE_STYLES=Tt.DEFAULT_EDGE_STYLE=Tt.DEFAULT_NODE_STYLE=Tt.RDF_TYPE_PREDICATES=void 0;Tt.mergeNodeStyles=TI;Tt.mergeEdgeStyles=xI;Tt.extractLocalName=AI;Tt.isClassType=CI;Tt.isTypePredicate=II;Tt.isSubClassPredicate=OI;Tt.RDF_TYPE_PREDICATES={RDF_TYPE:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",RDFS_CLASS:"http://www.w3.org/2000/01/rdf-schema#Class",OWL_CLASS:"http://www.w3.org/2002/07/owl#Class",RDFS_SUBCLASS_OF:"http://www.w3.org/2000/01/rdf-schema#subClassOf",OWL_EQUIVALENT_CLASS:"http://www.w3.org/2002/07/owl#equivalentClass",RDFS_LABEL:"http://www.w3.org/2000/01/rdf-schema#label",RDFS_COMMENT:"http://www.w3.org/2000/01/rdf-schema#comment"};Tt.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Tt.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Tt.BUILT_IN_NODE_STYLES={"http://www.w3.org/2000/01/rdf-schema#Class":{color:"#f59e0b",shape:"diamond",size:40},"http://www.w3.org/2002/07/owl#Class":{color:"#f59e0b",shape:"diamond",size:40},ems__Task:{color:"#22c55e",shape:"circle"},ems__Project:{color:"#3b82f6",shape:"square"},ems__Area:{color:"#8b5cf6",shape:"hexagon",size:40},ems__Meeting:{color:"#ec4899",shape:"circle"},exo__Class:{color:"#f59e0b",shape:"diamond"},ims__Person:{color:"#06b6d4",shape:"circle"}};Tt.BUILT_IN_EDGE_STYLES={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":{color:"#f59e0b",lineStyle:"dashed",arrow:"standard"},"http://www.w3.org/2000/01/rdf-schema#subClassOf":{color:"#8b5cf6",width:2,arrow:"triangle"},"https://exocortex.my/ontology/ems#Effort_parent":{color:"#6366f1",width:2,arrow:"standard"},"https://exocortex.my/ontology/exo#Asset_prototype":{color:"#f59e0b",lineStyle:"dashed",arrow:"circle"},"https://exocortex.my/ontology/exo#references":{color:"#22c55e",opacity:.4,arrow:"standard"}};function TI(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(TI,"mergeNodeStyles");function xI(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(xI,"mergeEdgeStyles");function AI(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}o(AI,"extractLocalName");function CI(n){return n===Tt.RDF_TYPE_PREDICATES.RDFS_CLASS||n===Tt.RDF_TYPE_PREDICATES.OWL_CLASS}o(CI,"isClassType");function II(n){return n===Tt.RDF_TYPE_PREDICATES.RDF_TYPE}o(II,"isTypePredicate");function OI(n){return n===Tt.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}o(OI,"isSubClassPredicate")});var m_=v(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var Ye=v(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.IRI=void 0;var Xp=class n{static{o(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!n.isValidIRI(t))throw new Error("Invalid IRI format");this._value=t}get value(){return this._value}equals(e){return this._value===e._value}toString(){return this._value}static isValidIRI(e){if(!e||e.trim().length===0||/\s/.test(e)||!/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=["http","https","ftp","ftps","file","mailto","tel","data","ws","wss","urn","obsidian"],i=e.match(/^([a-z][a-z0-9+.-]*?):/i);if(i){let s=i[1].toLowerCase();if(!r.includes(s))return!1}try{return new URL(e),!0}catch{return/^urn:[a-z0-9][a-z0-9-]{0,31}:[^\s]+$/i.test(e)}}};ju.IRI=Xp});var mt=v(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Literal=void 0;Ys.parseLanguageTag=g_;Ys.createDirectionalLiteral=RI;Ys.createLiteralFromLanguageTag=FI;var PI="http://www.w3.org/2001/XMLSchema#string",Nc=class{static{o(this,"Literal")}constructor(e,t,r,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&r)throw new Error("Literal cannot have both datatype and language tag");if(i&&!r)throw new Error("Literal cannot have direction without language tag");if(i&&i!=="ltr"&&i!=="rtl")throw new Error('Direction must be "ltr" or "rtl"');this._value=e,this._datatype=t,this._language=r?r.toLowerCase():void 0,this._direction=i}get value(){return this._value}get datatype(){return this._datatype}get language(){return this._language}get direction(){return this._direction}hasDirection(){return this._direction!==void 0}equals(e){if(this._value!==e._value||this._language!==e._language||this._direction!==e._direction)return!1;let t=this.normalizedDatatype(),r=e.normalizedDatatype();return t===r}normalizedDatatype(){return!this._datatype||this._datatype.value===PI?null:this._datatype.value}toString(){let e=`"${this._value}"`;return this._datatype?e+=`^^<${this._datatype.value}>`:this._language&&(e+=`@${this._language}`,this._direction&&(e+=`--${this._direction}`)),e}};Ys.Literal=Nc;function g_(n){let t=n.lastIndexOf("--");if(t===-1)return{language:n.toLowerCase()};let r=n.substring(t+2),i=n.substring(0,t);return r==="ltr"||r==="rtl"?{language:i.toLowerCase(),direction:r}:{language:n.toLowerCase()}}o(g_,"parseLanguageTag");function RI(n,e,t){return new Nc(n,void 0,e,t)}o(RI,"createDirectionalLiteral");function FI(n,e){let{language:t,direction:r}=g_(e);return new Nc(n,void 0,t,r)}o(FI,"createLiteralFromLanguageTag")});var Lt=v(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.BlankNode=void 0;var $u=class n{static{o(this,"BlankNode")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("BlankNode id cannot be empty");this._id=t}get id(){return this._id}equals(e){return this._id===e._id}toString(){return`_:${this._id}`}static generateId(){return`b${++n.counter}`}static create(){return new n(n.generateId())}};Vu.BlankNode=$u;$u.counter=0});var hn=v(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.Namespace=void 0;var y_=Ye(),Ar=class{static{o(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new y_.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new y_.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[r,i]=t;return r!==this._prefix?null:this.term(i)}};Uu.Namespace=Ar;Ar.RDF=new Ar("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Ar.RDFS=new Ar("rdfs","http://www.w3.org/2000/01/rdf-schema#");Ar.OWL=new Ar("owl","http://www.w3.org/2002/07/owl#");Ar.XSD=new Ar("xsd","http://www.w3.org/2001/XMLSchema#");Ar.EXO=new Ar("exo","https://exocortex.my/ontology/exo#");Ar.EMS=new Ar("ems","https://exocortex.my/ontology/ems#")});var Wi=v(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Triple=void 0;var Jp=Ye(),Zp=mt(),em=Lt(),tm=class{static{o(this,"Triple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof Jp.IRI&&t instanceof Jp.IRI||e instanceof em.BlankNode&&t instanceof em.BlankNode||e instanceof Zp.Literal&&t instanceof Zp.Literal||this.isQuotedTriple(e)&&this.isQuotedTriple(t)?e.equals(t):!1}isQuotedTriple(e){return typeof e=="object"&&e!==null&&"termType"in e&&e.termType==="QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`${e} ${t} ${r} .`}nodeToString(e){return e instanceof Jp.IRI?`<${e.value}>`:e instanceof em.BlankNode||e instanceof Zp.Literal||this.isQuotedTriple(e)?e.toString():""}};Bu.Triple=tm});var Lc=v(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.QuotedTriple=void 0;var rm=Ye(),nm=mt(),im=Lt(),sm=class n{static{o(this,"QuotedTriple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof rm.IRI&&t instanceof rm.IRI||e instanceof im.BlankNode&&t instanceof im.BlankNode||e instanceof nm.Literal&&t instanceof nm.Literal||e instanceof n&&t instanceof n?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`<< ${e} ${t} ${r} >>`}nodeToString(e){return e instanceof rm.IRI?`<${e.value}>`:e instanceof im.BlankNode||e instanceof nm.Literal||e instanceof n?e.toString():""}};qu.QuotedTriple=sm});var v_=v(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.QuotedTriple=Rt.Triple=Rt.Namespace=Rt.BlankNode=Rt.createLiteralFromLanguageTag=Rt.createDirectionalLiteral=Rt.parseLanguageTag=Rt.Literal=Rt.IRI=void 0;var DI=Ye();Object.defineProperty(Rt,"IRI",{enumerable:!0,get:o(function(){return DI.IRI},"get")});var Gu=mt();Object.defineProperty(Rt,"Literal",{enumerable:!0,get:o(function(){return Gu.Literal},"get")});Object.defineProperty(Rt,"parseLanguageTag",{enumerable:!0,get:o(function(){return Gu.parseLanguageTag},"get")});Object.defineProperty(Rt,"createDirectionalLiteral",{enumerable:!0,get:o(function(){return Gu.createDirectionalLiteral},"get")});Object.defineProperty(Rt,"createLiteralFromLanguageTag",{enumerable:!0,get:o(function(){return Gu.createLiteralFromLanguageTag},"get")});var NI=Lt();Object.defineProperty(Rt,"BlankNode",{enumerable:!0,get:o(function(){return NI.BlankNode},"get")});var LI=hn();Object.defineProperty(Rt,"Namespace",{enumerable:!0,get:o(function(){return LI.Namespace},"get")});var MI=Wi();Object.defineProperty(Rt,"Triple",{enumerable:!0,get:o(function(){return MI.Triple},"get")});var kI=Lc();Object.defineProperty(Rt,"QuotedTriple",{enumerable:!0,get:o(function(){return kI.QuotedTriple},"get")})});var Wu=v(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.UUID_URL_NAMESPACE=pn.DEFAULT_LANGUAGE_TAG=pn.REQUIRED_PROPERTIES=pn.ALLOWED_PROPERTIES=pn.Exo003MetadataType=void 0;var dn;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(dn||(pn.Exo003MetadataType=dn={}));pn.ALLOWED_PROPERTIES={[dn.Namespace]:["metadata","uri","aliases"],[dn.Anchor]:["metadata","uri","aliases"],[dn.BlankNode]:["metadata","uri","aliases"],[dn.Statement]:["metadata","subject","predicate","object","aliases"],[dn.Body]:["metadata","subject","predicate","aliases"]};pn.REQUIRED_PROPERTIES={[dn.Namespace]:["metadata","uri"],[dn.Anchor]:["metadata","uri"],[dn.BlankNode]:["metadata","uri"],[dn.Statement]:["metadata","subject","predicate","object"],[dn.Body]:["metadata","subject","predicate"]};pn.DEFAULT_LANGUAGE_TAG="ru";pn.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var __=v(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var S_=v(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.default="00000000-0000-0000-0000-000000000000"});var b_=v(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var Mc=v(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var jI=b_();function $I(n){return typeof n=="string"&&jI.default.test(n)}o($I,"validate");lm.default=$I});var kc=v(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var VI=Mc();function UI(n){if(!(0,VI.default)(n))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(n.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(n.slice(9,13),16))>>>8,e&255,(e=parseInt(n.slice(14,18),16))>>>8,e&255,(e=parseInt(n.slice(19,23),16))>>>8,e&255,(e=parseInt(n.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}o(UI,"parse");um.default=UI});var Hi=v(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.unsafeStringify=void 0;var BI=Mc(),tr=[];for(let n=0;n<256;++n)tr.push((n+256).toString(16).slice(1));function w_(n,e=0){return(tr[n[e+0]]+tr[n[e+1]]+tr[n[e+2]]+tr[n[e+3]]+"-"+tr[n[e+4]]+tr[n[e+5]]+"-"+tr[n[e+6]]+tr[n[e+7]]+"-"+tr[n[e+8]]+tr[n[e+9]]+"-"+tr[n[e+10]]+tr[n[e+11]]+tr[n[e+12]]+tr[n[e+13]]+tr[n[e+14]]+tr[n[e+15]]).toLowerCase()}o(w_,"unsafeStringify");jc.unsafeStringify=w_;function qI(n,e=0){let t=w_(n,e);if(!(0,BI.default)(t))throw TypeError("Stringified UUID is invalid");return t}o(qI,"stringify");jc.default=qI});var Qu=v(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var GI=require("crypto"),zu=new Uint8Array(256),Hu=zu.length;function WI(){return Hu>zu.length-16&&((0,GI.randomFillSync)(zu),Hu=0),zu.slice(Hu,Hu+=16)}o(WI,"rng");fm.default=WI});var hm=v(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.updateV1State=void 0;var E_=Qu(),HI=Hi(),$c={};function zI(n,e,t){let r,i=n?._v6??!1;if(n){let s=Object.keys(n);s.length===1&&s[0]==="_v6"&&(n=void 0)}if(n)r=T_(n.random??n.rng?.()??(0,E_.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),a=(0,E_.default)();x_($c,s,a),r=T_(a,$c.msecs,$c.nsecs,i?void 0:$c.clockseq,i?void 0:$c.node,e,t)}return e??(0,HI.unsafeStringify)(r)}o(zI,"v1");function x_(n,e,t){return n.msecs??=-1/0,n.nsecs??=0,e===n.msecs?(n.nsecs++,n.nsecs>=1e4&&(n.node=void 0,n.nsecs=0)):e>n.msecs?n.nsecs=0:e<n.msecs&&(n.node=void 0),n.node||(n.node=t.slice(10,16),n.node[0]|=1,n.clockseq=(t[8]<<8|t[9])&16383),n.msecs=e,n}o(x_,"updateV1State");Vc.updateV1State=x_;function T_(n,e,t,r,i,s,a=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),a=0;else if(a<0||a+16>s.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);e??=Date.now(),t??=0,r??=(n[8]<<8|n[9])&16383,i??=n.slice(10,16),e+=122192928e5;let c=((e&268435455)*1e4+t)%4294967296;s[a++]=c>>>24&255,s[a++]=c>>>16&255,s[a++]=c>>>8&255,s[a++]=c&255;let l=e/4294967296*1e4&268435455;s[a++]=l>>>8&255,s[a++]=l&255,s[a++]=l>>>24&15|16,s[a++]=l>>>16&255,s[a++]=r>>>8|128,s[a++]=r&255;for(let u=0;u<6;++u)s[a++]=i[u];return s}o(T_,"v1Bytes");Vc.default=zI});var pm=v(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var QI=kc(),YI=Hi();function KI(n){let e=typeof n=="string"?(0,QI.default)(n):n,t=XI(e);return typeof n=="string"?(0,YI.unsafeStringify)(t):t}o(KI,"v1ToV6");dm.default=KI;function XI(n){return Uint8Array.of((n[6]&15)<<4|n[7]>>4&15,(n[7]&15)<<4|(n[4]&240)>>4,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,(n[1]&15)<<4|(n[2]&240)>>4,96|n[2]&15,n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(XI,"_v1ToV6")});var A_=v(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var JI=require("crypto");function ZI(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,JI.createHash)("md5").update(n).digest()}o(ZI,"md5");mm.default=ZI});var Uc=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.URL=zi.DNS=zi.stringToBytes=void 0;var C_=kc(),eO=Hi();function I_(n){n=unescape(encodeURIComponent(n));let e=new Uint8Array(n.length);for(let t=0;t<n.length;++t)e[t]=n.charCodeAt(t);return e}o(I_,"stringToBytes");zi.stringToBytes=I_;zi.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";zi.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function tO(n,e,t,r,i,s){let a=typeof t=="string"?I_(t):t,c=typeof r=="string"?(0,C_.default)(r):r;if(typeof r=="string"&&(r=(0,C_.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+a.length);if(l.set(c),l.set(a,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){s=s||0;for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,eO.unsafeStringify)(l)}o(tO,"v35");zi.default=tO});var P_=v(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.URL=Ks.DNS=void 0;var rO=A_(),gm=Uc(),O_=Uc();Object.defineProperty(Ks,"DNS",{enumerable:!0,get:o(function(){return O_.DNS},"get")});Object.defineProperty(Ks,"URL",{enumerable:!0,get:o(function(){return O_.URL},"get")});function ym(n,e,t,r){return(0,gm.default)(48,rO.default,n,e,t,r)}o(ym,"v3");ym.DNS=gm.DNS;ym.URL=gm.URL;Ks.default=ym});var R_=v(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var nO=require("crypto");vm.default={randomUUID:nO.randomUUID}});var D_=v(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var F_=R_(),iO=Qu(),sO=Hi();function aO(n,e,t){if(F_.default.randomUUID&&!e&&!n)return F_.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,iO.default)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return(0,sO.unsafeStringify)(r)}o(aO,"v4");_m.default=aO});var N_=v(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var oO=require("crypto");function cO(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,oO.createHash)("sha1").update(n).digest()}o(cO,"sha1");Sm.default=cO});var M_=v(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.URL=Xs.DNS=void 0;var lO=N_(),bm=Uc(),L_=Uc();Object.defineProperty(Xs,"DNS",{enumerable:!0,get:o(function(){return L_.DNS},"get")});Object.defineProperty(Xs,"URL",{enumerable:!0,get:o(function(){return L_.URL},"get")});function wm(n,e,t,r){return(0,bm.default)(80,lO.default,n,e,t,r)}o(wm,"v5");wm.DNS=bm.DNS;wm.URL=bm.URL;Xs.default=wm});var k_=v(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var uO=Hi(),fO=hm(),hO=pm();function dO(n,e,t){n??={},t??=0;let r=(0,fO.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,hO.default)(r),e){for(let i=0;i<16;i++)e[t+i]=r[i];return e}return(0,uO.unsafeStringify)(r)}o(dO,"v6");Em.default=dO});var j_=v(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var pO=kc(),mO=Hi();function gO(n){let e=typeof n=="string"?(0,pO.default)(n):n,t=yO(e);return typeof n=="string"?(0,mO.unsafeStringify)(t):t}o(gO,"v6ToV1");Tm.default=gO;function yO(n){return Uint8Array.of((n[3]&15)<<4|n[4]>>4&15,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|n[6]&15,n[7],(n[1]&15)<<4|(n[2]&240)>>4,(n[2]&15)<<4|(n[3]&240)>>4,16|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(yO,"_v6ToV1")});var B_=v(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.updateV7State=void 0;var $_=Qu(),vO=Hi(),xm={};function _O(n,e,t){let r;if(n)r=V_(n.random??n.rng?.()??(0,$_.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,$_.default)();U_(xm,i,s),r=V_(s,xm.msecs,xm.seq,e,t)}return e??(0,vO.unsafeStringify)(r)}o(_O,"v7");function U_(n,e,t){return n.msecs??=-1/0,n.seq??=0,e>n.msecs?(n.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],n.msecs=e):(n.seq=n.seq+1|0,n.seq===0&&n.msecs++),n}o(U_,"updateV7State");Bc.updateV7State=U_;function V_(n,e,t,r,i=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=n[6]*127<<24|n[7]<<16|n[8]<<8|n[9],r[i++]=e/1099511627776&255,r[i++]=e/4294967296&255,r[i++]=e/16777216&255,r[i++]=e/65536&255,r[i++]=e/256&255,r[i++]=e&255,r[i++]=112|t>>>28&15,r[i++]=t>>>20&255,r[i++]=128|t>>>14&63,r[i++]=t>>>6&255,r[i++]=t<<2&255|n[10]&3,r[i++]=n[11],r[i++]=n[12],r[i++]=n[13],r[i++]=n[14],r[i++]=n[15],r}o(V_,"v7Bytes");Bc.default=_O});var q_=v(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var SO=Mc();function bO(n){if(!(0,SO.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}o(bO,"version");Am.default=bO});var Cr=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.version=Xe.validate=Xe.v7=Xe.v6ToV1=Xe.v6=Xe.v5=Xe.v4=Xe.v3=Xe.v1ToV6=Xe.v1=Xe.stringify=Xe.parse=Xe.NIL=Xe.MAX=void 0;var wO=__();Object.defineProperty(Xe,"MAX",{enumerable:!0,get:o(function(){return wO.default},"get")});var EO=S_();Object.defineProperty(Xe,"NIL",{enumerable:!0,get:o(function(){return EO.default},"get")});var TO=kc();Object.defineProperty(Xe,"parse",{enumerable:!0,get:o(function(){return TO.default},"get")});var xO=Hi();Object.defineProperty(Xe,"stringify",{enumerable:!0,get:o(function(){return xO.default},"get")});var AO=hm();Object.defineProperty(Xe,"v1",{enumerable:!0,get:o(function(){return AO.default},"get")});var CO=pm();Object.defineProperty(Xe,"v1ToV6",{enumerable:!0,get:o(function(){return CO.default},"get")});var IO=P_();Object.defineProperty(Xe,"v3",{enumerable:!0,get:o(function(){return IO.default},"get")});var OO=D_();Object.defineProperty(Xe,"v4",{enumerable:!0,get:o(function(){return OO.default},"get")});var PO=M_();Object.defineProperty(Xe,"v5",{enumerable:!0,get:o(function(){return PO.default},"get")});var RO=k_();Object.defineProperty(Xe,"v6",{enumerable:!0,get:o(function(){return RO.default},"get")});var FO=j_();Object.defineProperty(Xe,"v6ToV1",{enumerable:!0,get:o(function(){return FO.default},"get")});var DO=B_();Object.defineProperty(Xe,"v7",{enumerable:!0,get:o(function(){return DO.default},"get")});var NO=Mc();Object.defineProperty(Xe,"validate",{enumerable:!0,get:o(function(){return NO.default},"get")});var LO=q_();Object.defineProperty(Xe,"version",{enumerable:!0,get:o(function(){return LO.default},"get")})});var Om=v(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.Exo003UUIDGenerator=void 0;var Cm=Cr(),G_=Wu(),Im=class{static{o(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,Cm.v5)(e,G_.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let r=this.generateNamespaceUUID(e);return(0,Cm.v5)(t,r)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:r}=this.splitIRI(e);return r?this.generateAssetUUID(t,r):(0,Cm.v5)(e,G_.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let r="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(r,i)}static generateStatementUUID(e,t,r){if(!e||!t||!r)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${r}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let r="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(r,i)}static splitIRI(e){let t=e.lastIndexOf("#");if(t!==-1&&t<e.length-1)return{namespace:e.substring(0,t+1),localName:e.substring(t+1)};let r=e.lastIndexOf("/"),i=e.indexOf("://");return r!==-1&&r>i+2&&r<e.length-1?{namespace:e.substring(0,r+1),localName:e.substring(r+1)}:{namespace:e,localName:""}}static isValidUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};Yu.Exo003UUIDGenerator=Im});var H_=v(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.Exo003Parser=void 0;var st=Wu(),qc=Om(),us=Ye(),Ku=mt(),W_=Lt(),MO=Wi(),Pm=class{static{o(this,"Exo003Parser")}static parse(e,t){let r=this.validate(e);if(!r.valid)return{success:!1,errors:r.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===st.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],r=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:r};let i=e.metadata;if(!Object.values(st.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(st.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:r};let s=i,a=st.ALLOWED_PROPERTIES[s],c=st.REQUIRED_PROPERTIES[s];for(let l of c)(e[l]===void 0||e[l]===null)&&t.push(`Missing required property: ${l}`);for(let l of Object.keys(e))a.includes(l)||t.push(`Forbidden property for ${s}: ${l}`);switch(s){case st.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case st.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case st.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case st.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case st.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,r);break}return{valid:t.length===0,errors:t,warnings:r}}static parseByType(e,t){let r={metadata:t,aliases:e.aliases};switch(t){case st.Exo003MetadataType.Namespace:return{...r,metadata:st.Exo003MetadataType.Namespace,uri:e.uri};case st.Exo003MetadataType.Anchor:return{...r,metadata:st.Exo003MetadataType.Anchor,uri:e.uri};case st.Exo003MetadataType.BlankNode:return{...r,metadata:st.Exo003MetadataType.BlankNode,uri:e.uri};case st.Exo003MetadataType.Statement:return{...r,metadata:st.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case st.Exo003MetadataType.Body:return{...r,metadata:st.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateAnchorMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateBlankNodeMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,a=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of a)l&&typeof l!="string"&&t.push(`${c} must be a string`)}static validateBodyMetadata(e,t,r){let i=e.subject,s=e.predicate;i&&typeof i!="string"&&t.push("subject must be a string"),s&&typeof s!="string"&&t.push("predicate must be a string")}static toTriple(e,t,r){let i=t(e.subject),s;if(i.type==="iri")s=new us.IRI(i.value);else if(i.type==="blank")s=new W_.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let a=t(e.predicate);if(a.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new us.IRI(a.value),l=t(e.object),u;if(l.type==="iri")u=new us.IRI(l.value);else if(l.type==="blank")u=new W_.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new Ku.Literal(f,new us.IRI(l.datatype));else{let h=l.language||st.DEFAULT_LANGUAGE_TAG;u=(0,Ku.createDirectionalLiteral)(f,h,l.direction)}}return new MO.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new Ku.Literal(t,new us.IRI(r.datatype));let i=r?.language||st.DEFAULT_LANGUAGE_TAG;return(0,Ku.createDirectionalLiteral)(t,i,r?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(st.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case st.Exo003MetadataType.Namespace:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.Anchor:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.BlankNode:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.Statement:{let r=e;return qc.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case st.Exo003MetadataType.Body:{let r=e;return qc.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};Xu.Exo003Parser=Pm});var Rm=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Exo003Parser=hr.Exo003UUIDGenerator=hr.UUID_URL_NAMESPACE=hr.DEFAULT_LANGUAGE_TAG=hr.REQUIRED_PROPERTIES=hr.ALLOWED_PROPERTIES=hr.Exo003MetadataType=void 0;var Gc=Wu();Object.defineProperty(hr,"Exo003MetadataType",{enumerable:!0,get:o(function(){return Gc.Exo003MetadataType},"get")});Object.defineProperty(hr,"ALLOWED_PROPERTIES",{enumerable:!0,get:o(function(){return Gc.ALLOWED_PROPERTIES},"get")});Object.defineProperty(hr,"REQUIRED_PROPERTIES",{enumerable:!0,get:o(function(){return Gc.REQUIRED_PROPERTIES},"get")});Object.defineProperty(hr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:o(function(){return Gc.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(hr,"UUID_URL_NAMESPACE",{enumerable:!0,get:o(function(){return Gc.UUID_URL_NAMESPACE},"get")});var kO=Om();Object.defineProperty(hr,"Exo003UUIDGenerator",{enumerable:!0,get:o(function(){return kO.Exo003UUIDGenerator},"get")});var jO=H_();Object.defineProperty(hr,"Exo003Parser",{enumerable:!0,get:o(function(){return jO.Exo003Parser},"get")})});var Js=v(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.WikiLinkHelpers=void 0;var Ju=class{static{o(this,"WikiLinkHelpers")}static normalize(e){return e?e.replace(this.WIKI_LINK_PATTERN,"").trim():""}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(r=>this.normalize(r)).filter(r=>r.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let r=this.normalizeArray(e),i=this.normalize(t);return r.includes(i)}};Zu.WikiLinkHelpers=Ju;Ju.WIKI_LINK_PATTERN=/\[\[|\]\]/g});var dr=v(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.EffortStatus=Ka.AssetClass=void 0;var $O=zp();Object.defineProperty(Ka,"AssetClass",{enumerable:!0,get:o(function(){return $O.AssetClass},"get")});var VO=Qp();Object.defineProperty(Ka,"EffortStatus",{enumerable:!0,get:o(function(){return VO.EffortStatus},"get")})});var fs=v(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.hasClass=ea;pr.isAreaOrProject=UO;pr.isEffort=BO;pr.hasStatus=qO;pr.isAssetArchived=GO;pr.hasEmptyProperties=WO;pr.needsFolderRepair=HO;pr.getTodayDateString=Fm;pr.isPlannedForToday=zO;pr.hasPlannedStartTimestamp=QO;pr.extractDailyNoteDate=YO;pr.isCurrentDateGteDay=KO;pr.inheritsFromPrototype=Y_;pr.isPrototypeClass=JO;var Q_=Js(),Zs=dr();function ea(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>Q_.WikiLinkHelpers.normalize(r)===e):!1}o(ea,"hasClass");function UO(n){return ea(n,Zs.AssetClass.AREA)||ea(n,Zs.AssetClass.PROJECT)}o(UO,"isAreaOrProject");function BO(n){return ea(n,Zs.AssetClass.TASK)||ea(n,Zs.AssetClass.PROJECT)||ea(n,Zs.AssetClass.MEETING)}o(BO,"isEffort");function qO(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?Q_.WikiLinkHelpers.normalize(t)===e:!1}o(qO,"hasStatus");function GO(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}o(GO,"isAssetArchived");function WO(n){return!n||Object.keys(n).length===0?!1:Object.values(n).some(e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0))}o(WO,"hasEmptyProperties");function HO(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}o(HO,"needsFolderRepair");function Fm(){let n=new Date,e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}o(Fm,"getTodayDateString");function zO(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=Fm();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}o(zO,"isPlannedForToday");function QO(n){let e=n.ems__Effort_plannedStartTimestamp;return e?typeof e=="string"?e.trim().length>0:Array.isArray(e)&&e.length>0?String(e[0]).trim().length>0:!1:!1}o(QO,"hasPlannedStartTimestamp");function YO(n){let e=n.pn__DailyNote_day;if(!e)return null;if(typeof e=="string"){let t=e.match(/\[\[([^\[\]]+)\]\]/);return t?t[1]:e}if(Array.isArray(e)&&e.length>0){let t=String(e[0]),r=t.match(/\[\[([^\[\]]+)\]\]/);return r?r[1]:t}return null}o(YO,"extractDailyNoteDate");function KO(n){return Fm()>=n}o(KO,"isCurrentDateGteDay");function z_(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}o(z_,"normalizeWithQuotes");var XO=10;function Y_(n,e=XO){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let a of s){let c=z_(a);c&&i.push({className:c,depth:0})}for(;i.length>0;){let a=i.shift();if(!a)continue;let{className:c,depth:l}=a;if(l>e)continue;if(c===Zs.AssetClass.PROTOTYPE)return!0;if(r.has(c))continue;r.add(c);let u=`${c}__exo__Class_superClass`,f=n[u];if(f){let h=Array.isArray(f)?f:[f];for(let d of h){let p=z_(d);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}o(Y_,"inheritsFromPrototype");function JO(n,e){return ea(n,Zs.AssetClass.CLASS)?Y_(e):!1}o(JO,"isPrototypeClass")});var K_=v(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.canCreateTask=ZO;Ja.canCreateRelatedTask=eP;Ja.canConvertTaskToProject=tP;Ja.canSetCriticalityZone=rP;var Xa=fs(),Dm=dr();function ZO(n){return(0,Xa.isAreaOrProject)(n.instanceClass)}o(ZO,"canCreateTask");function eP(n){return!(!(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)||(0,Xa.isAssetArchived)(n.isArchived))}o(eP,"canCreateRelatedTask");function tP(n){return(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)}o(tP,"canConvertTaskToProject");function rP(n){return!(!(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)||(0,Xa.isAssetArchived)(n.isArchived))}o(rP,"canSetCriticalityZone")});var X_=v(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.canCreateProject=nP;Za.canMoveToAnalysis=iP;Za.canMoveToToDo=sP;Za.canConvertProjectToTask=aP;var hs=fs(),ds=dr();function nP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.AREA)||(0,hs.hasClass)(n.instanceClass,ds.AssetClass.INITIATIVE)||(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)}o(nP,"canCreateProject");function iP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)?(0,hs.hasStatus)(n.currentStatus,ds.EffortStatus.BACKLOG):!1}o(iP,"canMoveToAnalysis");function sP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)?(0,hs.hasStatus)(n.currentStatus,ds.EffortStatus.ANALYSIS):!1}o(sP,"canMoveToToDo");function aP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)}o(aP,"canConvertProjectToTask")});var eS=v(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.canCreateChildArea=oP;ef.canSetActiveFocus=cP;var J_=fs(),Z_=dr();function oP(n){return(0,J_.hasClass)(n.instanceClass,Z_.AssetClass.AREA)}o(oP,"canCreateChildArea");function cP(n){return(0,J_.hasClass)(n.instanceClass,Z_.AssetClass.AREA)}o(cP,"canSetActiveFocus")});var rS=v(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.canPlanOnToday=lP;Or.canPlanForEvening=uP;Or.canShiftDayBackward=fP;Or.canShiftDayForward=hP;Or.canSetDraftStatus=dP;Or.canMoveToBacklog=pP;Or.canStartEffort=mP;Or.canMarkDone=gP;Or.canTrashEffort=yP;Or.canVoteOnEffort=vP;Or.canRollbackStatus=_P;Or.canArchiveTask=SP;Or.canMarkReviewed=bP;var tS=Js(),tt=fs(),Ir=dr();function lP(n){return!(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isPlannedForToday)(n.metadata))}o(lP,"canPlanOnToday");function uP(n){return!(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.TASK)&&!(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.MEETING)?!1:(0,tt.hasStatus)(n.currentStatus,Ir.EffortStatus.BACKLOG)}o(uP,"canPlanForEvening");function fP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasPlannedStartTimestamp)(n.metadata):!1}o(fP,"canShiftDayBackward");function hP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasPlannedStartTimestamp)(n.metadata):!1}o(hP,"canShiftDayForward");function dP(n){return(0,tt.isEffort)(n.instanceClass)?!n.currentStatus:!1}o(dP,"canSetDraftStatus");function pP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasStatus)(n.currentStatus,Ir.EffortStatus.DRAFT):!1}o(pP,"canMoveToBacklog");function mP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.TASK)||(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.MEETING)?(0,tt.hasStatus)(n.currentStatus,Ir.EffortStatus.BACKLOG):(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.PROJECT)?(0,tt.hasStatus)(n.currentStatus,Ir.EffortStatus.TODO):!1:!1}o(mP,"canStartEffort");function gP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasStatus)(n.currentStatus,Ir.EffortStatus.DOING):!1}o(gP,"canMarkDone");function yP(n){return(0,tt.isEffort)(n.instanceClass)?n.currentStatus?!(Array.isArray(n.currentStatus)?n.currentStatus:[n.currentStatus]).some(r=>{let i=tS.WikiLinkHelpers.normalize(r);return i===Ir.EffortStatus.TRASHED||i===Ir.EffortStatus.DONE}):!0:!1}o(yP,"canTrashEffort");function vP(n){return!(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isAssetArchived)(n.isArchived))}o(vP,"canVoteOnEffort");function _P(n){if(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isAssetArchived)(n.isArchived)||!n.currentStatus)return!1;let e=Array.isArray(n.currentStatus)?n.currentStatus[0]:n.currentStatus;return!(!e||tS.WikiLinkHelpers.normalize(e)===Ir.EffortStatus.TRASHED)}o(_P,"canRollbackStatus");function SP(n){return!(0,tt.isAssetArchived)(n.isArchived)}o(SP,"canArchiveTask");function bP(n){return!(!(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.TASK)&&!(0,tt.hasClass)(n.instanceClass,Ir.AssetClass.PROJECT)||(0,tt.isAssetArchived)(n.isArchived))}o(bP,"canMarkReviewed")});var nS=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.canCreateEvent=wP;mn.canCreateInstance=EP;mn.canCleanProperties=TP;mn.canRepairFolder=xP;mn.canRenameToUid=AP;mn.canCopyLabelToAliases=CP;mn.canCreateNarrowerConcept=IP;mn.canCreateSubclass=OP;mn.canCreateTaskForDailyNote=PP;mn.canCopyFleetingNoteLabel=RP;var Pr=fs(),vi=dr();function wP(n){return(0,Pr.isAreaOrProject)(n.instanceClass)}o(wP,"canCreateEvent");function EP(n){return(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.TASK_PROTOTYPE)||(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.TASK_PROTOTYPE_UID)||(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.MEETING_PROTOTYPE)||(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.EVENT_PROTOTYPE)||(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.PROJECT_PROTOTYPE)?!0:(0,Pr.isPrototypeClass)(n.instanceClass,n.metadata)}o(EP,"canCreateInstance");function TP(n){return(0,Pr.hasEmptyProperties)(n.metadata)}o(TP,"canCleanProperties");function xP(n){return(0,Pr.needsFolderRepair)(n.currentFolder,n.expectedFolder)}o(xP,"canRepairFolder");function AP(n,e){let t=n.metadata.exo__Asset_uid;return t?e!==t:!1}o(AP,"canRenameToUid");function CP(n){let e=n.metadata.exo__Asset_label;if(!e||typeof e!="string"||e.trim()==="")return!1;let t=e.trim(),r=n.metadata.aliases;return!r||!Array.isArray(r)||r.length===0?!0:!r.some(i=>typeof i!="string"?!1:i.trim()===t)}o(CP,"canCopyLabelToAliases");function IP(n){return(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.CONCEPT)}o(IP,"canCreateNarrowerConcept");function OP(n){return(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.CLASS)}o(OP,"canCreateSubclass");function PP(n){return!(!(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.DAILY_NOTE)||n.isArchived||!(0,Pr.extractDailyNoteDate)(n.metadata))}o(PP,"canCreateTaskForDailyNote");function RP(n){return(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.FLEETING_NOTE)||(0,Pr.hasClass)(n.instanceClass,vi.AssetClass.FLEETING_NOTE_UID)}o(RP,"canCopyFleetingNoteLabel")});var sS=v(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.canCopyFleetingNoteLabel=D.canCreateTaskForDailyNote=D.canCreateSubclass=D.canCreateNarrowerConcept=D.canCopyLabelToAliases=D.canRenameToUid=D.canRepairFolder=D.canCleanProperties=D.canCreateInstance=D.canCreateEvent=D.canMarkReviewed=D.canArchiveTask=D.canRollbackStatus=D.canVoteOnEffort=D.canTrashEffort=D.canMarkDone=D.canStartEffort=D.canMoveToBacklog=D.canSetDraftStatus=D.canShiftDayForward=D.canShiftDayBackward=D.canPlanForEvening=D.canPlanOnToday=D.canSetActiveFocus=D.canCreateChildArea=D.canConvertProjectToTask=D.canMoveToToDo=D.canMoveToAnalysis=D.canCreateProject=D.canSetCriticalityZone=D.canConvertTaskToProject=D.canCreateRelatedTask=D.canCreateTask=D.isPrototypeClass=D.inheritsFromPrototype=D.isCurrentDateGteDay=D.extractDailyNoteDate=D.hasPlannedStartTimestamp=D.isPlannedForToday=D.getTodayDateString=D.needsFolderRepair=D.hasEmptyProperties=D.isAssetArchived=D.hasStatus=D.isEffort=D.isAreaOrProject=D.hasClass=void 0;var Br=fs();Object.defineProperty(D,"hasClass",{enumerable:!0,get:o(function(){return Br.hasClass},"get")});Object.defineProperty(D,"isAreaOrProject",{enumerable:!0,get:o(function(){return Br.isAreaOrProject},"get")});Object.defineProperty(D,"isEffort",{enumerable:!0,get:o(function(){return Br.isEffort},"get")});Object.defineProperty(D,"hasStatus",{enumerable:!0,get:o(function(){return Br.hasStatus},"get")});Object.defineProperty(D,"isAssetArchived",{enumerable:!0,get:o(function(){return Br.isAssetArchived},"get")});Object.defineProperty(D,"hasEmptyProperties",{enumerable:!0,get:o(function(){return Br.hasEmptyProperties},"get")});Object.defineProperty(D,"needsFolderRepair",{enumerable:!0,get:o(function(){return Br.needsFolderRepair},"get")});Object.defineProperty(D,"getTodayDateString",{enumerable:!0,get:o(function(){return Br.getTodayDateString},"get")});Object.defineProperty(D,"isPlannedForToday",{enumerable:!0,get:o(function(){return Br.isPlannedForToday},"get")});Object.defineProperty(D,"hasPlannedStartTimestamp",{enumerable:!0,get:o(function(){return Br.hasPlannedStartTimestamp},"get")});Object.defineProperty(D,"extractDailyNoteDate",{enumerable:!0,get:o(function(){return Br.extractDailyNoteDate},"get")});Object.defineProperty(D,"isCurrentDateGteDay",{enumerable:!0,get:o(function(){return Br.isCurrentDateGteDay},"get")});Object.defineProperty(D,"inheritsFromPrototype",{enumerable:!0,get:o(function(){return Br.inheritsFromPrototype},"get")});Object.defineProperty(D,"isPrototypeClass",{enumerable:!0,get:o(function(){return Br.isPrototypeClass},"get")});var tf=K_();Object.defineProperty(D,"canCreateTask",{enumerable:!0,get:o(function(){return tf.canCreateTask},"get")});Object.defineProperty(D,"canCreateRelatedTask",{enumerable:!0,get:o(function(){return tf.canCreateRelatedTask},"get")});Object.defineProperty(D,"canConvertTaskToProject",{enumerable:!0,get:o(function(){return tf.canConvertTaskToProject},"get")});Object.defineProperty(D,"canSetCriticalityZone",{enumerable:!0,get:o(function(){return tf.canSetCriticalityZone},"get")});var rf=X_();Object.defineProperty(D,"canCreateProject",{enumerable:!0,get:o(function(){return rf.canCreateProject},"get")});Object.defineProperty(D,"canMoveToAnalysis",{enumerable:!0,get:o(function(){return rf.canMoveToAnalysis},"get")});Object.defineProperty(D,"canMoveToToDo",{enumerable:!0,get:o(function(){return rf.canMoveToToDo},"get")});Object.defineProperty(D,"canConvertProjectToTask",{enumerable:!0,get:o(function(){return rf.canConvertProjectToTask},"get")});var iS=eS();Object.defineProperty(D,"canCreateChildArea",{enumerable:!0,get:o(function(){return iS.canCreateChildArea},"get")});Object.defineProperty(D,"canSetActiveFocus",{enumerable:!0,get:o(function(){return iS.canSetActiveFocus},"get")});var Jr=rS();Object.defineProperty(D,"canPlanOnToday",{enumerable:!0,get:o(function(){return Jr.canPlanOnToday},"get")});Object.defineProperty(D,"canPlanForEvening",{enumerable:!0,get:o(function(){return Jr.canPlanForEvening},"get")});Object.defineProperty(D,"canShiftDayBackward",{enumerable:!0,get:o(function(){return Jr.canShiftDayBackward},"get")});Object.defineProperty(D,"canShiftDayForward",{enumerable:!0,get:o(function(){return Jr.canShiftDayForward},"get")});Object.defineProperty(D,"canSetDraftStatus",{enumerable:!0,get:o(function(){return Jr.canSetDraftStatus},"get")});Object.defineProperty(D,"canMoveToBacklog",{enumerable:!0,get:o(function(){return Jr.canMoveToBacklog},"get")});Object.defineProperty(D,"canStartEffort",{enumerable:!0,get:o(function(){return Jr.canStartEffort},"get")});Object.defineProperty(D,"canMarkDone",{enumerable:!0,get:o(function(){return Jr.canMarkDone},"get")});Object.defineProperty(D,"canTrashEffort",{enumerable:!0,get:o(function(){return Jr.canTrashEffort},"get")});Object.defineProperty(D,"canVoteOnEffort",{enumerable:!0,get:o(function(){return Jr.canVoteOnEffort},"get")});Object.defineProperty(D,"canRollbackStatus",{enumerable:!0,get:o(function(){return Jr.canRollbackStatus},"get")});Object.defineProperty(D,"canArchiveTask",{enumerable:!0,get:o(function(){return Jr.canArchiveTask},"get")});Object.defineProperty(D,"canMarkReviewed",{enumerable:!0,get:o(function(){return Jr.canMarkReviewed},"get")});var _i=nS();Object.defineProperty(D,"canCreateEvent",{enumerable:!0,get:o(function(){return _i.canCreateEvent},"get")});Object.defineProperty(D,"canCreateInstance",{enumerable:!0,get:o(function(){return _i.canCreateInstance},"get")});Object.defineProperty(D,"canCleanProperties",{enumerable:!0,get:o(function(){return _i.canCleanProperties},"get")});Object.defineProperty(D,"canRepairFolder",{enumerable:!0,get:o(function(){return _i.canRepairFolder},"get")});Object.defineProperty(D,"canRenameToUid",{enumerable:!0,get:o(function(){return _i.canRenameToUid},"get")});Object.defineProperty(D,"canCopyLabelToAliases",{enumerable:!0,get:o(function(){return _i.canCopyLabelToAliases},"get")});Object.defineProperty(D,"canCreateNarrowerConcept",{enumerable:!0,get:o(function(){return _i.canCreateNarrowerConcept},"get")});Object.defineProperty(D,"canCreateSubclass",{enumerable:!0,get:o(function(){return _i.canCreateSubclass},"get")});Object.defineProperty(D,"canCreateTaskForDailyNote",{enumerable:!0,get:o(function(){return _i.canCreateTaskForDailyNote},"get")});Object.defineProperty(D,"canCopyFleetingNoteLabel",{enumerable:!0,get:o(function(){return _i.canCopyFleetingNoteLabel},"get")})});var aS=v(ta=>{"use strict";var FP=ta&&ta.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),DP=ta&&ta.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&FP(e,n,t)};Object.defineProperty(ta,"__esModule",{value:!0});DP(sS(),ta)});var Lm=v(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.PropertyFieldType=void 0;Wc.rangeToFieldType=MP;var rr;(function(n){n.Text="text",n.Number="number",n.Date="date",n.DateTime="datetime",n.Boolean="boolean",n.Reference="reference",n.Enum="enum",n.StatusSelect="status-select",n.SizeSelect="size-select",n.Wikilink="wikilink",n.Timestamp="timestamp",n.Unknown="unknown"})(rr||(Wc.PropertyFieldType=rr={}));var oS="http://www.w3.org/2001/XMLSchema#",NP="https://exocortex.my/ontology/exo#",LP="https://exocortex.my/ontology/ems#";function MP(n){if(!n)return rr.Unknown;let e=n.trim();if(!e)return rr.Unknown;if(e.startsWith(oS)){let t=e.substring(oS.length);return Nm(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return Nm(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return Nm(r)}return e.startsWith(LP)||e.startsWith("ems:")?kP(e):e.startsWith(NP)||e.startsWith("exo:")||jP(e)?rr.Reference:rr.Text}o(MP,"rangeToFieldType");function Nm(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return rr.Text;case"integer":case"int":case"long":case"short":case"byte":case"nonnegativeinteger":case"positiveinteger":case"nonpositiveinteger":case"negativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"decimal":case"float":case"double":return rr.Number;case"date":return rr.Date;case"datetime":case"datetimestamp":return rr.DateTime;case"boolean":return rr.Boolean;case"time":return rr.Timestamp;default:return rr.Text}}o(Nm,"xsdTypeToFieldType");function kP(n){let e=n.toLowerCase();return e.includes("effortstatus")?rr.StatusSelect:e.includes("tasksize")?rr.SizeSelect:rr.Reference}o(kP,"emsTypeToFieldType");function jP(n){let e=n.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(r=>e.includes(r))}o(jP,"isClassReference")});var lS=v(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.propertyNameToUri=$P;Hc.uriToPropertyName=cS;Hc.extractPropertyLabel=VP;function $P(n){return n.replace(/^([a-z]+)__/,"$1:")}o($P,"propertyNameToUri");function cS(n){if(n.startsWith("http://")||n.startsWith("https://")){let e=n.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=n.lastIndexOf("#"),r=n.lastIndexOf("/"),i=Math.max(t,r);return i>=0?n.substring(i+1):n}return n.replace(/^([a-z]+):/,"$1__")}o(cS,"uriToPropertyName");function VP(n){let r=(n.includes(":")?cS(n):n).replace(/^[a-z]+__/,"").split("_");return(r.length>1?r.slice(1).join(" "):r[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}o(VP,"extractPropertyLabel")});var nf={};Qv(nf,{__assign:()=>km,__asyncDelegator:()=>ZP,__asyncGenerator:()=>JP,__asyncValues:()=>eR,__await:()=>zc,__awaiter:()=>HP,__classPrivateFieldGet:()=>iR,__classPrivateFieldSet:()=>sR,__createBinding:()=>QP,__decorate:()=>qP,__exportStar:()=>YP,__extends:()=>UP,__generator:()=>zP,__importDefault:()=>nR,__importStar:()=>rR,__makeTemplateObject:()=>tR,__metadata:()=>WP,__param:()=>GP,__read:()=>uS,__rest:()=>BP,__spread:()=>KP,__spreadArrays:()=>XP,__values:()=>jm});function UP(n,e){Mm(n,e);function t(){this.constructor=n}o(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function BP(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function qP(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function GP(n,e){return function(t,r){e(t,r,n)}}function WP(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function HP(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,a){function c(f){try{u(r.next(f))}catch(h){a(h)}}o(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(h){a(h)}}o(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}o(u,"step"),u((r=r.apply(n,e||[])).next())})}function zP(n,e){var t={label:0,sent:o(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function QP(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function YP(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function jm(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:o(function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function uS(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return s}function KP(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(uS(arguments[e]));return n}function XP(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],a=0,c=s.length;a<c;a++,i++)r[i]=s[a];return r}function zc(n){return this instanceof zc?(this.v=n,this):new zc(n)}function JP(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(d){r[d]&&(i[d]=function(p){return new Promise(function(_,S){s.push([d,p,_,S])>1||c(d,p)})})}function c(d,p){try{l(r[d](p))}catch(_){h(s[0][3],_)}}function l(d){d.value instanceof zc?Promise.resolve(d.value.v).then(u,f):h(s[0][2],d)}function u(d){c("next",d)}function f(d){c("throw",d)}function h(d,p){d(p),s.shift(),s.length&&c(s[0][0],s[0][1])}}function ZP(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(a){return(t=!t)?{value:zc(n[i](a)),done:i==="return"}:s?s(a):a}:s}}function eR(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof jm=="function"?jm(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(a){return new Promise(function(c,l){a=n[s](a),i(c,l,a.done,a.value)})}}function i(s,a,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},a)}}function tR(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function rR(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function nR(n){return n&&n.__esModule?n:{default:n}}function iR(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function sR(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}var Mm,km,sf=rI(()=>{Mm=o(function(n,e){return Mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Mm(n,e)},"extendStatics");o(UP,"__extends");km=o(function(){return km=Object.assign||o(function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),km.apply(this,arguments)},"__assign");o(BP,"__rest");o(qP,"__decorate");o(GP,"__param");o(WP,"__metadata");o(HP,"__awaiter");o(zP,"__generator");o(QP,"__createBinding");o(YP,"__exportStar");o(jm,"__values");o(uS,"__read");o(KP,"__spread");o(XP,"__spreadArrays");o(zc,"__await");o(JP,"__asyncGenerator");o(ZP,"__asyncDelegator");o(eR,"__asyncValues");o(tR,"__makeTemplateObject");o(rR,"__importStar");o(nR,"__importDefault");o(iR,"__classPrivateFieldGet");o(sR,"__classPrivateFieldSet")});var Um=v(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var $m;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})($m||($m={}));Vm.default=$m});var fS=v(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var aR=Um();Object.defineProperty(Bm,"Lifecycle",{enumerable:!0,get:o(function(){return aR.default},"get")})});var ra=v(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.defineInjectionTokenMetadata=Rn.getParamInfo=Rn.INJECTION_TOKEN_METADATA_KEY=void 0;Rn.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function oR(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(Rn.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}o(oR,"getParamInfo");Rn.getParamInfo=oR;function cR(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(Rn.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(Rn.INJECTION_TOKEN_METADATA_KEY,s,t)}}o(cR,"defineInjectionTokenMetadata");Rn.defineInjectionTokenMetadata=cR});var qm=v(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.isClassProvider=void 0;function lR(n){return!!n.useClass}o(lR,"isClassProvider");af.isClassProvider=lR});var Gm=v(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.isFactoryProvider=void 0;function uR(n){return!!n.useFactory}o(uR,"isFactoryProvider");of.isFactoryProvider=uR});var lf=v(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.delay=eo.DelayedConstructor=void 0;var cf=class{static{o(this,"DelayedConstructor")}constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},r=!1,i,s=o(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=o(i=>{t[i]=(...s)=>{s[0]=e();let a=Reflect[i];return a(...s)}},"install");return this.reflectMethods.forEach(r),t}};eo.DelayedConstructor=cf;function fR(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new cf(n)}o(fR,"delay");eo.delay=fR});var uf=v(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.isConstructorToken=Si.isTransformDescriptor=Si.isTokenDescriptor=Si.isNormalToken=void 0;var hR=lf();function dR(n){return typeof n=="string"||typeof n=="symbol"}o(dR,"isNormalToken");Si.isNormalToken=dR;function pR(n){return typeof n=="object"&&"token"in n&&"multiple"in n}o(pR,"isTokenDescriptor");Si.isTokenDescriptor=pR;function mR(n){return typeof n=="object"&&"token"in n&&"transform"in n}o(mR,"isTransformDescriptor");Si.isTransformDescriptor=mR;function gR(n){return typeof n=="function"||n instanceof hR.DelayedConstructor}o(gR,"isConstructorToken");Si.isConstructorToken=gR});var Wm=v(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.isTokenProvider=void 0;function yR(n){return!!n.useToken}o(yR,"isTokenProvider");ff.isTokenProvider=yR});var Hm=v(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.isValueProvider=void 0;function vR(n){return n.useValue!=null}o(vR,"isValueProvider");hf.isValueProvider=vR});var zm=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var _R=qm();Object.defineProperty(na,"isClassProvider",{enumerable:!0,get:o(function(){return _R.isClassProvider},"get")});var SR=Gm();Object.defineProperty(na,"isFactoryProvider",{enumerable:!0,get:o(function(){return SR.isFactoryProvider},"get")});var bR=uf();Object.defineProperty(na,"isNormalToken",{enumerable:!0,get:o(function(){return bR.isNormalToken},"get")});var wR=Wm();Object.defineProperty(na,"isTokenProvider",{enumerable:!0,get:o(function(){return wR.isTokenProvider},"get")});var ER=Hm();Object.defineProperty(na,"isValueProvider",{enumerable:!0,get:o(function(){return ER.isValueProvider},"get")})});var hS=v(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.isProvider=void 0;var TR=qm(),xR=Hm(),AR=Wm(),CR=Gm();function IR(n){return TR.isClassProvider(n)||xR.isValueProvider(n)||AR.isTokenProvider(n)||CR.isFactoryProvider(n)}o(IR,"isProvider");df.isProvider=IR});var Km=v(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var Qm=class{static{o(this,"RegistryBase")}constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};Ym.default=Qm});var dS=v(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var OR=Km(),Xm=class extends OR.default{static{o(this,"Registry")}};Jm.default=Xm});var pS=v(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});var Zm=class{static{o(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};eg.default=Zm});var tg=v(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.formatErrorCtor=void 0;function PR(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}o(PR,"formatDependency");function RR(n,e,t=" "){return[n,...e.message.split(`
31
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function n_(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}o(n_,"incrementNodeInspectorPort");function Gp(){if(Qe.env.NO_COLOR||Qe.env.FORCE_COLOR==="0"||Qe.env.FORCE_COLOR==="false")return!1;if(Qe.env.FORCE_COLOR||Qe.env.CLICOLOR_FORCE!==void 0)return!0}o(Gp,"useColor");Wp.Command=qp;Wp.useColor=Gp});var c_=v(fn=>{var{Argument:s_}=Ru(),{Command:Hp}=i_(),{CommanderError:gI,InvalidArgumentError:a_}=Dc(),{Help:yI}=Mp(),{Option:o_}=Vp();fn.program=new Hp;fn.createCommand=n=>new Hp(n);fn.createOption=(n,e)=>new o_(n,e);fn.createArgument=(n,e)=>new s_(n,e);fn.Command=Hp;fn.Option=o_;fn.Argument=s_;fn.Help=yI;fn.CommanderError=gI;fn.InvalidArgumentError=a_;fn.InvalidOptionArgumentError=a_});var zp=v(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.AssetClass=void 0;var u_;(function(n){n.AREA="ems__Area",n.TASK="ems__Task",n.PROJECT="ems__Project",n.MEETING="ems__Meeting",n.INITIATIVE="ems__Initiative",n.TASK_PROTOTYPE="ems__TaskPrototype",n.TASK_PROTOTYPE_UID="75302770-279e-4a59-ba85-09df29725713",n.MEETING_PROTOTYPE="ems__MeetingPrototype",n.EVENT_PROTOTYPE="exo__EventPrototype",n.PROJECT_PROTOTYPE="ems__ProjectPrototype",n.EVENT="exo__Event",n.DAILY_NOTE="pn__DailyNote",n.CONCEPT="ims__Concept",n.SESSION_START_EVENT="ems__SessionStartEvent",n.SESSION_END_EVENT="ems__SessionEndEvent",n.PROTOTYPE="exo__Prototype",n.CLASS="exo__Class",n.FLEETING_NOTE="ztlk__FleetingNote",n.FLEETING_NOTE_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7"})(u_||(Du.AssetClass=u_={}))});var Qp=v(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.EffortStatus=void 0;var f_;(function(n){n.DRAFT="ems__EffortStatusDraft",n.BACKLOG="ems__EffortStatusBacklog",n.ANALYSIS="ems__EffortStatusAnalysis",n.TODO="ems__EffortStatusToDo",n.DOING="ems__EffortStatusDoing",n.DONE="ems__EffortStatusDone",n.TRASHED="ems__EffortStatusTrashed"})(f_||(Nu.EffortStatus=f_={}))});var h_=v(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.hasPosition=vI;Lu.isFixed=_I;function vI(n){return typeof n.x=="number"&&typeof n.y=="number"}o(vI,"hasPosition");function _I(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}o(_I,"isFixed")});var d_=v(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.createEmptyGraphData=SI;Mu.mergeGraphData=bI;function SI(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}o(SI,"createEmptyGraphData");function bI(n,e){let t=new Map,r=new Set,i=[];for(let s of n.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of n.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}for(let s of e.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}o(bI,"mergeGraphData")});var Yp=v(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.createEdgeId=wI;ku.edgesEqual=EI;function wI(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}o(wI,"createEdgeId");function EI(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}o(EI,"edgesEqual")});var Kp=v(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.BUILT_IN_EDGE_STYLES=Tt.BUILT_IN_NODE_STYLES=Tt.DEFAULT_EDGE_STYLE=Tt.DEFAULT_NODE_STYLE=Tt.RDF_TYPE_PREDICATES=void 0;Tt.mergeNodeStyles=TI;Tt.mergeEdgeStyles=xI;Tt.extractLocalName=AI;Tt.isClassType=CI;Tt.isTypePredicate=II;Tt.isSubClassPredicate=OI;Tt.RDF_TYPE_PREDICATES={RDF_TYPE:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",RDFS_CLASS:"http://www.w3.org/2000/01/rdf-schema#Class",OWL_CLASS:"http://www.w3.org/2002/07/owl#Class",RDFS_SUBCLASS_OF:"http://www.w3.org/2000/01/rdf-schema#subClassOf",OWL_EQUIVALENT_CLASS:"http://www.w3.org/2002/07/owl#equivalentClass",RDFS_LABEL:"http://www.w3.org/2000/01/rdf-schema#label",RDFS_COMMENT:"http://www.w3.org/2000/01/rdf-schema#comment"};Tt.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Tt.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Tt.BUILT_IN_NODE_STYLES={"http://www.w3.org/2000/01/rdf-schema#Class":{color:"#f59e0b",shape:"diamond",size:40},"http://www.w3.org/2002/07/owl#Class":{color:"#f59e0b",shape:"diamond",size:40},ems__Task:{color:"#22c55e",shape:"circle"},ems__Project:{color:"#3b82f6",shape:"square"},ems__Area:{color:"#8b5cf6",shape:"hexagon",size:40},ems__Meeting:{color:"#ec4899",shape:"circle"},exo__Class:{color:"#f59e0b",shape:"diamond"},ims__Person:{color:"#06b6d4",shape:"circle"}};Tt.BUILT_IN_EDGE_STYLES={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":{color:"#f59e0b",lineStyle:"dashed",arrow:"standard"},"http://www.w3.org/2000/01/rdf-schema#subClassOf":{color:"#8b5cf6",width:2,arrow:"triangle"},"https://exocortex.my/ontology/ems#Effort_parent":{color:"#6366f1",width:2,arrow:"standard"},"https://exocortex.my/ontology/exo#Asset_prototype":{color:"#f59e0b",lineStyle:"dashed",arrow:"circle"},"https://exocortex.my/ontology/exo#references":{color:"#22c55e",opacity:.4,arrow:"standard"}};function TI(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(TI,"mergeNodeStyles");function xI(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(xI,"mergeEdgeStyles");function AI(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}o(AI,"extractLocalName");function CI(n){return n===Tt.RDF_TYPE_PREDICATES.RDFS_CLASS||n===Tt.RDF_TYPE_PREDICATES.OWL_CLASS}o(CI,"isClassType");function II(n){return n===Tt.RDF_TYPE_PREDICATES.RDF_TYPE}o(II,"isTypePredicate");function OI(n){return n===Tt.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}o(OI,"isSubClassPredicate")});var m_=v(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var Ye=v(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.IRI=void 0;var Xp=class n{static{o(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!n.isValidIRI(t))throw new Error("Invalid IRI format");this._value=t}get value(){return this._value}equals(e){return this._value===e._value}toString(){return this._value}static isValidIRI(e){if(!e||e.trim().length===0||/\s/.test(e)||!/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=["http","https","ftp","ftps","file","mailto","tel","data","ws","wss","urn","obsidian"],i=e.match(/^([a-z][a-z0-9+.-]*?):/i);if(i){let s=i[1].toLowerCase();if(!r.includes(s))return!1}try{return new URL(e),!0}catch{return/^urn:[a-z0-9][a-z0-9-]{0,31}:[^\s]+$/i.test(e)}}};ju.IRI=Xp});var mt=v(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Literal=void 0;Ys.parseLanguageTag=g_;Ys.createDirectionalLiteral=RI;Ys.createLiteralFromLanguageTag=FI;var PI="http://www.w3.org/2001/XMLSchema#string",Nc=class{static{o(this,"Literal")}constructor(e,t,r,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&r)throw new Error("Literal cannot have both datatype and language tag");if(i&&!r)throw new Error("Literal cannot have direction without language tag");if(i&&i!=="ltr"&&i!=="rtl")throw new Error('Direction must be "ltr" or "rtl"');this._value=e,this._datatype=t,this._language=r?r.toLowerCase():void 0,this._direction=i}get value(){return this._value}get datatype(){return this._datatype}get language(){return this._language}get direction(){return this._direction}hasDirection(){return this._direction!==void 0}equals(e){if(this._value!==e._value||this._language!==e._language||this._direction!==e._direction)return!1;let t=this.normalizedDatatype(),r=e.normalizedDatatype();return t===r}normalizedDatatype(){return!this._datatype||this._datatype.value===PI?null:this._datatype.value}toString(){let e=`"${this._value}"`;return this._datatype?e+=`^^<${this._datatype.value}>`:this._language&&(e+=`@${this._language}`,this._direction&&(e+=`--${this._direction}`)),e}};Ys.Literal=Nc;function g_(n){let t=n.lastIndexOf("--");if(t===-1)return{language:n.toLowerCase()};let r=n.substring(t+2),i=n.substring(0,t);return r==="ltr"||r==="rtl"?{language:i.toLowerCase(),direction:r}:{language:n.toLowerCase()}}o(g_,"parseLanguageTag");function RI(n,e,t){return new Nc(n,void 0,e,t)}o(RI,"createDirectionalLiteral");function FI(n,e){let{language:t,direction:r}=g_(e);return new Nc(n,void 0,t,r)}o(FI,"createLiteralFromLanguageTag")});var Lt=v(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.BlankNode=void 0;var $u=class n{static{o(this,"BlankNode")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("BlankNode id cannot be empty");this._id=t}get id(){return this._id}equals(e){return this._id===e._id}toString(){return`_:${this._id}`}static generateId(){return`b${++n.counter}`}static create(){return new n(n.generateId())}};Vu.BlankNode=$u;$u.counter=0});var hn=v(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.Namespace=void 0;var y_=Ye(),Cr=class{static{o(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new y_.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new y_.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[r,i]=t;return r!==this._prefix?null:this.term(i)}};Uu.Namespace=Cr;Cr.RDF=new Cr("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Cr.RDFS=new Cr("rdfs","http://www.w3.org/2000/01/rdf-schema#");Cr.OWL=new Cr("owl","http://www.w3.org/2002/07/owl#");Cr.XSD=new Cr("xsd","http://www.w3.org/2001/XMLSchema#");Cr.EXO=new Cr("exo","https://exocortex.my/ontology/exo#");Cr.EMS=new Cr("ems","https://exocortex.my/ontology/ems#")});var Wi=v(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Triple=void 0;var Jp=Ye(),Zp=mt(),em=Lt(),tm=class{static{o(this,"Triple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof Jp.IRI&&t instanceof Jp.IRI||e instanceof em.BlankNode&&t instanceof em.BlankNode||e instanceof Zp.Literal&&t instanceof Zp.Literal||this.isQuotedTriple(e)&&this.isQuotedTriple(t)?e.equals(t):!1}isQuotedTriple(e){return typeof e=="object"&&e!==null&&"termType"in e&&e.termType==="QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`${e} ${t} ${r} .`}nodeToString(e){return e instanceof Jp.IRI?`<${e.value}>`:e instanceof em.BlankNode||e instanceof Zp.Literal||this.isQuotedTriple(e)?e.toString():""}};Bu.Triple=tm});var Lc=v(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.QuotedTriple=void 0;var rm=Ye(),nm=mt(),im=Lt(),sm=class n{static{o(this,"QuotedTriple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof rm.IRI&&t instanceof rm.IRI||e instanceof im.BlankNode&&t instanceof im.BlankNode||e instanceof nm.Literal&&t instanceof nm.Literal||e instanceof n&&t instanceof n?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`<< ${e} ${t} ${r} >>`}nodeToString(e){return e instanceof rm.IRI?`<${e.value}>`:e instanceof im.BlankNode||e instanceof nm.Literal||e instanceof n?e.toString():""}};qu.QuotedTriple=sm});var v_=v(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.QuotedTriple=Rt.Triple=Rt.Namespace=Rt.BlankNode=Rt.createLiteralFromLanguageTag=Rt.createDirectionalLiteral=Rt.parseLanguageTag=Rt.Literal=Rt.IRI=void 0;var DI=Ye();Object.defineProperty(Rt,"IRI",{enumerable:!0,get:o(function(){return DI.IRI},"get")});var Gu=mt();Object.defineProperty(Rt,"Literal",{enumerable:!0,get:o(function(){return Gu.Literal},"get")});Object.defineProperty(Rt,"parseLanguageTag",{enumerable:!0,get:o(function(){return Gu.parseLanguageTag},"get")});Object.defineProperty(Rt,"createDirectionalLiteral",{enumerable:!0,get:o(function(){return Gu.createDirectionalLiteral},"get")});Object.defineProperty(Rt,"createLiteralFromLanguageTag",{enumerable:!0,get:o(function(){return Gu.createLiteralFromLanguageTag},"get")});var NI=Lt();Object.defineProperty(Rt,"BlankNode",{enumerable:!0,get:o(function(){return NI.BlankNode},"get")});var LI=hn();Object.defineProperty(Rt,"Namespace",{enumerable:!0,get:o(function(){return LI.Namespace},"get")});var MI=Wi();Object.defineProperty(Rt,"Triple",{enumerable:!0,get:o(function(){return MI.Triple},"get")});var kI=Lc();Object.defineProperty(Rt,"QuotedTriple",{enumerable:!0,get:o(function(){return kI.QuotedTriple},"get")})});var Wu=v(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.UUID_URL_NAMESPACE=pn.DEFAULT_LANGUAGE_TAG=pn.REQUIRED_PROPERTIES=pn.ALLOWED_PROPERTIES=pn.Exo003MetadataType=void 0;var dn;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(dn||(pn.Exo003MetadataType=dn={}));pn.ALLOWED_PROPERTIES={[dn.Namespace]:["metadata","uri","aliases"],[dn.Anchor]:["metadata","uri","aliases"],[dn.BlankNode]:["metadata","uri","aliases"],[dn.Statement]:["metadata","subject","predicate","object","aliases"],[dn.Body]:["metadata","subject","predicate","aliases"]};pn.REQUIRED_PROPERTIES={[dn.Namespace]:["metadata","uri"],[dn.Anchor]:["metadata","uri"],[dn.BlankNode]:["metadata","uri"],[dn.Statement]:["metadata","subject","predicate","object"],[dn.Body]:["metadata","subject","predicate"]};pn.DEFAULT_LANGUAGE_TAG="ru";pn.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var __=v(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var S_=v(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.default="00000000-0000-0000-0000-000000000000"});var b_=v(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var Mc=v(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var jI=b_();function $I(n){return typeof n=="string"&&jI.default.test(n)}o($I,"validate");lm.default=$I});var kc=v(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var VI=Mc();function UI(n){if(!(0,VI.default)(n))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(n.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(n.slice(9,13),16))>>>8,e&255,(e=parseInt(n.slice(14,18),16))>>>8,e&255,(e=parseInt(n.slice(19,23),16))>>>8,e&255,(e=parseInt(n.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}o(UI,"parse");um.default=UI});var Hi=v(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.unsafeStringify=void 0;var BI=Mc(),tr=[];for(let n=0;n<256;++n)tr.push((n+256).toString(16).slice(1));function w_(n,e=0){return(tr[n[e+0]]+tr[n[e+1]]+tr[n[e+2]]+tr[n[e+3]]+"-"+tr[n[e+4]]+tr[n[e+5]]+"-"+tr[n[e+6]]+tr[n[e+7]]+"-"+tr[n[e+8]]+tr[n[e+9]]+"-"+tr[n[e+10]]+tr[n[e+11]]+tr[n[e+12]]+tr[n[e+13]]+tr[n[e+14]]+tr[n[e+15]]).toLowerCase()}o(w_,"unsafeStringify");jc.unsafeStringify=w_;function qI(n,e=0){let t=w_(n,e);if(!(0,BI.default)(t))throw TypeError("Stringified UUID is invalid");return t}o(qI,"stringify");jc.default=qI});var Qu=v(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var GI=require("crypto"),zu=new Uint8Array(256),Hu=zu.length;function WI(){return Hu>zu.length-16&&((0,GI.randomFillSync)(zu),Hu=0),zu.slice(Hu,Hu+=16)}o(WI,"rng");fm.default=WI});var hm=v(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.updateV1State=void 0;var E_=Qu(),HI=Hi(),$c={};function zI(n,e,t){let r,i=n?._v6??!1;if(n){let s=Object.keys(n);s.length===1&&s[0]==="_v6"&&(n=void 0)}if(n)r=T_(n.random??n.rng?.()??(0,E_.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),a=(0,E_.default)();x_($c,s,a),r=T_(a,$c.msecs,$c.nsecs,i?void 0:$c.clockseq,i?void 0:$c.node,e,t)}return e??(0,HI.unsafeStringify)(r)}o(zI,"v1");function x_(n,e,t){return n.msecs??=-1/0,n.nsecs??=0,e===n.msecs?(n.nsecs++,n.nsecs>=1e4&&(n.node=void 0,n.nsecs=0)):e>n.msecs?n.nsecs=0:e<n.msecs&&(n.node=void 0),n.node||(n.node=t.slice(10,16),n.node[0]|=1,n.clockseq=(t[8]<<8|t[9])&16383),n.msecs=e,n}o(x_,"updateV1State");Vc.updateV1State=x_;function T_(n,e,t,r,i,s,a=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),a=0;else if(a<0||a+16>s.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);e??=Date.now(),t??=0,r??=(n[8]<<8|n[9])&16383,i??=n.slice(10,16),e+=122192928e5;let c=((e&268435455)*1e4+t)%4294967296;s[a++]=c>>>24&255,s[a++]=c>>>16&255,s[a++]=c>>>8&255,s[a++]=c&255;let l=e/4294967296*1e4&268435455;s[a++]=l>>>8&255,s[a++]=l&255,s[a++]=l>>>24&15|16,s[a++]=l>>>16&255,s[a++]=r>>>8|128,s[a++]=r&255;for(let u=0;u<6;++u)s[a++]=i[u];return s}o(T_,"v1Bytes");Vc.default=zI});var pm=v(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var QI=kc(),YI=Hi();function KI(n){let e=typeof n=="string"?(0,QI.default)(n):n,t=XI(e);return typeof n=="string"?(0,YI.unsafeStringify)(t):t}o(KI,"v1ToV6");dm.default=KI;function XI(n){return Uint8Array.of((n[6]&15)<<4|n[7]>>4&15,(n[7]&15)<<4|(n[4]&240)>>4,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,(n[1]&15)<<4|(n[2]&240)>>4,96|n[2]&15,n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(XI,"_v1ToV6")});var A_=v(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var JI=require("crypto");function ZI(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,JI.createHash)("md5").update(n).digest()}o(ZI,"md5");mm.default=ZI});var Uc=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.URL=zi.DNS=zi.stringToBytes=void 0;var C_=kc(),eO=Hi();function I_(n){n=unescape(encodeURIComponent(n));let e=new Uint8Array(n.length);for(let t=0;t<n.length;++t)e[t]=n.charCodeAt(t);return e}o(I_,"stringToBytes");zi.stringToBytes=I_;zi.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";zi.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function tO(n,e,t,r,i,s){let a=typeof t=="string"?I_(t):t,c=typeof r=="string"?(0,C_.default)(r):r;if(typeof r=="string"&&(r=(0,C_.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+a.length);if(l.set(c),l.set(a,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){s=s||0;for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,eO.unsafeStringify)(l)}o(tO,"v35");zi.default=tO});var P_=v(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.URL=Ks.DNS=void 0;var rO=A_(),gm=Uc(),O_=Uc();Object.defineProperty(Ks,"DNS",{enumerable:!0,get:o(function(){return O_.DNS},"get")});Object.defineProperty(Ks,"URL",{enumerable:!0,get:o(function(){return O_.URL},"get")});function ym(n,e,t,r){return(0,gm.default)(48,rO.default,n,e,t,r)}o(ym,"v3");ym.DNS=gm.DNS;ym.URL=gm.URL;Ks.default=ym});var R_=v(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});var nO=require("crypto");vm.default={randomUUID:nO.randomUUID}});var D_=v(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var F_=R_(),iO=Qu(),sO=Hi();function aO(n,e,t){if(F_.default.randomUUID&&!e&&!n)return F_.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,iO.default)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return(0,sO.unsafeStringify)(r)}o(aO,"v4");_m.default=aO});var N_=v(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var oO=require("crypto");function cO(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,oO.createHash)("sha1").update(n).digest()}o(cO,"sha1");Sm.default=cO});var M_=v(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.URL=Xs.DNS=void 0;var lO=N_(),bm=Uc(),L_=Uc();Object.defineProperty(Xs,"DNS",{enumerable:!0,get:o(function(){return L_.DNS},"get")});Object.defineProperty(Xs,"URL",{enumerable:!0,get:o(function(){return L_.URL},"get")});function wm(n,e,t,r){return(0,bm.default)(80,lO.default,n,e,t,r)}o(wm,"v5");wm.DNS=bm.DNS;wm.URL=bm.URL;Xs.default=wm});var k_=v(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var uO=Hi(),fO=hm(),hO=pm();function dO(n,e,t){n??={},t??=0;let r=(0,fO.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,hO.default)(r),e){for(let i=0;i<16;i++)e[t+i]=r[i];return e}return(0,uO.unsafeStringify)(r)}o(dO,"v6");Em.default=dO});var j_=v(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var pO=kc(),mO=Hi();function gO(n){let e=typeof n=="string"?(0,pO.default)(n):n,t=yO(e);return typeof n=="string"?(0,mO.unsafeStringify)(t):t}o(gO,"v6ToV1");Tm.default=gO;function yO(n){return Uint8Array.of((n[3]&15)<<4|n[4]>>4&15,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|n[6]&15,n[7],(n[1]&15)<<4|(n[2]&240)>>4,(n[2]&15)<<4|(n[3]&240)>>4,16|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(yO,"_v6ToV1")});var B_=v(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.updateV7State=void 0;var $_=Qu(),vO=Hi(),xm={};function _O(n,e,t){let r;if(n)r=V_(n.random??n.rng?.()??(0,$_.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,$_.default)();U_(xm,i,s),r=V_(s,xm.msecs,xm.seq,e,t)}return e??(0,vO.unsafeStringify)(r)}o(_O,"v7");function U_(n,e,t){return n.msecs??=-1/0,n.seq??=0,e>n.msecs?(n.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],n.msecs=e):(n.seq=n.seq+1|0,n.seq===0&&n.msecs++),n}o(U_,"updateV7State");Bc.updateV7State=U_;function V_(n,e,t,r,i=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=n[6]*127<<24|n[7]<<16|n[8]<<8|n[9],r[i++]=e/1099511627776&255,r[i++]=e/4294967296&255,r[i++]=e/16777216&255,r[i++]=e/65536&255,r[i++]=e/256&255,r[i++]=e&255,r[i++]=112|t>>>28&15,r[i++]=t>>>20&255,r[i++]=128|t>>>14&63,r[i++]=t>>>6&255,r[i++]=t<<2&255|n[10]&3,r[i++]=n[11],r[i++]=n[12],r[i++]=n[13],r[i++]=n[14],r[i++]=n[15],r}o(V_,"v7Bytes");Bc.default=_O});var q_=v(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var SO=Mc();function bO(n){if(!(0,SO.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}o(bO,"version");Am.default=bO});var Ir=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.version=Xe.validate=Xe.v7=Xe.v6ToV1=Xe.v6=Xe.v5=Xe.v4=Xe.v3=Xe.v1ToV6=Xe.v1=Xe.stringify=Xe.parse=Xe.NIL=Xe.MAX=void 0;var wO=__();Object.defineProperty(Xe,"MAX",{enumerable:!0,get:o(function(){return wO.default},"get")});var EO=S_();Object.defineProperty(Xe,"NIL",{enumerable:!0,get:o(function(){return EO.default},"get")});var TO=kc();Object.defineProperty(Xe,"parse",{enumerable:!0,get:o(function(){return TO.default},"get")});var xO=Hi();Object.defineProperty(Xe,"stringify",{enumerable:!0,get:o(function(){return xO.default},"get")});var AO=hm();Object.defineProperty(Xe,"v1",{enumerable:!0,get:o(function(){return AO.default},"get")});var CO=pm();Object.defineProperty(Xe,"v1ToV6",{enumerable:!0,get:o(function(){return CO.default},"get")});var IO=P_();Object.defineProperty(Xe,"v3",{enumerable:!0,get:o(function(){return IO.default},"get")});var OO=D_();Object.defineProperty(Xe,"v4",{enumerable:!0,get:o(function(){return OO.default},"get")});var PO=M_();Object.defineProperty(Xe,"v5",{enumerable:!0,get:o(function(){return PO.default},"get")});var RO=k_();Object.defineProperty(Xe,"v6",{enumerable:!0,get:o(function(){return RO.default},"get")});var FO=j_();Object.defineProperty(Xe,"v6ToV1",{enumerable:!0,get:o(function(){return FO.default},"get")});var DO=B_();Object.defineProperty(Xe,"v7",{enumerable:!0,get:o(function(){return DO.default},"get")});var NO=Mc();Object.defineProperty(Xe,"validate",{enumerable:!0,get:o(function(){return NO.default},"get")});var LO=q_();Object.defineProperty(Xe,"version",{enumerable:!0,get:o(function(){return LO.default},"get")})});var Om=v(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.Exo003UUIDGenerator=void 0;var Cm=Ir(),G_=Wu(),Im=class{static{o(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,Cm.v5)(e,G_.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let r=this.generateNamespaceUUID(e);return(0,Cm.v5)(t,r)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:r}=this.splitIRI(e);return r?this.generateAssetUUID(t,r):(0,Cm.v5)(e,G_.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let r="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(r,i)}static generateStatementUUID(e,t,r){if(!e||!t||!r)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${r}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let r="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(r,i)}static splitIRI(e){let t=e.lastIndexOf("#");if(t!==-1&&t<e.length-1)return{namespace:e.substring(0,t+1),localName:e.substring(t+1)};let r=e.lastIndexOf("/"),i=e.indexOf("://");return r!==-1&&r>i+2&&r<e.length-1?{namespace:e.substring(0,r+1),localName:e.substring(r+1)}:{namespace:e,localName:""}}static isValidUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};Yu.Exo003UUIDGenerator=Im});var H_=v(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.Exo003Parser=void 0;var st=Wu(),qc=Om(),us=Ye(),Ku=mt(),W_=Lt(),MO=Wi(),Pm=class{static{o(this,"Exo003Parser")}static parse(e,t){let r=this.validate(e);if(!r.valid)return{success:!1,errors:r.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===st.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],r=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:r};let i=e.metadata;if(!Object.values(st.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(st.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:r};let s=i,a=st.ALLOWED_PROPERTIES[s],c=st.REQUIRED_PROPERTIES[s];for(let l of c)(e[l]===void 0||e[l]===null)&&t.push(`Missing required property: ${l}`);for(let l of Object.keys(e))a.includes(l)||t.push(`Forbidden property for ${s}: ${l}`);switch(s){case st.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case st.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case st.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case st.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case st.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,r);break}return{valid:t.length===0,errors:t,warnings:r}}static parseByType(e,t){let r={metadata:t,aliases:e.aliases};switch(t){case st.Exo003MetadataType.Namespace:return{...r,metadata:st.Exo003MetadataType.Namespace,uri:e.uri};case st.Exo003MetadataType.Anchor:return{...r,metadata:st.Exo003MetadataType.Anchor,uri:e.uri};case st.Exo003MetadataType.BlankNode:return{...r,metadata:st.Exo003MetadataType.BlankNode,uri:e.uri};case st.Exo003MetadataType.Statement:return{...r,metadata:st.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case st.Exo003MetadataType.Body:return{...r,metadata:st.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateAnchorMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateBlankNodeMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new us.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,a=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of a)l&&typeof l!="string"&&t.push(`${c} must be a string`)}static validateBodyMetadata(e,t,r){let i=e.subject,s=e.predicate;i&&typeof i!="string"&&t.push("subject must be a string"),s&&typeof s!="string"&&t.push("predicate must be a string")}static toTriple(e,t,r){let i=t(e.subject),s;if(i.type==="iri")s=new us.IRI(i.value);else if(i.type==="blank")s=new W_.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let a=t(e.predicate);if(a.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new us.IRI(a.value),l=t(e.object),u;if(l.type==="iri")u=new us.IRI(l.value);else if(l.type==="blank")u=new W_.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new Ku.Literal(f,new us.IRI(l.datatype));else{let h=l.language||st.DEFAULT_LANGUAGE_TAG;u=(0,Ku.createDirectionalLiteral)(f,h,l.direction)}}return new MO.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new Ku.Literal(t,new us.IRI(r.datatype));let i=r?.language||st.DEFAULT_LANGUAGE_TAG;return(0,Ku.createDirectionalLiteral)(t,i,r?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(st.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case st.Exo003MetadataType.Namespace:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.Anchor:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.BlankNode:return qc.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case st.Exo003MetadataType.Statement:{let r=e;return qc.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case st.Exo003MetadataType.Body:{let r=e;return qc.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};Xu.Exo003Parser=Pm});var Rm=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Exo003Parser=hr.Exo003UUIDGenerator=hr.UUID_URL_NAMESPACE=hr.DEFAULT_LANGUAGE_TAG=hr.REQUIRED_PROPERTIES=hr.ALLOWED_PROPERTIES=hr.Exo003MetadataType=void 0;var Gc=Wu();Object.defineProperty(hr,"Exo003MetadataType",{enumerable:!0,get:o(function(){return Gc.Exo003MetadataType},"get")});Object.defineProperty(hr,"ALLOWED_PROPERTIES",{enumerable:!0,get:o(function(){return Gc.ALLOWED_PROPERTIES},"get")});Object.defineProperty(hr,"REQUIRED_PROPERTIES",{enumerable:!0,get:o(function(){return Gc.REQUIRED_PROPERTIES},"get")});Object.defineProperty(hr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:o(function(){return Gc.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(hr,"UUID_URL_NAMESPACE",{enumerable:!0,get:o(function(){return Gc.UUID_URL_NAMESPACE},"get")});var kO=Om();Object.defineProperty(hr,"Exo003UUIDGenerator",{enumerable:!0,get:o(function(){return kO.Exo003UUIDGenerator},"get")});var jO=H_();Object.defineProperty(hr,"Exo003Parser",{enumerable:!0,get:o(function(){return jO.Exo003Parser},"get")})});var Js=v(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.WikiLinkHelpers=void 0;var Ju=class{static{o(this,"WikiLinkHelpers")}static normalize(e){return e?e.replace(this.WIKI_LINK_PATTERN,"").trim():""}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(r=>this.normalize(r)).filter(r=>r.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let r=this.normalizeArray(e),i=this.normalize(t);return r.includes(i)}};Zu.WikiLinkHelpers=Ju;Ju.WIKI_LINK_PATTERN=/\[\[|\]\]/g});var dr=v(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.EffortStatus=Ka.AssetClass=void 0;var $O=zp();Object.defineProperty(Ka,"AssetClass",{enumerable:!0,get:o(function(){return $O.AssetClass},"get")});var VO=Qp();Object.defineProperty(Ka,"EffortStatus",{enumerable:!0,get:o(function(){return VO.EffortStatus},"get")})});var fs=v(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.hasClass=ea;pr.isAreaOrProject=UO;pr.isEffort=BO;pr.hasStatus=qO;pr.isAssetArchived=GO;pr.hasEmptyProperties=WO;pr.needsFolderRepair=HO;pr.getTodayDateString=Fm;pr.isPlannedForToday=zO;pr.hasPlannedStartTimestamp=QO;pr.extractDailyNoteDate=YO;pr.isCurrentDateGteDay=KO;pr.inheritsFromPrototype=Y_;pr.isPrototypeClass=JO;var Q_=Js(),Zs=dr();function ea(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>Q_.WikiLinkHelpers.normalize(r)===e):!1}o(ea,"hasClass");function UO(n){return ea(n,Zs.AssetClass.AREA)||ea(n,Zs.AssetClass.PROJECT)}o(UO,"isAreaOrProject");function BO(n){return ea(n,Zs.AssetClass.TASK)||ea(n,Zs.AssetClass.PROJECT)||ea(n,Zs.AssetClass.MEETING)}o(BO,"isEffort");function qO(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?Q_.WikiLinkHelpers.normalize(t)===e:!1}o(qO,"hasStatus");function GO(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}o(GO,"isAssetArchived");function WO(n){return!n||Object.keys(n).length===0?!1:Object.values(n).some(e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0))}o(WO,"hasEmptyProperties");function HO(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}o(HO,"needsFolderRepair");function Fm(){let n=new Date,e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}o(Fm,"getTodayDateString");function zO(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=Fm();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}o(zO,"isPlannedForToday");function QO(n){let e=n.ems__Effort_plannedStartTimestamp;return e?typeof e=="string"?e.trim().length>0:Array.isArray(e)&&e.length>0?String(e[0]).trim().length>0:!1:!1}o(QO,"hasPlannedStartTimestamp");function YO(n){let e=n.pn__DailyNote_day;if(!e)return null;if(typeof e=="string"){let t=e.match(/\[\[([^\[\]]+)\]\]/);return t?t[1]:e}if(Array.isArray(e)&&e.length>0){let t=String(e[0]),r=t.match(/\[\[([^\[\]]+)\]\]/);return r?r[1]:t}return null}o(YO,"extractDailyNoteDate");function KO(n){return Fm()>=n}o(KO,"isCurrentDateGteDay");function z_(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}o(z_,"normalizeWithQuotes");var XO=10;function Y_(n,e=XO){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let a of s){let c=z_(a);c&&i.push({className:c,depth:0})}for(;i.length>0;){let a=i.shift();if(!a)continue;let{className:c,depth:l}=a;if(l>e)continue;if(c===Zs.AssetClass.PROTOTYPE)return!0;if(r.has(c))continue;r.add(c);let u=`${c}__exo__Class_superClass`,f=n[u];if(f){let h=Array.isArray(f)?f:[f];for(let d of h){let p=z_(d);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}o(Y_,"inheritsFromPrototype");function JO(n,e){return ea(n,Zs.AssetClass.CLASS)?Y_(e):!1}o(JO,"isPrototypeClass")});var K_=v(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.canCreateTask=ZO;Ja.canCreateRelatedTask=eP;Ja.canConvertTaskToProject=tP;Ja.canSetCriticalityZone=rP;var Xa=fs(),Dm=dr();function ZO(n){return(0,Xa.isAreaOrProject)(n.instanceClass)}o(ZO,"canCreateTask");function eP(n){return!(!(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)||(0,Xa.isAssetArchived)(n.isArchived))}o(eP,"canCreateRelatedTask");function tP(n){return(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)}o(tP,"canConvertTaskToProject");function rP(n){return!(!(0,Xa.hasClass)(n.instanceClass,Dm.AssetClass.TASK)||(0,Xa.isAssetArchived)(n.isArchived))}o(rP,"canSetCriticalityZone")});var X_=v(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.canCreateProject=nP;Za.canMoveToAnalysis=iP;Za.canMoveToToDo=sP;Za.canConvertProjectToTask=aP;var hs=fs(),ds=dr();function nP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.AREA)||(0,hs.hasClass)(n.instanceClass,ds.AssetClass.INITIATIVE)||(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)}o(nP,"canCreateProject");function iP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)?(0,hs.hasStatus)(n.currentStatus,ds.EffortStatus.BACKLOG):!1}o(iP,"canMoveToAnalysis");function sP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)?(0,hs.hasStatus)(n.currentStatus,ds.EffortStatus.ANALYSIS):!1}o(sP,"canMoveToToDo");function aP(n){return(0,hs.hasClass)(n.instanceClass,ds.AssetClass.PROJECT)}o(aP,"canConvertProjectToTask")});var eS=v(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.canCreateChildArea=oP;ef.canSetActiveFocus=cP;var J_=fs(),Z_=dr();function oP(n){return(0,J_.hasClass)(n.instanceClass,Z_.AssetClass.AREA)}o(oP,"canCreateChildArea");function cP(n){return(0,J_.hasClass)(n.instanceClass,Z_.AssetClass.AREA)}o(cP,"canSetActiveFocus")});var rS=v(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.canPlanOnToday=lP;Pr.canPlanForEvening=uP;Pr.canShiftDayBackward=fP;Pr.canShiftDayForward=hP;Pr.canSetDraftStatus=dP;Pr.canMoveToBacklog=pP;Pr.canStartEffort=mP;Pr.canMarkDone=gP;Pr.canTrashEffort=yP;Pr.canVoteOnEffort=vP;Pr.canRollbackStatus=_P;Pr.canArchiveTask=SP;Pr.canMarkReviewed=bP;var tS=Js(),tt=fs(),Or=dr();function lP(n){return!(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isPlannedForToday)(n.metadata))}o(lP,"canPlanOnToday");function uP(n){return!(0,tt.hasClass)(n.instanceClass,Or.AssetClass.TASK)&&!(0,tt.hasClass)(n.instanceClass,Or.AssetClass.MEETING)?!1:(0,tt.hasStatus)(n.currentStatus,Or.EffortStatus.BACKLOG)}o(uP,"canPlanForEvening");function fP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasPlannedStartTimestamp)(n.metadata):!1}o(fP,"canShiftDayBackward");function hP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasPlannedStartTimestamp)(n.metadata):!1}o(hP,"canShiftDayForward");function dP(n){return(0,tt.isEffort)(n.instanceClass)?!n.currentStatus:!1}o(dP,"canSetDraftStatus");function pP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasStatus)(n.currentStatus,Or.EffortStatus.DRAFT):!1}o(pP,"canMoveToBacklog");function mP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasClass)(n.instanceClass,Or.AssetClass.TASK)||(0,tt.hasClass)(n.instanceClass,Or.AssetClass.MEETING)?(0,tt.hasStatus)(n.currentStatus,Or.EffortStatus.BACKLOG):(0,tt.hasClass)(n.instanceClass,Or.AssetClass.PROJECT)?(0,tt.hasStatus)(n.currentStatus,Or.EffortStatus.TODO):!1:!1}o(mP,"canStartEffort");function gP(n){return(0,tt.isEffort)(n.instanceClass)?(0,tt.hasStatus)(n.currentStatus,Or.EffortStatus.DOING):!1}o(gP,"canMarkDone");function yP(n){return(0,tt.isEffort)(n.instanceClass)?n.currentStatus?!(Array.isArray(n.currentStatus)?n.currentStatus:[n.currentStatus]).some(r=>{let i=tS.WikiLinkHelpers.normalize(r);return i===Or.EffortStatus.TRASHED||i===Or.EffortStatus.DONE}):!0:!1}o(yP,"canTrashEffort");function vP(n){return!(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isAssetArchived)(n.isArchived))}o(vP,"canVoteOnEffort");function _P(n){if(!(0,tt.isEffort)(n.instanceClass)||(0,tt.isAssetArchived)(n.isArchived)||!n.currentStatus)return!1;let e=Array.isArray(n.currentStatus)?n.currentStatus[0]:n.currentStatus;return!(!e||tS.WikiLinkHelpers.normalize(e)===Or.EffortStatus.TRASHED)}o(_P,"canRollbackStatus");function SP(n){return!(0,tt.isAssetArchived)(n.isArchived)}o(SP,"canArchiveTask");function bP(n){return!(!(0,tt.hasClass)(n.instanceClass,Or.AssetClass.TASK)&&!(0,tt.hasClass)(n.instanceClass,Or.AssetClass.PROJECT)||(0,tt.isAssetArchived)(n.isArchived))}o(bP,"canMarkReviewed")});var nS=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.canCreateEvent=wP;mn.canCreateInstance=EP;mn.canCleanProperties=TP;mn.canRepairFolder=xP;mn.canRenameToUid=AP;mn.canCopyLabelToAliases=CP;mn.canCreateNarrowerConcept=IP;mn.canCreateSubclass=OP;mn.canCreateTaskForDailyNote=PP;mn.canCopyFleetingNoteLabel=RP;var mr=fs(),Rn=dr();function wP(n){return(0,mr.isAreaOrProject)(n.instanceClass)}o(wP,"canCreateEvent");function EP(n){return(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.TASK_PROTOTYPE)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.TASK_PROTOTYPE_UID)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.MEETING_PROTOTYPE)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.EVENT_PROTOTYPE)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.PROJECT_PROTOTYPE)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.PROTOTYPE)||n.classIsPrototype?!0:(0,mr.isPrototypeClass)(n.instanceClass,n.metadata)}o(EP,"canCreateInstance");function TP(n){return(0,mr.hasEmptyProperties)(n.metadata)}o(TP,"canCleanProperties");function xP(n){return(0,mr.needsFolderRepair)(n.currentFolder,n.expectedFolder)}o(xP,"canRepairFolder");function AP(n,e){let t=n.metadata.exo__Asset_uid;return t?e!==t:!1}o(AP,"canRenameToUid");function CP(n){let e=n.metadata.exo__Asset_label;if(!e||typeof e!="string"||e.trim()==="")return!1;let t=e.trim(),r=n.metadata.aliases;return!r||!Array.isArray(r)||r.length===0?!0:!r.some(i=>typeof i!="string"?!1:i.trim()===t)}o(CP,"canCopyLabelToAliases");function IP(n){return(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.CONCEPT)}o(IP,"canCreateNarrowerConcept");function OP(n){return(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.CLASS)}o(OP,"canCreateSubclass");function PP(n){return!(!(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.DAILY_NOTE)||n.isArchived||!(0,mr.extractDailyNoteDate)(n.metadata))}o(PP,"canCreateTaskForDailyNote");function RP(n){return(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.FLEETING_NOTE)||(0,mr.hasClass)(n.instanceClass,Rn.AssetClass.FLEETING_NOTE_UID)}o(RP,"canCopyFleetingNoteLabel")});var sS=v(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.canCopyFleetingNoteLabel=D.canCreateTaskForDailyNote=D.canCreateSubclass=D.canCreateNarrowerConcept=D.canCopyLabelToAliases=D.canRenameToUid=D.canRepairFolder=D.canCleanProperties=D.canCreateInstance=D.canCreateEvent=D.canMarkReviewed=D.canArchiveTask=D.canRollbackStatus=D.canVoteOnEffort=D.canTrashEffort=D.canMarkDone=D.canStartEffort=D.canMoveToBacklog=D.canSetDraftStatus=D.canShiftDayForward=D.canShiftDayBackward=D.canPlanForEvening=D.canPlanOnToday=D.canSetActiveFocus=D.canCreateChildArea=D.canConvertProjectToTask=D.canMoveToToDo=D.canMoveToAnalysis=D.canCreateProject=D.canSetCriticalityZone=D.canConvertTaskToProject=D.canCreateRelatedTask=D.canCreateTask=D.isPrototypeClass=D.inheritsFromPrototype=D.isCurrentDateGteDay=D.extractDailyNoteDate=D.hasPlannedStartTimestamp=D.isPlannedForToday=D.getTodayDateString=D.needsFolderRepair=D.hasEmptyProperties=D.isAssetArchived=D.hasStatus=D.isEffort=D.isAreaOrProject=D.hasClass=void 0;var Br=fs();Object.defineProperty(D,"hasClass",{enumerable:!0,get:o(function(){return Br.hasClass},"get")});Object.defineProperty(D,"isAreaOrProject",{enumerable:!0,get:o(function(){return Br.isAreaOrProject},"get")});Object.defineProperty(D,"isEffort",{enumerable:!0,get:o(function(){return Br.isEffort},"get")});Object.defineProperty(D,"hasStatus",{enumerable:!0,get:o(function(){return Br.hasStatus},"get")});Object.defineProperty(D,"isAssetArchived",{enumerable:!0,get:o(function(){return Br.isAssetArchived},"get")});Object.defineProperty(D,"hasEmptyProperties",{enumerable:!0,get:o(function(){return Br.hasEmptyProperties},"get")});Object.defineProperty(D,"needsFolderRepair",{enumerable:!0,get:o(function(){return Br.needsFolderRepair},"get")});Object.defineProperty(D,"getTodayDateString",{enumerable:!0,get:o(function(){return Br.getTodayDateString},"get")});Object.defineProperty(D,"isPlannedForToday",{enumerable:!0,get:o(function(){return Br.isPlannedForToday},"get")});Object.defineProperty(D,"hasPlannedStartTimestamp",{enumerable:!0,get:o(function(){return Br.hasPlannedStartTimestamp},"get")});Object.defineProperty(D,"extractDailyNoteDate",{enumerable:!0,get:o(function(){return Br.extractDailyNoteDate},"get")});Object.defineProperty(D,"isCurrentDateGteDay",{enumerable:!0,get:o(function(){return Br.isCurrentDateGteDay},"get")});Object.defineProperty(D,"inheritsFromPrototype",{enumerable:!0,get:o(function(){return Br.inheritsFromPrototype},"get")});Object.defineProperty(D,"isPrototypeClass",{enumerable:!0,get:o(function(){return Br.isPrototypeClass},"get")});var tf=K_();Object.defineProperty(D,"canCreateTask",{enumerable:!0,get:o(function(){return tf.canCreateTask},"get")});Object.defineProperty(D,"canCreateRelatedTask",{enumerable:!0,get:o(function(){return tf.canCreateRelatedTask},"get")});Object.defineProperty(D,"canConvertTaskToProject",{enumerable:!0,get:o(function(){return tf.canConvertTaskToProject},"get")});Object.defineProperty(D,"canSetCriticalityZone",{enumerable:!0,get:o(function(){return tf.canSetCriticalityZone},"get")});var rf=X_();Object.defineProperty(D,"canCreateProject",{enumerable:!0,get:o(function(){return rf.canCreateProject},"get")});Object.defineProperty(D,"canMoveToAnalysis",{enumerable:!0,get:o(function(){return rf.canMoveToAnalysis},"get")});Object.defineProperty(D,"canMoveToToDo",{enumerable:!0,get:o(function(){return rf.canMoveToToDo},"get")});Object.defineProperty(D,"canConvertProjectToTask",{enumerable:!0,get:o(function(){return rf.canConvertProjectToTask},"get")});var iS=eS();Object.defineProperty(D,"canCreateChildArea",{enumerable:!0,get:o(function(){return iS.canCreateChildArea},"get")});Object.defineProperty(D,"canSetActiveFocus",{enumerable:!0,get:o(function(){return iS.canSetActiveFocus},"get")});var Jr=rS();Object.defineProperty(D,"canPlanOnToday",{enumerable:!0,get:o(function(){return Jr.canPlanOnToday},"get")});Object.defineProperty(D,"canPlanForEvening",{enumerable:!0,get:o(function(){return Jr.canPlanForEvening},"get")});Object.defineProperty(D,"canShiftDayBackward",{enumerable:!0,get:o(function(){return Jr.canShiftDayBackward},"get")});Object.defineProperty(D,"canShiftDayForward",{enumerable:!0,get:o(function(){return Jr.canShiftDayForward},"get")});Object.defineProperty(D,"canSetDraftStatus",{enumerable:!0,get:o(function(){return Jr.canSetDraftStatus},"get")});Object.defineProperty(D,"canMoveToBacklog",{enumerable:!0,get:o(function(){return Jr.canMoveToBacklog},"get")});Object.defineProperty(D,"canStartEffort",{enumerable:!0,get:o(function(){return Jr.canStartEffort},"get")});Object.defineProperty(D,"canMarkDone",{enumerable:!0,get:o(function(){return Jr.canMarkDone},"get")});Object.defineProperty(D,"canTrashEffort",{enumerable:!0,get:o(function(){return Jr.canTrashEffort},"get")});Object.defineProperty(D,"canVoteOnEffort",{enumerable:!0,get:o(function(){return Jr.canVoteOnEffort},"get")});Object.defineProperty(D,"canRollbackStatus",{enumerable:!0,get:o(function(){return Jr.canRollbackStatus},"get")});Object.defineProperty(D,"canArchiveTask",{enumerable:!0,get:o(function(){return Jr.canArchiveTask},"get")});Object.defineProperty(D,"canMarkReviewed",{enumerable:!0,get:o(function(){return Jr.canMarkReviewed},"get")});var _i=nS();Object.defineProperty(D,"canCreateEvent",{enumerable:!0,get:o(function(){return _i.canCreateEvent},"get")});Object.defineProperty(D,"canCreateInstance",{enumerable:!0,get:o(function(){return _i.canCreateInstance},"get")});Object.defineProperty(D,"canCleanProperties",{enumerable:!0,get:o(function(){return _i.canCleanProperties},"get")});Object.defineProperty(D,"canRepairFolder",{enumerable:!0,get:o(function(){return _i.canRepairFolder},"get")});Object.defineProperty(D,"canRenameToUid",{enumerable:!0,get:o(function(){return _i.canRenameToUid},"get")});Object.defineProperty(D,"canCopyLabelToAliases",{enumerable:!0,get:o(function(){return _i.canCopyLabelToAliases},"get")});Object.defineProperty(D,"canCreateNarrowerConcept",{enumerable:!0,get:o(function(){return _i.canCreateNarrowerConcept},"get")});Object.defineProperty(D,"canCreateSubclass",{enumerable:!0,get:o(function(){return _i.canCreateSubclass},"get")});Object.defineProperty(D,"canCreateTaskForDailyNote",{enumerable:!0,get:o(function(){return _i.canCreateTaskForDailyNote},"get")});Object.defineProperty(D,"canCopyFleetingNoteLabel",{enumerable:!0,get:o(function(){return _i.canCopyFleetingNoteLabel},"get")})});var aS=v(ta=>{"use strict";var FP=ta&&ta.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),DP=ta&&ta.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&FP(e,n,t)};Object.defineProperty(ta,"__esModule",{value:!0});DP(sS(),ta)});var Lm=v(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.PropertyFieldType=void 0;Wc.rangeToFieldType=MP;var rr;(function(n){n.Text="text",n.Number="number",n.Date="date",n.DateTime="datetime",n.Boolean="boolean",n.Reference="reference",n.Enum="enum",n.StatusSelect="status-select",n.SizeSelect="size-select",n.Wikilink="wikilink",n.Timestamp="timestamp",n.Unknown="unknown"})(rr||(Wc.PropertyFieldType=rr={}));var oS="http://www.w3.org/2001/XMLSchema#",NP="https://exocortex.my/ontology/exo#",LP="https://exocortex.my/ontology/ems#";function MP(n){if(!n)return rr.Unknown;let e=n.trim();if(!e)return rr.Unknown;if(e.startsWith(oS)){let t=e.substring(oS.length);return Nm(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return Nm(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return Nm(r)}return e.startsWith(LP)||e.startsWith("ems:")?kP(e):e.startsWith(NP)||e.startsWith("exo:")||jP(e)?rr.Reference:rr.Text}o(MP,"rangeToFieldType");function Nm(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return rr.Text;case"integer":case"int":case"long":case"short":case"byte":case"nonnegativeinteger":case"positiveinteger":case"nonpositiveinteger":case"negativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"decimal":case"float":case"double":return rr.Number;case"date":return rr.Date;case"datetime":case"datetimestamp":return rr.DateTime;case"boolean":return rr.Boolean;case"time":return rr.Timestamp;default:return rr.Text}}o(Nm,"xsdTypeToFieldType");function kP(n){let e=n.toLowerCase();return e.includes("effortstatus")?rr.StatusSelect:e.includes("tasksize")?rr.SizeSelect:rr.Reference}o(kP,"emsTypeToFieldType");function jP(n){let e=n.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(r=>e.includes(r))}o(jP,"isClassReference")});var lS=v(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.propertyNameToUri=$P;Hc.uriToPropertyName=cS;Hc.extractPropertyLabel=VP;function $P(n){return n.replace(/^([a-z]+)__/,"$1:")}o($P,"propertyNameToUri");function cS(n){if(n.startsWith("http://")||n.startsWith("https://")){let e=n.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=n.lastIndexOf("#"),r=n.lastIndexOf("/"),i=Math.max(t,r);return i>=0?n.substring(i+1):n}return n.replace(/^([a-z]+):/,"$1__")}o(cS,"uriToPropertyName");function VP(n){let r=(n.includes(":")?cS(n):n).replace(/^[a-z]+__/,"").split("_");return(r.length>1?r.slice(1).join(" "):r[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}o(VP,"extractPropertyLabel")});var nf={};Qv(nf,{__assign:()=>km,__asyncDelegator:()=>ZP,__asyncGenerator:()=>JP,__asyncValues:()=>eR,__await:()=>zc,__awaiter:()=>HP,__classPrivateFieldGet:()=>iR,__classPrivateFieldSet:()=>sR,__createBinding:()=>QP,__decorate:()=>qP,__exportStar:()=>YP,__extends:()=>UP,__generator:()=>zP,__importDefault:()=>nR,__importStar:()=>rR,__makeTemplateObject:()=>tR,__metadata:()=>WP,__param:()=>GP,__read:()=>uS,__rest:()=>BP,__spread:()=>KP,__spreadArrays:()=>XP,__values:()=>jm});function UP(n,e){Mm(n,e);function t(){this.constructor=n}o(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function BP(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function qP(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function GP(n,e){return function(t,r){e(t,r,n)}}function WP(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function HP(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,a){function c(f){try{u(r.next(f))}catch(h){a(h)}}o(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(h){a(h)}}o(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}o(u,"step"),u((r=r.apply(n,e||[])).next())})}function zP(n,e){var t={label:0,sent:o(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function QP(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function YP(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function jm(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:o(function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function uS(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return s}function KP(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(uS(arguments[e]));return n}function XP(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],a=0,c=s.length;a<c;a++,i++)r[i]=s[a];return r}function zc(n){return this instanceof zc?(this.v=n,this):new zc(n)}function JP(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(d){r[d]&&(i[d]=function(p){return new Promise(function(_,S){s.push([d,p,_,S])>1||c(d,p)})})}function c(d,p){try{l(r[d](p))}catch(_){h(s[0][3],_)}}function l(d){d.value instanceof zc?Promise.resolve(d.value.v).then(u,f):h(s[0][2],d)}function u(d){c("next",d)}function f(d){c("throw",d)}function h(d,p){d(p),s.shift(),s.length&&c(s[0][0],s[0][1])}}function ZP(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(a){return(t=!t)?{value:zc(n[i](a)),done:i==="return"}:s?s(a):a}:s}}function eR(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof jm=="function"?jm(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(a){return new Promise(function(c,l){a=n[s](a),i(c,l,a.done,a.value)})}}function i(s,a,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},a)}}function tR(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function rR(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function nR(n){return n&&n.__esModule?n:{default:n}}function iR(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function sR(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}var Mm,km,sf=rI(()=>{Mm=o(function(n,e){return Mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Mm(n,e)},"extendStatics");o(UP,"__extends");km=o(function(){return km=Object.assign||o(function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),km.apply(this,arguments)},"__assign");o(BP,"__rest");o(qP,"__decorate");o(GP,"__param");o(WP,"__metadata");o(HP,"__awaiter");o(zP,"__generator");o(QP,"__createBinding");o(YP,"__exportStar");o(jm,"__values");o(uS,"__read");o(KP,"__spread");o(XP,"__spreadArrays");o(zc,"__await");o(JP,"__asyncGenerator");o(ZP,"__asyncDelegator");o(eR,"__asyncValues");o(tR,"__makeTemplateObject");o(rR,"__importStar");o(nR,"__importDefault");o(iR,"__classPrivateFieldGet");o(sR,"__classPrivateFieldSet")});var Um=v(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var $m;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})($m||($m={}));Vm.default=$m});var fS=v(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var aR=Um();Object.defineProperty(Bm,"Lifecycle",{enumerable:!0,get:o(function(){return aR.default},"get")})});var ra=v(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.defineInjectionTokenMetadata=Fn.getParamInfo=Fn.INJECTION_TOKEN_METADATA_KEY=void 0;Fn.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function oR(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(Fn.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}o(oR,"getParamInfo");Fn.getParamInfo=oR;function cR(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(Fn.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(Fn.INJECTION_TOKEN_METADATA_KEY,s,t)}}o(cR,"defineInjectionTokenMetadata");Fn.defineInjectionTokenMetadata=cR});var qm=v(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.isClassProvider=void 0;function lR(n){return!!n.useClass}o(lR,"isClassProvider");af.isClassProvider=lR});var Gm=v(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.isFactoryProvider=void 0;function uR(n){return!!n.useFactory}o(uR,"isFactoryProvider");of.isFactoryProvider=uR});var lf=v(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.delay=eo.DelayedConstructor=void 0;var cf=class{static{o(this,"DelayedConstructor")}constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},r=!1,i,s=o(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=o(i=>{t[i]=(...s)=>{s[0]=e();let a=Reflect[i];return a(...s)}},"install");return this.reflectMethods.forEach(r),t}};eo.DelayedConstructor=cf;function fR(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new cf(n)}o(fR,"delay");eo.delay=fR});var uf=v(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.isConstructorToken=Si.isTransformDescriptor=Si.isTokenDescriptor=Si.isNormalToken=void 0;var hR=lf();function dR(n){return typeof n=="string"||typeof n=="symbol"}o(dR,"isNormalToken");Si.isNormalToken=dR;function pR(n){return typeof n=="object"&&"token"in n&&"multiple"in n}o(pR,"isTokenDescriptor");Si.isTokenDescriptor=pR;function mR(n){return typeof n=="object"&&"token"in n&&"transform"in n}o(mR,"isTransformDescriptor");Si.isTransformDescriptor=mR;function gR(n){return typeof n=="function"||n instanceof hR.DelayedConstructor}o(gR,"isConstructorToken");Si.isConstructorToken=gR});var Wm=v(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.isTokenProvider=void 0;function yR(n){return!!n.useToken}o(yR,"isTokenProvider");ff.isTokenProvider=yR});var Hm=v(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.isValueProvider=void 0;function vR(n){return n.useValue!=null}o(vR,"isValueProvider");hf.isValueProvider=vR});var zm=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var _R=qm();Object.defineProperty(na,"isClassProvider",{enumerable:!0,get:o(function(){return _R.isClassProvider},"get")});var SR=Gm();Object.defineProperty(na,"isFactoryProvider",{enumerable:!0,get:o(function(){return SR.isFactoryProvider},"get")});var bR=uf();Object.defineProperty(na,"isNormalToken",{enumerable:!0,get:o(function(){return bR.isNormalToken},"get")});var wR=Wm();Object.defineProperty(na,"isTokenProvider",{enumerable:!0,get:o(function(){return wR.isTokenProvider},"get")});var ER=Hm();Object.defineProperty(na,"isValueProvider",{enumerable:!0,get:o(function(){return ER.isValueProvider},"get")})});var hS=v(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.isProvider=void 0;var TR=qm(),xR=Hm(),AR=Wm(),CR=Gm();function IR(n){return TR.isClassProvider(n)||xR.isValueProvider(n)||AR.isTokenProvider(n)||CR.isFactoryProvider(n)}o(IR,"isProvider");df.isProvider=IR});var Km=v(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var Qm=class{static{o(this,"RegistryBase")}constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};Ym.default=Qm});var dS=v(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var OR=Km(),Xm=class extends OR.default{static{o(this,"Registry")}};Jm.default=Xm});var pS=v(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});var Zm=class{static{o(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};eg.default=Zm});var tg=v(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.formatErrorCtor=void 0;function PR(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}o(PR,"formatDependency");function RR(n,e,t=" "){return[n,...e.message.split(`
32
32
  `).map(r=>t+r)].join(`
33
- `)}o(RR,"composeErrorMessage");function FR(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=PR(r,e);return RR(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}o(FR,"formatErrorCtor");pf.formatErrorCtor=FR});var mS=v(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.isDisposable=void 0;function DR(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}o(DR,"isDisposable");mf.isDisposable=DR});var yS=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.PostResolutionInterceptors=ia.PreResolutionInterceptors=void 0;var gS=Km(),gf=class extends gS.default{static{o(this,"PreResolutionInterceptors")}};ia.PreResolutionInterceptors=gf;var yf=class extends gS.default{static{o(this,"PostResolutionInterceptors")}};ia.PostResolutionInterceptors=yf;var rg=class{static{o(this,"Interceptors")}constructor(){this.preResolution=new gf,this.postResolution=new yf}};ia.default=rg});var ps=v(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.instance=Qi.typeInfo=void 0;var NR=(sf(),Op(nf)),Rr=zm(),LR=hS(),vf=uf(),MR=dS(),qr=Um(),_f=pS(),kR=tg(),jR=lf(),$R=mS(),VR=yS();Qi.typeInfo=new Map;var ng=class n{static{o(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new MR.default,this.interceptors=new VR.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:qr.default.Transient}){this.ensureNotDisposed();let i;if(LR.isProvider(t)?i=t:i={useClass:t},Rr.isTokenProvider(i)){let s=[e],a=i;for(;a!=null;){let c=a.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&Rr.isTokenProvider(l.provider)?a=l.provider:a=null}}if((r.lifecycle===qr.default.Singleton||r.lifecycle==qr.default.ContainerScoped||r.lifecycle==qr.default.ResolutionScoped)&&(Rr.isValueProvider(i)||Rr.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${qr.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),Rr.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),Rr.isNormalToken(e)){if(Rr.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:qr.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:qr.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!Rr.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:qr.default.Singleton})}resolve(e,t=new _f.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&Rr.isNormalToken(e)){if(r)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(vf.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===qr.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===qr.default.Singleton,i=e.options.lifecycle===qr.default.ContainerScoped,s=r||i,a;return Rr.isValueProvider(e.provider)?a=e.provider.useValue:Rr.isTokenProvider(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Rr.isClassProvider(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Rr.isFactoryProvider(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===qr.default.ResolutionScoped&&t.scopedResolutions.set(e,a),a}resolveAll(e,t=new _f.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&Rr.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let a=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,a,"All"),a}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!Rr.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===qr.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===qr.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return NR.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof jR.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Qi.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return $R.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return vf.isTokenDescriptor(r)?vf.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new _f.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new _f.default,r.isOptional):this.resolve(r.token,e,r.isOptional):vf.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(kR.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Qi.instance=new ng;Qi.default=Qi.instance});var vS=v(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});var UR=ra(),Yi=ps(),ig=uf(),BR=tg();function qR(){return function(n){let e=UR.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return ig.isTokenDescriptor(r)?ig.isTransformDescriptor(r)?r.multiple?Yi.instance.resolve(r.transform).transform(Yi.instance.resolveAll(r.token),...r.transformArgs):Yi.instance.resolve(r.transform).transform(Yi.instance.resolve(r.token),...r.transformArgs):r.multiple?Yi.instance.resolveAll(r.token):Yi.instance.resolve(r.token):ig.isTransformDescriptor(r)?Yi.instance.resolve(r.transform).transform(Yi.instance.resolve(r.token),...r.transformArgs):Yi.instance.resolve(r)}catch(s){let a=i+t.length;throw new Error(BR.formatErrorCtor(n,a,s))}})))}}}}o(qR,"autoInjectable");sg.default=qR});var _S=v(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});var GR=ra();function WR(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return GR.defineInjectionTokenMetadata(t)}o(WR,"inject");ag.default=WR});var Sf=v(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});var HR=ra(),zR=ps(),SS=ps();function QR(n){return function(e){zR.typeInfo.set(e,HR.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{SS.instance.register(t,e)}):SS.instance.register(n.token,e))}}o(QR,"injectable");og.default=QR});var bS=v(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});var YR=(sf(),Op(nf)),KR=ps();function XR(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=YR.__rest(t,["token","options"]);return KR.instance.register(r,s,i)}),e}}o(XR,"registry");cg.default=XR});var wS=v(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});var JR=Sf(),ZR=ps();function eF(){return function(n){JR.default()(n),ZR.instance.registerSingleton(n)}}o(eF,"singleton");lg.default=eF});var ES=v(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});var tF=ra();function rF(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return tF.defineInjectionTokenMetadata(t)}o(rF,"injectAll");ug.default=rF});var TS=v(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});var nF=ra();function iF(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return nF.defineInjectionTokenMetadata(r)}o(iF,"injectAllWithTransform");fg.default=iF});var xS=v(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});var sF=ra();function aF(n,e,...t){return sF.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}o(aF,"injectWithTransform");hg.default=aF});var AS=v(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});var oF=Sf(),cF=ps();function lF(n,e){return function(t){oF.default()(t),cF.instance.register(e||t,t,{lifecycle:n})}}o(lF,"scoped");dg.default=lF});var CS=v(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});var uF=vS();Object.defineProperty(Fn,"autoInjectable",{enumerable:!0,get:o(function(){return uF.default},"get")});var fF=_S();Object.defineProperty(Fn,"inject",{enumerable:!0,get:o(function(){return fF.default},"get")});var hF=Sf();Object.defineProperty(Fn,"injectable",{enumerable:!0,get:o(function(){return hF.default},"get")});var dF=bS();Object.defineProperty(Fn,"registry",{enumerable:!0,get:o(function(){return dF.default},"get")});var pF=wS();Object.defineProperty(Fn,"singleton",{enumerable:!0,get:o(function(){return pF.default},"get")});var mF=ES();Object.defineProperty(Fn,"injectAll",{enumerable:!0,get:o(function(){return mF.default},"get")});var gF=TS();Object.defineProperty(Fn,"injectAllWithTransform",{enumerable:!0,get:o(function(){return gF.default},"get")});var yF=xS();Object.defineProperty(Fn,"injectWithTransform",{enumerable:!0,get:o(function(){return yF.default},"get")});var vF=AS();Object.defineProperty(Fn,"scoped",{enumerable:!0,get:o(function(){return vF.default},"get")})});var IS=v(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});function _F(n){let e;return t=>(e==null&&(e=n(t)),e)}o(_F,"instanceCachingFactory");pg.default=_F});var OS=v(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});function SF(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}o(SF,"instancePerContainerCachingFactory");mg.default=SF});var PS=v(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});function bF(n,e,t,r=!0){let i,s;return a=>{let c=n(a);return(!r||s!==c)&&((s=c)?i=a.resolve(e):i=a.resolve(t)),i}}o(bF,"predicateAwareClassFactory");gg.default=bF});var RS=v(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var wF=IS();Object.defineProperty(Qc,"instanceCachingFactory",{enumerable:!0,get:o(function(){return wF.default},"get")});var EF=OS();Object.defineProperty(Qc,"instancePerContainerCachingFactory",{enumerable:!0,get:o(function(){return EF.default},"get")});var TF=PS();Object.defineProperty(Qc,"predicateAwareClassFactory",{enumerable:!0,get:o(function(){return TF.default},"get")})});var Ve=v(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var yg=(sf(),Op(nf));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var xF=fS();Object.defineProperty(ms,"Lifecycle",{enumerable:!0,get:o(function(){return xF.Lifecycle},"get")});yg.__exportStar(CS(),ms);yg.__exportStar(RS(),ms);yg.__exportStar(zm(),ms);var AF=lf();Object.defineProperty(ms,"delay",{enumerable:!0,get:o(function(){return AF.delay},"get")});var CF=ps();Object.defineProperty(ms,"container",{enumerable:!0,get:o(function(){return CF.instance},"get")})});var gn=v(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.MetadataHelpers=void 0;var vg=class{static{o(this,"MetadataHelpers")}static findAllReferencingProperties(e,t){let r=[];for(let[i,s]of Object.entries(e))this.containsReference(s,t)&&r.push(i);return r}static findReferencingProperty(e,t){for(let[r,i]of Object.entries(e))if(this.containsReference(i,t))return r}static containsReference(e,t){if(!e)return!1;let r=t.replace(/\.md$/,"");if(typeof e=="string"){let i=/\[\[([^\[\]]+)\]\]/g,s;for(;(s=i.exec(e))!==null;){let c=s[1].split("|")[0].trim();if(c===r||c.endsWith(`/${r}`))return!0}return!1}return Array.isArray(e)?e.some(i=>this.containsReference(i,t)):!1}static isAssetArchived(e){let t=e?.exo__Asset_isArchived;if(t!=null){if(t===!0||t===1)return!0;if(typeof t=="string"){let i=t.toLowerCase().trim();if(i==="true"||i==="yes"||i==="1")return!0}if(typeof t=="boolean")return t}let r=e?.archived;if(r==null)return!1;if(typeof r=="boolean")return r;if(typeof r=="number")return r!==0;if(typeof r=="string"){let i=r.toLowerCase().trim();return i==="true"||i==="yes"||i==="1"}return!1}static getPropertyValue(e,t){return t==="Name"||t==="title"?e.title:t==="created"?e.created:t==="modified"?e.modified:t==="path"?e.path:e.metadata?.[t]}static ensureQuoted(e){return!e||e==='""'?'""':e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}static buildFileContent(e,t){let r=Object.entries(e).map(([s,a])=>{if(Array.isArray(a)){let c=a.map(l=>` - ${l}`).join(`
33
+ `)}o(RR,"composeErrorMessage");function FR(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=PR(r,e);return RR(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}o(FR,"formatErrorCtor");pf.formatErrorCtor=FR});var mS=v(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.isDisposable=void 0;function DR(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}o(DR,"isDisposable");mf.isDisposable=DR});var yS=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.PostResolutionInterceptors=ia.PreResolutionInterceptors=void 0;var gS=Km(),gf=class extends gS.default{static{o(this,"PreResolutionInterceptors")}};ia.PreResolutionInterceptors=gf;var yf=class extends gS.default{static{o(this,"PostResolutionInterceptors")}};ia.PostResolutionInterceptors=yf;var rg=class{static{o(this,"Interceptors")}constructor(){this.preResolution=new gf,this.postResolution=new yf}};ia.default=rg});var ps=v(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.instance=Qi.typeInfo=void 0;var NR=(sf(),Op(nf)),Rr=zm(),LR=hS(),vf=uf(),MR=dS(),qr=Um(),_f=pS(),kR=tg(),jR=lf(),$R=mS(),VR=yS();Qi.typeInfo=new Map;var ng=class n{static{o(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new MR.default,this.interceptors=new VR.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:qr.default.Transient}){this.ensureNotDisposed();let i;if(LR.isProvider(t)?i=t:i={useClass:t},Rr.isTokenProvider(i)){let s=[e],a=i;for(;a!=null;){let c=a.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&Rr.isTokenProvider(l.provider)?a=l.provider:a=null}}if((r.lifecycle===qr.default.Singleton||r.lifecycle==qr.default.ContainerScoped||r.lifecycle==qr.default.ResolutionScoped)&&(Rr.isValueProvider(i)||Rr.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${qr.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),Rr.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),Rr.isNormalToken(e)){if(Rr.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:qr.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:qr.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!Rr.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:qr.default.Singleton})}resolve(e,t=new _f.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&Rr.isNormalToken(e)){if(r)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(vf.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===qr.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===qr.default.Singleton,i=e.options.lifecycle===qr.default.ContainerScoped,s=r||i,a;return Rr.isValueProvider(e.provider)?a=e.provider.useValue:Rr.isTokenProvider(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Rr.isClassProvider(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Rr.isFactoryProvider(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===qr.default.ResolutionScoped&&t.scopedResolutions.set(e,a),a}resolveAll(e,t=new _f.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&Rr.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let a=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,a,"All"),a}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!Rr.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===qr.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===qr.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return NR.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof jR.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Qi.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return $R.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return vf.isTokenDescriptor(r)?vf.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new _f.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new _f.default,r.isOptional):this.resolve(r.token,e,r.isOptional):vf.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(kR.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Qi.instance=new ng;Qi.default=Qi.instance});var vS=v(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});var UR=ra(),Yi=ps(),ig=uf(),BR=tg();function qR(){return function(n){let e=UR.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return ig.isTokenDescriptor(r)?ig.isTransformDescriptor(r)?r.multiple?Yi.instance.resolve(r.transform).transform(Yi.instance.resolveAll(r.token),...r.transformArgs):Yi.instance.resolve(r.transform).transform(Yi.instance.resolve(r.token),...r.transformArgs):r.multiple?Yi.instance.resolveAll(r.token):Yi.instance.resolve(r.token):ig.isTransformDescriptor(r)?Yi.instance.resolve(r.transform).transform(Yi.instance.resolve(r.token),...r.transformArgs):Yi.instance.resolve(r)}catch(s){let a=i+t.length;throw new Error(BR.formatErrorCtor(n,a,s))}})))}}}}o(qR,"autoInjectable");sg.default=qR});var _S=v(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});var GR=ra();function WR(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return GR.defineInjectionTokenMetadata(t)}o(WR,"inject");ag.default=WR});var Sf=v(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});var HR=ra(),zR=ps(),SS=ps();function QR(n){return function(e){zR.typeInfo.set(e,HR.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{SS.instance.register(t,e)}):SS.instance.register(n.token,e))}}o(QR,"injectable");og.default=QR});var bS=v(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});var YR=(sf(),Op(nf)),KR=ps();function XR(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=YR.__rest(t,["token","options"]);return KR.instance.register(r,s,i)}),e}}o(XR,"registry");cg.default=XR});var wS=v(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});var JR=Sf(),ZR=ps();function eF(){return function(n){JR.default()(n),ZR.instance.registerSingleton(n)}}o(eF,"singleton");lg.default=eF});var ES=v(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});var tF=ra();function rF(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return tF.defineInjectionTokenMetadata(t)}o(rF,"injectAll");ug.default=rF});var TS=v(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});var nF=ra();function iF(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return nF.defineInjectionTokenMetadata(r)}o(iF,"injectAllWithTransform");fg.default=iF});var xS=v(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});var sF=ra();function aF(n,e,...t){return sF.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}o(aF,"injectWithTransform");hg.default=aF});var AS=v(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});var oF=Sf(),cF=ps();function lF(n,e){return function(t){oF.default()(t),cF.instance.register(e||t,t,{lifecycle:n})}}o(lF,"scoped");dg.default=lF});var CS=v(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});var uF=vS();Object.defineProperty(Dn,"autoInjectable",{enumerable:!0,get:o(function(){return uF.default},"get")});var fF=_S();Object.defineProperty(Dn,"inject",{enumerable:!0,get:o(function(){return fF.default},"get")});var hF=Sf();Object.defineProperty(Dn,"injectable",{enumerable:!0,get:o(function(){return hF.default},"get")});var dF=bS();Object.defineProperty(Dn,"registry",{enumerable:!0,get:o(function(){return dF.default},"get")});var pF=wS();Object.defineProperty(Dn,"singleton",{enumerable:!0,get:o(function(){return pF.default},"get")});var mF=ES();Object.defineProperty(Dn,"injectAll",{enumerable:!0,get:o(function(){return mF.default},"get")});var gF=TS();Object.defineProperty(Dn,"injectAllWithTransform",{enumerable:!0,get:o(function(){return gF.default},"get")});var yF=xS();Object.defineProperty(Dn,"injectWithTransform",{enumerable:!0,get:o(function(){return yF.default},"get")});var vF=AS();Object.defineProperty(Dn,"scoped",{enumerable:!0,get:o(function(){return vF.default},"get")})});var IS=v(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});function _F(n){let e;return t=>(e==null&&(e=n(t)),e)}o(_F,"instanceCachingFactory");pg.default=_F});var OS=v(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});function SF(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}o(SF,"instancePerContainerCachingFactory");mg.default=SF});var PS=v(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});function bF(n,e,t,r=!0){let i,s;return a=>{let c=n(a);return(!r||s!==c)&&((s=c)?i=a.resolve(e):i=a.resolve(t)),i}}o(bF,"predicateAwareClassFactory");gg.default=bF});var RS=v(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var wF=IS();Object.defineProperty(Qc,"instanceCachingFactory",{enumerable:!0,get:o(function(){return wF.default},"get")});var EF=OS();Object.defineProperty(Qc,"instancePerContainerCachingFactory",{enumerable:!0,get:o(function(){return EF.default},"get")});var TF=PS();Object.defineProperty(Qc,"predicateAwareClassFactory",{enumerable:!0,get:o(function(){return TF.default},"get")})});var Ve=v(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var yg=(sf(),Op(nf));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var xF=fS();Object.defineProperty(ms,"Lifecycle",{enumerable:!0,get:o(function(){return xF.Lifecycle},"get")});yg.__exportStar(CS(),ms);yg.__exportStar(RS(),ms);yg.__exportStar(zm(),ms);var AF=lf();Object.defineProperty(ms,"delay",{enumerable:!0,get:o(function(){return AF.delay},"get")});var CF=ps();Object.defineProperty(ms,"container",{enumerable:!0,get:o(function(){return CF.instance},"get")})});var gn=v(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.MetadataHelpers=void 0;var vg=class{static{o(this,"MetadataHelpers")}static findAllReferencingProperties(e,t){let r=[];for(let[i,s]of Object.entries(e))this.containsReference(s,t)&&r.push(i);return r}static findReferencingProperty(e,t){for(let[r,i]of Object.entries(e))if(this.containsReference(i,t))return r}static containsReference(e,t){if(!e)return!1;let r=t.replace(/\.md$/,"");if(typeof e=="string"){let i=/\[\[([^\[\]]+)\]\]/g,s;for(;(s=i.exec(e))!==null;){let c=s[1].split("|")[0].trim();if(c===r||c.endsWith(`/${r}`))return!0}return!1}return Array.isArray(e)?e.some(i=>this.containsReference(i,t)):!1}static isAssetArchived(e){let t=e?.exo__Asset_isArchived;if(t!=null){if(t===!0||t===1)return!0;if(typeof t=="string"){let i=t.toLowerCase().trim();if(i==="true"||i==="yes"||i==="1")return!0}if(typeof t=="boolean")return t}let r=e?.archived;if(r==null)return!1;if(typeof r=="boolean")return r;if(typeof r=="number")return r!==0;if(typeof r=="string"){let i=r.toLowerCase().trim();return i==="true"||i==="yes"||i==="1"}return!1}static getPropertyValue(e,t){return t==="Name"||t==="title"?e.title:t==="created"?e.created:t==="modified"?e.modified:t==="path"?e.path:e.metadata?.[t]}static ensureQuoted(e){return!e||e==='""'?'""':e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}static buildFileContent(e,t){let r=Object.entries(e).map(([s,a])=>{if(Array.isArray(a)){let c=a.map(l=>` - ${l}`).join(`
34
34
  `);return`${s}:
35
35
  ${c}`}return`${s}: ${a}`}).join(`
36
36
  `),i=t?`
@@ -39,14 +39,14 @@ ${t}
39
39
  `;return`---
40
40
  ${r}
41
41
  ---
42
- ${i}`}};bf.MetadataHelpers=vg});var nr=v(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.DateFormatter=void 0;var _g=class n{static{o(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${i}T${s}:${a}:${c}`}static toDateWikilink(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${r}-${i}]]"`}static getTodayWikilink(){return n.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}static parseWikilink(e){let r=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return r?r[1]:null}static addDays(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}static isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static getTodayStartTimestamp(){let e=new Date;return e.setHours(0,0,0,0),n.toLocalTimestamp(e)}static toTimestampAtStartOfDay(e){let t=e.split("-").map(Number);if(t.length!==3||t.some(isNaN))throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD`);let[r,i,s]=t,a=new Date(r,i-1,s,0,0,0,0);if(isNaN(a.getTime()))throw new Error(`Invalid date values: ${e}`);return n.toLocalTimestamp(a)}static normalizeTimestamp(e){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e;let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid timestamp format: ${e}`);return n.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};wf.DateFormatter=_g});var Yc=v(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.MetadataExtractor=void 0;var IF=gn(),Sg=class{static{o(this,"MetadataExtractor")}constructor(e){this.vault=e}extractMetadata(e){return e?this.vault.getFrontmatter(e)||{}:{}}extractInstanceClass(e){return e.exo__Instance_class||null}extractStatus(e){return e.ems__Effort_status||null}extractIsArchived(e){return IF.MetadataHelpers.isAssetArchived(e)}static extractIsDefinedBy(e){let t=e.exo__Asset_isDefinedBy||'""';return Array.isArray(t)&&(t=t[0]||'""'),t}extractExpectedFolder(e){let t=e.exo__Asset_isDefinedBy;if(!t)return null;let r=Array.isArray(t)?t[0]:t;if(!r||typeof r!="string")return null;let i=r.replace(/["'[\]]/g,"").trim();if(!i)return null;let s=i.split("/");return s.pop(),s.join("/")}extractCommandVisibilityContext(e){let t=this.extractMetadata(e),r=this.extractInstanceClass(t),i=this.extractStatus(t),s=this.extractIsArchived(t),a=e.parent?.path||"",c=this.extractExpectedFolder(t);return{instanceClass:r,currentStatus:i,metadata:t,isArchived:s,currentFolder:a,expectedFolder:c}}extractCache(e){return e?this.vault.getFrontmatter(e):null}};Ef.MetadataExtractor=Sg});var Tf=v(sa=>{"use strict";var OF=sa&&sa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(sa,"__esModule",{value:!0});sa.TaskFrontmatterGenerator=void 0;var PF=Ve(),FS=Cr(),bg=nr(),RF=Js(),DS=Yc(),NS=gn(),At=dr(),FF=fs(),DF={[At.AssetClass.AREA]:"ems__Effort_area",[At.AssetClass.PROJECT]:"ems__Effort_parent",[At.AssetClass.TASK_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.MEETING_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.EVENT_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.PROJECT_PROTOTYPE]:"exo__Asset_prototype"},NF={[At.AssetClass.AREA]:At.AssetClass.TASK,[At.AssetClass.PROJECT]:At.AssetClass.TASK,[At.AssetClass.TASK_PROTOTYPE]:At.AssetClass.TASK,[At.AssetClass.MEETING_PROTOTYPE]:At.AssetClass.MEETING,[At.AssetClass.EVENT_PROTOTYPE]:At.AssetClass.EVENT,[At.AssetClass.PROJECT_PROTOTYPE]:At.AssetClass.PROJECT},wg=class{static{o(this,"TaskFrontmatterGenerator")}generateTaskFrontmatter(e,t,r,i,s,a,c){let l=new Date,u=bg.DateFormatter.toLocalTimestamp(l),f=DS.MetadataExtractor.extractIsDefinedBy(e),h=RF.WikiLinkHelpers.normalize(r),d=DF[h],p=NF[h]||At.AssetClass.TASK,_={};_.exo__Asset_isDefinedBy=NS.MetadataHelpers.ensureQuoted(f),_.exo__Asset_uid=s||(0,FS.v4)(),_.exo__Asset_createdAt=u,_.exo__Instance_class=[`"[[${p}]]"`],_.ems__Effort_status='"[[ems__EffortStatusDraft]]"',d?_[d]=`"[[${t}]]"`:(0,FF.isPrototypeClass)(r,e)&&(_.exo__Asset_prototype=`"[[${t}]]"`);let S=i;if(p===At.AssetClass.MEETING&&(!i||i.trim()==="")){let E=e.exo__Asset_label||t,A=bg.DateFormatter.toDateString(l);S=`${E} ${A}`}if(S&&S.trim()!==""){let E=S.trim();_.exo__Asset_label=E,_.aliases=[E]}return a&&(_.ems__Task_size=a),c&&(_.ems__Effort_plannedStartTimestamp=c),_}generateRelatedTaskFrontmatter(e,t,r,i,s){let a=new Date,c=bg.DateFormatter.toLocalTimestamp(a),l=DS.MetadataExtractor.extractIsDefinedBy(e),u={};if(u.exo__Asset_isDefinedBy=NS.MetadataHelpers.ensureQuoted(l),u.exo__Asset_uid=i||(0,FS.v4)(),u.exo__Asset_createdAt=c,u.exo__Instance_class=[`"[[${At.AssetClass.TASK}]]"`],u.ems__Effort_status='"[[ems__EffortStatusDraft]]"',u.exo__Asset_relates=[`"[[${t}]]"`],r&&r.trim()!==""){let f=r.trim();u.exo__Asset_label=f,u.aliases=[f]}return s&&(u.ems__Task_size=s),u}};sa.TaskFrontmatterGenerator=wg;sa.TaskFrontmatterGenerator=wg=OF([(0,PF.injectable)()],wg)});var xf=v(aa=>{"use strict";var LF=aa&&aa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(aa,"__esModule",{value:!0});aa.AlgorithmExtractor=void 0;var MF=Ve(),Eg=class{static{o(this,"AlgorithmExtractor")}extractH2Section(e,t){let r=e.split(`
42
+ ${i}`}};bf.MetadataHelpers=vg});var nr=v(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.DateFormatter=void 0;var _g=class n{static{o(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${i}T${s}:${a}:${c}`}static toDateWikilink(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${r}-${i}]]"`}static getTodayWikilink(){return n.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}static parseWikilink(e){let r=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return r?r[1]:null}static addDays(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}static isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static getTodayStartTimestamp(){let e=new Date;return e.setHours(0,0,0,0),n.toLocalTimestamp(e)}static toTimestampAtStartOfDay(e){let t=e.split("-").map(Number);if(t.length!==3||t.some(isNaN))throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD`);let[r,i,s]=t,a=new Date(r,i-1,s,0,0,0,0);if(isNaN(a.getTime()))throw new Error(`Invalid date values: ${e}`);return n.toLocalTimestamp(a)}static normalizeTimestamp(e){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e;let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid timestamp format: ${e}`);return n.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};wf.DateFormatter=_g});var Yc=v(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.MetadataExtractor=void 0;var IF=gn(),Sg=class{static{o(this,"MetadataExtractor")}constructor(e){this.vault=e}extractMetadata(e){return e?this.vault.getFrontmatter(e)||{}:{}}extractInstanceClass(e){return e.exo__Instance_class||null}extractStatus(e){return e.ems__Effort_status||null}extractIsArchived(e){return IF.MetadataHelpers.isAssetArchived(e)}static extractIsDefinedBy(e){let t=e.exo__Asset_isDefinedBy||'""';return Array.isArray(t)&&(t=t[0]||'""'),t}extractExpectedFolder(e){let t=e.exo__Asset_isDefinedBy;if(!t)return null;let r=Array.isArray(t)?t[0]:t;if(!r||typeof r!="string")return null;let i=r.replace(/["'[\]]/g,"").trim();if(!i)return null;let s=i.split("/");return s.pop(),s.join("/")}extractCommandVisibilityContext(e){let t=this.extractMetadata(e),r=this.extractInstanceClass(t),i=this.extractStatus(t),s=this.extractIsArchived(t),a=e.parent?.path||"",c=this.extractExpectedFolder(t);return{instanceClass:r,currentStatus:i,metadata:t,isArchived:s,currentFolder:a,expectedFolder:c}}extractCache(e){return e?this.vault.getFrontmatter(e):null}};Ef.MetadataExtractor=Sg});var Tf=v(sa=>{"use strict";var OF=sa&&sa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(sa,"__esModule",{value:!0});sa.TaskFrontmatterGenerator=void 0;var PF=Ve(),FS=Ir(),bg=nr(),RF=Js(),DS=Yc(),NS=gn(),At=dr(),FF=fs(),DF={[At.AssetClass.AREA]:"ems__Effort_area",[At.AssetClass.PROJECT]:"ems__Effort_parent",[At.AssetClass.TASK_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.MEETING_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.EVENT_PROTOTYPE]:"exo__Asset_prototype",[At.AssetClass.PROJECT_PROTOTYPE]:"exo__Asset_prototype"},NF={[At.AssetClass.AREA]:At.AssetClass.TASK,[At.AssetClass.PROJECT]:At.AssetClass.TASK,[At.AssetClass.TASK_PROTOTYPE]:At.AssetClass.TASK,[At.AssetClass.MEETING_PROTOTYPE]:At.AssetClass.MEETING,[At.AssetClass.EVENT_PROTOTYPE]:At.AssetClass.EVENT,[At.AssetClass.PROJECT_PROTOTYPE]:At.AssetClass.PROJECT},wg=class{static{o(this,"TaskFrontmatterGenerator")}generateTaskFrontmatter(e,t,r,i,s,a,c){let l=new Date,u=bg.DateFormatter.toLocalTimestamp(l),f=DS.MetadataExtractor.extractIsDefinedBy(e),h=RF.WikiLinkHelpers.normalize(r),d=DF[h],p=NF[h]||At.AssetClass.TASK,_={};_.exo__Asset_isDefinedBy=NS.MetadataHelpers.ensureQuoted(f),_.exo__Asset_uid=s||(0,FS.v4)(),_.exo__Asset_createdAt=u,_.exo__Instance_class=[`"[[${p}]]"`],_.ems__Effort_status='"[[ems__EffortStatusDraft]]"',d?_[d]=`"[[${t}]]"`:(0,FF.isPrototypeClass)(r,e)&&(_.exo__Asset_prototype=`"[[${t}]]"`);let S=i;if(p===At.AssetClass.MEETING&&(!i||i.trim()==="")){let E=e.exo__Asset_label||t,A=bg.DateFormatter.toDateString(l);S=`${E} ${A}`}if(S&&S.trim()!==""){let E=S.trim();_.exo__Asset_label=E,_.aliases=[E]}return a&&(_.ems__Task_size=a),c&&(_.ems__Effort_plannedStartTimestamp=c),_}generateRelatedTaskFrontmatter(e,t,r,i,s){let a=new Date,c=bg.DateFormatter.toLocalTimestamp(a),l=DS.MetadataExtractor.extractIsDefinedBy(e),u={};if(u.exo__Asset_isDefinedBy=NS.MetadataHelpers.ensureQuoted(l),u.exo__Asset_uid=i||(0,FS.v4)(),u.exo__Asset_createdAt=c,u.exo__Instance_class=[`"[[${At.AssetClass.TASK}]]"`],u.ems__Effort_status='"[[ems__EffortStatusDraft]]"',u.exo__Asset_relates=[`"[[${t}]]"`],r&&r.trim()!==""){let f=r.trim();u.exo__Asset_label=f,u.aliases=[f]}return s&&(u.ems__Task_size=s),u}};sa.TaskFrontmatterGenerator=wg;sa.TaskFrontmatterGenerator=wg=OF([(0,PF.injectable)()],wg)});var xf=v(aa=>{"use strict";var LF=aa&&aa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(aa,"__esModule",{value:!0});aa.AlgorithmExtractor=void 0;var MF=Ve(),Eg=class{static{o(this,"AlgorithmExtractor")}extractH2Section(e,t){let r=e.split(`
43
43
  `),i=`## ${t}`,s=!1,a=[];for(let l of r){if(l.trim()===i){s=!0;continue}if(s){if(l.startsWith("## ")||l.startsWith("# "))break;a.push(l)}}return a.length===0?null:a.join(`
44
- `).trim()||null}};aa.AlgorithmExtractor=Eg;aa.AlgorithmExtractor=Eg=LF([(0,MF.injectable)()],Eg)});var MS=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0})});var ct=v(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.DI_TOKENS=void 0;Af.DI_TOKENS={IFileSystemAdapter:Symbol.for("IFileSystemAdapter"),IVaultAdapter:Symbol.for("IVaultAdapter"),IVaultContext:Symbol.for("IVaultContext"),IMultiVaultManager:Symbol.for("IMultiVaultManager"),ILogger:Symbol.for("ILogger"),IEventBus:Symbol.for("IEventBus"),IConfiguration:Symbol.for("IConfiguration"),INotificationService:Symbol.for("INotificationService"),TaskCreationService:Symbol.for("TaskCreationService"),ProjectCreationService:Symbol.for("ProjectCreationService"),AreaCreationService:Symbol.for("AreaCreationService"),ClassCreationService:Symbol.for("ClassCreationService"),ConceptCreationService:Symbol.for("ConceptCreationService"),FleetingNoteCreationService:Symbol.for("FleetingNoteCreationService"),SupervisionCreationService:Symbol.for("SupervisionCreationService"),GenericAssetCreationService:Symbol.for("GenericAssetCreationService"),TaskFrontmatterGenerator:Symbol.for("TaskFrontmatterGenerator"),DynamicFrontmatterGenerator:Symbol.for("DynamicFrontmatterGenerator"),AlgorithmExtractor:Symbol.for("AlgorithmExtractor"),TaskStatusService:Symbol.for("TaskStatusService"),EffortStatusWorkflow:Symbol.for("EffortStatusWorkflow"),StatusTimestampService:Symbol.for("StatusTimestampService"),PropertyCleanupService:Symbol.for("PropertyCleanupService"),FolderRepairService:Symbol.for("FolderRepairService"),LabelToAliasService:Symbol.for("LabelToAliasService"),RenameToUidService:Symbol.for("RenameToUidService"),PlanningService:Symbol.for("PlanningService"),EffortVotingService:Symbol.for("EffortVotingService"),SessionEventService:Symbol.for("SessionEventService"),CriticalityZoneService:Symbol.for("CriticalityZoneService"),AssetConversionService:Symbol.for("AssetConversionService"),NoteToRDFConverter:Symbol.for("NoteToRDFConverter"),AreaHierarchyBuilder:Symbol.for("AreaHierarchyBuilder"),URIConstructionService:Symbol.for("URIConstructionService"),EmbeddingService:Symbol.for("EmbeddingService"),VectorStore:Symbol.for("VectorStore"),SemanticSearchService:Symbol.for("SemanticSearchService")}});var xg=v(ir=>{"use strict";var kF=ir&&ir.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),jF=ir&&ir.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),$F=ir&&ir.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},VF=ir&&ir.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&kF(t,e,r[i]);return jF(t,e),t}})(),UF=ir&&ir.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},BF=ir&&ir.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ir,"__esModule",{value:!0});ir.TaskCreationService=void 0;var kS=Ve(),jS=Cr(),qF=Js(),$S=gn(),GF=dr(),WF=Tf(),HF=xf(),kG=VF(MS()),zF=ct(),Tg=class{static{o(this,"TaskCreationService")}constructor(e,t,r){this.vault=e,this.frontmatterGenerator=t,this.algorithmExtractor=r}async createTask(e,t,r,i,s,a){let c=(0,jS.v4)(),l=`${c}.md`,u=this.frontmatterGenerator.generateTaskFrontmatter(t,e.basename,r,i,c,s,a),f="";if(qF.WikiLinkHelpers.normalize(r)===GF.AssetClass.TASK_PROTOTYPE){let E=await this.vault.read(e),A=this.algorithmExtractor.extractH2Section(E,"Algorithm");A&&(f=`## Algorithm
44
+ `).trim()||null}};aa.AlgorithmExtractor=Eg;aa.AlgorithmExtractor=Eg=LF([(0,MF.injectable)()],Eg)});var MS=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0})});var ct=v(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.DI_TOKENS=void 0;Af.DI_TOKENS={IFileSystemAdapter:Symbol.for("IFileSystemAdapter"),IVaultAdapter:Symbol.for("IVaultAdapter"),IVaultContext:Symbol.for("IVaultContext"),IMultiVaultManager:Symbol.for("IMultiVaultManager"),ILogger:Symbol.for("ILogger"),IEventBus:Symbol.for("IEventBus"),IConfiguration:Symbol.for("IConfiguration"),INotificationService:Symbol.for("INotificationService"),TaskCreationService:Symbol.for("TaskCreationService"),ProjectCreationService:Symbol.for("ProjectCreationService"),AreaCreationService:Symbol.for("AreaCreationService"),ClassCreationService:Symbol.for("ClassCreationService"),ConceptCreationService:Symbol.for("ConceptCreationService"),FleetingNoteCreationService:Symbol.for("FleetingNoteCreationService"),SupervisionCreationService:Symbol.for("SupervisionCreationService"),GenericAssetCreationService:Symbol.for("GenericAssetCreationService"),TaskFrontmatterGenerator:Symbol.for("TaskFrontmatterGenerator"),DynamicFrontmatterGenerator:Symbol.for("DynamicFrontmatterGenerator"),AlgorithmExtractor:Symbol.for("AlgorithmExtractor"),TaskStatusService:Symbol.for("TaskStatusService"),EffortStatusWorkflow:Symbol.for("EffortStatusWorkflow"),StatusTimestampService:Symbol.for("StatusTimestampService"),PropertyCleanupService:Symbol.for("PropertyCleanupService"),FolderRepairService:Symbol.for("FolderRepairService"),LabelToAliasService:Symbol.for("LabelToAliasService"),RenameToUidService:Symbol.for("RenameToUidService"),PlanningService:Symbol.for("PlanningService"),EffortVotingService:Symbol.for("EffortVotingService"),SessionEventService:Symbol.for("SessionEventService"),CriticalityZoneService:Symbol.for("CriticalityZoneService"),AssetConversionService:Symbol.for("AssetConversionService"),NoteToRDFConverter:Symbol.for("NoteToRDFConverter"),AreaHierarchyBuilder:Symbol.for("AreaHierarchyBuilder"),URIConstructionService:Symbol.for("URIConstructionService"),EmbeddingService:Symbol.for("EmbeddingService"),VectorStore:Symbol.for("VectorStore"),SemanticSearchService:Symbol.for("SemanticSearchService")}});var xg=v(ir=>{"use strict";var kF=ir&&ir.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),jF=ir&&ir.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),$F=ir&&ir.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},VF=ir&&ir.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&kF(t,e,r[i]);return jF(t,e),t}})(),UF=ir&&ir.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},BF=ir&&ir.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ir,"__esModule",{value:!0});ir.TaskCreationService=void 0;var kS=Ve(),jS=Ir(),qF=Js(),$S=gn(),GF=dr(),WF=Tf(),HF=xf(),kG=VF(MS()),zF=ct(),Tg=class{static{o(this,"TaskCreationService")}constructor(e,t,r){this.vault=e,this.frontmatterGenerator=t,this.algorithmExtractor=r}async createTask(e,t,r,i,s,a){let c=(0,jS.v4)(),l=`${c}.md`,u=this.frontmatterGenerator.generateTaskFrontmatter(t,e.basename,r,i,c,s,a),f="";if(qF.WikiLinkHelpers.normalize(r)===GF.AssetClass.TASK_PROTOTYPE){let E=await this.vault.read(e),A=this.algorithmExtractor.extractH2Section(E,"Algorithm");A&&(f=`## Algorithm
45
45
 
46
46
  ${A}`)}let d=$S.MetadataHelpers.buildFileContent(u,f),p=e.parent?.path||"",_=p?`${p}/${l}`:l;return await this.vault.create(_,d)}async createRelatedTask(e,t,r,i){let s=(0,jS.v4)(),a=`${s}.md`,c=this.frontmatterGenerator.generateRelatedTaskFrontmatter(t,e.basename,r,s,i),l=$S.MetadataHelpers.buildFileContent(c),u=e.parent?.path||"",f=u?`${u}/${a}`:a,h=await this.vault.create(f,l);return await this.addRelationToSourceFile(e,s),h}generateTaskFrontmatter(e,t,r,i,s,a,c){return this.frontmatterGenerator.generateTaskFrontmatter(e,t,r,i,s,a,c)}generateRelatedTaskFrontmatter(e,t,r,i,s){return this.frontmatterGenerator.generateRelatedTaskFrontmatter(e,t,r,i,s)}extractH2Section(e,t){return this.algorithmExtractor.extractH2Section(e,t)}async addRelationToSourceFile(e,t){let r=await this.vault.read(e),i=this.addRelationToFrontmatter(r,t);await this.vault.modify(e,i)}addRelationToFrontmatter(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---/,i=e.match(r),s=e.includes(`\r
47
47
  `)?`\r
48
48
  `:`
49
- `;if(!i)return`---${s}exo__Asset_relates:${s} - "[[${t}]]"${s}---${s}${e}`;let c=i[1];if(c.includes("exo__Asset_relates:")){let l=c.match(/exo__Asset_relates:\r?\n((?: {2}- .*\r?\n)*)/);if(l){let u=l[1],f=` - "[[${t}]]"${s}`;c=c.replace(/exo__Asset_relates:\r?\n((?: {2}- .*\r?\n)*)/,`exo__Asset_relates:${s}${u}${f}`)}}else c+=`${s}exo__Asset_relates:${s} - "[[${t}]]"`;return e.replace(r,`---${s}${c}${s}---`)}};ir.TaskCreationService=Tg;ir.TaskCreationService=Tg=$F([(0,kS.injectable)(),BF(0,(0,kS.inject)(zF.DI_TOKENS.IVaultAdapter)),UF("design:paramtypes",[Object,WF.TaskFrontmatterGenerator,HF.AlgorithmExtractor])],Tg)});var Cg=v(Dn=>{"use strict";var QF=Dn&&Dn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},YF=Dn&&Dn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},KF=Dn&&Dn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ProjectCreationService=void 0;var VS=Ve(),US=Cr(),XF=Js(),Cf=dr(),JF=nr(),ZF=Yc(),BS=gn(),eD=ct(),tD={[Cf.AssetClass.AREA]:"ems__Effort_area",[Cf.AssetClass.INITIATIVE]:"ems__Effort_parent",[Cf.AssetClass.PROJECT]:"ems__Effort_parent"},Ag=class{static{o(this,"ProjectCreationService")}constructor(e){this.vault=e}async createProject(e,t,r,i){let s=(0,US.v4)(),a=`${s}.md`,c=this.generateProjectFrontmatter(t,e.basename,r,i,s),l=BS.MetadataHelpers.buildFileContent(c),u=e.parent?.path||"",f=u?`${u}/${a}`:a;return await this.vault.create(f,l)}generateProjectFrontmatter(e,t,r,i,s){let a=new Date,c=JF.DateFormatter.toLocalTimestamp(a),l=ZF.MetadataExtractor.extractIsDefinedBy(e),u=XF.WikiLinkHelpers.normalize(r),f=tD[u]||"ems__Effort_area",h={};if(h.exo__Asset_isDefinedBy=BS.MetadataHelpers.ensureQuoted(l),h.exo__Asset_uid=s||(0,US.v4)(),h.exo__Asset_createdAt=c,h.exo__Instance_class=[`"[[${Cf.AssetClass.PROJECT}]]"`],h.ems__Effort_status='"[[ems__EffortStatusDraft]]"',h[f]=`"[[${t}]]"`,i&&i.trim()!==""){let d=i.trim();h.exo__Asset_label=d,h.aliases=[d]}return h}};Dn.ProjectCreationService=Ag;Dn.ProjectCreationService=Ag=QF([(0,VS.injectable)(),KF(0,(0,VS.inject)(eD.DI_TOKENS.IVaultAdapter)),YF("design:paramtypes",[Object])],Ag)});var Ki=v(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.FrontmatterService=void 0;var If=class n{static{o(this,"FrontmatterService")}parse(e){let t=e.match(n.FRONTMATTER_REGEX);return t?{exists:!0,content:t[1],originalContent:e}:{exists:!1,content:"",originalContent:e}}updateProperty(e,t,r){let i=this.parse(e);if(!i.exists)return this.createFrontmatter(e,{[t]:r});let s=i.content;if(this.hasProperty(s,t)){let a=new RegExp(`${this.escapeRegex(t)}:.*$`,"m");s=s.replace(a,`${t}: ${r}`)}else{let a=s.length>0?`
49
+ `;if(!i)return`---${s}exo__Asset_relates:${s} - "[[${t}]]"${s}---${s}${e}`;let c=i[1];if(c.includes("exo__Asset_relates:")){let l=c.match(/exo__Asset_relates:\r?\n((?: {2}- .*\r?\n)*)/);if(l){let u=l[1],f=` - "[[${t}]]"${s}`;c=c.replace(/exo__Asset_relates:\r?\n((?: {2}- .*\r?\n)*)/,`exo__Asset_relates:${s}${u}${f}`)}}else c+=`${s}exo__Asset_relates:${s} - "[[${t}]]"`;return e.replace(r,`---${s}${c}${s}---`)}};ir.TaskCreationService=Tg;ir.TaskCreationService=Tg=$F([(0,kS.injectable)(),BF(0,(0,kS.inject)(zF.DI_TOKENS.IVaultAdapter)),UF("design:paramtypes",[Object,WF.TaskFrontmatterGenerator,HF.AlgorithmExtractor])],Tg)});var Cg=v(Nn=>{"use strict";var QF=Nn&&Nn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},YF=Nn&&Nn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},KF=Nn&&Nn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ProjectCreationService=void 0;var VS=Ve(),US=Ir(),XF=Js(),Cf=dr(),JF=nr(),ZF=Yc(),BS=gn(),eD=ct(),tD={[Cf.AssetClass.AREA]:"ems__Effort_area",[Cf.AssetClass.INITIATIVE]:"ems__Effort_parent",[Cf.AssetClass.PROJECT]:"ems__Effort_parent"},Ag=class{static{o(this,"ProjectCreationService")}constructor(e){this.vault=e}async createProject(e,t,r,i){let s=(0,US.v4)(),a=`${s}.md`,c=this.generateProjectFrontmatter(t,e.basename,r,i,s),l=BS.MetadataHelpers.buildFileContent(c),u=e.parent?.path||"",f=u?`${u}/${a}`:a;return await this.vault.create(f,l)}generateProjectFrontmatter(e,t,r,i,s){let a=new Date,c=JF.DateFormatter.toLocalTimestamp(a),l=ZF.MetadataExtractor.extractIsDefinedBy(e),u=XF.WikiLinkHelpers.normalize(r),f=tD[u]||"ems__Effort_area",h={};if(h.exo__Asset_isDefinedBy=BS.MetadataHelpers.ensureQuoted(l),h.exo__Asset_uid=s||(0,US.v4)(),h.exo__Asset_createdAt=c,h.exo__Instance_class=[`"[[${Cf.AssetClass.PROJECT}]]"`],h.ems__Effort_status='"[[ems__EffortStatusDraft]]"',h[f]=`"[[${t}]]"`,i&&i.trim()!==""){let d=i.trim();h.exo__Asset_label=d,h.aliases=[d]}return h}};Nn.ProjectCreationService=Ag;Nn.ProjectCreationService=Ag=QF([(0,VS.injectable)(),KF(0,(0,VS.inject)(eD.DI_TOKENS.IVaultAdapter)),YF("design:paramtypes",[Object])],Ag)});var Ki=v(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.FrontmatterService=void 0;var If=class n{static{o(this,"FrontmatterService")}parse(e){let t=e.match(n.FRONTMATTER_REGEX);return t?{exists:!0,content:t[1],originalContent:e}:{exists:!1,content:"",originalContent:e}}updateProperty(e,t,r){let i=this.parse(e);if(!i.exists)return this.createFrontmatter(e,{[t]:r});let s=i.content;if(this.hasProperty(s,t)){let a=new RegExp(`${this.escapeRegex(t)}:.*$`,"m");s=s.replace(a,`${t}: ${r}`)}else{let a=s.length>0?`
50
50
  `:"";s+=`${a}${t}: ${r}`}return e.replace(n.FRONTMATTER_REGEX,`---
51
51
  ${s}
52
52
  ---`)}addProperty(e,t,r){return this.updateProperty(e,t,r)}removeProperty(e,t){let r=this.parse(e);if(!r.exists||!this.hasProperty(r.content,t))return e;let i=new RegExp(`
@@ -58,25 +58,25 @@ ${Object.entries(t).map(([a,c])=>`${a}: ${c}`).join(`
58
58
  `)}
59
59
  ---`,s=e.startsWith(`
60
60
  `)?"":`
61
- `;return`${i}${s}${e}`}getPropertyValue(e,t){let r=new RegExp(`${this.escapeRegex(t)}:\\s*(.*)$`,"m"),i=e.match(r);return i?i[1].trim():null}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Of.FrontmatterService=If;If.FRONTMATTER_REGEX=/^---\n([\s\S]*?)\n---/});var Pf=v(oa=>{"use strict";var rD=oa&&oa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(oa,"__esModule",{value:!0});oa.EffortStatusWorkflow=void 0;var nD=Ve(),Zr=dr(),Ig=class{static{o(this,"EffortStatusWorkflow")}getPreviousStatus(e,t){let r=this.normalizeStatus(e);if(r===Zr.EffortStatus.DRAFT)return null;if(r===Zr.EffortStatus.BACKLOG)return this.wrapStatus(Zr.EffortStatus.DRAFT);if(r===Zr.EffortStatus.ANALYSIS)return this.wrapStatus(Zr.EffortStatus.BACKLOG);if(r===Zr.EffortStatus.TODO)return this.wrapStatus(Zr.EffortStatus.ANALYSIS);if(r===Zr.EffortStatus.DOING)return this.hasInstanceClass(t,Zr.AssetClass.PROJECT)?this.wrapStatus(Zr.EffortStatus.TODO):this.wrapStatus(Zr.EffortStatus.BACKLOG);if(r===Zr.EffortStatus.DONE)return this.wrapStatus(Zr.EffortStatus.DOING)}normalizeStatus(e){return e.replace(/["'[\]]/g,"").trim()}wrapStatus(e){return`"[[${e}]]"`}hasInstanceClass(e,t){return e?(Array.isArray(e)?e:[e]).some(i=>i.replace(/["'[\]]/g,"").trim()===t):!1}};oa.EffortStatusWorkflow=Ig;oa.EffortStatusWorkflow=Ig=rD([(0,nD.injectable)()],Ig)});var Rf=v(Nn=>{"use strict";var iD=Nn&&Nn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},sD=Nn&&Nn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},aD=Nn&&Nn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.StatusTimestampService=void 0;var qS=Ve(),oD=Ki(),to=nr(),cD=ct(),Og=class{static{o(this,"StatusTimestampService")}constructor(e){this.vault=e,this.frontmatterService=new oD.FrontmatterService}async addStartTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_startTimestamp",r);await this.vault.modify(e,i)}async addEndTimestamp(e,t){let r=await this.vault.read(e),i=t||new Date,s=to.DateFormatter.toLocalTimestamp(i),a=this.frontmatterService.updateProperty(r,"ems__Effort_endTimestamp",s);await this.vault.modify(e,a)}async addResolutionTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_resolutionTimestamp",r);await this.vault.modify(e,i)}async addReviewTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_lastReviewTimestamp",r);await this.vault.modify(e,i)}async addEndAndResolutionTimestamps(e,t){let r=await this.vault.read(e),i=t||new Date,s=to.DateFormatter.toLocalTimestamp(i),a=this.frontmatterService.updateProperty(r,"ems__Effort_endTimestamp",s);a=this.frontmatterService.updateProperty(a,"ems__Effort_resolutionTimestamp",s),await this.vault.modify(e,a)}async removeStartTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_startTimestamp");await this.vault.modify(e,r)}async removeEndTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_endTimestamp");await this.vault.modify(e,r)}async removeResolutionTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_resolutionTimestamp");await this.vault.modify(e,r)}async removeEndAndResolutionTimestamps(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_endTimestamp");r=this.frontmatterService.removeProperty(r,"ems__Effort_resolutionTimestamp"),await this.vault.modify(e,r)}async shiftPlannedEndTimestamp(e,t){let r=await this.vault.read(e),i=this.frontmatterService.parse(r);if(!i.exists)return;let s=this.frontmatterService.getPropertyValue(i.content,"ems__Effort_plannedEndTimestamp");if(!s)return;let a=new Date(s.replace(/["']/g,""));if(isNaN(a.getTime()))return;let c=new Date(a.getTime()+t),l=to.DateFormatter.toLocalTimestamp(c),u=this.frontmatterService.updateProperty(r,"ems__Effort_plannedEndTimestamp",l);await this.vault.modify(e,u)}};Nn.StatusTimestampService=Og;Nn.StatusTimestampService=Og=iD([(0,qS.injectable)(),aD(0,(0,qS.inject)(cD.DI_TOKENS.IVaultAdapter)),sD("design:paramtypes",[Object])],Og)});var Rg=v(Ln=>{"use strict";var lD=Ln&&Ln.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uD=Ln&&Ln.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},fD=Ln&&Ln.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.TaskStatusService=void 0;var GS=Ve(),hD=Ki(),ca=nr(),dD=Pf(),pD=Rf(),mD=ct(),Pg=class{static{o(this,"TaskStatusService")}constructor(e,t,r){this.vault=e,this.workflow=t,this.timestampService=r,this.frontmatterService=new hD.FrontmatterService}async setDraftStatus(e){await this.updateStatus(e,"ems__EffortStatusDraft")}async moveToBacklog(e){await this.updateStatus(e,"ems__EffortStatusBacklog")}async moveToAnalysis(e){await this.updateStatus(e,"ems__EffortStatusAnalysis")}async moveToToDo(e){await this.updateStatus(e,"ems__EffortStatusToDo")}async startEffort(e){let t=await this.vault.read(e),r=ca.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');i=this.frontmatterService.updateProperty(i,"ems__Effort_startTimestamp",r),await this.vault.modify(e,i)}async markTaskAsDone(e){let t=await this.vault.read(e),r=ca.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');i=this.frontmatterService.updateProperty(i,"ems__Effort_endTimestamp",r),i=this.frontmatterService.updateProperty(i,"ems__Effort_resolutionTimestamp",r),await this.vault.modify(e,i)}async syncEffortEndTimestamp(e,t){await this.timestampService.addEndAndResolutionTimestamps(e,t)}async shiftPlannedEndTimestamp(e,t){await this.timestampService.shiftPlannedEndTimestamp(e,t)}async trashEffort(e,t){let r=await this.vault.read(e),i=ca.DateFormatter.toLocalTimestamp(new Date),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),t&&(s=this.appendTrashReason(s,t)),await this.vault.modify(e,s)}appendTrashReason(e,t){let r=`
61
+ `;return`${i}${s}${e}`}getPropertyValue(e,t){let r=new RegExp(`${this.escapeRegex(t)}:\\s*(.*)$`,"m"),i=e.match(r);return i?i[1].trim():null}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Of.FrontmatterService=If;If.FRONTMATTER_REGEX=/^---\n([\s\S]*?)\n---/});var Pf=v(oa=>{"use strict";var rD=oa&&oa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(oa,"__esModule",{value:!0});oa.EffortStatusWorkflow=void 0;var nD=Ve(),Zr=dr(),Ig=class{static{o(this,"EffortStatusWorkflow")}getPreviousStatus(e,t){let r=this.normalizeStatus(e);if(r===Zr.EffortStatus.DRAFT)return null;if(r===Zr.EffortStatus.BACKLOG)return this.wrapStatus(Zr.EffortStatus.DRAFT);if(r===Zr.EffortStatus.ANALYSIS)return this.wrapStatus(Zr.EffortStatus.BACKLOG);if(r===Zr.EffortStatus.TODO)return this.wrapStatus(Zr.EffortStatus.ANALYSIS);if(r===Zr.EffortStatus.DOING)return this.hasInstanceClass(t,Zr.AssetClass.PROJECT)?this.wrapStatus(Zr.EffortStatus.TODO):this.wrapStatus(Zr.EffortStatus.BACKLOG);if(r===Zr.EffortStatus.DONE)return this.wrapStatus(Zr.EffortStatus.DOING)}normalizeStatus(e){return e.replace(/["'[\]]/g,"").trim()}wrapStatus(e){return`"[[${e}]]"`}hasInstanceClass(e,t){return e?(Array.isArray(e)?e:[e]).some(i=>i.replace(/["'[\]]/g,"").trim()===t):!1}};oa.EffortStatusWorkflow=Ig;oa.EffortStatusWorkflow=Ig=rD([(0,nD.injectable)()],Ig)});var Rf=v(Ln=>{"use strict";var iD=Ln&&Ln.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},sD=Ln&&Ln.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},aD=Ln&&Ln.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.StatusTimestampService=void 0;var qS=Ve(),oD=Ki(),to=nr(),cD=ct(),Og=class{static{o(this,"StatusTimestampService")}constructor(e){this.vault=e,this.frontmatterService=new oD.FrontmatterService}async addStartTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_startTimestamp",r);await this.vault.modify(e,i)}async addEndTimestamp(e,t){let r=await this.vault.read(e),i=t||new Date,s=to.DateFormatter.toLocalTimestamp(i),a=this.frontmatterService.updateProperty(r,"ems__Effort_endTimestamp",s);await this.vault.modify(e,a)}async addResolutionTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_resolutionTimestamp",r);await this.vault.modify(e,i)}async addReviewTimestamp(e){let t=await this.vault.read(e),r=to.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_lastReviewTimestamp",r);await this.vault.modify(e,i)}async addEndAndResolutionTimestamps(e,t){let r=await this.vault.read(e),i=t||new Date,s=to.DateFormatter.toLocalTimestamp(i),a=this.frontmatterService.updateProperty(r,"ems__Effort_endTimestamp",s);a=this.frontmatterService.updateProperty(a,"ems__Effort_resolutionTimestamp",s),await this.vault.modify(e,a)}async removeStartTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_startTimestamp");await this.vault.modify(e,r)}async removeEndTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_endTimestamp");await this.vault.modify(e,r)}async removeResolutionTimestamp(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_resolutionTimestamp");await this.vault.modify(e,r)}async removeEndAndResolutionTimestamps(e){let t=await this.vault.read(e),r=this.frontmatterService.removeProperty(t,"ems__Effort_endTimestamp");r=this.frontmatterService.removeProperty(r,"ems__Effort_resolutionTimestamp"),await this.vault.modify(e,r)}async shiftPlannedEndTimestamp(e,t){let r=await this.vault.read(e),i=this.frontmatterService.parse(r);if(!i.exists)return;let s=this.frontmatterService.getPropertyValue(i.content,"ems__Effort_plannedEndTimestamp");if(!s)return;let a=new Date(s.replace(/["']/g,""));if(isNaN(a.getTime()))return;let c=new Date(a.getTime()+t),l=to.DateFormatter.toLocalTimestamp(c),u=this.frontmatterService.updateProperty(r,"ems__Effort_plannedEndTimestamp",l);await this.vault.modify(e,u)}};Ln.StatusTimestampService=Og;Ln.StatusTimestampService=Og=iD([(0,qS.injectable)(),aD(0,(0,qS.inject)(cD.DI_TOKENS.IVaultAdapter)),sD("design:paramtypes",[Object])],Og)});var Rg=v(Mn=>{"use strict";var lD=Mn&&Mn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uD=Mn&&Mn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},fD=Mn&&Mn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.TaskStatusService=void 0;var GS=Ve(),hD=Ki(),ca=nr(),dD=Pf(),pD=Rf(),mD=ct(),Pg=class{static{o(this,"TaskStatusService")}constructor(e,t,r){this.vault=e,this.workflow=t,this.timestampService=r,this.frontmatterService=new hD.FrontmatterService}async setDraftStatus(e){await this.updateStatus(e,"ems__EffortStatusDraft")}async moveToBacklog(e){await this.updateStatus(e,"ems__EffortStatusBacklog")}async moveToAnalysis(e){await this.updateStatus(e,"ems__EffortStatusAnalysis")}async moveToToDo(e){await this.updateStatus(e,"ems__EffortStatusToDo")}async startEffort(e){let t=await this.vault.read(e),r=ca.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');i=this.frontmatterService.updateProperty(i,"ems__Effort_startTimestamp",r),await this.vault.modify(e,i)}async markTaskAsDone(e){let t=await this.vault.read(e),r=ca.DateFormatter.toLocalTimestamp(new Date),i=this.frontmatterService.updateProperty(t,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');i=this.frontmatterService.updateProperty(i,"ems__Effort_endTimestamp",r),i=this.frontmatterService.updateProperty(i,"ems__Effort_resolutionTimestamp",r),await this.vault.modify(e,i)}async syncEffortEndTimestamp(e,t){await this.timestampService.addEndAndResolutionTimestamps(e,t)}async shiftPlannedEndTimestamp(e,t){await this.timestampService.shiftPlannedEndTimestamp(e,t)}async trashEffort(e,t){let r=await this.vault.read(e),i=ca.DateFormatter.toLocalTimestamp(new Date),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),t&&(s=this.appendTrashReason(s,t)),await this.vault.modify(e,s)}appendTrashReason(e,t){let r=`
62
62
 
63
63
  ## Trash Reason
64
64
 
65
65
  ${t}`;return e.trimEnd()+r}async archiveTask(e){let t=await this.vault.read(e),r=this.frontmatterService.updateProperty(t,"archived","true");r=this.frontmatterService.removeProperty(r,"aliases"),await this.vault.modify(e,r)}async planOnToday(e){let t=await this.vault.read(e),r=ca.DateFormatter.getTodayStartTimestamp(),i=this.frontmatterService.updateProperty(t,"ems__Effort_plannedStartTimestamp",r);await this.vault.modify(e,i)}async planForEvening(e){let t=await this.vault.read(e),r=new Date;r.setHours(19,0,0,0);let i=ca.DateFormatter.toLocalTimestamp(r),s=this.frontmatterService.updateProperty(t,"ems__Effort_plannedStartTimestamp",i);await this.vault.modify(e,s)}async shiftDayBackward(e){await this.shiftDay(e,-1)}async shiftDayForward(e){await this.shiftDay(e,1)}async markAsReviewed(e){await this.timestampService.addReviewTimestamp(e)}async rollbackStatus(e){let t=await this.vault.read(e),r=this.extractCurrentStatus(t),i=this.extractInstanceClass(t);if(!r)throw new Error("No current status to rollback from");let s=this.workflow.getPreviousStatus(r,i);if(s===void 0)throw new Error("Cannot rollback from current status");let a=t;s===null?a=this.frontmatterService.removeProperty(a,"ems__Effort_status"):a=this.frontmatterService.updateProperty(a,"ems__Effort_status",s);let c=this.workflow.normalizeStatus(r);c==="ems__EffortStatusDone"?(a=this.frontmatterService.removeProperty(a,"ems__Effort_endTimestamp"),a=this.frontmatterService.removeProperty(a,"ems__Effort_resolutionTimestamp")):c==="ems__EffortStatusDoing"&&(a=this.frontmatterService.removeProperty(a,"ems__Effort_startTimestamp")),await this.vault.modify(e,a)}async updateStatus(e,t){let r=await this.vault.read(e),i=this.frontmatterService.updateProperty(r,"ems__Effort_status",`"[[${t}]]"`);await this.vault.modify(e,i)}async shiftDay(e,t){let r=await this.vault.read(e),i=this.extractPlannedStartTimestamp(r);if(!i)throw new Error("ems__Effort_plannedStartTimestamp property not found");let s=this.parseDateFromTimestamp(i);if(!s)throw new Error("Invalid date format in ems__Effort_plannedStartTimestamp");let a=ca.DateFormatter.addDays(s,t);a.setHours(0,0,0,0);let c=ca.DateFormatter.toLocalTimestamp(a),l=this.frontmatterService.updateProperty(r,"ems__Effort_plannedStartTimestamp",c);await this.vault.modify(e,l)}parseDateFromTimestamp(e){let t=new Date(e);return isNaN(t.getTime())?null:t}extractPlannedStartTimestamp(e){let t=this.frontmatterService.parse(e);return t.exists?this.frontmatterService.getPropertyValue(t.content,"ems__Effort_plannedStartTimestamp"):null}extractCurrentStatus(e){let t=this.frontmatterService.parse(e);return t.exists?this.frontmatterService.getPropertyValue(t.content,"ems__Effort_status"):null}extractInstanceClass(e){let t=this.frontmatterService.parse(e);if(!t.exists)return null;let r=t.content.match(/exo__Instance_class:\s*\n((?:\s*-\s*.*\n?)+)/);return r?r[1].split(`
66
- `).filter(s=>s.trim()).map(s=>s.replace(/^\s*-\s*/,"").trim()):this.frontmatterService.getPropertyValue(t.content,"exo__Instance_class")}};Ln.TaskStatusService=Pg;Ln.TaskStatusService=Pg=lD([(0,GS.injectable)(),fD(0,(0,GS.inject)(mD.DI_TOKENS.IVaultAdapter)),uD("design:paramtypes",[Object,dD.EffortStatusWorkflow,pD.StatusTimestampService])],Pg)});var Dg=v(Mn=>{"use strict";var gD=Mn&&Mn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},yD=Mn&&Mn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},vD=Mn&&Mn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.AreaCreationService=void 0;var WS=Ve(),HS=Cr(),_D=dr(),SD=nr(),bD=Yc(),zS=gn(),wD=ct(),Fg=class{static{o(this,"AreaCreationService")}constructor(e){this.vault=e}async createChildArea(e,t,r){let i=(0,HS.v4)(),s=`${i}.md`,a=this.generateChildAreaFrontmatter(t,e.basename,r,i),c=zS.MetadataHelpers.buildFileContent(a),l=e.parent?.path||"",u=l?`${l}/${s}`:s;return await this.vault.create(u,c)}generateChildAreaFrontmatter(e,t,r,i){let s=new Date,a=SD.DateFormatter.toLocalTimestamp(s),c=bD.MetadataExtractor.extractIsDefinedBy(e),l={};if(l.exo__Asset_isDefinedBy=zS.MetadataHelpers.ensureQuoted(c),l.exo__Asset_uid=i||(0,HS.v4)(),l.exo__Asset_createdAt=a,l.exo__Instance_class=[`"[[${_D.AssetClass.AREA}]]"`],l.ems__Area_parent=`"[[${t}]]"`,r&&r.trim()!==""){let u=r.trim();l.exo__Asset_label=u,l.aliases=[u]}return l}};Mn.AreaCreationService=Fg;Mn.AreaCreationService=Fg=gD([(0,WS.injectable)(),vD(0,(0,WS.inject)(wD.DI_TOKENS.IVaultAdapter)),yD("design:paramtypes",[Object])],Fg)});var Lg=v(kn=>{"use strict";var ED=kn&&kn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TD=kn&&kn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},xD=kn&&kn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(kn,"__esModule",{value:!0});kn.AreaHierarchyBuilder=void 0;var QS=Ve(),YS=dr(),AD=ct(),Ng=class{static{o(this,"AreaHierarchyBuilder")}constructor(e){this.vault=e}buildHierarchy(e,t){let r=this.vault.getAbstractFileByPath(e);if(!this.isFile(r))return null;let i=this.vault.getFrontmatter(r)||{};if(this.extractInstanceClass(i)!==YS.AssetClass.AREA)return null;let a=this.collectAllAreasFromVault(),c=new Set;return this.buildTree(e,a,c,0)}isFile(e){return e&&typeof e=="object"&&"basename"in e&&"path"in e}extractInstanceClass(e){let t=e.exo__Instance_class||"";return Array.isArray(t)?this.cleanWikiLink(t[0]||""):this.cleanWikiLink(t)}cleanWikiLink(e){return typeof e!="string"?"":e.replace(/^\[\[|\]\]$/g,"").trim()}collectAllAreasFromVault(){let e=new Map,t=new Map,r=this.vault.getAllFiles();for(let i of r){let s=this.vault.getFrontmatter(i)||{};if(this.extractInstanceClass(s)===YS.AssetClass.AREA){let c=this.extractParentPath(s);e.set(i.path,{path:i.path,title:i.basename,label:s.exo__Asset_label||void 0,isArchived:this.isArchived(s),depth:0,parentPath:c||void 0}),t.set(i.basename,i.path)}}for(let[,i]of e.entries())i.parentPath&&t.has(i.parentPath)&&(i.parentPath=t.get(i.parentPath));return e}extractParentPath(e){let t=e.ems__Area_parent;if(!t)return null;if(Array.isArray(t)){let r=t[0]||"";return this.cleanWikiLink(r)}return this.cleanWikiLink(t)}isArchived(e){let t=e.exo__Asset_archived;if(t===!0||t==="true")return!0;if(Array.isArray(t)&&t.length>0){let r=t[0];return r===!0||r==="true"}return!1}buildTree(e,t,r,i){if(r.has(e))return null;r.add(e);let s=t.get(e);if(!s)return null;let a=[];for(let[c,l]of t.entries())if(l.parentPath===e){let u=this.buildTree(c,t,r,i+1);u&&a.push(u)}return a.sort((c,l)=>{let u=c.label||c.title,f=l.label||l.title;return u.localeCompare(f)}),{path:s.path,title:s.title,label:s.label,isArchived:s.isArchived,depth:i,parentPath:s.parentPath,children:a}}};kn.AreaHierarchyBuilder=Ng;kn.AreaHierarchyBuilder=Ng=ED([(0,QS.injectable)(),xD(0,(0,QS.inject)(AD.DI_TOKENS.IVaultAdapter)),TD("design:paramtypes",[Object])],Ng)});var kg=v(jn=>{"use strict";var CD=jn&&jn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},ID=jn&&jn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},OD=jn&&jn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(jn,"__esModule",{value:!0});jn.ClassCreationService=void 0;var KS=Ve(),PD=Cr(),RD=nr(),FD=gn(),DD=ct(),Mg=class{static{o(this,"ClassCreationService")}constructor(e){this.vault=e}async createSubclass(e,t,r){let i=(0,PD.v4)(),s=this.generateFileName(t),a=s.endsWith(".md")?s:`${s}.md`,c=this.generateClassFrontmatter(e.basename,t,i,r),l=FD.MetadataHelpers.buildFileContent(c),u="classes",f=`${u}/${a}`;return this.vault.getAbstractFileByPath(u)||await this.vault.createFolder(u),await this.vault.create(f,l)}generateFileName(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-");for(;t.startsWith("-");)t=t.slice(1);for(;t.endsWith("-");)t=t.slice(0,-1);return t}generateClassFrontmatter(e,t,r,i){let s=new Date,a=RD.DateFormatter.toLocalTimestamp(s),c={};c.exo__Asset_uid=r,c.exo__Asset_label=t,c.exo__Asset_createdAt=a,c.exo__Instance_class=['"[[exo__Class]]"'],c.exo__Class_superClass=`"[[${e}]]"`;let l=i.exo__Asset_isDefinedBy||'"[[Ontology/EXO]]"';return c.exo__Asset_isDefinedBy=l,c.aliases=[t],c}};jn.ClassCreationService=Mg;jn.ClassCreationService=Mg=CD([(0,KS.injectable)(),OD(0,(0,KS.inject)(DD.DI_TOKENS.IVaultAdapter)),ID("design:paramtypes",[Object])],Mg)});var $g=v($n=>{"use strict";var ND=$n&&$n.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},LD=$n&&$n.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},MD=$n&&$n.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty($n,"__esModule",{value:!0});$n.ConceptCreationService=void 0;var XS=Ve(),kD=Cr(),jD=nr(),$D=gn(),VD=dr(),UD=ct(),jg=class{static{o(this,"ConceptCreationService")}constructor(e){this.vault=e}async createNarrowerConcept(e,t,r,i){let s=(0,kD.v4)(),a=t.endsWith(".md")?t:`${t}.md`,c=this.generateConceptFrontmatter(e.basename,r,i,s),l=$D.MetadataHelpers.buildFileContent(c),u="concepts",f=`${u}/${a}`;return this.vault.getAbstractFileByPath(u)||await this.vault.createFolder(u),await this.vault.create(f,l)}generateConceptFrontmatter(e,t,r,i){let s=new Date,a=jD.DateFormatter.toLocalTimestamp(s),c={};return c.exo__Asset_isDefinedBy='"[[!concepts]]"',c.exo__Asset_uid=i,c.exo__Asset_createdAt=a,c.exo__Instance_class=[`"[[${VD.AssetClass.CONCEPT}]]"`],c.ims__Concept_broader=`"[[${e}]]"`,c.ims__Concept_definition=t,r.length>0&&(c.aliases=r),c}};$n.ConceptCreationService=jg;$n.ConceptCreationService=jg=ND([(0,XS.injectable)(),MD(0,(0,XS.inject)(UD.DI_TOKENS.IVaultAdapter)),LD("design:paramtypes",[Object])],jg)});var Ug=v(Vn=>{"use strict";var BD=Vn&&Vn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},qD=Vn&&Vn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},GD=Vn&&Vn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.EffortVotingService=void 0;var JS=Ve(),WD=ct(),Vg=class{static{o(this,"EffortVotingService")}constructor(e){this.vault=e}async incrementEffortVotes(e){let t=await this.vault.read(e),i=this.extractVoteCount(t)+1,s=this.updateFrontmatterWithVotes(t,i);return await this.vault.modify(e,s),i}extractVoteCount(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/,r=e.match(t);if(!r)return 0;let s=r[1].match(/ems__Effort_votes:\s*(\d+)/);return s&&s[1]?parseInt(s[1],10):0}updateFrontmatterWithVotes(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---/,i=e.match(r),s=e.includes(`\r
66
+ `).filter(s=>s.trim()).map(s=>s.replace(/^\s*-\s*/,"").trim()):this.frontmatterService.getPropertyValue(t.content,"exo__Instance_class")}};Mn.TaskStatusService=Pg;Mn.TaskStatusService=Pg=lD([(0,GS.injectable)(),fD(0,(0,GS.inject)(mD.DI_TOKENS.IVaultAdapter)),uD("design:paramtypes",[Object,dD.EffortStatusWorkflow,pD.StatusTimestampService])],Pg)});var Dg=v(kn=>{"use strict";var gD=kn&&kn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},yD=kn&&kn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},vD=kn&&kn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(kn,"__esModule",{value:!0});kn.AreaCreationService=void 0;var WS=Ve(),HS=Ir(),_D=dr(),SD=nr(),bD=Yc(),zS=gn(),wD=ct(),Fg=class{static{o(this,"AreaCreationService")}constructor(e){this.vault=e}async createChildArea(e,t,r){let i=(0,HS.v4)(),s=`${i}.md`,a=this.generateChildAreaFrontmatter(t,e.basename,r,i),c=zS.MetadataHelpers.buildFileContent(a),l=e.parent?.path||"",u=l?`${l}/${s}`:s;return await this.vault.create(u,c)}generateChildAreaFrontmatter(e,t,r,i){let s=new Date,a=SD.DateFormatter.toLocalTimestamp(s),c=bD.MetadataExtractor.extractIsDefinedBy(e),l={};if(l.exo__Asset_isDefinedBy=zS.MetadataHelpers.ensureQuoted(c),l.exo__Asset_uid=i||(0,HS.v4)(),l.exo__Asset_createdAt=a,l.exo__Instance_class=[`"[[${_D.AssetClass.AREA}]]"`],l.ems__Area_parent=`"[[${t}]]"`,r&&r.trim()!==""){let u=r.trim();l.exo__Asset_label=u,l.aliases=[u]}return l}};kn.AreaCreationService=Fg;kn.AreaCreationService=Fg=gD([(0,WS.injectable)(),vD(0,(0,WS.inject)(wD.DI_TOKENS.IVaultAdapter)),yD("design:paramtypes",[Object])],Fg)});var Lg=v(jn=>{"use strict";var ED=jn&&jn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TD=jn&&jn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},xD=jn&&jn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(jn,"__esModule",{value:!0});jn.AreaHierarchyBuilder=void 0;var QS=Ve(),YS=dr(),AD=ct(),Ng=class{static{o(this,"AreaHierarchyBuilder")}constructor(e){this.vault=e}buildHierarchy(e,t){let r=this.vault.getAbstractFileByPath(e);if(!this.isFile(r))return null;let i=this.vault.getFrontmatter(r)||{};if(this.extractInstanceClass(i)!==YS.AssetClass.AREA)return null;let a=this.collectAllAreasFromVault(),c=new Set;return this.buildTree(e,a,c,0)}isFile(e){return e&&typeof e=="object"&&"basename"in e&&"path"in e}extractInstanceClass(e){let t=e.exo__Instance_class||"";return Array.isArray(t)?this.cleanWikiLink(t[0]||""):this.cleanWikiLink(t)}cleanWikiLink(e){return typeof e!="string"?"":e.replace(/^\[\[|\]\]$/g,"").trim()}collectAllAreasFromVault(){let e=new Map,t=new Map,r=this.vault.getAllFiles();for(let i of r){let s=this.vault.getFrontmatter(i)||{};if(this.extractInstanceClass(s)===YS.AssetClass.AREA){let c=this.extractParentPath(s);e.set(i.path,{path:i.path,title:i.basename,label:s.exo__Asset_label||void 0,isArchived:this.isArchived(s),depth:0,parentPath:c||void 0}),t.set(i.basename,i.path)}}for(let[,i]of e.entries())i.parentPath&&t.has(i.parentPath)&&(i.parentPath=t.get(i.parentPath));return e}extractParentPath(e){let t=e.ems__Area_parent;if(!t)return null;if(Array.isArray(t)){let r=t[0]||"";return this.cleanWikiLink(r)}return this.cleanWikiLink(t)}isArchived(e){let t=e.exo__Asset_archived;if(t===!0||t==="true")return!0;if(Array.isArray(t)&&t.length>0){let r=t[0];return r===!0||r==="true"}return!1}buildTree(e,t,r,i){if(r.has(e))return null;r.add(e);let s=t.get(e);if(!s)return null;let a=[];for(let[c,l]of t.entries())if(l.parentPath===e){let u=this.buildTree(c,t,r,i+1);u&&a.push(u)}return a.sort((c,l)=>{let u=c.label||c.title,f=l.label||l.title;return u.localeCompare(f)}),{path:s.path,title:s.title,label:s.label,isArchived:s.isArchived,depth:i,parentPath:s.parentPath,children:a}}};jn.AreaHierarchyBuilder=Ng;jn.AreaHierarchyBuilder=Ng=ED([(0,QS.injectable)(),xD(0,(0,QS.inject)(AD.DI_TOKENS.IVaultAdapter)),TD("design:paramtypes",[Object])],Ng)});var kg=v($n=>{"use strict";var CD=$n&&$n.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},ID=$n&&$n.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},OD=$n&&$n.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty($n,"__esModule",{value:!0});$n.ClassCreationService=void 0;var KS=Ve(),PD=Ir(),RD=nr(),FD=gn(),DD=ct(),Mg=class{static{o(this,"ClassCreationService")}constructor(e){this.vault=e}async createSubclass(e,t,r){let i=(0,PD.v4)(),s=this.generateFileName(t),a=s.endsWith(".md")?s:`${s}.md`,c=this.generateClassFrontmatter(e.basename,t,i,r),l=FD.MetadataHelpers.buildFileContent(c),u="classes",f=`${u}/${a}`;return this.vault.getAbstractFileByPath(u)||await this.vault.createFolder(u),await this.vault.create(f,l)}generateFileName(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-");for(;t.startsWith("-");)t=t.slice(1);for(;t.endsWith("-");)t=t.slice(0,-1);return t}generateClassFrontmatter(e,t,r,i){let s=new Date,a=RD.DateFormatter.toLocalTimestamp(s),c={};c.exo__Asset_uid=r,c.exo__Asset_label=t,c.exo__Asset_createdAt=a,c.exo__Instance_class=['"[[exo__Class]]"'],c.exo__Class_superClass=`"[[${e}]]"`;let l=i.exo__Asset_isDefinedBy||'"[[Ontology/EXO]]"';return c.exo__Asset_isDefinedBy=l,c.aliases=[t],c}};$n.ClassCreationService=Mg;$n.ClassCreationService=Mg=CD([(0,KS.injectable)(),OD(0,(0,KS.inject)(DD.DI_TOKENS.IVaultAdapter)),ID("design:paramtypes",[Object])],Mg)});var $g=v(Vn=>{"use strict";var ND=Vn&&Vn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},LD=Vn&&Vn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},MD=Vn&&Vn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ConceptCreationService=void 0;var XS=Ve(),kD=Ir(),jD=nr(),$D=gn(),VD=dr(),UD=ct(),jg=class{static{o(this,"ConceptCreationService")}constructor(e){this.vault=e}async createNarrowerConcept(e,t,r,i){let s=(0,kD.v4)(),a=t.endsWith(".md")?t:`${t}.md`,c=this.generateConceptFrontmatter(e.basename,r,i,s),l=$D.MetadataHelpers.buildFileContent(c),u="concepts",f=`${u}/${a}`;return this.vault.getAbstractFileByPath(u)||await this.vault.createFolder(u),await this.vault.create(f,l)}generateConceptFrontmatter(e,t,r,i){let s=new Date,a=jD.DateFormatter.toLocalTimestamp(s),c={};return c.exo__Asset_isDefinedBy='"[[!concepts]]"',c.exo__Asset_uid=i,c.exo__Asset_createdAt=a,c.exo__Instance_class=[`"[[${VD.AssetClass.CONCEPT}]]"`],c.ims__Concept_broader=`"[[${e}]]"`,c.ims__Concept_definition=t,r.length>0&&(c.aliases=r),c}};Vn.ConceptCreationService=jg;Vn.ConceptCreationService=jg=ND([(0,XS.injectable)(),MD(0,(0,XS.inject)(UD.DI_TOKENS.IVaultAdapter)),LD("design:paramtypes",[Object])],jg)});var Ug=v(Un=>{"use strict";var BD=Un&&Un.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},qD=Un&&Un.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},GD=Un&&Un.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Un,"__esModule",{value:!0});Un.EffortVotingService=void 0;var JS=Ve(),WD=ct(),Vg=class{static{o(this,"EffortVotingService")}constructor(e){this.vault=e}async incrementEffortVotes(e){let t=await this.vault.read(e),i=this.extractVoteCount(t)+1,s=this.updateFrontmatterWithVotes(t,i);return await this.vault.modify(e,s),i}extractVoteCount(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/,r=e.match(t);if(!r)return 0;let s=r[1].match(/ems__Effort_votes:\s*(\d+)/);return s&&s[1]?parseInt(s[1],10):0}updateFrontmatterWithVotes(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---/,i=e.match(r),s=e.includes(`\r
67
67
  `)?`\r
68
68
  `:`
69
- `;if(!i)return`---${s}ems__Effort_votes: ${t}${s}---${s}${e}`;let c=i[1];return c.includes("ems__Effort_votes:")?c=c.replace(/ems__Effort_votes:.*$/m,`ems__Effort_votes: ${t}`):c+=`${s}ems__Effort_votes: ${t}`,e.replace(r,`---${s}${c}${s}---`)}};Vn.EffortVotingService=Vg;Vn.EffortVotingService=Vg=BD([(0,JS.injectable)(),GD(0,(0,JS.inject)(WD.DI_TOKENS.IVaultAdapter)),qD("design:paramtypes",[Object])],Vg)});var qg=v(Un=>{"use strict";var HD=Un&&Un.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},zD=Un&&Un.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},QD=Un&&Un.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Un,"__esModule",{value:!0});Un.FolderRepairService=void 0;var ZS=Ve(),YD=ct(),Bg=class{static{o(this,"FolderRepairService")}constructor(e){this.vault=e}async getExpectedFolder(e,t){let r=t?.exo__Asset_isDefinedBy;if(!r)return null;let i=this.extractReference(r);if(!i)return null;let s=this.vault.getFirstLinkpathDest(i,e.path);return s?this.getFileFolder(s):null}async repairFolder(e,t){let r=`${t}/${e.name}`;if(this.vault.getAbstractFileByPath(r))throw new Error(`Cannot move file: ${r} already exists`);await this.ensureFolderExists(t),await this.vault.rename(e,r)}getFileFolder(e){return e.parent?.path||""}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async ensureFolderExists(e){if(!e)return;let t=this.vault.getAbstractFileByPath(e);if(!(t&&"children"in t))try{await this.vault.createFolder(e)}catch(r){if(r instanceof Error&&r.message.includes("Folder already exists"))return;throw r}}};Un.FolderRepairService=Bg;Un.FolderRepairService=Bg=HD([(0,ZS.injectable)(),QD(0,(0,ZS.inject)(YD.DI_TOKENS.IVaultAdapter)),zD("design:paramtypes",[Object])],Bg)});var Wg=v(Bn=>{"use strict";var KD=Bn&&Bn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XD=Bn&&Bn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},JD=Bn&&Bn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.LabelToAliasService=void 0;var eb=Ve(),ZD=ct(),Gg=class{static{o(this,"LabelToAliasService")}constructor(e){this.vault=e}async copyLabelToAliases(e){let t=await this.vault.read(e),r=this.extractLabel(t);if(!r)throw new Error("No exo__Asset_label found in file");let i=this.addLabelToAliases(t,r);await this.vault.modify(e,i)}extractLabel(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/,r=e.match(t);if(!r)return null;let s=r[1].match(/exo__Asset_label:\s*["']?([^"'\r\n]+)["']?/);return s&&s[1]?s[1].trim():null}addLabelToAliases(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---/,i=e.match(r),s=e.includes(`\r
69
+ `;if(!i)return`---${s}ems__Effort_votes: ${t}${s}---${s}${e}`;let c=i[1];return c.includes("ems__Effort_votes:")?c=c.replace(/ems__Effort_votes:.*$/m,`ems__Effort_votes: ${t}`):c+=`${s}ems__Effort_votes: ${t}`,e.replace(r,`---${s}${c}${s}---`)}};Un.EffortVotingService=Vg;Un.EffortVotingService=Vg=BD([(0,JS.injectable)(),GD(0,(0,JS.inject)(WD.DI_TOKENS.IVaultAdapter)),qD("design:paramtypes",[Object])],Vg)});var qg=v(Bn=>{"use strict";var HD=Bn&&Bn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},zD=Bn&&Bn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},QD=Bn&&Bn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.FolderRepairService=void 0;var ZS=Ve(),YD=ct(),Bg=class{static{o(this,"FolderRepairService")}constructor(e){this.vault=e}async getExpectedFolder(e,t){let r=t?.exo__Asset_isDefinedBy;if(!r)return null;let i=this.extractReference(r);if(!i)return null;let s=this.vault.getFirstLinkpathDest(i,e.path);return s?this.getFileFolder(s):null}async repairFolder(e,t){let r=`${t}/${e.name}`;if(this.vault.getAbstractFileByPath(r))throw new Error(`Cannot move file: ${r} already exists`);await this.ensureFolderExists(t),await this.vault.rename(e,r)}getFileFolder(e){return e.parent?.path||""}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async ensureFolderExists(e){if(!e)return;let t=this.vault.getAbstractFileByPath(e);if(!(t&&"children"in t))try{await this.vault.createFolder(e)}catch(r){if(r instanceof Error&&r.message.includes("Folder already exists"))return;throw r}}};Bn.FolderRepairService=Bg;Bn.FolderRepairService=Bg=HD([(0,ZS.injectable)(),QD(0,(0,ZS.inject)(YD.DI_TOKENS.IVaultAdapter)),zD("design:paramtypes",[Object])],Bg)});var Wg=v(qn=>{"use strict";var KD=qn&&qn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XD=qn&&qn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},JD=qn&&qn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(qn,"__esModule",{value:!0});qn.LabelToAliasService=void 0;var eb=Ve(),ZD=ct(),Gg=class{static{o(this,"LabelToAliasService")}constructor(e){this.vault=e}async copyLabelToAliases(e){let t=await this.vault.read(e),r=this.extractLabel(t);if(!r)throw new Error("No exo__Asset_label found in file");let i=this.addLabelToAliases(t,r);await this.vault.modify(e,i)}extractLabel(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/,r=e.match(t);if(!r)return null;let s=r[1].match(/exo__Asset_label:\s*["']?([^"'\r\n]+)["']?/);return s&&s[1]?s[1].trim():null}addLabelToAliases(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---/,i=e.match(r),s=e.includes(`\r
70
70
  `)?`\r
71
71
  `:`
72
- `;if(!i)return`---${s}aliases:${s} - "${t}"${s}---${s}${e}`;let c=i[1];return c.includes("aliases:")?c.match(/(aliases:\r?\n(?: {2}- .*\r?\n)*)/)&&(c=c.replace(/(aliases:\r?\n(?: {2}- .*\r?\n)*)/,`$1 - "${t}"${s}`)):c+=`${s}aliases:${s} - "${t}"`,e.replace(r,`---${s}${c}${s}---`)}};Bn.LabelToAliasService=Gg;Bn.LabelToAliasService=Gg=KD([(0,eb.injectable)(),JD(0,(0,eb.inject)(ZD.DI_TOKENS.IVaultAdapter)),XD("design:paramtypes",[Object])],Gg)});var la=v(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.LoggingService=void 0;var Kc=class{static{o(this,"LoggingService")}static setVerbose(e){this.isVerbose=e}static setDevelopmentMode(e){this.isDevelopment=e}static checkIsDevelopment(){return this.isDevelopment!==void 0?this.isDevelopment:typeof process<"u"?(this.isDevelopment=!1,this.isDevelopment):(this.isDevelopment=!1,this.isDevelopment)}static debug(e,t){this.isVerbose&&console.debug(`[Exocortex] ${e}`,t??"")}static info(e,t){console.log(`[Exocortex] ${e}`,t??"")}static warn(e,t){console.warn(`[Exocortex] ${e}`,t??"")}static error(e,t,r){let i=this.checkIsDevelopment(),s=r?` [${r}]`:"";if(i){let a=t?.stack?`
72
+ `;if(!i)return`---${s}aliases:${s} - "${t}"${s}---${s}${e}`;let c=i[1];return c.includes("aliases:")?c.match(/(aliases:\r?\n(?: {2}- .*\r?\n)*)/)&&(c=c.replace(/(aliases:\r?\n(?: {2}- .*\r?\n)*)/,`$1 - "${t}"${s}`)):c+=`${s}aliases:${s} - "${t}"`,e.replace(r,`---${s}${c}${s}---`)}};qn.LabelToAliasService=Gg;qn.LabelToAliasService=Gg=KD([(0,eb.injectable)(),JD(0,(0,eb.inject)(ZD.DI_TOKENS.IVaultAdapter)),XD("design:paramtypes",[Object])],Gg)});var la=v(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.LoggingService=void 0;var Kc=class{static{o(this,"LoggingService")}static setVerbose(e){this.isVerbose=e}static setDevelopmentMode(e){this.isDevelopment=e}static checkIsDevelopment(){return this.isDevelopment!==void 0?this.isDevelopment:typeof process<"u"?(this.isDevelopment=!1,this.isDevelopment):(this.isDevelopment=!1,this.isDevelopment)}static debug(e,t){this.isVerbose&&console.debug(`[Exocortex] ${e}`,t??"")}static info(e,t){console.log(`[Exocortex] ${e}`,t??"")}static warn(e,t){console.warn(`[Exocortex] ${e}`,t??"")}static error(e,t,r){let i=this.checkIsDevelopment(),s=r?` [${r}]`:"";if(i){let a=t?.stack?`
73
73
  Stack trace:
74
74
  ${t.stack}`:"";console.error(`[Exocortex ERROR]${s} ${e}${a}`,t??"")}else{let a=t?.message?`
75
- Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${a}`)}}};Ff.LoggingService=Kc;Kc.isVerbose=!1;Kc.isDevelopment=void 0});var Qg=v(qn=>{"use strict";var eN=qn&&qn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},tN=qn&&qn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},tb=qn&&qn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(qn,"__esModule",{value:!0});qn.PropertyCleanupService=void 0;var Hg=Ve(),rb=ct(),zg=class{static{o(this,"PropertyCleanupService")}constructor(e,t){this.vault=e,this.logger=t,this.logger.debug("PropertyCleanupService initialized")}async cleanEmptyProperties(e){this.logger.debug("Cleaning empty properties",{path:e.path});let t=await this.vault.read(e),r=this.removeEmptyPropertiesFromContent(t);await this.vault.modify(e,r),this.logger.info("Empty properties cleaned",{path:e.path})}removeEmptyPropertiesFromContent(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return e;let s=r[1].split(`
75
+ Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${a}`)}}};Ff.LoggingService=Kc;Kc.isVerbose=!1;Kc.isDevelopment=void 0});var Qg=v(Gn=>{"use strict";var eN=Gn&&Gn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},tN=Gn&&Gn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},tb=Gn&&Gn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.PropertyCleanupService=void 0;var Hg=Ve(),rb=ct(),zg=class{static{o(this,"PropertyCleanupService")}constructor(e,t){this.vault=e,this.logger=t,this.logger.debug("PropertyCleanupService initialized")}async cleanEmptyProperties(e){this.logger.debug("Cleaning empty properties",{path:e.path});let t=await this.vault.read(e),r=this.removeEmptyPropertiesFromContent(t);await this.vault.modify(e,r),this.logger.info("Empty properties cleaned",{path:e.path})}removeEmptyPropertiesFromContent(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return e;let s=r[1].split(`
76
76
  `),a=[],c=0;for(;c<s.length;){let u=s[c],f=u.trim();if(f===""){a.push(u),c++;continue}let h=f.match(/^([^:]+):\s*(.*)$/);if(h){let d=h[2];if(d===""&&c+1<s.length&&s[c+1].match(/^\s+- /)){let _=[],S=c+1;for(;S<s.length&&s[S].match(/^\s+- /);)_.push(s[S]),S++;if(_.every(A=>{let C=A.replace(/^\s+- /,"").trim();return this.isEmptyValue(C)})){c=S;continue}else{a.push(u);for(let A=c+1;A<S;A++)a.push(s[A]);c=S;continue}}if(this.isEmptyValue(d)){c++;continue}a.push(u),c++}else f.match(/^\s*- /)||a.push(u),c++}let l=a.join(`
77
77
  `);return e.replace(t,`---
78
78
  ${l}
79
- ---`)}isEmptyValue(e){let t=e.trim();return t===""||t==="null"||t==="undefined"||t==="[]"||t==="{}"||t==='""'||t==="''"}};qn.PropertyCleanupService=zg;qn.PropertyCleanupService=zg=eN([(0,Hg.injectable)(),tb(0,(0,Hg.inject)(rb.DI_TOKENS.IVaultAdapter)),tb(1,(0,Hg.inject)(rb.DI_TOKENS.ILogger)),tN("design:paramtypes",[Object,Object])],zg)});var Kg=v(Gn=>{"use strict";var rN=Gn&&Gn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},nN=Gn&&Gn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},iN=Gn&&Gn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.RenameToUidService=void 0;var nb=Ve(),sN=ct(),Yg=class{static{o(this,"RenameToUidService")}constructor(e){this.vault=e}async renameToUid(e,t){let r=t.exo__Asset_uid;if(!r)throw new Error("Asset has no exo__Asset_uid property");let i=e.basename,s=r;if(i===s)throw new Error("File is already named according to UID");let a=t.exo__Asset_label;if(!a||a.trim()===""){let f=this.isAssetArchived(t);await this.updateLabel(e,i,f)}let l=e.parent?.path||"",u=l?`${l}/${s}.md`:`${s}.md`;await this.vault.updateLinks(e.path,u,i),await this.vault.rename(e,u)}async updateLabel(e,t,r){await this.vault.process(e,i=>{let s=/^---\n([\s\S]*?)\n---/,a=i.match(s);if(!a)return i;let c=a[1];return c=`${c}
79
+ ---`)}isEmptyValue(e){let t=e.trim();return t===""||t==="null"||t==="undefined"||t==="[]"||t==="{}"||t==='""'||t==="''"}};Gn.PropertyCleanupService=zg;Gn.PropertyCleanupService=zg=eN([(0,Hg.injectable)(),tb(0,(0,Hg.inject)(rb.DI_TOKENS.IVaultAdapter)),tb(1,(0,Hg.inject)(rb.DI_TOKENS.ILogger)),tN("design:paramtypes",[Object,Object])],zg)});var Kg=v(Wn=>{"use strict";var rN=Wn&&Wn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},nN=Wn&&Wn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},iN=Wn&&Wn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.RenameToUidService=void 0;var nb=Ve(),sN=ct(),Yg=class{static{o(this,"RenameToUidService")}constructor(e){this.vault=e}async renameToUid(e,t){let r=t.exo__Asset_uid;if(!r)throw new Error("Asset has no exo__Asset_uid property");let i=e.basename,s=r;if(i===s)throw new Error("File is already named according to UID");let a=t.exo__Asset_label;if(!a||a.trim()===""){let f=this.isAssetArchived(t);await this.updateLabel(e,i,f)}let l=e.parent?.path||"",u=l?`${l}/${s}.md`:`${s}.md`;await this.vault.updateLinks(e.path,u,i),await this.vault.rename(e,u)}async updateLabel(e,t,r){await this.vault.process(e,i=>{let s=/^---\n([\s\S]*?)\n---/,a=i.match(s);if(!a)return i;let c=a[1];return c=`${c}
80
80
  exo__Asset_label: ${t}`,r||(c=this.updateAliases(c,t)),i.replace(s,`---
81
81
  ${c}
82
82
  ---`)})}updateAliases(e,t){if(!/^aliases\s*:/m.test(e))return`${e}
@@ -86,7 +86,7 @@ aliases:
86
86
  - ${t}
87
87
  `;return e.replace(s[1],h)}let a=/^aliases\s*:\s*\[([^\]]*)\]/m,c=e.match(a);if(c){let u=c[1].trim();return u===""?e.replace(a,`aliases:
88
88
  - ${t}`):u.split(",").map(h=>h.trim().replace(/^["']|["']$/g,"")).includes(t)?e:e.replace(a,`aliases: [${u}, ${t}]`)}let l=/^aliases\s*:\s*(?:null|~)?\s*$/m;return e.replace(l,`aliases:
89
- - ${t}`)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}};Gn.RenameToUidService=Yg;Gn.RenameToUidService=Yg=rN([(0,nb.injectable)(),iN(0,(0,nb.inject)(sN.DI_TOKENS.IVaultAdapter)),nN("design:paramtypes",[Object])],Yg)});var Jg=v(Wn=>{"use strict";var aN=Wn&&Wn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},oN=Wn&&Wn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},cN=Wn&&Wn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.SupervisionCreationService=void 0;var ib=Ve(),lN=Cr(),uN=nr(),fN=ct(),Xg=class{static{o(this,"SupervisionCreationService")}constructor(e){this.vault=e}async createSupervision(e){let t=(0,lN.v4)(),r=`${t}.md`,i=this.generateFrontmatter(t),s=this.generateBody(e),a=this.buildFileContent(i,s),c=`01 Inbox/${r}`;return await this.vault.create(c,a)}generateFrontmatter(e){let t=new Date,r=uN.DateFormatter.toLocalTimestamp(t);return{exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Asset_uid:e,exo__Asset_createdAt:r,exo__Instance_class:['"[[fca0a931-a01f-48e4-b72a-4af206c94bc7]]"'],ztlk__FleetingNote_type:'"[[CBT-Diary Record]]"'}}generateBody(e){return[{label:"\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044F/\u0442\u0440\u0438\u0433\u0433\u0435\u0440",value:e.situation},{label:"\u042D\u043C\u043E\u0446\u0438\u0438",value:e.emotions},{label:"\u041C\u044B\u0441\u043B\u0438",value:e.thoughts},{label:"\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435",value:e.behavior},{label:"\u041A\u0440\u0430\u0442\u043A\u043E\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u0441\u0442\u0432\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F",value:e.shortTermConsequences},{label:"\u0414\u043E\u043B\u0433\u043E\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u0441\u0442\u0432\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F",value:e.longTermConsequences}].map(r=>`- ${r.label}: ${r.value}`).join(`
89
+ - ${t}`)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}};Wn.RenameToUidService=Yg;Wn.RenameToUidService=Yg=rN([(0,nb.injectable)(),iN(0,(0,nb.inject)(sN.DI_TOKENS.IVaultAdapter)),nN("design:paramtypes",[Object])],Yg)});var Jg=v(Hn=>{"use strict";var aN=Hn&&Hn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},oN=Hn&&Hn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},cN=Hn&&Hn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.SupervisionCreationService=void 0;var ib=Ve(),lN=Ir(),uN=nr(),fN=ct(),Xg=class{static{o(this,"SupervisionCreationService")}constructor(e){this.vault=e}async createSupervision(e){let t=(0,lN.v4)(),r=`${t}.md`,i=this.generateFrontmatter(t),s=this.generateBody(e),a=this.buildFileContent(i,s),c=`01 Inbox/${r}`;return await this.vault.create(c,a)}generateFrontmatter(e){let t=new Date,r=uN.DateFormatter.toLocalTimestamp(t);return{exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Asset_uid:e,exo__Asset_createdAt:r,exo__Instance_class:['"[[fca0a931-a01f-48e4-b72a-4af206c94bc7]]"'],ztlk__FleetingNote_type:'"[[CBT-Diary Record]]"'}}generateBody(e){return[{label:"\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044F/\u0442\u0440\u0438\u0433\u0433\u0435\u0440",value:e.situation},{label:"\u042D\u043C\u043E\u0446\u0438\u0438",value:e.emotions},{label:"\u041C\u044B\u0441\u043B\u0438",value:e.thoughts},{label:"\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435",value:e.behavior},{label:"\u041A\u0440\u0430\u0442\u043A\u043E\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u0441\u0442\u0432\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F",value:e.shortTermConsequences},{label:"\u0414\u043E\u043B\u0433\u043E\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u0441\u0442\u0432\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F",value:e.longTermConsequences}].map(r=>`- ${r.label}: ${r.value}`).join(`
90
90
  `)}buildFileContent(e,t){return`---
91
91
  ${Object.entries(e).map(([i,s])=>{if(Array.isArray(s)){let a=s.map(c=>` - ${c}`).join(`
92
92
  `);return`${i}:
@@ -95,15 +95,15 @@ ${a}`}return`${i}: ${s}`}).join(`
95
95
  ---
96
96
 
97
97
  ${t}
98
- `}};Wn.SupervisionCreationService=Xg;Wn.SupervisionCreationService=Xg=aN([(0,ib.injectable)(),cN(0,(0,ib.inject)(fN.DI_TOKENS.IVaultAdapter)),oN("design:paramtypes",[Object])],Xg)});var e0=v(Hn=>{"use strict";var hN=Hn&&Hn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},dN=Hn&&Hn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},pN=Hn&&Hn.__param||function(n,e){return function(t,r){e(t,r,n)}},Zg;Object.defineProperty(Hn,"__esModule",{value:!0});Hn.FleetingNoteCreationService=void 0;var sb=Ve(),mN=Cr(),gN=nr(),yN=gn(),vN=ct(),Df=Zg=class{static{o(this,"FleetingNoteCreationService")}constructor(e){this.vault=e}async createFleetingNote(e){let t=(0,mN.v4)(),r=`${t}.md`,i=this.generateFrontmatter(t,e),s=yN.MetadataHelpers.buildFileContent(i),a=`${Zg.INBOX_FOLDER}/${r}`;return await this.vault.create(a,s)}generateFrontmatter(e,t){let r=new Date,i=gN.DateFormatter.toLocalTimestamp(r),s=t.trim();return{exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Asset_uid:e,exo__Asset_createdAt:i,exo__Instance_class:['"[[fca0a931-a01f-48e4-b72a-4af206c94bc7]]"'],exo__Asset_label:s,aliases:[s]}}};Hn.FleetingNoteCreationService=Df;Df.INBOX_FOLDER="01 Inbox";Hn.FleetingNoteCreationService=Df=Zg=hN([(0,sb.injectable)(),pN(0,(0,sb.inject)(vN.DI_TOKENS.IVaultAdapter)),dN("design:paramtypes",[Object])],Df)});var r0=v(ua=>{"use strict";var _N=ua&&ua.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(ua,"__esModule",{value:!0});ua.DynamicFrontmatterGenerator=void 0;var SN=Ve(),bN=Cr(),Xc=nr(),t0=class{static{o(this,"DynamicFrontmatterGenerator")}generate(e,t,r,i){let s={},a=new Date;i?.isDefinedBy&&(s.exo__Asset_isDefinedBy=this.ensureQuoted(i.isDefinedBy)),s.exo__Asset_uid=i?.uid||(0,bN.v4)(),s.exo__Asset_createdAt=i?.createdAt||Xc.DateFormatter.toLocalTimestamp(a),s.exo__Instance_class=[this.formatWikilink(e)];let c=new Map;for(let u of r)c.set(u.name,u.type);for(let[u,f]of Object.entries(t)){if(f==null||u==="exo__Asset_uid"||u==="exo__Asset_createdAt"||u==="exo__Instance_class"||u==="exo__Asset_isDefinedBy")continue;let h=c.get(u);s[u]=this.formatValue(f,h)}let l=t.exo__Asset_label;if(l&&typeof l=="string"&&l.trim()!==""){let u=l.trim();s.exo__Asset_label=u,s.aliases=[u]}return s}formatValue(e,t){if(e==null)return null;if(!t)return this.formatInferredValue(e);switch(t){case"text":return this.formatText(e);case"wikilink":return this.formatWikilink(e);case"status-select":case"size-select":return this.formatWikilink(e);case"number":return this.formatNumber(e);case"boolean":return this.formatBoolean(e);case"timestamp":return this.formatTimestamp(e);default:return this.formatText(e)}}formatText(e){return typeof e=="string"?e:String(e)}formatWikilink(e){let t=String(e);return t.startsWith('"[[')&&t.endsWith(']]"')?t:t.startsWith("[[")&&t.endsWith("]]")?`"${t}"`:`"[[${t}]]"`}formatNumber(e){if(typeof e=="number")return e;let t=Number(e);return isNaN(t)?0:t}formatBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"}return typeof e=="number"?e!==0:!!e}formatTimestamp(e){if(e instanceof Date)return Xc.DateFormatter.toLocalTimestamp(e);if(typeof e=="string"){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e.replace("Z","");let t=new Date(e);return isNaN(t.getTime())?e:Xc.DateFormatter.toLocalTimestamp(t)}if(typeof e=="number"){let t=new Date(e);if(!isNaN(t.getTime()))return Xc.DateFormatter.toLocalTimestamp(t)}return String(e)}formatInferredValue(e){return typeof e=="boolean"||typeof e=="number"?e:e instanceof Date?Xc.DateFormatter.toLocalTimestamp(e):typeof e=="string"?e.startsWith("[[")||e.startsWith('"[[')?this.formatWikilink(e):e:String(e)}ensureQuoted(e){return!e||e==='""'?'""':e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}generateYAML(e,t,r,i){let s=this.generate(e,t,r,i);return this.toYAML(s)}toYAML(e){return`---
98
+ `}};Hn.SupervisionCreationService=Xg;Hn.SupervisionCreationService=Xg=aN([(0,ib.injectable)(),cN(0,(0,ib.inject)(fN.DI_TOKENS.IVaultAdapter)),oN("design:paramtypes",[Object])],Xg)});var e0=v(zn=>{"use strict";var hN=zn&&zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},dN=zn&&zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},pN=zn&&zn.__param||function(n,e){return function(t,r){e(t,r,n)}},Zg;Object.defineProperty(zn,"__esModule",{value:!0});zn.FleetingNoteCreationService=void 0;var sb=Ve(),mN=Ir(),gN=nr(),yN=gn(),vN=ct(),Df=Zg=class{static{o(this,"FleetingNoteCreationService")}constructor(e){this.vault=e}async createFleetingNote(e){let t=(0,mN.v4)(),r=`${t}.md`,i=this.generateFrontmatter(t,e),s=yN.MetadataHelpers.buildFileContent(i),a=`${Zg.INBOX_FOLDER}/${r}`;return await this.vault.create(a,s)}generateFrontmatter(e,t){let r=new Date,i=gN.DateFormatter.toLocalTimestamp(r),s=t.trim();return{exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Asset_uid:e,exo__Asset_createdAt:i,exo__Instance_class:['"[[fca0a931-a01f-48e4-b72a-4af206c94bc7]]"'],exo__Asset_label:s,aliases:[s]}}};zn.FleetingNoteCreationService=Df;Df.INBOX_FOLDER="01 Inbox";zn.FleetingNoteCreationService=Df=Zg=hN([(0,sb.injectable)(),pN(0,(0,sb.inject)(vN.DI_TOKENS.IVaultAdapter)),dN("design:paramtypes",[Object])],Df)});var r0=v(ua=>{"use strict";var _N=ua&&ua.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(ua,"__esModule",{value:!0});ua.DynamicFrontmatterGenerator=void 0;var SN=Ve(),bN=Ir(),Xc=nr(),t0=class{static{o(this,"DynamicFrontmatterGenerator")}generate(e,t,r,i){let s={},a=new Date;i?.isDefinedBy&&(s.exo__Asset_isDefinedBy=this.ensureQuoted(i.isDefinedBy)),s.exo__Asset_uid=i?.uid||(0,bN.v4)(),s.exo__Asset_createdAt=i?.createdAt||Xc.DateFormatter.toLocalTimestamp(a),s.exo__Instance_class=[this.formatWikilink(e)];let c=new Map;for(let u of r)c.set(u.name,u.type);for(let[u,f]of Object.entries(t)){if(f==null||u==="exo__Asset_uid"||u==="exo__Asset_createdAt"||u==="exo__Instance_class"||u==="exo__Asset_isDefinedBy")continue;let h=c.get(u);s[u]=this.formatValue(f,h)}let l=t.exo__Asset_label;if(l&&typeof l=="string"&&l.trim()!==""){let u=l.trim();s.exo__Asset_label=u,s.aliases=[u]}return s}formatValue(e,t){if(e==null)return null;if(!t)return this.formatInferredValue(e);switch(t){case"text":return this.formatText(e);case"wikilink":return this.formatWikilink(e);case"status-select":case"size-select":return this.formatWikilink(e);case"number":return this.formatNumber(e);case"boolean":return this.formatBoolean(e);case"timestamp":return this.formatTimestamp(e);default:return this.formatText(e)}}formatText(e){return typeof e=="string"?e:String(e)}formatWikilink(e){let t=String(e);return t.startsWith('"[[')&&t.endsWith(']]"')?t:t.startsWith("[[")&&t.endsWith("]]")?`"${t}"`:`"[[${t}]]"`}formatNumber(e){if(typeof e=="number")return e;let t=Number(e);return isNaN(t)?0:t}formatBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"}return typeof e=="number"?e!==0:!!e}formatTimestamp(e){if(e instanceof Date)return Xc.DateFormatter.toLocalTimestamp(e);if(typeof e=="string"){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e.replace("Z","");let t=new Date(e);return isNaN(t.getTime())?e:Xc.DateFormatter.toLocalTimestamp(t)}if(typeof e=="number"){let t=new Date(e);if(!isNaN(t.getTime()))return Xc.DateFormatter.toLocalTimestamp(t)}return String(e)}formatInferredValue(e){return typeof e=="boolean"||typeof e=="number"?e:e instanceof Date?Xc.DateFormatter.toLocalTimestamp(e):typeof e=="string"?e.startsWith("[[")||e.startsWith('"[[')?this.formatWikilink(e):e:String(e)}ensureQuoted(e){return!e||e==='""'?'""':e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}generateYAML(e,t,r,i){let s=this.generate(e,t,r,i);return this.toYAML(s)}toYAML(e){return`---
99
99
  ${Object.entries(e).map(([r,i])=>{if(Array.isArray(i)){let s=i.map(a=>` - ${a}`).join(`
100
100
  `);return`${r}:
101
101
  ${s}`}return`${r}: ${i}`}).join(`
102
102
  `)}
103
- ---`}};ua.DynamicFrontmatterGenerator=t0;ua.DynamicFrontmatterGenerator=t0=_N([(0,SN.injectable)()],t0)});var i0=v(zn=>{"use strict";var wN=zn&&zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},EN=zn&&zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},TN=zn&&zn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(zn,"__esModule",{value:!0});zn.PlanningService=void 0;var ab=Ve(),xN=Ki(),AN=nr(),CN=ct(),n0=class{static{o(this,"PlanningService")}constructor(e){this.vault=e,this.frontmatterService=new xN.FrontmatterService}async planOnToday(e){let t=this.vault.getAbstractFileByPath(e);if(!t||!this.isFile(t))throw new Error(`File not found: ${e}`);let r=await this.vault.read(t),i=AN.DateFormatter.getTodayStartTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_plannedStartTimestamp",i);await this.vault.modify(t,s)}isFile(e){return"basename"in e}};zn.PlanningService=n0;zn.PlanningService=n0=wN([(0,ab.injectable)(),TN(0,(0,ab.inject)(CN.DI_TOKENS.IVaultAdapter)),EN("design:paramtypes",[Object])],n0)});var a0=v(Qn=>{"use strict";var IN=Qn&&Qn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},ON=Qn&&Qn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},PN=Qn&&Qn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.AssetConversionService=void 0;var ob=Ve(),cb=dr(),RN=Ki(),Nf=la(),FN=ct(),s0=class{static{o(this,"AssetConversionService")}constructor(e){this.vault=e,this.frontmatterService=new RN.FrontmatterService}async convertTaskToProject(e){try{let t=await this.vault.read(e),r=this.removeInstanceClassProperty(t);return r=this.frontmatterService.updateProperty(r,"exo__Instance_class",`["[[${cb.AssetClass.PROJECT}]]"]`),await this.vault.modify(e,r),Nf.LoggingService.info(`Converted Task to Project: ${e.basename} (${e.path})`),e}catch(t){let r=`Failed to convert Task to Project: ${e.path}`;throw Nf.LoggingService.error(r,t instanceof Error?t:void 0),new Error(r)}}async convertProjectToTask(e){try{let t=await this.vault.read(e),r=this.removeInstanceClassProperty(t);return r=this.frontmatterService.updateProperty(r,"exo__Instance_class",`["[[${cb.AssetClass.TASK}]]"]`),await this.vault.modify(e,r),Nf.LoggingService.info(`Converted Project to Task: ${e.basename} (${e.path})`),e}catch(t){let r=`Failed to convert Project to Task: ${e.path}`;throw Nf.LoggingService.error(r,t instanceof Error?t:void 0),new Error(r)}}removeInstanceClassProperty(e){let t=this.frontmatterService.parse(e);if(!t.exists)return e;let r=/^exo__Instance_class:.*$(\n -.*$)*/gm,i=t.content.replace(r,"").replace(/\n\n+/g,`
103
+ ---`}};ua.DynamicFrontmatterGenerator=t0;ua.DynamicFrontmatterGenerator=t0=_N([(0,SN.injectable)()],t0)});var i0=v(Qn=>{"use strict";var wN=Qn&&Qn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},EN=Qn&&Qn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},TN=Qn&&Qn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.PlanningService=void 0;var ab=Ve(),xN=Ki(),AN=nr(),CN=ct(),n0=class{static{o(this,"PlanningService")}constructor(e){this.vault=e,this.frontmatterService=new xN.FrontmatterService}async planOnToday(e){let t=this.vault.getAbstractFileByPath(e);if(!t||!this.isFile(t))throw new Error(`File not found: ${e}`);let r=await this.vault.read(t),i=AN.DateFormatter.getTodayStartTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_plannedStartTimestamp",i);await this.vault.modify(t,s)}isFile(e){return"basename"in e}};Qn.PlanningService=n0;Qn.PlanningService=n0=wN([(0,ab.injectable)(),TN(0,(0,ab.inject)(CN.DI_TOKENS.IVaultAdapter)),EN("design:paramtypes",[Object])],n0)});var a0=v(Yn=>{"use strict";var IN=Yn&&Yn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},ON=Yn&&Yn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},PN=Yn&&Yn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.AssetConversionService=void 0;var ob=Ve(),cb=dr(),RN=Ki(),Nf=la(),FN=ct(),s0=class{static{o(this,"AssetConversionService")}constructor(e){this.vault=e,this.frontmatterService=new RN.FrontmatterService}async convertTaskToProject(e){try{let t=await this.vault.read(e),r=this.removeInstanceClassProperty(t);return r=this.frontmatterService.updateProperty(r,"exo__Instance_class",`["[[${cb.AssetClass.PROJECT}]]"]`),await this.vault.modify(e,r),Nf.LoggingService.info(`Converted Task to Project: ${e.basename} (${e.path})`),e}catch(t){let r=`Failed to convert Task to Project: ${e.path}`;throw Nf.LoggingService.error(r,t instanceof Error?t:void 0),new Error(r)}}async convertProjectToTask(e){try{let t=await this.vault.read(e),r=this.removeInstanceClassProperty(t);return r=this.frontmatterService.updateProperty(r,"exo__Instance_class",`["[[${cb.AssetClass.TASK}]]"]`),await this.vault.modify(e,r),Nf.LoggingService.info(`Converted Project to Task: ${e.basename} (${e.path})`),e}catch(t){let r=`Failed to convert Project to Task: ${e.path}`;throw Nf.LoggingService.error(r,t instanceof Error?t:void 0),new Error(r)}}removeInstanceClassProperty(e){let t=this.frontmatterService.parse(e);if(!t.exists)return e;let r=/^exo__Instance_class:.*$(\n -.*$)*/gm,i=t.content.replace(r,"").replace(/\n\n+/g,`
104
104
  `).trim();return e.replace(/^---\n[\s\S]*?\n---/,`---
105
105
  ${i}
106
- ---`)}};Qn.AssetConversionService=s0;Qn.AssetConversionService=s0=IN([(0,ob.injectable)(),PN(0,(0,ob.inject)(FN.DI_TOKENS.IVaultAdapter)),ON("design:paramtypes",[Object])],s0)});var c0=v(Yn=>{"use strict";var DN=Yn&&Yn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},NN=Yn&&Yn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},LN=Yn&&Yn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.SessionEventService=void 0;var lb=Ve(),MN=Cr(),ub=dr(),kN=nr(),jN=gn(),$N=ct(),o0=class{static{o(this,"SessionEventService")}constructor(e){this.vault=e,this.folderPathCache=null}async createSessionStartEvent(e){return this.createSessionEvent(e,ub.AssetClass.SESSION_START_EVENT)}async createSessionEndEvent(e){return this.createSessionEvent(e,ub.AssetClass.SESSION_END_EVENT)}getSessionEventFolder(){if(this.folderPathCache!==null)return this.folderPathCache;let e=this.vault.getDefaultNewFileParent();return this.folderPathCache=e?.path||"",this.folderPathCache}async createSessionEvent(e,t){let r=(0,MN.v4)(),i=kN.DateFormatter.toLocalTimestamp(new Date),s={exo__Asset_uid:r,exo__Asset_createdAt:i,exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Instance_class:[`"[[${t}]]"`],ems__SessionEvent_timestamp:i,ems__Session_area:`"[[${e}]]"`},a=jN.MetadataHelpers.buildFileContent(s),c=this.getSessionEventFolder();c&&!await this.vault.exists(c)&&await this.vault.createFolder(c);let l=c?`${c}/${r}.md`:`${r}.md`;return await this.vault.create(l,a)}};Yn.SessionEventService=o0;Yn.SessionEventService=o0=DN([(0,lb.injectable)(),LN(0,(0,lb.inject)($N.DI_TOKENS.IVaultAdapter)),NN("design:paramtypes",[Object])],o0)});var u0=v(Kn=>{"use strict";var VN=Kn&&Kn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},UN=Kn&&Kn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},BN=Kn&&Kn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.URIConstructionService=void 0;var fb=Ve(),qN=ct(),l0=class{static{o(this,"URIConstructionService")}constructor(e){this.fileSystem=e,this.defaultOntologyURL="https://exocortex.my/default/",this.strictValidation=!0}configure(e){e?.defaultOntologyURL&&(this.defaultOntologyURL=e.defaultOntologyURL),e?.strictValidation!==void 0&&(this.strictValidation=e.strictValidation)}async constructAssetURI(e){let t=this.extractUID(e);if(!t){if(this.strictValidation)throw new Error(`Asset missing exo__Asset_uid: ${e.path}`);return console.warn(`Asset ${e.path} missing UID, using filename fallback`),this.constructFallbackURI(e)}let r=await this.resolveOntologyURL(e);if(!this.validateOntologyURL(r))throw new Error(`Invalid ontology URL: ${r}`);return`${r.endsWith("/")?r:`${r}/`}${t}`}validateOntologyURL(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}async resolveOntologyURL(e){let t=e.frontmatter?.exo__Asset_isDefinedBy;if(!t)return this.defaultOntologyURL;let r=this.extractWikiLink(t),i=r,s=await this.fileSystem.fileExists(r);return!s&&!r.endsWith(".md")&&(i=`${r}.md`,s=await this.fileSystem.fileExists(i)),s?(await this.fileSystem.getFileMetadata(i))?.exo__Ontology_url||this.defaultOntologyURL:(console.warn(`Ontology file not found: ${r}, using default`),this.defaultOntologyURL)}extractUID(e){return e.frontmatter?.exo__Asset_uid||null}extractWikiLink(e){return e.replace(/^\[\[|\]\]$/g,"")}constructFallbackURI(e){let t=e.path.split("/").pop()?.replace(".md","")||"unknown";return`${this.defaultOntologyURL}${t}`}};Kn.URIConstructionService=l0;Kn.URIConstructionService=l0=VN([(0,fb.injectable)(),BN(0,(0,fb.inject)(qN.DI_TOKENS.IFileSystemAdapter)),UN("design:paramtypes",[Object])],l0)});var h0=v(Xn=>{"use strict";var GN=Xn&&Xn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},WN=Xn&&Xn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},HN=Xn&&Xn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.GenericAssetCreationService=void 0;var hb=Ve(),zN=Cr(),Jc=nr(),QN=gn(),YN=ct(),bi=Lm(),f0=class{static{o(this,"GenericAssetCreationService")}constructor(e){this.vault=e}async createAsset(e,t){let r=(0,zN.v4)(),i=`${r}.md`,s=this.generateFrontmatter(e,t||[],r),a=QN.MetadataHelpers.buildFileContent(s),c=e.folderPath||this.getDefaultFolderPath(e);this.vault.getAbstractFileByPath(c)||await this.vault.createFolder(c);let u=c?`${c}/${i}`:i;return await this.vault.create(u,a)}generateFrontmatter(e,t,r){let i=new Date,s={},a=new Map;for(let c of t)a.set(c.name,c.fieldType);if(s.exo__Asset_uid=r,s.exo__Asset_createdAt=Jc.DateFormatter.toLocalTimestamp(i),s.exo__Instance_class=[this.formatWikilink(e.className)],e.label&&e.label.trim()!==""){let c=e.label.trim();s.exo__Asset_label=c,s.aliases=[c]}if(e.parentFile&&e.parentMetadata&&this.inheritParentContext(s,e),e.propertyValues)for(let[c,l]of Object.entries(e.propertyValues)){if(c==="exo__Asset_uid"||c==="exo__Asset_createdAt"||c==="exo__Instance_class"||c==="exo__Asset_label"||c==="aliases"||l==null)continue;let u=a.get(c);s[c]=this.formatValue(l,u)}return s}inheritParentContext(e,t){let r=t.parentMetadata||{},i=t.parentFile?.basename;if((t.className==="ems__Task"||t.className.startsWith("ems__Task"))&&(e.ems__Effort_parent=i?this.formatWikilink(i):null),t.className==="ems__Project"||t.className.startsWith("ems__Project")){let s=r.exo__Instance_class;this.isAreaClass(s)&&(e.ems__Project_area=i?this.formatWikilink(i):null)}r.exo__Asset_isDefinedBy&&(e.exo__Asset_isDefinedBy=r.exo__Asset_isDefinedBy)}isAreaClass(e){return e?(Array.isArray(e)?e:[e]).some(r=>String(r).includes("Area")||String(r).includes("ems__Area")):!1}getDefaultFolderPath(e){if(e.parentFile?.parent?.path)return e.parentFile.parent.path;let t={ems__Task:"tasks",ems__Project:"projects",ems__Area:"areas",ems__Meeting:"meetings",exo__Event:"events",ims__Concept:"concepts"};if(t[e.className])return t[e.className];for(let[r,i]of Object.entries(t))if(e.className.startsWith(r))return i;return"assets"}formatValue(e,t){if(e==null)return null;if(!t)return this.formatInferredValue(e);switch(t){case bi.PropertyFieldType.Text:return String(e);case bi.PropertyFieldType.Wikilink:case bi.PropertyFieldType.Reference:case bi.PropertyFieldType.StatusSelect:case bi.PropertyFieldType.SizeSelect:return this.formatWikilink(String(e));case bi.PropertyFieldType.Number:return typeof e=="number"?e:Number(e)||0;case bi.PropertyFieldType.Boolean:return this.formatBoolean(e);case bi.PropertyFieldType.Date:case bi.PropertyFieldType.DateTime:case bi.PropertyFieldType.Timestamp:return this.formatTimestamp(e);default:return String(e)}}formatInferredValue(e){return typeof e=="boolean"||typeof e=="number"?e:e instanceof Date?Jc.DateFormatter.toLocalTimestamp(e):typeof e=="string"?e.startsWith("[[")||e.startsWith('"[[')?this.formatWikilink(e):e:String(e)}formatWikilink(e){return e.startsWith('"[[')&&e.endsWith(']]"')?e:e.startsWith("[[")&&e.endsWith("]]")?`"${e}"`:`"[[${e}]]"`}formatBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"}return typeof e=="number"?e!==0:!!e}formatTimestamp(e){if(e instanceof Date)return Jc.DateFormatter.toLocalTimestamp(e);if(typeof e=="string"){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e.replace("Z","");let t=new Date(e);return isNaN(t.getTime())?e:Jc.DateFormatter.toLocalTimestamp(t)}if(typeof e=="number"){let t=new Date(e);if(!isNaN(t.getTime()))return Jc.DateFormatter.toLocalTimestamp(t)}return String(e)}};Xn.GenericAssetCreationService=f0;Xn.GenericAssetCreationService=f0=GN([(0,hb.injectable)(),HN(0,(0,hb.inject)(YN.DI_TOKENS.IVaultAdapter)),WN("design:paramtypes",[Object])],f0)});var p0=v(yn=>{"use strict";var KN=yn&&yn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XN=yn&&yn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(yn,"__esModule",{value:!0});yn.EmbeddingService=yn.DEFAULT_EMBEDDING_CONFIG=void 0;var JN=Ve(),db=la();yn.DEFAULT_EMBEDDING_CONFIG={provider:"openai",model:"text-embedding-3-small",timeout:3e4,maxTextLength:8e3};var d0=class{static{o(this,"EmbeddingService")}constructor(e={}){this.requestCount=0,this.tokenCount=0,this.config={...yn.DEFAULT_EMBEDDING_CONFIG,...e}}setConfig(e){this.config={...this.config,...e},db.LoggingService.debug(`EmbeddingService config updated: provider=${this.config.provider}, model=${this.config.model}`)}getConfig(){let{apiKey:e,...t}=this.config;return t}isConfigured(){return this.config.provider==="openai"?!!this.config.apiKey:!0}async generateEmbedding(e){if(!this.isConfigured())throw new Error("EmbeddingService is not properly configured");let t=this.truncateText(e);if(this.config.provider==="openai")return this.generateOpenAIEmbedding(t);throw new Error(`Unsupported embedding provider: ${this.config.provider}`)}async generateBatchEmbeddings(e){if(!this.isConfigured())throw new Error("EmbeddingService is not properly configured");if(e.length===0)return[];let t=[];if(this.config.provider==="openai"){let r=e.map(i=>this.truncateText(i.text));try{let i=await this.generateOpenAIBatchEmbeddings(r);for(let s=0;s<e.length;s++)t.push({id:e[s].id,result:i[s]??null})}catch(i){let s=i instanceof Error?i.message:"Unknown error";for(let a of e)t.push({id:a.id,result:null,error:s})}}else throw new Error(`Unsupported embedding provider: ${this.config.provider}`);return t}async generateOpenAIEmbedding(e){let t=await this.generateOpenAIBatchEmbeddings([e]);if(t.length===0||!t[0])throw new Error("Failed to generate embedding");return t[0]}async generateOpenAIBatchEmbeddings(e){let r=`${this.config.baseUrl||"https://api.openai.com/v1"}/embeddings`,i=new AbortController,s=setTimeout(()=>i.abort(),this.config.timeout??3e4);try{let a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({model:this.config.model||"text-embedding-3-small",input:e}),signal:i.signal});if(clearTimeout(s),!a.ok){let l=await a.text();throw new Error(`OpenAI API error: ${a.status} - ${l}`)}let c=await a.json();return this.requestCount++,this.tokenCount+=c.usage?.total_tokens||0,c.data.map(l=>({embedding:l.embedding,tokenCount:Math.round((c.usage?.total_tokens||0)/e.length),model:c.model}))}catch(a){throw clearTimeout(s),a instanceof Error&&a.name==="AbortError"?new Error("OpenAI API request timeout"):a}}truncateText(e){let t=this.config.maxTextLength??8e3;return e.length<=t?e:(db.LoggingService.debug(`Truncating text from ${e.length} to ${t} characters`),e.slice(0,t))}prepareTextForEmbedding(e,t){let r=[];if(t){let s=t.exo__Asset_label;typeof s=="string"&&s&&r.push(`Title: ${s}`);let a=t.exo__Instance_class;if(a){let c=Array.isArray(a)?a[0]:a;typeof c=="string"&&r.push(`Type: ${this.cleanWikiLink(c)}`)}}let i=this.cleanMarkdownContent(e);return i&&r.push(i),r.join(`
106
+ ---`)}};Yn.AssetConversionService=s0;Yn.AssetConversionService=s0=IN([(0,ob.injectable)(),PN(0,(0,ob.inject)(FN.DI_TOKENS.IVaultAdapter)),ON("design:paramtypes",[Object])],s0)});var c0=v(Kn=>{"use strict";var DN=Kn&&Kn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},NN=Kn&&Kn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},LN=Kn&&Kn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.SessionEventService=void 0;var lb=Ve(),MN=Ir(),ub=dr(),kN=nr(),jN=gn(),$N=ct(),o0=class{static{o(this,"SessionEventService")}constructor(e){this.vault=e,this.folderPathCache=null}async createSessionStartEvent(e){return this.createSessionEvent(e,ub.AssetClass.SESSION_START_EVENT)}async createSessionEndEvent(e){return this.createSessionEvent(e,ub.AssetClass.SESSION_END_EVENT)}getSessionEventFolder(){if(this.folderPathCache!==null)return this.folderPathCache;let e=this.vault.getDefaultNewFileParent();return this.folderPathCache=e?.path||"",this.folderPathCache}async createSessionEvent(e,t){let r=(0,MN.v4)(),i=kN.DateFormatter.toLocalTimestamp(new Date),s={exo__Asset_uid:r,exo__Asset_createdAt:i,exo__Asset_isDefinedBy:'"[[!kitelev]]"',exo__Instance_class:[`"[[${t}]]"`],ems__SessionEvent_timestamp:i,ems__Session_area:`"[[${e}]]"`},a=jN.MetadataHelpers.buildFileContent(s),c=this.getSessionEventFolder();c&&!await this.vault.exists(c)&&await this.vault.createFolder(c);let l=c?`${c}/${r}.md`:`${r}.md`;return await this.vault.create(l,a)}};Kn.SessionEventService=o0;Kn.SessionEventService=o0=DN([(0,lb.injectable)(),LN(0,(0,lb.inject)($N.DI_TOKENS.IVaultAdapter)),NN("design:paramtypes",[Object])],o0)});var u0=v(Xn=>{"use strict";var VN=Xn&&Xn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},UN=Xn&&Xn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},BN=Xn&&Xn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.URIConstructionService=void 0;var fb=Ve(),qN=ct(),l0=class{static{o(this,"URIConstructionService")}constructor(e){this.fileSystem=e,this.defaultOntologyURL="https://exocortex.my/default/",this.strictValidation=!0}configure(e){e?.defaultOntologyURL&&(this.defaultOntologyURL=e.defaultOntologyURL),e?.strictValidation!==void 0&&(this.strictValidation=e.strictValidation)}async constructAssetURI(e){let t=this.extractUID(e);if(!t){if(this.strictValidation)throw new Error(`Asset missing exo__Asset_uid: ${e.path}`);return console.warn(`Asset ${e.path} missing UID, using filename fallback`),this.constructFallbackURI(e)}let r=await this.resolveOntologyURL(e);if(!this.validateOntologyURL(r))throw new Error(`Invalid ontology URL: ${r}`);return`${r.endsWith("/")?r:`${r}/`}${t}`}validateOntologyURL(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}async resolveOntologyURL(e){let t=e.frontmatter?.exo__Asset_isDefinedBy;if(!t)return this.defaultOntologyURL;let r=this.extractWikiLink(t),i=r,s=await this.fileSystem.fileExists(r);return!s&&!r.endsWith(".md")&&(i=`${r}.md`,s=await this.fileSystem.fileExists(i)),s?(await this.fileSystem.getFileMetadata(i))?.exo__Ontology_url||this.defaultOntologyURL:(console.warn(`Ontology file not found: ${r}, using default`),this.defaultOntologyURL)}extractUID(e){return e.frontmatter?.exo__Asset_uid||null}extractWikiLink(e){return e.replace(/^\[\[|\]\]$/g,"")}constructFallbackURI(e){let t=e.path.split("/").pop()?.replace(".md","")||"unknown";return`${this.defaultOntologyURL}${t}`}};Xn.URIConstructionService=l0;Xn.URIConstructionService=l0=VN([(0,fb.injectable)(),BN(0,(0,fb.inject)(qN.DI_TOKENS.IFileSystemAdapter)),UN("design:paramtypes",[Object])],l0)});var h0=v(Jn=>{"use strict";var GN=Jn&&Jn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},WN=Jn&&Jn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},HN=Jn&&Jn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.GenericAssetCreationService=void 0;var hb=Ve(),zN=Ir(),Jc=nr(),QN=gn(),YN=ct(),bi=Lm(),f0=class{static{o(this,"GenericAssetCreationService")}constructor(e){this.vault=e}async createAsset(e,t){let r=(0,zN.v4)(),i=`${r}.md`,s=this.generateFrontmatter(e,t||[],r),a=QN.MetadataHelpers.buildFileContent(s),c=e.folderPath||this.getDefaultFolderPath(e);this.vault.getAbstractFileByPath(c)||await this.vault.createFolder(c);let u=c?`${c}/${i}`:i;return await this.vault.create(u,a)}generateFrontmatter(e,t,r){let i=new Date,s={},a=new Map;for(let c of t)a.set(c.name,c.fieldType);if(s.exo__Asset_uid=r,s.exo__Asset_createdAt=Jc.DateFormatter.toLocalTimestamp(i),s.exo__Instance_class=[this.formatWikilink(e.className)],e.label&&e.label.trim()!==""){let c=e.label.trim();s.exo__Asset_label=c,s.aliases=[c]}if(e.parentFile&&e.parentMetadata&&this.inheritParentContext(s,e),e.propertyValues)for(let[c,l]of Object.entries(e.propertyValues)){if(c==="exo__Asset_uid"||c==="exo__Asset_createdAt"||c==="exo__Instance_class"||c==="exo__Asset_label"||c==="aliases"||l==null)continue;let u=a.get(c);s[c]=this.formatValue(l,u)}return s}inheritParentContext(e,t){let r=t.parentMetadata||{},i=t.parentFile?.basename;if((t.className==="ems__Task"||t.className.startsWith("ems__Task"))&&(e.ems__Effort_parent=i?this.formatWikilink(i):null),t.className==="ems__Project"||t.className.startsWith("ems__Project")){let s=r.exo__Instance_class;this.isAreaClass(s)&&(e.ems__Project_area=i?this.formatWikilink(i):null)}r.exo__Asset_isDefinedBy&&(e.exo__Asset_isDefinedBy=r.exo__Asset_isDefinedBy)}isAreaClass(e){return e?(Array.isArray(e)?e:[e]).some(r=>String(r).includes("Area")||String(r).includes("ems__Area")):!1}getDefaultFolderPath(e){if(e.parentFile?.parent?.path)return e.parentFile.parent.path;let t={ems__Task:"tasks",ems__Project:"projects",ems__Area:"areas",ems__Meeting:"meetings",exo__Event:"events",ims__Concept:"concepts"};if(t[e.className])return t[e.className];for(let[r,i]of Object.entries(t))if(e.className.startsWith(r))return i;return"assets"}formatValue(e,t){if(e==null)return null;if(!t)return this.formatInferredValue(e);switch(t){case bi.PropertyFieldType.Text:return String(e);case bi.PropertyFieldType.Wikilink:case bi.PropertyFieldType.Reference:case bi.PropertyFieldType.StatusSelect:case bi.PropertyFieldType.SizeSelect:return this.formatWikilink(String(e));case bi.PropertyFieldType.Number:return typeof e=="number"?e:Number(e)||0;case bi.PropertyFieldType.Boolean:return this.formatBoolean(e);case bi.PropertyFieldType.Date:case bi.PropertyFieldType.DateTime:case bi.PropertyFieldType.Timestamp:return this.formatTimestamp(e);default:return String(e)}}formatInferredValue(e){return typeof e=="boolean"||typeof e=="number"?e:e instanceof Date?Jc.DateFormatter.toLocalTimestamp(e):typeof e=="string"?e.startsWith("[[")||e.startsWith('"[[')?this.formatWikilink(e):e:String(e)}formatWikilink(e){return e.startsWith('"[[')&&e.endsWith(']]"')?e:e.startsWith("[[")&&e.endsWith("]]")?`"${e}"`:`"[[${e}]]"`}formatBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"}return typeof e=="number"?e!==0:!!e}formatTimestamp(e){if(e instanceof Date)return Jc.DateFormatter.toLocalTimestamp(e);if(typeof e=="string"){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))return e;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e.replace("Z","");let t=new Date(e);return isNaN(t.getTime())?e:Jc.DateFormatter.toLocalTimestamp(t)}if(typeof e=="number"){let t=new Date(e);if(!isNaN(t.getTime()))return Jc.DateFormatter.toLocalTimestamp(t)}return String(e)}};Jn.GenericAssetCreationService=f0;Jn.GenericAssetCreationService=f0=GN([(0,hb.injectable)(),HN(0,(0,hb.inject)(YN.DI_TOKENS.IVaultAdapter)),WN("design:paramtypes",[Object])],f0)});var p0=v(yn=>{"use strict";var KN=yn&&yn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XN=yn&&yn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(yn,"__esModule",{value:!0});yn.EmbeddingService=yn.DEFAULT_EMBEDDING_CONFIG=void 0;var JN=Ve(),db=la();yn.DEFAULT_EMBEDDING_CONFIG={provider:"openai",model:"text-embedding-3-small",timeout:3e4,maxTextLength:8e3};var d0=class{static{o(this,"EmbeddingService")}constructor(e={}){this.requestCount=0,this.tokenCount=0,this.config={...yn.DEFAULT_EMBEDDING_CONFIG,...e}}setConfig(e){this.config={...this.config,...e},db.LoggingService.debug(`EmbeddingService config updated: provider=${this.config.provider}, model=${this.config.model}`)}getConfig(){let{apiKey:e,...t}=this.config;return t}isConfigured(){return this.config.provider==="openai"?!!this.config.apiKey:!0}async generateEmbedding(e){if(!this.isConfigured())throw new Error("EmbeddingService is not properly configured");let t=this.truncateText(e);if(this.config.provider==="openai")return this.generateOpenAIEmbedding(t);throw new Error(`Unsupported embedding provider: ${this.config.provider}`)}async generateBatchEmbeddings(e){if(!this.isConfigured())throw new Error("EmbeddingService is not properly configured");if(e.length===0)return[];let t=[];if(this.config.provider==="openai"){let r=e.map(i=>this.truncateText(i.text));try{let i=await this.generateOpenAIBatchEmbeddings(r);for(let s=0;s<e.length;s++)t.push({id:e[s].id,result:i[s]??null})}catch(i){let s=i instanceof Error?i.message:"Unknown error";for(let a of e)t.push({id:a.id,result:null,error:s})}}else throw new Error(`Unsupported embedding provider: ${this.config.provider}`);return t}async generateOpenAIEmbedding(e){let t=await this.generateOpenAIBatchEmbeddings([e]);if(t.length===0||!t[0])throw new Error("Failed to generate embedding");return t[0]}async generateOpenAIBatchEmbeddings(e){let r=`${this.config.baseUrl||"https://api.openai.com/v1"}/embeddings`,i=new AbortController,s=setTimeout(()=>i.abort(),this.config.timeout??3e4);try{let a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify({model:this.config.model||"text-embedding-3-small",input:e}),signal:i.signal});if(clearTimeout(s),!a.ok){let l=await a.text();throw new Error(`OpenAI API error: ${a.status} - ${l}`)}let c=await a.json();return this.requestCount++,this.tokenCount+=c.usage?.total_tokens||0,c.data.map(l=>({embedding:l.embedding,tokenCount:Math.round((c.usage?.total_tokens||0)/e.length),model:c.model}))}catch(a){throw clearTimeout(s),a instanceof Error&&a.name==="AbortError"?new Error("OpenAI API request timeout"):a}}truncateText(e){let t=this.config.maxTextLength??8e3;return e.length<=t?e:(db.LoggingService.debug(`Truncating text from ${e.length} to ${t} characters`),e.slice(0,t))}prepareTextForEmbedding(e,t){let r=[];if(t){let s=t.exo__Asset_label;typeof s=="string"&&s&&r.push(`Title: ${s}`);let a=t.exo__Instance_class;if(a){let c=Array.isArray(a)?a[0]:a;typeof c=="string"&&r.push(`Type: ${this.cleanWikiLink(c)}`)}}let i=this.cleanMarkdownContent(e);return i&&r.push(i),r.join(`
107
107
 
108
108
  `)}cleanMarkdownContent(e){let t=e.replace(/^---[\s\S]*?---\n*/m,"").replace(/```[\s\S]*?```/g,r=>r.replace(/```\w*\n?|\n?```/g,"")).replace(/`([^`]+)`/g,"$1").replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(r,i,s)=>s||i).replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[[^\]]*\]\([^)]+\)/g,"").replace(/^---+$/gm,"");return t=this.removeHtmlTags(t),t.replace(/\n{3,}/g,`
109
109
 
@@ -260,17 +260,17 @@ SELECT ?s ?label ?class WHERE {
260
260
  FILTER NOT EXISTS { ?s exo:Asset_deprecatedBy ?newer }
261
261
  }
262
262
  ORDER BY ?label
263
- LIMIT ${this.config.defaultLimit}`,s="\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0442\u043E\u0447\u043D\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0442\u0438\u043F \u0437\u0430\u043F\u0440\u043E\u0441\u0430. \u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u043E\u0438\u0441\u043A \u043F\u043E \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u043C\u0443 \u0441\u043B\u043E\u0432\u0443.";return t?.template&&t?.missingParams&&(s+=` \u0414\u043B\u044F \u0448\u0430\u0431\u043B\u043E\u043D\u0430 "${t.template.name}" \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432: ${t.missingParams.join(", ")}.`),{query:i,templateName:null,parameters:{keyword:r},confidence:.3,explanation:s,isFallback:!0,alternatives:[]}}calculateConfidence(e,t,r){let i=.5;for(let c of t.keywords)e.includes(c.toLowerCase())&&(i+=.1);let s=t.parameters.filter(c=>c.required),a=s.filter(c=>r[c.name]&&r[c.name].length>0);s.length>0?i+=a.length/s.length*.2:i+=.2;for(let[c]of Object.entries(this.prototypeMapping))if(e.includes(c)){i+=.1;break}return Math.min(i,1)}generateExplanation(e,t){let r=e.description;return Object.keys(t).length>0&&(r+=". \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B: ",r+=Object.entries(t).filter(([,i])=>i&&i.length>0).map(([i,s])=>`${i}="${s}"`).join(", ")),r}getAvailableTemplates(){return[...lt.SPARQL_TEMPLATES]}getTemplate(e){return(0,lt.getTemplateByName)(e)}setConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}addTemplate(e){lt.SPARQL_TEMPLATES.push(e),y4.LoggingService.debug(`Added custom template: ${e.name}`)}getSuggestions(e){let t=[];return(e.includes("\u0441\u043A\u043E\u043B\u044C\u043A\u043E")||e.includes("\u0441\u0440\u0435\u0434\u043D")||e.includes("\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A"))&&!e.match(/\b20\d{2}\b/)&&!this.containsMonth(e)&&t.push("\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: '\u0437\u0430 \u0434\u0435\u043A\u0430\u0431\u0440\u044C' \u0438\u043B\u0438 '\u0437\u0430 2025-12')"),(e.includes("\u0437\u0430\u0434\u0430\u0447")||e.includes("\u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442"))&&t.push("\u0414\u043B\u044F \u0442\u043E\u0447\u043D\u043E\u0433\u043E \u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 UUID \u043F\u0440\u043E\u0442\u043E\u0442\u0438\u043F\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F"),e.length<10&&t.push("\u0423\u0442\u043E\u0447\u043D\u0438\u0442\u0435 \u0437\u0430\u043F\u0440\u043E\u0441: \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u0442\u0438\u043F \u0434\u0430\u043D\u043D\u044B\u0445"),t}containsMonth(e){return Object.keys(this.monthNames).some(t=>e.includes(t))}};Sn.NLToSPARQLService=w0;Sn.NLToSPARQLService=w0=p4([(0,g4.injectable)(),m4("design:paramtypes",[Object])],w0)});var bb=v(Jn=>{"use strict";var v4=Jn&&Jn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},_4=Jn&&Jn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},S4=Jn&&Jn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.AnalyticsService=void 0;var Sb=Ve(),b4=ct(),w4=nr(),E4=Ki(),E0=class{static{o(this,"AnalyticsService")}constructor(e){this.vault=e,this.frontmatterService=new E4.FrontmatterService}getDefaultPeriod(){let e=new Date,t=new Date;return t.setDate(t.getDate()-30),{startDate:t,endDate:e}}async getEffortsInPeriod(e,t){let i=this.vault.getAllFiles().filter(a=>a.path.endsWith(".md")),s=[];for(let a of i)try{let c=await this.vault.read(a),l=this.extractEffortData(a,c);if(!l)continue;if(l.startTimestamp){if(l.startTimestamp<e.startDate||l.startTimestamp>e.endDate)continue}else continue;if(t?.prototypeUri&&l.prototypeUri!==t.prototypeUri||t?.labelContains&&!l.label.toLowerCase().includes(t.labelContains.toLowerCase())||t?.status&&l.status&&!t.status.includes(l.status))continue;s.push(l)}catch{continue}return s}extractEffortData(e,t){let r=this.frontmatterService.parse(t);if(!r.exists)return null;let i=this.frontmatterService.getPropertyValue(r.content,"exo__Asset_label");if(!i)return null;let s=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_status"),a=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_startTimestamp"),c=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_endTimestamp"),l=this.frontmatterService.getPropertyValue(r.content,"exo__Asset_prototype"),u=this.extractInstanceClass(r.content);return{path:e.path,label:this.cleanWikiLink(i),status:s?this.cleanWikiLink(s):null,startTimestamp:a?this.parseTimestamp(a):null,endTimestamp:c?this.parseTimestamp(c):null,prototypeUri:l?this.cleanWikiLink(l):null,instanceClass:u}}extractInstanceClass(e){let t=e.match(/exo__Instance_class:\s*\n((?:\s*-\s*.*\n?)+)/);if(t)return t[1].split(`
264
- `).filter(s=>s.trim()).map(s=>this.cleanWikiLink(s.replace(/^\s*-\s*/,"").trim()));let r=this.frontmatterService.getPropertyValue(e,"exo__Instance_class");return r?this.cleanWikiLink(r):null}cleanWikiLink(e){return e.replace(/^\[\[/,"").replace(/\]\]$/,"").replace(/^"/,"").replace(/"$/,"")}parseTimestamp(e){if(!e)return null;let t=e.replace(/^"/,"").replace(/"$/,""),r=new Date(t);return isNaN(r.getTime())?null:r}calculateDurationStats(e){let t=e.filter(f=>f.startTimestamp&&f.endTimestamp).map(f=>(f.endTimestamp.getTime()-f.startTimestamp.getTime())/6e4).filter(f=>f>0);if(t.length===0)return{count:0,totalMinutes:0,averageMinutes:0,minMinutes:0,maxMinutes:0,stdDevMinutes:0};let r=t.reduce((f,h)=>f+h,0),i=r/t.length,s=Math.min(...t),a=Math.max(...t),l=t.map(f=>Math.pow(f-i,2)).reduce((f,h)=>f+h,0)/t.length,u=Math.sqrt(l);return{count:t.length,totalMinutes:Math.round(r),averageMinutes:Math.round(i*10)/10,minMinutes:Math.round(s),maxMinutes:Math.round(a),stdDevMinutes:Math.round(u*10)/10}}calculateDailyAggregates(e){let t=new Map;for(let r of e){if(!r.startTimestamp)continue;let i=w4.DateFormatter.toDateString(r.startTimestamp);t.has(i)||t.set(i,{count:0,totalMinutes:0});let s=t.get(i);if(s.count++,r.endTimestamp){let a=r.endTimestamp.getTime()-r.startTimestamp.getTime();s.totalMinutes+=a/6e4}}return Array.from(t.entries()).map(([r,i])=>({date:r,count:i.count,totalMinutes:Math.round(i.totalMinutes),averageMinutes:i.count>0?Math.round(i.totalMinutes/i.count*10)/10:0})).sort((r,i)=>r.date.localeCompare(i.date))}calculateHourlyDistribution(e){let t=new Array(24).fill(0);for(let i of e){if(!i.startTimestamp)continue;let s=i.startTimestamp.getHours();t[s]++}let r=t.reduce((i,s)=>i+s,0);return t.map((i,s)=>({hour:s,count:i,percentage:r>0?Math.round(i/r*1e3)/10:0}))}calculateWeekdayDistribution(e){let t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=new Array(7).fill(0);for(let s of e){if(!s.startTimestamp)continue;let a=s.startTimestamp.getDay();r[a]++}let i=r.reduce((s,a)=>s+a,0);return r.map((s,a)=>({dayOfWeek:a,dayName:t[a],count:s,percentage:i>0?Math.round(s/i*1e3)/10:0}))}async analyzeSleep(e=this.getDefaultPeriod()){let t=await this.getEffortsInPeriod(e,{labelContains:"\u041F\u043E\u0441\u043F\u0430\u0442\u044C"}),r=this.calculateDurationStats(t),i=this.calculateDailyAggregates(t),s=[],a=[];for(let h of t){if(h.startTimestamp){let d=h.startTimestamp.getHours()*60+h.startTimestamp.getMinutes();s.push(d<360?d+1440:d)}if(h.endTimestamp){let d=h.endTimestamp.getHours()*60+h.endTimestamp.getMinutes();a.push(d)}}let c=s.length>0?s.reduce((h,d)=>h+d,0)/s.length:0,l=a.length>0?a.reduce((h,d)=>h+d,0)/a.length:0,u=s.length>1?Math.sqrt(s.map(h=>Math.pow(h-c,2)).reduce((h,d)=>h+d,0)/s.length):0,f=a.length>1?Math.sqrt(a.map(h=>Math.pow(h-l,2)).reduce((h,d)=>h+d,0)/a.length):0;return{period:e,stats:r,dailyData:i,averageBedtime:this.minutesToTimeString(c%1440),averageWakeTime:this.minutesToTimeString(l),bedtimeVariabilityMinutes:Math.round(u),wakeTimeVariabilityMinutes:Math.round(f)}}minutesToTimeString(e){let t=Math.floor(e/60),r=Math.round(e%60);return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`}async analyzeTaskCompletion(e=this.getDefaultPeriod()){let r=(await this.getEffortsInPeriod(e)).filter(u=>Array.isArray(u.instanceClass)?u.instanceClass.some(f=>f.includes("ems__Task")):u.instanceClass?.includes("ems__Task")??!1),i=r.filter(u=>u.status?.includes("ems__EffortStatusDone")),s=r.filter(u=>u.status?.includes("ems__EffortStatusTrashed")),a=i.filter(u=>u.startTimestamp&&u.endTimestamp).map(u=>(u.endTimestamp.getTime()-u.startTimestamp.getTime())/6e4),c=a.length>0?a.reduce((u,f)=>u+f,0)/a.length:0,l=this.calculateDailyAggregates(i);return{period:e,totalTasks:r.length,completedTasks:i.length,trashedTasks:s.length,completionRate:r.length>0?Math.round(i.length/r.length*1e3)/10:0,averageCompletionTimeMinutes:Math.round(c*10)/10,dailyCompletions:l}}async analyzeActivityFrequency(e,t=this.getDefaultPeriod()){let r=await this.getEffortsInPeriod(t,{labelContains:e}),i=this.calculateDurationStats(r),s=this.calculateDailyAggregates(r),a=this.calculateHourlyDistribution(r),c=this.calculateWeekdayDistribution(r);return{activityLabel:e,period:t,stats:i,dailyData:s,hourlyDistribution:a,weekdayDistribution:c}}async getActivitySummary(e=this.getDefaultPeriod()){let t=await this.getEffortsInPeriod(e),r=new Map;for(let s of t){let a=s.label.split(" ")[0];r.has(a)||r.set(a,[]),r.get(a).push(s)}let i=new Map;for(let[s,a]of r)i.set(s,this.calculateDurationStats(a));return i}};Jn.AnalyticsService=E0;Jn.AnalyticsService=E0=v4([(0,Sb.injectable)(),S4(0,(0,Sb.inject)(b4.DI_TOKENS.IVaultAdapter)),_4("design:paramtypes",[Object])],E0)});var wb=v(fa=>{"use strict";var T4=fa&&fa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(fa,"__esModule",{value:!0});fa.TrendDetectionService=void 0;var x4=Ve(),T0=class{static{o(this,"TrendDetectionService")}constructor(){this.TREND_THRESHOLD=.05,this.ANOMALY_THRESHOLD_STD=2,this.STRONG_CORRELATION_THRESHOLD=.7,this.MODERATE_CORRELATION_THRESHOLD=.4}analyzeTrend(e,t="averageMinutes"){if(e.length<3)return{direction:"stable",strength:"none",slope:0,rSquared:0,changePercentage:0,insight:"Insufficient data for trend analysis (need at least 3 data points)"};let r=e.map(d=>d[t]),{slope:i,rSquared:s}=this.linearRegression(r),a=r[0]||1,l=((r[r.length-1]||0)-a)/a*100,u;Math.abs(l)<this.TREND_THRESHOLD*100?u="stable":i>0?u="increasing":u="decreasing";let f;s>=.7?f="strong":s>=.4?f="moderate":s>=.2?f="weak":f="none";let h=this.generateTrendInsight(u,f,l);return{direction:u,strength:f,slope:Math.round(i*100)/100,rSquared:Math.round(s*100)/100,changePercentage:Math.round(l*10)/10,insight:h}}linearRegression(e){let t=e.length;if(t===0)return{slope:0,intercept:0,rSquared:0};let r=(t-1)/2,i=e.reduce((d,p)=>d+p,0)/t,s=0,a=0;for(let d=0;d<t;d++)s+=(d-r)*(e[d]-i),a+=Math.pow(d-r,2);let c=a!==0?s/a:0,l=i-c*r,u=0,f=0;for(let d=0;d<t;d++){let p=l+c*d;u+=Math.pow(e[d]-p,2),f+=Math.pow(e[d]-i,2)}let h=f!==0?1-u/f:0;return{slope:c,intercept:l,rSquared:Math.max(0,h)}}generateTrendInsight(e,t,r){if(t==="none"||e==="stable")return"Metric is relatively stable with no significant trend.";let i=t==="strong"?"clearly":t==="moderate"?"moderately":"slightly",s=e==="increasing"?"increasing":"decreasing",a=`${Math.abs(Math.round(r))}%`;return`Metric is ${i} ${s} (${a} change over the period).`}detectAnomalies(e,t="averageMinutes"){if(e.length<5)return[];let r=e.map(c=>c[t]),{mean:i,stdDev:s}=this.calculateStats(r),a=[];for(let c=0;c<e.length;c++){let l=r[c],u=(l-i)/(s||1);if(Math.abs(u)>=this.ANOMALY_THRESHOLD_STD){let f=this.determineAnomalySeverity(u),h=this.determineAnomalyType(u,l,i);a.push({date:e[c].date,value:l,expectedValue:Math.round(i*10)/10,deviation:Math.round(u*100)/100,severity:f,type:h,description:this.generateAnomalyDescription(h,f,u,l,i)})}}return a}calculateStats(e){if(e.length===0)return{mean:0,stdDev:0};let t=e.reduce((a,c)=>a+c,0)/e.length,i=e.map(a=>Math.pow(a-t,2)).reduce((a,c)=>a+c,0)/e.length,s=Math.sqrt(i);return{mean:t,stdDev:s}}determineAnomalySeverity(e){let t=Math.abs(e);return t>=3?"critical":t>=2.5?"warning":"info"}determineAnomalyType(e,t,r){return t>r&&e>0?"spike":t<r&&e<0?"drop":"outlier"}generateAnomalyDescription(e,t,r,i,s){let a=t==="critical"?"Significant":t==="warning"?"Notable":"Minor",c=e==="spike"?"spike":e==="drop"?"drop":"unusual value",l=Math.round((i-s)/s*100);return`${a} ${c} detected: ${Math.round(i)} (${l>0?"+":""}${l}% from average of ${Math.round(s)}, ${r.toFixed(1)}\u03C3 from mean).`}calculateCorrelation(e,t,r,i){let s=Math.min(e.length,t.length);if(s<5)return{metric1:r,metric2:i,coefficient:0,strength:"none",direction:"none",insight:"Insufficient data for correlation analysis."};let{mean:a,stdDev:c}=this.calculateStats(e.slice(0,s)),{mean:l,stdDev:u}=this.calculateStats(t.slice(0,s));if(c===0||u===0)return{metric1:r,metric2:i,coefficient:0,strength:"none",direction:"none",insight:"One or both metrics have no variation."};let f=0;for(let E=0;E<s;E++)f+=(e[E]-a)/c*((t[E]-l)/u);let h=f/s,d=Math.abs(h),p;d>=this.STRONG_CORRELATION_THRESHOLD?p="strong":d>=this.MODERATE_CORRELATION_THRESHOLD?p="moderate":d>=.2?p="weak":p="none";let _=p==="none"?"none":h>0?"positive":"negative",S=this.generateCorrelationInsight(r,i,h,p,_);return{metric1:r,metric2:i,coefficient:Math.round(h*100)/100,strength:p,direction:_,insight:S}}generateCorrelationInsight(e,t,r,i,s){if(i==="none")return`No significant correlation found between ${e} and ${t}.`;let a=i==="strong"?"strongly":i==="moderate"?"moderately":"weakly",c=s==="positive"?"When one increases, the other tends to increase":"When one increases, the other tends to decrease";return`${e} and ${t} are ${a} ${s}ly correlated (r=${r.toFixed(2)}). ${c}.`}analyzeWeeklyPattern(e,t="averageMinutes"){let r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i={};for(let l of e){let f=new Date(l.date).getDay();i[f]||(i[f]=[]),i[f].push(l[t])}let s=[],a=0,c=1/0;for(let l=0;l<7;l++){let u=i[l]||[],{mean:f,stdDev:h}=this.calculateStats(u);f>a&&(a=f),f<c&&u.length>0&&(c=f),s.push({dayOfWeek:l,dayName:r[l],averageValue:Math.round(f*10)/10,deviation:Math.round(h*10)/10,isHighPoint:!1,isLowPoint:!1})}for(let l of s)l.averageValue===a&&a>0&&(l.isHighPoint=!0),l.averageValue===c&&c!==1/0&&(l.isLowPoint=!0);return s}generateInsights(e,t,r,i,s){let a=[];t.strength!=="none"&&t.direction!=="stable"&&a.push({type:"trend",severity:t.direction==="decreasing"?"warning":"info",title:`${s} is ${t.direction}`,description:t.insight,metric:s,value:t.changePercentage,actionable:t.direction==="decreasing"});let c=r.filter(f=>f.severity==="critical");if(c.length>0)for(let f of c)a.push({type:"anomaly",severity:"critical",title:`Unusual ${f.type} detected on ${f.date}`,description:f.description,metric:s,value:f.value,actionable:!0});let l=i.filter(f=>f.isHighPoint).map(f=>f.dayName),u=i.filter(f=>f.isLowPoint).map(f=>f.dayName);return l.length>0&&u.length>0&&a.push({type:"pattern",severity:"info",title:"Weekly pattern detected",description:`${s} tends to be highest on ${l.join(", ")} and lowest on ${u.join(", ")}.`,metric:s,actionable:!1}),e.stdDevMinutes>e.averageMinutes*.5&&a.push({type:"recommendation",severity:"warning",title:"High variability detected",description:`${s} shows high variability (std dev: ${e.stdDevMinutes} min). Consider maintaining a more consistent schedule.`,metric:s,value:e.stdDevMinutes,actionable:!0}),a}detectSuddenChanges(e,t="averageMinutes",r=50){let i=[];for(let s=1;s<e.length;s++){let a=e[s-1][t],c=e[s][t];if(a===0)continue;let l=(c-a)/a*100;Math.abs(l)>=r&&i.push({date:e[s].date,previousValue:a,currentValue:c,changePercent:Math.round(l*10)/10})}return i}};fa.TrendDetectionService=T0;fa.TrendDetectionService=T0=T4([(0,x4.injectable)()],T0)});var Tb=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.AutocompleteService=ha.DEFAULT_AUTOCOMPLETE_CONFIG=void 0;var kf=hn(),tl=Ye(),Eb=mt();ha.DEFAULT_AUTOCOMPLETE_CONFIG={limit:10,activeBoost:20,recencyBoost:10,recencyDays:7};var x0=class{static{o(this,"AutocompleteService")}constructor(e,t){this.tripleStore=e,this.config={...ha.DEFAULT_AUTOCOMPLETE_CONFIG,...t}}async getSuggestions(e,t,r){let i={...this.config,...r},s=await this.getPropertyRange(e);if(s.length===0){let l=this.inferClassFromProperty(e);l&&s.push(l)}let a=[];for(let l of s){let u=await this.getAssetsOfClass(l);a.push(...u)}return a.map(l=>({...l,matchScore:this.calculateMatchScore(l,t,i)})).filter(l=>l.matchScore>0).sort((l,u)=>u.matchScore-l.matchScore).slice(0,i.limit)}async getSuggestionsByClass(e,t,r){let i={...this.config,...r},s=[];for(let c of e){let l=await this.getAssetsOfClass(c);s.push(...l)}return s.map(c=>({...c,matchScore:this.calculateMatchScore(c,t,i)})).filter(c=>c.matchScore>0).sort((c,l)=>l.matchScore-c.matchScore).slice(0,i.limit)}async getPropertyRange(e){let t=this.toFullIri(e),r=[],i=await this.tripleStore.match(new tl.IRI(t),kf.Namespace.RDFS.term("range"),void 0);for(let s of i)if(s.object instanceof tl.IRI){let a=this.toClassName(s.object.value);a&&r.push(a)}return r}async getAssetsOfClass(e){let t=this.toFullIri(e),r=[],i=await this.tripleStore.match(void 0,kf.Namespace.RDF.term("type"),new tl.IRI(t));for(let s of i)if(s.subject instanceof tl.IRI){let a=await this.buildSuggestion(s.subject,e);a&&r.push(a)}return r}async buildSuggestion(e,t){let r=await this.tripleStore.match(e,kf.Namespace.EXO.term("Asset_label"),void 0),i="";for(let c of r)if(c.object instanceof Eb.Literal){i=c.object.value;break}if(i||(i=this.extractLabelFromUri(e.value)),!i)return null;let s=await this.checkIfActive(e),a=this.extractPathFromUri(e.value);return{label:i,uri:e.value,path:a,assetClass:t,isActive:s,matchScore:0}}async checkIfActive(e){let t=await this.tripleStore.match(e,kf.Namespace.EMS.term("Effort_status"),void 0);for(let r of t){let i=r.object instanceof Eb.Literal||r.object instanceof tl.IRI?r.object.value:"";if(i.includes("Active")||i.includes("EffortStatus_Active"))return!0}return!1}calculateMatchScore(e,t,r){if(!t||t.length===0)return e.isActive?100+r.activeBoost:100;let i=e.label.toLowerCase(),s=t.toLowerCase(),a=0;if(i===s)a=100;else if(i.startsWith(s))a=80;else if(i.includes(s))a=60;else if(this.fuzzyMatch(s,i))a=40;else return 0;if(e.isActive&&(a+=r.activeBoost),e.lastModified){let c=(Date.now()-e.lastModified)/864e5;c<=r.recencyDays&&(a+=r.recencyBoost*(1-c/r.recencyDays))}return a}fuzzyMatch(e,t){let r=0;for(let i=0;i<t.length&&r<e.length;i++)t[i]===e[r]&&r++;return r===e.length}inferClassFromProperty(e){let t=e.toLowerCase();return t.includes("project")?"ems__Project":t.includes("area")?"ems__Area":t.includes("task")?"ems__Task":t.includes("effort")?"ems__Effort":null}toFullIri(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;let t=e.match(/^([a-z]+)__(.+)$/);if(t){let[,r,i]=t;switch(r){case"ems":return`https://exocortex.my/ontology/ems#${i}`;case"exo":return`https://exocortex.my/ontology/exo#${i}`;default:return`https://exocortex.my/ontology/${r}#${i}`}}return e}toClassName(e){let t=e.match(/https:\/\/exocortex\.my\/ontology\/([a-z]+)#(.+)$/);if(t){let[,r,i]=t;return`${r}__${i}`}return null}extractLabelFromUri(e){if(e.startsWith("obsidian://")){let r=decodeURIComponent(e),i=r.lastIndexOf("/");if(i>=0){let s=r.substring(i+1);return s.endsWith(".md")&&(s=s.substring(0,s.length-3)),s}}let t=e.lastIndexOf("/");if(t>=0){let r=e.substring(t+1);return r.endsWith(".md")&&(r=r.substring(0,r.length-3)),r}return""}extractPathFromUri(e){if(e.startsWith("obsidian://vault/")){let t=decodeURIComponent(e.substring(17)),r=t.indexOf("/");return r>=0?t.substring(r+1):t}return e}};ha.AutocompleteService=x0});var Ab=v(Zn=>{"use strict";var A4=Zn&&Zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},C4=Zn&&Zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},I4=Zn&&Zn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.DailyReviewService=void 0;var xb=Ve(),O4=ct(),ro=nr(),P4=Ki(),R4=Cr(),A0=class{static{o(this,"DailyReviewService")}constructor(e){this.vault=e,this.frontmatterService=new P4.FrontmatterService}async getPractices(){let e=this.vault.getAllFiles(),t=[],r=ro.DateFormatter.toDateString(new Date);for(let i of e)if(i.path.endsWith(".md"))try{let s=await this.vault.read(i),a=this.frontmatterService.parse(s);if(!a.exists)continue;let c=this.frontmatterService.getPropertyValue(a.content,"exo__Instance_class");if(!this.isTaskPrototype(c))continue;let l=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_uid");if(!l)continue;let u=l.replace(/"/g,""),f=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_label");if(!f)continue;let h=f.replace(/"/g,""),p=this.frontmatterService.getPropertyValue(a.content,"ems__Recurring_rule")?.replace(/"/g,"")||null,_=this.frontmatterService.getPropertyValue(a.content,"ems__Task_estimatedDuration"),S=null;if(_){let A=parseInt(_,10);isNaN(A)||(S=A)}let E=await this.findTodayInstance(u,r);t.push({uid:u,label:h,path:i.path,recurringRule:p,estimatedDuration:S,doneToday:E?.status==="done",inProgressToday:E?.status==="doing",todayInstancePath:E?.path||null})}catch{continue}return t.sort((i,s)=>i.label.localeCompare(s.label))}async getDailyReviewSummary(e){let t=e||new Date,r=ro.DateFormatter.toDateString(t),i=new Date(t);i.setHours(0,0,0,0);let s=new Date(t);s.setHours(23,59,59,999);let a=this.vault.getAllFiles(),c=0,l=0,u=0,f=0;for(let _ of a)if(_.path.endsWith(".md"))try{let S=await this.vault.read(_),E=this.frontmatterService.parse(S);if(!E.exists)continue;let A=this.frontmatterService.getPropertyValue(E.content,"exo__Instance_class");if(!this.isTask(A))continue;let C=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_plannedStartTimestamp"),k=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_startTimestamp"),G=k?new Date(k):null,Q=C?new Date(C):null;if(!(Q&&Q>=i&&Q<=s||G&&G>=i&&G<=s))continue;c++;let re=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_status");if(this.isDoneStatus(re)){l++;let Ie=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_endTimestamp");if(k&&Ie){let N=this.calculateDurationMinutes(k,Ie);f+=N}}else this.isDoingStatus(re)&&u++}catch{continue}let d=(await this.getPractices()).filter(_=>!_.doneToday&&_.recurringRule),p=c>0?Math.round(l/c*100):0;return{date:r,plannedCount:c,completedCount:l,inProgressCount:u,practicesDue:d,completionPercentage:p,totalTimeMinutes:Math.round(f)}}async quickCapture(e,t=!0,r){let i=(0,R4.v4)(),s=ro.DateFormatter.toISOTimestamp(new Date),a=`${i}.md`,c="03 Knowledge/kitelev",l=["---",`exo__Asset_uid: "${i}"`,`exo__Asset_label: "${e}"`,'exo__Instance_class: "[[ems__Task]]"'];if(r?.prototypeUid){let h=this.buildPrototypeUri(r.prototypeUid);l.push(`exo__Asset_prototype: "${h}"`)}if(r?.areaUid){let h=this.buildAssetUri(r.areaUid);l.push(`ems__Effort_area: "${h}"`)}if(r?.parentUid){let h=this.buildAssetUri(r.parentUid);l.push(`ems__Effort_parent: "${h}"`)}t?(l.push('ems__Effort_status: "[[ems__EffortStatusDoing]]"'),l.push(`ems__Effort_startTimestamp: ${s}`)):l.push('ems__Effort_status: "[[ems__EffortStatusBacklog]]"'),l.push("---","","");let u=l.join(`
265
- `),f=`${c}/${a}`;return await this.vault.create(f,u),{path:f,uid:i,label:e,started:t}}async createFromPractice(e){let r=(await this.getPractices()).find(a=>a.uid===e.prototypeUid);if(!r)throw new Error(`Practice not found: ${e.prototypeUid}`);if(r.doneToday)throw new Error(`Practice "${r.label}" already completed today`);if(r.inProgressToday&&r.todayInstancePath)return{path:r.todayInstancePath,uid:e.prototypeUid,label:r.label,started:!0};let i=ro.DateFormatter.toDateString(new Date),s=e.label||`${r.label} ${i}`;return this.quickCapture(s,e.startImmediately??!0,{prototypeUid:e.prototypeUid,areaUid:e.areaUid,parentUid:e.parentUid})}async markPracticeDone(e){let r=(await this.getPractices()).find(u=>u.uid===e);if(!r)throw new Error(`Practice not found: ${e}`);if(r.doneToday)return;if(!r.todayInstancePath)throw new Error(`No active instance for practice "${r.label}" today`);let i=this.vault.getAbstractFileByPath(r.todayInstancePath);if(!i||!("basename"in i))throw new Error(`File not found: ${r.todayInstancePath}`);let s=i,a=await this.vault.read(s),c=ro.DateFormatter.toISOTimestamp(new Date),l=this.frontmatterService.updateProperty(a,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');l=this.frontmatterService.updateProperty(l,"ems__Effort_endTimestamp",c),l=this.frontmatterService.updateProperty(l,"ems__Effort_resolutionTimestamp",c),await this.vault.modify(s,l)}async findTodayInstance(e,t){let r=this.vault.getAllFiles();for(let i of r)if(i.path.endsWith(".md"))try{let s=await this.vault.read(i),a=this.frontmatterService.parse(s);if(!a.exists)continue;let c=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_prototype");if(!c||!c.includes(e))continue;let l=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_label"),u=this.frontmatterService.getPropertyValue(a.content,"ems__Effort_startTimestamp"),f=l?.includes(t),h=u?new Date(u):null,d=h&&ro.DateFormatter.toDateString(h)===t;if(!f&&!d)continue;let p=this.frontmatterService.getPropertyValue(a.content,"ems__Effort_status");return this.isDoneStatus(p)?{path:i.path,status:"done"}:this.isDoingStatus(p)?{path:i.path,status:"doing"}:{path:i.path,status:"other"}}catch{continue}return null}isTaskPrototype(e){return e?e.includes("ems__TaskPrototype")||e.includes("TaskPrototype"):!1}isTask(e){return e?(e.includes("ems__Task")||e.includes("[[ems__Task]]"))&&!e.includes("Prototype"):!1}isDoneStatus(e){return e?e.includes("Done")||e.includes("EffortStatusDone"):!1}isDoingStatus(e){return e?e.includes("Doing")||e.includes("EffortStatusDoing"):!1}calculateDurationMinutes(e,t){let r=new Date(e);return(new Date(t).getTime()-r.getTime())/1e3/60}buildPrototypeUri(e){return`obsidian://vault/03%20Knowledge%2Fkitelev%2F${e}.md`}buildAssetUri(e){return`obsidian://vault/03%20Knowledge%2Fkitelev%2F${e}.md`}};Zn.DailyReviewService=A0;Zn.DailyReviewService=A0=A4([(0,xb.injectable)(),I4(0,(0,xb.inject)(O4.DI_TOKENS.IVaultAdapter)),C4("design:paramtypes",[Object])],A0)});var I0=v(mr=>{"use strict";var F4=mr&&mr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},D4=mr&&mr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},N4=mr&&mr.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(mr,"__esModule",{value:!0});mr.CriticalityZoneService=mr.CriticalityZoneUUIDs=void 0;var Cb=Ve(),L4=Ki(),M4=ct();mr.CriticalityZoneUUIDs={TODAY:"e266a2e9-9eb0-431d-b1fe-b95b9d3e9a3f",THIS_WEEK:"c7f1a968-0959-4ac7-ac82-31b0cdc2aba7",SOMEDAY:"6968a0fc-7a41-4393-82b1-17d767c7ad7c"};var C0=class{static{o(this,"CriticalityZoneService")}constructor(e){this.vault=e,this.frontmatterService=new L4.FrontmatterService}async setZoneToday(e){await this.setZone(e,mr.CriticalityZoneUUIDs.TODAY)}async setZoneThisWeek(e){await this.setZone(e,mr.CriticalityZoneUUIDs.THIS_WEEK)}async setZoneSomeday(e){await this.setZone(e,mr.CriticalityZoneUUIDs.SOMEDAY)}async setZone(e,t){let r=await this.vault.read(e),i=this.frontmatterService.updateProperty(r,"ems__Task_zone",`"[[${t}]]"`);await this.vault.modify(e,i)}};mr.CriticalityZoneService=C0;mr.CriticalityZoneService=C0=F4([(0,Cb.injectable)(),N4(0,(0,Cb.inject)(M4.DI_TOKENS.IVaultAdapter)),D4("design:paramtypes",[Object])],C0)});var Ib=v(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.EffortSortingHelpers=void 0;var O0=class n{static{o(this,"EffortSortingHelpers")}static getTimeFromTimestamp(e){if(!e)return"00:00:00";let t=new Date(e);if(isNaN(t.getTime()))return"00:00:00";let r=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${r}:${i}:${s}`}static sortByStartTime(e,t){let r=n.getTimeFromTimestamp(e.startTimestamp),i=n.getTimeFromTimestamp(t.startTimestamp),s=r==="00:00:00",a=i==="00:00:00";return s&&!a?1:!s&&a?-1:r.localeCompare(i)}static sortByPriority(e,t){if(e.isTrashed!==t.isTrashed)return e.isTrashed?1:-1;if(e.isDone!==t.isDone)return e.isDone?1:-1;let r=typeof e.metadata.ems__Effort_votes=="number"?e.metadata.ems__Effort_votes:0,i=typeof t.metadata.ems__Effort_votes=="number"?t.metadata.ems__Effort_votes:0;return r!==i?i-r:e.startTime&&t.startTime?e.startTime.localeCompare(t.startTime):e.startTime?-1:t.startTime?1:0}};jf.EffortSortingHelpers=O0});var Ob=v($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.FilenameValidator=void 0;var da=class{static{o(this,"FilenameValidator")}static validate(e,t={}){let{maxLength:r=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT,allowEmpty:s=!1}=t,a=[];if(!e||e.trim().length===0)return s||a.push("Filename cannot be empty"),{valid:a.length===0,sanitized:"",errors:a};e.endsWith(" ")&&a.push("Filename should not end with a space");let c=e.trim();this.INVALID_CHARS_PATTERN.test(c)&&a.push('Filename contains invalid characters: / \\ : * ? " < > |');let l=this.getBaseName(c);this.RESERVED_NAMES.has(l.toUpperCase())&&a.push(`"${l}" is a reserved filename on Windows`),c.length>r&&a.push(`Filename exceeds maximum length of ${r} characters`),c.startsWith(".")&&a.push("Filename should not start with a dot"),c.endsWith(".")&&a.push("Filename should not end with a dot");let u=this.sanitize(e,{maxLength:r,replacementChar:i});return{valid:a.length===0,sanitized:u,errors:a}}static sanitize(e,t={}){let{maxLength:r=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT}=t;if(!e||e.trim().length===0)return"";let s=e.trim();for(s=s.replace(this.INVALID_CHARS_PATTERN,i);s.startsWith(".")&&s.length>1;)s=s.substring(1);for(;s.length>0&&(s.endsWith(".")||s.endsWith(" "));)s=s.slice(0,-1);for(s.includes(i)&&(s=s.split(i).filter(u=>u!=="").join(i));s.startsWith(i);)s=s.slice(i.length);for(;s.endsWith(i);)s=s.slice(0,-i.length);let a=this.getBaseName(s);if(this.RESERVED_NAMES.has(a.toUpperCase())){let c=this.getExtension(s);s=a+i+c}if(s.length>r)for(s=s.slice(0,r);s.endsWith(i);)s=s.slice(0,-i.length);return s}static hasInvalidChars(e){return this.INVALID_CHARS_PATTERN.test(e)}static getInvalidChars(e){let t=e.match(this.INVALID_CHARS_PATTERN);return t?[...new Set(t)]:[]}static getBaseName(e){let t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}static getExtension(e){let t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}};$f.FilenameValidator=da;da.INVALID_CHARS_PATTERN=/[/\\:*?"<>|\x00-\x1F]/g;da.RESERVED_NAMES=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"]);da.DEFAULT_MAX_LENGTH=200;da.DEFAULT_REPLACEMENT="_"});var R0=v(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.NTriplesSerializer=void 0;var P0=class{static{o(this,"NTriplesSerializer")}serialize(e,t={}){let r=t.newline??`
263
+ LIMIT ${this.config.defaultLimit}`,s="\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0442\u043E\u0447\u043D\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0442\u0438\u043F \u0437\u0430\u043F\u0440\u043E\u0441\u0430. \u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u043E\u0438\u0441\u043A \u043F\u043E \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u043C\u0443 \u0441\u043B\u043E\u0432\u0443.";return t?.template&&t?.missingParams&&(s+=` \u0414\u043B\u044F \u0448\u0430\u0431\u043B\u043E\u043D\u0430 "${t.template.name}" \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432: ${t.missingParams.join(", ")}.`),{query:i,templateName:null,parameters:{keyword:r},confidence:.3,explanation:s,isFallback:!0,alternatives:[]}}calculateConfidence(e,t,r){let i=.5;for(let c of t.keywords)e.includes(c.toLowerCase())&&(i+=.1);let s=t.parameters.filter(c=>c.required),a=s.filter(c=>r[c.name]&&r[c.name].length>0);s.length>0?i+=a.length/s.length*.2:i+=.2;for(let[c]of Object.entries(this.prototypeMapping))if(e.includes(c)){i+=.1;break}return Math.min(i,1)}generateExplanation(e,t){let r=e.description;return Object.keys(t).length>0&&(r+=". \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B: ",r+=Object.entries(t).filter(([,i])=>i&&i.length>0).map(([i,s])=>`${i}="${s}"`).join(", ")),r}getAvailableTemplates(){return[...lt.SPARQL_TEMPLATES]}getTemplate(e){return(0,lt.getTemplateByName)(e)}setConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}addTemplate(e){lt.SPARQL_TEMPLATES.push(e),y4.LoggingService.debug(`Added custom template: ${e.name}`)}getSuggestions(e){let t=[];return(e.includes("\u0441\u043A\u043E\u043B\u044C\u043A\u043E")||e.includes("\u0441\u0440\u0435\u0434\u043D")||e.includes("\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A"))&&!e.match(/\b20\d{2}\b/)&&!this.containsMonth(e)&&t.push("\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: '\u0437\u0430 \u0434\u0435\u043A\u0430\u0431\u0440\u044C' \u0438\u043B\u0438 '\u0437\u0430 2025-12')"),(e.includes("\u0437\u0430\u0434\u0430\u0447")||e.includes("\u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442"))&&t.push("\u0414\u043B\u044F \u0442\u043E\u0447\u043D\u043E\u0433\u043E \u043F\u043E\u0438\u0441\u043A\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 UUID \u043F\u0440\u043E\u0442\u043E\u0442\u0438\u043F\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F"),e.length<10&&t.push("\u0423\u0442\u043E\u0447\u043D\u0438\u0442\u0435 \u0437\u0430\u043F\u0440\u043E\u0441: \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u0442\u0438\u043F \u0434\u0430\u043D\u043D\u044B\u0445"),t}containsMonth(e){return Object.keys(this.monthNames).some(t=>e.includes(t))}};Sn.NLToSPARQLService=w0;Sn.NLToSPARQLService=w0=p4([(0,g4.injectable)(),m4("design:paramtypes",[Object])],w0)});var bb=v(Zn=>{"use strict";var v4=Zn&&Zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},_4=Zn&&Zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},S4=Zn&&Zn.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.AnalyticsService=void 0;var Sb=Ve(),b4=ct(),w4=nr(),E4=Ki(),E0=class{static{o(this,"AnalyticsService")}constructor(e){this.vault=e,this.frontmatterService=new E4.FrontmatterService}getDefaultPeriod(){let e=new Date,t=new Date;return t.setDate(t.getDate()-30),{startDate:t,endDate:e}}async getEffortsInPeriod(e,t){let i=this.vault.getAllFiles().filter(a=>a.path.endsWith(".md")),s=[];for(let a of i)try{let c=await this.vault.read(a),l=this.extractEffortData(a,c);if(!l)continue;if(l.startTimestamp){if(l.startTimestamp<e.startDate||l.startTimestamp>e.endDate)continue}else continue;if(t?.prototypeUri&&l.prototypeUri!==t.prototypeUri||t?.labelContains&&!l.label.toLowerCase().includes(t.labelContains.toLowerCase())||t?.status&&l.status&&!t.status.includes(l.status))continue;s.push(l)}catch{continue}return s}extractEffortData(e,t){let r=this.frontmatterService.parse(t);if(!r.exists)return null;let i=this.frontmatterService.getPropertyValue(r.content,"exo__Asset_label");if(!i)return null;let s=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_status"),a=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_startTimestamp"),c=this.frontmatterService.getPropertyValue(r.content,"ems__Effort_endTimestamp"),l=this.frontmatterService.getPropertyValue(r.content,"exo__Asset_prototype"),u=this.extractInstanceClass(r.content);return{path:e.path,label:this.cleanWikiLink(i),status:s?this.cleanWikiLink(s):null,startTimestamp:a?this.parseTimestamp(a):null,endTimestamp:c?this.parseTimestamp(c):null,prototypeUri:l?this.cleanWikiLink(l):null,instanceClass:u}}extractInstanceClass(e){let t=e.match(/exo__Instance_class:\s*\n((?:\s*-\s*.*\n?)+)/);if(t)return t[1].split(`
264
+ `).filter(s=>s.trim()).map(s=>this.cleanWikiLink(s.replace(/^\s*-\s*/,"").trim()));let r=this.frontmatterService.getPropertyValue(e,"exo__Instance_class");return r?this.cleanWikiLink(r):null}cleanWikiLink(e){return e.replace(/^\[\[/,"").replace(/\]\]$/,"").replace(/^"/,"").replace(/"$/,"")}parseTimestamp(e){if(!e)return null;let t=e.replace(/^"/,"").replace(/"$/,""),r=new Date(t);return isNaN(r.getTime())?null:r}calculateDurationStats(e){let t=e.filter(f=>f.startTimestamp&&f.endTimestamp).map(f=>(f.endTimestamp.getTime()-f.startTimestamp.getTime())/6e4).filter(f=>f>0);if(t.length===0)return{count:0,totalMinutes:0,averageMinutes:0,minMinutes:0,maxMinutes:0,stdDevMinutes:0};let r=t.reduce((f,h)=>f+h,0),i=r/t.length,s=Math.min(...t),a=Math.max(...t),l=t.map(f=>Math.pow(f-i,2)).reduce((f,h)=>f+h,0)/t.length,u=Math.sqrt(l);return{count:t.length,totalMinutes:Math.round(r),averageMinutes:Math.round(i*10)/10,minMinutes:Math.round(s),maxMinutes:Math.round(a),stdDevMinutes:Math.round(u*10)/10}}calculateDailyAggregates(e){let t=new Map;for(let r of e){if(!r.startTimestamp)continue;let i=w4.DateFormatter.toDateString(r.startTimestamp);t.has(i)||t.set(i,{count:0,totalMinutes:0});let s=t.get(i);if(s.count++,r.endTimestamp){let a=r.endTimestamp.getTime()-r.startTimestamp.getTime();s.totalMinutes+=a/6e4}}return Array.from(t.entries()).map(([r,i])=>({date:r,count:i.count,totalMinutes:Math.round(i.totalMinutes),averageMinutes:i.count>0?Math.round(i.totalMinutes/i.count*10)/10:0})).sort((r,i)=>r.date.localeCompare(i.date))}calculateHourlyDistribution(e){let t=new Array(24).fill(0);for(let i of e){if(!i.startTimestamp)continue;let s=i.startTimestamp.getHours();t[s]++}let r=t.reduce((i,s)=>i+s,0);return t.map((i,s)=>({hour:s,count:i,percentage:r>0?Math.round(i/r*1e3)/10:0}))}calculateWeekdayDistribution(e){let t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=new Array(7).fill(0);for(let s of e){if(!s.startTimestamp)continue;let a=s.startTimestamp.getDay();r[a]++}let i=r.reduce((s,a)=>s+a,0);return r.map((s,a)=>({dayOfWeek:a,dayName:t[a],count:s,percentage:i>0?Math.round(s/i*1e3)/10:0}))}async analyzeSleep(e=this.getDefaultPeriod()){let t=await this.getEffortsInPeriod(e,{labelContains:"\u041F\u043E\u0441\u043F\u0430\u0442\u044C"}),r=this.calculateDurationStats(t),i=this.calculateDailyAggregates(t),s=[],a=[];for(let h of t){if(h.startTimestamp){let d=h.startTimestamp.getHours()*60+h.startTimestamp.getMinutes();s.push(d<360?d+1440:d)}if(h.endTimestamp){let d=h.endTimestamp.getHours()*60+h.endTimestamp.getMinutes();a.push(d)}}let c=s.length>0?s.reduce((h,d)=>h+d,0)/s.length:0,l=a.length>0?a.reduce((h,d)=>h+d,0)/a.length:0,u=s.length>1?Math.sqrt(s.map(h=>Math.pow(h-c,2)).reduce((h,d)=>h+d,0)/s.length):0,f=a.length>1?Math.sqrt(a.map(h=>Math.pow(h-l,2)).reduce((h,d)=>h+d,0)/a.length):0;return{period:e,stats:r,dailyData:i,averageBedtime:this.minutesToTimeString(c%1440),averageWakeTime:this.minutesToTimeString(l),bedtimeVariabilityMinutes:Math.round(u),wakeTimeVariabilityMinutes:Math.round(f)}}minutesToTimeString(e){let t=Math.floor(e/60),r=Math.round(e%60);return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`}async analyzeTaskCompletion(e=this.getDefaultPeriod()){let r=(await this.getEffortsInPeriod(e)).filter(u=>Array.isArray(u.instanceClass)?u.instanceClass.some(f=>f.includes("ems__Task")):u.instanceClass?.includes("ems__Task")??!1),i=r.filter(u=>u.status?.includes("ems__EffortStatusDone")),s=r.filter(u=>u.status?.includes("ems__EffortStatusTrashed")),a=i.filter(u=>u.startTimestamp&&u.endTimestamp).map(u=>(u.endTimestamp.getTime()-u.startTimestamp.getTime())/6e4),c=a.length>0?a.reduce((u,f)=>u+f,0)/a.length:0,l=this.calculateDailyAggregates(i);return{period:e,totalTasks:r.length,completedTasks:i.length,trashedTasks:s.length,completionRate:r.length>0?Math.round(i.length/r.length*1e3)/10:0,averageCompletionTimeMinutes:Math.round(c*10)/10,dailyCompletions:l}}async analyzeActivityFrequency(e,t=this.getDefaultPeriod()){let r=await this.getEffortsInPeriod(t,{labelContains:e}),i=this.calculateDurationStats(r),s=this.calculateDailyAggregates(r),a=this.calculateHourlyDistribution(r),c=this.calculateWeekdayDistribution(r);return{activityLabel:e,period:t,stats:i,dailyData:s,hourlyDistribution:a,weekdayDistribution:c}}async getActivitySummary(e=this.getDefaultPeriod()){let t=await this.getEffortsInPeriod(e),r=new Map;for(let s of t){let a=s.label.split(" ")[0];r.has(a)||r.set(a,[]),r.get(a).push(s)}let i=new Map;for(let[s,a]of r)i.set(s,this.calculateDurationStats(a));return i}};Zn.AnalyticsService=E0;Zn.AnalyticsService=E0=v4([(0,Sb.injectable)(),S4(0,(0,Sb.inject)(b4.DI_TOKENS.IVaultAdapter)),_4("design:paramtypes",[Object])],E0)});var wb=v(fa=>{"use strict";var T4=fa&&fa.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(fa,"__esModule",{value:!0});fa.TrendDetectionService=void 0;var x4=Ve(),T0=class{static{o(this,"TrendDetectionService")}constructor(){this.TREND_THRESHOLD=.05,this.ANOMALY_THRESHOLD_STD=2,this.STRONG_CORRELATION_THRESHOLD=.7,this.MODERATE_CORRELATION_THRESHOLD=.4}analyzeTrend(e,t="averageMinutes"){if(e.length<3)return{direction:"stable",strength:"none",slope:0,rSquared:0,changePercentage:0,insight:"Insufficient data for trend analysis (need at least 3 data points)"};let r=e.map(d=>d[t]),{slope:i,rSquared:s}=this.linearRegression(r),a=r[0]||1,l=((r[r.length-1]||0)-a)/a*100,u;Math.abs(l)<this.TREND_THRESHOLD*100?u="stable":i>0?u="increasing":u="decreasing";let f;s>=.7?f="strong":s>=.4?f="moderate":s>=.2?f="weak":f="none";let h=this.generateTrendInsight(u,f,l);return{direction:u,strength:f,slope:Math.round(i*100)/100,rSquared:Math.round(s*100)/100,changePercentage:Math.round(l*10)/10,insight:h}}linearRegression(e){let t=e.length;if(t===0)return{slope:0,intercept:0,rSquared:0};let r=(t-1)/2,i=e.reduce((d,p)=>d+p,0)/t,s=0,a=0;for(let d=0;d<t;d++)s+=(d-r)*(e[d]-i),a+=Math.pow(d-r,2);let c=a!==0?s/a:0,l=i-c*r,u=0,f=0;for(let d=0;d<t;d++){let p=l+c*d;u+=Math.pow(e[d]-p,2),f+=Math.pow(e[d]-i,2)}let h=f!==0?1-u/f:0;return{slope:c,intercept:l,rSquared:Math.max(0,h)}}generateTrendInsight(e,t,r){if(t==="none"||e==="stable")return"Metric is relatively stable with no significant trend.";let i=t==="strong"?"clearly":t==="moderate"?"moderately":"slightly",s=e==="increasing"?"increasing":"decreasing",a=`${Math.abs(Math.round(r))}%`;return`Metric is ${i} ${s} (${a} change over the period).`}detectAnomalies(e,t="averageMinutes"){if(e.length<5)return[];let r=e.map(c=>c[t]),{mean:i,stdDev:s}=this.calculateStats(r),a=[];for(let c=0;c<e.length;c++){let l=r[c],u=(l-i)/(s||1);if(Math.abs(u)>=this.ANOMALY_THRESHOLD_STD){let f=this.determineAnomalySeverity(u),h=this.determineAnomalyType(u,l,i);a.push({date:e[c].date,value:l,expectedValue:Math.round(i*10)/10,deviation:Math.round(u*100)/100,severity:f,type:h,description:this.generateAnomalyDescription(h,f,u,l,i)})}}return a}calculateStats(e){if(e.length===0)return{mean:0,stdDev:0};let t=e.reduce((a,c)=>a+c,0)/e.length,i=e.map(a=>Math.pow(a-t,2)).reduce((a,c)=>a+c,0)/e.length,s=Math.sqrt(i);return{mean:t,stdDev:s}}determineAnomalySeverity(e){let t=Math.abs(e);return t>=3?"critical":t>=2.5?"warning":"info"}determineAnomalyType(e,t,r){return t>r&&e>0?"spike":t<r&&e<0?"drop":"outlier"}generateAnomalyDescription(e,t,r,i,s){let a=t==="critical"?"Significant":t==="warning"?"Notable":"Minor",c=e==="spike"?"spike":e==="drop"?"drop":"unusual value",l=Math.round((i-s)/s*100);return`${a} ${c} detected: ${Math.round(i)} (${l>0?"+":""}${l}% from average of ${Math.round(s)}, ${r.toFixed(1)}\u03C3 from mean).`}calculateCorrelation(e,t,r,i){let s=Math.min(e.length,t.length);if(s<5)return{metric1:r,metric2:i,coefficient:0,strength:"none",direction:"none",insight:"Insufficient data for correlation analysis."};let{mean:a,stdDev:c}=this.calculateStats(e.slice(0,s)),{mean:l,stdDev:u}=this.calculateStats(t.slice(0,s));if(c===0||u===0)return{metric1:r,metric2:i,coefficient:0,strength:"none",direction:"none",insight:"One or both metrics have no variation."};let f=0;for(let E=0;E<s;E++)f+=(e[E]-a)/c*((t[E]-l)/u);let h=f/s,d=Math.abs(h),p;d>=this.STRONG_CORRELATION_THRESHOLD?p="strong":d>=this.MODERATE_CORRELATION_THRESHOLD?p="moderate":d>=.2?p="weak":p="none";let _=p==="none"?"none":h>0?"positive":"negative",S=this.generateCorrelationInsight(r,i,h,p,_);return{metric1:r,metric2:i,coefficient:Math.round(h*100)/100,strength:p,direction:_,insight:S}}generateCorrelationInsight(e,t,r,i,s){if(i==="none")return`No significant correlation found between ${e} and ${t}.`;let a=i==="strong"?"strongly":i==="moderate"?"moderately":"weakly",c=s==="positive"?"When one increases, the other tends to increase":"When one increases, the other tends to decrease";return`${e} and ${t} are ${a} ${s}ly correlated (r=${r.toFixed(2)}). ${c}.`}analyzeWeeklyPattern(e,t="averageMinutes"){let r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i={};for(let l of e){let f=new Date(l.date).getDay();i[f]||(i[f]=[]),i[f].push(l[t])}let s=[],a=0,c=1/0;for(let l=0;l<7;l++){let u=i[l]||[],{mean:f,stdDev:h}=this.calculateStats(u);f>a&&(a=f),f<c&&u.length>0&&(c=f),s.push({dayOfWeek:l,dayName:r[l],averageValue:Math.round(f*10)/10,deviation:Math.round(h*10)/10,isHighPoint:!1,isLowPoint:!1})}for(let l of s)l.averageValue===a&&a>0&&(l.isHighPoint=!0),l.averageValue===c&&c!==1/0&&(l.isLowPoint=!0);return s}generateInsights(e,t,r,i,s){let a=[];t.strength!=="none"&&t.direction!=="stable"&&a.push({type:"trend",severity:t.direction==="decreasing"?"warning":"info",title:`${s} is ${t.direction}`,description:t.insight,metric:s,value:t.changePercentage,actionable:t.direction==="decreasing"});let c=r.filter(f=>f.severity==="critical");if(c.length>0)for(let f of c)a.push({type:"anomaly",severity:"critical",title:`Unusual ${f.type} detected on ${f.date}`,description:f.description,metric:s,value:f.value,actionable:!0});let l=i.filter(f=>f.isHighPoint).map(f=>f.dayName),u=i.filter(f=>f.isLowPoint).map(f=>f.dayName);return l.length>0&&u.length>0&&a.push({type:"pattern",severity:"info",title:"Weekly pattern detected",description:`${s} tends to be highest on ${l.join(", ")} and lowest on ${u.join(", ")}.`,metric:s,actionable:!1}),e.stdDevMinutes>e.averageMinutes*.5&&a.push({type:"recommendation",severity:"warning",title:"High variability detected",description:`${s} shows high variability (std dev: ${e.stdDevMinutes} min). Consider maintaining a more consistent schedule.`,metric:s,value:e.stdDevMinutes,actionable:!0}),a}detectSuddenChanges(e,t="averageMinutes",r=50){let i=[];for(let s=1;s<e.length;s++){let a=e[s-1][t],c=e[s][t];if(a===0)continue;let l=(c-a)/a*100;Math.abs(l)>=r&&i.push({date:e[s].date,previousValue:a,currentValue:c,changePercent:Math.round(l*10)/10})}return i}};fa.TrendDetectionService=T0;fa.TrendDetectionService=T0=T4([(0,x4.injectable)()],T0)});var Tb=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.AutocompleteService=ha.DEFAULT_AUTOCOMPLETE_CONFIG=void 0;var kf=hn(),tl=Ye(),Eb=mt();ha.DEFAULT_AUTOCOMPLETE_CONFIG={limit:10,activeBoost:20,recencyBoost:10,recencyDays:7};var x0=class{static{o(this,"AutocompleteService")}constructor(e,t){this.tripleStore=e,this.config={...ha.DEFAULT_AUTOCOMPLETE_CONFIG,...t}}async getSuggestions(e,t,r){let i={...this.config,...r},s=await this.getPropertyRange(e);if(s.length===0){let l=this.inferClassFromProperty(e);l&&s.push(l)}let a=[];for(let l of s){let u=await this.getAssetsOfClass(l);a.push(...u)}return a.map(l=>({...l,matchScore:this.calculateMatchScore(l,t,i)})).filter(l=>l.matchScore>0).sort((l,u)=>u.matchScore-l.matchScore).slice(0,i.limit)}async getSuggestionsByClass(e,t,r){let i={...this.config,...r},s=[];for(let c of e){let l=await this.getAssetsOfClass(c);s.push(...l)}return s.map(c=>({...c,matchScore:this.calculateMatchScore(c,t,i)})).filter(c=>c.matchScore>0).sort((c,l)=>l.matchScore-c.matchScore).slice(0,i.limit)}async getPropertyRange(e){let t=this.toFullIri(e),r=[],i=await this.tripleStore.match(new tl.IRI(t),kf.Namespace.RDFS.term("range"),void 0);for(let s of i)if(s.object instanceof tl.IRI){let a=this.toClassName(s.object.value);a&&r.push(a)}return r}async getAssetsOfClass(e){let t=this.toFullIri(e),r=[],i=await this.tripleStore.match(void 0,kf.Namespace.RDF.term("type"),new tl.IRI(t));for(let s of i)if(s.subject instanceof tl.IRI){let a=await this.buildSuggestion(s.subject,e);a&&r.push(a)}return r}async buildSuggestion(e,t){let r=await this.tripleStore.match(e,kf.Namespace.EXO.term("Asset_label"),void 0),i="";for(let c of r)if(c.object instanceof Eb.Literal){i=c.object.value;break}if(i||(i=this.extractLabelFromUri(e.value)),!i)return null;let s=await this.checkIfActive(e),a=this.extractPathFromUri(e.value);return{label:i,uri:e.value,path:a,assetClass:t,isActive:s,matchScore:0}}async checkIfActive(e){let t=await this.tripleStore.match(e,kf.Namespace.EMS.term("Effort_status"),void 0);for(let r of t){let i=r.object instanceof Eb.Literal||r.object instanceof tl.IRI?r.object.value:"";if(i.includes("Active")||i.includes("EffortStatus_Active"))return!0}return!1}calculateMatchScore(e,t,r){if(!t||t.length===0)return e.isActive?100+r.activeBoost:100;let i=e.label.toLowerCase(),s=t.toLowerCase(),a=0;if(i===s)a=100;else if(i.startsWith(s))a=80;else if(i.includes(s))a=60;else if(this.fuzzyMatch(s,i))a=40;else return 0;if(e.isActive&&(a+=r.activeBoost),e.lastModified){let c=(Date.now()-e.lastModified)/864e5;c<=r.recencyDays&&(a+=r.recencyBoost*(1-c/r.recencyDays))}return a}fuzzyMatch(e,t){let r=0;for(let i=0;i<t.length&&r<e.length;i++)t[i]===e[r]&&r++;return r===e.length}inferClassFromProperty(e){let t=e.toLowerCase();return t.includes("project")?"ems__Project":t.includes("area")?"ems__Area":t.includes("task")?"ems__Task":t.includes("effort")?"ems__Effort":null}toFullIri(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;let t=e.match(/^([a-z]+)__(.+)$/);if(t){let[,r,i]=t;switch(r){case"ems":return`https://exocortex.my/ontology/ems#${i}`;case"exo":return`https://exocortex.my/ontology/exo#${i}`;default:return`https://exocortex.my/ontology/${r}#${i}`}}return e}toClassName(e){let t=e.match(/https:\/\/exocortex\.my\/ontology\/([a-z]+)#(.+)$/);if(t){let[,r,i]=t;return`${r}__${i}`}return null}extractLabelFromUri(e){if(e.startsWith("obsidian://")){let r=decodeURIComponent(e),i=r.lastIndexOf("/");if(i>=0){let s=r.substring(i+1);return s.endsWith(".md")&&(s=s.substring(0,s.length-3)),s}}let t=e.lastIndexOf("/");if(t>=0){let r=e.substring(t+1);return r.endsWith(".md")&&(r=r.substring(0,r.length-3)),r}return""}extractPathFromUri(e){if(e.startsWith("obsidian://vault/")){let t=decodeURIComponent(e.substring(17)),r=t.indexOf("/");return r>=0?t.substring(r+1):t}return e}};ha.AutocompleteService=x0});var Ab=v(ei=>{"use strict";var A4=ei&&ei.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},C4=ei&&ei.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},I4=ei&&ei.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ei,"__esModule",{value:!0});ei.DailyReviewService=void 0;var xb=Ve(),O4=ct(),ro=nr(),P4=Ki(),R4=Ir(),A0=class{static{o(this,"DailyReviewService")}constructor(e){this.vault=e,this.frontmatterService=new P4.FrontmatterService}async getPractices(){let e=this.vault.getAllFiles(),t=[],r=ro.DateFormatter.toDateString(new Date);for(let i of e)if(i.path.endsWith(".md"))try{let s=await this.vault.read(i),a=this.frontmatterService.parse(s);if(!a.exists)continue;let c=this.frontmatterService.getPropertyValue(a.content,"exo__Instance_class");if(!this.isTaskPrototype(c))continue;let l=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_uid");if(!l)continue;let u=l.replace(/"/g,""),f=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_label");if(!f)continue;let h=f.replace(/"/g,""),p=this.frontmatterService.getPropertyValue(a.content,"ems__Recurring_rule")?.replace(/"/g,"")||null,_=this.frontmatterService.getPropertyValue(a.content,"ems__Task_estimatedDuration"),S=null;if(_){let A=parseInt(_,10);isNaN(A)||(S=A)}let E=await this.findTodayInstance(u,r);t.push({uid:u,label:h,path:i.path,recurringRule:p,estimatedDuration:S,doneToday:E?.status==="done",inProgressToday:E?.status==="doing",todayInstancePath:E?.path||null})}catch{continue}return t.sort((i,s)=>i.label.localeCompare(s.label))}async getDailyReviewSummary(e){let t=e||new Date,r=ro.DateFormatter.toDateString(t),i=new Date(t);i.setHours(0,0,0,0);let s=new Date(t);s.setHours(23,59,59,999);let a=this.vault.getAllFiles(),c=0,l=0,u=0,f=0;for(let _ of a)if(_.path.endsWith(".md"))try{let S=await this.vault.read(_),E=this.frontmatterService.parse(S);if(!E.exists)continue;let A=this.frontmatterService.getPropertyValue(E.content,"exo__Instance_class");if(!this.isTask(A))continue;let C=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_plannedStartTimestamp"),k=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_startTimestamp"),G=k?new Date(k):null,Q=C?new Date(C):null;if(!(Q&&Q>=i&&Q<=s||G&&G>=i&&G<=s))continue;c++;let re=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_status");if(this.isDoneStatus(re)){l++;let Ie=this.frontmatterService.getPropertyValue(E.content,"ems__Effort_endTimestamp");if(k&&Ie){let N=this.calculateDurationMinutes(k,Ie);f+=N}}else this.isDoingStatus(re)&&u++}catch{continue}let d=(await this.getPractices()).filter(_=>!_.doneToday&&_.recurringRule),p=c>0?Math.round(l/c*100):0;return{date:r,plannedCount:c,completedCount:l,inProgressCount:u,practicesDue:d,completionPercentage:p,totalTimeMinutes:Math.round(f)}}async quickCapture(e,t=!0,r){let i=(0,R4.v4)(),s=ro.DateFormatter.toISOTimestamp(new Date),a=`${i}.md`,c="03 Knowledge/kitelev",l=["---",`exo__Asset_uid: "${i}"`,`exo__Asset_label: "${e}"`,'exo__Instance_class: "[[ems__Task]]"'];if(r?.prototypeUid){let h=this.buildPrototypeUri(r.prototypeUid);l.push(`exo__Asset_prototype: "${h}"`)}if(r?.areaUid){let h=this.buildAssetUri(r.areaUid);l.push(`ems__Effort_area: "${h}"`)}if(r?.parentUid){let h=this.buildAssetUri(r.parentUid);l.push(`ems__Effort_parent: "${h}"`)}t?(l.push('ems__Effort_status: "[[ems__EffortStatusDoing]]"'),l.push(`ems__Effort_startTimestamp: ${s}`)):l.push('ems__Effort_status: "[[ems__EffortStatusBacklog]]"'),l.push("---","","");let u=l.join(`
265
+ `),f=`${c}/${a}`;return await this.vault.create(f,u),{path:f,uid:i,label:e,started:t}}async createFromPractice(e){let r=(await this.getPractices()).find(a=>a.uid===e.prototypeUid);if(!r)throw new Error(`Practice not found: ${e.prototypeUid}`);if(r.doneToday)throw new Error(`Practice "${r.label}" already completed today`);if(r.inProgressToday&&r.todayInstancePath)return{path:r.todayInstancePath,uid:e.prototypeUid,label:r.label,started:!0};let i=ro.DateFormatter.toDateString(new Date),s=e.label||`${r.label} ${i}`;return this.quickCapture(s,e.startImmediately??!0,{prototypeUid:e.prototypeUid,areaUid:e.areaUid,parentUid:e.parentUid})}async markPracticeDone(e){let r=(await this.getPractices()).find(u=>u.uid===e);if(!r)throw new Error(`Practice not found: ${e}`);if(r.doneToday)return;if(!r.todayInstancePath)throw new Error(`No active instance for practice "${r.label}" today`);let i=this.vault.getAbstractFileByPath(r.todayInstancePath);if(!i||!("basename"in i))throw new Error(`File not found: ${r.todayInstancePath}`);let s=i,a=await this.vault.read(s),c=ro.DateFormatter.toISOTimestamp(new Date),l=this.frontmatterService.updateProperty(a,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');l=this.frontmatterService.updateProperty(l,"ems__Effort_endTimestamp",c),l=this.frontmatterService.updateProperty(l,"ems__Effort_resolutionTimestamp",c),await this.vault.modify(s,l)}async findTodayInstance(e,t){let r=this.vault.getAllFiles();for(let i of r)if(i.path.endsWith(".md"))try{let s=await this.vault.read(i),a=this.frontmatterService.parse(s);if(!a.exists)continue;let c=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_prototype");if(!c||!c.includes(e))continue;let l=this.frontmatterService.getPropertyValue(a.content,"exo__Asset_label"),u=this.frontmatterService.getPropertyValue(a.content,"ems__Effort_startTimestamp"),f=l?.includes(t),h=u?new Date(u):null,d=h&&ro.DateFormatter.toDateString(h)===t;if(!f&&!d)continue;let p=this.frontmatterService.getPropertyValue(a.content,"ems__Effort_status");return this.isDoneStatus(p)?{path:i.path,status:"done"}:this.isDoingStatus(p)?{path:i.path,status:"doing"}:{path:i.path,status:"other"}}catch{continue}return null}isTaskPrototype(e){return e?e.includes("ems__TaskPrototype")||e.includes("TaskPrototype"):!1}isTask(e){return e?(e.includes("ems__Task")||e.includes("[[ems__Task]]"))&&!e.includes("Prototype"):!1}isDoneStatus(e){return e?e.includes("Done")||e.includes("EffortStatusDone"):!1}isDoingStatus(e){return e?e.includes("Doing")||e.includes("EffortStatusDoing"):!1}calculateDurationMinutes(e,t){let r=new Date(e);return(new Date(t).getTime()-r.getTime())/1e3/60}buildPrototypeUri(e){return`obsidian://vault/03%20Knowledge%2Fkitelev%2F${e}.md`}buildAssetUri(e){return`obsidian://vault/03%20Knowledge%2Fkitelev%2F${e}.md`}};ei.DailyReviewService=A0;ei.DailyReviewService=A0=A4([(0,xb.injectable)(),I4(0,(0,xb.inject)(O4.DI_TOKENS.IVaultAdapter)),C4("design:paramtypes",[Object])],A0)});var I0=v(gr=>{"use strict";var F4=gr&&gr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},D4=gr&&gr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},N4=gr&&gr.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(gr,"__esModule",{value:!0});gr.CriticalityZoneService=gr.CriticalityZoneUUIDs=void 0;var Cb=Ve(),L4=Ki(),M4=ct();gr.CriticalityZoneUUIDs={TODAY:"e266a2e9-9eb0-431d-b1fe-b95b9d3e9a3f",THIS_WEEK:"c7f1a968-0959-4ac7-ac82-31b0cdc2aba7",SOMEDAY:"6968a0fc-7a41-4393-82b1-17d767c7ad7c"};var C0=class{static{o(this,"CriticalityZoneService")}constructor(e){this.vault=e,this.frontmatterService=new L4.FrontmatterService}async setZoneToday(e){await this.setZone(e,gr.CriticalityZoneUUIDs.TODAY)}async setZoneThisWeek(e){await this.setZone(e,gr.CriticalityZoneUUIDs.THIS_WEEK)}async setZoneSomeday(e){await this.setZone(e,gr.CriticalityZoneUUIDs.SOMEDAY)}async setZone(e,t){let r=await this.vault.read(e),i=this.frontmatterService.updateProperty(r,"ems__Task_zone",`"[[${t}]]"`);await this.vault.modify(e,i)}};gr.CriticalityZoneService=C0;gr.CriticalityZoneService=C0=F4([(0,Cb.injectable)(),N4(0,(0,Cb.inject)(M4.DI_TOKENS.IVaultAdapter)),D4("design:paramtypes",[Object])],C0)});var Ib=v(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.EffortSortingHelpers=void 0;var O0=class n{static{o(this,"EffortSortingHelpers")}static getTimeFromTimestamp(e){if(!e)return"00:00:00";let t=new Date(e);if(isNaN(t.getTime()))return"00:00:00";let r=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${r}:${i}:${s}`}static sortByStartTime(e,t){let r=n.getTimeFromTimestamp(e.startTimestamp),i=n.getTimeFromTimestamp(t.startTimestamp),s=r==="00:00:00",a=i==="00:00:00";return s&&!a?1:!s&&a?-1:r.localeCompare(i)}static sortByPriority(e,t){if(e.isTrashed!==t.isTrashed)return e.isTrashed?1:-1;if(e.isDone!==t.isDone)return e.isDone?1:-1;let r=typeof e.metadata.ems__Effort_votes=="number"?e.metadata.ems__Effort_votes:0,i=typeof t.metadata.ems__Effort_votes=="number"?t.metadata.ems__Effort_votes:0;return r!==i?i-r:e.startTime&&t.startTime?e.startTime.localeCompare(t.startTime):e.startTime?-1:t.startTime?1:0}};jf.EffortSortingHelpers=O0});var Ob=v($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.FilenameValidator=void 0;var da=class{static{o(this,"FilenameValidator")}static validate(e,t={}){let{maxLength:r=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT,allowEmpty:s=!1}=t,a=[];if(!e||e.trim().length===0)return s||a.push("Filename cannot be empty"),{valid:a.length===0,sanitized:"",errors:a};e.endsWith(" ")&&a.push("Filename should not end with a space");let c=e.trim();this.INVALID_CHARS_PATTERN.test(c)&&a.push('Filename contains invalid characters: / \\ : * ? " < > |');let l=this.getBaseName(c);this.RESERVED_NAMES.has(l.toUpperCase())&&a.push(`"${l}" is a reserved filename on Windows`),c.length>r&&a.push(`Filename exceeds maximum length of ${r} characters`),c.startsWith(".")&&a.push("Filename should not start with a dot"),c.endsWith(".")&&a.push("Filename should not end with a dot");let u=this.sanitize(e,{maxLength:r,replacementChar:i});return{valid:a.length===0,sanitized:u,errors:a}}static sanitize(e,t={}){let{maxLength:r=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT}=t;if(!e||e.trim().length===0)return"";let s=e.trim();for(s=s.replace(this.INVALID_CHARS_PATTERN,i);s.startsWith(".")&&s.length>1;)s=s.substring(1);for(;s.length>0&&(s.endsWith(".")||s.endsWith(" "));)s=s.slice(0,-1);for(s.includes(i)&&(s=s.split(i).filter(u=>u!=="").join(i));s.startsWith(i);)s=s.slice(i.length);for(;s.endsWith(i);)s=s.slice(0,-i.length);let a=this.getBaseName(s);if(this.RESERVED_NAMES.has(a.toUpperCase())){let c=this.getExtension(s);s=a+i+c}if(s.length>r)for(s=s.slice(0,r);s.endsWith(i);)s=s.slice(0,-i.length);return s}static hasInvalidChars(e){return this.INVALID_CHARS_PATTERN.test(e)}static getInvalidChars(e){let t=e.match(this.INVALID_CHARS_PATTERN);return t?[...new Set(t)]:[]}static getBaseName(e){let t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}static getExtension(e){let t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}};$f.FilenameValidator=da;da.INVALID_CHARS_PATTERN=/[/\\:*?"<>|\x00-\x1F]/g;da.RESERVED_NAMES=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"]);da.DEFAULT_MAX_LENGTH=200;da.DEFAULT_REPLACEMENT="_"});var R0=v(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.NTriplesSerializer=void 0;var P0=class{static{o(this,"NTriplesSerializer")}serialize(e,t={}){let r=t.newline??`
266
266
  `;return e.length===0?"":e.map(i=>i.toString()).join(r)+r}serializeChunk(e,t){return e.length===0?"":e.map(r=>r.toString()).join(t)+t}};Vf.NTriplesSerializer=P0});var Pb=v(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.TurtleSerializer=void 0;var no=hn(),k4=R0(),j4={rdf:no.Namespace.RDF.iri.value,rdfs:no.Namespace.RDFS.iri.value,owl:no.Namespace.OWL.iri.value,xsd:no.Namespace.XSD.iri.value,exo:no.Namespace.EXO.iri.value,ems:no.Namespace.EMS.iri.value},F0=class{static{o(this,"TurtleSerializer")}constructor(){this.nTriplesSerializer=new k4.NTriplesSerializer}serialize(e,t={}){let r=t.newline??`
267
267
  `,i=this.composePrefixes(t),s=this.serializePrefixes(i,r),a=this.nTriplesSerializer.serialize(e,{newline:r}).trimEnd();return s?a?`${s}${r}${r}${a}${r}`:`${s}${r}`:a?`${a}${r}`:""}serializePrefixes(e,t){let r=Object.entries(e);return r.length===0?"":r.map(([i,s])=>`@prefix ${i}: <${s}> .`).join(t)}composePrefixes(e){return e.includeDefaultPrefixes??!0?{...j4,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};Uf.TurtleSerializer=F0});var Db=v(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.JSONLDSerializer=void 0;var Rb=Ye(),Fb=Lt(),$4=mt(),io=hn(),V4={rdf:io.Namespace.RDF.iri.value,rdfs:io.Namespace.RDFS.iri.value,owl:io.Namespace.OWL.iri.value,xsd:io.Namespace.XSD.iri.value,exo:io.Namespace.EXO.iri.value,ems:io.Namespace.EMS.iri.value},D0=class{static{o(this,"JSONLDSerializer")}toDocument(e,t={}){let r={...V4,...t.context??{}},i=new Map;for(let s of e){let a=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,r),l=this.objectToJSONLD(s.object,r),u=i.get(a)??{"@id":a},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(a,u)}return{"@context":r,"@graph":Array.from(i.values())}}serialize(e,t={}){let r=this.toDocument(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}subjectToId(e){return e instanceof Rb.IRI?e.value:e instanceof Fb.BlankNode?`_:${e.id}`:String(e)}compactIri(e,t){for(let[r,i]of Object.entries(t))if(e.startsWith(i)){let s=e.slice(i.length);if(s.length>0)return`${r}:${s}`}return e}objectToJSONLD(e,t){if(e instanceof Rb.IRI)return{"@id":e.value};if(e instanceof Fb.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof $4.Literal){let r={"@value":e.value};return e.datatype?r["@type"]=this.compactIri(e.datatype.value,t):e.language&&(r["@language"]=e.language,e.hasDirection()&&e.direction&&(r["@direction"]=e.direction)),r}return e}};Bf.JSONLDSerializer=D0});var M0=v(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.NTriplesParser=void 0;var U4=Wi(),Nb=Ye(),N0=mt(),B4=Lt(),so=hn(),q4={rdf:so.Namespace.RDF.iri.value,rdfs:so.Namespace.RDFS.iri.value,owl:so.Namespace.OWL.iri.value,xsd:so.Namespace.XSD.iri.value,exo:so.Namespace.EXO.iri.value,ems:so.Namespace.EMS.iri.value},L0=class{static{o(this,"NTriplesParser")}parse(e,t={}){let r={prefixes:{...q4,...t.prefixes??{}},strict:t.strict??!1},i=[];return e.split(/\r?\n/).forEach((a,c)=>{let l=a.trim();!l||l.startsWith("#")||i.push(this.parseLine(l,c+1,r))}),i}parseLine(e,t,r){if(!e.endsWith("."))throw new Error(`Invalid RDF statement at line ${t}: missing '.' terminator`);let s=e.slice(0,-1).trim(),a=this.parseSubject(s,t,r);s=a.rest.trim();let c=this.parsePredicate(s,t,r);s=c.rest.trim();let l=this.parseObject(s,t,r);if(s=l.rest.trim(),s.length>0)throw new Error(`Unexpected tokens after object at line ${t}`);return new U4.Triple(a.node,c.node,l.node)}parseSubject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):this.consumePrefixedName(e,t,r)}parsePredicate(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):this.consumePrefixedName(e,t,r)}parseObject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):e.startsWith('"')?this.consumeLiteral(e,t,r):this.consumePrefixedName(e,t,r)}consumePrefixedName(e,t,r){let i=e.match(/^([a-zA-Z_][\w-]*):([^\s]+)(?:\s+(.*))?$/);if(!i)throw new Error(`Invalid token at line ${t}: ${e}`);let[,s,a,c]=i,l=r.prefixes[s];if(!l)throw new Error(`Unknown prefix "${s}" at line ${t}`);return{node:new Nb.IRI(`${l}${a}`),rest:(c??"").trimStart()}}consumeIRI(e,t,r){let i=this.findClosingBracket(e,"<",">");if(i===-1)throw new Error(`Invalid IRI at line ${t}`);let s=e.slice(1,i),a=new Nb.IRI(s),c=e.slice(i+1).trimStart();return{node:a,rest:c}}consumeBlankNode(e,t){let r=e.match(/^_:(\w+)(?:\s+(.*))?$/);if(!r)throw new Error(`Invalid blank node identifier at line ${t}`);let[,i,s]=r;return{node:new B4.BlankNode(i),rest:(s??"").trimStart()}}consumeLiteral(e,t,r){let{value:i,rest:s}=this.consumeQuotedString(e,t),a=s.trimStart();if(a.startsWith("^^")){a=a.slice(2).trimStart();let c=a.startsWith("<")?this.consumeIRI(a,t,r):this.consumePrefixedName(a,t,r);return{node:new N0.Literal(i,c.node),rest:c.rest}}if(a.startsWith("@")){let c=a.match(/^@([a-zA-Z-]+)(?:\s+(.*))?$/);if(!c)throw new Error(`Invalid language tag at line ${t}`);let[,l,u]=c;return{node:new N0.Literal(i,void 0,l),rest:(u??"").trimStart()}}return{node:new N0.Literal(i),rest:a}}consumeQuotedString(e,t){if(!e.startsWith('"'))throw new Error(`Expected quoted string at line ${t}`);let r="";for(let i=1;i<e.length;i++){let s=e[i];if(s==="\\"){if(i+1>=e.length)throw new Error(`Invalid escape sequence at line ${t}`);let a=e[i+1];switch(a){case"t":r+=" ",i+=1;break;case"b":r+="\b",i+=1;break;case"n":r+=`
268
268
  `,i+=1;break;case"r":r+="\r",i+=1;break;case"f":r+="\f",i+=1;break;case'"':r+='"',i+=1;break;case"\\":r+="\\",i+=1;break;case"u":{let c=e.slice(i+2,i+6);if(c.length!==4||!/^[0-9a-fA-F]{4}$/.test(c))throw new Error(`Invalid \\u escape at line ${t}`);r+=String.fromCharCode(parseInt(c,16)),i+=5;break}case"U":{let c=e.slice(i+2,i+10);if(c.length!==8||!/^[0-9a-fA-F]{8}$/.test(c))throw new Error(`Invalid \\U escape at line ${t}`);r+=String.fromCodePoint(parseInt(c,16)),i+=9;break}default:throw new Error(`Unknown escape sequence \\${a} at line ${t}`)}continue}if(s==='"'){let a=e.slice(i+1);return{value:r,rest:a}}r+=s}throw new Error(`Unterminated string literal at line ${t}`)}findClosingBracket(e,t,r){let i=0;for(let s=0;s<e.length;s++){let a=e[s];if(a===t){i++;continue}if(a===r&&(i--,i===0))return s}return-1}};qf.NTriplesParser=L0});var Lb=v(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.TurtleParser=void 0;var ao=hn(),G4=M0(),W4={rdf:ao.Namespace.RDF.iri.value,rdfs:ao.Namespace.RDFS.iri.value,owl:ao.Namespace.OWL.iri.value,xsd:ao.Namespace.XSD.iri.value,exo:ao.Namespace.EXO.iri.value,ems:ao.Namespace.EMS.iri.value},H4=/^@prefix\s+([a-zA-Z_][\w-]*):\s*<([^>]+)>\s*\.$/,k0=class{static{o(this,"TurtleParser")}constructor(){this.nTriplesParser=new G4.NTriplesParser}parse(e,t={}){let r={...W4,...t.prefixes??{}},i=this.collectStatements(e),s=[];return i.forEach(({statement:a,lineNumber:c})=>{if(this.isPrefixStatement(a)){let u=a.match(H4);if(!u)throw new Error(`Invalid prefix declaration at line ${c}`);let[,f,h]=u;r[f]=h;return}if(a.includes(";")||a.includes(","))throw new Error(`Complex Turtle statements with ';' or ',' are not supported (line ${c})`);let l=this.normalizeShortcuts(a);s.push(this.nTriplesParser.parseLine(l,c,{prefixes:r,strict:!1}))}),s}collectStatements(e){let t=e.split(/\r?\n/),r=[],i="",s=0;if(t.forEach((a,c)=>{let l=a.trim();!l||l.startsWith("#")||(i||(s=c+1),i=i?`${i} ${l}`:l,l.endsWith(".")&&(r.push({statement:i,lineNumber:s}),i=""))}),i)throw new Error(`Unterminated Turtle statement near line ${s}`);return r}isPrefixStatement(e){return e.startsWith("@prefix")}normalizeShortcuts(e){return e.includes(" a ")?e.replace(/\sa\s/g," rdf:type "):e}};Gf.TurtleParser=k0});var Mb=v(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.RDFSerializer=void 0;var oo=Wi(),pa=Ye(),ma=mt(),j0=Lt(),Ti=hn(),z4=Pb(),Q4=R0(),Y4=Db(),K4=Lb(),X4=M0(),J4=1024,Z4=`
269
269
  `,e5={rdf:Ti.Namespace.RDF.iri.value,rdfs:Ti.Namespace.RDFS.iri.value,owl:Ti.Namespace.OWL.iri.value,xsd:Ti.Namespace.XSD.iri.value,exo:Ti.Namespace.EXO.iri.value,ems:Ti.Namespace.EMS.iri.value},$0=class{static{o(this,"RDFSerializer")}constructor(e){this.store=e,this.turtleSerializer=new z4.TurtleSerializer,this.nTriplesSerializer=new Q4.NTriplesSerializer,this.jsonldSerializer=new Y4.JSONLDSerializer,this.turtleParser=new K4.TurtleParser,this.nTriplesParser=new X4.NTriplesParser}async serialize(e,t={}){let r=await this.store.match();return this.serializeTriples(r,e,t)}serializeTriples(e,t,r={}){switch(t){case"turtle":return this.turtleSerializer.serialize(e,{prefixes:r.prefixes,includeDefaultPrefixes:r.includeDefaultPrefixes,newline:r.newline});case"n-triples":return this.nTriplesSerializer.serialize(e,{newline:r.newline});case"json-ld":return this.jsonldSerializer.serialize(e,{context:r.prefixes,pretty:r.pretty,indent:r.indent});default:throw new Error(`Unsupported serialization format: ${t}`)}}stream(e,t={}){let r=t.newline??Z4,i=t.batchSize??J4,s=t.includeDefaultPrefixes,a=t.prefixes,c=this,l=!1,u=[],f=[],h=0,d=o(async()=>{if(!l){if(f=await c.store.match(),e==="json-ld"){let _=c.jsonldSerializer.toDocument(f,{context:a,pretty:!1});u.push(...c.buildJsonLdChunks(_))}else if(e==="turtle"){let _=c.turtleSerializer.serializePrefixes(c.composePrefixes(a,s),r);_&&u.push(`${_}${r}${r}`)}l=!0}},"ensureInitialized");return{async next(){if(await d(),u.length>0)return{value:u.shift(),done:!1};if(e==="json-ld")return{value:void 0,done:!0};if(h>=f.length)return{value:void 0,done:!0};let _=f.slice(h,h+i);h+=_.length;let S="";if(e==="turtle"){let E=c.turtleSerializer.serializeTriplesOnly(_,r);E&&(S=`${E}${r}`)}else e==="n-triples"&&(S=c.nTriplesSerializer.serializeChunk(_,r));return S?{value:S,done:!1}:this.next()},async return(){return u=[],f=[],h=0,{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}async load(e,t,r={}){let i=this.parse(e,t,r);return r.mode!=="append"&&await this.store.clear(),await this.store.addAll(i),i.length}parse(e,t,r={}){switch(t){case"turtle":return this.turtleParser.parse(e,this.buildTurtleParseOptions(r));case"n-triples":return this.nTriplesParser.parse(e,this.buildNTriplesParseOptions(r));case"json-ld":return this.parseJsonLd(e,r);default:throw new Error(`Unsupported serialization format: ${t}`)}}buildTurtleParseOptions(e){return{prefixes:this.composePrefixes(e.prefixes,!0),strict:e.strict}}buildNTriplesParseOptions(e){return{prefixes:this.composePrefixes(e.prefixes,!0),strict:e.strict}}composePrefixes(e,t){return t??!0?{...e5,...e??{}}:{...e??{}}}parseJsonLd(e,t){let r;try{r=JSON.parse(e)}catch(u){throw new Error(`Invalid JSON-LD document: ${u.message}`)}let i=this.composePrefixes(t.prefixes,!0),s=this.extractContext(r),a={...i,...s},c=this.extractGraph(r),l=[];return c.forEach((u,f)=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error(`Invalid JSON-LD node at index ${f}`);let h=this.parseSubjectFromNode(u,a,f),d=Object.entries(u);for(let[p,_]of d){if(p==="@id"||p==="@context")continue;if(p==="@type"){this.collectTypeTriples(h,_,l,a);continue}let S=this.expandTerm(p,a),E=new pa.IRI(S);this.collectTriplesForValue(h,E,_,l,a)}}),l}extractContext(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let t=e["@context"];if(!t||typeof t!="object"||Array.isArray(t))return{};let r={};return Object.entries(t).forEach(([i,s])=>{typeof s=="string"&&(r[i]=s)}),r}extractGraph(e){if(Array.isArray(e))return e;if(!e||typeof e!="object")return[];let t=e["@graph"];return Array.isArray(t)?t:[e]}parseSubjectFromNode(e,t,r){let i=e["@id"];if(typeof i=="string"){if(i.startsWith("_:"))return new j0.BlankNode(i.slice(2));if(this.isAbsoluteIri(i))return new pa.IRI(i);let s=this.expandTerm(i,t);return new pa.IRI(s)}return new j0.BlankNode(`jsonld_${r}`)}collectTypeTriples(e,t,r,i){let s=Ti.Namespace.RDF.term("type");(Array.isArray(t)?t:[t]).forEach(c=>{if(typeof c!="string")throw new Error("Invalid @type value in JSON-LD node");let l=this.expandTerm(c,i);r.push(new oo.Triple(e,s,new pa.IRI(l)))})}collectTriplesForValue(e,t,r,i,s){if(r!=null){if(Array.isArray(r)){r.forEach(a=>this.collectTriplesForValue(e,t,a,i,s));return}if(typeof r=="object"){let a=r;if(typeof a["@id"]=="string"){let c=this.parseIdNode(a["@id"],s);i.push(new oo.Triple(e,t,c));return}if(a["@value"]!==void 0){let c=this.parseLiteralObject(a,s);i.push(new oo.Triple(e,t,c));return}}if(typeof r=="string"){i.push(new oo.Triple(e,t,new ma.Literal(r)));return}if(typeof r=="number"){let a=Number.isInteger(r)?Ti.Namespace.XSD.term("integer"):Ti.Namespace.XSD.term("decimal");i.push(new oo.Triple(e,t,new ma.Literal(r.toString(),a)));return}if(typeof r=="boolean"){let a=Ti.Namespace.XSD.term("boolean");i.push(new oo.Triple(e,t,new ma.Literal(r.toString(),a)));return}throw new Error("Unsupported JSON-LD value encountered")}}parseIdNode(e,t){if(e.startsWith("_:"))return new j0.BlankNode(e.slice(2));if(this.isAbsoluteIri(e))return new pa.IRI(e);let r=this.expandTerm(e,t);return new pa.IRI(r)}parseLiteralObject(e,t){let r=e["@value"];if(typeof r!="string")throw new Error("JSON-LD literal values must be strings");if(typeof e["@language"]=="string"){let i=e["@direction"];return i==="ltr"||i==="rtl"?new ma.Literal(r,void 0,e["@language"],i):new ma.Literal(r,void 0,e["@language"])}if(typeof e["@type"]=="string"){let i=this.expandTerm(e["@type"],t);return new ma.Literal(r,new pa.IRI(i))}return new ma.Literal(r)}expandTerm(e,t){if(this.isAbsoluteIri(e))return e;let r=e.indexOf(":");if(r>0){let s=e.slice(0,r),a=e.slice(r+1),c=t[s];if(!c)throw new Error(`Unknown prefix "${s}" in JSON-LD document`);return`${c}${a}`}let i=t["@vocab"];if(i)return`${i}${e}`;throw new Error(`Unable to expand JSON-LD term "${e}"`)}isAbsoluteIri(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)}buildJsonLdChunks(e){let t=[],r=JSON.stringify(e["@context"]);return t.push(`{"@context":${r},"@graph":[`),e["@graph"].forEach((i,s)=>{let a=JSON.stringify(i);s>0?t.push(`,${a}`):t.push(a)}),t.push(`]}
270
- `),t}};Wf.RDFSerializer=$0});var q0=v(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.TransactionError=ys.TripleNotFoundError=ys.TripleAlreadyExistsError=void 0;var V0=class extends Error{static{o(this,"TripleAlreadyExistsError")}constructor(e){super(`Triple already exists: ${e.toString()}`),this.name="TripleAlreadyExistsError"}};ys.TripleAlreadyExistsError=V0;var U0=class extends Error{static{o(this,"TripleNotFoundError")}constructor(e){super(`Triple not found: ${e.toString()}`),this.name="TripleNotFoundError"}};ys.TripleNotFoundError=U0;var B0=class extends Error{static{o(this,"TransactionError")}constructor(e){super(e),this.name="TransactionError"}};ys.TransactionError=B0});var zf=v(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.LRUCache=void 0;var G0=class{static{o(this,"LRUCache")}constructor(e){this.maxSize=e,this.cache=new Map}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};Hf.LRUCache=G0});var kb=v(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.InMemoryTripleStore=void 0;var vs=q0(),Qf=Ye(),t5=Lt(),r5=mt(),n5=hn(),i5=zf(),s5=n5.Namespace.XSD.term("string").value,a5=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,co="__default__",W0=class n{static{o(this,"InMemoryTripleStore")}constructor(){this.triples=new Map,this.spo=new Map,this.sop=new Map,this.pso=new Map,this.pos=new Map,this.osp=new Map,this.ops=new Map,this.queryCache=new i5.LRUCache(1e3),this.uuidIndex=new Map,this.namedGraphs=new Map}async add(e){let t=this.getTripleKey(e);if(this.triples.has(t))return;this.triples.set(t,e);let r=this.getNodeKey(e.subject),i=this.getNodeKey(e.predicate),s=this.getNodeKey(e.object);this.addToIndex(this.spo,r,i,s),this.addToIndex(this.sop,r,s,i),this.addToIndex(this.pso,i,r,s),this.addToIndex(this.pos,i,s,r),this.addToIndex(this.osp,s,r,i),this.addToIndex(this.ops,s,i,r),this.addToUUIDIndex(e.subject),this.queryCache.clear()}async remove(e){let t=this.getTripleKey(e);if(!this.triples.has(t))return!1;this.triples.delete(t);let r=this.getNodeKey(e.subject),i=this.getNodeKey(e.predicate),s=this.getNodeKey(e.object);return this.removeFromIndex(this.spo,r,i,s),this.removeFromIndex(this.sop,r,s,i),this.removeFromIndex(this.pso,i,r,s),this.removeFromIndex(this.pos,i,s,r),this.removeFromIndex(this.osp,s,r,i),this.removeFromIndex(this.ops,s,i,r),this.queryCache.clear(),!0}async has(e){let t=this.getTripleKey(e);return this.triples.has(t)}async match(e,t,r){let i=this.getMatchCacheKey(e,t,r),s=this.queryCache.get(i);if(s!==void 0)return s;let a;return!e&&!t&&!r?a=Array.from(this.triples.values()):e&&t&&r?a=this.matchSPO(e,t,r):e&&t?a=this.matchSP(e,t):e&&r?a=this.matchSO(e,r):t&&r?a=this.matchPO(t,r):e?a=this.matchS(e):t?a=this.matchP(t):r?a=this.matchO(r):a=[],this.queryCache.set(i,a),a}async addAll(e){for(let t of e)await this.add(t)}async removeAll(e){let t=0;for(let r of e)await this.remove(r)&&t++;return t}async clear(){this.triples.clear(),this.spo.clear(),this.sop.clear(),this.pso.clear(),this.pos.clear(),this.osp.clear(),this.ops.clear(),this.uuidIndex.clear(),this.queryCache.clear()}async count(){return this.triples.size}async subjects(){let e=new Set;for(let t of this.triples.values())e.add(t.subject);return Array.from(e)}async predicates(){let e=new Set;for(let t of this.triples.values())e.add(t.predicate);return Array.from(e)}async objects(){let e=new Set;for(let t of this.triples.values())e.add(t.object);return Array.from(e)}async beginTransaction(){return new H0(this)}async findSubjectsByUUID(e){return this.findSubjectsByUUIDSync(e)}findSubjectsByUUIDSync(e){let t=e.toLowerCase(),r=this.uuidIndex.get(t);if(!r||r.size===0)return[];let i=[];for(let s of r)this.spo.has(`i:${s}`)&&i.push(new Qf.IRI(s));return i}addToUUIDIndex(e){if(!(e instanceof Qf.IRI))return;let t=e.value,r=t.match(a5);if(r)for(let i of r){let s=i.toLowerCase();this.uuidIndex.has(s)||this.uuidIndex.set(s,new Set),this.uuidIndex.get(s).add(t)}}matchSPO(e,t,r){let i=this.getNodeKey(e),s=this.getNodeKey(t),a=this.getNodeKey(r),c=this.spo.get(i);if(!c)return[];let l=c.get(s);if(!l)return[];if(l.has(a)){let u=this.buildTripleKey(i,s,a),f=this.triples.get(u);return f?[f]:[]}return[]}matchSP(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.spo.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(r,i,c))):[]}matchSO(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.sop.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(r,c,i))):[]}matchPO(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.pos.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(c,r,i))):[]}matchS(e){let t=this.getNodeKey(e),r=this.spo.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(t,s,c));return this.getTriplesByKeys(i)}matchP(e){let t=this.getNodeKey(e),r=this.pso.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(s,t,c));return this.getTriplesByKeys(i)}matchO(e){let t=this.getNodeKey(e),r=this.osp.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(s,c,t));return this.getTriplesByKeys(i)}getTriplesByKeys(e){let t=[];for(let r of e){let i=this.triples.get(r);i&&t.push(i)}return t}addToIndex(e,t,r,i){e.has(t)||e.set(t,new Map);let s=e.get(t);s.has(r)||s.set(r,new Set),s.get(r).add(i)}removeFromIndex(e,t,r,i){let s=e.get(t);if(!s)return;let a=s.get(r);a&&(a.delete(i),a.size===0&&s.delete(r),s.size===0&&e.delete(t))}getTripleKey(e){let t=this.getNodeKey(e.subject),r=this.getNodeKey(e.predicate),i=this.getNodeKey(e.object);return this.buildTripleKey(t,r,i)}buildTripleKey(e,t,r){return`${e}|${t}|${r}`}getNodeKey(e){if(e instanceof Qf.IRI)return`i:${e.value}`;if(e instanceof t5.BlankNode)return`b:${e.id}`;if(e instanceof r5.Literal){let t=`l:${e.value}`;return e.datatype&&e.datatype.value!==s5?t+=`^^${e.datatype.value}`:e.language&&(t+=`@${e.language}`),t}return""}getMatchCacheKey(e,t,r){let i=e?this.getNodeKey(e):"?",s=t?this.getNodeKey(t):"?",a=r?this.getNodeKey(r):"?";return`${i}|${s}|${a}`}getGraphKey(e){return e?e.value:co}getOrCreateGraphStore(e){let t=this.getGraphKey(e);return t===co?this:(this.namedGraphs.has(t)||this.namedGraphs.set(t,new n),this.namedGraphs.get(t))}async addToGraph(e,t){await this.getOrCreateGraphStore(t).add(e)}async removeFromGraph(e,t){let r=this.getGraphKey(t);if(r===co)return this.remove(e);let i=this.namedGraphs.get(r);return i?i.remove(e):!1}async matchInGraph(e,t,r,i){let s=this.getGraphKey(i);if(s===co)return this.match(e,t,r);let a=this.namedGraphs.get(s);return a?a.match(e,t,r):[]}async getNamedGraphs(){return Array.from(this.namedGraphs.keys()).map(e=>new Qf.IRI(e))}async hasGraph(e){let t=this.namedGraphs.get(e.value);return t?await t.count()>0:!1}async clearGraph(e){let t=this.getGraphKey(e);if(t===co){await this.clear();return}let r=this.namedGraphs.get(t);r&&(await r.clear(),this.namedGraphs.delete(t))}async countInGraph(e){let t=this.getGraphKey(e);if(t===co)return this.count();let r=this.namedGraphs.get(t);return r?r.count():0}};Yf.InMemoryTripleStore=W0;var H0=class{static{o(this,"InMemoryTransaction")}constructor(e){this.store=e,this.operations=[],this.committed=!1,this.rolledBack=!1}async add(e){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");this.operations.push({type:"add",triple:e})}async remove(e){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");return this.operations.push({type:"remove",triple:e}),!0}async commit(){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");for(let e of this.operations)e.type==="add"?await this.store.add(e.triple):await this.store.remove(e.triple);this.committed=!0,this.operations=[]}async rollback(){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");this.operations=[],this.rolledBack=!0}}});var Q0=v(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.RDFVocabularyMapper=void 0;var en=Wi(),jb=Ye(),be=hn(),z0=class{static{o(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",be.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",be.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",be.Namespace.RDFS.term("subClassOf")],["exo__Property_range",be.Namespace.RDFS.term("range")],["exo__Property_domain",be.Namespace.RDFS.term("domain")],["exo__Property_superProperty",be.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new en.Triple(be.Namespace.EXO.term("Asset"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDFS.term("Resource"))),e.push(new en.Triple(be.Namespace.EXO.term("Class"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDFS.term("Class"))),e.push(new en.Triple(be.Namespace.EXO.term("Property"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDF.term("Property"))),e.push(new en.Triple(be.Namespace.EMS.term("Task"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e.push(new en.Triple(be.Namespace.EMS.term("Project"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e.push(new en.Triple(be.Namespace.EMS.term("Area"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new en.Triple(be.Namespace.EXO.term("Instance_class"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDF.term("type"))),e.push(new en.Triple(be.Namespace.EXO.term("Asset_isDefinedBy"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("isDefinedBy"))),e.push(new en.Triple(be.Namespace.EXO.term("Class_superClass"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("subClassOf"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_range"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("range"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_domain"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("domain"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_superProperty"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof jb.IRI)s=r;else{let a=r.match(/^(ems|exo)__(.+)$/);if(a){let[,c,l]=a;s=(c==="ems"?be.Namespace.EMS:be.Namespace.EXO).term(l)}else s=new jb.IRI(r)}return new en.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Kf.RDFVocabularyMapper=z0});var Y0=v(ei=>{"use strict";var o5=ei&&ei.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},c5=ei&&ei.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},l5=ei&&ei.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ei,"__esModule",{value:!0});ei.NoteToRDFConverter=void 0;var $b=Ve(),Gr=Wi(),lo=Ye(),tn=mt(),Vb=Lt(),Fr=hn(),u5=ct(),f5=Q0(),Wr=Rm(),uo=class{static{o(this,"NoteToRDFConverter")}constructor(e){this.vault=e,this.OBSIDIAN_VAULT_SCHEME="obsidian://vault/",this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.vocabularyMapper=new f5.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?Wr.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){let r=[],i=this.notePathToIRI(e.path),s=Fr.Namespace.EXO.term("Asset_fileName");r.push(new Gr.Triple(i,s,new tn.Literal(e.basename)));for(let[c,l]of Object.entries(t)){if(!this.isExocortexProperty(c))continue;let u=this.propertyKeyToIRI(c),f=Array.isArray(l)?l:[l];for(let h of f)if(c==="exo__Instance_class"){let d=this.valueToClassURI(h);r.push(new Gr.Triple(i,u,d))}else{let d=await this.valueToRDFObject(h,e);for(let p of d)if(r.push(new Gr.Triple(i,u,p)),this.vocabularyMapper.hasMappingFor(c)&&p instanceof lo.IRI){let _=this.vocabularyMapper.generateMappedTriple(i,c,p);_&&r.push(_)}}if(c==="exo__Instance_class")for(let h of f){let d=this.expandClassValue(h);if(d){let p=Fr.Namespace.RDF.term("type");r.push(new Gr.Triple(i,p,d))}}}let a=await this.convertBodyWikilinks(e,i);return r.push(...a),r}async convertExo003Note(e,t){let r=Wr.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Wr.Exo003MetadataType.Namespace:break;case Wr.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Wr.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Wr.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Wr.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new lo.IRI(t.uri);return[new Gr.Triple(r,Fr.Namespace.OWL.term("sameAs"),i),new Gr.Triple(i,Fr.Namespace.OWL.term("sameAs"),r)]}convertExo003BlankNode(e,t){let r=this.notePathToIRI(e.path),i=t.uri.replace(/[^a-zA-Z0-9_-]/g,"_");return[new Gr.Triple(r,Fr.Namespace.OWL.term("sameAs"),new Vb.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Wr.Exo003Parser.toTriple(t,i);r.push(s);let a=this.notePathToIRI(e.path);r.push(new Gr.Triple(a,Fr.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.createExo003ReferenceResolver(e),c=a(t.subject),l=a(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new lo.IRI(c.value):new Vb.BlankNode(c.value),f=new lo.IRI(l.value),h=Wr.Exo003Parser.toLiteral(t,s.trim());r.push(new Gr.Triple(u,f,h));let d=this.notePathToIRI(e.path);r.push(new Gr.Triple(d,Fr.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let a=this.vault.getFrontmatter(s);if(a&&Wr.Exo003Parser.isExo003Format(a)){let c=Wr.Exo003Parser.parse(a);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Wr.Exo003MetadataType.Anchor||l.metadata===Wr.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Wr.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let a of t)try{let c=await this.convertNote(a);r.push(...c)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${a.path}": ${l}`);i.push({path:a.path,reason:`Invalid IRI: ${l}`}),console.warn(`\u26A0\uFE0F Skipping file with invalid IRI: ${a.path}`),console.warn(` Reason: ${l}`)}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=encodeURI(r.path),s=`${this.OBSIDIAN_VAULT_SCHEME}${i}`;lo.IRI.isValidIRI(s)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){let t=encodeURI(e);return new lo.IRI(`${this.OBSIDIAN_VAULT_SCHEME}${t}`)}isExocortexProperty(e){return e.startsWith("exo__")||e.startsWith("ems__")}propertyKeyToIRI(e){if(e.startsWith("exo__")){let t=e.substring(5);return Fr.Namespace.EXO.term(t)}if(e.startsWith("ems__")){let t=e.substring(5);return Fr.Namespace.EMS.term(t)}throw new Error(`Invalid property key: ${e}`)}async valueToRDFObject(e,t){if(typeof e=="string"){let r=this.removeQuotes(e),i=this.extractWikilink(r);if(i){let s=this.vault.getFirstLinkpathDest(i,t.path);if(s){let a=this.notePathToIRI(s.path);if(this.isUUID(i)){let c=new tn.Literal(i);return[a,c]}return[a]}if(this.isClassReference(i)){let a=this.expandClassValue(i);if(a)return[a]}return[new tn.Literal(r)]}if(this.isClassReference(r)){let s=this.expandClassValue(r);if(s)return[s]}return this.isISO8601DateTime(r)?[new tn.Literal(r,Fr.Namespace.XSD.term("dateTime"))]:[new tn.Literal(r)]}return typeof e=="boolean"?[new tn.Literal(e.toString())]:typeof e=="number"?[new tn.Literal(e.toString(),Fr.Namespace.XSD.term("decimal"))]:e instanceof Date?[new tn.Literal(e.toISOString(),Fr.Namespace.XSD.term("dateTime"))]:[new tn.Literal(String(e))]}isISO8601DateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?$/.test(e)}removeQuotes(e){let t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.substring(1,t.length-1):e}extractWikilink(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);return t?t[1]:null}valueToClassURI(e){if(typeof e!="string")return new tn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);return s||new tn.Literal(t)}isClassReference(e){return(e.startsWith("ems__")||e.startsWith("exo__"))&&!/\s/.test(e)}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e);if(t.startsWith("ems__")){let r=t.substring(5);return Fr.Namespace.EMS.term(r)}if(t.startsWith("exo__")){let r=t.substring(5);return Fr.Namespace.EXO.term(r)}return null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.extractBodyWikilinks(s),c=Fr.Namespace.EXO.term("Asset_bodyLink");for(let l of a){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new Gr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new Gr.Triple(t,c,f)):r.push(new Gr.Triple(t,c,new tn.Literal(l)))}else r.push(new Gr.Triple(t,c,new tn.Literal(l)))}}catch{}return r}};ei.NoteToRDFConverter=uo;uo.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};uo.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};uo.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};ei.NoteToRDFConverter=uo=o5([(0,$b.injectable)(),l5(0,(0,$b.inject)(u5.DI_TOKENS.IVaultAdapter)),c5("design:paramtypes",[Object])],uo)});var K0=v((cz,Ub)=>{var fo=class{static{o(this,"Wildcard")}constructor(){return h5||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(fo.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(fo.prototype,"termType",{enumerable:!0,value:"Wildcard"});var h5=new fo;Ub.exports.Wildcard=fo});var qb=v((uz,Bb)=>{var d5=(function(){var n=o(function(I,x,O,F){for(O=O||{},F=I.length;F--;O[I[F]]=x);return O},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],a=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],h=[1,45],d=[1,41],p=[1,44],_=[123,126],S=[1,67],E=[39,45,87],A=[13,16,45,197,224,308],C=[1,87],k=[2,281],G=[1,86],Q=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],H=[6,28,29,53,63,70,73,81,83,85],re=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],Ie=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],N=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],K=[13,16,308],ge=[112,132,327,334],dt=[13,16,112,132,308],nt=[1,111],yt=[1,117],Ke=[112,132,327,328,334],Je=[13,16,112,132,308,328],Ue=[28,29,45,53,87],Z=[1,138],$=[1,151],Ze=[1,128],it=[1,127],B=[1,129],Ee=[1,140],Ne=[1,141],X=[1,142],Le=[1,143],Me=[1,144],Re=[1,145],ke=[1,147],ye=[1,148],Fe=[2,457],Te=[1,158],De=[1,159],je=[1,160],se=[1,152],le=[1,153],ue=[1,156],ae=[1,171],oe=[1,172],ce=[1,173],ie=[1,174],fe=[1,175],he=[1,176],de=[1,167],pe=[1,168],ne=[1,169],me=[1,170],Ge=[1,157],$e=[1,166],Pe=[1,161],b=[1,162],w=[1,163],T=[1,164],P=[1,165],Y=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],at=[1,195],pt=[6,31,73,81,83,85],Ae=[2,285],V=[1,199],U=[1,201],q=[6,31,70,73,81,83,85],z=[2,283],we=[1,207],We=[1,218],He=[1,223],Jt=[1,219],Vr=[1,225],Xr=[1,226],wr=[1,224],av=[6,63,70,73,81,83,85],ov=[1,236],cv=[2,334],lv=[1,243],uv=[1,241],Zt=[6,193],ou=[2,349],fv=[2,339],os=[28,128],hv=[47,48,193,272],cu=[47,48,193,242,272],$a=[47,48,193,242,246,272],Va=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Bt=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],dv=[1,271],pv=[1,270],Ot=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],mv=[1,281],gv=[1,280],Er=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],wc=[45,89],lu=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],uu=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],fu=[31,89],hu=[48,87],$s=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],hi=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],yv=[1,313],Ua=[6,85],cp=[6,31,81,83,85],vv=[2,361],Mi=[2,353],Vs=[1,343],Ec=[31,112,335],ki=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],lp=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],_v=[6,109,193],Us=[31,112],Pt=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],up=[1,390],fp=[1,391],cs=[13,16,87,197,308,314],Sv=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],du=[1,417],pu=[1,418],bv=[13,16,48,197,229,308],ls=[6,31,85],wv=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],hp=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],Bs=[29,31,85,112,159,160,161,163,164],mu=[1,443],gu=[1,444],Ev=[1,449],qs=[31,112,193,232,318,335],yu=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Tv=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],dp=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Tc=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],xc=[31,45],xv=[1,507],Av=[1,508],Cv=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],vu=[29,31,85,112,159,160,161,163,164,335],Gs=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Iv=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ov=[2,352],pp=[13,16,197,308,314],Pv=[1,565],Ba=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Rv=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ji=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],Fv=[13,16,87,308],$i=[2,364],qa=[29,31,85,112,159,160,161,163,164,193,232,318,335],_u=[31,112,193,232,272,318,335],Vi=[2,359],Dv=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Su=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],Nv=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Lv=[2,347],mp={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:o(function(x,O,F,J,xe,m,xr){var g=m.length-1;switch(xe){case 1:if(m[g-1]=m[g-1]||{},Oe.base&&(m[g-1].base=Oe.base),Oe.base="",m[g-1].prefixes=Oe.prefixes,Oe.prefixes=null,Oe.pathOnly){if(m[g-1].type==="path"||"termType"in m[g-1])return m[g-1];throw new Error("Received full SPARQL query in path only mode")}else if(m[g-1].type==="path"||"termType"in m[g-1])throw new Error("Received only path in full SPARQL mode");if(m[g-1].type==="update"){let ot={};for(let St of m[g-1].updates)if(St.updateType==="insert"){let ze={};for(let et of St.insert)if(et.type==="bgp"||et.type==="graph")for(let Ur of et.triples)Ur.subject.termType==="BlankNode"&&(ze[Ur.subject.value]=!0),Ur.predicate.termType==="BlankNode"&&(ze[Ur.predicate.value]=!0),Ur.object.termType==="BlankNode"&&(ze[Ur.object.value]=!0);for(let et of Object.keys(ze)){if(ot[et])throw new Error("Detected reuse blank node across different INSERT DATA clauses");ot[et]=!0}}}return m[g-1];case 2:this.$={...m[g-1],...m[g],type:"query"};break;case 4:Oe.base=Ac(m[g]);break;case 5:Oe.prefixes||(Oe.prefixes={}),m[g-1]=m[g-1].substr(0,m[g-1].length-1),m[g]=Ac(m[g]),Oe.prefixes[m[g-1]]=m[g];break;case 6:this.$={...m[g-3],...zs(m[g-2]),...m[g-1],...m[g]};break;case 7:if(!Oe.skipValidation&&(Ep(m[g-3].variables.map(St=>wp(St.expression))).some(St=>St.aggregation==="count"&&!(St.expression instanceof bu))||m[g].group)){for(let St of m[g-3].variables)if(St.termType==="Variable"){if(!m[g].group||!m[g].group.map(ze=>za(ze)).includes(za(St)))throw Error("Projection of ungrouped variable (?"+za(St)+")")}else if(wp(St.expression).length===0){let ze=QC(St.expression);for(let et of ze)if(!m[g].group||!m[g].group.map||!m[g].group.map(Ur=>za(Ur)).includes(za(et)))throw Error("Use of ungrouped variable in projection of operation (?"+za(et)+")")}}let gi=m[g-1].where.filter(ot=>ot.type==="query");if(gi.length>0){let ot=m[g-3].variables.filter(ze=>ze.variable&&ze.variable.value).map(ze=>ze.variable.value),St=Ep(gi.map(ze=>ze.variables)).map(ze=>ze.value||ze.variable.value);for(let ze of ot)if(St.indexOf(ze)>=0)throw Error("Target id of 'AS' (?"+ze+") already used in subquery")}this.$=xt(m[g-3],zs(m[g-2]),m[g-1],m[g]);break;case 8:this.$=xt({queryType:"CONSTRUCT",template:m[g-3]},zs(m[g-2]),m[g-1],m[g]);break;case 9:this.$=xt({queryType:"CONSTRUCT",template:m[g-2]=m[g-2]?m[g-2].triples:[]},zs(m[g-5]),{where:[{type:"bgp",triples:Hs([],m[g-2])}]},m[g]);break;case 10:this.$=xt({queryType:"DESCRIBE",variables:m[g-3]==="*"?[new bu]:m[g-3]},zs(m[g-2]),m[g-1],m[g]);break;case 11:this.$=xt({queryType:"ASK"},zs(m[g-2]),m[g-1],m[g]);break;case 12:this.$=xt(m[g-1],{variables:[new bu]});break;case 13:let Rc=m[g].map(ot=>ot.value||ot.variable.value),Qa=YC(Rc);if(Qa.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Qa[0]+")");this.$=xt(m[g-1],{variables:m[g]});break;case 14:this.$=xt({queryType:"SELECT"},m[g]&&(m[g-1]=Tr(m[g]),m[g]={},m[g][m[g-1]]=!0,m[g]));break;case 16:case 27:this.$=Ga(m[g-3],{variable:m[g-1]});break;case 17:case 18:this.$=xt(m[g-3],m[g-2],m[g-1],m[g],{type:"query"});break;case 19:case 58:this.$={iri:m[g],named:!!m[g-1]};break;case 20:this.$={where:m[g].patterns};break;case 21:this.$=xt(m[g-1],m[g]);break;case 22:this.$=xt(m[g-2],m[g-1],m[g]);break;case 23:this.$={group:m[g]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Ga(m[g]);break;case 26:this.$=Ga(m[g-1]);break;case 29:this.$={having:m[g]};break;case 30:this.$={order:m[g]};break;case 32:this.$=Ga(m[g],{descending:!0});break;case 35:this.$={limit:Ha(m[g])};break;case 36:this.$={offset:Ha(m[g])};break;case 37:this.$={limit:Ha(m[g-2]),offset:Ha(m[g])};break;case 38:this.$={limit:Ha(m[g]),offset:Ha(m[g-2])};break;case 39:case 43:this.$={type:"values",values:m[g]};break;case 40:case 84:this.$=m[g-1].map(ot=>({[m[g-3]]:ot}));break;case 41:case 85:this.$=m[g-1].map(()=>({}));break;case 42:case 86:var mi=m[g-4].length;m[g-4]=m[g-4].map(gp),this.$=m[g-1].map(function(ot){if(ot.length!==mi)throw Error("Inconsistent VALUES length");for(var St={},ze=0;ze<mi;ze++)St["?"+m[g-4][ze].value]=ot[ze];return St});break;case 44:case 65:case 100:case 126:case 175:this.$=m[g-1];break;case 45:this.$={type:"update",updates:Ui(m[g-2],m[g-1])};break;case 46:this.$=xt({type:"load",silent:!!m[g-2],source:m[g-1]},m[g]&&{destination:m[g]});break;case 47:this.$={type:Tr(m[g-2]),silent:!!m[g-1],graph:m[g]};break;case 48:this.$={type:Tr(m[g-4]),silent:!!m[g-3],source:m[g-2],destination:m[g]};break;case 49:this.$={type:"create",silent:!!m[g-2],graph:{type:"graph",name:m[g]}};break;case 50:this.$={updateType:"insert",insert:Hv(m[g])};break;case 51:this.$={updateType:"delete",delete:Ap(Hv(m[g]))};break;case 52:this.$={updateType:"deletewhere",delete:Ap(m[g])};break;case 53:this.$={updateType:"insertdelete",...m[g-4],...m[g-3],...zs(m[g-2],"using"),where:m[g].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=m[g];break;case 55:this.$={delete:Ap(m[g-1]),insert:m[g]||[]};break;case 56:this.$={delete:[],insert:m[g]};break;case 59:this.$={graph:m[g]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:m[g]};break;case 64:this.$={[Tr(m[g])]:!0};break;case 66:this.$=m[g-1]?di(m[g],[m[g-1]]):di(m[g]);break;case 67:var Oc=xt(m[g-3]||{triples:[]},{type:"graph",name:m[g-5]});this.$=m[g]?[Oc,m[g]]:[Oc];break;case 68:case 73:this.$={type:"bgp",triples:di(m[g-2],[m[g-1]])};break;case 69:this.$={type:"group",patterns:[m[g-1]]};break;case 70:for(let ot of m[g-1].filter(St=>St.type==="bind")){let St=m[g-1].indexOf(ot),ze=new Set;for(let et of m[g-1].slice(0,St))(et.type==="group"||et.type==="bgp")&&Gv(et).forEach(Ur=>ze.add(Ur));if(ze.has(ot.variable.value))throw Error("Variable used to bind is already bound (?"+ot.variable.value+")")}this.$={type:"group",patterns:m[g-1]};break;case 71:this.$=m[g-1]?di([m[g-1]],m[g]):di(m[g]);break;case 72:this.$=m[g]?[m[g-2],m[g]]:m[g-2];break;case 75:this.$=xt(m[g],{type:"optional"});break;case 76:this.$=xt(m[g],{type:"minus"});break;case 77:this.$=xt(m[g],{type:"graph",name:m[g-1]});break;case 78:this.$=xt(m[g],{type:"service",name:m[g-1],silent:!!m[g-2]});break;case 79:this.$={type:"filter",expression:m[g]};break;case 80:this.$={type:"bind",variable:m[g-1],expression:m[g-3]};break;case 89:this.$=Ic(m[g]);break;case 90:this.$=void 0;break;case 91:this.$=m[g-1].length?{type:"union",patterns:di(m[g-1].map(vp),[vp(m[g])])}:m[g];break;case 95:this.$={...m[g],function:m[g-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Ui(m[g-2],m[g-1]),distinct:!!m[g-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=Ui(m[g-2],m[g-1]);break;case 101:this.$=di(m[g-2],[m[g-1]]);break;case 102:case 112:this.$=xp(m[g].map(ot=>xt(Bi(m[g-1]),ot)));break;case 103:this.$=xp(Hs(m[g].map(ot=>xt(Bi(m[g-1].entity),ot)),m[g-1].triples));break;case 105:this.$=di([m[g-1]],m[g]);break;case 106:this.$=di(m[g]);break;case 107:this.$=bp(m[g-1],m[g]);break;case 109:case 237:this.$=Oe.factory.namedNode(jC);break;case 110:case 118:this.$=Ui(m[g-1],m[g]);break;case 111:this.$=m[g]?{annotation:m[g],object:m[g-1]}:m[g-1];break;case 113:this.$=m[g]?xp(Hs(m[g].map(ot=>xt(Bi(m[g-1].entity),ot)),m[g-1].triples)):m[g-1].triples;break;case 114:this.$=bp(...m[g-1],m[g]);break;case 116:this.$=bp(...m[g]);break;case 117:case 159:case 163:this.$=[m[g-1],m[g]];break;case 119:this.$=m[g]?{object:m[g-1],annotation:m[g]}:m[g-1];break;case 120:this.$=m[g-1].length?Wa("|",Ui(m[g-1],m[g])):m[g];break;case 121:this.$=m[g-1].length?Wa("/",Ui(m[g-1],m[g])):m[g];break;case 122:this.$=m[g]?Wa(m[g],[m[g-1]]):m[g-1];break;case 123:this.$=m[g-1]?Wa(m[g-1],[m[g]]):m[g];break;case 125:case 131:this.$=Wa(m[g-1],[m[g]]);break;case 129:this.$=Wa("|",Ui(m[g-2],m[g-1]));break;case 132:case 134:this.$=HC(m[g-1]);break;case 133:case 135:this.$=zC(m[g-1]);break;case 140:this.$={entity:m[g],triples:[]};break;case 145:this.$=gp(m[g]);break;case 149:this.$=Oe.factory.namedNode(Mv);break;case 151:case 153:case 158:case 162:this.$=yp(m[g-1],m[g]);break;case 152:this.$=["||",m[g]];break;case 154:this.$=["&&",m[g]];break;case 156:this.$=er(m[g-1],[m[g-2],m[g]]);break;case 157:this.$=er(m[g-2]?"notin":"in",[m[g-3],m[g]]);break;case 160:this.$=["+",yp(m[g-1],m[g])];break;case 161:var Tu=pi(m[g-1].value.replace("-",""),m[g-1].datatype);this.$=["-",yp(Tu,m[g])];break;case 164:this.$=er("UPLUS",[m[g]]);break;case 165:this.$=er(m[g-1],[m[g]]);break;case 166:this.$=er("UMINUS",[m[g]]);break;case 177:this.$=er(Tr(m[g-1]));break;case 178:this.$=er(Tr(m[g-3]),[m[g-1]]);break;case 179:this.$=Ic(er(Tr(m[g-3]),[m[g-1]]));break;case 180:this.$=er(Tr(m[g-5]),[m[g-3],m[g-1]]);break;case 181:this.$=er(Tr(m[g-7]),[m[g-5],m[g-3],m[g-1]]);break;case 182:this.$=Ic(er(Tr(m[g-7]),[m[g-5],m[g-3],m[g-1]]));break;case 183:this.$=er(Tr(m[g-1]),m[g]);break;case 184:this.$=er("bound",[gp(m[g-1])]);break;case 185:this.$=er(m[g-1],[]);break;case 186:this.$=er(m[g-3],[m[g-1]]);break;case 187:this.$=er(m[g-2]?"notexists":"exists",[vp(m[g])]);break;case 188:case 189:this.$=Ga(m[g-1],{type:"aggregate",aggregation:Tr(m[g-4]),distinct:!!m[g-2]});break;case 190:this.$=Ga(m[g-2],{type:"aggregate",aggregation:Tr(m[g-5]),distinct:!!m[g-3],separator:typeof m[g-1]=="string"?m[g-1]:" "});break;case 192:this.$=pi(m[g]);break;case 193:this.$=BC(m[g-1],Tr(m[g].substr(1)));break;case 194:this.$=pi(m[g-2],m[g]);break;case 195:case 204:this.$=pi(m[g],kv);break;case 196:case 205:this.$=pi(m[g],jv);break;case 197:case 206:this.$=pi(Tr(m[g]),$v);break;case 200:this.$=pi(m[g].toLowerCase(),UC);break;case 201:this.$=pi(m[g].substr(1),kv);break;case 202:this.$=pi(m[g].substr(1),jv);break;case 203:this.$=pi(m[g].substr(1).toLowerCase(),$v);break;case 207:case 208:this.$=qv(m[g],1);break;case 209:case 210:this.$=qv(m[g],3);break;case 211:this.$=Oe.factory.namedNode(Ac(m[g]));break;case 213:var xu=m[g].indexOf(":"),Pc=m[g].substr(0,xu),Au=Oe.prefixes[Pc];if(!Au)throw new Error("Unknown prefix: "+Pc);var Et=Ac(Au+m[g].substr(xu+1));this.$=Oe.factory.namedNode(Et);break;case 214:if(m[g]=m[g].substr(0,m[g].length-1),!(m[g]in Oe.prefixes))throw new Error("Unknown prefix: "+m[g]);var Et=Ac(Oe.prefixes[m[g]]);this.$=Oe.factory.namedNode(Et);break;case 215:this.$=Cc(m[g].replace(/^(_:)/,""));break;case 216:this.$=Cc();break;case 217:case 218:case 232:this.$=Ic(_p(m[g-3],m[g-2],m[g-1]));break;case 230:case 231:this.$=Ic(m[g-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:m[g-1].push(m[g]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[m[g]];break;case 308:m[g-3].push(m[g-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:m[g-2].push(m[g-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:a},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:h,33:35,39:[1,37],44:39,55:40,87:d,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(_,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:S,87:d},n(E,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(A,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:C,29:k,52:84,53:G,56:85},{19:88,28:C,29:k,52:89,53:G,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:G},n(Q,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(H,[2,263],{34:96}),n(H,[2,261],{44:39,55:40,307:43,139:97,13:f,16:h,87:d,308:p}),n(H,[2,262]),n(re,[2,259]),n(Ie,[2,143]),n(Ie,[2,144]),n([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),n(N,[2,211]),n(N,[2,212]),n(N,[2,213]),n(N,[2,214]),{19:98,28:C,29:k,52:99,53:G,56:85},{6:[2,309],99:100,193:[1,101]},n(K,[2,311],{101:102,328:[1,103]}),n(ge,[2,317],{104:104,328:[1,105]}),n(dt,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:nt,114:110},{29:nt,114:112},{29:nt,114:113},{118:114,123:[1,115],125:116,126:yt},n(Ke,[2,315]),n(Ke,[2,316]),n(Je,[2,319]),n(Je,[2,320]),n(Je,[2,321]),n(_,[2,327]),{13:f,16:h,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:S,87:d}),n(Ue,[2,269]),n(Ue,[2,15]),{13:f,16:h,44:136,45:Z,46:120,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(E,[2,14]),n(E,[2,274]),n(E,[2,271]),n(E,[2,272]),n(e,[2,4]),{13:[1,177]},n(Y,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},n(c,[2,410]),n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:h,45:[1,193],55:194,197:at,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(A,[2,419]),n(pt,Ae,{20:196,59:197,69:198,70:V}),n(l,[2,250]),{29:U,57:200},n(K,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(q,z,{23:204,58:205,62:206,63:we}),n(l,[2,252]),{19:208,28:C,29:k,52:209,53:G,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,145:212,172:221,185:213,187:214,231:Jt,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(av,[2,265],{56:85,35:227,52:228,19:229,28:C,29:k,53:G}),n(re,[2,260]),n(q,z,{58:205,62:206,23:230,63:we}),n(l,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:h,55:232,307:43,308:p},n(K,[2,312]),{105:233,112:ov,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(ge,[2,318]),n(K,cv,{108:240,133:242,112:lv,132:uv}),n(dt,[2,323]),{112:[1,244]},{112:[2,325]},n(Zt,[2,50]),n(Q,ou,{135:245,136:246,143:247,144:248,31:fv,112:fv}),n(Zt,[2,51]),n(Zt,[2,52]),n(os,[2,328],{119:249}),{29:nt,114:250},n(os,[2,56]),{29:nt,114:251},n(_,[2,59]),n(Ue,[2,270]),{47:[1,252]},n(hv,[2,150]),n(cu,[2,428],{240:253}),n($a,[2,430],{244:254}),n($a,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),n(Va,[2,440],{252:264}),n(Bt,[2,448],{260:265}),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:266,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:267,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:268,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Bt,[2,167]),n(Bt,[2,168]),n(Bt,[2,169]),n(Bt,[2,170],{176:269,45:dv,89:pv}),n(Bt,[2,171]),n(Bt,[2,172]),n(Bt,[2,173]),n(Bt,[2,174]),{13:f,16:h,44:136,45:Z,46:272,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:mv,89:gv,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(Er,[2,192],{292:[1,286],293:[1,287]}),n(Er,[2,195]),n(Er,[2,196]),n(Er,[2,197]),n(Er,[2,198]),n(Er,[2,199]),n(Er,[2,200]),{13:f,16:h,44:39,55:40,82:$,87:d,139:289,172:291,255:154,257:155,266:290,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(wc,[2,452]),n(wc,[2,453]),n(wc,[2,454]),n(wc,[2,455]),n(wc,[2,456]),{279:[2,458]},n(lu,[2,207]),n(lu,[2,208]),n(lu,[2,209]),n(lu,[2,210]),n(Er,[2,201]),n(Er,[2,202]),n(Er,[2,203]),n(Er,[2,204]),n(Er,[2,205]),n(Er,[2,206]),n(e,[2,5]),n(uu,[2,297],{88:295}),n(fu,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(hu,[2,301]),n(Y,[2,43]),n(Y,[2,82]),n(Y,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n($s,[2,123]),n($s,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(hi,[2,124]),{13:f,16:h,45:[1,311],55:194,89:[1,310],197:at,223:312,225:308,226:309,229:yv,307:43,308:p},n(c,i,{215:10,214:314}),n(hi,[2,236]),n(hi,[2,237]),n(Ua,[2,6]),n(cp,[2,287],{60:315,72:316,73:[1,317]}),n(pt,[2,286]),{13:f,16:h,45:Z,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n([6,31,63,70,73,81,83,85],[2,20]),n(Q,vv,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Mi,31:Mi,85:Mi,112:Mi,159:Mi,160:Mi,161:Mi,163:Mi,164:Mi,41:s}),{13:f,16:h,55:331,307:43,308:p},n(K,[2,280]),n(Ua,[2,7]),n(pt,Ae,{59:197,69:198,20:332,70:V}),n(q,[2,284]),{64:[1,333]},n(q,z,{58:205,62:206,23:334,63:we}),n(l,[2,254]),n(Q,ou,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:h,44:39,55:40,87:d,139:342,186:339,190:340,195:341,197:Vs,307:43,308:p},n(Ec,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:h,87:d,197:Vs,308:p}),n(ki,[2,227]),n(ki,[2,228]),n(ki,[2,229]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,172:221,185:351,187:350,200:348,230:347,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},{13:f,16:h,44:39,55:40,87:d,139:342,186:352,190:340,195:341,197:Vs,307:43,308:p},n(ki,[2,146]),n(ki,[2,147]),n(ki,[2,148]),n(ki,[2,149]),{13:f,16:h,44:354,55:355,82:$,87:d,172:357,237:356,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:358,312:wr,313:353},n(lp,[2,215]),n(lp,[2,216]),n(q,z,{58:205,62:206,23:359,63:we}),n(H,[2,264]),n(av,[2,266]),n(Ua,[2,11]),n(r,[2,308],{6:[2,310]}),n(Zt,[2,313],{102:360,120:361,121:[1,362]}),n(Zt,[2,47]),n(Zt,[2,63]),n(Zt,[2,64]),{13:f,16:h,55:363,307:43,308:p},n(Zt,[2,336]),n(Zt,[2,337]),n(Zt,[2,338]),{109:[1,364]},n(_v,[2,60]),{13:f,16:h,55:365,307:43,308:p},n(K,[2,335]),{13:f,16:h,55:366,307:43,308:p},{31:[1,367]},n(Us,[2,341],{137:368}),n(Us,[2,340]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,145:369,172:221,185:213,187:214,231:Jt,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},{28:[1,370],127:371,128:[1,372]},n(os,[2,330],{124:373,125:374,126:yt}),n(os,[2,57]),{44:375,87:d},n(hv,[2,151],{241:376,242:[1,377]}),n(cu,[2,153],{245:378,246:[1,379]}),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,247:380,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{250:[1,381]},n(Pt,[2,432]),n(Pt,[2,433]),n(Pt,[2,434]),n(Pt,[2,435]),n(Pt,[2,436]),n(Pt,[2,437]),{250:[2,439]},n([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:ae,298:oe,299:ce,300:ie,301:fe,302:he}),n(Va,[2,162],{261:388,262:389,39:up,338:fp}),n(Bt,[2,164]),n(Bt,[2,165]),n(Bt,[2,166]),n(Ot,[2,95]),n(Ot,[2,96]),n(Pt,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Ot,[2,177]),{13:f,16:h,44:136,45:Z,46:395,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:396,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:397,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:398,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:399,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,183]),n(Ot,[2,98]),n(Pt,[2,381],{180:400}),{87:[1,401]},n(Ot,[2,185]),{13:f,16:h,44:136,45:Z,46:402,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{29:U,57:403},n(Er,[2,193]),{13:f,16:h,55:404,307:43,308:p},{13:f,16:h,44:39,55:40,87:d,139:342,195:405,197:Vs,307:43,308:p},n(cs,[2,233]),n(cs,[2,234]),n(cs,[2,235]),n(Sv,[2,459],{281:406,325:[1,407]}),n(Pt,[2,463],{284:408,325:[1,409]}),n(Pt,[2,465],{286:410,325:[1,411]}),{13:f,16:h,31:[1,412],55:414,82:$,171:413,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,419],89:[1,420]},{29:[1,421]},n(hu,[2,302]),n(uu,[2,367],{167:422}),n(fu,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(hu,[2,371]),n($s,[2,122]),n($s,[2,417]),n($s,[2,413]),n($s,[2,414]),n($s,[2,415]),n(hi,[2,125]),n(hi,[2,127]),n(hi,[2,128]),n(bv,[2,420],{227:426}),n(hi,[2,130]),{13:f,16:h,55:194,197:at,223:427,307:43,308:p},{48:[1,428]},n(ls,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(cp,[2,288]),{64:[1,433]},n(pt,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:h,45:Z,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(wv,[2,293]),n(hp,[2,92]),n(hp,[2,93]),n(hp,[2,94]),{45:dv,89:pv,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:C,29:k,56:85},{19:438,28:C,29:k,56:85},n(Bs,[2,355],{149:439}),n(Bs,[2,354]),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,156:440,172:221,185:441,203:442,231:gu,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(H,[2,19]),n(ls,[2,21]),{13:f,16:h,44:450,45:Ev,55:323,65:445,66:446,67:447,68:448,87:d,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ua,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(Q,[2,386],{31:[2,388]}),n(Ec,[2,102]),n(qs,[2,391],{191:452}),n(Q,[2,395],{196:453,198:454}),n(Q,[2,108]),n(Q,[2,109]),n(Ec,[2,103]),n(Ec,[2,104]),n(Ec,[2,390]),{13:f,16:h,44:215,45:We,48:[1,455],55:220,82:$,87:d,89:He,172:221,185:351,187:350,200:456,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(yu,[2,424]),n(Tv,[2,136]),n(Tv,[2,137]),n(dp,[2,140]),{232:[1,457]},{13:f,16:h,44:39,55:40,87:d,139:342,195:458,197:Vs,307:43,308:p},n(cs,[2,219]),n(cs,[2,220]),n(cs,[2,221]),n(cs,[2,222]),n(cs,[2,223]),n(Ua,[2,10]),n(Zt,[2,46]),n(Zt,[2,314]),{112:ov,122:459},n(Zt,[2,62]),n(K,cv,{133:242,108:460,112:lv,132:uv}),n(_v,[2,61]),n(Zt,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(Us,[2,351],{146:463,335:[1,464]}),{29:U,57:465},n(os,[2,329]),n(K,[2,332],{129:466,327:[1,467]}),n(os,[2,55]),n(os,[2,331]),{48:[1,468]},n(cu,[2,429]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n($a,[2,431]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,243:470,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n($a,[2,156]),{45:mv,89:gv,179:471},n(Va,[2,441]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,251:472,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Bt,[2,444],{256:473}),n(Bt,[2,446],{258:474}),n(Pt,[2,442]),n(Pt,[2,443]),n(Bt,[2,449]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,255:154,257:155,259:475,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,450]),n(Pt,[2,451]),n(Pt,[2,379],{178:476}),n(Pt,[2,378]),n([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:h,44:136,45:Z,46:482,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{48:[1,483]},{48:[1,484]},n(Ot,[2,187]),n(Er,[2,194]),{13:f,16:h,44:39,55:40,82:$,87:d,139:289,172:291,255:154,257:155,266:290,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,320:485},{13:f,16:h,39:[1,487],44:136,45:Z,46:488,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,282:486,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Sv,[2,460]),{13:f,16:h,44:136,45:Z,46:489,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,464]),{13:f,16:h,44:136,45:Z,46:490,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,466]),n(Y,[2,40]),n(uu,[2,298]),n(Tc,[2,87]),n(Tc,[2,88]),n(Tc,[2,89]),n(Tc,[2,90]),{13:f,16:h,55:492,82:$,172:493,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,311:494,312:wr,315:491},n(Y,[2,41]),n(fu,[2,300]),n(xc,[2,303],{92:495}),{13:f,16:h,31:[1,496],55:414,82:$,171:497,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,498],89:[1,499]},{29:[1,500]},n(hu,[2,372]),{13:f,16:h,48:[2,422],55:194,197:at,223:312,226:502,228:501,229:yv,307:43,308:p},n(hi,[2,131]),n(hi,[2,126]),n(ls,[2,22]),n(ls,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:h,44:510,45:Z,55:323,67:321,68:322,74:505,75:506,76:xv,77:320,78:Av,79:509,87:d,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(wv,[2,294]),n(Cv,[2,69]),n(Cv,[2,70]),n(pt,Ae,{59:197,69:198,20:511,70:V}),n(q,z,{58:205,62:206,23:512,63:we}),{29:[2,375],31:[2,71],84:522,85:a,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(Bs,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:d}),n(vu,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:d}),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,172:221,185:351,203:536,212:534,231:gu,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:d}),n(q,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:h,45:Ev,87:d,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(Gs,[2,291]),n(Gs,[2,24]),n(Gs,[2,25]),{13:f,16:h,44:136,45:Z,46:539,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Gs,[2,28]),n(q,z,{58:205,62:206,23:540,63:we}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(qs,[2,107]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,172:221,185:351,187:350,199:543,200:544,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(Iv,[2,132]),n(yu,[2,425]),n(Iv,[2,133]),{13:f,16:h,44:354,55:355,82:$,87:d,172:357,237:356,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:358,312:wr,313:545},n(Zt,[2,54]),n(Zt,[2,48]),n(Us,[2,342]),{13:f,16:h,44:39,55:40,87:d,139:546,307:43,308:p},n(Us,[2,68]),n(Q,[2,350],{31:Ov,112:Ov}),n(Zt,[2,53]),{13:f,16:h,55:547,307:43,308:p},n(K,[2,333]),n(Ue,[2,16]),n(cu,[2,152]),n($a,[2,154]),n($a,[2,157]),n(Va,[2,159]),n(Va,[2,160],{262:389,261:548,39:up,338:fp}),n(Va,[2,161],{262:389,261:549,39:up,338:fp}),n(Bt,[2,163]),{13:f,16:h,44:136,45:Z,46:550,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,178]),n(Ot,[2,179]),{13:f,16:h,44:136,45:Z,46:551,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:552,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:553,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{48:[1,554],272:[1,555]},n(Ot,[2,184]),n(Ot,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:h,55:194,197:at,223:562,307:43,308:p},n(pp,[2,224]),n(pp,[2,225]),n(pp,[2,226]),{31:[1,563],45:Pv,94:564},n(Y,[2,84]),n(uu,[2,368]),n(Y,[2,85]),n(fu,[2,370]),n(xc,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ls,[2,35],{83:[1,569]}),n(ls,[2,36],{81:[1,570]}),n(cp,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:h,45:Z,76:xv,78:Av,87:d,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(Ba,[2,295]),{45:Z,77:572},{45:Z,77:573},n(Ba,[2,33]),n(Ba,[2,34]),{31:[2,275],50:574,84:575,85:a},{31:[2,277],51:576,84:577,85:a},n(Bs,[2,356]),n(Rv,[2,357],{152:578,335:[1,579]}),n(ji,[2,74]),{29:U,57:580},{29:U,57:581},{13:f,16:h,44:39,55:40,87:d,139:582,307:43,308:p},n(Fv,[2,365],{162:583,328:[1,584]}),{13:f,16:h,45:Z,55:323,67:321,68:322,77:320,79:585,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},{45:[1,586]},n(ji,[2,81]),{29:U,57:587},n(Bs,[2,73]),n(Q,[2,362],{29:$i,31:$i,85:$i,112:$i,159:$i,160:$i,161:$i,163:$i,164:$i}),n(vu,[2,112]),n(qa,[2,401],{206:588}),n(Q,[2,405],{209:589,210:590}),n(Q,[2,403]),n(Q,[2,404]),n(vu,[2,113]),n(vu,[2,400]),{13:f,16:h,44:215,45:mu,48:[1,591],55:220,82:$,87:d,89:He,172:221,185:351,203:536,212:592,231:gu,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(yu,[2,426]),n(dp,[2,138]),n(dp,[2,139]),{232:[1,593]},n(Gs,[2,292]),{47:[1,595],48:[1,594]},n(Ua,[2,9]),n(qs,[2,392]),n(qs,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:h,87:d,197:Vs,308:p}),n(qs,[2,110],{272:[1,598]}),n(_u,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(os,[2,58]),n(Bt,[2,445]),n(Bt,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Ot,[2,99]),n(Pt,[2,382]),n([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),n(Ot,[2,188]),n(Ot,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:h,55:492,82:$,172:493,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,311:494,312:wr,315:611},n(Y,[2,42]),n(xc,[2,304]),{13:f,16:h,55:414,82:$,95:612,171:613,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,614],45:Pv,94:615},n(hi,[2,129]),n(bv,[2,421]),{82:[1,616]},{82:[1,617]},n(Ba,[2,296]),n(Ba,[2,31]),n(Ba,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(Q,vv,{155:330,153:618,154:619,29:Vi,31:Vi,85:Vi,112:Vi,159:Vi,160:Vi,161:Vi,163:Vi,164:Vi}),n(Rv,[2,358]),n(ji,[2,75]),n(ji,[2,76]),{29:U,57:620},{13:f,16:h,44:39,55:40,87:d,139:621,307:43,308:p},n(Fv,[2,366]),n(ji,[2,79]),{13:f,16:h,44:136,45:Z,46:622,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(ji,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(qa,[2,117]),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,172:221,185:351,203:536,211:626,212:627,231:gu,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:wr},n(ki,[2,134]),n(yu,[2,427]),n(ki,[2,135]),n(Gs,[2,26]),{44:628,87:d},n(qs,[2,106]),n(qs,[2,394]),n(Q,[2,396]),n(_u,[2,111]),n(_u,[2,398]),{13:f,16:h,44:39,55:40,87:d,139:342,186:629,190:340,195:341,197:Vs,307:43,308:p},n(lp,[2,217]),n(Q,ou,{144:248,140:630,143:631,31:[2,343]}),n(Ot,[2,97]),n(Pt,[2,380]),n(Ot,[2,180]),{13:f,16:h,44:136,45:Z,46:632,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:633,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:h,48:[1,636],55:414,82:$,171:637,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},n(Dv,[2,305]),n(Y,[2,86]),n(xc,[2,374]),n(ls,[2,37]),n(ls,[2,38]),n(Bs,[2,72]),n(Bs,[2,360]),n(ji,[2,77]),{29:U,57:638},{47:[1,639]},{29:[2,376]},n(qa,[2,402]),n(qa,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:d}),n(qa,[2,118],{272:[1,641]}),n(Su,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:de,304:pe,305:ne,306:me},n(Tc,[2,218]),n(xc,[2,44]),n(Dv,[2,306]),n(ji,[2,78]),{44:651,87:d},n(qa,[2,116]),n(Q,[2,406]),n(Su,[2,119]),n(Su,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:d}),n(Gs,[2,27]),n(_u,[2,230]),n(Nv,[2,345],{141:653,335:[1,654]}),n(Ot,[2,181]),n(Ot,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(Q,ou,{144:248,142:657,143:658,31:Lv,112:Lv}),n(Nv,[2,346]),n(ji,[2,80]),n(Su,[2,231]),n(Us,[2,67]),n(Us,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:o(function(x,O){if(O.recoverable)this.trace(x);else{var F=new Error(x);throw F.hash=O,F}},"parseError"),parse:o(function(x){var O=this,F=[0],J=[],xe=[null],m=[],xr=this.table,g="",mi=0,Oc=0,Tu=0,xu=2,Pc=1,Au=m.slice.call(arguments,1),Et=Object.create(this.lexer),gi={yy:{}};for(var Rc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Rc)&&(gi.yy[Rc]=this.yy[Rc]);Et.setInput(x,gi.yy),gi.yy.lexer=Et,gi.yy.parser=this,typeof Et.yylloc>"u"&&(Et.yylloc={});var Qa=Et.yylloc;m.push(Qa);var ot=Et.options&&Et.options.ranges;typeof gi.yy.parseError=="function"?this.parseError=gi.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(yi){F.length=F.length-2*yi,xe.length=xe.length-yi,m.length=m.length-yi}o(St,"popStack");for(var ze=o(function(){var yi;return yi=Et.lex()||Pc,typeof yi!="number"&&(yi=O.symbols_[yi]||yi),yi},"lex"),et,Ur,Qs,un,YV,Cp,Ya={},Cu,qi,zv,Iu;;){if(Qs=F[F.length-1],this.defaultActions[Qs]?un=this.defaultActions[Qs]:((et===null||typeof et>"u")&&(et=ze()),un=xr[Qs]&&xr[Qs][et]),typeof un>"u"||!un.length||!un[0]){var Ip="";Iu=[];for(Cu in xr[Qs])this.terminals_[Cu]&&Cu>xu&&Iu.push("'"+this.terminals_[Cu]+"'");Et.showPosition?Ip="Parse error on line "+(mi+1)+`:
270
+ `),t}};Wf.RDFSerializer=$0});var q0=v(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.TransactionError=ys.TripleNotFoundError=ys.TripleAlreadyExistsError=void 0;var V0=class extends Error{static{o(this,"TripleAlreadyExistsError")}constructor(e){super(`Triple already exists: ${e.toString()}`),this.name="TripleAlreadyExistsError"}};ys.TripleAlreadyExistsError=V0;var U0=class extends Error{static{o(this,"TripleNotFoundError")}constructor(e){super(`Triple not found: ${e.toString()}`),this.name="TripleNotFoundError"}};ys.TripleNotFoundError=U0;var B0=class extends Error{static{o(this,"TransactionError")}constructor(e){super(e),this.name="TransactionError"}};ys.TransactionError=B0});var zf=v(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.LRUCache=void 0;var G0=class{static{o(this,"LRUCache")}constructor(e){this.maxSize=e,this.cache=new Map}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};Hf.LRUCache=G0});var kb=v(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.InMemoryTripleStore=void 0;var vs=q0(),Qf=Ye(),t5=Lt(),r5=mt(),n5=hn(),i5=zf(),s5=n5.Namespace.XSD.term("string").value,a5=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,co="__default__",W0=class n{static{o(this,"InMemoryTripleStore")}constructor(){this.triples=new Map,this.spo=new Map,this.sop=new Map,this.pso=new Map,this.pos=new Map,this.osp=new Map,this.ops=new Map,this.queryCache=new i5.LRUCache(1e3),this.uuidIndex=new Map,this.namedGraphs=new Map}async add(e){let t=this.getTripleKey(e);if(this.triples.has(t))return;this.triples.set(t,e);let r=this.getNodeKey(e.subject),i=this.getNodeKey(e.predicate),s=this.getNodeKey(e.object);this.addToIndex(this.spo,r,i,s),this.addToIndex(this.sop,r,s,i),this.addToIndex(this.pso,i,r,s),this.addToIndex(this.pos,i,s,r),this.addToIndex(this.osp,s,r,i),this.addToIndex(this.ops,s,i,r),this.addToUUIDIndex(e.subject),this.queryCache.clear()}async remove(e){let t=this.getTripleKey(e);if(!this.triples.has(t))return!1;this.triples.delete(t);let r=this.getNodeKey(e.subject),i=this.getNodeKey(e.predicate),s=this.getNodeKey(e.object);return this.removeFromIndex(this.spo,r,i,s),this.removeFromIndex(this.sop,r,s,i),this.removeFromIndex(this.pso,i,r,s),this.removeFromIndex(this.pos,i,s,r),this.removeFromIndex(this.osp,s,r,i),this.removeFromIndex(this.ops,s,i,r),this.queryCache.clear(),!0}async has(e){let t=this.getTripleKey(e);return this.triples.has(t)}async match(e,t,r){let i=this.getMatchCacheKey(e,t,r),s=this.queryCache.get(i);if(s!==void 0)return s;let a;return!e&&!t&&!r?a=Array.from(this.triples.values()):e&&t&&r?a=this.matchSPO(e,t,r):e&&t?a=this.matchSP(e,t):e&&r?a=this.matchSO(e,r):t&&r?a=this.matchPO(t,r):e?a=this.matchS(e):t?a=this.matchP(t):r?a=this.matchO(r):a=[],this.queryCache.set(i,a),a}async addAll(e){for(let t of e)await this.add(t)}async removeAll(e){let t=0;for(let r of e)await this.remove(r)&&t++;return t}async clear(){this.triples.clear(),this.spo.clear(),this.sop.clear(),this.pso.clear(),this.pos.clear(),this.osp.clear(),this.ops.clear(),this.uuidIndex.clear(),this.queryCache.clear()}async count(){return this.triples.size}async subjects(){let e=new Set;for(let t of this.triples.values())e.add(t.subject);return Array.from(e)}async predicates(){let e=new Set;for(let t of this.triples.values())e.add(t.predicate);return Array.from(e)}async objects(){let e=new Set;for(let t of this.triples.values())e.add(t.object);return Array.from(e)}async beginTransaction(){return new H0(this)}async findSubjectsByUUID(e){return this.findSubjectsByUUIDSync(e)}findSubjectsByUUIDSync(e){let t=e.toLowerCase(),r=this.uuidIndex.get(t);if(!r||r.size===0)return[];let i=[];for(let s of r)this.spo.has(`i:${s}`)&&i.push(new Qf.IRI(s));return i}addToUUIDIndex(e){if(!(e instanceof Qf.IRI))return;let t=e.value,r=t.match(a5);if(r)for(let i of r){let s=i.toLowerCase();this.uuidIndex.has(s)||this.uuidIndex.set(s,new Set),this.uuidIndex.get(s).add(t)}}matchSPO(e,t,r){let i=this.getNodeKey(e),s=this.getNodeKey(t),a=this.getNodeKey(r),c=this.spo.get(i);if(!c)return[];let l=c.get(s);if(!l)return[];if(l.has(a)){let u=this.buildTripleKey(i,s,a),f=this.triples.get(u);return f?[f]:[]}return[]}matchSP(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.spo.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(r,i,c))):[]}matchSO(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.sop.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(r,c,i))):[]}matchPO(e,t){let r=this.getNodeKey(e),i=this.getNodeKey(t),s=this.pos.get(r);if(!s)return[];let a=s.get(i);return a?this.getTriplesByKeys(Array.from(a).map(c=>this.buildTripleKey(c,r,i))):[]}matchS(e){let t=this.getNodeKey(e),r=this.spo.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(t,s,c));return this.getTriplesByKeys(i)}matchP(e){let t=this.getNodeKey(e),r=this.pso.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(s,t,c));return this.getTriplesByKeys(i)}matchO(e){let t=this.getNodeKey(e),r=this.osp.get(t);if(!r)return[];let i=[];for(let[s,a]of r.entries())for(let c of a)i.push(this.buildTripleKey(s,c,t));return this.getTriplesByKeys(i)}getTriplesByKeys(e){let t=[];for(let r of e){let i=this.triples.get(r);i&&t.push(i)}return t}addToIndex(e,t,r,i){e.has(t)||e.set(t,new Map);let s=e.get(t);s.has(r)||s.set(r,new Set),s.get(r).add(i)}removeFromIndex(e,t,r,i){let s=e.get(t);if(!s)return;let a=s.get(r);a&&(a.delete(i),a.size===0&&s.delete(r),s.size===0&&e.delete(t))}getTripleKey(e){let t=this.getNodeKey(e.subject),r=this.getNodeKey(e.predicate),i=this.getNodeKey(e.object);return this.buildTripleKey(t,r,i)}buildTripleKey(e,t,r){return`${e}|${t}|${r}`}getNodeKey(e){if(e instanceof Qf.IRI)return`i:${e.value}`;if(e instanceof t5.BlankNode)return`b:${e.id}`;if(e instanceof r5.Literal){let t=`l:${e.value}`;return e.datatype&&e.datatype.value!==s5?t+=`^^${e.datatype.value}`:e.language&&(t+=`@${e.language}`),t}return""}getMatchCacheKey(e,t,r){let i=e?this.getNodeKey(e):"?",s=t?this.getNodeKey(t):"?",a=r?this.getNodeKey(r):"?";return`${i}|${s}|${a}`}getGraphKey(e){return e?e.value:co}getOrCreateGraphStore(e){let t=this.getGraphKey(e);return t===co?this:(this.namedGraphs.has(t)||this.namedGraphs.set(t,new n),this.namedGraphs.get(t))}async addToGraph(e,t){await this.getOrCreateGraphStore(t).add(e)}async removeFromGraph(e,t){let r=this.getGraphKey(t);if(r===co)return this.remove(e);let i=this.namedGraphs.get(r);return i?i.remove(e):!1}async matchInGraph(e,t,r,i){let s=this.getGraphKey(i);if(s===co)return this.match(e,t,r);let a=this.namedGraphs.get(s);return a?a.match(e,t,r):[]}async getNamedGraphs(){return Array.from(this.namedGraphs.keys()).map(e=>new Qf.IRI(e))}async hasGraph(e){let t=this.namedGraphs.get(e.value);return t?await t.count()>0:!1}async clearGraph(e){let t=this.getGraphKey(e);if(t===co){await this.clear();return}let r=this.namedGraphs.get(t);r&&(await r.clear(),this.namedGraphs.delete(t))}async countInGraph(e){let t=this.getGraphKey(e);if(t===co)return this.count();let r=this.namedGraphs.get(t);return r?r.count():0}};Yf.InMemoryTripleStore=W0;var H0=class{static{o(this,"InMemoryTransaction")}constructor(e){this.store=e,this.operations=[],this.committed=!1,this.rolledBack=!1}async add(e){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");this.operations.push({type:"add",triple:e})}async remove(e){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");return this.operations.push({type:"remove",triple:e}),!0}async commit(){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");for(let e of this.operations)e.type==="add"?await this.store.add(e.triple):await this.store.remove(e.triple);this.committed=!0,this.operations=[]}async rollback(){if(this.committed)throw new vs.TransactionError("Transaction already committed");if(this.rolledBack)throw new vs.TransactionError("Transaction already rolled back");this.operations=[],this.rolledBack=!0}}});var Q0=v(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.RDFVocabularyMapper=void 0;var en=Wi(),jb=Ye(),be=hn(),z0=class{static{o(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",be.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",be.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",be.Namespace.RDFS.term("subClassOf")],["exo__Property_range",be.Namespace.RDFS.term("range")],["exo__Property_domain",be.Namespace.RDFS.term("domain")],["exo__Property_superProperty",be.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new en.Triple(be.Namespace.EXO.term("Asset"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDFS.term("Resource"))),e.push(new en.Triple(be.Namespace.EXO.term("Class"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDFS.term("Class"))),e.push(new en.Triple(be.Namespace.EXO.term("Property"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.RDF.term("Property"))),e.push(new en.Triple(be.Namespace.EMS.term("Task"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e.push(new en.Triple(be.Namespace.EMS.term("Project"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e.push(new en.Triple(be.Namespace.EMS.term("Area"),be.Namespace.RDFS.term("subClassOf"),be.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new en.Triple(be.Namespace.EXO.term("Instance_class"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDF.term("type"))),e.push(new en.Triple(be.Namespace.EXO.term("Asset_isDefinedBy"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("isDefinedBy"))),e.push(new en.Triple(be.Namespace.EXO.term("Class_superClass"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("subClassOf"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_range"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("range"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_domain"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("domain"))),e.push(new en.Triple(be.Namespace.EXO.term("Property_superProperty"),be.Namespace.RDFS.term("subPropertyOf"),be.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof jb.IRI)s=r;else{let a=r.match(/^(ems|exo)__(.+)$/);if(a){let[,c,l]=a;s=(c==="ems"?be.Namespace.EMS:be.Namespace.EXO).term(l)}else s=new jb.IRI(r)}return new en.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Kf.RDFVocabularyMapper=z0});var Y0=v(ti=>{"use strict";var o5=ti&&ti.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},c5=ti&&ti.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},l5=ti&&ti.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(ti,"__esModule",{value:!0});ti.NoteToRDFConverter=void 0;var $b=Ve(),Gr=Wi(),lo=Ye(),tn=mt(),Vb=Lt(),Fr=hn(),u5=ct(),f5=Q0(),Wr=Rm(),uo=class{static{o(this,"NoteToRDFConverter")}constructor(e){this.vault=e,this.OBSIDIAN_VAULT_SCHEME="obsidian://vault/",this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.vocabularyMapper=new f5.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?Wr.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){let r=[],i=this.notePathToIRI(e.path),s=Fr.Namespace.EXO.term("Asset_fileName");r.push(new Gr.Triple(i,s,new tn.Literal(e.basename)));for(let[c,l]of Object.entries(t)){if(!this.isExocortexProperty(c))continue;let u=this.propertyKeyToIRI(c),f=Array.isArray(l)?l:[l];for(let h of f)if(c==="exo__Instance_class"){let d=this.valueToClassURI(h);r.push(new Gr.Triple(i,u,d))}else{let d=await this.valueToRDFObject(h,e);for(let p of d)if(r.push(new Gr.Triple(i,u,p)),this.vocabularyMapper.hasMappingFor(c)&&p instanceof lo.IRI){let _=this.vocabularyMapper.generateMappedTriple(i,c,p);_&&r.push(_)}}if(c==="exo__Instance_class")for(let h of f){let d=this.expandClassValue(h);if(d){let p=Fr.Namespace.RDF.term("type");r.push(new Gr.Triple(i,p,d))}}}let a=await this.convertBodyWikilinks(e,i);return r.push(...a),r}async convertExo003Note(e,t){let r=Wr.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Wr.Exo003MetadataType.Namespace:break;case Wr.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Wr.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Wr.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Wr.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new lo.IRI(t.uri);return[new Gr.Triple(r,Fr.Namespace.OWL.term("sameAs"),i),new Gr.Triple(i,Fr.Namespace.OWL.term("sameAs"),r)]}convertExo003BlankNode(e,t){let r=this.notePathToIRI(e.path),i=t.uri.replace(/[^a-zA-Z0-9_-]/g,"_");return[new Gr.Triple(r,Fr.Namespace.OWL.term("sameAs"),new Vb.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Wr.Exo003Parser.toTriple(t,i);r.push(s);let a=this.notePathToIRI(e.path);r.push(new Gr.Triple(a,Fr.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.createExo003ReferenceResolver(e),c=a(t.subject),l=a(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new lo.IRI(c.value):new Vb.BlankNode(c.value),f=new lo.IRI(l.value),h=Wr.Exo003Parser.toLiteral(t,s.trim());r.push(new Gr.Triple(u,f,h));let d=this.notePathToIRI(e.path);r.push(new Gr.Triple(d,Fr.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let a=this.vault.getFrontmatter(s);if(a&&Wr.Exo003Parser.isExo003Format(a)){let c=Wr.Exo003Parser.parse(a);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Wr.Exo003MetadataType.Anchor||l.metadata===Wr.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Wr.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let a of t)try{let c=await this.convertNote(a);r.push(...c)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${a.path}": ${l}`);i.push({path:a.path,reason:`Invalid IRI: ${l}`}),console.warn(`\u26A0\uFE0F Skipping file with invalid IRI: ${a.path}`),console.warn(` Reason: ${l}`)}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=encodeURI(r.path),s=`${this.OBSIDIAN_VAULT_SCHEME}${i}`;lo.IRI.isValidIRI(s)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){let t=encodeURI(e);return new lo.IRI(`${this.OBSIDIAN_VAULT_SCHEME}${t}`)}isExocortexProperty(e){return e.startsWith("exo__")||e.startsWith("ems__")}propertyKeyToIRI(e){if(e.startsWith("exo__")){let t=e.substring(5);return Fr.Namespace.EXO.term(t)}if(e.startsWith("ems__")){let t=e.substring(5);return Fr.Namespace.EMS.term(t)}throw new Error(`Invalid property key: ${e}`)}async valueToRDFObject(e,t){if(typeof e=="string"){let r=this.removeQuotes(e),i=this.extractWikilink(r);if(i){let s=this.vault.getFirstLinkpathDest(i,t.path);if(s){let a=this.notePathToIRI(s.path);if(this.isUUID(i)){let c=new tn.Literal(i);return[a,c]}return[a]}if(this.isClassReference(i)){let a=this.expandClassValue(i);if(a)return[a]}return[new tn.Literal(r)]}if(this.isClassReference(r)){let s=this.expandClassValue(r);if(s)return[s]}return this.isISO8601DateTime(r)?[new tn.Literal(r,Fr.Namespace.XSD.term("dateTime"))]:[new tn.Literal(r)]}return typeof e=="boolean"?[new tn.Literal(e.toString())]:typeof e=="number"?[new tn.Literal(e.toString(),Fr.Namespace.XSD.term("decimal"))]:e instanceof Date?[new tn.Literal(e.toISOString(),Fr.Namespace.XSD.term("dateTime"))]:[new tn.Literal(String(e))]}isISO8601DateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?$/.test(e)}removeQuotes(e){let t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.substring(1,t.length-1):e}extractWikilink(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);return t?t[1]:null}valueToClassURI(e){if(typeof e!="string")return new tn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);return s||new tn.Literal(t)}isClassReference(e){return(e.startsWith("ems__")||e.startsWith("exo__"))&&!/\s/.test(e)}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e);if(t.startsWith("ems__")){let r=t.substring(5);return Fr.Namespace.EMS.term(r)}if(t.startsWith("exo__")){let r=t.substring(5);return Fr.Namespace.EXO.term(r)}return null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.extractBodyWikilinks(s),c=Fr.Namespace.EXO.term("Asset_bodyLink");for(let l of a){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new Gr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new Gr.Triple(t,c,f)):r.push(new Gr.Triple(t,c,new tn.Literal(l)))}else r.push(new Gr.Triple(t,c,new tn.Literal(l)))}}catch{}return r}};ti.NoteToRDFConverter=uo;uo.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};uo.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};uo.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};ti.NoteToRDFConverter=uo=o5([(0,$b.injectable)(),l5(0,(0,$b.inject)(u5.DI_TOKENS.IVaultAdapter)),c5("design:paramtypes",[Object])],uo)});var K0=v((cz,Ub)=>{var fo=class{static{o(this,"Wildcard")}constructor(){return h5||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(fo.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(fo.prototype,"termType",{enumerable:!0,value:"Wildcard"});var h5=new fo;Ub.exports.Wildcard=fo});var qb=v((uz,Bb)=>{var d5=(function(){var n=o(function(I,x,O,F){for(O=O||{},F=I.length;F--;O[I[F]]=x);return O},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],a=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],h=[1,45],d=[1,41],p=[1,44],_=[123,126],S=[1,67],E=[39,45,87],A=[13,16,45,197,224,308],C=[1,87],k=[2,281],G=[1,86],Q=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],H=[6,28,29,53,63,70,73,81,83,85],re=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],Ie=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],N=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],K=[13,16,308],ge=[112,132,327,334],dt=[13,16,112,132,308],nt=[1,111],yt=[1,117],Ke=[112,132,327,328,334],Je=[13,16,112,132,308,328],Ue=[28,29,45,53,87],Z=[1,138],$=[1,151],Ze=[1,128],it=[1,127],B=[1,129],Ee=[1,140],Ne=[1,141],X=[1,142],Le=[1,143],Me=[1,144],Re=[1,145],ke=[1,147],ye=[1,148],Fe=[2,457],Te=[1,158],De=[1,159],je=[1,160],se=[1,152],le=[1,153],ue=[1,156],ae=[1,171],oe=[1,172],ce=[1,173],ie=[1,174],fe=[1,175],he=[1,176],de=[1,167],pe=[1,168],ne=[1,169],me=[1,170],Ge=[1,157],$e=[1,166],Pe=[1,161],b=[1,162],w=[1,163],T=[1,164],P=[1,165],Y=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],at=[1,195],pt=[6,31,73,81,83,85],Ae=[2,285],V=[1,199],U=[1,201],q=[6,31,70,73,81,83,85],z=[2,283],we=[1,207],We=[1,218],He=[1,223],Jt=[1,219],Vr=[1,225],Xr=[1,226],Er=[1,224],av=[6,63,70,73,81,83,85],ov=[1,236],cv=[2,334],lv=[1,243],uv=[1,241],Zt=[6,193],ou=[2,349],fv=[2,339],os=[28,128],hv=[47,48,193,272],cu=[47,48,193,242,272],$a=[47,48,193,242,246,272],Va=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Bt=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],dv=[1,271],pv=[1,270],Ot=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],mv=[1,281],gv=[1,280],Tr=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],wc=[45,89],lu=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],uu=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],fu=[31,89],hu=[48,87],$s=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],di=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],yv=[1,313],Ua=[6,85],cp=[6,31,81,83,85],vv=[2,361],Mi=[2,353],Vs=[1,343],Ec=[31,112,335],ki=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],lp=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],_v=[6,109,193],Us=[31,112],Pt=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],up=[1,390],fp=[1,391],cs=[13,16,87,197,308,314],Sv=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],du=[1,417],pu=[1,418],bv=[13,16,48,197,229,308],ls=[6,31,85],wv=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],hp=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],Bs=[29,31,85,112,159,160,161,163,164],mu=[1,443],gu=[1,444],Ev=[1,449],qs=[31,112,193,232,318,335],yu=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Tv=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],dp=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Tc=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],xc=[31,45],xv=[1,507],Av=[1,508],Cv=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],vu=[29,31,85,112,159,160,161,163,164,335],Gs=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Iv=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ov=[2,352],pp=[13,16,197,308,314],Pv=[1,565],Ba=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Rv=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ji=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],Fv=[13,16,87,308],$i=[2,364],qa=[29,31,85,112,159,160,161,163,164,193,232,318,335],_u=[31,112,193,232,272,318,335],Vi=[2,359],Dv=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Su=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],Nv=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Lv=[2,347],mp={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:o(function(x,O,F,J,xe,m,Ar){var g=m.length-1;switch(xe){case 1:if(m[g-1]=m[g-1]||{},Oe.base&&(m[g-1].base=Oe.base),Oe.base="",m[g-1].prefixes=Oe.prefixes,Oe.prefixes=null,Oe.pathOnly){if(m[g-1].type==="path"||"termType"in m[g-1])return m[g-1];throw new Error("Received full SPARQL query in path only mode")}else if(m[g-1].type==="path"||"termType"in m[g-1])throw new Error("Received only path in full SPARQL mode");if(m[g-1].type==="update"){let ot={};for(let St of m[g-1].updates)if(St.updateType==="insert"){let ze={};for(let et of St.insert)if(et.type==="bgp"||et.type==="graph")for(let Ur of et.triples)Ur.subject.termType==="BlankNode"&&(ze[Ur.subject.value]=!0),Ur.predicate.termType==="BlankNode"&&(ze[Ur.predicate.value]=!0),Ur.object.termType==="BlankNode"&&(ze[Ur.object.value]=!0);for(let et of Object.keys(ze)){if(ot[et])throw new Error("Detected reuse blank node across different INSERT DATA clauses");ot[et]=!0}}}return m[g-1];case 2:this.$={...m[g-1],...m[g],type:"query"};break;case 4:Oe.base=Ac(m[g]);break;case 5:Oe.prefixes||(Oe.prefixes={}),m[g-1]=m[g-1].substr(0,m[g-1].length-1),m[g]=Ac(m[g]),Oe.prefixes[m[g-1]]=m[g];break;case 6:this.$={...m[g-3],...zs(m[g-2]),...m[g-1],...m[g]};break;case 7:if(!Oe.skipValidation&&(Ep(m[g-3].variables.map(St=>wp(St.expression))).some(St=>St.aggregation==="count"&&!(St.expression instanceof bu))||m[g].group)){for(let St of m[g-3].variables)if(St.termType==="Variable"){if(!m[g].group||!m[g].group.map(ze=>za(ze)).includes(za(St)))throw Error("Projection of ungrouped variable (?"+za(St)+")")}else if(wp(St.expression).length===0){let ze=QC(St.expression);for(let et of ze)if(!m[g].group||!m[g].group.map||!m[g].group.map(Ur=>za(Ur)).includes(za(et)))throw Error("Use of ungrouped variable in projection of operation (?"+za(et)+")")}}let yi=m[g-1].where.filter(ot=>ot.type==="query");if(yi.length>0){let ot=m[g-3].variables.filter(ze=>ze.variable&&ze.variable.value).map(ze=>ze.variable.value),St=Ep(yi.map(ze=>ze.variables)).map(ze=>ze.value||ze.variable.value);for(let ze of ot)if(St.indexOf(ze)>=0)throw Error("Target id of 'AS' (?"+ze+") already used in subquery")}this.$=xt(m[g-3],zs(m[g-2]),m[g-1],m[g]);break;case 8:this.$=xt({queryType:"CONSTRUCT",template:m[g-3]},zs(m[g-2]),m[g-1],m[g]);break;case 9:this.$=xt({queryType:"CONSTRUCT",template:m[g-2]=m[g-2]?m[g-2].triples:[]},zs(m[g-5]),{where:[{type:"bgp",triples:Hs([],m[g-2])}]},m[g]);break;case 10:this.$=xt({queryType:"DESCRIBE",variables:m[g-3]==="*"?[new bu]:m[g-3]},zs(m[g-2]),m[g-1],m[g]);break;case 11:this.$=xt({queryType:"ASK"},zs(m[g-2]),m[g-1],m[g]);break;case 12:this.$=xt(m[g-1],{variables:[new bu]});break;case 13:let Rc=m[g].map(ot=>ot.value||ot.variable.value),Qa=YC(Rc);if(Qa.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Qa[0]+")");this.$=xt(m[g-1],{variables:m[g]});break;case 14:this.$=xt({queryType:"SELECT"},m[g]&&(m[g-1]=xr(m[g]),m[g]={},m[g][m[g-1]]=!0,m[g]));break;case 16:case 27:this.$=Ga(m[g-3],{variable:m[g-1]});break;case 17:case 18:this.$=xt(m[g-3],m[g-2],m[g-1],m[g],{type:"query"});break;case 19:case 58:this.$={iri:m[g],named:!!m[g-1]};break;case 20:this.$={where:m[g].patterns};break;case 21:this.$=xt(m[g-1],m[g]);break;case 22:this.$=xt(m[g-2],m[g-1],m[g]);break;case 23:this.$={group:m[g]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Ga(m[g]);break;case 26:this.$=Ga(m[g-1]);break;case 29:this.$={having:m[g]};break;case 30:this.$={order:m[g]};break;case 32:this.$=Ga(m[g],{descending:!0});break;case 35:this.$={limit:Ha(m[g])};break;case 36:this.$={offset:Ha(m[g])};break;case 37:this.$={limit:Ha(m[g-2]),offset:Ha(m[g])};break;case 38:this.$={limit:Ha(m[g]),offset:Ha(m[g-2])};break;case 39:case 43:this.$={type:"values",values:m[g]};break;case 40:case 84:this.$=m[g-1].map(ot=>({[m[g-3]]:ot}));break;case 41:case 85:this.$=m[g-1].map(()=>({}));break;case 42:case 86:var gi=m[g-4].length;m[g-4]=m[g-4].map(gp),this.$=m[g-1].map(function(ot){if(ot.length!==gi)throw Error("Inconsistent VALUES length");for(var St={},ze=0;ze<gi;ze++)St["?"+m[g-4][ze].value]=ot[ze];return St});break;case 44:case 65:case 100:case 126:case 175:this.$=m[g-1];break;case 45:this.$={type:"update",updates:Ui(m[g-2],m[g-1])};break;case 46:this.$=xt({type:"load",silent:!!m[g-2],source:m[g-1]},m[g]&&{destination:m[g]});break;case 47:this.$={type:xr(m[g-2]),silent:!!m[g-1],graph:m[g]};break;case 48:this.$={type:xr(m[g-4]),silent:!!m[g-3],source:m[g-2],destination:m[g]};break;case 49:this.$={type:"create",silent:!!m[g-2],graph:{type:"graph",name:m[g]}};break;case 50:this.$={updateType:"insert",insert:Hv(m[g])};break;case 51:this.$={updateType:"delete",delete:Ap(Hv(m[g]))};break;case 52:this.$={updateType:"deletewhere",delete:Ap(m[g])};break;case 53:this.$={updateType:"insertdelete",...m[g-4],...m[g-3],...zs(m[g-2],"using"),where:m[g].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=m[g];break;case 55:this.$={delete:Ap(m[g-1]),insert:m[g]||[]};break;case 56:this.$={delete:[],insert:m[g]};break;case 59:this.$={graph:m[g]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:m[g]};break;case 64:this.$={[xr(m[g])]:!0};break;case 66:this.$=m[g-1]?pi(m[g],[m[g-1]]):pi(m[g]);break;case 67:var Oc=xt(m[g-3]||{triples:[]},{type:"graph",name:m[g-5]});this.$=m[g]?[Oc,m[g]]:[Oc];break;case 68:case 73:this.$={type:"bgp",triples:pi(m[g-2],[m[g-1]])};break;case 69:this.$={type:"group",patterns:[m[g-1]]};break;case 70:for(let ot of m[g-1].filter(St=>St.type==="bind")){let St=m[g-1].indexOf(ot),ze=new Set;for(let et of m[g-1].slice(0,St))(et.type==="group"||et.type==="bgp")&&Gv(et).forEach(Ur=>ze.add(Ur));if(ze.has(ot.variable.value))throw Error("Variable used to bind is already bound (?"+ot.variable.value+")")}this.$={type:"group",patterns:m[g-1]};break;case 71:this.$=m[g-1]?pi([m[g-1]],m[g]):pi(m[g]);break;case 72:this.$=m[g]?[m[g-2],m[g]]:m[g-2];break;case 75:this.$=xt(m[g],{type:"optional"});break;case 76:this.$=xt(m[g],{type:"minus"});break;case 77:this.$=xt(m[g],{type:"graph",name:m[g-1]});break;case 78:this.$=xt(m[g],{type:"service",name:m[g-1],silent:!!m[g-2]});break;case 79:this.$={type:"filter",expression:m[g]};break;case 80:this.$={type:"bind",variable:m[g-1],expression:m[g-3]};break;case 89:this.$=Ic(m[g]);break;case 90:this.$=void 0;break;case 91:this.$=m[g-1].length?{type:"union",patterns:pi(m[g-1].map(vp),[vp(m[g])])}:m[g];break;case 95:this.$={...m[g],function:m[g-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Ui(m[g-2],m[g-1]),distinct:!!m[g-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=Ui(m[g-2],m[g-1]);break;case 101:this.$=pi(m[g-2],[m[g-1]]);break;case 102:case 112:this.$=xp(m[g].map(ot=>xt(Bi(m[g-1]),ot)));break;case 103:this.$=xp(Hs(m[g].map(ot=>xt(Bi(m[g-1].entity),ot)),m[g-1].triples));break;case 105:this.$=pi([m[g-1]],m[g]);break;case 106:this.$=pi(m[g]);break;case 107:this.$=bp(m[g-1],m[g]);break;case 109:case 237:this.$=Oe.factory.namedNode(jC);break;case 110:case 118:this.$=Ui(m[g-1],m[g]);break;case 111:this.$=m[g]?{annotation:m[g],object:m[g-1]}:m[g-1];break;case 113:this.$=m[g]?xp(Hs(m[g].map(ot=>xt(Bi(m[g-1].entity),ot)),m[g-1].triples)):m[g-1].triples;break;case 114:this.$=bp(...m[g-1],m[g]);break;case 116:this.$=bp(...m[g]);break;case 117:case 159:case 163:this.$=[m[g-1],m[g]];break;case 119:this.$=m[g]?{object:m[g-1],annotation:m[g]}:m[g-1];break;case 120:this.$=m[g-1].length?Wa("|",Ui(m[g-1],m[g])):m[g];break;case 121:this.$=m[g-1].length?Wa("/",Ui(m[g-1],m[g])):m[g];break;case 122:this.$=m[g]?Wa(m[g],[m[g-1]]):m[g-1];break;case 123:this.$=m[g-1]?Wa(m[g-1],[m[g]]):m[g];break;case 125:case 131:this.$=Wa(m[g-1],[m[g]]);break;case 129:this.$=Wa("|",Ui(m[g-2],m[g-1]));break;case 132:case 134:this.$=HC(m[g-1]);break;case 133:case 135:this.$=zC(m[g-1]);break;case 140:this.$={entity:m[g],triples:[]};break;case 145:this.$=gp(m[g]);break;case 149:this.$=Oe.factory.namedNode(Mv);break;case 151:case 153:case 158:case 162:this.$=yp(m[g-1],m[g]);break;case 152:this.$=["||",m[g]];break;case 154:this.$=["&&",m[g]];break;case 156:this.$=er(m[g-1],[m[g-2],m[g]]);break;case 157:this.$=er(m[g-2]?"notin":"in",[m[g-3],m[g]]);break;case 160:this.$=["+",yp(m[g-1],m[g])];break;case 161:var Tu=mi(m[g-1].value.replace("-",""),m[g-1].datatype);this.$=["-",yp(Tu,m[g])];break;case 164:this.$=er("UPLUS",[m[g]]);break;case 165:this.$=er(m[g-1],[m[g]]);break;case 166:this.$=er("UMINUS",[m[g]]);break;case 177:this.$=er(xr(m[g-1]));break;case 178:this.$=er(xr(m[g-3]),[m[g-1]]);break;case 179:this.$=Ic(er(xr(m[g-3]),[m[g-1]]));break;case 180:this.$=er(xr(m[g-5]),[m[g-3],m[g-1]]);break;case 181:this.$=er(xr(m[g-7]),[m[g-5],m[g-3],m[g-1]]);break;case 182:this.$=Ic(er(xr(m[g-7]),[m[g-5],m[g-3],m[g-1]]));break;case 183:this.$=er(xr(m[g-1]),m[g]);break;case 184:this.$=er("bound",[gp(m[g-1])]);break;case 185:this.$=er(m[g-1],[]);break;case 186:this.$=er(m[g-3],[m[g-1]]);break;case 187:this.$=er(m[g-2]?"notexists":"exists",[vp(m[g])]);break;case 188:case 189:this.$=Ga(m[g-1],{type:"aggregate",aggregation:xr(m[g-4]),distinct:!!m[g-2]});break;case 190:this.$=Ga(m[g-2],{type:"aggregate",aggregation:xr(m[g-5]),distinct:!!m[g-3],separator:typeof m[g-1]=="string"?m[g-1]:" "});break;case 192:this.$=mi(m[g]);break;case 193:this.$=BC(m[g-1],xr(m[g].substr(1)));break;case 194:this.$=mi(m[g-2],m[g]);break;case 195:case 204:this.$=mi(m[g],kv);break;case 196:case 205:this.$=mi(m[g],jv);break;case 197:case 206:this.$=mi(xr(m[g]),$v);break;case 200:this.$=mi(m[g].toLowerCase(),UC);break;case 201:this.$=mi(m[g].substr(1),kv);break;case 202:this.$=mi(m[g].substr(1),jv);break;case 203:this.$=mi(m[g].substr(1).toLowerCase(),$v);break;case 207:case 208:this.$=qv(m[g],1);break;case 209:case 210:this.$=qv(m[g],3);break;case 211:this.$=Oe.factory.namedNode(Ac(m[g]));break;case 213:var xu=m[g].indexOf(":"),Pc=m[g].substr(0,xu),Au=Oe.prefixes[Pc];if(!Au)throw new Error("Unknown prefix: "+Pc);var Et=Ac(Au+m[g].substr(xu+1));this.$=Oe.factory.namedNode(Et);break;case 214:if(m[g]=m[g].substr(0,m[g].length-1),!(m[g]in Oe.prefixes))throw new Error("Unknown prefix: "+m[g]);var Et=Ac(Oe.prefixes[m[g]]);this.$=Oe.factory.namedNode(Et);break;case 215:this.$=Cc(m[g].replace(/^(_:)/,""));break;case 216:this.$=Cc();break;case 217:case 218:case 232:this.$=Ic(_p(m[g-3],m[g-2],m[g-1]));break;case 230:case 231:this.$=Ic(m[g-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:m[g-1].push(m[g]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[m[g]];break;case 308:m[g-3].push(m[g-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:m[g-2].push(m[g-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:a},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:h,33:35,39:[1,37],44:39,55:40,87:d,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(_,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:S,87:d},n(E,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(A,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:C,29:k,52:84,53:G,56:85},{19:88,28:C,29:k,52:89,53:G,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:G},n(Q,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(H,[2,263],{34:96}),n(H,[2,261],{44:39,55:40,307:43,139:97,13:f,16:h,87:d,308:p}),n(H,[2,262]),n(re,[2,259]),n(Ie,[2,143]),n(Ie,[2,144]),n([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),n(N,[2,211]),n(N,[2,212]),n(N,[2,213]),n(N,[2,214]),{19:98,28:C,29:k,52:99,53:G,56:85},{6:[2,309],99:100,193:[1,101]},n(K,[2,311],{101:102,328:[1,103]}),n(ge,[2,317],{104:104,328:[1,105]}),n(dt,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:nt,114:110},{29:nt,114:112},{29:nt,114:113},{118:114,123:[1,115],125:116,126:yt},n(Ke,[2,315]),n(Ke,[2,316]),n(Je,[2,319]),n(Je,[2,320]),n(Je,[2,321]),n(_,[2,327]),{13:f,16:h,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:S,87:d}),n(Ue,[2,269]),n(Ue,[2,15]),{13:f,16:h,44:136,45:Z,46:120,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(E,[2,14]),n(E,[2,274]),n(E,[2,271]),n(E,[2,272]),n(e,[2,4]),{13:[1,177]},n(Y,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},n(c,[2,410]),n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:h,45:[1,193],55:194,197:at,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(A,[2,419]),n(pt,Ae,{20:196,59:197,69:198,70:V}),n(l,[2,250]),{29:U,57:200},n(K,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(q,z,{23:204,58:205,62:206,63:we}),n(l,[2,252]),{19:208,28:C,29:k,52:209,53:G,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,145:212,172:221,185:213,187:214,231:Jt,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(av,[2,265],{56:85,35:227,52:228,19:229,28:C,29:k,53:G}),n(re,[2,260]),n(q,z,{58:205,62:206,23:230,63:we}),n(l,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:h,55:232,307:43,308:p},n(K,[2,312]),{105:233,112:ov,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(ge,[2,318]),n(K,cv,{108:240,133:242,112:lv,132:uv}),n(dt,[2,323]),{112:[1,244]},{112:[2,325]},n(Zt,[2,50]),n(Q,ou,{135:245,136:246,143:247,144:248,31:fv,112:fv}),n(Zt,[2,51]),n(Zt,[2,52]),n(os,[2,328],{119:249}),{29:nt,114:250},n(os,[2,56]),{29:nt,114:251},n(_,[2,59]),n(Ue,[2,270]),{47:[1,252]},n(hv,[2,150]),n(cu,[2,428],{240:253}),n($a,[2,430],{244:254}),n($a,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),n(Va,[2,440],{252:264}),n(Bt,[2,448],{260:265}),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:266,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:267,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,255:154,257:155,264:268,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Bt,[2,167]),n(Bt,[2,168]),n(Bt,[2,169]),n(Bt,[2,170],{176:269,45:dv,89:pv}),n(Bt,[2,171]),n(Bt,[2,172]),n(Bt,[2,173]),n(Bt,[2,174]),{13:f,16:h,44:136,45:Z,46:272,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:mv,89:gv,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(Tr,[2,192],{292:[1,286],293:[1,287]}),n(Tr,[2,195]),n(Tr,[2,196]),n(Tr,[2,197]),n(Tr,[2,198]),n(Tr,[2,199]),n(Tr,[2,200]),{13:f,16:h,44:39,55:40,82:$,87:d,139:289,172:291,255:154,257:155,266:290,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(wc,[2,452]),n(wc,[2,453]),n(wc,[2,454]),n(wc,[2,455]),n(wc,[2,456]),{279:[2,458]},n(lu,[2,207]),n(lu,[2,208]),n(lu,[2,209]),n(lu,[2,210]),n(Tr,[2,201]),n(Tr,[2,202]),n(Tr,[2,203]),n(Tr,[2,204]),n(Tr,[2,205]),n(Tr,[2,206]),n(e,[2,5]),n(uu,[2,297],{88:295}),n(fu,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(hu,[2,301]),n(Y,[2,43]),n(Y,[2,82]),n(Y,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n($s,[2,123]),n($s,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(di,[2,124]),{13:f,16:h,45:[1,311],55:194,89:[1,310],197:at,223:312,225:308,226:309,229:yv,307:43,308:p},n(c,i,{215:10,214:314}),n(di,[2,236]),n(di,[2,237]),n(Ua,[2,6]),n(cp,[2,287],{60:315,72:316,73:[1,317]}),n(pt,[2,286]),{13:f,16:h,45:Z,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n([6,31,63,70,73,81,83,85],[2,20]),n(Q,vv,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Mi,31:Mi,85:Mi,112:Mi,159:Mi,160:Mi,161:Mi,163:Mi,164:Mi,41:s}),{13:f,16:h,55:331,307:43,308:p},n(K,[2,280]),n(Ua,[2,7]),n(pt,Ae,{59:197,69:198,20:332,70:V}),n(q,[2,284]),{64:[1,333]},n(q,z,{58:205,62:206,23:334,63:we}),n(l,[2,254]),n(Q,ou,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:h,44:39,55:40,87:d,139:342,186:339,190:340,195:341,197:Vs,307:43,308:p},n(Ec,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:h,87:d,197:Vs,308:p}),n(ki,[2,227]),n(ki,[2,228]),n(ki,[2,229]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,172:221,185:351,187:350,200:348,230:347,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},{13:f,16:h,44:39,55:40,87:d,139:342,186:352,190:340,195:341,197:Vs,307:43,308:p},n(ki,[2,146]),n(ki,[2,147]),n(ki,[2,148]),n(ki,[2,149]),{13:f,16:h,44:354,55:355,82:$,87:d,172:357,237:356,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:358,312:Er,313:353},n(lp,[2,215]),n(lp,[2,216]),n(q,z,{58:205,62:206,23:359,63:we}),n(H,[2,264]),n(av,[2,266]),n(Ua,[2,11]),n(r,[2,308],{6:[2,310]}),n(Zt,[2,313],{102:360,120:361,121:[1,362]}),n(Zt,[2,47]),n(Zt,[2,63]),n(Zt,[2,64]),{13:f,16:h,55:363,307:43,308:p},n(Zt,[2,336]),n(Zt,[2,337]),n(Zt,[2,338]),{109:[1,364]},n(_v,[2,60]),{13:f,16:h,55:365,307:43,308:p},n(K,[2,335]),{13:f,16:h,55:366,307:43,308:p},{31:[1,367]},n(Us,[2,341],{137:368}),n(Us,[2,340]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,145:369,172:221,185:213,187:214,231:Jt,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},{28:[1,370],127:371,128:[1,372]},n(os,[2,330],{124:373,125:374,126:yt}),n(os,[2,57]),{44:375,87:d},n(hv,[2,151],{241:376,242:[1,377]}),n(cu,[2,153],{245:378,246:[1,379]}),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,247:380,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{250:[1,381]},n(Pt,[2,432]),n(Pt,[2,433]),n(Pt,[2,434]),n(Pt,[2,435]),n(Pt,[2,436]),n(Pt,[2,437]),{250:[2,439]},n([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:ae,298:oe,299:ce,300:ie,301:fe,302:he}),n(Va,[2,162],{261:388,262:389,39:up,338:fp}),n(Bt,[2,164]),n(Bt,[2,165]),n(Bt,[2,166]),n(Ot,[2,95]),n(Ot,[2,96]),n(Pt,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Ot,[2,177]),{13:f,16:h,44:136,45:Z,46:395,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:396,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:397,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:398,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:399,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,183]),n(Ot,[2,98]),n(Pt,[2,381],{180:400}),{87:[1,401]},n(Ot,[2,185]),{13:f,16:h,44:136,45:Z,46:402,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{29:U,57:403},n(Tr,[2,193]),{13:f,16:h,55:404,307:43,308:p},{13:f,16:h,44:39,55:40,87:d,139:342,195:405,197:Vs,307:43,308:p},n(cs,[2,233]),n(cs,[2,234]),n(cs,[2,235]),n(Sv,[2,459],{281:406,325:[1,407]}),n(Pt,[2,463],{284:408,325:[1,409]}),n(Pt,[2,465],{286:410,325:[1,411]}),{13:f,16:h,31:[1,412],55:414,82:$,171:413,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,419],89:[1,420]},{29:[1,421]},n(hu,[2,302]),n(uu,[2,367],{167:422}),n(fu,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(hu,[2,371]),n($s,[2,122]),n($s,[2,417]),n($s,[2,413]),n($s,[2,414]),n($s,[2,415]),n(di,[2,125]),n(di,[2,127]),n(di,[2,128]),n(bv,[2,420],{227:426}),n(di,[2,130]),{13:f,16:h,55:194,197:at,223:427,307:43,308:p},{48:[1,428]},n(ls,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(cp,[2,288]),{64:[1,433]},n(pt,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:h,45:Z,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(wv,[2,293]),n(hp,[2,92]),n(hp,[2,93]),n(hp,[2,94]),{45:dv,89:pv,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:C,29:k,56:85},{19:438,28:C,29:k,56:85},n(Bs,[2,355],{149:439}),n(Bs,[2,354]),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,156:440,172:221,185:441,203:442,231:gu,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(H,[2,19]),n(ls,[2,21]),{13:f,16:h,44:450,45:Ev,55:323,65:445,66:446,67:447,68:448,87:d,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ua,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(Q,[2,386],{31:[2,388]}),n(Ec,[2,102]),n(qs,[2,391],{191:452}),n(Q,[2,395],{196:453,198:454}),n(Q,[2,108]),n(Q,[2,109]),n(Ec,[2,103]),n(Ec,[2,104]),n(Ec,[2,390]),{13:f,16:h,44:215,45:We,48:[1,455],55:220,82:$,87:d,89:He,172:221,185:351,187:350,200:456,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(yu,[2,424]),n(Tv,[2,136]),n(Tv,[2,137]),n(dp,[2,140]),{232:[1,457]},{13:f,16:h,44:39,55:40,87:d,139:342,195:458,197:Vs,307:43,308:p},n(cs,[2,219]),n(cs,[2,220]),n(cs,[2,221]),n(cs,[2,222]),n(cs,[2,223]),n(Ua,[2,10]),n(Zt,[2,46]),n(Zt,[2,314]),{112:ov,122:459},n(Zt,[2,62]),n(K,cv,{133:242,108:460,112:lv,132:uv}),n(_v,[2,61]),n(Zt,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(Us,[2,351],{146:463,335:[1,464]}),{29:U,57:465},n(os,[2,329]),n(K,[2,332],{129:466,327:[1,467]}),n(os,[2,55]),n(os,[2,331]),{48:[1,468]},n(cu,[2,429]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n($a,[2,431]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,243:470,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n($a,[2,156]),{45:mv,89:gv,179:471},n(Va,[2,441]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,251:472,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Bt,[2,444],{256:473}),n(Bt,[2,446],{258:474}),n(Pt,[2,442]),n(Pt,[2,443]),n(Bt,[2,449]),{13:f,16:h,44:136,45:Z,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,255:154,257:155,259:475,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,450]),n(Pt,[2,451]),n(Pt,[2,379],{178:476}),n(Pt,[2,378]),n([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:h,44:136,45:Z,46:482,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{48:[1,483]},{48:[1,484]},n(Ot,[2,187]),n(Tr,[2,194]),{13:f,16:h,44:39,55:40,82:$,87:d,139:289,172:291,255:154,257:155,266:290,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,320:485},{13:f,16:h,39:[1,487],44:136,45:Z,46:488,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,282:486,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Sv,[2,460]),{13:f,16:h,44:136,45:Z,46:489,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,464]),{13:f,16:h,44:136,45:Z,46:490,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Pt,[2,466]),n(Y,[2,40]),n(uu,[2,298]),n(Tc,[2,87]),n(Tc,[2,88]),n(Tc,[2,89]),n(Tc,[2,90]),{13:f,16:h,55:492,82:$,172:493,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,311:494,312:Er,315:491},n(Y,[2,41]),n(fu,[2,300]),n(xc,[2,303],{92:495}),{13:f,16:h,31:[1,496],55:414,82:$,171:497,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,498],89:[1,499]},{29:[1,500]},n(hu,[2,372]),{13:f,16:h,48:[2,422],55:194,197:at,223:312,226:502,228:501,229:yv,307:43,308:p},n(di,[2,131]),n(di,[2,126]),n(ls,[2,22]),n(ls,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:h,44:510,45:Z,55:323,67:321,68:322,74:505,75:506,76:xv,77:320,78:Av,79:509,87:d,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(wv,[2,294]),n(Cv,[2,69]),n(Cv,[2,70]),n(pt,Ae,{59:197,69:198,20:511,70:V}),n(q,z,{58:205,62:206,23:512,63:we}),{29:[2,375],31:[2,71],84:522,85:a,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(Bs,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:d}),n(vu,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:d}),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,172:221,185:351,203:536,212:534,231:gu,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:d}),n(q,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:h,45:Ev,87:d,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(Gs,[2,291]),n(Gs,[2,24]),n(Gs,[2,25]),{13:f,16:h,44:136,45:Z,46:539,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Gs,[2,28]),n(q,z,{58:205,62:206,23:540,63:we}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(qs,[2,107]),{13:f,16:h,44:215,45:We,55:220,82:$,87:d,89:He,172:221,185:351,187:350,199:543,200:544,231:Jt,234:349,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(Iv,[2,132]),n(yu,[2,425]),n(Iv,[2,133]),{13:f,16:h,44:354,55:355,82:$,87:d,172:357,237:356,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:358,312:Er,313:545},n(Zt,[2,54]),n(Zt,[2,48]),n(Us,[2,342]),{13:f,16:h,44:39,55:40,87:d,139:546,307:43,308:p},n(Us,[2,68]),n(Q,[2,350],{31:Ov,112:Ov}),n(Zt,[2,53]),{13:f,16:h,55:547,307:43,308:p},n(K,[2,333]),n(Ue,[2,16]),n(cu,[2,152]),n($a,[2,154]),n($a,[2,157]),n(Va,[2,159]),n(Va,[2,160],{262:389,261:548,39:up,338:fp}),n(Va,[2,161],{262:389,261:549,39:up,338:fp}),n(Bt,[2,163]),{13:f,16:h,44:136,45:Z,46:550,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,178]),n(Ot,[2,179]),{13:f,16:h,44:136,45:Z,46:551,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:552,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:553,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{48:[1,554],272:[1,555]},n(Ot,[2,184]),n(Ot,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:h,55:194,197:at,223:562,307:43,308:p},n(pp,[2,224]),n(pp,[2,225]),n(pp,[2,226]),{31:[1,563],45:Pv,94:564},n(Y,[2,84]),n(uu,[2,368]),n(Y,[2,85]),n(fu,[2,370]),n(xc,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ls,[2,35],{83:[1,569]}),n(ls,[2,36],{81:[1,570]}),n(cp,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:h,45:Z,76:xv,78:Av,87:d,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,276:ke,277:ye,279:Fe,280:Te,283:De,285:je,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P}),n(Ba,[2,295]),{45:Z,77:572},{45:Z,77:573},n(Ba,[2,33]),n(Ba,[2,34]),{31:[2,275],50:574,84:575,85:a},{31:[2,277],51:576,84:577,85:a},n(Bs,[2,356]),n(Rv,[2,357],{152:578,335:[1,579]}),n(ji,[2,74]),{29:U,57:580},{29:U,57:581},{13:f,16:h,44:39,55:40,87:d,139:582,307:43,308:p},n(Fv,[2,365],{162:583,328:[1,584]}),{13:f,16:h,45:Z,55:323,67:321,68:322,77:320,79:585,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,307:43,308:p,346:$e,347:Pe,348:b,349:w,350:T,351:P},{45:[1,586]},n(ji,[2,81]),{29:U,57:587},n(Bs,[2,73]),n(Q,[2,362],{29:$i,31:$i,85:$i,112:$i,159:$i,160:$i,161:$i,163:$i,164:$i}),n(vu,[2,112]),n(qa,[2,401],{206:588}),n(Q,[2,405],{209:589,210:590}),n(Q,[2,403]),n(Q,[2,404]),n(vu,[2,113]),n(vu,[2,400]),{13:f,16:h,44:215,45:mu,48:[1,591],55:220,82:$,87:d,89:He,172:221,185:351,203:536,212:592,231:gu,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(yu,[2,426]),n(dp,[2,138]),n(dp,[2,139]),{232:[1,593]},n(Gs,[2,292]),{47:[1,595],48:[1,594]},n(Ua,[2,9]),n(qs,[2,392]),n(qs,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:h,87:d,197:Vs,308:p}),n(qs,[2,110],{272:[1,598]}),n(_u,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(os,[2,58]),n(Bt,[2,445]),n(Bt,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Ot,[2,99]),n(Pt,[2,382]),n([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),n(Ot,[2,188]),n(Ot,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:h,55:492,82:$,172:493,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,311:494,312:Er,315:611},n(Y,[2,42]),n(xc,[2,304]),{13:f,16:h,55:414,82:$,95:612,171:613,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},{31:[1,614],45:Pv,94:615},n(di,[2,129]),n(bv,[2,421]),{82:[1,616]},{82:[1,617]},n(Ba,[2,296]),n(Ba,[2,31]),n(Ba,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(Q,vv,{155:330,153:618,154:619,29:Vi,31:Vi,85:Vi,112:Vi,159:Vi,160:Vi,161:Vi,163:Vi,164:Vi}),n(Rv,[2,358]),n(ji,[2,75]),n(ji,[2,76]),{29:U,57:620},{13:f,16:h,44:39,55:40,87:d,139:621,307:43,308:p},n(Fv,[2,366]),n(ji,[2,79]),{13:f,16:h,44:136,45:Z,46:622,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(ji,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(qa,[2,117]),{13:f,16:h,44:215,45:mu,55:220,82:$,87:d,89:He,172:221,185:351,203:536,211:626,212:627,231:gu,234:535,236:216,237:222,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,309:Vr,310:Xr,311:217,312:Er},n(ki,[2,134]),n(yu,[2,427]),n(ki,[2,135]),n(Gs,[2,26]),{44:628,87:d},n(qs,[2,106]),n(qs,[2,394]),n(Q,[2,396]),n(_u,[2,111]),n(_u,[2,398]),{13:f,16:h,44:39,55:40,87:d,139:342,186:629,190:340,195:341,197:Vs,307:43,308:p},n(lp,[2,217]),n(Q,ou,{144:248,140:630,143:631,31:[2,343]}),n(Ot,[2,97]),n(Pt,[2,380]),n(Ot,[2,180]),{13:f,16:h,44:136,45:Z,46:632,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},{13:f,16:h,44:136,45:Z,46:633,55:133,67:132,68:134,77:131,82:$,87:d,172:135,224:Ze,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:it,264:130,265:B,266:137,267:139,268:Ee,269:Ne,270:X,271:Le,273:Me,274:Re,275:146,276:ke,277:ye,278:149,279:Fe,280:Te,283:De,285:je,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:Ge,346:$e,347:Pe,348:b,349:w,350:T,351:P},n(Ot,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:h,48:[1,636],55:414,82:$,171:637,172:415,173:416,174:du,255:154,257:155,291:150,294:se,295:le,296:ue,297:ae,298:oe,299:ce,300:ie,301:fe,302:he,303:de,304:pe,305:ne,306:me,307:43,308:p,312:pu},n(Dv,[2,305]),n(Y,[2,86]),n(xc,[2,374]),n(ls,[2,37]),n(ls,[2,38]),n(Bs,[2,72]),n(Bs,[2,360]),n(ji,[2,77]),{29:U,57:638},{47:[1,639]},{29:[2,376]},n(qa,[2,402]),n(qa,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:d}),n(qa,[2,118],{272:[1,641]}),n(Su,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:de,304:pe,305:ne,306:me},n(Tc,[2,218]),n(xc,[2,44]),n(Dv,[2,306]),n(ji,[2,78]),{44:651,87:d},n(qa,[2,116]),n(Q,[2,406]),n(Su,[2,119]),n(Su,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:d}),n(Gs,[2,27]),n(_u,[2,230]),n(Nv,[2,345],{141:653,335:[1,654]}),n(Ot,[2,181]),n(Ot,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(Q,ou,{144:248,142:657,143:658,31:Lv,112:Lv}),n(Nv,[2,346]),n(ji,[2,80]),n(Su,[2,231]),n(Us,[2,67]),n(Us,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:o(function(x,O){if(O.recoverable)this.trace(x);else{var F=new Error(x);throw F.hash=O,F}},"parseError"),parse:o(function(x){var O=this,F=[0],J=[],xe=[null],m=[],Ar=this.table,g="",gi=0,Oc=0,Tu=0,xu=2,Pc=1,Au=m.slice.call(arguments,1),Et=Object.create(this.lexer),yi={yy:{}};for(var Rc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Rc)&&(yi.yy[Rc]=this.yy[Rc]);Et.setInput(x,yi.yy),yi.yy.lexer=Et,yi.yy.parser=this,typeof Et.yylloc>"u"&&(Et.yylloc={});var Qa=Et.yylloc;m.push(Qa);var ot=Et.options&&Et.options.ranges;typeof yi.yy.parseError=="function"?this.parseError=yi.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(vi){F.length=F.length-2*vi,xe.length=xe.length-vi,m.length=m.length-vi}o(St,"popStack");for(var ze=o(function(){var vi;return vi=Et.lex()||Pc,typeof vi!="number"&&(vi=O.symbols_[vi]||vi),vi},"lex"),et,Ur,Qs,un,YV,Cp,Ya={},Cu,qi,zv,Iu;;){if(Qs=F[F.length-1],this.defaultActions[Qs]?un=this.defaultActions[Qs]:((et===null||typeof et>"u")&&(et=ze()),un=Ar[Qs]&&Ar[Qs][et]),typeof un>"u"||!un.length||!un[0]){var Ip="";Iu=[];for(Cu in Ar[Qs])this.terminals_[Cu]&&Cu>xu&&Iu.push("'"+this.terminals_[Cu]+"'");Et.showPosition?Ip="Parse error on line "+(gi+1)+`:
271
271
  `+Et.showPosition()+`
272
- Expecting `+Iu.join(", ")+", got '"+(this.terminals_[et]||et)+"'":Ip="Parse error on line "+(mi+1)+": Unexpected "+(et==Pc?"end of input":"'"+(this.terminals_[et]||et)+"'"),this.parseError(Ip,{text:Et.match,token:this.terminals_[et]||et,line:Et.yylineno,loc:Qa,expected:Iu})}if(un[0]instanceof Array&&un.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Qs+", token: "+et);switch(un[0]){case 1:F.push(et),xe.push(Et.yytext),m.push(Et.yylloc),F.push(un[1]),et=null,Ur?(et=Ur,Ur=null):(Oc=Et.yyleng,g=Et.yytext,mi=Et.yylineno,Qa=Et.yylloc,Tu>0&&Tu--);break;case 2:if(qi=this.productions_[un[1]][1],Ya.$=xe[xe.length-qi],Ya._$={first_line:m[m.length-(qi||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(qi||1)].first_column,last_column:m[m.length-1].last_column},ot&&(Ya._$.range=[m[m.length-(qi||1)].range[0],m[m.length-1].range[1]]),Cp=this.performAction.apply(Ya,[g,Oc,mi,gi.yy,un[1],xe,m].concat(Au)),typeof Cp<"u")return Cp;qi&&(F=F.slice(0,-1*qi*2),xe=xe.slice(0,-1*qi),m=m.slice(0,-1*qi)),F.push(this.productions_[un[1]][0]),xe.push(Ya.$),m.push(Ya._$),zv=xr[F[F.length-2]][F[F.length-1]],F.push(zv);break;case 3:return!0}}return!0},"parse")},bu=K0().Wildcard,wu="http://www.w3.org/1999/02/22-rdf-syntax-ns#",jC=wu+"type",$C=wu+"first",VC=wu+"rest",Mv=wu+"nil",Eu="http://www.w3.org/2001/XMLSchema#",kv=Eu+"integer",jv=Eu+"decimal",$v=Eu+"double",UC=Eu+"boolean",Ws="",Vv="",Uv="";function Tr(I){return I.toLowerCase()}o(Tr,"lowercase");function Ui(I,x){return I.push(x),I}o(Ui,"appendTo");function Hs(I,x){return I.push.apply(I,x),I}o(Hs,"appendAllTo");function xt(I){I||(I={});for(var x=1,O=arguments.length,F;x<O&&(F=arguments[x]||{});x++)for(var J in F)I[J]=F[J];return I}o(xt,"extend");function di(){for(var I=[],x=0,O=arguments.length;x<O;x++)I=I.concat.apply(I,arguments[x]);return I}o(di,"unionAll");function Ac(I){if(I[0]==="<"&&(I=I.substring(1,I.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(I))return I;if(!Oe.base)throw new Error("Cannot resolve relative IRI "+I+" because no base IRI was set.");switch(Ws!==Oe.base&&(Ws=Oe.base,Vv=Ws.replace(/[^\/:]*$/,""),Uv=Ws.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),I[0]){case void 0:return Ws;case"#":return Ws+I;case"?":return Ws.replace(/(?:\?.*)?$/,I);case"/":return Uv+I;default:return Vv+I}}o(Ac,"resolveIRI");function gp(I){if(I){var x=I[0];if(x==="?"||x==="$")return Oe.factory.variable(I.substr(1))}return I}o(gp,"toVar");function er(I,x){return{type:"operation",operator:I,args:x||[]}}o(er,"operation");function Ga(I,x){var O={expression:I==="*"?new bu:I};if(x)for(var F in x)O[F]=x[F];return O}o(Ga,"expression");function Wa(I,x){return{type:"path",pathType:I,items:x}}o(Wa,"path");function yp(I,x){for(var O=0,F=x.length,J;O<F&&(J=x[O]);O++)I=er(J[0],[I,J[1]]);return I}o(yp,"createOperationTree");function zs(I,x){var O=[],F=[],J=I.length,xe,m={};if(!J)return null;for(var xr=0;xr<J&&(xe=I[xr]);xr++)(xe.named?F:O).push(xe.iri);return m[x||"from"]={default:O,named:F},m}o(zs,"groupDatasets");function Ha(I){return parseInt(I,10)}o(Ha,"toInt");function vp(I){return I.type==="group"&&I.patterns.length===1?I.patterns[0]:I}o(vp,"degroupSingle");function pi(I,x){return x&&x.termType!=="NamedNode"&&(x=Oe.factory.namedNode(x)),Oe.factory.literal(I,x)}o(pi,"createTypedLiteral");function BC(I,x){return Oe.factory.literal(I,x)}o(BC,"createLangLiteral");function _p(I,x,O){if(!("termType"in x))throw new Error("Nested triples cannot contain paths");return Oe.factory.quad(I,x,O)}o(_p,"nestedTriple");function Bi(I,x,O,F){var J={};return I!=null&&(J.subject=I),x!=null&&(J.predicate=x),O!=null&&(J.object=O),F!=null&&(J.annotations=F),J}o(Bi,"triple");function Cc(I){return typeof I=="string"?I.startsWith("e_")?Oe.factory.blankNode(I):Oe.factory.blankNode("e_"+I):Oe.factory.blankNode("g_"+Bv++)}o(Cc,"blank");var Bv=0;Oe._resetBlanks=function(){Bv=0};var qC=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,GC={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
273
- `,r:"\r",f:"\f"},WC=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Sp=String.fromCharCode;function qv(I,x){I=I.substring(x,I.length-x);try{I=I.replace(qC,function(O,F,J,xe){var m;if(F){if(m=parseInt(F,16),isNaN(m))throw new Error;return Sp(m)}else if(J){if(m=parseInt(J,16),isNaN(m))throw new Error;return m<65535?Sp(m):Sp(55296+((m-=65536)>>10),56320+(m&1023))}else{var xr=GC[xe];if(!xr)throw new Error;return xr}})}catch{return""}if(WC.exec(I))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+I);return I}o(qv,"unescapeString");function HC(I){var x=Cc(),O=x,F=[],J,xe=[];I.forEach(function(mi){F.push(mi.entity),Hs(xe,mi.triples)});for(var m=0,xr=0,g=F.length,J=Array(g*2);m<g;)J[xr++]=Bi(O,Oe.factory.namedNode($C),F[m]),J[xr++]=Bi(O,Oe.factory.namedNode(VC),O=++m<g?Cc():Oe.factory.namedNode(Mv));return{entity:x,triples:Hs(J,xe)}}o(HC,"createList");function zC(I){var x=Cc();return{entity:x,triples:I.map(function(O){return xt(Bi(x),O)})}}o(zC,"createAnonymousObject");function bp(I,x,O){var F=[],J=[];return x.forEach(function(xe){let m=null;xe.annotation&&(m=xe.annotation,xe=xe.object),F.push(Bi(null,I,xe.entity,m)),Hs(J,xe.triples)}),di(F,O||[],J)}o(bp,"objectListToTriples");function zV(I){for(var x=[],O,F=0,J;J=I[F];F++)switch(J.type){case"bgp":J.triples.length&&(O?Hs(O.triples,J.triples):Ui(x,O=J));break;default:(!J.patterns||J.patterns.length>0)&&(Ui(x,J),O=null)}return x}o(zV,"mergeAdjacentBGPs");function za(I){return I.variable?I.variable.value:I.value||I.expression.value}o(za,"getExpressionId");function wp(I){if(!I)return[];if(I.type==="aggregate")return[I];if(I.type==="operation"){let x=[];for(let O of I.args)x.push(...wp(O));return x}return[]}o(wp,"getAggregatesOfExpression");function QC(I){let x=new Set,O=o(function(F){F&&(F.termType==="Variable"?x.add(F):F.type==="operation"&&F.args.forEach(O))},"visitExpression");return O(I),x}o(QC,"getVariablesFromExpression");function Ep(I,x=1,O=[]){for(let F of I)x>0&&F instanceof Array?Ep(F,x-1,O):O.push(F);return O}o(Ep,"flatten");function Tp(I){return I.termType==="Variable"}o(Tp,"isVariable");function Gv(I){if(I.triples){let x=[];for(let O of I.triples)Tp(O.subject)&&x.push(O.subject.value),Tp(O.predicate)&&x.push(O.predicate.value),Tp(O.object)&&x.push(O.object.value);return x}else if(I.patterns){let x=[];for(let O of I.patterns)x.push(...Gv(O));return x}return[]}o(Gv,"getBoundVarsFromGroupGraphPattern");function YC(I){let x=I.slice().sort(),O=[];for(let F=0;F<x.length-1;F++)x[F+1]==x[F]&&O.push(x[F]);return O}o(YC,"getDuplicatesInArray");function Ic(I){if(!Oe.sparqlStar)throw new Error("SPARQL-star support is not enabled");return I}o(Ic,"ensureSparqlStar");function Wv(I,x,O){for(let F of x){let J=Bi("subject"in F?F.subject:I,F.predicate,F.object);O.push(J),F.annotations&&Wv(_p(I,F.predicate,F.object),F.annotations,O)}}o(Wv,"_applyAnnotations");function xp(I){if(Oe.sparqlStar){let x=[];return I.forEach(O=>{let F=Bi(O.subject,O.predicate,O.object);x.push(F),O.annotations&&Wv(_p(O.subject,O.predicate,O.object),O.annotations,x)}),x}return I}o(xp,"applyAnnotations");function QV(I){if(!Oe.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return I}o(QV,"ensureSparqlStarNestedQuads");function Hv(I){for(let x of I){if(x.type==="graph"&&x.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(x.type==="bgp"||x.type==="graph"){for(let O of x.triples)if(O.subject.termType==="Variable"||O.predicate.termType==="Variable"||O.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return I}o(Hv,"ensureNoVariables");function Ap(I){for(let x of I)if(x.type==="bgp"){for(let O of x.triples)if(O.subject.termType==="BlankNode"||O.predicate.termType==="BlankNode"||O.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return I}o(Ap,"ensureNoBnodes");var KC=(function(){var I={EOF:1,parseError:o(function(O,F){if(this.yy.parser)this.yy.parser.parseError(O,F);else throw new Error(O)},"parseError"),setInput:o(function(x,O){return this.yy=O||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var O=x.match(/(?:\r\n?|\n).*/g);return O?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:o(function(x){var O=x.length,F=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O),this.offset-=O;var J=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var xe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===J.length?this.yylloc.first_column:0)+J[J.length-F.length].length-F[0].length:this.yylloc.first_column-O},this.options.ranges&&(this.yylloc.range=[xe[0],xe[0]+this.yyleng-O]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
272
+ Expecting `+Iu.join(", ")+", got '"+(this.terminals_[et]||et)+"'":Ip="Parse error on line "+(gi+1)+": Unexpected "+(et==Pc?"end of input":"'"+(this.terminals_[et]||et)+"'"),this.parseError(Ip,{text:Et.match,token:this.terminals_[et]||et,line:Et.yylineno,loc:Qa,expected:Iu})}if(un[0]instanceof Array&&un.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Qs+", token: "+et);switch(un[0]){case 1:F.push(et),xe.push(Et.yytext),m.push(Et.yylloc),F.push(un[1]),et=null,Ur?(et=Ur,Ur=null):(Oc=Et.yyleng,g=Et.yytext,gi=Et.yylineno,Qa=Et.yylloc,Tu>0&&Tu--);break;case 2:if(qi=this.productions_[un[1]][1],Ya.$=xe[xe.length-qi],Ya._$={first_line:m[m.length-(qi||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(qi||1)].first_column,last_column:m[m.length-1].last_column},ot&&(Ya._$.range=[m[m.length-(qi||1)].range[0],m[m.length-1].range[1]]),Cp=this.performAction.apply(Ya,[g,Oc,gi,yi.yy,un[1],xe,m].concat(Au)),typeof Cp<"u")return Cp;qi&&(F=F.slice(0,-1*qi*2),xe=xe.slice(0,-1*qi),m=m.slice(0,-1*qi)),F.push(this.productions_[un[1]][0]),xe.push(Ya.$),m.push(Ya._$),zv=Ar[F[F.length-2]][F[F.length-1]],F.push(zv);break;case 3:return!0}}return!0},"parse")},bu=K0().Wildcard,wu="http://www.w3.org/1999/02/22-rdf-syntax-ns#",jC=wu+"type",$C=wu+"first",VC=wu+"rest",Mv=wu+"nil",Eu="http://www.w3.org/2001/XMLSchema#",kv=Eu+"integer",jv=Eu+"decimal",$v=Eu+"double",UC=Eu+"boolean",Ws="",Vv="",Uv="";function xr(I){return I.toLowerCase()}o(xr,"lowercase");function Ui(I,x){return I.push(x),I}o(Ui,"appendTo");function Hs(I,x){return I.push.apply(I,x),I}o(Hs,"appendAllTo");function xt(I){I||(I={});for(var x=1,O=arguments.length,F;x<O&&(F=arguments[x]||{});x++)for(var J in F)I[J]=F[J];return I}o(xt,"extend");function pi(){for(var I=[],x=0,O=arguments.length;x<O;x++)I=I.concat.apply(I,arguments[x]);return I}o(pi,"unionAll");function Ac(I){if(I[0]==="<"&&(I=I.substring(1,I.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(I))return I;if(!Oe.base)throw new Error("Cannot resolve relative IRI "+I+" because no base IRI was set.");switch(Ws!==Oe.base&&(Ws=Oe.base,Vv=Ws.replace(/[^\/:]*$/,""),Uv=Ws.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),I[0]){case void 0:return Ws;case"#":return Ws+I;case"?":return Ws.replace(/(?:\?.*)?$/,I);case"/":return Uv+I;default:return Vv+I}}o(Ac,"resolveIRI");function gp(I){if(I){var x=I[0];if(x==="?"||x==="$")return Oe.factory.variable(I.substr(1))}return I}o(gp,"toVar");function er(I,x){return{type:"operation",operator:I,args:x||[]}}o(er,"operation");function Ga(I,x){var O={expression:I==="*"?new bu:I};if(x)for(var F in x)O[F]=x[F];return O}o(Ga,"expression");function Wa(I,x){return{type:"path",pathType:I,items:x}}o(Wa,"path");function yp(I,x){for(var O=0,F=x.length,J;O<F&&(J=x[O]);O++)I=er(J[0],[I,J[1]]);return I}o(yp,"createOperationTree");function zs(I,x){var O=[],F=[],J=I.length,xe,m={};if(!J)return null;for(var Ar=0;Ar<J&&(xe=I[Ar]);Ar++)(xe.named?F:O).push(xe.iri);return m[x||"from"]={default:O,named:F},m}o(zs,"groupDatasets");function Ha(I){return parseInt(I,10)}o(Ha,"toInt");function vp(I){return I.type==="group"&&I.patterns.length===1?I.patterns[0]:I}o(vp,"degroupSingle");function mi(I,x){return x&&x.termType!=="NamedNode"&&(x=Oe.factory.namedNode(x)),Oe.factory.literal(I,x)}o(mi,"createTypedLiteral");function BC(I,x){return Oe.factory.literal(I,x)}o(BC,"createLangLiteral");function _p(I,x,O){if(!("termType"in x))throw new Error("Nested triples cannot contain paths");return Oe.factory.quad(I,x,O)}o(_p,"nestedTriple");function Bi(I,x,O,F){var J={};return I!=null&&(J.subject=I),x!=null&&(J.predicate=x),O!=null&&(J.object=O),F!=null&&(J.annotations=F),J}o(Bi,"triple");function Cc(I){return typeof I=="string"?I.startsWith("e_")?Oe.factory.blankNode(I):Oe.factory.blankNode("e_"+I):Oe.factory.blankNode("g_"+Bv++)}o(Cc,"blank");var Bv=0;Oe._resetBlanks=function(){Bv=0};var qC=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,GC={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
273
+ `,r:"\r",f:"\f"},WC=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Sp=String.fromCharCode;function qv(I,x){I=I.substring(x,I.length-x);try{I=I.replace(qC,function(O,F,J,xe){var m;if(F){if(m=parseInt(F,16),isNaN(m))throw new Error;return Sp(m)}else if(J){if(m=parseInt(J,16),isNaN(m))throw new Error;return m<65535?Sp(m):Sp(55296+((m-=65536)>>10),56320+(m&1023))}else{var Ar=GC[xe];if(!Ar)throw new Error;return Ar}})}catch{return""}if(WC.exec(I))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+I);return I}o(qv,"unescapeString");function HC(I){var x=Cc(),O=x,F=[],J,xe=[];I.forEach(function(gi){F.push(gi.entity),Hs(xe,gi.triples)});for(var m=0,Ar=0,g=F.length,J=Array(g*2);m<g;)J[Ar++]=Bi(O,Oe.factory.namedNode($C),F[m]),J[Ar++]=Bi(O,Oe.factory.namedNode(VC),O=++m<g?Cc():Oe.factory.namedNode(Mv));return{entity:x,triples:Hs(J,xe)}}o(HC,"createList");function zC(I){var x=Cc();return{entity:x,triples:I.map(function(O){return xt(Bi(x),O)})}}o(zC,"createAnonymousObject");function bp(I,x,O){var F=[],J=[];return x.forEach(function(xe){let m=null;xe.annotation&&(m=xe.annotation,xe=xe.object),F.push(Bi(null,I,xe.entity,m)),Hs(J,xe.triples)}),pi(F,O||[],J)}o(bp,"objectListToTriples");function zV(I){for(var x=[],O,F=0,J;J=I[F];F++)switch(J.type){case"bgp":J.triples.length&&(O?Hs(O.triples,J.triples):Ui(x,O=J));break;default:(!J.patterns||J.patterns.length>0)&&(Ui(x,J),O=null)}return x}o(zV,"mergeAdjacentBGPs");function za(I){return I.variable?I.variable.value:I.value||I.expression.value}o(za,"getExpressionId");function wp(I){if(!I)return[];if(I.type==="aggregate")return[I];if(I.type==="operation"){let x=[];for(let O of I.args)x.push(...wp(O));return x}return[]}o(wp,"getAggregatesOfExpression");function QC(I){let x=new Set,O=o(function(F){F&&(F.termType==="Variable"?x.add(F):F.type==="operation"&&F.args.forEach(O))},"visitExpression");return O(I),x}o(QC,"getVariablesFromExpression");function Ep(I,x=1,O=[]){for(let F of I)x>0&&F instanceof Array?Ep(F,x-1,O):O.push(F);return O}o(Ep,"flatten");function Tp(I){return I.termType==="Variable"}o(Tp,"isVariable");function Gv(I){if(I.triples){let x=[];for(let O of I.triples)Tp(O.subject)&&x.push(O.subject.value),Tp(O.predicate)&&x.push(O.predicate.value),Tp(O.object)&&x.push(O.object.value);return x}else if(I.patterns){let x=[];for(let O of I.patterns)x.push(...Gv(O));return x}return[]}o(Gv,"getBoundVarsFromGroupGraphPattern");function YC(I){let x=I.slice().sort(),O=[];for(let F=0;F<x.length-1;F++)x[F+1]==x[F]&&O.push(x[F]);return O}o(YC,"getDuplicatesInArray");function Ic(I){if(!Oe.sparqlStar)throw new Error("SPARQL-star support is not enabled");return I}o(Ic,"ensureSparqlStar");function Wv(I,x,O){for(let F of x){let J=Bi("subject"in F?F.subject:I,F.predicate,F.object);O.push(J),F.annotations&&Wv(_p(I,F.predicate,F.object),F.annotations,O)}}o(Wv,"_applyAnnotations");function xp(I){if(Oe.sparqlStar){let x=[];return I.forEach(O=>{let F=Bi(O.subject,O.predicate,O.object);x.push(F),O.annotations&&Wv(_p(O.subject,O.predicate,O.object),O.annotations,x)}),x}return I}o(xp,"applyAnnotations");function QV(I){if(!Oe.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return I}o(QV,"ensureSparqlStarNestedQuads");function Hv(I){for(let x of I){if(x.type==="graph"&&x.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(x.type==="bgp"||x.type==="graph"){for(let O of x.triples)if(O.subject.termType==="Variable"||O.predicate.termType==="Variable"||O.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return I}o(Hv,"ensureNoVariables");function Ap(I){for(let x of I)if(x.type==="bgp"){for(let O of x.triples)if(O.subject.termType==="BlankNode"||O.predicate.termType==="BlankNode"||O.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return I}o(Ap,"ensureNoBnodes");var KC=(function(){var I={EOF:1,parseError:o(function(O,F){if(this.yy.parser)this.yy.parser.parseError(O,F);else throw new Error(O)},"parseError"),setInput:o(function(x,O){return this.yy=O||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var O=x.match(/(?:\r\n?|\n).*/g);return O?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:o(function(x){var O=x.length,F=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O),this.offset-=O;var J=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var xe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===J.length?this.yylloc.first_column:0)+J[J.length-F.length].length-F[0].length:this.yylloc.first_column-O},this.options.ranges&&(this.yylloc.range=[xe[0],xe[0]+this.yyleng-O]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
274
274
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(x){this.unput(this.match.slice(x))},"less"),pastInput:o(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var x=this.pastInput(),O=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
275
275
  `+O+"^"},"showPosition"),test_match:o(function(x,O){var F,J,xe;if(this.options.backtrack_lexer&&(xe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(xe.yylloc.range=this.yylloc.range.slice(0))),J=x[0].match(/(?:\r\n?|\n).*/g),J&&(this.yylineno+=J.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:J?J[J.length-1].length-J[J.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],F=this.performAction.call(this,this.yy,this,O,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var m in xe)this[m]=xe[m];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,O,F,J;this._more||(this.yytext="",this.match="");for(var xe=this._currentRules(),m=0;m<xe.length;m++)if(F=this._input.match(this.rules[xe[m]]),F&&(!O||F[0].length>O[0].length)){if(O=F,J=m,this.options.backtrack_lexer){if(x=this.test_match(F,xe[m]),x!==!1)return x;if(this._backtrack){O=!1;continue}else return!1}else if(!this.options.flex)break}return O?(x=this.test_match(O,xe[J]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
276
276
  `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var O=this.next();return O||this.lex()},"lex"),begin:o(function(O){this.conditionStack.push(O)},"begin"),popState:o(function(){var O=this.conditionStack.length-1;return O>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(O){return O=this.conditionStack.length-1-Math.abs(O||0),O>=0?this.conditionStack[O]:"INITIAL"},"topState"),pushState:o(function(O){this.begin(O)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:o(function(O,F,J,xe){var m=xe;switch(J){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(F.yytext);break}},"anonymous"),rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};return I})();mp.lexer=KC;function Oe(){this.yy={}}return o(Oe,"Parser"),Oe.prototype=mp,mp.Parser=Oe,new Oe})();Bb.exports=d5});var zb=v((hz,Hb)=>{var p5="http://www.w3.org/2001/XMLSchema#integer",m5="http://www.w3.org/2001/XMLSchema#string";function gt(n){this._options=n=n||{};var e=n.prefixes||{};this._prefixByIri={};var t=[];for(var r in e){var i=e[r];rl(i)&&(this._prefixByIri[i]=r,t.push(i))}var s=t.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+s+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=n.sparqlStar,this._indent=rl(n.indent)?n.indent:" ",this._newline=rl(n.newline)?n.newline:`
@@ -312,7 +312,7 @@ ${r})`;case"extend":return`${r}Extend (?${e.variable} = ${this.expressionToStrin
312
312
  ${this.toString(e.input,t+1)}
313
313
  ${r})`;case"subquery":return`${r}Subquery(
314
314
  ${this.toString(e.query,t+1)}
315
- ${r})`;default:return`${r}Unknown(${e.type})`}}tripleToString(e){return`${this.elementToString(e.subject)} ${this.predicateToString(e.predicate)} ${this.elementToString(e.object)}`}predicateToString(e){return this.isPropertyPath(e)?this.propertyPathToString(e):this.elementToString(e)}isPropertyPath(e){return e.type==="path"}propertyPathToString(e){let t=e.items.map(r=>r.type==="path"?`(${this.propertyPathToString(r)})`:`<${r.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}elementToString(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":let t=`"${e.value}"`;return e.language&&(t+=`@${e.language}`),e.datatype&&(t+=`^^<${e.datatype}>`),t;case"blank":return`_:${e.value}`;default:return String(e)}}expressionToString(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value}"`:String(e.value);case"comparison":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"logical":return e.operator==="!"?`!(${this.expressionToString(e.operands[0])})`:`(${e.operands.map(t=>this.expressionToString(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"function":return`${e.function}(${e.args.map(t=>this.expressionToString(t)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.toString(e.pattern,0)} }`;default:return"unknown"}}toJSON(e){return JSON.stringify(e,null,2)}};dh.AlgebraSerializer=xy});var Zi=v(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.SolutionMapping=void 0;var uw=mt(),fw=Ye(),hw=Lt(),Ay=class n{static{o(this,"SolutionMapping")}constructor(e){this.bindings=e?new Map(e):new Map}get(e){return this.bindings.get(e)}set(e,t){this.bindings.set(e,t)}has(e){return this.bindings.has(e)}variables(){return Array.from(this.bindings.keys())}getBindings(){return new Map(this.bindings)}isCompatibleWith(e){for(let[t,r]of this.bindings.entries()){let i=e.get(t);if(i!==void 0&&!this.areEqual(r,i))return!1}return!0}merge(e){if(!this.isCompatibleWith(e))return null;let t=new n(this.bindings);for(let[r,i]of e.getBindings().entries())t.set(r,i);return t}clone(){return new n(this.bindings)}areEqual(e,t){return e instanceof uw.Literal&&t instanceof uw.Literal?e.equals(t):e instanceof fw.IRI&&t instanceof fw.IRI?e.value===t.value:e instanceof hw.BlankNode&&t instanceof hw.BlankNode?e.id===t.id:!1}toJSON(){let e={};for(let[t,r]of this.bindings.entries())e[t]=r.toString();return e}size(){return this.bindings.size}};ph.SolutionMapping=Ay});var pw=v(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PropertyPathExecutor=wo.PropertyPathExecutorError=void 0;var $5=Zi(),mh=Ye(),dw=Lt(),sl=class extends Error{static{o(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};wo.PropertyPathExecutorError=sl;var Cy=class{static{o(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let a of i){let c=await this.evaluatePath(a,t,s);for(let l of c){let u=new $5.SolutionMapping;this.isVariable(e)&&u.set(e.value,a),this.isVariable(r)&&u.set(r.value,l),yield u}}}async*executeWithBindings(e,t){if(!this.isPropertyPath(e.predicate))throw new sl("Predicate is not a property path");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.object,t);for await(let s of this.execute(r,e.predicate,i)){let a=t.merge(s);a!==null&&(yield a)}}async evaluatePath(e,t,r){switch(t.pathType){case"/":return this.evaluateSequencePath(e,t.items,r);case"|":return this.evaluateAlternativePath(e,t.items,r);case"^":return this.evaluateInversePath(e,t.items[0],r);case"+":return this.evaluateOneOrMorePath(e,t.items[0],r);case"*":return this.evaluateZeroOrMorePath(e,t.items[0],r);case"?":return this.evaluateZeroOrOnePath(e,t.items[0],r)}}async evaluateSequencePath(e,t,r){let i=new Set([e]);for(let s=0;s<t.length;s++){let a=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,a,c?r:null);for(let h of f)l.add(h)}if(i=l,i.size===0)break}return i}async evaluateAlternativePath(e,t,r){let i=new Set;for(let s of t){let a=await this.evaluatePathItem(e,s,r);for(let c of a)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new mh.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&a.add(c.subject);return a}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,a=[{node:e,depth:0}];for(;a.length>0;){let{node:c,depth:l}=a.shift();if(l>=this.MAX_DEPTH)continue;let u=await this.evaluatePathItem(c,t,null);for(let f of u){let h=this.nodeToKey(f);(r===null||this.nodeInSet(f,r))&&s.add(f),i.has(h)||(i.add(h),a.push({node:f,depth:l+1}))}}return s}async evaluateZeroOrMorePath(e,t,r){let i=await this.evaluateOneOrMorePath(e,t,r);return(r===null||this.nodeInSet(e,r))&&i.add(e),i}async evaluateZeroOrOnePath(e,t,r){let i=new Set;(r===null||this.nodeInSet(e,r))&&i.add(e);let s=await this.evaluatePathItem(e,t,r);for(let a of s)i.add(a);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new mh.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&a.add(c.object);return a}else return this.evaluatePath(e,t,r)}invertPath(e){switch(e.pathType){case"^":return e.items[0];case"/":return{type:"path",pathType:"/",items:[...e.items].reverse().map(r=>r.type==="iri"?{type:"path",pathType:"^",items:[r]}:this.invertPath(r))};case"|":return{type:"path",pathType:"|",items:e.items.map(r=>r.type==="iri"?{type:"path",pathType:"^",items:[r]}:this.invertPath(r))};case"+":case"*":case"?":let t=e.items[0].type==="iri"?{type:"path",pathType:"^",items:[e.items[0]]}:this.invertPath(e.items[0]);return{type:"path",pathType:e.pathType,items:[t]}}}async resolveElement(e){if(this.isVariable(e)){let r=new Set,i=await this.tripleStore.match(void 0,void 0,void 0);for(let s of i)r.add(s.subject),r.add(s.object);return r}let t=new Set;switch(e.type){case"iri":t.add(new mh.IRI(e.value));break;case"blank":t.add(new dw.BlankNode(e.value));break;default:throw new sl(`Unsupported element type in subject/object position: ${e.type}`)}return t}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r){if(r instanceof mh.IRI)return{type:"iri",value:r.value};if(r instanceof dw.BlankNode)return{type:"blank",value:r.id}}}return e}isVariable(e){return e.type==="variable"}isPropertyPath(e){return e.type==="path"}nodeToKey(e){return e.toString()}nodeInSet(e,t){let r=this.nodeToKey(e);for(let i of t)if(this.nodeToKey(i)===r)return!0;return!1}};wo.PropertyPathExecutor=Cy});var Py=v(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.BGPExecutor=Eo.BGPExecutorError=void 0;var gh=Zi(),ws=Ye(),Iy=mt(),yh=Lt(),vh=Lc(),V5=pw(),gr=class extends Error{static{o(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};Eo.BGPExecutorError=gr;var Oy=class{static{o(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new V5.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new gh.SolutionMapping;return}let t=this.matchTriplePattern(e.triples[0]);for(let r=1;r<e.triples.length;r++)t=this.joinWithPattern(t,e.triples[r]);for await(let r of t)yield r}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}async*executeInGraph(e,t){if(e.triples.length===0){yield new gh.SolutionMapping;return}let r=this.matchTriplePatternInGraph(e.triples[0],t);for(let i=1;i<e.triples.length;i++)r=this.joinWithPatternInGraph(r,e.triples[i],t);for await(let i of r)yield i}async*matchTriplePatternInGraph(e,t){if(this.isPropertyPath(e.predicate))throw new gr("Property paths within named graphs are not yet supported");let r=e.predicate,i=this.isVariable(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),s=this.isVariable(r)?void 0:this.toRDFTermAsPredicate(r),a=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new gr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,a,t);for(let l of c){let u=new gh.SolutionMapping;this.isVariable(e.subject)&&u.set(e.subject.value,l.subject),this.isVariable(r)&&u.set(r.value,l.predicate),this.isVariable(e.object)&&u.set(e.object.value,l.object),yield u}}async*joinWithPatternInGraph(e,t,r){let i=[];for await(let s of e)i.push(s);for(let s of i){let a=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(a,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){yield*this.propertyPathExecutor.execute(e.subject,e.predicate,e.object);return}let t=e.predicate,r=this.isVariable(e.subject)||this.isQuotedTriple(e.subject)&&this.hasVariablesInQuotedTriple(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),i=this.isVariable(t)?void 0:this.toRDFTermAsPredicate(t),s=this.isVariable(e.object)||this.isQuotedTriple(e.object)&&this.hasVariablesInQuotedTriple(e.object)?void 0:this.toRDFTerm(e.object),a=await this.tripleStore.match(r,i,s);for(let c of a){let l=new gh.SolutionMapping;if(this.isVariable(e.subject))l.set(e.subject.value,c.subject);else if(this.isQuotedTriple(e.subject)){let u=this.matchQuotedTriplePattern(e.subject,c.subject);if(u===null)continue;for(let[f,h]of u.entries())l.set(f,h)}if(this.isVariable(t)&&l.set(t.value,c.predicate),this.isVariable(e.object))l.set(e.object.value,c.object);else if(this.isQuotedTriple(e.object)){let u=this.matchQuotedTriplePattern(e.object,c.object);if(u===null)continue;for(let[f,h]of u.entries())l.set(f,h)}yield l}}hasVariablesInQuotedTriple(e){return!!(this.isVariable(e.subject)||e.predicate.type==="variable"||this.isVariable(e.object)||this.isQuotedTriple(e.subject)&&this.hasVariablesInQuotedTriple(e.subject)||this.isQuotedTriple(e.object)&&this.hasVariablesInQuotedTriple(e.object))}matchQuotedTriplePattern(e,t){if(!(t instanceof vh.QuotedTriple))return null;let r=new Map;if(this.isVariable(e.subject))r.set(e.subject.value,t.subject);else if(this.isQuotedTriple(e.subject)){let i=this.matchQuotedTriplePattern(e.subject,t.subject);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.subject,t.subject))return null;if(e.predicate.type==="variable")r.set(e.predicate.value,t.predicate);else if(e.predicate.value!==t.predicate.value)return null;if(this.isVariable(e.object))r.set(e.object.value,t.object);else if(this.isQuotedTriple(e.object)){let i=this.matchQuotedTriplePattern(e.object,t.object);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof ws.IRI&&e.value===t.value;case"literal":return!(!(t instanceof Iy.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof yh.BlankNode&&e.value===t.id;case"quoted":return t instanceof vh.QuotedTriple?this.toRDFQuotedTriple(e).equals(t):!1;default:return!1}}isPropertyPath(e){return e.type==="path"}async*joinWithPattern(e,t){let r=[];for await(let i of e)r.push(i);for(let i of r){let s=this.instantiatePattern(t,i);for await(let a of this.matchTriplePattern(s)){let c=i.merge(a);c!==null&&(yield c)}}}instantiatePattern(e,t){let r=this.isPropertyPath(e.predicate)?e.predicate:this.instantiateElement(e.predicate,t);return{subject:this.instantiateElement(e.subject,t),predicate:r,object:this.instantiateElement(e.object,t)}}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r)return this.toAlgebraElement(r)}return this.isQuotedTriple(e)?this.instantiateQuotedTriple(e,t):e}instantiateQuotedTriple(e,t){let r=this.instantiateElement(e.subject,t),i=e.predicate.type==="variable"?this.instantiatePredicateVariable(e.predicate,t):e.predicate,s=this.instantiateElement(e.object,t);return{type:"quoted",subject:r,predicate:i,object:s}}instantiatePredicateVariable(e,t){let r=t.get(e.value);return r&&r instanceof ws.IRI?{type:"iri",value:r.value}:e}isVariable(e){return e.type==="variable"}isQuotedTriple(e){return e.type==="quoted"}toRDFTermAsSubject(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"blank":return new yh.BlankNode(e.value);case"literal":throw new gr("Literals cannot appear in subject position");case"variable":throw new gr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new gr(`Unknown element type: ${e.type}`)}}toRDFQuotedTriple(e){let t=this.toRDFTermAsSubject(e.subject),r=e.predicate.type==="iri"?new ws.IRI(e.predicate.value):(()=>{throw new gr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new vh.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"literal":throw new gr("Literals cannot appear in predicate position");case"blank":throw new gr("Blank nodes cannot appear in predicate position");case"variable":throw new gr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new gr(`Unknown element type: ${e.type}`)}}toRDFTerm(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"literal":return new Iy.Literal(e.value,e.datatype?new ws.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new yh.BlankNode(e.value);case"variable":throw new gr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new gr(`Unknown element type: ${e.type}`)}}toAlgebraElement(e){if(e instanceof ws.IRI)return{type:"iri",value:e.value};if(e instanceof Iy.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof yh.BlankNode)return{type:"blank",value:e.id};if(e instanceof vh.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new gr(`Unknown RDF term type: ${e.constructor?.name||"unknown"}`)}toAlgebraQuotedTriple(e){return{type:"quoted",subject:this.toAlgebraElement(e.subject),predicate:{type:"iri",value:e.predicate.value},object:this.toAlgebraElement(e.object)}}};Eo.BGPExecutor=Oy});var Sh=v(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.BuiltInFunctions=void 0;var Se=Ye(),R=mt(),Dr=Lt(),To=Lc(),Ry=Cr(),al=class{static{o(this,"BuiltInFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof Se.IRI||e instanceof R.Literal?e.value:e instanceof Dr.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof R.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof R.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=this.parseDirectionalLangTag(e),[s,a]=this.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":a&&i!==a?!1:c===l?!0:c.startsWith(l+"-")}static parseDirectionalLangTag(e){let t=e.indexOf("--");if(t===-1)return[e,void 0];let r=e.substring(0,t),i=e.substring(t+2).toLowerCase();return[r,i]}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof R.Literal)return e.datatype?e.datatype:e.language?new Se.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Se.IRI("http://www.w3.org/2001/XMLSchema#string");throw new Error("DATATYPE: argument must be a literal")}static bound(e){return e!==void 0}static isIRI(e){return e===void 0?!1:e instanceof Se.IRI}static isBlank(e){return e===void 0?!1:e instanceof Dr.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof R.Literal}static isTriple(e){return e===void 0?!1:e instanceof To.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof R.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof R.Literal))return!1;let t=e.datatype?.value;return t?["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float","http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedShort","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#positiveInteger"].includes(t):!1}static regex(e,t,r){try{let i=r?r.includes("u")?r:r+"u":"u";return new RegExp(t,i).test(e)}catch(i){throw new Error(`REGEX: invalid pattern '${t}': ${i.message}`)}}static compare(e,t,r){if(this.isDayTimeDurationValue(e)&&this.isDayTimeDurationValue(t))return this.compareDurations(e instanceof R.Literal?e:String(e),t instanceof R.Literal?t:String(t),r);let i=this.toComparableValue(e),s=this.toComparableValue(t);switch(r){case"=":return i===s;case"!=":return i!==s;case"<":return i<s;case">":return i>s;case"<=":return i<=s;case">=":return i>=s;default:throw new Error(`Unknown comparison operator: ${r}`)}}static isDayTimeDurationValue(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static toComparableValue(e){if(typeof e=="string"||typeof e=="number")return e;if(e instanceof R.Literal){let t=e.datatype?.value;if(t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double")){let r=parseFloat(e.value);if(!isNaN(r))return r}if(t==="http://www.w3.org/2001/XMLSchema#dayTimeDuration")try{return this.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof Se.IRI?e.value:e instanceof Dr.BlankNode?e.id:String(e)}static contains(e,t){return e.includes(t)}static strStarts(e,t){return e.startsWith(t)}static strEnds(e,t){return e.endsWith(t)}static strlen(e){return e.length}static ucase(e){return e.toUpperCase()}static lcase(e){return e.toLowerCase()}static substr(e,t,r){let i=t-1;if(i<0){if(r!==void 0){let s=r+i;return s<=0?"":e.substring(0,s)}return e}return r!==void 0?e.substring(i,i+r):e.substring(i)}static strBefore(e,t){if(t==="")return"";let r=e.indexOf(t);return r===-1?"":e.substring(0,r)}static strAfter(e,t){if(t==="")return e;let r=e.indexOf(t);return r===-1?"":e.substring(r+t.length)}static concat(...e){return e.join("")}static replace(e,t,r,i){try{let s=i||"g",a=s.includes("u")?s:s+"u",c=new RegExp(t,a);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static parseDate(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`PARSEDATE: invalid date string '${e}'`);return t.getTime()}static dateBefore(e,t){let r=this.parseDate(e),i=this.parseDate(t);return r<i}static dateAfter(e,t){let r=this.parseDate(e),i=this.parseDate(t);return r>i}static dateInRange(e,t,r){let i=this.parseDate(e),s=this.parseDate(t),a=this.parseDate(r);return i>=s&&i<=a}static dateDiffMinutes(e,t){let r=this.parseDate(e),i=this.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=this.parseDate(e),i=this.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60*60)*100)/100}static logicalAnd(e){return e.every(t=>t===!0)}static logicalOr(e){return e.some(t=>t===!0)}static logicalNot(e){return!e}static year(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`YEAR: invalid date string '${e}'`);return t.getFullYear()}static month(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`MONTH: invalid date string '${e}'`);return t.getMonth()+1}static day(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`DAY: invalid date string '${e}'`);return t.getDate()}static hours(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`HOURS: invalid date string '${e}'`);return t.getHours()}static minutes(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`MINUTES: invalid date string '${e}'`);return t.getMinutes()}static seconds(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`SECONDS: invalid date string '${e}'`);return t.getSeconds()+t.getMilliseconds()/1e3}static timezone(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`TIMEZONE: invalid date string '${e}'`);let r;if(e.endsWith("Z"))r="PT0S";else{let i=e.match(/([+-]\d{2}):?(\d{2})$/);if(i){let s=parseInt(i[1],10),a=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);a===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${a}M`}else{let s=-t.getTimezoneOffset(),a=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${a}H`:r=`${l}PT${a}H${c}M`}}return new R.Literal(r,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static tz(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`TZ: invalid date string '${e}'`);if(e.endsWith("Z"))return"Z";let r=e.match(/([+-]\d{2}:\d{2})$/);if(r)return r[1];let i=e.match(/([+-])(\d{2})(\d{2})$/);return i?`${i[1]}${i[2]}:${i[3]}`:""}static now(){return new Date().toISOString()}static msToMinutes(e){return Math.round(e/(1e3*60))}static msToHours(e){return Math.round(e/(1e3*60*60)*100)/100}static msToSeconds(e){return Math.round(e/1e3)}static abs(e){return Math.abs(e)}static round(e){return Math.round(e)}static ceil(e){return Math.ceil(e)}static floor(e){return Math.floor(e)}static rand(){return Math.random()}static coalesce(e){for(let t of e)if(t!=null)return t}static if(e,t,r){return e?t:r}static xsdDateTime(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`xsd:dateTime: invalid date string '${e}'`);return new R.Literal(t.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static xsdInteger(e){let t=parseInt(e,10);if(isNaN(t))throw new Error(`xsd:integer: cannot convert '${e}' to integer`);return new R.Literal(String(t),new Se.IRI("http://www.w3.org/2001/XMLSchema#integer"))}static xsdDecimal(e){let t=parseFloat(e);if(isNaN(t))throw new Error(`xsd:decimal: cannot convert '${e}' to decimal`);return new R.Literal(String(t),new Se.IRI("http://www.w3.org/2001/XMLSchema#decimal"))}static encodeForUri(e){return encodeURIComponent(e)}static md5(e){return require("crypto").createHash("md5").update(e).digest("hex")}static sha1(e){return require("crypto").createHash("sha1").update(e).digest("hex")}static sha256(e){return require("crypto").createHash("sha256").update(e).digest("hex")}static sha384(e){return require("crypto").createHash("sha384").update(e).digest("hex")}static sha512(e){return require("crypto").createHash("sha512").update(e).digest("hex")}static sameTerm(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0||e.constructor!==t.constructor)return!1;if(e instanceof Se.IRI&&t instanceof Se.IRI)return e.value===t.value;if(e instanceof Dr.BlankNode&&t instanceof Dr.BlankNode)return e.id===t.id;if(e instanceof R.Literal&&t instanceof R.Literal){if(e.value!==t.value||e.language!==t.language)return!1;let r=e.datatype?.value,i=t.datatype?.value;return r===i}return!1}static iri(e){if(e===void 0)throw new Error("IRI: argument is undefined");if(e instanceof Se.IRI)return e;if(e instanceof R.Literal)return new Se.IRI(e.value);throw e instanceof Dr.BlankNode?new Error("IRI: cannot convert blank node to IRI"):new Error("IRI: unsupported term type")}static uri(e){return this.iri(e)}static bnode(e){if(e===void 0){let t=`b${(0,Ry.v4)().replace(/-/g,"").substring(0,12)}`;return new Dr.BlankNode(t)}if(e instanceof R.Literal)return new Dr.BlankNode(e.value);if(e instanceof Dr.BlankNode)return e;throw new Error("BNODE: argument must be a string literal or omitted")}static strdt(e,t){if(e===void 0)throw new Error("STRDT: lexical form is undefined");if(t===void 0)throw new Error("STRDT: datatype IRI is undefined");let r;if(e instanceof R.Literal){if(e.language)throw new Error("STRDT: lexical form must not have a language tag");r=e.value}else if(typeof e=="string")r=e;else throw new Error("STRDT: lexical form must be a string literal");let i;if(t instanceof Se.IRI)i=t;else if(t instanceof R.Literal)i=new Se.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new R.Literal(r,i)}static strlang(e,t){if(e===void 0)throw new Error("STRLANG: lexical form is undefined");if(t===void 0)throw new Error("STRLANG: language tag is undefined");let r;if(e instanceof R.Literal){if(e.language)throw new Error("STRLANG: lexical form must not already have a language tag");r=e.value}else if(typeof e=="string")r=e;else throw new Error("STRLANG: lexical form must be a string literal");let i;if(t instanceof R.Literal)i=t.value;else if(typeof t=="string")i=t;else throw new Error("STRLANG: language tag must be a string literal");if(i==="")throw new Error("STRLANG: language tag cannot be empty");return new R.Literal(r,void 0,i)}static strlangdir(e,t,r){if(e===void 0)throw new Error("STRLANGDIR: lexical form is undefined");if(t===void 0)throw new Error("STRLANGDIR: language tag is undefined");if(r===void 0)throw new Error("STRLANGDIR: direction is undefined");let i;if(e instanceof R.Literal){if(e.language)throw new Error("STRLANGDIR: lexical form must not already have a language tag");i=e.value}else if(typeof e=="string")i=e;else throw new Error("STRLANGDIR: lexical form must be a string literal");let s;if(t instanceof R.Literal)s=t.value;else if(typeof t=="string")s=t;else throw new Error("STRLANGDIR: language tag must be a string literal");if(s==="")throw new Error("STRLANGDIR: language tag cannot be empty");let a;if(r instanceof R.Literal)a=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(a!=="ltr"&&a!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${a}'. Must be 'ltr' or 'rtl'`);return new R.Literal(i,void 0,s,a)}static uuid(){let e=(0,Ry.v4)();return new Se.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,Ry.v4)();return new R.Literal(e)}static parseDayTimeDuration(e){if(!e)throw new Error("parseDayTimeDuration: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDayTimeDuration: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=r.indexOf("T"),a="",c="";if(s===-1?a=r:(a=r.substring(0,s),c=r.substring(s+1)),a){let l=a.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(a!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${a}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let d=parseFloat(u[1]);i+=d*60*60*1e3,l=l.substring(u[0].length)}let f=l.match(/^(\d+(?:\.\d+)?)M/);if(f){let d=parseFloat(f[1]);i+=d*60*1e3,l=l.substring(f[0].length)}let h=l.match(/^(\d+(?:\.\d+)?)S$/);if(h){let d=parseFloat(h[1]);i+=d*1e3,l=l.substring(h[0].length)}if(l!=="")throw new Error(`parseDayTimeDuration: invalid time component: '${l}' in '${e}'`)}return t?-i:i}static formatDayTimeDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/(1440*60*1e3));r=r%(1440*60*1e3);let s=Math.floor(r/(3600*1e3));r=r%(3600*1e3);let a=Math.floor(r/(60*1e3));r=r%(60*1e3);let c=r/1e3,l=t?"-P":"P";return i>0&&(l+=`${i}D`),(s>0||a>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),a>0&&(l+=`${a}M`),(c>0||s===0&&a===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return this.parseDayTimeDuration(e),new R.Literal(e,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static compareDurations(e,t,r){let i=e instanceof R.Literal?e.value:e,s=t instanceof R.Literal?t.value:t,a=this.parseDayTimeDuration(i),c=this.parseDayTimeDuration(s);switch(r){case"=":return a===c;case"!=":return a!==c;case"<":return a<c;case">":return a>c;case"<=":return a<=c;case">=":return a>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static isDayTimeDuration(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static dateDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r),a=this.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(a===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-a.getTime(),l=Math.round(c/(1440*60*1e3)),u=this.formatDateDuration(l);return new R.Literal(u,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDDate(e){let t=/^(-?\d{4})-(\d{2})-(\d{2})(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r){let u=new Date(e);return isNaN(u.getTime())?null:new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()))}let i=parseInt(r[1],10),s=parseInt(r[2],10)-1,a=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,a));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,h=parseInt(u[2],10),d=parseInt(u[3],10),p=f*(h*60+d)*60*1e3;l=new Date(l.getTime()-p)}}return l}static formatDateDuration(e){if(e===0)return"P0D";let t=e<0,r=Math.abs(e);return t?`-P${r}D`:`P${r}D`}static dateTimeDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r),a=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(a.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-a.getTime(),l=this.formatDayTimeDuration(c);return new R.Literal(l,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c);return new R.Literal(l.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c);return new R.Literal(l.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),h=String(l.getUTCDate()).padStart(2,"0"),d=`${u}-${f}-${h}`;return new R.Literal(d,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),h=String(l.getUTCDate()).padStart(2,"0"),d=`${u}-${f}-${h}`;return new R.Literal(d,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static parseYearMonthDuration(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDuration: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+a;return i?-c:c}static isYearMonthDuration(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static dateTimeAddYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0),new R.Literal(s.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0),new R.Literal(s.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),h=`${l}-${u}-${f}`;return new R.Literal(h,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),h=`${l}-${u}-${f}`;return new R.Literal(h,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseDayTimeDuration(r),a=this.parseDayTimeDuration(i),c=this.formatDayTimeDuration(s+a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseDayTimeDuration(r),a=this.parseDayTimeDuration(i),c=this.formatDayTimeDuration(s-a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof R.Literal?e.value:e,i=this.parseDayTimeDuration(r),s=this.formatDayTimeDuration(i*t);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationDivide(e,t){if(t===0)throw new Error("durationDivide: division by zero");let r=e instanceof R.Literal?e.value:e,i=this.parseDayTimeDuration(r),s=this.formatDayTimeDuration(i/t);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,a=t?"-P":"P";return i>0&&(a+=`${i}Y`),(s>0||i===0)&&(a+=`${s}M`),a}static yearMonthDurationAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseYearMonthDuration(r),a=this.parseYearMonthDuration(i),c=this.formatYearMonthDuration(s+a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseYearMonthDuration(r),a=this.parseYearMonthDuration(i),c=this.formatYearMonthDuration(s-a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static parseYearMonthDurationComponents(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDurationComponents: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:a,negative:i}}static durationYears(e){let t=e instanceof R.Literal?e.value:e,r=this.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof R.Literal?e.value:e,r=this.parseYearMonthDurationComponents(t);return r.negative?-r.months:r.months}static durationToDays(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/1e3}static parseDurationComponents(e){if(!e)throw new Error("parseDurationComponents: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDurationComponents: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=0,a=0,c=0,l=r.indexOf("T"),u="",f="";if(l===-1?u=r:(u=r.substring(0,l),f=r.substring(l+1)),u){let h=u.match(/^(\d+(?:\.\d+)?)D$/);if(h)i=parseFloat(h[1]);else if(u!=="")throw new Error(`parseDurationComponents: invalid day component: '${u}' in '${e}'`)}if(f){let h=f,d=h.match(/^(\d+(?:\.\d+)?)H/);d&&(s=parseFloat(d[1]),h=h.substring(d[0].length));let p=h.match(/^(\d+(?:\.\d+)?)M/);p&&(a=parseFloat(p[1]),h=h.substring(p[0].length));let _=h.match(/^(\d+(?:\.\d+)?)S$/);if(_&&(c=parseFloat(_[1]),h=h.substring(_[0].length)),h!=="")throw new Error(`parseDurationComponents: invalid time component: '${h}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:a,seconds:c}}static durationDays(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static adjust(e,t){let r=e instanceof R.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let H=i.getUTCFullYear(),re=String(i.getUTCMonth()+1).padStart(2,"0"),Ie=String(i.getUTCDate()).padStart(2,"0"),N=String(i.getUTCHours()).padStart(2,"0"),K=String(i.getUTCMinutes()).padStart(2,"0"),ge=String(i.getUTCSeconds()).padStart(2,"0"),dt=i.getUTCMilliseconds(),nt=`${H}-${re}-${Ie}T${N}:${K}:${ge}`;return dt>0&&(nt+=`.${String(dt).padStart(3,"0")}`),new R.Literal(nt,new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof R.Literal?t.value:t,a=this.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(a)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+a),f=u.getUTCFullYear(),h=String(u.getUTCMonth()+1).padStart(2,"0"),d=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),_=String(u.getUTCMinutes()).padStart(2,"0"),S=String(u.getUTCSeconds()).padStart(2,"0"),E=u.getUTCMilliseconds(),A=a>=0?"+":"-",C=Math.floor(Math.abs(a)/(3600*1e3)),k=Math.floor(Math.abs(a)%(3600*1e3)/(60*1e3)),G=`${A}${String(C).padStart(2,"0")}:${String(k).padStart(2,"0")}`,Q=`${f}-${h}-${d}T${p}:${_}:${S}`;return E>0&&(Q+=`.${String(E).padStart(3,"0")}`),Q+=G,new R.Literal(Q,new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static normalize(e,t){if(e===void 0)throw new Error("NORMALIZE: string argument is undefined");let r;if(e instanceof R.Literal)r=e.value;else if(e instanceof Se.IRI)r=e.value;else if(e instanceof Dr.BlankNode)r=e.id;else if(typeof e=="string")r=e;else throw new Error("NORMALIZE: first argument must be a string or literal");let i="NFC";if(t!==void 0)if(t instanceof R.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof Se.IRI)i=t.value.toUpperCase();else throw new Error("NORMALIZE: second argument must be a string literal");if(!this.VALID_NORMALIZATION_FORMS.includes(i))throw new Error(`NORMALIZE: invalid normalization form '${i}'. Valid forms are: NFC, NFD, NFKC, NFKD`);let s=r.normalize(i);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#string"))}static fold(e){if(e===void 0)throw new Error("FOLD: string argument is undefined");let t;if(e instanceof R.Literal)t=e.value;else if(e instanceof Se.IRI)t=e.value;else if(e instanceof Dr.BlankNode)t=e.id;else if(typeof e=="string")t=e;else throw new Error("FOLD: argument must be a string or literal");let r=this.unicodeCaseFold(t);return new R.Literal(r,new Se.IRI("http://www.w3.org/2001/XMLSchema#string"))}static unicodeCaseFold(e){let t="";for(let r of e){let i=this.CASE_FOLDING_MAP.get(r);i!==void 0?t+=i:t+=r.toLowerCase()}return t}static isTime(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static timeDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDTime(r),a=this.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(a===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-a,l=this.formatDayTimeDuration(c);return new R.Literal(l,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDTime(e){let t=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r)return null;let i=parseInt(r[1],10),s=parseInt(r[2],10),a=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||a<0||a>59||i===24&&(s!==0||a!==0))return null;let u=0;if(c){let h=c.padEnd(3,"0").slice(0,3);u=parseInt(h,10)}let f=i*60*60*1e3+s*60*1e3+a*1e3+u;if(i===24&&(f=1440*60*1e3),l&&l!=="Z"){let h=l.match(/([+-])(\d{2}):(\d{2})/);if(h){let d=h[1]==="+"?1:-1,p=parseInt(h[2],10),_=parseInt(h[3],10),S=d*(p*60+_)*60*1e3;f-=S}}return f}static triple(e,t,r){if(e===void 0)throw new Error("TRIPLE: subject is undefined");if(t===void 0)throw new Error("TRIPLE: predicate is undefined");if(r===void 0)throw new Error("TRIPLE: object is undefined");if(e instanceof R.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Se.IRI)){let c=t instanceof R.Literal?"Literal":t instanceof Dr.BlankNode?"BlankNode":t instanceof To.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,a=r;return new To.QuotedTriple(i,s,a)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`SUBJECT: argument must be QuotedTriple, got ${t}`)}return e.subject}static predicate(e){if(e===void 0)throw new Error("PREDICATE: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`PREDICATE: argument must be QuotedTriple, got ${t}`)}return e.predicate}static object(e){if(e===void 0)throw new Error("OBJECT: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};_h.BuiltInFunctions=al;al.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];al.CASE_FOLDING_MAP=new Map([["\xDF","ss"],["\u1E9E","ss"],["\u03A3","\u03C3"],["\u03C2","\u03C3"],["\u0130","i\u0307"],["I","i"],["\u0587","\u0565\u0582"],["\uFB00","ff"],["\uFB01","fi"],["\uFB02","fl"],["\uFB03","ffi"],["\uFB04","ffl"],["\uFB05","st"],["\uFB06","st"],["\u0390","\u03B9\u0308\u0301"],["\u03B0","\u03C5\u0308\u0301"],["\u017F","s"],["\u1E9B","\u1E61"],["\u212A","k"],["\u212B","\xE5"]])});var Ew=v(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.functionHandlers=void 0;var j=Sh();L.functionHandlers=new Map;L.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.str(t)});L.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.lang(t)});L.functionHandlers.set("langmatches",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.langMatches(t,r)});L.functionHandlers.set("contains",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.contains(t,r)});L.functionHandlers.set("strstarts",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strStarts(t,r)});L.functionHandlers.set("strends",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strEnds(t,r)});L.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.strlen(t)});L.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.ucase(t)});L.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.lcase(t)});L.functionHandlers.set("substr",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=Number(e.evaluateExpression(n[1],e.solution));if(n[2]){let i=Number(e.evaluateExpression(n[2],e.solution));return j.BuiltInFunctions.substr(t,r,i)}return j.BuiltInFunctions.substr(t,r)});L.functionHandlers.set("strbefore",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strBefore(t,r)});L.functionHandlers.set("strafter",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strAfter(t,r)});L.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return j.BuiltInFunctions.concat(...t)});L.functionHandlers.set("replace",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=e.getStringValue(e.evaluateExpression(n[2],e.solution)),s=n[3]?e.getStringValue(e.evaluateExpression(n[3],e.solution)):void 0;return j.BuiltInFunctions.replace(t,r,i,s)});L.functionHandlers.set("regex",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=n[2]?e.getStringValue(e.evaluateExpression(n[2],e.solution)):void 0;return j.BuiltInFunctions.regex(t,r,i)});L.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.encodeForUri(t)});L.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.datatype(t).value});L.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return j.BuiltInFunctions.bound(r)}return!0});var mw=o((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isIRI(t)},"isIriHandler");L.functionHandlers.set("isiri",mw);L.functionHandlers.set("isuri",mw);L.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isBlank(t)});L.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isLiteral(t)});L.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isNumeric(t)});L.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.hasLangdir(t)});L.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isTriple(t)});L.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return j.BuiltInFunctions.sameTerm(t,r)});L.functionHandlers.set("abs",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.abs(t)});L.functionHandlers.set("round",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.round(t)});L.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.ceil(t)});L.functionHandlers.set("floor",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.floor(t)});L.functionHandlers.set("rand",()=>j.BuiltInFunctions.rand());L.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.parseDate(t)});L.functionHandlers.set("datebefore",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateBefore(t,r)});L.functionHandlers.set("dateafter",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateAfter(t,r)});L.functionHandlers.set("dateinrange",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=e.getStringValue(e.evaluateExpression(n[2],e.solution));return j.BuiltInFunctions.dateInRange(t,r,i)});L.functionHandlers.set("datediffminutes",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateDiffMinutes(t,r)});L.functionHandlers.set("datediffhours",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateDiffHours(t,r)});var xo=o((n,e,t)=>(r,i)=>{let s=i.evaluateExpression(r[0],i.solution);return e&&i.isYearMonthDurationValue(s)?e(s):t&&i.isDayTimeDurationValue(s)?t(s):n(i.getStringValue(s))},"createDateTimeAccessor"),gw=xo(j.BuiltInFunctions.year,j.BuiltInFunctions.durationYears,null);L.functionHandlers.set("year",gw);L.functionHandlers.set("years",gw);var yw=xo(j.BuiltInFunctions.month,j.BuiltInFunctions.durationMonths,null);L.functionHandlers.set("month",yw);L.functionHandlers.set("months",yw);var vw=xo(j.BuiltInFunctions.day,null,j.BuiltInFunctions.durationDays);L.functionHandlers.set("day",vw);L.functionHandlers.set("days",vw);L.functionHandlers.set("hours",xo(j.BuiltInFunctions.hours,null,j.BuiltInFunctions.durationHours));L.functionHandlers.set("minutes",xo(j.BuiltInFunctions.minutes,null,j.BuiltInFunctions.durationMinutes));L.functionHandlers.set("seconds",xo(j.BuiltInFunctions.seconds,null,j.BuiltInFunctions.durationSeconds));L.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.timezone(t)});L.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.tz(t)});L.functionHandlers.set("adjust",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=n.length>1?e.evaluateExpression(n[1],e.solution):void 0;return j.BuiltInFunctions.adjust(t,r)});L.functionHandlers.set("now",()=>j.BuiltInFunctions.now());var _w=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");L.functionHandlers.set("datetime",_w);L.functionHandlers.set("xsd:datetime",_w);var Sw=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");L.functionHandlers.set("integer",Sw);L.functionHandlers.set("xsd:integer",Sw);var bw=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");L.functionHandlers.set("decimal",bw);L.functionHandlers.set("xsd:decimal",bw);var ww=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");L.functionHandlers.set("daytimeduration",ww);L.functionHandlers.set("xsd:daytimeduration",ww);L.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToDays(t)});L.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToHours(t)});L.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToMinutes(t)});L.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToSeconds(t)});L.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationDays(t)});L.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationHours(t)});L.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationMinutes(t)});L.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationSeconds(t)});L.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationYears(t)});L.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationMonths(t)});L.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeDiff(t,r)});L.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeAdd(t,r)});L.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeSubtract(t,r)});L.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToMinutes(t)});L.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToHours(t)});L.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToSeconds(t)});L.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.md5(t)});L.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha1(t)});L.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha256(t)});L.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha384(t)});L.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha512(t)});L.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.subject(t)});L.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.predicate(t)});L.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.object(t)});L.functionHandlers.set("triple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution),i=e.getTermFromExpression(n[2],e.solution);return j.BuiltInFunctions.triple(t,r,i)})});var bh=v(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.FilterExecutor=Ao.FilterExecutorError=void 0;var ft=Sh(),U5=Ew(),va=mt(),sr=class extends Error{static{o(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};Ao.FilterExecutorError=sr;var Fy=class{static{o(this,"FilterExecutor")}constructor(){this.existsEvaluator=null,this.tripleStore=null,this.uuidCache=new Map}setExistsEvaluator(e){this.existsEvaluator=e}setTripleStore(e){this.tripleStore=e,this.uuidCache.clear()}async*execute(e,t){let r=this.expressionContainsExists(e.expression);for await(let i of t)try{let s;r?s=await this.evaluateExpressionAsync(e.expression,i):s=this.evaluateExpression(e.expression,i),s===!0&&(yield i)}catch{continue}}expressionContainsExists(e){if(e.type==="exists")return!0;if(e.type==="logical")return e.operands.some(t=>this.expressionContainsExists(t));if(e.type==="comparison")return this.expressionContainsExists(e.left)||this.expressionContainsExists(e.right);if(e.type==="in"){let t=e;return this.expressionContainsExists(t.expression)||t.list.some(r=>this.expressionContainsExists(r))}return!1}async executeAll(e,t){let r=[];async function*i(){for(let s of t)yield s}o(i,"generator");for await(let s of this.execute(e,i()))r.push(s);return r}evaluateExpression(e,t){let r=e;if(r.termType)switch(r.termType){case"Variable":return t.get(r.value);case"Literal":return r.value;case"NamedNode":return r.value;default:throw new sr(`Unsupported termType: ${r.termType}`)}switch(e.type){case"comparison":return this.evaluateComparison(e,t);case"logical":return this.evaluateLogical(e,t);case"arithmetic":return this.evaluateArithmetic(e,t);case"function":case"functionCall":return this.evaluateFunction(e,t);case"variable":return t.get(e.name);case"literal":return e.value;case"in":return this.evaluateIn(e,t);case"exists":throw new sr("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new sr(`Unsupported expression type: ${e.type}, expr.termType=${r.termType}`)}}async evaluateExpressionAsync(e,t){return e.type==="exists"?this.evaluateExists(e,t):e.type==="logical"?this.evaluateLogicalAsync(e,t):this.evaluateExpression(e,t)}async evaluateExists(e,t){if(!this.existsEvaluator)throw new sr("EXISTS evaluator not set. Call setExistsEvaluator before evaluating EXISTS expressions.");let r=await this.existsEvaluator(e.pattern,t);return e.negated?!r:r}async evaluateLogicalAsync(e,t){if(e.operator==="!"){let i=await this.evaluateExpressionAsync(e.operands[0],t);return ft.BuiltInFunctions.logicalNot(i)}let r=[];for(let i of e.operands){let s=await this.evaluateExpressionAsync(i,t);r.push(s)}if(e.operator==="&&")return ft.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return ft.BuiltInFunctions.logicalOr(r);throw new sr(`Unknown logical operator: ${e.operator}`)}evaluateComparison(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);return ft.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return ft.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return ft.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return ft.BuiltInFunctions.logicalOr(r);throw new sr(`Unknown logical operator: ${e.operator}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let a=this.evaluateExpression(s,t);return ft.BuiltInFunctions.compare(r,a,"=")});return e.negated?!i:i}evaluateArithmetic(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);if(e.operator==="-"&&this.isDateValue(r)&&this.isDateValue(i))return ft.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return ft.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return ft.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return ft.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return ft.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new sr("Division by zero");return ft.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),a=this.toNumericValue(i);switch(e.operator){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":if(a===0)throw new sr("Division by zero");return s/a;default:throw new sr(`Unknown arithmetic operator: ${e.operator}`)}}isDayTimeDurationValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof va.Literal){let t=e.datatype?.value||"";if(t.includes("#integer")||t.includes("#decimal")||t.includes("#double")||t.includes("#float")){let i=parseFloat(e.value);if(!isNaN(i))return i}let r=parseFloat(e.value);if(!isNaN(r))return r}if(typeof e=="string"){let t=parseFloat(e);if(!isNaN(t))return t}if(e&&typeof e=="object"&&"value"in e){let t=parseFloat(String(e.value));if(!isNaN(t))return t}throw new sr(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof va.Literal){let t=e.datatype?.value||"";return t.includes("#dateTime")||t.includes("#date")?!0:/^\d{4}-\d{2}-\d{2}(T|\s)/.test(e.value)}return typeof e=="string"?/^\d{4}-\d{2}-\d{2}(T|\s)/.test(e):!1}isDateValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}evaluateFunction(e,t){let r=e,i=this.extractFunctionName(r.function),s=this.evaluateSpecialFunction(i,r.args,t);if(s!==void 0)return s.value;let a=U5.functionHandlers.get(i);if(!a)throw new sr(`Unknown function: ${i}`);let c={evaluateExpression:o((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:o((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:o(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:o(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:o(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return a(r.args,c)}extractFunctionName(e){if(typeof e=="string")return e.toLowerCase();if(e&&typeof e=="object"&&"value"in e){let t=e.value;return((t.includes("#")?t.split("#").pop():t.split("/").pop())||t).toLowerCase()}throw new sr(`Unknown function format: ${e}`)}evaluateSpecialFunction(e,t,r){switch(e){case"coalesce":for(let c of t)try{let l=this.evaluateExpression(c,r);if(l!=null)return{value:l}}catch{continue}return{value:void 0};case"if":if(!t||t.length!==3)throw new sr("IF requires exactly 3 arguments");let i=this.evaluateExpression(t[0],r);return{value:this.toBoolean(i)?this.evaluateExpression(t[1],r):this.evaluateExpression(t[2],r)};case"byuuid":return{value:this.evaluateByUUID({args:t},r)};default:return}}getTermFromExpression(e,t){let r=e;if(r.type==="variable"&&r.name)return t.get(r.name)}getStringValue(e){return e==null?"":typeof e=="object"&&"value"in e?String(e.value):String(e)}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number")return!isNaN(e)&&e!==0;if(typeof e=="string")return e.length>0;if(e instanceof va.Literal){let t=e.datatype?.value||"";if(t.includes("#boolean"))return e.value==="true"||e.value==="1";if(t.includes("#integer")||t.includes("#decimal")||t.includes("#double")||t.includes("#float")){let r=parseFloat(e.value);return!isNaN(r)&&r!==0}return e.value.length>0}return!!e}evaluateByUUID(e,t){if(!e.args||e.args.length!==1)throw new sr("exo:byUUID requires exactly 1 argument (UUID string)");let r=this.evaluateExpression(e.args[0],t),i=this.getStringValue(r);if(!i)return;let s=i.toLowerCase();if(this.uuidCache.has(s))return this.uuidCache.get(s)??void 0;if(!this.tripleStore){this.uuidCache.set(s,null);return}if(this.tripleStore.findSubjectsByUUIDSync){let a=this.tripleStore.findSubjectsByUUIDSync(s);if(a.length===0){this.uuidCache.set(s,null);return}let c=a[0];return this.uuidCache.set(s,c),c}this.uuidCache.set(s,null)}cacheUUIDResult(e,t){let r=e.toLowerCase();this.uuidCache.set(r,t)}getCachedUUID(e){let t=e.toLowerCase();if(this.uuidCache.has(t))return this.uuidCache.get(t)}};Ao.FilterExecutor=Fy});var Ny=v(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.OptionalExecutor=void 0;var Dy=class{static{o(this,"OptionalExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i){let l=s.merge(c);l!==null&&(yield l,a=!0)}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}};wh.OptionalExecutor=Dy});var My=v(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.UnionExecutor=void 0;var Ly=class{static{o(this,"UnionExecutor")}async*execute(e,t){let r=new Set;for await(let i of e){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}for await(let i of t){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Eh.UnionExecutor=Ly});var Vy=v(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.ConstructExecutor=void 0;var B5=Wi(),_a=Ye(),ky=mt(),jy=Lt(),q5=Lc(),$y=class{static{o(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let a of e)try{let c=this.instantiateTriple(a,s),l=`${c.subject.toString()}|${c.predicate.toString()}|${c.object.toString()}`;i.has(l)||(i.add(l),r.push(c))}catch{continue}return r}instantiateTriple(e,t){if(this.isPropertyPath(e.predicate))throw new Error("Property paths are not supported in CONSTRUCT templates");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.predicate,t),s=this.instantiateElement(e.object,t);return new B5.Triple(r,i,s)}isPropertyPath(e){return e.type==="path"}instantiateElement(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable: ${e.value}`);return r}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="literal")return new ky.Literal(e.value,e.datatype?new _a.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);throw new Error(`Unknown element type: ${e.type}`)}instantiateQuotedTriple(e,t){let r=this.instantiateQuotedSubject(e.subject,t),i=this.instantiateQuotedPredicate(e.predicate,t),s=this.instantiateQuotedObject(e.object,t);return new q5.QuotedTriple(r,i,s)}instantiateQuotedSubject(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable in quoted triple subject: ${e.value}`);if(r instanceof ky.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);throw new Error(`Invalid element type for quoted triple subject: ${e.type}`)}instantiateQuotedPredicate(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable in quoted triple predicate: ${e.value}`);if(!(r instanceof _a.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new _a.IRI(e.value)}instantiateQuotedObject(e,t){if(e.type==="variable"){let i=t.get(e.value);if(!i)throw new Error(`Unbound variable in quoted triple object: ${e.value}`);return i}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="literal")return new ky.Literal(e.value,e.datatype?new _a.IRI(e.datatype):void 0,e.language);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);let r=e;throw new Error(`Invalid element type for quoted triple object: ${r.type}`)}};Th.ConstructExecutor=$y});var xw=v(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.DescribeExecutor=void 0;var Tw=Ye(),Uy=class{static{o(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,a=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,a,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,a,c){let l=e.toString();if(c.has(l)||(c.add(l),t!==void 0&&r>t))return;let u=[],f=await this.tripleStore.match(e,void 0,void 0);if(u.push(...f),i){let d=await this.tripleStore.match(void 0,void 0,e);u.push(...d)}let h=[];for(let d of u){let p=`${d.subject.toString()}|${d.predicate.toString()}|${d.object.toString()}`;a.has(p)||(a.add(p),s.push(d),(t===void 0||r<t)&&(this.isIRI(d.subject)&&d.subject.toString()!==l&&h.push(d.subject),this.isIRI(d.object)&&d.object.toString()!==l&&h.push(d.object)))}for(let d of h)await this.describeResourceWithDepth(d,t,r+1,i,s,a,c)}isIRI(e){return e?e instanceof Tw.IRI||e.termType==="NamedNode"||typeof e.value=="string"&&e.value.startsWith("http"):!1}async describeByIRI(e,t){let r=new Tw.IRI(e);return this.execute([r],t)}};xh.DescribeExecutor=Uy});var Aw=v(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.MinusExecutor=void 0;var By=class{static{o(this,"MinusExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i)if(this.areCompatible(s,c)){a=!0;break}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(a=>i.has(a));if(s.length===0)return!1;for(let a of s){let c=e.get(a),l=t.get(a);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Ah.MinusExecutor=By});var Iw=v(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ValuesExecutor=Co.ValuesExecutorError=void 0;var G5=Zi(),Cw=Ye(),W5=mt(),Ch=class extends Error{static{o(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Co.ValuesExecutorError=Ch;var qy=class{static{o(this,"ValuesExecutor")}async*execute(e){if(e.bindings.length!==0)for(let t of e.bindings)yield this.createSolutionMapping(t)}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}createSolutionMapping(e){let t=new G5.SolutionMapping;for(let[r,i]of Object.entries(e)){let s=this.toRDFTerm(i);t.set(r,s)}return t}toRDFTerm(e){if(e.type==="iri")return new Cw.IRI(e.value);if(e.type==="literal")return new W5.Literal(e.value,e.datatype?new Cw.IRI(e.datatype):void 0,e.language,e.direction);throw new Ch(`Unknown term type: ${e.type}`)}};Co.ValuesExecutor=qy});var Gy=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.CustomAggregateRegistry=Oo.CustomAggregateError=void 0;var Io=class extends Error{static{o(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Oo.CustomAggregateError=Io;var Ih=class n{static{o(this,"CustomAggregateRegistry")}constructor(){this.aggregates=new Map}static getInstance(){return n.instance||(n.instance=new n),n.instance}static resetInstance(){n.instance&&n.instance.clear(),n.instance=null}register(e,t){if(!e||typeof e!="string")throw new Io("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Io("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Io(`Aggregate with IRI "${e}" is already registered`,e);this.aggregates.set(e,t)}unregister(e){return this.aggregates.delete(e)}get(e){return this.aggregates.get(e)}has(e){return this.aggregates.has(e)}getRegisteredIris(){return Array.from(this.aggregates.keys())}clear(){this.aggregates.clear()}get size(){return this.aggregates.size}};Oo.CustomAggregateRegistry=Ih;Ih.instance=null});var Wy=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.BUILT_IN_AGGREGATES=qe.modeAggregate=qe.stddevAggregate=qe.varianceAggregate=qe.medianAggregate=qe.EXO_AGGREGATE_NS=void 0;qe.getNumericValue=Oh;qe.createDecimalLiteral=ti;qe.createDoubleLiteral=Q5;qe.createPercentileAggregate=Sa;var ba=mt(),Po=Ye(),H5=new Po.IRI("http://www.w3.org/2001/XMLSchema#decimal"),z5=new Po.IRI("http://www.w3.org/2001/XMLSchema#double");qe.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Oh(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof ba.Literal?parseFloat(n.value):n instanceof Po.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}o(Oh,"getNumericValue");function ti(n){return new ba.Literal(String(n),H5)}o(ti,"createDecimalLiteral");function Q5(n){return new ba.Literal(String(n),z5)}o(Q5,"createDoubleLiteral");qe.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Oh(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ti(0);let r=[...t].sort((a,c)=>a-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return ti(s)}};qe.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Oh(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ti(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return ti(i)}};qe.stddevAggregate={init(){return{values:[]}},step(n,e){qe.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ti(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return ti(Math.sqrt(i))}};qe.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof ba.Literal||e instanceof Po.IRI?e.value:e),i=t.counts.get(r)||0;t.counts.set(r,i+1),t.values.set(r,e)},finalize(n){let e=n;if(e.counts.size===0)return new ba.Literal(" ",new Po.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[a,c]of e.counts)c>r&&(r=c,t=a);let i=e.values.get(t);if(i instanceof ba.Literal)return i;let s=parseFloat(t);return isNaN(s)?new ba.Literal(t,new Po.IRI("http://www.w3.org/2001/XMLSchema#string")):ti(s)}};function Sa(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Oh(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return ti(0);let s=[...i].sort((h,d)=>h-d),a=r.percentile*(s.length-1),c=Math.floor(a),l=Math.ceil(a);if(c===l)return ti(s[c]);let u=a-c,f=s[c]*(1-u)+s[l]*u;return ti(f)}}}o(Sa,"createPercentileAggregate");qe.BUILT_IN_AGGREGATES={[`${qe.EXO_AGGREGATE_NS}median`]:qe.medianAggregate,[`${qe.EXO_AGGREGATE_NS}variance`]:qe.varianceAggregate,[`${qe.EXO_AGGREGATE_NS}stddev`]:qe.stddevAggregate,[`${qe.EXO_AGGREGATE_NS}mode`]:qe.modeAggregate,[`${qe.EXO_AGGREGATE_NS}percentile25`]:Sa(25),[`${qe.EXO_AGGREGATE_NS}percentile50`]:Sa(50),[`${qe.EXO_AGGREGATE_NS}percentile75`]:Sa(75),[`${qe.EXO_AGGREGATE_NS}percentile90`]:Sa(90),[`${qe.EXO_AGGREGATE_NS}percentile95`]:Sa(95),[`${qe.EXO_AGGREGATE_NS}percentile99`]:Sa(99)}});var Rw=v(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.AggregateExecutor=Ro.AggregateExecutorError=void 0;var kt=mt(),zy=Ye(),Y5=bh(),K5=Gy(),X5=Wy(),Ow=new zy.IRI("http://www.w3.org/2001/XMLSchema#integer"),wa=new zy.IRI("http://www.w3.org/2001/XMLSchema#decimal"),xi=new zy.IRI("http://www.w3.org/2001/XMLSchema#string");function Pw(n){return typeof n=="object"&&n.type==="custom"}o(Pw,"isCustomAggregation");var ol=class extends Error{static{o(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Ro.AggregateExecutorError=ol;var Hy=class{static{o(this,"AggregateExecutor")}constructor(){this.filterExecutor=new Y5.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,a]of r.entries()){let c=new Map;for(let f of e.variables)if(a.length>0){let h=a[0].get(f);h&&c.set(f,h)}for(let f of e.aggregates){let h=this.computeAggregate(f.expression,a);c.set(f.variable,h)}let{SolutionMapping:l}=Zi(),u=new l;for(let[f,h]of c.entries())u.set(f,h);i.push(u)}if(i.length===0&&e.aggregates.length>0){let s=this.createEmptyAggregateResult(e);s&&i.push(s)}return i}groupSolutions(e,t){let r=new Map;if(t.length===0)return r.set("",e),r;for(let i of e){let s=this.computeGroupKey(i,t),a=r.get(s);a?a.push(i):r.set(s,[i])}return r}computeGroupKey(e,t){return t.map(r=>{let i=e.get(r);return i?this.termToString(i):""}).join("|")}termToString(e){if(e&&typeof e=="object"){if("value"in e)return String(e.value);if("id"in e)return String(e.id)}return String(e)}computeAggregate(e,t){if(Pw(e.aggregation))return this.computeCustomAggregate(e,t);let r=this.extractValues(e,t),i=e.aggregation;switch(i){case"count":{let s=this.computeCount(r,e.distinct);return new kt.Literal(String(s),Ow)}case"sum":{let s=this.computeSum(r);return new kt.Literal(String(s),wa)}case"avg":{let s=this.computeAvg(r);return new kt.Literal(String(s),wa)}case"min":{let s=this.computeMin(r);return s===void 0?new kt.Literal("",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}case"max":{let s=this.computeMax(r);return s===void 0?new kt.Literal("",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new kt.Literal(s||" ",xi)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new kt.Literal(" ",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}default:{let s=i;throw new ol(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,a=K5.CustomAggregateRegistry.getInstance().get(i);if(a||(a=X5.BUILT_IN_AGGREGATES[i]),!a)throw new ol(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=a.init();for(let l of t){let u=null;if(e.expression){let f=this.evaluateExpression(e.expression,l);f!==void 0&&(u=f)}else u=1;a.step(c,u)}return a.finalize(c)}extractValues(e,t){if(!e.expression)return t.map(()=>1);let r=[];for(let i of t){let s=this.evaluateExpression(e.expression,i);s!=null&&r.push(s)}return r}evaluateExpression(e,t){if(e.type==="variable"){let r=t.get(e.name);return r==null?void 0:typeof r=="number"||typeof r=="string"||typeof r=="boolean"?r:typeof r=="object"&&"value"in r?r.value:r}if(e.type==="literal")return e.value;try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}computeCount(e,t){return t?new Set(e.map(r=>String(r))).size:e.length}computeSum(e){return e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r)).reduce((r,i)=>r+i,0)}computeAvg(e){let t=e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r));return t.length===0?0:t.reduce((r,i)=>r+i,0)/t.length}computeMin(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.min(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s<i?s:i,r[0])}computeMax(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.max(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s>i?s:i,r[0])}computeGroupConcat(e,t,r){let i=e.map(s=>String(s));return r&&(i=[...new Set(i)]),i.join(t)}computeSample(e,t){if(e.length===0)return;if(t){let s=[...new Set(e.map(l=>String(l)))];if(s.length===0)return;let a=s[0],c=parseFloat(a);return isNaN(c)?a:c}let r=e[0];if(typeof r=="number")return r;let i=parseFloat(String(r));return isNaN(i)?String(r):i}createEmptyAggregateResult(e){let{SolutionMapping:t}=Zi(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(Pw(s)){r.set(i.variable,new kt.Literal("0",wa));continue}switch(s){case"count":r.set(i.variable,new kt.Literal("0",Ow));break;case"sum":case"avg":r.set(i.variable,new kt.Literal("0",wa));break;case"group_concat":r.set(i.variable,new kt.Literal(" ",xi));break;case"min":case"max":case"sample":r.set(i.variable,new kt.Literal("",xi));break;default:r.set(i.variable,new kt.Literal("",xi))}}return r}};Ro.AggregateExecutor=Hy});var Dw=v(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ServiceExecutor=Fo.ServiceExecutorError=void 0;var J5=Zi(),Fw=Ye(),Z5=mt(),eL=Lt(),Ea=class extends Error{static{o(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Fo.ServiceExecutorError=Ea;var Qy=class{static{o(this,"ServiceExecutor")}constructor(e={}){this.timeout=e.timeout??3e4,this.httpClient=e.httpClient??((t,r)=>fetch(t,r)),this.maxRetries=e.maxRetries??2,this.retryDelay=e.retryDelay??1e3}async*execute(e,t){try{let r=t(e.pattern),i=await this.executeRemoteQuery(e.endpoint,r);for(let s of i)yield s}catch(r){if(e.silent)return;throw r}}async executeRemoteQuery(e,t){let r;for(let i=0;i<=this.maxRetries;i++)try{let s=new AbortController,a=setTimeout(()=>s.abort(),this.timeout);try{let c=await this.httpClient(e,{method:"POST",headers:{"Content-Type":"application/sparql-query",Accept:"application/sparql-results+json"},body:t,signal:s.signal});if(!c.ok)throw new Ea(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(a)}}catch(s){if(r=s instanceof Error?s:new Error(String(s)),this.isRetryableError(r)&&i<this.maxRetries){await this.delay(this.retryDelay);continue}throw new Ea(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new Ea(`Failed to query remote SPARQL endpoint ${e} after ${this.maxRetries+1} attempts`,r)}parseJsonResults(e){return!e.results||!Array.isArray(e.results.bindings)?[]:e.results.bindings.map(t=>this.parseBinding(t))}parseBinding(e){let t=new J5.SolutionMapping;for(let[r,i]of Object.entries(e)){let s=this.parseRDFTerm(i);t.set(r,s)}return t}parseRDFTerm(e){switch(e.type){case"uri":return new Fw.IRI(e.value);case"literal":{let t=e.datatype?new Fw.IRI(e.datatype):void 0;return new Z5.Literal(e.value,t,e["xml:lang"])}case"bnode":return new eL.BlankNode(e.value);default:throw new Ea(`Unknown RDF term type: ${e.type}`)}}isRetryableError(e){let t=e.message.toLowerCase();return!!(e.name==="AbortError"||t.includes("network")||t.includes("econnreset")||t.includes("econnrefused")||t.includes("etimedout")||t.includes("returned 5"))}delay(e){return new Promise(t=>setTimeout(t,e))}};Fo.ServiceExecutor=Qy});var Lw=v(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.GraphExecutor=Do.GraphExecutorError=void 0;var Nw=Ye(),Ph=class extends Error{static{o(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};Do.GraphExecutorError=Ph;var Yy=class{static{o(this,"GraphExecutor")}constructor(e){this.tripleStore=e}async*execute(e,t,r){let i=e.name;if(i.type==="iri")yield*this.executeWithGraph(e.pattern,i,t);else if(i.type==="variable")yield*this.executeWithGraphVariable(e,i,t,r);else throw new Ph(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new Nw.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let a=i.get(t.value);if(a&&a instanceof Nw.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:a.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let a of s)for await(let c of r(e.pattern,a)){let l=c.clone();l.set(t.value,a),yield l}}};Do.GraphExecutor=Yy});var Mw=v(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.SPARQLGenerator=Lo.SPARQLGeneratorError=void 0;var No=class extends Error{static{o(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};Lo.SPARQLGeneratorError=No;var Ky=class{static{o(this,"SPARQLGenerator")}collectVariables(e){let t=new Set;return this.collectVariablesFromOperation(e,t),t}generateSelect(e){let t=this.collectVariables(e),r=t.size>0?Array.from(t).map(s=>`?${s}`).join(" "):"*",i=this.generateWhereClause(e);return`SELECT ${r} WHERE {
315
+ ${r})`;default:return`${r}Unknown(${e.type})`}}tripleToString(e){return`${this.elementToString(e.subject)} ${this.predicateToString(e.predicate)} ${this.elementToString(e.object)}`}predicateToString(e){return this.isPropertyPath(e)?this.propertyPathToString(e):this.elementToString(e)}isPropertyPath(e){return e.type==="path"}propertyPathToString(e){let t=e.items.map(r=>r.type==="path"?`(${this.propertyPathToString(r)})`:`<${r.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}elementToString(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":let t=`"${e.value}"`;return e.language&&(t+=`@${e.language}`),e.datatype&&(t+=`^^<${e.datatype}>`),t;case"blank":return`_:${e.value}`;default:return String(e)}}expressionToString(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value}"`:String(e.value);case"comparison":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"logical":return e.operator==="!"?`!(${this.expressionToString(e.operands[0])})`:`(${e.operands.map(t=>this.expressionToString(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"function":return`${e.function}(${e.args.map(t=>this.expressionToString(t)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.toString(e.pattern,0)} }`;default:return"unknown"}}toJSON(e){return JSON.stringify(e,null,2)}};dh.AlgebraSerializer=xy});var Zi=v(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.SolutionMapping=void 0;var uw=mt(),fw=Ye(),hw=Lt(),Ay=class n{static{o(this,"SolutionMapping")}constructor(e){this.bindings=e?new Map(e):new Map}get(e){return this.bindings.get(e)}set(e,t){this.bindings.set(e,t)}has(e){return this.bindings.has(e)}variables(){return Array.from(this.bindings.keys())}getBindings(){return new Map(this.bindings)}isCompatibleWith(e){for(let[t,r]of this.bindings.entries()){let i=e.get(t);if(i!==void 0&&!this.areEqual(r,i))return!1}return!0}merge(e){if(!this.isCompatibleWith(e))return null;let t=new n(this.bindings);for(let[r,i]of e.getBindings().entries())t.set(r,i);return t}clone(){return new n(this.bindings)}areEqual(e,t){return e instanceof uw.Literal&&t instanceof uw.Literal?e.equals(t):e instanceof fw.IRI&&t instanceof fw.IRI?e.value===t.value:e instanceof hw.BlankNode&&t instanceof hw.BlankNode?e.id===t.id:!1}toJSON(){let e={};for(let[t,r]of this.bindings.entries())e[t]=r.toString();return e}size(){return this.bindings.size}};ph.SolutionMapping=Ay});var pw=v(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PropertyPathExecutor=wo.PropertyPathExecutorError=void 0;var $5=Zi(),mh=Ye(),dw=Lt(),sl=class extends Error{static{o(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};wo.PropertyPathExecutorError=sl;var Cy=class{static{o(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let a of i){let c=await this.evaluatePath(a,t,s);for(let l of c){let u=new $5.SolutionMapping;this.isVariable(e)&&u.set(e.value,a),this.isVariable(r)&&u.set(r.value,l),yield u}}}async*executeWithBindings(e,t){if(!this.isPropertyPath(e.predicate))throw new sl("Predicate is not a property path");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.object,t);for await(let s of this.execute(r,e.predicate,i)){let a=t.merge(s);a!==null&&(yield a)}}async evaluatePath(e,t,r){switch(t.pathType){case"/":return this.evaluateSequencePath(e,t.items,r);case"|":return this.evaluateAlternativePath(e,t.items,r);case"^":return this.evaluateInversePath(e,t.items[0],r);case"+":return this.evaluateOneOrMorePath(e,t.items[0],r);case"*":return this.evaluateZeroOrMorePath(e,t.items[0],r);case"?":return this.evaluateZeroOrOnePath(e,t.items[0],r)}}async evaluateSequencePath(e,t,r){let i=new Set([e]);for(let s=0;s<t.length;s++){let a=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,a,c?r:null);for(let h of f)l.add(h)}if(i=l,i.size===0)break}return i}async evaluateAlternativePath(e,t,r){let i=new Set;for(let s of t){let a=await this.evaluatePathItem(e,s,r);for(let c of a)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new mh.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&a.add(c.subject);return a}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,a=[{node:e,depth:0}];for(;a.length>0;){let{node:c,depth:l}=a.shift();if(l>=this.MAX_DEPTH)continue;let u=await this.evaluatePathItem(c,t,null);for(let f of u){let h=this.nodeToKey(f);(r===null||this.nodeInSet(f,r))&&s.add(f),i.has(h)||(i.add(h),a.push({node:f,depth:l+1}))}}return s}async evaluateZeroOrMorePath(e,t,r){let i=await this.evaluateOneOrMorePath(e,t,r);return(r===null||this.nodeInSet(e,r))&&i.add(e),i}async evaluateZeroOrOnePath(e,t,r){let i=new Set;(r===null||this.nodeInSet(e,r))&&i.add(e);let s=await this.evaluatePathItem(e,t,r);for(let a of s)i.add(a);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new mh.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&a.add(c.object);return a}else return this.evaluatePath(e,t,r)}invertPath(e){switch(e.pathType){case"^":return e.items[0];case"/":return{type:"path",pathType:"/",items:[...e.items].reverse().map(r=>r.type==="iri"?{type:"path",pathType:"^",items:[r]}:this.invertPath(r))};case"|":return{type:"path",pathType:"|",items:e.items.map(r=>r.type==="iri"?{type:"path",pathType:"^",items:[r]}:this.invertPath(r))};case"+":case"*":case"?":let t=e.items[0].type==="iri"?{type:"path",pathType:"^",items:[e.items[0]]}:this.invertPath(e.items[0]);return{type:"path",pathType:e.pathType,items:[t]}}}async resolveElement(e){if(this.isVariable(e)){let r=new Set,i=await this.tripleStore.match(void 0,void 0,void 0);for(let s of i)r.add(s.subject),r.add(s.object);return r}let t=new Set;switch(e.type){case"iri":t.add(new mh.IRI(e.value));break;case"blank":t.add(new dw.BlankNode(e.value));break;default:throw new sl(`Unsupported element type in subject/object position: ${e.type}`)}return t}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r){if(r instanceof mh.IRI)return{type:"iri",value:r.value};if(r instanceof dw.BlankNode)return{type:"blank",value:r.id}}}return e}isVariable(e){return e.type==="variable"}isPropertyPath(e){return e.type==="path"}nodeToKey(e){return e.toString()}nodeInSet(e,t){let r=this.nodeToKey(e);for(let i of t)if(this.nodeToKey(i)===r)return!0;return!1}};wo.PropertyPathExecutor=Cy});var Py=v(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.BGPExecutor=Eo.BGPExecutorError=void 0;var gh=Zi(),ws=Ye(),Iy=mt(),yh=Lt(),vh=Lc(),V5=pw(),yr=class extends Error{static{o(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};Eo.BGPExecutorError=yr;var Oy=class{static{o(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new V5.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new gh.SolutionMapping;return}let t=this.matchTriplePattern(e.triples[0]);for(let r=1;r<e.triples.length;r++)t=this.joinWithPattern(t,e.triples[r]);for await(let r of t)yield r}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}async*executeInGraph(e,t){if(e.triples.length===0){yield new gh.SolutionMapping;return}let r=this.matchTriplePatternInGraph(e.triples[0],t);for(let i=1;i<e.triples.length;i++)r=this.joinWithPatternInGraph(r,e.triples[i],t);for await(let i of r)yield i}async*matchTriplePatternInGraph(e,t){if(this.isPropertyPath(e.predicate))throw new yr("Property paths within named graphs are not yet supported");let r=e.predicate,i=this.isVariable(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),s=this.isVariable(r)?void 0:this.toRDFTermAsPredicate(r),a=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new yr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,a,t);for(let l of c){let u=new gh.SolutionMapping;this.isVariable(e.subject)&&u.set(e.subject.value,l.subject),this.isVariable(r)&&u.set(r.value,l.predicate),this.isVariable(e.object)&&u.set(e.object.value,l.object),yield u}}async*joinWithPatternInGraph(e,t,r){let i=[];for await(let s of e)i.push(s);for(let s of i){let a=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(a,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){yield*this.propertyPathExecutor.execute(e.subject,e.predicate,e.object);return}let t=e.predicate,r=this.isVariable(e.subject)||this.isQuotedTriple(e.subject)&&this.hasVariablesInQuotedTriple(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),i=this.isVariable(t)?void 0:this.toRDFTermAsPredicate(t),s=this.isVariable(e.object)||this.isQuotedTriple(e.object)&&this.hasVariablesInQuotedTriple(e.object)?void 0:this.toRDFTerm(e.object),a=await this.tripleStore.match(r,i,s);for(let c of a){let l=new gh.SolutionMapping;if(this.isVariable(e.subject))l.set(e.subject.value,c.subject);else if(this.isQuotedTriple(e.subject)){let u=this.matchQuotedTriplePattern(e.subject,c.subject);if(u===null)continue;for(let[f,h]of u.entries())l.set(f,h)}if(this.isVariable(t)&&l.set(t.value,c.predicate),this.isVariable(e.object))l.set(e.object.value,c.object);else if(this.isQuotedTriple(e.object)){let u=this.matchQuotedTriplePattern(e.object,c.object);if(u===null)continue;for(let[f,h]of u.entries())l.set(f,h)}yield l}}hasVariablesInQuotedTriple(e){return!!(this.isVariable(e.subject)||e.predicate.type==="variable"||this.isVariable(e.object)||this.isQuotedTriple(e.subject)&&this.hasVariablesInQuotedTriple(e.subject)||this.isQuotedTriple(e.object)&&this.hasVariablesInQuotedTriple(e.object))}matchQuotedTriplePattern(e,t){if(!(t instanceof vh.QuotedTriple))return null;let r=new Map;if(this.isVariable(e.subject))r.set(e.subject.value,t.subject);else if(this.isQuotedTriple(e.subject)){let i=this.matchQuotedTriplePattern(e.subject,t.subject);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.subject,t.subject))return null;if(e.predicate.type==="variable")r.set(e.predicate.value,t.predicate);else if(e.predicate.value!==t.predicate.value)return null;if(this.isVariable(e.object))r.set(e.object.value,t.object);else if(this.isQuotedTriple(e.object)){let i=this.matchQuotedTriplePattern(e.object,t.object);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof ws.IRI&&e.value===t.value;case"literal":return!(!(t instanceof Iy.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof yh.BlankNode&&e.value===t.id;case"quoted":return t instanceof vh.QuotedTriple?this.toRDFQuotedTriple(e).equals(t):!1;default:return!1}}isPropertyPath(e){return e.type==="path"}async*joinWithPattern(e,t){let r=[];for await(let i of e)r.push(i);for(let i of r){let s=this.instantiatePattern(t,i);for await(let a of this.matchTriplePattern(s)){let c=i.merge(a);c!==null&&(yield c)}}}instantiatePattern(e,t){let r=this.isPropertyPath(e.predicate)?e.predicate:this.instantiateElement(e.predicate,t);return{subject:this.instantiateElement(e.subject,t),predicate:r,object:this.instantiateElement(e.object,t)}}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r)return this.toAlgebraElement(r)}return this.isQuotedTriple(e)?this.instantiateQuotedTriple(e,t):e}instantiateQuotedTriple(e,t){let r=this.instantiateElement(e.subject,t),i=e.predicate.type==="variable"?this.instantiatePredicateVariable(e.predicate,t):e.predicate,s=this.instantiateElement(e.object,t);return{type:"quoted",subject:r,predicate:i,object:s}}instantiatePredicateVariable(e,t){let r=t.get(e.value);return r&&r instanceof ws.IRI?{type:"iri",value:r.value}:e}isVariable(e){return e.type==="variable"}isQuotedTriple(e){return e.type==="quoted"}toRDFTermAsSubject(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"blank":return new yh.BlankNode(e.value);case"literal":throw new yr("Literals cannot appear in subject position");case"variable":throw new yr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new yr(`Unknown element type: ${e.type}`)}}toRDFQuotedTriple(e){let t=this.toRDFTermAsSubject(e.subject),r=e.predicate.type==="iri"?new ws.IRI(e.predicate.value):(()=>{throw new yr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new vh.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"literal":throw new yr("Literals cannot appear in predicate position");case"blank":throw new yr("Blank nodes cannot appear in predicate position");case"variable":throw new yr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new yr(`Unknown element type: ${e.type}`)}}toRDFTerm(e){switch(e.type){case"iri":return new ws.IRI(e.value);case"literal":return new Iy.Literal(e.value,e.datatype?new ws.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new yh.BlankNode(e.value);case"variable":throw new yr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new yr(`Unknown element type: ${e.type}`)}}toAlgebraElement(e){if(e instanceof ws.IRI)return{type:"iri",value:e.value};if(e instanceof Iy.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof yh.BlankNode)return{type:"blank",value:e.id};if(e instanceof vh.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new yr(`Unknown RDF term type: ${e.constructor?.name||"unknown"}`)}toAlgebraQuotedTriple(e){return{type:"quoted",subject:this.toAlgebraElement(e.subject),predicate:{type:"iri",value:e.predicate.value},object:this.toAlgebraElement(e.object)}}};Eo.BGPExecutor=Oy});var Sh=v(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.BuiltInFunctions=void 0;var Se=Ye(),R=mt(),Dr=Lt(),To=Lc(),Ry=Ir(),al=class{static{o(this,"BuiltInFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof Se.IRI||e instanceof R.Literal?e.value:e instanceof Dr.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof R.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof R.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=this.parseDirectionalLangTag(e),[s,a]=this.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":a&&i!==a?!1:c===l?!0:c.startsWith(l+"-")}static parseDirectionalLangTag(e){let t=e.indexOf("--");if(t===-1)return[e,void 0];let r=e.substring(0,t),i=e.substring(t+2).toLowerCase();return[r,i]}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof R.Literal)return e.datatype?e.datatype:e.language?new Se.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Se.IRI("http://www.w3.org/2001/XMLSchema#string");throw new Error("DATATYPE: argument must be a literal")}static bound(e){return e!==void 0}static isIRI(e){return e===void 0?!1:e instanceof Se.IRI}static isBlank(e){return e===void 0?!1:e instanceof Dr.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof R.Literal}static isTriple(e){return e===void 0?!1:e instanceof To.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof R.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof R.Literal))return!1;let t=e.datatype?.value;return t?["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float","http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedShort","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#positiveInteger"].includes(t):!1}static regex(e,t,r){try{let i=r?r.includes("u")?r:r+"u":"u";return new RegExp(t,i).test(e)}catch(i){throw new Error(`REGEX: invalid pattern '${t}': ${i.message}`)}}static compare(e,t,r){if(this.isDayTimeDurationValue(e)&&this.isDayTimeDurationValue(t))return this.compareDurations(e instanceof R.Literal?e:String(e),t instanceof R.Literal?t:String(t),r);let i=this.toComparableValue(e),s=this.toComparableValue(t);switch(r){case"=":return i===s;case"!=":return i!==s;case"<":return i<s;case">":return i>s;case"<=":return i<=s;case">=":return i>=s;default:throw new Error(`Unknown comparison operator: ${r}`)}}static isDayTimeDurationValue(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static toComparableValue(e){if(typeof e=="string"||typeof e=="number")return e;if(e instanceof R.Literal){let t=e.datatype?.value;if(t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double")){let r=parseFloat(e.value);if(!isNaN(r))return r}if(t==="http://www.w3.org/2001/XMLSchema#dayTimeDuration")try{return this.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof Se.IRI?e.value:e instanceof Dr.BlankNode?e.id:String(e)}static contains(e,t){return e.includes(t)}static strStarts(e,t){return e.startsWith(t)}static strEnds(e,t){return e.endsWith(t)}static strlen(e){return e.length}static ucase(e){return e.toUpperCase()}static lcase(e){return e.toLowerCase()}static substr(e,t,r){let i=t-1;if(i<0){if(r!==void 0){let s=r+i;return s<=0?"":e.substring(0,s)}return e}return r!==void 0?e.substring(i,i+r):e.substring(i)}static strBefore(e,t){if(t==="")return"";let r=e.indexOf(t);return r===-1?"":e.substring(0,r)}static strAfter(e,t){if(t==="")return e;let r=e.indexOf(t);return r===-1?"":e.substring(r+t.length)}static concat(...e){return e.join("")}static replace(e,t,r,i){try{let s=i||"g",a=s.includes("u")?s:s+"u",c=new RegExp(t,a);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static parseDate(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`PARSEDATE: invalid date string '${e}'`);return t.getTime()}static dateBefore(e,t){let r=this.parseDate(e),i=this.parseDate(t);return r<i}static dateAfter(e,t){let r=this.parseDate(e),i=this.parseDate(t);return r>i}static dateInRange(e,t,r){let i=this.parseDate(e),s=this.parseDate(t),a=this.parseDate(r);return i>=s&&i<=a}static dateDiffMinutes(e,t){let r=this.parseDate(e),i=this.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=this.parseDate(e),i=this.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60*60)*100)/100}static logicalAnd(e){return e.every(t=>t===!0)}static logicalOr(e){return e.some(t=>t===!0)}static logicalNot(e){return!e}static year(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`YEAR: invalid date string '${e}'`);return t.getFullYear()}static month(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`MONTH: invalid date string '${e}'`);return t.getMonth()+1}static day(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`DAY: invalid date string '${e}'`);return t.getDate()}static hours(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`HOURS: invalid date string '${e}'`);return t.getHours()}static minutes(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`MINUTES: invalid date string '${e}'`);return t.getMinutes()}static seconds(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`SECONDS: invalid date string '${e}'`);return t.getSeconds()+t.getMilliseconds()/1e3}static timezone(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`TIMEZONE: invalid date string '${e}'`);let r;if(e.endsWith("Z"))r="PT0S";else{let i=e.match(/([+-]\d{2}):?(\d{2})$/);if(i){let s=parseInt(i[1],10),a=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);a===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${a}M`}else{let s=-t.getTimezoneOffset(),a=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${a}H`:r=`${l}PT${a}H${c}M`}}return new R.Literal(r,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static tz(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`TZ: invalid date string '${e}'`);if(e.endsWith("Z"))return"Z";let r=e.match(/([+-]\d{2}:\d{2})$/);if(r)return r[1];let i=e.match(/([+-])(\d{2})(\d{2})$/);return i?`${i[1]}${i[2]}:${i[3]}`:""}static now(){return new Date().toISOString()}static msToMinutes(e){return Math.round(e/(1e3*60))}static msToHours(e){return Math.round(e/(1e3*60*60)*100)/100}static msToSeconds(e){return Math.round(e/1e3)}static abs(e){return Math.abs(e)}static round(e){return Math.round(e)}static ceil(e){return Math.ceil(e)}static floor(e){return Math.floor(e)}static rand(){return Math.random()}static coalesce(e){for(let t of e)if(t!=null)return t}static if(e,t,r){return e?t:r}static xsdDateTime(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`xsd:dateTime: invalid date string '${e}'`);return new R.Literal(t.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static xsdInteger(e){let t=parseInt(e,10);if(isNaN(t))throw new Error(`xsd:integer: cannot convert '${e}' to integer`);return new R.Literal(String(t),new Se.IRI("http://www.w3.org/2001/XMLSchema#integer"))}static xsdDecimal(e){let t=parseFloat(e);if(isNaN(t))throw new Error(`xsd:decimal: cannot convert '${e}' to decimal`);return new R.Literal(String(t),new Se.IRI("http://www.w3.org/2001/XMLSchema#decimal"))}static encodeForUri(e){return encodeURIComponent(e)}static md5(e){return require("crypto").createHash("md5").update(e).digest("hex")}static sha1(e){return require("crypto").createHash("sha1").update(e).digest("hex")}static sha256(e){return require("crypto").createHash("sha256").update(e).digest("hex")}static sha384(e){return require("crypto").createHash("sha384").update(e).digest("hex")}static sha512(e){return require("crypto").createHash("sha512").update(e).digest("hex")}static sameTerm(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0||e.constructor!==t.constructor)return!1;if(e instanceof Se.IRI&&t instanceof Se.IRI)return e.value===t.value;if(e instanceof Dr.BlankNode&&t instanceof Dr.BlankNode)return e.id===t.id;if(e instanceof R.Literal&&t instanceof R.Literal){if(e.value!==t.value||e.language!==t.language)return!1;let r=e.datatype?.value,i=t.datatype?.value;return r===i}return!1}static iri(e){if(e===void 0)throw new Error("IRI: argument is undefined");if(e instanceof Se.IRI)return e;if(e instanceof R.Literal)return new Se.IRI(e.value);throw e instanceof Dr.BlankNode?new Error("IRI: cannot convert blank node to IRI"):new Error("IRI: unsupported term type")}static uri(e){return this.iri(e)}static bnode(e){if(e===void 0){let t=`b${(0,Ry.v4)().replace(/-/g,"").substring(0,12)}`;return new Dr.BlankNode(t)}if(e instanceof R.Literal)return new Dr.BlankNode(e.value);if(e instanceof Dr.BlankNode)return e;throw new Error("BNODE: argument must be a string literal or omitted")}static strdt(e,t){if(e===void 0)throw new Error("STRDT: lexical form is undefined");if(t===void 0)throw new Error("STRDT: datatype IRI is undefined");let r;if(e instanceof R.Literal){if(e.language)throw new Error("STRDT: lexical form must not have a language tag");r=e.value}else if(typeof e=="string")r=e;else throw new Error("STRDT: lexical form must be a string literal");let i;if(t instanceof Se.IRI)i=t;else if(t instanceof R.Literal)i=new Se.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new R.Literal(r,i)}static strlang(e,t){if(e===void 0)throw new Error("STRLANG: lexical form is undefined");if(t===void 0)throw new Error("STRLANG: language tag is undefined");let r;if(e instanceof R.Literal){if(e.language)throw new Error("STRLANG: lexical form must not already have a language tag");r=e.value}else if(typeof e=="string")r=e;else throw new Error("STRLANG: lexical form must be a string literal");let i;if(t instanceof R.Literal)i=t.value;else if(typeof t=="string")i=t;else throw new Error("STRLANG: language tag must be a string literal");if(i==="")throw new Error("STRLANG: language tag cannot be empty");return new R.Literal(r,void 0,i)}static strlangdir(e,t,r){if(e===void 0)throw new Error("STRLANGDIR: lexical form is undefined");if(t===void 0)throw new Error("STRLANGDIR: language tag is undefined");if(r===void 0)throw new Error("STRLANGDIR: direction is undefined");let i;if(e instanceof R.Literal){if(e.language)throw new Error("STRLANGDIR: lexical form must not already have a language tag");i=e.value}else if(typeof e=="string")i=e;else throw new Error("STRLANGDIR: lexical form must be a string literal");let s;if(t instanceof R.Literal)s=t.value;else if(typeof t=="string")s=t;else throw new Error("STRLANGDIR: language tag must be a string literal");if(s==="")throw new Error("STRLANGDIR: language tag cannot be empty");let a;if(r instanceof R.Literal)a=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(a!=="ltr"&&a!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${a}'. Must be 'ltr' or 'rtl'`);return new R.Literal(i,void 0,s,a)}static uuid(){let e=(0,Ry.v4)();return new Se.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,Ry.v4)();return new R.Literal(e)}static parseDayTimeDuration(e){if(!e)throw new Error("parseDayTimeDuration: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDayTimeDuration: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=r.indexOf("T"),a="",c="";if(s===-1?a=r:(a=r.substring(0,s),c=r.substring(s+1)),a){let l=a.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(a!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${a}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let d=parseFloat(u[1]);i+=d*60*60*1e3,l=l.substring(u[0].length)}let f=l.match(/^(\d+(?:\.\d+)?)M/);if(f){let d=parseFloat(f[1]);i+=d*60*1e3,l=l.substring(f[0].length)}let h=l.match(/^(\d+(?:\.\d+)?)S$/);if(h){let d=parseFloat(h[1]);i+=d*1e3,l=l.substring(h[0].length)}if(l!=="")throw new Error(`parseDayTimeDuration: invalid time component: '${l}' in '${e}'`)}return t?-i:i}static formatDayTimeDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/(1440*60*1e3));r=r%(1440*60*1e3);let s=Math.floor(r/(3600*1e3));r=r%(3600*1e3);let a=Math.floor(r/(60*1e3));r=r%(60*1e3);let c=r/1e3,l=t?"-P":"P";return i>0&&(l+=`${i}D`),(s>0||a>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),a>0&&(l+=`${a}M`),(c>0||s===0&&a===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return this.parseDayTimeDuration(e),new R.Literal(e,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static compareDurations(e,t,r){let i=e instanceof R.Literal?e.value:e,s=t instanceof R.Literal?t.value:t,a=this.parseDayTimeDuration(i),c=this.parseDayTimeDuration(s);switch(r){case"=":return a===c;case"!=":return a!==c;case"<":return a<c;case">":return a>c;case"<=":return a<=c;case">=":return a>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static isDayTimeDuration(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static dateDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r),a=this.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(a===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-a.getTime(),l=Math.round(c/(1440*60*1e3)),u=this.formatDateDuration(l);return new R.Literal(u,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDDate(e){let t=/^(-?\d{4})-(\d{2})-(\d{2})(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r){let u=new Date(e);return isNaN(u.getTime())?null:new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()))}let i=parseInt(r[1],10),s=parseInt(r[2],10)-1,a=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,a));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,h=parseInt(u[2],10),d=parseInt(u[3],10),p=f*(h*60+d)*60*1e3;l=new Date(l.getTime()-p)}}return l}static formatDateDuration(e){if(e===0)return"P0D";let t=e<0,r=Math.abs(e);return t?`-P${r}D`:`P${r}D`}static dateTimeDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r),a=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(a.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-a.getTime(),l=this.formatDayTimeDuration(c);return new R.Literal(l,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c);return new R.Literal(l.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c);return new R.Literal(l.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),h=String(l.getUTCDate()).padStart(2,"0"),d=`${u}-${f}-${h}`;return new R.Literal(d,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let a=this.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),h=String(l.getUTCDate()).padStart(2,"0"),d=`${u}-${f}-${h}`;return new R.Literal(d,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static parseYearMonthDuration(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDuration: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+a;return i?-c:c}static isYearMonthDuration(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static dateTimeAddYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0),new R.Literal(s.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0),new R.Literal(s.toISOString(),new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),h=`${l}-${u}-${f}`;return new R.Literal(h,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let a=this.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),h=`${l}-${u}-${f}`;return new R.Literal(h,new Se.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseDayTimeDuration(r),a=this.parseDayTimeDuration(i),c=this.formatDayTimeDuration(s+a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseDayTimeDuration(r),a=this.parseDayTimeDuration(i),c=this.formatDayTimeDuration(s-a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof R.Literal?e.value:e,i=this.parseDayTimeDuration(r),s=this.formatDayTimeDuration(i*t);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationDivide(e,t){if(t===0)throw new Error("durationDivide: division by zero");let r=e instanceof R.Literal?e.value:e,i=this.parseDayTimeDuration(r),s=this.formatDayTimeDuration(i/t);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,a=t?"-P":"P";return i>0&&(a+=`${i}Y`),(s>0||i===0)&&(a+=`${s}M`),a}static yearMonthDurationAdd(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseYearMonthDuration(r),a=this.parseYearMonthDuration(i),c=this.formatYearMonthDuration(s+a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseYearMonthDuration(r),a=this.parseYearMonthDuration(i),c=this.formatYearMonthDuration(s-a);return new R.Literal(c,new Se.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static parseYearMonthDurationComponents(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDurationComponents: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:a,negative:i}}static durationYears(e){let t=e instanceof R.Literal?e.value:e,r=this.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof R.Literal?e.value:e,r=this.parseYearMonthDurationComponents(t);return r.negative?-r.months:r.months}static durationToDays(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof R.Literal?e.value:e;return this.parseDayTimeDuration(t)/1e3}static parseDurationComponents(e){if(!e)throw new Error("parseDurationComponents: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDurationComponents: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=0,a=0,c=0,l=r.indexOf("T"),u="",f="";if(l===-1?u=r:(u=r.substring(0,l),f=r.substring(l+1)),u){let h=u.match(/^(\d+(?:\.\d+)?)D$/);if(h)i=parseFloat(h[1]);else if(u!=="")throw new Error(`parseDurationComponents: invalid day component: '${u}' in '${e}'`)}if(f){let h=f,d=h.match(/^(\d+(?:\.\d+)?)H/);d&&(s=parseFloat(d[1]),h=h.substring(d[0].length));let p=h.match(/^(\d+(?:\.\d+)?)M/);p&&(a=parseFloat(p[1]),h=h.substring(p[0].length));let _=h.match(/^(\d+(?:\.\d+)?)S$/);if(_&&(c=parseFloat(_[1]),h=h.substring(_[0].length)),h!=="")throw new Error(`parseDurationComponents: invalid time component: '${h}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:a,seconds:c}}static durationDays(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof R.Literal?e.value:e,r=this.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static adjust(e,t){let r=e instanceof R.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let H=i.getUTCFullYear(),re=String(i.getUTCMonth()+1).padStart(2,"0"),Ie=String(i.getUTCDate()).padStart(2,"0"),N=String(i.getUTCHours()).padStart(2,"0"),K=String(i.getUTCMinutes()).padStart(2,"0"),ge=String(i.getUTCSeconds()).padStart(2,"0"),dt=i.getUTCMilliseconds(),nt=`${H}-${re}-${Ie}T${N}:${K}:${ge}`;return dt>0&&(nt+=`.${String(dt).padStart(3,"0")}`),new R.Literal(nt,new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof R.Literal?t.value:t,a=this.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(a)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+a),f=u.getUTCFullYear(),h=String(u.getUTCMonth()+1).padStart(2,"0"),d=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),_=String(u.getUTCMinutes()).padStart(2,"0"),S=String(u.getUTCSeconds()).padStart(2,"0"),E=u.getUTCMilliseconds(),A=a>=0?"+":"-",C=Math.floor(Math.abs(a)/(3600*1e3)),k=Math.floor(Math.abs(a)%(3600*1e3)/(60*1e3)),G=`${A}${String(C).padStart(2,"0")}:${String(k).padStart(2,"0")}`,Q=`${f}-${h}-${d}T${p}:${_}:${S}`;return E>0&&(Q+=`.${String(E).padStart(3,"0")}`),Q+=G,new R.Literal(Q,new Se.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static normalize(e,t){if(e===void 0)throw new Error("NORMALIZE: string argument is undefined");let r;if(e instanceof R.Literal)r=e.value;else if(e instanceof Se.IRI)r=e.value;else if(e instanceof Dr.BlankNode)r=e.id;else if(typeof e=="string")r=e;else throw new Error("NORMALIZE: first argument must be a string or literal");let i="NFC";if(t!==void 0)if(t instanceof R.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof Se.IRI)i=t.value.toUpperCase();else throw new Error("NORMALIZE: second argument must be a string literal");if(!this.VALID_NORMALIZATION_FORMS.includes(i))throw new Error(`NORMALIZE: invalid normalization form '${i}'. Valid forms are: NFC, NFD, NFKC, NFKD`);let s=r.normalize(i);return new R.Literal(s,new Se.IRI("http://www.w3.org/2001/XMLSchema#string"))}static fold(e){if(e===void 0)throw new Error("FOLD: string argument is undefined");let t;if(e instanceof R.Literal)t=e.value;else if(e instanceof Se.IRI)t=e.value;else if(e instanceof Dr.BlankNode)t=e.id;else if(typeof e=="string")t=e;else throw new Error("FOLD: argument must be a string or literal");let r=this.unicodeCaseFold(t);return new R.Literal(r,new Se.IRI("http://www.w3.org/2001/XMLSchema#string"))}static unicodeCaseFold(e){let t="";for(let r of e){let i=this.CASE_FOLDING_MAP.get(r);i!==void 0?t+=i:t+=r.toLowerCase()}return t}static isTime(e){return e instanceof R.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static timeDiff(e,t){let r=e instanceof R.Literal?e.value:e,i=t instanceof R.Literal?t.value:t,s=this.parseXSDTime(r),a=this.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(a===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-a,l=this.formatDayTimeDuration(c);return new R.Literal(l,new Se.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDTime(e){let t=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r)return null;let i=parseInt(r[1],10),s=parseInt(r[2],10),a=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||a<0||a>59||i===24&&(s!==0||a!==0))return null;let u=0;if(c){let h=c.padEnd(3,"0").slice(0,3);u=parseInt(h,10)}let f=i*60*60*1e3+s*60*1e3+a*1e3+u;if(i===24&&(f=1440*60*1e3),l&&l!=="Z"){let h=l.match(/([+-])(\d{2}):(\d{2})/);if(h){let d=h[1]==="+"?1:-1,p=parseInt(h[2],10),_=parseInt(h[3],10),S=d*(p*60+_)*60*1e3;f-=S}}return f}static triple(e,t,r){if(e===void 0)throw new Error("TRIPLE: subject is undefined");if(t===void 0)throw new Error("TRIPLE: predicate is undefined");if(r===void 0)throw new Error("TRIPLE: object is undefined");if(e instanceof R.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Se.IRI)){let c=t instanceof R.Literal?"Literal":t instanceof Dr.BlankNode?"BlankNode":t instanceof To.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,a=r;return new To.QuotedTriple(i,s,a)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`SUBJECT: argument must be QuotedTriple, got ${t}`)}return e.subject}static predicate(e){if(e===void 0)throw new Error("PREDICATE: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`PREDICATE: argument must be QuotedTriple, got ${t}`)}return e.predicate}static object(e){if(e===void 0)throw new Error("OBJECT: argument is undefined");if(!(e instanceof To.QuotedTriple)){let t=e instanceof Se.IRI?"IRI":e instanceof R.Literal?"Literal":e instanceof Dr.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};_h.BuiltInFunctions=al;al.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];al.CASE_FOLDING_MAP=new Map([["\xDF","ss"],["\u1E9E","ss"],["\u03A3","\u03C3"],["\u03C2","\u03C3"],["\u0130","i\u0307"],["I","i"],["\u0587","\u0565\u0582"],["\uFB00","ff"],["\uFB01","fi"],["\uFB02","fl"],["\uFB03","ffi"],["\uFB04","ffl"],["\uFB05","st"],["\uFB06","st"],["\u0390","\u03B9\u0308\u0301"],["\u03B0","\u03C5\u0308\u0301"],["\u017F","s"],["\u1E9B","\u1E61"],["\u212A","k"],["\u212B","\xE5"]])});var Ew=v(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.functionHandlers=void 0;var j=Sh();L.functionHandlers=new Map;L.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.str(t)});L.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.lang(t)});L.functionHandlers.set("langmatches",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.langMatches(t,r)});L.functionHandlers.set("contains",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.contains(t,r)});L.functionHandlers.set("strstarts",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strStarts(t,r)});L.functionHandlers.set("strends",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strEnds(t,r)});L.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.strlen(t)});L.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.ucase(t)});L.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.lcase(t)});L.functionHandlers.set("substr",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=Number(e.evaluateExpression(n[1],e.solution));if(n[2]){let i=Number(e.evaluateExpression(n[2],e.solution));return j.BuiltInFunctions.substr(t,r,i)}return j.BuiltInFunctions.substr(t,r)});L.functionHandlers.set("strbefore",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strBefore(t,r)});L.functionHandlers.set("strafter",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.strAfter(t,r)});L.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return j.BuiltInFunctions.concat(...t)});L.functionHandlers.set("replace",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=e.getStringValue(e.evaluateExpression(n[2],e.solution)),s=n[3]?e.getStringValue(e.evaluateExpression(n[3],e.solution)):void 0;return j.BuiltInFunctions.replace(t,r,i,s)});L.functionHandlers.set("regex",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=n[2]?e.getStringValue(e.evaluateExpression(n[2],e.solution)):void 0;return j.BuiltInFunctions.regex(t,r,i)});L.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.encodeForUri(t)});L.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.datatype(t).value});L.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return j.BuiltInFunctions.bound(r)}return!0});var mw=o((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isIRI(t)},"isIriHandler");L.functionHandlers.set("isiri",mw);L.functionHandlers.set("isuri",mw);L.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isBlank(t)});L.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isLiteral(t)});L.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isNumeric(t)});L.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.hasLangdir(t)});L.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.isTriple(t)});L.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return j.BuiltInFunctions.sameTerm(t,r)});L.functionHandlers.set("abs",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.abs(t)});L.functionHandlers.set("round",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.round(t)});L.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.ceil(t)});L.functionHandlers.set("floor",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.floor(t)});L.functionHandlers.set("rand",()=>j.BuiltInFunctions.rand());L.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.parseDate(t)});L.functionHandlers.set("datebefore",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateBefore(t,r)});L.functionHandlers.set("dateafter",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateAfter(t,r)});L.functionHandlers.set("dateinrange",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=e.getStringValue(e.evaluateExpression(n[2],e.solution));return j.BuiltInFunctions.dateInRange(t,r,i)});L.functionHandlers.set("datediffminutes",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateDiffMinutes(t,r)});L.functionHandlers.set("datediffhours",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution));return j.BuiltInFunctions.dateDiffHours(t,r)});var xo=o((n,e,t)=>(r,i)=>{let s=i.evaluateExpression(r[0],i.solution);return e&&i.isYearMonthDurationValue(s)?e(s):t&&i.isDayTimeDurationValue(s)?t(s):n(i.getStringValue(s))},"createDateTimeAccessor"),gw=xo(j.BuiltInFunctions.year,j.BuiltInFunctions.durationYears,null);L.functionHandlers.set("year",gw);L.functionHandlers.set("years",gw);var yw=xo(j.BuiltInFunctions.month,j.BuiltInFunctions.durationMonths,null);L.functionHandlers.set("month",yw);L.functionHandlers.set("months",yw);var vw=xo(j.BuiltInFunctions.day,null,j.BuiltInFunctions.durationDays);L.functionHandlers.set("day",vw);L.functionHandlers.set("days",vw);L.functionHandlers.set("hours",xo(j.BuiltInFunctions.hours,null,j.BuiltInFunctions.durationHours));L.functionHandlers.set("minutes",xo(j.BuiltInFunctions.minutes,null,j.BuiltInFunctions.durationMinutes));L.functionHandlers.set("seconds",xo(j.BuiltInFunctions.seconds,null,j.BuiltInFunctions.durationSeconds));L.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.timezone(t)});L.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.tz(t)});L.functionHandlers.set("adjust",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=n.length>1?e.evaluateExpression(n[1],e.solution):void 0;return j.BuiltInFunctions.adjust(t,r)});L.functionHandlers.set("now",()=>j.BuiltInFunctions.now());var _w=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");L.functionHandlers.set("datetime",_w);L.functionHandlers.set("xsd:datetime",_w);var Sw=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");L.functionHandlers.set("integer",Sw);L.functionHandlers.set("xsd:integer",Sw);var bw=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");L.functionHandlers.set("decimal",bw);L.functionHandlers.set("xsd:decimal",bw);var ww=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");L.functionHandlers.set("daytimeduration",ww);L.functionHandlers.set("xsd:daytimeduration",ww);L.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToDays(t)});L.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToHours(t)});L.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToMinutes(t)});L.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationToSeconds(t)});L.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationDays(t)});L.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationHours(t)});L.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationMinutes(t)});L.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationSeconds(t)});L.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationYears(t)});L.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return j.BuiltInFunctions.durationMonths(t)});L.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeDiff(t,r)});L.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeAdd(t,r)});L.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return j.BuiltInFunctions.dateTimeSubtract(t,r)});L.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToMinutes(t)});L.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToHours(t)});L.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.msToSeconds(t)});L.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.md5(t)});L.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha1(t)});L.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha256(t)});L.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha384(t)});L.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return j.BuiltInFunctions.sha512(t)});L.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.subject(t)});L.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.predicate(t)});L.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return j.BuiltInFunctions.object(t)});L.functionHandlers.set("triple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution),i=e.getTermFromExpression(n[2],e.solution);return j.BuiltInFunctions.triple(t,r,i)})});var bh=v(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.FilterExecutor=Ao.FilterExecutorError=void 0;var ft=Sh(),U5=Ew(),va=mt(),sr=class extends Error{static{o(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};Ao.FilterExecutorError=sr;var Fy=class{static{o(this,"FilterExecutor")}constructor(){this.existsEvaluator=null,this.tripleStore=null,this.uuidCache=new Map}setExistsEvaluator(e){this.existsEvaluator=e}setTripleStore(e){this.tripleStore=e,this.uuidCache.clear()}async*execute(e,t){let r=this.expressionContainsExists(e.expression);for await(let i of t)try{let s;r?s=await this.evaluateExpressionAsync(e.expression,i):s=this.evaluateExpression(e.expression,i),s===!0&&(yield i)}catch{continue}}expressionContainsExists(e){if(e.type==="exists")return!0;if(e.type==="logical")return e.operands.some(t=>this.expressionContainsExists(t));if(e.type==="comparison")return this.expressionContainsExists(e.left)||this.expressionContainsExists(e.right);if(e.type==="in"){let t=e;return this.expressionContainsExists(t.expression)||t.list.some(r=>this.expressionContainsExists(r))}return!1}async executeAll(e,t){let r=[];async function*i(){for(let s of t)yield s}o(i,"generator");for await(let s of this.execute(e,i()))r.push(s);return r}evaluateExpression(e,t){let r=e;if(r.termType)switch(r.termType){case"Variable":return t.get(r.value);case"Literal":return r.value;case"NamedNode":return r.value;default:throw new sr(`Unsupported termType: ${r.termType}`)}switch(e.type){case"comparison":return this.evaluateComparison(e,t);case"logical":return this.evaluateLogical(e,t);case"arithmetic":return this.evaluateArithmetic(e,t);case"function":case"functionCall":return this.evaluateFunction(e,t);case"variable":return t.get(e.name);case"literal":return e.value;case"in":return this.evaluateIn(e,t);case"exists":throw new sr("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new sr(`Unsupported expression type: ${e.type}, expr.termType=${r.termType}`)}}async evaluateExpressionAsync(e,t){return e.type==="exists"?this.evaluateExists(e,t):e.type==="logical"?this.evaluateLogicalAsync(e,t):this.evaluateExpression(e,t)}async evaluateExists(e,t){if(!this.existsEvaluator)throw new sr("EXISTS evaluator not set. Call setExistsEvaluator before evaluating EXISTS expressions.");let r=await this.existsEvaluator(e.pattern,t);return e.negated?!r:r}async evaluateLogicalAsync(e,t){if(e.operator==="!"){let i=await this.evaluateExpressionAsync(e.operands[0],t);return ft.BuiltInFunctions.logicalNot(i)}let r=[];for(let i of e.operands){let s=await this.evaluateExpressionAsync(i,t);r.push(s)}if(e.operator==="&&")return ft.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return ft.BuiltInFunctions.logicalOr(r);throw new sr(`Unknown logical operator: ${e.operator}`)}evaluateComparison(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);return ft.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return ft.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return ft.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return ft.BuiltInFunctions.logicalOr(r);throw new sr(`Unknown logical operator: ${e.operator}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let a=this.evaluateExpression(s,t);return ft.BuiltInFunctions.compare(r,a,"=")});return e.negated?!i:i}evaluateArithmetic(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);if(e.operator==="-"&&this.isDateValue(r)&&this.isDateValue(i))return ft.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return ft.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return ft.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return ft.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return ft.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return ft.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new sr("Division by zero");return ft.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return ft.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),a=this.toNumericValue(i);switch(e.operator){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":if(a===0)throw new sr("Division by zero");return s/a;default:throw new sr(`Unknown arithmetic operator: ${e.operator}`)}}isDayTimeDurationValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof va.Literal){let t=e.datatype?.value||"";if(t.includes("#integer")||t.includes("#decimal")||t.includes("#double")||t.includes("#float")){let i=parseFloat(e.value);if(!isNaN(i))return i}let r=parseFloat(e.value);if(!isNaN(r))return r}if(typeof e=="string"){let t=parseFloat(e);if(!isNaN(t))return t}if(e&&typeof e=="object"&&"value"in e){let t=parseFloat(String(e.value));if(!isNaN(t))return t}throw new sr(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof va.Literal){let t=e.datatype?.value||"";return t.includes("#dateTime")||t.includes("#date")?!0:/^\d{4}-\d{2}-\d{2}(T|\s)/.test(e.value)}return typeof e=="string"?/^\d{4}-\d{2}-\d{2}(T|\s)/.test(e):!1}isDateValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof va.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}evaluateFunction(e,t){let r=e,i=this.extractFunctionName(r.function),s=this.evaluateSpecialFunction(i,r.args,t);if(s!==void 0)return s.value;let a=U5.functionHandlers.get(i);if(!a)throw new sr(`Unknown function: ${i}`);let c={evaluateExpression:o((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:o((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:o(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:o(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:o(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return a(r.args,c)}extractFunctionName(e){if(typeof e=="string")return e.toLowerCase();if(e&&typeof e=="object"&&"value"in e){let t=e.value;return((t.includes("#")?t.split("#").pop():t.split("/").pop())||t).toLowerCase()}throw new sr(`Unknown function format: ${e}`)}evaluateSpecialFunction(e,t,r){switch(e){case"coalesce":for(let c of t)try{let l=this.evaluateExpression(c,r);if(l!=null)return{value:l}}catch{continue}return{value:void 0};case"if":if(!t||t.length!==3)throw new sr("IF requires exactly 3 arguments");let i=this.evaluateExpression(t[0],r);return{value:this.toBoolean(i)?this.evaluateExpression(t[1],r):this.evaluateExpression(t[2],r)};case"byuuid":return{value:this.evaluateByUUID({args:t},r)};default:return}}getTermFromExpression(e,t){let r=e;if(r.type==="variable"&&r.name)return t.get(r.name)}getStringValue(e){return e==null?"":typeof e=="object"&&"value"in e?String(e.value):String(e)}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number")return!isNaN(e)&&e!==0;if(typeof e=="string")return e.length>0;if(e instanceof va.Literal){let t=e.datatype?.value||"";if(t.includes("#boolean"))return e.value==="true"||e.value==="1";if(t.includes("#integer")||t.includes("#decimal")||t.includes("#double")||t.includes("#float")){let r=parseFloat(e.value);return!isNaN(r)&&r!==0}return e.value.length>0}return!!e}evaluateByUUID(e,t){if(!e.args||e.args.length!==1)throw new sr("exo:byUUID requires exactly 1 argument (UUID string)");let r=this.evaluateExpression(e.args[0],t),i=this.getStringValue(r);if(!i)return;let s=i.toLowerCase();if(this.uuidCache.has(s))return this.uuidCache.get(s)??void 0;if(!this.tripleStore){this.uuidCache.set(s,null);return}if(this.tripleStore.findSubjectsByUUIDSync){let a=this.tripleStore.findSubjectsByUUIDSync(s);if(a.length===0){this.uuidCache.set(s,null);return}let c=a[0];return this.uuidCache.set(s,c),c}this.uuidCache.set(s,null)}cacheUUIDResult(e,t){let r=e.toLowerCase();this.uuidCache.set(r,t)}getCachedUUID(e){let t=e.toLowerCase();if(this.uuidCache.has(t))return this.uuidCache.get(t)}};Ao.FilterExecutor=Fy});var Ny=v(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.OptionalExecutor=void 0;var Dy=class{static{o(this,"OptionalExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i){let l=s.merge(c);l!==null&&(yield l,a=!0)}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}};wh.OptionalExecutor=Dy});var My=v(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.UnionExecutor=void 0;var Ly=class{static{o(this,"UnionExecutor")}async*execute(e,t){let r=new Set;for await(let i of e){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}for await(let i of t){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Eh.UnionExecutor=Ly});var Vy=v(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.ConstructExecutor=void 0;var B5=Wi(),_a=Ye(),ky=mt(),jy=Lt(),q5=Lc(),$y=class{static{o(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let a of e)try{let c=this.instantiateTriple(a,s),l=`${c.subject.toString()}|${c.predicate.toString()}|${c.object.toString()}`;i.has(l)||(i.add(l),r.push(c))}catch{continue}return r}instantiateTriple(e,t){if(this.isPropertyPath(e.predicate))throw new Error("Property paths are not supported in CONSTRUCT templates");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.predicate,t),s=this.instantiateElement(e.object,t);return new B5.Triple(r,i,s)}isPropertyPath(e){return e.type==="path"}instantiateElement(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable: ${e.value}`);return r}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="literal")return new ky.Literal(e.value,e.datatype?new _a.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);throw new Error(`Unknown element type: ${e.type}`)}instantiateQuotedTriple(e,t){let r=this.instantiateQuotedSubject(e.subject,t),i=this.instantiateQuotedPredicate(e.predicate,t),s=this.instantiateQuotedObject(e.object,t);return new q5.QuotedTriple(r,i,s)}instantiateQuotedSubject(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable in quoted triple subject: ${e.value}`);if(r instanceof ky.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);throw new Error(`Invalid element type for quoted triple subject: ${e.type}`)}instantiateQuotedPredicate(e,t){if(e.type==="variable"){let r=t.get(e.value);if(!r)throw new Error(`Unbound variable in quoted triple predicate: ${e.value}`);if(!(r instanceof _a.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new _a.IRI(e.value)}instantiateQuotedObject(e,t){if(e.type==="variable"){let i=t.get(e.value);if(!i)throw new Error(`Unbound variable in quoted triple object: ${e.value}`);return i}if(e.type==="iri")return new _a.IRI(e.value);if(e.type==="blank")return new jy.BlankNode(e.value);if(e.type==="literal")return new ky.Literal(e.value,e.datatype?new _a.IRI(e.datatype):void 0,e.language);if(e.type==="quoted")return this.instantiateQuotedTriple(e,t);let r=e;throw new Error(`Invalid element type for quoted triple object: ${r.type}`)}};Th.ConstructExecutor=$y});var xw=v(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.DescribeExecutor=void 0;var Tw=Ye(),Uy=class{static{o(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,a=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,a,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,a,c){let l=e.toString();if(c.has(l)||(c.add(l),t!==void 0&&r>t))return;let u=[],f=await this.tripleStore.match(e,void 0,void 0);if(u.push(...f),i){let d=await this.tripleStore.match(void 0,void 0,e);u.push(...d)}let h=[];for(let d of u){let p=`${d.subject.toString()}|${d.predicate.toString()}|${d.object.toString()}`;a.has(p)||(a.add(p),s.push(d),(t===void 0||r<t)&&(this.isIRI(d.subject)&&d.subject.toString()!==l&&h.push(d.subject),this.isIRI(d.object)&&d.object.toString()!==l&&h.push(d.object)))}for(let d of h)await this.describeResourceWithDepth(d,t,r+1,i,s,a,c)}isIRI(e){return e?e instanceof Tw.IRI||e.termType==="NamedNode"||typeof e.value=="string"&&e.value.startsWith("http"):!1}async describeByIRI(e,t){let r=new Tw.IRI(e);return this.execute([r],t)}};xh.DescribeExecutor=Uy});var Aw=v(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.MinusExecutor=void 0;var By=class{static{o(this,"MinusExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i)if(this.areCompatible(s,c)){a=!0;break}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(a=>i.has(a));if(s.length===0)return!1;for(let a of s){let c=e.get(a),l=t.get(a);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Ah.MinusExecutor=By});var Iw=v(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ValuesExecutor=Co.ValuesExecutorError=void 0;var G5=Zi(),Cw=Ye(),W5=mt(),Ch=class extends Error{static{o(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Co.ValuesExecutorError=Ch;var qy=class{static{o(this,"ValuesExecutor")}async*execute(e){if(e.bindings.length!==0)for(let t of e.bindings)yield this.createSolutionMapping(t)}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}createSolutionMapping(e){let t=new G5.SolutionMapping;for(let[r,i]of Object.entries(e)){let s=this.toRDFTerm(i);t.set(r,s)}return t}toRDFTerm(e){if(e.type==="iri")return new Cw.IRI(e.value);if(e.type==="literal")return new W5.Literal(e.value,e.datatype?new Cw.IRI(e.datatype):void 0,e.language,e.direction);throw new Ch(`Unknown term type: ${e.type}`)}};Co.ValuesExecutor=qy});var Gy=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.CustomAggregateRegistry=Oo.CustomAggregateError=void 0;var Io=class extends Error{static{o(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Oo.CustomAggregateError=Io;var Ih=class n{static{o(this,"CustomAggregateRegistry")}constructor(){this.aggregates=new Map}static getInstance(){return n.instance||(n.instance=new n),n.instance}static resetInstance(){n.instance&&n.instance.clear(),n.instance=null}register(e,t){if(!e||typeof e!="string")throw new Io("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Io("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Io(`Aggregate with IRI "${e}" is already registered`,e);this.aggregates.set(e,t)}unregister(e){return this.aggregates.delete(e)}get(e){return this.aggregates.get(e)}has(e){return this.aggregates.has(e)}getRegisteredIris(){return Array.from(this.aggregates.keys())}clear(){this.aggregates.clear()}get size(){return this.aggregates.size}};Oo.CustomAggregateRegistry=Ih;Ih.instance=null});var Wy=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.BUILT_IN_AGGREGATES=qe.modeAggregate=qe.stddevAggregate=qe.varianceAggregate=qe.medianAggregate=qe.EXO_AGGREGATE_NS=void 0;qe.getNumericValue=Oh;qe.createDecimalLiteral=ri;qe.createDoubleLiteral=Q5;qe.createPercentileAggregate=Sa;var ba=mt(),Po=Ye(),H5=new Po.IRI("http://www.w3.org/2001/XMLSchema#decimal"),z5=new Po.IRI("http://www.w3.org/2001/XMLSchema#double");qe.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Oh(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof ba.Literal?parseFloat(n.value):n instanceof Po.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}o(Oh,"getNumericValue");function ri(n){return new ba.Literal(String(n),H5)}o(ri,"createDecimalLiteral");function Q5(n){return new ba.Literal(String(n),z5)}o(Q5,"createDoubleLiteral");qe.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Oh(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ri(0);let r=[...t].sort((a,c)=>a-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return ri(s)}};qe.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Oh(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ri(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return ri(i)}};qe.stddevAggregate={init(){return{values:[]}},step(n,e){qe.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return ri(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return ri(Math.sqrt(i))}};qe.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof ba.Literal||e instanceof Po.IRI?e.value:e),i=t.counts.get(r)||0;t.counts.set(r,i+1),t.values.set(r,e)},finalize(n){let e=n;if(e.counts.size===0)return new ba.Literal(" ",new Po.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[a,c]of e.counts)c>r&&(r=c,t=a);let i=e.values.get(t);if(i instanceof ba.Literal)return i;let s=parseFloat(t);return isNaN(s)?new ba.Literal(t,new Po.IRI("http://www.w3.org/2001/XMLSchema#string")):ri(s)}};function Sa(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Oh(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return ri(0);let s=[...i].sort((h,d)=>h-d),a=r.percentile*(s.length-1),c=Math.floor(a),l=Math.ceil(a);if(c===l)return ri(s[c]);let u=a-c,f=s[c]*(1-u)+s[l]*u;return ri(f)}}}o(Sa,"createPercentileAggregate");qe.BUILT_IN_AGGREGATES={[`${qe.EXO_AGGREGATE_NS}median`]:qe.medianAggregate,[`${qe.EXO_AGGREGATE_NS}variance`]:qe.varianceAggregate,[`${qe.EXO_AGGREGATE_NS}stddev`]:qe.stddevAggregate,[`${qe.EXO_AGGREGATE_NS}mode`]:qe.modeAggregate,[`${qe.EXO_AGGREGATE_NS}percentile25`]:Sa(25),[`${qe.EXO_AGGREGATE_NS}percentile50`]:Sa(50),[`${qe.EXO_AGGREGATE_NS}percentile75`]:Sa(75),[`${qe.EXO_AGGREGATE_NS}percentile90`]:Sa(90),[`${qe.EXO_AGGREGATE_NS}percentile95`]:Sa(95),[`${qe.EXO_AGGREGATE_NS}percentile99`]:Sa(99)}});var Rw=v(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.AggregateExecutor=Ro.AggregateExecutorError=void 0;var kt=mt(),zy=Ye(),Y5=bh(),K5=Gy(),X5=Wy(),Ow=new zy.IRI("http://www.w3.org/2001/XMLSchema#integer"),wa=new zy.IRI("http://www.w3.org/2001/XMLSchema#decimal"),xi=new zy.IRI("http://www.w3.org/2001/XMLSchema#string");function Pw(n){return typeof n=="object"&&n.type==="custom"}o(Pw,"isCustomAggregation");var ol=class extends Error{static{o(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Ro.AggregateExecutorError=ol;var Hy=class{static{o(this,"AggregateExecutor")}constructor(){this.filterExecutor=new Y5.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,a]of r.entries()){let c=new Map;for(let f of e.variables)if(a.length>0){let h=a[0].get(f);h&&c.set(f,h)}for(let f of e.aggregates){let h=this.computeAggregate(f.expression,a);c.set(f.variable,h)}let{SolutionMapping:l}=Zi(),u=new l;for(let[f,h]of c.entries())u.set(f,h);i.push(u)}if(i.length===0&&e.aggregates.length>0){let s=this.createEmptyAggregateResult(e);s&&i.push(s)}return i}groupSolutions(e,t){let r=new Map;if(t.length===0)return r.set("",e),r;for(let i of e){let s=this.computeGroupKey(i,t),a=r.get(s);a?a.push(i):r.set(s,[i])}return r}computeGroupKey(e,t){return t.map(r=>{let i=e.get(r);return i?this.termToString(i):""}).join("|")}termToString(e){if(e&&typeof e=="object"){if("value"in e)return String(e.value);if("id"in e)return String(e.id)}return String(e)}computeAggregate(e,t){if(Pw(e.aggregation))return this.computeCustomAggregate(e,t);let r=this.extractValues(e,t),i=e.aggregation;switch(i){case"count":{let s=this.computeCount(r,e.distinct);return new kt.Literal(String(s),Ow)}case"sum":{let s=this.computeSum(r);return new kt.Literal(String(s),wa)}case"avg":{let s=this.computeAvg(r);return new kt.Literal(String(s),wa)}case"min":{let s=this.computeMin(r);return s===void 0?new kt.Literal("",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}case"max":{let s=this.computeMax(r);return s===void 0?new kt.Literal("",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new kt.Literal(s||" ",xi)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new kt.Literal(" ",xi):typeof s=="number"?new kt.Literal(String(s),wa):new kt.Literal(String(s),xi)}default:{let s=i;throw new ol(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,a=K5.CustomAggregateRegistry.getInstance().get(i);if(a||(a=X5.BUILT_IN_AGGREGATES[i]),!a)throw new ol(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=a.init();for(let l of t){let u=null;if(e.expression){let f=this.evaluateExpression(e.expression,l);f!==void 0&&(u=f)}else u=1;a.step(c,u)}return a.finalize(c)}extractValues(e,t){if(!e.expression)return t.map(()=>1);let r=[];for(let i of t){let s=this.evaluateExpression(e.expression,i);s!=null&&r.push(s)}return r}evaluateExpression(e,t){if(e.type==="variable"){let r=t.get(e.name);return r==null?void 0:typeof r=="number"||typeof r=="string"||typeof r=="boolean"?r:typeof r=="object"&&"value"in r?r.value:r}if(e.type==="literal")return e.value;try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}computeCount(e,t){return t?new Set(e.map(r=>String(r))).size:e.length}computeSum(e){return e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r)).reduce((r,i)=>r+i,0)}computeAvg(e){let t=e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r));return t.length===0?0:t.reduce((r,i)=>r+i,0)/t.length}computeMin(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.min(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s<i?s:i,r[0])}computeMax(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.max(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s>i?s:i,r[0])}computeGroupConcat(e,t,r){let i=e.map(s=>String(s));return r&&(i=[...new Set(i)]),i.join(t)}computeSample(e,t){if(e.length===0)return;if(t){let s=[...new Set(e.map(l=>String(l)))];if(s.length===0)return;let a=s[0],c=parseFloat(a);return isNaN(c)?a:c}let r=e[0];if(typeof r=="number")return r;let i=parseFloat(String(r));return isNaN(i)?String(r):i}createEmptyAggregateResult(e){let{SolutionMapping:t}=Zi(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(Pw(s)){r.set(i.variable,new kt.Literal("0",wa));continue}switch(s){case"count":r.set(i.variable,new kt.Literal("0",Ow));break;case"sum":case"avg":r.set(i.variable,new kt.Literal("0",wa));break;case"group_concat":r.set(i.variable,new kt.Literal(" ",xi));break;case"min":case"max":case"sample":r.set(i.variable,new kt.Literal("",xi));break;default:r.set(i.variable,new kt.Literal("",xi))}}return r}};Ro.AggregateExecutor=Hy});var Dw=v(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ServiceExecutor=Fo.ServiceExecutorError=void 0;var J5=Zi(),Fw=Ye(),Z5=mt(),eL=Lt(),Ea=class extends Error{static{o(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Fo.ServiceExecutorError=Ea;var Qy=class{static{o(this,"ServiceExecutor")}constructor(e={}){this.timeout=e.timeout??3e4,this.httpClient=e.httpClient??((t,r)=>fetch(t,r)),this.maxRetries=e.maxRetries??2,this.retryDelay=e.retryDelay??1e3}async*execute(e,t){try{let r=t(e.pattern),i=await this.executeRemoteQuery(e.endpoint,r);for(let s of i)yield s}catch(r){if(e.silent)return;throw r}}async executeRemoteQuery(e,t){let r;for(let i=0;i<=this.maxRetries;i++)try{let s=new AbortController,a=setTimeout(()=>s.abort(),this.timeout);try{let c=await this.httpClient(e,{method:"POST",headers:{"Content-Type":"application/sparql-query",Accept:"application/sparql-results+json"},body:t,signal:s.signal});if(!c.ok)throw new Ea(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(a)}}catch(s){if(r=s instanceof Error?s:new Error(String(s)),this.isRetryableError(r)&&i<this.maxRetries){await this.delay(this.retryDelay);continue}throw new Ea(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new Ea(`Failed to query remote SPARQL endpoint ${e} after ${this.maxRetries+1} attempts`,r)}parseJsonResults(e){return!e.results||!Array.isArray(e.results.bindings)?[]:e.results.bindings.map(t=>this.parseBinding(t))}parseBinding(e){let t=new J5.SolutionMapping;for(let[r,i]of Object.entries(e)){let s=this.parseRDFTerm(i);t.set(r,s)}return t}parseRDFTerm(e){switch(e.type){case"uri":return new Fw.IRI(e.value);case"literal":{let t=e.datatype?new Fw.IRI(e.datatype):void 0;return new Z5.Literal(e.value,t,e["xml:lang"])}case"bnode":return new eL.BlankNode(e.value);default:throw new Ea(`Unknown RDF term type: ${e.type}`)}}isRetryableError(e){let t=e.message.toLowerCase();return!!(e.name==="AbortError"||t.includes("network")||t.includes("econnreset")||t.includes("econnrefused")||t.includes("etimedout")||t.includes("returned 5"))}delay(e){return new Promise(t=>setTimeout(t,e))}};Fo.ServiceExecutor=Qy});var Lw=v(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.GraphExecutor=Do.GraphExecutorError=void 0;var Nw=Ye(),Ph=class extends Error{static{o(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};Do.GraphExecutorError=Ph;var Yy=class{static{o(this,"GraphExecutor")}constructor(e){this.tripleStore=e}async*execute(e,t,r){let i=e.name;if(i.type==="iri")yield*this.executeWithGraph(e.pattern,i,t);else if(i.type==="variable")yield*this.executeWithGraphVariable(e,i,t,r);else throw new Ph(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new Nw.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let a=i.get(t.value);if(a&&a instanceof Nw.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:a.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let a of s)for await(let c of r(e.pattern,a)){let l=c.clone();l.set(t.value,a),yield l}}};Do.GraphExecutor=Yy});var Mw=v(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.SPARQLGenerator=Lo.SPARQLGeneratorError=void 0;var No=class extends Error{static{o(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};Lo.SPARQLGeneratorError=No;var Ky=class{static{o(this,"SPARQLGenerator")}collectVariables(e){let t=new Set;return this.collectVariablesFromOperation(e,t),t}generateSelect(e){let t=this.collectVariables(e),r=t.size>0?Array.from(t).map(s=>`?${s}`).join(" "):"*",i=this.generateWhereClause(e);return`SELECT ${r} WHERE {
316
316
  ${i}
317
317
  }`}generateWhereClause(e,t=2){let r=" ".repeat(t);switch(e.type){case"bgp":return this.generateBGP(e,t);case"filter":return`${this.generateWhereClause(e.input,t)}
318
318
  ${r}FILTER(${this.generateExpression(e.expression)})`;case"join":return`${this.generateWhereClause(e.left,t)}
@@ -334,7 +334,7 @@ ${r}}`}default:throw new No(`Unsupported operation type for SPARQL generation: $
334
334
  `)}generateTriple(e){let t=this.generateElement(e.subject),r=this.generatePredicate(e.predicate),i=this.generateElement(e.object);return`${t} ${r} ${i}`}generatePredicate(e){return"pathType"in e?this.generatePropertyPath(e):this.generateElement(e)}generatePropertyPath(e){let t=e.items.map(r=>"pathType"in r?`(${this.generatePropertyPath(r)})`:`<${r.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}generateElement(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":{let r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}case"blank":return`_:${e.value}`;default:throw new No(`Unknown element type: ${e.type}`)}}generateValues(e,t){let r=" ".repeat(t);if(e.variables.length===0||e.bindings.length===0)return"";if(e.variables.length===1){let a=e.variables[0],c=e.bindings.map(l=>{let u=l[a];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ");return`${r}VALUES ?${a} { ${c} }`}let i=e.variables.map(a=>`?${a}`).join(" "),s=e.bindings.map(a=>`(${e.variables.map(l=>{let u=a[l];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ")})`);return`${r}VALUES (${i}) {
335
335
  ${s.map(a=>`${r} ${a}`).join(`
336
336
  `)}
337
- ${r}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}generateExpression(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:typeof e.value=="boolean"?e.value?"true":"false":String(e.value);case"comparison":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"logical":return e.operator==="!"?`!(${this.generateExpression(e.operands[0])})`:`(${e.operands.map(t=>this.generateExpression(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"function":return`${e.function.toUpperCase()}(${e.args.map(t=>this.generateExpression(t)).join(", ")})`;case"functionCall":return`${(typeof e.function=="string"?e.function:e.function.value).toUpperCase()}(${e.args.map(r=>this.generateExpression(r)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),r=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${r})`:`${t} IN (${r})`}default:throw new No(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let r of e.triples)this.collectVariablesFromTriple(r,t);break;case"filter":this.collectVariablesFromOperation(e.input,t),this.collectVariablesFromExpression(e.expression,t);break;case"join":case"leftjoin":case"union":case"minus":this.collectVariablesFromOperation(e.left,t),this.collectVariablesFromOperation(e.right,t);break;case"values":for(let r of e.variables)t.add(r);break;case"project":for(let r of e.variables)t.add(r);this.collectVariablesFromOperation(e.input,t);break;case"extend":t.add(e.variable),this.collectVariablesFromOperation(e.input,t);break;case"orderby":case"slice":case"distinct":case"reduced":this.collectVariablesFromOperation(e.input,t);break;case"group":for(let r of e.variables)t.add(r);for(let r of e.aggregates)t.add(r.variable);this.collectVariablesFromOperation(e.input,t);break;case"subquery":this.collectVariablesFromOperation(e.query,t);break}}collectVariablesFromTriple(e,t){e.subject.type==="variable"&&t.add(e.subject.value),"type"in e.predicate&&e.predicate.type==="variable"&&t.add(e.predicate.value),e.object.type==="variable"&&t.add(e.object.value)}collectVariablesFromExpression(e,t){switch(e.type){case"variable":t.add(e.name);break;case"comparison":case"arithmetic":this.collectVariablesFromExpression(e.left,t),this.collectVariablesFromExpression(e.right,t);break;case"logical":for(let r of e.operands)this.collectVariablesFromExpression(r,t);break;case"function":case"functionCall":for(let r of e.args)this.collectVariablesFromExpression(r,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let r of e.list)this.collectVariablesFromExpression(r,t);break}}};Lo.SPARQLGenerator=Ky});var kw=v(wn=>{"use strict";var tL=wn&&wn.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),rL=wn&&wn.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),nL=wn&&wn.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&tL(t,e,r[i]);return rL(t,e),t}})();Object.defineProperty(wn,"__esModule",{value:!0});wn.QueryExecutor=wn.QueryExecutorError=void 0;var iL=Py(),sL=bh(),aL=Ny(),oL=My(),cL=Aw(),lL=Iw(),uL=Rw(),fL=Vy(),hL=Dw(),dL=Lw(),pL=Mw(),mL=Ye(),Mo=class extends Error{static{o(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};wn.QueryExecutorError=Mo;var Xy=class{static{o(this,"QueryExecutor")}constructor(e,t={}){this.tripleStore=e,this.bgpExecutor=new iL.BGPExecutor(e),this.filterExecutor=new sL.FilterExecutor,this.optionalExecutor=new aL.OptionalExecutor,this.unionExecutor=new oL.UnionExecutor,this.minusExecutor=new cL.MinusExecutor,this.valuesExecutor=new lL.ValuesExecutor,this.aggregateExecutor=new uL.AggregateExecutor,this.constructExecutor=new fL.ConstructExecutor,this.serviceExecutor=new hL.ServiceExecutor(t.serviceConfig),this.graphExecutor=new dL.GraphExecutor(e),this.sparqlGenerator=new pL.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(r,i)=>this.evaluateExistsPattern(r,i)),this.filterExecutor.setTripleStore(e)}async evaluateExistsPattern(e,t){for await(let r of this.execute(e))if(t.merge(r)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}async*execute(e){switch(e.type){case"bgp":yield*this.executeBGP(e);break;case"filter":yield*this.executeFilter(e);break;case"join":yield*this.executeJoin(e);break;case"leftjoin":yield*this.executeLeftJoin(e);break;case"union":yield*this.executeUnion(e);break;case"minus":yield*this.executeMinus(e);break;case"values":yield*this.executeValues(e);break;case"project":yield*this.executeProject(e);break;case"orderby":yield*this.executeOrderBy(e);break;case"slice":yield*this.executeSlice(e);break;case"distinct":yield*this.executeDistinct(e);break;case"reduced":yield*this.executeReduced(e);break;case"group":yield*this.executeGroup(e);break;case"extend":yield*this.executeExtend(e);break;case"subquery":yield*this.executeSubquery(e);break;case"lateraljoin":yield*this.executeLateralJoin(e);break;case"service":yield*this.executeService(e);break;case"graph":yield*this.executeGraph(e);break;default:throw new Mo(`Unknown operation type: ${e.type}`)}}async*executeBGP(e){yield*this.bgpExecutor.execute(e)}async*executeFilter(e){let t=this.execute(e.input);yield*this.filterExecutor.execute(e,t)}async*executeJoin(e){let t=[];for await(let a of this.execute(e.left))t.push(a);if(t.length===0)return;let r=new Set;for(let a of t)for(let c of a.variables())r.add(c);let i=this.collectOperationVariables(e.right);if([...r].some(a=>i.has(a)))for(let a of t){let c=this.substituteVariables(e.right,a);for await(let l of this.execute(c)){let u=a.merge(l);u!==null&&(yield u)}}else{let a=[];for await(let c of this.execute(e.right))a.push(c);for(let c of t)for(let l of a){let u=c.merge(l);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.optionalExecutor.execute(i(),s())}async*executeUnion(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.unionExecutor.execute(i(),s())}async*executeMinus(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.minusExecutor.execute(i(),s())}async*executeValues(e){yield*this.valuesExecutor.execute(e)}async*executeProject(e){for await(let t of this.execute(e.input))yield t}async*executeOrderBy(e){let t=[];for await(let r of this.execute(e.input))t.push(r);t.sort((r,i)=>{for(let s of e.comparators){let a=this.getExpressionValue(s.expression,r),c=this.getExpressionValue(s.expression,i),l=0;if(a===void 0&&c===void 0?l=0:a===void 0?l=1:c===void 0?l=-1:typeof a=="number"&&typeof c=="number"?l=a-c:l=String(a).localeCompare(String(c)),s.descending&&(l=-l),l!==0)return l}return 0});for(let r of t)yield r}async*executeSlice(e){let t=0,r=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=r){if(i!==void 0&&t-r>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeReduced(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let r=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of r)e.having.every(a=>this.filterExecutor.evaluateExpression(a,i)===!0)&&(yield i);else for(let i of r)yield i}async*executeExtend(e){for await(let t of this.execute(e.input)){let r=t.clone(),i=this.evaluateExtendExpression(e.expression,t);i!==void 0&&r.set(e.variable,i),yield r}}async*executeSubquery(e){yield*this.execute(e.query)}async*executeLateralJoin(e){let t=[];for await(let r of this.execute(e.left))t.push(r);for(let r of t){let i=this.substituteVariables(e.right,r);for await(let s of this.execute(i)){let a=r.merge(s);a!==null&&(yield a)}}}substituteVariables(e,t){let r=JSON.parse(JSON.stringify(e));return this.substituteInOperation(r,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let r=e;return r.type==="bgp"&&r.triples?(r.triples=r.triples.map(i=>this.substituteInTriple(i,t)),r):(r.input&&(r.input=this.substituteInOperation(r.input,t)),r.left&&(r.left=this.substituteInOperation(r.left,t)),r.right&&(r.right=this.substituteInOperation(r.right,t)),r.pattern&&(r.pattern=this.substituteInOperation(r.pattern,t)),r.query&&(r.query=this.substituteInOperation(r.query,t)),r.where&&(r.where=this.substituteInOperation(r.where,t)),r.expression&&this.substituteInExpression(r.expression,t),r)}substituteInExpression(e,t){if(!(!e||typeof e!="object")){if(e.type==="exists"&&e.pattern&&(e.pattern=this.substituteInOperation(e.pattern,t)),e.left&&this.substituteInExpression(e.left,t),e.right&&this.substituteInExpression(e.right,t),e.operands)for(let r of e.operands)this.substituteInExpression(r,t);if(e.args)for(let r of e.args)this.substituteInExpression(r,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let r of e.list)this.substituteInExpression(r,t)}}substituteInTriple(e,t){return{subject:this.substituteInTripleElement(e.subject,t),predicate:e.predicate,object:this.substituteInTripleElement(e.object,t)}}substituteInTripleElement(e,t){if(e&&e.type==="variable"){let r=t.get(e.value);if(r!=null){if(r instanceof mL.IRI||r.termType==="NamedNode")return{type:"iri",value:r.value};if(r.termType==="Literal"||typeof r.value=="string"){let i=r;return{type:"literal",value:i.value,datatype:i.datatype?.value??i._datatype?.value,language:i.language??i._language}}}}return e}async*executeService(e){yield*this.serviceExecutor.execute(e,t=>this.sparqlGenerator.generateSelect(t))}async*executeGraph(e){let t=async function*(r,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{r.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(r,i):yield*this.execute(r)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:r}=await Promise.resolve().then(()=>nL(Zi()));yield new r;return}yield*this.bgpExecutor.executeInGraph(e,t)}evaluateExtendExpression(e,t){if(e.type!=="aggregate")try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}getExpressionValue(e,t){if(e.type==="variable"){let r=t.get(e.name);return r?r.value??r.id??String(r):void 0}return e.value}collectOperationVariables(e){let t=new Set;return this.collectVarsFromOperation(e,t),t}collectVarsFromOperation(e,t){if(!(!e||typeof e!="object")){if(e.type==="bgp"&&e.triples)for(let r of e.triples)this.collectVarsFromElement(r.subject,t),r.predicate?.type!=="path"&&this.collectVarsFromElement(r.predicate,t),this.collectVarsFromElement(r.object,t);if(e.type==="values"&&e.variables)for(let r of e.variables)t.add(r);e.expression&&this.collectVarsFromExpressionTree(e.expression,t),e.type==="extend"&&e.variable&&t.add(e.variable),e.input&&this.collectVarsFromOperation(e.input,t),e.left&&this.collectVarsFromOperation(e.left,t),e.right&&this.collectVarsFromOperation(e.right,t),e.pattern&&this.collectVarsFromOperation(e.pattern,t),e.query&&this.collectVarsFromOperation(e.query,t),e.where&&this.collectVarsFromOperation(e.where,t)}}collectVarsFromElement(e,t){e&&(e.type==="variable"&&t.add(e.value),e.type==="quoted"&&(this.collectVarsFromElement(e.subject,t),this.collectVarsFromElement(e.predicate,t),this.collectVarsFromElement(e.object,t)))}collectVarsFromExpressionTree(e,t){if(!(!e||typeof e!="object")){if(e.type==="variable"&&e.name&&t.add(e.name),e.type==="exists"&&e.pattern&&this.collectVarsFromOperation(e.pattern,t),e.left&&this.collectVarsFromExpressionTree(e.left,t),e.right&&this.collectVarsFromExpressionTree(e.right,t),e.operands)for(let r of e.operands)this.collectVarsFromExpressionTree(r,t);if(e.args)for(let r of e.args)this.collectVarsFromExpressionTree(r,t);if(e.expression&&this.collectVarsFromExpressionTree(e.expression,t),e.list)for(let r of e.list)this.collectVarsFromExpressionTree(r,t)}}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}isConstructQuery(e){return e.type==="construct"}async executeConstruct(e){if(e.type!=="construct")throw new Mo("executeConstruct requires a CONSTRUCT operation");let t=await this.executeAll(e.where);return this.constructExecutor.execute(e.template,t)}isAskQuery(e){return e.type==="ask"}async executeAsk(e){if(e.type!=="ask")throw new Mo("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};wn.QueryExecutor=Xy});var $w=v(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.UpdateExecutor=jo.UpdateExecutorError=void 0;var gL=Wi(),ko=Ye(),Jy=mt(),jw=Lt(),yr=class extends Error{static{o(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};jo.UpdateExecutorError=yr;var Zy=class{static{o(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new yr("Expected UPDATE request");let t=[];for(let r of e.updates){let i=await this.executeOperation(r);t.push(i)}return t}async executeOperation(e){if("updateType"in e)switch(e.updateType){case"insert":return this.executeInsertData(e);case"delete":return this.executeDeleteData(e);case"insertdelete":throw new yr("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new yr("DELETE WHERE not yet implemented");default:throw new yr(`Unknown update type: ${e.updateType}`)}if("type"in e)switch(e.type){case"clear":case"drop":case"load":case"create":case"copy":case"move":case"add":throw new yr(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new yr(`Unknown operation type: ${e.type}`)}throw new yr("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new yr("Expected INSERT DATA operation");let t=e,r=0;for(let i of t.insert)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.insertTriples(i.triples,s)}else if(i.type==="graph"){let s=i,a=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,a)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new yr("Expected DELETE DATA operation");let t=e,r=0;for(let i of t.delete)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.deleteTriples(i.triples,s)}else if(i.type==="graph"){let s=i,a=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,a)}return{type:"delete",deleted:r,success:!0}}async insertTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i);t&&this.tripleStore.addToGraph?await this.tripleStore.addToGraph(s,t):await this.tripleStore.add(s),r++}return r}async deleteTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i),a;t&&this.tripleStore.removeFromGraph?a=await this.tripleStore.removeFromGraph(s,t):a=await this.tripleStore.remove(s),a&&r++}return r}convertTriple(e){return new gL.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new ko.IRI(e.value);if(e.termType==="BlankNode")return new jw.BlankNode(e.value);throw new yr(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new ko.IRI(e.value);throw new yr("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new ko.IRI(e.value);if(e.termType==="BlankNode")return new jw.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new Jy.Literal(t.value,void 0,t.language):t.datatype?new Jy.Literal(t.value,new ko.IRI(t.datatype.value)):new Jy.Literal(t.value)}throw new yr(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new ko.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new yr("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new ko.IRI(e.value)}};jo.UpdateExecutor=Zy});var Uw=v(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.AggregateFunctions=void 0;var e1=mt(),Vw=Ye(),t1=class{static{o(this,"AggregateFunctions")}static count(e,t){if(!t)return e.length;let r=0;for(let i of e)i.has(t)&&r++;return r}static countDistinct(e,t){let r=new Set;for(let i of e){let s=i.get(t);s&&r.add(s.toString())}return r.size}static sum(e,t){let r=0;for(let i of e){let s=i.get(t);if(s instanceof e1.Literal){let a=this.toNumber(s);isNaN(a)||(r+=a)}}return r}static avg(e,t){let r=this.sum(e,t),i=this.count(e,t);return i>0?r/i:0}static min(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let a=this.toComparable(s);(r===null||a<r)&&(r=a)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let a=this.toComparable(s);(r===null||a>r)&&(r=a)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let a=s.get(t);a&&(a instanceof e1.Literal||a instanceof Vw.IRI?i.push(a.value):i.push(a.toString()))}return i.join(r)}static sample(e,t){for(let r of e){let i=r.get(t);if(i)return this.toComparable(i)}return null}static sampleDistinct(e,t){return this.sample(e,t)}static toNumber(e){let t=e.datatype?.value;return t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double"),parseFloat(e.value)}static toComparable(e){if(e instanceof e1.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof Vw.IRI?e.value:String(e)}};Rh.AggregateFunctions=t1});var Bw=v(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.QueryPlanCache=void 0;var yL=zf(),r1=class{static{o(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new yL.LRUCache(e)}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r!==void 0?this.hits++:this.misses++,r}set(e,t){let r=this.normalizeQuery(e);this.cache.set(r,t)}has(e){let t=this.normalizeQuery(e);return this.cache.get(t)!==void 0}clear(){this.cache.clear()}getStats(){let e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0,size:this.cache.size()}}resetStats(){this.hits=0,this.misses=0}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}};Fh.QueryPlanCache=r1});var qw=v(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.SPARQLResultCache=void 0;cl.createSPARQLResultCache=SL;var vL=zf(),_L={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Dh=class{static{o(this,"SPARQLResultCache")}constructor(e={}){this.fileToQueries=new Map,this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0},this.avgQueryTimeMs=100,this.options={..._L,...e},this.cache=new vL.LRUCache(this.options.maxSize)}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}hashResult(e){return this.isTripleArray(e)?`T:${e.length}`:`S:${e.length}`}isTripleArray(e){return e.length>0&&"subject"in e[0]}estimateResultSize(e){return this.isTripleArray(e)?e.length*300:e.length*200}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);if(r===void 0){this.stats.misses++;return}if(Date.now()-r.timestamp>this.options.ttlMs){this.cache.set(t,void 0),this.stats.ttlInvalidations++,this.stats.misses++;return}return this.stats.hits++,this.stats.totalTimeSavedMs+=this.avgQueryTimeMs,r.result}set(e,t,r,i){if(this.estimateResultSize(t)>this.options.maxResultSizeBytes)return;i!==void 0&&(this.avgQueryTimeMs=(this.avgQueryTimeMs+i)/2);let a=this.normalizeQuery(e),c=r??new Set,l={result:t,timestamp:Date.now(),affectedFiles:c,resultHash:this.hashResult(t)};if(this.cache.size()>=this.options.maxSize&&this.stats.evictions++,this.cache.set(a,l),this.options.enableFileInvalidation)for(let f of c){let h=this.fileToQueries.get(f);h||(h=new Set,this.fileToQueries.set(f,h)),h.add(a)}}has(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r===void 0?!1:Date.now()-r.timestamp<=this.options.ttlMs}invalidateByFile(e){if(!this.options.enableFileInvalidation)return 0;let t=this.fileToQueries.get(e);if(!t)return 0;let r=0;for(let i of t)this.cache.set(i,void 0),r++,this.stats.fileInvalidations++;return this.fileToQueries.delete(e),r}clear(){this.cache.clear(),this.fileToQueries.clear()}getStats(){let e=this.stats.hits+this.stats.misses,t=e>0?this.stats.hits/e:0;return{hits:this.stats.hits,misses:this.stats.misses,hitRate:t,size:this.cache.size(),maxSize:this.options.maxSize,evictions:this.stats.evictions,ttlInvalidations:this.stats.ttlInvalidations,fileInvalidations:this.stats.fileInvalidations,avgTimeSavedMs:this.stats.hits>0?this.stats.totalTimeSavedMs/this.stats.hits:0}}resetStats(){this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0}}size(){return this.cache.size()}pruneExpired(){return 0}};cl.SPARQLResultCache=Dh;function SL(n){return new Dh(n)}o(SL,"createSPARQLResultCache")});var Gw=v(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.IncrementalIndexer=void 0;ll.createIncrementalIndexer=wL;var bL={throttleMs:500,maxBatchSize:100,useContentHashing:!1},Nh=class{static{o(this,"IncrementalIndexer")}constructor(e={}){this.fileMetadata=new Map,this.pendingChanges=[],this.throttleTimer=null,this.invalidateCallbacks=[],this.lastIndexTime=0,this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]},this.options={...bL,...e}}recordChange(e){this.pendingChanges.push(e),this.stats.totalChanges++,this.throttleTimer===null&&(this.throttleTimer=setTimeout(()=>{this.processPendingChanges(),this.throttleTimer=null},this.options.throttleMs))}processPendingChanges(){if(this.pendingChanges.length===0)return;let e=performance.now(),t=new Map;for(let a of this.pendingChanges)t.set(a.path,a);let r=Array.from(t.values()),i=[];for(let a of r)switch(a.type){case"deleted":this.fileMetadata.delete(a.path),i.push(a);break;case"renamed":a.oldPath&&this.fileMetadata.delete(a.oldPath),i.push(a);break;case"created":case"modified":i.push(a);break}if(i.length>0){this.stats.invalidations+=i.length;for(let a of this.invalidateCallbacks)try{a(i)}catch(c){console.error("IncrementalIndexer: Error in invalidation callback:",c)}}let s=performance.now()-e;this.stats.indexDurations.push(s),this.stats.indexDurations.length>100&&this.stats.indexDurations.shift(),this.lastIndexTime=Date.now(),this.pendingChanges=[]}flush(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.processPendingChanges()}updateMetadata(e,t,r,i){this.fileMetadata.set(e,{mtime:t,size:r,contentHash:i})}hasChanged(e,t,r){let i=this.fileMetadata.get(e);return i===void 0||i.mtime!==t||r!==void 0&&i.size!==r}getChangedFiles(e){let t=[];for(let[r,i]of this.fileMetadata.entries())i.mtime>e&&t.push(r);return t}onInvalidate(e){return this.invalidateCallbacks.push(e),()=>{let t=this.invalidateCallbacks.indexOf(e);t!==-1&&this.invalidateCallbacks.splice(t,1)}}getStats(){let e=this.stats.indexDurations,t=e.length>0?e.reduce((i,s)=>i+s,0)/e.length:0,r=e.length>0?e[e.length-1]:0;return{trackedFiles:this.fileMetadata.size,totalChanges:this.stats.totalChanges,invalidations:this.stats.invalidations,noOpChanges:this.stats.noOpChanges,lastIndexDurationMs:r,avgIndexDurationMs:t,lastIndexTime:this.lastIndexTime}}resetStats(){this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]}}clear(){this.fileMetadata.clear(),this.pendingChanges=[],this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null)}size(){return this.fileMetadata.size}isTracked(e){return this.fileMetadata.has(e)}getMetadata(e){return this.fileMetadata.get(e)}dispose(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.invalidateCallbacks=[],this.pendingChanges=[],this.fileMetadata.clear()}};ll.IncrementalIndexer=Nh;function wL(n){return new Nh(n)}o(wL,"createIncrementalIndexer")});var Ww=v(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.ResultSerializer=void 0;var Lh=mt(),Mh=Ye(),kh=Lt(),n1=class{static{o(this,"ResultSerializer")}serialize(e,t,r={}){switch(t){case"json":return this.serializeJSON(e,r);case"xml":return this.serializeXML(e,r);case"csv":return this.serializeCSV(e,r);case"turtle":return this.serializeTurtle(e,r);default:throw new Error(`Unsupported result format: ${t}`)}}serializeJSON(e,t={}){let r=this.toJSONResultSet(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}toJSONResultSet(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(a=>{let c={};for(let l of i){let u=a.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof Mh.IRI?{type:"uri",value:e.value}:e instanceof kh.BlankNode?{type:"bnode",value:e.id}:e instanceof Lh.Literal?this.literalToJSONBinding(e):{type:"literal",value:String(e)}}literalToJSONBinding(e){let t={type:"literal",value:e.value};return e.datatype?t.datatype=e.datatype.value:e.language&&(t["xml:lang"]=e.language,e.hasDirection()&&e.direction&&(t.direction=e.direction)),t}serializeXML(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=['<?xml version="1.0"?>','<sparql xmlns="http://www.w3.org/2005/sparql-results#">'," <head>"];for(let a of i)s.push(` <variable name="${this.escapeXML(a)}"/>`);s.push(" </head>"),s.push(" <results>");for(let a of e){s.push(" <result>");for(let c of i){let l=a.get(c);l!==void 0&&(s.push(` <binding name="${this.escapeXML(c)}">`),s.push(" "+this.termToXML(l)),s.push(" </binding>"))}s.push(" </result>")}return s.push(" </results>"),s.push("</sparql>"),s.join(`
337
+ ${r}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}generateExpression(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:typeof e.value=="boolean"?e.value?"true":"false":String(e.value);case"comparison":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"logical":return e.operator==="!"?`!(${this.generateExpression(e.operands[0])})`:`(${e.operands.map(t=>this.generateExpression(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"function":return`${e.function.toUpperCase()}(${e.args.map(t=>this.generateExpression(t)).join(", ")})`;case"functionCall":return`${(typeof e.function=="string"?e.function:e.function.value).toUpperCase()}(${e.args.map(r=>this.generateExpression(r)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),r=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${r})`:`${t} IN (${r})`}default:throw new No(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let r of e.triples)this.collectVariablesFromTriple(r,t);break;case"filter":this.collectVariablesFromOperation(e.input,t),this.collectVariablesFromExpression(e.expression,t);break;case"join":case"leftjoin":case"union":case"minus":this.collectVariablesFromOperation(e.left,t),this.collectVariablesFromOperation(e.right,t);break;case"values":for(let r of e.variables)t.add(r);break;case"project":for(let r of e.variables)t.add(r);this.collectVariablesFromOperation(e.input,t);break;case"extend":t.add(e.variable),this.collectVariablesFromOperation(e.input,t);break;case"orderby":case"slice":case"distinct":case"reduced":this.collectVariablesFromOperation(e.input,t);break;case"group":for(let r of e.variables)t.add(r);for(let r of e.aggregates)t.add(r.variable);this.collectVariablesFromOperation(e.input,t);break;case"subquery":this.collectVariablesFromOperation(e.query,t);break}}collectVariablesFromTriple(e,t){e.subject.type==="variable"&&t.add(e.subject.value),"type"in e.predicate&&e.predicate.type==="variable"&&t.add(e.predicate.value),e.object.type==="variable"&&t.add(e.object.value)}collectVariablesFromExpression(e,t){switch(e.type){case"variable":t.add(e.name);break;case"comparison":case"arithmetic":this.collectVariablesFromExpression(e.left,t),this.collectVariablesFromExpression(e.right,t);break;case"logical":for(let r of e.operands)this.collectVariablesFromExpression(r,t);break;case"function":case"functionCall":for(let r of e.args)this.collectVariablesFromExpression(r,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let r of e.list)this.collectVariablesFromExpression(r,t);break}}};Lo.SPARQLGenerator=Ky});var kw=v(wn=>{"use strict";var tL=wn&&wn.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),rL=wn&&wn.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),nL=wn&&wn.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&tL(t,e,r[i]);return rL(t,e),t}})();Object.defineProperty(wn,"__esModule",{value:!0});wn.QueryExecutor=wn.QueryExecutorError=void 0;var iL=Py(),sL=bh(),aL=Ny(),oL=My(),cL=Aw(),lL=Iw(),uL=Rw(),fL=Vy(),hL=Dw(),dL=Lw(),pL=Mw(),mL=Ye(),Mo=class extends Error{static{o(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};wn.QueryExecutorError=Mo;var Xy=class{static{o(this,"QueryExecutor")}constructor(e,t={}){this.tripleStore=e,this.bgpExecutor=new iL.BGPExecutor(e),this.filterExecutor=new sL.FilterExecutor,this.optionalExecutor=new aL.OptionalExecutor,this.unionExecutor=new oL.UnionExecutor,this.minusExecutor=new cL.MinusExecutor,this.valuesExecutor=new lL.ValuesExecutor,this.aggregateExecutor=new uL.AggregateExecutor,this.constructExecutor=new fL.ConstructExecutor,this.serviceExecutor=new hL.ServiceExecutor(t.serviceConfig),this.graphExecutor=new dL.GraphExecutor(e),this.sparqlGenerator=new pL.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(r,i)=>this.evaluateExistsPattern(r,i)),this.filterExecutor.setTripleStore(e)}async evaluateExistsPattern(e,t){for await(let r of this.execute(e))if(t.merge(r)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}async*execute(e){switch(e.type){case"bgp":yield*this.executeBGP(e);break;case"filter":yield*this.executeFilter(e);break;case"join":yield*this.executeJoin(e);break;case"leftjoin":yield*this.executeLeftJoin(e);break;case"union":yield*this.executeUnion(e);break;case"minus":yield*this.executeMinus(e);break;case"values":yield*this.executeValues(e);break;case"project":yield*this.executeProject(e);break;case"orderby":yield*this.executeOrderBy(e);break;case"slice":yield*this.executeSlice(e);break;case"distinct":yield*this.executeDistinct(e);break;case"reduced":yield*this.executeReduced(e);break;case"group":yield*this.executeGroup(e);break;case"extend":yield*this.executeExtend(e);break;case"subquery":yield*this.executeSubquery(e);break;case"lateraljoin":yield*this.executeLateralJoin(e);break;case"service":yield*this.executeService(e);break;case"graph":yield*this.executeGraph(e);break;default:throw new Mo(`Unknown operation type: ${e.type}`)}}async*executeBGP(e){yield*this.bgpExecutor.execute(e)}async*executeFilter(e){let t=this.execute(e.input);yield*this.filterExecutor.execute(e,t)}async*executeJoin(e){let t=[];for await(let a of this.execute(e.left))t.push(a);if(t.length===0)return;let r=new Set;for(let a of t)for(let c of a.variables())r.add(c);let i=this.collectOperationVariables(e.right);if([...r].some(a=>i.has(a)))for(let a of t){let c=this.substituteVariables(e.right,a);for await(let l of this.execute(c)){let u=a.merge(l);u!==null&&(yield u)}}else{let a=[];for await(let c of this.execute(e.right))a.push(c);for(let c of t)for(let l of a){let u=c.merge(l);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.optionalExecutor.execute(i(),s())}async*executeUnion(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.unionExecutor.execute(i(),s())}async*executeMinus(e){let t=[];for await(let a of this.execute(e.left))t.push(a);let r=[];for await(let a of this.execute(e.right))r.push(a);async function*i(){for(let a of t)yield a}o(i,"leftGen");async function*s(){for(let a of r)yield a}o(s,"rightGen"),yield*this.minusExecutor.execute(i(),s())}async*executeValues(e){yield*this.valuesExecutor.execute(e)}async*executeProject(e){for await(let t of this.execute(e.input))yield t}async*executeOrderBy(e){let t=[];for await(let r of this.execute(e.input))t.push(r);t.sort((r,i)=>{for(let s of e.comparators){let a=this.getExpressionValue(s.expression,r),c=this.getExpressionValue(s.expression,i),l=0;if(a===void 0&&c===void 0?l=0:a===void 0?l=1:c===void 0?l=-1:typeof a=="number"&&typeof c=="number"?l=a-c:l=String(a).localeCompare(String(c)),s.descending&&(l=-l),l!==0)return l}return 0});for(let r of t)yield r}async*executeSlice(e){let t=0,r=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=r){if(i!==void 0&&t-r>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeReduced(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let r=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of r)e.having.every(a=>this.filterExecutor.evaluateExpression(a,i)===!0)&&(yield i);else for(let i of r)yield i}async*executeExtend(e){for await(let t of this.execute(e.input)){let r=t.clone(),i=this.evaluateExtendExpression(e.expression,t);i!==void 0&&r.set(e.variable,i),yield r}}async*executeSubquery(e){yield*this.execute(e.query)}async*executeLateralJoin(e){let t=[];for await(let r of this.execute(e.left))t.push(r);for(let r of t){let i=this.substituteVariables(e.right,r);for await(let s of this.execute(i)){let a=r.merge(s);a!==null&&(yield a)}}}substituteVariables(e,t){let r=JSON.parse(JSON.stringify(e));return this.substituteInOperation(r,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let r=e;return r.type==="bgp"&&r.triples?(r.triples=r.triples.map(i=>this.substituteInTriple(i,t)),r):(r.input&&(r.input=this.substituteInOperation(r.input,t)),r.left&&(r.left=this.substituteInOperation(r.left,t)),r.right&&(r.right=this.substituteInOperation(r.right,t)),r.pattern&&(r.pattern=this.substituteInOperation(r.pattern,t)),r.query&&(r.query=this.substituteInOperation(r.query,t)),r.where&&(r.where=this.substituteInOperation(r.where,t)),r.expression&&this.substituteInExpression(r.expression,t),r)}substituteInExpression(e,t){if(!(!e||typeof e!="object")){if(e.type==="exists"&&e.pattern&&(e.pattern=this.substituteInOperation(e.pattern,t)),e.left&&this.substituteInExpression(e.left,t),e.right&&this.substituteInExpression(e.right,t),e.operands)for(let r of e.operands)this.substituteInExpression(r,t);if(e.args)for(let r of e.args)this.substituteInExpression(r,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let r of e.list)this.substituteInExpression(r,t)}}substituteInTriple(e,t){return{subject:this.substituteInTripleElement(e.subject,t),predicate:e.predicate,object:this.substituteInTripleElement(e.object,t)}}substituteInTripleElement(e,t){if(e&&e.type==="variable"){let r=t.get(e.value);if(r!=null){if(r instanceof mL.IRI||r.termType==="NamedNode")return{type:"iri",value:r.value};if(r.termType==="Literal"||typeof r.value=="string"){let i=r;return{type:"literal",value:i.value,datatype:i.datatype?.value??i._datatype?.value,language:i.language??i._language}}}}return e}async*executeService(e){yield*this.serviceExecutor.execute(e,t=>this.sparqlGenerator.generateSelect(t))}async*executeGraph(e){let t=async function*(r,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{r.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(r,i):yield*this.execute(r)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:r}=await Promise.resolve().then(()=>nL(Zi()));yield new r;return}yield*this.bgpExecutor.executeInGraph(e,t)}evaluateExtendExpression(e,t){if(e.type!=="aggregate")try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}getExpressionValue(e,t){if(e.type==="variable"){let r=t.get(e.name);return r?r.value??r.id??String(r):void 0}return e.value}collectOperationVariables(e){let t=new Set;return this.collectVarsFromOperation(e,t),t}collectVarsFromOperation(e,t){if(!(!e||typeof e!="object")){if(e.type==="bgp"&&e.triples)for(let r of e.triples)this.collectVarsFromElement(r.subject,t),r.predicate?.type!=="path"&&this.collectVarsFromElement(r.predicate,t),this.collectVarsFromElement(r.object,t);if(e.type==="values"&&e.variables)for(let r of e.variables)t.add(r);e.expression&&this.collectVarsFromExpressionTree(e.expression,t),e.type==="extend"&&e.variable&&t.add(e.variable),e.input&&this.collectVarsFromOperation(e.input,t),e.left&&this.collectVarsFromOperation(e.left,t),e.right&&this.collectVarsFromOperation(e.right,t),e.pattern&&this.collectVarsFromOperation(e.pattern,t),e.query&&this.collectVarsFromOperation(e.query,t),e.where&&this.collectVarsFromOperation(e.where,t)}}collectVarsFromElement(e,t){e&&(e.type==="variable"&&t.add(e.value),e.type==="quoted"&&(this.collectVarsFromElement(e.subject,t),this.collectVarsFromElement(e.predicate,t),this.collectVarsFromElement(e.object,t)))}collectVarsFromExpressionTree(e,t){if(!(!e||typeof e!="object")){if(e.type==="variable"&&e.name&&t.add(e.name),e.type==="exists"&&e.pattern&&this.collectVarsFromOperation(e.pattern,t),e.left&&this.collectVarsFromExpressionTree(e.left,t),e.right&&this.collectVarsFromExpressionTree(e.right,t),e.operands)for(let r of e.operands)this.collectVarsFromExpressionTree(r,t);if(e.args)for(let r of e.args)this.collectVarsFromExpressionTree(r,t);if(e.expression&&this.collectVarsFromExpressionTree(e.expression,t),e.list)for(let r of e.list)this.collectVarsFromExpressionTree(r,t)}}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}isConstructQuery(e){return e.type==="construct"}async executeConstruct(e){if(e.type!=="construct")throw new Mo("executeConstruct requires a CONSTRUCT operation");let t=await this.executeAll(e.where);return this.constructExecutor.execute(e.template,t)}isAskQuery(e){return e.type==="ask"}async executeAsk(e){if(e.type!=="ask")throw new Mo("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};wn.QueryExecutor=Xy});var $w=v(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.UpdateExecutor=jo.UpdateExecutorError=void 0;var gL=Wi(),ko=Ye(),Jy=mt(),jw=Lt(),vr=class extends Error{static{o(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};jo.UpdateExecutorError=vr;var Zy=class{static{o(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new vr("Expected UPDATE request");let t=[];for(let r of e.updates){let i=await this.executeOperation(r);t.push(i)}return t}async executeOperation(e){if("updateType"in e)switch(e.updateType){case"insert":return this.executeInsertData(e);case"delete":return this.executeDeleteData(e);case"insertdelete":throw new vr("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new vr("DELETE WHERE not yet implemented");default:throw new vr(`Unknown update type: ${e.updateType}`)}if("type"in e)switch(e.type){case"clear":case"drop":case"load":case"create":case"copy":case"move":case"add":throw new vr(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new vr(`Unknown operation type: ${e.type}`)}throw new vr("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new vr("Expected INSERT DATA operation");let t=e,r=0;for(let i of t.insert)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.insertTriples(i.triples,s)}else if(i.type==="graph"){let s=i,a=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,a)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new vr("Expected DELETE DATA operation");let t=e,r=0;for(let i of t.delete)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.deleteTriples(i.triples,s)}else if(i.type==="graph"){let s=i,a=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,a)}return{type:"delete",deleted:r,success:!0}}async insertTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i);t&&this.tripleStore.addToGraph?await this.tripleStore.addToGraph(s,t):await this.tripleStore.add(s),r++}return r}async deleteTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i),a;t&&this.tripleStore.removeFromGraph?a=await this.tripleStore.removeFromGraph(s,t):a=await this.tripleStore.remove(s),a&&r++}return r}convertTriple(e){return new gL.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new ko.IRI(e.value);if(e.termType==="BlankNode")return new jw.BlankNode(e.value);throw new vr(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new ko.IRI(e.value);throw new vr("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new ko.IRI(e.value);if(e.termType==="BlankNode")return new jw.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new Jy.Literal(t.value,void 0,t.language):t.datatype?new Jy.Literal(t.value,new ko.IRI(t.datatype.value)):new Jy.Literal(t.value)}throw new vr(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new ko.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new vr("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new ko.IRI(e.value)}};jo.UpdateExecutor=Zy});var Uw=v(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.AggregateFunctions=void 0;var e1=mt(),Vw=Ye(),t1=class{static{o(this,"AggregateFunctions")}static count(e,t){if(!t)return e.length;let r=0;for(let i of e)i.has(t)&&r++;return r}static countDistinct(e,t){let r=new Set;for(let i of e){let s=i.get(t);s&&r.add(s.toString())}return r.size}static sum(e,t){let r=0;for(let i of e){let s=i.get(t);if(s instanceof e1.Literal){let a=this.toNumber(s);isNaN(a)||(r+=a)}}return r}static avg(e,t){let r=this.sum(e,t),i=this.count(e,t);return i>0?r/i:0}static min(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let a=this.toComparable(s);(r===null||a<r)&&(r=a)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let a=this.toComparable(s);(r===null||a>r)&&(r=a)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let a=s.get(t);a&&(a instanceof e1.Literal||a instanceof Vw.IRI?i.push(a.value):i.push(a.toString()))}return i.join(r)}static sample(e,t){for(let r of e){let i=r.get(t);if(i)return this.toComparable(i)}return null}static sampleDistinct(e,t){return this.sample(e,t)}static toNumber(e){let t=e.datatype?.value;return t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double"),parseFloat(e.value)}static toComparable(e){if(e instanceof e1.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof Vw.IRI?e.value:String(e)}};Rh.AggregateFunctions=t1});var Bw=v(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.QueryPlanCache=void 0;var yL=zf(),r1=class{static{o(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new yL.LRUCache(e)}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r!==void 0?this.hits++:this.misses++,r}set(e,t){let r=this.normalizeQuery(e);this.cache.set(r,t)}has(e){let t=this.normalizeQuery(e);return this.cache.get(t)!==void 0}clear(){this.cache.clear()}getStats(){let e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0,size:this.cache.size()}}resetStats(){this.hits=0,this.misses=0}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}};Fh.QueryPlanCache=r1});var qw=v(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.SPARQLResultCache=void 0;cl.createSPARQLResultCache=SL;var vL=zf(),_L={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Dh=class{static{o(this,"SPARQLResultCache")}constructor(e={}){this.fileToQueries=new Map,this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0},this.avgQueryTimeMs=100,this.options={..._L,...e},this.cache=new vL.LRUCache(this.options.maxSize)}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}hashResult(e){return this.isTripleArray(e)?`T:${e.length}`:`S:${e.length}`}isTripleArray(e){return e.length>0&&"subject"in e[0]}estimateResultSize(e){return this.isTripleArray(e)?e.length*300:e.length*200}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);if(r===void 0){this.stats.misses++;return}if(Date.now()-r.timestamp>this.options.ttlMs){this.cache.set(t,void 0),this.stats.ttlInvalidations++,this.stats.misses++;return}return this.stats.hits++,this.stats.totalTimeSavedMs+=this.avgQueryTimeMs,r.result}set(e,t,r,i){if(this.estimateResultSize(t)>this.options.maxResultSizeBytes)return;i!==void 0&&(this.avgQueryTimeMs=(this.avgQueryTimeMs+i)/2);let a=this.normalizeQuery(e),c=r??new Set,l={result:t,timestamp:Date.now(),affectedFiles:c,resultHash:this.hashResult(t)};if(this.cache.size()>=this.options.maxSize&&this.stats.evictions++,this.cache.set(a,l),this.options.enableFileInvalidation)for(let f of c){let h=this.fileToQueries.get(f);h||(h=new Set,this.fileToQueries.set(f,h)),h.add(a)}}has(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r===void 0?!1:Date.now()-r.timestamp<=this.options.ttlMs}invalidateByFile(e){if(!this.options.enableFileInvalidation)return 0;let t=this.fileToQueries.get(e);if(!t)return 0;let r=0;for(let i of t)this.cache.set(i,void 0),r++,this.stats.fileInvalidations++;return this.fileToQueries.delete(e),r}clear(){this.cache.clear(),this.fileToQueries.clear()}getStats(){let e=this.stats.hits+this.stats.misses,t=e>0?this.stats.hits/e:0;return{hits:this.stats.hits,misses:this.stats.misses,hitRate:t,size:this.cache.size(),maxSize:this.options.maxSize,evictions:this.stats.evictions,ttlInvalidations:this.stats.ttlInvalidations,fileInvalidations:this.stats.fileInvalidations,avgTimeSavedMs:this.stats.hits>0?this.stats.totalTimeSavedMs/this.stats.hits:0}}resetStats(){this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0}}size(){return this.cache.size()}pruneExpired(){return 0}};cl.SPARQLResultCache=Dh;function SL(n){return new Dh(n)}o(SL,"createSPARQLResultCache")});var Gw=v(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.IncrementalIndexer=void 0;ll.createIncrementalIndexer=wL;var bL={throttleMs:500,maxBatchSize:100,useContentHashing:!1},Nh=class{static{o(this,"IncrementalIndexer")}constructor(e={}){this.fileMetadata=new Map,this.pendingChanges=[],this.throttleTimer=null,this.invalidateCallbacks=[],this.lastIndexTime=0,this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]},this.options={...bL,...e}}recordChange(e){this.pendingChanges.push(e),this.stats.totalChanges++,this.throttleTimer===null&&(this.throttleTimer=setTimeout(()=>{this.processPendingChanges(),this.throttleTimer=null},this.options.throttleMs))}processPendingChanges(){if(this.pendingChanges.length===0)return;let e=performance.now(),t=new Map;for(let a of this.pendingChanges)t.set(a.path,a);let r=Array.from(t.values()),i=[];for(let a of r)switch(a.type){case"deleted":this.fileMetadata.delete(a.path),i.push(a);break;case"renamed":a.oldPath&&this.fileMetadata.delete(a.oldPath),i.push(a);break;case"created":case"modified":i.push(a);break}if(i.length>0){this.stats.invalidations+=i.length;for(let a of this.invalidateCallbacks)try{a(i)}catch(c){console.error("IncrementalIndexer: Error in invalidation callback:",c)}}let s=performance.now()-e;this.stats.indexDurations.push(s),this.stats.indexDurations.length>100&&this.stats.indexDurations.shift(),this.lastIndexTime=Date.now(),this.pendingChanges=[]}flush(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.processPendingChanges()}updateMetadata(e,t,r,i){this.fileMetadata.set(e,{mtime:t,size:r,contentHash:i})}hasChanged(e,t,r){let i=this.fileMetadata.get(e);return i===void 0||i.mtime!==t||r!==void 0&&i.size!==r}getChangedFiles(e){let t=[];for(let[r,i]of this.fileMetadata.entries())i.mtime>e&&t.push(r);return t}onInvalidate(e){return this.invalidateCallbacks.push(e),()=>{let t=this.invalidateCallbacks.indexOf(e);t!==-1&&this.invalidateCallbacks.splice(t,1)}}getStats(){let e=this.stats.indexDurations,t=e.length>0?e.reduce((i,s)=>i+s,0)/e.length:0,r=e.length>0?e[e.length-1]:0;return{trackedFiles:this.fileMetadata.size,totalChanges:this.stats.totalChanges,invalidations:this.stats.invalidations,noOpChanges:this.stats.noOpChanges,lastIndexDurationMs:r,avgIndexDurationMs:t,lastIndexTime:this.lastIndexTime}}resetStats(){this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]}}clear(){this.fileMetadata.clear(),this.pendingChanges=[],this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null)}size(){return this.fileMetadata.size}isTracked(e){return this.fileMetadata.has(e)}getMetadata(e){return this.fileMetadata.get(e)}dispose(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.invalidateCallbacks=[],this.pendingChanges=[],this.fileMetadata.clear()}};ll.IncrementalIndexer=Nh;function wL(n){return new Nh(n)}o(wL,"createIncrementalIndexer")});var Ww=v(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.ResultSerializer=void 0;var Lh=mt(),Mh=Ye(),kh=Lt(),n1=class{static{o(this,"ResultSerializer")}serialize(e,t,r={}){switch(t){case"json":return this.serializeJSON(e,r);case"xml":return this.serializeXML(e,r);case"csv":return this.serializeCSV(e,r);case"turtle":return this.serializeTurtle(e,r);default:throw new Error(`Unsupported result format: ${t}`)}}serializeJSON(e,t={}){let r=this.toJSONResultSet(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}toJSONResultSet(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(a=>{let c={};for(let l of i){let u=a.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof Mh.IRI?{type:"uri",value:e.value}:e instanceof kh.BlankNode?{type:"bnode",value:e.id}:e instanceof Lh.Literal?this.literalToJSONBinding(e):{type:"literal",value:String(e)}}literalToJSONBinding(e){let t={type:"literal",value:e.value};return e.datatype?t.datatype=e.datatype.value:e.language&&(t["xml:lang"]=e.language,e.hasDirection()&&e.direction&&(t.direction=e.direction)),t}serializeXML(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=['<?xml version="1.0"?>','<sparql xmlns="http://www.w3.org/2005/sparql-results#">'," <head>"];for(let a of i)s.push(` <variable name="${this.escapeXML(a)}"/>`);s.push(" </head>"),s.push(" <results>");for(let a of e){s.push(" <result>");for(let c of i){let l=a.get(c);l!==void 0&&(s.push(` <binding name="${this.escapeXML(c)}">`),s.push(" "+this.termToXML(l)),s.push(" </binding>"))}s.push(" </result>")}return s.push(" </results>"),s.push("</sparql>"),s.join(`
338
338
  `)}termToXML(e){return e instanceof Mh.IRI?`<uri>${this.escapeXML(e.value)}</uri>`:e instanceof kh.BlankNode?`<bnode>${this.escapeXML(e.id)}</bnode>`:e instanceof Lh.Literal?this.literalToXML(e):`<literal>${this.escapeXML(String(e))}</literal>`}literalToXML(e){let t=this.escapeXML(e.value);if(e.datatype)return`<literal datatype="${this.escapeXML(e.datatype.value)}">${t}</literal>`;if(e.language){let r=`xml:lang="${this.escapeXML(e.language)}"`;return e.hasDirection()&&e.direction&&(r+=` direction="${e.direction}"`),`<literal ${r}>${t}</literal>`}return`<literal>${t}</literal>`}serializeCSV(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(i.map(a=>this.escapeCSV(a)).join(","));for(let a of e){let c=i.map(l=>{let u=a.get(l);return u===void 0?"":this.escapeCSV(this.termToCSV(u))});s.push(c.join(","))}return s.join(`
339
339
  `)}termToCSV(e){return e instanceof Mh.IRI?e.value:e instanceof kh.BlankNode?`_:${e.id}`:e instanceof Lh.Literal?this.literalToCSV(e):String(e)}literalToCSV(e){if(e.datatype)return`${e.value}^^<${e.datatype.value}>`;if(e.language){let t=e.language;return e.hasDirection()&&e.direction&&(t+=`--${e.direction}`),`${e.value}@${t}`}return e.value}serializeTurtle(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(`# SPARQL Results - ${e.length} solution(s)`),s.push(`# Variables: ${i.join(", ")}`),s.push("");for(let a=0;a<e.length;a++){let c=e[a];s.push(`# Solution ${a+1}`);for(let l of i){let u=c.get(l);u!==void 0&&s.push(`?${l} = ${this.termToTurtle(u)}`)}s.push("")}return s.join(`
340
340
  `).trimEnd()}termToTurtle(e){return e instanceof Mh.IRI?`<${e.value}>`:e instanceof kh.BlankNode?`_:${e.id}`:e instanceof Lh.Literal?e.toString():`"${String(e)}"`}escapeXML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}escapeCSV(e){return e.includes(",")||e.includes('"')||e.includes(`
@@ -381,12 +381,12 @@ To resolve:
381
381
  \u2022 Review service logs for detailed error information
382
382
  \u2022 Contact support if the issue persists`}};Xh.ServiceError=S1});var cE=v(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ServiceError=Dt.ResourceExhaustedError=Dt.NotFoundError=Dt.PermissionError=Dt.StateTransitionError=Dt.NetworkError=Dt.ValidationError=Dt.ApplicationError=Dt.ErrorCode=void 0;var b9=Ai();Object.defineProperty(Dt,"ErrorCode",{enumerable:!0,get:o(function(){return b9.ErrorCode},"get")});var w9=Ci();Object.defineProperty(Dt,"ApplicationError",{enumerable:!0,get:o(function(){return w9.ApplicationError},"get")});var E9=tE();Object.defineProperty(Dt,"ValidationError",{enumerable:!0,get:o(function(){return E9.ValidationError},"get")});var T9=rE();Object.defineProperty(Dt,"NetworkError",{enumerable:!0,get:o(function(){return T9.NetworkError},"get")});var x9=nE();Object.defineProperty(Dt,"StateTransitionError",{enumerable:!0,get:o(function(){return x9.StateTransitionError},"get")});var A9=iE();Object.defineProperty(Dt,"PermissionError",{enumerable:!0,get:o(function(){return A9.PermissionError},"get")});var C9=sE();Object.defineProperty(Dt,"NotFoundError",{enumerable:!0,get:o(function(){return C9.NotFoundError},"get")});var I9=aE();Object.defineProperty(Dt,"ResourceExhaustedError",{enumerable:!0,get:o(function(){return I9.ResourceExhaustedError},"get")});var O9=oE();Object.defineProperty(Dt,"ServiceError",{enumerable:!0,get:o(function(){return O9.ServiceError},"get")})});var lE=v(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.ApplicationErrorHandler=void 0;var b1=Ci(),P9=Ai(),w1=class{static{o(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let a=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,a),this.logger?.debug(`Retrying after ${a}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(a),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof b1.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends b1.ApplicationError{constructor(){super(...arguments),this.code=i.code,this.retriable=i.retriable,this.guidance=i.guidance}}(e.message,s)}return e}return new class extends b1.ApplicationError{static{o(this,"UnknownError")}constructor(s,a){super(s,{originalError:a.name,...t}),this.code=P9.ErrorCode.UNKNOWN_ERROR,this.retriable=!1,this.guidance="An unexpected error occurred"}}(e.message,e)}formatError(e){let t=[];return t.push(`\u274C ${e.name}: ${e.message}`),e.guidance&&t.push(`\u{1F4A1} ${e.guidance}`),e.context&&Object.keys(e.context).length>0&&t.push(`Context: ${JSON.stringify(e.context,null,2)}`),t.join(`
383
383
  `)}calculateDelay(e){let t=this.retryConfig.initialDelayMs*Math.pow(this.retryConfig.backoffMultiplier,e);return Math.min(t,this.retryConfig.maxDelayMs)}sleep(e){return new Promise(t=>setTimeout(t,e))}callTelemetryHooks(e,...t){for(let r of this.telemetryHooks)try{let i=r[e];i&&i.apply(r,t)}catch(i){console.error("Error in telemetry hook:",i)}}};Jh.ApplicationErrorHandler=w1});var uE=v(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.ApplicationErrorHandler=void 0;var R9=lE();Object.defineProperty(Zh,"ApplicationErrorHandler",{enumerable:!0,get:o(function(){return R9.ApplicationErrorHandler},"get")})});var zr=v(y=>{"use strict";var F9=y&&y.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),En=y&&y.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&F9(e,n,t)};Object.defineProperty(y,"__esModule",{value:!0});y.fillTemplate=y.findMatchingTemplates=y.findClassByTerm=y.KNOWN_CLASSES=y.KNOWN_PROTOTYPES=y.EFFORT_STATUSES=y.ASSET_CLASSES=y.PREDICATES=y.SPARQL_PREFIXES=y.SPARQL_TEMPLATES=y.DEFAULT_NL_TO_SPARQL_CONFIG=y.NLToSPARQLService=y.TypeRegistry=y.GraphQueryService=y.DEFAULT_SEMANTIC_SEARCH_CONFIG=y.SemanticSearchService=y.DEFAULT_VECTOR_STORE_CONFIG=y.VectorStore=y.DEFAULT_EMBEDDING_CONFIG=y.EmbeddingService=y.GenericAssetCreationService=y.URIConstructionService=y.SessionEventService=y.AssetConversionService=y.PlanningService=y.AlgorithmExtractor=y.DynamicFrontmatterGenerator=y.TaskFrontmatterGenerator=y.FleetingNoteCreationService=y.SupervisionCreationService=y.StatusTimestampService=y.RenameToUidService=y.PropertyCleanupService=y.LoggingService=y.LabelToAliasService=y.FolderRepairService=y.EffortVotingService=y.EffortStatusWorkflow=y.ConceptCreationService=y.ClassCreationService=y.AreaHierarchyBuilder=y.AreaCreationService=y.TaskStatusService=y.ProjectCreationService=y.TaskCreationService=y.extractPropertyLabel=y.uriToPropertyName=y.propertyNameToUri=y.rangeToFieldType=y.PropertyFieldType=void 0;y.createDecimalLiteral=y.getNumericValue=y.createPercentileAggregate=y.modeAggregate=y.stddevAggregate=y.varianceAggregate=y.medianAggregate=y.EXO_AGGREGATE_NS=y.BUILT_IN_AGGREGATES=y.CustomAggregateError=y.CustomAggregateRegistry=y.AggregateFunctions=y.BuiltInFunctions=y.SolutionMapping=y.UpdateExecutorError=y.UpdateExecutor=y.QueryExecutor=y.DescribeExecutor=y.ConstructExecutor=y.UnionExecutor=y.OptionalExecutor=y.FilterExecutor=y.BGPExecutor=y.AlgebraSerializer=y.AlgebraOptimizer=y.AlgebraTranslator=y.DescribeOptionsTransformerError=y.DescribeOptionsTransformer=y.SPARQLParseError=y.SPARQLParser=y.NoteToRDFConverter=y.RDFVocabularyMapper=y.InMemoryTripleStore=y.RDFSerializer=y.FilenameValidator=y.EffortSortingHelpers=y.MetadataExtractor=y.MetadataHelpers=y.WikiLinkHelpers=y.DateFormatter=y.FrontmatterService=y.CriticalityZoneUUIDs=y.CriticalityZoneService=y.DailyReviewService=y.DEFAULT_AUTOCOMPLETE_CONFIG=y.AutocompleteService=y.TrendDetectionService=y.AnalyticsService=y.getTemplateByName=y.validateParameters=void 0;y.createStreamingSource=y.StreamingLoader=y.resetGlobalPool=y.getGlobalPool=y.MemoryPool=y.CompactGraphStore=y.StringTable=y.DEFAULT_COLORS=y.NODE_FLAGS=y.container=y.resetContainer=y.getContainer=y.createChildContainer=y.registerCoreServices=y.DI_TOKENS=y.TransactionError=y.TripleNotFoundError=y.TripleAlreadyExistsError=y.FileAlreadyExistsError=y.FileNotFoundError=y.FilterContainsOptimizer=y.VaultPrefixTransformer=y.CaseWhenTransformerError=y.CaseWhenTransformer=y.ResultSerializer=y.createIncrementalIndexer=y.IncrementalIndexer=y.createSPARQLResultCache=y.SPARQLResultCache=y.QueryPlanCache=y.createDoubleLiteral=void 0;En(zp(),y);En(Qp(),y);En(h_(),y);En(d_(),y);En(Yp(),y);En(Kp(),y);En(m_(),y);En(v_(),y);En(Rm(),y);En(aS(),y);var fE=Lm();Object.defineProperty(y,"PropertyFieldType",{enumerable:!0,get:o(function(){return fE.PropertyFieldType},"get")});Object.defineProperty(y,"rangeToFieldType",{enumerable:!0,get:o(function(){return fE.rangeToFieldType},"get")});var E1=lS();Object.defineProperty(y,"propertyNameToUri",{enumerable:!0,get:o(function(){return E1.propertyNameToUri},"get")});Object.defineProperty(y,"uriToPropertyName",{enumerable:!0,get:o(function(){return E1.uriToPropertyName},"get")});Object.defineProperty(y,"extractPropertyLabel",{enumerable:!0,get:o(function(){return E1.extractPropertyLabel},"get")});var D9=xg();Object.defineProperty(y,"TaskCreationService",{enumerable:!0,get:o(function(){return D9.TaskCreationService},"get")});var N9=Cg();Object.defineProperty(y,"ProjectCreationService",{enumerable:!0,get:o(function(){return N9.ProjectCreationService},"get")});var L9=Rg();Object.defineProperty(y,"TaskStatusService",{enumerable:!0,get:o(function(){return L9.TaskStatusService},"get")});var M9=Dg();Object.defineProperty(y,"AreaCreationService",{enumerable:!0,get:o(function(){return M9.AreaCreationService},"get")});var k9=Lg();Object.defineProperty(y,"AreaHierarchyBuilder",{enumerable:!0,get:o(function(){return k9.AreaHierarchyBuilder},"get")});var j9=kg();Object.defineProperty(y,"ClassCreationService",{enumerable:!0,get:o(function(){return j9.ClassCreationService},"get")});var $9=$g();Object.defineProperty(y,"ConceptCreationService",{enumerable:!0,get:o(function(){return $9.ConceptCreationService},"get")});var V9=Pf();Object.defineProperty(y,"EffortStatusWorkflow",{enumerable:!0,get:o(function(){return V9.EffortStatusWorkflow},"get")});var U9=Ug();Object.defineProperty(y,"EffortVotingService",{enumerable:!0,get:o(function(){return U9.EffortVotingService},"get")});var B9=qg();Object.defineProperty(y,"FolderRepairService",{enumerable:!0,get:o(function(){return B9.FolderRepairService},"get")});var q9=Wg();Object.defineProperty(y,"LabelToAliasService",{enumerable:!0,get:o(function(){return q9.LabelToAliasService},"get")});var G9=la();Object.defineProperty(y,"LoggingService",{enumerable:!0,get:o(function(){return G9.LoggingService},"get")});var W9=Qg();Object.defineProperty(y,"PropertyCleanupService",{enumerable:!0,get:o(function(){return W9.PropertyCleanupService},"get")});var H9=Kg();Object.defineProperty(y,"RenameToUidService",{enumerable:!0,get:o(function(){return H9.RenameToUidService},"get")});var z9=Rf();Object.defineProperty(y,"StatusTimestampService",{enumerable:!0,get:o(function(){return z9.StatusTimestampService},"get")});var Q9=Jg();Object.defineProperty(y,"SupervisionCreationService",{enumerable:!0,get:o(function(){return Q9.SupervisionCreationService},"get")});var Y9=e0();Object.defineProperty(y,"FleetingNoteCreationService",{enumerable:!0,get:o(function(){return Y9.FleetingNoteCreationService},"get")});var K9=Tf();Object.defineProperty(y,"TaskFrontmatterGenerator",{enumerable:!0,get:o(function(){return K9.TaskFrontmatterGenerator},"get")});var X9=r0();Object.defineProperty(y,"DynamicFrontmatterGenerator",{enumerable:!0,get:o(function(){return X9.DynamicFrontmatterGenerator},"get")});var J9=xf();Object.defineProperty(y,"AlgorithmExtractor",{enumerable:!0,get:o(function(){return J9.AlgorithmExtractor},"get")});var Z9=i0();Object.defineProperty(y,"PlanningService",{enumerable:!0,get:o(function(){return Z9.PlanningService},"get")});var e6=a0();Object.defineProperty(y,"AssetConversionService",{enumerable:!0,get:o(function(){return e6.AssetConversionService},"get")});var t6=c0();Object.defineProperty(y,"SessionEventService",{enumerable:!0,get:o(function(){return t6.SessionEventService},"get")});var r6=u0();Object.defineProperty(y,"URIConstructionService",{enumerable:!0,get:o(function(){return r6.URIConstructionService},"get")});var n6=h0();Object.defineProperty(y,"GenericAssetCreationService",{enumerable:!0,get:o(function(){return n6.GenericAssetCreationService},"get")});var hE=p0();Object.defineProperty(y,"EmbeddingService",{enumerable:!0,get:o(function(){return hE.EmbeddingService},"get")});Object.defineProperty(y,"DEFAULT_EMBEDDING_CONFIG",{enumerable:!0,get:o(function(){return hE.DEFAULT_EMBEDDING_CONFIG},"get")});var dE=y0();Object.defineProperty(y,"VectorStore",{enumerable:!0,get:o(function(){return dE.VectorStore},"get")});Object.defineProperty(y,"DEFAULT_VECTOR_STORE_CONFIG",{enumerable:!0,get:o(function(){return dE.DEFAULT_VECTOR_STORE_CONFIG},"get")});var pE=mb();Object.defineProperty(y,"SemanticSearchService",{enumerable:!0,get:o(function(){return pE.SemanticSearchService},"get")});Object.defineProperty(y,"DEFAULT_SEMANTIC_SEARCH_CONFIG",{enumerable:!0,get:o(function(){return pE.DEFAULT_SEMANTIC_SEARCH_CONFIG},"get")});var i6=gb();Object.defineProperty(y,"GraphQueryService",{enumerable:!0,get:o(function(){return i6.GraphQueryService},"get")});var s6=vb();Object.defineProperty(y,"TypeRegistry",{enumerable:!0,get:o(function(){return s6.TypeRegistry},"get")});var mE=_b();Object.defineProperty(y,"NLToSPARQLService",{enumerable:!0,get:o(function(){return mE.NLToSPARQLService},"get")});Object.defineProperty(y,"DEFAULT_NL_TO_SPARQL_CONFIG",{enumerable:!0,get:o(function(){return mE.DEFAULT_NL_TO_SPARQL_CONFIG},"get")});var Tn=b0();Object.defineProperty(y,"SPARQL_TEMPLATES",{enumerable:!0,get:o(function(){return Tn.SPARQL_TEMPLATES},"get")});Object.defineProperty(y,"SPARQL_PREFIXES",{enumerable:!0,get:o(function(){return Tn.SPARQL_PREFIXES},"get")});Object.defineProperty(y,"PREDICATES",{enumerable:!0,get:o(function(){return Tn.PREDICATES},"get")});Object.defineProperty(y,"ASSET_CLASSES",{enumerable:!0,get:o(function(){return Tn.ASSET_CLASSES},"get")});Object.defineProperty(y,"EFFORT_STATUSES",{enumerable:!0,get:o(function(){return Tn.EFFORT_STATUSES},"get")});Object.defineProperty(y,"KNOWN_PROTOTYPES",{enumerable:!0,get:o(function(){return Tn.KNOWN_PROTOTYPES},"get")});Object.defineProperty(y,"KNOWN_CLASSES",{enumerable:!0,get:o(function(){return Tn.KNOWN_CLASSES},"get")});Object.defineProperty(y,"findClassByTerm",{enumerable:!0,get:o(function(){return Tn.findClassByTerm},"get")});Object.defineProperty(y,"findMatchingTemplates",{enumerable:!0,get:o(function(){return Tn.findMatchingTemplates},"get")});Object.defineProperty(y,"fillTemplate",{enumerable:!0,get:o(function(){return Tn.fillTemplate},"get")});Object.defineProperty(y,"validateParameters",{enumerable:!0,get:o(function(){return Tn.validateParameters},"get")});Object.defineProperty(y,"getTemplateByName",{enumerable:!0,get:o(function(){return Tn.getTemplateByName},"get")});var a6=bb();Object.defineProperty(y,"AnalyticsService",{enumerable:!0,get:o(function(){return a6.AnalyticsService},"get")});var o6=wb();Object.defineProperty(y,"TrendDetectionService",{enumerable:!0,get:o(function(){return o6.TrendDetectionService},"get")});var gE=Tb();Object.defineProperty(y,"AutocompleteService",{enumerable:!0,get:o(function(){return gE.AutocompleteService},"get")});Object.defineProperty(y,"DEFAULT_AUTOCOMPLETE_CONFIG",{enumerable:!0,get:o(function(){return gE.DEFAULT_AUTOCOMPLETE_CONFIG},"get")});var c6=Ab();Object.defineProperty(y,"DailyReviewService",{enumerable:!0,get:o(function(){return c6.DailyReviewService},"get")});var yE=I0();Object.defineProperty(y,"CriticalityZoneService",{enumerable:!0,get:o(function(){return yE.CriticalityZoneService},"get")});Object.defineProperty(y,"CriticalityZoneUUIDs",{enumerable:!0,get:o(function(){return yE.CriticalityZoneUUIDs},"get")});var l6=Ki();Object.defineProperty(y,"FrontmatterService",{enumerable:!0,get:o(function(){return l6.FrontmatterService},"get")});var u6=nr();Object.defineProperty(y,"DateFormatter",{enumerable:!0,get:o(function(){return u6.DateFormatter},"get")});var f6=Js();Object.defineProperty(y,"WikiLinkHelpers",{enumerable:!0,get:o(function(){return f6.WikiLinkHelpers},"get")});var h6=gn();Object.defineProperty(y,"MetadataHelpers",{enumerable:!0,get:o(function(){return h6.MetadataHelpers},"get")});var d6=Yc();Object.defineProperty(y,"MetadataExtractor",{enumerable:!0,get:o(function(){return d6.MetadataExtractor},"get")});var p6=Ib();Object.defineProperty(y,"EffortSortingHelpers",{enumerable:!0,get:o(function(){return p6.EffortSortingHelpers},"get")});var m6=Ob();Object.defineProperty(y,"FilenameValidator",{enumerable:!0,get:o(function(){return m6.FilenameValidator},"get")});var g6=Mb();Object.defineProperty(y,"RDFSerializer",{enumerable:!0,get:o(function(){return g6.RDFSerializer},"get")});var y6=kb();Object.defineProperty(y,"InMemoryTripleStore",{enumerable:!0,get:o(function(){return y6.InMemoryTripleStore},"get")});var v6=Q0();Object.defineProperty(y,"RDFVocabularyMapper",{enumerable:!0,get:o(function(){return v6.RDFVocabularyMapper},"get")});var _6=Y0();Object.defineProperty(y,"NoteToRDFConverter",{enumerable:!0,get:o(function(){return _6.NoteToRDFConverter},"get")});var vE=sw();Object.defineProperty(y,"SPARQLParser",{enumerable:!0,get:o(function(){return vE.SPARQLParser},"get")});Object.defineProperty(y,"SPARQLParseError",{enumerable:!0,get:o(function(){return vE.SPARQLParseError},"get")});var _E=fy();Object.defineProperty(y,"DescribeOptionsTransformer",{enumerable:!0,get:o(function(){return _E.DescribeOptionsTransformer},"get")});Object.defineProperty(y,"DescribeOptionsTransformerError",{enumerable:!0,get:o(function(){return _E.DescribeOptionsTransformerError},"get")});var S6=ow();Object.defineProperty(y,"AlgebraTranslator",{enumerable:!0,get:o(function(){return S6.AlgebraTranslator},"get")});var b6=cw();Object.defineProperty(y,"AlgebraOptimizer",{enumerable:!0,get:o(function(){return b6.AlgebraOptimizer},"get")});var w6=lw();Object.defineProperty(y,"AlgebraSerializer",{enumerable:!0,get:o(function(){return w6.AlgebraSerializer},"get")});var E6=Py();Object.defineProperty(y,"BGPExecutor",{enumerable:!0,get:o(function(){return E6.BGPExecutor},"get")});var T6=bh();Object.defineProperty(y,"FilterExecutor",{enumerable:!0,get:o(function(){return T6.FilterExecutor},"get")});var x6=Ny();Object.defineProperty(y,"OptionalExecutor",{enumerable:!0,get:o(function(){return x6.OptionalExecutor},"get")});var A6=My();Object.defineProperty(y,"UnionExecutor",{enumerable:!0,get:o(function(){return A6.UnionExecutor},"get")});var C6=Vy();Object.defineProperty(y,"ConstructExecutor",{enumerable:!0,get:o(function(){return C6.ConstructExecutor},"get")});var I6=xw();Object.defineProperty(y,"DescribeExecutor",{enumerable:!0,get:o(function(){return I6.DescribeExecutor},"get")});var O6=kw();Object.defineProperty(y,"QueryExecutor",{enumerable:!0,get:o(function(){return O6.QueryExecutor},"get")});var SE=$w();Object.defineProperty(y,"UpdateExecutor",{enumerable:!0,get:o(function(){return SE.UpdateExecutor},"get")});Object.defineProperty(y,"UpdateExecutorError",{enumerable:!0,get:o(function(){return SE.UpdateExecutorError},"get")});var P6=Zi();Object.defineProperty(y,"SolutionMapping",{enumerable:!0,get:o(function(){return P6.SolutionMapping},"get")});var R6=Sh();Object.defineProperty(y,"BuiltInFunctions",{enumerable:!0,get:o(function(){return R6.BuiltInFunctions},"get")});var F6=Uw();Object.defineProperty(y,"AggregateFunctions",{enumerable:!0,get:o(function(){return F6.AggregateFunctions},"get")});var bE=Gy();Object.defineProperty(y,"CustomAggregateRegistry",{enumerable:!0,get:o(function(){return bE.CustomAggregateRegistry},"get")});Object.defineProperty(y,"CustomAggregateError",{enumerable:!0,get:o(function(){return bE.CustomAggregateError},"get")});var Ii=Wy();Object.defineProperty(y,"BUILT_IN_AGGREGATES",{enumerable:!0,get:o(function(){return Ii.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(y,"EXO_AGGREGATE_NS",{enumerable:!0,get:o(function(){return Ii.EXO_AGGREGATE_NS},"get")});Object.defineProperty(y,"medianAggregate",{enumerable:!0,get:o(function(){return Ii.medianAggregate},"get")});Object.defineProperty(y,"varianceAggregate",{enumerable:!0,get:o(function(){return Ii.varianceAggregate},"get")});Object.defineProperty(y,"stddevAggregate",{enumerable:!0,get:o(function(){return Ii.stddevAggregate},"get")});Object.defineProperty(y,"modeAggregate",{enumerable:!0,get:o(function(){return Ii.modeAggregate},"get")});Object.defineProperty(y,"createPercentileAggregate",{enumerable:!0,get:o(function(){return Ii.createPercentileAggregate},"get")});Object.defineProperty(y,"getNumericValue",{enumerable:!0,get:o(function(){return Ii.getNumericValue},"get")});Object.defineProperty(y,"createDecimalLiteral",{enumerable:!0,get:o(function(){return Ii.createDecimalLiteral},"get")});Object.defineProperty(y,"createDoubleLiteral",{enumerable:!0,get:o(function(){return Ii.createDoubleLiteral},"get")});var D6=Bw();Object.defineProperty(y,"QueryPlanCache",{enumerable:!0,get:o(function(){return D6.QueryPlanCache},"get")});var wE=qw();Object.defineProperty(y,"SPARQLResultCache",{enumerable:!0,get:o(function(){return wE.SPARQLResultCache},"get")});Object.defineProperty(y,"createSPARQLResultCache",{enumerable:!0,get:o(function(){return wE.createSPARQLResultCache},"get")});var EE=Gw();Object.defineProperty(y,"IncrementalIndexer",{enumerable:!0,get:o(function(){return EE.IncrementalIndexer},"get")});Object.defineProperty(y,"createIncrementalIndexer",{enumerable:!0,get:o(function(){return EE.createIncrementalIndexer},"get")});var N6=Ww();Object.defineProperty(y,"ResultSerializer",{enumerable:!0,get:o(function(){return N6.ResultSerializer},"get")});var TE=cy();Object.defineProperty(y,"CaseWhenTransformer",{enumerable:!0,get:o(function(){return TE.CaseWhenTransformer},"get")});Object.defineProperty(y,"CaseWhenTransformerError",{enumerable:!0,get:o(function(){return TE.CaseWhenTransformerError},"get")});var L6=my();Object.defineProperty(y,"VaultPrefixTransformer",{enumerable:!0,get:o(function(){return L6.VaultPrefixTransformer},"get")});var M6=Ey();Object.defineProperty(y,"FilterContainsOptimizer",{enumerable:!0,get:o(function(){return M6.FilterContainsOptimizer},"get")});var xE=Hw();Object.defineProperty(y,"FileNotFoundError",{enumerable:!0,get:o(function(){return xE.FileNotFoundError},"get")});Object.defineProperty(y,"FileAlreadyExistsError",{enumerable:!0,get:o(function(){return xE.FileAlreadyExistsError},"get")});var T1=q0();Object.defineProperty(y,"TripleAlreadyExistsError",{enumerable:!0,get:o(function(){return T1.TripleAlreadyExistsError},"get")});Object.defineProperty(y,"TripleNotFoundError",{enumerable:!0,get:o(function(){return T1.TripleNotFoundError},"get")});Object.defineProperty(y,"TransactionError",{enumerable:!0,get:o(function(){return T1.TransactionError},"get")});var k6=ct();Object.defineProperty(y,"DI_TOKENS",{enumerable:!0,get:o(function(){return k6.DI_TOKENS},"get")});var hl=zw();Object.defineProperty(y,"registerCoreServices",{enumerable:!0,get:o(function(){return hl.registerCoreServices},"get")});Object.defineProperty(y,"createChildContainer",{enumerable:!0,get:o(function(){return hl.createChildContainer},"get")});Object.defineProperty(y,"getContainer",{enumerable:!0,get:o(function(){return hl.getContainer},"get")});Object.defineProperty(y,"resetContainer",{enumerable:!0,get:o(function(){return hl.resetContainer},"get")});Object.defineProperty(y,"container",{enumerable:!0,get:o(function(){return hl.container},"get")});var es=Zw();Object.defineProperty(y,"NODE_FLAGS",{enumerable:!0,get:o(function(){return es.NODE_FLAGS},"get")});Object.defineProperty(y,"DEFAULT_COLORS",{enumerable:!0,get:o(function(){return es.DEFAULT_COLORS},"get")});Object.defineProperty(y,"StringTable",{enumerable:!0,get:o(function(){return es.StringTable},"get")});Object.defineProperty(y,"CompactGraphStore",{enumerable:!0,get:o(function(){return es.CompactGraphStore},"get")});Object.defineProperty(y,"MemoryPool",{enumerable:!0,get:o(function(){return es.MemoryPool},"get")});Object.defineProperty(y,"getGlobalPool",{enumerable:!0,get:o(function(){return es.getGlobalPool},"get")});Object.defineProperty(y,"resetGlobalPool",{enumerable:!0,get:o(function(){return es.resetGlobalPool},"get")});Object.defineProperty(y,"StreamingLoader",{enumerable:!0,get:o(function(){return es.StreamingLoader},"get")});Object.defineProperty(y,"createStreamingSource",{enumerable:!0,get:o(function(){return es.createStreamingSource},"get")});En(cE(),y);En(uE(),y)});var qt=v(x1=>{"use strict";x1.fromCallback=function(n){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")n.apply(this,e);else return new Promise((t,r)=>{e.push((i,s)=>i!=null?r(i):t(s)),n.apply(this,e)})},"name",{value:n.name})};x1.fromPromise=function(n){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return n.apply(this,e);e.pop(),n.apply(this,e).then(r=>t(null,r),t)},"name",{value:n.name})}});var CE=v((UY,AE)=>{var Ts=require("constants"),j6=process.cwd,ed=null,$6=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ed||(ed=j6.call(process)),ed};try{process.cwd()}catch{}typeof process.chdir=="function"&&(A1=process.chdir,process.chdir=function(n){ed=null,A1.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,A1));var A1;AE.exports=V6;function V6(n){Ts.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=a(n.chownSync),n.fchownSync=a(n.fchownSync),n.lchownSync=a(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=c(n.stat),n.fstat=c(n.fstat),n.lstat=c(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,h,d){d&&process.nextTick(d)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,h,d,p){p&&process.nextTick(p)},n.lchownSync=function(){}),$6==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function h(d,p,_){var S=Date.now(),E=0;f(d,p,o(function A(C){if(C&&(C.code==="EACCES"||C.code==="EPERM"||C.code==="EBUSY")&&Date.now()-S<6e4){setTimeout(function(){n.stat(p,function(k,G){k&&k.code==="ENOENT"?f(d,p,A):_(C)})},E),E<100&&(E+=10);return}_&&_(C)},"CB"))}return o(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function h(d,p,_,S,E,A){var C;if(A&&typeof A=="function"){var k=0;C=o(function(G,Q,H){if(G&&G.code==="EAGAIN"&&k<10)return k++,f.call(n,d,p,_,S,E,C);A.apply(this,arguments)},"callback")}return f.call(n,d,p,_,S,E,C)}return o(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(h,d,p,_,S){for(var E=0;;)try{return f.call(n,h,d,p,_,S)}catch(A){if(A.code==="EAGAIN"&&E<10){E++;continue}throw A}}})(n.readSync);function e(f){f.lchmod=function(h,d,p){f.open(h,Ts.O_WRONLY|Ts.O_SYMLINK,d,function(_,S){if(_){p&&p(_);return}f.fchmod(S,d,function(E){f.close(S,function(A){p&&p(E||A)})})})},f.lchmodSync=function(h,d){var p=f.openSync(h,Ts.O_WRONLY|Ts.O_SYMLINK,d),_=!0,S;try{S=f.fchmodSync(p,d),_=!1}finally{if(_)try{f.closeSync(p)}catch{}else f.closeSync(p)}return S}}o(e,"patchLchmod");function t(f){Ts.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,d,p,_){f.open(h,Ts.O_SYMLINK,function(S,E){if(S){_&&_(S);return}f.futimes(E,d,p,function(A){f.close(E,function(C){_&&_(A||C)})})})},f.lutimesSync=function(h,d,p){var _=f.openSync(h,Ts.O_SYMLINK),S,E=!0;try{S=f.futimesSync(_,d,p),E=!1}finally{if(E)try{f.closeSync(_)}catch{}else f.closeSync(_)}return S}):f.futimes&&(f.lutimes=function(h,d,p,_){_&&process.nextTick(_)},f.lutimesSync=function(){})}o(t,"patchLutimes");function r(f){return f&&function(h,d,p){return f.call(n,h,d,function(_){u(_)&&(_=null),p&&p.apply(this,arguments)})}}o(r,"chmodFix");function i(f){return f&&function(h,d){try{return f.call(n,h,d)}catch(p){if(!u(p))throw p}}}o(i,"chmodFixSync");function s(f){return f&&function(h,d,p,_){return f.call(n,h,d,p,function(S){u(S)&&(S=null),_&&_.apply(this,arguments)})}}o(s,"chownFix");function a(f){return f&&function(h,d,p){try{return f.call(n,h,d,p)}catch(_){if(!u(_))throw _}}}o(a,"chownFixSync");function c(f){return f&&function(h,d,p){typeof d=="function"&&(p=d,d=null);function _(S,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments)}return o(_,"callback"),d?f.call(n,h,d,_):f.call(n,h,_)}}o(c,"statFix");function l(f){return f&&function(h,d){var p=d?f.call(n,h,d):f.call(n,h);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}o(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}o(u,"chownErOk")}o(V6,"patch")});var PE=v((qY,OE)=>{var IE=require("stream").Stream;OE.exports=U6;function U6(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);IE.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),c=0,l=a.length;c<l;c++){var u=a[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}n.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function t(r,i){if(!(this instanceof t))return new t(r,i);IE.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}o(U6,"legacy")});var FE=v((WY,RE)=>{"use strict";RE.exports=q6;var B6=Object.getPrototypeOf||function(n){return n.__proto__};function q6(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:B6(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}o(q6,"clone")});var Go=v((zY,O1)=>{var bt=require("fs"),G6=CE(),W6=PE(),H6=FE(),td=require("util"),ar,nd;typeof Symbol=="function"&&typeof Symbol.for=="function"?(ar=Symbol.for("graceful-fs.queue"),nd=Symbol.for("graceful-fs.previous")):(ar="___graceful-fs.queue",nd="___graceful-fs.previous");function z6(){}o(z6,"noop");function LE(n,e){Object.defineProperty(n,ar,{get:o(function(){return e},"get")})}o(LE,"publishQueue");var Ta=z6;td.debuglog?Ta=td.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ta=o(function(){var n=td.format.apply(td,arguments);n="GFS4: "+n.split(/\n/).join(`
384
- GFS4: `),console.error(n)},"debug"));bt[ar]||(DE=global[ar]||[],LE(bt,DE),bt.close=(function(n){function e(t,r){return n.call(bt,t,function(i){i||NE(),typeof r=="function"&&r.apply(this,arguments)})}return o(e,"close"),Object.defineProperty(e,nd,{value:n}),e})(bt.close),bt.closeSync=(function(n){function e(t){n.apply(bt,arguments),NE()}return o(e,"closeSync"),Object.defineProperty(e,nd,{value:n}),e})(bt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ta(bt[ar]),require("assert").equal(bt[ar].length,0)}));var DE;global[ar]||LE(global,bt[ar]);O1.exports=C1(H6(bt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!bt.__patched&&(O1.exports=C1(bt),bt.__patched=!0);function C1(n){G6(n),n.gracefulify=C1,n.createReadStream=Q,n.createWriteStream=H;var e=n.readFile;n.readFile=t;function t(N,K,ge){return typeof K=="function"&&(ge=K,K=null),dt(N,K,ge);function dt(nt,yt,Ke,Je){return e(nt,yt,function(Ue){Ue&&(Ue.code==="EMFILE"||Ue.code==="ENFILE")?qo([dt,[nt,yt,Ke],Ue,Je||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(dt,"go$readFile")}o(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return r(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$writeFile")}o(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=a);function a(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return s(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$appendFile")}o(a,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=0),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return c(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$copyFile")}o(l,"copyFile");var u=n.readdir;n.readdir=h;var f=/^v[0-5]\./;function h(N,K,ge){typeof K=="function"&&(ge=K,K=null);var dt=f.test(process.version)?o(function(Ke,Je,Ue,Z){return u(Ke,nt(Ke,Je,Ue,Z))},"go$readdir"):o(function(Ke,Je,Ue,Z){return u(Ke,Je,nt(Ke,Je,Ue,Z))},"go$readdir");return dt(N,K,ge);function nt(yt,Ke,Je,Ue){return function(Z,$){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?qo([dt,[yt,Ke,Je],Z,Ue||Date.now(),Date.now()]):($&&$.sort&&$.sort(),typeof Je=="function"&&Je.call(this,Z,$))}}}if(o(h,"readdir"),process.version.substr(0,4)==="v0.8"){var d=W6(n);A=d.ReadStream,k=d.WriteStream}var p=n.ReadStream;p&&(A.prototype=Object.create(p.prototype),A.prototype.open=C);var _=n.WriteStream;_&&(k.prototype=Object.create(_.prototype),k.prototype.open=G),Object.defineProperty(n,"ReadStream",{get:o(function(){return A},"get"),set:o(function(N){A=N},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:o(function(){return k},"get"),set:o(function(N){k=N},"set"),enumerable:!0,configurable:!0});var S=A;Object.defineProperty(n,"FileReadStream",{get:o(function(){return S},"get"),set:o(function(N){S=N},"set"),enumerable:!0,configurable:!0});var E=k;Object.defineProperty(n,"FileWriteStream",{get:o(function(){return E},"get"),set:o(function(N){E=N},"set"),enumerable:!0,configurable:!0});function A(N,K){return this instanceof A?(p.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}o(A,"ReadStream");function C(){var N=this;Ie(N.path,N.flags,N.mode,function(K,ge){K?(N.autoClose&&N.destroy(),N.emit("error",K)):(N.fd=ge,N.emit("open",ge),N.read())})}o(C,"ReadStream$open");function k(N,K){return this instanceof k?(_.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}o(k,"WriteStream");function G(){var N=this;Ie(N.path,N.flags,N.mode,function(K,ge){K?(N.destroy(),N.emit("error",K)):(N.fd=ge,N.emit("open",ge))})}o(G,"WriteStream$open");function Q(N,K){return new n.ReadStream(N,K)}o(Q,"createReadStream");function H(N,K){return new n.WriteStream(N,K)}o(H,"createWriteStream");var re=n.open;n.open=Ie;function Ie(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return re(yt,Ke,Je,function($,Ze){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$open")}return o(Ie,"open"),n}o(C1,"patch");function qo(n){Ta("ENQUEUE",n[0].name,n[1]),bt[ar].push(n),I1()}o(qo,"enqueue");var rd;function NE(){for(var n=Date.now(),e=0;e<bt[ar].length;++e)bt[ar][e].length>2&&(bt[ar][e][3]=n,bt[ar][e][4]=n);I1()}o(NE,"resetQueue");function I1(){if(clearTimeout(rd),rd=void 0,bt[ar].length!==0){var n=bt[ar].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Ta("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Ta("TIMEOUT",e.name,t);var a=t.pop();typeof a=="function"&&a.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Ta("RETRY",e.name,t),e.apply(null,t.concat([i]))):bt[ar].push(n)}rd===void 0&&(rd=setTimeout(I1,0))}}o(I1,"retry")});var Lr=v(ts=>{"use strict";var ME=qt().fromCallback,Nr=Go(),Q6=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(n=>typeof Nr[n]=="function");Object.assign(ts,Nr);Q6.forEach(n=>{ts[n]=ME(Nr[n])});ts.exists=function(n,e){return typeof e=="function"?Nr.exists(n,e):new Promise(t=>Nr.exists(n,t))};ts.read=function(n,e,t,r,i,s){return typeof s=="function"?Nr.read(n,e,t,r,i,s):new Promise((a,c)=>{Nr.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);a({bytesRead:u,buffer:f})})})};ts.write=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.write(n,e,...t):new Promise((r,i)=>{Nr.write(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffer:c})})})};ts.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.readv(n,e,...t):new Promise((r,i)=>{Nr.readv(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesRead:a,buffers:c})})})};ts.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.writev(n,e,...t):new Promise((r,i)=>{Nr.writev(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffers:c})})})};typeof Nr.realpath.native=="function"?ts.realpath.native=ME(Nr.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var jE=v((KY,kE)=>{"use strict";var Y6=require("path");kE.exports.checkPath=o(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Y6.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var BE=v((JY,P1)=>{"use strict";var $E=Lr(),{checkPath:VE}=jE(),UE=o(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");P1.exports.makeDir=async(n,e)=>(VE(n),$E.mkdir(n,{mode:UE(e),recursive:!0}));P1.exports.makeDirSync=(n,e)=>(VE(n),$E.mkdirSync(n,{mode:UE(e),recursive:!0}))});var ri=v((eK,qE)=>{"use strict";var K6=qt().fromPromise,{makeDir:X6,makeDirSync:R1}=BE(),F1=K6(X6);qE.exports={mkdirs:F1,mkdirsSync:R1,mkdirp:F1,mkdirpSync:R1,ensureDir:F1,ensureDirSync:R1}});var xs=v((tK,WE)=>{"use strict";var J6=qt().fromPromise,GE=Lr();function Z6(n){return GE.access(n).then(()=>!0).catch(()=>!1)}o(Z6,"pathExists");WE.exports={pathExists:J6(Z6),pathExistsSync:GE.existsSync}});var D1=v((nK,HE)=>{"use strict";var Wo=Lr(),eM=qt().fromPromise;async function tM(n,e,t){let r=await Wo.open(n,"r+"),i=null;try{await Wo.futimes(r,e,t)}finally{try{await Wo.close(r)}catch(s){i=s}}if(i)throw i}o(tM,"utimesMillis");function rM(n,e,t){let r=Wo.openSync(n,"r+");return Wo.futimesSync(r,e,t),Wo.closeSync(r)}o(rM,"utimesMillisSync");HE.exports={utimesMillis:eM(tM),utimesMillisSync:rM}});var xa=v((sK,KE)=>{"use strict";var Ho=Lr(),Gt=require("path"),zE=qt().fromPromise;function nM(n,e,t){let r=t.dereference?i=>Ho.stat(i,{bigint:!0}):i=>Ho.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}o(nM,"getStats");function iM(n,e,t){let r,i=t.dereference?a=>Ho.statSync(a,{bigint:!0}):a=>Ho.lstatSync(a,{bigint:!0}),s=i(n);try{r=i(e)}catch(a){if(a.code==="ENOENT")return{srcStat:s,destStat:null};throw a}return{srcStat:s,destStat:r}}o(iM,"getStatsSync");async function sM(n,e,t,r){let{srcStat:i,destStat:s}=await nM(n,e,r);if(s){if(dl(i,s)){let a=Gt.basename(n),c=Gt.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&N1(n,e))throw new Error(id(n,e,t));return{srcStat:i,destStat:s}}o(sM,"checkPaths");function aM(n,e,t,r){let{srcStat:i,destStat:s}=iM(n,e,r);if(s){if(dl(i,s)){let a=Gt.basename(n),c=Gt.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&N1(n,e))throw new Error(id(n,e,t));return{srcStat:i,destStat:s}}o(aM,"checkPathsSync");async function QE(n,e,t,r){let i=Gt.resolve(Gt.dirname(n)),s=Gt.resolve(Gt.dirname(t));if(s===i||s===Gt.parse(s).root)return;let a;try{a=await Ho.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(dl(e,a))throw new Error(id(n,t,r));return QE(n,e,s,r)}o(QE,"checkParentPaths");function YE(n,e,t,r){let i=Gt.resolve(Gt.dirname(n)),s=Gt.resolve(Gt.dirname(t));if(s===i||s===Gt.parse(s).root)return;let a;try{a=Ho.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(dl(e,a))throw new Error(id(n,t,r));return YE(n,e,s,r)}o(YE,"checkParentPathsSync");function dl(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}o(dl,"areIdentical");function N1(n,e){let t=Gt.resolve(n).split(Gt.sep).filter(i=>i),r=Gt.resolve(e).split(Gt.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}o(N1,"isSrcSubdir");function id(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}o(id,"errMsg");KE.exports={checkPaths:zE(sM),checkPathsSync:aM,checkParentPaths:zE(QE),checkParentPathsSync:YE,isSrcSubdir:N1,areIdentical:dl}});var JE=v((oK,XE)=>{"use strict";async function oM(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}o(oM,"asyncIteratorConcurrentProcess");XE.exports={asyncIteratorConcurrentProcess:oM}});var nT=v((lK,rT)=>{"use strict";var vr=Lr(),pl=require("path"),{mkdirs:cM}=ri(),{pathExists:lM}=xs(),{utimesMillis:uM}=D1(),ml=xa(),{asyncIteratorConcurrentProcess:fM}=JE();async function hM(n,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
384
+ GFS4: `),console.error(n)},"debug"));bt[ar]||(DE=global[ar]||[],LE(bt,DE),bt.close=(function(n){function e(t,r){return n.call(bt,t,function(i){i||NE(),typeof r=="function"&&r.apply(this,arguments)})}return o(e,"close"),Object.defineProperty(e,nd,{value:n}),e})(bt.close),bt.closeSync=(function(n){function e(t){n.apply(bt,arguments),NE()}return o(e,"closeSync"),Object.defineProperty(e,nd,{value:n}),e})(bt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ta(bt[ar]),require("assert").equal(bt[ar].length,0)}));var DE;global[ar]||LE(global,bt[ar]);O1.exports=C1(H6(bt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!bt.__patched&&(O1.exports=C1(bt),bt.__patched=!0);function C1(n){G6(n),n.gracefulify=C1,n.createReadStream=Q,n.createWriteStream=H;var e=n.readFile;n.readFile=t;function t(N,K,ge){return typeof K=="function"&&(ge=K,K=null),dt(N,K,ge);function dt(nt,yt,Ke,Je){return e(nt,yt,function(Ue){Ue&&(Ue.code==="EMFILE"||Ue.code==="ENFILE")?qo([dt,[nt,yt,Ke],Ue,Je||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(dt,"go$readFile")}o(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return r(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$writeFile")}o(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=a);function a(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return s(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$appendFile")}o(a,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=0),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return c(yt,Ke,Je,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$copyFile")}o(l,"copyFile");var u=n.readdir;n.readdir=h;var f=/^v[0-5]\./;function h(N,K,ge){typeof K=="function"&&(ge=K,K=null);var dt=f.test(process.version)?o(function(Ke,Je,Ue,Z){return u(Ke,nt(Ke,Je,Ue,Z))},"go$readdir"):o(function(Ke,Je,Ue,Z){return u(Ke,Je,nt(Ke,Je,Ue,Z))},"go$readdir");return dt(N,K,ge);function nt(yt,Ke,Je,Ue){return function(Z,$){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?qo([dt,[yt,Ke,Je],Z,Ue||Date.now(),Date.now()]):($&&$.sort&&$.sort(),typeof Je=="function"&&Je.call(this,Z,$))}}}if(o(h,"readdir"),process.version.substr(0,4)==="v0.8"){var d=W6(n);A=d.ReadStream,k=d.WriteStream}var p=n.ReadStream;p&&(A.prototype=Object.create(p.prototype),A.prototype.open=C);var _=n.WriteStream;_&&(k.prototype=Object.create(_.prototype),k.prototype.open=G),Object.defineProperty(n,"ReadStream",{get:o(function(){return A},"get"),set:o(function(N){A=N},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:o(function(){return k},"get"),set:o(function(N){k=N},"set"),enumerable:!0,configurable:!0});var S=A;Object.defineProperty(n,"FileReadStream",{get:o(function(){return S},"get"),set:o(function(N){S=N},"set"),enumerable:!0,configurable:!0});var E=k;Object.defineProperty(n,"FileWriteStream",{get:o(function(){return E},"get"),set:o(function(N){E=N},"set"),enumerable:!0,configurable:!0});function A(N,K){return this instanceof A?(p.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}o(A,"ReadStream");function C(){var N=this;Ie(N.path,N.flags,N.mode,function(K,ge){K?(N.autoClose&&N.destroy(),N.emit("error",K)):(N.fd=ge,N.emit("open",ge),N.read())})}o(C,"ReadStream$open");function k(N,K){return this instanceof k?(_.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}o(k,"WriteStream");function G(){var N=this;Ie(N.path,N.flags,N.mode,function(K,ge){K?(N.destroy(),N.emit("error",K)):(N.fd=ge,N.emit("open",ge))})}o(G,"WriteStream$open");function Q(N,K){return new n.ReadStream(N,K)}o(Q,"createReadStream");function H(N,K){return new n.WriteStream(N,K)}o(H,"createWriteStream");var re=n.open;n.open=Ie;function Ie(N,K,ge,dt){return typeof ge=="function"&&(dt=ge,ge=null),nt(N,K,ge,dt);function nt(yt,Ke,Je,Ue,Z){return re(yt,Ke,Je,function($,Ze){$&&($.code==="EMFILE"||$.code==="ENFILE")?qo([nt,[yt,Ke,Je,Ue],$,Z||Date.now(),Date.now()]):typeof Ue=="function"&&Ue.apply(this,arguments)})}o(nt,"go$open")}return o(Ie,"open"),n}o(C1,"patch");function qo(n){Ta("ENQUEUE",n[0].name,n[1]),bt[ar].push(n),I1()}o(qo,"enqueue");var rd;function NE(){for(var n=Date.now(),e=0;e<bt[ar].length;++e)bt[ar][e].length>2&&(bt[ar][e][3]=n,bt[ar][e][4]=n);I1()}o(NE,"resetQueue");function I1(){if(clearTimeout(rd),rd=void 0,bt[ar].length!==0){var n=bt[ar].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Ta("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Ta("TIMEOUT",e.name,t);var a=t.pop();typeof a=="function"&&a.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Ta("RETRY",e.name,t),e.apply(null,t.concat([i]))):bt[ar].push(n)}rd===void 0&&(rd=setTimeout(I1,0))}}o(I1,"retry")});var Lr=v(ts=>{"use strict";var ME=qt().fromCallback,Nr=Go(),Q6=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(n=>typeof Nr[n]=="function");Object.assign(ts,Nr);Q6.forEach(n=>{ts[n]=ME(Nr[n])});ts.exists=function(n,e){return typeof e=="function"?Nr.exists(n,e):new Promise(t=>Nr.exists(n,t))};ts.read=function(n,e,t,r,i,s){return typeof s=="function"?Nr.read(n,e,t,r,i,s):new Promise((a,c)=>{Nr.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);a({bytesRead:u,buffer:f})})})};ts.write=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.write(n,e,...t):new Promise((r,i)=>{Nr.write(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffer:c})})})};ts.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.readv(n,e,...t):new Promise((r,i)=>{Nr.readv(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesRead:a,buffers:c})})})};ts.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?Nr.writev(n,e,...t):new Promise((r,i)=>{Nr.writev(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffers:c})})})};typeof Nr.realpath.native=="function"?ts.realpath.native=ME(Nr.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var jE=v((KY,kE)=>{"use strict";var Y6=require("path");kE.exports.checkPath=o(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Y6.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var BE=v((JY,P1)=>{"use strict";var $E=Lr(),{checkPath:VE}=jE(),UE=o(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");P1.exports.makeDir=async(n,e)=>(VE(n),$E.mkdir(n,{mode:UE(e),recursive:!0}));P1.exports.makeDirSync=(n,e)=>(VE(n),$E.mkdirSync(n,{mode:UE(e),recursive:!0}))});var ni=v((eK,qE)=>{"use strict";var K6=qt().fromPromise,{makeDir:X6,makeDirSync:R1}=BE(),F1=K6(X6);qE.exports={mkdirs:F1,mkdirsSync:R1,mkdirp:F1,mkdirpSync:R1,ensureDir:F1,ensureDirSync:R1}});var xs=v((tK,WE)=>{"use strict";var J6=qt().fromPromise,GE=Lr();function Z6(n){return GE.access(n).then(()=>!0).catch(()=>!1)}o(Z6,"pathExists");WE.exports={pathExists:J6(Z6),pathExistsSync:GE.existsSync}});var D1=v((nK,HE)=>{"use strict";var Wo=Lr(),eM=qt().fromPromise;async function tM(n,e,t){let r=await Wo.open(n,"r+"),i=null;try{await Wo.futimes(r,e,t)}finally{try{await Wo.close(r)}catch(s){i=s}}if(i)throw i}o(tM,"utimesMillis");function rM(n,e,t){let r=Wo.openSync(n,"r+");return Wo.futimesSync(r,e,t),Wo.closeSync(r)}o(rM,"utimesMillisSync");HE.exports={utimesMillis:eM(tM),utimesMillisSync:rM}});var xa=v((sK,KE)=>{"use strict";var Ho=Lr(),Gt=require("path"),zE=qt().fromPromise;function nM(n,e,t){let r=t.dereference?i=>Ho.stat(i,{bigint:!0}):i=>Ho.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}o(nM,"getStats");function iM(n,e,t){let r,i=t.dereference?a=>Ho.statSync(a,{bigint:!0}):a=>Ho.lstatSync(a,{bigint:!0}),s=i(n);try{r=i(e)}catch(a){if(a.code==="ENOENT")return{srcStat:s,destStat:null};throw a}return{srcStat:s,destStat:r}}o(iM,"getStatsSync");async function sM(n,e,t,r){let{srcStat:i,destStat:s}=await nM(n,e,r);if(s){if(dl(i,s)){let a=Gt.basename(n),c=Gt.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&N1(n,e))throw new Error(id(n,e,t));return{srcStat:i,destStat:s}}o(sM,"checkPaths");function aM(n,e,t,r){let{srcStat:i,destStat:s}=iM(n,e,r);if(s){if(dl(i,s)){let a=Gt.basename(n),c=Gt.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&N1(n,e))throw new Error(id(n,e,t));return{srcStat:i,destStat:s}}o(aM,"checkPathsSync");async function QE(n,e,t,r){let i=Gt.resolve(Gt.dirname(n)),s=Gt.resolve(Gt.dirname(t));if(s===i||s===Gt.parse(s).root)return;let a;try{a=await Ho.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(dl(e,a))throw new Error(id(n,t,r));return QE(n,e,s,r)}o(QE,"checkParentPaths");function YE(n,e,t,r){let i=Gt.resolve(Gt.dirname(n)),s=Gt.resolve(Gt.dirname(t));if(s===i||s===Gt.parse(s).root)return;let a;try{a=Ho.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(dl(e,a))throw new Error(id(n,t,r));return YE(n,e,s,r)}o(YE,"checkParentPathsSync");function dl(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}o(dl,"areIdentical");function N1(n,e){let t=Gt.resolve(n).split(Gt.sep).filter(i=>i),r=Gt.resolve(e).split(Gt.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}o(N1,"isSrcSubdir");function id(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}o(id,"errMsg");KE.exports={checkPaths:zE(sM),checkPathsSync:aM,checkParentPaths:zE(QE),checkParentPathsSync:YE,isSrcSubdir:N1,areIdentical:dl}});var JE=v((oK,XE)=>{"use strict";async function oM(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}o(oM,"asyncIteratorConcurrentProcess");XE.exports={asyncIteratorConcurrentProcess:oM}});var nT=v((lK,rT)=>{"use strict";var _r=Lr(),pl=require("path"),{mkdirs:cM}=ni(),{pathExists:lM}=xs(),{utimesMillis:uM}=D1(),ml=xa(),{asyncIteratorConcurrentProcess:fM}=JE();async function hM(n,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
385
385
 
386
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await ml.checkPaths(n,e,"copy",t);if(await ml.checkParentPaths(n,r,e,"copy"),!await eT(n,e,t))return;let a=pl.dirname(e);await lM(a)||await cM(a),await tT(i,n,e,t)}o(hM,"copy");async function eT(n,e,t){return t.filter?t.filter(n,e):!0}o(eT,"runFilter");async function tT(n,e,t,r){let s=await(r.dereference?vr.stat:vr.lstat)(e);if(s.isDirectory())return gM(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return dM(s,n,e,t,r);if(s.isSymbolicLink())return yM(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(tT,"getStatsAndPerformCopy");async function dM(n,e,t,r,i){if(!e)return ZE(n,t,r,i);if(i.overwrite)return await vr.unlink(r),ZE(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}o(dM,"onFile");async function ZE(n,e,t,r){if(await vr.copyFile(e,t),r.preserveTimestamps){pM(n.mode)&&await mM(t,n.mode);let i=await vr.stat(e);await uM(t,i.atime,i.mtime)}return vr.chmod(t,n.mode)}o(ZE,"copyFile");function pM(n){return(n&128)===0}o(pM,"fileIsNotWritable");function mM(n,e){return vr.chmod(n,e|128)}o(mM,"makeFileWritable");async function gM(n,e,t,r,i){e||await vr.mkdir(r),await fM(await vr.opendir(t),async s=>{let a=pl.join(t,s.name),c=pl.join(r,s.name);if(await eT(a,c,i)){let{destStat:u}=await ml.checkPaths(a,c,"copy",i);await tT(u,a,c,i)}}),e||await vr.chmod(r,n.mode)}o(gM,"onDir");async function yM(n,e,t,r){let i=await vr.readlink(e);if(r.dereference&&(i=pl.resolve(process.cwd(),i)),!n)return vr.symlink(i,t);let s=null;try{s=await vr.readlink(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return vr.symlink(i,t);throw a}if(r.dereference&&(s=pl.resolve(process.cwd(),s)),ml.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(ml.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await vr.unlink(t),vr.symlink(i,t)}o(yM,"onLink");rT.exports=hM});var cT=v((fK,oT)=>{"use strict";var Mr=Go(),gl=require("path"),vM=ri().mkdirsSync,_M=D1().utimesMillisSync,yl=xa();function SM(n,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
386
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await ml.checkPaths(n,e,"copy",t);if(await ml.checkParentPaths(n,r,e,"copy"),!await eT(n,e,t))return;let a=pl.dirname(e);await lM(a)||await cM(a),await tT(i,n,e,t)}o(hM,"copy");async function eT(n,e,t){return t.filter?t.filter(n,e):!0}o(eT,"runFilter");async function tT(n,e,t,r){let s=await(r.dereference?_r.stat:_r.lstat)(e);if(s.isDirectory())return gM(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return dM(s,n,e,t,r);if(s.isSymbolicLink())return yM(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(tT,"getStatsAndPerformCopy");async function dM(n,e,t,r,i){if(!e)return ZE(n,t,r,i);if(i.overwrite)return await _r.unlink(r),ZE(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}o(dM,"onFile");async function ZE(n,e,t,r){if(await _r.copyFile(e,t),r.preserveTimestamps){pM(n.mode)&&await mM(t,n.mode);let i=await _r.stat(e);await uM(t,i.atime,i.mtime)}return _r.chmod(t,n.mode)}o(ZE,"copyFile");function pM(n){return(n&128)===0}o(pM,"fileIsNotWritable");function mM(n,e){return _r.chmod(n,e|128)}o(mM,"makeFileWritable");async function gM(n,e,t,r,i){e||await _r.mkdir(r),await fM(await _r.opendir(t),async s=>{let a=pl.join(t,s.name),c=pl.join(r,s.name);if(await eT(a,c,i)){let{destStat:u}=await ml.checkPaths(a,c,"copy",i);await tT(u,a,c,i)}}),e||await _r.chmod(r,n.mode)}o(gM,"onDir");async function yM(n,e,t,r){let i=await _r.readlink(e);if(r.dereference&&(i=pl.resolve(process.cwd(),i)),!n)return _r.symlink(i,t);let s=null;try{s=await _r.readlink(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return _r.symlink(i,t);throw a}if(r.dereference&&(s=pl.resolve(process.cwd(),s)),ml.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(ml.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await _r.unlink(t),_r.symlink(i,t)}o(yM,"onLink");rT.exports=hM});var cT=v((fK,oT)=>{"use strict";var Mr=Go(),gl=require("path"),vM=ni().mkdirsSync,_M=D1().utimesMillisSync,yl=xa();function SM(n,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
387
387
 
388
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=yl.checkPathsSync(n,e,"copy",t);if(yl.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=gl.dirname(e);return Mr.existsSync(s)||vM(s),iT(i,n,e,t)}o(SM,"copySync");function iT(n,e,t,r){let s=(r.dereference?Mr.statSync:Mr.lstatSync)(e);if(s.isDirectory())return CM(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return bM(s,n,e,t,r);if(s.isSymbolicLink())return PM(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(iT,"getStats");function bM(n,e,t,r,i){return e?wM(n,t,r,i):sT(n,t,r,i)}o(bM,"onFile");function wM(n,e,t,r){if(r.overwrite)return Mr.unlinkSync(t),sT(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}o(wM,"mayCopyFile");function sT(n,e,t,r){return Mr.copyFileSync(e,t),r.preserveTimestamps&&EM(n.mode,e,t),L1(t,n.mode)}o(sT,"copyFile");function EM(n,e,t){return TM(n)&&xM(t,n),AM(e,t)}o(EM,"handleTimestamps");function TM(n){return(n&128)===0}o(TM,"fileIsNotWritable");function xM(n,e){return L1(n,e|128)}o(xM,"makeFileWritable");function L1(n,e){return Mr.chmodSync(n,e)}o(L1,"setDestMode");function AM(n,e){let t=Mr.statSync(n);return _M(e,t.atime,t.mtime)}o(AM,"setDestTimestamps");function CM(n,e,t,r,i){return e?aT(t,r,i):IM(n.mode,t,r,i)}o(CM,"onDir");function IM(n,e,t,r){return Mr.mkdirSync(t),aT(e,t,r),L1(t,n)}o(IM,"mkDirAndCopy");function aT(n,e,t){let r=Mr.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)OM(i.name,n,e,t)}finally{r.closeSync()}}o(aT,"copyDir");function OM(n,e,t,r){let i=gl.join(e,n),s=gl.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:a}=yl.checkPathsSync(i,s,"copy",r);return iT(a,i,s,r)}o(OM,"copyDirItem");function PM(n,e,t,r){let i=Mr.readlinkSync(e);if(r.dereference&&(i=gl.resolve(process.cwd(),i)),n){let s;try{s=Mr.readlinkSync(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Mr.symlinkSync(i,t);throw a}if(r.dereference&&(s=gl.resolve(process.cwd(),s)),yl.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(yl.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return RM(i,t)}else return Mr.symlinkSync(i,t)}o(PM,"onLink");function RM(n,e){return Mr.unlinkSync(e),Mr.symlinkSync(n,e)}o(RM,"copyLink");oT.exports=SM});var sd=v((dK,lT)=>{"use strict";var FM=qt().fromPromise;lT.exports={copy:FM(nT()),copySync:cT()}});var vl=v((pK,fT)=>{"use strict";var uT=Go(),DM=qt().fromCallback;function NM(n,e){uT.rm(n,{recursive:!0,force:!0},e)}o(NM,"remove");function LM(n){uT.rmSync(n,{recursive:!0,force:!0})}o(LM,"removeSync");fT.exports={remove:DM(NM),removeSync:LM}});var _T=v((gK,vT)=>{"use strict";var MM=qt().fromPromise,pT=Lr(),mT=require("path"),gT=ri(),yT=vl(),hT=MM(o(async function(e){let t;try{t=await pT.readdir(e)}catch{return gT.mkdirs(e)}return Promise.all(t.map(r=>yT.remove(mT.join(e,r))))},"emptyDir"));function dT(n){let e;try{e=pT.readdirSync(n)}catch{return gT.mkdirsSync(n)}e.forEach(t=>{t=mT.join(n,t),yT.removeSync(t)})}o(dT,"emptyDirSync");vT.exports={emptyDirSync:dT,emptydirSync:dT,emptyDir:hT,emptydir:hT}});var ET=v((vK,wT)=>{"use strict";var kM=qt().fromPromise,ST=require("path"),rs=Lr(),bT=ri();async function jM(n){let e;try{e=await rs.stat(n)}catch{}if(e&&e.isFile())return;let t=ST.dirname(n),r=null;try{r=await rs.stat(t)}catch(i){if(i.code==="ENOENT"){await bT.mkdirs(t),await rs.writeFile(n,"");return}else throw i}r.isDirectory()?await rs.writeFile(n,""):await rs.readdir(t)}o(jM,"createFile");function $M(n){let e;try{e=rs.statSync(n)}catch{}if(e&&e.isFile())return;let t=ST.dirname(n);try{rs.statSync(t).isDirectory()||rs.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")bT.mkdirsSync(t);else throw r}rs.writeFileSync(n,"")}o($M,"createFileSync");wT.exports={createFile:kM(jM),createFileSync:$M}});var IT=v((SK,CT)=>{"use strict";var VM=qt().fromPromise,TT=require("path"),As=Lr(),xT=ri(),{pathExists:UM}=xs(),{areIdentical:AT}=xa();async function BM(n,e){let t;try{t=await As.lstat(e)}catch{}let r;try{r=await As.lstat(n)}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(t&&AT(r,t))return;let i=TT.dirname(e);await UM(i)||await xT.mkdirs(i),await As.link(n,e)}o(BM,"createLink");function qM(n,e){let t;try{t=As.lstatSync(e)}catch{}try{let s=As.lstatSync(n);if(t&&AT(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=TT.dirname(e);return As.existsSync(r)||xT.mkdirsSync(r),As.linkSync(n,e)}o(qM,"createLinkSync");CT.exports={createLink:VM(BM),createLinkSync:qM}});var PT=v((wK,OT)=>{"use strict";var Cs=require("path"),_l=Lr(),{pathExists:GM}=xs(),WM=qt().fromPromise;async function HM(n,e){if(Cs.isAbsolute(n)){try{await _l.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=Cs.dirname(e),r=Cs.join(t,n);if(await GM(r))return{toCwd:r,toDst:n};try{await _l.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:Cs.relative(t,n)}}o(HM,"symlinkPaths");function zM(n,e){if(Cs.isAbsolute(n)){if(!_l.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=Cs.dirname(e),r=Cs.join(t,n);if(_l.existsSync(r))return{toCwd:r,toDst:n};if(!_l.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:Cs.relative(t,n)}}o(zM,"symlinkPathsSync");OT.exports={symlinkPaths:WM(HM),symlinkPathsSync:zM}});var DT=v((TK,FT)=>{"use strict";var RT=Lr(),QM=qt().fromPromise;async function YM(n,e){if(e)return e;let t;try{t=await RT.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(YM,"symlinkType");function KM(n,e){if(e)return e;let t;try{t=RT.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(KM,"symlinkTypeSync");FT.exports={symlinkType:QM(YM),symlinkTypeSync:KM}});var kT=v((AK,MT)=>{"use strict";var XM=qt().fromPromise,NT=require("path"),Oi=Lr(),{mkdirs:JM,mkdirsSync:ZM}=ri(),{symlinkPaths:e7,symlinkPathsSync:t7}=PT(),{symlinkType:r7,symlinkTypeSync:n7}=DT(),{pathExists:i7}=xs(),{areIdentical:LT}=xa();async function s7(n,e,t){let r;try{r=await Oi.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([Oi.stat(n),Oi.stat(e)]);if(LT(c,l))return}let i=await e7(n,e);n=i.toDst;let s=await r7(i.toCwd,t),a=NT.dirname(e);return await i7(a)||await JM(a),Oi.symlink(n,e,s)}o(s7,"createSymlink");function a7(n,e,t){let r;try{r=Oi.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=Oi.statSync(n),l=Oi.statSync(e);if(LT(c,l))return}let i=t7(n,e);n=i.toDst,t=n7(i.toCwd,t);let s=NT.dirname(e);return Oi.existsSync(s)||ZM(s),Oi.symlinkSync(n,e,t)}o(a7,"createSymlinkSync");MT.exports={createSymlink:XM(s7),createSymlinkSync:a7}});var WT=v((IK,GT)=>{"use strict";var{createFile:jT,createFileSync:$T}=ET(),{createLink:VT,createLinkSync:UT}=IT(),{createSymlink:BT,createSymlinkSync:qT}=kT();GT.exports={createFile:jT,createFileSync:$T,ensureFile:jT,ensureFileSync:$T,createLink:VT,createLinkSync:UT,ensureLink:VT,ensureLinkSync:UT,createSymlink:BT,createSymlinkSync:qT,ensureSymlink:BT,ensureSymlinkSync:qT}});var ad=v((OK,HT)=>{function o7(n,{EOL:e=`
389
- `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}o(o7,"stringify");function c7(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}o(c7,"stripBom");HT.exports={stringify:o7,stripBom:c7}});var KT=v((RK,YT)=>{var zo;try{zo=Go()}catch{zo=require("fs")}var od=qt(),{stringify:zT,stripBom:QT}=ad();async function l7(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||zo,r="throws"in e?e.throws:!0,i=await od.fromCallback(t.readFile)(n,e);i=QT(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(a){if(r)throw a.message=`${n}: ${a.message}`,a;return null}return s}o(l7,"_readFile");var u7=od.fromPromise(l7);function f7(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||zo,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=QT(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}o(f7,"readFileSync");async function h7(n,e,t={}){let r=t.fs||zo,i=zT(e,t);await od.fromCallback(r.writeFile)(n,i,t)}o(h7,"_writeFile");var d7=od.fromPromise(h7);function p7(n,e,t={}){let r=t.fs||zo,i=zT(e,t);return r.writeFileSync(n,i,t)}o(p7,"writeFileSync");YT.exports={readFile:u7,readFileSync:f7,writeFile:d7,writeFileSync:p7}});var JT=v((DK,XT)=>{"use strict";var cd=KT();XT.exports={readJson:cd.readFile,readJsonSync:cd.readFileSync,writeJson:cd.writeFile,writeJsonSync:cd.writeFileSync}});var ld=v((NK,t3)=>{"use strict";var m7=qt().fromPromise,M1=Lr(),ZT=require("path"),e3=ri(),g7=xs().pathExists;async function y7(n,e,t="utf-8"){let r=ZT.dirname(n);return await g7(r)||await e3.mkdirs(r),M1.writeFile(n,e,t)}o(y7,"outputFile");function v7(n,...e){let t=ZT.dirname(n);M1.existsSync(t)||e3.mkdirsSync(t),M1.writeFileSync(n,...e)}o(v7,"outputFileSync");t3.exports={outputFile:m7(y7),outputFileSync:v7}});var n3=v((MK,r3)=>{"use strict";var{stringify:_7}=ad(),{outputFile:S7}=ld();async function b7(n,e,t={}){let r=_7(e,t);await S7(n,r,t)}o(b7,"outputJson");r3.exports=b7});var s3=v((jK,i3)=>{"use strict";var{stringify:w7}=ad(),{outputFileSync:E7}=ld();function T7(n,e,t){let r=w7(e,t);E7(n,r,t)}o(T7,"outputJsonSync");i3.exports=T7});var o3=v((VK,a3)=>{"use strict";var x7=qt().fromPromise,kr=JT();kr.outputJson=x7(n3());kr.outputJsonSync=s3();kr.outputJSON=kr.outputJson;kr.outputJSONSync=kr.outputJsonSync;kr.writeJSON=kr.writeJson;kr.writeJSONSync=kr.writeJsonSync;kr.readJSON=kr.readJson;kr.readJSONSync=kr.readJsonSync;a3.exports=kr});var h3=v((UK,f3)=>{"use strict";var A7=Lr(),c3=require("path"),{copy:C7}=sd(),{remove:u3}=vl(),{mkdirp:I7}=ri(),{pathExists:O7}=xs(),l3=xa();async function P7(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await l3.checkPaths(n,e,"move",t);await l3.checkParentPaths(n,i,e,"move");let a=c3.dirname(e);return c3.parse(a).root!==a&&await I7(a),R7(n,e,r,s)}o(P7,"move");async function R7(n,e,t,r){if(!r){if(t)await u3(e);else if(await O7(e))throw new Error("dest already exists.")}try{await A7.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await F7(n,e,t)}}o(R7,"doRename");async function F7(n,e,t){return await C7(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),u3(n)}o(F7,"moveAcrossDevice");f3.exports=P7});var y3=v((qK,g3)=>{"use strict";var p3=Go(),j1=require("path"),D7=sd().copySync,m3=vl().removeSync,N7=ri().mkdirpSync,d3=xa();function L7(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=d3.checkPathsSync(n,e,"move",t);return d3.checkParentPathsSync(n,i,e,"move"),M7(e)||N7(j1.dirname(e)),k7(n,e,r,s)}o(L7,"moveSync");function M7(n){let e=j1.dirname(n);return j1.parse(e).root===e}o(M7,"isParentRoot");function k7(n,e,t,r){if(r)return k1(n,e,t);if(t)return m3(e),k1(n,e,t);if(p3.existsSync(e))throw new Error("dest already exists.");return k1(n,e,t)}o(k7,"doRename");function k1(n,e,t){try{p3.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return j7(n,e,t)}}o(k1,"rename");function j7(n,e,t){return D7(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),m3(n)}o(j7,"moveAcrossDevice");g3.exports=L7});var _3=v((WK,v3)=>{"use strict";var $7=qt().fromPromise;v3.exports={move:$7(h3()),moveSync:y3()}});var Is=v((HK,S3)=>{"use strict";S3.exports={...Lr(),...sd(),..._T(),...WT(),...o3(),...ri(),..._3(),...ld(),...xs(),...vl()}});var fA=v((bte,uA)=>{"use strict";uA.exports=cA;function cA(n,e,t){n instanceof RegExp&&(n=oA(n,t)),e instanceof RegExp&&(e=oA(e,t));var r=lA(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}o(cA,"balanced");function oA(n,e){var t=e.match(n);return t?t[0]:null}o(oA,"maybeMatch");cA.range=lA;function lA(n,e,t){var r,i,s,a,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,a=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,a])}return c}o(lA,"range")});var _A=v((Ete,vA)=>{var hA=fA();vA.exports=y$;var dA="\0SLASH"+Math.random()+"\0",pA="\0OPEN"+Math.random()+"\0",P2="\0CLOSE"+Math.random()+"\0",mA="\0COMMA"+Math.random()+"\0",gA="\0PERIOD"+Math.random()+"\0";function O2(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}o(O2,"numeric");function m$(n){return n.split("\\\\").join(dA).split("\\{").join(pA).split("\\}").join(P2).split("\\,").join(mA).split("\\.").join(gA)}o(m$,"escapeBraces");function g$(n){return n.split(dA).join("\\").split(pA).join("{").split(P2).join("}").split(mA).join(",").split(gA).join(".")}o(g$,"unescapeBraces");function yA(n){if(!n)return[""];var e=[],t=hA("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=yA(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(yA,"parseCommaParts");function y$(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),jl(m$(n),!0).map(g$)):[]}o(y$,"expandTop");function v$(n){return"{"+n+"}"}o(v$,"embrace");function _$(n){return/^-?0\d/.test(n)}o(_$,"isPadded");function S$(n,e){return n<=e}o(S$,"lte");function b$(n,e){return n>=e}o(b$,"gte");function jl(n,e){var t=[],r=hA("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?jl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<s.length;a++){var c=i+"{"+r.body+"}"+s[a];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,h=r.body.indexOf(",")>=0;if(!f&&!h)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+P2+r.post,jl(n)):[n];var d;if(f)d=r.body.split(/\.\./);else if(d=yA(r.body),d.length===1&&(d=jl(d[0],!1).map(v$),d.length===1))return s.map(function(K){return r.pre+d[0]+K});var p;if(f){var _=O2(d[0]),S=O2(d[1]),E=Math.max(d[0].length,d[1].length),A=d.length==3?Math.abs(O2(d[2])):1,C=S$,k=S<_;k&&(A*=-1,C=b$);var G=d.some(_$);p=[];for(var Q=_;C(Q,S);Q+=A){var H;if(u)H=String.fromCharCode(Q),H==="\\"&&(H="");else if(H=String(Q),G){var re=E-H.length;if(re>0){var Ie=new Array(re+1).join("0");Q<0?H="-"+Ie+H.slice(1):H=Ie+H}}p.push(H)}}else{p=[];for(var N=0;N<d.length;N++)p.push.apply(p,jl(d[N],!1))}for(var N=0;N<p.length;N++)for(var a=0;a<s.length;a++){var c=i+p[N]+s[a];(!e||f||c)&&t.push(c)}}return t}o(jl,"expand")});var Lse=te(Ou());var l_=te(c_(),1),{program:dU,createCommand:pU,createArgument:mU,createOption:gU,CommanderError:yU,InvalidArgumentError:vU,InvalidOptionArgumentError:_U,Command:ut,Argument:SU,Option:bU,Help:wU}=l_.default;var kl=require("fs"),I2=require("path"),Vt=te(zr());var $t=te(Is()),Wt=te(require("path"));function M3(n){return typeof n>"u"||n===null}o(M3,"isNothing");function V7(n){return typeof n=="object"&&n!==null}o(V7,"isObject");function U7(n){return Array.isArray(n)?n:M3(n)?[]:[n]}o(U7,"toArray");function B7(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}o(B7,"extend");function q7(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}o(q7,"repeat");function G7(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}o(G7,"isNegativeZero");var W7=M3,H7=V7,z7=U7,Q7=q7,Y7=G7,K7=B7,jt={isNothing:W7,isObject:H7,toArray:z7,repeat:Q7,isNegativeZero:Y7,extend:K7};function k3(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
388
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=yl.checkPathsSync(n,e,"copy",t);if(yl.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=gl.dirname(e);return Mr.existsSync(s)||vM(s),iT(i,n,e,t)}o(SM,"copySync");function iT(n,e,t,r){let s=(r.dereference?Mr.statSync:Mr.lstatSync)(e);if(s.isDirectory())return CM(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return bM(s,n,e,t,r);if(s.isSymbolicLink())return PM(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(iT,"getStats");function bM(n,e,t,r,i){return e?wM(n,t,r,i):sT(n,t,r,i)}o(bM,"onFile");function wM(n,e,t,r){if(r.overwrite)return Mr.unlinkSync(t),sT(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}o(wM,"mayCopyFile");function sT(n,e,t,r){return Mr.copyFileSync(e,t),r.preserveTimestamps&&EM(n.mode,e,t),L1(t,n.mode)}o(sT,"copyFile");function EM(n,e,t){return TM(n)&&xM(t,n),AM(e,t)}o(EM,"handleTimestamps");function TM(n){return(n&128)===0}o(TM,"fileIsNotWritable");function xM(n,e){return L1(n,e|128)}o(xM,"makeFileWritable");function L1(n,e){return Mr.chmodSync(n,e)}o(L1,"setDestMode");function AM(n,e){let t=Mr.statSync(n);return _M(e,t.atime,t.mtime)}o(AM,"setDestTimestamps");function CM(n,e,t,r,i){return e?aT(t,r,i):IM(n.mode,t,r,i)}o(CM,"onDir");function IM(n,e,t,r){return Mr.mkdirSync(t),aT(e,t,r),L1(t,n)}o(IM,"mkDirAndCopy");function aT(n,e,t){let r=Mr.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)OM(i.name,n,e,t)}finally{r.closeSync()}}o(aT,"copyDir");function OM(n,e,t,r){let i=gl.join(e,n),s=gl.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:a}=yl.checkPathsSync(i,s,"copy",r);return iT(a,i,s,r)}o(OM,"copyDirItem");function PM(n,e,t,r){let i=Mr.readlinkSync(e);if(r.dereference&&(i=gl.resolve(process.cwd(),i)),n){let s;try{s=Mr.readlinkSync(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Mr.symlinkSync(i,t);throw a}if(r.dereference&&(s=gl.resolve(process.cwd(),s)),yl.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(yl.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return RM(i,t)}else return Mr.symlinkSync(i,t)}o(PM,"onLink");function RM(n,e){return Mr.unlinkSync(e),Mr.symlinkSync(n,e)}o(RM,"copyLink");oT.exports=SM});var sd=v((dK,lT)=>{"use strict";var FM=qt().fromPromise;lT.exports={copy:FM(nT()),copySync:cT()}});var vl=v((pK,fT)=>{"use strict";var uT=Go(),DM=qt().fromCallback;function NM(n,e){uT.rm(n,{recursive:!0,force:!0},e)}o(NM,"remove");function LM(n){uT.rmSync(n,{recursive:!0,force:!0})}o(LM,"removeSync");fT.exports={remove:DM(NM),removeSync:LM}});var _T=v((gK,vT)=>{"use strict";var MM=qt().fromPromise,pT=Lr(),mT=require("path"),gT=ni(),yT=vl(),hT=MM(o(async function(e){let t;try{t=await pT.readdir(e)}catch{return gT.mkdirs(e)}return Promise.all(t.map(r=>yT.remove(mT.join(e,r))))},"emptyDir"));function dT(n){let e;try{e=pT.readdirSync(n)}catch{return gT.mkdirsSync(n)}e.forEach(t=>{t=mT.join(n,t),yT.removeSync(t)})}o(dT,"emptyDirSync");vT.exports={emptyDirSync:dT,emptydirSync:dT,emptyDir:hT,emptydir:hT}});var ET=v((vK,wT)=>{"use strict";var kM=qt().fromPromise,ST=require("path"),rs=Lr(),bT=ni();async function jM(n){let e;try{e=await rs.stat(n)}catch{}if(e&&e.isFile())return;let t=ST.dirname(n),r=null;try{r=await rs.stat(t)}catch(i){if(i.code==="ENOENT"){await bT.mkdirs(t),await rs.writeFile(n,"");return}else throw i}r.isDirectory()?await rs.writeFile(n,""):await rs.readdir(t)}o(jM,"createFile");function $M(n){let e;try{e=rs.statSync(n)}catch{}if(e&&e.isFile())return;let t=ST.dirname(n);try{rs.statSync(t).isDirectory()||rs.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")bT.mkdirsSync(t);else throw r}rs.writeFileSync(n,"")}o($M,"createFileSync");wT.exports={createFile:kM(jM),createFileSync:$M}});var IT=v((SK,CT)=>{"use strict";var VM=qt().fromPromise,TT=require("path"),As=Lr(),xT=ni(),{pathExists:UM}=xs(),{areIdentical:AT}=xa();async function BM(n,e){let t;try{t=await As.lstat(e)}catch{}let r;try{r=await As.lstat(n)}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(t&&AT(r,t))return;let i=TT.dirname(e);await UM(i)||await xT.mkdirs(i),await As.link(n,e)}o(BM,"createLink");function qM(n,e){let t;try{t=As.lstatSync(e)}catch{}try{let s=As.lstatSync(n);if(t&&AT(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=TT.dirname(e);return As.existsSync(r)||xT.mkdirsSync(r),As.linkSync(n,e)}o(qM,"createLinkSync");CT.exports={createLink:VM(BM),createLinkSync:qM}});var PT=v((wK,OT)=>{"use strict";var Cs=require("path"),_l=Lr(),{pathExists:GM}=xs(),WM=qt().fromPromise;async function HM(n,e){if(Cs.isAbsolute(n)){try{await _l.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=Cs.dirname(e),r=Cs.join(t,n);if(await GM(r))return{toCwd:r,toDst:n};try{await _l.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:Cs.relative(t,n)}}o(HM,"symlinkPaths");function zM(n,e){if(Cs.isAbsolute(n)){if(!_l.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=Cs.dirname(e),r=Cs.join(t,n);if(_l.existsSync(r))return{toCwd:r,toDst:n};if(!_l.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:Cs.relative(t,n)}}o(zM,"symlinkPathsSync");OT.exports={symlinkPaths:WM(HM),symlinkPathsSync:zM}});var DT=v((TK,FT)=>{"use strict";var RT=Lr(),QM=qt().fromPromise;async function YM(n,e){if(e)return e;let t;try{t=await RT.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(YM,"symlinkType");function KM(n,e){if(e)return e;let t;try{t=RT.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(KM,"symlinkTypeSync");FT.exports={symlinkType:QM(YM),symlinkTypeSync:KM}});var kT=v((AK,MT)=>{"use strict";var XM=qt().fromPromise,NT=require("path"),Oi=Lr(),{mkdirs:JM,mkdirsSync:ZM}=ni(),{symlinkPaths:e7,symlinkPathsSync:t7}=PT(),{symlinkType:r7,symlinkTypeSync:n7}=DT(),{pathExists:i7}=xs(),{areIdentical:LT}=xa();async function s7(n,e,t){let r;try{r=await Oi.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([Oi.stat(n),Oi.stat(e)]);if(LT(c,l))return}let i=await e7(n,e);n=i.toDst;let s=await r7(i.toCwd,t),a=NT.dirname(e);return await i7(a)||await JM(a),Oi.symlink(n,e,s)}o(s7,"createSymlink");function a7(n,e,t){let r;try{r=Oi.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=Oi.statSync(n),l=Oi.statSync(e);if(LT(c,l))return}let i=t7(n,e);n=i.toDst,t=n7(i.toCwd,t);let s=NT.dirname(e);return Oi.existsSync(s)||ZM(s),Oi.symlinkSync(n,e,t)}o(a7,"createSymlinkSync");MT.exports={createSymlink:XM(s7),createSymlinkSync:a7}});var WT=v((IK,GT)=>{"use strict";var{createFile:jT,createFileSync:$T}=ET(),{createLink:VT,createLinkSync:UT}=IT(),{createSymlink:BT,createSymlinkSync:qT}=kT();GT.exports={createFile:jT,createFileSync:$T,ensureFile:jT,ensureFileSync:$T,createLink:VT,createLinkSync:UT,ensureLink:VT,ensureLinkSync:UT,createSymlink:BT,createSymlinkSync:qT,ensureSymlink:BT,ensureSymlinkSync:qT}});var ad=v((OK,HT)=>{function o7(n,{EOL:e=`
389
+ `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}o(o7,"stringify");function c7(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}o(c7,"stripBom");HT.exports={stringify:o7,stripBom:c7}});var KT=v((RK,YT)=>{var zo;try{zo=Go()}catch{zo=require("fs")}var od=qt(),{stringify:zT,stripBom:QT}=ad();async function l7(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||zo,r="throws"in e?e.throws:!0,i=await od.fromCallback(t.readFile)(n,e);i=QT(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(a){if(r)throw a.message=`${n}: ${a.message}`,a;return null}return s}o(l7,"_readFile");var u7=od.fromPromise(l7);function f7(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||zo,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=QT(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}o(f7,"readFileSync");async function h7(n,e,t={}){let r=t.fs||zo,i=zT(e,t);await od.fromCallback(r.writeFile)(n,i,t)}o(h7,"_writeFile");var d7=od.fromPromise(h7);function p7(n,e,t={}){let r=t.fs||zo,i=zT(e,t);return r.writeFileSync(n,i,t)}o(p7,"writeFileSync");YT.exports={readFile:u7,readFileSync:f7,writeFile:d7,writeFileSync:p7}});var JT=v((DK,XT)=>{"use strict";var cd=KT();XT.exports={readJson:cd.readFile,readJsonSync:cd.readFileSync,writeJson:cd.writeFile,writeJsonSync:cd.writeFileSync}});var ld=v((NK,t3)=>{"use strict";var m7=qt().fromPromise,M1=Lr(),ZT=require("path"),e3=ni(),g7=xs().pathExists;async function y7(n,e,t="utf-8"){let r=ZT.dirname(n);return await g7(r)||await e3.mkdirs(r),M1.writeFile(n,e,t)}o(y7,"outputFile");function v7(n,...e){let t=ZT.dirname(n);M1.existsSync(t)||e3.mkdirsSync(t),M1.writeFileSync(n,...e)}o(v7,"outputFileSync");t3.exports={outputFile:m7(y7),outputFileSync:v7}});var n3=v((MK,r3)=>{"use strict";var{stringify:_7}=ad(),{outputFile:S7}=ld();async function b7(n,e,t={}){let r=_7(e,t);await S7(n,r,t)}o(b7,"outputJson");r3.exports=b7});var s3=v((jK,i3)=>{"use strict";var{stringify:w7}=ad(),{outputFileSync:E7}=ld();function T7(n,e,t){let r=w7(e,t);E7(n,r,t)}o(T7,"outputJsonSync");i3.exports=T7});var o3=v((VK,a3)=>{"use strict";var x7=qt().fromPromise,kr=JT();kr.outputJson=x7(n3());kr.outputJsonSync=s3();kr.outputJSON=kr.outputJson;kr.outputJSONSync=kr.outputJsonSync;kr.writeJSON=kr.writeJson;kr.writeJSONSync=kr.writeJsonSync;kr.readJSON=kr.readJson;kr.readJSONSync=kr.readJsonSync;a3.exports=kr});var h3=v((UK,f3)=>{"use strict";var A7=Lr(),c3=require("path"),{copy:C7}=sd(),{remove:u3}=vl(),{mkdirp:I7}=ni(),{pathExists:O7}=xs(),l3=xa();async function P7(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await l3.checkPaths(n,e,"move",t);await l3.checkParentPaths(n,i,e,"move");let a=c3.dirname(e);return c3.parse(a).root!==a&&await I7(a),R7(n,e,r,s)}o(P7,"move");async function R7(n,e,t,r){if(!r){if(t)await u3(e);else if(await O7(e))throw new Error("dest already exists.")}try{await A7.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await F7(n,e,t)}}o(R7,"doRename");async function F7(n,e,t){return await C7(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),u3(n)}o(F7,"moveAcrossDevice");f3.exports=P7});var y3=v((qK,g3)=>{"use strict";var p3=Go(),j1=require("path"),D7=sd().copySync,m3=vl().removeSync,N7=ni().mkdirpSync,d3=xa();function L7(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=d3.checkPathsSync(n,e,"move",t);return d3.checkParentPathsSync(n,i,e,"move"),M7(e)||N7(j1.dirname(e)),k7(n,e,r,s)}o(L7,"moveSync");function M7(n){let e=j1.dirname(n);return j1.parse(e).root===e}o(M7,"isParentRoot");function k7(n,e,t,r){if(r)return k1(n,e,t);if(t)return m3(e),k1(n,e,t);if(p3.existsSync(e))throw new Error("dest already exists.");return k1(n,e,t)}o(k7,"doRename");function k1(n,e,t){try{p3.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return j7(n,e,t)}}o(k1,"rename");function j7(n,e,t){return D7(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),m3(n)}o(j7,"moveAcrossDevice");g3.exports=L7});var _3=v((WK,v3)=>{"use strict";var $7=qt().fromPromise;v3.exports={move:$7(h3()),moveSync:y3()}});var Is=v((HK,S3)=>{"use strict";S3.exports={...Lr(),...sd(),..._T(),...WT(),...o3(),...ni(),..._3(),...ld(),...xs(),...vl()}});var fA=v((bte,uA)=>{"use strict";uA.exports=cA;function cA(n,e,t){n instanceof RegExp&&(n=oA(n,t)),e instanceof RegExp&&(e=oA(e,t));var r=lA(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}o(cA,"balanced");function oA(n,e){var t=e.match(n);return t?t[0]:null}o(oA,"maybeMatch");cA.range=lA;function lA(n,e,t){var r,i,s,a,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,a=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,a])}return c}o(lA,"range")});var _A=v((Ete,vA)=>{var hA=fA();vA.exports=y$;var dA="\0SLASH"+Math.random()+"\0",pA="\0OPEN"+Math.random()+"\0",P2="\0CLOSE"+Math.random()+"\0",mA="\0COMMA"+Math.random()+"\0",gA="\0PERIOD"+Math.random()+"\0";function O2(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}o(O2,"numeric");function m$(n){return n.split("\\\\").join(dA).split("\\{").join(pA).split("\\}").join(P2).split("\\,").join(mA).split("\\.").join(gA)}o(m$,"escapeBraces");function g$(n){return n.split(dA).join("\\").split(pA).join("{").split(P2).join("}").split(mA).join(",").split(gA).join(".")}o(g$,"unescapeBraces");function yA(n){if(!n)return[""];var e=[],t=hA("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=yA(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(yA,"parseCommaParts");function y$(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),jl(m$(n),!0).map(g$)):[]}o(y$,"expandTop");function v$(n){return"{"+n+"}"}o(v$,"embrace");function _$(n){return/^-?0\d/.test(n)}o(_$,"isPadded");function S$(n,e){return n<=e}o(S$,"lte");function b$(n,e){return n>=e}o(b$,"gte");function jl(n,e){var t=[],r=hA("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?jl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<s.length;a++){var c=i+"{"+r.body+"}"+s[a];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,h=r.body.indexOf(",")>=0;if(!f&&!h)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+P2+r.post,jl(n)):[n];var d;if(f)d=r.body.split(/\.\./);else if(d=yA(r.body),d.length===1&&(d=jl(d[0],!1).map(v$),d.length===1))return s.map(function(K){return r.pre+d[0]+K});var p;if(f){var _=O2(d[0]),S=O2(d[1]),E=Math.max(d[0].length,d[1].length),A=d.length==3?Math.abs(O2(d[2])):1,C=S$,k=S<_;k&&(A*=-1,C=b$);var G=d.some(_$);p=[];for(var Q=_;C(Q,S);Q+=A){var H;if(u)H=String.fromCharCode(Q),H==="\\"&&(H="");else if(H=String(Q),G){var re=E-H.length;if(re>0){var Ie=new Array(re+1).join("0");Q<0?H="-"+Ie+H.slice(1):H=Ie+H}}p.push(H)}}else{p=[];for(var N=0;N<d.length;N++)p.push.apply(p,jl(d[N],!1))}for(var N=0;N<p.length;N++)for(var a=0;a<s.length;a++){var c=i+p[N]+s[a];(!e||f||c)&&t.push(c)}}return t}o(jl,"expand")});var Lse=te(Ou());var l_=te(c_(),1),{program:dU,createCommand:pU,createArgument:mU,createOption:gU,CommanderError:yU,InvalidArgumentError:vU,InvalidOptionArgumentError:_U,Command:ut,Argument:SU,Option:bU,Help:wU}=l_.default;var kl=require("fs"),I2=require("path"),Vt=te(zr());var $t=te(Is()),Wt=te(require("path"));function M3(n){return typeof n>"u"||n===null}o(M3,"isNothing");function V7(n){return typeof n=="object"&&n!==null}o(V7,"isObject");function U7(n){return Array.isArray(n)?n:M3(n)?[]:[n]}o(U7,"toArray");function B7(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}o(B7,"extend");function q7(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}o(q7,"repeat");function G7(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}o(G7,"isNegativeZero");var W7=M3,H7=V7,z7=U7,Q7=q7,Y7=G7,K7=B7,jt={isNothing:W7,isObject:H7,toArray:z7,repeat:Q7,isNegativeZero:Y7,extend:K7};function k3(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
390
390
 
391
391
  `+n.mark.snippet),r+" "+t):r}o(k3,"formatError");function bl(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=k3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}o(bl,"YAMLException$1");bl.prototype=Object.create(Error.prototype);bl.prototype.constructor=bl;bl.prototype.toString=o(function(e){return this.name+": "+k3(this,e)},"toString");var jr=bl;function $1(n,e,t,r,i){var s="",a="",c=Math.floor(i/2)-1;return r-e>c&&(s=" ... ",e=r-c+s.length),t-r>c&&(a=" ...",t=r+c-a.length),{str:s+n.slice(e,t).replace(/\t/g,"\u2192")+a,pos:r-e+s.length}}o($1,"getLine");function V1(n,e){return jt.repeat(" ",e-n.length)+n}o(V1,"padStart");function X7(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=t.exec(n.buffer);)i.push(s.index),r.push(s.index+s[0].length),n.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c="",l,u,f=Math.min(n.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=$1(n.buffer,r[a-l],i[a-l],n.position-(r[a]-r[a-l]),h),c=jt.repeat(" ",e.indent)+V1((n.line-l+1).toString(),f)+" | "+u.str+`
392
392
  `+c;for(u=$1(n.buffer,r[a],i[a],n.position,h),c+=jt.repeat(" ",e.indent)+V1((n.line+1).toString(),f)+" | "+u.str+`
@@ -402,7 +402,7 @@ GFS4: `),console.error(n)},"debug"));bt[ar]||(DE=global[ar]||[],LE(bt,DE),bt.clo
402
402
  `,l+1)):l===0?s&&(n.result+=" "):n.result+=jt.repeat(`
403
403
  `,l):n.result+=jt.repeat(`
404
404
  `,s?1+l:l),s=!0,a=!0,l=0,t=n.position;!Pi(h)&&h!==0;)h=n.input.charCodeAt(++n.position);Os(n,t,n.position,!1)}return!0}o(Zk,"readBlockScalar");function C3(n,e){var t,r=n.tag,i=n.anchor,s=[],a,c=!1,l;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=s),l=n.input.charCodeAt(n.position);l!==0&&(n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,ee(n,"tab characters must not be used in indentation")),!(l!==45||(a=n.input.charCodeAt(n.position+1),!Qr(a))));){if(c=!0,n.position++,Nt(n,!0,-1)&&n.lineIndent<=e){s.push(null),l=n.input.charCodeAt(n.position);continue}if(t=n.line,Xo(n,e,ix,!1,!0),s.push(n.result),Nt(n,!0,-1),l=n.input.charCodeAt(n.position),(n.line===t||n.lineIndent>e)&&l!==0)ee(n,"bad indentation of a sequence entry");else if(n.lineIndent<e)break}return c?(n.tag=r,n.anchor=i,n.kind="sequence",n.result=s,!0):!1}o(C3,"readBlockSequence");function ej(n,e,t){var r,i,s,a,c,l,u=n.tag,f=n.anchor,h={},d=Object.create(null),p=null,_=null,S=null,E=!1,A=!1,C;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=h),C=n.input.charCodeAt(n.position);C!==0;){if(!E&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,ee(n,"tab characters must not be used in indentation")),r=n.input.charCodeAt(n.position+1),s=n.line,(C===63||C===58)&&Qr(r))C===63?(E&&(Ko(n,h,d,p,_,null,a,c,l),p=_=S=null),A=!0,E=!0,i=!0):E?(E=!1,i=!0):ee(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,C=r;else{if(a=n.line,c=n.lineStart,l=n.position,!Xo(n,t,nx,!1,!0))break;if(n.line===s){for(C=n.input.charCodeAt(n.position);Ca(C);)C=n.input.charCodeAt(++n.position);if(C===58)C=n.input.charCodeAt(++n.position),Qr(C)||ee(n,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Ko(n,h,d,p,_,null,a,c,l),p=_=S=null),A=!0,E=!1,i=!1,p=n.tag,_=n.result;else if(A)ee(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=u,n.anchor=f,!0}else if(A)ee(n,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.tag=u,n.anchor=f,!0}if((n.line===s||n.lineIndent>e)&&(E&&(a=n.line,c=n.lineStart,l=n.position),Xo(n,e,fd,!0,i)&&(E?_=n.result:S=n.result),E||(Ko(n,h,d,p,_,S,a,c,l),p=_=S=null),Nt(n,!0,-1),C=n.input.charCodeAt(n.position)),(n.line===s||n.lineIndent>e)&&C!==0)ee(n,"bad indentation of a mapping entry");else if(n.lineIndent<e)break}return E&&Ko(n,h,d,p,_,null,a,c,l),A&&(n.tag=u,n.anchor=f,n.kind="mapping",n.result=h),A}o(ej,"readBlockMapping");function tj(n){var e,t=!1,r=!1,i,s,a;if(a=n.input.charCodeAt(n.position),a!==33)return!1;if(n.tag!==null&&ee(n,"duplication of a tag property"),a=n.input.charCodeAt(++n.position),a===60?(t=!0,a=n.input.charCodeAt(++n.position)):a===33?(r=!0,i="!!",a=n.input.charCodeAt(++n.position)):i="!",e=n.position,t){do a=n.input.charCodeAt(++n.position);while(a!==0&&a!==62);n.position<n.length?(s=n.input.slice(e,n.position),a=n.input.charCodeAt(++n.position)):ee(n,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Qr(a);)a===33&&(r?ee(n,"tag suffix cannot contain exclamation marks"):(i=n.input.slice(e-1,n.position+1),sx.test(i)||ee(n,"named tag handle cannot contain such characters"),r=!0,e=n.position+1)),a=n.input.charCodeAt(++n.position);s=n.input.slice(e,n.position),qk.test(s)&&ee(n,"tag suffix cannot contain flow indicator characters")}s&&!ax.test(s)&&ee(n,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{ee(n,"tag name is malformed: "+s)}return t?n.tag=s:Ps.call(n.tagMap,i)?n.tag=n.tagMap[i]+s:i==="!"?n.tag="!"+s:i==="!!"?n.tag="tag:yaml.org,2002:"+s:ee(n,'undeclared tag handle "'+i+'"'),!0}o(tj,"readTagProperty");function rj(n){var e,t;if(t=n.input.charCodeAt(n.position),t!==38)return!1;for(n.anchor!==null&&ee(n,"duplication of an anchor property"),t=n.input.charCodeAt(++n.position),e=n.position;t!==0&&!Qr(t)&&!Yo(t);)t=n.input.charCodeAt(++n.position);return n.position===e&&ee(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(e,n.position),!0}o(rj,"readAnchorProperty");function nj(n){var e,t,r;if(r=n.input.charCodeAt(n.position),r!==42)return!1;for(r=n.input.charCodeAt(++n.position),e=n.position;r!==0&&!Qr(r)&&!Yo(r);)r=n.input.charCodeAt(++n.position);return n.position===e&&ee(n,"name of an alias node must contain at least one character"),t=n.input.slice(e,n.position),Ps.call(n.anchorMap,t)||ee(n,'unidentified alias "'+t+'"'),n.result=n.anchorMap[t],Nt(n,!0,-1),!0}o(nj,"readAlias");function Xo(n,e,t,r,i){var s,a,c,l=1,u=!1,f=!1,h,d,p,_,S,E;if(n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null,s=a=c=fd===t||ix===t,r&&Nt(n,!0,-1)&&(u=!0,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)),l===1)for(;tj(n)||rj(n);)Nt(n,!0,-1)?(u=!0,c=s,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)):c=!1;if(c&&(c=u||i),(l===1||fd===t)&&(ud===t||nx===t?S=e:S=e+1,E=n.position-n.lineStart,l===1?c&&(C3(n,E)||ej(n,E,S))||Jk(n,S)?f=!0:(a&&Zk(n,S)||Kk(n,S)||Xk(n,S)?f=!0:nj(n)?(f=!0,(n.tag!==null||n.anchor!==null)&&ee(n,"alias node should not have any properties")):Yk(n,S,ud===t)&&(f=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):l===0&&(f=c&&C3(n,E))),n.tag===null)n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);else if(n.tag==="?"){for(n.result!==null&&n.kind!=="scalar"&&ee(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"'),h=0,d=n.implicitTypes.length;h<d;h+=1)if(_=n.implicitTypes[h],_.resolve(n.result)){n.result=_.construct(n.result),n.tag=_.tag,n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);break}}else if(n.tag!=="!"){if(Ps.call(n.typeMap[n.kind||"fallback"],n.tag))_=n.typeMap[n.kind||"fallback"][n.tag];else for(_=null,p=n.typeMap.multi[n.kind||"fallback"],h=0,d=p.length;h<d;h+=1)if(n.tag.slice(0,p[h].tag.length)===p[h].tag){_=p[h];break}_||ee(n,"unknown tag !<"+n.tag+">"),n.result!==null&&_.kind!==n.kind&&ee(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+_.kind+'", not "'+n.kind+'"'),_.resolve(n.result,n.tag)?(n.result=_.construct(n.result,n.tag),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):ee(n,"cannot resolve a node with !<"+n.tag+"> explicit tag")}return n.listener!==null&&n.listener("close",n),n.tag!==null||n.anchor!==null||f}o(Xo,"composeNode");function ij(n){var e=n.position,t,r,i,s=!1,a;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(a=n.input.charCodeAt(n.position))!==0&&(Nt(n,!0,-1),a=n.input.charCodeAt(n.position),!(n.lineIndent>0||a!==37));){for(s=!0,a=n.input.charCodeAt(++n.position),t=n.position;a!==0&&!Qr(a);)a=n.input.charCodeAt(++n.position);for(r=n.input.slice(t,n.position),i=[],r.length<1&&ee(n,"directive name must not be less than one character in length");a!==0;){for(;Ca(a);)a=n.input.charCodeAt(++n.position);if(a===35){do a=n.input.charCodeAt(++n.position);while(a!==0&&!Pi(a));break}if(Pi(a))break;for(t=n.position;a!==0&&!Qr(a);)a=n.input.charCodeAt(++n.position);i.push(n.input.slice(t,n.position))}a!==0&&Y1(n),Ps.call(x3,r)?x3[r](n,r,i):hd(n,'unknown document directive "'+r+'"')}if(Nt(n,!0,-1),n.lineIndent===0&&n.input.charCodeAt(n.position)===45&&n.input.charCodeAt(n.position+1)===45&&n.input.charCodeAt(n.position+2)===45?(n.position+=3,Nt(n,!0,-1)):s&&ee(n,"directives end mark is expected"),Xo(n,n.lineIndent-1,fd,!1,!0),Nt(n,!0,-1),n.checkLineBreaks&&Bk.test(n.input.slice(e,n.position))&&hd(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&md(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,Nt(n,!0,-1));return}if(n.position<n.length-1)ee(n,"end of the stream or a document separator is expected");else return}o(ij,"readDocument");function fx(n,e){n=String(n),e=e||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
405
- `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new Qk(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,ee(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)ij(t);return t.documents}o(fx,"loadDocuments");function sj(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=fx(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}o(sj,"loadAll$1");function aj(n,e){var t=fx(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new jr("expected a single document in the stream, but found more")}}o(aj,"load$1");var oj=sj,cj=aj,hx={loadAll:oj,load:cj},dx=Object.prototype.toString,px=Object.prototype.hasOwnProperty,X1=65279,lj=9,wl=10,uj=13,fj=32,hj=33,dj=34,q1=35,pj=37,mj=38,gj=39,yj=42,mx=44,vj=45,dd=58,_j=61,Sj=62,bj=63,wj=64,gx=91,yx=93,Ej=96,vx=123,Tj=124,_x=125,_r={};_r[0]="\\0";_r[7]="\\a";_r[8]="\\b";_r[9]="\\t";_r[10]="\\n";_r[11]="\\v";_r[12]="\\f";_r[13]="\\r";_r[27]="\\e";_r[34]='\\"';_r[92]="\\\\";_r[133]="\\N";_r[160]="\\_";_r[8232]="\\L";_r[8233]="\\P";var xj=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Aj=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Cj(n,e){var t,r,i,s,a,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)a=r[i],c=String(e[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=n.compiledTypeMap.fallback[a],l&&px.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[a]=c;return t}o(Cj,"compileStyleMap");function Ij(n){var e,t,r;if(e=n.toString(16).toUpperCase(),n<=255)t="x",r=2;else if(n<=65535)t="u",r=4;else if(n<=4294967295)t="U",r=8;else throw new jr("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+jt.repeat("0",r-e.length)+e}o(Ij,"encodeHex");var Oj=1,El=2;function Pj(n){this.schema=n.schema||Q1,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=jt.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=Cj(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?El:Oj,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}o(Pj,"State");function I3(n,e){for(var t=jt.repeat(" ",e),r=0,i=-1,s="",a,c=n.length;r<c;)i=n.indexOf(`
405
+ `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new Qk(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,ee(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)ij(t);return t.documents}o(fx,"loadDocuments");function sj(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=fx(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}o(sj,"loadAll$1");function aj(n,e){var t=fx(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new jr("expected a single document in the stream, but found more")}}o(aj,"load$1");var oj=sj,cj=aj,hx={loadAll:oj,load:cj},dx=Object.prototype.toString,px=Object.prototype.hasOwnProperty,X1=65279,lj=9,wl=10,uj=13,fj=32,hj=33,dj=34,q1=35,pj=37,mj=38,gj=39,yj=42,mx=44,vj=45,dd=58,_j=61,Sj=62,bj=63,wj=64,gx=91,yx=93,Ej=96,vx=123,Tj=124,_x=125,Sr={};Sr[0]="\\0";Sr[7]="\\a";Sr[8]="\\b";Sr[9]="\\t";Sr[10]="\\n";Sr[11]="\\v";Sr[12]="\\f";Sr[13]="\\r";Sr[27]="\\e";Sr[34]='\\"';Sr[92]="\\\\";Sr[133]="\\N";Sr[160]="\\_";Sr[8232]="\\L";Sr[8233]="\\P";var xj=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Aj=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Cj(n,e){var t,r,i,s,a,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)a=r[i],c=String(e[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=n.compiledTypeMap.fallback[a],l&&px.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[a]=c;return t}o(Cj,"compileStyleMap");function Ij(n){var e,t,r;if(e=n.toString(16).toUpperCase(),n<=255)t="x",r=2;else if(n<=65535)t="u",r=4;else if(n<=4294967295)t="U",r=8;else throw new jr("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+jt.repeat("0",r-e.length)+e}o(Ij,"encodeHex");var Oj=1,El=2;function Pj(n){this.schema=n.schema||Q1,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=jt.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=Cj(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?El:Oj,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}o(Pj,"State");function I3(n,e){for(var t=jt.repeat(" ",e),r=0,i=-1,s="",a,c=n.length;r<c;)i=n.indexOf(`
406
406
  `,r),i===-1?(a=n.slice(r),r=c):(a=n.slice(r,i+1),r=i+1),a.length&&a!==`
407
407
  `&&(s+=t),s+=a;return s}o(I3,"indentString");function G1(n,e){return`
408
408
  `+jt.repeat(" ",n.indent*e)}o(G1,"generateNextLine");function Rj(n,e){var t,r,i;for(t=0,r=n.implicitTypes.length;t<r;t+=1)if(i=n.implicitTypes[t],i.resolve(e))return!0;return!1}o(Rj,"testImplicitResolving");function pd(n){return n===fj||n===lj}o(pd,"isWhitespace");function Tl(n){return 32<=n&&n<=126||161<=n&&n<=55295&&n!==8232&&n!==8233||57344<=n&&n<=65533&&n!==X1||65536<=n&&n<=1114111}o(Tl,"isPrintable");function O3(n){return Tl(n)&&n!==X1&&n!==uj&&n!==wl}o(O3,"isNsCharOrWhitespace");function P3(n,e,t){var r=O3(n),i=r&&!pd(n);return(t?r:r&&n!==mx&&n!==gx&&n!==yx&&n!==vx&&n!==_x)&&n!==q1&&!(e===dd&&!i)||O3(e)&&!pd(e)&&n===q1||e===dd&&i}o(P3,"isPlainSafe");function Fj(n){return Tl(n)&&n!==X1&&!pd(n)&&n!==vj&&n!==bj&&n!==dd&&n!==mx&&n!==gx&&n!==yx&&n!==vx&&n!==_x&&n!==q1&&n!==mj&&n!==yj&&n!==hj&&n!==Tj&&n!==_j&&n!==Sj&&n!==gj&&n!==dj&&n!==pj&&n!==wj&&n!==Ej}o(Fj,"isPlainSafeFirst");function Dj(n){return!pd(n)&&n!==dd}o(Dj,"isPlainSafeLast");function Sl(n,e){var t=n.charCodeAt(e),r;return t>=55296&&t<=56319&&e+1<n.length&&(r=n.charCodeAt(e+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}o(Sl,"codePointAt");function Sx(n){var e=/^\n* /;return e.test(n)}o(Sx,"needIndentIndicator");var bx=1,W1=2,wx=3,Ex=4,Qo=5;function Nj(n,e,t,r,i,s,a,c){var l,u=0,f=null,h=!1,d=!1,p=r!==-1,_=-1,S=Fj(Sl(n,0))&&Dj(Sl(n,n.length-1));if(e||a)for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Sl(n,l),!Tl(u))return Qo;S=S&&P3(u,f,c),f=u}else{for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Sl(n,l),u===wl)h=!0,p&&(d=d||l-_-1>r&&n[_+1]!==" ",_=l);else if(!Tl(u))return Qo;S=S&&P3(u,f,c),f=u}d=d||p&&l-_-1>r&&n[_+1]!==" "}return!h&&!d?S&&!a&&!i(n)?bx:s===El?Qo:W1:t>9&&Sx(n)?Qo:a?s===El?Qo:W1:d?Ex:wx}o(Nj,"chooseScalarStyle");function Lj(n,e,t,r,i){n.dump=(function(){if(e.length===0)return n.quotingType===El?'""':"''";if(!n.noCompatMode&&(xj.indexOf(e)!==-1||Aj.test(e)))return n.quotingType===El?'"'+e+'"':"'"+e+"'";var s=n.indent*Math.max(1,t),a=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-s),c=r||n.flowLevel>-1&&t>=n.flowLevel;function l(u){return Rj(n,u)}switch(o(l,"testAmbiguity"),Nj(e,c,n.indent,a,l,n.quotingType,n.forceQuotes&&!r,i)){case bx:return e;case W1:return"'"+e.replace(/'/g,"''")+"'";case wx:return"|"+R3(e,n.indent)+F3(I3(e,s));case Ex:return">"+R3(e,n.indent)+F3(I3(Mj(e,a),s));case Qo:return'"'+kj(e)+'"';default:throw new jr("impossible error: invalid scalar style")}})()}o(Lj,"writeScalar");function R3(n,e){var t=Sx(n)?String(e):"",r=n[n.length-1]===`
@@ -416,7 +416,7 @@ GFS4: `),console.error(n)},"debug"));bt[ar]||(DE=global[ar]||[],LE(bt,DE),bt.clo
416
416
  `:"")+D3(l,e),i=s}return r}o(Mj,"foldString");function D3(n,e){if(n===""||n[0]===" ")return n;for(var t=/ [^ ]/g,r,i=0,s,a=0,c=0,l="";r=t.exec(n);)c=r.index,c-i>e&&(s=a>i?a:c,l+=`
417
417
  `+n.slice(i,s),i=s+1),a=c;return l+=`
418
418
  `,n.length-i>e&&a>i?l+=n.slice(i,a)+`
419
- `+n.slice(a+1):l+=n.slice(i),l.slice(1)}o(D3,"foldLine");function kj(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=Sl(n,i),r=_r[t],!r&&Tl(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||Ij(t);return e}o(kj,"escapeString");function jj(n,e,t){var r="",i=n.tag,s,a,c;for(s=0,a=t.length;s<a;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(ns(n,e,c,!1,!1)||typeof c>"u"&&ns(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}o(jj,"writeFlowSequence");function N3(n,e,t,r){var i="",s=n.tag,a,c,l;for(a=0,c=t.length;a<c;a+=1)l=t[a],n.replacer&&(l=n.replacer.call(t,String(a),l)),(ns(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&ns(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=G1(n,e)),n.dump&&wl===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}o(N3,"writeBlockSequence");function $j(n,e,t){var r="",i=n.tag,s=Object.keys(t),a,c,l,u,f;for(a=0,c=s.length;a<c;a+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[a],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),ns(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),ns(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}o($j,"writeFlowMapping");function Vj(n,e,t,r){var i="",s=n.tag,a=Object.keys(t),c,l,u,f,h,d;if(n.sortKeys===!0)a.sort();else if(typeof n.sortKeys=="function")a.sort(n.sortKeys);else if(n.sortKeys)throw new jr("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)d="",(!r||i!=="")&&(d+=G1(n,e)),u=a[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),ns(n,e+1,u,!0,!0,!0)&&(h=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,h&&(n.dump&&wl===n.dump.charCodeAt(0)?d+="?":d+="? "),d+=n.dump,h&&(d+=G1(n,e)),ns(n,e+1,f,!0,h)&&(n.dump&&wl===n.dump.charCodeAt(0)?d+=":":d+=": ",d+=n.dump,i+=d));n.tag=s,n.dump=i||"{}"}o(Vj,"writeBlockMapping");function L3(n,e,t){var r,i,s,a,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,a=i.length;s<a;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof e=="object"&&e instanceof c.instanceOf)&&(!c.predicate||c.predicate(e))){if(t?c.multi&&c.representName?n.tag=c.representName(e):n.tag=c.tag:n.tag="?",c.represent){if(l=n.styleMap[c.tag]||c.defaultStyle,dx.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(px.call(c.represent,l))r=c.represent[l](e,l);else throw new jr("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}o(L3,"detectType");function ns(n,e,t,r,i,s,a){n.tag=null,n.dump=t,L3(n,t,!1)||L3(n,t,!0);var c=dx.call(n.dump),l=r,u;r&&(r=n.flowLevel<0||n.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",h,d;if(f&&(h=n.duplicates.indexOf(t),d=h!==-1),(n.tag!==null&&n.tag!=="?"||d||n.indent!==2&&e>0)&&(i=!1),d&&n.usedDuplicates[h])n.dump="*ref_"+h;else{if(f&&d&&!n.usedDuplicates[h]&&(n.usedDuplicates[h]=!0),c==="[object Object]")r&&Object.keys(n.dump).length!==0?(Vj(n,e,n.dump,i),d&&(n.dump="&ref_"+h+n.dump)):($j(n,e,n.dump),d&&(n.dump="&ref_"+h+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!a&&e>0?N3(n,e-1,n.dump,i):N3(n,e,n.dump,i),d&&(n.dump="&ref_"+h+n.dump)):(jj(n,e,n.dump),d&&(n.dump="&ref_"+h+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&Lj(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new jr("unacceptable kind of an object to dump "+c)}n.tag!==null&&n.tag!=="?"&&(u=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",n.dump=u+" "+n.dump)}return!0}o(ns,"writeNode");function Uj(n,e){var t=[],r=[],i,s;for(H1(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}o(Uj,"getDuplicateReferences");function H1(n,e,t){var r,i,s;if(n!==null&&typeof n=="object")if(i=e.indexOf(n),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(n),Array.isArray(n))for(i=0,s=n.length;i<s;i+=1)H1(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)H1(n[r[i]],e,t)}o(H1,"inspectNode");function Bj(n,e){e=e||{};var t=new Pj(e);t.noRefs||Uj(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),ns(t,0,r,!0,!0)?t.dump+`
419
+ `+n.slice(a+1):l+=n.slice(i),l.slice(1)}o(D3,"foldLine");function kj(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=Sl(n,i),r=Sr[t],!r&&Tl(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||Ij(t);return e}o(kj,"escapeString");function jj(n,e,t){var r="",i=n.tag,s,a,c;for(s=0,a=t.length;s<a;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(ns(n,e,c,!1,!1)||typeof c>"u"&&ns(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}o(jj,"writeFlowSequence");function N3(n,e,t,r){var i="",s=n.tag,a,c,l;for(a=0,c=t.length;a<c;a+=1)l=t[a],n.replacer&&(l=n.replacer.call(t,String(a),l)),(ns(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&ns(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=G1(n,e)),n.dump&&wl===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}o(N3,"writeBlockSequence");function $j(n,e,t){var r="",i=n.tag,s=Object.keys(t),a,c,l,u,f;for(a=0,c=s.length;a<c;a+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[a],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),ns(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),ns(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}o($j,"writeFlowMapping");function Vj(n,e,t,r){var i="",s=n.tag,a=Object.keys(t),c,l,u,f,h,d;if(n.sortKeys===!0)a.sort();else if(typeof n.sortKeys=="function")a.sort(n.sortKeys);else if(n.sortKeys)throw new jr("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)d="",(!r||i!=="")&&(d+=G1(n,e)),u=a[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),ns(n,e+1,u,!0,!0,!0)&&(h=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,h&&(n.dump&&wl===n.dump.charCodeAt(0)?d+="?":d+="? "),d+=n.dump,h&&(d+=G1(n,e)),ns(n,e+1,f,!0,h)&&(n.dump&&wl===n.dump.charCodeAt(0)?d+=":":d+=": ",d+=n.dump,i+=d));n.tag=s,n.dump=i||"{}"}o(Vj,"writeBlockMapping");function L3(n,e,t){var r,i,s,a,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,a=i.length;s<a;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof e=="object"&&e instanceof c.instanceOf)&&(!c.predicate||c.predicate(e))){if(t?c.multi&&c.representName?n.tag=c.representName(e):n.tag=c.tag:n.tag="?",c.represent){if(l=n.styleMap[c.tag]||c.defaultStyle,dx.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(px.call(c.represent,l))r=c.represent[l](e,l);else throw new jr("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}o(L3,"detectType");function ns(n,e,t,r,i,s,a){n.tag=null,n.dump=t,L3(n,t,!1)||L3(n,t,!0);var c=dx.call(n.dump),l=r,u;r&&(r=n.flowLevel<0||n.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",h,d;if(f&&(h=n.duplicates.indexOf(t),d=h!==-1),(n.tag!==null&&n.tag!=="?"||d||n.indent!==2&&e>0)&&(i=!1),d&&n.usedDuplicates[h])n.dump="*ref_"+h;else{if(f&&d&&!n.usedDuplicates[h]&&(n.usedDuplicates[h]=!0),c==="[object Object]")r&&Object.keys(n.dump).length!==0?(Vj(n,e,n.dump,i),d&&(n.dump="&ref_"+h+n.dump)):($j(n,e,n.dump),d&&(n.dump="&ref_"+h+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!a&&e>0?N3(n,e-1,n.dump,i):N3(n,e,n.dump,i),d&&(n.dump="&ref_"+h+n.dump)):(jj(n,e,n.dump),d&&(n.dump="&ref_"+h+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&Lj(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new jr("unacceptable kind of an object to dump "+c)}n.tag!==null&&n.tag!=="?"&&(u=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",n.dump=u+" "+n.dump)}return!0}o(ns,"writeNode");function Uj(n,e){var t=[],r=[],i,s;for(H1(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}o(Uj,"getDuplicateReferences");function H1(n,e,t){var r,i,s;if(n!==null&&typeof n=="object")if(i=e.indexOf(n),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(n),Array.isArray(n))for(i=0,s=n.length;i<s;i+=1)H1(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)H1(n[r[i]],e,t)}o(H1,"inspectNode");function Bj(n,e){e=e||{};var t=new Pj(e);t.noRefs||Uj(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),ns(t,0,r,!0,!0)?t.dump+`
420
420
  `:""}o(Bj,"dump$1");var qj=Bj,Gj={dump:qj};function J1(n,e){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}o(J1,"renamed");var Wj=or,Hj=j3,zj=B3,Qj=z3,Yj=Q3,Kj=Q1,Xj=hx.load,Jj=hx.loadAll,Zj=Gj.dump,e8=jr,t8={binary:Z3,float:H3,map:U3,null:q3,pairs:tx,set:rx,timestamp:X3,bool:G3,int:W3,merge:J3,omap:ex,seq:V3,str:$3},r8=J1("safeLoad","load"),n8=J1("safeLoadAll","loadAll"),i8=J1("safeDump","dump"),xl={Type:Wj,Schema:Hj,FAILSAFE_SCHEMA:zj,JSON_SCHEMA:Qj,CORE_SCHEMA:Yj,DEFAULT_SCHEMA:Kj,load:Xj,loadAll:Jj,dump:Zj,YAMLException:e8,types:t8,safeLoad:r8,safeLoadAll:n8,safeDump:i8};var s8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,sn=class{constructor(e){this.rootPath=e;this.uuidIndex=null}static{o(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await $t.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return $t.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await $t.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await $t.default.ensureDir(Wt.default.dirname(r)),await $t.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await $t.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await $t.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await $t.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await $t.default.remove(t)}async exists(e){let t=this.resolvePath(e);return $t.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=$t.default.statSync(t);if(r.isFile())return this.createFileObject(e);if(r.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let r=Wt.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=$t.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),a=this.replaceFrontmatter(r,s);await this.modify(e,a)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await $t.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await $t.default.ensureDir(Wt.default.dirname(i)),await $t.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await $t.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(s8.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let a=r.toLowerCase(),c=this.uuidIndex.get(a);return c?this.createFileObject(c):null}let i=Wt.default.dirname(this.resolvePath(t)),s;if(Wt.default.isAbsolute(r)?s=this.resolvePath(r):s=Wt.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),$t.default.existsSync(s)){let a=Wt.default.relative(this.rootPath,s);return this.createFileObject(a)}return null}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=Wt.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(r){let i=r[1].toLowerCase(),s=Wt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){return Promise.resolve()}resolvePath(e){return Wt.default.isAbsolute(e)?e:Wt.default.join(this.rootPath,e)}createFileObject(e){let t=Wt.default.basename(e),r=Wt.default.basename(e,Wt.default.extname(e)),i=Wt.default.dirname(e);return{path:e,basename:t,name:r,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Wt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=xl.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=xl.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
421
421
  ${r.trim()}
422
422
  ---`):`---
@@ -450,12 +450,12 @@ To fix this:
450
450
  3. Simplify query: reduce WHERE clauses or add LIMIT
451
451
  4. Use cache: --use-cache for faster vault loading${i!==void 0?`
452
452
 
453
- Partial results: ${i} result(s) were collected before timeout.`:""}`}static{o(this,"QueryTimeoutError")}};var yd=te(require("path")),an=te(Is()),zt=te(zr());var Ri=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=yd.default.resolve(e),this.cachePath=yd.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{o(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await an.default.pathExists(this.cachePath))return!1;let e=await an.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await an.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await an.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),r=new sn(this.vaultPath),s=await new zt.NoteToRDFConverter(r).convertVaultWithValidation({strict:e.strict??!1}),a=await an.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:a.mtimeMs},triples:c};return await an.default.ensureDir(yd.default.dirname(this.cachePath)),await an.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new sn(this.vaultPath);return new zt.NoteToRDFConverter(e).validateVault()}async invalidate(){await an.default.pathExists(this.cachePath)&&await an.default.remove(this.cachePath)}async getCacheStats(){try{if(!await an.default.pathExists(this.cachePath))return null;let e=await an.default.readJson(this.cachePath),t=await an.default.stat(this.cachePath),r=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:r,sizeBytes:t.size}}catch{return null}}serializeTriple(e){return{subject:Z1(e.subject),predicate:Z1(e.predicate),object:Z1(e.object)}}deserializeTriple(e){return new zt.Triple(e2(e.subject),e2(e.predicate),e2(e.object))}};function Z1(n){if(n instanceof zt.IRI)return{type:"IRI",value:n.value};if(n instanceof zt.Literal){let e={type:"Literal",value:n.value};return n.datatype&&(e.datatype=n.datatype.value),n.language&&(e.language=n.language),e}return n instanceof zt.BlankNode?{type:"BlankNode",value:n.value}:{type:"IRI",value:String(n)}}o(Z1,"serializeNode");function e2(n){switch(n.type){case"IRI":return new zt.IRI(n.value);case"Literal":return n.datatype?new zt.Literal(n.value,new zt.IRI(n.datatype)):n.language?new zt.Literal(n.value,void 0,n.language):new zt.Literal(n.value);case"BlankNode":return new zt.BlankNode(n.value);default:return new zt.IRI(n.value)}}o(e2,"deserializeNode");var xx=te(require("crypto")),Il=te(require("path")),Ax=te(require("os")),on=te(Is());var tc=class{static{o(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??Il.default.join(Ax.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return xx.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let r=this.getCacheKey(e),i=this.getCachePath(r);try{if(!await on.default.pathExists(i))return null;let s=await on.default.readJson(i),a=Date.now()-s.timestamp,c=t*1e3;return a>c?(await on.default.remove(i),null):s.result}catch{return null}}async set(e,t,r){let i=this.getCacheKey(e),s=this.getCachePath(i);await on.default.ensureDir(this.cacheDir);let a={timestamp:Date.now(),result:t};await on.default.writeJson(s,a,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),r=this.getCachePath(t);try{await on.default.remove(r)}catch{}}async clear(){try{if(await on.default.pathExists(this.cacheDir)){let e=await on.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>on.default.remove(Il.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await on.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await on.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),r=0;for(let i of t){let s=await on.default.stat(Il.default.join(this.cacheDir,i));r+=s.size}return{entryCount:t.length,totalSizeBytes:r}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return Il.default.join(this.cacheDir,`${e}.json`)}};var Ll=te(require("node:process"),1);var Cx=o((n=0)=>e=>`\x1B[${e+n}m`,"wrapAnsi16"),Ix=o((n=0)=>e=>`\x1B[${38+n};5;${e}m`,"wrapAnsi256"),Ox=o((n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,"wrapAnsi16m"),vt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},AJ=Object.keys(vt.modifier),a8=Object.keys(vt.color),o8=Object.keys(vt.bgColor),CJ=[...a8,...o8];function c8(){let n=new Map;for(let[e,t]of Object.entries(vt)){for(let[r,i]of Object.entries(t))vt[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=vt[r],n.set(i[0],i[1]);Object.defineProperty(vt,e,{value:t,enumerable:!1})}return Object.defineProperty(vt,"codes",{value:n,enumerable:!1}),vt.color.close="\x1B[39m",vt.bgColor.close="\x1B[49m",vt.color.ansi=Cx(),vt.color.ansi256=Ix(),vt.color.ansi16m=Ox(),vt.bgColor.ansi=Cx(10),vt.bgColor.ansi256=Ix(10),vt.bgColor.ansi16m=Ox(10),Object.defineProperties(vt,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(e=>vt.rgbToAnsi256(...vt.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,i;if(e>=232)t=((e-232)*10+8)/255,r=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((e,t,r)=>vt.ansi256ToAnsi(vt.rgbToAnsi256(e,t,r)),"value"),enumerable:!1},hexToAnsi:{value:o(e=>vt.ansi256ToAnsi(vt.hexToAnsi256(e)),"value"),enumerable:!1}}),vt}o(c8,"assembleStyles");var l8=c8(),ni=l8;var _d=te(require("node:process"),1),Rx=te(require("node:os"),1),t2=te(require("node:tty"),1);function An(n,e=globalThis.Deno?globalThis.Deno.args:_d.default.argv){let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}o(An,"hasFlag");var{env:_t}=_d.default,vd;An("no-color")||An("no-colors")||An("color=false")||An("color=never")?vd=0:(An("color")||An("colors")||An("color=true")||An("color=always"))&&(vd=1);function u8(){if("FORCE_COLOR"in _t)return _t.FORCE_COLOR==="true"?1:_t.FORCE_COLOR==="false"?0:_t.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_t.FORCE_COLOR,10),3)}o(u8,"envForceColor");function f8(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}o(f8,"translateLevel");function h8(n,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=u8();r!==void 0&&(vd=r);let i=t?vd:r;if(i===0)return 0;if(t){if(An("color=16m")||An("color=full")||An("color=truecolor"))return 3;if(An("color=256"))return 2}if("TF_BUILD"in _t&&"AGENT_NAME"in _t)return 1;if(n&&!e&&i===void 0)return 0;let s=i||0;if(_t.TERM==="dumb")return s;if(_d.default.platform==="win32"){let a=Rx.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in _t)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in _t)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in _t)||_t.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in _t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_t.TEAMCITY_VERSION)?1:0;if(_t.COLORTERM==="truecolor"||_t.TERM==="xterm-kitty"||_t.TERM==="xterm-ghostty"||_t.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _t){let a=Number.parseInt((_t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_t.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_t.TERM)||"COLORTERM"in _t?1:s}o(h8,"_supportsColor");function Px(n,e={}){let t=h8(n,{streamIsTTY:n&&n.isTTY,...e});return f8(t)}o(Px,"createSupportsColor");var d8={stdout:Px({isTTY:t2.default.isatty(1)}),stderr:Px({isTTY:t2.default.isatty(2)})},Fx=d8;function Dx(n,e,t){let r=n.indexOf(e);if(r===-1)return n;let i=e.length,s=0,a="";do a+=n.slice(s,r)+e+t,s=r+i,r=n.indexOf(e,s);while(r!==-1);return a+=n.slice(s),a}o(Dx,"stringReplaceAll");function Nx(n,e,t,r){let i=0,s="";do{let a=n[r-1]==="\r";s+=n.slice(i,a?r-1:r)+e+(a?`\r
453
+ Partial results: ${i} result(s) were collected before timeout.`:""}`}static{o(this,"QueryTimeoutError")}};var yd=te(require("path")),an=te(Is()),zt=te(zr());var Ri=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=yd.default.resolve(e),this.cachePath=yd.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{o(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await an.default.pathExists(this.cachePath))return!1;let e=await an.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await an.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await an.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),r=new sn(this.vaultPath),s=await new zt.NoteToRDFConverter(r).convertVaultWithValidation({strict:e.strict??!1}),a=await an.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:a.mtimeMs},triples:c};return await an.default.ensureDir(yd.default.dirname(this.cachePath)),await an.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new sn(this.vaultPath);return new zt.NoteToRDFConverter(e).validateVault()}async invalidate(){await an.default.pathExists(this.cachePath)&&await an.default.remove(this.cachePath)}async getCacheStats(){try{if(!await an.default.pathExists(this.cachePath))return null;let e=await an.default.readJson(this.cachePath),t=await an.default.stat(this.cachePath),r=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:r,sizeBytes:t.size}}catch{return null}}serializeTriple(e){return{subject:Z1(e.subject),predicate:Z1(e.predicate),object:Z1(e.object)}}deserializeTriple(e){return new zt.Triple(e2(e.subject),e2(e.predicate),e2(e.object))}};function Z1(n){if(n instanceof zt.IRI)return{type:"IRI",value:n.value};if(n instanceof zt.Literal){let e={type:"Literal",value:n.value};return n.datatype&&(e.datatype=n.datatype.value),n.language&&(e.language=n.language),e}return n instanceof zt.BlankNode?{type:"BlankNode",value:n.value}:{type:"IRI",value:String(n)}}o(Z1,"serializeNode");function e2(n){switch(n.type){case"IRI":return new zt.IRI(n.value);case"Literal":return n.datatype?new zt.Literal(n.value,new zt.IRI(n.datatype)):n.language?new zt.Literal(n.value,void 0,n.language):new zt.Literal(n.value);case"BlankNode":return new zt.BlankNode(n.value);default:return new zt.IRI(n.value)}}o(e2,"deserializeNode");var xx=te(require("crypto")),Il=te(require("path")),Ax=te(require("os")),on=te(Is());var tc=class{static{o(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??Il.default.join(Ax.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return xx.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let r=this.getCacheKey(e),i=this.getCachePath(r);try{if(!await on.default.pathExists(i))return null;let s=await on.default.readJson(i),a=Date.now()-s.timestamp,c=t*1e3;return a>c?(await on.default.remove(i),null):s.result}catch{return null}}async set(e,t,r){let i=this.getCacheKey(e),s=this.getCachePath(i);await on.default.ensureDir(this.cacheDir);let a={timestamp:Date.now(),result:t};await on.default.writeJson(s,a,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),r=this.getCachePath(t);try{await on.default.remove(r)}catch{}}async clear(){try{if(await on.default.pathExists(this.cacheDir)){let e=await on.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>on.default.remove(Il.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await on.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await on.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),r=0;for(let i of t){let s=await on.default.stat(Il.default.join(this.cacheDir,i));r+=s.size}return{entryCount:t.length,totalSizeBytes:r}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return Il.default.join(this.cacheDir,`${e}.json`)}};var Ll=te(require("node:process"),1);var Cx=o((n=0)=>e=>`\x1B[${e+n}m`,"wrapAnsi16"),Ix=o((n=0)=>e=>`\x1B[${38+n};5;${e}m`,"wrapAnsi256"),Ox=o((n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,"wrapAnsi16m"),vt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},AJ=Object.keys(vt.modifier),a8=Object.keys(vt.color),o8=Object.keys(vt.bgColor),CJ=[...a8,...o8];function c8(){let n=new Map;for(let[e,t]of Object.entries(vt)){for(let[r,i]of Object.entries(t))vt[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=vt[r],n.set(i[0],i[1]);Object.defineProperty(vt,e,{value:t,enumerable:!1})}return Object.defineProperty(vt,"codes",{value:n,enumerable:!1}),vt.color.close="\x1B[39m",vt.bgColor.close="\x1B[49m",vt.color.ansi=Cx(),vt.color.ansi256=Ix(),vt.color.ansi16m=Ox(),vt.bgColor.ansi=Cx(10),vt.bgColor.ansi256=Ix(10),vt.bgColor.ansi16m=Ox(10),Object.defineProperties(vt,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(e=>vt.rgbToAnsi256(...vt.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,i;if(e>=232)t=((e-232)*10+8)/255,r=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((e,t,r)=>vt.ansi256ToAnsi(vt.rgbToAnsi256(e,t,r)),"value"),enumerable:!1},hexToAnsi:{value:o(e=>vt.ansi256ToAnsi(vt.hexToAnsi256(e)),"value"),enumerable:!1}}),vt}o(c8,"assembleStyles");var l8=c8(),ii=l8;var _d=te(require("node:process"),1),Rx=te(require("node:os"),1),t2=te(require("node:tty"),1);function An(n,e=globalThis.Deno?globalThis.Deno.args:_d.default.argv){let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}o(An,"hasFlag");var{env:_t}=_d.default,vd;An("no-color")||An("no-colors")||An("color=false")||An("color=never")?vd=0:(An("color")||An("colors")||An("color=true")||An("color=always"))&&(vd=1);function u8(){if("FORCE_COLOR"in _t)return _t.FORCE_COLOR==="true"?1:_t.FORCE_COLOR==="false"?0:_t.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_t.FORCE_COLOR,10),3)}o(u8,"envForceColor");function f8(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}o(f8,"translateLevel");function h8(n,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=u8();r!==void 0&&(vd=r);let i=t?vd:r;if(i===0)return 0;if(t){if(An("color=16m")||An("color=full")||An("color=truecolor"))return 3;if(An("color=256"))return 2}if("TF_BUILD"in _t&&"AGENT_NAME"in _t)return 1;if(n&&!e&&i===void 0)return 0;let s=i||0;if(_t.TERM==="dumb")return s;if(_d.default.platform==="win32"){let a=Rx.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in _t)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in _t)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in _t)||_t.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in _t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_t.TEAMCITY_VERSION)?1:0;if(_t.COLORTERM==="truecolor"||_t.TERM==="xterm-kitty"||_t.TERM==="xterm-ghostty"||_t.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _t){let a=Number.parseInt((_t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_t.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_t.TERM)||"COLORTERM"in _t?1:s}o(h8,"_supportsColor");function Px(n,e={}){let t=h8(n,{streamIsTTY:n&&n.isTTY,...e});return f8(t)}o(Px,"createSupportsColor");var d8={stdout:Px({isTTY:t2.default.isatty(1)}),stderr:Px({isTTY:t2.default.isatty(2)})},Fx=d8;function Dx(n,e,t){let r=n.indexOf(e);if(r===-1)return n;let i=e.length,s=0,a="";do a+=n.slice(s,r)+e+t,s=r+i,r=n.indexOf(e,s);while(r!==-1);return a+=n.slice(s),a}o(Dx,"stringReplaceAll");function Nx(n,e,t,r){let i=0,s="";do{let a=n[r-1]==="\r";s+=n.slice(i,a?r-1:r)+e+(a?`\r
454
454
  `:`
455
455
  `)+t,i=r+1,r=n.indexOf(`
456
- `,i)}while(r!==-1);return s+=n.slice(i),s}o(Nx,"stringEncaseCRLFWithFirstIndex");var{stdout:Lx,stderr:Mx}=Fx,r2=Symbol("GENERATOR"),rc=Symbol("STYLER"),Ol=Symbol("IS_EMPTY"),kx=["ansi","ansi","ansi256","ansi16m"],nc=Object.create(null),p8=o((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Lx?Lx.level:0;n.level=e.level===void 0?t:e.level},"applyOptions");var m8=o(n=>{let e=o((...t)=>t.join(" "),"chalk");return p8(e,n),Object.setPrototypeOf(e,Pl.prototype),e},"chalkFactory");function Pl(n){return m8(n)}o(Pl,"createChalk");Object.setPrototypeOf(Pl.prototype,Function.prototype);for(let[n,e]of Object.entries(ni))nc[n]={get(){let t=Sd(this,i2(e.open,e.close,this[rc]),this[Ol]);return Object.defineProperty(this,n,{value:t}),t}};nc.visible={get(){let n=Sd(this,this[rc],!0);return Object.defineProperty(this,"visible",{value:n}),n}};var n2=o((n,e,t,...r)=>n==="rgb"?e==="ansi16m"?ni[t].ansi16m(...r):e==="ansi256"?ni[t].ansi256(ni.rgbToAnsi256(...r)):ni[t].ansi(ni.rgbToAnsi(...r)):n==="hex"?n2("rgb",e,t,...ni.hexToRgb(...r)):ni[t][n](...r),"getModelAnsi"),g8=["rgb","hex","ansi256"];for(let n of g8){nc[n]={get(){let{level:t}=this;return function(...r){let i=i2(n2(n,kx[t],"color",...r),ni.color.close,this[rc]);return Sd(this,i,this[Ol])}}};let e="bg"+n[0].toUpperCase()+n.slice(1);nc[e]={get(){let{level:t}=this;return function(...r){let i=i2(n2(n,kx[t],"bgColor",...r),ni.bgColor.close,this[rc]);return Sd(this,i,this[Ol])}}}}var y8=Object.defineProperties(()=>{},{...nc,level:{enumerable:!0,get(){return this[r2].level},set(n){this[r2].level=n}}}),i2=o((n,e,t)=>{let r,i;return t===void 0?(r=n,i=e):(r=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:r,closeAll:i,parent:t}},"createStyler"),Sd=o((n,e,t)=>{let r=o((...i)=>v8(r,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(r,y8),r[r2]=n,r[rc]=e,r[Ol]=t,r},"createBuilder"),v8=o((n,e)=>{if(n.level<=0||!e)return n[Ol]?"":e;let t=n[rc];if(t===void 0)return e;let{openAll:r,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Dx(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
456
+ `,i)}while(r!==-1);return s+=n.slice(i),s}o(Nx,"stringEncaseCRLFWithFirstIndex");var{stdout:Lx,stderr:Mx}=Fx,r2=Symbol("GENERATOR"),rc=Symbol("STYLER"),Ol=Symbol("IS_EMPTY"),kx=["ansi","ansi","ansi256","ansi16m"],nc=Object.create(null),p8=o((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Lx?Lx.level:0;n.level=e.level===void 0?t:e.level},"applyOptions");var m8=o(n=>{let e=o((...t)=>t.join(" "),"chalk");return p8(e,n),Object.setPrototypeOf(e,Pl.prototype),e},"chalkFactory");function Pl(n){return m8(n)}o(Pl,"createChalk");Object.setPrototypeOf(Pl.prototype,Function.prototype);for(let[n,e]of Object.entries(ii))nc[n]={get(){let t=Sd(this,i2(e.open,e.close,this[rc]),this[Ol]);return Object.defineProperty(this,n,{value:t}),t}};nc.visible={get(){let n=Sd(this,this[rc],!0);return Object.defineProperty(this,"visible",{value:n}),n}};var n2=o((n,e,t,...r)=>n==="rgb"?e==="ansi16m"?ii[t].ansi16m(...r):e==="ansi256"?ii[t].ansi256(ii.rgbToAnsi256(...r)):ii[t].ansi(ii.rgbToAnsi(...r)):n==="hex"?n2("rgb",e,t,...ii.hexToRgb(...r)):ii[t][n](...r),"getModelAnsi"),g8=["rgb","hex","ansi256"];for(let n of g8){nc[n]={get(){let{level:t}=this;return function(...r){let i=i2(n2(n,kx[t],"color",...r),ii.color.close,this[rc]);return Sd(this,i,this[Ol])}}};let e="bg"+n[0].toUpperCase()+n.slice(1);nc[e]={get(){let{level:t}=this;return function(...r){let i=i2(n2(n,kx[t],"bgColor",...r),ii.bgColor.close,this[rc]);return Sd(this,i,this[Ol])}}}}var y8=Object.defineProperties(()=>{},{...nc,level:{enumerable:!0,get(){return this[r2].level},set(n){this[r2].level=n}}}),i2=o((n,e,t)=>{let r,i;return t===void 0?(r=n,i=e):(r=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:r,closeAll:i,parent:t}},"createStyler"),Sd=o((n,e,t)=>{let r=o((...i)=>v8(r,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(r,y8),r[r2]=n,r[rc]=e,r[Ol]=t,r},"createBuilder"),v8=o((n,e)=>{if(n.level<=0||!e)return n[Ol]?"":e;let t=n[rc];if(t===void 0)return e;let{openAll:r,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Dx(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
457
457
  `);return s!==-1&&(e=Nx(e,i,r,s)),r+e+i},"applyStyle");Object.defineProperties(Pl.prototype,nc);var _8=Pl(),kJ=Pl({level:Mx?Mx.level:0});var jx=_8;var h2=te(require("node:process"),1);var Rl=te(require("node:process"),1);var S8=o((n,e,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(n,t),s=Object.getOwnPropertyDescriptor(e,t);!b8(i,s)&&r||Object.defineProperty(n,t,s)},"copyProperty"),b8=o(function(n,e){return n===void 0||n.configurable||n.writable===e.writable&&n.enumerable===e.enumerable&&n.configurable===e.configurable&&(n.writable||n.value===e.value)},"canCopyProperty"),w8=o((n,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,t)},"changePrototype"),E8=o((n,e)=>`/* Wrapped ${n}*/
458
- ${e}`,"wrappedToString"),T8=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),x8=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),A8=o((n,e,t)=>{let r=t===""?"":`with ${t.trim()}() `,i=E8.bind(null,r,e.toString());Object.defineProperty(i,"name",x8);let{writable:s,enumerable:a,configurable:c}=T8;Object.defineProperty(n,"toString",{value:i,writable:s,enumerable:a,configurable:c})},"changeToString");function s2(n,e,{ignoreNonConfigurable:t=!1}={}){let{name:r}=n;for(let i of Reflect.ownKeys(e))S8(n,e,i,t);return w8(n,e),A8(n,e,r),n}o(s2,"mimicFunction");var bd=new WeakMap,$x=o((n,e={})=>{if(typeof n!="function")throw new TypeError("Expected a function");let t,r=0,i=n.displayName||n.name||"<anonymous>",s=o(function(...a){if(bd.set(s,++r),r===1)t=n.apply(this,a),n=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return s2(s,n),bd.set(s,r),s},"onetime");$x.callCount=n=>{if(!bd.has(n))throw new Error(`The given function \`${n.name}\` is not wrapped by the \`onetime\` package`);return bd.get(n)};var Vx=$x;var Ia=[];Ia.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ia.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ia.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wd=o(n=>!!n&&typeof n=="object"&&typeof n.removeListener=="function"&&typeof n.emit=="function"&&typeof n.reallyExit=="function"&&typeof n.listeners=="function"&&typeof n.kill=="function"&&typeof n.pid=="number"&&typeof n.on=="function","processOk"),a2=Symbol.for("signal-exit emitter"),o2=globalThis,C8=Object.defineProperty.bind(Object),c2=class{static{o(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o2[a2])return o2[a2];C8(o2,a2,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],i=r.indexOf(t);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,r)||i),i}},Ed=class{static{o(this,"SignalExitBase")}},I8=o(n=>({onExit(e,t){return n.onExit(e,t)},load(){return n.load()},unload(){return n.unload()}}),"signalExitWrap"),l2=class extends Ed{static{o(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},u2=class extends Ed{static{o(this,"SignalExit")}#e=f2.platform==="win32"?"SIGINT":"SIGHUP";#n=new c2;#r;#t;#c;#v={};#i=!1;constructor(e){super(),this.#r=e,this.#v={};for(let t of Ia)this.#v[t]=()=>{let r=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();let a=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;a||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!wd(this.#r))return()=>{};this.#i===!1&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#n.on(r,e),()=>{this.#n.removeListener(r,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of Ia)try{let t=this.#v[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,Ia.forEach(e=>{let t=this.#v[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return wd(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let r=this.#t;if(e==="exit"&&wd(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=r.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return r.call(this.#r,e,...t)}},f2=globalThis.process,{onExit:Ux,load:zJ,unload:QJ}=I8(wd(f2)?new u2(f2):new l2);var Bx=Rl.default.stderr.isTTY?Rl.default.stderr:Rl.default.stdout.isTTY?Rl.default.stdout:void 0,O8=Bx?Vx(()=>{Ux(()=>{Bx.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},qx=O8;var Td=!1,ic={};ic.show=(n=h2.default.stderr)=>{n.isTTY&&(Td=!1,n.write("\x1B[?25h"))};ic.hide=(n=h2.default.stderr)=>{n.isTTY&&(qx(),Td=!0,n.write("\x1B[?25l"))};ic.toggle=(n,e)=>{n!==void 0&&(Td=n),Td?ic.show(e):ic.hide(e)};var d2=ic;var p2={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Fl=p2,iZ=Object.keys(p2);var Oa={};Qv(Oa,{error:()=>L8,info:()=>F8,success:()=>D8,warning:()=>N8});var Gx=te(require("node:tty"),1);var R8=Gx.default?.WriteStream?.prototype?.hasColors?.()??!1,Ce=o((n,e)=>{if(!R8)return i=>i;let t=`\x1B[${n}m`,r=`\x1B[${e}m`;return i=>{let s=i+"",a=s.indexOf(r);if(a===-1)return t+s+r;let c=t,l=0,f=(e===22?r:"")+t;for(;a!==-1;)c+=s.slice(l,a)+f,l=a+r.length,a=s.indexOf(r,l);return c+=s.slice(l)+r,c}},"format"),oZ=Ce(0,0),cZ=Ce(1,22),lZ=Ce(2,22),uZ=Ce(3,23),fZ=Ce(4,24),hZ=Ce(53,55),dZ=Ce(7,27),pZ=Ce(8,28),mZ=Ce(9,29),gZ=Ce(30,39),Wx=Ce(31,39),Hx=Ce(32,39),zx=Ce(33,39),Qx=Ce(34,39),yZ=Ce(35,39),vZ=Ce(36,39),_Z=Ce(37,39),SZ=Ce(90,39),bZ=Ce(40,49),wZ=Ce(41,49),EZ=Ce(42,49),TZ=Ce(43,49),xZ=Ce(44,49),AZ=Ce(45,49),CZ=Ce(46,49),IZ=Ce(47,49),OZ=Ce(100,49),PZ=Ce(91,39),RZ=Ce(92,39),FZ=Ce(93,39),DZ=Ce(94,39),NZ=Ce(95,39),LZ=Ce(96,39),MZ=Ce(97,39),kZ=Ce(101,49),jZ=Ce(102,49),$Z=Ce(103,49),VZ=Ce(104,49),UZ=Ce(105,49),BZ=Ce(106,49),qZ=Ce(107,49);var m2=te(require("node:process"),1);function Dl(){let{env:n}=m2.default,{TERM:e,TERM_PROGRAM:t}=n;return m2.default.platform!=="win32"?e!=="linux":!!n.WT_SESSION||!!n.TERMINUS_SUBLIME||n.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||n.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Dl,"isUnicodeSupported");var xd=Dl(),F8=Qx(xd?"\u2139":"i"),D8=Hx(xd?"\u2714":"\u221A"),N8=zx(xd?"\u26A0":"\u203C"),L8=Wx(xd?"\u2716":"\xD7");function g2({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}o(g2,"ansiRegex");var M8=g2();function Nl(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return n.replace(M8,"")}o(Nl,"stripAnsi");function Yx(n){return n===161||n===164||n===167||n===168||n===170||n===173||n===174||n>=176&&n<=180||n>=182&&n<=186||n>=188&&n<=191||n===198||n===208||n===215||n===216||n>=222&&n<=225||n===230||n>=232&&n<=234||n===236||n===237||n===240||n===242||n===243||n>=247&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||n===294||n===295||n===299||n>=305&&n<=307||n===312||n>=319&&n<=322||n===324||n>=328&&n<=331||n===333||n===338||n===339||n===358||n===359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||n>=713&&n<=715||n===717||n===720||n>=728&&n<=731||n===733||n===735||n>=768&&n<=879||n>=913&&n<=929||n>=931&&n<=937||n>=945&&n<=961||n>=963&&n<=969||n===1025||n>=1040&&n<=1103||n===1105||n===8208||n>=8211&&n<=8214||n===8216||n===8217||n===8220||n===8221||n>=8224&&n<=8226||n>=8228&&n<=8231||n===8240||n===8242||n===8243||n===8245||n===8251||n===8254||n===8308||n===8319||n>=8321&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||n===8481||n===8482||n===8486||n===8491||n===8531||n===8532||n>=8539&&n<=8542||n>=8544&&n<=8555||n>=8560&&n<=8569||n===8585||n>=8592&&n<=8601||n===8632||n===8633||n===8658||n===8660||n===8679||n===8704||n===8706||n===8707||n===8711||n===8712||n===8715||n===8719||n===8721||n===8725||n===8730||n>=8733&&n<=8736||n===8739||n===8741||n>=8743&&n<=8748||n===8750||n>=8756&&n<=8759||n===8764||n===8765||n===8776||n===8780||n===8786||n===8800||n===8801||n>=8804&&n<=8807||n===8810||n===8811||n===8814||n===8815||n===8834||n===8835||n===8838||n===8839||n===8853||n===8857||n===8869||n===8895||n===8978||n>=9312&&n<=9449||n>=9451&&n<=9547||n>=9552&&n<=9587||n>=9600&&n<=9615||n>=9618&&n<=9621||n===9632||n===9633||n>=9635&&n<=9641||n===9650||n===9651||n===9654||n===9655||n===9660||n===9661||n===9664||n===9665||n>=9670&&n<=9672||n===9675||n>=9678&&n<=9681||n>=9698&&n<=9701||n===9711||n===9733||n===9734||n===9737||n===9742||n===9743||n===9756||n===9758||n===9792||n===9794||n===9824||n===9825||n>=9827&&n<=9829||n>=9831&&n<=9834||n===9836||n===9837||n===9839||n===9886||n===9887||n===9919||n>=9926&&n<=9933||n>=9935&&n<=9939||n>=9941&&n<=9953||n===9955||n===9960||n===9961||n>=9963&&n<=9969||n===9972||n>=9974&&n<=9977||n===9979||n===9980||n===9982||n===9983||n===10045||n>=10102&&n<=10111||n>=11094&&n<=11097||n>=12872&&n<=12879||n>=57344&&n<=63743||n>=65024&&n<=65039||n===65533||n>=127232&&n<=127242||n>=127248&&n<=127277||n>=127280&&n<=127337||n>=127344&&n<=127373||n===127375||n===127376||n>=127387&&n<=127404||n>=917760&&n<=917999||n>=983040&&n<=1048573||n>=1048576&&n<=1114109}o(Yx,"isAmbiguous");function Kx(n){return n===12288||n>=65281&&n<=65376||n>=65504&&n<=65510}o(Kx,"isFullWidth");function Xx(n){return n>=4352&&n<=4447||n===8986||n===8987||n===9001||n===9002||n>=9193&&n<=9196||n===9200||n===9203||n===9725||n===9726||n===9748||n===9749||n>=9776&&n<=9783||n>=9800&&n<=9811||n===9855||n>=9866&&n<=9871||n===9875||n===9889||n===9898||n===9899||n===9917||n===9918||n===9924||n===9925||n===9934||n===9940||n===9962||n===9970||n===9971||n===9973||n===9978||n===9981||n===9989||n===9994||n===9995||n===10024||n===10060||n===10062||n>=10067&&n<=10069||n===10071||n>=10133&&n<=10135||n===10160||n===10175||n===11035||n===11036||n===11088||n===11093||n>=11904&&n<=11929||n>=11931&&n<=12019||n>=12032&&n<=12245||n>=12272&&n<=12287||n>=12289&&n<=12350||n>=12353&&n<=12438||n>=12441&&n<=12543||n>=12549&&n<=12591||n>=12593&&n<=12686||n>=12688&&n<=12773||n>=12783&&n<=12830||n>=12832&&n<=12871||n>=12880&&n<=42124||n>=42128&&n<=42182||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65106||n>=65108&&n<=65126||n>=65128&&n<=65131||n>=94176&&n<=94180||n>=94192&&n<=94198||n>=94208&&n<=101589||n>=101631&&n<=101662||n>=101760&&n<=101874||n>=110576&&n<=110579||n>=110581&&n<=110587||n===110589||n===110590||n>=110592&&n<=110882||n===110898||n>=110928&&n<=110930||n===110933||n>=110948&&n<=110951||n>=110960&&n<=111355||n>=119552&&n<=119638||n>=119648&&n<=119670||n===126980||n===127183||n===127374||n>=127377&&n<=127386||n>=127488&&n<=127490||n>=127504&&n<=127547||n>=127552&&n<=127560||n===127568||n===127569||n>=127584&&n<=127589||n>=127744&&n<=127776||n>=127789&&n<=127797||n>=127799&&n<=127868||n>=127870&&n<=127891||n>=127904&&n<=127946||n>=127951&&n<=127955||n>=127968&&n<=127984||n===127988||n>=127992&&n<=128062||n===128064||n>=128066&&n<=128252||n>=128255&&n<=128317||n>=128331&&n<=128334||n>=128336&&n<=128359||n===128378||n===128405||n===128406||n===128420||n>=128507&&n<=128591||n>=128640&&n<=128709||n===128716||n>=128720&&n<=128722||n>=128725&&n<=128728||n>=128732&&n<=128735||n===128747||n===128748||n>=128756&&n<=128764||n>=128992&&n<=129003||n===129008||n>=129292&&n<=129338||n>=129340&&n<=129349||n>=129351&&n<=129535||n>=129648&&n<=129660||n>=129664&&n<=129674||n>=129678&&n<=129734||n===129736||n>=129741&&n<=129756||n>=129759&&n<=129770||n>=129775&&n<=129784||n>=131072&&n<=196605||n>=196608&&n<=262141}o(Xx,"isWide");function k8(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}o(k8,"validate");function y2(n,{ambiguousAsWide:e=!1}={}){return k8(n),Kx(n)||Xx(n)||e&&Yx(n)?2:1}o(y2,"eastAsianWidth");var j8=new Intl.Segmenter,$8=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),V8=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),U8=new RegExp("^\\p{RGI_Emoji}$","v");function B8(n){return n.replace(V8,"")}o(B8,"baseVisible");function q8(n){return $8.test(n)}o(q8,"isZeroWidthCluster");function G8(n,e){let t=0;if(n.length>1)for(let r of n.slice(1))r>="\uFF00"&&r<="\uFFEF"&&(t+=y2(r.codePointAt(0),e));return t}o(G8,"trailingHalfwidthWidth");function v2(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(r||(i=Nl(i)),i.length===0)return 0;let s=0,a={ambiguousAsWide:!t};for(let{segment:c}of j8.segment(i)){if(q8(c))continue;if(U8.test(c)){s+=2;continue}let l=B8(c).codePointAt(0);s+=y2(l,a),s+=G8(c,a)}return s}o(v2,"stringWidth");function _2({stream:n=process.stdout}={}){return!!(n&&n.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}o(_2,"isInteractive");var ii=te(require("node:process"),1);var W8=3,S2=class{static{o(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){ii.default.platform==="win32"||!ii.default.stdin.isTTY||(ii.default.stdin.setRawMode(!0),ii.default.stdin.on("data",this.#t),ii.default.stdin.resume())}#r(){ii.default.stdin.isTTY&&(ii.default.stdin.off("data",this.#t),ii.default.stdin.pause(),ii.default.stdin.setRawMode(!1))}#t(e){e[0]===W8&&ii.default.emit("SIGINT")}},H8=new S2,b2=H8;var w2=class{static{o(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#v=0;#i;#u;#s;#l;#a;#p;#g;#h;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:Ll.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#a=this.#i.interval,this.#s=this.#i.stream,this.#p=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:_2({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,Ll.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#p,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#h}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#h=e,this.#S()}get interval(){return this.#a??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#a=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Dl())this.#u=Fl.line;else if(e===void 0)this.#u=Fl.dots;else if(e!=="default"&&Fl[e])this.#u=Fl[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#S()}get isSpinning(){return this.#l!==void 0}#E(e,t,r=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?r?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#E(e,t,!1)}#_(e=this.#f,t=" "){return this.#E(e,t,!0)}#w(e,t){let r=0;for(let i of Nl(e).split(`
458
+ ${e}`,"wrappedToString"),T8=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),x8=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),A8=o((n,e,t)=>{let r=t===""?"":`with ${t.trim()}() `,i=E8.bind(null,r,e.toString());Object.defineProperty(i,"name",x8);let{writable:s,enumerable:a,configurable:c}=T8;Object.defineProperty(n,"toString",{value:i,writable:s,enumerable:a,configurable:c})},"changeToString");function s2(n,e,{ignoreNonConfigurable:t=!1}={}){let{name:r}=n;for(let i of Reflect.ownKeys(e))S8(n,e,i,t);return w8(n,e),A8(n,e,r),n}o(s2,"mimicFunction");var bd=new WeakMap,$x=o((n,e={})=>{if(typeof n!="function")throw new TypeError("Expected a function");let t,r=0,i=n.displayName||n.name||"<anonymous>",s=o(function(...a){if(bd.set(s,++r),r===1)t=n.apply(this,a),n=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return s2(s,n),bd.set(s,r),s},"onetime");$x.callCount=n=>{if(!bd.has(n))throw new Error(`The given function \`${n.name}\` is not wrapped by the \`onetime\` package`);return bd.get(n)};var Vx=$x;var Ia=[];Ia.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ia.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ia.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wd=o(n=>!!n&&typeof n=="object"&&typeof n.removeListener=="function"&&typeof n.emit=="function"&&typeof n.reallyExit=="function"&&typeof n.listeners=="function"&&typeof n.kill=="function"&&typeof n.pid=="number"&&typeof n.on=="function","processOk"),a2=Symbol.for("signal-exit emitter"),o2=globalThis,C8=Object.defineProperty.bind(Object),c2=class{static{o(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o2[a2])return o2[a2];C8(o2,a2,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],i=r.indexOf(t);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,r)||i),i}},Ed=class{static{o(this,"SignalExitBase")}},I8=o(n=>({onExit(e,t){return n.onExit(e,t)},load(){return n.load()},unload(){return n.unload()}}),"signalExitWrap"),l2=class extends Ed{static{o(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},u2=class extends Ed{static{o(this,"SignalExit")}#e=f2.platform==="win32"?"SIGINT":"SIGHUP";#n=new c2;#r;#t;#c;#v={};#i=!1;constructor(e){super(),this.#r=e,this.#v={};for(let t of Ia)this.#v[t]=()=>{let r=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();let a=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;a||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!wd(this.#r))return()=>{};this.#i===!1&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#n.on(r,e),()=>{this.#n.removeListener(r,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of Ia)try{let t=this.#v[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,Ia.forEach(e=>{let t=this.#v[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return wd(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let r=this.#t;if(e==="exit"&&wd(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=r.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return r.call(this.#r,e,...t)}},f2=globalThis.process,{onExit:Ux,load:zJ,unload:QJ}=I8(wd(f2)?new u2(f2):new l2);var Bx=Rl.default.stderr.isTTY?Rl.default.stderr:Rl.default.stdout.isTTY?Rl.default.stdout:void 0,O8=Bx?Vx(()=>{Ux(()=>{Bx.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},qx=O8;var Td=!1,ic={};ic.show=(n=h2.default.stderr)=>{n.isTTY&&(Td=!1,n.write("\x1B[?25h"))};ic.hide=(n=h2.default.stderr)=>{n.isTTY&&(qx(),Td=!0,n.write("\x1B[?25l"))};ic.toggle=(n,e)=>{n!==void 0&&(Td=n),Td?ic.show(e):ic.hide(e)};var d2=ic;var p2={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Fl=p2,iZ=Object.keys(p2);var Oa={};Qv(Oa,{error:()=>L8,info:()=>F8,success:()=>D8,warning:()=>N8});var Gx=te(require("node:tty"),1);var R8=Gx.default?.WriteStream?.prototype?.hasColors?.()??!1,Ce=o((n,e)=>{if(!R8)return i=>i;let t=`\x1B[${n}m`,r=`\x1B[${e}m`;return i=>{let s=i+"",a=s.indexOf(r);if(a===-1)return t+s+r;let c=t,l=0,f=(e===22?r:"")+t;for(;a!==-1;)c+=s.slice(l,a)+f,l=a+r.length,a=s.indexOf(r,l);return c+=s.slice(l)+r,c}},"format"),oZ=Ce(0,0),cZ=Ce(1,22),lZ=Ce(2,22),uZ=Ce(3,23),fZ=Ce(4,24),hZ=Ce(53,55),dZ=Ce(7,27),pZ=Ce(8,28),mZ=Ce(9,29),gZ=Ce(30,39),Wx=Ce(31,39),Hx=Ce(32,39),zx=Ce(33,39),Qx=Ce(34,39),yZ=Ce(35,39),vZ=Ce(36,39),_Z=Ce(37,39),SZ=Ce(90,39),bZ=Ce(40,49),wZ=Ce(41,49),EZ=Ce(42,49),TZ=Ce(43,49),xZ=Ce(44,49),AZ=Ce(45,49),CZ=Ce(46,49),IZ=Ce(47,49),OZ=Ce(100,49),PZ=Ce(91,39),RZ=Ce(92,39),FZ=Ce(93,39),DZ=Ce(94,39),NZ=Ce(95,39),LZ=Ce(96,39),MZ=Ce(97,39),kZ=Ce(101,49),jZ=Ce(102,49),$Z=Ce(103,49),VZ=Ce(104,49),UZ=Ce(105,49),BZ=Ce(106,49),qZ=Ce(107,49);var m2=te(require("node:process"),1);function Dl(){let{env:n}=m2.default,{TERM:e,TERM_PROGRAM:t}=n;return m2.default.platform!=="win32"?e!=="linux":!!n.WT_SESSION||!!n.TERMINUS_SUBLIME||n.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||n.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Dl,"isUnicodeSupported");var xd=Dl(),F8=Qx(xd?"\u2139":"i"),D8=Hx(xd?"\u2714":"\u221A"),N8=zx(xd?"\u26A0":"\u203C"),L8=Wx(xd?"\u2716":"\xD7");function g2({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}o(g2,"ansiRegex");var M8=g2();function Nl(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return n.replace(M8,"")}o(Nl,"stripAnsi");function Yx(n){return n===161||n===164||n===167||n===168||n===170||n===173||n===174||n>=176&&n<=180||n>=182&&n<=186||n>=188&&n<=191||n===198||n===208||n===215||n===216||n>=222&&n<=225||n===230||n>=232&&n<=234||n===236||n===237||n===240||n===242||n===243||n>=247&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||n===294||n===295||n===299||n>=305&&n<=307||n===312||n>=319&&n<=322||n===324||n>=328&&n<=331||n===333||n===338||n===339||n===358||n===359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||n>=713&&n<=715||n===717||n===720||n>=728&&n<=731||n===733||n===735||n>=768&&n<=879||n>=913&&n<=929||n>=931&&n<=937||n>=945&&n<=961||n>=963&&n<=969||n===1025||n>=1040&&n<=1103||n===1105||n===8208||n>=8211&&n<=8214||n===8216||n===8217||n===8220||n===8221||n>=8224&&n<=8226||n>=8228&&n<=8231||n===8240||n===8242||n===8243||n===8245||n===8251||n===8254||n===8308||n===8319||n>=8321&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||n===8481||n===8482||n===8486||n===8491||n===8531||n===8532||n>=8539&&n<=8542||n>=8544&&n<=8555||n>=8560&&n<=8569||n===8585||n>=8592&&n<=8601||n===8632||n===8633||n===8658||n===8660||n===8679||n===8704||n===8706||n===8707||n===8711||n===8712||n===8715||n===8719||n===8721||n===8725||n===8730||n>=8733&&n<=8736||n===8739||n===8741||n>=8743&&n<=8748||n===8750||n>=8756&&n<=8759||n===8764||n===8765||n===8776||n===8780||n===8786||n===8800||n===8801||n>=8804&&n<=8807||n===8810||n===8811||n===8814||n===8815||n===8834||n===8835||n===8838||n===8839||n===8853||n===8857||n===8869||n===8895||n===8978||n>=9312&&n<=9449||n>=9451&&n<=9547||n>=9552&&n<=9587||n>=9600&&n<=9615||n>=9618&&n<=9621||n===9632||n===9633||n>=9635&&n<=9641||n===9650||n===9651||n===9654||n===9655||n===9660||n===9661||n===9664||n===9665||n>=9670&&n<=9672||n===9675||n>=9678&&n<=9681||n>=9698&&n<=9701||n===9711||n===9733||n===9734||n===9737||n===9742||n===9743||n===9756||n===9758||n===9792||n===9794||n===9824||n===9825||n>=9827&&n<=9829||n>=9831&&n<=9834||n===9836||n===9837||n===9839||n===9886||n===9887||n===9919||n>=9926&&n<=9933||n>=9935&&n<=9939||n>=9941&&n<=9953||n===9955||n===9960||n===9961||n>=9963&&n<=9969||n===9972||n>=9974&&n<=9977||n===9979||n===9980||n===9982||n===9983||n===10045||n>=10102&&n<=10111||n>=11094&&n<=11097||n>=12872&&n<=12879||n>=57344&&n<=63743||n>=65024&&n<=65039||n===65533||n>=127232&&n<=127242||n>=127248&&n<=127277||n>=127280&&n<=127337||n>=127344&&n<=127373||n===127375||n===127376||n>=127387&&n<=127404||n>=917760&&n<=917999||n>=983040&&n<=1048573||n>=1048576&&n<=1114109}o(Yx,"isAmbiguous");function Kx(n){return n===12288||n>=65281&&n<=65376||n>=65504&&n<=65510}o(Kx,"isFullWidth");function Xx(n){return n>=4352&&n<=4447||n===8986||n===8987||n===9001||n===9002||n>=9193&&n<=9196||n===9200||n===9203||n===9725||n===9726||n===9748||n===9749||n>=9776&&n<=9783||n>=9800&&n<=9811||n===9855||n>=9866&&n<=9871||n===9875||n===9889||n===9898||n===9899||n===9917||n===9918||n===9924||n===9925||n===9934||n===9940||n===9962||n===9970||n===9971||n===9973||n===9978||n===9981||n===9989||n===9994||n===9995||n===10024||n===10060||n===10062||n>=10067&&n<=10069||n===10071||n>=10133&&n<=10135||n===10160||n===10175||n===11035||n===11036||n===11088||n===11093||n>=11904&&n<=11929||n>=11931&&n<=12019||n>=12032&&n<=12245||n>=12272&&n<=12287||n>=12289&&n<=12350||n>=12353&&n<=12438||n>=12441&&n<=12543||n>=12549&&n<=12591||n>=12593&&n<=12686||n>=12688&&n<=12773||n>=12783&&n<=12830||n>=12832&&n<=12871||n>=12880&&n<=42124||n>=42128&&n<=42182||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65106||n>=65108&&n<=65126||n>=65128&&n<=65131||n>=94176&&n<=94180||n>=94192&&n<=94198||n>=94208&&n<=101589||n>=101631&&n<=101662||n>=101760&&n<=101874||n>=110576&&n<=110579||n>=110581&&n<=110587||n===110589||n===110590||n>=110592&&n<=110882||n===110898||n>=110928&&n<=110930||n===110933||n>=110948&&n<=110951||n>=110960&&n<=111355||n>=119552&&n<=119638||n>=119648&&n<=119670||n===126980||n===127183||n===127374||n>=127377&&n<=127386||n>=127488&&n<=127490||n>=127504&&n<=127547||n>=127552&&n<=127560||n===127568||n===127569||n>=127584&&n<=127589||n>=127744&&n<=127776||n>=127789&&n<=127797||n>=127799&&n<=127868||n>=127870&&n<=127891||n>=127904&&n<=127946||n>=127951&&n<=127955||n>=127968&&n<=127984||n===127988||n>=127992&&n<=128062||n===128064||n>=128066&&n<=128252||n>=128255&&n<=128317||n>=128331&&n<=128334||n>=128336&&n<=128359||n===128378||n===128405||n===128406||n===128420||n>=128507&&n<=128591||n>=128640&&n<=128709||n===128716||n>=128720&&n<=128722||n>=128725&&n<=128728||n>=128732&&n<=128735||n===128747||n===128748||n>=128756&&n<=128764||n>=128992&&n<=129003||n===129008||n>=129292&&n<=129338||n>=129340&&n<=129349||n>=129351&&n<=129535||n>=129648&&n<=129660||n>=129664&&n<=129674||n>=129678&&n<=129734||n===129736||n>=129741&&n<=129756||n>=129759&&n<=129770||n>=129775&&n<=129784||n>=131072&&n<=196605||n>=196608&&n<=262141}o(Xx,"isWide");function k8(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}o(k8,"validate");function y2(n,{ambiguousAsWide:e=!1}={}){return k8(n),Kx(n)||Xx(n)||e&&Yx(n)?2:1}o(y2,"eastAsianWidth");var j8=new Intl.Segmenter,$8=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),V8=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),U8=new RegExp("^\\p{RGI_Emoji}$","v");function B8(n){return n.replace(V8,"")}o(B8,"baseVisible");function q8(n){return $8.test(n)}o(q8,"isZeroWidthCluster");function G8(n,e){let t=0;if(n.length>1)for(let r of n.slice(1))r>="\uFF00"&&r<="\uFFEF"&&(t+=y2(r.codePointAt(0),e));return t}o(G8,"trailingHalfwidthWidth");function v2(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(r||(i=Nl(i)),i.length===0)return 0;let s=0,a={ambiguousAsWide:!t};for(let{segment:c}of j8.segment(i)){if(q8(c))continue;if(U8.test(c)){s+=2;continue}let l=B8(c).codePointAt(0);s+=y2(l,a),s+=G8(c,a)}return s}o(v2,"stringWidth");function _2({stream:n=process.stdout}={}){return!!(n&&n.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}o(_2,"isInteractive");var si=te(require("node:process"),1);var W8=3,S2=class{static{o(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){si.default.platform==="win32"||!si.default.stdin.isTTY||(si.default.stdin.setRawMode(!0),si.default.stdin.on("data",this.#t),si.default.stdin.resume())}#r(){si.default.stdin.isTTY&&(si.default.stdin.off("data",this.#t),si.default.stdin.pause(),si.default.stdin.setRawMode(!1))}#t(e){e[0]===W8&&si.default.emit("SIGINT")}},H8=new S2,b2=H8;var w2=class{static{o(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#v=0;#i;#u;#s;#l;#a;#p;#g;#h;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:Ll.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#a=this.#i.interval,this.#s=this.#i.stream,this.#p=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:_2({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,Ll.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#p,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#h}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#h=e,this.#S()}get interval(){return this.#a??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#a=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Dl())this.#u=Fl.line;else if(e===void 0)this.#u=Fl.dots;else if(e!=="default"&&Fl[e])this.#u=Fl[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#S()}get isSpinning(){return this.#l!==void 0}#E(e,t,r=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?r?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#E(e,t,!1)}#_(e=this.#f,t=" "){return this.#E(e,t,!0)}#w(e,t){let r=0;for(let i of Nl(e).split(`
459
459
  `))r+=Math.max(1,Math.ceil(v2(i)/t));return r}#S(){let e=this.#s.columns??80,t=typeof this.#y=="function"?"":this.#y,r=typeof this.#f=="function"?"":this.#f,i=typeof t=="string"&&t!==""?t+" ":"",s=typeof r=="string"&&r!==""?" "+r:"",c=" ".repeat(this.#h)+i+"-"+(typeof this.#m=="string"?" "+this.#m:"")+s;this.#r=this.#w(c,e)}get isEnabled(){return this.#p&&!this.#g}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#p=e}get isSilent(){return this.#g}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#g=e}frame(){let e=Date.now();(this.#t===-1||e-this.#c>=this.interval)&&(this.#t=++this.#t%this.#u.frames.length,this.#c=e);let{frames:t}=this.#u,r=t[this.#t];this.color&&(r=jx[this.color](r));let i=this.#T(this.#y," "),s=typeof this.text=="string"?" "+this.text:"",a=this.#_(this.#f," ");return i+r+s+a}clear(){if(!this.#p||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#s.moveCursor(0,-1),this.#s.clearLine(1);return(this.#h||this.#v!==this.#h)&&this.#s.cursorTo(this.#h),this.#v=this.#h,this.#e=0,this}render(){if(!this.#p||this.#g)return this;this.clear();let e=this.frame(),t=this.#s.columns??80,r=this.#w(e,t),i=this.#s.rows;if(i&&i>1&&r>i){let s=e.split(`
460
460
  `),a=i-1;e=[...s.slice(0,a),"... (content truncated to fit terminal)"].join(`
461
461
  `)}return this.#s.write(e),this.#e=this.#w(e,t),this}start(e){if(e&&(this.text=e),this.#g)return this;if(!this.#p){let t=" ".repeat(this.#h)+this.#T(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#_(this.#f," ");return t.trim()!==""&&this.#s.write(t+`
@@ -534,15 +534,15 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <
534
534
  \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${p}ms${h?" (from cache)":""}`),console.log(` Query execution: ${re}ms`),console.log(` Total time: ${Ie}ms`),console.log(` Triples scanned: ${f.length}`),console.log(` Results returned: ${H.length}`),e.useCache&&console.log(` Triple cache: ${h?"HIT":"MISS (rebuilt)"}`),a&&console.log(" Query result cache: MISS (cached for next run)"))}}catch(r){let i=new Ml;if(i.classifyError(r)!=="unknown"){let a=i.enhanceError(r,queryString);if(t==="json"){let c=_e.error("VALIDATION_INVALID_FORMAT",a.message,2,{context:{errorType:a.type,suggestions:a.suggestions,line:a.line,column:a.column,queryContext:a.context?{startLine:a.context.startLine,endLine:a.context.endLine,errorLine:a.context.errorLine}:void 0},recovery:{message:a.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(c,null,2)),process.exit(2)}else console.error(i.formatForText(a)),process.exit(2)}W.handle(r)}})}o(rA,"sparqlQueryCommand");function o$(n){if(n.includes("SELECT")||n.includes("CONSTRUCT"))return n;let e=(0,I2.resolve)(n);return(0,kl.existsSync)(e)?(0,kl.readFileSync)(e,"utf-8"):n}o(o$,"loadQuery");async function c$(n,e,t){if(e.explain){let i=new Cd,s=await i.analyze(n,{includeAlgebraPlan:!0,optimize:!e.noOptimize});if(t==="json"){let a=_e.success(s);console.log(JSON.stringify(a,null,2))}else s.valid?(console.log(`\u2705 Query syntax is valid
535
535
  `),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let r=new Vt.SPARQLParser;try{let i=r.parse(n),a=new Vt.AlgebraTranslator().translate(i);if(!e.noOptimize&&a.type!=="construct")a=new Vt.AlgebraOptimizer().optimize(a);else if(!e.noOptimize&&a.type==="construct"){let c=new Vt.AlgebraOptimizer,l=a;a={...l,where:c.optimize(l.where)}}if(t==="json"){let c=_e.success({valid:!0,queryType:tA(i),message:"Query syntax is valid"});console.log(JSON.stringify(c,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${tA(i)}`)}catch(i){let s=new Ml,a=s.enhanceError(i,n);if(t==="json"){let c=_e.error("VALIDATION_INVALID_FORMAT",a.message,2,{context:{valid:!1,errorType:a.type,suggestions:a.suggestions,line:a.line,column:a.column,queryContext:a.context?{startLine:a.context.startLine,endLine:a.context.endLine,errorLine:a.context.errorLine}:void 0},recovery:{message:a.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(c,null,2))}else console.error(s.formatForText(a));process.exit(2)}}o(c$,"executeDryRun");function tA(n){return n.type==="update"?"UPDATE":"queryType"in n?n.queryType:"UNKNOWN"}o(tA,"getQueryType");function l$(n,e){switch(e){case"json":let t=new Zo;console.log(t.format(n));break;case"csv":let r=new gd;console.log(r.format(n));break;case"table":default:let i=new Jo;console.log(i.format(n));break}}o(l$,"formatSelectResults");function u$(n,e){let t=new ec;switch(e){case"json":console.log(t.formatJson(n));break;case"ntriples":console.log(t.formatNTriples(n));break;case"table":default:console.log(t.formatTable(n));break}}o(u$,"formatConstructResults");function f$(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"csv":if(n.length===0){console.log("");return}let t=Object.keys(n[0]);console.log(t.join(","));for(let i of n){let s=t.map(a=>{let c=i[a];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(n.length===0){console.log("No results.");return}let r=Object.keys(n[0]);console.log(r.join(" ")),console.log(r.map(()=>"---").join(" "));for(let i of n){let s=r.map(a=>String(i[a]??""));console.log(s.join(" "))}break}}o(f$,"formatCachedSelectResults");function h$(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"ntriples":for(let t of n)console.log(`<${t.subject}> <${t.predicate}> ${d$(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of n)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}o(h$,"formatCachedConstructResults");function d$(n){return Od.formatObject(n)}o(d$,"formatNTriplesObject");var nA=require("fs"),iA=require("path");function sA(){return new ut("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").action(async n=>{let e=n.output||"text";W.setFormat(e);try{let t=(0,iA.resolve)(n.vault);if(!(0,nA.existsSync)(t))throw new wt(t);let r=new Ri(t),i=r.getCachePath();n.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await r.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),a=await r.buildCacheWithValidation({strict:n.strict??!1}),c=Date.now()-s;if(e==="json"){let l={action:"build",cachePath:i,tripleCount:a.tripleCount,durationMs:a.durationMs},u={summary:a.summary,skippedFiles:a.skippedFiles};if(n.stats){let f=await r.getCacheStats();if(f){let h={tripleCount:f.tripleCount,createdAt:f.createdAt.toISOString(),isValid:f.isValid,sizeBytes:f.sizeBytes,cachePath:i},d=_e.success({cache:l,stats:h,validation:u},{durationMs:c});console.log(JSON.stringify(d,null,2))}}else{let f=_e.success({cache:l,validation:u},{durationMs:c});console.log(JSON.stringify(f,null,2))}}else{if(a.skippedFiles.length>0){console.log(`
536
536
  \u26A0\uFE0F Files skipped due to IRI issues:`);for(let l of a.skippedFiles)console.log(` - ${l.path}`),console.log(` ${l.reason}`);console.log("")}if(console.log(`\u2705 Indexed ${a.summary.indexed} files, skipped ${a.summary.skipped} (total: ${a.summary.total})`),console.log(`\u{1F4CA} Created cache with ${a.tripleCount.toLocaleString()} triples at ${i}`),console.log(`\u23F1\uFE0F Build time: ${a.durationMs}ms`),n.stats){let l=await r.getCacheStats();l&&(console.log(`
537
- \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${l.tripleCount.toLocaleString()}`),console.log(` Created: ${l.createdAt.toISOString()}`),console.log(` Valid: ${l.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${p$(l.sizeBytes)}`))}}}catch(t){W.handle(t)}})}o(sA,"sparqlIndexCommand");function p$(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}o(p$,"formatBytes");function aA(){return new ut("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";W.setFormat(e);try{let t=new sc,r=t.listTemplates();if(e==="json"){let i=_e.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){W.handle(t)}})}o(aA,"sparqlTemplatesCommand");var dC=require("path");var Ut=te(Is()),Ls=te(require("path"));var IA=te(_A(),1);var $l=o(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var w$={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Vl=o(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),E$=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),SA=o(n=>n.join(""),"rangesToString"),bA=o((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,a=!1,c=!1,l=!1,u=!1,f=t,h="";e:for(;s<n.length;){let S=n.charAt(s);if((S==="!"||S==="^")&&s===t+1){u=!0,s++;continue}if(S==="]"&&a&&!l){f=s+1;break}if(a=!0,S==="\\"&&!l){l=!0,s++;continue}if(S==="["&&!l){for(let[E,[A,C,k]]of Object.entries(w$))if(n.startsWith(E,s)){if(h)return["$.",!1,n.length-t,!0];s+=E.length,k?i.push(A):r.push(A),c=c||C;continue e}}if(l=!1,h){S>h?r.push(Vl(h)+"-"+Vl(S)):S===h&&r.push(Vl(S)),h="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Vl(S+"-")),s+=2;continue}if(n.startsWith("-",s+1)){h=S,s+=2;continue}r.push(Vl(S)),s++}if(f<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let S=r[0].length===2?r[0].slice(-1):r[0];return[E$(S),!1,f-t,!1]}let d="["+(u?"^":"")+SA(r)+"]",p="["+(u?"":"^")+SA(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,f-t,!0]},"parseClass");var si=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Yr,T$=new Set(["!","?","+","*","@"]),R2=o(n=>T$.has(n),"isExtglobType"),wA=o(n=>R2(n.type),"isExtglobAST"),x$=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),A$=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),C$=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),EA=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),I$="(?!(?:^|/)\\.\\.?(?:$|/))",Pd="(?!\\.)",O$=new Set(["[","."]),P$=new Set(["..","."]),R$=new Set("().*{}+?[]^$\\!"),F$=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),F2="[^/]",TA=F2+"*?",xA=F2+"+?",Ra=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#v;#i;#u=!1;#s;#l;#a=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#v=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,r=t.#c;for(;r;){for(let i=t.#v+1;!r.type&&i<r.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}t=r,r=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Yr&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#v===0)return!0;let e=this.#c;for(let t=0;t<this.#v;t++){let r=e.#t[t];if(!(r instanceof Yr&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Yr(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let a=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let S=r,E="";for(;S<e.length;){let A=e.charAt(S++);if(c||A==="\\"){c=!c,E+=A;continue}if(l){S===u+1?(A==="^"||A==="!")&&(f=!0):A==="]"&&!(S===u+2&&f)&&(l=!1),E+=A;continue}else if(A==="["){l=!0,u=S,f=!1,E+=A;continue}if(!i.noext&&R2(A)&&e.charAt(S)==="("&&s<=a){t.push(E),E="";let k=new Yr(A,t);S=Yr.#g(e,k,S,i,s+1),t.push(k);continue}E+=A}return t.push(E),S}let h=r+1,d=new Yr(null,t),p=[],_="";for(;h<e.length;){let S=e.charAt(h++);if(c||S==="\\"){c=!c,_+=S;continue}if(l){h===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(h===u+2&&f)&&(l=!1),_+=S;continue}else if(S==="["){l=!0,u=h,f=!1,_+=S;continue}if(R2(S)&&e.charAt(h)==="("&&(s<=a||t&&t.#y(S))){let A=t&&t.#y(S)?0:1;d.push(_),_="";let C=new Yr(S,d);d.push(C),h=Yr.#g(e,C,h,i,s+A);continue}if(S==="|"){d.push(_),_="",p.push(d),d=new Yr(null,t);continue}if(S===")")return _===""&&t.#t.length===0&&(t.#a=!0),d.push(_),_="",t.push(...p,d),h;_+=S}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],h}#h(e){return this.#m(e,A$)}#m(e,t=x$){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let r=e.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,t)}#y(e,t=C$){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Yr(null,r,this.options);i.#t.push(""),r.push(i),this.#E(e,t)}#E(e,t){let r=e.#t[0];this.#t.splice(t,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!EA.get(this.type)?.has(e)}#_(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=EA.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#a=!1}#S(){if(wA(this)){let e=0,t=!1;do{t=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#S(),this.#m(i)?(t=!1,this.#E(i,r)):this.#h(i)?(t=!1,this.#f(i,r)):this.#_(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#S();this.#l=void 0}static fromGlob(e,t={}){let r=new Yr(null,void 0,t);return Yr.#g(e,r,0,t,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#S(),this.#p()),!wA(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[_,S,E,A]=typeof p=="string"?Yr.#A(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||E,this.#r=this.#r||A,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&P$.has(this.#t[0]))){let _=O$,S=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),E=!t&&!e&&_.has(u.charAt(0));f=S?I$:E?Pd:""}let h="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(h="(?:$|\\/)"),[f+u+h,si(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,si(this.toString()),!1,!1]}let a=!r||e||t||!Pd?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let c="";if(this.type==="!"&&this.#a)c=(this.isStart()&&!t?Pd:"")+xA;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Pd:"")+TA+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+s+l}return[c,si(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=t.toRegExpSource(e);return this.#r=this.#r||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#A(e,t,r=!1){let i=!1,s="",a=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(R$.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,h,d,p]=bA(e,l);if(d){s+=f,a=a||h,l+=d-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?xA:TA,t=!0;continue}else c=!1;if(u==="?"){s+=F2,t=!0;continue}s+=F$(u)}return[s,si(e),!!t,a]}};Yr=Ra;var ac=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var lr=o((n,e,t={})=>($l(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cn(e,t).match(n)),"minimatch"),D$=/^\*+([^+@!?\*\[\(]*)$/,N$=o(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),L$=o(n=>e=>e.endsWith(n),"starDotExtTestDot"),M$=o(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),k$=o(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),j$=/^\*+\.\*+$/,$$=o(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),V$=o(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),U$=/^\.\*+$/,B$=o(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),q$=/^\*+$/,G$=o(n=>n.length!==0&&!n.startsWith("."),"starTest"),W$=o(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),H$=/^\?+([^+@!?\*\[\(]*)?$/,z$=o(([n,e=""])=>{let t=OA([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Q$=o(([n,e=""])=>{let t=PA([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Y$=o(([n,e=""])=>{let t=PA([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),K$=o(([n,e=""])=>{let t=OA([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),OA=o(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),PA=o(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),RA=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",AA={win32:{sep:"\\"},posix:{sep:"/"}},X$=RA==="win32"?AA.win32.sep:AA.posix.sep;lr.sep=X$;var Ct=Symbol("globstar **");lr.GLOBSTAR=Ct;var J$="[^/]",Z$=J$+"*?",eV="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",tV="(?:(?!(?:\\/|^)\\.).)*?",rV=o((n,e={})=>t=>lr(t,n,e),"filter");lr.filter=rV;var Cn=o((n,e={})=>Object.assign({},n,e),"ext"),nV=o(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return lr;let e=lr;return Object.assign(o((r,i,s={})=>e(r,i,Cn(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Cn(n,s))}static defaults(i){return e.defaults(Cn(n,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Cn(n,a))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Cn(n,s))}},unescape:o((r,i={})=>e.unescape(r,Cn(n,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Cn(n,i)),"escape"),filter:o((r,i={})=>e.filter(r,Cn(n,i)),"filter"),defaults:o(r=>e.defaults(Cn(n,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Cn(n,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Cn(n,i)),"braceExpand"),match:o((r,i,s={})=>e.match(r,i,Cn(n,s)),"match"),sep:e.sep,GLOBSTAR:Ct})},"defaults");lr.defaults=nV;var FA=o((n,e={})=>($l(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,IA.default)(n)),"braceExpand");lr.braceExpand=FA;var iV=o((n,e={})=>new cn(n,e).makeRe(),"makeRe");lr.makeRe=iV;var sV=o((n,e,t={})=>{let r=new cn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");lr.match=sV;var CA=/[?*]|[+@!]\(.*?\)|\[|\]/,aV=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){$l(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||RA,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!CA.test(s[2]))&&!CA.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,a=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])a.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])a.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])a.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[s]),i++,s++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),h=l?3:c?0:void 0,d=f?3:u?0:void 0;if(typeof h=="number"&&typeof d=="number"){let[p,_]=[e[h],t[d]];p.toLowerCase()===_.toLowerCase()&&(t[d]=p,s=d,i=h)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Ct)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let a=t.indexOf(Ct,s),c=t.lastIndexOf(Ct),[l,u,f]=r?[t.slice(s,a),t.slice(a+1),[]]:[t.slice(s,a),t.slice(a+1,c),t.slice(c+1)];if(l.length){let C=e.slice(i,i+l.length);if(!this.#r(C,l,r,0,0))return!1;i+=l.length}let h=0;if(f.length){if(f.length+i>e.length)return!1;let C=e.length-f.length;if(this.#r(e,f,r,C,0))h=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(C--,!this.#r(e,f,r,C,0)))return!1;h=f.length+1}}if(!u.length){let C=!!h;for(let k=i;k<e.length-h;k++){let G=String(e[k]);if(C=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||C}let d=[[[],0]],p=d[0],_=0,S=[0];for(let C of u)C===Ct?(S.push(_),p=[[],0],d.push(p)):(p[0].push(C),_++);let E=d.length-1,A=e.length-h;for(let C of d)C[1]=A-(S[E--]+C[0].length);return!!this.#n(e,d,i,0,r,0,!!h)}#n(e,t,r,i,s,a,c){let l=t[i];if(!l){for(let h=r;h<e.length;h++){c=!0;let d=e[h];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return c}let[u,f]=l;for(;r<=f;){if(this.#r(e.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,a+1,c);if(p!==!1)return p}let d=e[r];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let a,c,l,u;for(a=i,c=s,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");let f=t[c],h=e[a];if(this.debug(t,f,h),f===!1||f===Ct)return!1;let d;if(typeof f=="string"?(d=h===f,this.debug("string match",f,h,d)):(d=f.test(h),this.debug("pattern match",f,h,d)),!d)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return FA(this.pattern,this.options)}parse(e){$l(e);let t=this.options;if(e==="**")return Ct;if(e==="")return"";let r,i=null;(r=e.match(q$))?i=t.dot?W$:G$:(r=e.match(D$))?i=(t.nocase?t.dot?k$:M$:t.dot?L$:N$)(r[1]):(r=e.match(H$))?i=(t.nocase?t.dot?Q$:z$:t.dot?Y$:K$)(r):(r=e.match(j$))?i=t.dot?V$:$$:(r=e.match(U$))&&(i=B$);let s=Ra.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?Z$:t.dot?eV:tV,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?aV(f):f===Ct?Ct:f._src});return u.forEach((f,h)=>{let d=u[h+1],p=u[h-1];f!==Ct||p===Ct||(p===void 0?d!==void 0&&d!==Ct?u[h+1]="(?:\\/|"+r+"\\/)?"+d:u[h]=r:d===void 0?u[h-1]=p+"(?:\\/|"+r+")?":d!==Ct&&(u[h-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[h+1]=Ct))}),u.filter(f=>f!==Ct).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return lr.defaults(e).Minimatch}};lr.AST=Ra;lr.Minimatch=cn;lr.escape=ac;lr.unescape=si;var rC=require("node:url");var oc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NA=new Set,D2=typeof process=="object"&&process?process:{},LA=o((n,e,t,r)=>{typeof D2.emitWarning=="function"?D2.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),Rd=globalThis.AbortController,DA=globalThis.AbortSignal;if(typeof Rd>"u"){DA=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Rd=class{static{o(this,"AbortController")}constructor(){e()}signal=new DA;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let n=D2.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{n&&(n=!1,LA("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var oV=o(n=>!NA.has(n),"shouldWarn");var Rs=o(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),MA=o(n=>Rs(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?cc:null:null,"getUintArray"),cc=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},N2=class n{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=MA(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ul=class n{static{o(this,"LRUCache")}#e;#n;#r;#t;#c;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#a;#p;#g;#h;#m;#y;#f;#E;#T;#_;#w;#S;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#a,next:e.#p,prev:e.#g,get head(){return e.#h},get tail(){return e.#m},free:e.#y,isBackgroundFetch:o(t=>e.#d(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#I(t),"indexes"),rindexes:o(t=>e.#O(t),"rindexes"),isStale:o(t=>e.#x(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#v}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:_=0,sizeCalculation:S,fetchMethod:E,memoMethod:A,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:Q,ignoreFetchAbort:H}=e;if(t!==0&&!Rs(t))throw new TypeError("max option must be a nonnegative integer");let re=t?MA(t):Array;if(!re)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=_||this.#n,this.sizeCalculation=S,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=A,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=E,this.#S=!!E,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new re(t),this.#g=new re(t),this.#h=0,this.#m=0,this.#y=N2.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!Q,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.#n!==0&&!Rs(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let Ie="LRU_CACHE_UNBOUNDED";oV(Ie)&&(NA.add(Ie),LA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ie,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#A(){let e=new cc(this.#e),t=new cc(this.#e);this.#_=e,this.#T=t,this.#F=(s,a,c=oc.now())=>{if(t[s]=a!==0?c:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#x(s)&&this.#R(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?oc.now():0},this.#o=(s,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=o(()=>{let s=oc.now();if(this.ttlResolution>0){r=s;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return s},"getNow");this.getRemainingTTL=s=>{let a=this.#s.get(s);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#x=s=>{let a=t[s],c=e[s];return!!c&&!!a&&(r||i())-a>c}}#C=o(()=>{},"#updateItemAge");#o=o(()=>{},"#statusTTL");#F=o(()=>{},"#setItemTTL");#x=o(()=>!1,"#isStale");#P(){let e=new cc(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#d(r))return 0;if(!Rs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Rs(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#k(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=o(e=>{},"#removeItemSize");#N=o((e,t,r)=>{},"#addItemSize");#L=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#M(t)||((e||!this.#x(t))&&(yield t),t===this.#h));)t=this.#g[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#h;!(!this.#M(t)||((e||!this.#x(t))&&(yield t),t===this.#m));)t=this.#p[t]}#M(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#I())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*rentries(){for(let e of this.#O())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*keys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#d(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#l[e];t!==void 0&&!this.#d(this.#a[e])&&(yield t)}}*values(){for(let e of this.#I())this.#a[e]!==void 0&&!this.#d(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#O())this.#a[e]!==void 0&&!this.#d(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#I()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#I()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#O()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#x(t)&&(this.#R(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#a[t],i=this.#d(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#T){let a=this.#_[t],c=this.#T[t];if(a&&c){let l=a-(oc.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let r=this.#l[t],i=this.#a[t],s=this.#d(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let a={value:s};if(this.#_&&this.#T){a.ttl=this.#_[t];let c=oc.now()-this.#T[t];a.start=Math.floor(Date.now()-c)}this.#E&&(a.size=this.#E[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=oc.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#R(e,"set"),this;let h=this.#i===0?void 0:this.#s.get(e);if(h===void 0)h=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#k(!1):this.#i,this.#l[h]=e,this.#a[h]=t,this.#s.set(e,h),this.#p[this.#m]=h,this.#g[h]=this.#m,this.#m=h,this.#i++,this.#N(h,f,l),l&&(l.set="add"),u=!1;else{this.#V(h);let d=this.#a[h];if(t!==d){if(this.#S&&this.#d(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else a||(this.#w&&this.#r?.(d,e,"set"),this.#b&&this.#f?.push([d,e,"set"]));if(this.#D(h),this.#N(h,f,l),this.#a[h]=t,l){l.set="replace";let p=d&&this.#d(d)?d.__staleWhileFetching:d;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#_&&this.#A(),this.#_&&(u||this.#F(h,i,s),l&&this.#o(l,h)),!a&&this.#b&&this.#f){let d=this.#f,p;for(;p=d?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#a[this.#h];if(this.#k(!0),this.#d(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#b&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#k(e){let t=this.#h,r=this.#l[t],i=this.#a[t];return this.#S&&this.#d(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#a[t]=void 0,this.#y.push(t)),this.#i===1?(this.#h=this.#m=0,this.#y.length=0):this.#h=this.#p[t],this.#s.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let a=this.#a[s];if(this.#d(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#x(s))i&&(i.has="stale",this.#o(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#o(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#x(i))return;let s=this.#a[i];return this.#d(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#a[t];if(this.#d(s))return s;let a=new Rd,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:r,context:i},u=o((S,E=!1)=>{let{aborted:A}=a.signal,C=r.ignoreFetchAbort&&S!==void 0;if(r.status&&(A&&!E?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!C&&!E)return h(a.signal.reason);let k=p;return this.#a[t]===p&&(S===void 0?k.__staleWhileFetching?this.#a[t]=k.__staleWhileFetching:this.#R(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,S,l.options))),S},"cb"),f=o(S=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=S),h(S)),"eb"),h=o(S=>{let{aborted:E}=a.signal,A=E&&r.allowStaleOnFetchAbort,C=A||r.allowStaleOnFetchRejection,k=C||r.noDeleteOnFetchRejection,G=p;if(this.#a[t]===p&&(!k||G.__staleWhileFetching===void 0?this.#R(e,"fetch"):A||(this.#a[t]=G.__staleWhileFetching)),C)return r.status&&G.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw S},"fetchFail"),d=o((S,E)=>{let A=this.#c?.(e,s,l);A&&A instanceof Promise&&A.then(C=>S(C===void 0?void 0:C),E),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(S(void 0),r.allowStaleOnFetchAbort&&(S=o(C=>u(C,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,f),_=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#a[t]=_,_}#d(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Rd}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:S,forceRefresh:E=!1,status:A,signal:C}=t;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let k={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:A,signal:C},G=this.#s.get(e);if(G===void 0){A&&(A.fetch="miss");let Q=this.#j(e,G,k,S);return Q.__returned=Q}else{let Q=this.#a[G];if(this.#d(Q)){let K=r&&Q.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?Q.__staleWhileFetching:Q.__returned=Q}let H=this.#x(G);if(!E&&!H)return A&&(A.fetch="hit"),this.#V(G),i&&this.#C(G),A&&this.#o(A,G),Q;let re=this.#j(e,G,k,S),N=re.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=H?"stale":"refresh",N&&H&&(A.returnedStale=!0)),N?re.__staleWhileFetching:re.__returned=re}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...a}=t,c=this.get(e,a);if(!s&&c!==void 0)return c;let l=r(e,c,{options:a,context:i});return this.set(e,l,a),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#a[c],u=this.#d(l);return a&&this.#o(a,c),this.#x(c)?(a&&(a.get="stale"),u?(a&&r&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#R(e,"expire"),a&&r&&(a.returnedStale=!0),r?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#V(c),i&&this.#C(c),l))}else a&&(a.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#h?this.#h=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#R(e,"delete")}#R(e,t){let r=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.#U(t);else{this.#D(i);let s=this.#a[i];if(this.#d(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#a[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#h)this.#h=this.#p[i];else{let a=this.#g[i];this.#p[a]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#U("delete")}#U(e){for(let t of this.#O({allowStale:!0})){let r=this.#a[t];if(this.#d(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#a.fill(void 0),this.#l.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#E&&this.#E.fill(0),this.#h=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var fc=require("node:path"),HA=require("node:url"),Li=require("fs"),yV=te(require("node:fs"),1),Ns=require("node:fs/promises");var jd=require("node:events"),U2=te(require("node:stream"),1),UA=require("node:string_decoder");var kA=typeof process=="object"&&process?process:{stdout:null,stderr:null},cV=o(n=>!!n&&typeof n=="object"&&(n instanceof Ds||n instanceof U2.default||lV(n)||uV(n)),"isStream"),lV=o(n=>!!n&&typeof n=="object"&&n instanceof jd.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==U2.default.Writable.prototype.pipe,"isReadable"),uV=o(n=>!!n&&typeof n=="object"&&n instanceof jd.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),is=Symbol("EOF"),ss=Symbol("maybeEmitEnd"),Fs=Symbol("emittedEnd"),Fd=Symbol("emittingEnd"),Bl=Symbol("emittedError"),Dd=Symbol("closed"),jA=Symbol("read"),Nd=Symbol("flush"),$A=Symbol("flushChunk"),ai=Symbol("encoding"),lc=Symbol("decoder"),Qt=Symbol("flowing"),ql=Symbol("paused"),uc=Symbol("resume"),Yt=Symbol("buffer"),$r=Symbol("pipes"),Kt=Symbol("bufferLength"),L2=Symbol("bufferPush"),Ld=Symbol("bufferShift"),Sr=Symbol("objectMode"),It=Symbol("destroyed"),M2=Symbol("error"),k2=Symbol("emitData"),VA=Symbol("emitEnd"),j2=Symbol("emitEnd2"),Di=Symbol("async"),$2=Symbol("abort"),Md=Symbol("aborted"),Gl=Symbol("signal"),Fa=Symbol("dataListeners"),ln=Symbol("discarded"),Wl=o(n=>Promise.resolve().then(n),"defer"),fV=o(n=>n(),"nodefer"),hV=o(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),dV=o(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),pV=o(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),kd=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[uc](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V2=class extends kd{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},mV=o(n=>!!n.objectMode,"isObjectModeOptions"),gV=o(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Ds=class extends jd.EventEmitter{static{o(this,"Minipass")}[Qt]=!1;[ql]=!1;[$r]=[];[Yt]=[];[Sr];[ai];[Di];[lc];[is]=!1;[Fs]=!1;[Fd]=!1;[Dd]=!1;[Bl]=null;[Kt]=0;[It]=!1;[Gl];[Md]=!1;[Fa]=0;[ln]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");mV(t)?(this[Sr]=!0,this[ai]=null):gV(t)?(this[ai]=t.encoding,this[Sr]=!1):(this[Sr]=!1,this[ai]=null),this[Di]=!!t.async,this[lc]=this[ai]?new UA.StringDecoder(this[ai]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Yt],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[$r],"get")});let{signal:r}=t;r&&(this[Gl]=r,r.aborted?this[$2]():r.addEventListener("abort",()=>this[$2]()))}get bufferLength(){return this[Kt]}get encoding(){return this[ai]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Sr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Di]}set async(e){this[Di]=this[Di]||!!e}[$2](){this[Md]=!0,this.emit("abort",this[Gl]?.reason),this.destroy(this[Gl]?.reason)}get aborted(){return this[Md]}set aborted(e){}write(e,t,r){if(this[Md])return!1;if(this[is])throw new Error("write after end");if(this[It])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[Di]?Wl:fV;if(!this[Sr]&&!Buffer.isBuffer(e)){if(pV(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(dV(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Sr]?(this[Qt]&&this[Kt]!==0&&this[Nd](!0),this[Qt]?this.emit("data",e):this[L2](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt]):e.length?(typeof e=="string"&&!(t===this[ai]&&!this[lc]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ai]&&(e=this[lc].write(e)),this[Qt]&&this[Kt]!==0&&this[Nd](!0),this[Qt]?this.emit("data",e):this[L2](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt]):(this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt])}read(e){if(this[It])return null;if(this[ln]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[ss](),null;this[Sr]&&(e=null),this[Yt].length>1&&!this[Sr]&&(this[Yt]=[this[ai]?this[Yt].join(""):Buffer.concat(this[Yt],this[Kt])]);let t=this[jA](e||null,this[Yt][0]);return this[ss](),t}[jA](e,t){if(this[Sr])this[Ld]();else{let r=t;e===r.length||e===null?this[Ld]():typeof r=="string"?(this[Yt][0]=r.slice(e),t=r.slice(0,e),this[Kt]-=e):(this[Yt][0]=r.subarray(e),t=r.subarray(0,e),this[Kt]-=e)}return this.emit("data",t),!this[Yt].length&&!this[is]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[is]=!0,this.writable=!1,(this[Qt]||!this[ql])&&this[ss](),this}[uc](){this[It]||(!this[Fa]&&!this[$r].length&&(this[ln]=!0),this[ql]=!1,this[Qt]=!0,this.emit("resume"),this[Yt].length?this[Nd]():this[is]?this[ss]():this.emit("drain"))}resume(){return this[uc]()}pause(){this[Qt]=!1,this[ql]=!0,this[ln]=!1}get destroyed(){return this[It]}get flowing(){return this[Qt]}get paused(){return this[ql]}[L2](e){this[Sr]?this[Kt]+=1:this[Kt]+=e.length,this[Yt].push(e)}[Ld](){return this[Sr]?this[Kt]-=1:this[Kt]-=this[Yt][0].length,this[Yt].shift()}[Nd](e=!1){do;while(this[$A](this[Ld]())&&this[Yt].length);!e&&!this[Yt].length&&!this[is]&&this.emit("drain")}[$A](e){return this.emit("data",e),this[Qt]}pipe(e,t){if(this[It])return e;this[ln]=!1;let r=this[Fs];return t=t||{},e===kA.stdout||e===kA.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[$r].push(t.proxyErrors?new V2(this,e,t):new kd(this,e,t)),this[Di]?Wl(()=>this[uc]()):this[uc]()),e}unpipe(e){let t=this[$r].find(r=>r.dest===e);t&&(this[$r].length===1?(this[Qt]&&this[Fa]===0&&(this[Qt]=!1),this[$r]=[]):this[$r].splice(this[$r].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ln]=!1,this[Fa]++,!this[$r].length&&!this[Qt]&&this[uc]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(hV(e)&&this[Fs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Bl]){let i=t;this[Di]?Wl(()=>i.call(this,this[Bl])):i.call(this,this[Bl])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Fa]=this.listeners("data").length,this[Fa]===0&&!this[ln]&&!this[$r].length&&(this[Qt]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Fa]=0,!this[ln]&&!this[$r].length&&(this[Qt]=!1)),t}get emittedEnd(){return this[Fs]}[ss](){!this[Fd]&&!this[Fs]&&!this[It]&&this[Yt].length===0&&this[is]&&(this[Fd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Dd]&&this.emit("close"),this[Fd]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==It&&this[It])return!1;if(e==="data")return!this[Sr]&&!r?!1:this[Di]?(Wl(()=>this[k2](r)),!0):this[k2](r);if(e==="end")return this[VA]();if(e==="close"){if(this[Dd]=!0,!this[Fs]&&!this[It])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Bl]=r,super.emit(M2,r);let s=!this[Gl]||this.listeners("error").length?super.emit("error",r):!1;return this[ss](),s}else if(e==="resume"){let s=super.emit("resume");return this[ss](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[ss](),i}[k2](e){for(let r of this[$r])r.dest.write(e)===!1&&this.pause();let t=this[ln]?!1:super.emit("data",e);return this[ss](),t}[VA](){return this[Fs]?!1:(this[Fs]=!0,this.readable=!1,this[Di]?(Wl(()=>this[j2]()),!0):this[j2]())}[j2](){if(this[lc]){let t=this[lc].end();if(t){for(let r of this[$r])r.dest.write(t);this[ln]||super.emit("data",t)}}for(let t of this[$r])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Sr]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Sr]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Sr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ai]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(It,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ln]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[is])return t();let s,a,c=o(h=>{this.off("data",l),this.off("end",u),this.off(It,f),t(),a(h)},"onerr"),l=o(h=>{this.off("error",c),this.off("end",u),this.off(It,f),this.pause(),s({value:h,done:!!this[is]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",l),this.off(It,f),t(),s({done:!0,value:void 0})},"onend"),f=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((h,d)=>{a=d,s=h,this.once(It,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ln]=!1;let e=!1,t=o(()=>(this.pause(),this.off(M2,t),this.off(It,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(M2,t),this.once(It,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[It])return e?this.emit("error",e):this.emit(It),this;this[It]=!0,this[ln]=!0,this[Yt].length=0,this[Kt]=0;let t=this;return typeof t.close=="function"&&!this[Dd]&&t.close(),e?this.emit("error",e):this.emit(It),this}static get isStream(){return cV}};var vV=Li.realpathSync.native,zl={lstatSync:Li.lstatSync,readdir:Li.readdir,readdirSync:Li.readdirSync,readlinkSync:Li.readlinkSync,realpathSync:vV,promises:{lstat:Ns.lstat,readdir:Ns.readdir,readlink:Ns.readlink,realpath:Ns.realpath}},zA=o(n=>!n||n===zl||n===yV?zl:{...zl,...n,promises:{...zl.promises,...n.promises||{}}},"fsFromOption"),QA=/^\\\\\?\\([a-z]:)\\?$/i,_V=o(n=>n.replace(/\//g,"\\").replace(QA,"$1\\"),"uncToDrive"),SV=/[\\\/]/,On=0,YA=1,KA=2,Ni=4,XA=6,JA=8,Da=10,ZA=12,In=15,Hl=~In,B2=16,BA=32,Ql=64,oi=128,$d=256,Ud=512,qA=Ql|oi|Ud,bV=1023,q2=o(n=>n.isFile()?JA:n.isDirectory()?Ni:n.isSymbolicLink()?Da:n.isCharacterDevice()?KA:n.isBlockDevice()?XA:n.isSocket()?ZA:n.isFIFO()?YA:On,"entToType"),GA=new Map,Yl=o(n=>{let e=GA.get(n);if(e)return e;let t=n.normalize("NFKD");return GA.set(n,t),t},"normalize"),WA=new Map,Vd=o(n=>{let e=WA.get(n);if(e)return e;let t=Yl(n.toLowerCase());return WA.set(n,t),t},"normalizeNocase"),Bd=class extends Ul{static{o(this,"ResolveCache")}constructor(){super({max:256})}},G2=class extends Ul{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}},eC=Symbol("PathScurry setAsCwd"),br=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#v;get gid(){return this.#v}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#a;get blocks(){return this.#a}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#h;get ctimeMs(){return this.#h}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#E;get ctime(){return this.#E}#T;get birthtime(){return this.#T}#_;#w;#S;#b;#A;#C;#o;#F;#x;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=On,r,i,s,a,c){this.name=e,this.#_=s?Vd(e):Yl(e),this.#o=t&bV,this.nocase=s,this.roots=i,this.root=r||this,this.#F=a,this.#S=c.fullpath,this.#A=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=zA(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#o&=~B2,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Vd(e):Yl(e);for(let l of r)if(l.#_===i)return l;let s=this.parent?this.sep:"",a=this.#S?this.#S+s+e:void 0,c=this.newChild(e,On,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=oi),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,t=this.parent;if(!t)return this.#A=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&In)===On}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&In)===JA}isDirectory(){return(this.#o&In)===Ni}isCharacterDevice(){return(this.#o&In)===KA}isBlockDevice(){return(this.#o&In)===XA}isFIFO(){return(this.#o&In)===YA}isSocket(){return(this.#o&In)===ZA}isSymbolicLink(){return(this.#o&Da)===Da}lstatCached(){return this.#o&BA?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#P}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#o&In;return!(e!==On&&e!==Da||this.#o&$d||this.#o&oi)}calledReaddir(){return!!(this.#o&B2)}isENOENT(){return!!(this.#o&oi)}isNamed(e){return this.nocase?this.#_===Vd(e):this.#_===Yl(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#x=r}catch(t){this.#d(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#x=r}catch(t){this.#d(t.code);return}}#N(e){this.#o|=B2;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#o&oi||(this.#o=(this.#o|oi)&Hl,this.#I())}#I(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#O(){this.#o|=Ud,this.#M()}#M(){if(this.#o&Ql)return;let e=this.#o;(e&In)===Ni&&(e&=Hl),this.#o=e|Ql,this.#I()}#k(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#L()}#d(e=""){let t=this.#o;t|=$d,e==="ENOENT"&&(t|=oi),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Hl),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#$(e,t){return this.#R(e,t)||this.#V(e,t)}#V(e,t){let r=q2(e),i=this.newChild(e.name,r,{parent:this}),s=i.#o&In;return s!==Ni&&s!==Da&&s!==On&&(i.#o|=Ql),t.unshift(i),t.provisional++,i}#R(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?Vd(e.name):Yl(e.name))===i.#_)return this.#U(e,i,r,t)}}#U(e,t,r,i){let s=t.name;return t.#o=t.#o&Hl|q2(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&oi)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#o&oi)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#W(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:h,ino:d,mode:p,mtime:_,mtimeMs:S,nlink:E,rdev:A,size:C,uid:k}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=a,this.#a=c,this.#E=l,this.#h=u,this.#n=f,this.#v=h,this.#s=d,this.#r=p,this.#f=_,this.#g=S,this.#t=E,this.#i=A,this.#l=C,this.#c=k;let G=q2(e);this.#o=this.#o&Hl|G|BA,G!==On&&G!==Ni&&G!==Da&&(this.#o|=Ql)}#q=[];#G=!1;#H(e){this.#G=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,a)=>{if(s)this.#k(s.code),r.provisional=0;else{for(let c of a)this.#$(c,r);this.#N(r)}this.#H(r.slice(0,r.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#B)await this.#B;else{let r=o(()=>{},"resolve");this.#B=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#k(i.code),e.provisional=0}this.#B=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#k(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&qA)return!1;let e=In&this.#o;return e===On||e===Ni||e===Da}shouldWalk(e,t){return(this.#o&Ni)===Ni&&!(this.#o&qA)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!((Ud|$d|oi)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#P)return this.#P;if(!((Ud|$d|oi)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#O()}}[eC](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#A=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#A=void 0,i.#C=void 0,i=i.parent}},qd=class n extends br{static{o(this,"PathWin32")}sep="\\";splitSep=SV;constructor(e,t=On,r,i,s,a,c){super(e,t,r,i,s,a,c)}newChild(e,t=On,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return fc.win32.parse(e).root}getRoot(e){if(e=_V(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new hc(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(QA,"$1\\"),e===t}},Gd=class n extends br{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=On,r,i,s,a,c){super(e,t,r,i,s,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=On,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Wd=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:a=zl}={}){this.#t=zA(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,HA.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Bd,this.#n=new Bd,this.#r=new G2(s);let l=c.substring(this.rootPath.length).split(r);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,h=t.sep,d=this.rootPath,p=!1;for(let _ of l){let S=f--;u=u.child(_,{relative:new Array(S).fill("..").join(h),relativePosix:new Array(S).fill("..").join("/"),fullpath:d+=(p?"":h)+_}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=o((h,d)=>{l.add(h),h.readdirCB((p,_)=>{if(p)return d(p);let S=_.length;if(!S)return d();let E=o(()=>{--S===0&&d()},"next");for(let A of _)(!s||s(A))&&c.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(C=>C?.isUnknown()?C.lstat():C).then(C=>C?.shouldWalk(l,a)?u(C,E):E()):A.shouldWalk(l,a)?u(A,E):E()},!0)},"walk"),f=e;return new Promise((h,d)=>{u(f,p=>{if(p)return d(p);h(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let h of f){(!s||s(h))&&c.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(c,a)&&c.add(h)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ds({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,h=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=o((E,A,C=!1)=>{if(E)return c.emit("error",E);if(i&&!C){let k=[];for(let G of A)G.isSymbolicLink()&&k.push(G.realpath().then(Q=>Q?.isUnknown()?Q.lstat():Q));if(k.length){Promise.all(k).then(()=>_(null,A,!0));return}}for(let k of A)k&&(!s||s(k))&&(c.write(r?k:k.fullpath())||(d=!0));f--;for(let k of A){let G=k.realpathCached()||k;G.shouldWalk(l,a)&&u.push(G)}d&&!c.flowing?c.once("drain",h):S||h()},"onReaddir"),S=!0;p.readdirCB(_,!0),S=!1}},"process");return h(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof br||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ds({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,h=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=p.readdirSync();for(let S of _)(!s||s(S))&&(c.write(r?S:S.fullpath())||(d=!0));f--;for(let S of _){let E=S;if(S.isSymbolicLink()){if(!(i&&(E=S.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(l,a)&&u.push(E)}}d&&!c.flowing&&c.once("drain",h)},"process");return h(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[eC](t)}},hc=class extends Wd{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,fc.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return fc.win32.parse(e).root.toUpperCase()}newRoot(e){return new qd(this.rootPath,Ni,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},dc=class extends Wd{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,fc.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Gd(this.rootPath,Ni,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Kl=class extends dc{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},rre=process.platform==="win32"?qd:Gd,tC=process.platform==="win32"?hc:process.platform==="darwin"?Kl:dc;var wV=o(n=>n.length>=1,"isPatternList"),EV=o(n=>n.length>=1,"isGlobList"),pc=class n{static{o(this,"Pattern")}#e;#n;#r;length;#t;#c;#v;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!wV(e))throw new TypeError("empty pattern list");if(!EV(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,a,c,l,...u]=this.#e,[f,h,d,p,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let S=[s,a,c,l,""].join("/"),E=[f,h,d,p,""].join("/");this.#e=[S,...u],this.#n=[E,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[c,...l]=this.#n;a[0]===""&&(a.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...a],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ct}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#v=this.#v||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new n(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var TV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",mc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:a=TV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new cn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let a=new pc(i,s,0,this.platform),c=new cn(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(s))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var W2=class n{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},H2=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},z2=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Xl=class n{static{o(this,"Processor")}hasWalkedCache;matches=new H2;subwalks=new z2;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new W2}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let a=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,h);continue}else if(l===Ct){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=u?.pattern(),d=u?.rest();if(!u||(h===""||h===".")&&!d)this.matches.add(i,c,h===""||h===".");else if(h===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let s of t)for(let a of r){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Ct?i.testGlobstar(s,a,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var xV=o((n,e)=>typeof n=="string"?new mc([n],e):Array.isArray(n)?new mc(n,e):n,"makeIgnore"),Hd=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=xV(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?a+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new Xl(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,a):c.readdirCB((u,f)=>this.walkCB3(c,f,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new Xl(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),a);a()}},Jl=class extends Hd{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Zl=class extends Hd{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Ds({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var AV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ci=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,rC.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||AV,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?hc:t.platform==="darwin"?Kl:t.platform?dc:tC;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new cn(l,i)),[a,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new pc(l,f,0,this.platform)})}async walk(){return[...await new Jl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Jl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Zl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Zl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Q2=o((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new cn(t,e).hasMagic())return!0;return!1},"hasMagic");function Qd(n,e={}){return new ci(n,e).streamSync()}o(Qd,"globStreamSync");function iC(n,e={}){return new ci(n,e).stream()}o(iC,"globStream");function sC(n,e={}){return new ci(n,e).walkSync()}o(sC,"globSync");async function nC(n,e={}){return new ci(n,e).walk()}o(nC,"glob_");function Yd(n,e={}){return new ci(n,e).iterateSync()}o(Yd,"globIterateSync");function aC(n,e={}){return new ci(n,e).iterate()}o(aC,"globIterate");var CV=Qd,IV=Object.assign(iC,{sync:Qd}),OV=Yd,PV=Object.assign(aC,{sync:Yd}),RV=Object.assign(sC,{stream:Qd,iterate:Yd}),zd=Object.assign(nC,{glob:nC,globSync:sC,sync:RV,globStream:iC,stream:IV,globStreamSync:Qd,streamSync:CV,globIterate:aC,iterate:PV,globIterateSync:Yd,iterateSync:OV,Glob:ci,hasMagic:Q2,escape:ac,unescape:si});zd.glob=zd;var Na=te(zr());var Ms=class{constructor(e){this.rootPath=e}static{o(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await Ut.default.pathExists(t))throw new Na.FileNotFoundError(e);return Ut.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return Ut.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await Ut.default.pathExists(r))throw new Na.FileAlreadyExistsError(e);return await Ut.default.ensureDir(Ls.default.dirname(r)),await Ut.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await Ut.default.pathExists(r))throw new Na.FileNotFoundError(e);await Ut.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await Ut.default.ensureDir(Ls.default.dirname(r)),await Ut.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await Ut.default.pathExists(t))throw new Na.FileNotFoundError(e);await Ut.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await Ut.default.pathExists(r))throw new Na.FileNotFoundError(e);await Ut.default.ensureDir(Ls.default.dirname(i)),await Ut.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await Ut.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await Ut.default.pathExists(t)?(await Ut.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=Ls.default.join(t,"**/*.md");return(await zd(r,{nodir:!0})).map(a=>Ls.default.relative(this.rootPath,a))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return Ls.default.isAbsolute(e)?e:Ls.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=xl.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(a=>this.normalizeValue(a)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var eu=te(require("path")),Y2=te(Is());var gc=class{constructor(e){this.vaultRoot=e}static{o(this,"PathResolver")}resolve(e){if(!eu.default.isAbsolute(e))return eu.default.resolve(this.vaultRoot,e);let t=eu.default.resolve(e),r=eu.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Be(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!Y2.default.existsSync(e))throw new Al(e);if(!Y2.default.statSync(e).isFile())throw new Be(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Be(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var hC=te(zr());var oC=te(zr());var li=class{static{o(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return oC.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
538
- `).filter(i=>i.trim()).map(i=>i.replace(/^\s*-\s*/,"").trim()):[]}};var tu=class extends li{static{o(this,"StatusCommandExecutor")}constructor(e){super(e)}async executeStart(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Started: ${e}`),console.log(" Status: Doing"),console.log(` Start time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeComplete(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Completed: ${e}`),console.log(" Status: Done"),console.log(` Completion time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeTrash(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Trashed: ${e}`),console.log(" Status: Trashed"),console.log(` Resolution time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeArchive(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.frontmatterService.updateProperty(r,"archived","true");i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(t,i),console.log(`\u2705 Archived: ${e}`),console.log(" Archived: true"),console.log(" Aliases removed"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToBacklog(e){try{await this.updateStatus(e,"ems__EffortStatusBacklog","Backlog"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToAnalysis(e){try{await this.updateStatus(e,"ems__EffortStatusAnalysis","Analysis"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToToDo(e){try{await this.updateStatus(e,"ems__EffortStatusToDo","ToDo"),process.exit(0)}catch(t){W.handle(t)}}async updateStatus(e,t,r){let{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),a=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${t}]]"`);await this.fsAdapter.updateFile(i,a),console.log(`\u2705 Moved to ${r}: ${e}`),console.log(` Status: ${r}`)}};var ur=[];for(let n=0;n<256;++n)ur.push((n+256).toString(16).slice(1));function cC(n,e=0){return(ur[n[e+0]]+ur[n[e+1]]+ur[n[e+2]]+ur[n[e+3]]+"-"+ur[n[e+4]]+ur[n[e+5]]+"-"+ur[n[e+6]]+ur[n[e+7]]+"-"+ur[n[e+8]]+ur[n[e+9]]+"-"+ur[n[e+10]]+ur[n[e+11]]+ur[n[e+12]]+ur[n[e+13]]+ur[n[e+14]]+ur[n[e+15]]).toLowerCase()}o(cC,"unsafeStringify");var lC=require("node:crypto");var Xd=new Uint8Array(256),Kd=Xd.length;function K2(){return Kd>Xd.length-16&&((0,lC.randomFillSync)(Xd),Kd=0),Xd.slice(Kd,Kd+=16)}o(K2,"rng");var uC=require("node:crypto"),X2={randomUUID:uC.randomUUID};function DV(n,e,t){n=n||{};let r=n.random??n.rng?.()??K2();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return cC(r)}o(DV,"_v4");function NV(n,e,t){return X2.randomUUID&&!e&&!n?X2.randomUUID():DV(n,e,t)}o(NV,"v4");var J2=NV;var yc=te(zr());var ru=class extends li{static{o(this,"AssetCreationExecutor")}constructor(e){super(e)}async executeCreateTask(e,t,r={}){try{await this.createAsset(e,t,"ems__Task",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateMeeting(e,t,r={}){try{await this.createAsset(e,t,"ems__Meeting",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateProject(e,t,r={}){try{await this.createAsset(e,t,"ems__Project",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateArea(e,t,r={}){try{await this.createAsset(e,t,"ems__Area",r),process.exit(0)}catch(i){W.handle(i)}}async createAsset(e,t,r,i={}){if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let s=t.trim(),{relativePath:a}=this.resolveAndValidate(e);if(await this.fsAdapter.fileExists(a))throw new yc.FileAlreadyExistsError(e);let l=J2(),u=this.buildAssetFrontmatter(r,l,s,i),f=yc.MetadataHelpers.buildFileContent(u);await this.fsAdapter.createFile(a,f),console.log(`\u2705 Created ${this.getAssetTypeName(r)}: ${e}`),console.log(` UID: ${l}`),console.log(` Label: ${s}`),console.log(` Class: ${r}`)}buildAssetFrontmatter(e,t,r,i={}){let s=yc.DateFormatter.toLocalTimestamp(new Date),a={exo__Asset_isDefinedBy:'"[[Ontology/EMS]]"',exo__Asset_uid:t,exo__Asset_label:r,exo__Asset_createdAt:s,exo__Instance_class:[`"[[${e}]]"`],aliases:[r]};return(e==="ems__Task"||e==="ems__Project"||e==="ems__Meeting")&&(a.ems__Effort_status='"[[ems__EffortStatusDraft]]"'),i.prototype&&(a.ems__Effort_prototype=`"[[${i.prototype}]]"`),i.area&&(a.ems__Effort_area=`"[[${i.area}]]"`),i.parent&&(a.ems__Effort_parent=`"[[${i.parent}]]"`),a}getAssetTypeName(e){return{ems__Task:"task",ems__Meeting:"meeting",ems__Project:"project",ems__Area:"area"}[e]||"asset"}};var Z2=te(require("path"));var fC=te(zr());var nu=class extends li{static{o(this,"PropertyCommandExecutor")}constructor(e){super(e)}async executeRenameToUid(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.getFileMetadata(t);if(!r.exo__Asset_uid)throw new Error("Asset missing exo__Asset_uid property");let i=Z2.default.basename(t,".md"),s=r.exo__Asset_uid;if(i===s&&(console.log(`\u2705 Already renamed: ${e}`),console.log(` Current filename matches UID: ${s}.md`),process.exit(0)),!r.exo__Asset_label||r.exo__Asset_label.trim()===""){let l=await this.fsAdapter.readFile(t),u=this.frontmatterService.updateProperty(l,"exo__Asset_label",i),f=this.isAssetArchived(r),h=u;f||(h=this.frontmatterService.updateProperty(u,"aliases",`
537
+ \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${l.tripleCount.toLocaleString()}`),console.log(` Created: ${l.createdAt.toISOString()}`),console.log(` Valid: ${l.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${p$(l.sizeBytes)}`))}}}catch(t){W.handle(t)}})}o(sA,"sparqlIndexCommand");function p$(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}o(p$,"formatBytes");function aA(){return new ut("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";W.setFormat(e);try{let t=new sc,r=t.listTemplates();if(e==="json"){let i=_e.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){W.handle(t)}})}o(aA,"sparqlTemplatesCommand");var dC=require("path");var Ut=te(Is()),Ls=te(require("path"));var IA=te(_A(),1);var $l=o(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var w$={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Vl=o(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),E$=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),SA=o(n=>n.join(""),"rangesToString"),bA=o((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,a=!1,c=!1,l=!1,u=!1,f=t,h="";e:for(;s<n.length;){let S=n.charAt(s);if((S==="!"||S==="^")&&s===t+1){u=!0,s++;continue}if(S==="]"&&a&&!l){f=s+1;break}if(a=!0,S==="\\"&&!l){l=!0,s++;continue}if(S==="["&&!l){for(let[E,[A,C,k]]of Object.entries(w$))if(n.startsWith(E,s)){if(h)return["$.",!1,n.length-t,!0];s+=E.length,k?i.push(A):r.push(A),c=c||C;continue e}}if(l=!1,h){S>h?r.push(Vl(h)+"-"+Vl(S)):S===h&&r.push(Vl(S)),h="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Vl(S+"-")),s+=2;continue}if(n.startsWith("-",s+1)){h=S,s+=2;continue}r.push(Vl(S)),s++}if(f<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let S=r[0].length===2?r[0].slice(-1):r[0];return[E$(S),!1,f-t,!1]}let d="["+(u?"^":"")+SA(r)+"]",p="["+(u?"":"^")+SA(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,f-t,!0]},"parseClass");var ai=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Yr,T$=new Set(["!","?","+","*","@"]),R2=o(n=>T$.has(n),"isExtglobType"),wA=o(n=>R2(n.type),"isExtglobAST"),x$=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),A$=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),C$=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),EA=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),I$="(?!(?:^|/)\\.\\.?(?:$|/))",Pd="(?!\\.)",O$=new Set(["[","."]),P$=new Set(["..","."]),R$=new Set("().*{}+?[]^$\\!"),F$=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),F2="[^/]",TA=F2+"*?",xA=F2+"+?",Ra=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#v;#i;#u=!1;#s;#l;#a=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#v=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,r=t.#c;for(;r;){for(let i=t.#v+1;!r.type&&i<r.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}t=r,r=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Yr&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#v===0)return!0;let e=this.#c;for(let t=0;t<this.#v;t++){let r=e.#t[t];if(!(r instanceof Yr&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Yr(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let a=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let S=r,E="";for(;S<e.length;){let A=e.charAt(S++);if(c||A==="\\"){c=!c,E+=A;continue}if(l){S===u+1?(A==="^"||A==="!")&&(f=!0):A==="]"&&!(S===u+2&&f)&&(l=!1),E+=A;continue}else if(A==="["){l=!0,u=S,f=!1,E+=A;continue}if(!i.noext&&R2(A)&&e.charAt(S)==="("&&s<=a){t.push(E),E="";let k=new Yr(A,t);S=Yr.#g(e,k,S,i,s+1),t.push(k);continue}E+=A}return t.push(E),S}let h=r+1,d=new Yr(null,t),p=[],_="";for(;h<e.length;){let S=e.charAt(h++);if(c||S==="\\"){c=!c,_+=S;continue}if(l){h===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(h===u+2&&f)&&(l=!1),_+=S;continue}else if(S==="["){l=!0,u=h,f=!1,_+=S;continue}if(R2(S)&&e.charAt(h)==="("&&(s<=a||t&&t.#y(S))){let A=t&&t.#y(S)?0:1;d.push(_),_="";let C=new Yr(S,d);d.push(C),h=Yr.#g(e,C,h,i,s+A);continue}if(S==="|"){d.push(_),_="",p.push(d),d=new Yr(null,t);continue}if(S===")")return _===""&&t.#t.length===0&&(t.#a=!0),d.push(_),_="",t.push(...p,d),h;_+=S}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],h}#h(e){return this.#m(e,A$)}#m(e,t=x$){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let r=e.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,t)}#y(e,t=C$){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Yr(null,r,this.options);i.#t.push(""),r.push(i),this.#E(e,t)}#E(e,t){let r=e.#t[0];this.#t.splice(t,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!EA.get(this.type)?.has(e)}#_(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=EA.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#a=!1}#S(){if(wA(this)){let e=0,t=!1;do{t=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#S(),this.#m(i)?(t=!1,this.#E(i,r)):this.#h(i)?(t=!1,this.#f(i,r)):this.#_(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#S();this.#l=void 0}static fromGlob(e,t={}){let r=new Yr(null,void 0,t);return Yr.#g(e,r,0,t,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#S(),this.#p()),!wA(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[_,S,E,A]=typeof p=="string"?Yr.#A(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||E,this.#r=this.#r||A,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&P$.has(this.#t[0]))){let _=O$,S=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),E=!t&&!e&&_.has(u.charAt(0));f=S?I$:E?Pd:""}let h="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(h="(?:$|\\/)"),[f+u+h,ai(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,ai(this.toString()),!1,!1]}let a=!r||e||t||!Pd?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let c="";if(this.type==="!"&&this.#a)c=(this.isStart()&&!t?Pd:"")+xA;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Pd:"")+TA+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+s+l}return[c,ai(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=t.toRegExpSource(e);return this.#r=this.#r||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#A(e,t,r=!1){let i=!1,s="",a=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(R$.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,h,d,p]=bA(e,l);if(d){s+=f,a=a||h,l+=d-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?xA:TA,t=!0;continue}else c=!1;if(u==="?"){s+=F2,t=!0;continue}s+=F$(u)}return[s,ai(e),!!t,a]}};Yr=Ra;var ac=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var lr=o((n,e,t={})=>($l(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cn(e,t).match(n)),"minimatch"),D$=/^\*+([^+@!?\*\[\(]*)$/,N$=o(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),L$=o(n=>e=>e.endsWith(n),"starDotExtTestDot"),M$=o(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),k$=o(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),j$=/^\*+\.\*+$/,$$=o(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),V$=o(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),U$=/^\.\*+$/,B$=o(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),q$=/^\*+$/,G$=o(n=>n.length!==0&&!n.startsWith("."),"starTest"),W$=o(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),H$=/^\?+([^+@!?\*\[\(]*)?$/,z$=o(([n,e=""])=>{let t=OA([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Q$=o(([n,e=""])=>{let t=PA([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Y$=o(([n,e=""])=>{let t=PA([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),K$=o(([n,e=""])=>{let t=OA([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),OA=o(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),PA=o(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),RA=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",AA={win32:{sep:"\\"},posix:{sep:"/"}},X$=RA==="win32"?AA.win32.sep:AA.posix.sep;lr.sep=X$;var Ct=Symbol("globstar **");lr.GLOBSTAR=Ct;var J$="[^/]",Z$=J$+"*?",eV="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",tV="(?:(?!(?:\\/|^)\\.).)*?",rV=o((n,e={})=>t=>lr(t,n,e),"filter");lr.filter=rV;var Cn=o((n,e={})=>Object.assign({},n,e),"ext"),nV=o(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return lr;let e=lr;return Object.assign(o((r,i,s={})=>e(r,i,Cn(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Cn(n,s))}static defaults(i){return e.defaults(Cn(n,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Cn(n,a))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Cn(n,s))}},unescape:o((r,i={})=>e.unescape(r,Cn(n,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Cn(n,i)),"escape"),filter:o((r,i={})=>e.filter(r,Cn(n,i)),"filter"),defaults:o(r=>e.defaults(Cn(n,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Cn(n,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Cn(n,i)),"braceExpand"),match:o((r,i,s={})=>e.match(r,i,Cn(n,s)),"match"),sep:e.sep,GLOBSTAR:Ct})},"defaults");lr.defaults=nV;var FA=o((n,e={})=>($l(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,IA.default)(n)),"braceExpand");lr.braceExpand=FA;var iV=o((n,e={})=>new cn(n,e).makeRe(),"makeRe");lr.makeRe=iV;var sV=o((n,e,t={})=>{let r=new cn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");lr.match=sV;var CA=/[?*]|[+@!]\(.*?\)|\[|\]/,aV=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){$l(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||RA,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!CA.test(s[2]))&&!CA.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,a=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])a.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])a.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])a.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[s]),i++,s++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),h=l?3:c?0:void 0,d=f?3:u?0:void 0;if(typeof h=="number"&&typeof d=="number"){let[p,_]=[e[h],t[d]];p.toLowerCase()===_.toLowerCase()&&(t[d]=p,s=d,i=h)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Ct)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let a=t.indexOf(Ct,s),c=t.lastIndexOf(Ct),[l,u,f]=r?[t.slice(s,a),t.slice(a+1),[]]:[t.slice(s,a),t.slice(a+1,c),t.slice(c+1)];if(l.length){let C=e.slice(i,i+l.length);if(!this.#r(C,l,r,0,0))return!1;i+=l.length}let h=0;if(f.length){if(f.length+i>e.length)return!1;let C=e.length-f.length;if(this.#r(e,f,r,C,0))h=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(C--,!this.#r(e,f,r,C,0)))return!1;h=f.length+1}}if(!u.length){let C=!!h;for(let k=i;k<e.length-h;k++){let G=String(e[k]);if(C=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||C}let d=[[[],0]],p=d[0],_=0,S=[0];for(let C of u)C===Ct?(S.push(_),p=[[],0],d.push(p)):(p[0].push(C),_++);let E=d.length-1,A=e.length-h;for(let C of d)C[1]=A-(S[E--]+C[0].length);return!!this.#n(e,d,i,0,r,0,!!h)}#n(e,t,r,i,s,a,c){let l=t[i];if(!l){for(let h=r;h<e.length;h++){c=!0;let d=e[h];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return c}let[u,f]=l;for(;r<=f;){if(this.#r(e.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,a+1,c);if(p!==!1)return p}let d=e[r];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let a,c,l,u;for(a=i,c=s,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");let f=t[c],h=e[a];if(this.debug(t,f,h),f===!1||f===Ct)return!1;let d;if(typeof f=="string"?(d=h===f,this.debug("string match",f,h,d)):(d=f.test(h),this.debug("pattern match",f,h,d)),!d)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return FA(this.pattern,this.options)}parse(e){$l(e);let t=this.options;if(e==="**")return Ct;if(e==="")return"";let r,i=null;(r=e.match(q$))?i=t.dot?W$:G$:(r=e.match(D$))?i=(t.nocase?t.dot?k$:M$:t.dot?L$:N$)(r[1]):(r=e.match(H$))?i=(t.nocase?t.dot?Q$:z$:t.dot?Y$:K$)(r):(r=e.match(j$))?i=t.dot?V$:$$:(r=e.match(U$))&&(i=B$);let s=Ra.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?Z$:t.dot?eV:tV,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?aV(f):f===Ct?Ct:f._src});return u.forEach((f,h)=>{let d=u[h+1],p=u[h-1];f!==Ct||p===Ct||(p===void 0?d!==void 0&&d!==Ct?u[h+1]="(?:\\/|"+r+"\\/)?"+d:u[h]=r:d===void 0?u[h-1]=p+"(?:\\/|"+r+")?":d!==Ct&&(u[h-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[h+1]=Ct))}),u.filter(f=>f!==Ct).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return lr.defaults(e).Minimatch}};lr.AST=Ra;lr.Minimatch=cn;lr.escape=ac;lr.unescape=ai;var rC=require("node:url");var oc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NA=new Set,D2=typeof process=="object"&&process?process:{},LA=o((n,e,t,r)=>{typeof D2.emitWarning=="function"?D2.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),Rd=globalThis.AbortController,DA=globalThis.AbortSignal;if(typeof Rd>"u"){DA=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Rd=class{static{o(this,"AbortController")}constructor(){e()}signal=new DA;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let n=D2.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{n&&(n=!1,LA("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var oV=o(n=>!NA.has(n),"shouldWarn");var Rs=o(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),MA=o(n=>Rs(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?cc:null:null,"getUintArray"),cc=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},N2=class n{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=MA(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ul=class n{static{o(this,"LRUCache")}#e;#n;#r;#t;#c;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#a;#p;#g;#h;#m;#y;#f;#E;#T;#_;#w;#S;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#a,next:e.#p,prev:e.#g,get head(){return e.#h},get tail(){return e.#m},free:e.#y,isBackgroundFetch:o(t=>e.#d(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#I(t),"indexes"),rindexes:o(t=>e.#O(t),"rindexes"),isStale:o(t=>e.#x(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#v}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:_=0,sizeCalculation:S,fetchMethod:E,memoMethod:A,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:Q,ignoreFetchAbort:H}=e;if(t!==0&&!Rs(t))throw new TypeError("max option must be a nonnegative integer");let re=t?MA(t):Array;if(!re)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=_||this.#n,this.sizeCalculation=S,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=A,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=E,this.#S=!!E,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new re(t),this.#g=new re(t),this.#h=0,this.#m=0,this.#y=N2.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!Q,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.#n!==0&&!Rs(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let Ie="LRU_CACHE_UNBOUNDED";oV(Ie)&&(NA.add(Ie),LA("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ie,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#A(){let e=new cc(this.#e),t=new cc(this.#e);this.#_=e,this.#T=t,this.#F=(s,a,c=oc.now())=>{if(t[s]=a!==0?c:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#x(s)&&this.#R(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?oc.now():0},this.#o=(s,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=o(()=>{let s=oc.now();if(this.ttlResolution>0){r=s;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return s},"getNow");this.getRemainingTTL=s=>{let a=this.#s.get(s);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#x=s=>{let a=t[s],c=e[s];return!!c&&!!a&&(r||i())-a>c}}#C=o(()=>{},"#updateItemAge");#o=o(()=>{},"#statusTTL");#F=o(()=>{},"#setItemTTL");#x=o(()=>!1,"#isStale");#P(){let e=new cc(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#d(r))return 0;if(!Rs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Rs(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#k(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=o(e=>{},"#removeItemSize");#N=o((e,t,r)=>{},"#addItemSize");#L=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#M(t)||((e||!this.#x(t))&&(yield t),t===this.#h));)t=this.#g[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#h;!(!this.#M(t)||((e||!this.#x(t))&&(yield t),t===this.#m));)t=this.#p[t]}#M(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#I())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*rentries(){for(let e of this.#O())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*keys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#d(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#l[e];t!==void 0&&!this.#d(this.#a[e])&&(yield t)}}*values(){for(let e of this.#I())this.#a[e]!==void 0&&!this.#d(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#O())this.#a[e]!==void 0&&!this.#d(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#I()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#I()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#O()){let i=this.#a[r],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#x(t)&&(this.#R(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#a[t],i=this.#d(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#T){let a=this.#_[t],c=this.#T[t];if(a&&c){let l=a-(oc.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let r=this.#l[t],i=this.#a[t],s=this.#d(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let a={value:s};if(this.#_&&this.#T){a.ttl=this.#_[t];let c=oc.now()-this.#T[t];a.start=Math.floor(Date.now()-c)}this.#E&&(a.size=this.#E[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=oc.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#R(e,"set"),this;let h=this.#i===0?void 0:this.#s.get(e);if(h===void 0)h=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#k(!1):this.#i,this.#l[h]=e,this.#a[h]=t,this.#s.set(e,h),this.#p[this.#m]=h,this.#g[h]=this.#m,this.#m=h,this.#i++,this.#N(h,f,l),l&&(l.set="add"),u=!1;else{this.#V(h);let d=this.#a[h];if(t!==d){if(this.#S&&this.#d(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else a||(this.#w&&this.#r?.(d,e,"set"),this.#b&&this.#f?.push([d,e,"set"]));if(this.#D(h),this.#N(h,f,l),this.#a[h]=t,l){l.set="replace";let p=d&&this.#d(d)?d.__staleWhileFetching:d;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#_&&this.#A(),this.#_&&(u||this.#F(h,i,s),l&&this.#o(l,h)),!a&&this.#b&&this.#f){let d=this.#f,p;for(;p=d?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#a[this.#h];if(this.#k(!0),this.#d(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#b&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#k(e){let t=this.#h,r=this.#l[t],i=this.#a[t];return this.#S&&this.#d(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#a[t]=void 0,this.#y.push(t)),this.#i===1?(this.#h=this.#m=0,this.#y.length=0):this.#h=this.#p[t],this.#s.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let a=this.#a[s];if(this.#d(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#x(s))i&&(i.has="stale",this.#o(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#o(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#x(i))return;let s=this.#a[i];return this.#d(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#a[t];if(this.#d(s))return s;let a=new Rd,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:r,context:i},u=o((S,E=!1)=>{let{aborted:A}=a.signal,C=r.ignoreFetchAbort&&S!==void 0;if(r.status&&(A&&!E?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!C&&!E)return h(a.signal.reason);let k=p;return this.#a[t]===p&&(S===void 0?k.__staleWhileFetching?this.#a[t]=k.__staleWhileFetching:this.#R(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,S,l.options))),S},"cb"),f=o(S=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=S),h(S)),"eb"),h=o(S=>{let{aborted:E}=a.signal,A=E&&r.allowStaleOnFetchAbort,C=A||r.allowStaleOnFetchRejection,k=C||r.noDeleteOnFetchRejection,G=p;if(this.#a[t]===p&&(!k||G.__staleWhileFetching===void 0?this.#R(e,"fetch"):A||(this.#a[t]=G.__staleWhileFetching)),C)return r.status&&G.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw S},"fetchFail"),d=o((S,E)=>{let A=this.#c?.(e,s,l);A&&A instanceof Promise&&A.then(C=>S(C===void 0?void 0:C),E),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(S(void 0),r.allowStaleOnFetchAbort&&(S=o(C=>u(C,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,f),_=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#a[t]=_,_}#d(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Rd}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:S,forceRefresh:E=!1,status:A,signal:C}=t;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let k={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:A,signal:C},G=this.#s.get(e);if(G===void 0){A&&(A.fetch="miss");let Q=this.#j(e,G,k,S);return Q.__returned=Q}else{let Q=this.#a[G];if(this.#d(Q)){let K=r&&Q.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?Q.__staleWhileFetching:Q.__returned=Q}let H=this.#x(G);if(!E&&!H)return A&&(A.fetch="hit"),this.#V(G),i&&this.#C(G),A&&this.#o(A,G),Q;let re=this.#j(e,G,k,S),N=re.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=H?"stale":"refresh",N&&H&&(A.returnedStale=!0)),N?re.__staleWhileFetching:re.__returned=re}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...a}=t,c=this.get(e,a);if(!s&&c!==void 0)return c;let l=r(e,c,{options:a,context:i});return this.set(e,l,a),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#a[c],u=this.#d(l);return a&&this.#o(a,c),this.#x(c)?(a&&(a.get="stale"),u?(a&&r&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#R(e,"expire"),a&&r&&(a.returnedStale=!0),r?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#V(c),i&&this.#C(c),l))}else a&&(a.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#h?this.#h=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#R(e,"delete")}#R(e,t){let r=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.#U(t);else{this.#D(i);let s=this.#a[i];if(this.#d(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#a[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#h)this.#h=this.#p[i];else{let a=this.#g[i];this.#p[a]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#U("delete")}#U(e){for(let t of this.#O({allowStale:!0})){let r=this.#a[t];if(this.#d(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#a.fill(void 0),this.#l.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#E&&this.#E.fill(0),this.#h=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var fc=require("node:path"),HA=require("node:url"),Li=require("fs"),yV=te(require("node:fs"),1),Ns=require("node:fs/promises");var jd=require("node:events"),U2=te(require("node:stream"),1),UA=require("node:string_decoder");var kA=typeof process=="object"&&process?process:{stdout:null,stderr:null},cV=o(n=>!!n&&typeof n=="object"&&(n instanceof Ds||n instanceof U2.default||lV(n)||uV(n)),"isStream"),lV=o(n=>!!n&&typeof n=="object"&&n instanceof jd.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==U2.default.Writable.prototype.pipe,"isReadable"),uV=o(n=>!!n&&typeof n=="object"&&n instanceof jd.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),is=Symbol("EOF"),ss=Symbol("maybeEmitEnd"),Fs=Symbol("emittedEnd"),Fd=Symbol("emittingEnd"),Bl=Symbol("emittedError"),Dd=Symbol("closed"),jA=Symbol("read"),Nd=Symbol("flush"),$A=Symbol("flushChunk"),oi=Symbol("encoding"),lc=Symbol("decoder"),Qt=Symbol("flowing"),ql=Symbol("paused"),uc=Symbol("resume"),Yt=Symbol("buffer"),$r=Symbol("pipes"),Kt=Symbol("bufferLength"),L2=Symbol("bufferPush"),Ld=Symbol("bufferShift"),br=Symbol("objectMode"),It=Symbol("destroyed"),M2=Symbol("error"),k2=Symbol("emitData"),VA=Symbol("emitEnd"),j2=Symbol("emitEnd2"),Di=Symbol("async"),$2=Symbol("abort"),Md=Symbol("aborted"),Gl=Symbol("signal"),Fa=Symbol("dataListeners"),ln=Symbol("discarded"),Wl=o(n=>Promise.resolve().then(n),"defer"),fV=o(n=>n(),"nodefer"),hV=o(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),dV=o(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),pV=o(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),kd=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[uc](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V2=class extends kd{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},mV=o(n=>!!n.objectMode,"isObjectModeOptions"),gV=o(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Ds=class extends jd.EventEmitter{static{o(this,"Minipass")}[Qt]=!1;[ql]=!1;[$r]=[];[Yt]=[];[br];[oi];[Di];[lc];[is]=!1;[Fs]=!1;[Fd]=!1;[Dd]=!1;[Bl]=null;[Kt]=0;[It]=!1;[Gl];[Md]=!1;[Fa]=0;[ln]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");mV(t)?(this[br]=!0,this[oi]=null):gV(t)?(this[oi]=t.encoding,this[br]=!1):(this[br]=!1,this[oi]=null),this[Di]=!!t.async,this[lc]=this[oi]?new UA.StringDecoder(this[oi]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Yt],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[$r],"get")});let{signal:r}=t;r&&(this[Gl]=r,r.aborted?this[$2]():r.addEventListener("abort",()=>this[$2]()))}get bufferLength(){return this[Kt]}get encoding(){return this[oi]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[br]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Di]}set async(e){this[Di]=this[Di]||!!e}[$2](){this[Md]=!0,this.emit("abort",this[Gl]?.reason),this.destroy(this[Gl]?.reason)}get aborted(){return this[Md]}set aborted(e){}write(e,t,r){if(this[Md])return!1;if(this[is])throw new Error("write after end");if(this[It])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[Di]?Wl:fV;if(!this[br]&&!Buffer.isBuffer(e)){if(pV(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(dV(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[br]?(this[Qt]&&this[Kt]!==0&&this[Nd](!0),this[Qt]?this.emit("data",e):this[L2](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt]):e.length?(typeof e=="string"&&!(t===this[oi]&&!this[lc]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[oi]&&(e=this[lc].write(e)),this[Qt]&&this[Kt]!==0&&this[Nd](!0),this[Qt]?this.emit("data",e):this[L2](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt]):(this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Qt])}read(e){if(this[It])return null;if(this[ln]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[ss](),null;this[br]&&(e=null),this[Yt].length>1&&!this[br]&&(this[Yt]=[this[oi]?this[Yt].join(""):Buffer.concat(this[Yt],this[Kt])]);let t=this[jA](e||null,this[Yt][0]);return this[ss](),t}[jA](e,t){if(this[br])this[Ld]();else{let r=t;e===r.length||e===null?this[Ld]():typeof r=="string"?(this[Yt][0]=r.slice(e),t=r.slice(0,e),this[Kt]-=e):(this[Yt][0]=r.subarray(e),t=r.subarray(0,e),this[Kt]-=e)}return this.emit("data",t),!this[Yt].length&&!this[is]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[is]=!0,this.writable=!1,(this[Qt]||!this[ql])&&this[ss](),this}[uc](){this[It]||(!this[Fa]&&!this[$r].length&&(this[ln]=!0),this[ql]=!1,this[Qt]=!0,this.emit("resume"),this[Yt].length?this[Nd]():this[is]?this[ss]():this.emit("drain"))}resume(){return this[uc]()}pause(){this[Qt]=!1,this[ql]=!0,this[ln]=!1}get destroyed(){return this[It]}get flowing(){return this[Qt]}get paused(){return this[ql]}[L2](e){this[br]?this[Kt]+=1:this[Kt]+=e.length,this[Yt].push(e)}[Ld](){return this[br]?this[Kt]-=1:this[Kt]-=this[Yt][0].length,this[Yt].shift()}[Nd](e=!1){do;while(this[$A](this[Ld]())&&this[Yt].length);!e&&!this[Yt].length&&!this[is]&&this.emit("drain")}[$A](e){return this.emit("data",e),this[Qt]}pipe(e,t){if(this[It])return e;this[ln]=!1;let r=this[Fs];return t=t||{},e===kA.stdout||e===kA.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[$r].push(t.proxyErrors?new V2(this,e,t):new kd(this,e,t)),this[Di]?Wl(()=>this[uc]()):this[uc]()),e}unpipe(e){let t=this[$r].find(r=>r.dest===e);t&&(this[$r].length===1?(this[Qt]&&this[Fa]===0&&(this[Qt]=!1),this[$r]=[]):this[$r].splice(this[$r].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ln]=!1,this[Fa]++,!this[$r].length&&!this[Qt]&&this[uc]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(hV(e)&&this[Fs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Bl]){let i=t;this[Di]?Wl(()=>i.call(this,this[Bl])):i.call(this,this[Bl])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Fa]=this.listeners("data").length,this[Fa]===0&&!this[ln]&&!this[$r].length&&(this[Qt]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Fa]=0,!this[ln]&&!this[$r].length&&(this[Qt]=!1)),t}get emittedEnd(){return this[Fs]}[ss](){!this[Fd]&&!this[Fs]&&!this[It]&&this[Yt].length===0&&this[is]&&(this[Fd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Dd]&&this.emit("close"),this[Fd]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==It&&this[It])return!1;if(e==="data")return!this[br]&&!r?!1:this[Di]?(Wl(()=>this[k2](r)),!0):this[k2](r);if(e==="end")return this[VA]();if(e==="close"){if(this[Dd]=!0,!this[Fs]&&!this[It])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Bl]=r,super.emit(M2,r);let s=!this[Gl]||this.listeners("error").length?super.emit("error",r):!1;return this[ss](),s}else if(e==="resume"){let s=super.emit("resume");return this[ss](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[ss](),i}[k2](e){for(let r of this[$r])r.dest.write(e)===!1&&this.pause();let t=this[ln]?!1:super.emit("data",e);return this[ss](),t}[VA](){return this[Fs]?!1:(this[Fs]=!0,this.readable=!1,this[Di]?(Wl(()=>this[j2]()),!0):this[j2]())}[j2](){if(this[lc]){let t=this[lc].end();if(t){for(let r of this[$r])r.dest.write(t);this[ln]||super.emit("data",t)}}for(let t of this[$r])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[br]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[br]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[br])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[oi]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(It,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ln]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[is])return t();let s,a,c=o(h=>{this.off("data",l),this.off("end",u),this.off(It,f),t(),a(h)},"onerr"),l=o(h=>{this.off("error",c),this.off("end",u),this.off(It,f),this.pause(),s({value:h,done:!!this[is]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",l),this.off(It,f),t(),s({done:!0,value:void 0})},"onend"),f=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((h,d)=>{a=d,s=h,this.once(It,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ln]=!1;let e=!1,t=o(()=>(this.pause(),this.off(M2,t),this.off(It,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(M2,t),this.once(It,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[It])return e?this.emit("error",e):this.emit(It),this;this[It]=!0,this[ln]=!0,this[Yt].length=0,this[Kt]=0;let t=this;return typeof t.close=="function"&&!this[Dd]&&t.close(),e?this.emit("error",e):this.emit(It),this}static get isStream(){return cV}};var vV=Li.realpathSync.native,zl={lstatSync:Li.lstatSync,readdir:Li.readdir,readdirSync:Li.readdirSync,readlinkSync:Li.readlinkSync,realpathSync:vV,promises:{lstat:Ns.lstat,readdir:Ns.readdir,readlink:Ns.readlink,realpath:Ns.realpath}},zA=o(n=>!n||n===zl||n===yV?zl:{...zl,...n,promises:{...zl.promises,...n.promises||{}}},"fsFromOption"),QA=/^\\\\\?\\([a-z]:)\\?$/i,_V=o(n=>n.replace(/\//g,"\\").replace(QA,"$1\\"),"uncToDrive"),SV=/[\\\/]/,On=0,YA=1,KA=2,Ni=4,XA=6,JA=8,Da=10,ZA=12,In=15,Hl=~In,B2=16,BA=32,Ql=64,ci=128,$d=256,Ud=512,qA=Ql|ci|Ud,bV=1023,q2=o(n=>n.isFile()?JA:n.isDirectory()?Ni:n.isSymbolicLink()?Da:n.isCharacterDevice()?KA:n.isBlockDevice()?XA:n.isSocket()?ZA:n.isFIFO()?YA:On,"entToType"),GA=new Map,Yl=o(n=>{let e=GA.get(n);if(e)return e;let t=n.normalize("NFKD");return GA.set(n,t),t},"normalize"),WA=new Map,Vd=o(n=>{let e=WA.get(n);if(e)return e;let t=Yl(n.toLowerCase());return WA.set(n,t),t},"normalizeNocase"),Bd=class extends Ul{static{o(this,"ResolveCache")}constructor(){super({max:256})}},G2=class extends Ul{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}},eC=Symbol("PathScurry setAsCwd"),wr=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#v;get gid(){return this.#v}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#a;get blocks(){return this.#a}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#h;get ctimeMs(){return this.#h}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#E;get ctime(){return this.#E}#T;get birthtime(){return this.#T}#_;#w;#S;#b;#A;#C;#o;#F;#x;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=On,r,i,s,a,c){this.name=e,this.#_=s?Vd(e):Yl(e),this.#o=t&bV,this.nocase=s,this.roots=i,this.root=r||this,this.#F=a,this.#S=c.fullpath,this.#A=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=zA(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#o&=~B2,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Vd(e):Yl(e);for(let l of r)if(l.#_===i)return l;let s=this.parent?this.sep:"",a=this.#S?this.#S+s+e:void 0,c=this.newChild(e,On,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=ci),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,t=this.parent;if(!t)return this.#A=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&In)===On}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&In)===JA}isDirectory(){return(this.#o&In)===Ni}isCharacterDevice(){return(this.#o&In)===KA}isBlockDevice(){return(this.#o&In)===XA}isFIFO(){return(this.#o&In)===YA}isSocket(){return(this.#o&In)===ZA}isSymbolicLink(){return(this.#o&Da)===Da}lstatCached(){return this.#o&BA?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#P}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#o&In;return!(e!==On&&e!==Da||this.#o&$d||this.#o&ci)}calledReaddir(){return!!(this.#o&B2)}isENOENT(){return!!(this.#o&ci)}isNamed(e){return this.nocase?this.#_===Vd(e):this.#_===Yl(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#x=r}catch(t){this.#d(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#x=r}catch(t){this.#d(t.code);return}}#N(e){this.#o|=B2;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#o&ci||(this.#o=(this.#o|ci)&Hl,this.#I())}#I(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#O(){this.#o|=Ud,this.#M()}#M(){if(this.#o&Ql)return;let e=this.#o;(e&In)===Ni&&(e&=Hl),this.#o=e|Ql,this.#I()}#k(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#L()}#d(e=""){let t=this.#o;t|=$d,e==="ENOENT"&&(t|=ci),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Hl),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#$(e,t){return this.#R(e,t)||this.#V(e,t)}#V(e,t){let r=q2(e),i=this.newChild(e.name,r,{parent:this}),s=i.#o&In;return s!==Ni&&s!==Da&&s!==On&&(i.#o|=Ql),t.unshift(i),t.provisional++,i}#R(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?Vd(e.name):Yl(e.name))===i.#_)return this.#U(e,i,r,t)}}#U(e,t,r,i){let s=t.name;return t.#o=t.#o&Hl|q2(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&ci)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#o&ci)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#W(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:h,ino:d,mode:p,mtime:_,mtimeMs:S,nlink:E,rdev:A,size:C,uid:k}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=a,this.#a=c,this.#E=l,this.#h=u,this.#n=f,this.#v=h,this.#s=d,this.#r=p,this.#f=_,this.#g=S,this.#t=E,this.#i=A,this.#l=C,this.#c=k;let G=q2(e);this.#o=this.#o&Hl|G|BA,G!==On&&G!==Ni&&G!==Da&&(this.#o|=Ql)}#q=[];#G=!1;#H(e){this.#G=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,a)=>{if(s)this.#k(s.code),r.provisional=0;else{for(let c of a)this.#$(c,r);this.#N(r)}this.#H(r.slice(0,r.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#B)await this.#B;else{let r=o(()=>{},"resolve");this.#B=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#k(i.code),e.provisional=0}this.#B=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#k(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&qA)return!1;let e=In&this.#o;return e===On||e===Ni||e===Da}shouldWalk(e,t){return(this.#o&Ni)===Ni&&!(this.#o&qA)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!((Ud|$d|ci)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#P)return this.#P;if(!((Ud|$d|ci)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#O()}}[eC](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#A=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#A=void 0,i.#C=void 0,i=i.parent}},qd=class n extends wr{static{o(this,"PathWin32")}sep="\\";splitSep=SV;constructor(e,t=On,r,i,s,a,c){super(e,t,r,i,s,a,c)}newChild(e,t=On,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return fc.win32.parse(e).root}getRoot(e){if(e=_V(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new hc(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(QA,"$1\\"),e===t}},Gd=class n extends wr{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=On,r,i,s,a,c){super(e,t,r,i,s,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=On,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Wd=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:a=zl}={}){this.#t=zA(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,HA.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Bd,this.#n=new Bd,this.#r=new G2(s);let l=c.substring(this.rootPath.length).split(r);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,h=t.sep,d=this.rootPath,p=!1;for(let _ of l){let S=f--;u=u.child(_,{relative:new Array(S).fill("..").join(h),relativePosix:new Array(S).fill("..").join("/"),fullpath:d+=(p?"":h)+_}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=o((h,d)=>{l.add(h),h.readdirCB((p,_)=>{if(p)return d(p);let S=_.length;if(!S)return d();let E=o(()=>{--S===0&&d()},"next");for(let A of _)(!s||s(A))&&c.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(C=>C?.isUnknown()?C.lstat():C).then(C=>C?.shouldWalk(l,a)?u(C,E):E()):A.shouldWalk(l,a)?u(A,E):E()},!0)},"walk"),f=e;return new Promise((h,d)=>{u(f,p=>{if(p)return d(p);h(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let h of f){(!s||s(h))&&c.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(c,a)&&c.add(h)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ds({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,h=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=o((E,A,C=!1)=>{if(E)return c.emit("error",E);if(i&&!C){let k=[];for(let G of A)G.isSymbolicLink()&&k.push(G.realpath().then(Q=>Q?.isUnknown()?Q.lstat():Q));if(k.length){Promise.all(k).then(()=>_(null,A,!0));return}}for(let k of A)k&&(!s||s(k))&&(c.write(r?k:k.fullpath())||(d=!0));f--;for(let k of A){let G=k.realpathCached()||k;G.shouldWalk(l,a)&&u.push(G)}d&&!c.flowing?c.once("drain",h):S||h()},"onReaddir"),S=!0;p.readdirCB(_,!0),S=!1}},"process");return h(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof wr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ds({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,h=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=p.readdirSync();for(let S of _)(!s||s(S))&&(c.write(r?S:S.fullpath())||(d=!0));f--;for(let S of _){let E=S;if(S.isSymbolicLink()){if(!(i&&(E=S.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(l,a)&&u.push(E)}}d&&!c.flowing&&c.once("drain",h)},"process");return h(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[eC](t)}},hc=class extends Wd{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,fc.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return fc.win32.parse(e).root.toUpperCase()}newRoot(e){return new qd(this.rootPath,Ni,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},dc=class extends Wd{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,fc.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Gd(this.rootPath,Ni,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Kl=class extends dc{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},rre=process.platform==="win32"?qd:Gd,tC=process.platform==="win32"?hc:process.platform==="darwin"?Kl:dc;var wV=o(n=>n.length>=1,"isPatternList"),EV=o(n=>n.length>=1,"isGlobList"),pc=class n{static{o(this,"Pattern")}#e;#n;#r;length;#t;#c;#v;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!wV(e))throw new TypeError("empty pattern list");if(!EV(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,a,c,l,...u]=this.#e,[f,h,d,p,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let S=[s,a,c,l,""].join("/"),E=[f,h,d,p,""].join("/");this.#e=[S,...u],this.#n=[E,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[c,...l]=this.#n;a[0]===""&&(a.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...a],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ct}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#v=this.#v||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new n(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var TV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",mc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:a=TV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new cn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let a=new pc(i,s,0,this.platform),c=new cn(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(s))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var W2=class n{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},H2=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},z2=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Xl=class n{static{o(this,"Processor")}hasWalkedCache;matches=new H2;subwalks=new z2;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new W2}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let a=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,h);continue}else if(l===Ct){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=u?.pattern(),d=u?.rest();if(!u||(h===""||h===".")&&!d)this.matches.add(i,c,h===""||h===".");else if(h===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let s of t)for(let a of r){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Ct?i.testGlobstar(s,a,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var xV=o((n,e)=>typeof n=="string"?new mc([n],e):Array.isArray(n)?new mc(n,e):n,"makeIgnore"),Hd=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=xV(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?a+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new Xl(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,a):c.readdirCB((u,f)=>this.walkCB3(c,f,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new Xl(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),a);a()}},Jl=class extends Hd{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Zl=class extends Hd{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Ds({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var AV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",li=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,rC.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||AV,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?hc:t.platform==="darwin"?Kl:t.platform?dc:tC;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new cn(l,i)),[a,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new pc(l,f,0,this.platform)})}async walk(){return[...await new Jl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Jl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Zl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Zl(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Q2=o((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new cn(t,e).hasMagic())return!0;return!1},"hasMagic");function Qd(n,e={}){return new li(n,e).streamSync()}o(Qd,"globStreamSync");function iC(n,e={}){return new li(n,e).stream()}o(iC,"globStream");function sC(n,e={}){return new li(n,e).walkSync()}o(sC,"globSync");async function nC(n,e={}){return new li(n,e).walk()}o(nC,"glob_");function Yd(n,e={}){return new li(n,e).iterateSync()}o(Yd,"globIterateSync");function aC(n,e={}){return new li(n,e).iterate()}o(aC,"globIterate");var CV=Qd,IV=Object.assign(iC,{sync:Qd}),OV=Yd,PV=Object.assign(aC,{sync:Yd}),RV=Object.assign(sC,{stream:Qd,iterate:Yd}),zd=Object.assign(nC,{glob:nC,globSync:sC,sync:RV,globStream:iC,stream:IV,globStreamSync:Qd,streamSync:CV,globIterate:aC,iterate:PV,globIterateSync:Yd,iterateSync:OV,Glob:li,hasMagic:Q2,escape:ac,unescape:ai});zd.glob=zd;var Na=te(zr());var Ms=class{constructor(e){this.rootPath=e}static{o(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await Ut.default.pathExists(t))throw new Na.FileNotFoundError(e);return Ut.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return Ut.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await Ut.default.pathExists(r))throw new Na.FileAlreadyExistsError(e);return await Ut.default.ensureDir(Ls.default.dirname(r)),await Ut.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await Ut.default.pathExists(r))throw new Na.FileNotFoundError(e);await Ut.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await Ut.default.ensureDir(Ls.default.dirname(r)),await Ut.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await Ut.default.pathExists(t))throw new Na.FileNotFoundError(e);await Ut.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await Ut.default.pathExists(r))throw new Na.FileNotFoundError(e);await Ut.default.ensureDir(Ls.default.dirname(i)),await Ut.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await Ut.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await Ut.default.pathExists(t)?(await Ut.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=Ls.default.join(t,"**/*.md");return(await zd(r,{nodir:!0})).map(a=>Ls.default.relative(this.rootPath,a))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return Ls.default.isAbsolute(e)?e:Ls.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=xl.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(a=>this.normalizeValue(a)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var eu=te(require("path")),Y2=te(Is());var gc=class{constructor(e){this.vaultRoot=e}static{o(this,"PathResolver")}resolve(e){if(!eu.default.isAbsolute(e))return eu.default.resolve(this.vaultRoot,e);let t=eu.default.resolve(e),r=eu.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Be(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!Y2.default.existsSync(e))throw new Al(e);if(!Y2.default.statSync(e).isFile())throw new Be(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Be(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var hC=te(zr());var oC=te(zr());var ui=class{static{o(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return oC.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
538
+ `).filter(i=>i.trim()).map(i=>i.replace(/^\s*-\s*/,"").trim()):[]}};var tu=class extends ui{static{o(this,"StatusCommandExecutor")}constructor(e){super(e)}async executeStart(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Started: ${e}`),console.log(" Status: Doing"),console.log(` Start time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeComplete(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Completed: ${e}`),console.log(" Status: Done"),console.log(` Completion time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeTrash(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Trashed: ${e}`),console.log(" Status: Trashed"),console.log(` Resolution time: ${i}`),process.exit(0)}catch(t){W.handle(t)}}async executeArchive(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.frontmatterService.updateProperty(r,"archived","true");i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(t,i),console.log(`\u2705 Archived: ${e}`),console.log(" Archived: true"),console.log(" Aliases removed"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToBacklog(e){try{await this.updateStatus(e,"ems__EffortStatusBacklog","Backlog"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToAnalysis(e){try{await this.updateStatus(e,"ems__EffortStatusAnalysis","Analysis"),process.exit(0)}catch(t){W.handle(t)}}async executeMoveToToDo(e){try{await this.updateStatus(e,"ems__EffortStatusToDo","ToDo"),process.exit(0)}catch(t){W.handle(t)}}async updateStatus(e,t,r){let{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),a=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${t}]]"`);await this.fsAdapter.updateFile(i,a),console.log(`\u2705 Moved to ${r}: ${e}`),console.log(` Status: ${r}`)}};var ur=[];for(let n=0;n<256;++n)ur.push((n+256).toString(16).slice(1));function cC(n,e=0){return(ur[n[e+0]]+ur[n[e+1]]+ur[n[e+2]]+ur[n[e+3]]+"-"+ur[n[e+4]]+ur[n[e+5]]+"-"+ur[n[e+6]]+ur[n[e+7]]+"-"+ur[n[e+8]]+ur[n[e+9]]+"-"+ur[n[e+10]]+ur[n[e+11]]+ur[n[e+12]]+ur[n[e+13]]+ur[n[e+14]]+ur[n[e+15]]).toLowerCase()}o(cC,"unsafeStringify");var lC=require("node:crypto");var Xd=new Uint8Array(256),Kd=Xd.length;function K2(){return Kd>Xd.length-16&&((0,lC.randomFillSync)(Xd),Kd=0),Xd.slice(Kd,Kd+=16)}o(K2,"rng");var uC=require("node:crypto"),X2={randomUUID:uC.randomUUID};function DV(n,e,t){n=n||{};let r=n.random??n.rng?.()??K2();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return cC(r)}o(DV,"_v4");function NV(n,e,t){return X2.randomUUID&&!e&&!n?X2.randomUUID():DV(n,e,t)}o(NV,"v4");var J2=NV;var yc=te(zr());var ru=class extends ui{static{o(this,"AssetCreationExecutor")}constructor(e){super(e)}async executeCreateTask(e,t,r={}){try{await this.createAsset(e,t,"ems__Task",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateMeeting(e,t,r={}){try{await this.createAsset(e,t,"ems__Meeting",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateProject(e,t,r={}){try{await this.createAsset(e,t,"ems__Project",r),process.exit(0)}catch(i){W.handle(i)}}async executeCreateArea(e,t,r={}){try{await this.createAsset(e,t,"ems__Area",r),process.exit(0)}catch(i){W.handle(i)}}async createAsset(e,t,r,i={}){if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let s=t.trim(),{relativePath:a}=this.resolveAndValidate(e);if(await this.fsAdapter.fileExists(a))throw new yc.FileAlreadyExistsError(e);let l=J2(),u=this.buildAssetFrontmatter(r,l,s,i),f=yc.MetadataHelpers.buildFileContent(u);await this.fsAdapter.createFile(a,f),console.log(`\u2705 Created ${this.getAssetTypeName(r)}: ${e}`),console.log(` UID: ${l}`),console.log(` Label: ${s}`),console.log(` Class: ${r}`)}buildAssetFrontmatter(e,t,r,i={}){let s=yc.DateFormatter.toLocalTimestamp(new Date),a={exo__Asset_isDefinedBy:'"[[Ontology/EMS]]"',exo__Asset_uid:t,exo__Asset_label:r,exo__Asset_createdAt:s,exo__Instance_class:[`"[[${e}]]"`],aliases:[r]};return(e==="ems__Task"||e==="ems__Project"||e==="ems__Meeting")&&(a.ems__Effort_status='"[[ems__EffortStatusDraft]]"'),i.prototype&&(a.ems__Effort_prototype=`"[[${i.prototype}]]"`),i.area&&(a.ems__Effort_area=`"[[${i.area}]]"`),i.parent&&(a.ems__Effort_parent=`"[[${i.parent}]]"`),a}getAssetTypeName(e){return{ems__Task:"task",ems__Meeting:"meeting",ems__Project:"project",ems__Area:"area"}[e]||"asset"}};var Z2=te(require("path"));var fC=te(zr());var nu=class extends ui{static{o(this,"PropertyCommandExecutor")}constructor(e){super(e)}async executeRenameToUid(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.getFileMetadata(t);if(!r.exo__Asset_uid)throw new Error("Asset missing exo__Asset_uid property");let i=Z2.default.basename(t,".md"),s=r.exo__Asset_uid;if(i===s&&(console.log(`\u2705 Already renamed: ${e}`),console.log(` Current filename matches UID: ${s}.md`),process.exit(0)),!r.exo__Asset_label||r.exo__Asset_label.trim()===""){let l=await this.fsAdapter.readFile(t),u=this.frontmatterService.updateProperty(l,"exo__Asset_label",i),f=this.isAssetArchived(r),h=u;f||(h=this.frontmatterService.updateProperty(u,"aliases",`
539
539
  - ${i}`)),await this.fsAdapter.updateFile(t,h),console.log(` Updated label: "${i}"`)}let a=Z2.default.dirname(t),c=a!=="."?`${a}/${s}.md`:`${s}.md`;await this.fsAdapter.renameFile(t,c),console.log("\u2705 Renamed to UID format"),console.log(` Old: ${t}`),console.log(` New: ${c}`),process.exit(0)}catch(t){W.handle(t)}}async executeUpdateLabel(e,t){try{if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let r=t.trim(),{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),a=this.frontmatterService.updateProperty(s,"exo__Asset_label",r),c=this.frontmatterService.parse(a),l=this.extractAliasesFromFrontmatter(c.content);if(l.includes(r)||(l.length===0?a=this.frontmatterService.updateProperty(a,"aliases",`
540
540
  - ${r}`):a=this.frontmatterService.updateProperty(a,"aliases",`${l.map(u=>`
541
541
  - ${u}`).join("")}
542
542
  - ${r}`)),this.dryRun){if(console.log("\u{1F50D} DRY RUN: Preview of changes (not applied)"),console.log(` File: ${e}`),console.log(" Changes:"),console.log(` \u2022 exo__Asset_label: "${r}"`),l.includes(r))console.log(" \u2022 aliases: unchanged (label already present)");else{let u=l.length===0?[r]:[...l,r];console.log(` \u2022 aliases: [${u.map(f=>`"${f}"`).join(", ")}]`)}console.log(`
543
- \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0)}await this.fsAdapter.updateFile(i,a),console.log("\u2705 Updated label"),console.log(` File: ${e}`),console.log(` New label: "${r}"`),console.log(" Aliases synchronized"),process.exit(0)}catch(r){W.handle(r)}}async executeSchedule(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedStartTimestamp"),process.exit(0)}catch(r){W.handle(r)}}async executeSetDeadline(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedEndTimestamp"),process.exit(0)}catch(r){W.handle(r)}}async updatePlannedTimestamp(e,t,r){let{relativePath:i}=this.resolveAndValidate(e);if(!await this.fsAdapter.fileExists(i))throw new Error(`File not found: ${e}`);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new Error(`Invalid date format: ${t}. Expected YYYY-MM-DD (e.g., 2025-11-25)`);let a=fC.DateFormatter.toTimestampAtStartOfDay(t),c=await this.fsAdapter.readFile(i),l=this.frontmatterService.updateProperty(c,r,a);await this.fsAdapter.writeFile(i,l),console.log(`\u2705 ${r==="ems__Effort_plannedStartTimestamp"?"Scheduled":"Set deadline for"}: ${e}`),console.log(` Date: ${t}`),console.log(` Timestamp: ${a}`)}};var ks=te(require("path"));var iu=class extends li{static{o(this,"FolderRepairExecutor")}constructor(e){super(e)}async executeRepairFolder(e){try{let{relativePath:t}=this.resolveAndValidate(e),i=(await this.fsAdapter.getFileMetadata(t))?.exo__Asset_isDefinedBy;if(!i)throw new Error("Cannot determine expected folder: missing exo__Asset_isDefinedBy");let s=this.extractReference(i);if(!s)throw new Error("Cannot determine expected folder: invalid exo__Asset_isDefinedBy format");let a=await this.findReferencedFile(s,t);if(!a)throw new Error(`Cannot determine expected folder: referenced asset not found: ${s}`);let c=ks.default.dirname(a),l=c==="."?"":c,u=ks.default.dirname(t),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return console.log("\u2705 Already in correct folder"),console.log(` File: ${e}`),console.log(` Folder: ${l||"(root)"}`),process.exit(0),{moved:!1,oldPath:t,newPath:t,expectedFolder:l};if(this.dryRun){let _=ks.default.basename(t),S=l?`${l}/${_}`:_;return console.log("\u{1F50D} DRY RUN: Preview of changes (not applied)"),console.log(` File: ${e}`),console.log(` Current folder: ${f||"(root)"}`),console.log(` Expected folder: ${l||"(root)"}`),console.log(` Would move to: ${S}`),console.log(`
543
+ \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0)}await this.fsAdapter.updateFile(i,a),console.log("\u2705 Updated label"),console.log(` File: ${e}`),console.log(` New label: "${r}"`),console.log(" Aliases synchronized"),process.exit(0)}catch(r){W.handle(r)}}async executeSchedule(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedStartTimestamp"),process.exit(0)}catch(r){W.handle(r)}}async executeSetDeadline(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedEndTimestamp"),process.exit(0)}catch(r){W.handle(r)}}async updatePlannedTimestamp(e,t,r){let{relativePath:i}=this.resolveAndValidate(e);if(!await this.fsAdapter.fileExists(i))throw new Error(`File not found: ${e}`);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new Error(`Invalid date format: ${t}. Expected YYYY-MM-DD (e.g., 2025-11-25)`);let a=fC.DateFormatter.toTimestampAtStartOfDay(t),c=await this.fsAdapter.readFile(i),l=this.frontmatterService.updateProperty(c,r,a);await this.fsAdapter.writeFile(i,l),console.log(`\u2705 ${r==="ems__Effort_plannedStartTimestamp"?"Scheduled":"Set deadline for"}: ${e}`),console.log(` Date: ${t}`),console.log(` Timestamp: ${a}`)}};var ks=te(require("path"));var iu=class extends ui{static{o(this,"FolderRepairExecutor")}constructor(e){super(e)}async executeRepairFolder(e){try{let{relativePath:t}=this.resolveAndValidate(e),i=(await this.fsAdapter.getFileMetadata(t))?.exo__Asset_isDefinedBy;if(!i)throw new Error("Cannot determine expected folder: missing exo__Asset_isDefinedBy");let s=this.extractReference(i);if(!s)throw new Error("Cannot determine expected folder: invalid exo__Asset_isDefinedBy format");let a=await this.findReferencedFile(s,t);if(!a)throw new Error(`Cannot determine expected folder: referenced asset not found: ${s}`);let c=ks.default.dirname(a),l=c==="."?"":c,u=ks.default.dirname(t),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return console.log("\u2705 Already in correct folder"),console.log(` File: ${e}`),console.log(` Folder: ${l||"(root)"}`),process.exit(0),{moved:!1,oldPath:t,newPath:t,expectedFolder:l};if(this.dryRun){let _=ks.default.basename(t),S=l?`${l}/${_}`:_;return console.log("\u{1F50D} DRY RUN: Preview of changes (not applied)"),console.log(` File: ${e}`),console.log(` Current folder: ${f||"(root)"}`),console.log(` Expected folder: ${l||"(root)"}`),console.log(` Would move to: ${S}`),console.log(`
544
544
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0),{moved:!1,oldPath:t,newPath:S,expectedFolder:l}}let h=ks.default.basename(t),d=l?`${l}/${h}`:h;if(await this.fsAdapter.fileExists(d))throw new Error(`Cannot move file: ${d} already exists`);return l&&(await this.fsAdapter.directoryExists(l)||await this.fsAdapter.createDirectory(l)),await this.fsAdapter.renameFile(t,d),console.log("\u2705 Moved to correct folder"),console.log(` Old path: ${t}`),console.log(` New path: ${d}`),console.log(` Expected folder: ${l||"(root)"}`),process.exit(0),{moved:!0,oldPath:t,newPath:d,expectedFolder:l}}catch(t){W.handle(t)}}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=ks.default.dirname(t),s=i?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let h=ks.default.basename(f,".md"),d=ks.default.basename(r,".md");return h===d})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};var Jd=class{static{o(this,"CommandExecutor")}constructor(e,t=!1){this.context={pathResolver:new gc(e),fsAdapter:new Ms(e),frontmatterService:new hC.FrontmatterService,dryRun:t},this.statusExecutor=new tu(this.context),this.creationExecutor=new ru(this.context),this.propertyExecutor=new nu(this.context),this.folderRepairExecutor=new iu(this.context)}async execute(e,t,r){try{let i=this.context.pathResolver.resolve(t);this.context.pathResolver.validate(i),await this.context.fsAdapter.readFile(i.replace(this.context.pathResolver.getVaultRoot()+"/","")),console.log("\u2705 Command infrastructure verified"),console.log(` Command: ${e}`),console.log(` File: ${i}`),console.log(` Vault: ${this.context.pathResolver.getVaultRoot()}`),Object.keys(r).length>0&&console.log(` Options: ${JSON.stringify(r,null,2)}`),console.log(`
545
- \u{1F4DD} Note: Actual command execution will be implemented in follow-up issues.`),console.log(" This PR establishes the infrastructure foundation."),process.exit(0)}catch(i){W.handle(i)}}getVaultRoot(){return this.context.pathResolver.getVaultRoot()}async executeStart(e){return this.statusExecutor.executeStart(e)}async executeComplete(e){return this.statusExecutor.executeComplete(e)}async executeTrash(e){return this.statusExecutor.executeTrash(e)}async executeArchive(e){return this.statusExecutor.executeArchive(e)}async executeMoveToBacklog(e){return this.statusExecutor.executeMoveToBacklog(e)}async executeMoveToAnalysis(e){return this.statusExecutor.executeMoveToAnalysis(e)}async executeMoveToToDo(e){return this.statusExecutor.executeMoveToToDo(e)}async executeCreateTask(e,t,r={}){return this.creationExecutor.executeCreateTask(e,t,r)}async executeCreateMeeting(e,t,r={}){return this.creationExecutor.executeCreateMeeting(e,t,r)}async executeCreateProject(e,t,r={}){return this.creationExecutor.executeCreateProject(e,t,r)}async executeCreateArea(e,t,r={}){return this.creationExecutor.executeCreateArea(e,t,r)}async executeRenameToUid(e){return this.propertyExecutor.executeRenameToUid(e)}async executeUpdateLabel(e,t){return this.propertyExecutor.executeUpdateLabel(e,t)}async executeSchedule(e,t){return this.propertyExecutor.executeSchedule(e,t)}async executeSetDeadline(e,t){return this.propertyExecutor.executeSetDeadline(e,t)}async executeRepairFolder(e){return this.folderRepairExecutor.executeRepairFolder(e)}};function fr(n,e,t,r,i){if(n==="json"){let s={command:e,filepath:t,action:r,...i&&{changes:i}},a=_e.success(s);console.log(JSON.stringify(a,null,2))}else console.log(`\u2705 ${r}`)}o(fr,"outputResult");function La(n,e,t,r){let i=new Be(`--${e} option is required for ${t} command`,r,{command:t,missingOption:e});W.handle(i)}o(La,"handleMissingOption");function pC(){return new ut("command").description("Execute plugin command on single asset").argument("<command-name>","Command to execute (rename-to-uid, start, complete, schedule, set-deadline, etc.)").argument("<filepath>","Path to asset file (relative to vault root or absolute)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--label <value>","Asset label (required for update-label and creation commands)").option("--prototype <uid>","Prototype UID for inheritance (creation commands)").option("--area <uid>","Area UID for effort linkage (creation commands)").option("--parent <uid>","Parent UID for effort linkage (creation commands)").option("--date <value>","Date in YYYY-MM-DD format (required for schedule and set-deadline commands)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async(n,e,t)=>{let r=t.format||"text";W.setFormat(r);try{let i=(0,dC.resolve)(t.vault),s=new Jd(i,t.dryRun);switch(n){case"rename-to-uid":await s.executeRenameToUid(e),fr(r,n,e,"Renamed file to UID-based name");break;case"update-label":t.label||La(r,"label","update-label",'exocortex command update-label <filepath> --label "<value>"'),await s.executeUpdateLabel(e,t.label),fr(r,n,e,`Updated label to "${t.label}"`,{label:t.label});break;case"start":await s.executeStart(e),fr(r,n,e,"Started task");break;case"complete":await s.executeComplete(e),fr(r,n,e,"Completed task");break;case"trash":await s.executeTrash(e),fr(r,n,e,"Moved task to trash");break;case"archive":await s.executeArchive(e),fr(r,n,e,"Archived task");break;case"move-to-backlog":await s.executeMoveToBacklog(e),fr(r,n,e,"Moved task to backlog");break;case"move-to-analysis":await s.executeMoveToAnalysis(e),fr(r,n,e,"Moved task to analysis");break;case"move-to-todo":await s.executeMoveToToDo(e),fr(r,n,e,"Moved task to todo");break;case"create-task":t.label||La(r,"label","create-task",'exocortex command create-task <filepath> --label "<value>"'),await s.executeCreateTask(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created task "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-meeting":t.label||La(r,"label","create-meeting",'exocortex command create-meeting <filepath> --label "<value>"'),await s.executeCreateMeeting(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created meeting "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-project":t.label||La(r,"label","create-project",'exocortex command create-project <filepath> --label "<value>"'),await s.executeCreateProject(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created project "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-area":t.label||La(r,"label","create-area",'exocortex command create-area <filepath> --label "<value>"'),await s.executeCreateArea(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created area "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"schedule":t.date||La(r,"date","schedule",'exocortex command schedule <filepath> --date "YYYY-MM-DD"'),await s.executeSchedule(e,t.date),fr(r,n,e,`Scheduled task for ${t.date}`,{date:t.date});break;case"set-deadline":t.date||La(r,"date","set-deadline",'exocortex command set-deadline <filepath> --date "YYYY-MM-DD"'),await s.executeSetDeadline(e,t.date),fr(r,n,e,`Set deadline to ${t.date}`,{date:t.date});break;case"repair-folder":{let a=await s.executeRepairFolder(e);fr(r,n,e,a.moved?`Moved to correct folder: ${a.newPath}`:"Already in correct folder",{moved:a.moved,oldPath:a.oldPath,newPath:a.newPath,expectedFolder:a.expectedFolder});break}default:await s.execute(n,e,t),fr(r,n,e,`Executed ${n}`);break}}catch(i){W.handle(i)}})}o(pC,"commandCommand");var gC=require("path");var as=te(require("fs")),ev=te(require("path")),mC=require("events");var LV={watch:as.default.watch.bind(as.default),existsSync:as.default.existsSync.bind(as.default),statSync:as.default.statSync.bind(as.default),readFileSync:as.default.readFileSync.bind(as.default)},Zd=class extends mC.EventEmitter{constructor(t,r={}){super();this.watcher=null;this.debounceTimers=new Map;this.isRunning=!1;this.vaultPath=ev.default.resolve(t),this.fsAdapter=r.fsAdapter??LV,this.options={pattern:r.pattern??"**/*.md",assetType:r.assetType??"",debounceMs:r.debounceMs??100,recursive:r.recursive??!0}}static{o(this,"FileSystemWatcher")}start(){this.isRunning||(this.watcher=this.fsAdapter.watch(this.vaultPath,{recursive:this.options.recursive},(t,r)=>{r&&this.handleFileEvent(t,r.toString())}),this.watcher.on("error",t=>{this.emit("error",t)}),this.isRunning=!0,this.emit("started"))}stop(){if(this.isRunning){for(let t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear(),this.watcher&&(this.watcher.close(),this.watcher=null),this.isRunning=!1,this.emit("stopped")}}isWatching(){return this.isRunning}handleFileEvent(t,r){let i=ev.default.join(this.vaultPath,r),s=r;if(!this.matchesPattern(s))return;let a=this.debounceTimers.get(i);a&&clearTimeout(a);let c=setTimeout(()=>{this.debounceTimers.delete(i),this.processFileEvent(i,s)},this.options.debounceMs);this.debounceTimers.set(i,c)}processFileEvent(t,r){let i=this.fsAdapter.existsSync(t),s;if(!i)s="delete";else{let l=this.fsAdapter.statSync(t);s=Date.now()-l.birthtimeMs<1e3?"create":"modify"}let a;if(i&&t.endsWith(".md")&&(a=this.extractAssetType(t)),this.options.assetType&&a!==this.options.assetType)return;let c={type:s,path:t,relativePath:r,timestamp:new Date().toISOString(),assetType:a};this.emit("change",c)}matchesPattern(t){return this.options.pattern?lr(t,this.options.pattern):!0}extractAssetType(t){try{let i=this.fsAdapter.readFileSync(t,"utf-8").match(/^---\n([\s\S]*?)\n---/);if(!i)return;let a=i[1].match(/exo__Instance_class:\s*(?:\[?"?\[\[([^\]]+)\]\]"?\]?|"?\[\[([^\]]+)\]\]"?)/);return a?a[1]||a[2]:void 0}catch{return}}};var tv=te(require("fs"));function yC(){return new ut("watch").description("Watch vault for file changes and emit NDJSON events").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--pattern <glob>","Glob pattern to filter files (e.g., '*.md', 'tasks/**')").option("--asset-type <type>","Filter by asset type (e.g., 'ems__Task', 'ems__Project')").option("--debounce <ms>","Debounce interval in milliseconds","100").action(async n=>{W.setFormat("json");try{let e=(0,gC.resolve)(n.vault);if(!tv.default.existsSync(e))throw new wt(e);if(!tv.default.statSync(e).isDirectory())throw new Be(`Vault path is not a directory: ${e}`,"Provide a path to a directory, not a file",{vaultPath:e});let t=parseInt(n.debounce?.toString()??"100",10);if(isNaN(t)||t<0)throw new Be("--debounce must be a non-negative integer","Use a positive integer value for debounce",{debounce:n.debounce});let r=new Zd(e,{pattern:n.pattern,assetType:n.assetType,debounceMs:t});r.on("change",s=>{console.log(JSON.stringify(s))}),r.on("error",s=>{let a=_e.error("INTERNAL_OPERATION_FAILED",s.message,5,{recovery:{message:"Check file permissions and vault access",suggestion:"Ensure the vault directory is accessible"}});console.log(JSON.stringify(a))});let i=o(()=>{r.stop(),process.exit(0)},"shutdown");process.on("SIGINT",i),process.on("SIGTERM",i),console.error(`Watching vault: ${e}`),n.pattern&&console.error(` Pattern filter: ${n.pattern}`),n.assetType&&console.error(` Asset type filter: ${n.assetType}`),console.error(` Debounce: ${t}ms`),console.error("Press Ctrl+C to stop"),r.start()}catch(e){W.handle(e)}})}o(yC,"watchCommand");var nv=require("path"),iv=te(Is());var Ma=te(require("path"));var vc=te(zr());var ui=te(Is()),rv=te(require("crypto"));var ep=class{constructor(){this.backups=new Map;this.fileHashes=new Map}static{o(this,"TransactionManager")}async begin(e){if(!ui.default.existsSync(e))throw new Error(`Cannot backup non-existent file: ${e}`);let t=await ui.default.readFile(e,"utf-8"),r=rv.default.createHash("sha256").update(t).digest("hex");this.fileHashes.set(e,r);let i=`${e}.backup.${Date.now()}`;await ui.default.writeFile(i,t,"utf-8"),this.backups.set(e,i)}async verify(e){let t=this.fileHashes.get(e);if(!t)return!0;if(!ui.default.existsSync(e))return!1;let r=await ui.default.readFile(e,"utf-8");return rv.default.createHash("sha256").update(r).digest("hex")===t}async commit(){for(let e of this.backups.values())ui.default.existsSync(e)&&await ui.default.remove(e);this.backups.clear(),this.fileHashes.clear()}async rollback(){for(let[e,t]of this.backups.entries())ui.default.existsSync(t)&&(await ui.default.copy(t,e,{overwrite:!0}),await ui.default.remove(t));this.backups.clear(),this.fileHashes.clear()}getTrackedFiles(){return Array.from(this.backups.keys())}};var ka=class{static{o(this,"BatchExecutor")}constructor(e,t=!1){this.pathResolver=new gc(e),this.fsAdapter=new Ms(e),this.frontmatterService=new vc.FrontmatterService,this.transactionManager=new ep,this.dryRun=t}async executeBatch(e,t=!1){let r=Date.now(),i=[],s=0,a=0;if(e.length===0)return{success:!0,total:0,succeeded:0,failed:0,results:[],durationMs:Date.now()-r,atomic:t};if(t&&!this.dryRun)try{await this.backupAllFiles(e)}catch(l){return{success:!1,total:e.length,succeeded:0,failed:e.length,results:e.map(u=>({success:!1,command:u.command,filepath:u.filepath,error:`Backup failed: ${l.message}`})),durationMs:Date.now()-r,atomic:t}}for(let l of e){let u=await this.executeSingleOperation(l);if(i.push(u),u.success)s++;else if(a++,t&&!this.dryRun){await this.transactionManager.rollback();let f=i.length;for(let h=f;h<e.length;h++)i.push({success:!1,command:e[h].command,filepath:e[h].filepath,error:"Not executed due to atomic rollback"}),a++;return{success:!1,total:e.length,succeeded:0,failed:e.length,results:i,durationMs:Date.now()-r,atomic:t,rolledBack:!0}}}return t&&!this.dryRun&&await this.transactionManager.commit(),{success:a===0,total:e.length,succeeded:s,failed:a,results:i,durationMs:Date.now()-r,atomic:t,...t&&{rolledBack:!1}}}static parseInput(e){try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Be("Batch input must be a JSON array of operations",`exo batch --input '[{"command":"start","filepath":"task.md"}]'`);for(let r of t){if(!r.command||typeof r.command!="string")throw new Be('Each operation must have a "command" string property','{"command":"start","filepath":"task.md"}');if(!r.filepath||typeof r.filepath!="string")throw new Be('Each operation must have a "filepath" string property','{"command":"start","filepath":"task.md"}')}return t}catch(t){throw t instanceof Be?t:new Be(`Failed to parse batch input: ${t.message}`,`exo batch --input '[{"command":"start","filepath":"task.md"}]'`)}}async backupAllFiles(e){let t=new Set;for(let r of e){let i=this.pathResolver.resolve(r.filepath);t.add(i)}for(let r of t)await this.transactionManager.begin(r)}async executeSingleOperation(e){try{let t=this.pathResolver.resolve(e.filepath);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");if(await this.fsAdapter.readFile(r),this.dryRun)return{success:!0,command:e.command,filepath:e.filepath,action:`Would execute ${e.command} (dry-run)`};switch(e.command){case"start":return await this.executeStart(r,e);case"complete":return await this.executeComplete(r,e);case"trash":return await this.executeTrash(r,e);case"archive":return await this.executeArchive(r,e);case"move-to-backlog":return await this.executeStatusUpdate(r,e,"ems__EffortStatusBacklog","Moved to backlog");case"move-to-analysis":return await this.executeStatusUpdate(r,e,"ems__EffortStatusAnalysis","Moved to analysis");case"move-to-todo":return await this.executeStatusUpdate(r,e,"ems__EffortStatusToDo","Moved to todo");case"update-label":return await this.executeUpdateLabel(r,e);case"schedule":return await this.executeSchedule(r,e);case"set-deadline":return await this.executeSetDeadline(r,e);case"repair-folder":return await this.executeRepairFolder(r,e);default:return{success:!1,command:e.command,filepath:e.filepath,error:`Unknown command: ${e.command}`}}}catch(t){return{success:!1,command:e.command,filepath:e.filepath,error:t.message}}}getCurrentTimestamp(){return vc.DateFormatter.toLocalTimestamp(new Date)}async executeStart(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Started task",changes:{status:"Doing",startTimestamp:i}}}async executeComplete(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Completed task",changes:{status:"Done",endTimestamp:i,resolutionTimestamp:i}}}async executeTrash(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Trashed task",changes:{status:"Trashed",resolutionTimestamp:i}}}async executeArchive(e,t){let r=await this.fsAdapter.readFile(e),i=this.frontmatterService.updateProperty(r,"archived","true");return i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(e,i),{success:!0,command:t.command,filepath:t.filepath,action:"Archived task",changes:{archived:!0,aliasesRemoved:!0}}}async executeStatusUpdate(e,t,r,i){let s=await this.fsAdapter.readFile(e),a=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${r}]]"`);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:i,changes:{status:r.replace("ems__EffortStatus","")}}}async executeUpdateLabel(e,t){let r=t.options?.label;if(!r||r.trim()==="")return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "label"'};let i=r.trim(),s=await this.fsAdapter.readFile(e),a=this.frontmatterService.updateProperty(s,"exo__Asset_label",`"${i}"`);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Updated label to "${i}"`,changes:{label:i}}}async executeSchedule(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=vc.DateFormatter.toTimestampAtStartOfDay(r),a=this.frontmatterService.updateProperty(i,"ems__Effort_scheduledTimestamp",s);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Scheduled for ${r}`,changes:{scheduledTimestamp:s}}}async executeSetDeadline(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=vc.DateFormatter.toTimestampAtStartOfDay(r),a=this.frontmatterService.updateProperty(i,"ems__Effort_deadlineTimestamp",s);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Set deadline to ${r}`,changes:{deadlineTimestamp:s}}}async executeRepairFolder(e,t){let i=(await this.fsAdapter.getFileMetadata(e))?.exo__Asset_isDefinedBy;if(!i)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: missing exo__Asset_isDefinedBy"};let s=this.extractReference(i);if(!s)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: invalid exo__Asset_isDefinedBy format"};let a=await this.findReferencedFile(s,e);if(!a)return{success:!1,command:t.command,filepath:t.filepath,error:`Cannot determine expected folder: referenced asset not found: ${s}`};let c=Ma.default.dirname(a),l=c==="."?"":c,u=Ma.default.dirname(e),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return{success:!0,command:t.command,filepath:t.filepath,action:"Already in correct folder",changes:{moved:!1,folder:l||"(root)"}};let h=Ma.default.basename(e),d=l?`${l}/${h}`:h;return await this.fsAdapter.fileExists(d)?{success:!1,command:t.command,filepath:t.filepath,error:`Cannot move file: ${d} already exists`}:(await this.fsAdapter.renameFile(e,d),{success:!0,command:t.command,filepath:t.filepath,action:`Moved to ${l||"(root)"}`,changes:{moved:!0,oldPath:e,newPath:d,expectedFolder:l||"(root)"}})}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=Ma.default.dirname(t),s=i!=="."?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let h=Ma.default.basename(f,".md"),d=Ma.default.basename(r,".md");return h===d})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};function MV(n,e){if(n==="json"){let t=_e.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
545
+ \u{1F4DD} Note: Actual command execution will be implemented in follow-up issues.`),console.log(" This PR establishes the infrastructure foundation."),process.exit(0)}catch(i){W.handle(i)}}getVaultRoot(){return this.context.pathResolver.getVaultRoot()}async executeStart(e){return this.statusExecutor.executeStart(e)}async executeComplete(e){return this.statusExecutor.executeComplete(e)}async executeTrash(e){return this.statusExecutor.executeTrash(e)}async executeArchive(e){return this.statusExecutor.executeArchive(e)}async executeMoveToBacklog(e){return this.statusExecutor.executeMoveToBacklog(e)}async executeMoveToAnalysis(e){return this.statusExecutor.executeMoveToAnalysis(e)}async executeMoveToToDo(e){return this.statusExecutor.executeMoveToToDo(e)}async executeCreateTask(e,t,r={}){return this.creationExecutor.executeCreateTask(e,t,r)}async executeCreateMeeting(e,t,r={}){return this.creationExecutor.executeCreateMeeting(e,t,r)}async executeCreateProject(e,t,r={}){return this.creationExecutor.executeCreateProject(e,t,r)}async executeCreateArea(e,t,r={}){return this.creationExecutor.executeCreateArea(e,t,r)}async executeRenameToUid(e){return this.propertyExecutor.executeRenameToUid(e)}async executeUpdateLabel(e,t){return this.propertyExecutor.executeUpdateLabel(e,t)}async executeSchedule(e,t){return this.propertyExecutor.executeSchedule(e,t)}async executeSetDeadline(e,t){return this.propertyExecutor.executeSetDeadline(e,t)}async executeRepairFolder(e){return this.folderRepairExecutor.executeRepairFolder(e)}};function fr(n,e,t,r,i){if(n==="json"){let s={command:e,filepath:t,action:r,...i&&{changes:i}},a=_e.success(s);console.log(JSON.stringify(a,null,2))}else console.log(`\u2705 ${r}`)}o(fr,"outputResult");function La(n,e,t,r){let i=new Be(`--${e} option is required for ${t} command`,r,{command:t,missingOption:e});W.handle(i)}o(La,"handleMissingOption");function pC(){return new ut("command").description("Execute plugin command on single asset").argument("<command-name>","Command to execute (rename-to-uid, start, complete, schedule, set-deadline, etc.)").argument("<filepath>","Path to asset file (relative to vault root or absolute)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--label <value>","Asset label (required for update-label and creation commands)").option("--prototype <uid>","Prototype UID for inheritance (creation commands)").option("--area <uid>","Area UID for effort linkage (creation commands)").option("--parent <uid>","Parent UID for effort linkage (creation commands)").option("--date <value>","Date in YYYY-MM-DD format (required for schedule and set-deadline commands)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async(n,e,t)=>{let r=t.format||"text";W.setFormat(r);try{let i=(0,dC.resolve)(t.vault),s=new Jd(i,t.dryRun);switch(n){case"rename-to-uid":await s.executeRenameToUid(e),fr(r,n,e,"Renamed file to UID-based name");break;case"update-label":t.label||La(r,"label","update-label",'exocortex command update-label <filepath> --label "<value>"'),await s.executeUpdateLabel(e,t.label),fr(r,n,e,`Updated label to "${t.label}"`,{label:t.label});break;case"start":await s.executeStart(e),fr(r,n,e,"Started task");break;case"complete":await s.executeComplete(e),fr(r,n,e,"Completed task");break;case"trash":await s.executeTrash(e),fr(r,n,e,"Moved task to trash");break;case"archive":await s.executeArchive(e),fr(r,n,e,"Archived task");break;case"move-to-backlog":await s.executeMoveToBacklog(e),fr(r,n,e,"Moved task to backlog");break;case"move-to-analysis":await s.executeMoveToAnalysis(e),fr(r,n,e,"Moved task to analysis");break;case"move-to-todo":await s.executeMoveToToDo(e),fr(r,n,e,"Moved task to todo");break;case"create-task":t.label||La(r,"label","create-task",'exocortex command create-task <filepath> --label "<value>"'),await s.executeCreateTask(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created task "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-meeting":t.label||La(r,"label","create-meeting",'exocortex command create-meeting <filepath> --label "<value>"'),await s.executeCreateMeeting(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created meeting "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-project":t.label||La(r,"label","create-project",'exocortex command create-project <filepath> --label "<value>"'),await s.executeCreateProject(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created project "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-area":t.label||La(r,"label","create-area",'exocortex command create-area <filepath> --label "<value>"'),await s.executeCreateArea(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),fr(r,n,e,`Created area "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"schedule":t.date||La(r,"date","schedule",'exocortex command schedule <filepath> --date "YYYY-MM-DD"'),await s.executeSchedule(e,t.date),fr(r,n,e,`Scheduled task for ${t.date}`,{date:t.date});break;case"set-deadline":t.date||La(r,"date","set-deadline",'exocortex command set-deadline <filepath> --date "YYYY-MM-DD"'),await s.executeSetDeadline(e,t.date),fr(r,n,e,`Set deadline to ${t.date}`,{date:t.date});break;case"repair-folder":{let a=await s.executeRepairFolder(e);fr(r,n,e,a.moved?`Moved to correct folder: ${a.newPath}`:"Already in correct folder",{moved:a.moved,oldPath:a.oldPath,newPath:a.newPath,expectedFolder:a.expectedFolder});break}default:await s.execute(n,e,t),fr(r,n,e,`Executed ${n}`);break}}catch(i){W.handle(i)}})}o(pC,"commandCommand");var gC=require("path");var as=te(require("fs")),ev=te(require("path")),mC=require("events");var LV={watch:as.default.watch.bind(as.default),existsSync:as.default.existsSync.bind(as.default),statSync:as.default.statSync.bind(as.default),readFileSync:as.default.readFileSync.bind(as.default)},Zd=class extends mC.EventEmitter{constructor(t,r={}){super();this.watcher=null;this.debounceTimers=new Map;this.isRunning=!1;this.vaultPath=ev.default.resolve(t),this.fsAdapter=r.fsAdapter??LV,this.options={pattern:r.pattern??"**/*.md",assetType:r.assetType??"",debounceMs:r.debounceMs??100,recursive:r.recursive??!0}}static{o(this,"FileSystemWatcher")}start(){this.isRunning||(this.watcher=this.fsAdapter.watch(this.vaultPath,{recursive:this.options.recursive},(t,r)=>{r&&this.handleFileEvent(t,r.toString())}),this.watcher.on("error",t=>{this.emit("error",t)}),this.isRunning=!0,this.emit("started"))}stop(){if(this.isRunning){for(let t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear(),this.watcher&&(this.watcher.close(),this.watcher=null),this.isRunning=!1,this.emit("stopped")}}isWatching(){return this.isRunning}handleFileEvent(t,r){let i=ev.default.join(this.vaultPath,r),s=r;if(!this.matchesPattern(s))return;let a=this.debounceTimers.get(i);a&&clearTimeout(a);let c=setTimeout(()=>{this.debounceTimers.delete(i),this.processFileEvent(i,s)},this.options.debounceMs);this.debounceTimers.set(i,c)}processFileEvent(t,r){let i=this.fsAdapter.existsSync(t),s;if(!i)s="delete";else{let l=this.fsAdapter.statSync(t);s=Date.now()-l.birthtimeMs<1e3?"create":"modify"}let a;if(i&&t.endsWith(".md")&&(a=this.extractAssetType(t)),this.options.assetType&&a!==this.options.assetType)return;let c={type:s,path:t,relativePath:r,timestamp:new Date().toISOString(),assetType:a};this.emit("change",c)}matchesPattern(t){return this.options.pattern?lr(t,this.options.pattern):!0}extractAssetType(t){try{let i=this.fsAdapter.readFileSync(t,"utf-8").match(/^---\n([\s\S]*?)\n---/);if(!i)return;let a=i[1].match(/exo__Instance_class:\s*(?:\[?"?\[\[([^\]]+)\]\]"?\]?|"?\[\[([^\]]+)\]\]"?)/);return a?a[1]||a[2]:void 0}catch{return}}};var tv=te(require("fs"));function yC(){return new ut("watch").description("Watch vault for file changes and emit NDJSON events").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--pattern <glob>","Glob pattern to filter files (e.g., '*.md', 'tasks/**')").option("--asset-type <type>","Filter by asset type (e.g., 'ems__Task', 'ems__Project')").option("--debounce <ms>","Debounce interval in milliseconds","100").action(async n=>{W.setFormat("json");try{let e=(0,gC.resolve)(n.vault);if(!tv.default.existsSync(e))throw new wt(e);if(!tv.default.statSync(e).isDirectory())throw new Be(`Vault path is not a directory: ${e}`,"Provide a path to a directory, not a file",{vaultPath:e});let t=parseInt(n.debounce?.toString()??"100",10);if(isNaN(t)||t<0)throw new Be("--debounce must be a non-negative integer","Use a positive integer value for debounce",{debounce:n.debounce});let r=new Zd(e,{pattern:n.pattern,assetType:n.assetType,debounceMs:t});r.on("change",s=>{console.log(JSON.stringify(s))}),r.on("error",s=>{let a=_e.error("INTERNAL_OPERATION_FAILED",s.message,5,{recovery:{message:"Check file permissions and vault access",suggestion:"Ensure the vault directory is accessible"}});console.log(JSON.stringify(a))});let i=o(()=>{r.stop(),process.exit(0)},"shutdown");process.on("SIGINT",i),process.on("SIGTERM",i),console.error(`Watching vault: ${e}`),n.pattern&&console.error(` Pattern filter: ${n.pattern}`),n.assetType&&console.error(` Asset type filter: ${n.assetType}`),console.error(` Debounce: ${t}ms`),console.error("Press Ctrl+C to stop"),r.start()}catch(e){W.handle(e)}})}o(yC,"watchCommand");var nv=require("path"),iv=te(Is());var Ma=te(require("path"));var vc=te(zr());var fi=te(Is()),rv=te(require("crypto"));var ep=class{constructor(){this.backups=new Map;this.fileHashes=new Map}static{o(this,"TransactionManager")}async begin(e){if(!fi.default.existsSync(e))throw new Error(`Cannot backup non-existent file: ${e}`);let t=await fi.default.readFile(e,"utf-8"),r=rv.default.createHash("sha256").update(t).digest("hex");this.fileHashes.set(e,r);let i=`${e}.backup.${Date.now()}`;await fi.default.writeFile(i,t,"utf-8"),this.backups.set(e,i)}async verify(e){let t=this.fileHashes.get(e);if(!t)return!0;if(!fi.default.existsSync(e))return!1;let r=await fi.default.readFile(e,"utf-8");return rv.default.createHash("sha256").update(r).digest("hex")===t}async commit(){for(let e of this.backups.values())fi.default.existsSync(e)&&await fi.default.remove(e);this.backups.clear(),this.fileHashes.clear()}async rollback(){for(let[e,t]of this.backups.entries())fi.default.existsSync(t)&&(await fi.default.copy(t,e,{overwrite:!0}),await fi.default.remove(t));this.backups.clear(),this.fileHashes.clear()}getTrackedFiles(){return Array.from(this.backups.keys())}};var ka=class{static{o(this,"BatchExecutor")}constructor(e,t=!1){this.pathResolver=new gc(e),this.fsAdapter=new Ms(e),this.frontmatterService=new vc.FrontmatterService,this.transactionManager=new ep,this.dryRun=t}async executeBatch(e,t=!1){let r=Date.now(),i=[],s=0,a=0;if(e.length===0)return{success:!0,total:0,succeeded:0,failed:0,results:[],durationMs:Date.now()-r,atomic:t};if(t&&!this.dryRun)try{await this.backupAllFiles(e)}catch(l){return{success:!1,total:e.length,succeeded:0,failed:e.length,results:e.map(u=>({success:!1,command:u.command,filepath:u.filepath,error:`Backup failed: ${l.message}`})),durationMs:Date.now()-r,atomic:t}}for(let l of e){let u=await this.executeSingleOperation(l);if(i.push(u),u.success)s++;else if(a++,t&&!this.dryRun){await this.transactionManager.rollback();let f=i.length;for(let h=f;h<e.length;h++)i.push({success:!1,command:e[h].command,filepath:e[h].filepath,error:"Not executed due to atomic rollback"}),a++;return{success:!1,total:e.length,succeeded:0,failed:e.length,results:i,durationMs:Date.now()-r,atomic:t,rolledBack:!0}}}return t&&!this.dryRun&&await this.transactionManager.commit(),{success:a===0,total:e.length,succeeded:s,failed:a,results:i,durationMs:Date.now()-r,atomic:t,...t&&{rolledBack:!1}}}static parseInput(e){try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Be("Batch input must be a JSON array of operations",`exo batch --input '[{"command":"start","filepath":"task.md"}]'`);for(let r of t){if(!r.command||typeof r.command!="string")throw new Be('Each operation must have a "command" string property','{"command":"start","filepath":"task.md"}');if(!r.filepath||typeof r.filepath!="string")throw new Be('Each operation must have a "filepath" string property','{"command":"start","filepath":"task.md"}')}return t}catch(t){throw t instanceof Be?t:new Be(`Failed to parse batch input: ${t.message}`,`exo batch --input '[{"command":"start","filepath":"task.md"}]'`)}}async backupAllFiles(e){let t=new Set;for(let r of e){let i=this.pathResolver.resolve(r.filepath);t.add(i)}for(let r of t)await this.transactionManager.begin(r)}async executeSingleOperation(e){try{let t=this.pathResolver.resolve(e.filepath);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");if(await this.fsAdapter.readFile(r),this.dryRun)return{success:!0,command:e.command,filepath:e.filepath,action:`Would execute ${e.command} (dry-run)`};switch(e.command){case"start":return await this.executeStart(r,e);case"complete":return await this.executeComplete(r,e);case"trash":return await this.executeTrash(r,e);case"archive":return await this.executeArchive(r,e);case"move-to-backlog":return await this.executeStatusUpdate(r,e,"ems__EffortStatusBacklog","Moved to backlog");case"move-to-analysis":return await this.executeStatusUpdate(r,e,"ems__EffortStatusAnalysis","Moved to analysis");case"move-to-todo":return await this.executeStatusUpdate(r,e,"ems__EffortStatusToDo","Moved to todo");case"update-label":return await this.executeUpdateLabel(r,e);case"schedule":return await this.executeSchedule(r,e);case"set-deadline":return await this.executeSetDeadline(r,e);case"repair-folder":return await this.executeRepairFolder(r,e);default:return{success:!1,command:e.command,filepath:e.filepath,error:`Unknown command: ${e.command}`}}}catch(t){return{success:!1,command:e.command,filepath:e.filepath,error:t.message}}}getCurrentTimestamp(){return vc.DateFormatter.toLocalTimestamp(new Date)}async executeStart(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Started task",changes:{status:"Doing",startTimestamp:i}}}async executeComplete(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Completed task",changes:{status:"Done",endTimestamp:i,resolutionTimestamp:i}}}async executeTrash(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Trashed task",changes:{status:"Trashed",resolutionTimestamp:i}}}async executeArchive(e,t){let r=await this.fsAdapter.readFile(e),i=this.frontmatterService.updateProperty(r,"archived","true");return i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(e,i),{success:!0,command:t.command,filepath:t.filepath,action:"Archived task",changes:{archived:!0,aliasesRemoved:!0}}}async executeStatusUpdate(e,t,r,i){let s=await this.fsAdapter.readFile(e),a=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${r}]]"`);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:i,changes:{status:r.replace("ems__EffortStatus","")}}}async executeUpdateLabel(e,t){let r=t.options?.label;if(!r||r.trim()==="")return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "label"'};let i=r.trim(),s=await this.fsAdapter.readFile(e),a=this.frontmatterService.updateProperty(s,"exo__Asset_label",`"${i}"`);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Updated label to "${i}"`,changes:{label:i}}}async executeSchedule(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=vc.DateFormatter.toTimestampAtStartOfDay(r),a=this.frontmatterService.updateProperty(i,"ems__Effort_scheduledTimestamp",s);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Scheduled for ${r}`,changes:{scheduledTimestamp:s}}}async executeSetDeadline(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=vc.DateFormatter.toTimestampAtStartOfDay(r),a=this.frontmatterService.updateProperty(i,"ems__Effort_deadlineTimestamp",s);return await this.fsAdapter.updateFile(e,a),{success:!0,command:t.command,filepath:t.filepath,action:`Set deadline to ${r}`,changes:{deadlineTimestamp:s}}}async executeRepairFolder(e,t){let i=(await this.fsAdapter.getFileMetadata(e))?.exo__Asset_isDefinedBy;if(!i)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: missing exo__Asset_isDefinedBy"};let s=this.extractReference(i);if(!s)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: invalid exo__Asset_isDefinedBy format"};let a=await this.findReferencedFile(s,e);if(!a)return{success:!1,command:t.command,filepath:t.filepath,error:`Cannot determine expected folder: referenced asset not found: ${s}`};let c=Ma.default.dirname(a),l=c==="."?"":c,u=Ma.default.dirname(e),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return{success:!0,command:t.command,filepath:t.filepath,action:"Already in correct folder",changes:{moved:!1,folder:l||"(root)"}};let h=Ma.default.basename(e),d=l?`${l}/${h}`:h;return await this.fsAdapter.fileExists(d)?{success:!1,command:t.command,filepath:t.filepath,error:`Cannot move file: ${d} already exists`}:(await this.fsAdapter.renameFile(e,d),{success:!0,command:t.command,filepath:t.filepath,action:`Moved to ${l||"(root)"}`,changes:{moved:!0,oldPath:e,newPath:d,expectedFolder:l||"(root)"}})}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=Ma.default.dirname(t),s=i!=="."?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let h=Ma.default.basename(f,".md"),d=Ma.default.basename(r,".md");return h===d})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};function MV(n,e){if(n==="json"){let t=_e.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
546
546
  \u{1F4E6} Batch Execution ${e.success?"Complete":"Failed"}`),console.log(` Total: ${e.total} operations`),console.log(` \u2705 Succeeded: ${e.succeeded}`),console.log(` \u274C Failed: ${e.failed}`),console.log(` \u23F1\uFE0F Duration: ${e.durationMs}ms`),e.atomic&&console.log(` \u{1F512} Atomic mode: ${e.rolledBack?"Rolled back":"Committed"}`),e.failed>0){console.log(`
547
547
  \u{1F4CB} Failed Operations:`);for(let t of e.results.filter(r=>!r.success))console.log(` \u274C ${t.command} ${t.filepath}: ${t.error}`)}if(e.succeeded>0&&n==="text"){console.log(`
548
548
  \u{1F4CB} Successful Operations:`);for(let t of e.results.filter(r=>r.success))console.log(` \u2705 ${t.command} ${t.filepath}: ${t.action}`)}}}o(MV,"outputResult");function vC(){return new ut("batch").description("Execute multiple operations in a single CLI invocation").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>","JSON array of operations to execute").option("--file <path>","Path to JSON file containing operations").option("--atomic","All-or-nothing execution (rollback on any failure)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async n=>{let e=n.format||"text";W.setFormat(e);try{let t=(0,nv.resolve)(n.vault),r;if(n.input)r=n.input;else if(n.file){let c=(0,nv.resolve)(n.file);if(!iv.default.existsSync(c))throw new Be(`Batch file not found: ${c}`,"exocortex batch --file operations.json");r=await iv.default.readFile(c,"utf-8")}else throw new Be("Either --input or --file option is required",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]' or exocortex batch --file operations.json`);let i=ka.parseInput(r);if(i.length===0)throw new Be("Batch input contains no operations",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]'`);let a=await new ka(t,n.dryRun).executeBatch(i,n.atomic);MV(e,a),process.exit(a.success?0:5)}catch(t){W.handle(t)}})}o(vC,"batchCommand");var _C=require("path");function kV(n,e){if(n==="json"){let t=_e.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
@@ -550,7 +550,7 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <
550
550
  \u{1F4CB} Failed Files:`);for(let t of e.results.filter(r=>!r.success))console.log(` \u274C ${t.filepath}: ${t.error}`)}if(e.movedCount>0&&n==="text"){console.log(`
551
551
  \u{1F4CB} Moved Files:`);for(let t of e.results.filter(r=>r.success&&r.changes?.moved))console.log(` \u{1F4C1} ${t.filepath} \u2192 ${t.changes?.newPath}`)}}}o(kV,"outputResult");function SC(){return new ut("batch-repair").description("Batch repair folder locations for all markdown files in a directory").argument("<directory>","Directory to process (relative to vault root)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").option("--progress","Show progress during processing (default: true)",!0).option("--no-progress","Disable progress output").action(async(n,e)=>{let t=e.format||"text";W.setFormat(t);try{let r=(0,_C.resolve)(e.vault),i=new Ms(r),s=n;if(!await i.directoryExists(s))throw new Be(`Directory not found: ${s}`,"exocortex batch-repair <existing-directory>");let c=await i.getMarkdownFiles(s);if(c.length===0){if(t==="json"){let A=_e.success({success:!0,total:0,movedCount:0,alreadyCorrectCount:0,errorCount:0,results:[],durationMs:0,atomic:!1});console.log(JSON.stringify(A,null,2))}else console.log(`
552
552
  \u{1F4C2} No markdown files found in ${s}`);process.exit(0)}let l=c.map(A=>({command:"repair-folder",filepath:A})),u=e.progress!==!1&&t==="text",f=0;u&&console.log(`
553
- \u{1F50D} Processing ${c.length} files in ${s}...`);let d=await new ka(r,e.dryRun).executeBatch(l,!1),p=0,_=0,S=0;for(let A of d.results)if(A.success?A.changes?.moved?p++:_++:S++,u&&!e.dryRun){f++;let C=Math.round(f/c.length*100);process.stdout.write(`\r Processing ${f}/${c.length} (${C}%)...`)}u&&process.stdout.write("\r"+" ".repeat(60)+"\r");let E={...d,movedCount:p,alreadyCorrectCount:_,errorCount:S};kV(t,E),process.exit(E.success?0:5)}catch(r){W.handle(r)}})}o(SC,"batchRepairCommand");var tp=require("fs"),fi=require("path");function bC(){return new ut("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(n,e)=>{let t=e.output||"text";W.setFormat(t);try{let r=Date.now();if(!jV(n))throw new Be(`Invalid UUID format: ${n}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:n});let i=(0,fi.resolve)(e.vault);if(!(0,tp.existsSync)(i))throw new wt(i);let s=$V(i,n,e.partial??!1),a=Date.now()-r;if(s.length===0){if(t==="json"){let c=_e.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${n}`,3,{context:{uuid:n}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${n}`);process.exit(1)}e.partial||s.length>1?UV(s,i,e.format,t,n,a):VV(s[0],i,e.format,t,n,a)}catch(r){W.handle(r)}})}o(bC,"resolveCommand");function jV(n){if(n.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(n)||t.test(n)}o(jV,"isValidUuidFormat");function $V(n,e,t){let r=[],i=e.toLowerCase();function s(a){let c=(0,tp.readdirSync)(a,{withFileTypes:!0});for(let l of c){let u=(0,fi.join)(a,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&r.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&r.push(u)}}}return o(s,"walk"),s(n),r}o($V,"findFilesWithUuid");function wC(n){return`obsidian://vault/${encodeURI(n)}`}o(wC,"pathToObsidianUri");function EC(n){let e=n.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,fi.basename)(n,".md")}o(EC,"extractUuidFromFilename");function VV(n,e,t,r,i,s){let a=(0,fi.relative)(e,n),c=wC(a),l=EC((0,fi.basename)(n));if(r==="json"){let u={uuid:l,path:a,absolutePath:n,uri:c},f=_e.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(n);break;case"json":console.log(JSON.stringify({uuid:l,path:a,absolutePath:n,uri:c},null,2));break;case"uri":default:console.log(c);break}}o(VV,"outputSingleResult");function UV(n,e,t,r,i,s){let a=n.map(c=>{let l=(0,fi.relative)(e,c),u=wC(l);return{uuid:EC((0,fi.basename)(c)),path:l,absolutePath:c,uri:u}});if(r==="json"){let c=_e.success({matches:a,count:a.length},{durationMs:s,searchUuid:i,itemCount:a.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of a)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(a,null,2));break;case"uri":default:for(let c of a)console.log(c.uri);break}}o(UV,"outputMultipleResults");var TC=require("fs"),xC=require("path"),Kr=te(zr());function AC(){return new ut("ask").description("Ask a question in natural language about your vault").argument("<question>","Question in natural language (Russian or English)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--show-query","Show the generated SPARQL query").option("--explain","Show explanation of the query conversion").action(async(n,e)=>{let t=e.output||"text";W.setFormat(t);try{let r=Date.now(),i=(0,xC.resolve)(e.vault);if(!(0,TC.existsSync)(i))throw new wt(i);let s=new Kr.NLToSPARQLService;t==="text"&&console.log(`\u{1F9E0} Analyzing question: "${n}"
553
+ \u{1F50D} Processing ${c.length} files in ${s}...`);let d=await new ka(r,e.dryRun).executeBatch(l,!1),p=0,_=0,S=0;for(let A of d.results)if(A.success?A.changes?.moved?p++:_++:S++,u&&!e.dryRun){f++;let C=Math.round(f/c.length*100);process.stdout.write(`\r Processing ${f}/${c.length} (${C}%)...`)}u&&process.stdout.write("\r"+" ".repeat(60)+"\r");let E={...d,movedCount:p,alreadyCorrectCount:_,errorCount:S};kV(t,E),process.exit(E.success?0:5)}catch(r){W.handle(r)}})}o(SC,"batchRepairCommand");var tp=require("fs"),hi=require("path");function bC(){return new ut("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(n,e)=>{let t=e.output||"text";W.setFormat(t);try{let r=Date.now();if(!jV(n))throw new Be(`Invalid UUID format: ${n}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:n});let i=(0,hi.resolve)(e.vault);if(!(0,tp.existsSync)(i))throw new wt(i);let s=$V(i,n,e.partial??!1),a=Date.now()-r;if(s.length===0){if(t==="json"){let c=_e.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${n}`,3,{context:{uuid:n}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${n}`);process.exit(1)}e.partial||s.length>1?UV(s,i,e.format,t,n,a):VV(s[0],i,e.format,t,n,a)}catch(r){W.handle(r)}})}o(bC,"resolveCommand");function jV(n){if(n.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(n)||t.test(n)}o(jV,"isValidUuidFormat");function $V(n,e,t){let r=[],i=e.toLowerCase();function s(a){let c=(0,tp.readdirSync)(a,{withFileTypes:!0});for(let l of c){let u=(0,hi.join)(a,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&r.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&r.push(u)}}}return o(s,"walk"),s(n),r}o($V,"findFilesWithUuid");function wC(n){return`obsidian://vault/${encodeURI(n)}`}o(wC,"pathToObsidianUri");function EC(n){let e=n.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,hi.basename)(n,".md")}o(EC,"extractUuidFromFilename");function VV(n,e,t,r,i,s){let a=(0,hi.relative)(e,n),c=wC(a),l=EC((0,hi.basename)(n));if(r==="json"){let u={uuid:l,path:a,absolutePath:n,uri:c},f=_e.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(n);break;case"json":console.log(JSON.stringify({uuid:l,path:a,absolutePath:n,uri:c},null,2));break;case"uri":default:console.log(c);break}}o(VV,"outputSingleResult");function UV(n,e,t,r,i,s){let a=n.map(c=>{let l=(0,hi.relative)(e,c),u=wC(l);return{uuid:EC((0,hi.basename)(c)),path:l,absolutePath:c,uri:u}});if(r==="json"){let c=_e.success({matches:a,count:a.length},{durationMs:s,searchUuid:i,itemCount:a.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of a)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(a,null,2));break;case"uri":default:for(let c of a)console.log(c.uri);break}}o(UV,"outputMultipleResults");var TC=require("fs"),xC=require("path"),Kr=te(zr());function AC(){return new ut("ask").description("Ask a question in natural language about your vault").argument("<question>","Question in natural language (Russian or English)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--show-query","Show the generated SPARQL query").option("--explain","Show explanation of the query conversion").action(async(n,e)=>{let t=e.output||"text";W.setFormat(t);try{let r=Date.now(),i=(0,xC.resolve)(e.vault);if(!(0,TC.existsSync)(i))throw new wt(i);let s=new Kr.NLToSPARQLService;t==="text"&&console.log(`\u{1F9E0} Analyzing question: "${n}"
554
554
  `);let a=s.convert(n);e.showQuery&&t==="text"&&(console.log("\u{1F4DD} Generated SPARQL Query:"),console.log("\u2500".repeat(50)),console.log(a.query),console.log("\u2500".repeat(50)),console.log()),e.explain&&t==="text"&&(console.log(`\u{1F4D6} Explanation: ${a.explanation}`),console.log(`\u{1F3AF} Confidence: ${(a.confidence*100).toFixed(0)}%`),a.templateName&&console.log(`\u{1F4CB} Template: ${a.templateName}`),a.isFallback&&console.log("\u26A0\uFE0F Using fallback generic search query"),console.log()),t==="text"&&console.log(`\u{1F4E6} Loading vault: ${i}...`);let c=Date.now(),l=new sn(i),f=await new Kr.NoteToRDFConverter(l).convertVault(),h=new Kr.InMemoryTripleStore;await h.addAll(f);let d=Date.now()-c;t==="text"&&console.log(`\u2705 Loaded ${f.length} triples in ${d}ms
555
555
  `);let _=new Kr.SPARQLParser().parse(a.query),E=new Kr.AlgebraTranslator().translate(_);E=new Kr.AlgebraOptimizer().optimize(E);let C=Date.now(),G=await new Kr.QueryExecutor(h).executeAll(E),Q=Date.now()-C,H=Date.now()-r,re=s.getSuggestions(n);if(t==="json"){let Ie=G.map(ge=>ge.toJSON()),N={question:n,query:a.query,template:a.templateName,parameters:a.parameters,confidence:a.confidence,explanation:a.explanation,count:G.length,bindings:Ie,suggestions:re.length>0?re:void 0},K=_e.success(N,{durationMs:H,itemCount:G.length,loadDurationMs:d,execDurationMs:Q,triplesScanned:f.length});console.log(JSON.stringify(K,null,2))}else{if(console.log(`\u2705 Found ${G.length} result(s) in ${Q}ms
556
556
  `),G.length>0?BV(G,e.format):console.log("No results found."),re.length>0){console.log(`
@@ -594,7 +594,7 @@ Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes
594
594
  ORDER BY DESC(?usageCount)
595
595
  `;a=s.parse(p),c=new Xt.AlgebraTranslator,l=c.translate(a),u=new Xt.AlgebraOptimizer,l=u.optimize(l);let S=(await f.executeAll(l)).map(A=>{let C=A.get("property"),k=A.get("usageCount");return{name:C?kC(C.toString()):"unknown",usageCount:k?parseInt(k.toString(),10):0}}),E={name:e,instanceCount:d,properties:S};if(r==="json"||t.format==="json"){let A=_e.success(E);console.log(JSON.stringify(A,null,2))}else{if(console.log(`\u{1F4CB} Class: ${e}
596
596
  `),console.log(` Instances: ${d}`),console.log(` Properties: ${S.length}
597
- `),S.length===0){console.log(" No properties found.");return}let A=Math.max(...S.map(C=>C.name.length),10);console.log(" \u250C"+"\u2500".repeat(A+2)+"\u252C"+"\u2500".repeat(10)+"\u2510"),console.log(" \u2502 "+"Property".padEnd(A)+" \u2502 "+"Usage".padEnd(8)+" \u2502"),console.log(" \u251C"+"\u2500".repeat(A+2)+"\u253C"+"\u2500".repeat(10)+"\u2524");for(let C of S)console.log(" \u2502 "+C.name.padEnd(A)+" \u2502 "+C.usageCount.toString().padStart(8)+" \u2502");console.log(" \u2514"+"\u2500".repeat(A+2)+"\u2534"+"\u2500".repeat(10)+"\u2518")}}o(HV,"showClassDetails");function kC(n){let e=n.replace(/^<|>$/g,""),t=e.lastIndexOf("#");if(t!==-1)return e.substring(t+1);let r=e.lastIndexOf("/");return r!==-1?e.substring(r+1):e}o(kC,"extractLocalName");var Pn=new ut;Pn.name("exocortex").description("CLI tool for Exocortex knowledge management system").version("15.27.0");var sv=Pn.command("sparql").description("SPARQL query execution and cache management");sv.addCommand(rA());sv.addCommand(sA());sv.addCommand(aA());Pn.addCommand(pC());Pn.addCommand(yC());Pn.addCommand(vC());Pn.addCommand(SC());Pn.addCommand(bC());Pn.addCommand(AC());Pn.addCommand(PC());Pn.addCommand(DC());Pn.addCommand(MC());Pn.parse();
597
+ `),S.length===0){console.log(" No properties found.");return}let A=Math.max(...S.map(C=>C.name.length),10);console.log(" \u250C"+"\u2500".repeat(A+2)+"\u252C"+"\u2500".repeat(10)+"\u2510"),console.log(" \u2502 "+"Property".padEnd(A)+" \u2502 "+"Usage".padEnd(8)+" \u2502"),console.log(" \u251C"+"\u2500".repeat(A+2)+"\u253C"+"\u2500".repeat(10)+"\u2524");for(let C of S)console.log(" \u2502 "+C.name.padEnd(A)+" \u2502 "+C.usageCount.toString().padStart(8)+" \u2502");console.log(" \u2514"+"\u2500".repeat(A+2)+"\u2534"+"\u2500".repeat(10)+"\u2518")}}o(HV,"showClassDetails");function kC(n){let e=n.replace(/^<|>$/g,""),t=e.lastIndexOf("#");if(t!==-1)return e.substring(t+1);let r=e.lastIndexOf("/");return r!==-1?e.substring(r+1):e}o(kC,"extractLocalName");var Pn=new ut;Pn.name("exocortex").description("CLI tool for Exocortex knowledge management system").version("15.28.1");var sv=Pn.command("sparql").description("SPARQL query execution and cache management");sv.addCommand(rA());sv.addCommand(sA());sv.addCommand(aA());Pn.addCommand(pC());Pn.addCommand(yC());Pn.addCommand(vC());Pn.addCommand(SC());Pn.addCommand(bC());Pn.addCommand(AC());Pn.addCommand(PC());Pn.addCommand(DC());Pn.addCommand(MC());Pn.parse();
598
598
  /*! Bundled license information:
599
599
 
600
600
  reflect-metadata/Reflect.js: