@kitelev/exocortex-cli 16.156.1 → 16.156.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.156.
|
|
2
|
+
// @kitelev/exocortex-cli v16.156.2
|
|
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 f9=Object.create;var ff=Object.defineProperty;var d9=Object.getOwnPropertyDescriptor;var h9=Object.getOwnPropertyNames;var p9=Object.getPrototypeOf,m9=Object.prototype.hasOwnProperty;var a=(n,e)=>ff(n,"name",{value:e,configurable:!0});var g9=(n,e)=>()=>(n&&(e=n(n=0)),e);var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),zb=(n,e)=>{for(var t in e)ff(n,t,{get:e[t],enumerable:!0})},ZI=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h9(e))!m9.call(n,i)&&i!==t&&ff(n,i,{get:()=>e[i],enumerable:!(r=d9(e,i))||r.enumerable});return n};var se=(n,e,t)=>(t=n!=null?f9(p9(n)):{},ZI(e||!n||!n.__esModule?ff(t,"default",{value:n,enumerable:!0}):t,n)),Wh=n=>ZI(ff({},"__esModule",{value:!0}),n);var Kb=w(()=>{var ex;(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,d){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}a(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}a(s,"functionThis");function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}a(o,"indirectEvalThis");function c(){return s()||o()}a(c,"sloppyModeThis")})(function(e,t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=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 Je(Object.create(null))}:l?function(){return Je({__proto__:null})}:function(){return Je({})},has:u?function(x,C){return r.call(x,C)}:function(x,C){return C in x},get:u?function(x,C){return r.call(x,C)?x[C]:void 0}:function(x,C){return x[C]}},d=Object.getPrototypeOf(Function),h=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ke(),p=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:at(),g=typeof WeakMap=="function"?WeakMap:Ze(),y=i?Symbol.for("@reflect-metadata:registry"):void 0,b=De(),S=Le(b);function v(x,C,F,U){if(q(F)){if(!xe(x))throw new TypeError;if(!_e(C))throw new TypeError;return Y(x,C)}else{if(!xe(x))throw new TypeError;if(!ge(C))throw new TypeError;if(!ge(U)&&!q(U)&&!te(U))throw new TypeError;return te(U)&&(U=void 0),F=pe(F),oe(x,C,F,U)}}a(v,"decorate"),e("decorate",v);function I(x,C){function F(U,me){if(!ge(U))throw new TypeError;if(!q(me)&&!W(me))throw new TypeError;k(x,C,U,me)}return a(F,"decorator"),F}a(I,"metadata"),e("metadata",I);function A(x,C,F,U){if(!ge(F))throw new TypeError;return q(U)||(U=pe(U)),k(x,C,F,U)}a(A,"defineMetadata"),e("defineMetadata",A);function T(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),Q(x,C,F)}a(T,"hasMetadata"),e("hasMetadata",T);function R(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),be(x,C,F)}a(R,"hasOwnMetadata"),e("hasOwnMetadata",R);function B(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),le(x,C,F)}a(B,"getMetadata"),e("getMetadata",B);function L(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),ue(x,C,F)}a(L,"getOwnMetadata"),e("getOwnMetadata",L);function P(x,C){if(!ge(x))throw new TypeError;return q(C)||(C=pe(C)),G(x,C)}a(P,"getMetadataKeys"),e("getMetadataKeys",P);function M(x,C){if(!ge(x))throw new TypeError;return q(C)||(C=pe(C)),je(x,C)}a(M,"getOwnMetadataKeys"),e("getOwnMetadataKeys",M);function O(x,C,F){if(!ge(C))throw new TypeError;if(q(F)||(F=pe(F)),!ge(C))throw new TypeError;q(F)||(F=pe(F));var U=Ie(C,F,!1);return q(U)?!1:U.OrdinaryDeleteMetadata(x,C,F)}a(O,"deleteMetadata"),e("deleteMetadata",O);function Y(x,C){for(var F=x.length-1;F>=0;--F){var U=x[F],me=U(C);if(!q(me)&&!te(me)){if(!_e(me))throw new TypeError;C=me}}return C}a(Y,"DecorateConstructor");function oe(x,C,F,U){for(var me=x.length-1;me>=0;--me){var At=x[me],Ot=At(C,F,U);if(!q(Ot)&&!te(Ot)){if(!ge(Ot))throw new TypeError;U=Ot}}return U}a(oe,"DecorateProperty");function Q(x,C,F){var U=be(x,C,F);if(U)return!0;var me=Ce(C);return te(me)?!1:Q(x,me,F)}a(Q,"OrdinaryHasMetadata");function be(x,C,F){var U=Ie(C,F,!1);return q(U)?!1:j(U.OrdinaryHasOwnMetadata(x,C,F))}a(be,"OrdinaryHasOwnMetadata");function le(x,C,F){var U=be(x,C,F);if(U)return ue(x,C,F);var me=Ce(C);if(!te(me))return le(x,me,F)}a(le,"OrdinaryGetMetadata");function ue(x,C,F){var U=Ie(C,F,!1);if(!q(U))return U.OrdinaryGetOwnMetadata(x,C,F)}a(ue,"OrdinaryGetOwnMetadata");function k(x,C,F,U){var me=Ie(F,U,!0);me.OrdinaryDefineOwnMetadata(x,C,F,U)}a(k,"OrdinaryDefineOwnMetadata");function G(x,C){var F=je(x,C),U=Ce(x);if(U===null)return F;var me=G(U,C);if(me.length<=0)return F;if(F.length<=0)return me;for(var At=new p,Ot=[],ze=0,ne=F;ze<ne.length;ze++){var ie=ne[ze],ae=At.has(ie);ae||(At.add(ie),Ot.push(ie))}for(var fe=0,We=me;fe<We.length;fe++){var ie=We[fe],ae=At.has(ie);ae||(At.add(ie),Ot.push(ie))}return Ot}a(G,"OrdinaryMetadataKeys");function je(x,C){var F=Ie(x,C,!1);return F?F.OrdinaryOwnMetadataKeys(x,C):[]}a(je,"OrdinaryOwnMetadataKeys");function X(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}a(X,"Type");function q(x){return x===void 0}a(q,"IsUndefined");function te(x){return x===null}a(te,"IsNull");function Z(x){return typeof x=="symbol"}a(Z,"IsSymbol");function ge(x){return typeof x=="object"?x!==null:typeof x=="function"}a(ge,"IsObject");function $e(x,C){switch(X(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var F=C===3?"string":C===5?"number":"default",U=ee(x,s);if(U!==void 0){var me=U.call(x,F);if(ge(me))throw new TypeError;return me}return Ve(x,F==="default"?"number":F)}a($e,"ToPrimitive");function Ve(x,C){if(C==="string"){var F=x.toString;if(ye(F)){var U=F.call(x);if(!ge(U))return U}var me=x.valueOf;if(ye(me)){var U=me.call(x);if(!ge(U))return U}}else{var me=x.valueOf;if(ye(me)){var U=me.call(x);if(!ge(U))return U}var At=x.toString;if(ye(At)){var U=At.call(x);if(!ge(U))return U}}throw new TypeError}a(Ve,"OrdinaryToPrimitive");function j(x){return!!x}a(j,"ToBoolean");function re(x){return""+x}a(re,"ToString");function pe(x){var C=$e(x,3);return Z(C)?C:re(C)}a(pe,"ToPropertyKey");function xe(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}a(xe,"IsArray");function ye(x){return typeof x=="function"}a(ye,"IsCallable");function _e(x){return typeof x=="function"}a(_e,"IsConstructor");function W(x){switch(X(x)){case 3:return!0;case 4:return!0;default:return!1}}a(W,"IsPropertyKey");function J(x,C){return x===C||x!==x&&C!==C}a(J,"SameValueZero");function ee(x,C){var F=x[C];if(F!=null){if(!ye(F))throw new TypeError;return F}}a(ee,"GetMethod");function de(x){var C=ee(x,o);if(!ye(C))throw new TypeError;var F=C.call(x);if(!ge(F))throw new TypeError;return F}a(de,"GetIterator");function Te(x){return x.value}a(Te,"IteratorValue");function Ae(x){var C=x.next();return C.done?!1:C}a(Ae,"IteratorStep");function Pe(x){var C=x.return;C&&C.call(x)}a(Pe,"IteratorClose");function Ce(x){var C=Object.getPrototypeOf(x);if(typeof x!="function"||x===d||C!==d)return C;var F=x.prototype,U=F&&Object.getPrototypeOf(F);if(U==null||U===Object.prototype)return C;var me=U.constructor;return typeof me!="function"||me===x?C:me}a(Ce,"OrdinaryGetPrototypeOf");function Fe(){var x;!q(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(x=Ne(t.Reflect));var C,F,U,me=new g,At={registerProvider:Ot,getProvider:ne,setProvider:ae};return At;function Ot(fe){if(!Object.isExtensible(At))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===fe:break;case q(C):C=fe;break;case C===fe:break;case q(F):F=fe;break;case F===fe:break;default:U===void 0&&(U=new p),U.add(fe);break}}function ze(fe,We){if(!q(C)){if(C.isProviderFor(fe,We))return C;if(!q(F)){if(F.isProviderFor(fe,We))return C;if(!q(U))for(var lt=de(U);;){var ut=Ae(lt);if(!ut)return;var Mr=Te(ut);if(Mr.isProviderFor(fe,We))return Pe(lt),Mr}}}if(!q(x)&&x.isProviderFor(fe,We))return x}function ne(fe,We){var lt=me.get(fe),ut;return q(lt)||(ut=lt.get(We)),q(ut)&&(ut=ze(fe,We),q(ut)||(q(lt)&&(lt=new h,me.set(fe,lt)),lt.set(We,ut))),ut}function ie(fe){if(q(fe))throw new TypeError;return C===fe||F===fe||!q(U)&&U.has(fe)}function ae(fe,We,lt){if(!ie(lt))throw new Error("Metadata provider not registered.");var ut=ne(fe,We);if(ut!==lt){if(!q(ut))return!1;var Mr=me.get(fe);q(Mr)&&(Mr=new h,me.set(fe,Mr)),Mr.set(We,lt)}return!0}}a(Fe,"CreateMetadataRegistry");function De(){var x;return!q(y)&&ge(t.Reflect)&&Object.isExtensible(t.Reflect)&&(x=t.Reflect[y]),q(x)&&(x=Fe()),!q(y)&&ge(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}a(De,"GetOrCreateMetadataRegistry");function Le(x){var C=new g,F={isProviderFor:a(function(ie,ae){var fe=C.get(ie);return q(fe)?!1:fe.has(ae)},"isProviderFor"),OrdinaryDefineOwnMetadata:Ot,OrdinaryHasOwnMetadata:me,OrdinaryGetOwnMetadata:At,OrdinaryOwnMetadataKeys:ze,OrdinaryDeleteMetadata:ne};return b.registerProvider(F),F;function U(ie,ae,fe){var We=C.get(ie),lt=!1;if(q(We)){if(!fe)return;We=new h,C.set(ie,We),lt=!0}var ut=We.get(ae);if(q(ut)){if(!fe)return;if(ut=new h,We.set(ae,ut),!x.setProvider(ie,ae,F))throw We.delete(ae),lt&&C.delete(ie),new Error("Wrong provider for target.")}return ut}a(U,"GetOrCreateMetadataMap");function me(ie,ae,fe){var We=U(ae,fe,!1);return q(We)?!1:j(We.has(ie))}a(me,"OrdinaryHasOwnMetadata");function At(ie,ae,fe){var We=U(ae,fe,!1);if(!q(We))return We.get(ie)}a(At,"OrdinaryGetOwnMetadata");function Ot(ie,ae,fe,We){var lt=U(fe,We,!0);lt.set(ie,ae)}a(Ot,"OrdinaryDefineOwnMetadata");function ze(ie,ae){var fe=[],We=U(ie,ae,!1);if(q(We))return fe;for(var lt=We.keys(),ut=de(lt),Mr=0;;){var On=Ae(ut);if(!On)return fe.length=Mr,fe;var Kn=Te(On);try{fe[Mr]=Kn}catch(un){try{Pe(ut)}finally{throw un}}Mr++}}a(ze,"OrdinaryOwnMetadataKeys");function ne(ie,ae,fe){var We=U(ae,fe,!1);if(q(We)||!We.delete(ie))return!1;if(We.size===0){var lt=C.get(ae);q(lt)||(lt.delete(fe),lt.size===0&&C.delete(lt))}return!0}a(ne,"OrdinaryDeleteMetadata")}a(Le,"CreateMetadataProvider");function Ne(x){var C=x.defineMetadata,F=x.hasOwnMetadata,U=x.getOwnMetadata,me=x.getOwnMetadataKeys,At=x.deleteMetadata,Ot=new g,ze={isProviderFor:a(function(ne,ie){var ae=Ot.get(ne);return!q(ae)&&ae.has(ie)?!0:me(ne,ie).length?(q(ae)&&(ae=new p,Ot.set(ne,ae)),ae.add(ie),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:me,OrdinaryDeleteMetadata:At};return ze}a(Ne,"CreateFallbackProvider");function Ie(x,C,F){var U=b.getProvider(x,C);if(!q(U))return U;if(F){if(b.setProvider(x,C,S))return S;throw new Error("Illegal state.")}}a(Ie,"GetMetadataProvider");function ke(){var x={},C=[],F=(function(){function ze(ne,ie,ae){this._index=0,this._keys=ne,this._values=ie,this._selector=ae}return a(ze,"MapIterator"),ze.prototype["@@iterator"]=function(){return this},ze.prototype[o]=function(){return this},ze.prototype.next=function(){var ne=this._index;if(ne>=0&&ne<this._keys.length){var ie=this._selector(this._keys[ne],this._values[ne]);return ne+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:ie,done:!1}}return{value:void 0,done:!0}},ze.prototype.throw=function(ne){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),ne},ze.prototype.return=function(ne){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:ne,done:!0}},ze})(),U=(function(){function ze(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return a(ze,"Map"),Object.defineProperty(ze.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),ze.prototype.has=function(ne){return this._find(ne,!1)>=0},ze.prototype.get=function(ne){var ie=this._find(ne,!1);return ie>=0?this._values[ie]:void 0},ze.prototype.set=function(ne,ie){var ae=this._find(ne,!0);return this._values[ae]=ie,this},ze.prototype.delete=function(ne){var ie=this._find(ne,!1);if(ie>=0){for(var ae=this._keys.length,fe=ie+1;fe<ae;fe++)this._keys[fe-1]=this._keys[fe],this._values[fe-1]=this._values[fe];return this._keys.length--,this._values.length--,J(ne,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},ze.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},ze.prototype.keys=function(){return new F(this._keys,this._values,me)},ze.prototype.values=function(){return new F(this._keys,this._values,At)},ze.prototype.entries=function(){return new F(this._keys,this._values,Ot)},ze.prototype["@@iterator"]=function(){return this.entries()},ze.prototype[o]=function(){return this.entries()},ze.prototype._find=function(ne,ie){if(!J(this._cacheKey,ne)){this._cacheIndex=-1;for(var ae=0;ae<this._keys.length;ae++)if(J(this._keys[ae],ne)){this._cacheIndex=ae;break}}return this._cacheIndex<0&&ie&&(this._cacheIndex=this._keys.length,this._keys.push(ne),this._values.push(void 0)),this._cacheIndex},ze})();return U;function me(ze,ne){return ze}function At(ze,ne){return ne}function Ot(ze,ne){return[ze,ne]}}a(ke,"CreateMapPolyfill");function at(){var x=(function(){function C(){this._map=new h}return a(C,"Set"),Object.defineProperty(C.prototype,"size",{get:a(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),C.prototype.has=function(F){return this._map.has(F)},C.prototype.add=function(F){return this._map.set(F,F),this},C.prototype.delete=function(F){return this._map.delete(F)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[o]=function(){return this.keys()},C})();return x}a(at,"CreateSetPolyfill");function Ze(){var x=16,C=f.create(),F=U();return(function(){function ne(){this._key=U()}return a(ne,"WeakMap"),ne.prototype.has=function(ie){var ae=me(ie,!1);return ae!==void 0?f.has(ae,this._key):!1},ne.prototype.get=function(ie){var ae=me(ie,!1);return ae!==void 0?f.get(ae,this._key):void 0},ne.prototype.set=function(ie,ae){var fe=me(ie,!0);return fe[this._key]=ae,this},ne.prototype.delete=function(ie){var ae=me(ie,!1);return ae!==void 0?delete ae[this._key]:!1},ne.prototype.clear=function(){this._key=U()},ne})();function U(){var ne;do ne="@@WeakMap@@"+ze();while(f.has(C,ne));return C[ne]=!0,ne}function me(ne,ie){if(!r.call(ne,F)){if(!ie)return;Object.defineProperty(ne,F,{value:f.create()})}return ne[F]}function At(ne,ie){for(var ae=0;ae<ie;++ae)ne[ae]=Math.random()*255|0;return ne}function Ot(ne){if(typeof Uint8Array=="function"){var ie=new Uint8Array(ne);return typeof crypto<"u"?crypto.getRandomValues(ie):typeof msCrypto<"u"?msCrypto.getRandomValues(ie):At(ie,ne),ie}return At(new Array(ne),ne)}function ze(){var ne=Ot(x);ne[6]=ne[6]&79|64,ne[8]=ne[8]&191|128;for(var ie="",ae=0;ae<x;++ae){var fe=ne[ae];(ae===4||ae===6||ae===8)&&(ie+="-"),fe<16&&(ie+="0"),ie+=fe.toString(16).toLowerCase()}return ie}}a(Ze,"CreateWeakMapPolyfill");function Je(x){return x.__=void 0,delete x.__,x}a(Je,"MakeDictionary")})})(ex||(ex={}))});var df=w(Yb=>{var Hh=class extends Error{static{a(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}},Qb=class extends Hh{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yb.CommanderError=Hh;Yb.InvalidArgumentError=Qb});var zh=w(Jb=>{var{InvalidArgumentError:y9}=df(),Xb=class{static{a(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 y9(`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 b9(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}a(b9,"humanReadableArgName");Jb.Argument=Xb;Jb.humanReadableArgName=b9});var t_=w(e_=>{var{humanReadableArgName:_9}=zh(),Zb=class{static{a(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=a(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=>_9(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 o=r(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(d,h){return t.formatItem(d,r,h,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let p=d.map(g=>s(t.styleOptionTerm(t.optionTerm(g)),t.styleOptionDescription(t.optionDescription(g))));o=o.concat(this.formatItemList(h,p,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(h=>s(t.styleOptionTerm(t.optionTerm(h)),t.styleOptionDescription(t.optionDescription(h))));o=o.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let p=d.map(g=>s(t.styleSubcommandTerm(t.subcommandTerm(g)),t.styleSubcommandDescription(t.subcommandDescription(g))));o=o.concat(this.formatItemList(h,p,t))}),o.join(`
|
|
6
|
+
"use strict";var f9=Object.create;var ff=Object.defineProperty;var d9=Object.getOwnPropertyDescriptor;var h9=Object.getOwnPropertyNames;var p9=Object.getPrototypeOf,m9=Object.prototype.hasOwnProperty;var a=(n,e)=>ff(n,"name",{value:e,configurable:!0});var g9=(n,e)=>()=>(n&&(e=n(n=0)),e);var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),zb=(n,e)=>{for(var t in e)ff(n,t,{get:e[t],enumerable:!0})},ZI=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h9(e))!m9.call(n,i)&&i!==t&&ff(n,i,{get:()=>e[i],enumerable:!(r=d9(e,i))||r.enumerable});return n};var se=(n,e,t)=>(t=n!=null?f9(p9(n)):{},ZI(e||!n||!n.__esModule?ff(t,"default",{value:n,enumerable:!0}):t,n)),Wh=n=>ZI(ff({},"__esModule",{value:!0}),n);var Kb=w(()=>{var ex;(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,d){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}a(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}a(s,"functionThis");function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}a(o,"indirectEvalThis");function c(){return s()||o()}a(c,"sloppyModeThis")})(function(e,t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=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 Je(Object.create(null))}:l?function(){return Je({__proto__:null})}:function(){return Je({})},has:u?function(x,C){return r.call(x,C)}:function(x,C){return C in x},get:u?function(x,C){return r.call(x,C)?x[C]:void 0}:function(x,C){return x[C]}},d=Object.getPrototypeOf(Function),h=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ke(),p=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:at(),g=typeof WeakMap=="function"?WeakMap:Ze(),y=i?Symbol.for("@reflect-metadata:registry"):void 0,b=De(),S=Le(b);function v(x,C,F,U){if(q(F)){if(!xe(x))throw new TypeError;if(!_e(C))throw new TypeError;return Y(x,C)}else{if(!xe(x))throw new TypeError;if(!ge(C))throw new TypeError;if(!ge(U)&&!q(U)&&!te(U))throw new TypeError;return te(U)&&(U=void 0),F=pe(F),oe(x,C,F,U)}}a(v,"decorate"),e("decorate",v);function I(x,C){function F(U,me){if(!ge(U))throw new TypeError;if(!q(me)&&!W(me))throw new TypeError;k(x,C,U,me)}return a(F,"decorator"),F}a(I,"metadata"),e("metadata",I);function A(x,C,F,U){if(!ge(F))throw new TypeError;return q(U)||(U=pe(U)),k(x,C,F,U)}a(A,"defineMetadata"),e("defineMetadata",A);function T(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),Q(x,C,F)}a(T,"hasMetadata"),e("hasMetadata",T);function R(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),be(x,C,F)}a(R,"hasOwnMetadata"),e("hasOwnMetadata",R);function B(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),le(x,C,F)}a(B,"getMetadata"),e("getMetadata",B);function L(x,C,F){if(!ge(C))throw new TypeError;return q(F)||(F=pe(F)),ue(x,C,F)}a(L,"getOwnMetadata"),e("getOwnMetadata",L);function P(x,C){if(!ge(x))throw new TypeError;return q(C)||(C=pe(C)),G(x,C)}a(P,"getMetadataKeys"),e("getMetadataKeys",P);function M(x,C){if(!ge(x))throw new TypeError;return q(C)||(C=pe(C)),je(x,C)}a(M,"getOwnMetadataKeys"),e("getOwnMetadataKeys",M);function O(x,C,F){if(!ge(C))throw new TypeError;if(q(F)||(F=pe(F)),!ge(C))throw new TypeError;q(F)||(F=pe(F));var U=Ie(C,F,!1);return q(U)?!1:U.OrdinaryDeleteMetadata(x,C,F)}a(O,"deleteMetadata"),e("deleteMetadata",O);function Y(x,C){for(var F=x.length-1;F>=0;--F){var U=x[F],me=U(C);if(!q(me)&&!te(me)){if(!_e(me))throw new TypeError;C=me}}return C}a(Y,"DecorateConstructor");function oe(x,C,F,U){for(var me=x.length-1;me>=0;--me){var At=x[me],Ot=At(C,F,U);if(!q(Ot)&&!te(Ot)){if(!ge(Ot))throw new TypeError;U=Ot}}return U}a(oe,"DecorateProperty");function Q(x,C,F){var U=be(x,C,F);if(U)return!0;var me=Ce(C);return te(me)?!1:Q(x,me,F)}a(Q,"OrdinaryHasMetadata");function be(x,C,F){var U=Ie(C,F,!1);return q(U)?!1:j(U.OrdinaryHasOwnMetadata(x,C,F))}a(be,"OrdinaryHasOwnMetadata");function le(x,C,F){var U=be(x,C,F);if(U)return ue(x,C,F);var me=Ce(C);if(!te(me))return le(x,me,F)}a(le,"OrdinaryGetMetadata");function ue(x,C,F){var U=Ie(C,F,!1);if(!q(U))return U.OrdinaryGetOwnMetadata(x,C,F)}a(ue,"OrdinaryGetOwnMetadata");function k(x,C,F,U){var me=Ie(F,U,!0);me.OrdinaryDefineOwnMetadata(x,C,F,U)}a(k,"OrdinaryDefineOwnMetadata");function G(x,C){var F=je(x,C),U=Ce(x);if(U===null)return F;var me=G(U,C);if(me.length<=0)return F;if(F.length<=0)return me;for(var At=new p,Ot=[],ze=0,ne=F;ze<ne.length;ze++){var ie=ne[ze],ae=At.has(ie);ae||(At.add(ie),Ot.push(ie))}for(var fe=0,We=me;fe<We.length;fe++){var ie=We[fe],ae=At.has(ie);ae||(At.add(ie),Ot.push(ie))}return Ot}a(G,"OrdinaryMetadataKeys");function je(x,C){var F=Ie(x,C,!1);return F?F.OrdinaryOwnMetadataKeys(x,C):[]}a(je,"OrdinaryOwnMetadataKeys");function X(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}a(X,"Type");function q(x){return x===void 0}a(q,"IsUndefined");function te(x){return x===null}a(te,"IsNull");function Z(x){return typeof x=="symbol"}a(Z,"IsSymbol");function ge(x){return typeof x=="object"?x!==null:typeof x=="function"}a(ge,"IsObject");function $e(x,C){switch(X(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var F=C===3?"string":C===5?"number":"default",U=ee(x,s);if(U!==void 0){var me=U.call(x,F);if(ge(me))throw new TypeError;return me}return Ve(x,F==="default"?"number":F)}a($e,"ToPrimitive");function Ve(x,C){if(C==="string"){var F=x.toString;if(ye(F)){var U=F.call(x);if(!ge(U))return U}var me=x.valueOf;if(ye(me)){var U=me.call(x);if(!ge(U))return U}}else{var me=x.valueOf;if(ye(me)){var U=me.call(x);if(!ge(U))return U}var At=x.toString;if(ye(At)){var U=At.call(x);if(!ge(U))return U}}throw new TypeError}a(Ve,"OrdinaryToPrimitive");function j(x){return!!x}a(j,"ToBoolean");function re(x){return""+x}a(re,"ToString");function pe(x){var C=$e(x,3);return Z(C)?C:re(C)}a(pe,"ToPropertyKey");function xe(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}a(xe,"IsArray");function ye(x){return typeof x=="function"}a(ye,"IsCallable");function _e(x){return typeof x=="function"}a(_e,"IsConstructor");function W(x){switch(X(x)){case 3:return!0;case 4:return!0;default:return!1}}a(W,"IsPropertyKey");function J(x,C){return x===C||x!==x&&C!==C}a(J,"SameValueZero");function ee(x,C){var F=x[C];if(F!=null){if(!ye(F))throw new TypeError;return F}}a(ee,"GetMethod");function de(x){var C=ee(x,o);if(!ye(C))throw new TypeError;var F=C.call(x);if(!ge(F))throw new TypeError;return F}a(de,"GetIterator");function Te(x){return x.value}a(Te,"IteratorValue");function Ae(x){var C=x.next();return C.done?!1:C}a(Ae,"IteratorStep");function Pe(x){var C=x.return;C&&C.call(x)}a(Pe,"IteratorClose");function Ce(x){var C=Object.getPrototypeOf(x);if(typeof x!="function"||x===d||C!==d)return C;var F=x.prototype,U=F&&Object.getPrototypeOf(F);if(U==null||U===Object.prototype)return C;var me=U.constructor;return typeof me!="function"||me===x?C:me}a(Ce,"OrdinaryGetPrototypeOf");function Fe(){var x;!q(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(x=Ne(t.Reflect));var C,F,U,me=new g,At={registerProvider:Ot,getProvider:ne,setProvider:ae};return At;function Ot(fe){if(!Object.isExtensible(At))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===fe:break;case q(C):C=fe;break;case C===fe:break;case q(F):F=fe;break;case F===fe:break;default:U===void 0&&(U=new p),U.add(fe);break}}function ze(fe,We){if(!q(C)){if(C.isProviderFor(fe,We))return C;if(!q(F)){if(F.isProviderFor(fe,We))return C;if(!q(U))for(var lt=de(U);;){var ut=Ae(lt);if(!ut)return;var Mr=Te(ut);if(Mr.isProviderFor(fe,We))return Pe(lt),Mr}}}if(!q(x)&&x.isProviderFor(fe,We))return x}function ne(fe,We){var lt=me.get(fe),ut;return q(lt)||(ut=lt.get(We)),q(ut)&&(ut=ze(fe,We),q(ut)||(q(lt)&&(lt=new h,me.set(fe,lt)),lt.set(We,ut))),ut}function ie(fe){if(q(fe))throw new TypeError;return C===fe||F===fe||!q(U)&&U.has(fe)}function ae(fe,We,lt){if(!ie(lt))throw new Error("Metadata provider not registered.");var ut=ne(fe,We);if(ut!==lt){if(!q(ut))return!1;var Mr=me.get(fe);q(Mr)&&(Mr=new h,me.set(fe,Mr)),Mr.set(We,lt)}return!0}}a(Fe,"CreateMetadataRegistry");function De(){var x;return!q(y)&&ge(t.Reflect)&&Object.isExtensible(t.Reflect)&&(x=t.Reflect[y]),q(x)&&(x=Fe()),!q(y)&&ge(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}a(De,"GetOrCreateMetadataRegistry");function Le(x){var C=new g,F={isProviderFor:a(function(ie,ae){var fe=C.get(ie);return q(fe)?!1:fe.has(ae)},"isProviderFor"),OrdinaryDefineOwnMetadata:Ot,OrdinaryHasOwnMetadata:me,OrdinaryGetOwnMetadata:At,OrdinaryOwnMetadataKeys:ze,OrdinaryDeleteMetadata:ne};return b.registerProvider(F),F;function U(ie,ae,fe){var We=C.get(ie),lt=!1;if(q(We)){if(!fe)return;We=new h,C.set(ie,We),lt=!0}var ut=We.get(ae);if(q(ut)){if(!fe)return;if(ut=new h,We.set(ae,ut),!x.setProvider(ie,ae,F))throw We.delete(ae),lt&&C.delete(ie),new Error("Wrong provider for target.")}return ut}a(U,"GetOrCreateMetadataMap");function me(ie,ae,fe){var We=U(ae,fe,!1);return q(We)?!1:j(We.has(ie))}a(me,"OrdinaryHasOwnMetadata");function At(ie,ae,fe){var We=U(ae,fe,!1);if(!q(We))return We.get(ie)}a(At,"OrdinaryGetOwnMetadata");function Ot(ie,ae,fe,We){var lt=U(fe,We,!0);lt.set(ie,ae)}a(Ot,"OrdinaryDefineOwnMetadata");function ze(ie,ae){var fe=[],We=U(ie,ae,!1);if(q(We))return fe;for(var lt=We.keys(),ut=de(lt),Mr=0;;){var On=Ae(ut);if(!On)return fe.length=Mr,fe;var Qn=Te(On);try{fe[Mr]=Qn}catch(un){try{Pe(ut)}finally{throw un}}Mr++}}a(ze,"OrdinaryOwnMetadataKeys");function ne(ie,ae,fe){var We=U(ae,fe,!1);if(q(We)||!We.delete(ie))return!1;if(We.size===0){var lt=C.get(ae);q(lt)||(lt.delete(fe),lt.size===0&&C.delete(lt))}return!0}a(ne,"OrdinaryDeleteMetadata")}a(Le,"CreateMetadataProvider");function Ne(x){var C=x.defineMetadata,F=x.hasOwnMetadata,U=x.getOwnMetadata,me=x.getOwnMetadataKeys,At=x.deleteMetadata,Ot=new g,ze={isProviderFor:a(function(ne,ie){var ae=Ot.get(ne);return!q(ae)&&ae.has(ie)?!0:me(ne,ie).length?(q(ae)&&(ae=new p,Ot.set(ne,ae)),ae.add(ie),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:me,OrdinaryDeleteMetadata:At};return ze}a(Ne,"CreateFallbackProvider");function Ie(x,C,F){var U=b.getProvider(x,C);if(!q(U))return U;if(F){if(b.setProvider(x,C,S))return S;throw new Error("Illegal state.")}}a(Ie,"GetMetadataProvider");function ke(){var x={},C=[],F=(function(){function ze(ne,ie,ae){this._index=0,this._keys=ne,this._values=ie,this._selector=ae}return a(ze,"MapIterator"),ze.prototype["@@iterator"]=function(){return this},ze.prototype[o]=function(){return this},ze.prototype.next=function(){var ne=this._index;if(ne>=0&&ne<this._keys.length){var ie=this._selector(this._keys[ne],this._values[ne]);return ne+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:ie,done:!1}}return{value:void 0,done:!0}},ze.prototype.throw=function(ne){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),ne},ze.prototype.return=function(ne){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:ne,done:!0}},ze})(),U=(function(){function ze(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return a(ze,"Map"),Object.defineProperty(ze.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),ze.prototype.has=function(ne){return this._find(ne,!1)>=0},ze.prototype.get=function(ne){var ie=this._find(ne,!1);return ie>=0?this._values[ie]:void 0},ze.prototype.set=function(ne,ie){var ae=this._find(ne,!0);return this._values[ae]=ie,this},ze.prototype.delete=function(ne){var ie=this._find(ne,!1);if(ie>=0){for(var ae=this._keys.length,fe=ie+1;fe<ae;fe++)this._keys[fe-1]=this._keys[fe],this._values[fe-1]=this._values[fe];return this._keys.length--,this._values.length--,J(ne,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},ze.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},ze.prototype.keys=function(){return new F(this._keys,this._values,me)},ze.prototype.values=function(){return new F(this._keys,this._values,At)},ze.prototype.entries=function(){return new F(this._keys,this._values,Ot)},ze.prototype["@@iterator"]=function(){return this.entries()},ze.prototype[o]=function(){return this.entries()},ze.prototype._find=function(ne,ie){if(!J(this._cacheKey,ne)){this._cacheIndex=-1;for(var ae=0;ae<this._keys.length;ae++)if(J(this._keys[ae],ne)){this._cacheIndex=ae;break}}return this._cacheIndex<0&&ie&&(this._cacheIndex=this._keys.length,this._keys.push(ne),this._values.push(void 0)),this._cacheIndex},ze})();return U;function me(ze,ne){return ze}function At(ze,ne){return ne}function Ot(ze,ne){return[ze,ne]}}a(ke,"CreateMapPolyfill");function at(){var x=(function(){function C(){this._map=new h}return a(C,"Set"),Object.defineProperty(C.prototype,"size",{get:a(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),C.prototype.has=function(F){return this._map.has(F)},C.prototype.add=function(F){return this._map.set(F,F),this},C.prototype.delete=function(F){return this._map.delete(F)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[o]=function(){return this.keys()},C})();return x}a(at,"CreateSetPolyfill");function Ze(){var x=16,C=f.create(),F=U();return(function(){function ne(){this._key=U()}return a(ne,"WeakMap"),ne.prototype.has=function(ie){var ae=me(ie,!1);return ae!==void 0?f.has(ae,this._key):!1},ne.prototype.get=function(ie){var ae=me(ie,!1);return ae!==void 0?f.get(ae,this._key):void 0},ne.prototype.set=function(ie,ae){var fe=me(ie,!0);return fe[this._key]=ae,this},ne.prototype.delete=function(ie){var ae=me(ie,!1);return ae!==void 0?delete ae[this._key]:!1},ne.prototype.clear=function(){this._key=U()},ne})();function U(){var ne;do ne="@@WeakMap@@"+ze();while(f.has(C,ne));return C[ne]=!0,ne}function me(ne,ie){if(!r.call(ne,F)){if(!ie)return;Object.defineProperty(ne,F,{value:f.create()})}return ne[F]}function At(ne,ie){for(var ae=0;ae<ie;++ae)ne[ae]=Math.random()*255|0;return ne}function Ot(ne){if(typeof Uint8Array=="function"){var ie=new Uint8Array(ne);return typeof crypto<"u"?crypto.getRandomValues(ie):typeof msCrypto<"u"?msCrypto.getRandomValues(ie):At(ie,ne),ie}return At(new Array(ne),ne)}function ze(){var ne=Ot(x);ne[6]=ne[6]&79|64,ne[8]=ne[8]&191|128;for(var ie="",ae=0;ae<x;++ae){var fe=ne[ae];(ae===4||ae===6||ae===8)&&(ie+="-"),fe<16&&(ie+="0"),ie+=fe.toString(16).toLowerCase()}return ie}}a(Ze,"CreateWeakMapPolyfill");function Je(x){return x.__=void 0,delete x.__,x}a(Je,"MakeDictionary")})})(ex||(ex={}))});var df=w(Yb=>{var Hh=class extends Error{static{a(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}},Qb=class extends Hh{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yb.CommanderError=Hh;Yb.InvalidArgumentError=Qb});var zh=w(Jb=>{var{InvalidArgumentError:y9}=df(),Xb=class{static{a(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 y9(`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 b9(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}a(b9,"humanReadableArgName");Jb.Argument=Xb;Jb.humanReadableArgName=b9});var t_=w(e_=>{var{humanReadableArgName:_9}=zh(),Zb=class{static{a(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=a(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=>_9(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 o=r(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(d,h){return t.formatItem(d,r,h,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let p=d.map(g=>s(t.styleOptionTerm(t.optionTerm(g)),t.styleOptionDescription(t.optionDescription(g))));o=o.concat(this.formatItemList(h,p,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(h=>s(t.styleOptionTerm(t.optionTerm(h)),t.styleOptionDescription(t.optionDescription(h))));o=o.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let p=d.map(g=>s(t.styleSubcommandTerm(t.subcommandTerm(g)),t.styleSubcommandDescription(t.subcommandDescription(g))));o=o.concat(this.formatItemList(h,p,t))}),o.join(`
|
|
7
7
|
`)}displayWidth(e){return tx(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 o=" ".repeat(2);if(!r)return o+e;let c=e.padEnd(t+e.length-i.displayWidth(e)),l=2,f=(this.helpWidth??80)-t-l-2,d;return f<this.minWidthToWrap||i.preformatted(r)?d=r:d=i.boxWrap(r,f).replace(/\n/g,`
|
|
8
8
|
`+" ".repeat(t+l)),o+c+" ".repeat(l)+d.replace(/\n/g,`
|
|
9
9
|
${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return r.forEach(o=>{let c=o.match(i);if(c===null){s.push("");return}let l=[c.shift()],u=this.displayWidth(l[0]);c.forEach(f=>{let d=this.displayWidth(f);if(u+d<=t){l.push(f),u+=d;return}s.push(l.join(""));let h=f.trimStart();l=[h],u=this.displayWidth(h)}),s.push(l.join(""))}),s.join(`
|
|
@@ -28,16 +28,16 @@ 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 dt.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()}`,dt.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new C9(this.options),t=a(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=a(o=>{let c=o.attributeName(),l=this.getOptionValue(c),u=this.options.find(d=>d.negate&&c===d.attributeName()),f=this.options.find(d=>!d.negate&&c===d.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:f||o},"findBestOptionFromValue"),i=a(o=>{let c=r(o),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 o=s.createHelp().visibleOptions(s).filter(c=>c.long).map(c=>c.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=ox(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=ox(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=>I9(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=eo.basename(e,eo.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=a(c=>this._outputConfiguration.writeErr(c),"baseWrite"),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=a(c=>this._outputConfiguration.writeOut(c),"baseWrite"),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a(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(o=>o.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(o=>o.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(dt.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 o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
|
|
31
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ax(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})}a(ax,"incrementNodeInspectorPort");function l_(){if(dt.env.NO_COLOR||dt.env.FORCE_COLOR==="0"||dt.env.FORCE_COLOR==="false")return!1;if(dt.env.FORCE_COLOR||dt.env.CLICOLOR_FORCE!==void 0)return!0}a(l_,"useColor");u_.Command=c_;u_.useColor=l_});var dx=w(li=>{var{Argument:lx}=zh(),{Command:f_}=cx(),{CommanderError:O9,InvalidArgumentError:ux}=df(),{Help:P9}=t_(),{Option:fx}=s_();li.program=new f_;li.createCommand=n=>new f_(n);li.createOption=(n,e)=>new fx(n,e);li.createArgument=(n,e)=>new lx(n,e);li.Command=f_;li.Option=fx;li.Argument=lx;li.Help=P9;li.CommanderError=O9;li.InvalidArgumentError=ux;li.InvalidOptionArgumentError=ux});var tl=w(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.AssetClass=void 0;var px;(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.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.WORKFLOW="ems__Workflow",n.WORKFLOW_STATE="ems__WorkflowState",n.WORKFLOW_TRANSITION="ems__WorkflowTransition",n.COMMAND="exocmd__Command",n.PRECONDITION="exocmd__Precondition",n.GROUNDING="exocmd__Grounding",n.COMMAND_BINDING="exocmd__CommandBinding"})(px||(Qh.AssetClass=px={}))});var rl=w(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.EffortStatus=void 0;var mx;(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"})(mx||(Yh.EffortStatus=mx={}))});var d_=w(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.EFFORT_STATUS_OPTIONS=void 0;Xh.EFFORT_STATUS_OPTIONS=[{value:"[[ems__EffortStatusDraft]]",label:"Draft"},{value:"[[ems__EffortStatusBacklog]]",label:"Backlog"},{value:"[[ems__EffortStatusAnalysis]]",label:"Analysis"},{value:"[[ems__EffortStatusToDo]]",label:"To Do"},{value:"[[ems__EffortStatusDoing]]",label:"Doing"},{value:"[[ems__EffortStatusDone]]",label:"Done"},{value:"[[ems__EffortStatusTrashed]]",label:"Trashed"}]});var Ko=w(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.GroundingType=void 0;var gx;(function(n){n.SPARQL_UPDATE="sparql_update",n.PROPERTY_DELETE="property_delete",n.PROPERTY_SET="property_set",n.COMPOSITE="composite",n.SERVICE_CALL="service_call",n.CREATE_INSTANCE="create_instance",n.PROPERTY_APPEND="property_append",n.PROPERTY_INCREMENT="property_increment",n.PROPERTY_SHIFT="property_shift",n.WORKFLOW_TRANSITION="workflow_transition",n.BODY_TEMPLATE="body_template"})(gx||(Jh.GroundingType=gx={}))});var hf=w(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.GROUNDING_TYPE_IRI_TO_ENUM=Fn.GROUNDING_TYPE_UID_TO_ENUM=Fn.GROUNDING_TYPE_UIDS=void 0;Fn.resolveGroundingTypeFromIRI=D9;Fn.resolveGroundingTypeFromWikilinkLiteral=L9;var Wt=Ko();Fn.GROUNDING_TYPE_UIDS={[Wt.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[Wt.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[Wt.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[Wt.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[Wt.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[Wt.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[Wt.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[Wt.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[Wt.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[Wt.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[Wt.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};Fn.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries(Fn.GROUNDING_TYPE_UIDS).map(([n,e])=>[e,n])));var Ai="https://exocortex.my/ontology/exocmd#";Fn.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${Ai}GroundingTypePropertySet`]:Wt.GroundingType.PROPERTY_SET,[`${Ai}GroundingTypePropertyDelete`]:Wt.GroundingType.PROPERTY_DELETE,[`${Ai}GroundingTypeComposite`]:Wt.GroundingType.COMPOSITE,[`${Ai}GroundingTypeServiceCall`]:Wt.GroundingType.SERVICE_CALL,[`${Ai}GroundingTypeCreateInstance`]:Wt.GroundingType.CREATE_INSTANCE,[`${Ai}GroundingTypePropertyAppend`]:Wt.GroundingType.PROPERTY_APPEND,[`${Ai}GroundingTypePropertyIncrement`]:Wt.GroundingType.PROPERTY_INCREMENT,[`${Ai}GroundingTypePropertyShift`]:Wt.GroundingType.PROPERTY_SHIFT,[`${Ai}GroundingTypeSparqlUpdate`]:Wt.GroundingType.SPARQL_UPDATE,[`${Ai}GroundingTypeWorkflowTransition`]:Wt.GroundingType.WORKFLOW_TRANSITION,[`${Ai}GroundingTypeBodyTemplate`]:Wt.GroundingType.BODY_TEMPLATE});var F9=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function D9(n){let e=Fn.GROUNDING_TYPE_IRI_TO_ENUM[n];if(e!==void 0)return e;let t=n.match(F9);return t?Fn.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(D9,"resolveGroundingTypeFromIRI");function L9(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?Fn.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(L9,"resolveGroundingTypeFromWikilinkLiteral")});var h_=w(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.CommandBindingStyleProperty=ui.CommandBindingProperty=ui.GroundingProperty=ui.PreconditionProperty=ui.CommandProperty=void 0;ui.CommandProperty={ICON:"exocmd__Command_icon",PRECONDITION:"exocmd__Command_precondition",GROUNDING:"exocmd__Command_grounding",CONFIRM_MESSAGE:"exocmd__Command_confirmMessage",SUCCESS_MESSAGE:"exocmd__Command_successMessage",CATEGORY:"exocmd__Command_category",OPEN_IN_SAME_TAB:"exocmd__Command_openInSameTab"};ui.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};ui.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",STEPS:"exocmd__Grounding_steps",IS_DEFINED_BY:"exocmd__Grounding_isDefinedBy",LABEL_TEMPLATE:"exocmd__Grounding_labelTemplate"};ui.CommandBindingProperty={COMMAND:"exocmd__CommandBinding_command",TARGET_CLASS:"exocmd__CommandBinding_targetClass",TARGET_PROTOTYPE:"exocmd__CommandBinding_targetPrototype",TARGET_ASSET:"exocmd__CommandBinding_targetAsset",POSITION:"exocmd__CommandBinding_position",ORDER:"exocmd__CommandBinding_order",PRECONDITION:"exocmd__CommandBinding_precondition",STYLE:"exocmd__CommandBinding_style",VARIANT:"exocmd__CommandBinding_variant"};ui.CommandBindingStyleProperty={VARIANT:"exocmd__CommandBindingStyle_variant",SHOW_ICON:"exocmd__CommandBindingStyle_showIcon",LABEL_CLASS:"exocmd__CommandBindingStyle_labelClass",ARIA_LABEL:"exocmd__CommandBindingStyle_ariaLabel",TOOLTIP:"exocmd__CommandBindingStyle_tooltip",KEYBOARD_SHORTCUT:"exocmd__CommandBindingStyle_keyboardShortcut",SOURCE:"exocmd__CommandBindingStyle_source"}});var p_=w(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.STYLE_SOURCE_VALUES=Dn.LABEL_CLASS_VALUES=Dn.COMMAND_VARIANT_VALUES=void 0;Dn.isCommandVariant=N9;Dn.isLabelClass=k9;Dn.isStyleSource=M9;Dn.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Dn.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Dn.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function N9(n){return typeof n=="string"&&Dn.COMMAND_VARIANT_VALUES.includes(n)}a(N9,"isCommandVariant");function k9(n){return typeof n=="string"&&Dn.LABEL_CLASS_VALUES.includes(n)}a(k9,"isLabelClass");function M9(n){return typeof n=="string"&&Dn.STYLE_SOURCE_VALUES.includes(n)}a(M9,"isStyleSource")});var yx=w(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.isCommandFrontmatter=j9;nl.isPreconditionFrontmatter=$9;nl.isGroundingFrontmatter=U9;nl.isCommandBindingFrontmatter=B9;function j9(n){return Zh(n,"exocmd__Command")}a(j9,"isCommandFrontmatter");function $9(n){return Zh(n,"exocmd__Precondition")}a($9,"isPreconditionFrontmatter");function U9(n){return Zh(n,"exocmd__Grounding")}a(U9,"isGroundingFrontmatter");function B9(n){return Zh(n,"exocmd__CommandBinding")}a(B9,"isCommandBindingFrontmatter");function Zh(n,e){let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(Zh,"hasInstanceClass")});var bx=w(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.parseGroundingDefinitionFromFrontmatter=q9;var V9=hf();function m_(n){if(typeof n!="string")return"";let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(m_,"normalizeGroundingRef");function q9(n,e,t){let r=e.exocmd__Grounding_type,i=(()=>{if(typeof r!="string")return r;let p=(0,V9.resolveGroundingTypeFromWikilinkLiteral)(r);if(p!==null)return p;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${r}' for exocmd__Grounding_type in fixture ${n}. Migrate to wikilink form per RFC 9d20c91f Phase 3.`)})(),s=i==="service_call"?e.exocmd__Grounding_serviceId??e.exocmd__Grounding_targetProperty:e.exocmd__Grounding_targetProperty,o;if(i==="composite"){let p=e.exocmd__Grounding_steps;Array.isArray(p)&&(o=p.map(g=>t(m_(g))))}let c=e.exocmd__Grounding_incrementBy,l;if(c!=null&&c!==""){let p=Number.parseInt(String(c),10);Number.isFinite(p)&&(l=p)}let u=e.exocmd__Grounding_targetValueRef,f=u?m_(u):void 0,d=e.exocmd__Grounding_templateRef,h=d?m_(d):void 0;return{id:n,label:e.exo__Asset_label??"",type:i,targetProperty:s,targetValueRef:f,targetValueLiteral:e.exocmd__Grounding_targetValueLiteral,targetValueSubstitution:e.exocmd__Grounding_targetValueSubstitution,serviceCallPayload:e.exocmd__Grounding_serviceCallPayload,appendExpression:e.exocmd__Grounding_appendExpression,targetClass:e.exocmd__Grounding_targetClass,targetPrototype:e.exocmd__Grounding_targetPrototype,targetFolder:e.exocmd__Grounding_targetFolder,shiftDelta:e.exocmd__Grounding_shiftDelta,incrementBy:l,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:h,steps:o}}a(q9,"parseGroundingDefinitionFromFrontmatter")});var _x=w(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.hasPosition=G9;ep.isFixed=W9;function G9(n){return typeof n.x=="number"&&typeof n.y=="number"}a(G9,"hasPosition");function W9(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}a(W9,"isFixed")});var Sx=w(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.createEmptyGraphData=H9;tp.mergeGraphData=z9;function H9(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(H9,"createEmptyGraphData");function z9(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 o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}a(z9,"mergeGraphData")});var y_=w(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.createEdgeId=K9;rp.edgesEqual=Q9;function K9(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}a(K9,"createEdgeId");function Q9(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}a(Q9,"edgesEqual")});var b_=w(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.BUILT_IN_EDGE_STYLES=Ht.BUILT_IN_NODE_STYLES=Ht.DEFAULT_EDGE_STYLE=Ht.DEFAULT_NODE_STYLE=Ht.RDF_TYPE_PREDICATES=void 0;Ht.mergeNodeStyles=Y9;Ht.mergeEdgeStyles=X9;Ht.extractLocalName=J9;Ht.isClassType=Z9;Ht.isTypePredicate=e5;Ht.isSubClassPredicate=t5;Ht.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"};Ht.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Ht.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Ht.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"},person__Person:{color:"#06b6d4",shape:"circle"},ims__Person:{color:"#06b6d4",shape:"circle"}};Ht.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 Y9(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(Y9,"mergeNodeStyles");function X9(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(X9,"mergeEdgeStyles");function J9(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}a(J9,"extractLocalName");function Z9(n){return n===Ht.RDF_TYPE_PREDICATES.RDFS_CLASS||n===Ht.RDF_TYPE_PREDICATES.OWL_CLASS}a(Z9,"isClassType");function e5(n){return n===Ht.RDF_TYPE_PREDICATES.RDF_TYPE}a(e5,"isTypePredicate");function t5(n){return n===Ht.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(t5,"isSubClassPredicate")});var vx=w(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0})});var Oe=w(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.IRI=void 0;var __=class n{static{a(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)}}};np.IRI=__});var Ge=w(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Literal=void 0;Qa.parseLanguageTag=Ex;Qa.createDirectionalLiteral=n5;Qa.createLiteralFromLanguageTag=i5;var r5="http://www.w3.org/2001/XMLSchema#string",pf=class{static{a(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===r5?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}};Qa.Literal=pf;function Ex(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()}}a(Ex,"parseLanguageTag");function n5(n,e,t){return new pf(n,void 0,e,t)}a(n5,"createDirectionalLiteral");function i5(n,e){let{language:t,direction:r}=Ex(e);return new pf(n,void 0,t,r)}a(i5,"createLiteralFromLanguageTag")});var jt=w(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.BlankNode=void 0;var ip=class n{static{a(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())}};sp.BlankNode=ip;ip.counter=0});var zt=w(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.Namespace=void 0;var Tx=Oe(),Ye=class n{static{a(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new Tx.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new Tx.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)}static forPrefix(e){if(!/^[a-z][a-zA-Z0-9]*$/.test(e))return null;let t=n.KNOWN_NAMESPACES.find(r=>r.prefix===e);return t||new n(e,`${n.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=/^([a-z][a-zA-Z0-9]*)__(.+)$/.exec(e);if(!t)return null;let r=n.forPrefix(t[1]);return r?{namespace:r,localName:t[2]}:null}};op.Namespace=Ye;Ye.RDF=new Ye("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Ye.RDFS=new Ye("rdfs","http://www.w3.org/2000/01/rdf-schema#");Ye.OWL=new Ye("owl","http://www.w3.org/2002/07/owl#");Ye.XSD=new Ye("xsd","http://www.w3.org/2001/XMLSchema#");Ye.EXO=new Ye("exo","https://exocortex.my/ontology/exo#");Ye.EMS=new Ye("ems","https://exocortex.my/ontology/ems#");Ye.EXOCMD=new Ye("exocmd","https://exocortex.my/ontology/exocmd#");Ye.IMS=new Ye("ims","https://exocortex.my/ontology/ims#");Ye.ZTLK=new Ye("ztlk","https://exocortex.my/ontology/ztlk#");Ye.PTMS=new Ye("ptms","https://exocortex.my/ontology/ptms#");Ye.LIT=new Ye("lit","https://exocortex.my/ontology/lit#");Ye.INBOX=new Ye("inbox","https://exocortex.my/ontology/inbox#");Ye.PMBOK=new Ye("pmbok","https://exocortex.my/ontology/pmbok#");Ye.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Ye.KNOWN_NAMESPACES=[Ye.EXO,Ye.EMS,Ye.EXOCMD,Ye.IMS,Ye.ZTLK,Ye.PTMS,Ye.LIT,Ye.INBOX,Ye.PMBOK]});var Qn=w(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.Triple=void 0;var S_=Oe(),w_=Ge(),v_=jt(),E_=class{static{a(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 S_.IRI&&t instanceof S_.IRI||e instanceof v_.BlankNode&&t instanceof v_.BlankNode||e instanceof w_.Literal&&t instanceof w_.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 S_.IRI?`<${e.value}>`:e instanceof v_.BlankNode||e instanceof w_.Literal||this.isQuotedTriple(e)?e.toString():""}};ap.Triple=E_});var mf=w(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.QuotedTriple=void 0;var T_=Oe(),A_=Ge(),I_=jt(),x_=class n{static{a(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 T_.IRI&&t instanceof T_.IRI||e instanceof I_.BlankNode&&t instanceof I_.BlankNode||e instanceof A_.Literal&&t instanceof A_.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 T_.IRI?`<${e.value}>`:e instanceof I_.BlankNode||e instanceof A_.Literal||e instanceof n?e.toString():""}};cp.QuotedTriple=x_});var Ax=w(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.QuotedTriple=or.Triple=or.Namespace=or.BlankNode=or.createLiteralFromLanguageTag=or.createDirectionalLiteral=or.parseLanguageTag=or.Literal=or.IRI=void 0;var s5=Oe();Object.defineProperty(or,"IRI",{enumerable:!0,get:a(function(){return s5.IRI},"get")});var lp=Ge();Object.defineProperty(or,"Literal",{enumerable:!0,get:a(function(){return lp.Literal},"get")});Object.defineProperty(or,"parseLanguageTag",{enumerable:!0,get:a(function(){return lp.parseLanguageTag},"get")});Object.defineProperty(or,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return lp.createDirectionalLiteral},"get")});Object.defineProperty(or,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return lp.createLiteralFromLanguageTag},"get")});var o5=jt();Object.defineProperty(or,"BlankNode",{enumerable:!0,get:a(function(){return o5.BlankNode},"get")});var a5=zt();Object.defineProperty(or,"Namespace",{enumerable:!0,get:a(function(){return a5.Namespace},"get")});var c5=Qn();Object.defineProperty(or,"Triple",{enumerable:!0,get:a(function(){return c5.Triple},"get")});var l5=mf();Object.defineProperty(or,"QuotedTriple",{enumerable:!0,get:a(function(){return l5.QuotedTriple},"get")})});var up=w(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.UUID_URL_NAMESPACE=di.DEFAULT_LANGUAGE_TAG=di.REQUIRED_PROPERTIES=di.ALLOWED_PROPERTIES=di.Exo003MetadataType=void 0;var fi;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(fi||(di.Exo003MetadataType=fi={}));di.ALLOWED_PROPERTIES={[fi.Namespace]:["metadata","uri","aliases"],[fi.Anchor]:["metadata","uri","aliases"],[fi.BlankNode]:["metadata","uri","aliases"],[fi.Statement]:["metadata","subject","predicate","object","aliases"],[fi.Body]:["metadata","subject","predicate","aliases"]};di.REQUIRED_PROPERTIES={[fi.Namespace]:["metadata","uri"],[fi.Anchor]:["metadata","uri"],[fi.BlankNode]:["metadata","uri"],[fi.Statement]:["metadata","subject","predicate","object"],[fi.Body]:["metadata","subject","predicate"]};di.DEFAULT_LANGUAGE_TAG="ru";di.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var Ix=w(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var xx=w(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.default="00000000-0000-0000-0000-000000000000"});var Rx=w(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.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 gf=w(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var u5=Rx();function f5(n){return typeof n=="string"&&u5.default.test(n)}a(f5,"validate");P_.default=f5});var yf=w(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var d5=gf();function h5(n){if(!(0,d5.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)}a(h5,"parse");F_.default=h5});var to=w(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.unsafeStringify=void 0;var p5=gf(),Ur=[];for(let n=0;n<256;++n)Ur.push((n+256).toString(16).slice(1));function Cx(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()}a(Cx,"unsafeStringify");bf.unsafeStringify=Cx;function m5(n,e=0){let t=Cx(n,e);if(!(0,p5.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(m5,"stringify");bf.default=m5});var hp=w(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var g5=require("crypto"),dp=new Uint8Array(256),fp=dp.length;function y5(){return fp>dp.length-16&&((0,g5.randomFillSync)(dp),fp=0),dp.slice(fp,fp+=16)}a(y5,"rng");D_.default=y5});var L_=w(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.updateV1State=void 0;var Ox=hp(),b5=to(),_f={};function _5(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=Px(n.random??n.rng?.()??(0,Ox.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),o=(0,Ox.default)();Fx(_f,s,o),r=Px(o,_f.msecs,_f.nsecs,i?void 0:_f.clockseq,i?void 0:_f.node,e,t)}return e??(0,b5.unsafeStringify)(r)}a(_5,"v1");function Fx(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}a(Fx,"updateV1State");Sf.updateV1State=Fx;function Px(n,e,t,r,i,s,o=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),o=0;else if(o<0||o+16>s.length)throw new RangeError(`UUID byte range ${o}:${o+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[o++]=c>>>24&255,s[o++]=c>>>16&255,s[o++]=c>>>8&255,s[o++]=c&255;let l=e/4294967296*1e4&268435455;s[o++]=l>>>8&255,s[o++]=l&255,s[o++]=l>>>24&15|16,s[o++]=l>>>16&255,s[o++]=r>>>8|128,s[o++]=r&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(Px,"v1Bytes");Sf.default=_5});var k_=w(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var S5=yf(),w5=to();function v5(n){let e=typeof n=="string"?(0,S5.default)(n):n,t=E5(e);return typeof n=="string"?(0,w5.unsafeStringify)(t):t}a(v5,"v1ToV6");N_.default=v5;function E5(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])}a(E5,"_v1ToV6")});var Dx=w(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var T5=require("crypto");function A5(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,T5.createHash)("md5").update(n).digest()}a(A5,"md5");M_.default=A5});var wf=w(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.URL=ro.DNS=ro.stringToBytes=void 0;var Lx=yf(),I5=to();function Nx(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}a(Nx,"stringToBytes");ro.stringToBytes=Nx;ro.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ro.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function x5(n,e,t,r,i,s){let o=typeof t=="string"?Nx(t):t,c=typeof r=="string"?(0,Lx.default)(r):r;if(typeof r=="string"&&(r=(0,Lx.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(c),l.set(o,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){if(s=s||0,s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,I5.unsafeStringify)(l)}a(x5,"v35");ro.default=x5});var Mx=w(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.URL=Ya.DNS=void 0;var R5=Dx(),j_=wf(),kx=wf();Object.defineProperty(Ya,"DNS",{enumerable:!0,get:a(function(){return kx.DNS},"get")});Object.defineProperty(Ya,"URL",{enumerable:!0,get:a(function(){return kx.URL},"get")});function $_(n,e,t,r){return(0,j_.default)(48,R5.default,n,e,t,r)}a($_,"v3");$_.DNS=j_.DNS;$_.URL=j_.URL;Ya.default=$_});var jx=w(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var C5=require("crypto");U_.default={randomUUID:C5.randomUUID}});var Ux=w(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var $x=jx(),O5=hp(),P5=to();function F5(n,e,t){if($x.default.randomUUID&&!e&&!n)return $x.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,O5.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,P5.unsafeStringify)(r)}a(F5,"v4");B_.default=F5});var Bx=w(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var D5=require("crypto");function L5(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,D5.createHash)("sha1").update(n).digest()}a(L5,"sha1");V_.default=L5});var qx=w(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.URL=Xa.DNS=void 0;var N5=Bx(),q_=wf(),Vx=wf();Object.defineProperty(Xa,"DNS",{enumerable:!0,get:a(function(){return Vx.DNS},"get")});Object.defineProperty(Xa,"URL",{enumerable:!0,get:a(function(){return Vx.URL},"get")});function G_(n,e,t,r){return(0,q_.default)(80,N5.default,n,e,t,r)}a(G_,"v5");G_.DNS=q_.DNS;G_.URL=q_.URL;Xa.default=G_});var Gx=w(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var k5=to(),M5=L_(),j5=k_();function $5(n,e,t){n??={},t??=0;let r=(0,M5.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,j5.default)(r),e){if(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,k5.unsafeStringify)(r)}a($5,"v6");W_.default=$5});var Wx=w(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var U5=yf(),B5=to();function V5(n){let e=typeof n=="string"?(0,U5.default)(n):n,t=q5(e);return typeof n=="string"?(0,B5.unsafeStringify)(t):t}a(V5,"v6ToV1");H_.default=V5;function q5(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])}a(q5,"_v6ToV1")});var Qx=w(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.updateV7State=void 0;var Hx=hp(),G5=to(),z_={};function W5(n,e,t){let r;if(n)r=zx(n.random??n.rng?.()??(0,Hx.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,Hx.default)();Kx(z_,i,s),r=zx(s,z_.msecs,z_.seq,e,t)}return e??(0,G5.unsafeStringify)(r)}a(W5,"v7");function Kx(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}a(Kx,"updateV7State");vf.updateV7State=Kx;function zx(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}a(zx,"v7Bytes");vf.default=W5});var Yx=w(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var H5=gf();function z5(n){if(!(0,H5.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}a(z5,"version");K_.default=z5});var Ii=w(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.version=ht.validate=ht.v7=ht.v6ToV1=ht.v6=ht.v5=ht.v4=ht.v3=ht.v1ToV6=ht.v1=ht.stringify=ht.parse=ht.NIL=ht.MAX=void 0;var K5=Ix();Object.defineProperty(ht,"MAX",{enumerable:!0,get:a(function(){return K5.default},"get")});var Q5=xx();Object.defineProperty(ht,"NIL",{enumerable:!0,get:a(function(){return Q5.default},"get")});var Y5=yf();Object.defineProperty(ht,"parse",{enumerable:!0,get:a(function(){return Y5.default},"get")});var X5=to();Object.defineProperty(ht,"stringify",{enumerable:!0,get:a(function(){return X5.default},"get")});var J5=L_();Object.defineProperty(ht,"v1",{enumerable:!0,get:a(function(){return J5.default},"get")});var Z5=k_();Object.defineProperty(ht,"v1ToV6",{enumerable:!0,get:a(function(){return Z5.default},"get")});var e$=Mx();Object.defineProperty(ht,"v3",{enumerable:!0,get:a(function(){return e$.default},"get")});var t$=Ux();Object.defineProperty(ht,"v4",{enumerable:!0,get:a(function(){return t$.default},"get")});var r$=qx();Object.defineProperty(ht,"v5",{enumerable:!0,get:a(function(){return r$.default},"get")});var n$=Gx();Object.defineProperty(ht,"v6",{enumerable:!0,get:a(function(){return n$.default},"get")});var i$=Wx();Object.defineProperty(ht,"v6ToV1",{enumerable:!0,get:a(function(){return i$.default},"get")});var s$=Qx();Object.defineProperty(ht,"v7",{enumerable:!0,get:a(function(){return s$.default},"get")});var o$=gf();Object.defineProperty(ht,"validate",{enumerable:!0,get:a(function(){return o$.default},"get")});var a$=Yx();Object.defineProperty(ht,"version",{enumerable:!0,get:a(function(){return a$.default},"get")})});var X_=w(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.Exo003UUIDGenerator=void 0;var Q_=Ii(),Xx=up(),Y_=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,Q_.v5)(e,Xx.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,Q_.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,Q_.v5)(e,Xx.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)}};pp.Exo003UUIDGenerator=Y_});var Zx=w(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Exo003Parser=void 0;var St=up(),Ef=X_(),Qo=Oe(),mp=Ge(),Jx=jt(),c$=Qn(),J_=class{static{a(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,o=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))o.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 Qo.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 Qo.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){let i=r;if(!i.startsWith("_:"))try{new Qo.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(r)}`)}}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,o=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of o)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 Qo.IRI(i.value);else if(i.type==="blank")s=new Jx.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let o=t(e.predicate);if(o.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new Qo.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new Qo.IRI(l.value);else if(l.type==="blank")u=new Jx.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new mp.Literal(f,new Qo.IRI(l.datatype));else{let d=l.language||St.DEFAULT_LANGUAGE_TAG;u=(0,mp.createDirectionalLiteral)(f,d,l.direction)}}return new c$.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new mp.Literal(t,new Qo.IRI(r.datatype));let i=r?.language||St.DEFAULT_LANGUAGE_TAG;return(0,mp.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 Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.Anchor:return Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.BlankNode:return Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.Statement:{let r=e;return Ef.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case St.Exo003MetadataType.Body:{let r=e;return Ef.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};gp.Exo003Parser=J_});var Z_=w(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Exo003Parser=Qr.Exo003UUIDGenerator=Qr.UUID_URL_NAMESPACE=Qr.DEFAULT_LANGUAGE_TAG=Qr.REQUIRED_PROPERTIES=Qr.ALLOWED_PROPERTIES=Qr.Exo003MetadataType=void 0;var Tf=up();Object.defineProperty(Qr,"Exo003MetadataType",{enumerable:!0,get:a(function(){return Tf.Exo003MetadataType},"get")});Object.defineProperty(Qr,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return Tf.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Qr,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return Tf.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Qr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return Tf.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Qr,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return Tf.UUID_URL_NAMESPACE},"get")});var l$=X_();Object.defineProperty(Qr,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return l$.Exo003UUIDGenerator},"get")});var u$=Zx();Object.defineProperty(Qr,"Exo003Parser",{enumerable:!0,get:a(function(){return u$.Exo003Parser},"get")})});var no=w(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.WikiLinkHelpers=void 0;var Af=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let r=t.indexOf("|");if(r===-1)return t;let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();return this.UUID_PATTERN.test(i)&&s||i}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)}static resolveSymbolic(e,t){let r=this.normalize(e);if(!r)return"";if(this.UUID_PATTERN.test(r)){let i=t(r);return i&&i.length>0?i:r}return r}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};yp.WikiLinkHelpers=Af;Af.WIKI_LINK_PATTERN=/\[\[|\]\]/g;Af.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var Yo=w(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.CommandBindingProperty=wt.GroundingProperty=wt.PreconditionProperty=wt.CommandProperty=wt.resolveGroundingTypeFromWikilinkLiteral=wt.resolveGroundingTypeFromIRI=wt.GROUNDING_TYPE_IRI_TO_ENUM=wt.GROUNDING_TYPE_UID_TO_ENUM=wt.GROUNDING_TYPE_UIDS=wt.GroundingType=wt.EFFORT_STATUS_OPTIONS=wt.EffortStatus=wt.AssetClass=void 0;var f$=tl();Object.defineProperty(wt,"AssetClass",{enumerable:!0,get:a(function(){return f$.AssetClass},"get")});var d$=rl();Object.defineProperty(wt,"EffortStatus",{enumerable:!0,get:a(function(){return d$.EffortStatus},"get")});var h$=d_();Object.defineProperty(wt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return h$.EFFORT_STATUS_OPTIONS},"get")});var p$=Ko();Object.defineProperty(wt,"GroundingType",{enumerable:!0,get:a(function(){return p$.GroundingType},"get")});var If=hf();Object.defineProperty(wt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(wt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(wt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(wt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return If.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(wt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return If.resolveGroundingTypeFromWikilinkLiteral},"get")});var bp=h_();Object.defineProperty(wt,"CommandProperty",{enumerable:!0,get:a(function(){return bp.CommandProperty},"get")});Object.defineProperty(wt,"PreconditionProperty",{enumerable:!0,get:a(function(){return bp.PreconditionProperty},"get")});Object.defineProperty(wt,"GroundingProperty",{enumerable:!0,get:a(function(){return bp.GroundingProperty},"get")});Object.defineProperty(wt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return bp.CommandBindingProperty},"get")})});var nR=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.hasClass=Za;Yr.isAreaOrProject=m$;Yr.isEffort=g$;Yr.hasStatus=y$;Yr.isAssetArchived=b$;Yr.hasEmptyProperties=_$;Yr.needsFolderRepair=S$;Yr.getTodayDateString=eS;Yr.isPlannedForToday=w$;Yr.hasPlannedStartTimestamp=v$;Yr.extractDailyNoteDate=E$;Yr.isCurrentDateGteDay=T$;Yr.inheritsFromPrototype=rR;Yr.isPrototypeClass=I$;var tR=no(),Ja=Yo();function Za(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>tR.WikiLinkHelpers.normalize(r)===e):!1}a(Za,"hasClass");function m$(n){return Za(n,Ja.AssetClass.AREA)||Za(n,Ja.AssetClass.PROJECT)}a(m$,"isAreaOrProject");function g$(n){return Za(n,Ja.AssetClass.TASK)||Za(n,Ja.AssetClass.PROJECT)||Za(n,Ja.AssetClass.MEETING)}a(g$,"isEffort");function y$(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?tR.WikiLinkHelpers.normalize(t)===e:!1}a(y$,"hasStatus");function b$(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}a(b$,"isAssetArchived");function _$(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))}a(_$,"hasEmptyProperties");function S$(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}a(S$,"needsFolderRepair");function eS(){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}`}a(eS,"getTodayDateString");function w$(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=eS();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(w$,"isPlannedForToday");function v$(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}a(v$,"hasPlannedStartTimestamp");function E$(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}a(E$,"extractDailyNoteDate");function T$(n){return eS()>=n}a(T$,"isCurrentDateGteDay");function eR(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(eR,"normalizeWithQuotes");var A$=10;function rR(n,e=A$){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=eR(o);c&&i.push({className:c,depth:0})}for(;i.length>0;){let o=i.shift();if(!o)continue;let{className:c,depth:l}=o;if(l>e)continue;if(c===Ja.AssetClass.PROTOTYPE)return!0;if(r.has(c))continue;r.add(c);let u=`${c}__exo__Class_superClass`,f=n[u];if(f){let d=Array.isArray(f)?f:[f];for(let h of d){let p=eR(h);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}a(rR,"inheritsFromPrototype");function I$(n,e){return Za(n,Ja.AssetClass.CLASS)?rR(e):!1}a(I$,"isPrototypeClass")});var iR=w(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.isPrototypeClass=pt.inheritsFromPrototype=pt.isCurrentDateGteDay=pt.extractDailyNoteDate=pt.hasPlannedStartTimestamp=pt.isPlannedForToday=pt.getTodayDateString=pt.needsFolderRepair=pt.hasEmptyProperties=pt.isAssetArchived=pt.hasStatus=pt.isEffort=pt.isAreaOrProject=pt.hasClass=void 0;var Ln=nR();Object.defineProperty(pt,"hasClass",{enumerable:!0,get:a(function(){return Ln.hasClass},"get")});Object.defineProperty(pt,"isAreaOrProject",{enumerable:!0,get:a(function(){return Ln.isAreaOrProject},"get")});Object.defineProperty(pt,"isEffort",{enumerable:!0,get:a(function(){return Ln.isEffort},"get")});Object.defineProperty(pt,"hasStatus",{enumerable:!0,get:a(function(){return Ln.hasStatus},"get")});Object.defineProperty(pt,"isAssetArchived",{enumerable:!0,get:a(function(){return Ln.isAssetArchived},"get")});Object.defineProperty(pt,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Ln.hasEmptyProperties},"get")});Object.defineProperty(pt,"needsFolderRepair",{enumerable:!0,get:a(function(){return Ln.needsFolderRepair},"get")});Object.defineProperty(pt,"getTodayDateString",{enumerable:!0,get:a(function(){return Ln.getTodayDateString},"get")});Object.defineProperty(pt,"isPlannedForToday",{enumerable:!0,get:a(function(){return Ln.isPlannedForToday},"get")});Object.defineProperty(pt,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Ln.hasPlannedStartTimestamp},"get")});Object.defineProperty(pt,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Ln.extractDailyNoteDate},"get")});Object.defineProperty(pt,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Ln.isCurrentDateGteDay},"get")});Object.defineProperty(pt,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Ln.inheritsFromPrototype},"get")});Object.defineProperty(pt,"isPrototypeClass",{enumerable:!0,get:a(function(){return Ln.isPrototypeClass},"get")})});var sR=w(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.TsFloorViolationError=mt.CATALOG_KEEP_NAMESPACES=mt.PLUGIN_UI_FLOOR=mt.SDK_FLOOR=mt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=mt.SDK_FLOOR_ASSETSPACE_UIDS=mt.TS_FLOOR_AS_UID_SHARED_IDENTITIES=mt.TS_FLOOR_AS_UID_EXOCMD=mt.TS_FLOOR_AS_UID_EXO=void 0;mt.assertTsFloor=x$;mt.assertTsFloorReconciled=R$;mt.isTsFloorAssetSpace=C$;mt.isTsFloorMountPath=O$;mt.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";mt.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";mt.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";mt.SDK_FLOOR_ASSETSPACE_UIDS=new Set([mt.TS_FLOOR_AS_UID_EXO]);mt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([mt.TS_FLOOR_AS_UID_EXO]);mt.SDK_FLOOR=[{uid:mt.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];mt.PLUGIN_UI_FLOOR=mt.SDK_FLOOR;mt.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var xf=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};mt.TsFloorViolationError=xf;function x$(n,e){let t=[];for(let r of e)n.has(r)||t.push(r);if(t.length>0)throw new xf(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(x$,"assertTsFloor");function R$(n,e,t){let r=[];for(let i of t)n.has(i.uid)||e.has(i.namespace)||r.push(`${i.namespace} (${i.uid})`);if(r.length>0)throw new xf(`Target profile's declared set excludes TS-floor AssetSpace(s): ${r.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(R$,"assertTsFloorReconciled");function C$(n,e,t=mt.SDK_FLOOR){return t.some(r=>n.length>0&&r.uid===n||e.length>0&&r.namespace===e)}a(C$,"isTsFloorAssetSpace");function O$(n,e=mt.SDK_FLOOR){let t=n.replace(/\/+$/,""),r=t.slice(t.lastIndexOf("/")+1),i=r.startsWith("exoas-")?r.slice(6):r;return i.length===0?!1:e.some(s=>s.namespace===i)}a(O$,"isTsFloorMountPath")});var oR=w(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.transitiveDependsOnClosure=P$;function P$(n,e){let t=new Set,r=[];for(let i of n)t.has(i)||(t.add(i),r.push(i));for(;r.length>0;){let i=r.shift();if(i===void 0)break;let s=e.get(i);if(s!==void 0)for(let o of s)t.has(o)||(t.add(o),r.push(o))}return t}a(P$,"transitiveDependsOnClosure")});var _p=w(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.PropertyFieldType=void 0;Rf.rangeToFieldType=L$;var Br;(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"})(Br||(Rf.PropertyFieldType=Br={}));var aR="http://www.w3.org/2001/XMLSchema#",F$="https://exocortex.my/ontology/exo#",D$="https://exocortex.my/ontology/ems#";function L$(n){if(!n)return Br.Unknown;let e=n.trim();if(!e)return Br.Unknown;if(e.startsWith(aR)){let t=e.substring(aR.length);return rS(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return rS(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return rS(r)}return e.startsWith(D$)||e.startsWith("ems:")?N$(e):e.startsWith(F$)||e.startsWith("exo:")||k$(e)?Br.Reference:Br.Text}a(L$,"rangeToFieldType");function rS(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return Br.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 Br.Number;case"date":return Br.Date;case"datetime":case"datetimestamp":return Br.DateTime;case"boolean":return Br.Boolean;case"time":return Br.Timestamp;default:return Br.Text}}a(rS,"xsdTypeToFieldType");function N$(n){let e=n.toLowerCase();return e.includes("effortstatus")?Br.StatusSelect:e.includes("tasksize")?Br.SizeSelect:Br.Reference}a(N$,"emsTypeToFieldType");function k$(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))}a(k$,"isClassReference")});var nS=w(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.propertyNameToUri=M$;Cf.uriToPropertyName=cR;Cf.extractPropertyLabel=j$;function M$(n){return n.replace(/^([a-z]+)__/,"$1:")}a(M$,"propertyNameToUri");function cR(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__")}a(cR,"uriToPropertyName");function j$(n){let r=(n.includes(":")?cR(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())}a(j$,"extractPropertyLabel")});var Sp={};zb(Sp,{__assign:()=>sS,__asyncDelegator:()=>X$,__asyncGenerator:()=>Y$,__asyncValues:()=>J$,__await:()=>Of,__awaiter:()=>G$,__classPrivateFieldGet:()=>r6,__classPrivateFieldSet:()=>n6,__createBinding:()=>H$,__decorate:()=>B$,__exportStar:()=>z$,__extends:()=>$$,__generator:()=>W$,__importDefault:()=>t6,__importStar:()=>e6,__makeTemplateObject:()=>Z$,__metadata:()=>q$,__param:()=>V$,__read:()=>lR,__rest:()=>U$,__spread:()=>K$,__spreadArrays:()=>Q$,__values:()=>oS});function $$(n,e){iS(n,e);function t(){this.constructor=n}a(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function U$(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 B$(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function V$(n,e){return function(t,r){e(t,r,n)}}function q$(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function G$(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return a(i,"adopt"),new(t||(t=Promise))(function(s,o){function c(f){try{u(r.next(f))}catch(d){o(d)}}a(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(d){o(d)}}a(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}a(u,"step"),u((r=r.apply(n,e||[])).next())})}function W$(n,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;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 H$(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function z$(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function oS(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:a(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 lR(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function K$(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(lR(arguments[e]));return n}function Q$(){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],o=0,c=s.length;o<c;o++,i++)r[i]=s[o];return r}function Of(n){return this instanceof Of?(this.v=n,this):new Of(n)}function Y$(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(p){return new Promise(function(g,y){s.push([h,p,g,y])>1||c(h,p)})})}function c(h,p){try{l(r[h](p))}catch(g){d(s[0][3],g)}}function l(h){h.value instanceof Of?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){c("next",h)}function f(h){c("throw",h)}function d(h,p){h(p),s.shift(),s.length&&c(s[0][0],s[0][1])}}function X$(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(o){return(t=!t)?{value:Of(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function J$(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 oS=="function"?oS(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(o){return new Promise(function(c,l){o=n[s](o),i(c,l,o.done,o.value)})}}function i(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function Z$(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function e6(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 t6(n){return n&&n.__esModule?n:{default:n}}function r6(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function n6(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 iS,sS,wp=g9(()=>{iS=a(function(n,e){return iS=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])},iS(n,e)},"extendStatics");a($$,"__extends");sS=a(function(){return sS=Object.assign||a(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"),sS.apply(this,arguments)},"__assign");a(U$,"__rest");a(B$,"__decorate");a(V$,"__param");a(q$,"__metadata");a(G$,"__awaiter");a(W$,"__generator");a(H$,"__createBinding");a(z$,"__exportStar");a(oS,"__values");a(lR,"__read");a(K$,"__spread");a(Q$,"__spreadArrays");a(Of,"__await");a(Y$,"__asyncGenerator");a(X$,"__asyncDelegator");a(J$,"__asyncValues");a(Z$,"__makeTemplateObject");a(e6,"__importStar");a(t6,"__importDefault");a(r6,"__classPrivateFieldGet");a(n6,"__classPrivateFieldSet")});var lS=w(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var aS;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})(aS||(aS={}));cS.default=aS});var uR=w(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});var i6=lS();Object.defineProperty(uS,"Lifecycle",{enumerable:!0,get:a(function(){return i6.default},"get")})});var ec=w(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.defineInjectionTokenMetadata=xi.getParamInfo=xi.INJECTION_TOKEN_METADATA_KEY=void 0;xi.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function s6(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(xi.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}a(s6,"getParamInfo");xi.getParamInfo=s6;function o6(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(xi.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(xi.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(o6,"defineInjectionTokenMetadata");xi.defineInjectionTokenMetadata=o6});var fS=w(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.isClassProvider=void 0;function a6(n){return!!n.useClass}a(a6,"isClassProvider");vp.isClassProvider=a6});var dS=w(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.isFactoryProvider=void 0;function c6(n){return!!n.useFactory}a(c6,"isFactoryProvider");Ep.isFactoryProvider=c6});var Ap=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.delay=il.DelayedConstructor=void 0;var Tp=class{static{a(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=a(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(r),t}};il.DelayedConstructor=Tp;function l6(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Tp(n)}a(l6,"delay");il.delay=l6});var Ip=w(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.isConstructorToken=ys.isTransformDescriptor=ys.isTokenDescriptor=ys.isNormalToken=void 0;var u6=Ap();function f6(n){return typeof n=="string"||typeof n=="symbol"}a(f6,"isNormalToken");ys.isNormalToken=f6;function d6(n){return typeof n=="object"&&"token"in n&&"multiple"in n}a(d6,"isTokenDescriptor");ys.isTokenDescriptor=d6;function h6(n){return typeof n=="object"&&"token"in n&&"transform"in n}a(h6,"isTransformDescriptor");ys.isTransformDescriptor=h6;function p6(n){return typeof n=="function"||n instanceof u6.DelayedConstructor}a(p6,"isConstructorToken");ys.isConstructorToken=p6});var hS=w(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.isTokenProvider=void 0;function m6(n){return!!n.useToken}a(m6,"isTokenProvider");xp.isTokenProvider=m6});var pS=w(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.isValueProvider=void 0;function g6(n){return n.useValue!=null}a(g6,"isValueProvider");Rp.isValueProvider=g6});var mS=w(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var y6=fS();Object.defineProperty(tc,"isClassProvider",{enumerable:!0,get:a(function(){return y6.isClassProvider},"get")});var b6=dS();Object.defineProperty(tc,"isFactoryProvider",{enumerable:!0,get:a(function(){return b6.isFactoryProvider},"get")});var _6=Ip();Object.defineProperty(tc,"isNormalToken",{enumerable:!0,get:a(function(){return _6.isNormalToken},"get")});var S6=hS();Object.defineProperty(tc,"isTokenProvider",{enumerable:!0,get:a(function(){return S6.isTokenProvider},"get")});var w6=pS();Object.defineProperty(tc,"isValueProvider",{enumerable:!0,get:a(function(){return w6.isValueProvider},"get")})});var fR=w(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.isProvider=void 0;var v6=fS(),E6=pS(),T6=hS(),A6=dS();function I6(n){return v6.isClassProvider(n)||E6.isValueProvider(n)||T6.isTokenProvider(n)||A6.isFactoryProvider(n)}a(I6,"isProvider");Cp.isProvider=I6});var bS=w(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var gS=class{static{a(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,[])}};yS.default=gS});var dR=w(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var x6=bS(),_S=class extends x6.default{static{a(this,"Registry")}};SS.default=_S});var hR=w(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var wS=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};vS.default=wS});var ES=w(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.formatErrorCtor=void 0;function R6(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}a(R6,"formatDependency");function C6(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 ax(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})}a(ax,"incrementNodeInspectorPort");function l_(){if(dt.env.NO_COLOR||dt.env.FORCE_COLOR==="0"||dt.env.FORCE_COLOR==="false")return!1;if(dt.env.FORCE_COLOR||dt.env.CLICOLOR_FORCE!==void 0)return!0}a(l_,"useColor");u_.Command=c_;u_.useColor=l_});var dx=w(li=>{var{Argument:lx}=zh(),{Command:f_}=cx(),{CommanderError:O9,InvalidArgumentError:ux}=df(),{Help:P9}=t_(),{Option:fx}=s_();li.program=new f_;li.createCommand=n=>new f_(n);li.createOption=(n,e)=>new fx(n,e);li.createArgument=(n,e)=>new lx(n,e);li.Command=f_;li.Option=fx;li.Argument=lx;li.Help=P9;li.CommanderError=O9;li.InvalidArgumentError=ux;li.InvalidOptionArgumentError=ux});var tl=w(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.AssetClass=void 0;var px;(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.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.WORKFLOW="ems__Workflow",n.WORKFLOW_STATE="ems__WorkflowState",n.WORKFLOW_TRANSITION="ems__WorkflowTransition",n.COMMAND="exocmd__Command",n.PRECONDITION="exocmd__Precondition",n.GROUNDING="exocmd__Grounding",n.COMMAND_BINDING="exocmd__CommandBinding"})(px||(Qh.AssetClass=px={}))});var rl=w(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.EffortStatus=void 0;var mx;(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"})(mx||(Yh.EffortStatus=mx={}))});var d_=w(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.EFFORT_STATUS_OPTIONS=void 0;Xh.EFFORT_STATUS_OPTIONS=[{value:"[[ems__EffortStatusDraft]]",label:"Draft"},{value:"[[ems__EffortStatusBacklog]]",label:"Backlog"},{value:"[[ems__EffortStatusAnalysis]]",label:"Analysis"},{value:"[[ems__EffortStatusToDo]]",label:"To Do"},{value:"[[ems__EffortStatusDoing]]",label:"Doing"},{value:"[[ems__EffortStatusDone]]",label:"Done"},{value:"[[ems__EffortStatusTrashed]]",label:"Trashed"}]});var Ko=w(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.GroundingType=void 0;var gx;(function(n){n.SPARQL_UPDATE="sparql_update",n.PROPERTY_DELETE="property_delete",n.PROPERTY_SET="property_set",n.COMPOSITE="composite",n.SERVICE_CALL="service_call",n.CREATE_INSTANCE="create_instance",n.PROPERTY_APPEND="property_append",n.PROPERTY_INCREMENT="property_increment",n.PROPERTY_SHIFT="property_shift",n.WORKFLOW_TRANSITION="workflow_transition",n.BODY_TEMPLATE="body_template"})(gx||(Jh.GroundingType=gx={}))});var hf=w(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.GROUNDING_TYPE_IRI_TO_ENUM=Fn.GROUNDING_TYPE_UID_TO_ENUM=Fn.GROUNDING_TYPE_UIDS=void 0;Fn.resolveGroundingTypeFromIRI=D9;Fn.resolveGroundingTypeFromWikilinkLiteral=L9;var Wt=Ko();Fn.GROUNDING_TYPE_UIDS={[Wt.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[Wt.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[Wt.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[Wt.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[Wt.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[Wt.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[Wt.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[Wt.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[Wt.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[Wt.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[Wt.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};Fn.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries(Fn.GROUNDING_TYPE_UIDS).map(([n,e])=>[e,n])));var Ai="https://exocortex.my/ontology/exocmd#";Fn.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${Ai}GroundingTypePropertySet`]:Wt.GroundingType.PROPERTY_SET,[`${Ai}GroundingTypePropertyDelete`]:Wt.GroundingType.PROPERTY_DELETE,[`${Ai}GroundingTypeComposite`]:Wt.GroundingType.COMPOSITE,[`${Ai}GroundingTypeServiceCall`]:Wt.GroundingType.SERVICE_CALL,[`${Ai}GroundingTypeCreateInstance`]:Wt.GroundingType.CREATE_INSTANCE,[`${Ai}GroundingTypePropertyAppend`]:Wt.GroundingType.PROPERTY_APPEND,[`${Ai}GroundingTypePropertyIncrement`]:Wt.GroundingType.PROPERTY_INCREMENT,[`${Ai}GroundingTypePropertyShift`]:Wt.GroundingType.PROPERTY_SHIFT,[`${Ai}GroundingTypeSparqlUpdate`]:Wt.GroundingType.SPARQL_UPDATE,[`${Ai}GroundingTypeWorkflowTransition`]:Wt.GroundingType.WORKFLOW_TRANSITION,[`${Ai}GroundingTypeBodyTemplate`]:Wt.GroundingType.BODY_TEMPLATE});var F9=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function D9(n){let e=Fn.GROUNDING_TYPE_IRI_TO_ENUM[n];if(e!==void 0)return e;let t=n.match(F9);return t?Fn.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(D9,"resolveGroundingTypeFromIRI");function L9(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?Fn.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(L9,"resolveGroundingTypeFromWikilinkLiteral")});var h_=w(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.CommandBindingStyleProperty=ui.CommandBindingProperty=ui.GroundingProperty=ui.PreconditionProperty=ui.CommandProperty=void 0;ui.CommandProperty={ICON:"exocmd__Command_icon",PRECONDITION:"exocmd__Command_precondition",GROUNDING:"exocmd__Command_grounding",CONFIRM_MESSAGE:"exocmd__Command_confirmMessage",SUCCESS_MESSAGE:"exocmd__Command_successMessage",CATEGORY:"exocmd__Command_category",OPEN_IN_SAME_TAB:"exocmd__Command_openInSameTab"};ui.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};ui.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",STEPS:"exocmd__Grounding_steps",IS_DEFINED_BY:"exocmd__Grounding_isDefinedBy",LABEL_TEMPLATE:"exocmd__Grounding_labelTemplate"};ui.CommandBindingProperty={COMMAND:"exocmd__CommandBinding_command",TARGET_CLASS:"exocmd__CommandBinding_targetClass",TARGET_PROTOTYPE:"exocmd__CommandBinding_targetPrototype",TARGET_ASSET:"exocmd__CommandBinding_targetAsset",POSITION:"exocmd__CommandBinding_position",ORDER:"exocmd__CommandBinding_order",PRECONDITION:"exocmd__CommandBinding_precondition",STYLE:"exocmd__CommandBinding_style",VARIANT:"exocmd__CommandBinding_variant"};ui.CommandBindingStyleProperty={VARIANT:"exocmd__CommandBindingStyle_variant",SHOW_ICON:"exocmd__CommandBindingStyle_showIcon",LABEL_CLASS:"exocmd__CommandBindingStyle_labelClass",ARIA_LABEL:"exocmd__CommandBindingStyle_ariaLabel",TOOLTIP:"exocmd__CommandBindingStyle_tooltip",KEYBOARD_SHORTCUT:"exocmd__CommandBindingStyle_keyboardShortcut",SOURCE:"exocmd__CommandBindingStyle_source"}});var p_=w(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.STYLE_SOURCE_VALUES=Dn.LABEL_CLASS_VALUES=Dn.COMMAND_VARIANT_VALUES=void 0;Dn.isCommandVariant=N9;Dn.isLabelClass=k9;Dn.isStyleSource=M9;Dn.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Dn.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Dn.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function N9(n){return typeof n=="string"&&Dn.COMMAND_VARIANT_VALUES.includes(n)}a(N9,"isCommandVariant");function k9(n){return typeof n=="string"&&Dn.LABEL_CLASS_VALUES.includes(n)}a(k9,"isLabelClass");function M9(n){return typeof n=="string"&&Dn.STYLE_SOURCE_VALUES.includes(n)}a(M9,"isStyleSource")});var yx=w(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.isCommandFrontmatter=j9;nl.isPreconditionFrontmatter=$9;nl.isGroundingFrontmatter=U9;nl.isCommandBindingFrontmatter=B9;function j9(n){return Zh(n,"exocmd__Command")}a(j9,"isCommandFrontmatter");function $9(n){return Zh(n,"exocmd__Precondition")}a($9,"isPreconditionFrontmatter");function U9(n){return Zh(n,"exocmd__Grounding")}a(U9,"isGroundingFrontmatter");function B9(n){return Zh(n,"exocmd__CommandBinding")}a(B9,"isCommandBindingFrontmatter");function Zh(n,e){let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(Zh,"hasInstanceClass")});var bx=w(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.parseGroundingDefinitionFromFrontmatter=q9;var V9=hf();function m_(n){if(typeof n!="string")return"";let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(m_,"normalizeGroundingRef");function q9(n,e,t){let r=e.exocmd__Grounding_type,i=(()=>{if(typeof r!="string")return r;let p=(0,V9.resolveGroundingTypeFromWikilinkLiteral)(r);if(p!==null)return p;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${r}' for exocmd__Grounding_type in fixture ${n}. Migrate to wikilink form per RFC 9d20c91f Phase 3.`)})(),s=i==="service_call"?e.exocmd__Grounding_serviceId??e.exocmd__Grounding_targetProperty:e.exocmd__Grounding_targetProperty,o;if(i==="composite"){let p=e.exocmd__Grounding_steps;Array.isArray(p)&&(o=p.map(g=>t(m_(g))))}let c=e.exocmd__Grounding_incrementBy,l;if(c!=null&&c!==""){let p=Number.parseInt(String(c),10);Number.isFinite(p)&&(l=p)}let u=e.exocmd__Grounding_targetValueRef,f=u?m_(u):void 0,d=e.exocmd__Grounding_templateRef,h=d?m_(d):void 0;return{id:n,label:e.exo__Asset_label??"",type:i,targetProperty:s,targetValueRef:f,targetValueLiteral:e.exocmd__Grounding_targetValueLiteral,targetValueSubstitution:e.exocmd__Grounding_targetValueSubstitution,serviceCallPayload:e.exocmd__Grounding_serviceCallPayload,appendExpression:e.exocmd__Grounding_appendExpression,targetClass:e.exocmd__Grounding_targetClass,targetPrototype:e.exocmd__Grounding_targetPrototype,targetFolder:e.exocmd__Grounding_targetFolder,shiftDelta:e.exocmd__Grounding_shiftDelta,incrementBy:l,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:h,steps:o}}a(q9,"parseGroundingDefinitionFromFrontmatter")});var _x=w(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.hasPosition=G9;ep.isFixed=W9;function G9(n){return typeof n.x=="number"&&typeof n.y=="number"}a(G9,"hasPosition");function W9(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}a(W9,"isFixed")});var Sx=w(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.createEmptyGraphData=H9;tp.mergeGraphData=z9;function H9(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(H9,"createEmptyGraphData");function z9(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 o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}a(z9,"mergeGraphData")});var y_=w(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.createEdgeId=K9;rp.edgesEqual=Q9;function K9(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}a(K9,"createEdgeId");function Q9(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}a(Q9,"edgesEqual")});var b_=w(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.BUILT_IN_EDGE_STYLES=Ht.BUILT_IN_NODE_STYLES=Ht.DEFAULT_EDGE_STYLE=Ht.DEFAULT_NODE_STYLE=Ht.RDF_TYPE_PREDICATES=void 0;Ht.mergeNodeStyles=Y9;Ht.mergeEdgeStyles=X9;Ht.extractLocalName=J9;Ht.isClassType=Z9;Ht.isTypePredicate=e5;Ht.isSubClassPredicate=t5;Ht.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"};Ht.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Ht.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Ht.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"},person__Person:{color:"#06b6d4",shape:"circle"},ims__Person:{color:"#06b6d4",shape:"circle"}};Ht.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 Y9(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(Y9,"mergeNodeStyles");function X9(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(X9,"mergeEdgeStyles");function J9(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}a(J9,"extractLocalName");function Z9(n){return n===Ht.RDF_TYPE_PREDICATES.RDFS_CLASS||n===Ht.RDF_TYPE_PREDICATES.OWL_CLASS}a(Z9,"isClassType");function e5(n){return n===Ht.RDF_TYPE_PREDICATES.RDF_TYPE}a(e5,"isTypePredicate");function t5(n){return n===Ht.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(t5,"isSubClassPredicate")});var vx=w(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0})});var Oe=w(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.IRI=void 0;var __=class n{static{a(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)}}};np.IRI=__});var Ge=w(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Literal=void 0;Qa.parseLanguageTag=Ex;Qa.createDirectionalLiteral=n5;Qa.createLiteralFromLanguageTag=i5;var r5="http://www.w3.org/2001/XMLSchema#string",pf=class{static{a(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===r5?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}};Qa.Literal=pf;function Ex(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()}}a(Ex,"parseLanguageTag");function n5(n,e,t){return new pf(n,void 0,e,t)}a(n5,"createDirectionalLiteral");function i5(n,e){let{language:t,direction:r}=Ex(e);return new pf(n,void 0,t,r)}a(i5,"createLiteralFromLanguageTag")});var jt=w(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.BlankNode=void 0;var ip=class n{static{a(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())}};sp.BlankNode=ip;ip.counter=0});var zt=w(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.Namespace=void 0;var Tx=Oe(),Ye=class n{static{a(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new Tx.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new Tx.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)}static forPrefix(e){if(!/^[a-z][a-zA-Z0-9]*$/.test(e))return null;let t=n.KNOWN_NAMESPACES.find(r=>r.prefix===e);return t||new n(e,`${n.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=/^([a-z][a-zA-Z0-9]*)__(.+)$/.exec(e);if(!t)return null;let r=n.forPrefix(t[1]);return r?{namespace:r,localName:t[2]}:null}};op.Namespace=Ye;Ye.RDF=new Ye("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Ye.RDFS=new Ye("rdfs","http://www.w3.org/2000/01/rdf-schema#");Ye.OWL=new Ye("owl","http://www.w3.org/2002/07/owl#");Ye.XSD=new Ye("xsd","http://www.w3.org/2001/XMLSchema#");Ye.EXO=new Ye("exo","https://exocortex.my/ontology/exo#");Ye.EMS=new Ye("ems","https://exocortex.my/ontology/ems#");Ye.EXOCMD=new Ye("exocmd","https://exocortex.my/ontology/exocmd#");Ye.IMS=new Ye("ims","https://exocortex.my/ontology/ims#");Ye.ZTLK=new Ye("ztlk","https://exocortex.my/ontology/ztlk#");Ye.PTMS=new Ye("ptms","https://exocortex.my/ontology/ptms#");Ye.LIT=new Ye("lit","https://exocortex.my/ontology/lit#");Ye.INBOX=new Ye("inbox","https://exocortex.my/ontology/inbox#");Ye.PMBOK=new Ye("pmbok","https://exocortex.my/ontology/pmbok#");Ye.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Ye.KNOWN_NAMESPACES=[Ye.EXO,Ye.EMS,Ye.EXOCMD,Ye.IMS,Ye.ZTLK,Ye.PTMS,Ye.LIT,Ye.INBOX,Ye.PMBOK]});var Yn=w(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.Triple=void 0;var S_=Oe(),w_=Ge(),v_=jt(),E_=class{static{a(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 S_.IRI&&t instanceof S_.IRI||e instanceof v_.BlankNode&&t instanceof v_.BlankNode||e instanceof w_.Literal&&t instanceof w_.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 S_.IRI?`<${e.value}>`:e instanceof v_.BlankNode||e instanceof w_.Literal||this.isQuotedTriple(e)?e.toString():""}};ap.Triple=E_});var mf=w(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.QuotedTriple=void 0;var T_=Oe(),A_=Ge(),I_=jt(),x_=class n{static{a(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 T_.IRI&&t instanceof T_.IRI||e instanceof I_.BlankNode&&t instanceof I_.BlankNode||e instanceof A_.Literal&&t instanceof A_.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 T_.IRI?`<${e.value}>`:e instanceof I_.BlankNode||e instanceof A_.Literal||e instanceof n?e.toString():""}};cp.QuotedTriple=x_});var Ax=w(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.QuotedTriple=or.Triple=or.Namespace=or.BlankNode=or.createLiteralFromLanguageTag=or.createDirectionalLiteral=or.parseLanguageTag=or.Literal=or.IRI=void 0;var s5=Oe();Object.defineProperty(or,"IRI",{enumerable:!0,get:a(function(){return s5.IRI},"get")});var lp=Ge();Object.defineProperty(or,"Literal",{enumerable:!0,get:a(function(){return lp.Literal},"get")});Object.defineProperty(or,"parseLanguageTag",{enumerable:!0,get:a(function(){return lp.parseLanguageTag},"get")});Object.defineProperty(or,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return lp.createDirectionalLiteral},"get")});Object.defineProperty(or,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return lp.createLiteralFromLanguageTag},"get")});var o5=jt();Object.defineProperty(or,"BlankNode",{enumerable:!0,get:a(function(){return o5.BlankNode},"get")});var a5=zt();Object.defineProperty(or,"Namespace",{enumerable:!0,get:a(function(){return a5.Namespace},"get")});var c5=Yn();Object.defineProperty(or,"Triple",{enumerable:!0,get:a(function(){return c5.Triple},"get")});var l5=mf();Object.defineProperty(or,"QuotedTriple",{enumerable:!0,get:a(function(){return l5.QuotedTriple},"get")})});var up=w(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.UUID_URL_NAMESPACE=di.DEFAULT_LANGUAGE_TAG=di.REQUIRED_PROPERTIES=di.ALLOWED_PROPERTIES=di.Exo003MetadataType=void 0;var fi;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(fi||(di.Exo003MetadataType=fi={}));di.ALLOWED_PROPERTIES={[fi.Namespace]:["metadata","uri","aliases"],[fi.Anchor]:["metadata","uri","aliases"],[fi.BlankNode]:["metadata","uri","aliases"],[fi.Statement]:["metadata","subject","predicate","object","aliases"],[fi.Body]:["metadata","subject","predicate","aliases"]};di.REQUIRED_PROPERTIES={[fi.Namespace]:["metadata","uri"],[fi.Anchor]:["metadata","uri"],[fi.BlankNode]:["metadata","uri"],[fi.Statement]:["metadata","subject","predicate","object"],[fi.Body]:["metadata","subject","predicate"]};di.DEFAULT_LANGUAGE_TAG="ru";di.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var Ix=w(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var xx=w(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.default="00000000-0000-0000-0000-000000000000"});var Rx=w(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.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 gf=w(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var u5=Rx();function f5(n){return typeof n=="string"&&u5.default.test(n)}a(f5,"validate");P_.default=f5});var yf=w(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var d5=gf();function h5(n){if(!(0,d5.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)}a(h5,"parse");F_.default=h5});var to=w(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.unsafeStringify=void 0;var p5=gf(),Ur=[];for(let n=0;n<256;++n)Ur.push((n+256).toString(16).slice(1));function Cx(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()}a(Cx,"unsafeStringify");bf.unsafeStringify=Cx;function m5(n,e=0){let t=Cx(n,e);if(!(0,p5.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(m5,"stringify");bf.default=m5});var hp=w(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var g5=require("crypto"),dp=new Uint8Array(256),fp=dp.length;function y5(){return fp>dp.length-16&&((0,g5.randomFillSync)(dp),fp=0),dp.slice(fp,fp+=16)}a(y5,"rng");D_.default=y5});var L_=w(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.updateV1State=void 0;var Ox=hp(),b5=to(),_f={};function _5(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=Px(n.random??n.rng?.()??(0,Ox.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),o=(0,Ox.default)();Fx(_f,s,o),r=Px(o,_f.msecs,_f.nsecs,i?void 0:_f.clockseq,i?void 0:_f.node,e,t)}return e??(0,b5.unsafeStringify)(r)}a(_5,"v1");function Fx(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}a(Fx,"updateV1State");Sf.updateV1State=Fx;function Px(n,e,t,r,i,s,o=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),o=0;else if(o<0||o+16>s.length)throw new RangeError(`UUID byte range ${o}:${o+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[o++]=c>>>24&255,s[o++]=c>>>16&255,s[o++]=c>>>8&255,s[o++]=c&255;let l=e/4294967296*1e4&268435455;s[o++]=l>>>8&255,s[o++]=l&255,s[o++]=l>>>24&15|16,s[o++]=l>>>16&255,s[o++]=r>>>8|128,s[o++]=r&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(Px,"v1Bytes");Sf.default=_5});var k_=w(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var S5=yf(),w5=to();function v5(n){let e=typeof n=="string"?(0,S5.default)(n):n,t=E5(e);return typeof n=="string"?(0,w5.unsafeStringify)(t):t}a(v5,"v1ToV6");N_.default=v5;function E5(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])}a(E5,"_v1ToV6")});var Dx=w(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var T5=require("crypto");function A5(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,T5.createHash)("md5").update(n).digest()}a(A5,"md5");M_.default=A5});var wf=w(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.URL=ro.DNS=ro.stringToBytes=void 0;var Lx=yf(),I5=to();function Nx(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}a(Nx,"stringToBytes");ro.stringToBytes=Nx;ro.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ro.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function x5(n,e,t,r,i,s){let o=typeof t=="string"?Nx(t):t,c=typeof r=="string"?(0,Lx.default)(r):r;if(typeof r=="string"&&(r=(0,Lx.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(c),l.set(o,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){if(s=s||0,s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,I5.unsafeStringify)(l)}a(x5,"v35");ro.default=x5});var Mx=w(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.URL=Ya.DNS=void 0;var R5=Dx(),j_=wf(),kx=wf();Object.defineProperty(Ya,"DNS",{enumerable:!0,get:a(function(){return kx.DNS},"get")});Object.defineProperty(Ya,"URL",{enumerable:!0,get:a(function(){return kx.URL},"get")});function $_(n,e,t,r){return(0,j_.default)(48,R5.default,n,e,t,r)}a($_,"v3");$_.DNS=j_.DNS;$_.URL=j_.URL;Ya.default=$_});var jx=w(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var C5=require("crypto");U_.default={randomUUID:C5.randomUUID}});var Ux=w(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var $x=jx(),O5=hp(),P5=to();function F5(n,e,t){if($x.default.randomUUID&&!e&&!n)return $x.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,O5.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,P5.unsafeStringify)(r)}a(F5,"v4");B_.default=F5});var Bx=w(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var D5=require("crypto");function L5(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,D5.createHash)("sha1").update(n).digest()}a(L5,"sha1");V_.default=L5});var qx=w(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.URL=Xa.DNS=void 0;var N5=Bx(),q_=wf(),Vx=wf();Object.defineProperty(Xa,"DNS",{enumerable:!0,get:a(function(){return Vx.DNS},"get")});Object.defineProperty(Xa,"URL",{enumerable:!0,get:a(function(){return Vx.URL},"get")});function G_(n,e,t,r){return(0,q_.default)(80,N5.default,n,e,t,r)}a(G_,"v5");G_.DNS=q_.DNS;G_.URL=q_.URL;Xa.default=G_});var Gx=w(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var k5=to(),M5=L_(),j5=k_();function $5(n,e,t){n??={},t??=0;let r=(0,M5.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,j5.default)(r),e){if(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,k5.unsafeStringify)(r)}a($5,"v6");W_.default=$5});var Wx=w(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var U5=yf(),B5=to();function V5(n){let e=typeof n=="string"?(0,U5.default)(n):n,t=q5(e);return typeof n=="string"?(0,B5.unsafeStringify)(t):t}a(V5,"v6ToV1");H_.default=V5;function q5(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])}a(q5,"_v6ToV1")});var Qx=w(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.updateV7State=void 0;var Hx=hp(),G5=to(),z_={};function W5(n,e,t){let r;if(n)r=zx(n.random??n.rng?.()??(0,Hx.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,Hx.default)();Kx(z_,i,s),r=zx(s,z_.msecs,z_.seq,e,t)}return e??(0,G5.unsafeStringify)(r)}a(W5,"v7");function Kx(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}a(Kx,"updateV7State");vf.updateV7State=Kx;function zx(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}a(zx,"v7Bytes");vf.default=W5});var Yx=w(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var H5=gf();function z5(n){if(!(0,H5.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}a(z5,"version");K_.default=z5});var Ii=w(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.version=ht.validate=ht.v7=ht.v6ToV1=ht.v6=ht.v5=ht.v4=ht.v3=ht.v1ToV6=ht.v1=ht.stringify=ht.parse=ht.NIL=ht.MAX=void 0;var K5=Ix();Object.defineProperty(ht,"MAX",{enumerable:!0,get:a(function(){return K5.default},"get")});var Q5=xx();Object.defineProperty(ht,"NIL",{enumerable:!0,get:a(function(){return Q5.default},"get")});var Y5=yf();Object.defineProperty(ht,"parse",{enumerable:!0,get:a(function(){return Y5.default},"get")});var X5=to();Object.defineProperty(ht,"stringify",{enumerable:!0,get:a(function(){return X5.default},"get")});var J5=L_();Object.defineProperty(ht,"v1",{enumerable:!0,get:a(function(){return J5.default},"get")});var Z5=k_();Object.defineProperty(ht,"v1ToV6",{enumerable:!0,get:a(function(){return Z5.default},"get")});var e$=Mx();Object.defineProperty(ht,"v3",{enumerable:!0,get:a(function(){return e$.default},"get")});var t$=Ux();Object.defineProperty(ht,"v4",{enumerable:!0,get:a(function(){return t$.default},"get")});var r$=qx();Object.defineProperty(ht,"v5",{enumerable:!0,get:a(function(){return r$.default},"get")});var n$=Gx();Object.defineProperty(ht,"v6",{enumerable:!0,get:a(function(){return n$.default},"get")});var i$=Wx();Object.defineProperty(ht,"v6ToV1",{enumerable:!0,get:a(function(){return i$.default},"get")});var s$=Qx();Object.defineProperty(ht,"v7",{enumerable:!0,get:a(function(){return s$.default},"get")});var o$=gf();Object.defineProperty(ht,"validate",{enumerable:!0,get:a(function(){return o$.default},"get")});var a$=Yx();Object.defineProperty(ht,"version",{enumerable:!0,get:a(function(){return a$.default},"get")})});var X_=w(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.Exo003UUIDGenerator=void 0;var Q_=Ii(),Xx=up(),Y_=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,Q_.v5)(e,Xx.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,Q_.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,Q_.v5)(e,Xx.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)}};pp.Exo003UUIDGenerator=Y_});var Zx=w(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Exo003Parser=void 0;var St=up(),Ef=X_(),Qo=Oe(),mp=Ge(),Jx=jt(),c$=Yn(),J_=class{static{a(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,o=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))o.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 Qo.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 Qo.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){let i=r;if(!i.startsWith("_:"))try{new Qo.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(r)}`)}}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,o=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of o)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 Qo.IRI(i.value);else if(i.type==="blank")s=new Jx.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let o=t(e.predicate);if(o.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new Qo.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new Qo.IRI(l.value);else if(l.type==="blank")u=new Jx.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new mp.Literal(f,new Qo.IRI(l.datatype));else{let d=l.language||St.DEFAULT_LANGUAGE_TAG;u=(0,mp.createDirectionalLiteral)(f,d,l.direction)}}return new c$.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new mp.Literal(t,new Qo.IRI(r.datatype));let i=r?.language||St.DEFAULT_LANGUAGE_TAG;return(0,mp.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 Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.Anchor:return Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.BlankNode:return Ef.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case St.Exo003MetadataType.Statement:{let r=e;return Ef.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case St.Exo003MetadataType.Body:{let r=e;return Ef.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};gp.Exo003Parser=J_});var Z_=w(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Exo003Parser=Qr.Exo003UUIDGenerator=Qr.UUID_URL_NAMESPACE=Qr.DEFAULT_LANGUAGE_TAG=Qr.REQUIRED_PROPERTIES=Qr.ALLOWED_PROPERTIES=Qr.Exo003MetadataType=void 0;var Tf=up();Object.defineProperty(Qr,"Exo003MetadataType",{enumerable:!0,get:a(function(){return Tf.Exo003MetadataType},"get")});Object.defineProperty(Qr,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return Tf.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Qr,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return Tf.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Qr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return Tf.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Qr,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return Tf.UUID_URL_NAMESPACE},"get")});var l$=X_();Object.defineProperty(Qr,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return l$.Exo003UUIDGenerator},"get")});var u$=Zx();Object.defineProperty(Qr,"Exo003Parser",{enumerable:!0,get:a(function(){return u$.Exo003Parser},"get")})});var no=w(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.WikiLinkHelpers=void 0;var Af=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let r=t.indexOf("|");if(r===-1)return t;let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();return this.UUID_PATTERN.test(i)&&s||i}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)}static resolveSymbolic(e,t){let r=this.normalize(e);if(!r)return"";if(this.UUID_PATTERN.test(r)){let i=t(r);return i&&i.length>0?i:r}return r}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};yp.WikiLinkHelpers=Af;Af.WIKI_LINK_PATTERN=/\[\[|\]\]/g;Af.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var Yo=w(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.CommandBindingProperty=wt.GroundingProperty=wt.PreconditionProperty=wt.CommandProperty=wt.resolveGroundingTypeFromWikilinkLiteral=wt.resolveGroundingTypeFromIRI=wt.GROUNDING_TYPE_IRI_TO_ENUM=wt.GROUNDING_TYPE_UID_TO_ENUM=wt.GROUNDING_TYPE_UIDS=wt.GroundingType=wt.EFFORT_STATUS_OPTIONS=wt.EffortStatus=wt.AssetClass=void 0;var f$=tl();Object.defineProperty(wt,"AssetClass",{enumerable:!0,get:a(function(){return f$.AssetClass},"get")});var d$=rl();Object.defineProperty(wt,"EffortStatus",{enumerable:!0,get:a(function(){return d$.EffortStatus},"get")});var h$=d_();Object.defineProperty(wt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return h$.EFFORT_STATUS_OPTIONS},"get")});var p$=Ko();Object.defineProperty(wt,"GroundingType",{enumerable:!0,get:a(function(){return p$.GroundingType},"get")});var If=hf();Object.defineProperty(wt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(wt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(wt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return If.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(wt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return If.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(wt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return If.resolveGroundingTypeFromWikilinkLiteral},"get")});var bp=h_();Object.defineProperty(wt,"CommandProperty",{enumerable:!0,get:a(function(){return bp.CommandProperty},"get")});Object.defineProperty(wt,"PreconditionProperty",{enumerable:!0,get:a(function(){return bp.PreconditionProperty},"get")});Object.defineProperty(wt,"GroundingProperty",{enumerable:!0,get:a(function(){return bp.GroundingProperty},"get")});Object.defineProperty(wt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return bp.CommandBindingProperty},"get")})});var nR=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.hasClass=Za;Yr.isAreaOrProject=m$;Yr.isEffort=g$;Yr.hasStatus=y$;Yr.isAssetArchived=b$;Yr.hasEmptyProperties=_$;Yr.needsFolderRepair=S$;Yr.getTodayDateString=eS;Yr.isPlannedForToday=w$;Yr.hasPlannedStartTimestamp=v$;Yr.extractDailyNoteDate=E$;Yr.isCurrentDateGteDay=T$;Yr.inheritsFromPrototype=rR;Yr.isPrototypeClass=I$;var tR=no(),Ja=Yo();function Za(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>tR.WikiLinkHelpers.normalize(r)===e):!1}a(Za,"hasClass");function m$(n){return Za(n,Ja.AssetClass.AREA)||Za(n,Ja.AssetClass.PROJECT)}a(m$,"isAreaOrProject");function g$(n){return Za(n,Ja.AssetClass.TASK)||Za(n,Ja.AssetClass.PROJECT)||Za(n,Ja.AssetClass.MEETING)}a(g$,"isEffort");function y$(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?tR.WikiLinkHelpers.normalize(t)===e:!1}a(y$,"hasStatus");function b$(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}a(b$,"isAssetArchived");function _$(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))}a(_$,"hasEmptyProperties");function S$(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}a(S$,"needsFolderRepair");function eS(){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}`}a(eS,"getTodayDateString");function w$(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=eS();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(w$,"isPlannedForToday");function v$(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}a(v$,"hasPlannedStartTimestamp");function E$(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}a(E$,"extractDailyNoteDate");function T$(n){return eS()>=n}a(T$,"isCurrentDateGteDay");function eR(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(eR,"normalizeWithQuotes");var A$=10;function rR(n,e=A$){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=eR(o);c&&i.push({className:c,depth:0})}for(;i.length>0;){let o=i.shift();if(!o)continue;let{className:c,depth:l}=o;if(l>e)continue;if(c===Ja.AssetClass.PROTOTYPE)return!0;if(r.has(c))continue;r.add(c);let u=`${c}__exo__Class_superClass`,f=n[u];if(f){let d=Array.isArray(f)?f:[f];for(let h of d){let p=eR(h);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}a(rR,"inheritsFromPrototype");function I$(n,e){return Za(n,Ja.AssetClass.CLASS)?rR(e):!1}a(I$,"isPrototypeClass")});var iR=w(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.isPrototypeClass=pt.inheritsFromPrototype=pt.isCurrentDateGteDay=pt.extractDailyNoteDate=pt.hasPlannedStartTimestamp=pt.isPlannedForToday=pt.getTodayDateString=pt.needsFolderRepair=pt.hasEmptyProperties=pt.isAssetArchived=pt.hasStatus=pt.isEffort=pt.isAreaOrProject=pt.hasClass=void 0;var Ln=nR();Object.defineProperty(pt,"hasClass",{enumerable:!0,get:a(function(){return Ln.hasClass},"get")});Object.defineProperty(pt,"isAreaOrProject",{enumerable:!0,get:a(function(){return Ln.isAreaOrProject},"get")});Object.defineProperty(pt,"isEffort",{enumerable:!0,get:a(function(){return Ln.isEffort},"get")});Object.defineProperty(pt,"hasStatus",{enumerable:!0,get:a(function(){return Ln.hasStatus},"get")});Object.defineProperty(pt,"isAssetArchived",{enumerable:!0,get:a(function(){return Ln.isAssetArchived},"get")});Object.defineProperty(pt,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Ln.hasEmptyProperties},"get")});Object.defineProperty(pt,"needsFolderRepair",{enumerable:!0,get:a(function(){return Ln.needsFolderRepair},"get")});Object.defineProperty(pt,"getTodayDateString",{enumerable:!0,get:a(function(){return Ln.getTodayDateString},"get")});Object.defineProperty(pt,"isPlannedForToday",{enumerable:!0,get:a(function(){return Ln.isPlannedForToday},"get")});Object.defineProperty(pt,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Ln.hasPlannedStartTimestamp},"get")});Object.defineProperty(pt,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Ln.extractDailyNoteDate},"get")});Object.defineProperty(pt,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Ln.isCurrentDateGteDay},"get")});Object.defineProperty(pt,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Ln.inheritsFromPrototype},"get")});Object.defineProperty(pt,"isPrototypeClass",{enumerable:!0,get:a(function(){return Ln.isPrototypeClass},"get")})});var sR=w(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.TsFloorViolationError=mt.CATALOG_KEEP_NAMESPACES=mt.PLUGIN_UI_FLOOR=mt.SDK_FLOOR=mt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=mt.SDK_FLOOR_ASSETSPACE_UIDS=mt.TS_FLOOR_AS_UID_SHARED_IDENTITIES=mt.TS_FLOOR_AS_UID_EXOCMD=mt.TS_FLOOR_AS_UID_EXO=void 0;mt.assertTsFloor=x$;mt.assertTsFloorReconciled=R$;mt.isTsFloorAssetSpace=C$;mt.isTsFloorMountPath=O$;mt.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";mt.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";mt.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";mt.SDK_FLOOR_ASSETSPACE_UIDS=new Set([mt.TS_FLOOR_AS_UID_EXO]);mt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([mt.TS_FLOOR_AS_UID_EXO]);mt.SDK_FLOOR=[{uid:mt.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];mt.PLUGIN_UI_FLOOR=mt.SDK_FLOOR;mt.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var xf=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};mt.TsFloorViolationError=xf;function x$(n,e){let t=[];for(let r of e)n.has(r)||t.push(r);if(t.length>0)throw new xf(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(x$,"assertTsFloor");function R$(n,e,t){let r=[];for(let i of t)n.has(i.uid)||e.has(i.namespace)||r.push(`${i.namespace} (${i.uid})`);if(r.length>0)throw new xf(`Target profile's declared set excludes TS-floor AssetSpace(s): ${r.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(R$,"assertTsFloorReconciled");function C$(n,e,t=mt.SDK_FLOOR){return t.some(r=>n.length>0&&r.uid===n||e.length>0&&r.namespace===e)}a(C$,"isTsFloorAssetSpace");function O$(n,e=mt.SDK_FLOOR){let t=n.replace(/\/+$/,""),r=t.slice(t.lastIndexOf("/")+1),i=r.startsWith("exoas-")?r.slice(6):r;return i.length===0?!1:e.some(s=>s.namespace===i)}a(O$,"isTsFloorMountPath")});var oR=w(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.transitiveDependsOnClosure=P$;function P$(n,e){let t=new Set,r=[];for(let i of n)t.has(i)||(t.add(i),r.push(i));for(;r.length>0;){let i=r.shift();if(i===void 0)break;let s=e.get(i);if(s!==void 0)for(let o of s)t.has(o)||(t.add(o),r.push(o))}return t}a(P$,"transitiveDependsOnClosure")});var _p=w(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.PropertyFieldType=void 0;Rf.rangeToFieldType=L$;var Br;(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"})(Br||(Rf.PropertyFieldType=Br={}));var aR="http://www.w3.org/2001/XMLSchema#",F$="https://exocortex.my/ontology/exo#",D$="https://exocortex.my/ontology/ems#";function L$(n){if(!n)return Br.Unknown;let e=n.trim();if(!e)return Br.Unknown;if(e.startsWith(aR)){let t=e.substring(aR.length);return rS(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return rS(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return rS(r)}return e.startsWith(D$)||e.startsWith("ems:")?N$(e):e.startsWith(F$)||e.startsWith("exo:")||k$(e)?Br.Reference:Br.Text}a(L$,"rangeToFieldType");function rS(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return Br.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 Br.Number;case"date":return Br.Date;case"datetime":case"datetimestamp":return Br.DateTime;case"boolean":return Br.Boolean;case"time":return Br.Timestamp;default:return Br.Text}}a(rS,"xsdTypeToFieldType");function N$(n){let e=n.toLowerCase();return e.includes("effortstatus")?Br.StatusSelect:e.includes("tasksize")?Br.SizeSelect:Br.Reference}a(N$,"emsTypeToFieldType");function k$(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))}a(k$,"isClassReference")});var nS=w(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.propertyNameToUri=M$;Cf.uriToPropertyName=cR;Cf.extractPropertyLabel=j$;function M$(n){return n.replace(/^([a-z]+)__/,"$1:")}a(M$,"propertyNameToUri");function cR(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__")}a(cR,"uriToPropertyName");function j$(n){let r=(n.includes(":")?cR(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())}a(j$,"extractPropertyLabel")});var Sp={};zb(Sp,{__assign:()=>sS,__asyncDelegator:()=>X$,__asyncGenerator:()=>Y$,__asyncValues:()=>J$,__await:()=>Of,__awaiter:()=>G$,__classPrivateFieldGet:()=>r6,__classPrivateFieldSet:()=>n6,__createBinding:()=>H$,__decorate:()=>B$,__exportStar:()=>z$,__extends:()=>$$,__generator:()=>W$,__importDefault:()=>t6,__importStar:()=>e6,__makeTemplateObject:()=>Z$,__metadata:()=>q$,__param:()=>V$,__read:()=>lR,__rest:()=>U$,__spread:()=>K$,__spreadArrays:()=>Q$,__values:()=>oS});function $$(n,e){iS(n,e);function t(){this.constructor=n}a(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function U$(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 B$(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function V$(n,e){return function(t,r){e(t,r,n)}}function q$(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function G$(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return a(i,"adopt"),new(t||(t=Promise))(function(s,o){function c(f){try{u(r.next(f))}catch(d){o(d)}}a(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(d){o(d)}}a(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}a(u,"step"),u((r=r.apply(n,e||[])).next())})}function W$(n,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;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 H$(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function z$(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function oS(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:a(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 lR(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function K$(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(lR(arguments[e]));return n}function Q$(){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],o=0,c=s.length;o<c;o++,i++)r[i]=s[o];return r}function Of(n){return this instanceof Of?(this.v=n,this):new Of(n)}function Y$(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(p){return new Promise(function(g,y){s.push([h,p,g,y])>1||c(h,p)})})}function c(h,p){try{l(r[h](p))}catch(g){d(s[0][3],g)}}function l(h){h.value instanceof Of?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){c("next",h)}function f(h){c("throw",h)}function d(h,p){h(p),s.shift(),s.length&&c(s[0][0],s[0][1])}}function X$(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(o){return(t=!t)?{value:Of(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function J$(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 oS=="function"?oS(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(o){return new Promise(function(c,l){o=n[s](o),i(c,l,o.done,o.value)})}}function i(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function Z$(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function e6(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 t6(n){return n&&n.__esModule?n:{default:n}}function r6(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function n6(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 iS,sS,wp=g9(()=>{iS=a(function(n,e){return iS=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])},iS(n,e)},"extendStatics");a($$,"__extends");sS=a(function(){return sS=Object.assign||a(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"),sS.apply(this,arguments)},"__assign");a(U$,"__rest");a(B$,"__decorate");a(V$,"__param");a(q$,"__metadata");a(G$,"__awaiter");a(W$,"__generator");a(H$,"__createBinding");a(z$,"__exportStar");a(oS,"__values");a(lR,"__read");a(K$,"__spread");a(Q$,"__spreadArrays");a(Of,"__await");a(Y$,"__asyncGenerator");a(X$,"__asyncDelegator");a(J$,"__asyncValues");a(Z$,"__makeTemplateObject");a(e6,"__importStar");a(t6,"__importDefault");a(r6,"__classPrivateFieldGet");a(n6,"__classPrivateFieldSet")});var lS=w(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var aS;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})(aS||(aS={}));cS.default=aS});var uR=w(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});var i6=lS();Object.defineProperty(uS,"Lifecycle",{enumerable:!0,get:a(function(){return i6.default},"get")})});var ec=w(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.defineInjectionTokenMetadata=xi.getParamInfo=xi.INJECTION_TOKEN_METADATA_KEY=void 0;xi.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function s6(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(xi.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}a(s6,"getParamInfo");xi.getParamInfo=s6;function o6(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(xi.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(xi.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(o6,"defineInjectionTokenMetadata");xi.defineInjectionTokenMetadata=o6});var fS=w(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.isClassProvider=void 0;function a6(n){return!!n.useClass}a(a6,"isClassProvider");vp.isClassProvider=a6});var dS=w(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.isFactoryProvider=void 0;function c6(n){return!!n.useFactory}a(c6,"isFactoryProvider");Ep.isFactoryProvider=c6});var Ap=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.delay=il.DelayedConstructor=void 0;var Tp=class{static{a(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=a(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(r),t}};il.DelayedConstructor=Tp;function l6(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Tp(n)}a(l6,"delay");il.delay=l6});var Ip=w(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.isConstructorToken=ys.isTransformDescriptor=ys.isTokenDescriptor=ys.isNormalToken=void 0;var u6=Ap();function f6(n){return typeof n=="string"||typeof n=="symbol"}a(f6,"isNormalToken");ys.isNormalToken=f6;function d6(n){return typeof n=="object"&&"token"in n&&"multiple"in n}a(d6,"isTokenDescriptor");ys.isTokenDescriptor=d6;function h6(n){return typeof n=="object"&&"token"in n&&"transform"in n}a(h6,"isTransformDescriptor");ys.isTransformDescriptor=h6;function p6(n){return typeof n=="function"||n instanceof u6.DelayedConstructor}a(p6,"isConstructorToken");ys.isConstructorToken=p6});var hS=w(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.isTokenProvider=void 0;function m6(n){return!!n.useToken}a(m6,"isTokenProvider");xp.isTokenProvider=m6});var pS=w(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.isValueProvider=void 0;function g6(n){return n.useValue!=null}a(g6,"isValueProvider");Rp.isValueProvider=g6});var mS=w(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var y6=fS();Object.defineProperty(tc,"isClassProvider",{enumerable:!0,get:a(function(){return y6.isClassProvider},"get")});var b6=dS();Object.defineProperty(tc,"isFactoryProvider",{enumerable:!0,get:a(function(){return b6.isFactoryProvider},"get")});var _6=Ip();Object.defineProperty(tc,"isNormalToken",{enumerable:!0,get:a(function(){return _6.isNormalToken},"get")});var S6=hS();Object.defineProperty(tc,"isTokenProvider",{enumerable:!0,get:a(function(){return S6.isTokenProvider},"get")});var w6=pS();Object.defineProperty(tc,"isValueProvider",{enumerable:!0,get:a(function(){return w6.isValueProvider},"get")})});var fR=w(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.isProvider=void 0;var v6=fS(),E6=pS(),T6=hS(),A6=dS();function I6(n){return v6.isClassProvider(n)||E6.isValueProvider(n)||T6.isTokenProvider(n)||A6.isFactoryProvider(n)}a(I6,"isProvider");Cp.isProvider=I6});var bS=w(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var gS=class{static{a(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,[])}};yS.default=gS});var dR=w(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var x6=bS(),_S=class extends x6.default{static{a(this,"Registry")}};SS.default=_S});var hR=w(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var wS=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};vS.default=wS});var ES=w(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.formatErrorCtor=void 0;function R6(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}a(R6,"formatDependency");function C6(n,e,t=" "){return[n,...e.message.split(`
|
|
32
32
|
`).map(r=>t+r)].join(`
|
|
33
|
-
`)}a(C6,"composeErrorMessage");function O6(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=R6(r,e);return C6(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(O6,"formatErrorCtor");Op.formatErrorCtor=O6});var pR=w(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.isDisposable=void 0;function P6(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(P6,"isDisposable");Pp.isDisposable=P6});var gR=w(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.PostResolutionInterceptors=rc.PreResolutionInterceptors=void 0;var mR=bS(),Fp=class extends mR.default{static{a(this,"PreResolutionInterceptors")}};rc.PreResolutionInterceptors=Fp;var Dp=class extends mR.default{static{a(this,"PostResolutionInterceptors")}};rc.PostResolutionInterceptors=Dp;var TS=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new Fp,this.postResolution=new Dp}};rc.default=TS});var Xo=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.instance=io.typeInfo=void 0;var F6=(wp(),Wh(Sp)),pn=mS(),D6=fR(),Lp=Ip(),L6=dR(),Nn=lS(),Np=hR(),N6=ES(),k6=Ap(),M6=pR(),j6=gR();io.typeInfo=new Map;var AS=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new L6.default,this.interceptors=new j6.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Nn.default.Transient}){this.ensureNotDisposed();let i;if(D6.isProvider(t)?i=t:i={useClass:t},pn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.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&&pn.isTokenProvider(l.provider)?o=l.provider:o=null}}if((r.lifecycle===Nn.default.Singleton||r.lifecycle==Nn.default.ContainerScoped||r.lifecycle==Nn.default.ResolutionScoped)&&(pn.isValueProvider(i)||pn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Nn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),pn.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(),pn.isNormalToken(e)){if(pn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Nn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Nn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!pn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Nn.default.Singleton})}resolve(e,t=new Np.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&pn.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(Lp.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===Nn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Nn.default.Singleton,i=e.options.lifecycle===Nn.default.ContainerScoped,s=r||i,o;return pn.isValueProvider(e.provider)?o=e.provider.useValue:pn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):pn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):pn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Nn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new Np.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&pn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}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=>!pn.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===Nn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Nn.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 F6.__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 k6.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=io.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 M6.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Lp.isTokenDescriptor(r)?Lp.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new Np.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 Np.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Lp.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(N6.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};io.instance=new AS;io.default=io.instance});var yR=w(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var $6=ec(),so=Xo(),IS=Ip(),U6=ES();function B6(){return function(n){let e=$6.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return IS.isTokenDescriptor(r)?IS.isTransformDescriptor(r)?r.multiple?so.instance.resolve(r.transform).transform(so.instance.resolveAll(r.token),...r.transformArgs):so.instance.resolve(r.transform).transform(so.instance.resolve(r.token),...r.transformArgs):r.multiple?so.instance.resolveAll(r.token):so.instance.resolve(r.token):IS.isTransformDescriptor(r)?so.instance.resolve(r.transform).transform(so.instance.resolve(r.token),...r.transformArgs):so.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(U6.formatErrorCtor(n,o,s))}})))}}}}a(B6,"autoInjectable");xS.default=B6});var bR=w(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var V6=ec();function q6(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return V6.defineInjectionTokenMetadata(t)}a(q6,"inject");RS.default=q6});var kp=w(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var G6=ec(),W6=Xo(),_R=Xo();function H6(n){return function(e){W6.typeInfo.set(e,G6.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{_R.instance.register(t,e)}):_R.instance.register(n.token,e))}}a(H6,"injectable");CS.default=H6});var SR=w(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var z6=(wp(),Wh(Sp)),K6=Xo();function Q6(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=z6.__rest(t,["token","options"]);return K6.instance.register(r,s,i)}),e}}a(Q6,"registry");OS.default=Q6});var wR=w(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var Y6=kp(),X6=Xo();function J6(){return function(n){Y6.default()(n),X6.instance.registerSingleton(n)}}a(J6,"singleton");PS.default=J6});var vR=w(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Z6=ec();function e7(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return Z6.defineInjectionTokenMetadata(t)}a(e7,"injectAll");FS.default=e7});var ER=w(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var t7=ec();function r7(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return t7.defineInjectionTokenMetadata(r)}a(r7,"injectAllWithTransform");DS.default=r7});var TR=w(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var n7=ec();function i7(n,e,...t){return n7.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(i7,"injectWithTransform");LS.default=i7});var AR=w(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var s7=kp(),o7=Xo();function a7(n,e){return function(t){s7.default()(t),o7.instance.register(e||t,t,{lifecycle:n})}}a(a7,"scoped");NS.default=a7});var IR=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var c7=yR();Object.defineProperty(Ri,"autoInjectable",{enumerable:!0,get:a(function(){return c7.default},"get")});var l7=bR();Object.defineProperty(Ri,"inject",{enumerable:!0,get:a(function(){return l7.default},"get")});var u7=kp();Object.defineProperty(Ri,"injectable",{enumerable:!0,get:a(function(){return u7.default},"get")});var f7=SR();Object.defineProperty(Ri,"registry",{enumerable:!0,get:a(function(){return f7.default},"get")});var d7=wR();Object.defineProperty(Ri,"singleton",{enumerable:!0,get:a(function(){return d7.default},"get")});var h7=vR();Object.defineProperty(Ri,"injectAll",{enumerable:!0,get:a(function(){return h7.default},"get")});var p7=ER();Object.defineProperty(Ri,"injectAllWithTransform",{enumerable:!0,get:a(function(){return p7.default},"get")});var m7=TR();Object.defineProperty(Ri,"injectWithTransform",{enumerable:!0,get:a(function(){return m7.default},"get")});var g7=AR();Object.defineProperty(Ri,"scoped",{enumerable:!0,get:a(function(){return g7.default},"get")})});var xR=w(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});function y7(n){let e;return t=>(e==null&&(e=n(t)),e)}a(y7,"instanceCachingFactory");kS.default=y7});var RR=w(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});function b7(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(b7,"instancePerContainerCachingFactory");MS.default=b7});var CR=w(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});function _7(n,e,t,r=!0){let i,s;return o=>{let c=n(o);return(!r||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(_7,"predicateAwareClassFactory");jS.default=_7});var OR=w(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var S7=xR();Object.defineProperty(Pf,"instanceCachingFactory",{enumerable:!0,get:a(function(){return S7.default},"get")});var w7=RR();Object.defineProperty(Pf,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return w7.default},"get")});var v7=CR();Object.defineProperty(Pf,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return v7.default},"get")})});var Be=w(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var $S=(wp(),Wh(Sp));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 E7=uR();Object.defineProperty(Jo,"Lifecycle",{enumerable:!0,get:a(function(){return E7.Lifecycle},"get")});$S.__exportStar(IR(),Jo);$S.__exportStar(OR(),Jo);$S.__exportStar(mS(),Jo);var T7=Ap();Object.defineProperty(Jo,"delay",{enumerable:!0,get:a(function(){return T7.delay},"get")});var A7=Xo();Object.defineProperty(Jo,"container",{enumerable:!0,get:a(function(){return A7.instance},"get")})});var sl=w(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.NullLogger=void 0;Mp.NullLogger={debug(){},info(){},warn(){},error(){}}});var al=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.bytesToBase64=FR;ol.base64ToBytes=DR;ol.base64ToUtf8=I7;ol.utf8ToBase64=x7;var PR=32768;function FR(n){let e="";for(let t=0;t<n.length;t+=PR)e+=String.fromCharCode(...n.subarray(t,t+PR));return btoa(e)}a(FR,"bytesToBase64");function DR(n){let e=n.replace(/\s/g,""),t=e.length%4,r=t===2||t===3?e+"=".repeat(4-t):e,i=atob(r),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(DR,"base64ToBytes");function I7(n){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(DR(n))}a(I7,"base64ToUtf8");function x7(n){return FR(new TextEncoder().encode(n))}a(x7,"utf8ToBase64")});var jp=w(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.iriToObsidianName=R7;function R7(n){let e=n.match(/^https:\/\/exocortex\.my\/ontology\/([a-z][a-zA-Z0-9]*)#([^#]+)$/);if(e){let[,r,i]=e;return`${r}__${i}`}let t=n.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(R7,"iriToObsidianName")});var LR=w(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.registerUniversalDefaultLoader=C7;Zo.clearUniversalDefaultLoader=O7;Zo.clearUniversalDefault=P7;Zo.loadUniversalDefault=F7;Zo.mergePropertyDefaults=D7;Zo.mergeInheritanceRules=L7;var $p=null,oo,Ff=!1;function C7(n){$p=n,oo=void 0,Ff=!1}a(C7,"registerUniversalDefaultLoader");function O7(){$p=null,oo=void 0,Ff=!1}a(O7,"clearUniversalDefaultLoader");function P7(){oo=void 0,Ff=!1}a(P7,"clearUniversalDefault");async function F7(){if(oo!==void 0)return oo;if(!$p)return oo=null,null;try{oo=await $p()??null}catch(n){Ff||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",n),Ff=!0),oo=null}return oo}a(F7,"loadUniversalDefault");function D7(n,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.propertyName);o?(r.push(o),i.add(o.propertyName)):r.push(s)}for(let s of e)i.has(s.propertyName)||r.push(s);return r}a(D7,"mergePropertyDefaults");function L7(n,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.targetPropertyName);o?(r.push(o),i.add(o.targetPropertyName)):r.push(s)}for(let s of e)i.has(s.targetPropertyName)||r.push(s);return r}a(L7,"mergeInheritanceRules")});var BS=w((Xue,NR)=>{var cl=class{static{a(this,"Wildcard")}constructor(){return N7||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(cl.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(cl.prototype,"termType",{enumerable:!0,value:"Wildcard"});var N7=new cl;NR.exports.Wildcard=cl});var MR=w((Zue,kR)=>{var k7=(function(){var n=a(function(N,D,$,H){for($=$||{},H=N.length;H--;$[N[H]]=D);return $},"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],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],g=[123,126],y=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],v=[1,87],I=[2,281],A=[1,86],T=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],R=[6,28,29,53,63,70,73,81,83,85],B=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],L=[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],P=[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],M=[13,16,308],O=[112,132,327,334],Y=[13,16,112,132,308],oe=[1,111],Q=[1,117],be=[112,132,327,328,334],le=[13,16,112,132,308,328],ue=[28,29,45,53,87],k=[1,138],G=[1,151],je=[1,128],X=[1,127],q=[1,129],te=[1,140],Z=[1,141],ge=[1,142],$e=[1,143],Ve=[1,144],j=[1,145],re=[1,147],pe=[1,148],xe=[2,457],ye=[1,158],_e=[1,159],W=[1,160],J=[1,152],ee=[1,153],de=[1,156],Te=[1,171],Ae=[1,172],Pe=[1,173],Ce=[1,174],Fe=[1,175],De=[1,176],Le=[1,167],Ne=[1,168],Ie=[1,169],ke=[1,170],at=[1,157],Ze=[1,166],Je=[1,161],x=[1,162],C=[1,163],F=[1,164],U=[1,165],me=[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],Ot=[6,31,73,81,83,85],ze=[2,285],ne=[1,199],ie=[1,201],ae=[6,31,70,73,81,83,85],fe=[2,283],We=[1,207],lt=[1,218],ut=[1,223],Mr=[1,219],On=[1,225],Kn=[1,226],un=[1,224],fI=[6,63,70,73,81,83,85],dI=[1,236],hI=[2,334],pI=[1,243],mI=[1,241],jr=[6,193],Eh=[2,349],gI=[2,339],Wo=[28,128],yI=[47,48,193,272],Th=[47,48,193,242,272],Gc=[47,48,193,242,246,272],Wc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Tr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],bI=[1,271],_I=[1,270],ir=[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],SI=[1,281],wI=[1,280],fn=[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],ef=[45,89],Ah=[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],Ih=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],xh=[31,89],Rh=[48,87],$a=[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],fs=[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],vI=[1,313],Hc=[6,85],Ib=[6,31,81,83,85],EI=[2,361],Hs=[2,353],Ua=[1,343],tf=[31,112,335],zs=[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],xb=[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],TI=[6,109,193],Ba=[31,112],sr=[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],Rb=[1,390],Cb=[1,391],Ho=[13,16,87,197,308,314],AI=[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],Ch=[1,417],Oh=[1,418],II=[13,16,48,197,229,308],zo=[6,31,85],xI=[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],Ob=[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],Va=[29,31,85,112,159,160,161,163,164],Ph=[1,443],Fh=[1,444],RI=[1,449],qa=[31,112,193,232,318,335],Dh=[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],CI=[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],Pb=[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],rf=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],nf=[31,45],OI=[1,507],PI=[1,508],FI=[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],Lh=[29,31,85,112,159,160,161,163,164,335],Ga=[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],DI=[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],LI=[2,352],Fb=[13,16,197,308,314],NI=[1,565],zc=[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],kI=[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],Ks=[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],MI=[13,16,87,308],Qs=[2,364],Kc=[29,31,85,112,159,160,161,163,164,193,232,318,335],Nh=[31,112,193,232,272,318,335],Ys=[2,359],jI=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],kh=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],$I=[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],UI=[2,347],Db={trace:a(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:a(function(D,$,H,we,He,_,hn){var E=_.length-1;switch(He){case 1:if(_[E-1]=_[E-1]||{},Qe.base&&(_[E-1].base=Qe.base),Qe.base="",_[E-1].prefixes=Qe.prefixes,Qe.prefixes=null,Qe.pathOnly){if(_[E-1].type==="path"||"termType"in _[E-1])return _[E-1];throw new Error("Received full SPARQL query in path only mode")}else if(_[E-1].type==="path"||"termType"in _[E-1])throw new Error("Received only path in full SPARQL mode");if(_[E-1].type==="update"){let It={};for(let Mt of _[E-1].updates)if(Mt.updateType==="insert"){let ft={};for(let bt of Mt.insert)if(bt.type==="bgp"||bt.type==="graph")for(let Pn of bt.triples)Pn.subject.termType==="BlankNode"&&(ft[Pn.subject.value]=!0),Pn.predicate.termType==="BlankNode"&&(ft[Pn.predicate.value]=!0),Pn.object.termType==="BlankNode"&&(ft[Pn.object.value]=!0);for(let bt of Object.keys(ft)){if(It[bt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");It[bt]=!0}}}return _[E-1];case 2:this.$={..._[E-1],..._[E],type:"query"};break;case 4:Qe.base=sf(_[E]);break;case 5:Qe.prefixes||(Qe.prefixes={}),_[E-1]=_[E-1].substr(0,_[E-1].length-1),_[E]=sf(_[E]),Qe.prefixes[_[E-1]]=_[E];break;case 6:this.$={..._[E-3],...za(_[E-2]),..._[E-1],..._[E]};break;case 7:if(!Qe.skipValidation&&(Bb(_[E-3].variables.map(Mt=>Ub(Mt.expression))).some(Mt=>Mt.aggregation==="count"&&!(Mt.expression instanceof Mh))||_[E].group)){for(let Mt of _[E-3].variables)if(Mt.termType==="Variable"){if(!_[E].group||!_[E].group.map(ft=>Jc(ft)).includes(Jc(Mt)))throw Error("Projection of ungrouped variable (?"+Jc(Mt)+")")}else if(Ub(Mt.expression).length===0){let ft=c9(Mt.expression);for(let bt of ft)if(!_[E].group||!_[E].group.map||!_[E].group.map(Pn=>Jc(Pn)).includes(Jc(bt)))throw Error("Use of ungrouped variable in projection of operation (?"+Jc(bt)+")")}}let ms=_[E-1].where.filter(It=>It.type==="query");if(ms.length>0){let It=_[E-3].variables.filter(ft=>ft.variable&&ft.variable.value).map(ft=>ft.variable.value),Mt=Bb(ms.map(ft=>ft.variables)).map(ft=>ft.value||ft.variable.value);for(let ft of It)if(Mt.indexOf(ft)>=0)throw Error("Target id of 'AS' (?"+ft+") already used in subquery")}this.$=Jt(_[E-3],za(_[E-2]),_[E-1],_[E]);break;case 8:this.$=Jt({queryType:"CONSTRUCT",template:_[E-3]},za(_[E-2]),_[E-1],_[E]);break;case 9:this.$=Jt({queryType:"CONSTRUCT",template:_[E-2]=_[E-2]?_[E-2].triples:[]},za(_[E-5]),{where:[{type:"bgp",triples:Ha([],_[E-2])}]},_[E]);break;case 10:this.$=Jt({queryType:"DESCRIBE",variables:_[E-3]==="*"?[new Mh]:_[E-3]},za(_[E-2]),_[E-1],_[E]);break;case 11:this.$=Jt({queryType:"ASK"},za(_[E-2]),_[E-1],_[E]);break;case 12:this.$=Jt(_[E-1],{variables:[new Mh]});break;case 13:let uf=_[E].map(It=>It.value||It.variable.value),Zc=l9(uf);if(Zc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Zc[0]+")");this.$=Jt(_[E-1],{variables:_[E]});break;case 14:this.$=Jt({queryType:"SELECT"},_[E]&&(_[E-1]=dn(_[E]),_[E]={},_[E][_[E-1]]=!0,_[E]));break;case 16:case 27:this.$=Qc(_[E-3],{variable:_[E-1]});break;case 17:case 18:this.$=Jt(_[E-3],_[E-2],_[E-1],_[E],{type:"query"});break;case 19:case 58:this.$={iri:_[E],named:!!_[E-1]};break;case 20:this.$={where:_[E].patterns};break;case 21:this.$=Jt(_[E-1],_[E]);break;case 22:this.$=Jt(_[E-2],_[E-1],_[E]);break;case 23:this.$={group:_[E]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Qc(_[E]);break;case 26:this.$=Qc(_[E-1]);break;case 29:this.$={having:_[E]};break;case 30:this.$={order:_[E]};break;case 32:this.$=Qc(_[E],{descending:!0});break;case 35:this.$={limit:Xc(_[E])};break;case 36:this.$={offset:Xc(_[E])};break;case 37:this.$={limit:Xc(_[E-2]),offset:Xc(_[E])};break;case 38:this.$={limit:Xc(_[E]),offset:Xc(_[E-2])};break;case 39:case 43:this.$={type:"values",values:_[E]};break;case 40:case 84:this.$=_[E-1].map(It=>({[_[E-3]]:It}));break;case 41:case 85:this.$=_[E-1].map(()=>({}));break;case 42:case 86:var ps=_[E-4].length;_[E-4]=_[E-4].map(Lb),this.$=_[E-1].map(function(It){if(It.length!==ps)throw Error("Inconsistent VALUES length");for(var Mt={},ft=0;ft<ps;ft++)Mt["?"+_[E-4][ft].value]=It[ft];return Mt});break;case 44:case 65:case 100:case 126:case 175:this.$=_[E-1];break;case 45:this.$={type:"update",updates:Xs(_[E-2],_[E-1])};break;case 46:this.$=Jt({type:"load",silent:!!_[E-2],source:_[E-1]},_[E]&&{destination:_[E]});break;case 47:this.$={type:dn(_[E-2]),silent:!!_[E-1],graph:_[E]};break;case 48:this.$={type:dn(_[E-4]),silent:!!_[E-3],source:_[E-2],destination:_[E]};break;case 49:this.$={type:"create",silent:!!_[E-2],graph:{type:"graph",name:_[E]}};break;case 50:this.$={updateType:"insert",insert:XI(_[E])};break;case 51:this.$={updateType:"delete",delete:Gb(XI(_[E]))};break;case 52:this.$={updateType:"deletewhere",delete:Gb(_[E])};break;case 53:this.$={updateType:"insertdelete",..._[E-4],..._[E-3],...za(_[E-2],"using"),where:_[E].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=_[E];break;case 55:this.$={delete:Gb(_[E-1]),insert:_[E]||[]};break;case 56:this.$={delete:[],insert:_[E]};break;case 59:this.$={graph:_[E]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:_[E]};break;case 64:this.$={[dn(_[E])]:!0};break;case 66:this.$=_[E-1]?ds(_[E],[_[E-1]]):ds(_[E]);break;case 67:var cf=Jt(_[E-3]||{triples:[]},{type:"graph",name:_[E-5]});this.$=_[E]?[cf,_[E]]:[cf];break;case 68:case 73:this.$={type:"bgp",triples:ds(_[E-2],[_[E-1]])};break;case 69:this.$={type:"group",patterns:[_[E-1]]};break;case 70:for(let It of _[E-1].filter(Mt=>Mt.type==="bind")){let Mt=_[E-1].indexOf(It),ft=new Set;for(let bt of _[E-1].slice(0,Mt))(bt.type==="group"||bt.type==="bgp")&&QI(bt).forEach(Pn=>ft.add(Pn));if(ft.has(It.variable.value))throw Error("Variable used to bind is already bound (?"+It.variable.value+")")}this.$={type:"group",patterns:_[E-1]};break;case 71:this.$=_[E-1]?ds([_[E-1]],_[E]):ds(_[E]);break;case 72:this.$=_[E]?[_[E-2],_[E]]:_[E-2];break;case 75:this.$=Jt(_[E],{type:"optional"});break;case 76:this.$=Jt(_[E],{type:"minus"});break;case 77:this.$=Jt(_[E],{type:"graph",name:_[E-1]});break;case 78:this.$=Jt(_[E],{type:"service",name:_[E-1],silent:!!_[E-2]});break;case 79:this.$={type:"filter",expression:_[E]};break;case 80:this.$={type:"bind",variable:_[E-1],expression:_[E-3]};break;case 89:this.$=af(_[E]);break;case 90:this.$=void 0;break;case 91:this.$=_[E-1].length?{type:"union",patterns:ds(_[E-1].map(kb),[kb(_[E])])}:_[E];break;case 95:this.$={..._[E],function:_[E-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Xs(_[E-2],_[E-1]),distinct:!!_[E-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.$=Xs(_[E-2],_[E-1]);break;case 101:this.$=ds(_[E-2],[_[E-1]]);break;case 102:case 112:this.$=qb(_[E].map(It=>Jt(Js(_[E-1]),It)));break;case 103:this.$=qb(Ha(_[E].map(It=>Jt(Js(_[E-1].entity),It)),_[E-1].triples));break;case 105:this.$=ds([_[E-1]],_[E]);break;case 106:this.$=ds(_[E]);break;case 107:this.$=$b(_[E-1],_[E]);break;case 109:case 237:this.$=Qe.factory.namedNode(Jj);break;case 110:case 118:this.$=Xs(_[E-1],_[E]);break;case 111:this.$=_[E]?{annotation:_[E],object:_[E-1]}:_[E-1];break;case 113:this.$=_[E]?qb(Ha(_[E].map(It=>Jt(Js(_[E-1].entity),It)),_[E-1].triples)):_[E-1].triples;break;case 114:this.$=$b(..._[E-1],_[E]);break;case 116:this.$=$b(..._[E]);break;case 117:case 159:case 163:this.$=[_[E-1],_[E]];break;case 119:this.$=_[E]?{object:_[E-1],annotation:_[E]}:_[E-1];break;case 120:this.$=_[E-1].length?Yc("|",Xs(_[E-1],_[E])):_[E];break;case 121:this.$=_[E-1].length?Yc("/",Xs(_[E-1],_[E])):_[E];break;case 122:this.$=_[E]?Yc(_[E],[_[E-1]]):_[E-1];break;case 123:this.$=_[E-1]?Yc(_[E-1],[_[E]]):_[E];break;case 125:case 131:this.$=Yc(_[E-1],[_[E]]);break;case 129:this.$=Yc("|",Xs(_[E-2],_[E-1]));break;case 132:case 134:this.$=o9(_[E-1]);break;case 133:case 135:this.$=a9(_[E-1]);break;case 140:this.$={entity:_[E],triples:[]};break;case 145:this.$=Lb(_[E]);break;case 149:this.$=Qe.factory.namedNode(BI);break;case 151:case 153:case 158:case 162:this.$=Nb(_[E-1],_[E]);break;case 152:this.$=["||",_[E]];break;case 154:this.$=["&&",_[E]];break;case 156:this.$=$r(_[E-1],[_[E-2],_[E]]);break;case 157:this.$=$r(_[E-2]?"notin":"in",[_[E-3],_[E]]);break;case 160:this.$=["+",Nb(_[E-1],_[E])];break;case 161:var Uh=hs(_[E-1].value.replace("-",""),_[E-1].datatype);this.$=["-",Nb(Uh,_[E])];break;case 164:this.$=$r("UPLUS",[_[E]]);break;case 165:this.$=$r(_[E-1],[_[E]]);break;case 166:this.$=$r("UMINUS",[_[E]]);break;case 177:this.$=$r(dn(_[E-1]));break;case 178:this.$=$r(dn(_[E-3]),[_[E-1]]);break;case 179:this.$=af($r(dn(_[E-3]),[_[E-1]]));break;case 180:this.$=$r(dn(_[E-5]),[_[E-3],_[E-1]]);break;case 181:this.$=$r(dn(_[E-7]),[_[E-5],_[E-3],_[E-1]]);break;case 182:this.$=af($r(dn(_[E-7]),[_[E-5],_[E-3],_[E-1]]));break;case 183:this.$=$r(dn(_[E-1]),_[E]);break;case 184:this.$=$r("bound",[Lb(_[E-1])]);break;case 185:this.$=$r(_[E-1],[]);break;case 186:this.$=$r(_[E-3],[_[E-1]]);break;case 187:this.$=$r(_[E-2]?"notexists":"exists",[kb(_[E])]);break;case 188:case 189:this.$=Qc(_[E-1],{type:"aggregate",aggregation:dn(_[E-4]),distinct:!!_[E-2]});break;case 190:this.$=Qc(_[E-2],{type:"aggregate",aggregation:dn(_[E-5]),distinct:!!_[E-3],separator:typeof _[E-1]=="string"?_[E-1]:" "});break;case 192:this.$=hs(_[E]);break;case 193:this.$=r9(_[E-1],dn(_[E].substr(1)));break;case 194:this.$=hs(_[E-2],_[E]);break;case 195:case 204:this.$=hs(_[E],VI);break;case 196:case 205:this.$=hs(_[E],qI);break;case 197:case 206:this.$=hs(dn(_[E]),GI);break;case 200:this.$=hs(_[E].toLowerCase(),t9);break;case 201:this.$=hs(_[E].substr(1),VI);break;case 202:this.$=hs(_[E].substr(1),qI);break;case 203:this.$=hs(_[E].substr(1).toLowerCase(),GI);break;case 207:case 208:this.$=KI(_[E],1);break;case 209:case 210:this.$=KI(_[E],3);break;case 211:this.$=Qe.factory.namedNode(sf(_[E]));break;case 213:var Bh=_[E].indexOf(":"),lf=_[E].substr(0,Bh),Vh=Qe.prefixes[lf];if(!Vh)throw new Error("Unknown prefix: "+lf);var Gt=sf(Vh+_[E].substr(Bh+1));this.$=Qe.factory.namedNode(Gt);break;case 214:if(_[E]=_[E].substr(0,_[E].length-1),!(_[E]in Qe.prefixes))throw new Error("Unknown prefix: "+_[E]);var Gt=sf(Qe.prefixes[_[E]]);this.$=Qe.factory.namedNode(Gt);break;case 215:this.$=of(_[E].replace(/^(_:)/,""));break;case 216:this.$=of();break;case 217:case 218:case 232:this.$=af(Mb(_[E-3],_[E-2],_[E-1]));break;case 230:case 231:this.$=af(_[E-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:_[E-1].push(_[E]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[_[E]];break;case 308:_[E-3].push(_[E-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:_[E-2].push(_[E-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:o},{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:d,33:35,39:[1,37],44:39,55:40,87:h,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(g,[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:y,87:h},n(b,[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(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:v,29:I,52:84,53:A,56:85},{19:88,28:v,29:I,52:89,53:A,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:A},n(T,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(R,[2,263],{34:96}),n(R,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(R,[2,262]),n(B,[2,259]),n(L,[2,143]),n(L,[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(P,[2,211]),n(P,[2,212]),n(P,[2,213]),n(P,[2,214]),{19:98,28:v,29:I,52:99,53:A,56:85},{6:[2,309],99:100,193:[1,101]},n(M,[2,311],{101:102,328:[1,103]}),n(O,[2,317],{104:104,328:[1,105]}),n(Y,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:oe,114:110},{29:oe,114:112},{29:oe,114:113},{118:114,123:[1,115],125:116,126:Q},n(be,[2,315]),n(be,[2,316]),n(le,[2,319]),n(le,[2,320]),n(le,[2,321]),n(g,[2,327]),{13:f,16:d,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:y,87:h}),n(ue,[2,269]),n(ue,[2,15]),{13:f,16:d,44:136,45:k,46:120,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(me,[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:d,45:[1,193],55:194,197:At,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(S,[2,419]),n(Ot,ze,{20:196,59:197,69:198,70:ne}),n(l,[2,250]),{29:ie,57:200},n(M,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(ae,fe,{23:204,58:205,62:206,63:We}),n(l,[2,252]),{19:208,28:v,29:I,52:209,53:A,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,145:212,172:221,185:213,187:214,231:Mr,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(fI,[2,265],{56:85,35:227,52:228,19:229,28:v,29:I,53:A}),n(B,[2,260]),n(ae,fe,{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:d,55:232,307:43,308:p},n(M,[2,312]),{105:233,112:dI,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(O,[2,318]),n(M,hI,{108:240,133:242,112:pI,132:mI}),n(Y,[2,323]),{112:[1,244]},{112:[2,325]},n(jr,[2,50]),n(T,Eh,{135:245,136:246,143:247,144:248,31:gI,112:gI}),n(jr,[2,51]),n(jr,[2,52]),n(Wo,[2,328],{119:249}),{29:oe,114:250},n(Wo,[2,56]),{29:oe,114:251},n(g,[2,59]),n(ue,[2,270]),{47:[1,252]},n(yI,[2,150]),n(Th,[2,428],{240:253}),n(Gc,[2,430],{244:254}),n(Gc,[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(Wc,[2,440],{252:264}),n(Tr,[2,448],{260:265}),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Tr,[2,167]),n(Tr,[2,168]),n(Tr,[2,169]),n(Tr,[2,170],{176:269,45:bI,89:_I}),n(Tr,[2,171]),n(Tr,[2,172]),n(Tr,[2,173]),n(Tr,[2,174]),{13:f,16:d,44:136,45:k,46:272,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:SI,89:wI,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(fn,[2,192],{292:[1,286],293:[1,287]}),n(fn,[2,195]),n(fn,[2,196]),n(fn,[2,197]),n(fn,[2,198]),n(fn,[2,199]),n(fn,[2,200]),{13:f,16:d,44:39,55:40,82:G,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(ef,[2,452]),n(ef,[2,453]),n(ef,[2,454]),n(ef,[2,455]),n(ef,[2,456]),{279:[2,458]},n(Ah,[2,207]),n(Ah,[2,208]),n(Ah,[2,209]),n(Ah,[2,210]),n(fn,[2,201]),n(fn,[2,202]),n(fn,[2,203]),n(fn,[2,204]),n(fn,[2,205]),n(fn,[2,206]),n(e,[2,5]),n(Ih,[2,297],{88:295}),n(xh,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Rh,[2,301]),n(me,[2,43]),n(me,[2,82]),n(me,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n($a,[2,123]),n($a,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(fs,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:At,223:312,225:308,226:309,229:vI,307:43,308:p},n(c,i,{215:10,214:314}),n(fs,[2,236]),n(fs,[2,237]),n(Hc,[2,6]),n(Ib,[2,287],{60:315,72:316,73:[1,317]}),n(Ot,[2,286]),{13:f,16:d,45:k,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n([6,31,63,70,73,81,83,85],[2,20]),n(T,EI,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Hs,31:Hs,85:Hs,112:Hs,159:Hs,160:Hs,161:Hs,163:Hs,164:Hs,41:s}),{13:f,16:d,55:331,307:43,308:p},n(M,[2,280]),n(Hc,[2,7]),n(Ot,ze,{59:197,69:198,20:332,70:ne}),n(ae,[2,284]),{64:[1,333]},n(ae,fe,{58:205,62:206,23:334,63:We}),n(l,[2,254]),n(T,Eh,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:h,139:342,186:339,190:340,195:341,197:Ua,307:43,308:p},n(tf,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:h,197:Ua,308:p}),n(zs,[2,227]),n(zs,[2,228]),n(zs,[2,229]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,172:221,185:351,187:350,200:348,230:347,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:Ua,307:43,308:p},n(zs,[2,146]),n(zs,[2,147]),n(zs,[2,148]),n(zs,[2,149]),{13:f,16:d,44:354,55:355,82:G,87:h,172:357,237:356,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:358,312:un,313:353},n(xb,[2,215]),n(xb,[2,216]),n(ae,fe,{58:205,62:206,23:359,63:We}),n(R,[2,264]),n(fI,[2,266]),n(Hc,[2,11]),n(r,[2,308],{6:[2,310]}),n(jr,[2,313],{102:360,120:361,121:[1,362]}),n(jr,[2,47]),n(jr,[2,63]),n(jr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(jr,[2,336]),n(jr,[2,337]),n(jr,[2,338]),{109:[1,364]},n(TI,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(M,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(Ba,[2,341],{137:368}),n(Ba,[2,340]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,145:369,172:221,185:213,187:214,231:Mr,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},{28:[1,370],127:371,128:[1,372]},n(Wo,[2,330],{124:373,125:374,126:Q}),n(Wo,[2,57]),{44:375,87:h},n(yI,[2,151],{241:376,242:[1,377]}),n(Th,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,247:380,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{250:[1,381]},n(sr,[2,432]),n(sr,[2,433]),n(sr,[2,434]),n(sr,[2,435]),n(sr,[2,436]),n(sr,[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:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De}),n(Wc,[2,162],{261:388,262:389,39:Rb,338:Cb}),n(Tr,[2,164]),n(Tr,[2,165]),n(Tr,[2,166]),n(ir,[2,95]),n(ir,[2,96]),n(sr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(ir,[2,177]),{13:f,16:d,44:136,45:k,46:395,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:396,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:397,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:398,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:399,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,183]),n(ir,[2,98]),n(sr,[2,381],{180:400}),{87:[1,401]},n(ir,[2,185]),{13:f,16:d,44:136,45:k,46:402,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{29:ie,57:403},n(fn,[2,193]),{13:f,16:d,55:404,307:43,308:p},{13:f,16:d,44:39,55:40,87:h,139:342,195:405,197:Ua,307:43,308:p},n(Ho,[2,233]),n(Ho,[2,234]),n(Ho,[2,235]),n(AI,[2,459],{281:406,325:[1,407]}),n(sr,[2,463],{284:408,325:[1,409]}),n(sr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:G,171:413,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,419],89:[1,420]},{29:[1,421]},n(Rh,[2,302]),n(Ih,[2,367],{167:422}),n(xh,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Rh,[2,371]),n($a,[2,122]),n($a,[2,417]),n($a,[2,413]),n($a,[2,414]),n($a,[2,415]),n(fs,[2,125]),n(fs,[2,127]),n(fs,[2,128]),n(II,[2,420],{227:426}),n(fs,[2,130]),{13:f,16:d,55:194,197:At,223:427,307:43,308:p},{48:[1,428]},n(zo,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(Ib,[2,288]),{64:[1,433]},n(Ot,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:k,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(xI,[2,293]),n(Ob,[2,92]),n(Ob,[2,93]),n(Ob,[2,94]),{45:bI,89:_I,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:v,29:I,56:85},{19:438,28:v,29:I,56:85},n(Va,[2,355],{149:439}),n(Va,[2,354]),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,156:440,172:221,185:441,203:442,231:Fh,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(R,[2,19]),n(zo,[2,21]),{13:f,16:d,44:450,45:RI,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Hc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(T,[2,386],{31:[2,388]}),n(tf,[2,102]),n(qa,[2,391],{191:452}),n(T,[2,395],{196:453,198:454}),n(T,[2,108]),n(T,[2,109]),n(tf,[2,103]),n(tf,[2,104]),n(tf,[2,390]),{13:f,16:d,44:215,45:lt,48:[1,455],55:220,82:G,87:h,89:ut,172:221,185:351,187:350,200:456,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(Dh,[2,424]),n(CI,[2,136]),n(CI,[2,137]),n(Pb,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:Ua,307:43,308:p},n(Ho,[2,219]),n(Ho,[2,220]),n(Ho,[2,221]),n(Ho,[2,222]),n(Ho,[2,223]),n(Hc,[2,10]),n(jr,[2,46]),n(jr,[2,314]),{112:dI,122:459},n(jr,[2,62]),n(M,hI,{133:242,108:460,112:pI,132:mI}),n(TI,[2,61]),n(jr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(Ba,[2,351],{146:463,335:[1,464]}),{29:ie,57:465},n(Wo,[2,329]),n(M,[2,332],{129:466,327:[1,467]}),n(Wo,[2,55]),n(Wo,[2,331]),{48:[1,468]},n(Th,[2,429]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Gc,[2,431]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,243:470,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Gc,[2,156]),{45:SI,89:wI,179:471},n(Wc,[2,441]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,251:472,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Tr,[2,444],{256:473}),n(Tr,[2,446],{258:474}),n(sr,[2,442]),n(sr,[2,443]),n(Tr,[2,449]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,255:154,257:155,259:475,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,450]),n(sr,[2,451]),n(sr,[2,379],{178:476}),n(sr,[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:d,44:136,45:k,46:482,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{48:[1,483]},{48:[1,484]},n(ir,[2,187]),n(fn,[2,194]),{13:f,16:d,44:39,55:40,82:G,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,320:485},{13:f,16:d,39:[1,487],44:136,45:k,46:488,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,282:486,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(AI,[2,460]),{13:f,16:d,44:136,45:k,46:489,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,464]),{13:f,16:d,44:136,45:k,46:490,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,466]),n(me,[2,40]),n(Ih,[2,298]),n(rf,[2,87]),n(rf,[2,88]),n(rf,[2,89]),n(rf,[2,90]),{13:f,16:d,55:492,82:G,172:493,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,311:494,312:un,315:491},n(me,[2,41]),n(xh,[2,300]),n(nf,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:G,171:497,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,498],89:[1,499]},{29:[1,500]},n(Rh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:At,223:312,226:502,228:501,229:vI,307:43,308:p},n(fs,[2,131]),n(fs,[2,126]),n(zo,[2,22]),n(zo,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:k,55:323,67:321,68:322,74:505,75:506,76:OI,77:320,78:PI,79:509,87:h,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(xI,[2,294]),n(FI,[2,69]),n(FI,[2,70]),n(Ot,ze,{59:197,69:198,20:511,70:ne}),n(ae,fe,{58:205,62:206,23:512,63:We}),{29:[2,375],31:[2,71],84:522,85:o,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(Va,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:h}),n(Lh,[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:h}),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,172:221,185:351,203:536,212:534,231:Fh,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(ae,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:RI,87:h,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(Ga,[2,291]),n(Ga,[2,24]),n(Ga,[2,25]),{13:f,16:d,44:136,45:k,46:539,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Ga,[2,28]),n(ae,fe,{58:205,62:206,23:540,63:We}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(qa,[2,107]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,172:221,185:351,187:350,199:543,200:544,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(DI,[2,132]),n(Dh,[2,425]),n(DI,[2,133]),{13:f,16:d,44:354,55:355,82:G,87:h,172:357,237:356,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:358,312:un,313:545},n(jr,[2,54]),n(jr,[2,48]),n(Ba,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(Ba,[2,68]),n(T,[2,350],{31:LI,112:LI}),n(jr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(M,[2,333]),n(ue,[2,16]),n(Th,[2,152]),n(Gc,[2,154]),n(Gc,[2,157]),n(Wc,[2,159]),n(Wc,[2,160],{262:389,261:548,39:Rb,338:Cb}),n(Wc,[2,161],{262:389,261:549,39:Rb,338:Cb}),n(Tr,[2,163]),{13:f,16:d,44:136,45:k,46:550,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,178]),n(ir,[2,179]),{13:f,16:d,44:136,45:k,46:551,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:552,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:553,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{48:[1,554],272:[1,555]},n(ir,[2,184]),n(ir,[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:d,55:194,197:At,223:562,307:43,308:p},n(Fb,[2,224]),n(Fb,[2,225]),n(Fb,[2,226]),{31:[1,563],45:NI,94:564},n(me,[2,84]),n(Ih,[2,368]),n(me,[2,85]),n(xh,[2,370]),n(nf,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(zo,[2,35],{83:[1,569]}),n(zo,[2,36],{81:[1,570]}),n(Ib,[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:d,45:k,76:OI,78:PI,87:h,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(zc,[2,295]),{45:k,77:572},{45:k,77:573},n(zc,[2,33]),n(zc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(Va,[2,356]),n(kI,[2,357],{152:578,335:[1,579]}),n(Ks,[2,74]),{29:ie,57:580},{29:ie,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(MI,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:k,55:323,67:321,68:322,77:320,79:585,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},{45:[1,586]},n(Ks,[2,81]),{29:ie,57:587},n(Va,[2,73]),n(T,[2,362],{29:Qs,31:Qs,85:Qs,112:Qs,159:Qs,160:Qs,161:Qs,163:Qs,164:Qs}),n(Lh,[2,112]),n(Kc,[2,401],{206:588}),n(T,[2,405],{209:589,210:590}),n(T,[2,403]),n(T,[2,404]),n(Lh,[2,113]),n(Lh,[2,400]),{13:f,16:d,44:215,45:Ph,48:[1,591],55:220,82:G,87:h,89:ut,172:221,185:351,203:536,212:592,231:Fh,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(Dh,[2,426]),n(Pb,[2,138]),n(Pb,[2,139]),{232:[1,593]},n(Ga,[2,292]),{47:[1,595],48:[1,594]},n(Hc,[2,9]),n(qa,[2,392]),n(qa,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:Ua,308:p}),n(qa,[2,110],{272:[1,598]}),n(Nh,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(Wo,[2,58]),n(Tr,[2,445]),n(Tr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(ir,[2,99]),n(sr,[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(ir,[2,188]),n(ir,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:G,172:493,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,311:494,312:un,315:611},n(me,[2,42]),n(nf,[2,304]),{13:f,16:d,55:414,82:G,95:612,171:613,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,614],45:NI,94:615},n(fs,[2,129]),n(II,[2,421]),{82:[1,616]},{82:[1,617]},n(zc,[2,296]),n(zc,[2,31]),n(zc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(T,EI,{155:330,153:618,154:619,29:Ys,31:Ys,85:Ys,112:Ys,159:Ys,160:Ys,161:Ys,163:Ys,164:Ys}),n(kI,[2,358]),n(Ks,[2,75]),n(Ks,[2,76]),{29:ie,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(MI,[2,366]),n(Ks,[2,79]),{13:f,16:d,44:136,45:k,46:622,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Ks,[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(Kc,[2,117]),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,172:221,185:351,203:536,211:626,212:627,231:Fh,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Kn,311:217,312:un},n(zs,[2,134]),n(Dh,[2,427]),n(zs,[2,135]),n(Ga,[2,26]),{44:628,87:h},n(qa,[2,106]),n(qa,[2,394]),n(T,[2,396]),n(Nh,[2,111]),n(Nh,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:Ua,307:43,308:p},n(xb,[2,217]),n(T,Eh,{144:248,140:630,143:631,31:[2,343]}),n(ir,[2,97]),n(sr,[2,380]),n(ir,[2,180]),{13:f,16:d,44:136,45:k,46:632,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:633,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:G,171:637,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},n(jI,[2,305]),n(me,[2,86]),n(nf,[2,374]),n(zo,[2,37]),n(zo,[2,38]),n(Va,[2,72]),n(Va,[2,360]),n(Ks,[2,77]),{29:ie,57:638},{47:[1,639]},{29:[2,376]},n(Kc,[2,402]),n(Kc,[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:h}),n(Kc,[2,118],{272:[1,641]}),n(kh,[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:Le,304:Ne,305:Ie,306:ke},n(rf,[2,218]),n(nf,[2,44]),n(jI,[2,306]),n(Ks,[2,78]),{44:651,87:h},n(Kc,[2,116]),n(T,[2,406]),n(kh,[2,119]),n(kh,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(Ga,[2,27]),n(Nh,[2,230]),n($I,[2,345],{141:653,335:[1,654]}),n(ir,[2,181]),n(ir,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(T,Eh,{144:248,142:657,143:658,31:UI,112:UI}),n($I,[2,346]),n(Ks,[2,80]),n(kh,[2,231]),n(Ba,[2,67]),n(Ba,[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:a(function(D,$){if($.recoverable)this.trace(D);else{var H=new Error(D);throw H.hash=$,H}},"parseError"),parse:a(function(D){var $=this,H=[0],we=[],He=[null],_=[],hn=this.table,E="",ps=0,cf=0,Uh=0,Bh=2,lf=1,Vh=_.slice.call(arguments,1),Gt=Object.create(this.lexer),ms={yy:{}};for(var uf in this.yy)Object.prototype.hasOwnProperty.call(this.yy,uf)&&(ms.yy[uf]=this.yy[uf]);Gt.setInput(D,ms.yy),ms.yy.lexer=Gt,ms.yy.parser=this,typeof Gt.yylloc>"u"&&(Gt.yylloc={});var Zc=Gt.yylloc;_.push(Zc);var It=Gt.options&&Gt.options.ranges;typeof ms.yy.parseError=="function"?this.parseError=ms.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(gs){H.length=H.length-2*gs,He.length=He.length-gs,_.length=_.length-gs}a(Mt,"popStack");for(var ft=a(function(){var gs;return gs=Gt.lex()||lf,typeof gs!="number"&&(gs=$.symbols_[gs]||gs),gs},"lex"),bt,Pn,Ka,ci,hae,Wb,el={},qh,Zs,JI,Gh;;){if(Ka=H[H.length-1],this.defaultActions[Ka]?ci=this.defaultActions[Ka]:((bt===null||typeof bt>"u")&&(bt=ft()),ci=hn[Ka]&&hn[Ka][bt]),typeof ci>"u"||!ci.length||!ci[0]){var Hb="";Gh=[];for(qh in hn[Ka])this.terminals_[qh]&&qh>Bh&&Gh.push("'"+this.terminals_[qh]+"'");Gt.showPosition?Hb="Parse error on line "+(ps+1)+`:
|
|
33
|
+
`)}a(C6,"composeErrorMessage");function O6(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=R6(r,e);return C6(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(O6,"formatErrorCtor");Op.formatErrorCtor=O6});var pR=w(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.isDisposable=void 0;function P6(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(P6,"isDisposable");Pp.isDisposable=P6});var gR=w(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.PostResolutionInterceptors=rc.PreResolutionInterceptors=void 0;var mR=bS(),Fp=class extends mR.default{static{a(this,"PreResolutionInterceptors")}};rc.PreResolutionInterceptors=Fp;var Dp=class extends mR.default{static{a(this,"PostResolutionInterceptors")}};rc.PostResolutionInterceptors=Dp;var TS=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new Fp,this.postResolution=new Dp}};rc.default=TS});var Xo=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.instance=io.typeInfo=void 0;var F6=(wp(),Wh(Sp)),pn=mS(),D6=fR(),Lp=Ip(),L6=dR(),Nn=lS(),Np=hR(),N6=ES(),k6=Ap(),M6=pR(),j6=gR();io.typeInfo=new Map;var AS=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new L6.default,this.interceptors=new j6.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Nn.default.Transient}){this.ensureNotDisposed();let i;if(D6.isProvider(t)?i=t:i={useClass:t},pn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.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&&pn.isTokenProvider(l.provider)?o=l.provider:o=null}}if((r.lifecycle===Nn.default.Singleton||r.lifecycle==Nn.default.ContainerScoped||r.lifecycle==Nn.default.ResolutionScoped)&&(pn.isValueProvider(i)||pn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Nn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),pn.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(),pn.isNormalToken(e)){if(pn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Nn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Nn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!pn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Nn.default.Singleton})}resolve(e,t=new Np.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&pn.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(Lp.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===Nn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Nn.default.Singleton,i=e.options.lifecycle===Nn.default.ContainerScoped,s=r||i,o;return pn.isValueProvider(e.provider)?o=e.provider.useValue:pn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):pn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):pn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Nn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new Np.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&pn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}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=>!pn.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===Nn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Nn.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 F6.__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 k6.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=io.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 M6.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Lp.isTokenDescriptor(r)?Lp.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new Np.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 Np.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Lp.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(N6.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};io.instance=new AS;io.default=io.instance});var yR=w(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var $6=ec(),so=Xo(),IS=Ip(),U6=ES();function B6(){return function(n){let e=$6.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return IS.isTokenDescriptor(r)?IS.isTransformDescriptor(r)?r.multiple?so.instance.resolve(r.transform).transform(so.instance.resolveAll(r.token),...r.transformArgs):so.instance.resolve(r.transform).transform(so.instance.resolve(r.token),...r.transformArgs):r.multiple?so.instance.resolveAll(r.token):so.instance.resolve(r.token):IS.isTransformDescriptor(r)?so.instance.resolve(r.transform).transform(so.instance.resolve(r.token),...r.transformArgs):so.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(U6.formatErrorCtor(n,o,s))}})))}}}}a(B6,"autoInjectable");xS.default=B6});var bR=w(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var V6=ec();function q6(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return V6.defineInjectionTokenMetadata(t)}a(q6,"inject");RS.default=q6});var kp=w(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var G6=ec(),W6=Xo(),_R=Xo();function H6(n){return function(e){W6.typeInfo.set(e,G6.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{_R.instance.register(t,e)}):_R.instance.register(n.token,e))}}a(H6,"injectable");CS.default=H6});var SR=w(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var z6=(wp(),Wh(Sp)),K6=Xo();function Q6(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=z6.__rest(t,["token","options"]);return K6.instance.register(r,s,i)}),e}}a(Q6,"registry");OS.default=Q6});var wR=w(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var Y6=kp(),X6=Xo();function J6(){return function(n){Y6.default()(n),X6.instance.registerSingleton(n)}}a(J6,"singleton");PS.default=J6});var vR=w(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Z6=ec();function e7(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return Z6.defineInjectionTokenMetadata(t)}a(e7,"injectAll");FS.default=e7});var ER=w(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var t7=ec();function r7(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return t7.defineInjectionTokenMetadata(r)}a(r7,"injectAllWithTransform");DS.default=r7});var TR=w(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var n7=ec();function i7(n,e,...t){return n7.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(i7,"injectWithTransform");LS.default=i7});var AR=w(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var s7=kp(),o7=Xo();function a7(n,e){return function(t){s7.default()(t),o7.instance.register(e||t,t,{lifecycle:n})}}a(a7,"scoped");NS.default=a7});var IR=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var c7=yR();Object.defineProperty(Ri,"autoInjectable",{enumerable:!0,get:a(function(){return c7.default},"get")});var l7=bR();Object.defineProperty(Ri,"inject",{enumerable:!0,get:a(function(){return l7.default},"get")});var u7=kp();Object.defineProperty(Ri,"injectable",{enumerable:!0,get:a(function(){return u7.default},"get")});var f7=SR();Object.defineProperty(Ri,"registry",{enumerable:!0,get:a(function(){return f7.default},"get")});var d7=wR();Object.defineProperty(Ri,"singleton",{enumerable:!0,get:a(function(){return d7.default},"get")});var h7=vR();Object.defineProperty(Ri,"injectAll",{enumerable:!0,get:a(function(){return h7.default},"get")});var p7=ER();Object.defineProperty(Ri,"injectAllWithTransform",{enumerable:!0,get:a(function(){return p7.default},"get")});var m7=TR();Object.defineProperty(Ri,"injectWithTransform",{enumerable:!0,get:a(function(){return m7.default},"get")});var g7=AR();Object.defineProperty(Ri,"scoped",{enumerable:!0,get:a(function(){return g7.default},"get")})});var xR=w(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});function y7(n){let e;return t=>(e==null&&(e=n(t)),e)}a(y7,"instanceCachingFactory");kS.default=y7});var RR=w(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});function b7(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(b7,"instancePerContainerCachingFactory");MS.default=b7});var CR=w(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});function _7(n,e,t,r=!0){let i,s;return o=>{let c=n(o);return(!r||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(_7,"predicateAwareClassFactory");jS.default=_7});var OR=w(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var S7=xR();Object.defineProperty(Pf,"instanceCachingFactory",{enumerable:!0,get:a(function(){return S7.default},"get")});var w7=RR();Object.defineProperty(Pf,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return w7.default},"get")});var v7=CR();Object.defineProperty(Pf,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return v7.default},"get")})});var Be=w(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var $S=(wp(),Wh(Sp));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 E7=uR();Object.defineProperty(Jo,"Lifecycle",{enumerable:!0,get:a(function(){return E7.Lifecycle},"get")});$S.__exportStar(IR(),Jo);$S.__exportStar(OR(),Jo);$S.__exportStar(mS(),Jo);var T7=Ap();Object.defineProperty(Jo,"delay",{enumerable:!0,get:a(function(){return T7.delay},"get")});var A7=Xo();Object.defineProperty(Jo,"container",{enumerable:!0,get:a(function(){return A7.instance},"get")})});var sl=w(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.NullLogger=void 0;Mp.NullLogger={debug(){},info(){},warn(){},error(){}}});var al=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.bytesToBase64=FR;ol.base64ToBytes=DR;ol.base64ToUtf8=I7;ol.utf8ToBase64=x7;var PR=32768;function FR(n){let e="";for(let t=0;t<n.length;t+=PR)e+=String.fromCharCode(...n.subarray(t,t+PR));return btoa(e)}a(FR,"bytesToBase64");function DR(n){let e=n.replace(/\s/g,""),t=e.length%4,r=t===2||t===3?e+"=".repeat(4-t):e,i=atob(r),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(DR,"base64ToBytes");function I7(n){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(DR(n))}a(I7,"base64ToUtf8");function x7(n){return FR(new TextEncoder().encode(n))}a(x7,"utf8ToBase64")});var jp=w(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.iriToObsidianName=R7;function R7(n){let e=n.match(/^https:\/\/exocortex\.my\/ontology\/([a-z][a-zA-Z0-9]*)#([^#]+)$/);if(e){let[,r,i]=e;return`${r}__${i}`}let t=n.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(R7,"iriToObsidianName")});var LR=w(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.registerUniversalDefaultLoader=C7;Zo.clearUniversalDefaultLoader=O7;Zo.clearUniversalDefault=P7;Zo.loadUniversalDefault=F7;Zo.mergePropertyDefaults=D7;Zo.mergeInheritanceRules=L7;var $p=null,oo,Ff=!1;function C7(n){$p=n,oo=void 0,Ff=!1}a(C7,"registerUniversalDefaultLoader");function O7(){$p=null,oo=void 0,Ff=!1}a(O7,"clearUniversalDefaultLoader");function P7(){oo=void 0,Ff=!1}a(P7,"clearUniversalDefault");async function F7(){if(oo!==void 0)return oo;if(!$p)return oo=null,null;try{oo=await $p()??null}catch(n){Ff||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",n),Ff=!0),oo=null}return oo}a(F7,"loadUniversalDefault");function D7(n,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.propertyName);o?(r.push(o),i.add(o.propertyName)):r.push(s)}for(let s of e)i.has(s.propertyName)||r.push(s);return r}a(D7,"mergePropertyDefaults");function L7(n,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.targetPropertyName);o?(r.push(o),i.add(o.targetPropertyName)):r.push(s)}for(let s of e)i.has(s.targetPropertyName)||r.push(s);return r}a(L7,"mergeInheritanceRules")});var BS=w((Xue,NR)=>{var cl=class{static{a(this,"Wildcard")}constructor(){return N7||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(cl.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(cl.prototype,"termType",{enumerable:!0,value:"Wildcard"});var N7=new cl;NR.exports.Wildcard=cl});var MR=w((Zue,kR)=>{var k7=(function(){var n=a(function(N,D,$,H){for($=$||{},H=N.length;H--;$[N[H]]=D);return $},"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],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],g=[123,126],y=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],v=[1,87],I=[2,281],A=[1,86],T=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],R=[6,28,29,53,63,70,73,81,83,85],B=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],L=[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],P=[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],M=[13,16,308],O=[112,132,327,334],Y=[13,16,112,132,308],oe=[1,111],Q=[1,117],be=[112,132,327,328,334],le=[13,16,112,132,308,328],ue=[28,29,45,53,87],k=[1,138],G=[1,151],je=[1,128],X=[1,127],q=[1,129],te=[1,140],Z=[1,141],ge=[1,142],$e=[1,143],Ve=[1,144],j=[1,145],re=[1,147],pe=[1,148],xe=[2,457],ye=[1,158],_e=[1,159],W=[1,160],J=[1,152],ee=[1,153],de=[1,156],Te=[1,171],Ae=[1,172],Pe=[1,173],Ce=[1,174],Fe=[1,175],De=[1,176],Le=[1,167],Ne=[1,168],Ie=[1,169],ke=[1,170],at=[1,157],Ze=[1,166],Je=[1,161],x=[1,162],C=[1,163],F=[1,164],U=[1,165],me=[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],Ot=[6,31,73,81,83,85],ze=[2,285],ne=[1,199],ie=[1,201],ae=[6,31,70,73,81,83,85],fe=[2,283],We=[1,207],lt=[1,218],ut=[1,223],Mr=[1,219],On=[1,225],Qn=[1,226],un=[1,224],fI=[6,63,70,73,81,83,85],dI=[1,236],hI=[2,334],pI=[1,243],mI=[1,241],jr=[6,193],Eh=[2,349],gI=[2,339],Wo=[28,128],yI=[47,48,193,272],Th=[47,48,193,242,272],Gc=[47,48,193,242,246,272],Wc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Tr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],bI=[1,271],_I=[1,270],ir=[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],SI=[1,281],wI=[1,280],fn=[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],ef=[45,89],Ah=[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],Ih=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],xh=[31,89],Rh=[48,87],$a=[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],fs=[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],vI=[1,313],Hc=[6,85],Ib=[6,31,81,83,85],EI=[2,361],Hs=[2,353],Ua=[1,343],tf=[31,112,335],zs=[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],xb=[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],TI=[6,109,193],Ba=[31,112],sr=[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],Rb=[1,390],Cb=[1,391],Ho=[13,16,87,197,308,314],AI=[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],Ch=[1,417],Oh=[1,418],II=[13,16,48,197,229,308],zo=[6,31,85],xI=[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],Ob=[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],Va=[29,31,85,112,159,160,161,163,164],Ph=[1,443],Fh=[1,444],RI=[1,449],qa=[31,112,193,232,318,335],Dh=[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],CI=[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],Pb=[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],rf=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],nf=[31,45],OI=[1,507],PI=[1,508],FI=[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],Lh=[29,31,85,112,159,160,161,163,164,335],Ga=[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],DI=[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],LI=[2,352],Fb=[13,16,197,308,314],NI=[1,565],zc=[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],kI=[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],Ks=[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],MI=[13,16,87,308],Qs=[2,364],Kc=[29,31,85,112,159,160,161,163,164,193,232,318,335],Nh=[31,112,193,232,272,318,335],Ys=[2,359],jI=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],kh=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],$I=[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],UI=[2,347],Db={trace:a(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:a(function(D,$,H,we,He,_,hn){var E=_.length-1;switch(He){case 1:if(_[E-1]=_[E-1]||{},Qe.base&&(_[E-1].base=Qe.base),Qe.base="",_[E-1].prefixes=Qe.prefixes,Qe.prefixes=null,Qe.pathOnly){if(_[E-1].type==="path"||"termType"in _[E-1])return _[E-1];throw new Error("Received full SPARQL query in path only mode")}else if(_[E-1].type==="path"||"termType"in _[E-1])throw new Error("Received only path in full SPARQL mode");if(_[E-1].type==="update"){let It={};for(let Mt of _[E-1].updates)if(Mt.updateType==="insert"){let ft={};for(let bt of Mt.insert)if(bt.type==="bgp"||bt.type==="graph")for(let Pn of bt.triples)Pn.subject.termType==="BlankNode"&&(ft[Pn.subject.value]=!0),Pn.predicate.termType==="BlankNode"&&(ft[Pn.predicate.value]=!0),Pn.object.termType==="BlankNode"&&(ft[Pn.object.value]=!0);for(let bt of Object.keys(ft)){if(It[bt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");It[bt]=!0}}}return _[E-1];case 2:this.$={..._[E-1],..._[E],type:"query"};break;case 4:Qe.base=sf(_[E]);break;case 5:Qe.prefixes||(Qe.prefixes={}),_[E-1]=_[E-1].substr(0,_[E-1].length-1),_[E]=sf(_[E]),Qe.prefixes[_[E-1]]=_[E];break;case 6:this.$={..._[E-3],...za(_[E-2]),..._[E-1],..._[E]};break;case 7:if(!Qe.skipValidation&&(Bb(_[E-3].variables.map(Mt=>Ub(Mt.expression))).some(Mt=>Mt.aggregation==="count"&&!(Mt.expression instanceof Mh))||_[E].group)){for(let Mt of _[E-3].variables)if(Mt.termType==="Variable"){if(!_[E].group||!_[E].group.map(ft=>Jc(ft)).includes(Jc(Mt)))throw Error("Projection of ungrouped variable (?"+Jc(Mt)+")")}else if(Ub(Mt.expression).length===0){let ft=c9(Mt.expression);for(let bt of ft)if(!_[E].group||!_[E].group.map||!_[E].group.map(Pn=>Jc(Pn)).includes(Jc(bt)))throw Error("Use of ungrouped variable in projection of operation (?"+Jc(bt)+")")}}let ms=_[E-1].where.filter(It=>It.type==="query");if(ms.length>0){let It=_[E-3].variables.filter(ft=>ft.variable&&ft.variable.value).map(ft=>ft.variable.value),Mt=Bb(ms.map(ft=>ft.variables)).map(ft=>ft.value||ft.variable.value);for(let ft of It)if(Mt.indexOf(ft)>=0)throw Error("Target id of 'AS' (?"+ft+") already used in subquery")}this.$=Jt(_[E-3],za(_[E-2]),_[E-1],_[E]);break;case 8:this.$=Jt({queryType:"CONSTRUCT",template:_[E-3]},za(_[E-2]),_[E-1],_[E]);break;case 9:this.$=Jt({queryType:"CONSTRUCT",template:_[E-2]=_[E-2]?_[E-2].triples:[]},za(_[E-5]),{where:[{type:"bgp",triples:Ha([],_[E-2])}]},_[E]);break;case 10:this.$=Jt({queryType:"DESCRIBE",variables:_[E-3]==="*"?[new Mh]:_[E-3]},za(_[E-2]),_[E-1],_[E]);break;case 11:this.$=Jt({queryType:"ASK"},za(_[E-2]),_[E-1],_[E]);break;case 12:this.$=Jt(_[E-1],{variables:[new Mh]});break;case 13:let uf=_[E].map(It=>It.value||It.variable.value),Zc=l9(uf);if(Zc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Zc[0]+")");this.$=Jt(_[E-1],{variables:_[E]});break;case 14:this.$=Jt({queryType:"SELECT"},_[E]&&(_[E-1]=dn(_[E]),_[E]={},_[E][_[E-1]]=!0,_[E]));break;case 16:case 27:this.$=Qc(_[E-3],{variable:_[E-1]});break;case 17:case 18:this.$=Jt(_[E-3],_[E-2],_[E-1],_[E],{type:"query"});break;case 19:case 58:this.$={iri:_[E],named:!!_[E-1]};break;case 20:this.$={where:_[E].patterns};break;case 21:this.$=Jt(_[E-1],_[E]);break;case 22:this.$=Jt(_[E-2],_[E-1],_[E]);break;case 23:this.$={group:_[E]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Qc(_[E]);break;case 26:this.$=Qc(_[E-1]);break;case 29:this.$={having:_[E]};break;case 30:this.$={order:_[E]};break;case 32:this.$=Qc(_[E],{descending:!0});break;case 35:this.$={limit:Xc(_[E])};break;case 36:this.$={offset:Xc(_[E])};break;case 37:this.$={limit:Xc(_[E-2]),offset:Xc(_[E])};break;case 38:this.$={limit:Xc(_[E]),offset:Xc(_[E-2])};break;case 39:case 43:this.$={type:"values",values:_[E]};break;case 40:case 84:this.$=_[E-1].map(It=>({[_[E-3]]:It}));break;case 41:case 85:this.$=_[E-1].map(()=>({}));break;case 42:case 86:var ps=_[E-4].length;_[E-4]=_[E-4].map(Lb),this.$=_[E-1].map(function(It){if(It.length!==ps)throw Error("Inconsistent VALUES length");for(var Mt={},ft=0;ft<ps;ft++)Mt["?"+_[E-4][ft].value]=It[ft];return Mt});break;case 44:case 65:case 100:case 126:case 175:this.$=_[E-1];break;case 45:this.$={type:"update",updates:Xs(_[E-2],_[E-1])};break;case 46:this.$=Jt({type:"load",silent:!!_[E-2],source:_[E-1]},_[E]&&{destination:_[E]});break;case 47:this.$={type:dn(_[E-2]),silent:!!_[E-1],graph:_[E]};break;case 48:this.$={type:dn(_[E-4]),silent:!!_[E-3],source:_[E-2],destination:_[E]};break;case 49:this.$={type:"create",silent:!!_[E-2],graph:{type:"graph",name:_[E]}};break;case 50:this.$={updateType:"insert",insert:XI(_[E])};break;case 51:this.$={updateType:"delete",delete:Gb(XI(_[E]))};break;case 52:this.$={updateType:"deletewhere",delete:Gb(_[E])};break;case 53:this.$={updateType:"insertdelete",..._[E-4],..._[E-3],...za(_[E-2],"using"),where:_[E].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=_[E];break;case 55:this.$={delete:Gb(_[E-1]),insert:_[E]||[]};break;case 56:this.$={delete:[],insert:_[E]};break;case 59:this.$={graph:_[E]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:_[E]};break;case 64:this.$={[dn(_[E])]:!0};break;case 66:this.$=_[E-1]?ds(_[E],[_[E-1]]):ds(_[E]);break;case 67:var cf=Jt(_[E-3]||{triples:[]},{type:"graph",name:_[E-5]});this.$=_[E]?[cf,_[E]]:[cf];break;case 68:case 73:this.$={type:"bgp",triples:ds(_[E-2],[_[E-1]])};break;case 69:this.$={type:"group",patterns:[_[E-1]]};break;case 70:for(let It of _[E-1].filter(Mt=>Mt.type==="bind")){let Mt=_[E-1].indexOf(It),ft=new Set;for(let bt of _[E-1].slice(0,Mt))(bt.type==="group"||bt.type==="bgp")&&QI(bt).forEach(Pn=>ft.add(Pn));if(ft.has(It.variable.value))throw Error("Variable used to bind is already bound (?"+It.variable.value+")")}this.$={type:"group",patterns:_[E-1]};break;case 71:this.$=_[E-1]?ds([_[E-1]],_[E]):ds(_[E]);break;case 72:this.$=_[E]?[_[E-2],_[E]]:_[E-2];break;case 75:this.$=Jt(_[E],{type:"optional"});break;case 76:this.$=Jt(_[E],{type:"minus"});break;case 77:this.$=Jt(_[E],{type:"graph",name:_[E-1]});break;case 78:this.$=Jt(_[E],{type:"service",name:_[E-1],silent:!!_[E-2]});break;case 79:this.$={type:"filter",expression:_[E]};break;case 80:this.$={type:"bind",variable:_[E-1],expression:_[E-3]};break;case 89:this.$=af(_[E]);break;case 90:this.$=void 0;break;case 91:this.$=_[E-1].length?{type:"union",patterns:ds(_[E-1].map(kb),[kb(_[E])])}:_[E];break;case 95:this.$={..._[E],function:_[E-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Xs(_[E-2],_[E-1]),distinct:!!_[E-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.$=Xs(_[E-2],_[E-1]);break;case 101:this.$=ds(_[E-2],[_[E-1]]);break;case 102:case 112:this.$=qb(_[E].map(It=>Jt(Js(_[E-1]),It)));break;case 103:this.$=qb(Ha(_[E].map(It=>Jt(Js(_[E-1].entity),It)),_[E-1].triples));break;case 105:this.$=ds([_[E-1]],_[E]);break;case 106:this.$=ds(_[E]);break;case 107:this.$=$b(_[E-1],_[E]);break;case 109:case 237:this.$=Qe.factory.namedNode(Jj);break;case 110:case 118:this.$=Xs(_[E-1],_[E]);break;case 111:this.$=_[E]?{annotation:_[E],object:_[E-1]}:_[E-1];break;case 113:this.$=_[E]?qb(Ha(_[E].map(It=>Jt(Js(_[E-1].entity),It)),_[E-1].triples)):_[E-1].triples;break;case 114:this.$=$b(..._[E-1],_[E]);break;case 116:this.$=$b(..._[E]);break;case 117:case 159:case 163:this.$=[_[E-1],_[E]];break;case 119:this.$=_[E]?{object:_[E-1],annotation:_[E]}:_[E-1];break;case 120:this.$=_[E-1].length?Yc("|",Xs(_[E-1],_[E])):_[E];break;case 121:this.$=_[E-1].length?Yc("/",Xs(_[E-1],_[E])):_[E];break;case 122:this.$=_[E]?Yc(_[E],[_[E-1]]):_[E-1];break;case 123:this.$=_[E-1]?Yc(_[E-1],[_[E]]):_[E];break;case 125:case 131:this.$=Yc(_[E-1],[_[E]]);break;case 129:this.$=Yc("|",Xs(_[E-2],_[E-1]));break;case 132:case 134:this.$=o9(_[E-1]);break;case 133:case 135:this.$=a9(_[E-1]);break;case 140:this.$={entity:_[E],triples:[]};break;case 145:this.$=Lb(_[E]);break;case 149:this.$=Qe.factory.namedNode(BI);break;case 151:case 153:case 158:case 162:this.$=Nb(_[E-1],_[E]);break;case 152:this.$=["||",_[E]];break;case 154:this.$=["&&",_[E]];break;case 156:this.$=$r(_[E-1],[_[E-2],_[E]]);break;case 157:this.$=$r(_[E-2]?"notin":"in",[_[E-3],_[E]]);break;case 160:this.$=["+",Nb(_[E-1],_[E])];break;case 161:var Uh=hs(_[E-1].value.replace("-",""),_[E-1].datatype);this.$=["-",Nb(Uh,_[E])];break;case 164:this.$=$r("UPLUS",[_[E]]);break;case 165:this.$=$r(_[E-1],[_[E]]);break;case 166:this.$=$r("UMINUS",[_[E]]);break;case 177:this.$=$r(dn(_[E-1]));break;case 178:this.$=$r(dn(_[E-3]),[_[E-1]]);break;case 179:this.$=af($r(dn(_[E-3]),[_[E-1]]));break;case 180:this.$=$r(dn(_[E-5]),[_[E-3],_[E-1]]);break;case 181:this.$=$r(dn(_[E-7]),[_[E-5],_[E-3],_[E-1]]);break;case 182:this.$=af($r(dn(_[E-7]),[_[E-5],_[E-3],_[E-1]]));break;case 183:this.$=$r(dn(_[E-1]),_[E]);break;case 184:this.$=$r("bound",[Lb(_[E-1])]);break;case 185:this.$=$r(_[E-1],[]);break;case 186:this.$=$r(_[E-3],[_[E-1]]);break;case 187:this.$=$r(_[E-2]?"notexists":"exists",[kb(_[E])]);break;case 188:case 189:this.$=Qc(_[E-1],{type:"aggregate",aggregation:dn(_[E-4]),distinct:!!_[E-2]});break;case 190:this.$=Qc(_[E-2],{type:"aggregate",aggregation:dn(_[E-5]),distinct:!!_[E-3],separator:typeof _[E-1]=="string"?_[E-1]:" "});break;case 192:this.$=hs(_[E]);break;case 193:this.$=r9(_[E-1],dn(_[E].substr(1)));break;case 194:this.$=hs(_[E-2],_[E]);break;case 195:case 204:this.$=hs(_[E],VI);break;case 196:case 205:this.$=hs(_[E],qI);break;case 197:case 206:this.$=hs(dn(_[E]),GI);break;case 200:this.$=hs(_[E].toLowerCase(),t9);break;case 201:this.$=hs(_[E].substr(1),VI);break;case 202:this.$=hs(_[E].substr(1),qI);break;case 203:this.$=hs(_[E].substr(1).toLowerCase(),GI);break;case 207:case 208:this.$=KI(_[E],1);break;case 209:case 210:this.$=KI(_[E],3);break;case 211:this.$=Qe.factory.namedNode(sf(_[E]));break;case 213:var Bh=_[E].indexOf(":"),lf=_[E].substr(0,Bh),Vh=Qe.prefixes[lf];if(!Vh)throw new Error("Unknown prefix: "+lf);var Gt=sf(Vh+_[E].substr(Bh+1));this.$=Qe.factory.namedNode(Gt);break;case 214:if(_[E]=_[E].substr(0,_[E].length-1),!(_[E]in Qe.prefixes))throw new Error("Unknown prefix: "+_[E]);var Gt=sf(Qe.prefixes[_[E]]);this.$=Qe.factory.namedNode(Gt);break;case 215:this.$=of(_[E].replace(/^(_:)/,""));break;case 216:this.$=of();break;case 217:case 218:case 232:this.$=af(Mb(_[E-3],_[E-2],_[E-1]));break;case 230:case 231:this.$=af(_[E-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:_[E-1].push(_[E]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[_[E]];break;case 308:_[E-3].push(_[E-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:_[E-2].push(_[E-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:o},{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:d,33:35,39:[1,37],44:39,55:40,87:h,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(g,[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:y,87:h},n(b,[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(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:v,29:I,52:84,53:A,56:85},{19:88,28:v,29:I,52:89,53:A,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:A},n(T,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(R,[2,263],{34:96}),n(R,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(R,[2,262]),n(B,[2,259]),n(L,[2,143]),n(L,[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(P,[2,211]),n(P,[2,212]),n(P,[2,213]),n(P,[2,214]),{19:98,28:v,29:I,52:99,53:A,56:85},{6:[2,309],99:100,193:[1,101]},n(M,[2,311],{101:102,328:[1,103]}),n(O,[2,317],{104:104,328:[1,105]}),n(Y,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:oe,114:110},{29:oe,114:112},{29:oe,114:113},{118:114,123:[1,115],125:116,126:Q},n(be,[2,315]),n(be,[2,316]),n(le,[2,319]),n(le,[2,320]),n(le,[2,321]),n(g,[2,327]),{13:f,16:d,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:y,87:h}),n(ue,[2,269]),n(ue,[2,15]),{13:f,16:d,44:136,45:k,46:120,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(me,[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:d,45:[1,193],55:194,197:At,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(S,[2,419]),n(Ot,ze,{20:196,59:197,69:198,70:ne}),n(l,[2,250]),{29:ie,57:200},n(M,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(ae,fe,{23:204,58:205,62:206,63:We}),n(l,[2,252]),{19:208,28:v,29:I,52:209,53:A,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,145:212,172:221,185:213,187:214,231:Mr,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(fI,[2,265],{56:85,35:227,52:228,19:229,28:v,29:I,53:A}),n(B,[2,260]),n(ae,fe,{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:d,55:232,307:43,308:p},n(M,[2,312]),{105:233,112:dI,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(O,[2,318]),n(M,hI,{108:240,133:242,112:pI,132:mI}),n(Y,[2,323]),{112:[1,244]},{112:[2,325]},n(jr,[2,50]),n(T,Eh,{135:245,136:246,143:247,144:248,31:gI,112:gI}),n(jr,[2,51]),n(jr,[2,52]),n(Wo,[2,328],{119:249}),{29:oe,114:250},n(Wo,[2,56]),{29:oe,114:251},n(g,[2,59]),n(ue,[2,270]),{47:[1,252]},n(yI,[2,150]),n(Th,[2,428],{240:253}),n(Gc,[2,430],{244:254}),n(Gc,[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(Wc,[2,440],{252:264}),n(Tr,[2,448],{260:265}),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Tr,[2,167]),n(Tr,[2,168]),n(Tr,[2,169]),n(Tr,[2,170],{176:269,45:bI,89:_I}),n(Tr,[2,171]),n(Tr,[2,172]),n(Tr,[2,173]),n(Tr,[2,174]),{13:f,16:d,44:136,45:k,46:272,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:SI,89:wI,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(fn,[2,192],{292:[1,286],293:[1,287]}),n(fn,[2,195]),n(fn,[2,196]),n(fn,[2,197]),n(fn,[2,198]),n(fn,[2,199]),n(fn,[2,200]),{13:f,16:d,44:39,55:40,82:G,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(ef,[2,452]),n(ef,[2,453]),n(ef,[2,454]),n(ef,[2,455]),n(ef,[2,456]),{279:[2,458]},n(Ah,[2,207]),n(Ah,[2,208]),n(Ah,[2,209]),n(Ah,[2,210]),n(fn,[2,201]),n(fn,[2,202]),n(fn,[2,203]),n(fn,[2,204]),n(fn,[2,205]),n(fn,[2,206]),n(e,[2,5]),n(Ih,[2,297],{88:295}),n(xh,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Rh,[2,301]),n(me,[2,43]),n(me,[2,82]),n(me,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n($a,[2,123]),n($a,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(fs,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:At,223:312,225:308,226:309,229:vI,307:43,308:p},n(c,i,{215:10,214:314}),n(fs,[2,236]),n(fs,[2,237]),n(Hc,[2,6]),n(Ib,[2,287],{60:315,72:316,73:[1,317]}),n(Ot,[2,286]),{13:f,16:d,45:k,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n([6,31,63,70,73,81,83,85],[2,20]),n(T,EI,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Hs,31:Hs,85:Hs,112:Hs,159:Hs,160:Hs,161:Hs,163:Hs,164:Hs,41:s}),{13:f,16:d,55:331,307:43,308:p},n(M,[2,280]),n(Hc,[2,7]),n(Ot,ze,{59:197,69:198,20:332,70:ne}),n(ae,[2,284]),{64:[1,333]},n(ae,fe,{58:205,62:206,23:334,63:We}),n(l,[2,254]),n(T,Eh,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:h,139:342,186:339,190:340,195:341,197:Ua,307:43,308:p},n(tf,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:h,197:Ua,308:p}),n(zs,[2,227]),n(zs,[2,228]),n(zs,[2,229]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,172:221,185:351,187:350,200:348,230:347,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:Ua,307:43,308:p},n(zs,[2,146]),n(zs,[2,147]),n(zs,[2,148]),n(zs,[2,149]),{13:f,16:d,44:354,55:355,82:G,87:h,172:357,237:356,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:358,312:un,313:353},n(xb,[2,215]),n(xb,[2,216]),n(ae,fe,{58:205,62:206,23:359,63:We}),n(R,[2,264]),n(fI,[2,266]),n(Hc,[2,11]),n(r,[2,308],{6:[2,310]}),n(jr,[2,313],{102:360,120:361,121:[1,362]}),n(jr,[2,47]),n(jr,[2,63]),n(jr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(jr,[2,336]),n(jr,[2,337]),n(jr,[2,338]),{109:[1,364]},n(TI,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(M,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(Ba,[2,341],{137:368}),n(Ba,[2,340]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,145:369,172:221,185:213,187:214,231:Mr,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},{28:[1,370],127:371,128:[1,372]},n(Wo,[2,330],{124:373,125:374,126:Q}),n(Wo,[2,57]),{44:375,87:h},n(yI,[2,151],{241:376,242:[1,377]}),n(Th,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,247:380,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{250:[1,381]},n(sr,[2,432]),n(sr,[2,433]),n(sr,[2,434]),n(sr,[2,435]),n(sr,[2,436]),n(sr,[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:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De}),n(Wc,[2,162],{261:388,262:389,39:Rb,338:Cb}),n(Tr,[2,164]),n(Tr,[2,165]),n(Tr,[2,166]),n(ir,[2,95]),n(ir,[2,96]),n(sr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(ir,[2,177]),{13:f,16:d,44:136,45:k,46:395,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:396,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:397,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:398,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:399,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,183]),n(ir,[2,98]),n(sr,[2,381],{180:400}),{87:[1,401]},n(ir,[2,185]),{13:f,16:d,44:136,45:k,46:402,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{29:ie,57:403},n(fn,[2,193]),{13:f,16:d,55:404,307:43,308:p},{13:f,16:d,44:39,55:40,87:h,139:342,195:405,197:Ua,307:43,308:p},n(Ho,[2,233]),n(Ho,[2,234]),n(Ho,[2,235]),n(AI,[2,459],{281:406,325:[1,407]}),n(sr,[2,463],{284:408,325:[1,409]}),n(sr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:G,171:413,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,419],89:[1,420]},{29:[1,421]},n(Rh,[2,302]),n(Ih,[2,367],{167:422}),n(xh,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Rh,[2,371]),n($a,[2,122]),n($a,[2,417]),n($a,[2,413]),n($a,[2,414]),n($a,[2,415]),n(fs,[2,125]),n(fs,[2,127]),n(fs,[2,128]),n(II,[2,420],{227:426}),n(fs,[2,130]),{13:f,16:d,55:194,197:At,223:427,307:43,308:p},{48:[1,428]},n(zo,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(Ib,[2,288]),{64:[1,433]},n(Ot,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:k,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(xI,[2,293]),n(Ob,[2,92]),n(Ob,[2,93]),n(Ob,[2,94]),{45:bI,89:_I,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:v,29:I,56:85},{19:438,28:v,29:I,56:85},n(Va,[2,355],{149:439}),n(Va,[2,354]),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,156:440,172:221,185:441,203:442,231:Fh,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(R,[2,19]),n(zo,[2,21]),{13:f,16:d,44:450,45:RI,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Hc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(T,[2,386],{31:[2,388]}),n(tf,[2,102]),n(qa,[2,391],{191:452}),n(T,[2,395],{196:453,198:454}),n(T,[2,108]),n(T,[2,109]),n(tf,[2,103]),n(tf,[2,104]),n(tf,[2,390]),{13:f,16:d,44:215,45:lt,48:[1,455],55:220,82:G,87:h,89:ut,172:221,185:351,187:350,200:456,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(Dh,[2,424]),n(CI,[2,136]),n(CI,[2,137]),n(Pb,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:Ua,307:43,308:p},n(Ho,[2,219]),n(Ho,[2,220]),n(Ho,[2,221]),n(Ho,[2,222]),n(Ho,[2,223]),n(Hc,[2,10]),n(jr,[2,46]),n(jr,[2,314]),{112:dI,122:459},n(jr,[2,62]),n(M,hI,{133:242,108:460,112:pI,132:mI}),n(TI,[2,61]),n(jr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(Ba,[2,351],{146:463,335:[1,464]}),{29:ie,57:465},n(Wo,[2,329]),n(M,[2,332],{129:466,327:[1,467]}),n(Wo,[2,55]),n(Wo,[2,331]),{48:[1,468]},n(Th,[2,429]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Gc,[2,431]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,243:470,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Gc,[2,156]),{45:SI,89:wI,179:471},n(Wc,[2,441]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,251:472,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Tr,[2,444],{256:473}),n(Tr,[2,446],{258:474}),n(sr,[2,442]),n(sr,[2,443]),n(Tr,[2,449]),{13:f,16:d,44:136,45:k,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,255:154,257:155,259:475,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,450]),n(sr,[2,451]),n(sr,[2,379],{178:476}),n(sr,[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:d,44:136,45:k,46:482,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{48:[1,483]},{48:[1,484]},n(ir,[2,187]),n(fn,[2,194]),{13:f,16:d,44:39,55:40,82:G,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,320:485},{13:f,16:d,39:[1,487],44:136,45:k,46:488,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,282:486,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(AI,[2,460]),{13:f,16:d,44:136,45:k,46:489,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,464]),{13:f,16:d,44:136,45:k,46:490,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(sr,[2,466]),n(me,[2,40]),n(Ih,[2,298]),n(rf,[2,87]),n(rf,[2,88]),n(rf,[2,89]),n(rf,[2,90]),{13:f,16:d,55:492,82:G,172:493,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,311:494,312:un,315:491},n(me,[2,41]),n(xh,[2,300]),n(nf,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:G,171:497,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,498],89:[1,499]},{29:[1,500]},n(Rh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:At,223:312,226:502,228:501,229:vI,307:43,308:p},n(fs,[2,131]),n(fs,[2,126]),n(zo,[2,22]),n(zo,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:k,55:323,67:321,68:322,74:505,75:506,76:OI,77:320,78:PI,79:509,87:h,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(xI,[2,294]),n(FI,[2,69]),n(FI,[2,70]),n(Ot,ze,{59:197,69:198,20:511,70:ne}),n(ae,fe,{58:205,62:206,23:512,63:We}),{29:[2,375],31:[2,71],84:522,85:o,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(Va,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:h}),n(Lh,[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:h}),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,172:221,185:351,203:536,212:534,231:Fh,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(ae,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:RI,87:h,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(Ga,[2,291]),n(Ga,[2,24]),n(Ga,[2,25]),{13:f,16:d,44:136,45:k,46:539,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Ga,[2,28]),n(ae,fe,{58:205,62:206,23:540,63:We}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(qa,[2,107]),{13:f,16:d,44:215,45:lt,55:220,82:G,87:h,89:ut,172:221,185:351,187:350,199:543,200:544,231:Mr,234:349,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(DI,[2,132]),n(Dh,[2,425]),n(DI,[2,133]),{13:f,16:d,44:354,55:355,82:G,87:h,172:357,237:356,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:358,312:un,313:545},n(jr,[2,54]),n(jr,[2,48]),n(Ba,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(Ba,[2,68]),n(T,[2,350],{31:LI,112:LI}),n(jr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(M,[2,333]),n(ue,[2,16]),n(Th,[2,152]),n(Gc,[2,154]),n(Gc,[2,157]),n(Wc,[2,159]),n(Wc,[2,160],{262:389,261:548,39:Rb,338:Cb}),n(Wc,[2,161],{262:389,261:549,39:Rb,338:Cb}),n(Tr,[2,163]),{13:f,16:d,44:136,45:k,46:550,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,178]),n(ir,[2,179]),{13:f,16:d,44:136,45:k,46:551,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:552,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:553,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{48:[1,554],272:[1,555]},n(ir,[2,184]),n(ir,[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:d,55:194,197:At,223:562,307:43,308:p},n(Fb,[2,224]),n(Fb,[2,225]),n(Fb,[2,226]),{31:[1,563],45:NI,94:564},n(me,[2,84]),n(Ih,[2,368]),n(me,[2,85]),n(xh,[2,370]),n(nf,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(zo,[2,35],{83:[1,569]}),n(zo,[2,36],{81:[1,570]}),n(Ib,[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:d,45:k,76:OI,78:PI,87:h,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,276:re,277:pe,279:xe,280:ye,283:_e,285:W,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U}),n(zc,[2,295]),{45:k,77:572},{45:k,77:573},n(zc,[2,33]),n(zc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(Va,[2,356]),n(kI,[2,357],{152:578,335:[1,579]}),n(Ks,[2,74]),{29:ie,57:580},{29:ie,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(MI,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:k,55:323,67:321,68:322,77:320,79:585,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,307:43,308:p,346:Ze,347:Je,348:x,349:C,350:F,351:U},{45:[1,586]},n(Ks,[2,81]),{29:ie,57:587},n(Va,[2,73]),n(T,[2,362],{29:Qs,31:Qs,85:Qs,112:Qs,159:Qs,160:Qs,161:Qs,163:Qs,164:Qs}),n(Lh,[2,112]),n(Kc,[2,401],{206:588}),n(T,[2,405],{209:589,210:590}),n(T,[2,403]),n(T,[2,404]),n(Lh,[2,113]),n(Lh,[2,400]),{13:f,16:d,44:215,45:Ph,48:[1,591],55:220,82:G,87:h,89:ut,172:221,185:351,203:536,212:592,231:Fh,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(Dh,[2,426]),n(Pb,[2,138]),n(Pb,[2,139]),{232:[1,593]},n(Ga,[2,292]),{47:[1,595],48:[1,594]},n(Hc,[2,9]),n(qa,[2,392]),n(qa,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:Ua,308:p}),n(qa,[2,110],{272:[1,598]}),n(Nh,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(Wo,[2,58]),n(Tr,[2,445]),n(Tr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(ir,[2,99]),n(sr,[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(ir,[2,188]),n(ir,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:G,172:493,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,311:494,312:un,315:611},n(me,[2,42]),n(nf,[2,304]),{13:f,16:d,55:414,82:G,95:612,171:613,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},{31:[1,614],45:NI,94:615},n(fs,[2,129]),n(II,[2,421]),{82:[1,616]},{82:[1,617]},n(zc,[2,296]),n(zc,[2,31]),n(zc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(T,EI,{155:330,153:618,154:619,29:Ys,31:Ys,85:Ys,112:Ys,159:Ys,160:Ys,161:Ys,163:Ys,164:Ys}),n(kI,[2,358]),n(Ks,[2,75]),n(Ks,[2,76]),{29:ie,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(MI,[2,366]),n(Ks,[2,79]),{13:f,16:d,44:136,45:k,46:622,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(Ks,[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(Kc,[2,117]),{13:f,16:d,44:215,45:Ph,55:220,82:G,87:h,89:ut,172:221,185:351,203:536,211:626,212:627,231:Fh,234:535,236:216,237:222,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,309:On,310:Qn,311:217,312:un},n(zs,[2,134]),n(Dh,[2,427]),n(zs,[2,135]),n(Ga,[2,26]),{44:628,87:h},n(qa,[2,106]),n(qa,[2,394]),n(T,[2,396]),n(Nh,[2,111]),n(Nh,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:Ua,307:43,308:p},n(xb,[2,217]),n(T,Eh,{144:248,140:630,143:631,31:[2,343]}),n(ir,[2,97]),n(sr,[2,380]),n(ir,[2,180]),{13:f,16:d,44:136,45:k,46:632,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},{13:f,16:d,44:136,45:k,46:633,55:133,67:132,68:134,77:131,82:G,87:h,172:135,224:je,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:X,264:130,265:q,266:137,267:139,268:te,269:Z,270:ge,271:$e,273:Ve,274:j,275:146,276:re,277:pe,278:149,279:xe,280:ye,283:_e,285:W,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:at,346:Ze,347:Je,348:x,349:C,350:F,351:U},n(ir,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:G,171:637,172:415,173:416,174:Ch,255:154,257:155,291:150,294:J,295:ee,296:de,297:Te,298:Ae,299:Pe,300:Ce,301:Fe,302:De,303:Le,304:Ne,305:Ie,306:ke,307:43,308:p,312:Oh},n(jI,[2,305]),n(me,[2,86]),n(nf,[2,374]),n(zo,[2,37]),n(zo,[2,38]),n(Va,[2,72]),n(Va,[2,360]),n(Ks,[2,77]),{29:ie,57:638},{47:[1,639]},{29:[2,376]},n(Kc,[2,402]),n(Kc,[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:h}),n(Kc,[2,118],{272:[1,641]}),n(kh,[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:Le,304:Ne,305:Ie,306:ke},n(rf,[2,218]),n(nf,[2,44]),n(jI,[2,306]),n(Ks,[2,78]),{44:651,87:h},n(Kc,[2,116]),n(T,[2,406]),n(kh,[2,119]),n(kh,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(Ga,[2,27]),n(Nh,[2,230]),n($I,[2,345],{141:653,335:[1,654]}),n(ir,[2,181]),n(ir,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(T,Eh,{144:248,142:657,143:658,31:UI,112:UI}),n($I,[2,346]),n(Ks,[2,80]),n(kh,[2,231]),n(Ba,[2,67]),n(Ba,[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:a(function(D,$){if($.recoverable)this.trace(D);else{var H=new Error(D);throw H.hash=$,H}},"parseError"),parse:a(function(D){var $=this,H=[0],we=[],He=[null],_=[],hn=this.table,E="",ps=0,cf=0,Uh=0,Bh=2,lf=1,Vh=_.slice.call(arguments,1),Gt=Object.create(this.lexer),ms={yy:{}};for(var uf in this.yy)Object.prototype.hasOwnProperty.call(this.yy,uf)&&(ms.yy[uf]=this.yy[uf]);Gt.setInput(D,ms.yy),ms.yy.lexer=Gt,ms.yy.parser=this,typeof Gt.yylloc>"u"&&(Gt.yylloc={});var Zc=Gt.yylloc;_.push(Zc);var It=Gt.options&&Gt.options.ranges;typeof ms.yy.parseError=="function"?this.parseError=ms.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(gs){H.length=H.length-2*gs,He.length=He.length-gs,_.length=_.length-gs}a(Mt,"popStack");for(var ft=a(function(){var gs;return gs=Gt.lex()||lf,typeof gs!="number"&&(gs=$.symbols_[gs]||gs),gs},"lex"),bt,Pn,Ka,ci,hae,Wb,el={},qh,Zs,JI,Gh;;){if(Ka=H[H.length-1],this.defaultActions[Ka]?ci=this.defaultActions[Ka]:((bt===null||typeof bt>"u")&&(bt=ft()),ci=hn[Ka]&&hn[Ka][bt]),typeof ci>"u"||!ci.length||!ci[0]){var Hb="";Gh=[];for(qh in hn[Ka])this.terminals_[qh]&&qh>Bh&&Gh.push("'"+this.terminals_[qh]+"'");Gt.showPosition?Hb="Parse error on line "+(ps+1)+`:
|
|
34
34
|
`+Gt.showPosition()+`
|
|
35
35
|
Expecting `+Gh.join(", ")+", got '"+(this.terminals_[bt]||bt)+"'":Hb="Parse error on line "+(ps+1)+": Unexpected "+(bt==lf?"end of input":"'"+(this.terminals_[bt]||bt)+"'"),this.parseError(Hb,{text:Gt.match,token:this.terminals_[bt]||bt,line:Gt.yylineno,loc:Zc,expected:Gh})}if(ci[0]instanceof Array&&ci.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ka+", token: "+bt);switch(ci[0]){case 1:H.push(bt),He.push(Gt.yytext),_.push(Gt.yylloc),H.push(ci[1]),bt=null,Pn?(bt=Pn,Pn=null):(cf=Gt.yyleng,E=Gt.yytext,ps=Gt.yylineno,Zc=Gt.yylloc,Uh>0&&Uh--);break;case 2:if(Zs=this.productions_[ci[1]][1],el.$=He[He.length-Zs],el._$={first_line:_[_.length-(Zs||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(Zs||1)].first_column,last_column:_[_.length-1].last_column},It&&(el._$.range=[_[_.length-(Zs||1)].range[0],_[_.length-1].range[1]]),Wb=this.performAction.apply(el,[E,cf,ps,ms.yy,ci[1],He,_].concat(Vh)),typeof Wb<"u")return Wb;Zs&&(H=H.slice(0,-1*Zs*2),He=He.slice(0,-1*Zs),_=_.slice(0,-1*Zs)),H.push(this.productions_[ci[1]][0]),He.push(el.$),_.push(el._$),JI=hn[H[H.length-2]][H[H.length-1]],H.push(JI);break;case 3:return!0}}return!0},"parse")},Mh=BS().Wildcard,jh="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Jj=jh+"type",Zj=jh+"first",e9=jh+"rest",BI=jh+"nil",$h="http://www.w3.org/2001/XMLSchema#",VI=$h+"integer",qI=$h+"decimal",GI=$h+"double",t9=$h+"boolean",Wa="",WI="",HI="";function dn(N){return N.toLowerCase()}a(dn,"lowercase");function Xs(N,D){return N.push(D),N}a(Xs,"appendTo");function Ha(N,D){return N.push.apply(N,D),N}a(Ha,"appendAllTo");function Jt(N){N||(N={});for(var D=1,$=arguments.length,H;D<$&&(H=arguments[D]||{});D++)for(var we in H)N[we]=H[we];return N}a(Jt,"extend");function ds(){for(var N=[],D=0,$=arguments.length;D<$;D++)N=N.concat.apply(N,arguments[D]);return N}a(ds,"unionAll");function sf(N){if(N[0]==="<"&&(N=N.substring(1,N.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(N))return N;if(!Qe.base)throw new Error("Cannot resolve relative IRI "+N+" because no base IRI was set.");switch(Wa!==Qe.base&&(Wa=Qe.base,WI=Wa.replace(/[^\/:]*$/,""),HI=Wa.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),N[0]){case void 0:return Wa;case"#":return Wa+N;case"?":return Wa.replace(/(?:\?.*)?$/,N);case"/":return HI+N;default:return WI+N}}a(sf,"resolveIRI");function Lb(N){if(N){var D=N[0];if(D==="?"||D==="$")return Qe.factory.variable(N.substr(1))}return N}a(Lb,"toVar");function $r(N,D){return{type:"operation",operator:N,args:D||[]}}a($r,"operation");function Qc(N,D){var $={expression:N==="*"?new Mh:N};if(D)for(var H in D)$[H]=D[H];return $}a(Qc,"expression");function Yc(N,D){return{type:"path",pathType:N,items:D}}a(Yc,"path");function Nb(N,D){for(var $=0,H=D.length,we;$<H&&(we=D[$]);$++)N=$r(we[0],[N,we[1]]);return N}a(Nb,"createOperationTree");function za(N,D){var $=[],H=[],we=N.length,He,_={};if(!we)return null;for(var hn=0;hn<we&&(He=N[hn]);hn++)(He.named?H:$).push(He.iri);return _[D||"from"]={default:$,named:H},_}a(za,"groupDatasets");function Xc(N){return parseInt(N,10)}a(Xc,"toInt");function kb(N){return N.type==="group"&&N.patterns.length===1?N.patterns[0]:N}a(kb,"degroupSingle");function hs(N,D){return D&&D.termType!=="NamedNode"&&(D=Qe.factory.namedNode(D)),Qe.factory.literal(N,D)}a(hs,"createTypedLiteral");function r9(N,D){return Qe.factory.literal(N,D)}a(r9,"createLangLiteral");function Mb(N,D,$){if(!("termType"in D))throw new Error("Nested triples cannot contain paths");return Qe.factory.quad(N,D,$)}a(Mb,"nestedTriple");function Js(N,D,$,H){var we={};return N!=null&&(we.subject=N),D!=null&&(we.predicate=D),$!=null&&(we.object=$),H!=null&&(we.annotations=H),we}a(Js,"triple");function of(N){return typeof N=="string"?N.startsWith("e_")?Qe.factory.blankNode(N):Qe.factory.blankNode("e_"+N):Qe.factory.blankNode("g_"+zI++)}a(of,"blank");var zI=0;Qe._resetBlanks=function(){zI=0};var n9=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,i9={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
|
|
36
36
|
`,r:"\r",f:"\f"},s9=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,jb=String.fromCharCode;function KI(N,D){N=N.substring(D,N.length-D);try{N=N.replace(n9,function($,H,we,He){var _;if(H){if(_=parseInt(H,16),isNaN(_))throw new Error;return jb(_)}else if(we){if(_=parseInt(we,16),isNaN(_))throw new Error;return _<65535?jb(_):jb(55296+((_-=65536)>>10),56320+(_&1023))}else{var hn=i9[He];if(!hn)throw new Error;return hn}})}catch{return""}if(s9.exec(N))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+N);return N}a(KI,"unescapeString");function o9(N){var D=of(),$=D,H=[],we,He=[];N.forEach(function(ps){H.push(ps.entity),Ha(He,ps.triples)});for(var _=0,hn=0,E=H.length,we=Array(E*2);_<E;)we[hn++]=Js($,Qe.factory.namedNode(Zj),H[_]),we[hn++]=Js($,Qe.factory.namedNode(e9),$=++_<E?of():Qe.factory.namedNode(BI));return{entity:D,triples:Ha(we,He)}}a(o9,"createList");function a9(N){var D=of();return{entity:D,triples:N.map(function($){return Jt(Js(D),$)})}}a(a9,"createAnonymousObject");function $b(N,D,$){var H=[],we=[];return D.forEach(function(He){let _=null;He.annotation&&(_=He.annotation,He=He.object),H.push(Js(null,N,He.entity,_)),Ha(we,He.triples)}),ds(H,$||[],we)}a($b,"objectListToTriples");function fae(N){for(var D=[],$,H=0,we;we=N[H];H++)switch(we.type){case"bgp":we.triples.length&&($?Ha($.triples,we.triples):Xs(D,$=we));break;default:(!we.patterns||we.patterns.length>0)&&(Xs(D,we),$=null)}return D}a(fae,"mergeAdjacentBGPs");function Jc(N){return N.variable?N.variable.value:N.value||N.expression.value}a(Jc,"getExpressionId");function Ub(N){if(!N)return[];if(N.type==="aggregate")return[N];if(N.type==="operation"){let D=[];for(let $ of N.args)D.push(...Ub($));return D}return[]}a(Ub,"getAggregatesOfExpression");function c9(N){let D=new Set,$=a(function(H){H&&(H.termType==="Variable"?D.add(H):H.type==="operation"&&H.args.forEach($))},"visitExpression");return $(N),D}a(c9,"getVariablesFromExpression");function Bb(N,D=1,$=[]){for(let H of N)D>0&&H instanceof Array?Bb(H,D-1,$):$.push(H);return $}a(Bb,"flatten");function Vb(N){return N.termType==="Variable"}a(Vb,"isVariable");function QI(N){if(N.triples){let D=[];for(let $ of N.triples)Vb($.subject)&&D.push($.subject.value),Vb($.predicate)&&D.push($.predicate.value),Vb($.object)&&D.push($.object.value);return D}else if(N.patterns){let D=[];for(let $ of N.patterns)D.push(...QI($));return D}return[]}a(QI,"getBoundVarsFromGroupGraphPattern");function l9(N){let D=N.slice().sort(),$=[];for(let H=0;H<D.length-1;H++)D[H+1]==D[H]&&$.push(D[H]);return $}a(l9,"getDuplicatesInArray");function af(N){if(!Qe.sparqlStar)throw new Error("SPARQL-star support is not enabled");return N}a(af,"ensureSparqlStar");function YI(N,D,$){for(let H of D){let we=Js("subject"in H?H.subject:N,H.predicate,H.object);$.push(we),H.annotations&&YI(Mb(N,H.predicate,H.object),H.annotations,$)}}a(YI,"_applyAnnotations");function qb(N){if(Qe.sparqlStar){let D=[];return N.forEach($=>{let H=Js($.subject,$.predicate,$.object);D.push(H),$.annotations&&YI(Mb($.subject,$.predicate,$.object),$.annotations,D)}),D}return N}a(qb,"applyAnnotations");function dae(N){if(!Qe.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return N}a(dae,"ensureSparqlStarNestedQuads");function XI(N){for(let D of N){if(D.type==="graph"&&D.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(D.type==="bgp"||D.type==="graph"){for(let $ of D.triples)if($.subject.termType==="Variable"||$.predicate.termType==="Variable"||$.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return N}a(XI,"ensureNoVariables");function Gb(N){for(let D of N)if(D.type==="bgp"){for(let $ of D.triples)if($.subject.termType==="BlankNode"||$.predicate.termType==="BlankNode"||$.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return N}a(Gb,"ensureNoBnodes");var u9=(function(){var N={EOF:1,parseError:a(function($,H){if(this.yy.parser)this.yy.parser.parseError($,H);else throw new Error($)},"parseError"),setInput:a(function(D,$){return this.yy=$||this.yy||{},this._input=D,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:a(function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var $=D.match(/(?:\r\n?|\n).*/g);return $?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),D},"input"),unput:a(function(D){var $=D.length,H=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$),this.offset-=$;var we=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),H.length-1&&(this.yylineno-=H.length-1);var He=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:H?(H.length===we.length?this.yylloc.first_column:0)+we[we.length-H.length].length-H[0].length:this.yylloc.first_column-$},this.options.ranges&&(this.yylloc.range=[He[0],He[0]+this.yyleng-$]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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).
|
|
37
37
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(D){this.unput(this.match.slice(D))},"less"),pastInput:a(function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var D=this.match;return D.length<20&&(D+=this._input.substr(0,20-D.length)),(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var D=this.pastInput(),$=new Array(D.length+1).join("-");return D+this.upcomingInput()+`
|
|
38
38
|
`+$+"^"},"showPosition"),test_match:a(function(D,$){var H,we,He;if(this.options.backtrack_lexer&&(He={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&&(He.yylloc.range=this.yylloc.range.slice(0))),we=D[0].match(/(?:\r\n?|\n).*/g),we&&(this.yylineno+=we.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:we?we[we.length-1].length-we[we.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,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(D[0].length),this.matched+=D[0],H=this.performAction.call(this,this.yy,this,$,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),H)return H;if(this._backtrack){for(var _ in He)this[_]=He[_];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var D,$,H,we;this._more||(this.yytext="",this.match="");for(var He=this._currentRules(),_=0;_<He.length;_++)if(H=this._input.match(this.rules[He[_]]),H&&(!$||H[0].length>$[0].length)){if($=H,we=_,this.options.backtrack_lexer){if(D=this.test_match(H,He[_]),D!==!1)return D;if(this._backtrack){$=!1;continue}else return!1}else if(!this.options.flex)break}return $?(D=this.test_match($,He[we]),D!==!1?D:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
39
39
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var $=this.next();return $||this.lex()},"lex"),begin:a(function($){this.conditionStack.push($)},"begin"),popState:a(function(){var $=this.conditionStack.length-1;return $>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},"topState"),pushState:a(function($){this.begin($)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function($,H,we,He){var _=He;switch(we){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(H.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 N})();Db.lexer=u9;function Qe(){this.yy={}}return a(Qe,"Parser"),Qe.prototype=Db,Db.Parser=Qe,new Qe})();kR.exports=k7});var BR=w((tfe,UR)=>{var M7="http://www.w3.org/2001/XMLSchema#integer",j7="http://www.w3.org/2001/XMLSchema#string";function Pt(n){this._options=n=n||{};var e=n.prefixes||{};this._prefixByIri={};var t=[];for(var r in e){var i=e[r];Df(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=Df(n.indent)?n.indent:" ",this._newline=Df(n.newline)?n.newline:`
|
|
40
|
-
`,this._explicitDatatype=!!n.explicitDatatype}a(Pt,"Generator");Pt.prototype.toQuery=function(n){var e="";return n.queryType&&(e+=n.queryType.toUpperCase()+" "),n.reduced&&(e+="REDUCED "),n.distinct&&(e+="DISTINCT "),n.variables?e+=Yn(n.variables,void 0,function(t){return/^[?$]/.test(t)?t:ea(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Up(t.variable)+")"},this)+" ":n.template&&(e+=this.group(n.template,!0)+this._newline),n.from&&(e+=this.graphs("FROM ",n.from.default)+this.graphs("FROM NAMED ",n.from.named)),n.where&&(e+="WHERE "+this.group(n.where,!0)+this._newline),n.updates&&(e+=Yn(n.updates,";"+this._newline,this.toUpdate,this)),n.group&&(e+="GROUP BY "+Yn(n.group,void 0,function(t){var r=ea(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+r+" AS "+Up(t.variable)+")":r},this)+this._newline),n.having&&(e+="HAVING ("+Yn(n.having,void 0,this.toExpression,this)+")"+this._newline),n.order&&(e+="ORDER BY "+Yn(n.order,void 0,function(t){var r="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+r:r},this)+this._newline),n.offset&&(e+="OFFSET "+n.offset+this._newline),n.limit&&(e+="LIMIT "+n.limit+this._newline),n.values&&(e+=this.values(n)),e=this.baseAndPrefixes(n)+e,e.trim()};Pt.prototype.baseAndPrefixes=function(n){var e=n.base?"BASE <"+n.base+">"+this._newline:"",t="";for(var r in n.prefixes)(this._options.allPrefixes||this._usedPrefixes[r])&&(t+="PREFIX "+r+": <"+n.prefixes[r]+">"+this._newline);return e+t};Pt.prototype.toPattern=function(n){var e=n.type||n instanceof Array&&"array"||(n.subject&&n.predicate&&n.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](n)};Pt.prototype.triple=function(n){return this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+"."};Pt.prototype.array=function(n){return Yn(n,this._newline,this.toPattern,this)};Pt.prototype.bgp=function(n){return this.encodeTriples(n.triples)};Pt.prototype.encodeTriples=function(n){if(!n.length)return"";for(var e=[],t=void 0,r=void 0,i=0;i<n.length;i++){var s=n[i];nc(s.subject,t)?nc(s.predicate,r)?e.push(","):(r=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(r))):(t&&e.push("."+this._newline),t=s.subject,r=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(r))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Pt.prototype.graph=function(n){return"GRAPH "+this.toEntity(n.name)+" "+this.group(n)};Pt.prototype.graphs=function(n,e){return!e||e.length===0?"":Yn(e,"",function(t){return n+this.toEntity(t)+this._newline},this)};Pt.prototype.group=function(n,e){return n=e!==!0?this.array(n.patterns||n.triples):this.toPattern(n.type!=="group"?n:n.patterns),n.indexOf(this._newline)===-1?"{ "+n+" }":"{"+this._newline+this.indent(n)+this._newline+"}"};Pt.prototype.query=function(n){return this.toQuery(n)};Pt.prototype.filter=function(n){return"FILTER("+this.toExpression(n.expression)+")"};Pt.prototype.bind=function(n){return"BIND("+this.toExpression(n.expression)+" AS "+Up(n.variable)+")"};Pt.prototype.optional=function(n){return"OPTIONAL "+this.group(n)};Pt.prototype.union=function(n){return Yn(n.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Pt.prototype.minus=function(n){return"MINUS "+this.group(n)};Pt.prototype.values=function(n){var e=Object.keys(n.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,r;return e.length===1?t=r="":(t="(",r=")"),"VALUES "+t+e.join(" ")+r+" {"+this._newline+Yn(n.values,this._newline,function(i){return" "+t+Yn(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+r},this)+this._newline+"}"};Pt.prototype.service=function(n){return"SERVICE "+(n.silent?"SILENT ":"")+this.toEntity(n.name)+" "+this.group(n)};Pt.prototype.toExpression=function(n){if(ea(n))return this.toEntity(n);switch(n.type.toLowerCase()){case"aggregate":return n.aggregation.toUpperCase()+"("+(n.distinct?"DISTINCT ":"")+this.toExpression(n.expression)+(typeof n.separator=="string"?'; SEPARATOR = "'+n.separator.replace(jR,$R)+'"':"")+")";case"functioncall":return this.toEntity(n.function)+"("+Yn(n.args,", ",this.toExpression,this)+")";case"operation":var e=n.operator.toUpperCase(),t=n.args||[];switch(n.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(ea(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(ea(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(Df(t[1])?t[1]:Yn(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Yn(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+n.type)}};Pt.prototype.toEntity=function(n){if(ea(n))switch(n.termType){case"Wildcard":return"*";case"Variable":return Up(n);case"BlankNode":return"_:"+n.value;case"Literal":var e=n.value||"",t=n.language||"",r=n.datatype;if(n='"'+e.replace(jR,$R)+'"',t)n+="@"+t;else if(r){if(!this._explicitDatatype)switch(r.value){case j7:return n;case M7:if(/^\d+$/.test(e))return e+" "}n+="^^"+this.encodeIRI(r.value)}return n;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return n.graph&&n.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(n.graph)+" { "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" } >>":"<< "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" >>";default:return this.encodeIRI(n.value)}else{var i=n.items.map(this.toEntity,this),s=n.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var jR=/["\\\t\n\r\b\f]/g,$R=a(function(n){return $7[n]},"escapeReplacer"),$7={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Pt.prototype.encodeIRI=function(n){var e=this._prefixRegex.exec(n);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+n+">"};Pt.prototype.toUpdate=function(n){switch(n.type||n.updateType){case"load":return"LOAD"+(n.source?" "+this.toEntity(n.source):"")+(n.destination?" INTO GRAPH "+this.toEntity(n.destination):"");case"insert":return"INSERT DATA "+this.group(n.insert,!0);case"delete":return"DELETE DATA "+this.group(n.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(n.delete,!0);case"insertdelete":return(n.graph?"WITH "+this.toEntity(n.graph)+this._newline:"")+(n.delete.length?"DELETE "+this.group(n.delete,!0)+this._newline:"")+(n.insert.length?"INSERT "+this.group(n.insert,!0)+this._newline:"")+(n.using?this.graphs("USING ",n.using.default):"")+(n.using?this.graphs("USING NAMED ",n.using.named):"")+"WHERE "+this.group(n.where,!0);case"add":case"copy":case"move":return n.type.toUpperCase()+" "+(n.silent?"SILENT ":"")+(n.source.default?"DEFAULT":this.toEntity(n.source.name))+" TO "+this.toEntity(n.destination.name);case"create":case"clear":case"drop":return n.type.toUpperCase()+(n.silent?" SILENT ":" ")+(n.graph.default?"DEFAULT":n.graph.named?"NAMED":n.graph.all?"ALL":"GRAPH "+this.toEntity(n.graph.name));default:throw new Error("Unknown update query type: "+n.type)}};Pt.prototype.indent=function(n){return n.replace(/^/gm,this._indent)};function Up(n){return"?"+n.value}a(Up,"variableToString");function Df(n){return typeof n=="string"}a(Df,"isString");function ea(n){return typeof n.termType=="string"}a(ea,"isTerm");function nc(n,e){if(!n||!ea(n)||!e||!ea(e)||n.termType!==e.termType)return!1;switch(n.termType){case"Literal":return n.value===e.value&&n.language===e.language&&nc(n.datatype,e.datatype);case"Quad":return nc(n.subject,e.subject)&&nc(n.predicate,e.predicate)&&nc(n.object,e.object)&&nc(n.graph,e.graph);default:return n.value===e.value}}a(nc,"equalTerms");function Yn(n,e,t,r){return n.map(t,r).join(Df(e)?e:" ")}a(Yn,"mapJoin");function U7(n={}){return{stringify:a(function(e){var t=Object.create(n);return t.prefixes=e.prefixes,new Pt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Pt(n)},"createGenerator")}}a(U7,"_Generator");UR.exports={Generator:U7}});var qS=w(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.BlankNode=void 0;var VS=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};Bp.BlankNode=VS});var GS=w(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.DefaultGraph=void 0;var Lf=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Vp.DefaultGraph=Lf;Lf.INSTANCE=new Lf});var Gp=w(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.NamedNode=void 0;var WS=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};qp.NamedNode=WS});var HS=w(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Literal=void 0;var VR=Gp(),Nf=class n{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=n.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=n.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};Wp.Literal=Nf;Nf.RDF_LANGUAGE_STRING=new VR.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");Nf.XSD_STRING=new VR.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var KS=w(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Quad=void 0;var zS=class{static{a(this,"Quad")}constructor(e,t,r,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};Hp.Quad=zS});var YS=w(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.Variable=void 0;var QS=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};zp.Variable=QS});var GR=w(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.DataFactory=void 0;var B7=qS(),V7=GS(),qR=HS(),q7=Gp(),G7=KS(),W7=YS(),H7=0,XS=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${H7++}_`}namedNode(e){return new q7.NamedNode(e)}blankNode(e){return new B7.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new qR.Literal(e,t)}variable(e){return new W7.Variable(e)}defaultGraph(){return V7.DefaultGraph.INSTANCE}quad(e,t,r,i){return new G7.Quad(e,t,r,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(qR.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};Kp.DataFactory=XS});var WR=w(Xn=>{"use strict";var z7=Xn&&Xn.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ic=Xn&&Xn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&z7(e,n,t)};Object.defineProperty(Xn,"__esModule",{value:!0});ic(qS(),Xn);ic(GR(),Xn);ic(GS(),Xn);ic(HS(),Xn);ic(Gp(),Xn);ic(KS(),Xn);ic(YS(),Xn)});var zR=w((_fe,HR)=>{var{Parser:ao}=MR(),{Generator:K7}=BR(),{Wildcard:Q7}=BS(),{DataFactory:Y7}=WR();function X7({prefixes:n,baseIRI:e,factory:t,pathOnly:r,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in n??{})c[u]=n[u];let l=new ao;return l.parse=function(){return ao.base=e||"",ao.prefixes=Object.create(c),ao.factory=t||new Y7,ao.sparqlStar=!!i,ao.pathOnly=!!r,ao.skipValidation=!!s||!!o,ao.prototype.parse.apply(l,arguments)},l._resetBlanks=ao._resetBlanks,l}a(X7,"_Parser");HR.exports={Parser:X7,Generator:K7,Wildcard:Q7}});var ZS=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.CaseWhenTransformerError=ll.CaseWhenTransformer=void 0;var JS=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new co("Too many nested CASE expressions (max 100 iterations)");while(t!==r);return t}stripLineComments(e){let t="",r=0;for(;r<e.length;){let i=e[r];if(i==="'"||i==='"'){let s=i;for(t+=i,r++;r<e.length&&e[r]!==s;){if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++}r<e.length&&(t+=e[r],r++);continue}if(i==="<"){let s=e.indexOf(">",r),o=e.indexOf(`
|
|
40
|
+
`,this._explicitDatatype=!!n.explicitDatatype}a(Pt,"Generator");Pt.prototype.toQuery=function(n){var e="";return n.queryType&&(e+=n.queryType.toUpperCase()+" "),n.reduced&&(e+="REDUCED "),n.distinct&&(e+="DISTINCT "),n.variables?e+=Xn(n.variables,void 0,function(t){return/^[?$]/.test(t)?t:ea(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Up(t.variable)+")"},this)+" ":n.template&&(e+=this.group(n.template,!0)+this._newline),n.from&&(e+=this.graphs("FROM ",n.from.default)+this.graphs("FROM NAMED ",n.from.named)),n.where&&(e+="WHERE "+this.group(n.where,!0)+this._newline),n.updates&&(e+=Xn(n.updates,";"+this._newline,this.toUpdate,this)),n.group&&(e+="GROUP BY "+Xn(n.group,void 0,function(t){var r=ea(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+r+" AS "+Up(t.variable)+")":r},this)+this._newline),n.having&&(e+="HAVING ("+Xn(n.having,void 0,this.toExpression,this)+")"+this._newline),n.order&&(e+="ORDER BY "+Xn(n.order,void 0,function(t){var r="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+r:r},this)+this._newline),n.offset&&(e+="OFFSET "+n.offset+this._newline),n.limit&&(e+="LIMIT "+n.limit+this._newline),n.values&&(e+=this.values(n)),e=this.baseAndPrefixes(n)+e,e.trim()};Pt.prototype.baseAndPrefixes=function(n){var e=n.base?"BASE <"+n.base+">"+this._newline:"",t="";for(var r in n.prefixes)(this._options.allPrefixes||this._usedPrefixes[r])&&(t+="PREFIX "+r+": <"+n.prefixes[r]+">"+this._newline);return e+t};Pt.prototype.toPattern=function(n){var e=n.type||n instanceof Array&&"array"||(n.subject&&n.predicate&&n.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](n)};Pt.prototype.triple=function(n){return this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+"."};Pt.prototype.array=function(n){return Xn(n,this._newline,this.toPattern,this)};Pt.prototype.bgp=function(n){return this.encodeTriples(n.triples)};Pt.prototype.encodeTriples=function(n){if(!n.length)return"";for(var e=[],t=void 0,r=void 0,i=0;i<n.length;i++){var s=n[i];nc(s.subject,t)?nc(s.predicate,r)?e.push(","):(r=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(r))):(t&&e.push("."+this._newline),t=s.subject,r=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(r))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Pt.prototype.graph=function(n){return"GRAPH "+this.toEntity(n.name)+" "+this.group(n)};Pt.prototype.graphs=function(n,e){return!e||e.length===0?"":Xn(e,"",function(t){return n+this.toEntity(t)+this._newline},this)};Pt.prototype.group=function(n,e){return n=e!==!0?this.array(n.patterns||n.triples):this.toPattern(n.type!=="group"?n:n.patterns),n.indexOf(this._newline)===-1?"{ "+n+" }":"{"+this._newline+this.indent(n)+this._newline+"}"};Pt.prototype.query=function(n){return this.toQuery(n)};Pt.prototype.filter=function(n){return"FILTER("+this.toExpression(n.expression)+")"};Pt.prototype.bind=function(n){return"BIND("+this.toExpression(n.expression)+" AS "+Up(n.variable)+")"};Pt.prototype.optional=function(n){return"OPTIONAL "+this.group(n)};Pt.prototype.union=function(n){return Xn(n.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Pt.prototype.minus=function(n){return"MINUS "+this.group(n)};Pt.prototype.values=function(n){var e=Object.keys(n.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,r;return e.length===1?t=r="":(t="(",r=")"),"VALUES "+t+e.join(" ")+r+" {"+this._newline+Xn(n.values,this._newline,function(i){return" "+t+Xn(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+r},this)+this._newline+"}"};Pt.prototype.service=function(n){return"SERVICE "+(n.silent?"SILENT ":"")+this.toEntity(n.name)+" "+this.group(n)};Pt.prototype.toExpression=function(n){if(ea(n))return this.toEntity(n);switch(n.type.toLowerCase()){case"aggregate":return n.aggregation.toUpperCase()+"("+(n.distinct?"DISTINCT ":"")+this.toExpression(n.expression)+(typeof n.separator=="string"?'; SEPARATOR = "'+n.separator.replace(jR,$R)+'"':"")+")";case"functioncall":return this.toEntity(n.function)+"("+Xn(n.args,", ",this.toExpression,this)+")";case"operation":var e=n.operator.toUpperCase(),t=n.args||[];switch(n.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(ea(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(ea(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(Df(t[1])?t[1]:Xn(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Xn(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+n.type)}};Pt.prototype.toEntity=function(n){if(ea(n))switch(n.termType){case"Wildcard":return"*";case"Variable":return Up(n);case"BlankNode":return"_:"+n.value;case"Literal":var e=n.value||"",t=n.language||"",r=n.datatype;if(n='"'+e.replace(jR,$R)+'"',t)n+="@"+t;else if(r){if(!this._explicitDatatype)switch(r.value){case j7:return n;case M7:if(/^\d+$/.test(e))return e+" "}n+="^^"+this.encodeIRI(r.value)}return n;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return n.graph&&n.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(n.graph)+" { "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" } >>":"<< "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" >>";default:return this.encodeIRI(n.value)}else{var i=n.items.map(this.toEntity,this),s=n.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var jR=/["\\\t\n\r\b\f]/g,$R=a(function(n){return $7[n]},"escapeReplacer"),$7={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Pt.prototype.encodeIRI=function(n){var e=this._prefixRegex.exec(n);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+n+">"};Pt.prototype.toUpdate=function(n){switch(n.type||n.updateType){case"load":return"LOAD"+(n.source?" "+this.toEntity(n.source):"")+(n.destination?" INTO GRAPH "+this.toEntity(n.destination):"");case"insert":return"INSERT DATA "+this.group(n.insert,!0);case"delete":return"DELETE DATA "+this.group(n.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(n.delete,!0);case"insertdelete":return(n.graph?"WITH "+this.toEntity(n.graph)+this._newline:"")+(n.delete.length?"DELETE "+this.group(n.delete,!0)+this._newline:"")+(n.insert.length?"INSERT "+this.group(n.insert,!0)+this._newline:"")+(n.using?this.graphs("USING ",n.using.default):"")+(n.using?this.graphs("USING NAMED ",n.using.named):"")+"WHERE "+this.group(n.where,!0);case"add":case"copy":case"move":return n.type.toUpperCase()+" "+(n.silent?"SILENT ":"")+(n.source.default?"DEFAULT":this.toEntity(n.source.name))+" TO "+this.toEntity(n.destination.name);case"create":case"clear":case"drop":return n.type.toUpperCase()+(n.silent?" SILENT ":" ")+(n.graph.default?"DEFAULT":n.graph.named?"NAMED":n.graph.all?"ALL":"GRAPH "+this.toEntity(n.graph.name));default:throw new Error("Unknown update query type: "+n.type)}};Pt.prototype.indent=function(n){return n.replace(/^/gm,this._indent)};function Up(n){return"?"+n.value}a(Up,"variableToString");function Df(n){return typeof n=="string"}a(Df,"isString");function ea(n){return typeof n.termType=="string"}a(ea,"isTerm");function nc(n,e){if(!n||!ea(n)||!e||!ea(e)||n.termType!==e.termType)return!1;switch(n.termType){case"Literal":return n.value===e.value&&n.language===e.language&&nc(n.datatype,e.datatype);case"Quad":return nc(n.subject,e.subject)&&nc(n.predicate,e.predicate)&&nc(n.object,e.object)&&nc(n.graph,e.graph);default:return n.value===e.value}}a(nc,"equalTerms");function Xn(n,e,t,r){return n.map(t,r).join(Df(e)?e:" ")}a(Xn,"mapJoin");function U7(n={}){return{stringify:a(function(e){var t=Object.create(n);return t.prefixes=e.prefixes,new Pt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Pt(n)},"createGenerator")}}a(U7,"_Generator");UR.exports={Generator:U7}});var qS=w(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.BlankNode=void 0;var VS=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};Bp.BlankNode=VS});var GS=w(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.DefaultGraph=void 0;var Lf=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Vp.DefaultGraph=Lf;Lf.INSTANCE=new Lf});var Gp=w(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.NamedNode=void 0;var WS=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};qp.NamedNode=WS});var HS=w(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Literal=void 0;var VR=Gp(),Nf=class n{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=n.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=n.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};Wp.Literal=Nf;Nf.RDF_LANGUAGE_STRING=new VR.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");Nf.XSD_STRING=new VR.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var KS=w(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Quad=void 0;var zS=class{static{a(this,"Quad")}constructor(e,t,r,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};Hp.Quad=zS});var YS=w(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.Variable=void 0;var QS=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};zp.Variable=QS});var GR=w(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.DataFactory=void 0;var B7=qS(),V7=GS(),qR=HS(),q7=Gp(),G7=KS(),W7=YS(),H7=0,XS=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${H7++}_`}namedNode(e){return new q7.NamedNode(e)}blankNode(e){return new B7.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new qR.Literal(e,t)}variable(e){return new W7.Variable(e)}defaultGraph(){return V7.DefaultGraph.INSTANCE}quad(e,t,r,i){return new G7.Quad(e,t,r,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(qR.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};Kp.DataFactory=XS});var WR=w(Jn=>{"use strict";var z7=Jn&&Jn.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ic=Jn&&Jn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&z7(e,n,t)};Object.defineProperty(Jn,"__esModule",{value:!0});ic(qS(),Jn);ic(GR(),Jn);ic(GS(),Jn);ic(HS(),Jn);ic(Gp(),Jn);ic(KS(),Jn);ic(YS(),Jn)});var zR=w((_fe,HR)=>{var{Parser:ao}=MR(),{Generator:K7}=BR(),{Wildcard:Q7}=BS(),{DataFactory:Y7}=WR();function X7({prefixes:n,baseIRI:e,factory:t,pathOnly:r,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in n??{})c[u]=n[u];let l=new ao;return l.parse=function(){return ao.base=e||"",ao.prefixes=Object.create(c),ao.factory=t||new Y7,ao.sparqlStar=!!i,ao.pathOnly=!!r,ao.skipValidation=!!s||!!o,ao.prototype.parse.apply(l,arguments)},l._resetBlanks=ao._resetBlanks,l}a(X7,"_Parser");HR.exports={Parser:X7,Generator:K7,Wildcard:Q7}});var ZS=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.CaseWhenTransformerError=ll.CaseWhenTransformer=void 0;var JS=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new co("Too many nested CASE expressions (max 100 iterations)");while(t!==r);return t}stripLineComments(e){let t="",r=0;for(;r<e.length;){let i=e[r];if(i==="'"||i==='"'){let s=i;for(t+=i,r++;r<e.length&&e[r]!==s;){if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++}r<e.length&&(t+=e[r],r++);continue}if(i==="<"){let s=e.indexOf(">",r),o=e.indexOf(`
|
|
41
41
|
`,r);if(s!==-1&&(o===-1||s<o)){t+=e.substring(r,s+1),r=s+1;continue}}if(i==="#"){let s=e.indexOf(`
|
|
42
42
|
`,r),o=s===-1?e.length:s;t+=" ".repeat(o-r),r=o;continue}t+=i,r++}return t}transformSinglePass(e){let t=this.findCasePositions(e);if(t.length===0)return e;let r=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractCaseExpression(r,s);if(o){let c=this.convertCaseToIf(o.content);r=r.substring(0,s)+c+r.substring(s+o.length)}}return r}findCasePositions(e){let t=[],r=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(r.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){t.push(i),i+=4;continue}i++}return t}extractCaseExpression(e,t){let r=1,i=t+4,s=e.toUpperCase();for(;i<e.length&&r>0;){if(e[i]==="'"||e[i]==='"'){let o=e[i];for(i++;i<e.length&&e[i]!==o;)e[i]==="\\"&&i++,i++;i++;continue}if(s.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){r++,i+=4;continue}if(s.substring(i,i+3)==="END"&&this.isWordBoundary(e,i,3)){if(r--,r===0){let o=e.substring(t,i+3);return{content:o,length:o.length}}i+=3;continue}i++}if(r>0)throw new co(`Unclosed CASE expression at position ${t}`);return null}isWordBoundary(e,t,r){let i=t>0?e[t-1]:"",s=t===0||!/[a-zA-Z0-9_?$]/.test(i),o=t+r<e.length?e[t+r]:"",c=t+r>=e.length||!/[a-zA-Z0-9_]/.test(o);return s&&c}convertCaseToIf(e){let t=this.extractWhenClauses(e),r=this.extractElseClause(e);if(t.length===0)throw new co("CASE expression must have at least one WHEN clause");let i=r!==null?r:'""';for(let s=t.length-1;s>=0;s--){let{condition:o,result:c}=t[s];i=`IF(${o}, ${c}, ${i})`}return i}extractWhenClauses(e){let t=[],r=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),i=this.findKeywordPositions(r,"WHEN"),s=this.findKeywordPositions(r,"ELSE"),o=s.length>0?s[0]:r.length;for(let c=0;c<i.length;c++){let l=i[c]+4,u=c+1<i.length?i[c+1]:o,f=r.substring(l,u).trim(),d=this.parseWhenClause(f);d&&t.push(d)}return t}findKeywordPositions(e,t){let r=[],i=e.toUpperCase(),s=0,o=0;for(;s<e.length;){let c=e[s];if(c==="'"||c==='"'){let l=c;for(s++;s<e.length&&e[s]!==l;)e[s]==="\\"&&s++,s++;s++;continue}if(c==="("){o++,s++;continue}if(c===")"){o--,s++;continue}if(o===0&&i.substring(s,s+t.length)===t&&this.isWordBoundary(e,s,t.length)){r.push(s),s+=t.length;continue}s++}return r}parseWhenClause(e){let t=this.findKeywordPositions(e,"THEN");if(t.length===0)throw new co(`WHEN clause missing THEN keyword: ${e.substring(0,50)}...`);let r=t[0],i=e.substring(0,r).trim(),s=e.substring(r+4).trim();if(!i)throw new co("WHEN clause has empty condition");if(!s)throw new co("WHEN clause has empty result");return{condition:i,result:s}}extractElseClause(e){let t=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),r=this.findKeywordPositions(t,"ELSE");if(r.length>0){let i=r[0];return t.substring(i+4).trim()}return null}};ll.CaseWhenTransformer=JS;var co=class extends Error{static{a(this,"CaseWhenTransformerError")}constructor(e){super(`CASE WHEN transformation error: ${e}`),this.name="CaseWhenTransformerError"}};ll.CaseWhenTransformerError=co});var ew=w(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.LateralTransformerError=ul.LateralTransformer=void 0;var Qp=class n{static{a(this,"LateralTransformer")}transform(e){let t=e,r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new ta("Too many nested LATERAL joins (max 100 iterations)");while(t!==r);return t}hasLateral(e){return this.findLateralPositions(e).length>0}static isLateralJoin(e){if(e.type==="group"&&e.patterns){for(let t of e.patterns)if(t.type==="query"&&t.queryType==="SELECT"&&t.variables&&Array.isArray(t.variables)){for(let r of t.variables)if(r.termType==="Variable"&&r.value===n.LATERAL_MARKER)return!0}}if(e.type==="query"&&e.queryType==="SELECT"&&e.variables&&Array.isArray(e.variables)){for(let t of e.variables)if(t.termType==="Variable"&&t.value===n.LATERAL_MARKER)return!0}return!1}transformSinglePass(e){let t=this.findLateralPositions(e);if(t.length===0)return e;let r=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractLateralExpression(r,s);if(o){let c=this.transformLateral(o.content);r=r.substring(0,s)+c+r.substring(s+o.length)}}return r}findLateralPositions(e){let t=[],r=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(e[i]==="#"){for(;i<e.length&&e[i]!==`
|
|
43
43
|
`;)i++;continue}if(r.substring(i,i+7)==="LATERAL"&&this.isWordBoundary(e,i,7)){t.push(i),i+=7;continue}i++}return t}extractLateralExpression(e,t){let r=t+7;for(;r<e.length&&/\s/.test(e[r]);)r++;if(e[r]!=="{")throw new ta(`Expected '{' after LATERAL keyword at position ${t}`);let i=1;for(r++;r<e.length&&i>0;){if(e[r]==="'"||e[r]==='"'){let s=e[r];for(r++;r<e.length&&e[r]!==s;)e[r]==="\\"&&r++,r++;r++;continue}if(e[r]==="#"){for(;r<e.length&&e[r]!==`
|
|
@@ -45,7 +45,7 @@ Expecting `+Gh.join(", ")+", got '"+(this.terminals_[bt]||bt)+"'":Hb="Parse erro
|
|
|
45
45
|
`)+`
|
|
46
46
|
`+s.trimStart()),s}findPrefixStarDeclarations(e){let t=[],r=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(r.substring(i,i+6)==="PREFIX"){let s=i;for(i+=6;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]==="*"){for(i++;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]==="<"){i++;let o=i;for(;i<e.length&&e[i]!==">";)i++;if(e[i]===">"){let c=e.substring(o,i);i++;let l=this.findDeclarationEnd(e,i);t.push({uri:c,startPos:s,endPos:l}),i=l;continue}else throw new fl(`Unclosed IRI in PREFIX* declaration at position ${o}`)}else throw new fl(`Expected IRI after PREFIX* at position ${i}`)}else continue}i++}return t}findDeclarationEnd(e,t){let r=t;for(;r<e.length;){let i=e[r];if(i===`
|
|
47
47
|
`)return r+1;let s=e.substring(r).toUpperCase();if(s.startsWith("PREFIX")||s.startsWith("BASE")||s.startsWith("SELECT")||s.startsWith("CONSTRUCT")||s.startsWith("DESCRIBE")||s.startsWith("ASK"))return r;if(/\s/.test(i)){r++;continue}break}return r}extractPrefixFromUri(e){let t=e.replace(/^https?:\/\//,"");t=t.replace(/\/$/,"").replace(/#$/,"");let r=t.split(/[/.#]+/).filter(Boolean);if(r.length===0)return null;let i=r[r.length-1];return/^(ontology|vocab|schema|ns|core)$/i.test(i)&&r.length>1?r[r.length-2].toLowerCase():i.toLowerCase().replace(/[^a-z0-9]/g,"")}};ra.PrefixStarTransformer=tw;var fl=class extends Error{static{a(this,"PrefixStarTransformerError")}constructor(e){super(`PREFIX* transformation error: ${e}`),this.name="PrefixStarTransformerError"}};ra.PrefixStarTransformerError=fl});var rw=w(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.DescribeOptionsTransformer=hl.DescribeOptionsTransformerError=void 0;var Xp=class extends Error{static{a(this,"DescribeOptionsTransformerError")}constructor(e){super(e),this.name="DescribeOptionsTransformerError"}};hl.DescribeOptionsTransformerError=Xp;var dl=class n{static{a(this,"DescribeOptionsTransformer")}transform(e){if(!n.DESCRIBE_QUERY_PATTERN.test(e))return{query:e};let t=e,r={},i=!1,s=n.DEPTH_PATTERN.exec(e);if(s){let o=parseInt(s[1],10);if(o<0)throw new Xp(`DESCRIBE DEPTH must be a non-negative integer, got: ${o}`);r.depth=o,i=!0,n.DEPTH_PATTERN.lastIndex=0,t=t.replace(n.DEPTH_PATTERN,"")}return n.DEPTH_PATTERN.lastIndex=0,n.SYMMETRIC_PATTERN.test(e)&&(r.symmetric=!0,i=!0,n.SYMMETRIC_PATTERN.lastIndex=0,t=t.replace(n.SYMMETRIC_PATTERN,"")),n.SYMMETRIC_PATTERN.lastIndex=0,t=t.replace(/\s{2,}/g," ").trim(),{query:t,options:i?r:void 0}}hasDescribeOptions(e){let t=n.DEPTH_PATTERN.test(e);n.DEPTH_PATTERN.lastIndex=0;let r=n.SYMMETRIC_PATTERN.test(e);return n.SYMMETRIC_PATTERN.lastIndex=0,t||r}};hl.DescribeOptionsTransformer=dl;dl.DEPTH_PATTERN=/\bDEPTH\s+(\d+)/gi;dl.SYMMETRIC_PATTERN=/\bSYMMETRIC\b/gi;dl.DESCRIBE_QUERY_PATTERN=/\bDESCRIBE\b/i});var QR=w(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.DirectionalLangTagTransformerError=pl.DirectionalLangTagTransformer=void 0;var Jp=class n{static{a(this,"DirectionalLangTagTransformer")}constructor(){this.directionMappings=new Map}transform(e){return this.directionMappings.clear(),e.replace(n.DIRECTIONAL_TAG_REGEX,(t,r,i,s,o)=>{let c=s.toLowerCase();return this.directionMappings.set(c,o),`${r}${i}${r}@${s}`})}getDirection(e){return this.directionMappings.get(e.toLowerCase())}getAllMappings(){return new Map(this.directionMappings)}hasDirectionalTags(e){return n.DIRECTIONAL_TAG_REGEX.lastIndex=0,n.DIRECTIONAL_TAG_REGEX.test(e)}clearMappings(){this.directionMappings.clear()}};pl.DirectionalLangTagTransformer=Jp;Jp.DIRECTIONAL_TAG_REGEX=/(["'])((?:[^\\]|\\.)*?)\1@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)--(ltr|rtl)/g;var nw=class extends Error{static{a(this,"DirectionalLangTagTransformerError")}constructor(e){super(`Directional language tag transformation error: ${e}`),this.name="DirectionalLangTagTransformerError"}};pl.DirectionalLangTagTransformerError=nw});var YR=w(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.TripleTermTransformerError=gl.TripleTermTransformer=void 0;var iw=class{static{a(this,"TripleTermTransformer")}transform(e){let t=e,r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new ml("Too many nested triple terms (max 100 iterations)");while(t!==r);return t}hasTripleTermSyntax(e){return this.findTripleTermPositions(e).length>0}transformSinglePass(e){let t=this.findTripleTermPositions(e);if(t.length===0)return e;let r=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractTripleTerm(r,s);if(o){let c=this.convertToStandardSyntax(o.content);r=r.substring(0,s)+c+r.substring(s+o.length)}}return r}findTripleTermPositions(e){let t=[],r=0;for(;r<e.length;){if(e[r]==="'"){r=this.skipStringLiteral(e,r,"'");continue}if(e[r]==='"'){r=this.skipStringLiteral(e,r,'"');continue}if(e.substring(r,r+2)==="<<"&&this.isParenthesizedTripleTerm(e,r)){t.push(r),r+=2;continue}r++}return t}skipStringLiteral(e,t,r){let i=r.repeat(3);if(e.substring(t,t+3)===i){for(t+=3;t<e.length;){if(e.substring(t,t+3)===i)return t+3;e[t]==="\\"&&t++,t++}return t}for(t++;t<e.length&&e[t]!==r;)e[t]==="\\"&&t++,t++;return t+1}isParenthesizedTripleTerm(e,t){let r=t+2;for(;r<e.length&&/\s/.test(e[r]);)r++;return e[r]==="("}extractTripleTerm(e,t){let r=t+2;for(;r<e.length&&/\s/.test(e[r]);)r++;if(e[r]!=="(")return null;r++;let i=1;for(;r<e.length&&i>0;){if(e[r]==="'"||e[r]==='"'){r=this.skipStringLiteral(e,r,e[r]);continue}if(e.substring(r,r+2)==="<<"&&this.isParenthesizedTripleTerm(e,r)){for(r+=2;r<e.length&&/\s/.test(e[r]);)r++;e[r]==="("&&(i++,r++);continue}if(e.substring(r,r+2)==="<<"){r+=2;let s=1;for(;r<e.length&&s>0;){if(e[r]==="'"||e[r]==='"'){r=this.skipStringLiteral(e,r,e[r]);continue}if(e.substring(r,r+2)==="<<"){s++,r+=2;continue}if(e.substring(r,r+2)===">>"){s--,r+=2;continue}r++}continue}if(e[r]==="("){i++,r++;continue}if(e[r]===")"){let s=r+1;for(;s<e.length&&/\s/.test(e[s]);)s++;if(e.substring(s,s+2)===">>"){if(i--,i===0){let o=e.substring(t,s+2);return{content:o,length:o.length}}r=s+2;continue}r++;continue}r++}if(i>0)throw new ml(`Unclosed triple term at position ${t}: missing )>>`);return null}convertToStandardSyntax(e){let t=e.match(/^<<\s*\(\s*([\s\S]*?)\s*\)\s*>>$/);if(!t)throw new ml(`Invalid triple term syntax: ${e.substring(0,50)}...`);return`<< ${t[1]} >>`}};gl.TripleTermTransformer=iw;var ml=class extends Error{static{a(this,"TripleTermTransformerError")}constructor(e){super(`Triple term transformation error: ${e}`),this.name="TripleTermTransformerError"}};gl.TripleTermTransformerError=ml});var ow=w(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.VaultPrefixTransformer=void 0;var J7=/PREFIX\s+(\w+)\s*:/gi,Z7=new Set(["mailto","http","https","urn","ftp","prefix","base","select","construct","describe","ask","where","filter","optional","union","graph","order","group","having","limit","offset","values","bind","minus","service","insert","delete","load","clear","drop","create","move","copy","add"]),sw=class{static{a(this,"VaultPrefixTransformer")}constructor(){this.vaultPrefixes=new Map}setVaultPrefixes(e){this.vaultPrefixes=new Map(e)}getVaultPrefixes(){return new Map(this.vaultPrefixes)}transform(e){if(this.vaultPrefixes.size===0)return e;let t=this.findDeclaredPrefixes(e),r=[];for(let[o,c]of this.vaultPrefixes)!t.has(o.toLowerCase())&&!Z7.has(o.toLowerCase())&&r.push({prefix:o,baseIRI:c});if(r.length===0)return e;let i="",s=0;for(;s<e.length;){let o=e[s];if(o==='"'||o==="'"){let l=this.skipLiteral(e,s);i+=e.substring(s,l),s=l;continue}if(o==="<"){let l=e.indexOf(">",s);l!==-1?(i+=e.substring(s,l+1),s=l+1):(i+=o,s++);continue}if(o==="#"){let l=e.indexOf(`
|
|
48
|
-
`,s);l!==-1?(i+=e.substring(s,l),s=l):(i+=e.substring(s),s=e.length);continue}let c=this.tryReplacePrefixedName(e,s,r);if(c){i+=c.iri,s=c.endIndex;continue}i+=o,s++}return i}tryReplacePrefixedName(e,t,r){if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return null;for(let{prefix:i,baseIRI:s}of r){if(e.substring(t,t+i.length+1)!==i+":")continue;let o=t+i.length+1,c=o;for(;c<e.length&&/[a-zA-Z0-9_.%-]/.test(e[c]);)c++;if(c===o)continue;let l=e.substring(o,c);return{iri:`<${s}${l}.md>`,endIndex:c}}return null}findDeclaredPrefixes(e){let t=new Set,r=new RegExp(J7.source,"gi"),i;for(;(i=r.exec(e))!==null;)t.add(i[1].toLowerCase());return t}skipLiteral(e,t){let r=e[t];if(t+2<e.length&&e.substring(t,t+3)===r+r+r){let s=e.indexOf(r+r+r,t+3);return s!==-1?s+3:e.length}let i=t+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;return i<e.length?i+1:e.length}};Zp.VaultPrefixTransformer=sw});var yl=w(kn=>{"use strict";var eU=kn&&kn.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),tU=kn&&kn.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),rU=kn&&kn.__importStar||(function(){var n=a(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"&&eU(t,e,r[i]);return tU(t,e),t}})();Object.defineProperty(kn,"__esModule",{value:!0});kn.SPARQLParser=kn.ExoQLParser=kn.SPARQLParseError=void 0;var XR=rU(zR()),aw=ZS(),cw=ew(),JR=KR(),lw=rw(),nU=QR(),uw=YR(),iU=ow(),mr=class extends Error{static{a(this,"SPARQLParseError")}constructor(e,t,r,i){super(e,i?{cause:i}:void 0),this.name="SPARQLParseError",this.line=t,this.column=r}};kn.SPARQLParseError=mr;var em=class{static{a(this,"ExoQLParser")}constructor(e){this.lastDirectionMappings=new Map,this.parser=new XR.Parser({sparqlStar:!0}),this.generator=new XR.Generator({sparqlStar:!0}),this.caseWhenTransformer=new aw.CaseWhenTransformer,this.lateralTransformer=new cw.LateralTransformer,this.prefixStarTransformer=new JR.PrefixStarTransformer(e?.vocabularyResolver),this.describeOptionsTransformer=new lw.DescribeOptionsTransformer,this.directionalLangTagTransformer=new nU.DirectionalLangTagTransformer,this.tripleTermTransformer=new uw.TripleTermTransformer,this.vaultPrefixTransformer=new iU.VaultPrefixTransformer}setVaultPrefixes(e){this.vaultPrefixTransformer.setVaultPrefixes(e)}parse(e){try{let t=this.vaultPrefixTransformer.transform(e),r=this.describeOptionsTransformer.transform(t);this.lastDescribeOptions=r.options;let i=r.query;i=this.directionalLangTagTransformer.transform(i),this.lastDirectionMappings=this.directionalLangTagTransformer.getAllMappings(),i=this.lateralTransformer.transform(i),i=this.caseWhenTransformer.transform(i),i=this.tripleTermTransformer.transform(i);let s=this.parser.parse(i);return this.validateQuery(s),this.lastDescribeOptions&&this.isDescribeQuery(s)&&(s.describeOptions=this.lastDescribeOptions),s}catch(t){if(t instanceof lw.DescribeOptionsTransformerError)throw new mr(t.message);if(t instanceof cw.LateralTransformerError)throw new mr(t.message);if(t instanceof aw.CaseWhenTransformerError)throw new mr(t.message);if(t instanceof uw.TripleTermTransformerError)throw new mr(t.message);if(t instanceof Error){let r=t.message.match(/line (\d+), column (\d+)/),i=r?parseInt(r[1],10):void 0,s=r?parseInt(r[2],10):void 0;throw new mr(`SPARQL syntax error: ${t.message}`,i,s,t)}throw t}}parseWithOptions(e){return{query:this.parse(e),describeOptions:this.lastDescribeOptions}}getLastDescribeOptions(){return this.lastDescribeOptions}async parseAsync(e){try{let t=this.vaultPrefixTransformer.transform(e),r=this.describeOptionsTransformer.transform(t);this.lastDescribeOptions=r.options;let i=r.query;i=this.directionalLangTagTransformer.transform(i),this.lastDirectionMappings=this.directionalLangTagTransformer.getAllMappings(),i=await this.prefixStarTransformer.transform(i),i=this.lateralTransformer.transform(i),i=this.caseWhenTransformer.transform(i),i=this.tripleTermTransformer.transform(i);let s=this.parser.parse(i);return this.validateQuery(s),this.lastDescribeOptions&&this.isDescribeQuery(s)&&(s.describeOptions=this.lastDescribeOptions),s}catch(t){if(t instanceof lw.DescribeOptionsTransformerError)throw new mr(t.message);if(t instanceof JR.PrefixStarTransformerError)throw new mr(t.message);if(t instanceof cw.LateralTransformerError)throw new mr(t.message);if(t instanceof aw.CaseWhenTransformerError)throw new mr(t.message);if(t instanceof uw.TripleTermTransformerError)throw new mr(t.message);if(t instanceof Error){let r=t.message.match(/line (\d+), column (\d+)/),i=r?parseInt(r[1],10):void 0,s=r?parseInt(r[2],10):void 0;throw new mr(`SPARQL syntax error: ${t.message}`,i,s,t)}throw t}}async parseAsyncWithOptions(e){return{query:await this.parseAsync(e),describeOptions:this.lastDescribeOptions}}hasPrefixStar(e){return/PREFIX\s*\*/i.test(e)}hasLateral(e){return this.lateralTransformer.hasLateral(e)}hasDescribeOptions(e){return this.describeOptionsTransformer.hasDescribeOptions(e)}hasDirectionalLangTags(e){return this.directionalLangTagTransformer.hasDirectionalTags(e)}hasTripleTermSyntax(e){return this.tripleTermTransformer.hasTripleTermSyntax(e)}getLastDirectionMappings(){return new Map(this.lastDirectionMappings)}getDirectionForLanguage(e){return this.lastDirectionMappings.get(e.toLowerCase())}toString(e){try{return this.generator.stringify(e)}catch(t){throw t instanceof Error?new mr(`Failed to serialize SPARQL query: ${t.message}`,void 0,void 0,t):t}}getQueryType(e){if("queryType"in e&&e.type==="query")return e.queryType;throw new mr("Query does not have a valid queryType property")}isSelectQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="SELECT"}isConstructQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="CONSTRUCT"}isAskQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="ASK"}isDescribeQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="DESCRIBE"}isUpdateQuery(e){return e.type==="update"}isInsertDataOperation(e){return"updateType"in e&&e.updateType==="insert"}isDeleteDataOperation(e){return"updateType"in e&&e.updateType==="delete"}validateQuery(e){if(!e||typeof e!="object")throw new mr("Invalid query: not an object");if(e.type!=="query"&&e.type!=="update")throw new mr(`Invalid type: expected "query" or "update", got "${e.type}"`);if(e.type==="query"){let t=["SELECT","CONSTRUCT","ASK","DESCRIBE"];if(!t.includes(e.queryType))throw new mr(`Invalid query type: expected one of ${t.join(", ")}, got "${e.queryType}"`)}}};kn.ExoQLParser=em;kn.SPARQLParser=em});var sc=w(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.AlgebraTranslatorError=void 0;var fw=class extends Error{static{a(this,"AlgebraTranslatorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AlgebraTranslatorError"}};tm.AlgebraTranslatorError=fw});var rm=w(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isVariableExpression=sU;bs.isVariableTerm=oU;bs.isNamedNode=aU;bs.isLiteral=cU;bs.isPropertyPath=lU;bs.isAggregateExpression=uU;bs.isOperationExpression=fU;bs.isFunctionCallExpression=dU;function sU(n){return typeof n=="object"&&n!==null&&"expression"in n&&"variable"in n}a(sU,"isVariableExpression");function oU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Variable"}a(oU,"isVariableTerm");function aU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="NamedNode"}a(aU,"isNamedNode");function cU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Literal"}a(cU,"isLiteral");function lU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="path"}a(lU,"isPropertyPath");function uU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="aggregate"}a(uU,"isAggregateExpression");function fU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="operation"}a(fU,"isOperationExpression");function dU(n){return typeof n=="object"&&n!==null&&"type"in n&&(n.type==="functionCall"||n.type==="functioncall")}a(dU,"isFunctionCallExpression")});var ZR=w(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.TripleTranslator=void 0;var mn=sc(),dw=class{static{a(this,"TripleTranslator")}constructor(){this.directionMappings=new Map}setDirectionMappings(e){this.directionMappings=e}translateBGP(e){if(!("triples"in e)||!Array.isArray(e.triples))throw new mn.AlgebraTranslatorError("BGP pattern must have triples array");return{type:"bgp",triples:e.triples.map(t=>this.translateTriple(t))}}translateTriple(e){if(!e.subject||!e.predicate||!e.object)throw new mn.AlgebraTranslatorError("Triple must have subject, predicate, and object");return{subject:this.translateTripleElement(e.subject),predicate:this.translatePredicate(e.predicate),object:this.translateTripleElement(e.object)}}translateConstructTemplate(e){return!e||!Array.isArray(e)?[]:e.map(t=>this.translateTriple(t))}translatePredicate(e){return"type"in e&&e.type==="path"?this.translatePropertyPath(e):this.translateTripleElement(e)}translatePropertyPath(e){if(!("pathType"in e)||!e.pathType)throw new mn.AlgebraTranslatorError("Property path must have pathType");if(!("items"in e)||!Array.isArray(e.items))throw new mn.AlgebraTranslatorError("Property path must have items array");let t=e.items.map(r=>this.translatePathItem(r));switch(e.pathType){case"/":return{type:"path",pathType:"/",items:t};case"|":return{type:"path",pathType:"|",items:t};case"^":if(t.length!==1)throw new mn.AlgebraTranslatorError("Inverse path must have exactly one item");return{type:"path",pathType:"^",items:[t[0]]};case"+":if(t.length!==1)throw new mn.AlgebraTranslatorError("OneOrMore path must have exactly one item");return{type:"path",pathType:"+",items:[t[0]]};case"*":if(t.length!==1)throw new mn.AlgebraTranslatorError("ZeroOrMore path must have exactly one item");return{type:"path",pathType:"*",items:[t[0]]};case"?":if(t.length!==1)throw new mn.AlgebraTranslatorError("ZeroOrOne path must have exactly one item");return{type:"path",pathType:"?",items:[t[0]]};default:throw new mn.AlgebraTranslatorError(`Unsupported property path type: ${e.pathType}`)}}translatePathItem(e){if("type"in e&&e.type==="path")return this.translatePropertyPath(e);if("termType"in e&&e.termType==="NamedNode")return{type:"iri",value:e.value};let t="type"in e?e.type:"termType"in e?e.termType:"unknown";throw new mn.AlgebraTranslatorError(`Unsupported path item type: ${String(t)}`)}translateTripleElement(e){if(!e||!("termType"in e))throw new mn.AlgebraTranslatorError("Triple element must have termType");switch(e.termType){case"Variable":return{type:"variable",value:e.value};case"NamedNode":return{type:"iri",value:e.value};case"Literal":{let t={type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language};if(e.language){let r=this.directionMappings.get(e.language.toLowerCase());r&&(t.direction=r)}return t}case"BlankNode":return{type:"blank",value:e.value};case"Quad":return this.translateQuotedTriple(e);default:throw new mn.AlgebraTranslatorError(`Unsupported term type: ${e.termType}`)}}translateQuotedTriple(e){if(!e.subject||!e.predicate||!e.object)throw new mn.AlgebraTranslatorError("Quoted triple must have subject, predicate, and object");return{type:"quoted",subject:this.translateTripleElement(e.subject),predicate:this.translateQuotedTriplePredicate(e.predicate),object:this.translateTripleElement(e.object)}}translateQuotedTriplePredicate(e){if(!e||!("termType"in e))throw new mn.AlgebraTranslatorError("Quoted triple predicate must have termType");switch(e.termType){case"Variable":return{type:"variable",value:e.value};case"NamedNode":return{type:"iri",value:e.value};default:throw new mn.AlgebraTranslatorError(`Quoted triple predicate must be IRI or Variable, got: ${e.termType}`)}}};nm.TripleTranslator=dw});var eC=w(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.ExpressionTranslator=void 0;var bl=sc(),hw=class{static{a(this,"ExpressionTranslator")}constructor(e){this.translateWhereFn=e.translateWhere,this.translateBGPFn=e.translateBGP,this.translatePatternFn=e.translatePattern}translateExpression(e){if(!e)throw new bl.AlgebraTranslatorError("Expression cannot be null or undefined");if("type"in e&&e.type==="operation")return this.translateOperationExpression(e);let t="type"in e?e.type:void 0;if(t==="functioncall"||t==="functionCall"){let r=e;return{type:"functionCall",function:r.function,args:r.args.map(i=>this.translateExpression(i))}}if("termType"in e)return this.translateTermExpression(e);throw new bl.AlgebraTranslatorError(`Unsupported expression structure: ${JSON.stringify(e)}`)}translateFilter(e){if(!e.expression)throw new bl.AlgebraTranslatorError("Filter pattern must have expression");let t={type:"bgp",triples:[]};return{type:"filter",expression:this.translateExpression(e.expression),input:t}}translateTermExpression(e){if(e.termType==="Variable")return{type:"variable",name:e.value};if(e.termType==="Literal"){let t=e.value;return e.datatype&&(e.datatype.value.includes("#integer")||e.datatype.value.includes("#decimal")?t=parseFloat(e.value):e.datatype.value.includes("#boolean")&&(t=e.value==="true")),{type:"literal",value:t,datatype:e.datatype?.value}}return{type:"literal",value:String(e.value||e)}}translateOperationExpression(e){let t=["=","!=","<",">","<=",">="],r=["&&","||","!"],i=["+","-","*","/"],s=e.args.filter(o=>!("patterns"in o)||"termType"in o);return t.includes(e.operator)?{type:"comparison",operator:e.operator,left:this.translateExpression(s[0]),right:this.translateExpression(s[1])}:r.includes(e.operator)?{type:"logical",operator:e.operator,operands:s.map(o=>this.translateExpression(o))}:i.includes(e.operator)?{type:"arithmetic",operator:e.operator,left:this.translateExpression(s[0]),right:this.translateExpression(s[1])}:e.operator==="exists"||e.operator==="notexists"?this.translateExistsExpression(e):e.operator==="in"||e.operator==="notin"?this.translateInExpression(e):{type:"function",function:e.operator,args:s.map(o=>this.translateExpression(o))}}translateExistsExpression(e){if(!e.args||e.args.length!==1)throw new bl.AlgebraTranslatorError("EXISTS/NOT EXISTS must have exactly one pattern argument");let t=e.args[0],r;return t.type==="group"&&"patterns"in t&&t.patterns?r=this.translateWhereFn(t.patterns):t.type==="bgp"?r=this.translateBGPFn(t):r=this.translatePatternFn(t),{type:"exists",negated:e.operator==="notexists",pattern:r}}translateInExpression(e){if(!e.args||e.args.length!==2)throw new bl.AlgebraTranslatorError("IN/NOT IN must have exactly 2 arguments (expression and list)");let t=e.args[0],r=e.args[1];if(!Array.isArray(r))throw new bl.AlgebraTranslatorError("IN/NOT IN second argument must be an array of values");return{type:"in",expression:this.translateExpression(t),list:r.map(i=>this.translateExpression(i)),negated:e.operator==="notin"}}};im.ExpressionTranslator=hw});var nC=w(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.PatternTranslator=void 0;var tC=ew(),Vr=sc(),rC=rm(),pw=class{static{a(this,"PatternTranslator")}constructor(e){this.directionMappings=new Map,this.translateExpressionFn=e.translateExpression,this.translateSelectFn=e.translateSelect,this.translateBGPFn=e.translateBGP}setDirectionMappings(e){this.directionMappings=e}translateWhere(e){if(e.length===0)throw new Vr.AlgebraTranslatorError("Empty WHERE clause");let t=e.filter(o=>o.type==="filter"),r=e.filter(o=>o.type==="bind"),i=e.filter(o=>o.type!=="filter"&&o.type!=="bind"),s;if(i.length===0)s={type:"bgp",triples:[]};else if(i.length===1)if(i[0].type==="optional"){let o=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:o?this.translateExpressionFn(o):void 0}}else s=this.translatePattern(i[0]);else{if(i[0].type==="optional"){let o=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:o?this.translateExpressionFn(o):void 0}}else s=this.translatePattern(i[0]);for(let o=1;o<i.length;o++){let c=i[o];if(this.isLateralPattern(c)){let l=this.extractLateralSubquery(c),u=this.removeLateralMarker(l),f=this.translateSelectFn(u);s={type:"lateraljoin",left:s,right:f}}else if(c.type==="optional"){let l=c.expression;s={type:"leftjoin",left:s,right:this.translateWhere(c.patterns),expression:l?this.translateExpressionFn(l):void 0}}else{let l=this.translatePattern(c);s={type:"join",left:s,right:l}}}}for(let o of r)s=this.translateBind(o,s);for(let o of t)s={type:"filter",expression:this.translateExpressionFn(o.expression),input:s};return s}translatePattern(e){if(!e||!e.type)throw new Vr.AlgebraTranslatorError("Invalid pattern: missing type");switch(e.type){case"bgp":return this.translateBGPFn(e);case"filter":return this.translateFilter(e);case"optional":return this.translateOptional(e);case"union":return this.translateUnion(e);case"minus":return this.translateMinus(e);case"values":return this.translateValues(e);case"group":return this.translateWhere(e.patterns);case"query":return this.translateSubquery(e);case"service":return this.translateService(e);case"graph":return this.translateGraph(e);default:throw new Vr.AlgebraTranslatorError(`Unsupported pattern type: ${e.type}`)}}translateFilter(e){if(!e.expression)throw new Vr.AlgebraTranslatorError("Filter pattern must have expression");let t={type:"bgp",triples:[]};return{type:"filter",expression:this.translateExpressionFn(e.expression),input:t}}translateOptional(e){if(!e.patterns||e.patterns.length===0)throw new Vr.AlgebraTranslatorError("OPTIONAL pattern must have patterns");let t=e.expression;return{type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(e.patterns),expression:t?this.translateExpressionFn(t):void 0}}translateUnion(e){if(!e.patterns||e.patterns.length<2)throw new Vr.AlgebraTranslatorError("UNION pattern must have at least 2 patterns");let t=a(i=>i.type==="graph"?this.translateGraph(i):i.type==="service"?this.translateService(i):"patterns"in i&&i.patterns&&Array.isArray(i.patterns)?this.translateWhere(i.patterns):this.translateWhere([i]),"translateBranch"),r={type:"union",left:t(e.patterns[0]),right:t(e.patterns[1])};for(let i=2;i<e.patterns.length;i++)r={type:"union",left:r,right:t(e.patterns[i])};return r}translateMinus(e){if(!e.patterns||e.patterns.length===0)throw new Vr.AlgebraTranslatorError("MINUS pattern must have patterns");return{type:"minus",left:{type:"bgp",triples:[]},right:this.translateWhere(e.patterns)}}translateValues(e){if(!e.values||!Array.isArray(e.values))throw new Vr.AlgebraTranslatorError("VALUES pattern must have values array");let t=new Set;for(let i of e.values)for(let s of Object.keys(i)){let o=s.startsWith("?")?s.slice(1):s;t.add(o)}let r=e.values.map(i=>this.translateValuesBinding(i));return{type:"values",variables:Array.from(t),bindings:r}}translateValuesBinding(e){let t={};for(let[r,i]of Object.entries(e)){let s=r.startsWith("?")?r.slice(1):r,o=i;if(o)if(o.termType==="NamedNode")t[s]={type:"iri",value:o.value};else if(o.termType==="Literal"){let c=o,l={type:"literal",value:c.value,datatype:c.datatype?.value,language:c.language||void 0};if(c.language){let u=this.directionMappings.get(c.language.toLowerCase());u&&(l.direction=u)}t[s]=l}else throw new Vr.AlgebraTranslatorError(`Unsupported VALUES term type: ${o.termType}`)}return t}translateBind(e,t){if(!e.variable||!e.expression)throw new Vr.AlgebraTranslatorError("BIND pattern must have variable and expression");return{type:"extend",variable:e.variable.value,expression:this.translateExpressionFn(e.expression),input:t}}translateSubquery(e){if(e.queryType!=="SELECT")throw new Vr.AlgebraTranslatorError(`Only SELECT subqueries are supported, got: ${String(e.queryType)}`);let t=this.removeLateralMarker(e);return{type:"subquery",query:this.translateSelectFn(t)}}translateService(e){if(!e.name||e.name.termType!=="NamedNode")throw new Vr.AlgebraTranslatorError("SERVICE pattern must have a NamedNode endpoint");if(!e.patterns||!Array.isArray(e.patterns))throw new Vr.AlgebraTranslatorError("SERVICE pattern must have patterns array");return{type:"service",endpoint:e.name.value,pattern:this.translateWhere(e.patterns),silent:e.silent||!1}}translateGraph(e){if(!e.name)throw new Vr.AlgebraTranslatorError("GRAPH pattern must have a name (IRI or variable)");if(!e.patterns||!Array.isArray(e.patterns))throw new Vr.AlgebraTranslatorError("GRAPH pattern must have patterns array");let t;if(e.name.termType==="NamedNode")t={type:"iri",value:e.name.value};else if(e.name.termType==="Variable")t={type:"variable",value:e.name.value};else throw new Vr.AlgebraTranslatorError(`GRAPH pattern name must be NamedNode or Variable, got: ${e.name.termType}`);return{type:"graph",name:t,pattern:this.translateWhere(e.patterns)}}isLateralPattern(e){if(e.type==="query"&&this.isLateralSubquery(e))return!0;if(e.type==="group"&&e.patterns?.length===1){let t=e.patterns[0];if(t.type==="query"&&this.isLateralSubquery(t))return!0}return!1}extractLateralSubquery(e){if(e.type==="query")return e;if(e.type==="group"&&e.patterns?.length===1){let t=e.patterns[0];if(t.type==="query")return t}throw new Vr.AlgebraTranslatorError("Invalid lateral pattern structure")}isLateralSubquery(e){return!("queryType"in e)||e.queryType!=="SELECT"||!("variables"in e)||!e.variables?!1:e.variables.some(i=>(0,rC.isVariableTerm)(i)&&i.value===tC.LateralTransformer.LATERAL_MARKER)}removeLateralMarker(e){if(!("variables"in e)||!e.variables)return e;let t=e,r=t.variables;return{...t,variables:r.filter(i=>!((0,rC.isVariableTerm)(i)&&i.value===tC.LateralTransformer.LATERAL_MARKER))}}};sm.PatternTranslator=pw});var sC=w(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.AggregateTranslator=void 0;var iC=sc(),hU=rm(),mw=class{static{a(this,"AggregateTranslator")}constructor(e){this.aggregateCounter=0,this.translateExpressionFn=e.translateExpression}resetCounter(){this.aggregateCounter=0}extractAggregatesWithMapping(e,t){if(!e)return[];let r=[];for(let i of e)(0,hU.isVariableExpression)(i)&&("type"in i.expression&&i.expression.type==="aggregate"?(r.push({variable:i.variable.value,expression:this.translateAggregateExpression(i.expression)}),t.set(i.expression,i.variable.value)):this.collectNestedAggregates(i.expression,r,t));return r}extractGroupVariables(e){return e?e.filter(t=>t.expression&&"termType"in t.expression&&t.expression.termType==="Variable").map(t=>t.expression.value):[]}extractHavingExpressions(e,t,r){if(!e||e.length===0)return[];for(let i of e)this.collectNestedAggregates(i,t,r);return e.map(i=>this.transformExpressionWithAggregateVars(i,r))}transformExpressionWithAggregateVars(e,t){let r=t.get(e);if(r!==void 0)return{type:"variable",name:r};if("type"in e&&e.type==="operation"&&"args"in e){let i=e,s=i.args.filter(u=>!Array.isArray(u)&&!("patterns"in u)).map(u=>this.transformExpressionWithAggregateVars(u,t)),o=["=","!=","<",">","<=",">="],c=["&&","||","!"],l=["+","-","*","/"];return o.includes(i.operator)?{type:"comparison",operator:i.operator,left:s[0],right:s[1]}:c.includes(i.operator)?{type:"logical",operator:i.operator,operands:s}:l.includes(i.operator)?{type:"arithmetic",operator:i.operator,left:s[0],right:s[1]}:{type:"function",function:i.operator,args:s}}return this.translateExpressionFn(e)}translateOrderComparator(e){return{expression:this.translateExpressionFn(e.expression),descending:e.descending||!1}}translateAggregateExpression(e){let t=e.aggregation,r=a(()=>{if(e.expression&&!("termType"in e.expression&&e.expression.termType==="Wildcard"))return this.translateExpressionFn(e.expression)},"translateInnerExpr");if(typeof t=="string"){let s=t.toLowerCase();return["count","sum","avg","min","max","group_concat","sample"].includes(s)?{type:"aggregate",aggregation:s,expression:r(),distinct:e.distinct||!1,separator:e.separator}:{type:"aggregate",aggregation:{type:"custom",iri:t},expression:r(),distinct:e.distinct||!1,separator:e.separator}}let i=t;if(i&&typeof i=="object"){let s,o=i;if(o.termType==="NamedNode"&&typeof o.value=="string")s=o.value;else if("value"in o)s=String(o.value);else throw new iC.AlgebraTranslatorError(`Invalid custom aggregate: expected IRI but got ${JSON.stringify(i)}`);return{type:"aggregate",aggregation:{type:"custom",iri:s},expression:r(),distinct:e.distinct||!1,separator:e.separator}}throw new iC.AlgebraTranslatorError(`Unknown aggregate format: ${JSON.stringify(t)}`)}collectNestedAggregates(e,t,r){if(e){if("type"in e&&e.type==="aggregate"){let i=`__agg${this.aggregateCounter++}`;t.push({variable:i,expression:this.translateAggregateExpression(e)}),r.set(e,i)}else if("type"in e&&e.type==="operation"&&"args"in e){let i=e;for(let s of i.args)!Array.isArray(s)&&"type"in s&&!("patterns"in s)?this.collectNestedAggregates(s,t,r):"termType"in s&&this.collectNestedAggregates(s,t,r)}}}};om.AggregateTranslator=mw});var _l=w(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.AlgebraTranslator=na.ExoQLAlgebraTranslator=na.AlgebraTranslatorError=void 0;var am=sc(),cm=rm(),pU=ZR(),mU=eC(),gU=nC(),yU=sC(),bU=sc();Object.defineProperty(na,"AlgebraTranslatorError",{enumerable:!0,get:a(function(){return bU.AlgebraTranslatorError},"get")});var lm=class{static{a(this,"ExoQLAlgebraTranslator")}constructor(){this.tripleTranslator=new pU.TripleTranslator,this.expressionTranslator=new mU.ExpressionTranslator({translateWhere:a(e=>this.patternTranslator.translateWhere(e),"translateWhere"),translateBGP:a(e=>this.tripleTranslator.translateBGP(e),"translateBGP"),translatePattern:a(e=>this.patternTranslator.translatePattern(e),"translatePattern")}),this.patternTranslator=new gU.PatternTranslator({translateExpression:a(e=>this.expressionTranslator.translateExpression(e),"translateExpression"),translateSelect:a(e=>this.translateSelect(e),"translateSelect"),translateBGP:a(e=>this.tripleTranslator.translateBGP(e),"translateBGP")}),this.aggregateTranslator=new yU.AggregateTranslator({translateExpression:a(e=>this.expressionTranslator.translateExpression(e),"translateExpression")})}setDirectionMappings(e){this.tripleTranslator.setDirectionMappings(e),this.patternTranslator.setDirectionMappings(e)}translate(e){if(e.type!=="query")throw new am.AlgebraTranslatorError("Only query operations are supported (not updates)");if(e.queryType==="SELECT")return this.translateSelect(e);if(e.queryType==="CONSTRUCT")return this.translateConstruct(e);if(e.queryType==="ASK")return this.translateAsk(e);if(e.queryType==="DESCRIBE")return this.translateDescribe(e);throw new am.AlgebraTranslatorError(`Query type ${String(e.queryType)} not yet supported`)}translateSelect(e){if(!e.where||e.where.length===0)throw new am.AlgebraTranslatorError("SELECT query must have WHERE clause");let t=this.patternTranslator.translateWhere(e.where);this.aggregateTranslator.resetCounter();let r=new Map,i=Array.isArray(e.variables)?e.variables.filter(l=>!("termType"in l&&l.termType==="Wildcard")):[],s=this.aggregateTranslator.extractAggregatesWithMapping(i,r),o=this.aggregateTranslator.extractGroupVariables(e.group),c=this.aggregateTranslator.extractHavingExpressions(e.having,s,r);if((s.length>0||o.length>0||c.length>0)&&(t={type:"group",variables:o,aggregates:s,having:c.length>0?c:void 0,input:t}),i.length>0){for(let l of i)if((0,cm.isVariableExpression)(l)){if("type"in l.expression&&l.expression.type==="aggregate")continue;let u=this.aggregateTranslator.transformExpressionWithAggregateVars(l.expression,r);t={type:"extend",variable:l.variable.value,expression:u,input:t}}}if(e.order&&e.order.length>0&&(t={type:"orderby",comparators:e.order.map(l=>this.aggregateTranslator.translateOrderComparator(l)),input:t}),i.length>0){let l=i.filter(u=>(0,cm.isVariableTerm)(u)||(0,cm.isVariableExpression)(u)).map(u=>(0,cm.isVariableTerm)(u)?u.value:u.variable.value);l.length>0&&(t={type:"project",variables:l,input:t})}return e.distinct&&(t={type:"distinct",input:t}),e.reduced&&(t={type:"reduced",input:t}),(e.limit!==void 0||e.offset!==void 0)&&(t={type:"slice",limit:e.limit,offset:e.offset,input:t}),t}translateConstruct(e){let t=this.tripleTranslator.translateConstructTemplate(e.template??[]);if(!e.where||e.where.length===0)throw new am.AlgebraTranslatorError("CONSTRUCT query must have WHERE clause");let r=this.patternTranslator.translateWhere(e.where),i=e;return(i.limit!==void 0||i.offset!==void 0)&&(r={type:"slice",limit:i.limit,offset:i.offset,input:r}),{type:"construct",template:t,where:r}}translateAsk(e){return{type:"ask",where:e.where&&e.where.length>0?this.patternTranslator.translateWhere(e.where):{type:"bgp",triples:[]}}}translateDescribe(e){let t=[];if(e.variables&&Array.isArray(e.variables)){let s=e.variables;for(let o of s)o.termType==="Wildcard"||o.value==="*"||(o.termType==="Variable"?t.push({type:"variable",value:o.value}):o.termType==="NamedNode"&&t.push({type:"iri",value:o.value}))}let r;e.where&&e.where.length>0&&(r=this.patternTranslator.translateWhere(e.where));let i=e.describeOptions;return{type:"describe",resources:t,where:r,depth:i?.depth,symmetric:i?.symmetric}}};na.ExoQLAlgebraTranslator=lm;na.AlgebraTranslator=lm});var _s=w(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.SolutionMapping=void 0;var oC=Ge(),aC=Oe(),cC=jt(),gw=class n{static{a(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 oC.Literal&&t instanceof oC.Literal?e.equals(t):e instanceof aC.IRI&&t instanceof aC.IRI?e.value===t.value:e instanceof cC.BlankNode&&t instanceof cC.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}};um.SolutionMapping=gw});var uC=w(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.PropertyPathExecutor=wl.PropertyPathExecutorError=void 0;var _U=_s(),fm=Oe(),lC=jt(),SU=Ge(),Sl=class extends Error{static{a(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};wl.PropertyPathExecutorError=Sl;var yw=class n{static{a(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){if(this.isLiteralElement(e)||this.isLiteralElement(r)){let o=this.isLiteralElement(e)?"subject":"object",c=this.isLiteralElement(e)?e:r,l="value"in c?String(c.value):"<unknown>",u=l.length>80?`${l.slice(0,77)}...`:l,f=this.describePath(t),d={position:o,value:u,path:f,hint:"Wikilink could not be resolved to IRI (likely label-form wikilink with no matching basename/alias). Check whether the target file exists in the queried vault, or add an alias. See issue #3282."};if(console.error(`[PropertyPathExecutor] literal-safety guard fired: literal in ${o} position \u2014 yielding 0 solutions. value="${u}" path=${f}`,d),n.isStrictModeEnabled())throw new Sl(`Literal subject in property path: "${u}" (path=${f}). Set EXOCORTEX_SPARQL_STRICT=0 or omit --strict to fall back to warn-and-empty behaviour.`);return}let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let o of i){let c=await this.evaluatePath(o,t,s);for(let l of c){let u=new _U.SolutionMapping;this.isVariable(e)&&u.set(e.value,o),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 o=t.merge(s);o!==null&&(yield o)}}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 o=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,o,c?r:null);for(let d of f)l.add(d)}if(i=l,i.size===0)break}return i}async evaluateAlternativePath(e,t,r){let i=new Set;for(let s of t){let o=await this.evaluatePathItem(e,s,r);for(let c of o)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new fm.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),o=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&o.add(c.subject);return o}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,o=[{node:e,depth:0}];for(;o.length>0;){let c=o.shift();if(!c)break;let{node:l,depth:u}=c;if(u>=this.MAX_DEPTH)continue;let f=await this.evaluatePathItem(l,t,null);for(let d of f){let h=this.nodeToKey(d);(r===null||this.nodeInSet(d,r))&&s.add(d),i.has(h)||(i.add(h),o.push({node:d,depth:u+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 o of s)i.add(o);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new fm.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),o=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&o.add(c.object);return o}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(t=>t.type==="iri"?{type:"path",pathType:"^",items:[t]}:this.invertPath(t))};case"|":return{type:"path",pathType:"|",items:e.items.map(t=>t.type==="iri"?{type:"path",pathType:"^",items:[t]}:this.invertPath(t))};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 fm.IRI(e.value));break;case"blank":t.add(new lC.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 fm.IRI)return{type:"iri",value:r.value};if(r instanceof lC.BlankNode)return{type:"blank",value:r.id};if(r instanceof SU.Literal)return{type:"literal",value:r.value,datatype:r.datatype?.value,language:r.language,direction:r.direction}}}return e}isVariable(e){return e.type==="variable"}isLiteralElement(e){return e.type==="literal"}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}describePath(e){try{let t=e.items,r=a(s=>{if(s&&typeof s=="object"&&"type"in s){let o=s;if(o.type==="iri")return`<${String(o.value)}>`;if(o.type==="path")return this.describePath(o)}return"?"},"renderItem");if(!Array.isArray(t)||t.length===0)return"(?)";if(t.length===1){let s=r(t[0]);return e.pathType==="^"?`(^${s})`:e.pathType==="+"||e.pathType==="*"||e.pathType==="?"?`(${s}${e.pathType})`:`(${s})`}return`(${t.map(r).join(` ${e.pathType} `)})`}catch{return"<unprintable-path>"}}static isStrictModeEnabled(){let t=(typeof process<"u"?process.env:void 0)?.EXOCORTEX_SPARQL_STRICT;if(!t)return!1;let r=t.trim().toLowerCase();return r==="1"||r==="true"||r==="yes"}};wl.PropertyPathExecutor=yw});var Sw=w(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.BGPExecutor=vl.BGPExecutorError=void 0;var dm=_s(),ia=Oe(),bw=Ge(),hm=jt(),pm=mf(),fC=uC(),qr=class extends Error{static{a(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};vl.BGPExecutorError=qr;var _w=class{static{a(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new fC.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new dm.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 dm.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 qr("Property paths within named graphs are not yet supported");let r=e.predicate;if(this.isLiteral(e.subject)||this.isLiteral(r)){this.warnLiteralGuard("matchTriplePatternInGraph",this.isLiteral(e.subject)?"subject":"predicate",this.isLiteral(e.subject)?e.subject:r);return}let i=this.isVariable(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),s=this.isVariable(r)?void 0:this.toRDFTermAsPredicate(r),o=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new qr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,o,t);for(let l of c){let u=new dm.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 o=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(o,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){if(this.isLiteral(e.subject)||this.isLiteral(e.object)){this.warnLiteralGuard("matchTriplePattern.propertyPath",this.isLiteral(e.subject)?"subject":"object",this.isLiteral(e.subject)?e.subject:e.object);return}yield*this.propertyPathExecutor.execute(e.subject,e.predicate,e.object);return}let t=e.predicate;if(this.isLiteral(e.subject)||this.isLiteral(t)){this.warnLiteralGuard("matchTriplePattern",this.isLiteral(e.subject)?"subject":"predicate",this.isLiteral(e.subject)?e.subject:t);return}let 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),o=await this.tripleStore.match(r,i,s);for(let c of o){let l=new dm.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,d]of u.entries())l.set(f,d)}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,d]of u.entries())l.set(f,d)}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 pm.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,o]of i)r.set(s,o)}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,o]of i)r.set(s,o)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof ia.IRI&&e.value===t.value;case"literal":return!(!(t instanceof bw.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof hm.BlankNode&&e.value===t.id;case"quoted":return t instanceof pm.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 o of this.matchTriplePattern(s)){let c=i.merge(o);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 ia.IRI?{type:"iri",value:r.value}:e}isVariable(e){return e.type==="variable"}isQuotedTriple(e){return e.type==="quoted"}isLiteral(e){return e.type==="literal"}warnLiteralGuard(e,t,r){let i="value"in r?String(r.value):"<unknown>",s=i.length>80?`${i.slice(0,77)}...`:i,o={executor:"BGPExecutor",context:e,position:t,value:s,hint:"Wikilink could not be resolved to IRI (likely label-form wikilink with no matching basename/alias). Check whether the target file exists in the queried vault, or add an alias. See issue #3282."};if(console.error(`[BGPExecutor] literal-safety guard fired in ${e}: literal in ${t} position \u2014 yielding 0 solutions. value="${s}"`,o),fC.PropertyPathExecutor.isStrictModeEnabled())throw new qr(`Literal in ${t} position (${e}): "${s}". Set EXOCORTEX_SPARQL_STRICT=0 or omit --strict to fall back to warn-and-empty behaviour.`)}toRDFTermAsSubject(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"blank":return new hm.BlankNode(e.value);case"literal":throw new qr("Literals cannot appear in subject position");case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new qr(`Unknown element type: ${String(e)}`)}}toRDFQuotedTriple(e){let t=this.toRDFTermAsSubject(e.subject),r=e.predicate.type==="iri"?new ia.IRI(e.predicate.value):(()=>{throw new qr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new pm.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"literal":throw new qr("Literals cannot appear in predicate position");case"blank":throw new qr("Blank nodes cannot appear in predicate position");case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new qr(`Unknown element type: ${String(e)}`)}}toRDFTerm(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"literal":return new bw.Literal(e.value,e.datatype?new ia.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new hm.BlankNode(e.value);case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new qr(`Unknown element type: ${String(e)}`)}}toAlgebraElement(e){if(e instanceof ia.IRI)return{type:"iri",value:e.value};if(e instanceof bw.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof hm.BlankNode)return{type:"blank",value:e.id};if(e instanceof pm.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new qr(`Unknown RDF term type: ${String(e)}`)}toAlgebraQuotedTriple(e){return{type:"quoted",subject:this.toAlgebraElement(e.subject),predicate:{type:"iri",value:e.predicate.value},object:this.toAlgebraElement(e.object)}}};vl.BGPExecutor=_w});var dC=w(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.StringFunctions=void 0;var El=Oe(),sa=Ge(),ww=jt(),kf=class n{static{a(this,"StringFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof El.IRI||e instanceof sa.Literal?e.value:e instanceof ww.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof sa.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof sa.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=n.parseDirectionalLangTag(e),[s,o]=n.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":o&&i!==o?!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 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 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",o=s.includes("u")?s:s+"u",c=new RegExp(t,o);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static encodeForUri(e){return encodeURIComponent(e)}static normalize(e,t){if(e===void 0)throw new Error("NORMALIZE: string argument is undefined");let r;if(e instanceof sa.Literal)r=e.value;else if(e instanceof El.IRI)r=e.value;else if(e instanceof ww.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 sa.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof El.IRI)i=t.value.toUpperCase();else throw new Error("NORMALIZE: second argument must be a string literal");if(!n.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 sa.Literal(s,new El.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 sa.Literal)t=e.value;else if(e instanceof El.IRI)t=e.value;else if(e instanceof ww.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=n.unicodeCaseFold(t);return new sa.Literal(r,new El.IRI("http://www.w3.org/2001/XMLSchema#string"))}static unicodeCaseFold(e){let t="";for(let r of e){let i=n.CASE_FOLDING_MAP.get(r);i!==void 0?t+=i:t+=r.toLowerCase()}return t}};mm.StringFunctions=kf;kf.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];kf.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 hC=w(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.MathFunctions=void 0;var vw=class{static{a(this,"MathFunctions")}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()}};gm.MathFunctions=vw});var Mf=w(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.DateTimeParsing=void 0;var wU=Oe(),vU=Ge(),Ew=class n{static{a(this,"DateTimeParsing")}static parseDate(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`PARSEDATE: invalid date string '${e}'`);return t.getTime()}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"),o="",c="";if(s===-1?o=r:(o=r.substring(0,s),c=r.substring(s+1)),o){let l=o.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(o!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${o}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let h=parseFloat(u[1]);i+=h*60*60*1e3,l=l.substring(u[0].length)}let f=l.match(/^(\d+(?:\.\d+)?)M/);if(f){let h=parseFloat(f[1]);i+=h*60*1e3,l=l.substring(f[0].length)}let d=l.match(/^(\d+(?:\.\d+)?)S$/);if(d){let h=parseFloat(d[1]);i+=h*1e3,l=l.substring(d[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 o=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||o>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),o>0&&(l+=`${o}M`),(c>0||s===0&&o===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return n.parseDayTimeDuration(e),new vU.Literal(e,new wU.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,o=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,o));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,d=parseInt(u[2],10),h=parseInt(u[3],10),p=f*(d*60+h)*60*1e3;l=new Date(l.getTime()-p)}}return l}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),o=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||o<0||o>59||i===24&&(s!==0||o!==0))return null;let u=0;if(c){let d=c.padEnd(3,"0").slice(0,3);u=parseInt(d,10)}let f=i*60*60*1e3+s*60*1e3+o*1e3+u;if(i===24&&(f=1440*60*1e3),l&&l!=="Z"){let d=l.match(/([+-])(\d{2}):(\d{2})/);if(d){let h=d[1]==="+"?1:-1,p=parseInt(d[2],10),g=parseInt(d[3],10),y=h*(p*60+g)*60*1e3;f-=y}}return f}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 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),o=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+o;return i?-c:c}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,o=t?"-P":"P";return i>0&&(o+=`${i}Y`),(s>0||i===0)&&(o+=`${s}M`),o}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),o=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:o,negative:i}}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,o=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 d=u.match(/^(\d+(?:\.\d+)?)D$/);if(d)i=parseFloat(d[1]);else if(u!=="")throw new Error(`parseDurationComponents: invalid day component: '${u}' in '${e}'`)}if(f){let d=f,h=d.match(/^(\d+(?:\.\d+)?)H/);h&&(s=parseFloat(h[1]),d=d.substring(h[0].length));let p=d.match(/^(\d+(?:\.\d+)?)M/);p&&(o=parseFloat(p[1]),d=d.substring(p[0].length));let g=d.match(/^(\d+(?:\.\d+)?)S$/);if(g&&(c=parseFloat(g[1]),d=d.substring(g[0].length)),d!=="")throw new Error(`parseDurationComponents: invalid time component: '${d}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:o,seconds:c}}};ym.DateTimeParsing=Ew});var pC=w(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.DateTimeArithmetic=void 0;var gn=Oe(),Ue=Ge(),it=Mf(),Tw=class{static{a(this,"DateTimeArithmetic")}static dateTimeDiff(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r),o=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(o.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-o.getTime(),l=it.DateTimeParsing.formatDayTimeDuration(c);return new Ue.Literal(l,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+o,l=new Date(c);return new Ue.Literal(l.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-o,l=new Date(c);return new Ue.Literal(l.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+o,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),d=String(l.getUTCDate()).padStart(2,"0"),h=`${u}-${f}-${d}`;return new Ue.Literal(h,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-o,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),d=String(l.getUTCDate()).padStart(2,"0"),h=`${u}-${f}-${d}`;return new Ue.Literal(h,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateTimeAddYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+o),s.getUTCDate()!==c&&s.setUTCDate(0),new Ue.Literal(s.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-o),s.getUTCDate()!==c&&s.setUTCDate(0),new Ue.Literal(s.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+o),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"),d=`${l}-${u}-${f}`;return new Ue.Literal(d,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-o),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"),d=`${l}-${u}-${f}`;return new Ue.Literal(d,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseDayTimeDuration(r),o=it.DateTimeParsing.parseDayTimeDuration(i),c=it.DateTimeParsing.formatDayTimeDuration(s+o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseDayTimeDuration(r),o=it.DateTimeParsing.parseDayTimeDuration(i),c=it.DateTimeParsing.formatDayTimeDuration(s-o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof Ue.Literal?e.value:e,i=it.DateTimeParsing.parseDayTimeDuration(r),s=it.DateTimeParsing.formatDayTimeDuration(i*t);return new Ue.Literal(s,new gn.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 Ue.Literal?e.value:e,i=it.DateTimeParsing.parseDayTimeDuration(r),s=it.DateTimeParsing.formatDayTimeDuration(i/t);return new Ue.Literal(s,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static yearMonthDurationAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseYearMonthDuration(r),o=it.DateTimeParsing.parseYearMonthDuration(i),c=it.DateTimeParsing.formatYearMonthDuration(s+o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseYearMonthDuration(r),o=it.DateTimeParsing.parseYearMonthDuration(i),c=it.DateTimeParsing.formatYearMonthDuration(s-o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static durationToDays(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/1e3}};bm.DateTimeArithmetic=Tw});var mC=w(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.DateTimeAccessors=void 0;var jf=Oe(),$t=Ge(),Rt=Mf(),Aw=class{static{a(this,"DateTimeAccessors")}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 durationDays(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static durationYears(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.months:r.months}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),o=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);o===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${o}M`}else{let s=-t.getTimezoneOffset(),o=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${o}H`:r=`${l}PT${o}H${c}M`}}return new $t.Literal(r,new jf.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 adjust(e,t){let r=e instanceof $t.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let R=i.getUTCFullYear(),B=String(i.getUTCMonth()+1).padStart(2,"0"),L=String(i.getUTCDate()).padStart(2,"0"),P=String(i.getUTCHours()).padStart(2,"0"),M=String(i.getUTCMinutes()).padStart(2,"0"),O=String(i.getUTCSeconds()).padStart(2,"0"),Y=i.getUTCMilliseconds(),oe=`${R}-${B}-${L}T${P}:${M}:${O}`;return Y>0&&(oe+=`.${String(Y).padStart(3,"0")}`),new $t.Literal(oe,new jf.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof $t.Literal?t.value:t,o=Rt.DateTimeParsing.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(o)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+o),f=u.getUTCFullYear(),d=String(u.getUTCMonth()+1).padStart(2,"0"),h=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),g=String(u.getUTCMinutes()).padStart(2,"0"),y=String(u.getUTCSeconds()).padStart(2,"0"),b=u.getUTCMilliseconds(),S=o>=0?"+":"-",v=Math.floor(Math.abs(o)/(3600*1e3)),I=Math.floor(Math.abs(o)%(3600*1e3)/(60*1e3)),A=`${S}${String(v).padStart(2,"0")}:${String(I).padStart(2,"0")}`,T=`${f}-${d}-${h}T${p}:${g}:${y}`;return b>0&&(T+=`.${String(b).padStart(3,"0")}`),T+=A,new $t.Literal(T,new jf.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static now(){return new Date().toISOString()}static dateBefore(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t);return r<i}static dateAfter(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t);return r>i}static dateInRange(e,t,r){let i=Rt.DateTimeParsing.parseDate(e),s=Rt.DateTimeParsing.parseDate(t),o=Rt.DateTimeParsing.parseDate(r);return i>=s&&i<=o}static compareDurations(e,t,r){let i=e instanceof $t.Literal?e.value:e,s=t instanceof $t.Literal?t.value:t,o=Rt.DateTimeParsing.parseDayTimeDuration(i),c=Rt.DateTimeParsing.parseDayTimeDuration(s);switch(r){case"=":return o===c;case"!=":return o!==c;case"<":return o<c;case">":return o>c;case"<=":return o<=c;case">=":return o>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static dateDiffMinutes(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60*60)*100)/100}static timeDiff(e,t){let r=e instanceof $t.Literal?e.value:e,i=t instanceof $t.Literal?t.value:t,s=Rt.DateTimeParsing.parseXSDTime(r),o=Rt.DateTimeParsing.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(o===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-o,l=Rt.DateTimeParsing.formatDayTimeDuration(c);return new $t.Literal(l,new jf.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static isDayTimeDuration(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static isYearMonthDuration(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static isTime(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static dateDiff(e,t){let r=e instanceof $t.Literal?e.value:e,i=t instanceof $t.Literal?t.value:t,s=Rt.DateTimeParsing.parseXSDDate(r),o=Rt.DateTimeParsing.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(o===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-o.getTime(),l=Math.round(c/(1440*60*1e3)),u=Rt.DateTimeParsing.formatDateDuration(l);return new $t.Literal(u,new jf.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}};_m.DateTimeAccessors=Aw});var wm=w(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.DateTimeFunctions=void 0;var Tl=Mf(),gr=pC(),vt=mC(),Iw=class{static{a(this,"DateTimeFunctions")}static parseDate(e){return Tl.DateTimeParsing.parseDate(e)}static parseDayTimeDuration(e){return Tl.DateTimeParsing.parseDayTimeDuration(e)}static formatDayTimeDuration(e){return Tl.DateTimeParsing.formatDayTimeDuration(e)}static xsdDayTimeDuration(e){return Tl.DateTimeParsing.xsdDayTimeDuration(e)}static parseYearMonthDuration(e){return Tl.DateTimeParsing.parseYearMonthDuration(e)}static formatYearMonthDuration(e){return Tl.DateTimeParsing.formatYearMonthDuration(e)}static year(e){return vt.DateTimeAccessors.year(e)}static month(e){return vt.DateTimeAccessors.month(e)}static day(e){return vt.DateTimeAccessors.day(e)}static hours(e){return vt.DateTimeAccessors.hours(e)}static minutes(e){return vt.DateTimeAccessors.minutes(e)}static seconds(e){return vt.DateTimeAccessors.seconds(e)}static durationDays(e){return vt.DateTimeAccessors.durationDays(e)}static durationHours(e){return vt.DateTimeAccessors.durationHours(e)}static durationMinutes(e){return vt.DateTimeAccessors.durationMinutes(e)}static durationSeconds(e){return vt.DateTimeAccessors.durationSeconds(e)}static durationYears(e){return vt.DateTimeAccessors.durationYears(e)}static durationMonths(e){return vt.DateTimeAccessors.durationMonths(e)}static timezone(e){return vt.DateTimeAccessors.timezone(e)}static tz(e){return vt.DateTimeAccessors.tz(e)}static adjust(e,t){return vt.DateTimeAccessors.adjust(e,t)}static now(){return vt.DateTimeAccessors.now()}static dateBefore(e,t){return vt.DateTimeAccessors.dateBefore(e,t)}static dateAfter(e,t){return vt.DateTimeAccessors.dateAfter(e,t)}static dateInRange(e,t,r){return vt.DateTimeAccessors.dateInRange(e,t,r)}static compareDurations(e,t,r){return vt.DateTimeAccessors.compareDurations(e,t,r)}static dateDiffMinutes(e,t){return vt.DateTimeAccessors.dateDiffMinutes(e,t)}static dateDiffHours(e,t){return vt.DateTimeAccessors.dateDiffHours(e,t)}static timeDiff(e,t){return vt.DateTimeAccessors.timeDiff(e,t)}static dateDiff(e,t){return vt.DateTimeAccessors.dateDiff(e,t)}static isDayTimeDuration(e){return vt.DateTimeAccessors.isDayTimeDuration(e)}static isDate(e){return vt.DateTimeAccessors.isDate(e)}static isYearMonthDuration(e){return vt.DateTimeAccessors.isYearMonthDuration(e)}static isTime(e){return vt.DateTimeAccessors.isTime(e)}static dateTimeDiff(e,t){return gr.DateTimeArithmetic.dateTimeDiff(e,t)}static dateTimeAdd(e,t){return gr.DateTimeArithmetic.dateTimeAdd(e,t)}static dateTimeSubtract(e,t){return gr.DateTimeArithmetic.dateTimeSubtract(e,t)}static dateAdd(e,t){return gr.DateTimeArithmetic.dateAdd(e,t)}static dateSubtract(e,t){return gr.DateTimeArithmetic.dateSubtract(e,t)}static dateTimeAddYearMonth(e,t){return gr.DateTimeArithmetic.dateTimeAddYearMonth(e,t)}static dateTimeSubtractYearMonth(e,t){return gr.DateTimeArithmetic.dateTimeSubtractYearMonth(e,t)}static dateAddYearMonth(e,t){return gr.DateTimeArithmetic.dateAddYearMonth(e,t)}static dateSubtractYearMonth(e,t){return gr.DateTimeArithmetic.dateSubtractYearMonth(e,t)}static durationAdd(e,t){return gr.DateTimeArithmetic.durationAdd(e,t)}static durationSubtract(e,t){return gr.DateTimeArithmetic.durationSubtract(e,t)}static durationMultiply(e,t){return gr.DateTimeArithmetic.durationMultiply(e,t)}static durationDivide(e,t){return gr.DateTimeArithmetic.durationDivide(e,t)}static yearMonthDurationAdd(e,t){return gr.DateTimeArithmetic.yearMonthDurationAdd(e,t)}static yearMonthDurationSubtract(e,t){return gr.DateTimeArithmetic.yearMonthDurationSubtract(e,t)}static durationToDays(e){return gr.DateTimeArithmetic.durationToDays(e)}static durationToHours(e){return gr.DateTimeArithmetic.durationToHours(e)}static durationToMinutes(e){return gr.DateTimeArithmetic.durationToMinutes(e)}static durationToSeconds(e){return gr.DateTimeArithmetic.durationToSeconds(e)}};Sm.DateTimeFunctions=Iw});var gC=w(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.LogicalFunctions=void 0;var EU=Oe(),Al=Ge(),TU=jt(),vm=wm(),xw=class n{static{a(this,"LogicalFunctions")}static compare(e,t,r){if(n.isDayTimeDurationValue(e)&&n.isDayTimeDurationValue(t))return vm.DateTimeFunctions.compareDurations(e instanceof Al.Literal?e:String(e),t instanceof Al.Literal?t:String(t),r);if(n.isDayTimeDurationValue(e)&&typeof t=="string"&&/^-?P/.test(t))return vm.DateTimeFunctions.compareDurations(e instanceof Al.Literal?e:String(e),t,r);if(typeof e=="string"&&/^-?P/.test(e)&&n.isDayTimeDurationValue(t))return vm.DateTimeFunctions.compareDurations(e,t instanceof Al.Literal?t:String(t),r);let i=n.toComparableValue(e),s=n.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 Al.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 Al.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 vm.DateTimeFunctions.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof EU.IRI?e.value:e instanceof TU.BlankNode?e.id:String(e)}static logicalAnd(e){return e.every(t=>t===!0)}static logicalOr(e){return e.some(t=>t===!0)}static logicalNot(e){return!e}static coalesce(e){for(let t of e)if(t!=null)return t}static if(e,t,r){return e?t:r}};Em.LogicalFunctions=xw});var yC=w(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.RDFTermFunctions=void 0;var Gr=Oe(),xt=Ge(),Ci=jt(),Il=mf(),Rw=Ii(),Cw=class n{static{a(this,"RDFTermFunctions")}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof xt.Literal)return e.datatype?e.datatype:e.language?new Gr.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Gr.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 Gr.IRI}static isBlank(e){return e===void 0?!1:e instanceof Ci.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof xt.Literal}static isTriple(e){return e===void 0?!1:e instanceof Il.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof xt.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof xt.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 xsdDateTime(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`xsd:dateTime: invalid date string '${e}'`);return new xt.Literal(t.toISOString(),new Gr.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 xt.Literal(String(t),new Gr.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 xt.Literal(String(t),new Gr.IRI("http://www.w3.org/2001/XMLSchema#decimal"))}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 Gr.IRI&&t instanceof Gr.IRI)return e.value===t.value;if(e instanceof Ci.BlankNode&&t instanceof Ci.BlankNode)return e.id===t.id;if(e instanceof xt.Literal&&t instanceof xt.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 Gr.IRI)return e;if(e instanceof xt.Literal)return new Gr.IRI(e.value);throw e instanceof Ci.BlankNode?new Error("IRI: cannot convert blank node to IRI"):new Error("IRI: unsupported term type")}static uri(e){return n.iri(e)}static bnode(e){if(e===void 0){let t=`b${(0,Rw.v4)().replace(/-/g,"").substring(0,12)}`;return new Ci.BlankNode(t)}if(e instanceof xt.Literal)return new Ci.BlankNode(e.value);if(e instanceof Ci.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 xt.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 Gr.IRI)i=t;else if(t instanceof xt.Literal)i=new Gr.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new xt.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 xt.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 xt.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 xt.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 xt.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 xt.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 o;if(r instanceof xt.Literal)o=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(o!=="ltr"&&o!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${o}'. Must be 'ltr' or 'rtl'`);return new xt.Literal(i,void 0,s,o)}static uuid(){let e=(0,Rw.v4)();return new Gr.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,Rw.v4)();return new xt.Literal(e)}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 xt.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Gr.IRI)){let c=t instanceof xt.Literal?"Literal":t instanceof Ci.BlankNode?"BlankNode":t instanceof Il.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,o=r;return new Il.QuotedTriple(i,s,o)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.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 Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.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 Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};Tm.RDFTermFunctions=Cw});var bC=w(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.HashFunctions=void 0;var Ow=class{static{a(this,"HashFunctions")}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")}};Am.HashFunctions=Ow});var xm=w(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.BuiltInFunctions=void 0;var yr=dC(),oa=hC(),Re=wm(),xl=gC(),Ft=yC(),$f=bC(),Pw=class{static{a(this,"BuiltInFunctions")}static str(...e){return yr.StringFunctions.str(...e)}static lang(...e){return yr.StringFunctions.lang(...e)}static langdir(...e){return yr.StringFunctions.langdir(...e)}static langMatches(...e){return yr.StringFunctions.langMatches(...e)}static regex(...e){return yr.StringFunctions.regex(...e)}static contains(...e){return yr.StringFunctions.contains(...e)}static strStarts(...e){return yr.StringFunctions.strStarts(...e)}static strEnds(...e){return yr.StringFunctions.strEnds(...e)}static strlen(...e){return yr.StringFunctions.strlen(...e)}static ucase(...e){return yr.StringFunctions.ucase(...e)}static lcase(...e){return yr.StringFunctions.lcase(...e)}static substr(...e){return yr.StringFunctions.substr(...e)}static strBefore(...e){return yr.StringFunctions.strBefore(...e)}static strAfter(...e){return yr.StringFunctions.strAfter(...e)}static concat(...e){return yr.StringFunctions.concat(...e)}static replace(...e){return yr.StringFunctions.replace(...e)}static encodeForUri(...e){return yr.StringFunctions.encodeForUri(...e)}static normalize(...e){return yr.StringFunctions.normalize(...e)}static fold(...e){return yr.StringFunctions.fold(...e)}static abs(...e){return oa.MathFunctions.abs(...e)}static round(...e){return oa.MathFunctions.round(...e)}static ceil(...e){return oa.MathFunctions.ceil(...e)}static floor(...e){return oa.MathFunctions.floor(...e)}static rand(){return oa.MathFunctions.rand()}static msToMinutes(...e){return oa.MathFunctions.msToMinutes(...e)}static msToHours(...e){return oa.MathFunctions.msToHours(...e)}static msToSeconds(...e){return oa.MathFunctions.msToSeconds(...e)}static parseDate(...e){return Re.DateTimeFunctions.parseDate(...e)}static dateBefore(...e){return Re.DateTimeFunctions.dateBefore(...e)}static dateAfter(...e){return Re.DateTimeFunctions.dateAfter(...e)}static dateInRange(...e){return Re.DateTimeFunctions.dateInRange(...e)}static dateDiffMinutes(...e){return Re.DateTimeFunctions.dateDiffMinutes(...e)}static dateDiffHours(...e){return Re.DateTimeFunctions.dateDiffHours(...e)}static year(...e){return Re.DateTimeFunctions.year(...e)}static month(...e){return Re.DateTimeFunctions.month(...e)}static day(...e){return Re.DateTimeFunctions.day(...e)}static hours(...e){return Re.DateTimeFunctions.hours(...e)}static minutes(...e){return Re.DateTimeFunctions.minutes(...e)}static seconds(...e){return Re.DateTimeFunctions.seconds(...e)}static timezone(...e){return Re.DateTimeFunctions.timezone(...e)}static tz(...e){return Re.DateTimeFunctions.tz(...e)}static now(){return Re.DateTimeFunctions.now()}static parseDayTimeDuration(...e){return Re.DateTimeFunctions.parseDayTimeDuration(...e)}static formatDayTimeDuration(...e){return Re.DateTimeFunctions.formatDayTimeDuration(...e)}static xsdDayTimeDuration(...e){return Re.DateTimeFunctions.xsdDayTimeDuration(...e)}static compareDurations(...e){return Re.DateTimeFunctions.compareDurations(...e)}static isDayTimeDuration(...e){return Re.DateTimeFunctions.isDayTimeDuration(...e)}static isDate(...e){return Re.DateTimeFunctions.isDate(...e)}static dateDiff(...e){return Re.DateTimeFunctions.dateDiff(...e)}static dateTimeDiff(...e){return Re.DateTimeFunctions.dateTimeDiff(...e)}static dateTimeAdd(...e){return Re.DateTimeFunctions.dateTimeAdd(...e)}static dateTimeSubtract(...e){return Re.DateTimeFunctions.dateTimeSubtract(...e)}static dateAdd(...e){return Re.DateTimeFunctions.dateAdd(...e)}static dateSubtract(...e){return Re.DateTimeFunctions.dateSubtract(...e)}static parseYearMonthDuration(...e){return Re.DateTimeFunctions.parseYearMonthDuration(...e)}static isYearMonthDuration(...e){return Re.DateTimeFunctions.isYearMonthDuration(...e)}static dateTimeAddYearMonth(...e){return Re.DateTimeFunctions.dateTimeAddYearMonth(...e)}static dateTimeSubtractYearMonth(...e){return Re.DateTimeFunctions.dateTimeSubtractYearMonth(...e)}static dateAddYearMonth(...e){return Re.DateTimeFunctions.dateAddYearMonth(...e)}static dateSubtractYearMonth(...e){return Re.DateTimeFunctions.dateSubtractYearMonth(...e)}static durationAdd(...e){return Re.DateTimeFunctions.durationAdd(...e)}static durationSubtract(...e){return Re.DateTimeFunctions.durationSubtract(...e)}static durationMultiply(...e){return Re.DateTimeFunctions.durationMultiply(...e)}static durationDivide(...e){return Re.DateTimeFunctions.durationDivide(...e)}static formatYearMonthDuration(...e){return Re.DateTimeFunctions.formatYearMonthDuration(...e)}static yearMonthDurationAdd(...e){return Re.DateTimeFunctions.yearMonthDurationAdd(...e)}static yearMonthDurationSubtract(...e){return Re.DateTimeFunctions.yearMonthDurationSubtract(...e)}static durationYears(...e){return Re.DateTimeFunctions.durationYears(...e)}static durationMonths(...e){return Re.DateTimeFunctions.durationMonths(...e)}static durationToDays(...e){return Re.DateTimeFunctions.durationToDays(...e)}static durationToHours(...e){return Re.DateTimeFunctions.durationToHours(...e)}static durationToMinutes(...e){return Re.DateTimeFunctions.durationToMinutes(...e)}static durationToSeconds(...e){return Re.DateTimeFunctions.durationToSeconds(...e)}static durationDays(...e){return Re.DateTimeFunctions.durationDays(...e)}static durationHours(...e){return Re.DateTimeFunctions.durationHours(...e)}static durationMinutes(...e){return Re.DateTimeFunctions.durationMinutes(...e)}static durationSeconds(...e){return Re.DateTimeFunctions.durationSeconds(...e)}static adjust(...e){return Re.DateTimeFunctions.adjust(...e)}static isTime(...e){return Re.DateTimeFunctions.isTime(...e)}static timeDiff(...e){return Re.DateTimeFunctions.timeDiff(...e)}static compare(...e){return xl.LogicalFunctions.compare(...e)}static logicalAnd(...e){return xl.LogicalFunctions.logicalAnd(...e)}static logicalOr(...e){return xl.LogicalFunctions.logicalOr(...e)}static logicalNot(...e){return xl.LogicalFunctions.logicalNot(...e)}static coalesce(...e){return xl.LogicalFunctions.coalesce(...e)}static if(...e){return xl.LogicalFunctions.if(...e)}static datatype(...e){return Ft.RDFTermFunctions.datatype(...e)}static bound(...e){return Ft.RDFTermFunctions.bound(...e)}static isIRI(...e){return Ft.RDFTermFunctions.isIRI(...e)}static isBlank(...e){return Ft.RDFTermFunctions.isBlank(...e)}static isLiteral(...e){return Ft.RDFTermFunctions.isLiteral(...e)}static isTriple(...e){return Ft.RDFTermFunctions.isTriple(...e)}static isNumeric(...e){return Ft.RDFTermFunctions.isNumeric(...e)}static hasLangdir(...e){return Ft.RDFTermFunctions.hasLangdir(...e)}static sameTerm(...e){return Ft.RDFTermFunctions.sameTerm(...e)}static iri(...e){return Ft.RDFTermFunctions.iri(...e)}static uri(...e){return Ft.RDFTermFunctions.uri(...e)}static bnode(...e){return Ft.RDFTermFunctions.bnode(...e)}static strdt(...e){return Ft.RDFTermFunctions.strdt(...e)}static strlang(...e){return Ft.RDFTermFunctions.strlang(...e)}static strlangdir(...e){return Ft.RDFTermFunctions.strlangdir(...e)}static uuid(){return Ft.RDFTermFunctions.uuid()}static struuid(){return Ft.RDFTermFunctions.struuid()}static xsdDateTime(...e){return Ft.RDFTermFunctions.xsdDateTime(...e)}static xsdInteger(...e){return Ft.RDFTermFunctions.xsdInteger(...e)}static xsdDecimal(...e){return Ft.RDFTermFunctions.xsdDecimal(...e)}static triple(...e){return Ft.RDFTermFunctions.triple(...e)}static subject(...e){return Ft.RDFTermFunctions.subject(...e)}static predicate(...e){return Ft.RDFTermFunctions.predicate(...e)}static object(...e){return Ft.RDFTermFunctions.object(...e)}static md5(...e){return $f.HashFunctions.md5(...e)}static sha1(...e){return $f.HashFunctions.sha1(...e)}static sha256(...e){return $f.HashFunctions.sha256(...e)}static sha384(...e){return $f.HashFunctions.sha384(...e)}static sha512(...e){return $f.HashFunctions.sha512(...e)}};Im.BuiltInFunctions=Pw});var Uf=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ExoQLBudgetExceededError=Ss.ExoQLCycleError=Ss.ExoQLEvalDisabledError=Ss.ExoQLForbiddenKeywordError=void 0;var Fw=class extends Error{static{a(this,"ExoQLForbiddenKeywordError")}constructor(e,t){super(t??`ExoQLForbiddenKeywordError: keyword "${e}" is not permitted by the exoql__Query AST allowlist`),this.name="ExoQLForbiddenKeywordError",this.keyword=e}};Ss.ExoQLForbiddenKeywordError=Fw;var Dw=class extends Error{static{a(this,"ExoQLEvalDisabledError")}constructor(e){super(e??"ExoQLEvalDisabledError: exoql.eval.enabled is false (default). Flip the feature flag to opt in."),this.name="ExoQLEvalDisabledError"}};Ss.ExoQLEvalDisabledError=Dw;var Lw=class extends Error{static{a(this,"ExoQLCycleError")}constructor(e,t){super(t??`ExoQLCycleError: cycle detected in nested exo:eval invocations: ${e.join(" \u2192 ")}`),this.name="ExoQLCycleError",this.path=e}};Ss.ExoQLCycleError=Lw;var Nw=class extends Error{static{a(this,"ExoQLBudgetExceededError")}constructor(e,t,r,i){super(i??`ExoQLBudgetExceededError: ${e} budget exceeded (limit=${t}, observed=${r})`),this.name="ExoQLBudgetExceededError",this.budget=e,this.limit=t,this.observed=r}};Ss.ExoQLBudgetExceededError=Nw});var xC=w(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.functionHandlers=void 0;var z=xm();K.functionHandlers=new Map;K.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.str(t)});K.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.lang(t)});K.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 z.BuiltInFunctions.langMatches(t,r)});K.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 z.BuiltInFunctions.contains(t,r)});K.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 z.BuiltInFunctions.strStarts(t,r)});K.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 z.BuiltInFunctions.strEnds(t,r)});K.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.strlen(t)});K.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.ucase(t)});K.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.lcase(t)});K.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 z.BuiltInFunctions.substr(t,r,i)}return z.BuiltInFunctions.substr(t,r)});K.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 z.BuiltInFunctions.strBefore(t,r)});K.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 z.BuiltInFunctions.strAfter(t,r)});K.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return z.BuiltInFunctions.concat(...t)});K.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 z.BuiltInFunctions.replace(t,r,i,s)});K.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 z.BuiltInFunctions.regex(t,r,i)});K.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.encodeForUri(t)});K.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.datatype(t).value});K.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return z.BuiltInFunctions.bound(r)}return!0});var _C=a((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isIRI(t)},"isIriHandler");K.functionHandlers.set("isiri",_C);K.functionHandlers.set("isuri",_C);K.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isBlank(t)});K.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isLiteral(t)});K.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isNumeric(t)});K.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.hasLangdir(t)});K.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isTriple(t)});K.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return z.BuiltInFunctions.sameTerm(t,r)});K.functionHandlers.set("abs",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.abs(t)});K.functionHandlers.set("round",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.round(t)});K.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.ceil(t)});K.functionHandlers.set("floor",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.floor(t)});K.functionHandlers.set("rand",()=>z.BuiltInFunctions.rand());K.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.parseDate(t)});K.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 z.BuiltInFunctions.dateBefore(t,r)});K.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 z.BuiltInFunctions.dateAfter(t,r)});K.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 z.BuiltInFunctions.dateInRange(t,r,i)});K.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 z.BuiltInFunctions.dateDiffMinutes(t,r)});K.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 z.BuiltInFunctions.dateDiffHours(t,r)});var Rl=a((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"),SC=Rl(z.BuiltInFunctions.year.bind(z.BuiltInFunctions),z.BuiltInFunctions.durationYears.bind(z.BuiltInFunctions),null);K.functionHandlers.set("year",SC);K.functionHandlers.set("years",SC);var wC=Rl(z.BuiltInFunctions.month.bind(z.BuiltInFunctions),z.BuiltInFunctions.durationMonths.bind(z.BuiltInFunctions),null);K.functionHandlers.set("month",wC);K.functionHandlers.set("months",wC);var vC=Rl(z.BuiltInFunctions.day.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationDays.bind(z.BuiltInFunctions));K.functionHandlers.set("day",vC);K.functionHandlers.set("days",vC);K.functionHandlers.set("hours",Rl(z.BuiltInFunctions.hours.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationHours.bind(z.BuiltInFunctions)));K.functionHandlers.set("minutes",Rl(z.BuiltInFunctions.minutes.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationMinutes.bind(z.BuiltInFunctions)));K.functionHandlers.set("seconds",Rl(z.BuiltInFunctions.seconds.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationSeconds.bind(z.BuiltInFunctions)));K.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.timezone(t)});K.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.tz(t)});K.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 z.BuiltInFunctions.adjust(t,r)});K.functionHandlers.set("now",()=>z.BuiltInFunctions.now());var EC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");K.functionHandlers.set("datetime",EC);K.functionHandlers.set("xsd:datetime",EC);var TC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");K.functionHandlers.set("integer",TC);K.functionHandlers.set("xsd:integer",TC);var AC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");K.functionHandlers.set("decimal",AC);K.functionHandlers.set("xsd:decimal",AC);var IC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");K.functionHandlers.set("daytimeduration",IC);K.functionHandlers.set("xsd:daytimeduration",IC);K.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToDays(t)});K.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToHours(t)});K.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToMinutes(t)});K.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToSeconds(t)});K.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationDays(t)});K.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationHours(t)});K.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationMinutes(t)});K.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationSeconds(t)});K.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationYears(t)});K.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationMonths(t)});K.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeDiff(t,r)});K.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeAdd(t,r)});K.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeSubtract(t,r)});K.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToMinutes(t)});K.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToHours(t)});K.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToSeconds(t)});K.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.md5(t)});K.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha1(t)});K.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha256(t)});K.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha384(t)});K.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha512(t)});K.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.subject(t)});K.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.predicate(t)});K.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.object(t)});K.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 z.BuiltInFunctions.triple(t,r,i)});K.functionHandlers.set("days_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t),s=new Date(r);return Math.floor((s.getTime()-i.getTime())/(1440*60*1e3))});K.functionHandlers.set("minutes_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t),s=new Date(r);return Math.floor((s.getTime()-i.getTime())/(60*1e3))});K.functionHandlers.set("hours_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t);return(new Date(r).getTime()-i.getTime())/(3600*1e3)});K.functionHandlers.set("age_days",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=new Date(t);return Math.floor((new Date().getTime()-r.getTime())/(1440*60*1e3))});K.functionHandlers.set("week_number",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=new Date(t),i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate()));i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7));let s=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i.getTime()-s.getTime())/(1440*60*1e3)+1)/7)});K.functionHandlers.set("format_date",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t);return r.replace("YYYY",String(i.getFullYear())).replace("MM",String(i.getMonth()+1).padStart(2,"0")).replace("DD",String(i.getDate()).padStart(2,"0")).replace("HH",String(i.getHours()).padStart(2,"0")).replace("mm",String(i.getMinutes()).padStart(2,"0")).replace("ss",String(i.getSeconds()).padStart(2,"0"))});K.functionHandlers.set("exo:eval",()=>{let{ExoQLEvalDisabledError:n}=Uf();throw new n})});var Rm=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.FilterExecutor=Cl.FilterExecutorError=void 0;var Et=xm(),AU=xC(),kw=Oe(),ws=Ge(),Ar=class extends Error{static{a(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};Cl.FilterExecutorError=Ar;var Mw=class{static{a(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||typeof e!="object")return!1;if(e.type==="exists")return!0;if(e.type==="logical")return e.operands.some(t=>this.expressionContainsExists(t));if(e.type==="comparison"){let t=e;return this.expressionContainsExists(t.left)||this.expressionContainsExists(t.right)}if(e.type==="arithmetic"){let t=e;return this.expressionContainsExists(t.left)||this.expressionContainsExists(t.right)}if(e.type==="in"){let t=e;return this.expressionContainsExists(t.expression)||t.list.some(r=>this.expressionContainsExists(r))}if(e.type==="function"||e.type==="functionCall"){let t=e;return Array.isArray(t.args)?t.args.some(r=>this.expressionContainsExists(r)):!1}return!1}async executeAll(e,t){let r=[];async function*i(){for(let s of t)yield s}a(i,"generator");for await(let s of this.execute(e,i()))r.push(s);return r}evaluateExpression(e,t){let r=e;if("termType"in e)switch(r.termType){case"Variable":return t.get(r.value);case"Literal":{let i=r.value,s=r.datatype,o=typeof s=="string"?s:s?.value;return o&&i.length>0&&this.shouldPreserveDatatype(o)?new ws.Literal(i,new kw.IRI(o)):i}case"NamedNode":return r.value;default:throw new Ar(`Unsupported termType: ${String(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":{let i=e;return i.datatype&&i.value.length>0&&this.shouldPreserveDatatype(i.datatype)?new ws.Literal(i.value,new kw.IRI(i.datatype)):i.value}case"in":return this.evaluateIn(e,t);case"exists":throw new Ar("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new Ar(`Unsupported expression type: ${e.type}`)}}async evaluateExpressionAsync(e,t){if(!this.expressionContainsExists(e))return this.evaluateExpression(e,t);if(e.type==="exists")return this.evaluateExists(e,t);if(e.type==="logical")return this.evaluateLogicalAsync(e,t);if(e.type==="comparison"){let r=e,i=await this.evaluateExpressionAsync(r.left,t),s=await this.evaluateExpressionAsync(r.right,t);return Et.BuiltInFunctions.compare(i,s,r.operator)}return e.type==="in"?this.evaluateInAsync(e,t):e.type==="function"||e.type==="functionCall"?this.evaluateFunctionAsync(e,t):this.evaluateExpression(e,t)}async evaluateExists(e,t){if(!this.existsEvaluator)throw new Ar("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 Et.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 Et.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return Et.BuiltInFunctions.logicalOr(r);throw new Ar(`Unknown logical operator: ${String(e.operator)}`)}async evaluateInAsync(e,t){let r=await this.evaluateExpressionAsync(e.expression,t),i=!1;for(let s of e.list){let o=await this.evaluateExpressionAsync(s,t);if(Et.BuiltInFunctions.compare(r,o,"=")){i=!0;break}}return e.negated?!i:i}async evaluateFunctionAsync(e,t){let r=e,i=this.extractFunctionName(r.function),s=r.args??[];if(i==="if"){if(s.length!==3)throw new Ar("IF requires exactly 3 arguments");let l=await this.evaluateExpressionAsync(s[0],t);return this.toBoolean(l)?this.evaluateExpressionAsync(s[1],t):this.evaluateExpressionAsync(s[2],t)}if(i==="coalesce"){for(let l of s)try{let u=await this.evaluateExpressionAsync(l,t);if(u!=null)return u}catch{continue}return}let o=[];for(let l of s){let u=await this.evaluateExpressionAsync(l,t);o.push(this.wrapAsLiteralExpression(u))}let c={...r,args:o};return this.evaluateFunction(c,t)}wrapAsLiteralExpression(e){return e==null?{type:"literal",value:""}:typeof e=="object"&&"termType"in e?e:e instanceof kw.IRI||e instanceof ws.Literal?{type:"literal",value:e.value}:typeof e=="number"||typeof e=="boolean"||typeof e=="string"?{type:"literal",value:e}:{type:"literal",value:String(e)}}evaluateComparison(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);return Et.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return Et.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return Et.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return Et.BuiltInFunctions.logicalOr(r);throw new Ar(`Unknown logical operator: ${String(e.operator)}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let o=this.evaluateExpression(s,t);return Et.BuiltInFunctions.compare(r,o,"=")});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 Et.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return Et.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return Et.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return Et.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return Et.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new Ar("Division by zero");return Et.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),o=this.toNumericValue(i);switch(e.operator){case"+":return s+o;case"-":return s-o;case"*":return s*o;case"/":if(o===0)throw new Ar("Division by zero");return s/o;default:throw new Ar(`Unknown arithmetic operator: ${String(e.operator)}`)}}shouldPreserveDatatype(e){return e==="http://www.w3.org/2001/XMLSchema#dateTime"||e==="http://www.w3.org/2001/XMLSchema#date"||e==="http://www.w3.org/2001/XMLSchema#time"||e==="http://www.w3.org/2001/XMLSchema#dayTimeDuration"||e==="http://www.w3.org/2001/XMLSchema#yearMonthDuration"||e==="http://www.w3.org/2001/XMLSchema#duration"}isDayTimeDurationValue(e){return e instanceof ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof ws.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 Ar(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof ws.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 ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof ws.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 o=AU.functionHandlers.get(i);if(!o)throw new Ar(`Unknown function: ${i}`);let c={evaluateExpression:a((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:a((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:a(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:a(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:a(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return o(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 Ar(`Unknown function format: ${String(e)}`)}evaluateSpecialFunction(e,t,r){switch(e){case"coalesce":for(let i of t)try{let s=this.evaluateExpression(i,r);if(s!=null)return{value:s}}catch{continue}return{value:void 0};case"if":{if(!t||t.length!==3)throw new Ar("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({type:"function",function:"byuuid",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 ws.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 Ar("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 o=this.tripleStore.findSubjectsByUUIDSync(s);if(o.length===0){this.uuidCache.set(s,null);return}let c=o[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)}};Cl.FilterExecutor=Mw});var $w=w(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.OptionalExecutor=void 0;var jw=class{static{a(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);yield*this.hashJoin(r,i)}async executeAll(e,t){let r=[];for(let i of this.hashJoin(e,t))r.push(i);return r}*hashJoin(e,t){if(e.length===0)return;if(t.length===0){yield*e;return}let r=new Set;for(let l of e)for(let u of l.variables())r.add(u);let i=new Set;for(let l of t)for(let u of l.variables())i.add(u);let s=[];for(let l of r)i.has(l)&&s.push(l);if(s.sort(),s.length===0){yield*this.nestedLoopJoin(e,t);return}let o="\0",c=new Map;for(let l of t){let u=this.computeHashKey(l,s,o),f=c.get(u);f||(f=[],c.set(u,f)),f.push(l)}for(let l of e){let u=this.computeHashKey(l,s,o),f=c.get(u),d=!1;if(f)for(let h of f){let p=l.merge(h);p!==null&&(yield p,d=!0)}d||(yield l)}}computeHashKey(e,t,r){let i=[];for(let s of t){let o=e.get(s);i.push(o!==void 0?o.toString():"UNBOUND")}return i.join(r)}*nestedLoopJoin(e,t){for(let r of e){let i=!1;for(let s of t){let o=r.merge(s);o!==null&&(yield o,i=!0)}i||(yield r)}}};Cm.OptionalExecutor=jw});var Bw=w(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.UnionExecutor=void 0;var Uw=class{static{a(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 o of e)yield o}a(i,"generateLeft");async function*s(){for(let o of t)yield o}a(s,"generateRight");for await(let o of this.execute(i(),s()))r.push(o);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Om.UnionExecutor=Uw});var RC=w(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.MinusExecutor=void 0;var Vw=class{static{a(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 o=!1;for(let c of i)if(this.areCompatible(s,c)){o=!0;break}o||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let o of e)yield o}a(i,"generateLeft");async function*s(){for(let o of t)yield o}a(s,"generateRight");for await(let o of this.execute(i(),s()))r.push(o);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(o=>i.has(o));if(s.length===0)return!1;for(let o of s){let c=e.get(o),l=t.get(o);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Pm.MinusExecutor=Vw});var OC=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.ValuesExecutor=Ol.ValuesExecutorError=void 0;var IU=_s(),CC=Oe(),xU=Ge(),Fm=class extends Error{static{a(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Ol.ValuesExecutorError=Fm;var qw=class{static{a(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 IU.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 CC.IRI(e.value);if(e.type==="literal")return new xU.Literal(e.value,e.datatype?new CC.IRI(e.datatype):void 0,e.language,e.direction);throw new Fm(`Unknown term type: ${e.type}`)}};Ol.ValuesExecutor=qw});var Gw=w(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.CustomAggregateRegistry=Fl.CustomAggregateError=void 0;var Pl=class extends Error{static{a(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Fl.CustomAggregateError=Pl;var Dm=class n{static{a(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 Pl("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Pl("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Pl(`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}};Fl.CustomAggregateRegistry=Dm;Dm.instance=null});var Ww=w(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.BUILT_IN_AGGREGATES=st.modeAggregate=st.stddevAggregate=st.varianceAggregate=st.medianAggregate=st.EXO_AGGREGATE_NS=void 0;st.getNumericValue=Lm;st.createDecimalLiteral=Oi;st.createDoubleLiteral=OU;st.createPercentileAggregate=oc;var ac=Ge(),Dl=Oe(),RU=new Dl.IRI("http://www.w3.org/2001/XMLSchema#decimal"),CU=new Dl.IRI("http://www.w3.org/2001/XMLSchema#double");st.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Lm(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof ac.Literal?parseFloat(n.value):n instanceof Dl.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}a(Lm,"getNumericValue");function Oi(n){return new ac.Literal(String(n),RU)}a(Oi,"createDecimalLiteral");function OU(n){return new ac.Literal(String(n),CU)}a(OU,"createDoubleLiteral");st.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Lm(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=[...t].sort((o,c)=>o-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return Oi(s)}};st.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Lm(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=t.reduce((s,o)=>s+o,0)/t.length,i=t.reduce((s,o)=>s+Math.pow(o-r,2),0)/t.length;return Oi(i)}};st.stddevAggregate={init(){return{values:[]}},step(n,e){st.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=t.reduce((s,o)=>s+o,0)/t.length,i=t.reduce((s,o)=>s+Math.pow(o-r,2),0)/t.length;return Oi(Math.sqrt(i))}};st.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof ac.Literal||e instanceof Dl.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 ac.Literal(" ",new Dl.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[o,c]of e.counts)c>r&&(r=c,t=o);let i=e.values.get(t);if(i instanceof ac.Literal)return i;let s=parseFloat(t);return isNaN(s)?new ac.Literal(t,new Dl.IRI("http://www.w3.org/2001/XMLSchema#string")):Oi(s)}};function oc(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Lm(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return Oi(0);let s=[...i].sort((d,h)=>d-h),o=r.percentile*(s.length-1),c=Math.floor(o),l=Math.ceil(o);if(c===l)return Oi(s[c]);let u=o-c,f=s[c]*(1-u)+s[l]*u;return Oi(f)}}}a(oc,"createPercentileAggregate");st.BUILT_IN_AGGREGATES={[`${st.EXO_AGGREGATE_NS}median`]:st.medianAggregate,[`${st.EXO_AGGREGATE_NS}variance`]:st.varianceAggregate,[`${st.EXO_AGGREGATE_NS}stddev`]:st.stddevAggregate,[`${st.EXO_AGGREGATE_NS}mode`]:st.modeAggregate,[`${st.EXO_AGGREGATE_NS}percentile25`]:oc(25),[`${st.EXO_AGGREGATE_NS}percentile50`]:oc(50),[`${st.EXO_AGGREGATE_NS}percentile75`]:oc(75),[`${st.EXO_AGGREGATE_NS}percentile90`]:oc(90),[`${st.EXO_AGGREGATE_NS}percentile95`]:oc(95),[`${st.EXO_AGGREGATE_NS}percentile99`]:oc(99)}});var DC=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.AggregateExecutor=Ll.AggregateExecutorError=void 0;var br=Ge(),zw=Oe(),PU=Rm(),FU=Gw(),DU=Ww(),PC=new zw.IRI("http://www.w3.org/2001/XMLSchema#integer"),cc=new zw.IRI("http://www.w3.org/2001/XMLSchema#decimal"),vs=new zw.IRI("http://www.w3.org/2001/XMLSchema#string");function FC(n){return typeof n=="object"&&n.type==="custom"}a(FC,"isCustomAggregation");var Bf=class extends Error{static{a(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Ll.AggregateExecutorError=Bf;var Hw=class{static{a(this,"AggregateExecutor")}constructor(){this.filterExecutor=new PU.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,o]of r.entries()){let c=new Map;for(let f of e.variables)if(o.length>0){let d=o[0].get(f);d&&c.set(f,d)}for(let f of e.aggregates){let d=this.computeAggregate(f.expression,o);c.set(f.variable,d)}let{SolutionMapping:l}=_s(),u=new l;for(let[f,d]of c.entries())u.set(f,d);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),o=r.get(s);o?o.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(FC(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 br.Literal(String(s),PC)}case"sum":{let s=this.computeSum(r);return new br.Literal(String(s),cc)}case"avg":{let s=this.computeAvg(r);return new br.Literal(String(s),cc)}case"min":{let s=this.computeMin(r);return s===void 0?new br.Literal("",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}case"max":{let s=this.computeMax(r);return s===void 0?new br.Literal("",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new br.Literal(s||" ",vs)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new br.Literal(" ",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}default:{let s=i;throw new Bf(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,o=FU.CustomAggregateRegistry.getInstance().get(i);if(o||(o=DU.BUILT_IN_AGGREGATES[i]),!o)throw new Bf(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=o.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;o.step(c,u)}return o.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 o=s[0],c=parseFloat(o);return isNaN(c)?o: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}=_s(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(FC(s)){r.set(i.variable,new br.Literal("0",cc));continue}switch(s){case"count":r.set(i.variable,new br.Literal("0",PC));break;case"sum":case"avg":r.set(i.variable,new br.Literal("0",cc));break;case"group_concat":r.set(i.variable,new br.Literal(" ",vs));break;case"min":case"max":case"sample":r.set(i.variable,new br.Literal("",vs));break;default:r.set(i.variable,new br.Literal("",vs))}}return r}};Ll.AggregateExecutor=Hw});var Xw=w(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.ConstructExecutor=void 0;var LU=Qn(),lc=Oe(),Kw=Ge(),Qw=jt(),NU=mf(),Yw=class{static{a(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let o of e)try{let c=this.instantiateTriple(o,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 LU.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 lc.IRI(e.value);if(e.type==="literal")return new Kw.Literal(e.value,e.datatype?new lc.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new Qw.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 NU.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 Kw.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new lc.IRI(e.value);if(e.type==="blank")return new Qw.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 lc.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new lc.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 lc.IRI(e.value);if(e.type==="blank")return new Qw.BlankNode(e.value);if(e.type==="literal")return new Kw.Literal(e.value,e.datatype?new lc.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}`)}};Nm.ConstructExecutor=Yw});var NC=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.ServiceExecutor=Nl.ServiceExecutorError=void 0;var kU=_s(),LC=Oe(),MU=Ge(),jU=jt(),uc=class extends Error{static{a(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Nl.ServiceExecutorError=uc;var Jw=class{static{a(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,o=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 uc(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(o)}}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 uc(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new uc(`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 kU.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 LC.IRI(e.value);case"literal":{let t=e.datatype?new LC.IRI(e.datatype):void 0;return new MU.Literal(e.value,t,e["xml:lang"])}case"bnode":return new jU.BlankNode(e.value);default:throw new uc(`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))}};Nl.ServiceExecutor=Jw});var MC=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.GraphExecutor=kl.GraphExecutorError=void 0;var kC=Oe(),km=class extends Error{static{a(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};kl.GraphExecutorError=km;var Zw=class{static{a(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 km(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new kC.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let o=i.get(t.value);if(o&&o instanceof kC.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:o.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let o of s)for await(let c of r(e.pattern,o)){let l=c.clone();l.set(t.value,o),yield l}}};kl.GraphExecutor=Zw});var jC=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.SPARQLGenerator=jl.SPARQLGeneratorError=void 0;var Ml=class extends Error{static{a(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};jl.SPARQLGeneratorError=Ml;var e1=class{static{a(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 {
|
|
48
|
+
`,s);l!==-1?(i+=e.substring(s,l),s=l):(i+=e.substring(s),s=e.length);continue}let c=this.tryReplacePrefixedName(e,s,r);if(c){i+=c.iri,s=c.endIndex;continue}i+=o,s++}return i}tryReplacePrefixedName(e,t,r){if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return null;for(let{prefix:i,baseIRI:s}of r){if(e.substring(t,t+i.length+1)!==i+":")continue;let o=t+i.length+1,c=o;for(;c<e.length&&/[a-zA-Z0-9_.%-]/.test(e[c]);)c++;if(c===o)continue;let l=e.substring(o,c);return{iri:`<${s}${l}.md>`,endIndex:c}}return null}findDeclaredPrefixes(e){let t=new Set,r=new RegExp(J7.source,"gi"),i;for(;(i=r.exec(e))!==null;)t.add(i[1].toLowerCase());return t}skipLiteral(e,t){let r=e[t];if(t+2<e.length&&e.substring(t,t+3)===r+r+r){let s=e.indexOf(r+r+r,t+3);return s!==-1?s+3:e.length}let i=t+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;return i<e.length?i+1:e.length}};Zp.VaultPrefixTransformer=sw});var yl=w(kn=>{"use strict";var eU=kn&&kn.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),tU=kn&&kn.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),rU=kn&&kn.__importStar||(function(){var n=a(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"&&eU(t,e,r[i]);return tU(t,e),t}})();Object.defineProperty(kn,"__esModule",{value:!0});kn.SPARQLParser=kn.ExoQLParser=kn.SPARQLParseError=void 0;var XR=rU(zR()),aw=ZS(),cw=ew(),JR=KR(),lw=rw(),nU=QR(),uw=YR(),iU=ow(),mr=class extends Error{static{a(this,"SPARQLParseError")}constructor(e,t,r,i){super(e,i?{cause:i}:void 0),this.name="SPARQLParseError",this.line=t,this.column=r}};kn.SPARQLParseError=mr;var em=class{static{a(this,"ExoQLParser")}constructor(e){this.lastDirectionMappings=new Map,this.parser=new XR.Parser({sparqlStar:!0}),this.generator=new XR.Generator({sparqlStar:!0}),this.caseWhenTransformer=new aw.CaseWhenTransformer,this.lateralTransformer=new cw.LateralTransformer,this.prefixStarTransformer=new JR.PrefixStarTransformer(e?.vocabularyResolver),this.describeOptionsTransformer=new lw.DescribeOptionsTransformer,this.directionalLangTagTransformer=new nU.DirectionalLangTagTransformer,this.tripleTermTransformer=new uw.TripleTermTransformer,this.vaultPrefixTransformer=new iU.VaultPrefixTransformer}setVaultPrefixes(e){this.vaultPrefixTransformer.setVaultPrefixes(e)}parse(e){try{let t=this.vaultPrefixTransformer.transform(e),r=this.describeOptionsTransformer.transform(t);this.lastDescribeOptions=r.options;let i=r.query;i=this.directionalLangTagTransformer.transform(i),this.lastDirectionMappings=this.directionalLangTagTransformer.getAllMappings(),i=this.lateralTransformer.transform(i),i=this.caseWhenTransformer.transform(i),i=this.tripleTermTransformer.transform(i);let s=this.parser.parse(i);return this.validateQuery(s),this.lastDescribeOptions&&this.isDescribeQuery(s)&&(s.describeOptions=this.lastDescribeOptions),s}catch(t){if(t instanceof lw.DescribeOptionsTransformerError)throw new mr(t.message);if(t instanceof cw.LateralTransformerError)throw new mr(t.message);if(t instanceof aw.CaseWhenTransformerError)throw new mr(t.message);if(t instanceof uw.TripleTermTransformerError)throw new mr(t.message);if(t instanceof Error){let r=t.message.match(/line (\d+), column (\d+)/),i=r?parseInt(r[1],10):void 0,s=r?parseInt(r[2],10):void 0;throw new mr(`SPARQL syntax error: ${t.message}`,i,s,t)}throw t}}parseWithOptions(e){return{query:this.parse(e),describeOptions:this.lastDescribeOptions}}getLastDescribeOptions(){return this.lastDescribeOptions}async parseAsync(e){try{let t=this.vaultPrefixTransformer.transform(e),r=this.describeOptionsTransformer.transform(t);this.lastDescribeOptions=r.options;let i=r.query;i=this.directionalLangTagTransformer.transform(i),this.lastDirectionMappings=this.directionalLangTagTransformer.getAllMappings(),i=await this.prefixStarTransformer.transform(i),i=this.lateralTransformer.transform(i),i=this.caseWhenTransformer.transform(i),i=this.tripleTermTransformer.transform(i);let s=this.parser.parse(i);return this.validateQuery(s),this.lastDescribeOptions&&this.isDescribeQuery(s)&&(s.describeOptions=this.lastDescribeOptions),s}catch(t){if(t instanceof lw.DescribeOptionsTransformerError)throw new mr(t.message);if(t instanceof JR.PrefixStarTransformerError)throw new mr(t.message);if(t instanceof cw.LateralTransformerError)throw new mr(t.message);if(t instanceof aw.CaseWhenTransformerError)throw new mr(t.message);if(t instanceof uw.TripleTermTransformerError)throw new mr(t.message);if(t instanceof Error){let r=t.message.match(/line (\d+), column (\d+)/),i=r?parseInt(r[1],10):void 0,s=r?parseInt(r[2],10):void 0;throw new mr(`SPARQL syntax error: ${t.message}`,i,s,t)}throw t}}async parseAsyncWithOptions(e){return{query:await this.parseAsync(e),describeOptions:this.lastDescribeOptions}}hasPrefixStar(e){return/PREFIX\s*\*/i.test(e)}hasLateral(e){return this.lateralTransformer.hasLateral(e)}hasDescribeOptions(e){return this.describeOptionsTransformer.hasDescribeOptions(e)}hasDirectionalLangTags(e){return this.directionalLangTagTransformer.hasDirectionalTags(e)}hasTripleTermSyntax(e){return this.tripleTermTransformer.hasTripleTermSyntax(e)}getLastDirectionMappings(){return new Map(this.lastDirectionMappings)}getDirectionForLanguage(e){return this.lastDirectionMappings.get(e.toLowerCase())}toString(e){try{return this.generator.stringify(e)}catch(t){throw t instanceof Error?new mr(`Failed to serialize SPARQL query: ${t.message}`,void 0,void 0,t):t}}getQueryType(e){if("queryType"in e&&e.type==="query")return e.queryType;throw new mr("Query does not have a valid queryType property")}isSelectQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="SELECT"}isConstructQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="CONSTRUCT"}isAskQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="ASK"}isDescribeQuery(e){return"queryType"in e&&e.type==="query"&&e.queryType==="DESCRIBE"}isUpdateQuery(e){return e.type==="update"}isInsertDataOperation(e){return"updateType"in e&&e.updateType==="insert"}isDeleteDataOperation(e){return"updateType"in e&&e.updateType==="delete"}validateQuery(e){if(!e||typeof e!="object")throw new mr("Invalid query: not an object");if(e.type!=="query"&&e.type!=="update")throw new mr(`Invalid type: expected "query" or "update", got "${e.type}"`);if(e.type==="query"){let t=["SELECT","CONSTRUCT","ASK","DESCRIBE"];if(!t.includes(e.queryType))throw new mr(`Invalid query type: expected one of ${t.join(", ")}, got "${e.queryType}"`)}}};kn.ExoQLParser=em;kn.SPARQLParser=em});var sc=w(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.AlgebraTranslatorError=void 0;var fw=class extends Error{static{a(this,"AlgebraTranslatorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AlgebraTranslatorError"}};tm.AlgebraTranslatorError=fw});var rm=w(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isVariableExpression=sU;bs.isVariableTerm=oU;bs.isNamedNode=aU;bs.isLiteral=cU;bs.isPropertyPath=lU;bs.isAggregateExpression=uU;bs.isOperationExpression=fU;bs.isFunctionCallExpression=dU;function sU(n){return typeof n=="object"&&n!==null&&"expression"in n&&"variable"in n}a(sU,"isVariableExpression");function oU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Variable"}a(oU,"isVariableTerm");function aU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="NamedNode"}a(aU,"isNamedNode");function cU(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Literal"}a(cU,"isLiteral");function lU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="path"}a(lU,"isPropertyPath");function uU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="aggregate"}a(uU,"isAggregateExpression");function fU(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="operation"}a(fU,"isOperationExpression");function dU(n){return typeof n=="object"&&n!==null&&"type"in n&&(n.type==="functionCall"||n.type==="functioncall")}a(dU,"isFunctionCallExpression")});var ZR=w(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.TripleTranslator=void 0;var mn=sc(),dw=class{static{a(this,"TripleTranslator")}constructor(){this.directionMappings=new Map}setDirectionMappings(e){this.directionMappings=e}translateBGP(e){if(!("triples"in e)||!Array.isArray(e.triples))throw new mn.AlgebraTranslatorError("BGP pattern must have triples array");return{type:"bgp",triples:e.triples.map(t=>this.translateTriple(t))}}translateTriple(e){if(!e.subject||!e.predicate||!e.object)throw new mn.AlgebraTranslatorError("Triple must have subject, predicate, and object");return{subject:this.translateTripleElement(e.subject),predicate:this.translatePredicate(e.predicate),object:this.translateTripleElement(e.object)}}translateConstructTemplate(e){return!e||!Array.isArray(e)?[]:e.map(t=>this.translateTriple(t))}translatePredicate(e){return"type"in e&&e.type==="path"?this.translatePropertyPath(e):this.translateTripleElement(e)}translatePropertyPath(e){if(!("pathType"in e)||!e.pathType)throw new mn.AlgebraTranslatorError("Property path must have pathType");if(!("items"in e)||!Array.isArray(e.items))throw new mn.AlgebraTranslatorError("Property path must have items array");let t=e.items.map(r=>this.translatePathItem(r));switch(e.pathType){case"/":return{type:"path",pathType:"/",items:t};case"|":return{type:"path",pathType:"|",items:t};case"^":if(t.length!==1)throw new mn.AlgebraTranslatorError("Inverse path must have exactly one item");return{type:"path",pathType:"^",items:[t[0]]};case"+":if(t.length!==1)throw new mn.AlgebraTranslatorError("OneOrMore path must have exactly one item");return{type:"path",pathType:"+",items:[t[0]]};case"*":if(t.length!==1)throw new mn.AlgebraTranslatorError("ZeroOrMore path must have exactly one item");return{type:"path",pathType:"*",items:[t[0]]};case"?":if(t.length!==1)throw new mn.AlgebraTranslatorError("ZeroOrOne path must have exactly one item");return{type:"path",pathType:"?",items:[t[0]]};default:throw new mn.AlgebraTranslatorError(`Unsupported property path type: ${e.pathType}`)}}translatePathItem(e){if("type"in e&&e.type==="path")return this.translatePropertyPath(e);if("termType"in e&&e.termType==="NamedNode")return{type:"iri",value:e.value};let t="type"in e?e.type:"termType"in e?e.termType:"unknown";throw new mn.AlgebraTranslatorError(`Unsupported path item type: ${String(t)}`)}translateTripleElement(e){if(!e||!("termType"in e))throw new mn.AlgebraTranslatorError("Triple element must have termType");switch(e.termType){case"Variable":return{type:"variable",value:e.value};case"NamedNode":return{type:"iri",value:e.value};case"Literal":{let t={type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language};if(e.language){let r=this.directionMappings.get(e.language.toLowerCase());r&&(t.direction=r)}return t}case"BlankNode":return{type:"blank",value:e.value};case"Quad":return this.translateQuotedTriple(e);default:throw new mn.AlgebraTranslatorError(`Unsupported term type: ${e.termType}`)}}translateQuotedTriple(e){if(!e.subject||!e.predicate||!e.object)throw new mn.AlgebraTranslatorError("Quoted triple must have subject, predicate, and object");return{type:"quoted",subject:this.translateTripleElement(e.subject),predicate:this.translateQuotedTriplePredicate(e.predicate),object:this.translateTripleElement(e.object)}}translateQuotedTriplePredicate(e){if(!e||!("termType"in e))throw new mn.AlgebraTranslatorError("Quoted triple predicate must have termType");switch(e.termType){case"Variable":return{type:"variable",value:e.value};case"NamedNode":return{type:"iri",value:e.value};default:throw new mn.AlgebraTranslatorError(`Quoted triple predicate must be IRI or Variable, got: ${e.termType}`)}}};nm.TripleTranslator=dw});var eC=w(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.ExpressionTranslator=void 0;var bl=sc(),hw=class{static{a(this,"ExpressionTranslator")}constructor(e){this.translateWhereFn=e.translateWhere,this.translateBGPFn=e.translateBGP,this.translatePatternFn=e.translatePattern}translateExpression(e){if(!e)throw new bl.AlgebraTranslatorError("Expression cannot be null or undefined");if("type"in e&&e.type==="operation")return this.translateOperationExpression(e);let t="type"in e?e.type:void 0;if(t==="functioncall"||t==="functionCall"){let r=e;return{type:"functionCall",function:r.function,args:r.args.map(i=>this.translateExpression(i))}}if("termType"in e)return this.translateTermExpression(e);throw new bl.AlgebraTranslatorError(`Unsupported expression structure: ${JSON.stringify(e)}`)}translateFilter(e){if(!e.expression)throw new bl.AlgebraTranslatorError("Filter pattern must have expression");let t={type:"bgp",triples:[]};return{type:"filter",expression:this.translateExpression(e.expression),input:t}}translateTermExpression(e){if(e.termType==="Variable")return{type:"variable",name:e.value};if(e.termType==="Literal"){let t=e.value;return e.datatype&&(e.datatype.value.includes("#integer")||e.datatype.value.includes("#decimal")?t=parseFloat(e.value):e.datatype.value.includes("#boolean")&&(t=e.value==="true")),{type:"literal",value:t,datatype:e.datatype?.value}}return{type:"literal",value:String(e.value||e)}}translateOperationExpression(e){let t=["=","!=","<",">","<=",">="],r=["&&","||","!"],i=["+","-","*","/"],s=e.args.filter(o=>!("patterns"in o)||"termType"in o);return t.includes(e.operator)?{type:"comparison",operator:e.operator,left:this.translateExpression(s[0]),right:this.translateExpression(s[1])}:r.includes(e.operator)?{type:"logical",operator:e.operator,operands:s.map(o=>this.translateExpression(o))}:i.includes(e.operator)?{type:"arithmetic",operator:e.operator,left:this.translateExpression(s[0]),right:this.translateExpression(s[1])}:e.operator==="exists"||e.operator==="notexists"?this.translateExistsExpression(e):e.operator==="in"||e.operator==="notin"?this.translateInExpression(e):{type:"function",function:e.operator,args:s.map(o=>this.translateExpression(o))}}translateExistsExpression(e){if(!e.args||e.args.length!==1)throw new bl.AlgebraTranslatorError("EXISTS/NOT EXISTS must have exactly one pattern argument");let t=e.args[0],r;return t.type==="group"&&"patterns"in t&&t.patterns?r=this.translateWhereFn(t.patterns):t.type==="bgp"?r=this.translateBGPFn(t):r=this.translatePatternFn(t),{type:"exists",negated:e.operator==="notexists",pattern:r}}translateInExpression(e){if(!e.args||e.args.length!==2)throw new bl.AlgebraTranslatorError("IN/NOT IN must have exactly 2 arguments (expression and list)");let t=e.args[0],r=e.args[1];if(!Array.isArray(r))throw new bl.AlgebraTranslatorError("IN/NOT IN second argument must be an array of values");return{type:"in",expression:this.translateExpression(t),list:r.map(i=>this.translateExpression(i)),negated:e.operator==="notin"}}};im.ExpressionTranslator=hw});var nC=w(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.PatternTranslator=void 0;var tC=ew(),Vr=sc(),rC=rm(),pw=class{static{a(this,"PatternTranslator")}constructor(e){this.directionMappings=new Map,this.translateExpressionFn=e.translateExpression,this.translateSelectFn=e.translateSelect,this.translateBGPFn=e.translateBGP}setDirectionMappings(e){this.directionMappings=e}translateWhere(e){if(e.length===0)throw new Vr.AlgebraTranslatorError("Empty WHERE clause");let t=e.filter(o=>o.type==="filter"),r=e.filter(o=>o.type==="bind"),i=e.filter(o=>o.type!=="filter"&&o.type!=="bind"),s;if(i.length===0)s={type:"bgp",triples:[]};else if(i.length===1)if(i[0].type==="optional"){let o=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:o?this.translateExpressionFn(o):void 0}}else s=this.translatePattern(i[0]);else{if(i[0].type==="optional"){let o=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:o?this.translateExpressionFn(o):void 0}}else s=this.translatePattern(i[0]);for(let o=1;o<i.length;o++){let c=i[o];if(this.isLateralPattern(c)){let l=this.extractLateralSubquery(c),u=this.removeLateralMarker(l),f=this.translateSelectFn(u);s={type:"lateraljoin",left:s,right:f}}else if(c.type==="optional"){let l=c.expression;s={type:"leftjoin",left:s,right:this.translateWhere(c.patterns),expression:l?this.translateExpressionFn(l):void 0}}else{let l=this.translatePattern(c);s={type:"join",left:s,right:l}}}}for(let o of r)s=this.translateBind(o,s);for(let o of t)s={type:"filter",expression:this.translateExpressionFn(o.expression),input:s};return s}translatePattern(e){if(!e||!e.type)throw new Vr.AlgebraTranslatorError("Invalid pattern: missing type");switch(e.type){case"bgp":return this.translateBGPFn(e);case"filter":return this.translateFilter(e);case"optional":return this.translateOptional(e);case"union":return this.translateUnion(e);case"minus":return this.translateMinus(e);case"values":return this.translateValues(e);case"group":return this.translateWhere(e.patterns);case"query":return this.translateSubquery(e);case"service":return this.translateService(e);case"graph":return this.translateGraph(e);default:throw new Vr.AlgebraTranslatorError(`Unsupported pattern type: ${e.type}`)}}translateFilter(e){if(!e.expression)throw new Vr.AlgebraTranslatorError("Filter pattern must have expression");let t={type:"bgp",triples:[]};return{type:"filter",expression:this.translateExpressionFn(e.expression),input:t}}translateOptional(e){if(!e.patterns||e.patterns.length===0)throw new Vr.AlgebraTranslatorError("OPTIONAL pattern must have patterns");let t=e.expression;return{type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(e.patterns),expression:t?this.translateExpressionFn(t):void 0}}translateUnion(e){if(!e.patterns||e.patterns.length<2)throw new Vr.AlgebraTranslatorError("UNION pattern must have at least 2 patterns");let t=a(i=>i.type==="graph"?this.translateGraph(i):i.type==="service"?this.translateService(i):"patterns"in i&&i.patterns&&Array.isArray(i.patterns)?this.translateWhere(i.patterns):this.translateWhere([i]),"translateBranch"),r={type:"union",left:t(e.patterns[0]),right:t(e.patterns[1])};for(let i=2;i<e.patterns.length;i++)r={type:"union",left:r,right:t(e.patterns[i])};return r}translateMinus(e){if(!e.patterns||e.patterns.length===0)throw new Vr.AlgebraTranslatorError("MINUS pattern must have patterns");return{type:"minus",left:{type:"bgp",triples:[]},right:this.translateWhere(e.patterns)}}translateValues(e){if(!e.values||!Array.isArray(e.values))throw new Vr.AlgebraTranslatorError("VALUES pattern must have values array");let t=new Set;for(let i of e.values)for(let s of Object.keys(i)){let o=s.startsWith("?")?s.slice(1):s;t.add(o)}let r=e.values.map(i=>this.translateValuesBinding(i));return{type:"values",variables:Array.from(t),bindings:r}}translateValuesBinding(e){let t={};for(let[r,i]of Object.entries(e)){let s=r.startsWith("?")?r.slice(1):r,o=i;if(o)if(o.termType==="NamedNode")t[s]={type:"iri",value:o.value};else if(o.termType==="Literal"){let c=o,l={type:"literal",value:c.value,datatype:c.datatype?.value,language:c.language||void 0};if(c.language){let u=this.directionMappings.get(c.language.toLowerCase());u&&(l.direction=u)}t[s]=l}else throw new Vr.AlgebraTranslatorError(`Unsupported VALUES term type: ${o.termType}`)}return t}translateBind(e,t){if(!e.variable||!e.expression)throw new Vr.AlgebraTranslatorError("BIND pattern must have variable and expression");return{type:"extend",variable:e.variable.value,expression:this.translateExpressionFn(e.expression),input:t}}translateSubquery(e){if(e.queryType!=="SELECT")throw new Vr.AlgebraTranslatorError(`Only SELECT subqueries are supported, got: ${String(e.queryType)}`);let t=this.removeLateralMarker(e);return{type:"subquery",query:this.translateSelectFn(t)}}translateService(e){if(!e.name||e.name.termType!=="NamedNode")throw new Vr.AlgebraTranslatorError("SERVICE pattern must have a NamedNode endpoint");if(!e.patterns||!Array.isArray(e.patterns))throw new Vr.AlgebraTranslatorError("SERVICE pattern must have patterns array");return{type:"service",endpoint:e.name.value,pattern:this.translateWhere(e.patterns),silent:e.silent||!1}}translateGraph(e){if(!e.name)throw new Vr.AlgebraTranslatorError("GRAPH pattern must have a name (IRI or variable)");if(!e.patterns||!Array.isArray(e.patterns))throw new Vr.AlgebraTranslatorError("GRAPH pattern must have patterns array");let t;if(e.name.termType==="NamedNode")t={type:"iri",value:e.name.value};else if(e.name.termType==="Variable")t={type:"variable",value:e.name.value};else throw new Vr.AlgebraTranslatorError(`GRAPH pattern name must be NamedNode or Variable, got: ${e.name.termType}`);return{type:"graph",name:t,pattern:this.translateWhere(e.patterns)}}isLateralPattern(e){if(e.type==="query"&&this.isLateralSubquery(e))return!0;if(e.type==="group"&&e.patterns?.length===1){let t=e.patterns[0];if(t.type==="query"&&this.isLateralSubquery(t))return!0}return!1}extractLateralSubquery(e){if(e.type==="query")return e;if(e.type==="group"&&e.patterns?.length===1){let t=e.patterns[0];if(t.type==="query")return t}throw new Vr.AlgebraTranslatorError("Invalid lateral pattern structure")}isLateralSubquery(e){return!("queryType"in e)||e.queryType!=="SELECT"||!("variables"in e)||!e.variables?!1:e.variables.some(i=>(0,rC.isVariableTerm)(i)&&i.value===tC.LateralTransformer.LATERAL_MARKER)}removeLateralMarker(e){if(!("variables"in e)||!e.variables)return e;let t=e,r=t.variables;return{...t,variables:r.filter(i=>!((0,rC.isVariableTerm)(i)&&i.value===tC.LateralTransformer.LATERAL_MARKER))}}};sm.PatternTranslator=pw});var sC=w(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.AggregateTranslator=void 0;var iC=sc(),hU=rm(),mw=class{static{a(this,"AggregateTranslator")}constructor(e){this.aggregateCounter=0,this.translateExpressionFn=e.translateExpression}resetCounter(){this.aggregateCounter=0}extractAggregatesWithMapping(e,t){if(!e)return[];let r=[];for(let i of e)(0,hU.isVariableExpression)(i)&&("type"in i.expression&&i.expression.type==="aggregate"?(r.push({variable:i.variable.value,expression:this.translateAggregateExpression(i.expression)}),t.set(i.expression,i.variable.value)):this.collectNestedAggregates(i.expression,r,t));return r}extractGroupVariables(e){return e?e.filter(t=>t.expression&&"termType"in t.expression&&t.expression.termType==="Variable").map(t=>t.expression.value):[]}extractHavingExpressions(e,t,r){if(!e||e.length===0)return[];for(let i of e)this.collectNestedAggregates(i,t,r);return e.map(i=>this.transformExpressionWithAggregateVars(i,r))}transformExpressionWithAggregateVars(e,t){let r=t.get(e);if(r!==void 0)return{type:"variable",name:r};if("type"in e&&e.type==="operation"&&"args"in e){let i=e,s=i.args.filter(u=>!Array.isArray(u)&&!("patterns"in u)).map(u=>this.transformExpressionWithAggregateVars(u,t)),o=["=","!=","<",">","<=",">="],c=["&&","||","!"],l=["+","-","*","/"];return o.includes(i.operator)?{type:"comparison",operator:i.operator,left:s[0],right:s[1]}:c.includes(i.operator)?{type:"logical",operator:i.operator,operands:s}:l.includes(i.operator)?{type:"arithmetic",operator:i.operator,left:s[0],right:s[1]}:{type:"function",function:i.operator,args:s}}return this.translateExpressionFn(e)}translateOrderComparator(e){return{expression:this.translateExpressionFn(e.expression),descending:e.descending||!1}}translateAggregateExpression(e){let t=e.aggregation,r=a(()=>{if(e.expression&&!("termType"in e.expression&&e.expression.termType==="Wildcard"))return this.translateExpressionFn(e.expression)},"translateInnerExpr");if(typeof t=="string"){let s=t.toLowerCase();return["count","sum","avg","min","max","group_concat","sample"].includes(s)?{type:"aggregate",aggregation:s,expression:r(),distinct:e.distinct||!1,separator:e.separator}:{type:"aggregate",aggregation:{type:"custom",iri:t},expression:r(),distinct:e.distinct||!1,separator:e.separator}}let i=t;if(i&&typeof i=="object"){let s,o=i;if(o.termType==="NamedNode"&&typeof o.value=="string")s=o.value;else if("value"in o)s=String(o.value);else throw new iC.AlgebraTranslatorError(`Invalid custom aggregate: expected IRI but got ${JSON.stringify(i)}`);return{type:"aggregate",aggregation:{type:"custom",iri:s},expression:r(),distinct:e.distinct||!1,separator:e.separator}}throw new iC.AlgebraTranslatorError(`Unknown aggregate format: ${JSON.stringify(t)}`)}collectNestedAggregates(e,t,r){if(e){if("type"in e&&e.type==="aggregate"){let i=`__agg${this.aggregateCounter++}`;t.push({variable:i,expression:this.translateAggregateExpression(e)}),r.set(e,i)}else if("type"in e&&e.type==="operation"&&"args"in e){let i=e;for(let s of i.args)!Array.isArray(s)&&"type"in s&&!("patterns"in s)?this.collectNestedAggregates(s,t,r):"termType"in s&&this.collectNestedAggregates(s,t,r)}}}};om.AggregateTranslator=mw});var _l=w(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.AlgebraTranslator=na.ExoQLAlgebraTranslator=na.AlgebraTranslatorError=void 0;var am=sc(),cm=rm(),pU=ZR(),mU=eC(),gU=nC(),yU=sC(),bU=sc();Object.defineProperty(na,"AlgebraTranslatorError",{enumerable:!0,get:a(function(){return bU.AlgebraTranslatorError},"get")});var lm=class{static{a(this,"ExoQLAlgebraTranslator")}constructor(){this.tripleTranslator=new pU.TripleTranslator,this.expressionTranslator=new mU.ExpressionTranslator({translateWhere:a(e=>this.patternTranslator.translateWhere(e),"translateWhere"),translateBGP:a(e=>this.tripleTranslator.translateBGP(e),"translateBGP"),translatePattern:a(e=>this.patternTranslator.translatePattern(e),"translatePattern")}),this.patternTranslator=new gU.PatternTranslator({translateExpression:a(e=>this.expressionTranslator.translateExpression(e),"translateExpression"),translateSelect:a(e=>this.translateSelect(e),"translateSelect"),translateBGP:a(e=>this.tripleTranslator.translateBGP(e),"translateBGP")}),this.aggregateTranslator=new yU.AggregateTranslator({translateExpression:a(e=>this.expressionTranslator.translateExpression(e),"translateExpression")})}setDirectionMappings(e){this.tripleTranslator.setDirectionMappings(e),this.patternTranslator.setDirectionMappings(e)}translate(e){if(e.type!=="query")throw new am.AlgebraTranslatorError("Only query operations are supported (not updates)");if(e.queryType==="SELECT")return this.translateSelect(e);if(e.queryType==="CONSTRUCT")return this.translateConstruct(e);if(e.queryType==="ASK")return this.translateAsk(e);if(e.queryType==="DESCRIBE")return this.translateDescribe(e);throw new am.AlgebraTranslatorError(`Query type ${String(e.queryType)} not yet supported`)}translateSelect(e){if(!e.where||e.where.length===0)throw new am.AlgebraTranslatorError("SELECT query must have WHERE clause");let t=this.patternTranslator.translateWhere(e.where);this.aggregateTranslator.resetCounter();let r=new Map,i=Array.isArray(e.variables)?e.variables.filter(l=>!("termType"in l&&l.termType==="Wildcard")):[],s=this.aggregateTranslator.extractAggregatesWithMapping(i,r),o=this.aggregateTranslator.extractGroupVariables(e.group),c=this.aggregateTranslator.extractHavingExpressions(e.having,s,r);if((s.length>0||o.length>0||c.length>0)&&(t={type:"group",variables:o,aggregates:s,having:c.length>0?c:void 0,input:t}),i.length>0){for(let l of i)if((0,cm.isVariableExpression)(l)){if("type"in l.expression&&l.expression.type==="aggregate")continue;let u=this.aggregateTranslator.transformExpressionWithAggregateVars(l.expression,r);t={type:"extend",variable:l.variable.value,expression:u,input:t}}}if(e.order&&e.order.length>0&&(t={type:"orderby",comparators:e.order.map(l=>this.aggregateTranslator.translateOrderComparator(l)),input:t}),i.length>0){let l=i.filter(u=>(0,cm.isVariableTerm)(u)||(0,cm.isVariableExpression)(u)).map(u=>(0,cm.isVariableTerm)(u)?u.value:u.variable.value);l.length>0&&(t={type:"project",variables:l,input:t})}return e.distinct&&(t={type:"distinct",input:t}),e.reduced&&(t={type:"reduced",input:t}),(e.limit!==void 0||e.offset!==void 0)&&(t={type:"slice",limit:e.limit,offset:e.offset,input:t}),t}translateConstruct(e){let t=this.tripleTranslator.translateConstructTemplate(e.template??[]);if(!e.where||e.where.length===0)throw new am.AlgebraTranslatorError("CONSTRUCT query must have WHERE clause");let r=this.patternTranslator.translateWhere(e.where),i=e;return(i.limit!==void 0||i.offset!==void 0)&&(r={type:"slice",limit:i.limit,offset:i.offset,input:r}),{type:"construct",template:t,where:r}}translateAsk(e){return{type:"ask",where:e.where&&e.where.length>0?this.patternTranslator.translateWhere(e.where):{type:"bgp",triples:[]}}}translateDescribe(e){let t=[];if(e.variables&&Array.isArray(e.variables)){let s=e.variables;for(let o of s)o.termType==="Wildcard"||o.value==="*"||(o.termType==="Variable"?t.push({type:"variable",value:o.value}):o.termType==="NamedNode"&&t.push({type:"iri",value:o.value}))}let r;e.where&&e.where.length>0&&(r=this.patternTranslator.translateWhere(e.where));let i=e.describeOptions;return{type:"describe",resources:t,where:r,depth:i?.depth,symmetric:i?.symmetric}}};na.ExoQLAlgebraTranslator=lm;na.AlgebraTranslator=lm});var _s=w(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.SolutionMapping=void 0;var oC=Ge(),aC=Oe(),cC=jt(),gw=class n{static{a(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 oC.Literal&&t instanceof oC.Literal?e.equals(t):e instanceof aC.IRI&&t instanceof aC.IRI?e.value===t.value:e instanceof cC.BlankNode&&t instanceof cC.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}};um.SolutionMapping=gw});var uC=w(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.PropertyPathExecutor=wl.PropertyPathExecutorError=void 0;var _U=_s(),fm=Oe(),lC=jt(),SU=Ge(),Sl=class extends Error{static{a(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};wl.PropertyPathExecutorError=Sl;var yw=class n{static{a(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){if(this.isLiteralElement(e)||this.isLiteralElement(r)){let o=this.isLiteralElement(e)?"subject":"object",c=this.isLiteralElement(e)?e:r,l="value"in c?String(c.value):"<unknown>",u=l.length>80?`${l.slice(0,77)}...`:l,f=this.describePath(t),d={position:o,value:u,path:f,hint:"Wikilink could not be resolved to IRI (likely label-form wikilink with no matching basename/alias). Check whether the target file exists in the queried vault, or add an alias. See issue #3282."};if(console.error(`[PropertyPathExecutor] literal-safety guard fired: literal in ${o} position \u2014 yielding 0 solutions. value="${u}" path=${f}`,d),n.isStrictModeEnabled())throw new Sl(`Literal subject in property path: "${u}" (path=${f}). Set EXOCORTEX_SPARQL_STRICT=0 or omit --strict to fall back to warn-and-empty behaviour.`);return}let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let o of i){let c=await this.evaluatePath(o,t,s);for(let l of c){let u=new _U.SolutionMapping;this.isVariable(e)&&u.set(e.value,o),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 o=t.merge(s);o!==null&&(yield o)}}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 o=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,o,c?r:null);for(let d of f)l.add(d)}if(i=l,i.size===0)break}return i}async evaluateAlternativePath(e,t,r){let i=new Set;for(let s of t){let o=await this.evaluatePathItem(e,s,r);for(let c of o)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new fm.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),o=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&o.add(c.subject);return o}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,o=[{node:e,depth:0}];for(;o.length>0;){let c=o.shift();if(!c)break;let{node:l,depth:u}=c;if(u>=this.MAX_DEPTH)continue;let f=await this.evaluatePathItem(l,t,null);for(let d of f){let h=this.nodeToKey(d);(r===null||this.nodeInSet(d,r))&&s.add(d),i.has(h)||(i.add(h),o.push({node:d,depth:u+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 o of s)i.add(o);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new fm.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),o=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&o.add(c.object);return o}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(t=>t.type==="iri"?{type:"path",pathType:"^",items:[t]}:this.invertPath(t))};case"|":return{type:"path",pathType:"|",items:e.items.map(t=>t.type==="iri"?{type:"path",pathType:"^",items:[t]}:this.invertPath(t))};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 fm.IRI(e.value));break;case"blank":t.add(new lC.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 fm.IRI)return{type:"iri",value:r.value};if(r instanceof lC.BlankNode)return{type:"blank",value:r.id};if(r instanceof SU.Literal)return{type:"literal",value:r.value,datatype:r.datatype?.value,language:r.language,direction:r.direction}}}return e}isVariable(e){return e.type==="variable"}isLiteralElement(e){return e.type==="literal"}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}describePath(e){try{let t=e.items,r=a(s=>{if(s&&typeof s=="object"&&"type"in s){let o=s;if(o.type==="iri")return`<${String(o.value)}>`;if(o.type==="path")return this.describePath(o)}return"?"},"renderItem");if(!Array.isArray(t)||t.length===0)return"(?)";if(t.length===1){let s=r(t[0]);return e.pathType==="^"?`(^${s})`:e.pathType==="+"||e.pathType==="*"||e.pathType==="?"?`(${s}${e.pathType})`:`(${s})`}return`(${t.map(r).join(` ${e.pathType} `)})`}catch{return"<unprintable-path>"}}static isStrictModeEnabled(){let t=(typeof process<"u"?process.env:void 0)?.EXOCORTEX_SPARQL_STRICT;if(!t)return!1;let r=t.trim().toLowerCase();return r==="1"||r==="true"||r==="yes"}};wl.PropertyPathExecutor=yw});var Sw=w(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.BGPExecutor=vl.BGPExecutorError=void 0;var dm=_s(),ia=Oe(),bw=Ge(),hm=jt(),pm=mf(),fC=uC(),qr=class extends Error{static{a(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};vl.BGPExecutorError=qr;var _w=class{static{a(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new fC.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new dm.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 dm.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 qr("Property paths within named graphs are not yet supported");let r=e.predicate;if(this.isLiteral(e.subject)||this.isLiteral(r)){this.warnLiteralGuard("matchTriplePatternInGraph",this.isLiteral(e.subject)?"subject":"predicate",this.isLiteral(e.subject)?e.subject:r);return}let i=this.isVariable(e.subject)?void 0:this.toRDFTermAsSubject(e.subject),s=this.isVariable(r)?void 0:this.toRDFTermAsPredicate(r),o=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new qr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,o,t);for(let l of c){let u=new dm.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 o=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(o,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){if(this.isLiteral(e.subject)||this.isLiteral(e.object)){this.warnLiteralGuard("matchTriplePattern.propertyPath",this.isLiteral(e.subject)?"subject":"object",this.isLiteral(e.subject)?e.subject:e.object);return}yield*this.propertyPathExecutor.execute(e.subject,e.predicate,e.object);return}let t=e.predicate;if(this.isLiteral(e.subject)||this.isLiteral(t)){this.warnLiteralGuard("matchTriplePattern",this.isLiteral(e.subject)?"subject":"predicate",this.isLiteral(e.subject)?e.subject:t);return}let 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),o=await this.tripleStore.match(r,i,s);for(let c of o){let l=new dm.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,d]of u.entries())l.set(f,d)}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,d]of u.entries())l.set(f,d)}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 pm.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,o]of i)r.set(s,o)}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,o]of i)r.set(s,o)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof ia.IRI&&e.value===t.value;case"literal":return!(!(t instanceof bw.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof hm.BlankNode&&e.value===t.id;case"quoted":return t instanceof pm.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 o of this.matchTriplePattern(s)){let c=i.merge(o);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 ia.IRI?{type:"iri",value:r.value}:e}isVariable(e){return e.type==="variable"}isQuotedTriple(e){return e.type==="quoted"}isLiteral(e){return e.type==="literal"}warnLiteralGuard(e,t,r){let i="value"in r?String(r.value):"<unknown>",s=i.length>80?`${i.slice(0,77)}...`:i,o={executor:"BGPExecutor",context:e,position:t,value:s,hint:"Wikilink could not be resolved to IRI (likely label-form wikilink with no matching basename/alias). Check whether the target file exists in the queried vault, or add an alias. See issue #3282."};if(console.error(`[BGPExecutor] literal-safety guard fired in ${e}: literal in ${t} position \u2014 yielding 0 solutions. value="${s}"`,o),fC.PropertyPathExecutor.isStrictModeEnabled())throw new qr(`Literal in ${t} position (${e}): "${s}". Set EXOCORTEX_SPARQL_STRICT=0 or omit --strict to fall back to warn-and-empty behaviour.`)}toRDFTermAsSubject(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"blank":return new hm.BlankNode(e.value);case"literal":throw new qr("Literals cannot appear in subject position");case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new qr(`Unknown element type: ${String(e)}`)}}toRDFQuotedTriple(e){let t=this.toRDFTermAsSubject(e.subject),r=e.predicate.type==="iri"?new ia.IRI(e.predicate.value):(()=>{throw new qr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new pm.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"literal":throw new qr("Literals cannot appear in predicate position");case"blank":throw new qr("Blank nodes cannot appear in predicate position");case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new qr(`Unknown element type: ${String(e)}`)}}toRDFTerm(e){switch(e.type){case"iri":return new ia.IRI(e.value);case"literal":return new bw.Literal(e.value,e.datatype?new ia.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new hm.BlankNode(e.value);case"variable":throw new qr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new qr(`Unknown element type: ${String(e)}`)}}toAlgebraElement(e){if(e instanceof ia.IRI)return{type:"iri",value:e.value};if(e instanceof bw.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof hm.BlankNode)return{type:"blank",value:e.id};if(e instanceof pm.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new qr(`Unknown RDF term type: ${String(e)}`)}toAlgebraQuotedTriple(e){return{type:"quoted",subject:this.toAlgebraElement(e.subject),predicate:{type:"iri",value:e.predicate.value},object:this.toAlgebraElement(e.object)}}};vl.BGPExecutor=_w});var dC=w(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.StringFunctions=void 0;var El=Oe(),sa=Ge(),ww=jt(),kf=class n{static{a(this,"StringFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof El.IRI||e instanceof sa.Literal?e.value:e instanceof ww.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof sa.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof sa.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=n.parseDirectionalLangTag(e),[s,o]=n.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":o&&i!==o?!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 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 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",o=s.includes("u")?s:s+"u",c=new RegExp(t,o);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static encodeForUri(e){return encodeURIComponent(e)}static normalize(e,t){if(e===void 0)throw new Error("NORMALIZE: string argument is undefined");let r;if(e instanceof sa.Literal)r=e.value;else if(e instanceof El.IRI)r=e.value;else if(e instanceof ww.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 sa.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof El.IRI)i=t.value.toUpperCase();else throw new Error("NORMALIZE: second argument must be a string literal");if(!n.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 sa.Literal(s,new El.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 sa.Literal)t=e.value;else if(e instanceof El.IRI)t=e.value;else if(e instanceof ww.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=n.unicodeCaseFold(t);return new sa.Literal(r,new El.IRI("http://www.w3.org/2001/XMLSchema#string"))}static unicodeCaseFold(e){let t="";for(let r of e){let i=n.CASE_FOLDING_MAP.get(r);i!==void 0?t+=i:t+=r.toLowerCase()}return t}};mm.StringFunctions=kf;kf.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];kf.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 hC=w(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.MathFunctions=void 0;var vw=class{static{a(this,"MathFunctions")}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()}};gm.MathFunctions=vw});var Mf=w(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.DateTimeParsing=void 0;var wU=Oe(),vU=Ge(),Ew=class n{static{a(this,"DateTimeParsing")}static parseDate(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`PARSEDATE: invalid date string '${e}'`);return t.getTime()}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"),o="",c="";if(s===-1?o=r:(o=r.substring(0,s),c=r.substring(s+1)),o){let l=o.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(o!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${o}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let h=parseFloat(u[1]);i+=h*60*60*1e3,l=l.substring(u[0].length)}let f=l.match(/^(\d+(?:\.\d+)?)M/);if(f){let h=parseFloat(f[1]);i+=h*60*1e3,l=l.substring(f[0].length)}let d=l.match(/^(\d+(?:\.\d+)?)S$/);if(d){let h=parseFloat(d[1]);i+=h*1e3,l=l.substring(d[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 o=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||o>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),o>0&&(l+=`${o}M`),(c>0||s===0&&o===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return n.parseDayTimeDuration(e),new vU.Literal(e,new wU.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,o=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,o));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,d=parseInt(u[2],10),h=parseInt(u[3],10),p=f*(d*60+h)*60*1e3;l=new Date(l.getTime()-p)}}return l}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),o=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||o<0||o>59||i===24&&(s!==0||o!==0))return null;let u=0;if(c){let d=c.padEnd(3,"0").slice(0,3);u=parseInt(d,10)}let f=i*60*60*1e3+s*60*1e3+o*1e3+u;if(i===24&&(f=1440*60*1e3),l&&l!=="Z"){let d=l.match(/([+-])(\d{2}):(\d{2})/);if(d){let h=d[1]==="+"?1:-1,p=parseInt(d[2],10),g=parseInt(d[3],10),y=h*(p*60+g)*60*1e3;f-=y}}return f}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 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),o=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+o;return i?-c:c}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,o=t?"-P":"P";return i>0&&(o+=`${i}Y`),(s>0||i===0)&&(o+=`${s}M`),o}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),o=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:o,negative:i}}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,o=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 d=u.match(/^(\d+(?:\.\d+)?)D$/);if(d)i=parseFloat(d[1]);else if(u!=="")throw new Error(`parseDurationComponents: invalid day component: '${u}' in '${e}'`)}if(f){let d=f,h=d.match(/^(\d+(?:\.\d+)?)H/);h&&(s=parseFloat(h[1]),d=d.substring(h[0].length));let p=d.match(/^(\d+(?:\.\d+)?)M/);p&&(o=parseFloat(p[1]),d=d.substring(p[0].length));let g=d.match(/^(\d+(?:\.\d+)?)S$/);if(g&&(c=parseFloat(g[1]),d=d.substring(g[0].length)),d!=="")throw new Error(`parseDurationComponents: invalid time component: '${d}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:o,seconds:c}}};ym.DateTimeParsing=Ew});var pC=w(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.DateTimeArithmetic=void 0;var gn=Oe(),Ue=Ge(),it=Mf(),Tw=class{static{a(this,"DateTimeArithmetic")}static dateTimeDiff(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r),o=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(o.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-o.getTime(),l=it.DateTimeParsing.formatDayTimeDuration(c);return new Ue.Literal(l,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+o,l=new Date(c);return new Ue.Literal(l.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-o,l=new Date(c);return new Ue.Literal(l.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+o,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),d=String(l.getUTCDate()).padStart(2,"0"),h=`${u}-${f}-${d}`;return new Ue.Literal(h,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let o=it.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-o,l=new Date(c),u=l.getUTCFullYear(),f=String(l.getUTCMonth()+1).padStart(2,"0"),d=String(l.getUTCDate()).padStart(2,"0"),h=`${u}-${f}-${d}`;return new Ue.Literal(h,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateTimeAddYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+o),s.getUTCDate()!==c&&s.setUTCDate(0),new Ue.Literal(s.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-o),s.getUTCDate()!==c&&s.setUTCDate(0),new Ue.Literal(s.toISOString(),new gn.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+o),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"),d=`${l}-${u}-${f}`;return new Ue.Literal(d,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let o=it.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-o),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"),d=`${l}-${u}-${f}`;return new Ue.Literal(d,new gn.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseDayTimeDuration(r),o=it.DateTimeParsing.parseDayTimeDuration(i),c=it.DateTimeParsing.formatDayTimeDuration(s+o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseDayTimeDuration(r),o=it.DateTimeParsing.parseDayTimeDuration(i),c=it.DateTimeParsing.formatDayTimeDuration(s-o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof Ue.Literal?e.value:e,i=it.DateTimeParsing.parseDayTimeDuration(r),s=it.DateTimeParsing.formatDayTimeDuration(i*t);return new Ue.Literal(s,new gn.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 Ue.Literal?e.value:e,i=it.DateTimeParsing.parseDayTimeDuration(r),s=it.DateTimeParsing.formatDayTimeDuration(i/t);return new Ue.Literal(s,new gn.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static yearMonthDurationAdd(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseYearMonthDuration(r),o=it.DateTimeParsing.parseYearMonthDuration(i),c=it.DateTimeParsing.formatYearMonthDuration(s+o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof Ue.Literal?e.value:e,i=t instanceof Ue.Literal?t.value:t,s=it.DateTimeParsing.parseYearMonthDuration(r),o=it.DateTimeParsing.parseYearMonthDuration(i),c=it.DateTimeParsing.formatYearMonthDuration(s-o);return new Ue.Literal(c,new gn.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static durationToDays(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof Ue.Literal?e.value:e;return it.DateTimeParsing.parseDayTimeDuration(t)/1e3}};bm.DateTimeArithmetic=Tw});var mC=w(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.DateTimeAccessors=void 0;var jf=Oe(),$t=Ge(),Rt=Mf(),Aw=class{static{a(this,"DateTimeAccessors")}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 durationDays(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static durationYears(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof $t.Literal?e.value:e,r=Rt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.months:r.months}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),o=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);o===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${o}M`}else{let s=-t.getTimezoneOffset(),o=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${o}H`:r=`${l}PT${o}H${c}M`}}return new $t.Literal(r,new jf.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 adjust(e,t){let r=e instanceof $t.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let R=i.getUTCFullYear(),B=String(i.getUTCMonth()+1).padStart(2,"0"),L=String(i.getUTCDate()).padStart(2,"0"),P=String(i.getUTCHours()).padStart(2,"0"),M=String(i.getUTCMinutes()).padStart(2,"0"),O=String(i.getUTCSeconds()).padStart(2,"0"),Y=i.getUTCMilliseconds(),oe=`${R}-${B}-${L}T${P}:${M}:${O}`;return Y>0&&(oe+=`.${String(Y).padStart(3,"0")}`),new $t.Literal(oe,new jf.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof $t.Literal?t.value:t,o=Rt.DateTimeParsing.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(o)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+o),f=u.getUTCFullYear(),d=String(u.getUTCMonth()+1).padStart(2,"0"),h=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),g=String(u.getUTCMinutes()).padStart(2,"0"),y=String(u.getUTCSeconds()).padStart(2,"0"),b=u.getUTCMilliseconds(),S=o>=0?"+":"-",v=Math.floor(Math.abs(o)/(3600*1e3)),I=Math.floor(Math.abs(o)%(3600*1e3)/(60*1e3)),A=`${S}${String(v).padStart(2,"0")}:${String(I).padStart(2,"0")}`,T=`${f}-${d}-${h}T${p}:${g}:${y}`;return b>0&&(T+=`.${String(b).padStart(3,"0")}`),T+=A,new $t.Literal(T,new jf.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static now(){return new Date().toISOString()}static dateBefore(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t);return r<i}static dateAfter(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t);return r>i}static dateInRange(e,t,r){let i=Rt.DateTimeParsing.parseDate(e),s=Rt.DateTimeParsing.parseDate(t),o=Rt.DateTimeParsing.parseDate(r);return i>=s&&i<=o}static compareDurations(e,t,r){let i=e instanceof $t.Literal?e.value:e,s=t instanceof $t.Literal?t.value:t,o=Rt.DateTimeParsing.parseDayTimeDuration(i),c=Rt.DateTimeParsing.parseDayTimeDuration(s);switch(r){case"=":return o===c;case"!=":return o!==c;case"<":return o<c;case">":return o>c;case"<=":return o<=c;case">=":return o>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static dateDiffMinutes(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=Rt.DateTimeParsing.parseDate(e),i=Rt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60*60)*100)/100}static timeDiff(e,t){let r=e instanceof $t.Literal?e.value:e,i=t instanceof $t.Literal?t.value:t,s=Rt.DateTimeParsing.parseXSDTime(r),o=Rt.DateTimeParsing.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(o===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-o,l=Rt.DateTimeParsing.formatDayTimeDuration(c);return new $t.Literal(l,new jf.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static isDayTimeDuration(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static isYearMonthDuration(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static isTime(e){return e instanceof $t.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static dateDiff(e,t){let r=e instanceof $t.Literal?e.value:e,i=t instanceof $t.Literal?t.value:t,s=Rt.DateTimeParsing.parseXSDDate(r),o=Rt.DateTimeParsing.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(o===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-o.getTime(),l=Math.round(c/(1440*60*1e3)),u=Rt.DateTimeParsing.formatDateDuration(l);return new $t.Literal(u,new jf.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}};_m.DateTimeAccessors=Aw});var wm=w(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.DateTimeFunctions=void 0;var Tl=Mf(),gr=pC(),vt=mC(),Iw=class{static{a(this,"DateTimeFunctions")}static parseDate(e){return Tl.DateTimeParsing.parseDate(e)}static parseDayTimeDuration(e){return Tl.DateTimeParsing.parseDayTimeDuration(e)}static formatDayTimeDuration(e){return Tl.DateTimeParsing.formatDayTimeDuration(e)}static xsdDayTimeDuration(e){return Tl.DateTimeParsing.xsdDayTimeDuration(e)}static parseYearMonthDuration(e){return Tl.DateTimeParsing.parseYearMonthDuration(e)}static formatYearMonthDuration(e){return Tl.DateTimeParsing.formatYearMonthDuration(e)}static year(e){return vt.DateTimeAccessors.year(e)}static month(e){return vt.DateTimeAccessors.month(e)}static day(e){return vt.DateTimeAccessors.day(e)}static hours(e){return vt.DateTimeAccessors.hours(e)}static minutes(e){return vt.DateTimeAccessors.minutes(e)}static seconds(e){return vt.DateTimeAccessors.seconds(e)}static durationDays(e){return vt.DateTimeAccessors.durationDays(e)}static durationHours(e){return vt.DateTimeAccessors.durationHours(e)}static durationMinutes(e){return vt.DateTimeAccessors.durationMinutes(e)}static durationSeconds(e){return vt.DateTimeAccessors.durationSeconds(e)}static durationYears(e){return vt.DateTimeAccessors.durationYears(e)}static durationMonths(e){return vt.DateTimeAccessors.durationMonths(e)}static timezone(e){return vt.DateTimeAccessors.timezone(e)}static tz(e){return vt.DateTimeAccessors.tz(e)}static adjust(e,t){return vt.DateTimeAccessors.adjust(e,t)}static now(){return vt.DateTimeAccessors.now()}static dateBefore(e,t){return vt.DateTimeAccessors.dateBefore(e,t)}static dateAfter(e,t){return vt.DateTimeAccessors.dateAfter(e,t)}static dateInRange(e,t,r){return vt.DateTimeAccessors.dateInRange(e,t,r)}static compareDurations(e,t,r){return vt.DateTimeAccessors.compareDurations(e,t,r)}static dateDiffMinutes(e,t){return vt.DateTimeAccessors.dateDiffMinutes(e,t)}static dateDiffHours(e,t){return vt.DateTimeAccessors.dateDiffHours(e,t)}static timeDiff(e,t){return vt.DateTimeAccessors.timeDiff(e,t)}static dateDiff(e,t){return vt.DateTimeAccessors.dateDiff(e,t)}static isDayTimeDuration(e){return vt.DateTimeAccessors.isDayTimeDuration(e)}static isDate(e){return vt.DateTimeAccessors.isDate(e)}static isYearMonthDuration(e){return vt.DateTimeAccessors.isYearMonthDuration(e)}static isTime(e){return vt.DateTimeAccessors.isTime(e)}static dateTimeDiff(e,t){return gr.DateTimeArithmetic.dateTimeDiff(e,t)}static dateTimeAdd(e,t){return gr.DateTimeArithmetic.dateTimeAdd(e,t)}static dateTimeSubtract(e,t){return gr.DateTimeArithmetic.dateTimeSubtract(e,t)}static dateAdd(e,t){return gr.DateTimeArithmetic.dateAdd(e,t)}static dateSubtract(e,t){return gr.DateTimeArithmetic.dateSubtract(e,t)}static dateTimeAddYearMonth(e,t){return gr.DateTimeArithmetic.dateTimeAddYearMonth(e,t)}static dateTimeSubtractYearMonth(e,t){return gr.DateTimeArithmetic.dateTimeSubtractYearMonth(e,t)}static dateAddYearMonth(e,t){return gr.DateTimeArithmetic.dateAddYearMonth(e,t)}static dateSubtractYearMonth(e,t){return gr.DateTimeArithmetic.dateSubtractYearMonth(e,t)}static durationAdd(e,t){return gr.DateTimeArithmetic.durationAdd(e,t)}static durationSubtract(e,t){return gr.DateTimeArithmetic.durationSubtract(e,t)}static durationMultiply(e,t){return gr.DateTimeArithmetic.durationMultiply(e,t)}static durationDivide(e,t){return gr.DateTimeArithmetic.durationDivide(e,t)}static yearMonthDurationAdd(e,t){return gr.DateTimeArithmetic.yearMonthDurationAdd(e,t)}static yearMonthDurationSubtract(e,t){return gr.DateTimeArithmetic.yearMonthDurationSubtract(e,t)}static durationToDays(e){return gr.DateTimeArithmetic.durationToDays(e)}static durationToHours(e){return gr.DateTimeArithmetic.durationToHours(e)}static durationToMinutes(e){return gr.DateTimeArithmetic.durationToMinutes(e)}static durationToSeconds(e){return gr.DateTimeArithmetic.durationToSeconds(e)}};Sm.DateTimeFunctions=Iw});var gC=w(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.LogicalFunctions=void 0;var EU=Oe(),Al=Ge(),TU=jt(),vm=wm(),xw=class n{static{a(this,"LogicalFunctions")}static compare(e,t,r){if(n.isDayTimeDurationValue(e)&&n.isDayTimeDurationValue(t))return vm.DateTimeFunctions.compareDurations(e instanceof Al.Literal?e:String(e),t instanceof Al.Literal?t:String(t),r);if(n.isDayTimeDurationValue(e)&&typeof t=="string"&&/^-?P/.test(t))return vm.DateTimeFunctions.compareDurations(e instanceof Al.Literal?e:String(e),t,r);if(typeof e=="string"&&/^-?P/.test(e)&&n.isDayTimeDurationValue(t))return vm.DateTimeFunctions.compareDurations(e,t instanceof Al.Literal?t:String(t),r);let i=n.toComparableValue(e),s=n.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 Al.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 Al.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 vm.DateTimeFunctions.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof EU.IRI?e.value:e instanceof TU.BlankNode?e.id:String(e)}static logicalAnd(e){return e.every(t=>t===!0)}static logicalOr(e){return e.some(t=>t===!0)}static logicalNot(e){return!e}static coalesce(e){for(let t of e)if(t!=null)return t}static if(e,t,r){return e?t:r}};Em.LogicalFunctions=xw});var yC=w(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.RDFTermFunctions=void 0;var Gr=Oe(),xt=Ge(),Ci=jt(),Il=mf(),Rw=Ii(),Cw=class n{static{a(this,"RDFTermFunctions")}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof xt.Literal)return e.datatype?e.datatype:e.language?new Gr.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Gr.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 Gr.IRI}static isBlank(e){return e===void 0?!1:e instanceof Ci.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof xt.Literal}static isTriple(e){return e===void 0?!1:e instanceof Il.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof xt.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof xt.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 xsdDateTime(e){let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`xsd:dateTime: invalid date string '${e}'`);return new xt.Literal(t.toISOString(),new Gr.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 xt.Literal(String(t),new Gr.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 xt.Literal(String(t),new Gr.IRI("http://www.w3.org/2001/XMLSchema#decimal"))}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 Gr.IRI&&t instanceof Gr.IRI)return e.value===t.value;if(e instanceof Ci.BlankNode&&t instanceof Ci.BlankNode)return e.id===t.id;if(e instanceof xt.Literal&&t instanceof xt.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 Gr.IRI)return e;if(e instanceof xt.Literal)return new Gr.IRI(e.value);throw e instanceof Ci.BlankNode?new Error("IRI: cannot convert blank node to IRI"):new Error("IRI: unsupported term type")}static uri(e){return n.iri(e)}static bnode(e){if(e===void 0){let t=`b${(0,Rw.v4)().replace(/-/g,"").substring(0,12)}`;return new Ci.BlankNode(t)}if(e instanceof xt.Literal)return new Ci.BlankNode(e.value);if(e instanceof Ci.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 xt.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 Gr.IRI)i=t;else if(t instanceof xt.Literal)i=new Gr.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new xt.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 xt.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 xt.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 xt.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 xt.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 xt.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 o;if(r instanceof xt.Literal)o=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(o!=="ltr"&&o!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${o}'. Must be 'ltr' or 'rtl'`);return new xt.Literal(i,void 0,s,o)}static uuid(){let e=(0,Rw.v4)();return new Gr.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,Rw.v4)();return new xt.Literal(e)}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 xt.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Gr.IRI)){let c=t instanceof xt.Literal?"Literal":t instanceof Ci.BlankNode?"BlankNode":t instanceof Il.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,o=r;return new Il.QuotedTriple(i,s,o)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.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 Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.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 Il.QuotedTriple)){let t=e instanceof Gr.IRI?"IRI":e instanceof xt.Literal?"Literal":e instanceof Ci.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};Tm.RDFTermFunctions=Cw});var bC=w(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.HashFunctions=void 0;var Ow=class{static{a(this,"HashFunctions")}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")}};Am.HashFunctions=Ow});var xm=w(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.BuiltInFunctions=void 0;var yr=dC(),oa=hC(),Re=wm(),xl=gC(),Ft=yC(),$f=bC(),Pw=class{static{a(this,"BuiltInFunctions")}static str(...e){return yr.StringFunctions.str(...e)}static lang(...e){return yr.StringFunctions.lang(...e)}static langdir(...e){return yr.StringFunctions.langdir(...e)}static langMatches(...e){return yr.StringFunctions.langMatches(...e)}static regex(...e){return yr.StringFunctions.regex(...e)}static contains(...e){return yr.StringFunctions.contains(...e)}static strStarts(...e){return yr.StringFunctions.strStarts(...e)}static strEnds(...e){return yr.StringFunctions.strEnds(...e)}static strlen(...e){return yr.StringFunctions.strlen(...e)}static ucase(...e){return yr.StringFunctions.ucase(...e)}static lcase(...e){return yr.StringFunctions.lcase(...e)}static substr(...e){return yr.StringFunctions.substr(...e)}static strBefore(...e){return yr.StringFunctions.strBefore(...e)}static strAfter(...e){return yr.StringFunctions.strAfter(...e)}static concat(...e){return yr.StringFunctions.concat(...e)}static replace(...e){return yr.StringFunctions.replace(...e)}static encodeForUri(...e){return yr.StringFunctions.encodeForUri(...e)}static normalize(...e){return yr.StringFunctions.normalize(...e)}static fold(...e){return yr.StringFunctions.fold(...e)}static abs(...e){return oa.MathFunctions.abs(...e)}static round(...e){return oa.MathFunctions.round(...e)}static ceil(...e){return oa.MathFunctions.ceil(...e)}static floor(...e){return oa.MathFunctions.floor(...e)}static rand(){return oa.MathFunctions.rand()}static msToMinutes(...e){return oa.MathFunctions.msToMinutes(...e)}static msToHours(...e){return oa.MathFunctions.msToHours(...e)}static msToSeconds(...e){return oa.MathFunctions.msToSeconds(...e)}static parseDate(...e){return Re.DateTimeFunctions.parseDate(...e)}static dateBefore(...e){return Re.DateTimeFunctions.dateBefore(...e)}static dateAfter(...e){return Re.DateTimeFunctions.dateAfter(...e)}static dateInRange(...e){return Re.DateTimeFunctions.dateInRange(...e)}static dateDiffMinutes(...e){return Re.DateTimeFunctions.dateDiffMinutes(...e)}static dateDiffHours(...e){return Re.DateTimeFunctions.dateDiffHours(...e)}static year(...e){return Re.DateTimeFunctions.year(...e)}static month(...e){return Re.DateTimeFunctions.month(...e)}static day(...e){return Re.DateTimeFunctions.day(...e)}static hours(...e){return Re.DateTimeFunctions.hours(...e)}static minutes(...e){return Re.DateTimeFunctions.minutes(...e)}static seconds(...e){return Re.DateTimeFunctions.seconds(...e)}static timezone(...e){return Re.DateTimeFunctions.timezone(...e)}static tz(...e){return Re.DateTimeFunctions.tz(...e)}static now(){return Re.DateTimeFunctions.now()}static parseDayTimeDuration(...e){return Re.DateTimeFunctions.parseDayTimeDuration(...e)}static formatDayTimeDuration(...e){return Re.DateTimeFunctions.formatDayTimeDuration(...e)}static xsdDayTimeDuration(...e){return Re.DateTimeFunctions.xsdDayTimeDuration(...e)}static compareDurations(...e){return Re.DateTimeFunctions.compareDurations(...e)}static isDayTimeDuration(...e){return Re.DateTimeFunctions.isDayTimeDuration(...e)}static isDate(...e){return Re.DateTimeFunctions.isDate(...e)}static dateDiff(...e){return Re.DateTimeFunctions.dateDiff(...e)}static dateTimeDiff(...e){return Re.DateTimeFunctions.dateTimeDiff(...e)}static dateTimeAdd(...e){return Re.DateTimeFunctions.dateTimeAdd(...e)}static dateTimeSubtract(...e){return Re.DateTimeFunctions.dateTimeSubtract(...e)}static dateAdd(...e){return Re.DateTimeFunctions.dateAdd(...e)}static dateSubtract(...e){return Re.DateTimeFunctions.dateSubtract(...e)}static parseYearMonthDuration(...e){return Re.DateTimeFunctions.parseYearMonthDuration(...e)}static isYearMonthDuration(...e){return Re.DateTimeFunctions.isYearMonthDuration(...e)}static dateTimeAddYearMonth(...e){return Re.DateTimeFunctions.dateTimeAddYearMonth(...e)}static dateTimeSubtractYearMonth(...e){return Re.DateTimeFunctions.dateTimeSubtractYearMonth(...e)}static dateAddYearMonth(...e){return Re.DateTimeFunctions.dateAddYearMonth(...e)}static dateSubtractYearMonth(...e){return Re.DateTimeFunctions.dateSubtractYearMonth(...e)}static durationAdd(...e){return Re.DateTimeFunctions.durationAdd(...e)}static durationSubtract(...e){return Re.DateTimeFunctions.durationSubtract(...e)}static durationMultiply(...e){return Re.DateTimeFunctions.durationMultiply(...e)}static durationDivide(...e){return Re.DateTimeFunctions.durationDivide(...e)}static formatYearMonthDuration(...e){return Re.DateTimeFunctions.formatYearMonthDuration(...e)}static yearMonthDurationAdd(...e){return Re.DateTimeFunctions.yearMonthDurationAdd(...e)}static yearMonthDurationSubtract(...e){return Re.DateTimeFunctions.yearMonthDurationSubtract(...e)}static durationYears(...e){return Re.DateTimeFunctions.durationYears(...e)}static durationMonths(...e){return Re.DateTimeFunctions.durationMonths(...e)}static durationToDays(...e){return Re.DateTimeFunctions.durationToDays(...e)}static durationToHours(...e){return Re.DateTimeFunctions.durationToHours(...e)}static durationToMinutes(...e){return Re.DateTimeFunctions.durationToMinutes(...e)}static durationToSeconds(...e){return Re.DateTimeFunctions.durationToSeconds(...e)}static durationDays(...e){return Re.DateTimeFunctions.durationDays(...e)}static durationHours(...e){return Re.DateTimeFunctions.durationHours(...e)}static durationMinutes(...e){return Re.DateTimeFunctions.durationMinutes(...e)}static durationSeconds(...e){return Re.DateTimeFunctions.durationSeconds(...e)}static adjust(...e){return Re.DateTimeFunctions.adjust(...e)}static isTime(...e){return Re.DateTimeFunctions.isTime(...e)}static timeDiff(...e){return Re.DateTimeFunctions.timeDiff(...e)}static compare(...e){return xl.LogicalFunctions.compare(...e)}static logicalAnd(...e){return xl.LogicalFunctions.logicalAnd(...e)}static logicalOr(...e){return xl.LogicalFunctions.logicalOr(...e)}static logicalNot(...e){return xl.LogicalFunctions.logicalNot(...e)}static coalesce(...e){return xl.LogicalFunctions.coalesce(...e)}static if(...e){return xl.LogicalFunctions.if(...e)}static datatype(...e){return Ft.RDFTermFunctions.datatype(...e)}static bound(...e){return Ft.RDFTermFunctions.bound(...e)}static isIRI(...e){return Ft.RDFTermFunctions.isIRI(...e)}static isBlank(...e){return Ft.RDFTermFunctions.isBlank(...e)}static isLiteral(...e){return Ft.RDFTermFunctions.isLiteral(...e)}static isTriple(...e){return Ft.RDFTermFunctions.isTriple(...e)}static isNumeric(...e){return Ft.RDFTermFunctions.isNumeric(...e)}static hasLangdir(...e){return Ft.RDFTermFunctions.hasLangdir(...e)}static sameTerm(...e){return Ft.RDFTermFunctions.sameTerm(...e)}static iri(...e){return Ft.RDFTermFunctions.iri(...e)}static uri(...e){return Ft.RDFTermFunctions.uri(...e)}static bnode(...e){return Ft.RDFTermFunctions.bnode(...e)}static strdt(...e){return Ft.RDFTermFunctions.strdt(...e)}static strlang(...e){return Ft.RDFTermFunctions.strlang(...e)}static strlangdir(...e){return Ft.RDFTermFunctions.strlangdir(...e)}static uuid(){return Ft.RDFTermFunctions.uuid()}static struuid(){return Ft.RDFTermFunctions.struuid()}static xsdDateTime(...e){return Ft.RDFTermFunctions.xsdDateTime(...e)}static xsdInteger(...e){return Ft.RDFTermFunctions.xsdInteger(...e)}static xsdDecimal(...e){return Ft.RDFTermFunctions.xsdDecimal(...e)}static triple(...e){return Ft.RDFTermFunctions.triple(...e)}static subject(...e){return Ft.RDFTermFunctions.subject(...e)}static predicate(...e){return Ft.RDFTermFunctions.predicate(...e)}static object(...e){return Ft.RDFTermFunctions.object(...e)}static md5(...e){return $f.HashFunctions.md5(...e)}static sha1(...e){return $f.HashFunctions.sha1(...e)}static sha256(...e){return $f.HashFunctions.sha256(...e)}static sha384(...e){return $f.HashFunctions.sha384(...e)}static sha512(...e){return $f.HashFunctions.sha512(...e)}};Im.BuiltInFunctions=Pw});var Uf=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ExoQLBudgetExceededError=Ss.ExoQLCycleError=Ss.ExoQLEvalDisabledError=Ss.ExoQLForbiddenKeywordError=void 0;var Fw=class extends Error{static{a(this,"ExoQLForbiddenKeywordError")}constructor(e,t){super(t??`ExoQLForbiddenKeywordError: keyword "${e}" is not permitted by the exoql__Query AST allowlist`),this.name="ExoQLForbiddenKeywordError",this.keyword=e}};Ss.ExoQLForbiddenKeywordError=Fw;var Dw=class extends Error{static{a(this,"ExoQLEvalDisabledError")}constructor(e){super(e??"ExoQLEvalDisabledError: exoql.eval.enabled is false (default). Flip the feature flag to opt in."),this.name="ExoQLEvalDisabledError"}};Ss.ExoQLEvalDisabledError=Dw;var Lw=class extends Error{static{a(this,"ExoQLCycleError")}constructor(e,t){super(t??`ExoQLCycleError: cycle detected in nested exo:eval invocations: ${e.join(" \u2192 ")}`),this.name="ExoQLCycleError",this.path=e}};Ss.ExoQLCycleError=Lw;var Nw=class extends Error{static{a(this,"ExoQLBudgetExceededError")}constructor(e,t,r,i){super(i??`ExoQLBudgetExceededError: ${e} budget exceeded (limit=${t}, observed=${r})`),this.name="ExoQLBudgetExceededError",this.budget=e,this.limit=t,this.observed=r}};Ss.ExoQLBudgetExceededError=Nw});var xC=w(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.functionHandlers=void 0;var z=xm();K.functionHandlers=new Map;K.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.str(t)});K.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.lang(t)});K.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 z.BuiltInFunctions.langMatches(t,r)});K.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 z.BuiltInFunctions.contains(t,r)});K.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 z.BuiltInFunctions.strStarts(t,r)});K.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 z.BuiltInFunctions.strEnds(t,r)});K.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.strlen(t)});K.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.ucase(t)});K.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.lcase(t)});K.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 z.BuiltInFunctions.substr(t,r,i)}return z.BuiltInFunctions.substr(t,r)});K.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 z.BuiltInFunctions.strBefore(t,r)});K.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 z.BuiltInFunctions.strAfter(t,r)});K.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return z.BuiltInFunctions.concat(...t)});K.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 z.BuiltInFunctions.replace(t,r,i,s)});K.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 z.BuiltInFunctions.regex(t,r,i)});K.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.encodeForUri(t)});K.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.datatype(t).value});K.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return z.BuiltInFunctions.bound(r)}return!0});var _C=a((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isIRI(t)},"isIriHandler");K.functionHandlers.set("isiri",_C);K.functionHandlers.set("isuri",_C);K.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isBlank(t)});K.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isLiteral(t)});K.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isNumeric(t)});K.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.hasLangdir(t)});K.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.isTriple(t)});K.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return z.BuiltInFunctions.sameTerm(t,r)});K.functionHandlers.set("abs",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.abs(t)});K.functionHandlers.set("round",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.round(t)});K.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.ceil(t)});K.functionHandlers.set("floor",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return z.BuiltInFunctions.floor(t)});K.functionHandlers.set("rand",()=>z.BuiltInFunctions.rand());K.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.parseDate(t)});K.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 z.BuiltInFunctions.dateBefore(t,r)});K.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 z.BuiltInFunctions.dateAfter(t,r)});K.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 z.BuiltInFunctions.dateInRange(t,r,i)});K.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 z.BuiltInFunctions.dateDiffMinutes(t,r)});K.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 z.BuiltInFunctions.dateDiffHours(t,r)});var Rl=a((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"),SC=Rl(z.BuiltInFunctions.year.bind(z.BuiltInFunctions),z.BuiltInFunctions.durationYears.bind(z.BuiltInFunctions),null);K.functionHandlers.set("year",SC);K.functionHandlers.set("years",SC);var wC=Rl(z.BuiltInFunctions.month.bind(z.BuiltInFunctions),z.BuiltInFunctions.durationMonths.bind(z.BuiltInFunctions),null);K.functionHandlers.set("month",wC);K.functionHandlers.set("months",wC);var vC=Rl(z.BuiltInFunctions.day.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationDays.bind(z.BuiltInFunctions));K.functionHandlers.set("day",vC);K.functionHandlers.set("days",vC);K.functionHandlers.set("hours",Rl(z.BuiltInFunctions.hours.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationHours.bind(z.BuiltInFunctions)));K.functionHandlers.set("minutes",Rl(z.BuiltInFunctions.minutes.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationMinutes.bind(z.BuiltInFunctions)));K.functionHandlers.set("seconds",Rl(z.BuiltInFunctions.seconds.bind(z.BuiltInFunctions),null,z.BuiltInFunctions.durationSeconds.bind(z.BuiltInFunctions)));K.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.timezone(t)});K.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.tz(t)});K.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 z.BuiltInFunctions.adjust(t,r)});K.functionHandlers.set("now",()=>z.BuiltInFunctions.now());var EC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");K.functionHandlers.set("datetime",EC);K.functionHandlers.set("xsd:datetime",EC);var TC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");K.functionHandlers.set("integer",TC);K.functionHandlers.set("xsd:integer",TC);var AC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");K.functionHandlers.set("decimal",AC);K.functionHandlers.set("xsd:decimal",AC);var IC=a((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");K.functionHandlers.set("daytimeduration",IC);K.functionHandlers.set("xsd:daytimeduration",IC);K.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToDays(t)});K.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToHours(t)});K.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToMinutes(t)});K.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationToSeconds(t)});K.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationDays(t)});K.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationHours(t)});K.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationMinutes(t)});K.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationSeconds(t)});K.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationYears(t)});K.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return z.BuiltInFunctions.durationMonths(t)});K.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeDiff(t,r)});K.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeAdd(t,r)});K.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return z.BuiltInFunctions.dateTimeSubtract(t,r)});K.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToMinutes(t)});K.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToHours(t)});K.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.msToSeconds(t)});K.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.md5(t)});K.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha1(t)});K.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha256(t)});K.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha384(t)});K.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return z.BuiltInFunctions.sha512(t)});K.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.subject(t)});K.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.predicate(t)});K.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return z.BuiltInFunctions.object(t)});K.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 z.BuiltInFunctions.triple(t,r,i)});K.functionHandlers.set("days_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t),s=new Date(r);return Math.floor((s.getTime()-i.getTime())/(1440*60*1e3))});K.functionHandlers.set("minutes_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t),s=new Date(r);return Math.floor((s.getTime()-i.getTime())/(60*1e3))});K.functionHandlers.set("hours_between",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t);return(new Date(r).getTime()-i.getTime())/(3600*1e3)});K.functionHandlers.set("age_days",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=new Date(t);return Math.floor((new Date().getTime()-r.getTime())/(1440*60*1e3))});K.functionHandlers.set("week_number",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=new Date(t),i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate()));i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7));let s=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i.getTime()-s.getTime())/(1440*60*1e3)+1)/7)});K.functionHandlers.set("format_date",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution)),r=e.getStringValue(e.evaluateExpression(n[1],e.solution)),i=new Date(t);return r.replace("YYYY",String(i.getFullYear())).replace("MM",String(i.getMonth()+1).padStart(2,"0")).replace("DD",String(i.getDate()).padStart(2,"0")).replace("HH",String(i.getHours()).padStart(2,"0")).replace("mm",String(i.getMinutes()).padStart(2,"0")).replace("ss",String(i.getSeconds()).padStart(2,"0"))});K.functionHandlers.set("exo:eval",()=>{let{ExoQLEvalDisabledError:n}=Uf();throw new n})});var Rm=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.FilterExecutor=Cl.FilterExecutorError=void 0;var Et=xm(),AU=xC(),kw=Oe(),ws=Ge(),Ar=class extends Error{static{a(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};Cl.FilterExecutorError=Ar;var Mw=class{static{a(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||typeof e!="object")return!1;if(e.type==="exists")return!0;if(e.type==="logical")return e.operands.some(t=>this.expressionContainsExists(t));if(e.type==="comparison"){let t=e;return this.expressionContainsExists(t.left)||this.expressionContainsExists(t.right)}if(e.type==="arithmetic"){let t=e;return this.expressionContainsExists(t.left)||this.expressionContainsExists(t.right)}if(e.type==="in"){let t=e;return this.expressionContainsExists(t.expression)||t.list.some(r=>this.expressionContainsExists(r))}if(e.type==="function"||e.type==="functionCall"){let t=e;return Array.isArray(t.args)?t.args.some(r=>this.expressionContainsExists(r)):!1}return!1}async executeAll(e,t){let r=[];async function*i(){for(let s of t)yield s}a(i,"generator");for await(let s of this.execute(e,i()))r.push(s);return r}evaluateExpression(e,t){let r=e;if("termType"in e)switch(r.termType){case"Variable":return t.get(r.value);case"Literal":{let i=r.value,s=r.datatype,o=typeof s=="string"?s:s?.value;return o&&i.length>0&&this.shouldPreserveDatatype(o)?new ws.Literal(i,new kw.IRI(o)):i}case"NamedNode":return r.value;default:throw new Ar(`Unsupported termType: ${String(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":{let i=e;return i.datatype&&i.value.length>0&&this.shouldPreserveDatatype(i.datatype)?new ws.Literal(i.value,new kw.IRI(i.datatype)):i.value}case"in":return this.evaluateIn(e,t);case"exists":throw new Ar("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new Ar(`Unsupported expression type: ${e.type}`)}}async evaluateExpressionAsync(e,t){if(!this.expressionContainsExists(e))return this.evaluateExpression(e,t);if(e.type==="exists")return this.evaluateExists(e,t);if(e.type==="logical")return this.evaluateLogicalAsync(e,t);if(e.type==="comparison"){let r=e,i=await this.evaluateExpressionAsync(r.left,t),s=await this.evaluateExpressionAsync(r.right,t);return Et.BuiltInFunctions.compare(i,s,r.operator)}return e.type==="in"?this.evaluateInAsync(e,t):e.type==="function"||e.type==="functionCall"?this.evaluateFunctionAsync(e,t):this.evaluateExpression(e,t)}async evaluateExists(e,t){if(!this.existsEvaluator)throw new Ar("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 Et.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 Et.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return Et.BuiltInFunctions.logicalOr(r);throw new Ar(`Unknown logical operator: ${String(e.operator)}`)}async evaluateInAsync(e,t){let r=await this.evaluateExpressionAsync(e.expression,t),i=!1;for(let s of e.list){let o=await this.evaluateExpressionAsync(s,t);if(Et.BuiltInFunctions.compare(r,o,"=")){i=!0;break}}return e.negated?!i:i}async evaluateFunctionAsync(e,t){let r=e,i=this.extractFunctionName(r.function),s=r.args??[];if(i==="if"){if(s.length!==3)throw new Ar("IF requires exactly 3 arguments");let l=await this.evaluateExpressionAsync(s[0],t);return this.toBoolean(l)?this.evaluateExpressionAsync(s[1],t):this.evaluateExpressionAsync(s[2],t)}if(i==="coalesce"){for(let l of s)try{let u=await this.evaluateExpressionAsync(l,t);if(u!=null)return u}catch{continue}return}let o=[];for(let l of s){let u=await this.evaluateExpressionAsync(l,t);o.push(this.wrapAsLiteralExpression(u))}let c={...r,args:o};return this.evaluateFunction(c,t)}wrapAsLiteralExpression(e){return e==null?{type:"literal",value:""}:typeof e=="object"&&"termType"in e?e:e instanceof kw.IRI||e instanceof ws.Literal?{type:"literal",value:e.value}:typeof e=="number"||typeof e=="boolean"||typeof e=="string"?{type:"literal",value:e}:{type:"literal",value:String(e)}}evaluateComparison(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);return Et.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return Et.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return Et.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return Et.BuiltInFunctions.logicalOr(r);throw new Ar(`Unknown logical operator: ${String(e.operator)}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let o=this.evaluateExpression(s,t);return Et.BuiltInFunctions.compare(r,o,"=")});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 Et.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return Et.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return Et.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return Et.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return Et.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return Et.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new Ar("Division by zero");return Et.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return Et.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),o=this.toNumericValue(i);switch(e.operator){case"+":return s+o;case"-":return s-o;case"*":return s*o;case"/":if(o===0)throw new Ar("Division by zero");return s/o;default:throw new Ar(`Unknown arithmetic operator: ${String(e.operator)}`)}}shouldPreserveDatatype(e){return e==="http://www.w3.org/2001/XMLSchema#dateTime"||e==="http://www.w3.org/2001/XMLSchema#date"||e==="http://www.w3.org/2001/XMLSchema#time"||e==="http://www.w3.org/2001/XMLSchema#dayTimeDuration"||e==="http://www.w3.org/2001/XMLSchema#yearMonthDuration"||e==="http://www.w3.org/2001/XMLSchema#duration"}isDayTimeDurationValue(e){return e instanceof ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof ws.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 Ar(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof ws.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 ws.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof ws.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 o=AU.functionHandlers.get(i);if(!o)throw new Ar(`Unknown function: ${i}`);let c={evaluateExpression:a((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:a((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:a(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:a(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:a(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return o(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 Ar(`Unknown function format: ${String(e)}`)}evaluateSpecialFunction(e,t,r){switch(e){case"coalesce":for(let i of t)try{let s=this.evaluateExpression(i,r);if(s!=null)return{value:s}}catch{continue}return{value:void 0};case"if":{if(!t||t.length!==3)throw new Ar("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({type:"function",function:"byuuid",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 ws.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 Ar("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 o=this.tripleStore.findSubjectsByUUIDSync(s);if(o.length===0){this.uuidCache.set(s,null);return}let c=o[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)}};Cl.FilterExecutor=Mw});var $w=w(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.OptionalExecutor=void 0;var jw=class{static{a(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);yield*this.hashJoin(r,i)}async executeAll(e,t){let r=[];for(let i of this.hashJoin(e,t))r.push(i);return r}*hashJoin(e,t){if(e.length===0)return;if(t.length===0){yield*e;return}let r=new Set;for(let l of e)for(let u of l.variables())r.add(u);let i=new Set;for(let l of t)for(let u of l.variables())i.add(u);let s=[];for(let l of r)i.has(l)&&s.push(l);if(s.sort(),s.length===0){yield*this.nestedLoopJoin(e,t);return}let o="\0",c=new Map;for(let l of t){let u=this.computeHashKey(l,s,o),f=c.get(u);f||(f=[],c.set(u,f)),f.push(l)}for(let l of e){let u=this.computeHashKey(l,s,o),f=c.get(u),d=!1;if(f)for(let h of f){let p=l.merge(h);p!==null&&(yield p,d=!0)}d||(yield l)}}computeHashKey(e,t,r){let i=[];for(let s of t){let o=e.get(s);i.push(o!==void 0?o.toString():"UNBOUND")}return i.join(r)}*nestedLoopJoin(e,t){for(let r of e){let i=!1;for(let s of t){let o=r.merge(s);o!==null&&(yield o,i=!0)}i||(yield r)}}};Cm.OptionalExecutor=jw});var Bw=w(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.UnionExecutor=void 0;var Uw=class{static{a(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 o of e)yield o}a(i,"generateLeft");async function*s(){for(let o of t)yield o}a(s,"generateRight");for await(let o of this.execute(i(),s()))r.push(o);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Om.UnionExecutor=Uw});var RC=w(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.MinusExecutor=void 0;var Vw=class{static{a(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 o=!1;for(let c of i)if(this.areCompatible(s,c)){o=!0;break}o||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let o of e)yield o}a(i,"generateLeft");async function*s(){for(let o of t)yield o}a(s,"generateRight");for await(let o of this.execute(i(),s()))r.push(o);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(o=>i.has(o));if(s.length===0)return!1;for(let o of s){let c=e.get(o),l=t.get(o);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Pm.MinusExecutor=Vw});var OC=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.ValuesExecutor=Ol.ValuesExecutorError=void 0;var IU=_s(),CC=Oe(),xU=Ge(),Fm=class extends Error{static{a(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Ol.ValuesExecutorError=Fm;var qw=class{static{a(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 IU.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 CC.IRI(e.value);if(e.type==="literal")return new xU.Literal(e.value,e.datatype?new CC.IRI(e.datatype):void 0,e.language,e.direction);throw new Fm(`Unknown term type: ${e.type}`)}};Ol.ValuesExecutor=qw});var Gw=w(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.CustomAggregateRegistry=Fl.CustomAggregateError=void 0;var Pl=class extends Error{static{a(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Fl.CustomAggregateError=Pl;var Dm=class n{static{a(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 Pl("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Pl("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Pl(`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}};Fl.CustomAggregateRegistry=Dm;Dm.instance=null});var Ww=w(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.BUILT_IN_AGGREGATES=st.modeAggregate=st.stddevAggregate=st.varianceAggregate=st.medianAggregate=st.EXO_AGGREGATE_NS=void 0;st.getNumericValue=Lm;st.createDecimalLiteral=Oi;st.createDoubleLiteral=OU;st.createPercentileAggregate=oc;var ac=Ge(),Dl=Oe(),RU=new Dl.IRI("http://www.w3.org/2001/XMLSchema#decimal"),CU=new Dl.IRI("http://www.w3.org/2001/XMLSchema#double");st.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Lm(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof ac.Literal?parseFloat(n.value):n instanceof Dl.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}a(Lm,"getNumericValue");function Oi(n){return new ac.Literal(String(n),RU)}a(Oi,"createDecimalLiteral");function OU(n){return new ac.Literal(String(n),CU)}a(OU,"createDoubleLiteral");st.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Lm(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=[...t].sort((o,c)=>o-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return Oi(s)}};st.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Lm(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=t.reduce((s,o)=>s+o,0)/t.length,i=t.reduce((s,o)=>s+Math.pow(o-r,2),0)/t.length;return Oi(i)}};st.stddevAggregate={init(){return{values:[]}},step(n,e){st.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return Oi(0);let r=t.reduce((s,o)=>s+o,0)/t.length,i=t.reduce((s,o)=>s+Math.pow(o-r,2),0)/t.length;return Oi(Math.sqrt(i))}};st.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof ac.Literal||e instanceof Dl.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 ac.Literal(" ",new Dl.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[o,c]of e.counts)c>r&&(r=c,t=o);let i=e.values.get(t);if(i instanceof ac.Literal)return i;let s=parseFloat(t);return isNaN(s)?new ac.Literal(t,new Dl.IRI("http://www.w3.org/2001/XMLSchema#string")):Oi(s)}};function oc(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Lm(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return Oi(0);let s=[...i].sort((d,h)=>d-h),o=r.percentile*(s.length-1),c=Math.floor(o),l=Math.ceil(o);if(c===l)return Oi(s[c]);let u=o-c,f=s[c]*(1-u)+s[l]*u;return Oi(f)}}}a(oc,"createPercentileAggregate");st.BUILT_IN_AGGREGATES={[`${st.EXO_AGGREGATE_NS}median`]:st.medianAggregate,[`${st.EXO_AGGREGATE_NS}variance`]:st.varianceAggregate,[`${st.EXO_AGGREGATE_NS}stddev`]:st.stddevAggregate,[`${st.EXO_AGGREGATE_NS}mode`]:st.modeAggregate,[`${st.EXO_AGGREGATE_NS}percentile25`]:oc(25),[`${st.EXO_AGGREGATE_NS}percentile50`]:oc(50),[`${st.EXO_AGGREGATE_NS}percentile75`]:oc(75),[`${st.EXO_AGGREGATE_NS}percentile90`]:oc(90),[`${st.EXO_AGGREGATE_NS}percentile95`]:oc(95),[`${st.EXO_AGGREGATE_NS}percentile99`]:oc(99)}});var DC=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.AggregateExecutor=Ll.AggregateExecutorError=void 0;var br=Ge(),zw=Oe(),PU=Rm(),FU=Gw(),DU=Ww(),PC=new zw.IRI("http://www.w3.org/2001/XMLSchema#integer"),cc=new zw.IRI("http://www.w3.org/2001/XMLSchema#decimal"),vs=new zw.IRI("http://www.w3.org/2001/XMLSchema#string");function FC(n){return typeof n=="object"&&n.type==="custom"}a(FC,"isCustomAggregation");var Bf=class extends Error{static{a(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Ll.AggregateExecutorError=Bf;var Hw=class{static{a(this,"AggregateExecutor")}constructor(){this.filterExecutor=new PU.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,o]of r.entries()){let c=new Map;for(let f of e.variables)if(o.length>0){let d=o[0].get(f);d&&c.set(f,d)}for(let f of e.aggregates){let d=this.computeAggregate(f.expression,o);c.set(f.variable,d)}let{SolutionMapping:l}=_s(),u=new l;for(let[f,d]of c.entries())u.set(f,d);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),o=r.get(s);o?o.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(FC(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 br.Literal(String(s),PC)}case"sum":{let s=this.computeSum(r);return new br.Literal(String(s),cc)}case"avg":{let s=this.computeAvg(r);return new br.Literal(String(s),cc)}case"min":{let s=this.computeMin(r);return s===void 0?new br.Literal("",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}case"max":{let s=this.computeMax(r);return s===void 0?new br.Literal("",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new br.Literal(s||" ",vs)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new br.Literal(" ",vs):typeof s=="number"?new br.Literal(String(s),cc):new br.Literal(String(s),vs)}default:{let s=i;throw new Bf(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,o=FU.CustomAggregateRegistry.getInstance().get(i);if(o||(o=DU.BUILT_IN_AGGREGATES[i]),!o)throw new Bf(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=o.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;o.step(c,u)}return o.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 o=s[0],c=parseFloat(o);return isNaN(c)?o: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}=_s(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(FC(s)){r.set(i.variable,new br.Literal("0",cc));continue}switch(s){case"count":r.set(i.variable,new br.Literal("0",PC));break;case"sum":case"avg":r.set(i.variable,new br.Literal("0",cc));break;case"group_concat":r.set(i.variable,new br.Literal(" ",vs));break;case"min":case"max":case"sample":r.set(i.variable,new br.Literal("",vs));break;default:r.set(i.variable,new br.Literal("",vs))}}return r}};Ll.AggregateExecutor=Hw});var Xw=w(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.ConstructExecutor=void 0;var LU=Yn(),lc=Oe(),Kw=Ge(),Qw=jt(),NU=mf(),Yw=class{static{a(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let o of e)try{let c=this.instantiateTriple(o,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 LU.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 lc.IRI(e.value);if(e.type==="literal")return new Kw.Literal(e.value,e.datatype?new lc.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new Qw.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 NU.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 Kw.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new lc.IRI(e.value);if(e.type==="blank")return new Qw.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 lc.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new lc.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 lc.IRI(e.value);if(e.type==="blank")return new Qw.BlankNode(e.value);if(e.type==="literal")return new Kw.Literal(e.value,e.datatype?new lc.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}`)}};Nm.ConstructExecutor=Yw});var NC=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.ServiceExecutor=Nl.ServiceExecutorError=void 0;var kU=_s(),LC=Oe(),MU=Ge(),jU=jt(),uc=class extends Error{static{a(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Nl.ServiceExecutorError=uc;var Jw=class{static{a(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,o=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 uc(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(o)}}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 uc(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new uc(`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 kU.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 LC.IRI(e.value);case"literal":{let t=e.datatype?new LC.IRI(e.datatype):void 0;return new MU.Literal(e.value,t,e["xml:lang"])}case"bnode":return new jU.BlankNode(e.value);default:throw new uc(`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))}};Nl.ServiceExecutor=Jw});var MC=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.GraphExecutor=kl.GraphExecutorError=void 0;var kC=Oe(),km=class extends Error{static{a(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};kl.GraphExecutorError=km;var Zw=class{static{a(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 km(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new kC.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let o=i.get(t.value);if(o&&o instanceof kC.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:o.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let o of s)for await(let c of r(e.pattern,o)){let l=c.clone();l.set(t.value,o),yield l}}};kl.GraphExecutor=Zw});var jC=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.SPARQLGenerator=jl.SPARQLGeneratorError=void 0;var Ml=class extends Error{static{a(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};jl.SPARQLGeneratorError=Ml;var e1=class{static{a(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 {
|
|
49
49
|
${i}
|
|
50
50
|
}`}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)}
|
|
51
51
|
${r}FILTER(${this.generateExpression(e.expression)})`;case"join":return`${this.generateWhereClause(e.left,t)}
|
|
@@ -88,8 +88,8 @@ ${Object.entries(r).map(([c,l])=>this.serializeValue(c,l)).join(`
|
|
|
88
88
|
${r}`}return`${e}: ${String(t)}`}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Zm.FrontmatterService=zf;zf.FRONTMATTER_REGEX=/^---\n([\s\S]*?)\n---/;zf.IRI_PREFIX_MAP={"https://exocortex.my/ontology/ems#":"ems__","https://exocortex.my/ontology/exo#":"exo__","https://exocortex.my/ontology/exocmd#":"exocmd__","https://exocortex.my/ontology/ims#":"ims__","https://exocortex.my/ontology/ztlk#":"ztlk__","https://exocortex.my/ontology/ptms#":"ptms__","https://exocortex.my/ontology/lit#":"lit__","https://exocortex.my/ontology/inbox#":"inbox__","https://exocortex.my/ontology/pmbok#":"pmbok__"}});var jn=w(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.DateFormatter=void 0;var f1=class n{static{a(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"),o=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${i}T${s}:${o}:${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,o=new Date(r,i-1,s,0,0,0,0);if(isNaN(o.getTime()))throw new Error(`Invalid date values: ${e}`);return n.toLocalTimestamp(o)}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)}};eg.DateFormatter=f1});var fc=w(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.LoggingService=void 0;var Kf=class{static{a(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 o=t?.stack?`
|
|
89
89
|
Stack trace:
|
|
90
90
|
${t.stack}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`,t??"")}else{let o=t?.message?`
|
|
91
|
-
Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`)}}};tg.LoggingService=Kf;Kf.isVerbose=!1;Kf.isDevelopment=void 0});var rO=w(Ir=>{"use strict";var aB=Ir&&Ir.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},cB=Ir&&Ir.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},
|
|
92
|
-
${t}`:t}async executeCreateInstance(e,t,r,i){if(!e.targetFolder)return{success:!1,error:"create_instance requires targetFolder"};let s={},o=null;if((e.inheritanceRule&&e.inheritanceRule.length>0||e.propertyDefault&&e.propertyDefault.some(g=>typeof g.value=="string"&&g.value.includes("__SUBSTITUTE"))||e.labelTemplate!==void 0&&/\$target\./.test(e.labelTemplate))&&t&&r){let g;try{g=await this.fileReader.readFile(r)}catch(y){return{success:!1,error:`create_instance: failed to read $target file "${r}": ${y instanceof Error?y.message:String(y)}`}}o=this.frontmatterService.parseObject(g)??null}let l;e.targetClass&&(l=await this.resolveClassRefToUid(e.targetClass));let u={userInput:i,targetIRI:t,targetFilePath:r,targetFm:o??void 0,groundingTargetClassUid:l};if(e.propertyDefault&&e.propertyDefault.length>0&&this.applyPropertyDefaultStep(s,e.propertyDefault,u),this.applyMissingScalarPrimitives(s,i,l,e,t,o,r),i)for(let[g,y]of Object.entries(i))g!=="label"&&y!=null&&(s[g]=y);if(e.inheritanceRule&&e.inheritanceRule.length>0&&o&&await this.applyInheritanceRuleStep(s,e.inheritanceRule,o),this.applyMissingBacklinkTopUp(s,e,t,r),t&&e.linkBackProperty&&s[e.linkBackProperty]===void 0){let g=Jn.extractBacklinkTarget(t,r);s[e.linkBackProperty]=`"[[${g}]]"`}let f=s.exo__Asset_uid,d=this.frontmatterService.createFrontmatter("",s),h=e.targetFolder.includes("$isDefinedByFolder")?await this.resolveIsDefinedByFolder(s,r):this.substituteVariables(e.targetFolder,t,i,void 0,r),p=h?`${h}/${f}.md`:`${f}.md`;return await this.fileWriter.createFile(p,d),{success:!0,openPath:p}}async resolveIsDefinedByFolder(e,t){let r=Jn.parentFolderOf(t),i=e.exo__Asset_isDefinedBy,s=Jn.extractBareRef(i);if(s&&this.refToFolder)try{let o=await this.refToFolder(s);if(o!=null)return o}catch(o){hc.LoggingService.error(`[GroundingExecutor] $isDefinedByFolder resolution failed for ref "${s}" \u2014 falling back to host folder.`,o instanceof Error?o:new Error(String(o)))}return r}static parentFolderOf(e){let t=e.replace(/^\/+/,""),r=t.lastIndexOf("/");return r>=0?t.slice(0,r):""}static extractBareRef(e){if(typeof e!="string")return null;let t=e.trim();t=t.replace(/^["']|["']$/g,"").trim(),t=t.replace(/^\[\[/,"").replace(/\]\]$/,"");let r=t.indexOf("|");return r>=0&&(t=t.slice(0,r)),t=t.trim(),t.length>0?t:null}async resolveClassRefToUid(e){if(eO.test(e)||!this.classLabelToUid)return e;try{let t=await this.classLabelToUid(e);return t&&t.length>0?t:e}catch{return e}}applyPropertyDefaultStep(e,t,r){for(let{propertyName:i,value:s}of t){if(e[i]!==void 0)continue;let o=this.resolveSubstitutionMarker(s,r);if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;e[i]=o;continue}if(i==="exo__Instance_class"&&typeof o=="string"){e[i]=[o];continue}e[i]=o}}}applyMissingScalarPrimitives(e,t,r,i,s,o,c){let l=[];e.exo__Asset_uid===void 0&&(e.exo__Asset_uid=this.uidGen.next(),l.push("exo__Asset_uid")),e.exo__Asset_createdAt===void 0&&(e.exo__Asset_createdAt=d1.DateFormatter.toLocalTimestamp(this.clock.now()),l.push("exo__Asset_createdAt"));let u=typeof e.exo__Asset_label=="string"&&e.exo__Asset_label.trim().length===0;if(e.exo__Asset_label===void 0||u){let f=t?.label;if(f===void 0&&i?.labelTemplate)try{let h=this.substituteVariables(i.labelTemplate,s??"",t,o??void 0,c);h.trim().length>0&&(f=h)}catch(h){hc.LoggingService.error(`[GroundingExecutor] labelTemplate substitution failed: ${h instanceof Error?h.message:String(h)}. Falling back to "Untitled".`)}let d=f??"Untitled";e.exo__Asset_label=d,d!=="Untitled"&&e.aliases===void 0&&(e.aliases=[d]),l.push("exo__Asset_label")}e.exo__Instance_class===void 0&&r&&(e.exo__Instance_class=[`"[[${r}]]"`],l.push("exo__Instance_class")),l.length>0&&hc.LoggingService.error(`[GroundingExecutor] Universal Default Template did not cover essential scalar primitives: ${l.join(", ")}. Filled from legacy TS fallback. Vault may be in an unhealthy state \u2014 verify UniversalDefaultTemplate singleton is present and complete.`)}applyMissingBacklinkTopUp(e,t,r,i){if(!r||t.linkBackProperty||e.exo__Asset_prototype!==void 0||e.ems__Effort_parent!==void 0)return;let s=Jn.extractBacklinkTarget(r,i);Jn.propertiesReferenceTarget(e,s)||(e.exo__Asset_prototype=`"[[${s}]]"`,hc.LoggingService.error("[GroundingExecutor] No backlink rule fired (Universal IRs absent or no class match). Falling back to legacy exo__Asset_prototype default. Bug #5 may surface if target is not a prototype-instance."))}static propertiesReferenceTarget(e,t){if(!t)return!1;let r=`[[${t}]]`,i=a(s=>typeof s=="string"&&s.includes(r),"refs");for(let s of Object.values(e))if(i(s)||Array.isArray(s)&&s.some(i))return!0;return!1}resolveSubstitutionMarker(e,t){let r=e.match(_B);if(r){let c=r[1],l=r[2],u=Jn.decodeBase64UrlSafe(l),f=(0,h1.getResolver)(c);return f?f(t,u):(hc.LoggingService.warn(`[GroundingExecutor] Parameterised marker references unknown resolver '${c}' \u2014 value left as marker.`),e)}let i=e.match(bB);if(!i)return e;let s=i[1];if(s==="target"){let c=t.targetIRI??"",l=t.targetFilePath??"";return`"[[${Jn.extractBacklinkTarget(c,l)}]]"`}if(s==="targetFolder"){let c=t.targetFilePath??"";if(!c)return"";let l=c.replace(/^\/+/,""),u=l.lastIndexOf("/");return u>=0?l.slice(0,u):""}let o=(0,h1.getResolver)(s);return o?o(t):(hc.LoggingService.warn(`[GroundingExecutor] Marker references unknown resolver '${s}' \u2014 value left as marker.`),e)}static decodeBase64UrlSafe(e){return(0,hB.base64ToUtf8)(e.replace(/-/g,"+").replace(/_/g,"/"))}async applyInheritanceRuleStep(e,t,r){let i=this.extractTargetClassNames(r),s=[];for(let o of t)!await this.inheritanceConditionMatches(o.targetClassCondition,o.targetClassConditionUid,i)||await this.inheritanceExclusionMatches(o.targetClassExclusion,o.targetClassExclusionUids,i)||s.push(o);s.sort((o,c)=>c.priority-o.priority);for(let o of s){if(e[o.targetPropertyName]!==void 0)continue;let c=r[o.sourcePropertyName];c!=null&&(e[o.targetPropertyName]=this.formatInheritedValue(c))}}async inheritanceConditionMatches(e,t,r){return!e&&!t?!0:this.classRefMatchesAny(e,t,r)}async inheritanceExclusionMatches(e,t,r){for(let i of t??[])if(i&&r.includes(i))return!0;for(let i of e)if(await this.classRefMatchesAny(i,void 0,r))return!0;return!1}async classRefMatchesAny(e,t,r){if(t&&r.includes(t)||e&&r.includes(e))return!0;if(e&&this.classLabelToUid)try{let i=await this.classLabelToUid(e);if(i&&i.length>0&&r.includes(i))return!0}catch{}return!1}extractTargetClassNames(e){let t=e.exo__Instance_class;if(t==null)return[];let r=Array.isArray(t)?t:[t],i=[];for(let s of r){let o=this.extractWikilinkInner(String(s));o&&i.push(o)}return i}extractWikilinkInner(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/);return t?t[1].trim():e.replace(/^["']|["']$/g,"").trim()}formatInheritedValue(e){return Array.isArray(e)?e.map(t=>this.formatInheritedScalar(String(t))):this.formatInheritedScalar(String(e))}formatInheritedScalar(e){return/^"?\[\[.+\]\]"?$/.test(e)?this.reformatWikilink(e):eO.test(e)?`"[[${e}]]"`:e}reformatWikilink(e){return e.startsWith('"[[')&&e.endsWith(']]"')?e:e.startsWith("[[")&&e.endsWith("]]")?`"${e}"`:e}async executeStep(e,t,r,i,s){return e.type===$n.GroundingType.COMPOSITE?this.executeComposite(e,t,r,i,s):this.execute(e,t,r,i)}async rollback(e,t,r){if(e!==void 0)try{await this.fileWriter.updateFile(t,e)}catch(i){hc.LoggingService.error(`[GroundingExecutor] Rollback failed for ${t}`,i instanceof Error?i:new Error(String(i)))}}substituteVariables(e,t,r,i,s){let o=this.clock.now(),c=o.toISOString(),l=d1.DateFormatter.toLocalTimestamp(o),u=c.slice(0,10),f=`${u}T00:00:00`,d=`${l.slice(0,10)}-${l.slice(11,13)}-${l.slice(14,16)}`,h=e.replace(/\$target\.([A-Za-z_][\w]*)/g,(p,g)=>{if(!i)throw new Error(`$target.${g} substitution requires target frontmatter context; none was supplied (asset IRI: ${t})`);let y=i[g];if(y==null)throw new Error(`$target.${g} is undefined on asset ${t}`);if(Array.isArray(y))throw new Error(`$target.${g} resolved to an array on asset ${t}; only scalar properties are supported for substitution`);return String(y).replace(/^["'](.*)["']$/,"$1")});if(/\$targetFolder\b/.test(h)){if(!s)throw new Error("$targetFolder substitution requires targetFilePath context; none was supplied (asset IRI: "+t+")");let p=s.replace(/^\/+/,""),g=p.lastIndexOf("/"),y=g>=0?p.slice(0,g):"";h=h.replace(/\$targetFolder\b/g,y)}if(h=h.replace(/\$target/g,t).replace(/\$nowCompact\b/g,d).replace(/\$nowLocal/g,l).replace(/\$now/g,c).replace(/\$todayStart\b/g,f).replace(/\$today/g,u),r?.value!==void 0&&r.value!==null){let p=String(r.value);h=h.replace(/\$input\b/g,p).replace(/\$value\b/g,p)}return h}async executePropertyAppend(e,t,r,i){if(!e.targetProperty)return{success:!1,error:"property_append requires targetProperty"};if(e.appendExpression===void 0)return{success:!1,error:"property_append requires appendExpression"};let s=await this.fileReader.readFile(r),o=this.frontmatterService.parseObject(s)??{},c=this.substituteVariables(e.appendExpression,t,i,o),l=o[e.targetProperty],u=Array.isArray(l)?l:l!==void 0?[String(l)]:[],f=a(g=>g.replace(/^["'](.*)["']$/,"$1"),"stripQuotes"),d=new Set(u.map(f)),h;if(d.has(f(c)))h=u;else{let g=`"${f(c)}"`;h=[...u,g]}let p=this.frontmatterService.updateProperty(s,e.targetProperty,h);return await this.fileWriter.updateFile(r,p),{success:!0}}async executePropertyIncrement(e,t){if(!e.targetProperty)return{success:!1,error:"property_increment requires targetProperty"};let r=e.incrementBy??1;if(!Number.isFinite(r)||!Number.isInteger(r))return{success:!1,error:`property_increment: incrementBy must be an integer (got ${String(e.incrementBy)})`};let i=await this.fileReader.readFile(t),o=(this.frontmatterService.parseObject(i)??{})[e.targetProperty],c;if(o==null||o==="")c=0;else{if(Array.isArray(o))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" is an array, expected integer`};{let f=String(o).replace(/^["'](.*)["']$/,"$1").trim();if(!/^-?\d+$/.test(f))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" current value "${String(o)}" is not a valid integer`};c=Number.parseInt(f,10)}}let l=c+r,u=this.frontmatterService.updateProperty(i,e.targetProperty,l);return await this.fileWriter.updateFile(t,u),{success:!0}}async executePropertyShift(e,t){if(!e.targetProperty)return{success:!1,error:"property_shift requires targetProperty"};if(!e.shiftDelta)return{success:!1,error:"property_shift requires shiftDelta (ISO-8601 duration literal)"};let r=await this.fileReader.readFile(t),s=(this.frontmatterService.parseObject(r)??{})[e.targetProperty];if(s==null||s==="")return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is not set on target asset`};if(Array.isArray(s))return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is an array, expected single datetime`};let o=String(s).replace(/^["'](.*)["']$/,"$1").trim(),c=new Date(o);if(Number.isNaN(c.getTime()))return{success:!1,error:`property_shift: current value "${o}" is not a valid datetime`};let l;try{l=Jn.applyIsoDuration(c,e.shiftDelta)}catch(d){return{success:!1,error:`property_shift: invalid shiftDelta "${e.shiftDelta}": ${d instanceof Error?d.message:String(d)}`}}let u=d1.DateFormatter.toLocalTimestamp(l),f=this.frontmatterService.updateProperty(r,e.targetProperty,u);return await this.fileWriter.updateFile(t,f),{success:!0}}async executeWorkflowTransition(e,t,r,i){if(!this.workflowResolver)return{success:!1,error:"workflow_transition requires WorkflowResolver injection (options.workflowResolver). Wire the plugin/CLI before using this grounding type."};let s=await this.fileReader.readFile(r),o=this.frontmatterService.parseObject(s)??{},c=this.resolveAssetClassFromFrontmatter(o);if(!c)return{success:!1,error:"workflow_transition: target asset has no recognised ems__* class in exo__Instance_class (cannot resolve workflow)."};let l=this.resolveStatusFromFrontmatter(o);if(!l)return{success:!1,error:"workflow_transition: target asset has no parseable ems__Effort_status value (need wikilink to an ems__EffortStatus* asset)."};let u;try{u=new pB.IRI(t)}catch(I){return{success:!1,error:`workflow_transition: invalid targetIRI "${t}" \u2014 ${I instanceof Error?I.message:String(I)}`}}let f=await this.workflowResolver.resolveForAsset(u,c),d=e.direction??"forward",h=d==="rollback",p=f.transitions.find(I=>I.from===l&&I.isRollback===h);if(!p)return{success:!1,error:`workflow_transition: no ${d} transition from "${l}" defined in workflow "${f.name}" (target class: ${c}).`};let g=Ir.STATUS_UID_BY_ENUM[p.to];if(!g)return{success:!1,error:`workflow_transition: no UID mapping for destination status "${p.to}" (transition target unreachable).`};let y={id:`${e.id}.statusMutation`,label:`workflow_transition: ${p.from} \u2192 ${p.to}`,type:$n.GroundingType.PROPERTY_SET,targetProperty:"ems__Effort_status",targetValueRef:g},b=await this.executePropertySet(y,t,r,i);if(!b.success)return{success:!1,error:`workflow_transition: status mutation failed \u2014 ${b.error}`};let S=p.postActions??[],v=this.groundingLoader;if(S.length>0&&v===void 0)return{success:!1,error:"workflow_transition: transition has postActions but no GroundingLoader injected (options.groundingLoader). Wire commandResolver.loadGroundingByUid in plugin/CLI."};for(let I of S){if(v===void 0)break;let A=await v(I);if(!A)return{success:!1,error:`workflow_transition: postAction grounding UID "${I}" could not be loaded (asset missing or invalid Grounding shape).`};let T=await this.execute(A,t,r,i);if(!T.success)return{success:!1,error:`workflow_transition: postAction "${A.label}" (UID ${I}) failed \u2014 ${T.error}`}}return{success:!0}}resolveAssetClassFromFrontmatter(e){let t=e.exo__Instance_class;if(t==null)return null;let r=Array.isArray(t)?t:[t],i=new Set(Object.values(rg.AssetClass));for(let s of r){if(typeof s!="string")continue;let o=s.replace(/^\s*"?\[\[/,"").replace(/\]\]"?\s*$/,""),l=(o.includes("|")?o.split("|")[1]:o).trim();if(i.has(l))return l;let u=o.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(u){let f=Ir.CLASS_UID_TO_LABEL[u[1].toLowerCase()];if(f&&i.has(f))return f}}return null}resolveStatusFromFrontmatter(e){let t=e.ems__Effort_status;if(t==null)return null;if(Array.isArray(t)){if(t.length!==1)return null;t=t[0]}let i=String(t).trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"");if(/^ems__EffortStatus[A-Za-z]+$/.test(i))return i;if(i.includes("|")){let o=i.split("|")[1].trim();if(/^ems__EffortStatus[A-Za-z]+$/.test(o))return o}let s=i.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(s){let o=gB[s[1].toLowerCase()];if(o)return o}return null}static applyIsoDuration(e,t){let r=t.trim();if(/^-?P(\d+Y)(\d+M)?$|^-?P\d+M$/.test(r)){let o=ZC.DateTimeParsing.parseYearMonthDuration(r),c=new Date(e.getTime());return c.setMonth(c.getMonth()+o),c}let s=ZC.DateTimeParsing.parseDayTimeDuration(r);return new Date(e.getTime()+s)}static extractBacklinkTarget(e,t){let r=Jn.resolveTargetPath(e,t),i=r.split("/").pop()??r;return Jn.UUID_BASENAME_RE.test(i)?i:r}static resolveTargetPath(e,t){if(t)return t.replace(/\.md$/i,"").replace(/^\/+/,"");if(e){let r=e.match(/^obsidian:\/\/vault\/(.+?)(?:\.md)?(?:\?|#|$)/i);if(r&&r[1])try{return decodeURIComponent(r[1])}catch{return r[1]}}return e}};Ir.GroundingExecutor=ig;ig.UUID_BASENAME_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ir.GroundingExecutor=ig=Jn=aB([(0,lB.injectable)(),cB("design:paramtypes",[Object,Object,ng,Function,Object])],ig)});var nO=w(p1=>{"use strict";Object.defineProperty(p1,"__esModule",{value:!0});p1.createVaultFrontmatterClassLabelResolver=SB;function SB(n){return async e=>{if(!e)return null;let t=await n.findFilesByMetadata({exo__Asset_label:e});if(t.length>0){let s=(await n.getFileMetadata(t[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}let r=await n.findFilesByMetadata({aliases:e});if(r.length>0){let s=(await n.getFileMetadata(r[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}return null}}a(SB,"createVaultFrontmatterClassLabelResolver")});var iO=w(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});m1.createVaultFrontmatterRefToFolderResolver=wB;function wB(n){return async e=>{if(!e)return null;let t=await n.findFilesByMetadata({exo__Asset_uid:e});return t.length===0?null:vB(t[0])}}a(wB,"createVaultFrontmatterRefToFolderResolver");function vB(n){let e=n.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}a(vB,"parentFolderOf")});var oO=w(ho=>{"use strict";var EB=ho&&ho.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TB=ho&&ho.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},ql;Object.defineProperty(ho,"__esModule",{value:!0});ho.NamedQueryRunner=void 0;var AB=Be(),IB=Oe(),xB=Ge(),sO=qm(),RB=jp(),g1=ql=class{static{a(this,"NamedQueryRunner")}constructor(e,t){this.queryBodyResolver=e,this.tripleStore=t}async run(e,t={}){if(!e)return null;let r=await this.queryBodyResolver.resolveSparql(e);if(!r)return null;let i=this.substitute(r,t);return(0,sO.evaluateWithExoEval)(i,{store:this.tripleStore})}async runScalar(e,t={},r){if(!e)throw new Error("NamedQueryRunner.runScalar: empty queryUid");let i=await this.queryBodyResolver.resolveSparql(e);if(!i)throw new Error(`NamedQueryRunner: query__NamedQuery '${e}' has no resolvable SPARQL body (asset missing or no \`\`\`sparql block).`);let s=this.substitute(i,t),o=await(0,sO.evaluateWithExoEval)(s,{store:this.tripleStore});if(o.kind==="ask")return{value:o.result?"true":"false",kind:"literal"};if(o.kind==="construct")return null;let c=o.rows[0];if(!c)return null;let l=c.variables(),u=r??l[0];if(!u)return null;let f=c.get(u);return f===void 0?null:f instanceof IB.IRI?{value:(0,RB.iriToObsidianName)(f.value)??f.value,kind:"iri"}:f instanceof xB.Literal?{value:f.value,kind:"literal"}:null}substitute(e,t){let r=e;t.currentAsset&&(r=r.replace(/\$currentAsset\b/g,ql.formatIri(t.currentAsset))),t.currentClass&&(r=r.replace(/\$currentClass\b/g,ql.formatIri(t.currentClass)));let i=t.params;if(i){let s=Object.keys(i).sort((o,c)=>c.length-o.length);for(let o of s){let c=i[o],l=c.kind==="iri"?ql.formatIri(c.value):`"${ql.escapeLiteral(c.value)}"`,u=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(`\\$${u}\\b`,"g"),l)}}return r}static formatIri(e){if(/[\s<>"{}|\\^`]/.test(e))throw new Error(`NamedQueryRunner: refusing to inject malformed IRI "${e}" \u2014 contains a character illegal in a SPARQL IRIREF (would break out of <...>). Pass a percent-encoded IRI.`);return`<${e}>`}static escapeLiteral(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}};ho.NamedQueryRunner=g1;ho.NamedQueryRunner=g1=ql=EB([(0,AB.injectable)(),TB("design:paramtypes",[Object,Object])],g1)});var aO=w(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.extractSparqlBlock=CB;sg.stripFrontmatter=OB;function CB(n){let e=n.match(/```sparql\s*\n([\s\S]*?)\n```/);if(!e)return null;let t=e[1].trim();return t.length>0?t:null}a(CB,"extractSparqlBlock");function OB(n){if(!n.startsWith("---"))return n;let e=n.indexOf(`
|
|
91
|
+
Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`)}}};tg.LoggingService=Kf;Kf.isVerbose=!1;Kf.isDevelopment=void 0});var rO=w(Ir=>{"use strict";var aB=Ir&&Ir.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},cB=Ir&&Ir.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},Un;Object.defineProperty(Ir,"__esModule",{value:!0});Ir.GroundingExecutor=Ir.ServiceRegistry=Ir.CLASS_UID_TO_LABEL=Ir.STATUS_UID_BY_ENUM=void 0;var lB=Be(),uB=qf(),fB=Hm(),$n=Ko(),dB=u1(),rg=tl(),hB=al(),dc=rl(),pB=Oe(),mB=Es(),d1=jn(),ZC=Mf(),hc=fc();Ir.STATUS_UID_BY_ENUM={[dc.EffortStatus.DRAFT]:"c42245d0-01de-4c35-bfcf-d910445ea28e",[dc.EffortStatus.BACKLOG]:"753a44d5-846c-4b82-9196-4fd9a4d48777",[dc.EffortStatus.ANALYSIS]:"cde3525c-57ea-4efc-b477-2e7e7ccd3a1e",[dc.EffortStatus.TODO]:"6a0e933a-6653-46f4-95ae-ed7508177c73",[dc.EffortStatus.DOING]:"027e78f4-6e16-4b36-b8fb-5510507d5745",[dc.EffortStatus.DONE]:"7b9b3116-7c3c-438c-9618-94fe301320a6",[dc.EffortStatus.TRASHED]:"5d14f18d-db2b-4847-9ac1-144cb93b2541"};var gB=Object.freeze(Object.fromEntries(Object.entries(Ir.STATUS_UID_BY_ENUM).map(([n,e])=>[e,n])));Ir.CLASS_UID_TO_LABEL=Object.freeze({"1b20a8f0-d745-4e93-91db-4531b3df120e":rg.AssetClass.TASK,"7db5eeff-718a-49b0-8d2b-39b084a356e3":rg.AssetClass.PROJECT,"1b0a5e34-dd7f-4ead-b43a-6c7c5a5ecaca":rg.AssetClass.MEETING});var h1=Qm();(0,h1.installDefaultResolvers)();function yB(n){if(n){if(n==="1b20a8f0-d745-4e93-91db-4531b3df120e")return"ems__Task";if(n==="7db5eeff-718a-49b0-8d2b-39b084a356e3")return"ems__Project";if(n==="ems__Task"||n==="ems__Project")return n}}a(yB,"resolveClassFlipTarget");var eO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,bB=/^__SUBSTITUTE__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__$/,_B=/^__SUBSTITUTE_P__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__([A-Za-z0-9_-]*)__$/,ng=class{static{a(this,"ServiceRegistry")}constructor(){this.services=new Map}register(e,t){this.services.set(e,t)}get(e){return this.services.get(e)}has(e){return this.services.has(e)}getRegisteredIds(){return Array.from(this.services.keys())}};Ir.ServiceRegistry=ng;var tO=20,ig=Un=class{static{a(this,"GroundingExecutor")}constructor(e,t,r,i,s){this.frontmatterService=new mB.FrontmatterService,this.fileReader=e,this.fileWriter=t,this.serviceRegistry=r,this.classLabelToUid=i,this.refToFolder=s?.refToFolder,this.workflowResolver=s?.workflowResolver,this.groundingLoader=s?.groundingLoader,this.templateLoader=s?.templateLoader,this.namedQueryRunner=s?.namedQueryRunner,this.clock=s?.clock??(0,uB.liveClock)(),this.uidGen=s?.uidGenerator??(0,fB.liveUidGenerator)()}async execute(e,t,r,i){try{switch(e.type){case $n.GroundingType.PROPERTY_SET:return await this.executePropertySet(e,t,r,i);case $n.GroundingType.PROPERTY_DELETE:return await this.executePropertyDelete(e,r);case $n.GroundingType.COMPOSITE:return await this.executeComposite(e,t,r,i,0);case $n.GroundingType.SERVICE_CALL:return await this.executeServiceCall(e,t,r,i);case $n.GroundingType.CREATE_INSTANCE:return await this.executeCreateInstance(e,t,r,i);case $n.GroundingType.PROPERTY_APPEND:return await this.executePropertyAppend(e,t,r,i);case $n.GroundingType.PROPERTY_INCREMENT:return await this.executePropertyIncrement(e,r);case $n.GroundingType.PROPERTY_SHIFT:return await this.executePropertyShift(e,r);case $n.GroundingType.SPARQL_UPDATE:return{success:!1,error:"sparql_update grounding not yet implemented. Use property_set/property_delete instead."};case $n.GroundingType.WORKFLOW_TRANSITION:return await this.executeWorkflowTransition(e,t,r,i);case $n.GroundingType.BODY_TEMPLATE:return await this.executeBodyTemplate(e,t,r,i);default:return{success:!1,error:`Unknown grounding type: ${e.type}`}}}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}}async executePropertySet(e,t,r,i){if(!e.targetProperty)return{success:!1,error:"property_set requires targetProperty"};let s;if([e.targetValueRef!==void 0,e.targetValueLiteral!==void 0,e.targetValueSubstitution!==void 0,e.targetValueQuery!==void 0].filter(Boolean).length>1)return{success:!1,error:"property_set: more than one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery set (cardinality 0..1 each, mutually exclusive)"};if(e.targetValueRef!==void 0)s=`"[[${e.targetValueRef}]]"`;else if(e.targetValueLiteral!==void 0)s=e.targetValueLiteral;else if(e.targetValueSubstitution!==void 0)s=e.targetValueSubstitution;else if(e.targetValueQuery!==void 0){let d=await this.resolveTargetValueQuery(e.targetValueQuery,t);if(!d.success)return d;s=d.value}else return{success:!1,error:"property_set requires one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery"};if(/\$(input|value)\b/.test(s)&&(i===void 0||i.value===void 0||i.value===null))return{success:!1,error:"property_set: substituted value contains $input/$value placeholder but no userInput.value provided"};let l=this.substituteVariables(s,t,i),u=await this.fileReader.readFile(r),f=this.frontmatterService.updateProperty(u,e.targetProperty,l);return await this.fileWriter.updateFile(r,f),{success:!0}}async resolveTargetValueQuery(e,t){if(!this.namedQueryRunner)return{success:!1,error:"property_set targetValueQuery requires NamedQueryRunner injection (options.namedQueryRunner). Wire the plugin/CLI before using this value-source."};let r;try{r=await this.namedQueryRunner.runScalar(e,{currentAsset:t})}catch(s){return{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' failed \u2014 ${s instanceof Error?s.message:String(s)}`}}return r===null?{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' returned no scalar value (empty result set or non-scalar shape).`}:{success:!0,value:r.kind==="iri"?`"[[${r.value}]]"`:r.value}}async executePropertyDelete(e,t){if(!e.targetProperty)return{success:!1,error:"property_delete requires targetProperty"};let r=await this.fileReader.readFile(t),i=this.frontmatterService.removeProperty(r,e.targetProperty);return await this.fileWriter.updateFile(t,i),{success:!0}}async executeComposite(e,t,r,i,s){if(s>=tO)return{success:!1,error:`Composite grounding exceeded maximum depth of ${tO}`};let o=e.steps??[];if(o.length===0)return{success:!0};let c;try{c=await this.fileReader.readFile(r)}catch{}let l=[],u;try{for(let f=0;f<o.length;f++){let d=o[f],h=d.type===$n.GroundingType.BODY_TEMPLATE&&u?u:r,p=await this.executeStep(d,t,h,i,s+1);if(!p.success)return await this.rollback(c,r,l),{success:!1,error:`Composite step ${f} failed: ${p.error}`};p.openPath&&(u=p.openPath),l.push(f)}return{success:!0}}catch(f){return await this.rollback(c,r,l),{success:!1,error:`Composite execution failed: ${f instanceof Error?f.message:String(f)}`}}}async executeServiceCall(e,t,r,i){let s=e.targetProperty;if(!s)return{success:!1,error:"service_call requires targetProperty as serviceId"};if(s==="convertToTask")return await this.executeConvertToTask(r);if(s==="updateProperty"){let l=yB(e.targetValueRef);if(l==="ems__Task")return await this.executeConvertToTask(r);if(l==="ems__Project")return await this.executeConvertToProject(r)}let o=this.serviceRegistry.get(s);if(!o)return{success:!1,error:`Service not found: "${s}". Registered services: ${this.serviceRegistry.getRegisteredIds().join(", ")||"none"}`};let c=i;if(e.isDefinedBy&&(c={isDefinedBy:e.isDefinedBy,...c??{}}),e.serviceCallPayload)try{let l=this.substituteVariables(e.serviceCallPayload,t,i),u=JSON.parse(l);typeof u=="object"&&u!==null&&(c={...u,...c??{}})}catch{}return await o.execute(t,c),{success:!0}}async executeConvertToTask(e){let t=await this.fileReader.readFile(e),r=await this.resolveClassRefToUid("ems__Task"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${r}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeConvertToProject(e){let t=await this.fileReader.readFile(e),r=await this.resolveClassRefToUid("ems__Project"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${r}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeBodyTemplate(e,t,r,i){let s=null;if(e.templateRef)if(this.templateLoader){if(s=await this.templateLoader(e.templateRef),s===null)return{success:!1,error:`body_template: templateRef "${e.templateRef}" did not resolve to a template body (asset missing or empty).`}}else{if(e.bodyTemplate===void 0)return{success:!1,error:`body_template: templateRef "${e.templateRef}" set but no TemplateLoaderPort is wired (and no inline bodyTemplate fallback).`};s=e.bodyTemplate}else if(e.bodyTemplate!==void 0)s=e.bodyTemplate;else return{success:!1,error:"body_template requires bodyTemplate or templateRef"};let o=(0,dB.resolveTemplateBody)(s,{userInput:i,targetIRI:t,targetFilePath:r}),c;try{c=await this.fileReader.readFile(r)}catch(u){return{success:!1,error:`body_template: failed to read target file "${r}": ${u instanceof Error?u.message:String(u)}`}}let l=Un.replaceBody(c,o);return await this.fileWriter.updateFile(r,l),{success:!0}}static replaceBody(e,t){let r=e.match(/^---\r?\n[\s\S]*?\r?\n---/);return r?`${r[0]}
|
|
92
|
+
${t}`:t}async executeCreateInstance(e,t,r,i){if(!e.targetFolder)return{success:!1,error:"create_instance requires targetFolder"};let s={},o=null;if((e.inheritanceRule&&e.inheritanceRule.length>0||e.propertyDefault&&e.propertyDefault.some(b=>typeof b.value=="string"&&b.value.includes("__SUBSTITUTE"))||e.labelTemplate!==void 0&&/\$target\./.test(e.labelTemplate))&&t&&r){let b;try{b=await this.fileReader.readFile(r)}catch(S){return{success:!1,error:`create_instance: failed to read $target file "${r}": ${S instanceof Error?S.message:String(S)}`}}o=this.frontmatterService.parseObject(b)??null}let l;e.targetClass&&(l=await this.resolveClassRefToUid(e.targetClass));let u={userInput:i,targetIRI:t,targetFilePath:r,targetFm:o??void 0,groundingTargetClassUid:l};if(e.propertyDefault&&e.propertyDefault.length>0&&this.applyPropertyDefaultStep(s,e.propertyDefault,u),this.applyMissingScalarPrimitives(s,i,l,e,t,o,r),i)for(let[b,S]of Object.entries(i))b!=="label"&&b!=="body"&&S!=null&&(s[b]=S);if(e.inheritanceRule&&e.inheritanceRule.length>0&&o&&await this.applyInheritanceRuleStep(s,e.inheritanceRule,o),this.applyMissingBacklinkTopUp(s,e,t,r),t&&e.linkBackProperty&&s[e.linkBackProperty]===void 0){let b=Un.extractBacklinkTarget(t,r);s[e.linkBackProperty]=`"[[${b}]]"`}let f=s.exo__Asset_uid,d=this.frontmatterService.createFrontmatter("",s),h=e.targetFolder.includes("$isDefinedByFolder")?await this.resolveIsDefinedByFolder(s,r):this.substituteVariables(e.targetFolder,t,i,void 0,r),p=h?`${h}/${f}.md`:`${f}.md`,g=i?.body,y=typeof g=="string"&&g.length>0?Un.replaceBody(d,g):d;return await this.fileWriter.createFile(p,y),{success:!0,openPath:p}}async resolveIsDefinedByFolder(e,t){let r=Un.parentFolderOf(t),i=e.exo__Asset_isDefinedBy,s=Un.extractBareRef(i);if(s&&this.refToFolder)try{let o=await this.refToFolder(s);if(o!=null)return o}catch(o){hc.LoggingService.error(`[GroundingExecutor] $isDefinedByFolder resolution failed for ref "${s}" \u2014 falling back to host folder.`,o instanceof Error?o:new Error(String(o)))}return r}static parentFolderOf(e){let t=e.replace(/^\/+/,""),r=t.lastIndexOf("/");return r>=0?t.slice(0,r):""}static extractBareRef(e){if(typeof e!="string")return null;let t=e.trim();t=t.replace(/^["']|["']$/g,"").trim(),t=t.replace(/^\[\[/,"").replace(/\]\]$/,"");let r=t.indexOf("|");return r>=0&&(t=t.slice(0,r)),t=t.trim(),t.length>0?t:null}async resolveClassRefToUid(e){if(eO.test(e)||!this.classLabelToUid)return e;try{let t=await this.classLabelToUid(e);return t&&t.length>0?t:e}catch{return e}}applyPropertyDefaultStep(e,t,r){for(let{propertyName:i,value:s}of t){if(e[i]!==void 0)continue;let o=this.resolveSubstitutionMarker(s,r);if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;e[i]=o;continue}if(i==="exo__Instance_class"&&typeof o=="string"){e[i]=[o];continue}e[i]=o}}}applyMissingScalarPrimitives(e,t,r,i,s,o,c){let l=[];e.exo__Asset_uid===void 0&&(e.exo__Asset_uid=this.uidGen.next(),l.push("exo__Asset_uid")),e.exo__Asset_createdAt===void 0&&(e.exo__Asset_createdAt=d1.DateFormatter.toLocalTimestamp(this.clock.now()),l.push("exo__Asset_createdAt"));let u=typeof e.exo__Asset_label=="string"&&e.exo__Asset_label.trim().length===0;if(e.exo__Asset_label===void 0||u){let f=t?.label;if(f===void 0&&i?.labelTemplate)try{let h=this.substituteVariables(i.labelTemplate,s??"",t,o??void 0,c);h.trim().length>0&&(f=h)}catch(h){hc.LoggingService.error(`[GroundingExecutor] labelTemplate substitution failed: ${h instanceof Error?h.message:String(h)}. Falling back to "Untitled".`)}let d=f??"Untitled";e.exo__Asset_label=d,d!=="Untitled"&&e.aliases===void 0&&(e.aliases=[d]),l.push("exo__Asset_label")}e.exo__Instance_class===void 0&&r&&(e.exo__Instance_class=[`"[[${r}]]"`],l.push("exo__Instance_class")),l.length>0&&hc.LoggingService.error(`[GroundingExecutor] Universal Default Template did not cover essential scalar primitives: ${l.join(", ")}. Filled from legacy TS fallback. Vault may be in an unhealthy state \u2014 verify UniversalDefaultTemplate singleton is present and complete.`)}applyMissingBacklinkTopUp(e,t,r,i){if(!r||t.linkBackProperty||e.exo__Asset_prototype!==void 0||e.ems__Effort_parent!==void 0)return;let s=Un.extractBacklinkTarget(r,i);Un.propertiesReferenceTarget(e,s)||(e.exo__Asset_prototype=`"[[${s}]]"`,hc.LoggingService.error("[GroundingExecutor] No backlink rule fired (Universal IRs absent or no class match). Falling back to legacy exo__Asset_prototype default. Bug #5 may surface if target is not a prototype-instance."))}static propertiesReferenceTarget(e,t){if(!t)return!1;let r=`[[${t}]]`,i=a(s=>typeof s=="string"&&s.includes(r),"refs");for(let s of Object.values(e))if(i(s)||Array.isArray(s)&&s.some(i))return!0;return!1}resolveSubstitutionMarker(e,t){let r=e.match(_B);if(r){let c=r[1],l=r[2],u=Un.decodeBase64UrlSafe(l),f=(0,h1.getResolver)(c);return f?f(t,u):(hc.LoggingService.warn(`[GroundingExecutor] Parameterised marker references unknown resolver '${c}' \u2014 value left as marker.`),e)}let i=e.match(bB);if(!i)return e;let s=i[1];if(s==="target"){let c=t.targetIRI??"",l=t.targetFilePath??"";return`"[[${Un.extractBacklinkTarget(c,l)}]]"`}if(s==="targetFolder"){let c=t.targetFilePath??"";if(!c)return"";let l=c.replace(/^\/+/,""),u=l.lastIndexOf("/");return u>=0?l.slice(0,u):""}let o=(0,h1.getResolver)(s);return o?o(t):(hc.LoggingService.warn(`[GroundingExecutor] Marker references unknown resolver '${s}' \u2014 value left as marker.`),e)}static decodeBase64UrlSafe(e){return(0,hB.base64ToUtf8)(e.replace(/-/g,"+").replace(/_/g,"/"))}async applyInheritanceRuleStep(e,t,r){let i=this.extractTargetClassNames(r),s=[];for(let o of t)!await this.inheritanceConditionMatches(o.targetClassCondition,o.targetClassConditionUid,i)||await this.inheritanceExclusionMatches(o.targetClassExclusion,o.targetClassExclusionUids,i)||s.push(o);s.sort((o,c)=>c.priority-o.priority);for(let o of s){if(e[o.targetPropertyName]!==void 0)continue;let c=r[o.sourcePropertyName];c!=null&&(e[o.targetPropertyName]=this.formatInheritedValue(c))}}async inheritanceConditionMatches(e,t,r){return!e&&!t?!0:this.classRefMatchesAny(e,t,r)}async inheritanceExclusionMatches(e,t,r){for(let i of t??[])if(i&&r.includes(i))return!0;for(let i of e)if(await this.classRefMatchesAny(i,void 0,r))return!0;return!1}async classRefMatchesAny(e,t,r){if(t&&r.includes(t)||e&&r.includes(e))return!0;if(e&&this.classLabelToUid)try{let i=await this.classLabelToUid(e);if(i&&i.length>0&&r.includes(i))return!0}catch{}return!1}extractTargetClassNames(e){let t=e.exo__Instance_class;if(t==null)return[];let r=Array.isArray(t)?t:[t],i=[];for(let s of r){let o=this.extractWikilinkInner(String(s));o&&i.push(o)}return i}extractWikilinkInner(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/);return t?t[1].trim():e.replace(/^["']|["']$/g,"").trim()}formatInheritedValue(e){return Array.isArray(e)?e.map(t=>this.formatInheritedScalar(String(t))):this.formatInheritedScalar(String(e))}formatInheritedScalar(e){return/^"?\[\[.+\]\]"?$/.test(e)?this.reformatWikilink(e):eO.test(e)?`"[[${e}]]"`:e}reformatWikilink(e){return e.startsWith('"[[')&&e.endsWith(']]"')?e:e.startsWith("[[")&&e.endsWith("]]")?`"${e}"`:e}async executeStep(e,t,r,i,s){return e.type===$n.GroundingType.COMPOSITE?this.executeComposite(e,t,r,i,s):this.execute(e,t,r,i)}async rollback(e,t,r){if(e!==void 0)try{await this.fileWriter.updateFile(t,e)}catch(i){hc.LoggingService.error(`[GroundingExecutor] Rollback failed for ${t}`,i instanceof Error?i:new Error(String(i)))}}substituteVariables(e,t,r,i,s){let o=this.clock.now(),c=o.toISOString(),l=d1.DateFormatter.toLocalTimestamp(o),u=c.slice(0,10),f=`${u}T00:00:00`,d=`${l.slice(0,10)}-${l.slice(11,13)}-${l.slice(14,16)}`,h=e.replace(/\$target\.([A-Za-z_][\w]*)/g,(p,g)=>{if(!i)throw new Error(`$target.${g} substitution requires target frontmatter context; none was supplied (asset IRI: ${t})`);let y=i[g];if(y==null)throw new Error(`$target.${g} is undefined on asset ${t}`);if(Array.isArray(y))throw new Error(`$target.${g} resolved to an array on asset ${t}; only scalar properties are supported for substitution`);return String(y).replace(/^["'](.*)["']$/,"$1")});if(/\$targetFolder\b/.test(h)){if(!s)throw new Error("$targetFolder substitution requires targetFilePath context; none was supplied (asset IRI: "+t+")");let p=s.replace(/^\/+/,""),g=p.lastIndexOf("/"),y=g>=0?p.slice(0,g):"";h=h.replace(/\$targetFolder\b/g,y)}if(h=h.replace(/\$target/g,t).replace(/\$nowCompact\b/g,d).replace(/\$nowLocal/g,l).replace(/\$now/g,c).replace(/\$todayStart\b/g,f).replace(/\$today/g,u),r?.value!==void 0&&r.value!==null){let p=String(r.value);h=h.replace(/\$input\b/g,p).replace(/\$value\b/g,p)}return h}async executePropertyAppend(e,t,r,i){if(!e.targetProperty)return{success:!1,error:"property_append requires targetProperty"};if(e.appendExpression===void 0)return{success:!1,error:"property_append requires appendExpression"};let s=await this.fileReader.readFile(r),o=this.frontmatterService.parseObject(s)??{},c=this.substituteVariables(e.appendExpression,t,i,o),l=o[e.targetProperty],u=Array.isArray(l)?l:l!==void 0?[String(l)]:[],f=a(g=>g.replace(/^["'](.*)["']$/,"$1"),"stripQuotes"),d=new Set(u.map(f)),h;if(d.has(f(c)))h=u;else{let g=`"${f(c)}"`;h=[...u,g]}let p=this.frontmatterService.updateProperty(s,e.targetProperty,h);return await this.fileWriter.updateFile(r,p),{success:!0}}async executePropertyIncrement(e,t){if(!e.targetProperty)return{success:!1,error:"property_increment requires targetProperty"};let r=e.incrementBy??1;if(!Number.isFinite(r)||!Number.isInteger(r))return{success:!1,error:`property_increment: incrementBy must be an integer (got ${String(e.incrementBy)})`};let i=await this.fileReader.readFile(t),o=(this.frontmatterService.parseObject(i)??{})[e.targetProperty],c;if(o==null||o==="")c=0;else{if(Array.isArray(o))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" is an array, expected integer`};{let f=String(o).replace(/^["'](.*)["']$/,"$1").trim();if(!/^-?\d+$/.test(f))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" current value "${String(o)}" is not a valid integer`};c=Number.parseInt(f,10)}}let l=c+r,u=this.frontmatterService.updateProperty(i,e.targetProperty,l);return await this.fileWriter.updateFile(t,u),{success:!0}}async executePropertyShift(e,t){if(!e.targetProperty)return{success:!1,error:"property_shift requires targetProperty"};if(!e.shiftDelta)return{success:!1,error:"property_shift requires shiftDelta (ISO-8601 duration literal)"};let r=await this.fileReader.readFile(t),s=(this.frontmatterService.parseObject(r)??{})[e.targetProperty];if(s==null||s==="")return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is not set on target asset`};if(Array.isArray(s))return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is an array, expected single datetime`};let o=String(s).replace(/^["'](.*)["']$/,"$1").trim(),c=new Date(o);if(Number.isNaN(c.getTime()))return{success:!1,error:`property_shift: current value "${o}" is not a valid datetime`};let l;try{l=Un.applyIsoDuration(c,e.shiftDelta)}catch(d){return{success:!1,error:`property_shift: invalid shiftDelta "${e.shiftDelta}": ${d instanceof Error?d.message:String(d)}`}}let u=d1.DateFormatter.toLocalTimestamp(l),f=this.frontmatterService.updateProperty(r,e.targetProperty,u);return await this.fileWriter.updateFile(t,f),{success:!0}}async executeWorkflowTransition(e,t,r,i){if(!this.workflowResolver)return{success:!1,error:"workflow_transition requires WorkflowResolver injection (options.workflowResolver). Wire the plugin/CLI before using this grounding type."};let s=await this.fileReader.readFile(r),o=this.frontmatterService.parseObject(s)??{},c=this.resolveAssetClassFromFrontmatter(o);if(!c)return{success:!1,error:"workflow_transition: target asset has no recognised ems__* class in exo__Instance_class (cannot resolve workflow)."};let l=this.resolveStatusFromFrontmatter(o);if(!l)return{success:!1,error:"workflow_transition: target asset has no parseable ems__Effort_status value (need wikilink to an ems__EffortStatus* asset)."};let u;try{u=new pB.IRI(t)}catch(I){return{success:!1,error:`workflow_transition: invalid targetIRI "${t}" \u2014 ${I instanceof Error?I.message:String(I)}`}}let f=await this.workflowResolver.resolveForAsset(u,c),d=e.direction??"forward",h=d==="rollback",p=f.transitions.find(I=>I.from===l&&I.isRollback===h);if(!p)return{success:!1,error:`workflow_transition: no ${d} transition from "${l}" defined in workflow "${f.name}" (target class: ${c}).`};let g=Ir.STATUS_UID_BY_ENUM[p.to];if(!g)return{success:!1,error:`workflow_transition: no UID mapping for destination status "${p.to}" (transition target unreachable).`};let y={id:`${e.id}.statusMutation`,label:`workflow_transition: ${p.from} \u2192 ${p.to}`,type:$n.GroundingType.PROPERTY_SET,targetProperty:"ems__Effort_status",targetValueRef:g},b=await this.executePropertySet(y,t,r,i);if(!b.success)return{success:!1,error:`workflow_transition: status mutation failed \u2014 ${b.error}`};let S=p.postActions??[],v=this.groundingLoader;if(S.length>0&&v===void 0)return{success:!1,error:"workflow_transition: transition has postActions but no GroundingLoader injected (options.groundingLoader). Wire commandResolver.loadGroundingByUid in plugin/CLI."};for(let I of S){if(v===void 0)break;let A=await v(I);if(!A)return{success:!1,error:`workflow_transition: postAction grounding UID "${I}" could not be loaded (asset missing or invalid Grounding shape).`};let T=await this.execute(A,t,r,i);if(!T.success)return{success:!1,error:`workflow_transition: postAction "${A.label}" (UID ${I}) failed \u2014 ${T.error}`}}return{success:!0}}resolveAssetClassFromFrontmatter(e){let t=e.exo__Instance_class;if(t==null)return null;let r=Array.isArray(t)?t:[t],i=new Set(Object.values(rg.AssetClass));for(let s of r){if(typeof s!="string")continue;let o=s.replace(/^\s*"?\[\[/,"").replace(/\]\]"?\s*$/,""),l=(o.includes("|")?o.split("|")[1]:o).trim();if(i.has(l))return l;let u=o.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(u){let f=Ir.CLASS_UID_TO_LABEL[u[1].toLowerCase()];if(f&&i.has(f))return f}}return null}resolveStatusFromFrontmatter(e){let t=e.ems__Effort_status;if(t==null)return null;if(Array.isArray(t)){if(t.length!==1)return null;t=t[0]}let i=String(t).trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"");if(/^ems__EffortStatus[A-Za-z]+$/.test(i))return i;if(i.includes("|")){let o=i.split("|")[1].trim();if(/^ems__EffortStatus[A-Za-z]+$/.test(o))return o}let s=i.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(s){let o=gB[s[1].toLowerCase()];if(o)return o}return null}static applyIsoDuration(e,t){let r=t.trim();if(/^-?P(\d+Y)(\d+M)?$|^-?P\d+M$/.test(r)){let o=ZC.DateTimeParsing.parseYearMonthDuration(r),c=new Date(e.getTime());return c.setMonth(c.getMonth()+o),c}let s=ZC.DateTimeParsing.parseDayTimeDuration(r);return new Date(e.getTime()+s)}static extractBacklinkTarget(e,t){let r=Un.resolveTargetPath(e,t),i=r.split("/").pop()??r;return Un.UUID_BASENAME_RE.test(i)?i:r}static resolveTargetPath(e,t){if(t)return t.replace(/\.md$/i,"").replace(/^\/+/,"");if(e){let r=e.match(/^obsidian:\/\/vault\/(.+?)(?:\.md)?(?:\?|#|$)/i);if(r&&r[1])try{return decodeURIComponent(r[1])}catch{return r[1]}}return e}};Ir.GroundingExecutor=ig;ig.UUID_BASENAME_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ir.GroundingExecutor=ig=Un=aB([(0,lB.injectable)(),cB("design:paramtypes",[Object,Object,ng,Function,Object])],ig)});var nO=w(p1=>{"use strict";Object.defineProperty(p1,"__esModule",{value:!0});p1.createVaultFrontmatterClassLabelResolver=SB;function SB(n){return async e=>{if(!e)return null;let t=await n.findFilesByMetadata({exo__Asset_label:e});if(t.length>0){let s=(await n.getFileMetadata(t[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}let r=await n.findFilesByMetadata({aliases:e});if(r.length>0){let s=(await n.getFileMetadata(r[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}return null}}a(SB,"createVaultFrontmatterClassLabelResolver")});var iO=w(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});m1.createVaultFrontmatterRefToFolderResolver=wB;function wB(n){return async e=>{if(!e)return null;let t=await n.findFilesByMetadata({exo__Asset_uid:e});return t.length===0?null:vB(t[0])}}a(wB,"createVaultFrontmatterRefToFolderResolver");function vB(n){let e=n.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}a(vB,"parentFolderOf")});var oO=w(ho=>{"use strict";var EB=ho&&ho.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TB=ho&&ho.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},ql;Object.defineProperty(ho,"__esModule",{value:!0});ho.NamedQueryRunner=void 0;var AB=Be(),IB=Oe(),xB=Ge(),sO=qm(),RB=jp(),g1=ql=class{static{a(this,"NamedQueryRunner")}constructor(e,t){this.queryBodyResolver=e,this.tripleStore=t}async run(e,t={}){if(!e)return null;let r=await this.queryBodyResolver.resolveSparql(e);if(!r)return null;let i=this.substitute(r,t);return(0,sO.evaluateWithExoEval)(i,{store:this.tripleStore})}async runScalar(e,t={},r){if(!e)throw new Error("NamedQueryRunner.runScalar: empty queryUid");let i=await this.queryBodyResolver.resolveSparql(e);if(!i)throw new Error(`NamedQueryRunner: query__NamedQuery '${e}' has no resolvable SPARQL body (asset missing or no \`\`\`sparql block).`);let s=this.substitute(i,t),o=await(0,sO.evaluateWithExoEval)(s,{store:this.tripleStore});if(o.kind==="ask")return{value:o.result?"true":"false",kind:"literal"};if(o.kind==="construct")return null;let c=o.rows[0];if(!c)return null;let l=c.variables(),u=r??l[0];if(!u)return null;let f=c.get(u);return f===void 0?null:f instanceof IB.IRI?{value:(0,RB.iriToObsidianName)(f.value)??f.value,kind:"iri"}:f instanceof xB.Literal?{value:f.value,kind:"literal"}:null}substitute(e,t){let r=e;t.currentAsset&&(r=r.replace(/\$currentAsset\b/g,ql.formatIri(t.currentAsset))),t.currentClass&&(r=r.replace(/\$currentClass\b/g,ql.formatIri(t.currentClass)));let i=t.params;if(i){let s=Object.keys(i).sort((o,c)=>c.length-o.length);for(let o of s){let c=i[o],l=c.kind==="iri"?ql.formatIri(c.value):`"${ql.escapeLiteral(c.value)}"`,u=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(`\\$${u}\\b`,"g"),l)}}return r}static formatIri(e){if(/[\s<>"{}|\\^`]/.test(e))throw new Error(`NamedQueryRunner: refusing to inject malformed IRI "${e}" \u2014 contains a character illegal in a SPARQL IRIREF (would break out of <...>). Pass a percent-encoded IRI.`);return`<${e}>`}static escapeLiteral(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}};ho.NamedQueryRunner=g1;ho.NamedQueryRunner=g1=ql=EB([(0,AB.injectable)(),TB("design:paramtypes",[Object,Object])],g1)});var aO=w(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.extractSparqlBlock=CB;sg.stripFrontmatter=OB;function CB(n){let e=n.match(/```sparql\s*\n([\s\S]*?)\n```/);if(!e)return null;let t=e[1].trim();return t.length>0?t:null}a(CB,"extractSparqlBlock");function OB(n){if(!n.startsWith("---"))return n;let e=n.indexOf(`
|
|
93
93
|
---`,3);return e<0?n:n.slice(e+4)}a(OB,"stripFrontmatter")});var lO=w(po=>{"use strict";var PB=po&&po.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},FB=po&&po.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},Qf;Object.defineProperty(po,"__esModule",{value:!0});po.CommandExecutionFlow=void 0;var DB=Be(),cO=Ko(),LB=Oe(),NB=Ge(),kB=zt(),MB=jn(),og=Qf=class{static{a(this,"CommandExecutionFlow")}constructor(e,t,r,i,s,o,c){this.groundingExecutor=e,this.notificationService=t,this.logger=r,this.prompts=i,this.tripleStore=s,this.fileOpener=o,this.requiredPropertyResolver=c}async run(e,t){let{command:r}=e;if(r.confirmMessage&&!await this.prompts.confirm(r.confirmMessage))return;let i=t.injectedUserInput,s=Qf.extractInputSchema(e);if(s!==null&&s.length>0){let l=await this.applyLabelDatePrefill(s,r.grounding,t.targetIRI);l=await this.applyRequiredPropertyFields(l,r.grounding,t);let u=await this.prompts.promptInputSchema(l);if(u===null)return;i={...t.injectedUserInput??{},...u}}let o=await this.groundingExecutor.execute(r.grounding,t.targetIRI??"",t.filePath??"",i),c=t.filePath??"<no-file>";if(o.success){if(r.successMessage&&this.notificationService.success(r.successMessage),await new Promise(l=>setTimeout(l,100)),t.onComplete&&await t.onComplete(),o.openPath&&this.fileOpener)try{await this.fileOpener.open(o.openPath,{sameTab:r.openInSameTab})}catch(l){this.logger.info(`[CommandExecutionFlow] Failed to open created file "${o.openPath}": ${l instanceof Error?l.message:String(l)}`)}this.logger.info(`[CommandExecutionFlow] Executed "${r.name}" on ${c}`)}else this.notificationService.error(`Command failed: ${o.error??"unknown error"}`),this.logger.info(`[CommandExecutionFlow] Failed "${r.name}": ${o.error}`)}static extractInputSchema(e){let r=e.command.grounding.inputSchema;return!r||!Array.isArray(r)?null:r}async applyLabelDatePrefill(e,t,r){if(t.type!==cO.GroundingType.CREATE_INSTANCE||!t.prefillLabelWithDate||!r||!this.tripleStore)return e;let i=await this.resolveAssetLabel(r);if(!i)return e;let s=MB.DateFormatter.toDateString(new Date),o=`${i} ${s}`;return e.map(c=>{if(typeof c!="object"||c===null)return c;let l=c;if(l.name!=="label")return c;let u=l.defaultValue;return typeof u=="string"&&u.length>0?c:{...l,defaultValue:o}})}async applyRequiredPropertyFields(e,t,r){if(t.type!==cO.GroundingType.CREATE_INSTANCE||t.targetClass||!this.requiredPropertyResolver||!r.filePath)return e;let i=Qf.basenameUid(r.filePath);if(!i)return e;let s;try{s=await this.requiredPropertyResolver(i)}catch(l){return this.logger.info(`[CommandExecutionFlow] required-property resolution failed for "${i}": ${l instanceof Error?l.message:String(l)}`),e}if(s.length===0)return e;let o=new Set(Qf.ALWAYS_COVERED);for(let l of e)l&&typeof l=="object"&&typeof l.name=="string"&&o.add(l.name);let c=s.filter(l=>!o.has(l.propertyKey)).map(l=>{let u={name:l.propertyKey,type:l.fieldType,label:l.label,required:!0};return l.targetClassUid&&(u.targetClassUid=l.targetClassUid),l.fieldType==="boolean"&&(u.defaultValue="false"),u});return c.length===0?e:[...e,...c]}static basenameUid(e){let t=e.replace(/^\/+/,"").split("/").pop()?.replace(/\.md$/i,"");return t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)?t.toLowerCase():null}async resolveAssetLabel(e){if(!this.tripleStore)return;let t=new LB.IRI(e),r=await this.tripleStore.match(t,kB.Namespace.EXO.term("Asset_label"),void 0);if(r.length===0)return;let i=r[0].object;if(i instanceof NB.Literal)return i.value.length>0?i.value:void 0}};po.CommandExecutionFlow=og;og.ALWAYS_COVERED=["exo__Asset_uid","exo__Asset_createdAt","exo__Asset_updatedAt","exo__Asset_label","exo__Asset_createdBy","exo__Instance_class","exo__Asset_isDefinedBy"];po.CommandExecutionFlow=og=Qf=PB([(0,DB.injectable)(),FB("design:paramtypes",[Function,Object,Object,Object,Object,Object,Function])],og)});var dO=w(b1=>{"use strict";Object.defineProperty(b1,"__esModule",{value:!0});b1.createTripleStoreRequiredPropertyResolver=BB;var Yf=Oe(),y1=Ge(),uO=zt(),fO="http://www.w3.org/2001/XMLSchema#",jB=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i,$B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xf(n){let e=jB.exec(n);return e?e[1].toLowerCase():$B.test(n.trim())?n.trim().toLowerCase():null}a(Xf,"uidFrom");function UB(n){for(let e of n){let t=e.value;if(t.startsWith(fO)){let r=t.slice(fO.length).toLowerCase();return r==="date"||r==="datetime"?{fieldType:"date"}:r==="boolean"?{fieldType:"boolean"}:["integer","int","long","short","decimal","float","double","nonnegativeinteger","positiveinteger"].includes(r)?{fieldType:"number"}:{fieldType:"text"}}if(e.iri){let r=Xf(t);return r?{fieldType:"assetRef",targetClassUid:r}:{fieldType:"assetRef"}}}return{fieldType:"text"}}a(UB,"fieldTypeFromRange");function BB(n){let e=uO.Namespace.EXO,t=uO.Namespace.RDFS;return async r=>{let i=Xf(r)??r.trim().toLowerCase();if(!i)return[];let s=await n.match(void 0,e.term("Class_superClass"),void 0),o=new Map;for(let h of s){let p=h.subject instanceof Yf.IRI?Xf(h.subject.value):null,g=h.object instanceof Yf.IRI?Xf(h.object.value):null;if(!p||!g)continue;let y=o.get(p);y||(y=new Set,o.set(p,y)),y.add(g)}let c=new Set([i]),l=[i];for(;l.length>0;){let h=l.shift();if(h===void 0)break;for(let p of o.get(h)??[])c.has(p)||(c.add(p),l.push(p))}let u=await n.match(void 0,e.term("Property_minCount"),void 0),f=[],d=new Set;for(let h of u){if(!((h.object instanceof y1.Literal?parseInt(h.object.value,10):NaN)>0))continue;let g=h.subject;if(!(g instanceof Yf.IRI)||!(await n.match(g,e.term("Property_domain"),void 0)).map(R=>R.object instanceof Yf.IRI?Xf(R.object.value):null).filter(R=>R!==null).some(R=>c.has(R)))continue;let S=null;for(let R of[e.term("Asset_label"),t.term("label")]){let B=await n.match(g,R,void 0);for(let L of B)if(L.object instanceof y1.Literal&&L.object.value.trim().length>0){S=L.object.value.trim();break}if(S)break}if(!S||d.has(S))continue;d.add(S);let I=(await n.match(g,e.term("Property_range"),void 0)).map(R=>R.object instanceof Yf.IRI?{iri:!0,value:R.object.value}:R.object instanceof y1.Literal?{iri:!1,value:R.object.value}:null).filter(R=>R!==null),{fieldType:A,targetClassUid:T}=UB(I);f.push({propertyKey:S,label:S,fieldType:A,targetClassUid:T})}return f.sort((h,p)=>h.propertyKey.localeCompare(p.propertyKey)),f}}a(BB,"createTripleStoreRequiredPropertyResolver")});var Jf=w(mo=>{"use strict";var VB=mo&&mo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},qB=mo&&mo.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(mo,"__esModule",{value:!0});mo.WorkflowEngine=void 0;var GB=Be(),_1=class{static{a(this,"WorkflowEngine")}constructor(e){this.definition=e}getAvailableTransitions(e){return this.definition.transitions.filter(t=>t.from===e&&!t.isRollback)}getRollbackTransitions(e){return this.definition.transitions.filter(t=>t.from===e&&t.isRollback)}getAllTransitions(e){return this.definition.transitions.filter(t=>t.from===e)}canTransition(e,t){return this.definition.transitions.some(r=>r.from===e&&r.to===t)}getPreviousStatus(e){return this.definition.transitions.find(r=>r.from===e&&r.isRollback)?.to??null}getNextStates(e){return this.getAvailableTransitions(e).map(t=>t.to)}isTerminalState(e){return this.definition.terminalStates.includes(e)}isInitialState(e){return this.definition.initialState===e}getTimestampsForStatus(e){return this.definition.states.find(r=>r.status===e)?.timestampOnEnter??[]}getTransition(e,t){return this.definition.transitions.find(r=>r.from===e&&r.to===t)}getOrderedStates(){return this.definition.states.map(e=>e.status)}getDefinition(){return this.definition}validate(){let e=[],t=new Set(this.definition.states.map(i=>i.status));this.definition.states.length===0&&e.push("Workflow must have at least one state"),t.has(this.definition.initialState)||e.push(`Initial state "${this.definition.initialState}" is not in the states list`);for(let i of this.definition.terminalStates)t.has(i)||e.push(`Terminal state "${i}" is not in the states list`);for(let i of this.definition.transitions)t.has(i.from)||e.push(`Transition "${i.label}" references unknown source state "${i.from}"`),t.has(i.to)||e.push(`Transition "${i.label}" references unknown target state "${i.to}"`);for(let i of this.definition.states){if(this.definition.terminalStates.includes(i.status))continue;this.definition.transitions.filter(o=>o.from===i.status&&!o.isRollback).length===0&&e.push(`State "${i.status}" has no outgoing forward transitions (dead end)`)}let r=new Set;for(let i of this.definition.transitions){let s=`${i.from}\u2192${i.to}`;r.has(s)&&e.push(`Duplicate transition: ${s}`),r.add(s)}return{valid:e.length===0,errors:e}}};mo.WorkflowEngine=_1;mo.WorkflowEngine=_1=VB([(0,GB.injectable)(),qB("design:paramtypes",[Object])],_1)});var hO=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.EFFORT_WORKFLOW_PROPERTY=Ts.WorkflowTransitionProperty=Ts.WorkflowStateProperty=Ts.WorkflowProperty=void 0;Ts.WorkflowProperty={TARGET_CLASS:"ems__Workflow_targetClass",INITIAL_STATE:"ems__Workflow_initialState",TERMINAL_STATES:"ems__Workflow_terminalStates",IS_DEFAULT:"ems__Workflow_isDefault"};Ts.WorkflowStateProperty={WORKFLOW:"ems__WorkflowState_workflow",STATUS:"ems__WorkflowState_status",ORDER:"ems__WorkflowState_order",OPTIONAL:"ems__WorkflowState_optional",TIMESTAMP_ON_ENTER:"ems__WorkflowState_timestampOnEnter",BADGE_COLOR:"ems__WorkflowState_badgeColor"};Ts.WorkflowTransitionProperty={WORKFLOW:"ems__WorkflowTransition_workflow",FROM:"ems__WorkflowTransition_from",TO:"ems__WorkflowTransition_to",LABEL:"ems__WorkflowTransition_label",ICON:"ems__WorkflowTransition_icon",IS_ROLLBACK:"ems__WorkflowTransition_isRollback"};Ts.EFFORT_WORKFLOW_PROPERTY="ems__Effort_workflow"});var go=w(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.MetadataHelpers=void 0;var pO=Hf(),S1=class{static{a(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=(0,pO.orderProperties)(e,(0,pO.loadDefaultSpec)()),i=Object.entries(r).map(([c,l])=>{if(Array.isArray(l)){let u=l.map(f=>` - ${String(f)}`).join(`
|
|
94
94
|
`);return`${c}:
|
|
95
95
|
${u}`}return`${c}: ${String(l)}`}).join(`
|
|
@@ -217,10 +217,10 @@ PREFIX lit: <https://exocortex.my/ontology/lit#>
|
|
|
217
217
|
PREFIX inbox: <https://exocortex.my/ontology/inbox#>
|
|
218
218
|
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>`});var Nv=w(Zr=>{"use strict";var DG=Zr&&Zr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},LG=Zr&&Zr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},NG=Zr&&Zr.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.CriticalityZoneService=Zr.CriticalityZoneUUIDs=void 0;var o3=Be(),kG=Es(),MG=Bt();Zr.CriticalityZoneUUIDs={TODAY:"e266a2e9-9eb0-431d-b1fe-b95b9d3e9a3f",THIS_WEEK:"c7f1a968-0959-4ac7-ac82-31b0cdc2aba7",SOMEDAY:"6968a0fc-7a41-4393-82b1-17d767c7ad7c"};var Lv=class{static{a(this,"CriticalityZoneService")}constructor(e){this.vault=e,this.frontmatterService=new kG.FrontmatterService}async setZoneToday(e){await this.setZone(e,Zr.CriticalityZoneUUIDs.TODAY)}async setZoneThisWeek(e){await this.setZone(e,Zr.CriticalityZoneUUIDs.THIS_WEEK)}async setZoneSomeday(e){await this.setZone(e,Zr.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)}};Zr.CriticalityZoneService=Lv;Zr.CriticalityZoneService=Lv=DG([(0,o3.injectable)(),NG(0,(0,o3.inject)(MG.DI_TOKENS.IVaultAdapter)),LG("design:paramtypes",[Object])],Lv)});var a3=w(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.EffortSortingHelpers=void 0;var kv=class n{static{a(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",o=i==="00:00:00";return s&&!o?1:!s&&o?-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}};vg.EffortSortingHelpers=kv});var c3=w(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.FilenameValidator=void 0;var bc=class{static{a(this,"FilenameValidator")}static validate(e,t={}){let{maxLength:r=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT,allowEmpty:s=!1}=t,o=[];if(!e||e.trim().length===0)return s||o.push("Filename cannot be empty"),{valid:o.length===0,sanitized:"",errors:o};e.endsWith(" ")&&o.push("Filename should not end with a space");let c=e.trim();this.INVALID_CHARS_PATTERN.test(c)&&o.push('Filename contains invalid characters: / \\ : * ? " < > |');let l=this.getBaseName(c);this.RESERVED_NAMES.has(l.toUpperCase())&&o.push(`"${l}" is a reserved filename on Windows`),c.length>r&&o.push(`Filename exceeds maximum length of ${r} characters`),c.startsWith(".")&&o.push("Filename should not start with a dot"),c.endsWith(".")&&o.push("Filename should not end with a dot");let u=this.sanitize(e,{maxLength:r,replacementChar:i});return{valid:o.length===0,sanitized:u,errors:o}}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 o=this.getBaseName(s);if(this.RESERVED_NAMES.has(o.toUpperCase())){let c=this.getExtension(s);s=o+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)}};Eg.FilenameValidator=bc;bc.INVALID_CHARS_PATTERN=/[/\\:*?"<>|\x00-\x1F]/g;bc.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"]);bc.DEFAULT_MAX_LENGTH=200;bc.DEFAULT_REPLACEMENT="_"});var jv=w(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.NTriplesSerializer=void 0;var Mv=class{static{a(this,"NTriplesSerializer")}serialize(e,t={}){let r=t.newline??`
|
|
219
219
|
`;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}};Tg.NTriplesSerializer=Mv});var l3=w(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.TurtleSerializer=void 0;var Kl=zt(),jG=jv(),$G={rdf:Kl.Namespace.RDF.iri.value,rdfs:Kl.Namespace.RDFS.iri.value,owl:Kl.Namespace.OWL.iri.value,xsd:Kl.Namespace.XSD.iri.value,exo:Kl.Namespace.EXO.iri.value,ems:Kl.Namespace.EMS.iri.value},$v=class{static{a(this,"TurtleSerializer")}constructor(){this.nTriplesSerializer=new jG.NTriplesSerializer}serialize(e,t={}){let r=t.newline??`
|
|
220
|
-
`,i=this.composePrefixes(t),s=this.serializePrefixes(i,r),o=this.nTriplesSerializer.serialize(e,{newline:r}).trimEnd();return s?o?`${s}${r}${r}${o}${r}`:`${s}${r}`:o?`${o}${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?{...$G,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};Ag.TurtleSerializer=$v});var d3=w(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});Ig.JSONLDSerializer=void 0;var u3=Oe(),f3=jt(),UG=Ge(),Ql=zt(),BG={rdf:Ql.Namespace.RDF.iri.value,rdfs:Ql.Namespace.RDFS.iri.value,owl:Ql.Namespace.OWL.iri.value,xsd:Ql.Namespace.XSD.iri.value,exo:Ql.Namespace.EXO.iri.value,ems:Ql.Namespace.EMS.iri.value},Uv=class{static{a(this,"JSONLDSerializer")}toDocument(e,t={}){let r={...BG,...t.context??{}},i=new Map;for(let s of e){let o=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,r),l=this.objectToJSONLD(s.object,r),u=i.get(o)??{"@id":o},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(o,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 u3.IRI?e.value:e instanceof f3.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 u3.IRI)return{"@id":e.value};if(e instanceof f3.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof UG.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}};Ig.JSONLDSerializer=Uv});var qv=w(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.NTriplesParser=void 0;var VG=
|
|
221
|
-
`,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 \\${o} at line ${t}`)}continue}if(s==='"'){let o=e.slice(i+1);return{value:r,rest:o}}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 o=e[s];if(o===t){i++;continue}if(o===r&&(i--,i===0))return s}return-1}};xg.NTriplesParser=Vv});var p3=w(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.TurtleParser=void 0;var Xl=zt(),WG=qv(),HG={rdf:Xl.Namespace.RDF.iri.value,rdfs:Xl.Namespace.RDFS.iri.value,owl:Xl.Namespace.OWL.iri.value,xsd:Xl.Namespace.XSD.iri.value,exo:Xl.Namespace.EXO.iri.value,ems:Xl.Namespace.EMS.iri.value},zG=/^@prefix\s+([a-zA-Z_][\w-]*):\s*<([^>]+)>\s*\.$/,Gv=class{static{a(this,"TurtleParser")}constructor(){this.nTriplesParser=new WG.NTriplesParser}parse(e,t={}){let r={...HG,...t.prefixes??{}},i=this.collectStatements(e),s=[];return i.forEach(({statement:o,lineNumber:c})=>{if(this.isPrefixStatement(o)){let u=o.match(zG);if(!u)throw new Error(`Invalid prefix declaration at line ${c}`);let[,f,d]=u;r[f]=d;return}if(o.includes(";")||o.includes(","))throw new Error(`Complex Turtle statements with ';' or ',' are not supported (line ${c})`);let l=this.normalizeShortcuts(o);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((o,c)=>{let l=o.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}};Rg.TurtleParser=Gv});var m3=w(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.RDFSerializer=void 0;var Jl=
|
|
220
|
+
`,i=this.composePrefixes(t),s=this.serializePrefixes(i,r),o=this.nTriplesSerializer.serialize(e,{newline:r}).trimEnd();return s?o?`${s}${r}${r}${o}${r}`:`${s}${r}`:o?`${o}${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?{...$G,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};Ag.TurtleSerializer=$v});var d3=w(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});Ig.JSONLDSerializer=void 0;var u3=Oe(),f3=jt(),UG=Ge(),Ql=zt(),BG={rdf:Ql.Namespace.RDF.iri.value,rdfs:Ql.Namespace.RDFS.iri.value,owl:Ql.Namespace.OWL.iri.value,xsd:Ql.Namespace.XSD.iri.value,exo:Ql.Namespace.EXO.iri.value,ems:Ql.Namespace.EMS.iri.value},Uv=class{static{a(this,"JSONLDSerializer")}toDocument(e,t={}){let r={...BG,...t.context??{}},i=new Map;for(let s of e){let o=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,r),l=this.objectToJSONLD(s.object,r),u=i.get(o)??{"@id":o},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(o,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 u3.IRI?e.value:e instanceof f3.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 u3.IRI)return{"@id":e.value};if(e instanceof f3.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof UG.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}};Ig.JSONLDSerializer=Uv});var qv=w(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.NTriplesParser=void 0;var VG=Yn(),h3=Oe(),Bv=Ge(),qG=jt(),Yl=zt(),GG={rdf:Yl.Namespace.RDF.iri.value,rdfs:Yl.Namespace.RDFS.iri.value,owl:Yl.Namespace.OWL.iri.value,xsd:Yl.Namespace.XSD.iri.value,exo:Yl.Namespace.EXO.iri.value,ems:Yl.Namespace.EMS.iri.value},Vv=class{static{a(this,"NTriplesParser")}parse(e,t={}){let r={prefixes:{...GG,...t.prefixes??{}},strict:t.strict??!1},i=[];return e.split(/\r?\n/).forEach((o,c)=>{let l=o.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(),o=this.parseSubject(s,t,r);s=o.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 VG.Triple(o.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,o,c]=i,l=r.prefixes[s];if(!l)throw new Error(`Unknown prefix "${s}" at line ${t}`);return{node:new h3.IRI(`${l}${o}`),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),o=new h3.IRI(s),c=e.slice(i+1).trimStart();return{node:o,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 qG.BlankNode(i),rest:(s??"").trimStart()}}consumeLiteral(e,t,r){let{value:i,rest:s}=this.consumeQuotedString(e,t),o=s.trimStart();if(o.startsWith("^^")){o=o.slice(2).trimStart();let c=o.startsWith("<")?this.consumeIRI(o,t,r):this.consumePrefixedName(o,t,r);return{node:new Bv.Literal(i,c.node),rest:c.rest}}if(o.startsWith("@")){let c=o.match(/^@([a-zA-Z-]+)(?:\s+(.*))?$/);if(!c)throw new Error(`Invalid language tag at line ${t}`);let[,l,u]=c;return{node:new Bv.Literal(i,void 0,l),rest:(u??"").trimStart()}}return{node:new Bv.Literal(i),rest:o}}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 o=e[i+1];switch(o){case"t":r+=" ",i+=1;break;case"b":r+="\b",i+=1;break;case"n":r+=`
|
|
221
|
+
`,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 \\${o} at line ${t}`)}continue}if(s==='"'){let o=e.slice(i+1);return{value:r,rest:o}}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 o=e[s];if(o===t){i++;continue}if(o===r&&(i--,i===0))return s}return-1}};xg.NTriplesParser=Vv});var p3=w(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.TurtleParser=void 0;var Xl=zt(),WG=qv(),HG={rdf:Xl.Namespace.RDF.iri.value,rdfs:Xl.Namespace.RDFS.iri.value,owl:Xl.Namespace.OWL.iri.value,xsd:Xl.Namespace.XSD.iri.value,exo:Xl.Namespace.EXO.iri.value,ems:Xl.Namespace.EMS.iri.value},zG=/^@prefix\s+([a-zA-Z_][\w-]*):\s*<([^>]+)>\s*\.$/,Gv=class{static{a(this,"TurtleParser")}constructor(){this.nTriplesParser=new WG.NTriplesParser}parse(e,t={}){let r={...HG,...t.prefixes??{}},i=this.collectStatements(e),s=[];return i.forEach(({statement:o,lineNumber:c})=>{if(this.isPrefixStatement(o)){let u=o.match(zG);if(!u)throw new Error(`Invalid prefix declaration at line ${c}`);let[,f,d]=u;r[f]=d;return}if(o.includes(";")||o.includes(","))throw new Error(`Complex Turtle statements with ';' or ',' are not supported (line ${c})`);let l=this.normalizeShortcuts(o);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((o,c)=>{let l=o.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}};Rg.TurtleParser=Gv});var m3=w(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.RDFSerializer=void 0;var Jl=Yn(),_c=Oe(),Sc=Ge(),Wv=jt(),Rs=zt(),KG=l3(),QG=jv(),YG=d3(),XG=p3(),JG=qv(),ZG=1024,eW=`
|
|
222
222
|
`,tW={rdf:Rs.Namespace.RDF.iri.value,rdfs:Rs.Namespace.RDFS.iri.value,owl:Rs.Namespace.OWL.iri.value,xsd:Rs.Namespace.XSD.iri.value,exo:Rs.Namespace.EXO.iri.value,ems:Rs.Namespace.EMS.iri.value},Hv=class{static{a(this,"RDFSerializer")}constructor(e){this.store=e,this.turtleSerializer=new KG.TurtleSerializer,this.nTriplesSerializer=new QG.NTriplesSerializer,this.jsonldSerializer=new YG.JSONLDSerializer,this.turtleParser=new XG.TurtleParser,this.nTriplesParser=new JG.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??eW,i=t.batchSize??ZG,s=t.includeDefaultPrefixes,o=t.prefixes,c=this,l=!1,u=[],f=[],d=0,h=a(async()=>{if(!l){if(f=await c.store.match(),e==="json-ld"){let g=c.jsonldSerializer.toDocument(f,{context:o,pretty:!1});u.push(...c.buildJsonLdChunks(g))}else if(e==="turtle"){let g=c.turtleSerializer.serializePrefixes(c.composePrefixes(o,s),r);g&&u.push(`${g}${r}${r}`)}l=!0}},"ensureInitialized");return{async next(){if(await h(),u.length>0)return{value:u.shift(),done:!1};if(e==="json-ld")return{value:void 0,done:!0};if(d>=f.length)return{value:void 0,done:!0};let g=f.slice(d,d+i);d+=g.length;let y="";if(e==="turtle"){let b=c.turtleSerializer.serializeTriplesOnly(g,r);b&&(y=`${b}${r}`)}else e==="n-triples"&&(y=c.nTriplesSerializer.serializeChunk(g,r));return y?{value:y,done:!1}:this.next()},async return(){return u=[],f=[],d=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?{...tW,...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),o={...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 d=this.parseSubjectFromNode(u,o,f),h=Object.entries(u);for(let[p,g]of h){if(p==="@id"||p==="@context")continue;if(p==="@type"){this.collectTypeTriples(d,g,l,o);continue}let y=this.expandTerm(p,o),b=new _c.IRI(y);this.collectTriplesForValue(d,b,g,l,o)}}),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 Wv.BlankNode(i.slice(2));if(this.isAbsoluteIri(i))return new _c.IRI(i);let s=this.expandTerm(i,t);return new _c.IRI(s)}return new Wv.BlankNode(`jsonld_${r}`)}collectTypeTriples(e,t,r,i){let s=Rs.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 Jl.Triple(e,s,new _c.IRI(l)))})}collectTriplesForValue(e,t,r,i,s){if(r!=null){if(Array.isArray(r)){r.forEach(o=>this.collectTriplesForValue(e,t,o,i,s));return}if(typeof r=="object"){let o=r;if(typeof o["@id"]=="string"){let c=this.parseIdNode(o["@id"],s);i.push(new Jl.Triple(e,t,c));return}if(o["@value"]!==void 0){let c=this.parseLiteralObject(o,s);i.push(new Jl.Triple(e,t,c));return}}if(typeof r=="string"){i.push(new Jl.Triple(e,t,new Sc.Literal(r)));return}if(typeof r=="number"){let o=Number.isInteger(r)?Rs.Namespace.XSD.term("integer"):Rs.Namespace.XSD.term("decimal");i.push(new Jl.Triple(e,t,new Sc.Literal(r.toString(),o)));return}if(typeof r=="boolean"){let o=Rs.Namespace.XSD.term("boolean");i.push(new Jl.Triple(e,t,new Sc.Literal(r.toString(),o)));return}throw new Error("Unsupported JSON-LD value encountered")}}parseIdNode(e,t){if(e.startsWith("_:"))return new Wv.BlankNode(e.slice(2));if(this.isAbsoluteIri(e))return new _c.IRI(e);let r=this.expandTerm(e,t);return new _c.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 Sc.Literal(r,void 0,e["@language"],i):new Sc.Literal(r,void 0,e["@language"])}if(typeof e["@type"]=="string"){let i=this.expandTerm(e["@type"],t);return new Sc.Literal(r,new _c.IRI(i))}return new Sc.Literal(r)}expandTerm(e,t){if(this.isAbsoluteIri(e))return e;let r=e.indexOf(":");if(r>0){let s=e.slice(0,r),o=e.slice(r+1),c=t[s];if(!c)throw new Error(`Unknown prefix "${s}" in JSON-LD document`);return`${c}${o}`}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 o=JSON.stringify(i);s>0?t.push(`,${o}`):t.push(o)}),t.push(`]}
|
|
223
|
-
`),t}};Cg.RDFSerializer=Hv});var zv=w(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.OBSIDIAN_VAULT_SCHEME=void 0;Ro.vaultPathToIRI=rW;Ro.iriToVaultPath=nW;Ro.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function rW(n){let e=n.startsWith("./")?n.slice(2):n;return`${Ro.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}a(rW,"vaultPathToIRI");function nW(n){if(!n.startsWith(Ro.OBSIDIAN_VAULT_SCHEME))return null;let e=n.slice(Ro.OBSIDIAN_VAULT_SCHEME.length);try{return decodeURI(e)}catch{return null}}a(nW,"iriToVaultPath")});var Qv=w(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.RDFVocabularyMapper=void 0;var cr=Qn(),g3=Oe(),he=zt(),Kv=class{static{a(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",he.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",he.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",he.Namespace.RDFS.term("subClassOf")],["exo__Property_range",he.Namespace.RDFS.term("range")],["exo__Property_domain",he.Namespace.RDFS.term("domain")],["exo__Property_superProperty",he.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new cr.Triple(he.Namespace.EXO.term("Asset"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDFS.term("Resource"))),e.push(new cr.Triple(he.Namespace.EXO.term("Class"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDFS.term("Class"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDF.term("Property"))),e.push(new cr.Triple(he.Namespace.EMS.term("Task"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Project"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Area"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Workflow"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("WorkflowState"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("WorkflowTransition"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Command"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Precondition"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Grounding"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("CommandBinding"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new cr.Triple(he.Namespace.EXO.term("Instance_class"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDF.term("type"))),e.push(new cr.Triple(he.Namespace.EXO.term("Asset_isDefinedBy"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("isDefinedBy"))),e.push(new cr.Triple(he.Namespace.EXO.term("Class_superClass"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("subClassOf"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_range"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("range"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_domain"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("domain"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_superProperty"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof g3.IRI)s=r;else{let o=r.match(/^(ems|exo|exocmd)__(.+)$/);if(o){let[,c,l]=o;s=(c==="ems"?he.Namespace.EMS:c==="exocmd"?he.Namespace.EXOCMD:he.Namespace.EXO).term(l)}else s=new g3.IRI(r)}return new cr.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Og.RDFVocabularyMapper=Kv});var y3=w(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.RDFSInferenceEngine=void 0;var iW=Qn(),Pg=Oe(),Yv=class{static{a(this,"RDFSInferenceEngine")}async materialize(e){let t=await e.predicates(),r=t.find(d=>d.value.includes("Class_superClass")),i=t.find(d=>d.value.includes("Instance_class"));if(!r||!i)return 0;let s=await this.buildDirectParentMap(e,r);if(s.size===0)return 0;let o=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof Pg.IRI){let h=o.get(d.object.value);if(h)for(let p of h)u.push(new iW.Triple(d.subject,i,new Pg.IRI(p)))}return u.length>0&&await e.addAll(u),await e.count()-c}async buildDirectParentMap(e,t){let r=await e.match(void 0,t),i=new Map;for(let s of r)if(s.subject instanceof Pg.IRI&&s.object instanceof Pg.IRI){let o=s.subject.value,c=s.object.value;i.has(o)||i.set(o,new Set),i.get(o).add(c)}return i}computeAllAncestors(e){let t=new Map;for(let r of e.keys())t.has(r)||t.set(r,this.computeAncestorsBFS(r,e));return t}computeAncestorsBFS(e,t){let r=new Set,i=new Set,s=[],o=t.get(e);if(o)for(let c of o)s.push(c);for(;s.length>0;){let c=s.shift();if(i.has(c))continue;i.add(c),r.add(c);let l=t.get(c);if(l)for(let u of l)i.has(u)||s.push(u)}return r}};Fg.RDFSInferenceEngine=Yv});var Zv=w(wc=>{"use strict";var sW=wc&&wc.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(wc,"__esModule",{value:!0});wc.NonInheritablePropertyRegistry=void 0;var oW=Be(),b3=Oe(),_3=Ge(),Xv=zt(),Jv=class{static{a(this,"NonInheritablePropertyRegistry")}constructor(){this.nonInheritableIRIs=new Set,this.initialized=!1}async initialize(e){this.nonInheritableIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Instance_class"));if(!r){this.initialized=!0;return}let i=await this.findNonInheritableClassIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof _3.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.nonInheritableIRIs.add(d)}}}catch{}this.initialized=!0}isNonInheritable(e){return this.nonInheritableIRIs.has(e)}get size(){return this.nonInheritableIRIs.size}get isInitialized(){return this.initialized}async findNonInheritableClassIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new _3.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof b3.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof b3.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?Xv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?Xv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?Xv.Namespace.EXOCMD.term(e.substring(8)).value:null}};wc.NonInheritablePropertyRegistry=Jv;wc.NonInheritablePropertyRegistry=Jv=sW([(0,oW.injectable)()],Jv)});var rE=w(vc=>{"use strict";var aW=vc&&vc.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(vc,"__esModule",{value:!0});vc.PropertyCardinalityRegistry=void 0;var cW=Be(),S3=Oe(),w3=Ge(),eE=zt(),tE=class{static{a(this,"PropertyCardinalityRegistry")}constructor(){this.multiValuedIRIs=new Set,this.initialized=!1}async initialize(e){this.multiValuedIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Property_cardinality"));if(!r){this.initialized=!0;return}let i=await this.findMultipleCardinalityIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof w3.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.multiValuedIRIs.add(d)}}}catch{}this.initialized=!0}isMultiValued(e){return this.multiValuedIRIs.has(e)}get size(){return this.multiValuedIRIs.size}get isInitialized(){return this.initialized}async findMultipleCardinalityIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new w3.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof S3.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof S3.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?eE.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?eE.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?eE.Namespace.EXOCMD.term(e.substring(8)).value:null}};vc.PropertyCardinalityRegistry=tE;vc.PropertyCardinalityRegistry=tE=aW([(0,cW.injectable)()],tE)});var sE=w(xr=>{"use strict";var lW=xr&&xr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uW=xr&&xr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(xr,"__esModule",{value:!0});xr.PrototypeChainMaterializer=xr.MAX_PROTOTYPE_DEPTH=xr.INFERRED_GRAPH=void 0;xr.inferredGraphForDepth=nE;var fW=Be(),v3=Qn(),da=Oe(),dW=Zv(),hW=rE();xr.INFERRED_GRAPH=new da.IRI("https://exocortex.my/ontology/exo#inferred");var pW="https://exocortex.my/ontology/exo#inferred/";function nE(n){return new da.IRI(`${pW}${n}`)}a(nE,"inferredGraphForDepth");xr.MAX_PROTOTYPE_DEPTH=10;var iE=class{static{a(this,"PrototypeChainMaterializer")}constructor(e,t){this.registry=e,this.cardinalityRegistry=t??null}async materialize(e){let r=(await e.predicates()).find(c=>c.value.includes("Asset_prototype"));if(!r)return 0;let i=await e.match(void 0,r,void 0);if(i.length===0)return 0;let s=new Map;for(let c of i)if(c.subject instanceof da.IRI&&c.object instanceof da.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let o=0;for(let[c]of s){let l=new da.IRI(c),u=this.resolveChain(c,s);if(u.length===0)continue;let f=await e.match(l,void 0,void 0),d=new Set,h=new Map;for(let p of f)if(d.add(p.predicate.value),this.isMultiValued(p.predicate.value)){let g=p.object instanceof da.IRI?p.object.value:String(p.object),y=h.get(p.predicate.value);y||(y=new Set,h.set(p.predicate.value,y)),y.add(g)}for(let p=0;p<u.length;p++){let g=u[p],y=p+1,b=new da.IRI(g),S=await e.match(b,void 0,void 0),v=new Set;if(e.matchInGraph){let I=await e.matchInGraph(b,void 0,void 0,xr.INFERRED_GRAPH);for(let A of I)v.add(A.predicate.value)}for(let I of S){let A=I.predicate.value;if(this.registry.isNonInheritable(A)||v.has(A))continue;if(d.has(A)&&this.isMultiValued(A)){let R=I.object instanceof da.IRI?I.object.value:String(I.object);if(h.get(A)?.has(R))continue;let L=h.get(A);L||(L=new Set,h.set(A,L)),L.add(R);let P=new v3.Triple(l,I.predicate,I.object);await e.add(P),e.addToGraph&&(await e.addToGraph(P,xr.INFERRED_GRAPH),await e.addToGraph(P,nE(y))),o++;continue}if(d.has(A))continue;let T=new v3.Triple(l,I.predicate,I.object);await e.add(T),e.addToGraph&&(await e.addToGraph(T,xr.INFERRED_GRAPH),await e.addToGraph(T,nE(y))),d.add(A),o++}}}return o}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],o=t.get(e);for(o&&s.push(o.value);s.length>0&&r.length<xr.MAX_PROTOTYPE_DEPTH;){let c=s.shift();if(c===void 0)break;if(i.has(c))continue;i.add(c),r.push(c);let l=t.get(c);l&&!i.has(l.value)&&s.push(l.value)}return r}};xr.PrototypeChainMaterializer=iE;xr.PrototypeChainMaterializer=iE=lW([(0,fW.injectable)(),uW("design:paramtypes",[dW.NonInheritablePropertyRegistry,hW.PropertyCardinalityRegistry])],iE)});var T3=w(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.IRICanonicalizer=void 0;var E3=Oe(),mW=Ge(),gW=jt(),yW=Qn(),oE=/^obsidian:\/\/vault\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i,Dg=class n{static{a(this,"IRICanonicalizer")}static extractSynthAUid(e){let t=oE.exec(e);return t?t[1].toLowerCase():null}static canonicalize(e,t){if(t.size===0)return{triples:e,remapCount:0,uniqueRemapCount:0};let r=new Map,i=new Set,s=0;return{triples:e.map(c=>{let l=n.remapIfSynthA(c.subject,t,r,i),u=n.remapIfSynthA(c.object,t,r,i);return l===c.subject&&u===c.object?c:(s++,new yW.Triple(l,c.predicate,u))}),remapCount:s,uniqueRemapCount:i.size}}static remapIfSynthA(e,t,r,i){if(e instanceof mW.Literal||e instanceof gW.BlankNode||!(e instanceof E3.IRI))return e;let s=oE.exec(e.value);if(!s)return e;let o=s[1].toLowerCase(),c=t.get(o);if(!c||c===e.value)return e;i.add(o);let l=r.get(c);return l||(l=new E3.IRI(c),r.set(c,l)),l}};Lg.IRICanonicalizer=Dg;Dg.SYNTH_A_IRI_PATTERN=oE});var kg=w(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.derivePath=x3;Ng.deriveLegacyFlatPath=bW;var I3="assetspaces",A3=/^[A-Za-z0-9._-]+$/;function x3(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0||/^file:\/\//i.test(e))return null;e=e.replace(/\/+$/,""),e=e.replace(/\.git$/i,"");let t=null;if(!e.includes("://")){let o=/^[^/@\s]+@[^/:\s]+:(.+)$/.exec(e);o&&(t=o[1])}if(t===null){let o=e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"");o=o.replace(/^[^/@]+@/,"");let c=o.indexOf("/");if(c<0)return null;t=o.slice(c+1)}let r=t.split("/").filter(o=>o.length>0);if(r.length<2)return null;let i=r[0],s=r[1];return i==="."||i===".."||s==="."||s===".."||!A3.test(i)||!A3.test(s)?null:`${I3}/${i}/${s}`}a(x3,"derivePath");function bW(n){let e=x3(n);if(e===null)return null;let t=e.split("/")[2];if(t===void 0||t.length===0)return null;let r=t.startsWith("exoas-")?t.slice(6):t;return r.length===0?null:`${I3}/${r}`}a(bW,"deriveLegacyFlatPath")});var Mg=w(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.FILE_SPACE_CLASS_UID=void 0;Qi.frontmatterDeclaresFileSpace=SW;Qi.discoverFileSpaceExclusions=vW;var _W=kg();Qi.FILE_SPACE_CLASS_UID="aad8913e-5e9f-4047-879d-93cc46befd52";var R3=/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/g,aE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function O3(n){let e=Array.isArray(n)?n:[n],t=[];for(let r of e){if(typeof r!="string")continue;R3.lastIndex=0;let i;for(;(i=R3.exec(r))!==null;)t.push(i[1].trim())}return t}a(O3,"wikilinkTargets");function SW(n){return n?O3(n.exo__Instance_class).some(e=>aE.test(e)&&e.toLowerCase()===Qi.FILE_SPACE_CLASS_UID):!1}a(SW,"frontmatterDeclaresFileSpace");function C3(n,e){try{return n.getFrontmatter(e)}catch{return null}}a(C3,"readFrontmatterSafe");function wW(n){let e=n.exo__AssetSpace_source;if(typeof e=="string"&&e.length>0)return e;let t=n.exo__AssetSpace_git;return typeof t=="string"&&t.length>0?t:null}a(wW,"readSource");function vW(n){let e=[],t=[],r=[],i=new Map,s=a((c,l)=>{if(aE.test(c))return c.toLowerCase()===Qi.FILE_SPACE_CLASS_UID;let u=n.getFirstLinkpathDest(c,l);if(u==null)return!1;let f=i.get(u.path);if(f!==void 0)return f;let h=C3(n,u)?.exo__Asset_uid,p=typeof h=="string"&&h.toLowerCase()===Qi.FILE_SPACE_CLASS_UID;return i.set(u.path,p),p},"isFileSpaceClassRef"),o=a(c=>c.some(l=>aE.test(l)&&l.toLowerCase()===Qi.FILE_SPACE_CLASS_UID),"hasUuidFormRef");for(let c of n.getAllFiles()){let l=C3(n,c);if(!l)continue;let u=O3(l.exo__Instance_class);if(!u.some(p=>s(p,c.path)))continue;t.push(c.path),o(u)||r.push(`FileSpace declaration ${c.path} references the class via a label-form link only \u2014 the sync layer will not pick it up; use the UUID-form wikilink [[${Qi.FILE_SPACE_CLASS_UID}]] (UID-canon)`);let f=wW(l);if(f===null){r.push(`FileSpace declaration ${c.path} has no exo__AssetSpace_source/_git \u2014 mount path underivable, content NOT excluded from the index`);continue}let d=(0,_W.derivePath)(f);if(d===null){r.push(`FileSpace declaration ${c.path}: cannot derive mount path from source "${f}" \u2014 content NOT excluded from the index`);continue}let h=`${d}/`;c.path.startsWith(h)&&r.push(`FileSpace declaration ${c.path} lies INSIDE its own mount ${h} \u2014 it will be excluded from the index together with the content; move the declaration outside the mount folder`),e.push(h)}return{prefixes:e,declarationPaths:t,warnings:r}}a(vW,"discoverFileSpaceExclusions")});var P3=w(Zn=>{"use strict";var EW=Zn&&Zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TW=Zn&&Zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.LazyAssetGraphLoader=Zn.MAX_LAZY_DEPTH=void 0;var AW=Be(),IW=Oe(),cE=zt();Zn.MAX_LAZY_DEPTH=10;var lE=class{static{a(this,"LazyAssetGraphLoader")}constructor(e,t,r){this.converter=e,this.fileResolver=t,this.store=r,this.loadedIRIs=new Set,this.instanceClassPredicate=cE.Namespace.EXO.term("Instance_class"),this.superClassPredicate=cE.Namespace.EXO.term("Class_superClass"),this.prototypePredicate=cE.Namespace.EXO.term("Asset_prototype")}async ensureFileLoaded(e,t=0){if(t>=Zn.MAX_LAZY_DEPTH)return;let r=this.converter.notePathToIRI(e.path).value;if(!this.loadedIRIs.has(r)){this.loadedIRIs.add(r);try{let i=await this.converter.convertNote(e);if(!this.loadedIRIs.has(r)||(await this.store.addAll(i),!this.loadedIRIs.has(r)))return;await this.walkClassAndPrototypeRelations(i,t+1)}catch(i){throw this.loadedIRIs.delete(r),i}}}async ensureLoadedByIRI(e,t=0){if(t>=Zn.MAX_LAZY_DEPTH||this.loadedIRIs.has(e.value))return;let r=this.fileResolver.resolveByIRI(e);r!==null&&await this.ensureFileLoaded(r,t)}isLoaded(e){return this.loadedIRIs.has(e.value)}notePathToIRI(e){return this.converter.notePathToIRI(e)}forget(e){this.loadedIRIs.delete(e.value)}clearAll(){this.loadedIRIs.clear()}get loadedCount(){return this.loadedIRIs.size}clearForTests(){this.loadedIRIs.clear()}async walkClassAndPrototypeRelations(e,t){let r=[];for(let i of e){if(!(i.object instanceof IW.IRI))continue;let s=i.predicate.value;(s===this.instanceClassPredicate.value||s===this.superClassPredicate.value||s===this.prototypePredicate.value)&&r.push(i.object)}for(let i of r)await this.ensureLoadedByIRI(i,t)}};Zn.LazyAssetGraphLoader=lE;Zn.LazyAssetGraphLoader=lE=EW([(0,AW.injectable)(),TW("design:paramtypes",[Object,Object,Object])],lE)});var fE=w(_r=>{"use strict";var xW=_r&&_r.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},RW=_r&&_r.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(_r,"__esModule",{value:!0});_r.SourceAnnotator=_r.DEPTH_VARIABLE=_r.SOURCE_VARIABLE=void 0;var CW=Be(),Zl=Ge(),OW=Oe(),jg=sE();_r.SOURCE_VARIABLE="_source";_r.DEPTH_VARIABLE="_depth";var uE=class{static{a(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(o=>{let c=o.clone();return c.set(_r.SOURCE_VARIABLE,new Zl.Literal("own")),c});let s=[];for(let o of e){let c=o.get(t),l=o.get(r),u=o.get(i),f=o.clone();if(!c||!l||!u)f.set(_r.SOURCE_VARIABLE,new Zl.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(_r.SOURCE_VARIABLE,new Zl.Literal(d))}s.push(f)}return s}async annotateSingle(e,t,r,i){return(await this.annotate([e],t,r,i))[0]}async determineSource(e,t,r){return this.tripleStore.matchInGraph&&(await this.tripleStore.matchInGraph(e,t,r,jg.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=jg.MAX_PROTOTYPE_DEPTH;i++){let s=(0,jg.inferredGraphForDepth)(i);if((await this.tripleStore.matchInGraph(e,t,r,s)).length>0)return i}return 0}async annotateBySubject(e,t){if(!this.tripleStore.matchInGraph)return e.map(s=>{let o=s.clone();return o.set(_r.SOURCE_VARIABLE,new Zl.Literal("own")),o});let r=[],i=new Map;for(let s of e){let o=s.get(t),c=s.clone();if(!o||!(o instanceof OW.IRI))c.set(_r.SOURCE_VARIABLE,new Zl.Literal("own"));else{let l=o.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(o,void 0,void 0,jg.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(_r.SOURCE_VARIABLE,new Zl.Literal(u))}r.push(c)}return r}};_r.SourceAnnotator=uE;_r.SourceAnnotator=uE=xW([(0,CW.injectable)(),RW("design:paramtypes",[Object])],uE)});var mE=w(ei=>{"use strict";var PW=ei&&ei.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},FW=ei&&ei.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},F3=ei&&ei.__param||function(n,e){return function(t,r){e(t,r,n)}},pE;Object.defineProperty(ei,"__esModule",{value:!0});ei.NoteToRDFConverter=void 0;ei.normaliseExcludedFolders=k3;ei.isPathExcluded=M3;var dE=Be(),lr=Qn(),Yi=Oe(),bn=Ge(),D3=jt(),Kt=zt(),L3=Bt(),DW=Qv(),LW=sl(),hE=zv(),Un=Z_(),NW=Mg(),N3=new Set(["archived","draft","pinned","aliases"]);function k3(n){return Array.isArray(n)?n.map(e=>String(e).replace(/\\/g,"/").trim()).filter(e=>e.length>0).map(e=>e.endsWith("/")?e:`${e}/`):[]}a(k3,"normaliseExcludedFolders");function M3(n,e){if(e.length===0)return!1;let t=n.replace(/\\/g,"/");for(let r of e)if(t.startsWith(r))return!0;return!1}a(M3,"isPathExcluded");function kW(n){if(!n)return"";let e=n.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);for(;e.endsWith("/");)e=e.slice(0,-1);return e.length>0?`${e}/`:""}a(kW,"normaliseSubjectIriPrefix");var Ec=pE=class{static{a(this,"NoteToRDFConverter")}constructor(e,t=LW.NullLogger,r={}){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.pendingExtraTriples=[],this.vocabularyMapper=new DW.RDFVocabularyMapper,this.subjectIriPrefix=kW(r.subjectIriPrefix)}async convertNote(e){return this.convertNoteFromFrontmatter(e,this.vault.getFrontmatter(e))}async convertNoteFromFrontmatter(e,t){if(!t)return[];let r=this.notePathToIRI(e.path),i=Kt.Namespace.EXO.term("Asset_filename"),s=new lr.Triple(r,i,new bn.Literal(e.basename));if(Un.Exo003Parser.isExo003Format(t)){let o=await this.convertExo003Note(e,t);return[s,...o]}return this.convertLegacyNote(e,t,s)}async convertLegacyNote(e,t,r){this.pendingExtraTriples=[];let i=[r],s=this.notePathToIRI(e.path),o,c,l,u=!1,f=Kt.Namespace.EXO.term("Statement").value;for(let[y,b]of Object.entries(t)){let S=N3.has(y)?`exo__Asset_${y}`:y;if(!this.isExocortexProperty(S))continue;let v=this.propertyKeyToIRI(S),I=Array.isArray(b)?b:[b];for(let A of I)if(!((y==="exo__Asset_label"||N3.has(y))&&(A==null||typeof A=="string"&&A.trim()==="")))if(y==="exo__Instance_class"){let T=this.valueToClassURI(A);i.push(new lr.Triple(s,v,T))}else{let T=await this.valueToRDFObject(A,e,v);if(S==="exo__Statement_subject"&&o===void 0){let R=T.find(B=>B instanceof Yi.IRI);R&&(o=R)}else if(S==="exo__Statement_predicate"&&c===void 0){let R=T.find(B=>B instanceof Yi.IRI);R&&(c=R)}else S==="exo__Statement_object"&&l===void 0&&(l=T[0]);for(let R of T)if(i.push(new lr.Triple(s,v,R)),this.vocabularyMapper.hasMappingFor(y)&&R instanceof Yi.IRI){let B=this.vocabularyMapper.generateMappedTriple(s,y,R);B&&i.push(B)}}if(y==="exo__Instance_class")for(let A of I){let T=this.valueToClassURI(A);if(T instanceof Yi.IRI){let R=Kt.Namespace.RDF.term("type");i.push(new lr.Triple(s,R,T)),T.value===f&&(u=!0)}}if(y==="exo__Asset_label"){let A=Kt.Namespace.RDFS.term("label");for(let T of I)typeof T=="string"&&T.length>0&&i.push(new lr.Triple(s,A,new bn.Literal(T)))}}let d="exo__Instance_class"in t||"exo__Asset_uid"in t,h=t.exo__Asset_label,p="exo__Asset_label"in t&&h!==null&&h!==void 0&&!(typeof h=="string"&&h.trim()==="")&&!(Array.isArray(h)&&h.length===0);if(d&&!p){let y=Kt.Namespace.RDFS.term("label"),b=Kt.Namespace.EXO.term("Asset_label"),S=new bn.Literal(e.basename);i.push(new lr.Triple(s,y,S)),i.push(new lr.Triple(s,b,S))}i.push(...this.pendingExtraTriples),this.pendingExtraTriples=[],u&&o&&c&&l&&i.push(new lr.Triple(o,c,l));let g=await this.convertBodyWikilinks(e,s);return i.push(...g),i}async convertExo003Note(e,t){let r=Un.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Un.Exo003MetadataType.Namespace:break;case Un.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Un.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Un.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Un.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new Yi.IRI(t.uri);return[new lr.Triple(r,Kt.Namespace.OWL.term("sameAs"),i),new lr.Triple(i,Kt.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 lr.Triple(r,Kt.Namespace.OWL.term("sameAs"),new D3.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Un.Exo003Parser.toTriple(t,i);r.push(s);let o=this.notePathToIRI(e.path);r.push(new lr.Triple(o,Kt.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),o=this.createExo003ReferenceResolver(e),c=o(t.subject),l=o(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 Yi.IRI(c.value):new D3.BlankNode(c.value),f=new Yi.IRI(l.value),d=Un.Exo003Parser.toLiteral(t,s.trim());r.push(new lr.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new lr.Triple(h,Kt.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 o=this.vault.getFrontmatter(s);if(o&&Un.Exo003Parser.isExo003Format(o)){let c=Un.Exo003Parser.parse(o);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Un.Exo003MetadataType.Anchor||l.metadata===Un.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Un.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(e={}){return(await this.convertVaultWithValidation({strict:!1,excludedFolders:e.excludedFolders})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1,o=0,c=0,l=(0,NW.discoverFileSpaceExclusions)(this.vault);for(let y of l.warnings)this.logger.warn(`FileSpace discovery: ${y}`);let u=[...k3(e.excludedFolders),...l.prefixes],f=u.length===0?t:t.filter(y=>!M3(y.path,u)),d=e.onProgress,h=e.progressIntervalFiles&&e.progressIntervalFiles>0?e.progressIntervalFiles:pE.INDEX_PROGRESS_INTERVAL,p=f.length,g=0;for(let y of f){if(g++,d&&g%h===0&&g<p)try{d(g,p)}catch{}try{let b=this.vault.getFrontmatter(y),S=b?this.validateExocortexAsset(b,y.basename):null;if(S){if(s)throw new Error(`Invariant violation in "${y.path}": ${S.message}`);i.push({path:y.path,reason:`Invariant violation: ${S.message}`}),o++,this.logger.info(`Skipping file with invariant violation: ${y.path}`,{code:S.code,property:S.property,reason:S.message});continue}let v=await this.convertNote(y);r.push(...v)}catch(b){let S=b instanceof Error?b.message:String(b);if(s)throw new Error(`Invalid IRI for file "${y.path}": ${S}`);i.push({path:y.path,reason:`Invalid IRI: ${S}`}),c++,this.logger.info(`Skipping file with invalid IRI: ${y.path}`,{reason:S})}}return o>0&&this.logger.warn(`Skipped ${o} file${o===1?"":"s"} with invariant violations during indexing (paths in developer console)`,{count:o}),c>0&&this.logger.warn(`Skipped ${c} file${c===1?"":"s"} with invalid IRI during indexing (paths in developer console)`,{count:c}),{triples:r,skippedFiles:i,summary:{total:f.length,indexed:f.length-i.length,skipped:i.length},fileSpaces:l}}static inferLabelFromBasename(e){return Kt.Namespace.fromPropertyKey(e)!==null?e:null}validateExocortexAsset(e,t){let r=a(d=>d==null?!0:typeof d=="string"?d.trim()==="":Array.isArray(d)?d.length===0||d.every(r):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let s=["exo__Asset_uid","exo__Instance_class"];for(let d of s){if(!(d in e))return{code:"MISSING_PROPERTY",property:d,message:`Required property "${d}" is missing`};if(r(e[d]))return{code:"EMPTY_PROPERTY",property:d,message:`Required property "${d}" is empty`}}let o=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let d of o)if(d in e&&r(e[d]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:d,message:`Optional property "${d}" is present but empty`};let c=e.exo__Instance_class,l=Array.isArray(c)?c:[c],u=null,f=!1;for(let d of l){if(typeof d!="string")continue;let h=this.removeQuotes(d),g=(this.extractWikilink(h)??h).trim();/^[a-z][a-zA-Z0-9]*__/.test(g)&&/[\s()]/.test(g)?u||(u={candidate:d}):f=!0}return u&&!f?{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${u.candidate}"`}:null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,hE.vaultPathToIRI)(r.path);Yi.IRI.isValidIRI(i)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){return new Yi.IRI((0,hE.vaultPathToIRI)(`${this.subjectIriPrefix}${e}`))}synthesizeWikilinkTargetIRI(e){return new Yi.IRI((0,hE.vaultPathToIRI)(e))}isExocortexProperty(e){return Kt.Namespace.fromPropertyKey(e)!==null}propertyKeyToIRI(e){let t=Kt.Namespace.fromPropertyKey(e);if(!t)throw new Error(`Invalid property key: ${e}`);return t.namespace.term(t.localName)}emitTypeTripleForEnumInstance(e,t){let r=this.vault.getFrontmatter(t);if(!r)return;let i=r.exo__Instance_class,s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return;let o=this.valueToClassURI(s);o instanceof Yi.IRI&&(this.pendingExtraTriples.push(new lr.Triple(e,Kt.Namespace.RDF.term("type"),o)),this.pendingExtraTriples.push(new lr.Triple(e,Kt.Namespace.EXO.term("Instance_class"),o)))}async valueToRDFObject(e,t,r){if(typeof e=="string"){let i=this.removeQuotes(e),s=this.extractWikilink(i);if(s){let o=this.vault.getFirstLinkpathDest(s,t.path);if(o){let l=this.notePathToIRI(o.path),u=s.includes("|")?s.split("|")[0]:s;if(this.isUUID(u)){let d=new bn.Literal(u);if(r?.value.endsWith("#Grounding_targetValueRef")||r?.value.endsWith("#Grounding_targetValueSubstitution")||r?.value.endsWith("#Grounding_targetClass")||r?.value.endsWith("#Grounding_type")||r?.value.endsWith("#PropertyDefault_value"))return[l];let p=this.expandClassValue(o.basename);if(p)return this.emitTypeTripleForEnumInstance(p,o),[p];let g=this.vault.getFrontmatter(o);if(g){let I=g.exo__Asset_label;if(typeof I=="string"){let A=this.expandClassValue(I);if(A)return this.emitTypeTripleForEnumInstance(A,o),[A]}}let y=r?.value.endsWith("#Asset_prototype")||r?.value.endsWith("/Asset_prototype"),S=((typeof process<"u"?process.env:void 0)?.EXOCORTEX_DUAL_STORAGE_PREDICATES??"").split(",").map(I=>I.trim()).filter(Boolean),v=S.length>0&&S.some(I=>r?.value.endsWith(`#${I}`));return y||v?[l,d]:[l]}let f=this.expandClassValue(o.basename);return f?(this.emitTypeTripleForEnumInstance(f,o),[f]):[l]}if(this.isClassReference(s)){let l=this.expandClassValue(s);if(l)return[l]}let c=s.includes("|")?s.split("|")[0]:s;return this.isUUID(c)?[this.synthesizeWikilinkTargetIRI(`${c}.md`)]:[new bn.Literal(i)]}if(this.isClassReference(i)){let o=this.expandClassValue(i);if(o)return[o]}return this.isISO8601DateTime(i)?[new bn.Literal(i,Kt.Namespace.XSD.term("dateTime"))]:[new bn.Literal(i)]}return typeof e=="boolean"?[new bn.Literal(e.toString())]:typeof e=="number"?[new bn.Literal(e.toString(),Kt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new bn.Literal(e.toISOString(),Kt.Namespace.XSD.term("dateTime"))]:[new bn.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(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1];return r.includes("|")?r.split("|")[0]:r}extractWikilinkAlias(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1],i=r.indexOf("|");return i>=0?r.substring(i+1).trim():null}valueToClassURI(e){if(typeof e!="string")return new bn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let o=this.extractWikilinkAlias(t);if(o){let c=this.expandClassValue(o);if(c)return c}if(this.isUUID(i)){let c=this.vault.getFirstLinkpathDest(i,"");if(c){let l=this.expandClassValue(c.basename);if(l)return l;let u=this.vault.getFrontmatter(c);if(u){let f=u.exo__Asset_label;if(typeof f=="string"){let d=this.expandClassValue(f);if(d)return d}}return this.notePathToIRI(c.path)}}return new bn.Literal(t)}isClassReference(e){return/\s/.test(e)?!1:Kt.Namespace.fromPropertyKey(e)!==null}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),r=Kt.Namespace.fromPropertyKey(t);return!r||/[\s()]/.test(r.localName)?null:r.namespace.term(r.localName)}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),o=this.extractBodyWikilinks(s),c=Kt.Namespace.EXO.term("Asset_bodyLink");for(let l of o){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new lr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new lr.Triple(t,c,f)):r.push(new lr.Triple(t,c,new bn.Literal(l)))}else r.push(new lr.Triple(t,c,new bn.Literal(l)))}}catch{}return r}};ei.NoteToRDFConverter=Ec;Ec.INDEX_PROGRESS_INTERVAL=200;Ec.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};Ec.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};Ec.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};ei.NoteToRDFConverter=Ec=pE=PW([(0,dE.injectable)(),F3(0,(0,dE.inject)(L3.DI_TOKENS.IVaultAdapter)),F3(1,(0,dE.inject)(L3.DI_TOKENS.ILogger)),FW("design:paramtypes",[Object,Object,Object])],Ec)});var yE=w($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.FilterContainsOptimizer=void 0;var MW=Oe(),jW=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,gE=class{static{a(this,"FilterContainsOptimizer")}constructor(){this.tripleStore=null,this.lastOptimizationHints=[]}setTripleStore(e){this.tripleStore=e}getLastOptimizationHints(){return this.lastOptimizationHints}clearHints(){this.lastOptimizationHints=[]}async optimize(e){return this.clearHints(),this.optimizeRecursive(e)}optimizeSync(e,t){return this.clearHints(),this.optimizeSyncRecursive(e,t)}async optimizeRecursive(e){return e.type==="filter"?this.optimizeFilter(e):e.type==="join"?{type:"join",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="leftjoin"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="union"?{type:"union",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="minus"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="project"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="orderby"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="slice"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="distinct"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="reduced"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="group"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="extend"?{...e,input:await this.optimizeRecursive(e.input)}:e}optimizeSyncRecursive(e,t){return e.type==="filter"?this.optimizeFilterSync(e,t):e.type==="join"?{type:"join",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="leftjoin"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="union"?{type:"union",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="minus"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="project"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="orderby"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="slice"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="distinct"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="reduced"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="group"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="extend"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e}async optimizeFilter(e){let t=this.detectContainsUUIDPattern(e.expression);if(!t)return{type:"filter",expression:e.expression,input:await this.optimizeRecursive(e.input)};let r=[];return this.tripleStore&&(r=await this.findSubjectsContainingUUID(t.uuid)),this.rewriteFilter(e,t,r)}optimizeFilterSync(e,t){let r=this.detectContainsUUIDPattern(e.expression);if(!r)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input,t)};let i=t?t.filter(s=>s.includes(r.uuid)):[];return this.rewriteFilter(e,r,i)}rewriteFilter(e,t,r){if(this.lastOptimizationHints.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${t.variable}), "${t.uuid}"))`,suggestedRewrite:r.length===1?`VALUES ?${t.variable} { <${r[0]}> }`:r.length>1?`VALUES ?${t.variable} { ${r.map(i=>`<${i}>`).join(" ")} }`:"No matching URIs found for UUID",estimatedSpeedup:r.length>0?"O(n) \u2192 O(1)":"N/A",matchedUri:r.length===1?r[0]:void 0}),r.length===0)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input)};if(r.length===1){let i=this.injectSubjectConstraint(e.input,t.variable,r[0]);if(i!==e.input)return i}return this.createValuesJoin(e,t,r)}detectContainsUUIDPattern(e){if(e.type==="function"||e.type==="functionCall"){let t=e;if((typeof t.function=="string"?t.function.toLowerCase():t.function?.value?.toLowerCase()??"")==="contains"&&t.args.length===2)return this.analyzeContainsArgs(t.args[0],t.args[1],e)}if(e.type==="logical"&&e.operator==="&&")for(let t of e.operands){let r=this.detectContainsUUIDPattern(t);if(r)return r}return null}analyzeContainsArgs(e,t,r){let i=null;if(e.type==="function"||e.type==="functionCall"){let s=e;if((typeof s.function=="string"?s.function.toLowerCase():s.function?.value?.toLowerCase()??"")==="str"&&s.args.length===1){let c=s.args[0];c.type==="variable"&&(i=c.name)}}if(!i&&e.type==="variable"&&(i=e.name),!i)return null;if(t.type==="literal"){let c=String(t.value).match(jW);if(c)return{variable:i,uuid:c[0].toLowerCase(),originalExpression:r}}return null}async findSubjectsContainingUUID(e){if(!this.tripleStore)return[];if(this.tripleStore.findSubjectsByUUID)return(await this.tripleStore.findSubjectsByUUID(e)).map(s=>s.value);let t=await this.tripleStore.subjects(),r=[];for(let i of t)i instanceof MW.IRI&&i.value.toLowerCase().includes(e.toLowerCase())&&r.push(i.value);return r}injectSubjectConstraint(e,t,r){if(e.type==="bgp"){let i=e.triples.map(o=>o.subject.type==="variable"&&o.subject.value===t?{...o,subject:{type:"iri",value:r}}:o);if(i.some((o,c)=>o.subject!==e.triples[c].subject))return{type:"bgp",triples:i}}if(e.type==="join"){let i=this.injectSubjectConstraint(e.left,t,r),s=this.injectSubjectConstraint(e.right,t,r);if(i!==e.left||s!==e.right)return{type:"join",left:i,right:s}}if(e.type==="filter"){let i=this.injectSubjectConstraint(e.input,t,r);if(i!==e.input)return{...e,input:i}}return e}createValuesJoin(e,t,r){return{type:"join",left:{type:"values",variables:[t.variable],bindings:r.map(o=>({[t.variable]:{type:"iri",value:o}}))},right:this.optimizeSyncRecursive(e.input)}}analyzeQuery(e){let t=[];return this.analyzeRecursive(e,t),t}analyzeRecursive(e,t){if(e.type==="filter"){let r=this.detectContainsUUIDPattern(e.expression);r&&t.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${r.variable}), "${r.uuid}"))`,suggestedRewrite:`Use --optimize flag or rewrite as VALUES ?${r.variable} { <uri-containing-uuid> }`,estimatedSpeedup:"O(n) \u2192 O(1) with UUID index lookup"}),this.analyzeRecursive(e.input,t);return}e.type==="join"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="leftjoin"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="union"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="minus"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="project"?this.analyzeRecursive(e.input,t):e.type==="orderby"?this.analyzeRecursive(e.input,t):e.type==="slice"?this.analyzeRecursive(e.input,t):e.type==="distinct"?this.analyzeRecursive(e.input,t):e.type==="reduced"?this.analyzeRecursive(e.input,t):e.type==="group"?this.analyzeRecursive(e.input,t):e.type==="extend"&&this.analyzeRecursive(e.input,t)}};$g.FilterContainsOptimizer=gE});var j3=w(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.AlgebraOptimizer=void 0;var $W=yE(),bE=class{static{a(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new $W.FilterContainsOptimizer}setTripleStore(e){this.tripleStore=e,this.filterContainsOptimizer.setTripleStore(e)}getOptimizationHints(){return this.filterContainsOptimizer.getLastOptimizationHints()}analyzeQuery(e){return this.filterContainsOptimizer.analyzeQuery(e)}optimize(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),t=this.filterPushDown(t),t=this.joinReordering(t),t}async optimizeAsync(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),this.tripleStore&&(t=await this.filterContainsOptimizer.optimize(t)),t=this.filterPushDown(t),t=this.joinReordering(t),t}optimizeWithSubjects(e,t){let r=e;return r=this.eliminateEmptyBGPInFilterJoin(r),r=this.filterContainsOptimizer.optimizeSync(r,t),r=this.filterPushDown(r),r=this.joinReordering(r),r}eliminateEmptyBGPInFilterJoin(e){if(e.type==="join"){if(e.left.type==="filter"){let t=e.left;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.right)}}if(e.right.type==="filter"){let t=e.right;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.left)}}return{type:"join",left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}}return e.type==="filter"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="leftjoin"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="union"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="minus"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="project"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="orderby"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="slice"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="distinct"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e}filterPushDown(e){return e.type==="filter"?this.pushDownFilter(e):e.type==="join"?{type:"join",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="leftjoin"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="union"?{type:"union",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="minus"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="project"?{...e,input:this.filterPushDown(e.input)}:e.type==="orderby"?{...e,input:this.filterPushDown(e.input)}:e.type==="slice"?{...e,input:this.filterPushDown(e.input)}:e.type==="distinct"?{...e,input:this.filterPushDown(e.input)}:e}pushDownFilter(e){let t=e.input;if(t.type==="join"){let r=this.getFilterVariables(e.expression),i=this.getOperationVariables(t.left),s=this.getOperationVariables(t.right),o=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return o&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!o?{type:"join",left:this.filterPushDown(t.left),right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:{type:"join",left:this.filterPushDown(t.left),right:this.filterPushDown(t.right)}}}return t.type==="union"?{type:"union",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:this.filterPushDown(t)}}getFilterVariables(e){let t=[];if(e.type==="variable")t.push(e.name);else if(e.type==="comparison")t.push(...this.getFilterVariables(e.left)),t.push(...this.getFilterVariables(e.right));else if(e.type==="logical")for(let r of e.operands)t.push(...this.getFilterVariables(r));else if(e.type==="function")for(let r of e.args)t.push(...this.getFilterVariables(r));return Array.from(new Set(t))}getOperationVariables(e){let t=new Set;if(e.type==="bgp")for(let r of e.triples)r.subject.type==="variable"&&t.add(r.subject.value),r.predicate.type==="variable"&&t.add(r.predicate.value),r.object.type==="variable"&&t.add(r.object.value);else if(e.type==="join"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="filter")return this.getOperationVariables(e.input);if(e.type==="leftjoin"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else if(e.type==="union"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="minus")return this.getOperationVariables(e.left);if(e.type==="project")return new Set(e.variables)}}return t}joinReordering(e){return e.type==="join"?this.reorderJoin(e):e.type==="filter"?{...e,input:this.joinReordering(e.input)}:e.type==="leftjoin"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="union"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="minus"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="project"?{...e,input:this.joinReordering(e.input)}:e.type==="orderby"?{...e,input:this.joinReordering(e.input)}:e.type==="slice"?{...e,input:this.joinReordering(e.input)}:e.type==="distinct"?{...e,input:this.joinReordering(e.input)}:e}reorderJoin(e){let t=this.isConstrained(e.left),r=this.isConstrained(e.right);if(r&&!t)return{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)};if(t&&!r)return{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)};let i=this.estimateCost(e.left);return this.estimateCost(e.right)<i?{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)}:{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)}}isConstrained(e){return e.type==="values"?!0:e.type==="bgp"?e.triples.some(t=>t.object.type!=="variable"||t.subject.type!=="variable"):e.type==="filter"?this.isConstrained(e.input):e.type==="join"?this.isConstrained(e.left)||this.isConstrained(e.right):e.type==="union"?this.isConstrained(e.left)&&this.isConstrained(e.right):!1}estimateCost(e){if(e.type==="bgp"){let t=0;for(let r of e.triples){let i=10;r.subject.type==="variable"&&(i*=10),r.predicate.type==="variable"&&(i*=20),r.object.type==="variable"&&(i*=5),t+=i}return t}if(e.type==="filter")return this.estimateCost(e.input)*.3;if(e.type==="join"){let t=this.estimateCost(e.left),r=this.estimateCost(e.right);return e.left.type==="values"||e.right.type==="values"?Math.min(t,r)*2:t*r}if(e.type==="leftjoin")return this.estimateCost(e.left)+this.estimateCost(e.right)*.5;if(e.type==="union")return this.estimateCost(e.left)+this.estimateCost(e.right);if(e.type==="values"){let t=e.bindings;return Array.isArray(t)?t.length*5:10}return e.type==="minus"?this.estimateCost(e.left)+this.estimateCost(e.right)*.3:100}setStatistics(e,t){this.stats.set(e,t)}getStatistics(e){return this.stats.get(e)}};Ug.AlgebraOptimizer=bE});var $3=w(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.AlgebraSerializer=void 0;var _E=class{static{a(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
|
|
223
|
+
`),t}};Cg.RDFSerializer=Hv});var zv=w(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.OBSIDIAN_VAULT_SCHEME=void 0;Ro.vaultPathToIRI=rW;Ro.iriToVaultPath=nW;Ro.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function rW(n){let e=n.startsWith("./")?n.slice(2):n;return`${Ro.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}a(rW,"vaultPathToIRI");function nW(n){if(!n.startsWith(Ro.OBSIDIAN_VAULT_SCHEME))return null;let e=n.slice(Ro.OBSIDIAN_VAULT_SCHEME.length);try{return decodeURI(e)}catch{return null}}a(nW,"iriToVaultPath")});var Qv=w(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.RDFVocabularyMapper=void 0;var cr=Yn(),g3=Oe(),he=zt(),Kv=class{static{a(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",he.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",he.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",he.Namespace.RDFS.term("subClassOf")],["exo__Property_range",he.Namespace.RDFS.term("range")],["exo__Property_domain",he.Namespace.RDFS.term("domain")],["exo__Property_superProperty",he.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new cr.Triple(he.Namespace.EXO.term("Asset"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDFS.term("Resource"))),e.push(new cr.Triple(he.Namespace.EXO.term("Class"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDFS.term("Class"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.RDF.term("Property"))),e.push(new cr.Triple(he.Namespace.EMS.term("Task"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Project"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Area"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("Workflow"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("WorkflowState"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EMS.term("WorkflowTransition"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Command"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Precondition"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("Grounding"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e.push(new cr.Triple(he.Namespace.EXOCMD.term("CommandBinding"),he.Namespace.RDFS.term("subClassOf"),he.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new cr.Triple(he.Namespace.EXO.term("Instance_class"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDF.term("type"))),e.push(new cr.Triple(he.Namespace.EXO.term("Asset_isDefinedBy"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("isDefinedBy"))),e.push(new cr.Triple(he.Namespace.EXO.term("Class_superClass"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("subClassOf"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_range"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("range"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_domain"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("domain"))),e.push(new cr.Triple(he.Namespace.EXO.term("Property_superProperty"),he.Namespace.RDFS.term("subPropertyOf"),he.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof g3.IRI)s=r;else{let o=r.match(/^(ems|exo|exocmd)__(.+)$/);if(o){let[,c,l]=o;s=(c==="ems"?he.Namespace.EMS:c==="exocmd"?he.Namespace.EXOCMD:he.Namespace.EXO).term(l)}else s=new g3.IRI(r)}return new cr.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Og.RDFVocabularyMapper=Kv});var y3=w(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.RDFSInferenceEngine=void 0;var iW=Yn(),Pg=Oe(),Yv=class{static{a(this,"RDFSInferenceEngine")}async materialize(e){let t=await e.predicates(),r=t.find(d=>d.value.includes("Class_superClass")),i=t.find(d=>d.value.includes("Instance_class"));if(!r||!i)return 0;let s=await this.buildDirectParentMap(e,r);if(s.size===0)return 0;let o=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof Pg.IRI){let h=o.get(d.object.value);if(h)for(let p of h)u.push(new iW.Triple(d.subject,i,new Pg.IRI(p)))}return u.length>0&&await e.addAll(u),await e.count()-c}async buildDirectParentMap(e,t){let r=await e.match(void 0,t),i=new Map;for(let s of r)if(s.subject instanceof Pg.IRI&&s.object instanceof Pg.IRI){let o=s.subject.value,c=s.object.value;i.has(o)||i.set(o,new Set),i.get(o).add(c)}return i}computeAllAncestors(e){let t=new Map;for(let r of e.keys())t.has(r)||t.set(r,this.computeAncestorsBFS(r,e));return t}computeAncestorsBFS(e,t){let r=new Set,i=new Set,s=[],o=t.get(e);if(o)for(let c of o)s.push(c);for(;s.length>0;){let c=s.shift();if(i.has(c))continue;i.add(c),r.add(c);let l=t.get(c);if(l)for(let u of l)i.has(u)||s.push(u)}return r}};Fg.RDFSInferenceEngine=Yv});var Zv=w(wc=>{"use strict";var sW=wc&&wc.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(wc,"__esModule",{value:!0});wc.NonInheritablePropertyRegistry=void 0;var oW=Be(),b3=Oe(),_3=Ge(),Xv=zt(),Jv=class{static{a(this,"NonInheritablePropertyRegistry")}constructor(){this.nonInheritableIRIs=new Set,this.initialized=!1}async initialize(e){this.nonInheritableIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Instance_class"));if(!r){this.initialized=!0;return}let i=await this.findNonInheritableClassIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof _3.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.nonInheritableIRIs.add(d)}}}catch{}this.initialized=!0}isNonInheritable(e){return this.nonInheritableIRIs.has(e)}get size(){return this.nonInheritableIRIs.size}get isInitialized(){return this.initialized}async findNonInheritableClassIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new _3.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof b3.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof b3.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?Xv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?Xv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?Xv.Namespace.EXOCMD.term(e.substring(8)).value:null}};wc.NonInheritablePropertyRegistry=Jv;wc.NonInheritablePropertyRegistry=Jv=sW([(0,oW.injectable)()],Jv)});var rE=w(vc=>{"use strict";var aW=vc&&vc.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(vc,"__esModule",{value:!0});vc.PropertyCardinalityRegistry=void 0;var cW=Be(),S3=Oe(),w3=Ge(),eE=zt(),tE=class{static{a(this,"PropertyCardinalityRegistry")}constructor(){this.multiValuedIRIs=new Set,this.initialized=!1}async initialize(e){this.multiValuedIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Property_cardinality"));if(!r){this.initialized=!0;return}let i=await this.findMultipleCardinalityIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof w3.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.multiValuedIRIs.add(d)}}}catch{}this.initialized=!0}isMultiValued(e){return this.multiValuedIRIs.has(e)}get size(){return this.multiValuedIRIs.size}get isInitialized(){return this.initialized}async findMultipleCardinalityIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new w3.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof S3.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof S3.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?eE.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?eE.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?eE.Namespace.EXOCMD.term(e.substring(8)).value:null}};vc.PropertyCardinalityRegistry=tE;vc.PropertyCardinalityRegistry=tE=aW([(0,cW.injectable)()],tE)});var sE=w(xr=>{"use strict";var lW=xr&&xr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uW=xr&&xr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(xr,"__esModule",{value:!0});xr.PrototypeChainMaterializer=xr.MAX_PROTOTYPE_DEPTH=xr.INFERRED_GRAPH=void 0;xr.inferredGraphForDepth=nE;var fW=Be(),v3=Yn(),da=Oe(),dW=Zv(),hW=rE();xr.INFERRED_GRAPH=new da.IRI("https://exocortex.my/ontology/exo#inferred");var pW="https://exocortex.my/ontology/exo#inferred/";function nE(n){return new da.IRI(`${pW}${n}`)}a(nE,"inferredGraphForDepth");xr.MAX_PROTOTYPE_DEPTH=10;var iE=class{static{a(this,"PrototypeChainMaterializer")}constructor(e,t){this.registry=e,this.cardinalityRegistry=t??null}async materialize(e){let r=(await e.predicates()).find(c=>c.value.includes("Asset_prototype"));if(!r)return 0;let i=await e.match(void 0,r,void 0);if(i.length===0)return 0;let s=new Map;for(let c of i)if(c.subject instanceof da.IRI&&c.object instanceof da.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let o=0;for(let[c]of s){let l=new da.IRI(c),u=this.resolveChain(c,s);if(u.length===0)continue;let f=await e.match(l,void 0,void 0),d=new Set,h=new Map;for(let p of f)if(d.add(p.predicate.value),this.isMultiValued(p.predicate.value)){let g=p.object instanceof da.IRI?p.object.value:String(p.object),y=h.get(p.predicate.value);y||(y=new Set,h.set(p.predicate.value,y)),y.add(g)}for(let p=0;p<u.length;p++){let g=u[p],y=p+1,b=new da.IRI(g),S=await e.match(b,void 0,void 0),v=new Set;if(e.matchInGraph){let I=await e.matchInGraph(b,void 0,void 0,xr.INFERRED_GRAPH);for(let A of I)v.add(A.predicate.value)}for(let I of S){let A=I.predicate.value;if(this.registry.isNonInheritable(A)||v.has(A))continue;if(d.has(A)&&this.isMultiValued(A)){let R=I.object instanceof da.IRI?I.object.value:String(I.object);if(h.get(A)?.has(R))continue;let L=h.get(A);L||(L=new Set,h.set(A,L)),L.add(R);let P=new v3.Triple(l,I.predicate,I.object);await e.add(P),e.addToGraph&&(await e.addToGraph(P,xr.INFERRED_GRAPH),await e.addToGraph(P,nE(y))),o++;continue}if(d.has(A))continue;let T=new v3.Triple(l,I.predicate,I.object);await e.add(T),e.addToGraph&&(await e.addToGraph(T,xr.INFERRED_GRAPH),await e.addToGraph(T,nE(y))),d.add(A),o++}}}return o}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],o=t.get(e);for(o&&s.push(o.value);s.length>0&&r.length<xr.MAX_PROTOTYPE_DEPTH;){let c=s.shift();if(c===void 0)break;if(i.has(c))continue;i.add(c),r.push(c);let l=t.get(c);l&&!i.has(l.value)&&s.push(l.value)}return r}};xr.PrototypeChainMaterializer=iE;xr.PrototypeChainMaterializer=iE=lW([(0,fW.injectable)(),uW("design:paramtypes",[dW.NonInheritablePropertyRegistry,hW.PropertyCardinalityRegistry])],iE)});var T3=w(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.IRICanonicalizer=void 0;var E3=Oe(),mW=Ge(),gW=jt(),yW=Yn(),oE=/^obsidian:\/\/vault\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i,Dg=class n{static{a(this,"IRICanonicalizer")}static extractSynthAUid(e){let t=oE.exec(e);return t?t[1].toLowerCase():null}static canonicalize(e,t){if(t.size===0)return{triples:e,remapCount:0,uniqueRemapCount:0};let r=new Map,i=new Set,s=0;return{triples:e.map(c=>{let l=n.remapIfSynthA(c.subject,t,r,i),u=n.remapIfSynthA(c.object,t,r,i);return l===c.subject&&u===c.object?c:(s++,new yW.Triple(l,c.predicate,u))}),remapCount:s,uniqueRemapCount:i.size}}static remapIfSynthA(e,t,r,i){if(e instanceof mW.Literal||e instanceof gW.BlankNode||!(e instanceof E3.IRI))return e;let s=oE.exec(e.value);if(!s)return e;let o=s[1].toLowerCase(),c=t.get(o);if(!c||c===e.value)return e;i.add(o);let l=r.get(c);return l||(l=new E3.IRI(c),r.set(c,l)),l}};Lg.IRICanonicalizer=Dg;Dg.SYNTH_A_IRI_PATTERN=oE});var kg=w(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.derivePath=x3;Ng.deriveLegacyFlatPath=bW;var I3="assetspaces",A3=/^[A-Za-z0-9._-]+$/;function x3(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0||/^file:\/\//i.test(e))return null;e=e.replace(/\/+$/,""),e=e.replace(/\.git$/i,"");let t=null;if(!e.includes("://")){let o=/^[^/@\s]+@[^/:\s]+:(.+)$/.exec(e);o&&(t=o[1])}if(t===null){let o=e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"");o=o.replace(/^[^/@]+@/,"");let c=o.indexOf("/");if(c<0)return null;t=o.slice(c+1)}let r=t.split("/").filter(o=>o.length>0);if(r.length<2)return null;let i=r[0],s=r[1];return i==="."||i===".."||s==="."||s===".."||!A3.test(i)||!A3.test(s)?null:`${I3}/${i}/${s}`}a(x3,"derivePath");function bW(n){let e=x3(n);if(e===null)return null;let t=e.split("/")[2];if(t===void 0||t.length===0)return null;let r=t.startsWith("exoas-")?t.slice(6):t;return r.length===0?null:`${I3}/${r}`}a(bW,"deriveLegacyFlatPath")});var Mg=w(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.FILE_SPACE_CLASS_UID=void 0;Qi.frontmatterDeclaresFileSpace=SW;Qi.discoverFileSpaceExclusions=vW;var _W=kg();Qi.FILE_SPACE_CLASS_UID="aad8913e-5e9f-4047-879d-93cc46befd52";var R3=/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/g,aE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function O3(n){let e=Array.isArray(n)?n:[n],t=[];for(let r of e){if(typeof r!="string")continue;R3.lastIndex=0;let i;for(;(i=R3.exec(r))!==null;)t.push(i[1].trim())}return t}a(O3,"wikilinkTargets");function SW(n){return n?O3(n.exo__Instance_class).some(e=>aE.test(e)&&e.toLowerCase()===Qi.FILE_SPACE_CLASS_UID):!1}a(SW,"frontmatterDeclaresFileSpace");function C3(n,e){try{return n.getFrontmatter(e)}catch{return null}}a(C3,"readFrontmatterSafe");function wW(n){let e=n.exo__AssetSpace_source;if(typeof e=="string"&&e.length>0)return e;let t=n.exo__AssetSpace_git;return typeof t=="string"&&t.length>0?t:null}a(wW,"readSource");function vW(n){let e=[],t=[],r=[],i=new Map,s=a((c,l)=>{if(aE.test(c))return c.toLowerCase()===Qi.FILE_SPACE_CLASS_UID;let u=n.getFirstLinkpathDest(c,l);if(u==null)return!1;let f=i.get(u.path);if(f!==void 0)return f;let h=C3(n,u)?.exo__Asset_uid,p=typeof h=="string"&&h.toLowerCase()===Qi.FILE_SPACE_CLASS_UID;return i.set(u.path,p),p},"isFileSpaceClassRef"),o=a(c=>c.some(l=>aE.test(l)&&l.toLowerCase()===Qi.FILE_SPACE_CLASS_UID),"hasUuidFormRef");for(let c of n.getAllFiles()){let l=C3(n,c);if(!l)continue;let u=O3(l.exo__Instance_class);if(!u.some(p=>s(p,c.path)))continue;t.push(c.path),o(u)||r.push(`FileSpace declaration ${c.path} references the class via a label-form link only \u2014 the sync layer will not pick it up; use the UUID-form wikilink [[${Qi.FILE_SPACE_CLASS_UID}]] (UID-canon)`);let f=wW(l);if(f===null){r.push(`FileSpace declaration ${c.path} has no exo__AssetSpace_source/_git \u2014 mount path underivable, content NOT excluded from the index`);continue}let d=(0,_W.derivePath)(f);if(d===null){r.push(`FileSpace declaration ${c.path}: cannot derive mount path from source "${f}" \u2014 content NOT excluded from the index`);continue}let h=`${d}/`;c.path.startsWith(h)&&r.push(`FileSpace declaration ${c.path} lies INSIDE its own mount ${h} \u2014 it will be excluded from the index together with the content; move the declaration outside the mount folder`),e.push(h)}return{prefixes:e,declarationPaths:t,warnings:r}}a(vW,"discoverFileSpaceExclusions")});var P3=w(Zn=>{"use strict";var EW=Zn&&Zn.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},TW=Zn&&Zn.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.LazyAssetGraphLoader=Zn.MAX_LAZY_DEPTH=void 0;var AW=Be(),IW=Oe(),cE=zt();Zn.MAX_LAZY_DEPTH=10;var lE=class{static{a(this,"LazyAssetGraphLoader")}constructor(e,t,r){this.converter=e,this.fileResolver=t,this.store=r,this.loadedIRIs=new Set,this.instanceClassPredicate=cE.Namespace.EXO.term("Instance_class"),this.superClassPredicate=cE.Namespace.EXO.term("Class_superClass"),this.prototypePredicate=cE.Namespace.EXO.term("Asset_prototype")}async ensureFileLoaded(e,t=0){if(t>=Zn.MAX_LAZY_DEPTH)return;let r=this.converter.notePathToIRI(e.path).value;if(!this.loadedIRIs.has(r)){this.loadedIRIs.add(r);try{let i=await this.converter.convertNote(e);if(!this.loadedIRIs.has(r)||(await this.store.addAll(i),!this.loadedIRIs.has(r)))return;await this.walkClassAndPrototypeRelations(i,t+1)}catch(i){throw this.loadedIRIs.delete(r),i}}}async ensureLoadedByIRI(e,t=0){if(t>=Zn.MAX_LAZY_DEPTH||this.loadedIRIs.has(e.value))return;let r=this.fileResolver.resolveByIRI(e);r!==null&&await this.ensureFileLoaded(r,t)}isLoaded(e){return this.loadedIRIs.has(e.value)}notePathToIRI(e){return this.converter.notePathToIRI(e)}forget(e){this.loadedIRIs.delete(e.value)}clearAll(){this.loadedIRIs.clear()}get loadedCount(){return this.loadedIRIs.size}clearForTests(){this.loadedIRIs.clear()}async walkClassAndPrototypeRelations(e,t){let r=[];for(let i of e){if(!(i.object instanceof IW.IRI))continue;let s=i.predicate.value;(s===this.instanceClassPredicate.value||s===this.superClassPredicate.value||s===this.prototypePredicate.value)&&r.push(i.object)}for(let i of r)await this.ensureLoadedByIRI(i,t)}};Zn.LazyAssetGraphLoader=lE;Zn.LazyAssetGraphLoader=lE=EW([(0,AW.injectable)(),TW("design:paramtypes",[Object,Object,Object])],lE)});var fE=w(_r=>{"use strict";var xW=_r&&_r.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},RW=_r&&_r.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(_r,"__esModule",{value:!0});_r.SourceAnnotator=_r.DEPTH_VARIABLE=_r.SOURCE_VARIABLE=void 0;var CW=Be(),Zl=Ge(),OW=Oe(),jg=sE();_r.SOURCE_VARIABLE="_source";_r.DEPTH_VARIABLE="_depth";var uE=class{static{a(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(o=>{let c=o.clone();return c.set(_r.SOURCE_VARIABLE,new Zl.Literal("own")),c});let s=[];for(let o of e){let c=o.get(t),l=o.get(r),u=o.get(i),f=o.clone();if(!c||!l||!u)f.set(_r.SOURCE_VARIABLE,new Zl.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(_r.SOURCE_VARIABLE,new Zl.Literal(d))}s.push(f)}return s}async annotateSingle(e,t,r,i){return(await this.annotate([e],t,r,i))[0]}async determineSource(e,t,r){return this.tripleStore.matchInGraph&&(await this.tripleStore.matchInGraph(e,t,r,jg.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=jg.MAX_PROTOTYPE_DEPTH;i++){let s=(0,jg.inferredGraphForDepth)(i);if((await this.tripleStore.matchInGraph(e,t,r,s)).length>0)return i}return 0}async annotateBySubject(e,t){if(!this.tripleStore.matchInGraph)return e.map(s=>{let o=s.clone();return o.set(_r.SOURCE_VARIABLE,new Zl.Literal("own")),o});let r=[],i=new Map;for(let s of e){let o=s.get(t),c=s.clone();if(!o||!(o instanceof OW.IRI))c.set(_r.SOURCE_VARIABLE,new Zl.Literal("own"));else{let l=o.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(o,void 0,void 0,jg.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(_r.SOURCE_VARIABLE,new Zl.Literal(u))}r.push(c)}return r}};_r.SourceAnnotator=uE;_r.SourceAnnotator=uE=xW([(0,CW.injectable)(),RW("design:paramtypes",[Object])],uE)});var mE=w(ei=>{"use strict";var PW=ei&&ei.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},FW=ei&&ei.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},F3=ei&&ei.__param||function(n,e){return function(t,r){e(t,r,n)}},pE;Object.defineProperty(ei,"__esModule",{value:!0});ei.NoteToRDFConverter=void 0;ei.normaliseExcludedFolders=k3;ei.isPathExcluded=M3;var dE=Be(),lr=Yn(),Yi=Oe(),bn=Ge(),D3=jt(),Kt=zt(),L3=Bt(),DW=Qv(),LW=sl(),hE=zv(),Bn=Z_(),NW=Mg(),N3=new Set(["archived","draft","pinned","aliases"]);function k3(n){return Array.isArray(n)?n.map(e=>String(e).replace(/\\/g,"/").trim()).filter(e=>e.length>0).map(e=>e.endsWith("/")?e:`${e}/`):[]}a(k3,"normaliseExcludedFolders");function M3(n,e){if(e.length===0)return!1;let t=n.replace(/\\/g,"/");for(let r of e)if(t.startsWith(r))return!0;return!1}a(M3,"isPathExcluded");function kW(n){if(!n)return"";let e=n.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);for(;e.endsWith("/");)e=e.slice(0,-1);return e.length>0?`${e}/`:""}a(kW,"normaliseSubjectIriPrefix");var Ec=pE=class{static{a(this,"NoteToRDFConverter")}constructor(e,t=LW.NullLogger,r={}){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.pendingExtraTriples=[],this.vocabularyMapper=new DW.RDFVocabularyMapper,this.subjectIriPrefix=kW(r.subjectIriPrefix)}async convertNote(e){return this.convertNoteFromFrontmatter(e,this.vault.getFrontmatter(e))}async convertNoteFromFrontmatter(e,t){if(!t)return[];let r=this.notePathToIRI(e.path),i=Kt.Namespace.EXO.term("Asset_filename"),s=new lr.Triple(r,i,new bn.Literal(e.basename));if(Bn.Exo003Parser.isExo003Format(t)){let o=await this.convertExo003Note(e,t);return[s,...o]}return this.convertLegacyNote(e,t,s)}async convertLegacyNote(e,t,r){this.pendingExtraTriples=[];let i=[r],s=this.notePathToIRI(e.path),o,c,l,u=!1,f=Kt.Namespace.EXO.term("Statement").value;for(let[y,b]of Object.entries(t)){let S=N3.has(y)?`exo__Asset_${y}`:y;if(!this.isExocortexProperty(S))continue;let v=this.propertyKeyToIRI(S),I=Array.isArray(b)?b:[b];for(let A of I)if(!((y==="exo__Asset_label"||N3.has(y))&&(A==null||typeof A=="string"&&A.trim()==="")))if(y==="exo__Instance_class"){let T=this.valueToClassURI(A);i.push(new lr.Triple(s,v,T))}else{let T=await this.valueToRDFObject(A,e,v);if(S==="exo__Statement_subject"&&o===void 0){let R=T.find(B=>B instanceof Yi.IRI);R&&(o=R)}else if(S==="exo__Statement_predicate"&&c===void 0){let R=T.find(B=>B instanceof Yi.IRI);R&&(c=R)}else S==="exo__Statement_object"&&l===void 0&&(l=T[0]);for(let R of T)if(i.push(new lr.Triple(s,v,R)),this.vocabularyMapper.hasMappingFor(y)&&R instanceof Yi.IRI){let B=this.vocabularyMapper.generateMappedTriple(s,y,R);B&&i.push(B)}}if(y==="exo__Instance_class")for(let A of I){let T=this.valueToClassURI(A);if(T instanceof Yi.IRI){let R=Kt.Namespace.RDF.term("type");i.push(new lr.Triple(s,R,T)),T.value===f&&(u=!0)}}if(y==="exo__Asset_label"){let A=Kt.Namespace.RDFS.term("label");for(let T of I)typeof T=="string"&&T.length>0&&i.push(new lr.Triple(s,A,new bn.Literal(T)))}}let d="exo__Instance_class"in t||"exo__Asset_uid"in t,h=t.exo__Asset_label,p="exo__Asset_label"in t&&h!==null&&h!==void 0&&!(typeof h=="string"&&h.trim()==="")&&!(Array.isArray(h)&&h.length===0);if(d&&!p){let y=Kt.Namespace.RDFS.term("label"),b=Kt.Namespace.EXO.term("Asset_label"),S=new bn.Literal(e.basename);i.push(new lr.Triple(s,y,S)),i.push(new lr.Triple(s,b,S))}i.push(...this.pendingExtraTriples),this.pendingExtraTriples=[],u&&o&&c&&l&&i.push(new lr.Triple(o,c,l));let g=await this.convertBodyWikilinks(e,s);return i.push(...g),i}async convertExo003Note(e,t){let r=Bn.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Bn.Exo003MetadataType.Namespace:break;case Bn.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Bn.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Bn.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Bn.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new Yi.IRI(t.uri);return[new lr.Triple(r,Kt.Namespace.OWL.term("sameAs"),i),new lr.Triple(i,Kt.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 lr.Triple(r,Kt.Namespace.OWL.term("sameAs"),new D3.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Bn.Exo003Parser.toTriple(t,i);r.push(s);let o=this.notePathToIRI(e.path);r.push(new lr.Triple(o,Kt.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),o=this.createExo003ReferenceResolver(e),c=o(t.subject),l=o(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 Yi.IRI(c.value):new D3.BlankNode(c.value),f=new Yi.IRI(l.value),d=Bn.Exo003Parser.toLiteral(t,s.trim());r.push(new lr.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new lr.Triple(h,Kt.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 o=this.vault.getFrontmatter(s);if(o&&Bn.Exo003Parser.isExo003Format(o)){let c=Bn.Exo003Parser.parse(o);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Bn.Exo003MetadataType.Anchor||l.metadata===Bn.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Bn.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(e={}){return(await this.convertVaultWithValidation({strict:!1,excludedFolders:e.excludedFolders})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1,o=0,c=0,l=(0,NW.discoverFileSpaceExclusions)(this.vault);for(let y of l.warnings)this.logger.warn(`FileSpace discovery: ${y}`);let u=[...k3(e.excludedFolders),...l.prefixes],f=u.length===0?t:t.filter(y=>!M3(y.path,u)),d=e.onProgress,h=e.progressIntervalFiles&&e.progressIntervalFiles>0?e.progressIntervalFiles:pE.INDEX_PROGRESS_INTERVAL,p=f.length,g=0;for(let y of f){if(g++,d&&g%h===0&&g<p)try{d(g,p)}catch{}try{let b=this.vault.getFrontmatter(y),S=b?this.validateExocortexAsset(b,y.basename):null;if(S){if(s)throw new Error(`Invariant violation in "${y.path}": ${S.message}`);i.push({path:y.path,reason:`Invariant violation: ${S.message}`}),o++,this.logger.info(`Skipping file with invariant violation: ${y.path}`,{code:S.code,property:S.property,reason:S.message});continue}let v=await this.convertNote(y);r.push(...v)}catch(b){let S=b instanceof Error?b.message:String(b);if(s)throw new Error(`Invalid IRI for file "${y.path}": ${S}`);i.push({path:y.path,reason:`Invalid IRI: ${S}`}),c++,this.logger.info(`Skipping file with invalid IRI: ${y.path}`,{reason:S})}}return o>0&&this.logger.warn(`Skipped ${o} file${o===1?"":"s"} with invariant violations during indexing (paths in developer console)`,{count:o}),c>0&&this.logger.warn(`Skipped ${c} file${c===1?"":"s"} with invalid IRI during indexing (paths in developer console)`,{count:c}),{triples:r,skippedFiles:i,summary:{total:f.length,indexed:f.length-i.length,skipped:i.length},fileSpaces:l}}static inferLabelFromBasename(e){return Kt.Namespace.fromPropertyKey(e)!==null?e:null}validateExocortexAsset(e,t){let r=a(d=>d==null?!0:typeof d=="string"?d.trim()==="":Array.isArray(d)?d.length===0||d.every(r):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let s=["exo__Asset_uid","exo__Instance_class"];for(let d of s){if(!(d in e))return{code:"MISSING_PROPERTY",property:d,message:`Required property "${d}" is missing`};if(r(e[d]))return{code:"EMPTY_PROPERTY",property:d,message:`Required property "${d}" is empty`}}let o=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let d of o)if(d in e&&r(e[d]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:d,message:`Optional property "${d}" is present but empty`};let c=e.exo__Instance_class,l=Array.isArray(c)?c:[c],u=null,f=!1;for(let d of l){if(typeof d!="string")continue;let h=this.removeQuotes(d),g=(this.extractWikilink(h)??h).trim();/^[a-z][a-zA-Z0-9]*__/.test(g)&&/[\s()]/.test(g)?u||(u={candidate:d}):f=!0}return u&&!f?{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${u.candidate}"`}:null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,hE.vaultPathToIRI)(r.path);Yi.IRI.isValidIRI(i)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){return new Yi.IRI((0,hE.vaultPathToIRI)(`${this.subjectIriPrefix}${e}`))}synthesizeWikilinkTargetIRI(e){return new Yi.IRI((0,hE.vaultPathToIRI)(e))}isExocortexProperty(e){return Kt.Namespace.fromPropertyKey(e)!==null}propertyKeyToIRI(e){let t=Kt.Namespace.fromPropertyKey(e);if(!t)throw new Error(`Invalid property key: ${e}`);return t.namespace.term(t.localName)}emitTypeTripleForEnumInstance(e,t){let r=this.vault.getFrontmatter(t);if(!r)return;let i=r.exo__Instance_class,s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return;let o=this.valueToClassURI(s);o instanceof Yi.IRI&&(this.pendingExtraTriples.push(new lr.Triple(e,Kt.Namespace.RDF.term("type"),o)),this.pendingExtraTriples.push(new lr.Triple(e,Kt.Namespace.EXO.term("Instance_class"),o)))}async valueToRDFObject(e,t,r){if(typeof e=="string"){let i=this.removeQuotes(e),s=this.extractWikilink(i);if(s){let o=this.vault.getFirstLinkpathDest(s,t.path);if(o){let l=this.notePathToIRI(o.path),u=s.includes("|")?s.split("|")[0]:s;if(this.isUUID(u)){let d=new bn.Literal(u);if(r?.value.endsWith("#Grounding_targetValueRef")||r?.value.endsWith("#Grounding_targetValueSubstitution")||r?.value.endsWith("#Grounding_targetClass")||r?.value.endsWith("#Grounding_type")||r?.value.endsWith("#PropertyDefault_value"))return[l];let p=this.expandClassValue(o.basename);if(p)return this.emitTypeTripleForEnumInstance(p,o),[p];let g=this.vault.getFrontmatter(o);if(g){let I=g.exo__Asset_label;if(typeof I=="string"){let A=this.expandClassValue(I);if(A)return this.emitTypeTripleForEnumInstance(A,o),[A]}}let y=r?.value.endsWith("#Asset_prototype")||r?.value.endsWith("/Asset_prototype"),S=((typeof process<"u"?process.env:void 0)?.EXOCORTEX_DUAL_STORAGE_PREDICATES??"").split(",").map(I=>I.trim()).filter(Boolean),v=S.length>0&&S.some(I=>r?.value.endsWith(`#${I}`));return y||v?[l,d]:[l]}let f=this.expandClassValue(o.basename);return f?(this.emitTypeTripleForEnumInstance(f,o),[f]):[l]}if(this.isClassReference(s)){let l=this.expandClassValue(s);if(l)return[l]}let c=s.includes("|")?s.split("|")[0]:s;return this.isUUID(c)?[this.synthesizeWikilinkTargetIRI(`${c}.md`)]:[new bn.Literal(i)]}if(this.isClassReference(i)){let o=this.expandClassValue(i);if(o)return[o]}return this.isISO8601DateTime(i)?[new bn.Literal(i,Kt.Namespace.XSD.term("dateTime"))]:[new bn.Literal(i)]}return typeof e=="boolean"?[new bn.Literal(e.toString())]:typeof e=="number"?[new bn.Literal(e.toString(),Kt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new bn.Literal(e.toISOString(),Kt.Namespace.XSD.term("dateTime"))]:[new bn.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(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1];return r.includes("|")?r.split("|")[0]:r}extractWikilinkAlias(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1],i=r.indexOf("|");return i>=0?r.substring(i+1).trim():null}valueToClassURI(e){if(typeof e!="string")return new bn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let o=this.extractWikilinkAlias(t);if(o){let c=this.expandClassValue(o);if(c)return c}if(this.isUUID(i)){let c=this.vault.getFirstLinkpathDest(i,"");if(c){let l=this.expandClassValue(c.basename);if(l)return l;let u=this.vault.getFrontmatter(c);if(u){let f=u.exo__Asset_label;if(typeof f=="string"){let d=this.expandClassValue(f);if(d)return d}}return this.notePathToIRI(c.path)}}return new bn.Literal(t)}isClassReference(e){return/\s/.test(e)?!1:Kt.Namespace.fromPropertyKey(e)!==null}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),r=Kt.Namespace.fromPropertyKey(t);return!r||/[\s()]/.test(r.localName)?null:r.namespace.term(r.localName)}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),o=this.extractBodyWikilinks(s),c=Kt.Namespace.EXO.term("Asset_bodyLink");for(let l of o){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new lr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new lr.Triple(t,c,f)):r.push(new lr.Triple(t,c,new bn.Literal(l)))}else r.push(new lr.Triple(t,c,new bn.Literal(l)))}}catch{}return r}};ei.NoteToRDFConverter=Ec;Ec.INDEX_PROGRESS_INTERVAL=200;Ec.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};Ec.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};Ec.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};ei.NoteToRDFConverter=Ec=pE=PW([(0,dE.injectable)(),F3(0,(0,dE.inject)(L3.DI_TOKENS.IVaultAdapter)),F3(1,(0,dE.inject)(L3.DI_TOKENS.ILogger)),FW("design:paramtypes",[Object,Object,Object])],Ec)});var yE=w($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.FilterContainsOptimizer=void 0;var MW=Oe(),jW=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,gE=class{static{a(this,"FilterContainsOptimizer")}constructor(){this.tripleStore=null,this.lastOptimizationHints=[]}setTripleStore(e){this.tripleStore=e}getLastOptimizationHints(){return this.lastOptimizationHints}clearHints(){this.lastOptimizationHints=[]}async optimize(e){return this.clearHints(),this.optimizeRecursive(e)}optimizeSync(e,t){return this.clearHints(),this.optimizeSyncRecursive(e,t)}async optimizeRecursive(e){return e.type==="filter"?this.optimizeFilter(e):e.type==="join"?{type:"join",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="leftjoin"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="union"?{type:"union",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="minus"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="project"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="orderby"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="slice"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="distinct"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="reduced"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="group"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="extend"?{...e,input:await this.optimizeRecursive(e.input)}:e}optimizeSyncRecursive(e,t){return e.type==="filter"?this.optimizeFilterSync(e,t):e.type==="join"?{type:"join",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="leftjoin"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="union"?{type:"union",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="minus"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="project"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="orderby"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="slice"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="distinct"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="reduced"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="group"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="extend"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e}async optimizeFilter(e){let t=this.detectContainsUUIDPattern(e.expression);if(!t)return{type:"filter",expression:e.expression,input:await this.optimizeRecursive(e.input)};let r=[];return this.tripleStore&&(r=await this.findSubjectsContainingUUID(t.uuid)),this.rewriteFilter(e,t,r)}optimizeFilterSync(e,t){let r=this.detectContainsUUIDPattern(e.expression);if(!r)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input,t)};let i=t?t.filter(s=>s.includes(r.uuid)):[];return this.rewriteFilter(e,r,i)}rewriteFilter(e,t,r){if(this.lastOptimizationHints.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${t.variable}), "${t.uuid}"))`,suggestedRewrite:r.length===1?`VALUES ?${t.variable} { <${r[0]}> }`:r.length>1?`VALUES ?${t.variable} { ${r.map(i=>`<${i}>`).join(" ")} }`:"No matching URIs found for UUID",estimatedSpeedup:r.length>0?"O(n) \u2192 O(1)":"N/A",matchedUri:r.length===1?r[0]:void 0}),r.length===0)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input)};if(r.length===1){let i=this.injectSubjectConstraint(e.input,t.variable,r[0]);if(i!==e.input)return i}return this.createValuesJoin(e,t,r)}detectContainsUUIDPattern(e){if(e.type==="function"||e.type==="functionCall"){let t=e;if((typeof t.function=="string"?t.function.toLowerCase():t.function?.value?.toLowerCase()??"")==="contains"&&t.args.length===2)return this.analyzeContainsArgs(t.args[0],t.args[1],e)}if(e.type==="logical"&&e.operator==="&&")for(let t of e.operands){let r=this.detectContainsUUIDPattern(t);if(r)return r}return null}analyzeContainsArgs(e,t,r){let i=null;if(e.type==="function"||e.type==="functionCall"){let s=e;if((typeof s.function=="string"?s.function.toLowerCase():s.function?.value?.toLowerCase()??"")==="str"&&s.args.length===1){let c=s.args[0];c.type==="variable"&&(i=c.name)}}if(!i&&e.type==="variable"&&(i=e.name),!i)return null;if(t.type==="literal"){let c=String(t.value).match(jW);if(c)return{variable:i,uuid:c[0].toLowerCase(),originalExpression:r}}return null}async findSubjectsContainingUUID(e){if(!this.tripleStore)return[];if(this.tripleStore.findSubjectsByUUID)return(await this.tripleStore.findSubjectsByUUID(e)).map(s=>s.value);let t=await this.tripleStore.subjects(),r=[];for(let i of t)i instanceof MW.IRI&&i.value.toLowerCase().includes(e.toLowerCase())&&r.push(i.value);return r}injectSubjectConstraint(e,t,r){if(e.type==="bgp"){let i=e.triples.map(o=>o.subject.type==="variable"&&o.subject.value===t?{...o,subject:{type:"iri",value:r}}:o);if(i.some((o,c)=>o.subject!==e.triples[c].subject))return{type:"bgp",triples:i}}if(e.type==="join"){let i=this.injectSubjectConstraint(e.left,t,r),s=this.injectSubjectConstraint(e.right,t,r);if(i!==e.left||s!==e.right)return{type:"join",left:i,right:s}}if(e.type==="filter"){let i=this.injectSubjectConstraint(e.input,t,r);if(i!==e.input)return{...e,input:i}}return e}createValuesJoin(e,t,r){return{type:"join",left:{type:"values",variables:[t.variable],bindings:r.map(o=>({[t.variable]:{type:"iri",value:o}}))},right:this.optimizeSyncRecursive(e.input)}}analyzeQuery(e){let t=[];return this.analyzeRecursive(e,t),t}analyzeRecursive(e,t){if(e.type==="filter"){let r=this.detectContainsUUIDPattern(e.expression);r&&t.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${r.variable}), "${r.uuid}"))`,suggestedRewrite:`Use --optimize flag or rewrite as VALUES ?${r.variable} { <uri-containing-uuid> }`,estimatedSpeedup:"O(n) \u2192 O(1) with UUID index lookup"}),this.analyzeRecursive(e.input,t);return}e.type==="join"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="leftjoin"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="union"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="minus"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="project"?this.analyzeRecursive(e.input,t):e.type==="orderby"?this.analyzeRecursive(e.input,t):e.type==="slice"?this.analyzeRecursive(e.input,t):e.type==="distinct"?this.analyzeRecursive(e.input,t):e.type==="reduced"?this.analyzeRecursive(e.input,t):e.type==="group"?this.analyzeRecursive(e.input,t):e.type==="extend"&&this.analyzeRecursive(e.input,t)}};$g.FilterContainsOptimizer=gE});var j3=w(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.AlgebraOptimizer=void 0;var $W=yE(),bE=class{static{a(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new $W.FilterContainsOptimizer}setTripleStore(e){this.tripleStore=e,this.filterContainsOptimizer.setTripleStore(e)}getOptimizationHints(){return this.filterContainsOptimizer.getLastOptimizationHints()}analyzeQuery(e){return this.filterContainsOptimizer.analyzeQuery(e)}optimize(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),t=this.filterPushDown(t),t=this.joinReordering(t),t}async optimizeAsync(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),this.tripleStore&&(t=await this.filterContainsOptimizer.optimize(t)),t=this.filterPushDown(t),t=this.joinReordering(t),t}optimizeWithSubjects(e,t){let r=e;return r=this.eliminateEmptyBGPInFilterJoin(r),r=this.filterContainsOptimizer.optimizeSync(r,t),r=this.filterPushDown(r),r=this.joinReordering(r),r}eliminateEmptyBGPInFilterJoin(e){if(e.type==="join"){if(e.left.type==="filter"){let t=e.left;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.right)}}if(e.right.type==="filter"){let t=e.right;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.left)}}return{type:"join",left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}}return e.type==="filter"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="leftjoin"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="union"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="minus"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="project"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="orderby"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="slice"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="distinct"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e}filterPushDown(e){return e.type==="filter"?this.pushDownFilter(e):e.type==="join"?{type:"join",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="leftjoin"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="union"?{type:"union",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="minus"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="project"?{...e,input:this.filterPushDown(e.input)}:e.type==="orderby"?{...e,input:this.filterPushDown(e.input)}:e.type==="slice"?{...e,input:this.filterPushDown(e.input)}:e.type==="distinct"?{...e,input:this.filterPushDown(e.input)}:e}pushDownFilter(e){let t=e.input;if(t.type==="join"){let r=this.getFilterVariables(e.expression),i=this.getOperationVariables(t.left),s=this.getOperationVariables(t.right),o=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return o&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!o?{type:"join",left:this.filterPushDown(t.left),right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:{type:"join",left:this.filterPushDown(t.left),right:this.filterPushDown(t.right)}}}return t.type==="union"?{type:"union",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:this.filterPushDown(t)}}getFilterVariables(e){let t=[];if(e.type==="variable")t.push(e.name);else if(e.type==="comparison")t.push(...this.getFilterVariables(e.left)),t.push(...this.getFilterVariables(e.right));else if(e.type==="logical")for(let r of e.operands)t.push(...this.getFilterVariables(r));else if(e.type==="function")for(let r of e.args)t.push(...this.getFilterVariables(r));return Array.from(new Set(t))}getOperationVariables(e){let t=new Set;if(e.type==="bgp")for(let r of e.triples)r.subject.type==="variable"&&t.add(r.subject.value),r.predicate.type==="variable"&&t.add(r.predicate.value),r.object.type==="variable"&&t.add(r.object.value);else if(e.type==="join"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="filter")return this.getOperationVariables(e.input);if(e.type==="leftjoin"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else if(e.type==="union"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="minus")return this.getOperationVariables(e.left);if(e.type==="project")return new Set(e.variables)}}return t}joinReordering(e){return e.type==="join"?this.reorderJoin(e):e.type==="filter"?{...e,input:this.joinReordering(e.input)}:e.type==="leftjoin"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="union"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="minus"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="project"?{...e,input:this.joinReordering(e.input)}:e.type==="orderby"?{...e,input:this.joinReordering(e.input)}:e.type==="slice"?{...e,input:this.joinReordering(e.input)}:e.type==="distinct"?{...e,input:this.joinReordering(e.input)}:e}reorderJoin(e){let t=this.isConstrained(e.left),r=this.isConstrained(e.right);if(r&&!t)return{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)};if(t&&!r)return{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)};let i=this.estimateCost(e.left);return this.estimateCost(e.right)<i?{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)}:{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)}}isConstrained(e){return e.type==="values"?!0:e.type==="bgp"?e.triples.some(t=>t.object.type!=="variable"||t.subject.type!=="variable"):e.type==="filter"?this.isConstrained(e.input):e.type==="join"?this.isConstrained(e.left)||this.isConstrained(e.right):e.type==="union"?this.isConstrained(e.left)&&this.isConstrained(e.right):!1}estimateCost(e){if(e.type==="bgp"){let t=0;for(let r of e.triples){let i=10;r.subject.type==="variable"&&(i*=10),r.predicate.type==="variable"&&(i*=20),r.object.type==="variable"&&(i*=5),t+=i}return t}if(e.type==="filter")return this.estimateCost(e.input)*.3;if(e.type==="join"){let t=this.estimateCost(e.left),r=this.estimateCost(e.right);return e.left.type==="values"||e.right.type==="values"?Math.min(t,r)*2:t*r}if(e.type==="leftjoin")return this.estimateCost(e.left)+this.estimateCost(e.right)*.5;if(e.type==="union")return this.estimateCost(e.left)+this.estimateCost(e.right);if(e.type==="values"){let t=e.bindings;return Array.isArray(t)?t.length*5:10}return e.type==="minus"?this.estimateCost(e.left)+this.estimateCost(e.right)*.3:100}setStatistics(e,t){this.stats.set(e,t)}getStatistics(e){return this.stats.get(e)}};Ug.AlgebraOptimizer=bE});var $3=w(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.AlgebraSerializer=void 0;var _E=class{static{a(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
|
|
224
224
|
${e.triples.map(u=>`${r} ${this.tripleToString(u)}`).join(`
|
|
225
225
|
`)}
|
|
226
226
|
${r}]`;case"filter":return`${r}Filter(
|
|
@@ -252,11 +252,11 @@ ${r})`;case"extend":return`${r}Extend (?${e.variable} = ${this.expressionToStrin
|
|
|
252
252
|
${this.toString(e.input,t+1)}
|
|
253
253
|
${r})`;case"subquery":return`${r}Subquery(
|
|
254
254
|
${this.toString(e.query,t+1)}
|
|
255
|
-
${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)}};Bg.AlgebraSerializer=_E});var B3=w(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.DescribeExecutor=void 0;var U3=Oe(),SE=class{static{a(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,o=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,o,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,o,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 h=await this.tripleStore.match(void 0,void 0,e);u.push(...h)}let d=[];for(let h of u){let p=`${h.subject.toString()}|${h.predicate.toString()}|${h.object.toString()}`;o.has(p)||(o.add(p),s.push(h),(t===void 0||r<t)&&(this.isIRI(h.subject)&&h.subject.toString()!==l&&d.push(h.subject),this.isIRI(h.object)&&h.object.toString()!==l&&d.push(h.object)))}for(let h of d)await this.describeResourceWithDepth(h,t,r+1,i,s,o,c)}isIRI(e){if(!e||typeof e!="object")return!1;let t=e;return e instanceof U3.IRI||t.termType==="NamedNode"||typeof t.value=="string"&&t.value.startsWith("http")}async describeByIRI(e,t){let r=new U3.IRI(e);return this.execute([r],t)}};Vg.DescribeExecutor=SE});var q3=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.UpdateExecutor=tu.UpdateExecutorError=void 0;var UW=Qn(),eu=Oe(),wE=Ge(),V3=jt(),en=class extends Error{static{a(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};tu.UpdateExecutorError=en;var vE=class{static{a(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new en("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 en("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new en("DELETE WHERE not yet implemented");default:throw new en(`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 en(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new en(`Unknown operation type: ${e.type}`)}throw new en("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new en("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,o=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,o)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new en("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,o=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,o)}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),o;t&&this.tripleStore.removeFromGraph?o=await this.tripleStore.removeFromGraph(s,t):o=await this.tripleStore.remove(s),o&&r++}return r}convertTriple(e){return new UW.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new eu.IRI(e.value);if(e.termType==="BlankNode")return new V3.BlankNode(e.value);throw new en(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new eu.IRI(e.value);throw new en("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new eu.IRI(e.value);if(e.termType==="BlankNode")return new V3.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new wE.Literal(t.value,void 0,t.language):t.datatype?new wE.Literal(t.value,new eu.IRI(t.datatype.value)):new wE.Literal(t.value)}throw new en(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new eu.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new en("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new eu.IRI(e.value)}};tu.UpdateExecutor=vE});var W3=w(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.AggregateFunctions=void 0;var EE=Ge(),G3=Oe(),TE=class{static{a(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 EE.Literal){let o=this.toNumber(s);isNaN(o)||(r+=o)}}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 o=this.toComparable(s);(r===null||o<r)&&(r=o)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o>r)&&(r=o)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let o=s.get(t);o&&(o instanceof EE.Literal||o instanceof G3.IRI?i.push(o.value):i.push(o.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 EE.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof G3.IRI?e.value:String(e)}};qg.AggregateFunctions=TE});var H3=w(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.QueryPlanCache=void 0;var BW=ug(),AE=class{static{a(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new BW.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()}};Gg.QueryPlanCache=AE});var z3=w(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.SPARQLResultCache=void 0;id.createSPARQLResultCache=GW;var VW=ug(),qW={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Wg=class{static{a(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={...qW,...e},this.cache=new VW.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 o=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(o,l),this.options.enableFileInvalidation)for(let f of c){let d=this.fileToQueries.get(f);d||(d=new Set,this.fileToQueries.set(f,d)),d.add(o)}}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}};id.SPARQLResultCache=Wg;function GW(n){return new Wg(n)}a(GW,"createSPARQLResultCache")});var K3=w(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.IncrementalIndexer=void 0;sd.createIncrementalIndexer=zW;var WW=fc(),HW={throttleMs:500,maxBatchSize:100,useContentHashing:!1},Hg=class{static{a(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={...HW,...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 o of this.pendingChanges)t.set(o.path,o);let r=Array.from(t.values()),i=[];for(let o of r)switch(o.type){case"deleted":this.fileMetadata.delete(o.path),i.push(o);break;case"renamed":o.oldPath&&this.fileMetadata.delete(o.oldPath),i.push(o);break;case"created":case"modified":i.push(o);break}if(i.length>0){this.stats.invalidations+=i.length;for(let o of this.invalidateCallbacks)try{o(i)}catch(c){WW.LoggingService.error("IncrementalIndexer: Error in invalidation callback",c instanceof Error?c:new Error(String(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()}};sd.IncrementalIndexer=Hg;function zW(n){return new Hg(n)}a(zW,"createIncrementalIndexer")});var Q3=w(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});Yg.ResultSerializer=void 0;var zg=Ge(),Kg=Oe(),Qg=jt(),IE=class{static{a(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 o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(o=>{let c={};for(let l of i){let u=o.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof Kg.IRI?{type:"uri",value:e.value}:e instanceof Qg.BlankNode?{type:"bnode",value:e.id}:e instanceof zg.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 o of e)for(let c of o.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 o of i)s.push(` <variable name="${this.escapeXML(o)}"/>`);s.push(" </head>"),s.push(" <results>");for(let o of e){s.push(" <result>");for(let c of i){let l=o.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(`
|
|
255
|
+
${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)}};Bg.AlgebraSerializer=_E});var B3=w(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.DescribeExecutor=void 0;var U3=Oe(),SE=class{static{a(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,o=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,o,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,o,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 h=await this.tripleStore.match(void 0,void 0,e);u.push(...h)}let d=[];for(let h of u){let p=`${h.subject.toString()}|${h.predicate.toString()}|${h.object.toString()}`;o.has(p)||(o.add(p),s.push(h),(t===void 0||r<t)&&(this.isIRI(h.subject)&&h.subject.toString()!==l&&d.push(h.subject),this.isIRI(h.object)&&h.object.toString()!==l&&d.push(h.object)))}for(let h of d)await this.describeResourceWithDepth(h,t,r+1,i,s,o,c)}isIRI(e){if(!e||typeof e!="object")return!1;let t=e;return e instanceof U3.IRI||t.termType==="NamedNode"||typeof t.value=="string"&&t.value.startsWith("http")}async describeByIRI(e,t){let r=new U3.IRI(e);return this.execute([r],t)}};Vg.DescribeExecutor=SE});var q3=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.UpdateExecutor=tu.UpdateExecutorError=void 0;var UW=Yn(),eu=Oe(),wE=Ge(),V3=jt(),en=class extends Error{static{a(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};tu.UpdateExecutorError=en;var vE=class{static{a(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new en("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 en("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new en("DELETE WHERE not yet implemented");default:throw new en(`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 en(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new en(`Unknown operation type: ${e.type}`)}throw new en("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new en("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,o=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,o)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new en("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,o=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,o)}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),o;t&&this.tripleStore.removeFromGraph?o=await this.tripleStore.removeFromGraph(s,t):o=await this.tripleStore.remove(s),o&&r++}return r}convertTriple(e){return new UW.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new eu.IRI(e.value);if(e.termType==="BlankNode")return new V3.BlankNode(e.value);throw new en(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new eu.IRI(e.value);throw new en("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new eu.IRI(e.value);if(e.termType==="BlankNode")return new V3.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new wE.Literal(t.value,void 0,t.language):t.datatype?new wE.Literal(t.value,new eu.IRI(t.datatype.value)):new wE.Literal(t.value)}throw new en(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new eu.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new en("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new eu.IRI(e.value)}};tu.UpdateExecutor=vE});var W3=w(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.AggregateFunctions=void 0;var EE=Ge(),G3=Oe(),TE=class{static{a(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 EE.Literal){let o=this.toNumber(s);isNaN(o)||(r+=o)}}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 o=this.toComparable(s);(r===null||o<r)&&(r=o)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o>r)&&(r=o)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let o=s.get(t);o&&(o instanceof EE.Literal||o instanceof G3.IRI?i.push(o.value):i.push(o.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 EE.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof G3.IRI?e.value:String(e)}};qg.AggregateFunctions=TE});var H3=w(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.QueryPlanCache=void 0;var BW=ug(),AE=class{static{a(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new BW.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()}};Gg.QueryPlanCache=AE});var z3=w(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.SPARQLResultCache=void 0;id.createSPARQLResultCache=GW;var VW=ug(),qW={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Wg=class{static{a(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={...qW,...e},this.cache=new VW.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 o=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(o,l),this.options.enableFileInvalidation)for(let f of c){let d=this.fileToQueries.get(f);d||(d=new Set,this.fileToQueries.set(f,d)),d.add(o)}}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}};id.SPARQLResultCache=Wg;function GW(n){return new Wg(n)}a(GW,"createSPARQLResultCache")});var K3=w(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.IncrementalIndexer=void 0;sd.createIncrementalIndexer=zW;var WW=fc(),HW={throttleMs:500,maxBatchSize:100,useContentHashing:!1},Hg=class{static{a(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={...HW,...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 o of this.pendingChanges)t.set(o.path,o);let r=Array.from(t.values()),i=[];for(let o of r)switch(o.type){case"deleted":this.fileMetadata.delete(o.path),i.push(o);break;case"renamed":o.oldPath&&this.fileMetadata.delete(o.oldPath),i.push(o);break;case"created":case"modified":i.push(o);break}if(i.length>0){this.stats.invalidations+=i.length;for(let o of this.invalidateCallbacks)try{o(i)}catch(c){WW.LoggingService.error("IncrementalIndexer: Error in invalidation callback",c instanceof Error?c:new Error(String(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()}};sd.IncrementalIndexer=Hg;function zW(n){return new Hg(n)}a(zW,"createIncrementalIndexer")});var Q3=w(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});Yg.ResultSerializer=void 0;var zg=Ge(),Kg=Oe(),Qg=jt(),IE=class{static{a(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 o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(o=>{let c={};for(let l of i){let u=o.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof Kg.IRI?{type:"uri",value:e.value}:e instanceof Qg.BlankNode?{type:"bnode",value:e.id}:e instanceof zg.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 o of e)for(let c of o.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 o of i)s.push(` <variable name="${this.escapeXML(o)}"/>`);s.push(" </head>"),s.push(" <results>");for(let o of e){s.push(" <result>");for(let c of i){let l=o.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(`
|
|
256
256
|
`)}termToXML(e){return e instanceof Kg.IRI?`<uri>${this.escapeXML(e.value)}</uri>`:e instanceof Qg.BlankNode?`<bnode>${this.escapeXML(e.id)}</bnode>`:e instanceof zg.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 o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(i.map(o=>this.escapeCSV(o)).join(","));for(let o of e){let c=i.map(l=>{let u=o.get(l);return u===void 0?"":this.escapeCSV(this.termToCSV(u))});s.push(c.join(","))}return s.join(`
|
|
257
257
|
`)}termToCSV(e){return e instanceof Kg.IRI?e.value:e instanceof Qg.BlankNode?`_:${e.id}`:e instanceof zg.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 o of e)for(let c of o.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 o=0;o<e.length;o++){let c=e[o];s.push(`# Solution ${o+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(`
|
|
258
258
|
`).trimEnd()}termToTurtle(e){return e instanceof Kg.IRI?`<${e.value}>`:e instanceof Qg.BlankNode?`_:${e.id}`:e instanceof zg.Literal?e.toString():`"${String(e)}"`}escapeXML(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}escapeCSV(e){return e.includes(",")||e.includes('"')||e.includes(`
|
|
259
|
-
`)?`"${e.replace(/"/g,'""')}"`:e}};Yg.ResultSerializer=IE});var Y3=w(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.FileAlreadyExistsError=ru.FileNotFoundError=void 0;var xE=class extends Error{static{a(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};ru.FileNotFoundError=xE;var RE=class extends Error{static{a(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};ru.FileAlreadyExistsError=RE});var OE=w(Rr=>{"use strict";var KW=Rr&&Rr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},QW=Rr&&Rr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.VaultSettings=Rr.DEFAULT_FLEETING_NOTE_CLASS_UID=Rr.DEFAULT_INBOX_FOLDER=Rr.DEFAULT_OWNER_IDENTITY=void 0;var YW=Be();Rr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';Rr.DEFAULT_INBOX_FOLDER="01 Inbox";Rr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var CE=class{static{a(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??Rr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??Rr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??Rr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};Rr.VaultSettings=CE;Rr.VaultSettings=CE=KW([(0,YW.injectable)(),QW("design:paramtypes",[Object])],CE)});var X3=w(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.container=void 0;ha.registerCoreServices=_H;ha.createChildContainer=SH;ha.getContainer=wH;ha.resetContainer=vH;Kb();var od=Be();Object.defineProperty(ha,"container",{enumerable:!0,get:a(function(){return od.container},"get")});var Vt=Bt(),XW=dv(),JW=pv(),ZW=sv(),eH=$1(),tH=N1(),rH=pg(),nH=gg(),iH=_g(),sH=av(),oH=rv(),aH=gv(),cH=Tv(),lH=wv(),uH=z1(),fH=Q1(),dH=uv(),hH=mE(),pH=B1(),mH=xv(),gH=Cv(),yH=Nv(),bH=OE();function _H(n){let e=n||od.container;e.registerSingleton(Vt.DI_TOKENS.DynamicFrontmatterGenerator,XW.DynamicFrontmatterGenerator),e.registerSingleton(Vt.DI_TOKENS.AlgorithmExtractor,JW.AlgorithmExtractor),e.isRegistered(Vt.DI_TOKENS.IVaultSettings)||e.register(Vt.DI_TOKENS.IVaultSettings,{useValue:new bH.VaultSettings}),e.registerSingleton(Vt.DI_TOKENS.EffortStatusWorkflow,rH.EffortStatusWorkflow),e.registerSingleton(Vt.DI_TOKENS.StatusTimestampService,nH.StatusTimestampService),e.registerSingleton(Vt.DI_TOKENS.TaskStatusService,tH.TaskStatusService),e.registerSingleton(Vt.DI_TOKENS.AreaCreationService,eH.AreaCreationService),e.registerSingleton(Vt.DI_TOKENS.ClassCreationService,uH.ClassCreationService),e.registerSingleton(Vt.DI_TOKENS.ConceptCreationService,fH.ConceptCreationService),e.registerSingleton(Vt.DI_TOKENS.SupervisionCreationService,dH.SupervisionCreationService),e.registerSingleton(Vt.DI_TOKENS.GenericAssetCreationService,gH.GenericAssetCreationService),e.registerSingleton(Vt.DI_TOKENS.PropertyCleanupService,ZW.PropertyCleanupService),e.registerSingleton(Vt.DI_TOKENS.FolderRepairService,iH.FolderRepairService),e.registerSingleton(Vt.DI_TOKENS.RenameToUidService,sH.RenameToUidService),e.registerSingleton(Vt.DI_TOKENS.PlanningService,aH.PlanningService),e.registerSingleton(Vt.DI_TOKENS.EffortVotingService,oH.EffortVotingService),e.registerSingleton(Vt.DI_TOKENS.SessionEventService,cH.SessionEventService),e.registerSingleton(Vt.DI_TOKENS.AssetConversionService,lH.AssetConversionService),e.registerSingleton(Vt.DI_TOKENS.NoteToRDFConverter,hH.NoteToRDFConverter),e.registerSingleton(Vt.DI_TOKENS.AreaHierarchyBuilder,pH.AreaHierarchyBuilder),e.registerSingleton(Vt.DI_TOKENS.URIConstructionService,mH.URIConstructionService),e.registerSingleton(Vt.DI_TOKENS.CriticalityZoneService,yH.CriticalityZoneService)}a(_H,"registerCoreServices");function SH(){return od.container.createChildContainer()}a(SH,"createChildContainer");function wH(){return od.container}a(wH,"getContainer");function vH(){od.container.reset()}a(vH,"resetContainer")});var PE=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.DEFAULT_COLORS=nu.NODE_FLAGS=void 0;nu.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};nu.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var DE=w(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.StringTable=void 0;var FE=class n{static{a(this,"StringTable")}constructor(e){if(this.stringToIndex=new Map,this.strings=[],this.memoryBytes=0,e)for(let t of e)this.intern(t)}intern(e){let t=this.stringToIndex.get(e);if(t!==void 0)return t;let r=this.strings.length;return this.strings.push(e),this.stringToIndex.set(e,r),this.memoryBytes+=e.length*2+50,r}getIndex(e){return this.stringToIndex.get(e)??-1}getString(e){if(e<0||e>=this.strings.length)throw new RangeError(`StringTable index out of bounds: ${e}`);return this.strings[e]}has(e){return this.stringToIndex.has(e)}hasIndex(e){return e>=0&&e<this.strings.length}get size(){return this.strings.length}getMemoryBytes(){return this.memoryBytes}*entries(){for(let e=0;e<this.strings.length;e++)yield[e,this.strings[e]]}*values(){for(let e of this.strings)yield e}toArray(){return[...this.strings]}clear(){this.stringToIndex.clear(),this.strings=[],this.memoryBytes=0}static fromJSON(e){return new n(e)}toJSON(){return this.strings}internAll(e){return e.map(t=>this.intern(t))}getStrings(e){return e.map(t=>this.getString(t))}search(e){let t=typeof e=="string"?new RegExp(e):e,r=[];for(let i=0;i<this.strings.length;i++)t.test(this.strings[i])&&r.push([i,this.strings[i]]);return r}getStats(){let e=this.strings.reduce((t,r)=>t+r.length,0);return{count:this.strings.length,memoryBytes:this.memoryBytes,avgStringLength:this.strings.length>0?e/this.strings.length:0}}};Xg.StringTable=FE});var J3=w(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.CompactGraphStore=void 0;var Jg=DE(),Bn=PE(),EH={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function LE(n,e){if(n===void 0)return e;if(typeof n=="number")return n;if(n.startsWith("#")){let t=n.slice(1);if(t.length===6)return parseInt(t,16)<<8|255;if(t.length===8)return parseInt(t,16)}return e}a(LE,"parseColor");var NE=class{static{a(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...EH,...e},this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity),this.uriTable=new Jg.StringTable,this.labelTable=new Jg.StringTable,this.typeTable=new Jg.StringTable,this.predicateTable=new Jg.StringTable}allocateNodeArrays(e){return{positions:new Float32Array(e*2),radii:new Float32Array(e),colors:new Uint32Array(e),types:new Uint16Array(e),flags:new Uint8Array(e)}}allocateEdgeArrays(e){return{sourceIndices:new Uint32Array(e),targetIndices:new Uint32Array(e),predicateIndices:new Uint16Array(e),widths:new Float32Array(e),colors:new Uint32Array(e)}}resizeNodeArrays(e){if(e<=this.nodeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateNodeArrays(e);t.positions.set(this.nodes.positions.subarray(0,this.nodeCount*2)),t.radii.set(this.nodes.radii.subarray(0,this.nodeCount)),t.colors.set(this.nodes.colors.subarray(0,this.nodeCount)),t.types.set(this.nodes.types.subarray(0,this.nodeCount)),t.flags.set(this.nodes.flags.subarray(0,this.nodeCount)),this.nodes=t,this.nodeCapacity=e}resizeEdgeArrays(e){if(e<=this.edgeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateEdgeArrays(e);t.sourceIndices.set(this.edges.sourceIndices.subarray(0,this.edgeCount)),t.targetIndices.set(this.edges.targetIndices.subarray(0,this.edgeCount)),t.predicateIndices.set(this.edges.predicateIndices.subarray(0,this.edgeCount)),t.widths.set(this.edges.widths.subarray(0,this.edgeCount)),t.colors.set(this.edges.colors.subarray(0,this.edgeCount)),this.edges=t,this.edgeCapacity=e}ensureNodeCapacity(e){let t=this.nodeCount+e;if(t>this.nodeCapacity){let r=Math.max(t,Math.floor(this.nodeCapacity*this.config.growthFactor));this.resizeNodeArrays(r)}}ensureEdgeCapacity(e){let t=this.edgeCount+e;if(t>this.edgeCapacity){let r=Math.max(t,Math.floor(this.edgeCapacity*this.config.growthFactor));this.resizeEdgeArrays(r)}}addNode(e){let t=this.nodeIdToIndex.get(e.id);if(t!==void 0)return this.updateNodeAt(t,e),t;this.ensureNodeCapacity(1);let r=this.nodeCount++,i=r*2;this.nodes.positions[i]=e.x??Math.random()*1e3-500,this.nodes.positions[i+1]=e.y??Math.random()*1e3-500,this.nodes.radii[r]=e.radius??8,this.nodes.colors[r]=LE(e.color,Bn.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=Bn.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=Bn.NODE_FLAGS.PINNED),e.isArchived&&(s|=Bn.NODE_FLAGS.ARCHIVED),this.nodes.flags[r]=s,this.nodeIdToIndex.set(e.id,r),this.indexToNodeId[r]=e.id,this.uriTable.intern(e.id),e.label&&this.labelTable.intern(e.label),r}updateNodeAt(e,t){let r=e*2;t.x!==void 0&&(this.nodes.positions[r]=t.x),t.y!==void 0&&(this.nodes.positions[r+1]=t.y),t.radius!==void 0&&(this.nodes.radii[e]=t.radius),t.color!==void 0&&(this.nodes.colors[e]=LE(t.color,Bn.DEFAULT_COLORS.NODE)),t.assetClass!==void 0&&(this.nodes.types[e]=this.typeTable.intern(t.assetClass));let i=this.nodes.flags[e];t.isPinned!==void 0&&(i=t.isPinned?i|Bn.NODE_FLAGS.PINNED:i&~Bn.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|Bn.NODE_FLAGS.ARCHIVED:i&~Bn.NODE_FLAGS.ARCHIVED),this.nodes.flags[e]=i}addEdge(e){let t=this.nodeIdToIndex.get(e.sourceId),r=this.nodeIdToIndex.get(e.targetId);if(t===void 0||r===void 0)return-1;let i=`${e.sourceId}->${e.targetId}:${e.predicate??"link"}`,s=this.edgeIdToIndex.get(i);if(s!==void 0)return s;this.ensureEdgeCapacity(1);let o=this.edgeCount++;return this.edges.sourceIndices[o]=t,this.edges.targetIndices[o]=r,this.edges.widths[o]=e.width??1,this.edges.colors[o]=LE(e.color,Bn.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[o]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[o]=0,this.edgeIdToIndex.set(i,o),o}addNodes(e){return this.ensureNodeCapacity(e.length),e.map(t=>this.addNode(t))}addEdges(e){return this.ensureEdgeCapacity(e.length),e.map(t=>this.addEdge(t))}loadChunk(e){let r=this.addNodes(e.nodes).filter(o=>o>=0).length,s=this.addEdges(e.edges).filter(o=>o>=0).length;return{nodesAdded:r,edgesAdded:s}}getNodePosition(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return null;let r=t*2;return{x:this.nodes.positions[r],y:this.nodes.positions[r+1]}}getNodePositionByIndex(e){let t=e*2;return{x:this.nodes.positions[t],y:this.nodes.positions[t+1]}}setNodePosition(e,t,r){let i=this.nodeIdToIndex.get(e);if(i===void 0)return!1;let s=i*2;return this.nodes.positions[s]=t,this.nodes.positions[s+1]=r,!0}setNodePositionByIndex(e,t,r){let i=e*2;this.nodes.positions[i]=t,this.nodes.positions[i+1]=r}updateNodePositions(e){let t=0;for(let[r,i]of e)this.setNodePosition(r,i.x,i.y)&&t++;return t}applyNodeUpdates(e){let t=performance.now(),r=0;for(let i of e){let s=i.index;if(!(s<0||s>=this.nodeCount)){if(i.x!==void 0||i.y!==void 0){let o=s*2;i.x!==void 0&&(this.nodes.positions[o]=i.x),i.y!==void 0&&(this.nodes.positions[o+1]=i.y)}i.radius!==void 0&&(this.nodes.radii[s]=i.radius),i.color!==void 0&&(this.nodes.colors[s]=i.color),i.setFlags!==void 0&&(this.nodes.flags[s]|=i.setFlags),i.clearFlags!==void 0&&(this.nodes.flags[s]&=~i.clearFlags),r++}}return{nodesUpdated:r,edgesUpdated:0,timeMs:performance.now()-t}}getNodeFlags(e){let t=this.nodeIdToIndex.get(e);return t===void 0?0:this.nodes.flags[t]}setNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]|=t,!0)}clearNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]&=~t,!0)}hasNodeFlag(e,t){return(this.getNodeFlags(e)&t)!==0}selectNode(e){return this.setNodeFlag(e,Bn.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,Bn.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~Bn.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&Bn.NODE_FLAGS.SELECTED&&e.push(this.indexToNodeId[t]);return e}getNodeId(e){return this.indexToNodeId[e]}getNodeIndex(e){return this.nodeIdToIndex.get(e)}hasNode(e){return this.nodeIdToIndex.has(e)}getNodeCount(){return this.nodeCount}getEdgeCount(){return this.edgeCount}getNodeEdges(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=[];for(let i=0;i<this.edgeCount;i++)this.edges.sourceIndices[i]===t?r.push({edgeIndex:i,isSource:!0}):this.edges.targetIndices[i]===t&&r.push({edgeIndex:i,isSource:!1});return r}getNeighbors(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=new Set;for(let i=0;i<this.edgeCount;i++)if(this.edges.sourceIndices[i]===t){let s=this.edges.targetIndices[i];r.add(this.indexToNodeId[s])}else if(this.edges.targetIndices[i]===t){let s=this.edges.sourceIndices[i];r.add(this.indexToNodeId[s])}return Array.from(r)}getRawArrays(){return{nodes:this.nodes,edges:this.edges,nodeCount:this.nodeCount,edgeCount:this.edgeCount}}getPositionsArray(){return this.nodes.positions.subarray(0,this.nodeCount*2)}getMemoryStats(){let e=this.nodeCapacity*2*4+this.nodeCapacity*4+this.nodeCapacity*4+this.nodeCapacity*2+this.nodeCapacity,t=this.edgeCapacity*4+this.edgeCapacity*4+this.edgeCapacity*2+this.edgeCapacity*4+this.edgeCapacity*4,r=this.uriTable.getMemoryBytes()+this.labelTable.getMemoryBytes()+this.typeTable.getMemoryBytes()+this.predicateTable.getMemoryBytes();return{nodeCount:this.nodeCount,edgeCount:this.edgeCount,nodeCapacity:this.nodeCapacity,edgeCapacity:this.edgeCapacity,nodeMemoryBytes:e,edgeMemoryBytes:t,stringTableBytes:r,totalBytes:e+t+r,internedStringCount:this.uriTable.size+this.labelTable.size+this.typeTable.size+this.predicateTable.size}}clear(){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex.clear(),this.indexToNodeId=[],this.edgeIdToIndex.clear(),this.uriTable.clear(),this.labelTable.clear(),this.typeTable.clear(),this.predicateTable.clear(),this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity)}getTypeTable(){return this.typeTable}getLabelTable(){return this.labelTable}getUriTable(){return this.uriTable}getPredicateTable(){return this.predicateTable}};Zg.CompactGraphStore=NE});var Z3=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MemoryPool=void 0;su.getGlobalPool=AH;su.resetGlobalPool=IH;var TH={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},ey=class{static{a(this,"MemoryPool")}constructor(e){this.float32Pool=new Map,this.uint32Pool=new Map,this.uint16Pool=new Map,this.uint8Pool=new Map,this.stats={poolHits:0,poolMisses:0,pooledArrays:0,pooledMemory:0,returned:0,rejected:0},this.config={...TH,...e};for(let t of this.config.sizeBuckets)this.float32Pool.set(t,[]),this.uint32Pool.set(t,[]),this.uint16Pool.set(t,[]),this.uint8Pool.set(t,[])}getBucketSize(e){for(let t of this.config.sizeBuckets)if(t>=e)return t;return e}getFloat32(e){let t=this.getBucketSize(e),r=this.float32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Float32Array(t)}getUint32(e){let t=this.getBucketSize(e),r=this.uint32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint32Array(t)}getUint16(e){let t=this.getBucketSize(e),r=this.uint16Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*2;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint16Array(t)}getUint8(e){let t=this.getBucketSize(e),r=this.uint8Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint8Array(t)}releaseFloat32(e){this.releaseToPool(this.float32Pool,e,4)}releaseUint32(e){this.releaseToPool(this.uint32Pool,e,4)}releaseUint16(e){this.releaseToPool(this.uint16Pool,e,2)}releaseUint8(e){this.releaseToPool(this.uint8Pool,e,1)}releaseToPool(e,t,r){let i=t.length,s=e.get(i);if(s&&s.length<this.config.maxPooledArrays){if(this.config.autoCleanup&&this.stats.pooledMemory+i*r>this.config.maxPoolMemory){this.stats.rejected++;return}s.push(t),this.stats.returned++,this.stats.pooledArrays++,this.stats.pooledMemory+=i*r}else this.stats.rejected++}getStats(){return{...this.stats}}getHitRatio(){let e=this.stats.poolHits+this.stats.poolMisses;return e>0?this.stats.poolHits/e:0}clear(){for(let e of this.float32Pool.values())e.length=0;for(let e of this.uint32Pool.values())e.length=0;for(let e of this.uint16Pool.values())e.length=0;for(let e of this.uint8Pool.values())e.length=0;this.stats.pooledArrays=0,this.stats.pooledMemory=0}cleanup(e){if(this.stats.pooledMemory<=e)return;let t=[...this.config.sizeBuckets].sort((r,i)=>i-r);for(let r of t){if(this.stats.pooledMemory<=e)break;for(let[i,s]of[[this.float32Pool,4],[this.uint32Pool,4],[this.uint16Pool,2],[this.uint8Pool,1]]){let o=i.get(r);if(o)for(;o.length>0&&this.stats.pooledMemory>e;)o.pop(),this.stats.pooledArrays--,this.stats.pooledMemory-=r*s}}}resetStats(){this.stats.poolHits=0,this.stats.poolMisses=0,this.stats.returned=0,this.stats.rejected=0}};su.MemoryPool=ey;var iu=null;function AH(){return iu||(iu=new ey),iu}a(AH,"getGlobalPool");function IH(){iu&&iu.clear(),iu=null}a(IH,"resetGlobalPool")});var eP=w(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.StreamingLoader=void 0;ad.createStreamingSource=RH;var xH={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},kE=class{static{a(this,"StreamingLoader")}constructor(e,t){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.progressCallbacks=[],this.abortController=null,this.store=e,this.config={...xH,...t}}getState(){return this.state}getProgress(){let e=this.totalChunks!==void 0&&this.totalChunks>0?this.chunksProcessed/this.totalChunks:0;return{currentChunk:this.chunksProcessed,totalChunks:this.totalChunks,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,progress:e,isComplete:this.state==="completed"}}onProgress(e){return this.progressCallbacks.push(e),()=>{let t=this.progressCallbacks.indexOf(e);t>=0&&this.progressCallbacks.splice(t,1)}}notifyProgress(){let e=this.getProgress();for(let t of this.progressCallbacks)t(e)}loadChunk(e){if(this.state==="error")throw new Error("Loader is in error state");this.state="loading",e.totalChunks!==void 0&&(this.totalChunks=e.totalChunks);for(let t of e.nodes)this.store.addNode(t),this.nodesLoaded++;for(let t of e.edges)this.store.addEdge(t)>=0?this.edgesLoaded++:this.pendingEdges.push(t);this.chunksProcessed++,e.isLast&&this.finishLoading(),this.notifyProgress()}finishLoading(){if(this.config.autoResolveEdges&&this.pendingEdges.length>0){for(let e of this.pendingEdges)this.store.addEdge(e)>=0&&this.edgesLoaded++;this.pendingEdges=[]}this.state="completed",this.notifyProgress()}async loadFromIterator(e){this.reset(),this.state="loading",this.abortController=new AbortController;try{for await(let r of e){if(this.abortController.signal.aborted){this.state="paused";return}this.loadChunk(r),this.config.chunkDelay>0&&await this.delay(this.config.chunkDelay)}this.state!=="completed"&&this.finishLoading()}catch(t){throw this.state="error",t}finally{this.abortController=null}}async loadFromArrays(e,t){let r=this.createChunks(e,t);await this.loadFromIterator(this.arrayToAsyncIterator(r))}createChunks(e,t){let r=[],{chunkSize:i}=this.config,s=Math.ceil(e.length/i),o=Array(s).fill(null).map(()=>[]);for(let c of t){let l=e.findIndex(u=>u.id===c.sourceId);if(l>=0){let u=Math.floor(l/i);o[u].push(c)}}for(let c=0;c<s;c++){let l=c*i,u=Math.min(l+i,e.length);r.push({chunkIndex:c,totalChunks:s,nodes:e.slice(l,u),edges:o[c],isLast:c===s-1})}return r}async*arrayToAsyncIterator(e){for(let t of e)yield t}delay(e){return new Promise(t=>setTimeout(t,e))}cancel(){this.abortController&&this.abortController.abort(),this.state="paused"}reset(){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.totalChunks=void 0,this.abortController=null}getPendingEdgeCount(){return this.pendingEdges.length}getStats(){return{state:this.state,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,chunksProcessed:this.chunksProcessed,totalChunks:this.totalChunks,pendingEdges:this.pendingEdges.length,storeStats:this.store.getMemoryStats()}}};ad.StreamingLoader=kE;async function*RH(n,e,t=1e3){let r=0,i=0,s;for(;;){let o=await e(n,r,t);if(o.totalCount!==void 0&&s===void 0&&(s=Math.ceil(o.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:o.nodes,edges:o.edges,isLast:!o.hasMore},!o.hasMore)break;r+=t,i++}}a(RH,"createStreamingSource")});var nP=w(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.createStreamingSource=ur.StreamingLoader=ur.resetGlobalPool=ur.getGlobalPool=ur.MemoryPool=ur.CompactGraphStore=ur.StringTable=ur.DEFAULT_COLORS=ur.NODE_FLAGS=void 0;var tP=PE();Object.defineProperty(ur,"NODE_FLAGS",{enumerable:!0,get:a(function(){return tP.NODE_FLAGS},"get")});Object.defineProperty(ur,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return tP.DEFAULT_COLORS},"get")});var CH=DE();Object.defineProperty(ur,"StringTable",{enumerable:!0,get:a(function(){return CH.StringTable},"get")});var OH=J3();Object.defineProperty(ur,"CompactGraphStore",{enumerable:!0,get:a(function(){return OH.CompactGraphStore},"get")});var ME=Z3();Object.defineProperty(ur,"MemoryPool",{enumerable:!0,get:a(function(){return ME.MemoryPool},"get")});Object.defineProperty(ur,"getGlobalPool",{enumerable:!0,get:a(function(){return ME.getGlobalPool},"get")});Object.defineProperty(ur,"resetGlobalPool",{enumerable:!0,get:a(function(){return ME.resetGlobalPool},"get")});var rP=eP();Object.defineProperty(ur,"StreamingLoader",{enumerable:!0,get:a(function(){return rP.StreamingLoader},"get")});Object.defineProperty(ur,"createStreamingSource",{enumerable:!0,get:a(function(){return rP.createStreamingSource},"get")})});var iP=w(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExoQLError=fr.ExoQL=fr.ExoQLBudgetExceededError=fr.ExoQLCycleError=fr.ExoQLEvalDisabledError=fr.ExoQLForbiddenKeywordError=fr.DEFAULT_EVAL_CONFIG=fr.validateExoQLAllowlist=fr.evaluateWithExoEval=void 0;var PH=yl(),FH=_l(),DH=Ul(),jE=fE(),LH=Ge(),NH=qm();Object.defineProperty(fr,"evaluateWithExoEval",{enumerable:!0,get:a(function(){return NH.evaluateWithExoEval},"get")});var kH=i1();Object.defineProperty(fr,"validateExoQLAllowlist",{enumerable:!0,get:a(function(){return kH.validateExoQLAllowlist},"get")});var MH=s1();Object.defineProperty(fr,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:a(function(){return MH.DEFAULT_EVAL_CONFIG},"get")});var ty=Uf();Object.defineProperty(fr,"ExoQLForbiddenKeywordError",{enumerable:!0,get:a(function(){return ty.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(fr,"ExoQLEvalDisabledError",{enumerable:!0,get:a(function(){return ty.ExoQLEvalDisabledError},"get")});Object.defineProperty(fr,"ExoQLCycleError",{enumerable:!0,get:a(function(){return ty.ExoQLCycleError},"get")});Object.defineProperty(fr,"ExoQLBudgetExceededError",{enumerable:!0,get:a(function(){return ty.ExoQLBudgetExceededError},"get")});var $E=class n{static{a(this,"ExoQL")}static async query(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);return s.executeAll(i)}static async ask(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isAskQuery(i))throw new cd("ExoQL.ask() requires an ASK query");return s.executeAsk(i)}static async construct(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isConstructQuery(i))throw new cd("ExoQL.construct() requires a CONSTRUCT query");return s.executeConstruct(i)}static async queryOwn(e,t,r,i){let s=await n.query(e,t,i);if(s.length===0)return[];let o=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new jE.SourceAnnotator(t).annotate(s,o,c,l)).filter(d=>{let h=d.get(jE.SOURCE_VARIABLE);return h instanceof LH.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new jE.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new PH.ExoQLParser,s=new FH.ExoQLAlgebraTranslator,o=i.parse(e),c=s.translate(o),l=new DH.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};fr.ExoQL=$E;var cd=class extends Error{static{a(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};fr.ExoQLError=cd});var ry=w(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});UE.normalizeRef=$H;var jH=no();function $H(n){if(typeof n!="string")return null;let e=jH.WikiLinkHelpers.normalize(n);return e.length>0?e:null}a($H,"normalizeRef")});var oP=w(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.LAYOUT_CLASS_UID=Xi.LAYOUT_CLASS_IRI=void 0;Xi.createLayoutFromFrontmatter=WH;Xi.isLayout=HH;Xi.isLayoutFrontmatter=KH;var UH=no(),BH=ry();Xi.LAYOUT_CLASS_IRI="exo__Layout";Xi.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function sP(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(sP,"toStringArray");function VH(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(VH,"basenameFromPath");function qH(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(qH,"parseBoolean");function GH(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);if(Number.isFinite(e))return e}return 0}a(GH,"parsePriority");function WH(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`Layout: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`Layout: exo__Asset_uid missing at ${r}`),null;let o=(0,BH.normalizeRef)(n.exo__Layout_targetClass);if(o===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=sP(n.exo__Layout_blocks),l=[];for(let p of c){let g=UH.WikiLinkHelpers.normalize(p);g.length>0&&l.push(g)}if(l.length===0)return t(`Layout ${s}: exo__Layout_blocks must contain at least one block (${r})`),null;let u=n.exo__Asset_label,f=typeof u=="string"&&u.trim().length>0?u.trim():VH(r),d=GH(n.exo__Layout_priority),h=qH(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:o,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}a(WH,"createLayoutFromFrontmatter");function HH(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||typeof e.targetClass!="string"||e.targetClass.length===0||!Array.isArray(e.blocks)||e.blocks.length===0||e.blocks.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.coexistsWithDefault!="boolean"||typeof e.sourcePath!="string")}a(HH,"isLayout");function zH(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(zH,"extractClassIdentifiers");function KH(n){if(!n)return!1;let e=sP(n.exo__Instance_class);for(let t of e)for(let r of zH(t))if(r===Xi.LAYOUT_CLASS_IRI||r===Xi.LAYOUT_CLASS_UID)return!0;return!1}a(KH,"isLayoutFrontmatter")});var lP=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Qt.PROPERTIES_BLOCK_CLASS_UID=Qt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Qt.createLayoutBlockFromFrontmatter=ez;Qt.isLayoutBlockFrontmatter=tz;Qt.isPropertiesBlock=rz;Qt.isBacklinksTableBlock=nz;var QH=no(),BE=ry();Qt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Qt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function aP(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(aP,"toStringArray");function YH(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(YH,"basenameFromPath");function cP(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(cP,"parseBoolean");function XH(n){if(typeof n=="number"&&Number.isFinite(n)&&Number.isInteger(n))return n;if(typeof n=="string"){let e=Number.parseInt(n,10);if(Number.isFinite(e))return e}return null}a(XH,"parseInteger");function JH(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(JH,"extractClassIdentifiers");function ny(n,e,t){let r=aP(n.exo__Instance_class);for(let i of r)for(let s of JH(i))if(s===e||s===t)return!0;return!1}a(ny,"classOf");function ZH(n,e){let t=e.warn??(()=>{}),r=n.exo__Asset_uid,i=typeof r=="string"?r.trim():"";if(i.length===0)return t(`LayoutBlock: exo__Asset_uid missing at ${e.sourcePath}`),null;let s=n.exo__LayoutBlock_title,o=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof o=="string"&&o.trim().length>0?o.trim():YH(e.sourcePath),l=cP(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}a(ZH,"extractBase");function ez(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=ZH(n,e);if(r===null)return null;if(ny(n,Qt.PROPERTIES_BLOCK_CLASS_IRI,Qt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(ny(n,Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let o=aP(n.exo__BacklinksTableBlock_columns),c=[];for(let p of o){let g=QH.WikiLinkHelpers.normalize(p);g.length>0&&c.push(g)}let l=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=XH(n.exo__BacklinksTableBlock_limit),h=cP(n.exo__BacklinksTableBlock_showArchived,!1);return{...r,kind:"backlinks-table",rowClass:i,referencingProperty:s,columns:c,sortBy:l,sortOrder:f,limit:d,showArchived:h}}return t(`LayoutBlock ${r.uid}: unknown block class at ${e.sourcePath} \u2014 expected exo__PropertiesBlock or exo__BacklinksTableBlock`),null}a(ez,"createLayoutBlockFromFrontmatter");function tz(n){return n?ny(n,Qt.PROPERTIES_BLOCK_CLASS_IRI,Qt.PROPERTIES_BLOCK_CLASS_UID)||ny(n,Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}a(tz,"isLayoutBlockFrontmatter");function rz(n){return n.kind==="properties"}a(rz,"isPropertiesBlock");function nz(n){return n.kind==="backlinks-table"}a(nz,"isBacklinksTableBlock")});var VE=w(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isPropertiesBlock=gt.isLayoutBlockFrontmatter=gt.isBacklinksTableBlock=gt.createLayoutBlockFromFrontmatter=gt.PROPERTIES_BLOCK_CLASS_UID=gt.PROPERTIES_BLOCK_CLASS_IRI=gt.BACKLINKS_TABLE_BLOCK_CLASS_UID=gt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=gt.isLayoutFrontmatter=gt.isLayout=gt.createLayoutFromFrontmatter=gt.LAYOUT_CLASS_UID=gt.LAYOUT_CLASS_IRI=gt.normalizeRef=void 0;var iz=ry();Object.defineProperty(gt,"normalizeRef",{enumerable:!0,get:a(function(){return iz.normalizeRef},"get")});var ld=oP();Object.defineProperty(gt,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return ld.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(gt,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return ld.LAYOUT_CLASS_UID},"get")});Object.defineProperty(gt,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return ld.createLayoutFromFrontmatter},"get")});Object.defineProperty(gt,"isLayout",{enumerable:!0,get:a(function(){return ld.isLayout},"get")});Object.defineProperty(gt,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return ld.isLayoutFrontmatter},"get")});var pa=lP();Object.defineProperty(gt,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return pa.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(gt,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return pa.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(gt,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return pa.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(gt,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return pa.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(gt,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return pa.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(gt,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return pa.isBacklinksTableBlock},"get")});Object.defineProperty(gt,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return pa.isLayoutBlockFrontmatter},"get")});Object.defineProperty(gt,"isPropertiesBlock",{enumerable:!0,get:a(function(){return pa.isPropertiesBlock},"get")})});var fP=w(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.LayoutSelector=void 0;ud.selectByPriority=uP;var sz=no(),qE=class{static{a(this,"LayoutSelector")}constructor(e){this.source=e}resolve(e){if(!Array.isArray(e)||e.length===0)return null;let t=this.source.all;if(t.length===0)return null;for(let r of e){if(typeof r!="string")continue;let i=sz.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(o=>o.targetClass===i);if(s.length!==0)return uP(s)}return null}};ud.LayoutSelector=qE;function uP(n){if(n.length===0)throw new Error("selectByPriority: expected at least one candidate");return n.length===1?n[0]:[...n].sort((t,r)=>t.priority!==r.priority?r.priority-t.priority:t.uid<r.uid?-1:t.uid>r.uid?1:0)[0]}a(uP,"selectByPriority")});var Cs=w(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.ErrorCode=void 0;var dP;(function(n){n[n.INVALID_INPUT=1e3]="INVALID_INPUT",n[n.INVALID_FORMAT=1001]="INVALID_FORMAT",n[n.MISSING_REQUIRED_FIELD=1002]="MISSING_REQUIRED_FIELD",n[n.INVALID_SCHEMA=1003]="INVALID_SCHEMA",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.REQUEST_TIMEOUT=2001]="REQUEST_TIMEOUT",n[n.CONNECTION_FAILED=2002]="CONNECTION_FAILED",n[n.FILE_READ_ERROR=2003]="FILE_READ_ERROR",n[n.FILE_WRITE_ERROR=2004]="FILE_WRITE_ERROR",n[n.INVALID_STATE=3e3]="INVALID_STATE",n[n.INVALID_TRANSITION=3001]="INVALID_TRANSITION",n[n.OPERATION_FAILED=3002]="OPERATION_FAILED",n[n.CONCURRENT_MODIFICATION=3003]="CONCURRENT_MODIFICATION",n[n.PERMISSION_DENIED=4e3]="PERMISSION_DENIED",n[n.UNAUTHORIZED=4001]="UNAUTHORIZED",n[n.FORBIDDEN=4003]="FORBIDDEN",n[n.NOT_FOUND=5e3]="NOT_FOUND",n[n.RESOURCE_EXHAUSTED=5001]="RESOURCE_EXHAUSTED",n[n.ALREADY_EXISTS=5002]="ALREADY_EXISTS",n[n.UNKNOWN_ERROR=9e3]="UNKNOWN_ERROR",n[n.INTERNAL_ERROR=9001]="INTERNAL_ERROR"})(dP||(iy.ErrorCode=dP={}))});var Os=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.ApplicationError=void 0;var GE=class extends Error{static{a(this,"ApplicationError")}constructor(e,t){super(e),this.name=this.constructor.name,this.context=t,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}format(){let e=`\u274C ${this.name}: ${this.message}`;if(this.guidance&&(e+=`
|
|
259
|
+
`)?`"${e.replace(/"/g,'""')}"`:e}};Yg.ResultSerializer=IE});var Y3=w(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.FileAlreadyExistsError=ru.FileNotFoundError=void 0;var xE=class extends Error{static{a(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};ru.FileNotFoundError=xE;var RE=class extends Error{static{a(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};ru.FileAlreadyExistsError=RE});var OE=w(Rr=>{"use strict";var KW=Rr&&Rr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;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--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},QW=Rr&&Rr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.VaultSettings=Rr.DEFAULT_FLEETING_NOTE_CLASS_UID=Rr.DEFAULT_INBOX_FOLDER=Rr.DEFAULT_OWNER_IDENTITY=void 0;var YW=Be();Rr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';Rr.DEFAULT_INBOX_FOLDER="01 Inbox";Rr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var CE=class{static{a(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??Rr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??Rr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??Rr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};Rr.VaultSettings=CE;Rr.VaultSettings=CE=KW([(0,YW.injectable)(),QW("design:paramtypes",[Object])],CE)});var X3=w(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.container=void 0;ha.registerCoreServices=_H;ha.createChildContainer=SH;ha.getContainer=wH;ha.resetContainer=vH;Kb();var od=Be();Object.defineProperty(ha,"container",{enumerable:!0,get:a(function(){return od.container},"get")});var Vt=Bt(),XW=dv(),JW=pv(),ZW=sv(),eH=$1(),tH=N1(),rH=pg(),nH=gg(),iH=_g(),sH=av(),oH=rv(),aH=gv(),cH=Tv(),lH=wv(),uH=z1(),fH=Q1(),dH=uv(),hH=mE(),pH=B1(),mH=xv(),gH=Cv(),yH=Nv(),bH=OE();function _H(n){let e=n||od.container;e.registerSingleton(Vt.DI_TOKENS.DynamicFrontmatterGenerator,XW.DynamicFrontmatterGenerator),e.registerSingleton(Vt.DI_TOKENS.AlgorithmExtractor,JW.AlgorithmExtractor),e.isRegistered(Vt.DI_TOKENS.IVaultSettings)||e.register(Vt.DI_TOKENS.IVaultSettings,{useValue:new bH.VaultSettings}),e.registerSingleton(Vt.DI_TOKENS.EffortStatusWorkflow,rH.EffortStatusWorkflow),e.registerSingleton(Vt.DI_TOKENS.StatusTimestampService,nH.StatusTimestampService),e.registerSingleton(Vt.DI_TOKENS.TaskStatusService,tH.TaskStatusService),e.registerSingleton(Vt.DI_TOKENS.AreaCreationService,eH.AreaCreationService),e.registerSingleton(Vt.DI_TOKENS.ClassCreationService,uH.ClassCreationService),e.registerSingleton(Vt.DI_TOKENS.ConceptCreationService,fH.ConceptCreationService),e.registerSingleton(Vt.DI_TOKENS.SupervisionCreationService,dH.SupervisionCreationService),e.registerSingleton(Vt.DI_TOKENS.GenericAssetCreationService,gH.GenericAssetCreationService),e.registerSingleton(Vt.DI_TOKENS.PropertyCleanupService,ZW.PropertyCleanupService),e.registerSingleton(Vt.DI_TOKENS.FolderRepairService,iH.FolderRepairService),e.registerSingleton(Vt.DI_TOKENS.RenameToUidService,sH.RenameToUidService),e.registerSingleton(Vt.DI_TOKENS.PlanningService,aH.PlanningService),e.registerSingleton(Vt.DI_TOKENS.EffortVotingService,oH.EffortVotingService),e.registerSingleton(Vt.DI_TOKENS.SessionEventService,cH.SessionEventService),e.registerSingleton(Vt.DI_TOKENS.AssetConversionService,lH.AssetConversionService),e.registerSingleton(Vt.DI_TOKENS.NoteToRDFConverter,hH.NoteToRDFConverter),e.registerSingleton(Vt.DI_TOKENS.AreaHierarchyBuilder,pH.AreaHierarchyBuilder),e.registerSingleton(Vt.DI_TOKENS.URIConstructionService,mH.URIConstructionService),e.registerSingleton(Vt.DI_TOKENS.CriticalityZoneService,yH.CriticalityZoneService)}a(_H,"registerCoreServices");function SH(){return od.container.createChildContainer()}a(SH,"createChildContainer");function wH(){return od.container}a(wH,"getContainer");function vH(){od.container.reset()}a(vH,"resetContainer")});var PE=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.DEFAULT_COLORS=nu.NODE_FLAGS=void 0;nu.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};nu.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var DE=w(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.StringTable=void 0;var FE=class n{static{a(this,"StringTable")}constructor(e){if(this.stringToIndex=new Map,this.strings=[],this.memoryBytes=0,e)for(let t of e)this.intern(t)}intern(e){let t=this.stringToIndex.get(e);if(t!==void 0)return t;let r=this.strings.length;return this.strings.push(e),this.stringToIndex.set(e,r),this.memoryBytes+=e.length*2+50,r}getIndex(e){return this.stringToIndex.get(e)??-1}getString(e){if(e<0||e>=this.strings.length)throw new RangeError(`StringTable index out of bounds: ${e}`);return this.strings[e]}has(e){return this.stringToIndex.has(e)}hasIndex(e){return e>=0&&e<this.strings.length}get size(){return this.strings.length}getMemoryBytes(){return this.memoryBytes}*entries(){for(let e=0;e<this.strings.length;e++)yield[e,this.strings[e]]}*values(){for(let e of this.strings)yield e}toArray(){return[...this.strings]}clear(){this.stringToIndex.clear(),this.strings=[],this.memoryBytes=0}static fromJSON(e){return new n(e)}toJSON(){return this.strings}internAll(e){return e.map(t=>this.intern(t))}getStrings(e){return e.map(t=>this.getString(t))}search(e){let t=typeof e=="string"?new RegExp(e):e,r=[];for(let i=0;i<this.strings.length;i++)t.test(this.strings[i])&&r.push([i,this.strings[i]]);return r}getStats(){let e=this.strings.reduce((t,r)=>t+r.length,0);return{count:this.strings.length,memoryBytes:this.memoryBytes,avgStringLength:this.strings.length>0?e/this.strings.length:0}}};Xg.StringTable=FE});var J3=w(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.CompactGraphStore=void 0;var Jg=DE(),Vn=PE(),EH={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function LE(n,e){if(n===void 0)return e;if(typeof n=="number")return n;if(n.startsWith("#")){let t=n.slice(1);if(t.length===6)return parseInt(t,16)<<8|255;if(t.length===8)return parseInt(t,16)}return e}a(LE,"parseColor");var NE=class{static{a(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...EH,...e},this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity),this.uriTable=new Jg.StringTable,this.labelTable=new Jg.StringTable,this.typeTable=new Jg.StringTable,this.predicateTable=new Jg.StringTable}allocateNodeArrays(e){return{positions:new Float32Array(e*2),radii:new Float32Array(e),colors:new Uint32Array(e),types:new Uint16Array(e),flags:new Uint8Array(e)}}allocateEdgeArrays(e){return{sourceIndices:new Uint32Array(e),targetIndices:new Uint32Array(e),predicateIndices:new Uint16Array(e),widths:new Float32Array(e),colors:new Uint32Array(e)}}resizeNodeArrays(e){if(e<=this.nodeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateNodeArrays(e);t.positions.set(this.nodes.positions.subarray(0,this.nodeCount*2)),t.radii.set(this.nodes.radii.subarray(0,this.nodeCount)),t.colors.set(this.nodes.colors.subarray(0,this.nodeCount)),t.types.set(this.nodes.types.subarray(0,this.nodeCount)),t.flags.set(this.nodes.flags.subarray(0,this.nodeCount)),this.nodes=t,this.nodeCapacity=e}resizeEdgeArrays(e){if(e<=this.edgeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateEdgeArrays(e);t.sourceIndices.set(this.edges.sourceIndices.subarray(0,this.edgeCount)),t.targetIndices.set(this.edges.targetIndices.subarray(0,this.edgeCount)),t.predicateIndices.set(this.edges.predicateIndices.subarray(0,this.edgeCount)),t.widths.set(this.edges.widths.subarray(0,this.edgeCount)),t.colors.set(this.edges.colors.subarray(0,this.edgeCount)),this.edges=t,this.edgeCapacity=e}ensureNodeCapacity(e){let t=this.nodeCount+e;if(t>this.nodeCapacity){let r=Math.max(t,Math.floor(this.nodeCapacity*this.config.growthFactor));this.resizeNodeArrays(r)}}ensureEdgeCapacity(e){let t=this.edgeCount+e;if(t>this.edgeCapacity){let r=Math.max(t,Math.floor(this.edgeCapacity*this.config.growthFactor));this.resizeEdgeArrays(r)}}addNode(e){let t=this.nodeIdToIndex.get(e.id);if(t!==void 0)return this.updateNodeAt(t,e),t;this.ensureNodeCapacity(1);let r=this.nodeCount++,i=r*2;this.nodes.positions[i]=e.x??Math.random()*1e3-500,this.nodes.positions[i+1]=e.y??Math.random()*1e3-500,this.nodes.radii[r]=e.radius??8,this.nodes.colors[r]=LE(e.color,Vn.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=Vn.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=Vn.NODE_FLAGS.PINNED),e.isArchived&&(s|=Vn.NODE_FLAGS.ARCHIVED),this.nodes.flags[r]=s,this.nodeIdToIndex.set(e.id,r),this.indexToNodeId[r]=e.id,this.uriTable.intern(e.id),e.label&&this.labelTable.intern(e.label),r}updateNodeAt(e,t){let r=e*2;t.x!==void 0&&(this.nodes.positions[r]=t.x),t.y!==void 0&&(this.nodes.positions[r+1]=t.y),t.radius!==void 0&&(this.nodes.radii[e]=t.radius),t.color!==void 0&&(this.nodes.colors[e]=LE(t.color,Vn.DEFAULT_COLORS.NODE)),t.assetClass!==void 0&&(this.nodes.types[e]=this.typeTable.intern(t.assetClass));let i=this.nodes.flags[e];t.isPinned!==void 0&&(i=t.isPinned?i|Vn.NODE_FLAGS.PINNED:i&~Vn.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|Vn.NODE_FLAGS.ARCHIVED:i&~Vn.NODE_FLAGS.ARCHIVED),this.nodes.flags[e]=i}addEdge(e){let t=this.nodeIdToIndex.get(e.sourceId),r=this.nodeIdToIndex.get(e.targetId);if(t===void 0||r===void 0)return-1;let i=`${e.sourceId}->${e.targetId}:${e.predicate??"link"}`,s=this.edgeIdToIndex.get(i);if(s!==void 0)return s;this.ensureEdgeCapacity(1);let o=this.edgeCount++;return this.edges.sourceIndices[o]=t,this.edges.targetIndices[o]=r,this.edges.widths[o]=e.width??1,this.edges.colors[o]=LE(e.color,Vn.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[o]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[o]=0,this.edgeIdToIndex.set(i,o),o}addNodes(e){return this.ensureNodeCapacity(e.length),e.map(t=>this.addNode(t))}addEdges(e){return this.ensureEdgeCapacity(e.length),e.map(t=>this.addEdge(t))}loadChunk(e){let r=this.addNodes(e.nodes).filter(o=>o>=0).length,s=this.addEdges(e.edges).filter(o=>o>=0).length;return{nodesAdded:r,edgesAdded:s}}getNodePosition(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return null;let r=t*2;return{x:this.nodes.positions[r],y:this.nodes.positions[r+1]}}getNodePositionByIndex(e){let t=e*2;return{x:this.nodes.positions[t],y:this.nodes.positions[t+1]}}setNodePosition(e,t,r){let i=this.nodeIdToIndex.get(e);if(i===void 0)return!1;let s=i*2;return this.nodes.positions[s]=t,this.nodes.positions[s+1]=r,!0}setNodePositionByIndex(e,t,r){let i=e*2;this.nodes.positions[i]=t,this.nodes.positions[i+1]=r}updateNodePositions(e){let t=0;for(let[r,i]of e)this.setNodePosition(r,i.x,i.y)&&t++;return t}applyNodeUpdates(e){let t=performance.now(),r=0;for(let i of e){let s=i.index;if(!(s<0||s>=this.nodeCount)){if(i.x!==void 0||i.y!==void 0){let o=s*2;i.x!==void 0&&(this.nodes.positions[o]=i.x),i.y!==void 0&&(this.nodes.positions[o+1]=i.y)}i.radius!==void 0&&(this.nodes.radii[s]=i.radius),i.color!==void 0&&(this.nodes.colors[s]=i.color),i.setFlags!==void 0&&(this.nodes.flags[s]|=i.setFlags),i.clearFlags!==void 0&&(this.nodes.flags[s]&=~i.clearFlags),r++}}return{nodesUpdated:r,edgesUpdated:0,timeMs:performance.now()-t}}getNodeFlags(e){let t=this.nodeIdToIndex.get(e);return t===void 0?0:this.nodes.flags[t]}setNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]|=t,!0)}clearNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]&=~t,!0)}hasNodeFlag(e,t){return(this.getNodeFlags(e)&t)!==0}selectNode(e){return this.setNodeFlag(e,Vn.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,Vn.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~Vn.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&Vn.NODE_FLAGS.SELECTED&&e.push(this.indexToNodeId[t]);return e}getNodeId(e){return this.indexToNodeId[e]}getNodeIndex(e){return this.nodeIdToIndex.get(e)}hasNode(e){return this.nodeIdToIndex.has(e)}getNodeCount(){return this.nodeCount}getEdgeCount(){return this.edgeCount}getNodeEdges(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=[];for(let i=0;i<this.edgeCount;i++)this.edges.sourceIndices[i]===t?r.push({edgeIndex:i,isSource:!0}):this.edges.targetIndices[i]===t&&r.push({edgeIndex:i,isSource:!1});return r}getNeighbors(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=new Set;for(let i=0;i<this.edgeCount;i++)if(this.edges.sourceIndices[i]===t){let s=this.edges.targetIndices[i];r.add(this.indexToNodeId[s])}else if(this.edges.targetIndices[i]===t){let s=this.edges.sourceIndices[i];r.add(this.indexToNodeId[s])}return Array.from(r)}getRawArrays(){return{nodes:this.nodes,edges:this.edges,nodeCount:this.nodeCount,edgeCount:this.edgeCount}}getPositionsArray(){return this.nodes.positions.subarray(0,this.nodeCount*2)}getMemoryStats(){let e=this.nodeCapacity*2*4+this.nodeCapacity*4+this.nodeCapacity*4+this.nodeCapacity*2+this.nodeCapacity,t=this.edgeCapacity*4+this.edgeCapacity*4+this.edgeCapacity*2+this.edgeCapacity*4+this.edgeCapacity*4,r=this.uriTable.getMemoryBytes()+this.labelTable.getMemoryBytes()+this.typeTable.getMemoryBytes()+this.predicateTable.getMemoryBytes();return{nodeCount:this.nodeCount,edgeCount:this.edgeCount,nodeCapacity:this.nodeCapacity,edgeCapacity:this.edgeCapacity,nodeMemoryBytes:e,edgeMemoryBytes:t,stringTableBytes:r,totalBytes:e+t+r,internedStringCount:this.uriTable.size+this.labelTable.size+this.typeTable.size+this.predicateTable.size}}clear(){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex.clear(),this.indexToNodeId=[],this.edgeIdToIndex.clear(),this.uriTable.clear(),this.labelTable.clear(),this.typeTable.clear(),this.predicateTable.clear(),this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity)}getTypeTable(){return this.typeTable}getLabelTable(){return this.labelTable}getUriTable(){return this.uriTable}getPredicateTable(){return this.predicateTable}};Zg.CompactGraphStore=NE});var Z3=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MemoryPool=void 0;su.getGlobalPool=AH;su.resetGlobalPool=IH;var TH={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},ey=class{static{a(this,"MemoryPool")}constructor(e){this.float32Pool=new Map,this.uint32Pool=new Map,this.uint16Pool=new Map,this.uint8Pool=new Map,this.stats={poolHits:0,poolMisses:0,pooledArrays:0,pooledMemory:0,returned:0,rejected:0},this.config={...TH,...e};for(let t of this.config.sizeBuckets)this.float32Pool.set(t,[]),this.uint32Pool.set(t,[]),this.uint16Pool.set(t,[]),this.uint8Pool.set(t,[])}getBucketSize(e){for(let t of this.config.sizeBuckets)if(t>=e)return t;return e}getFloat32(e){let t=this.getBucketSize(e),r=this.float32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Float32Array(t)}getUint32(e){let t=this.getBucketSize(e),r=this.uint32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint32Array(t)}getUint16(e){let t=this.getBucketSize(e),r=this.uint16Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*2;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint16Array(t)}getUint8(e){let t=this.getBucketSize(e),r=this.uint8Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint8Array(t)}releaseFloat32(e){this.releaseToPool(this.float32Pool,e,4)}releaseUint32(e){this.releaseToPool(this.uint32Pool,e,4)}releaseUint16(e){this.releaseToPool(this.uint16Pool,e,2)}releaseUint8(e){this.releaseToPool(this.uint8Pool,e,1)}releaseToPool(e,t,r){let i=t.length,s=e.get(i);if(s&&s.length<this.config.maxPooledArrays){if(this.config.autoCleanup&&this.stats.pooledMemory+i*r>this.config.maxPoolMemory){this.stats.rejected++;return}s.push(t),this.stats.returned++,this.stats.pooledArrays++,this.stats.pooledMemory+=i*r}else this.stats.rejected++}getStats(){return{...this.stats}}getHitRatio(){let e=this.stats.poolHits+this.stats.poolMisses;return e>0?this.stats.poolHits/e:0}clear(){for(let e of this.float32Pool.values())e.length=0;for(let e of this.uint32Pool.values())e.length=0;for(let e of this.uint16Pool.values())e.length=0;for(let e of this.uint8Pool.values())e.length=0;this.stats.pooledArrays=0,this.stats.pooledMemory=0}cleanup(e){if(this.stats.pooledMemory<=e)return;let t=[...this.config.sizeBuckets].sort((r,i)=>i-r);for(let r of t){if(this.stats.pooledMemory<=e)break;for(let[i,s]of[[this.float32Pool,4],[this.uint32Pool,4],[this.uint16Pool,2],[this.uint8Pool,1]]){let o=i.get(r);if(o)for(;o.length>0&&this.stats.pooledMemory>e;)o.pop(),this.stats.pooledArrays--,this.stats.pooledMemory-=r*s}}}resetStats(){this.stats.poolHits=0,this.stats.poolMisses=0,this.stats.returned=0,this.stats.rejected=0}};su.MemoryPool=ey;var iu=null;function AH(){return iu||(iu=new ey),iu}a(AH,"getGlobalPool");function IH(){iu&&iu.clear(),iu=null}a(IH,"resetGlobalPool")});var eP=w(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.StreamingLoader=void 0;ad.createStreamingSource=RH;var xH={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},kE=class{static{a(this,"StreamingLoader")}constructor(e,t){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.progressCallbacks=[],this.abortController=null,this.store=e,this.config={...xH,...t}}getState(){return this.state}getProgress(){let e=this.totalChunks!==void 0&&this.totalChunks>0?this.chunksProcessed/this.totalChunks:0;return{currentChunk:this.chunksProcessed,totalChunks:this.totalChunks,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,progress:e,isComplete:this.state==="completed"}}onProgress(e){return this.progressCallbacks.push(e),()=>{let t=this.progressCallbacks.indexOf(e);t>=0&&this.progressCallbacks.splice(t,1)}}notifyProgress(){let e=this.getProgress();for(let t of this.progressCallbacks)t(e)}loadChunk(e){if(this.state==="error")throw new Error("Loader is in error state");this.state="loading",e.totalChunks!==void 0&&(this.totalChunks=e.totalChunks);for(let t of e.nodes)this.store.addNode(t),this.nodesLoaded++;for(let t of e.edges)this.store.addEdge(t)>=0?this.edgesLoaded++:this.pendingEdges.push(t);this.chunksProcessed++,e.isLast&&this.finishLoading(),this.notifyProgress()}finishLoading(){if(this.config.autoResolveEdges&&this.pendingEdges.length>0){for(let e of this.pendingEdges)this.store.addEdge(e)>=0&&this.edgesLoaded++;this.pendingEdges=[]}this.state="completed",this.notifyProgress()}async loadFromIterator(e){this.reset(),this.state="loading",this.abortController=new AbortController;try{for await(let r of e){if(this.abortController.signal.aborted){this.state="paused";return}this.loadChunk(r),this.config.chunkDelay>0&&await this.delay(this.config.chunkDelay)}this.state!=="completed"&&this.finishLoading()}catch(t){throw this.state="error",t}finally{this.abortController=null}}async loadFromArrays(e,t){let r=this.createChunks(e,t);await this.loadFromIterator(this.arrayToAsyncIterator(r))}createChunks(e,t){let r=[],{chunkSize:i}=this.config,s=Math.ceil(e.length/i),o=Array(s).fill(null).map(()=>[]);for(let c of t){let l=e.findIndex(u=>u.id===c.sourceId);if(l>=0){let u=Math.floor(l/i);o[u].push(c)}}for(let c=0;c<s;c++){let l=c*i,u=Math.min(l+i,e.length);r.push({chunkIndex:c,totalChunks:s,nodes:e.slice(l,u),edges:o[c],isLast:c===s-1})}return r}async*arrayToAsyncIterator(e){for(let t of e)yield t}delay(e){return new Promise(t=>setTimeout(t,e))}cancel(){this.abortController&&this.abortController.abort(),this.state="paused"}reset(){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.totalChunks=void 0,this.abortController=null}getPendingEdgeCount(){return this.pendingEdges.length}getStats(){return{state:this.state,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,chunksProcessed:this.chunksProcessed,totalChunks:this.totalChunks,pendingEdges:this.pendingEdges.length,storeStats:this.store.getMemoryStats()}}};ad.StreamingLoader=kE;async function*RH(n,e,t=1e3){let r=0,i=0,s;for(;;){let o=await e(n,r,t);if(o.totalCount!==void 0&&s===void 0&&(s=Math.ceil(o.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:o.nodes,edges:o.edges,isLast:!o.hasMore},!o.hasMore)break;r+=t,i++}}a(RH,"createStreamingSource")});var nP=w(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.createStreamingSource=ur.StreamingLoader=ur.resetGlobalPool=ur.getGlobalPool=ur.MemoryPool=ur.CompactGraphStore=ur.StringTable=ur.DEFAULT_COLORS=ur.NODE_FLAGS=void 0;var tP=PE();Object.defineProperty(ur,"NODE_FLAGS",{enumerable:!0,get:a(function(){return tP.NODE_FLAGS},"get")});Object.defineProperty(ur,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return tP.DEFAULT_COLORS},"get")});var CH=DE();Object.defineProperty(ur,"StringTable",{enumerable:!0,get:a(function(){return CH.StringTable},"get")});var OH=J3();Object.defineProperty(ur,"CompactGraphStore",{enumerable:!0,get:a(function(){return OH.CompactGraphStore},"get")});var ME=Z3();Object.defineProperty(ur,"MemoryPool",{enumerable:!0,get:a(function(){return ME.MemoryPool},"get")});Object.defineProperty(ur,"getGlobalPool",{enumerable:!0,get:a(function(){return ME.getGlobalPool},"get")});Object.defineProperty(ur,"resetGlobalPool",{enumerable:!0,get:a(function(){return ME.resetGlobalPool},"get")});var rP=eP();Object.defineProperty(ur,"StreamingLoader",{enumerable:!0,get:a(function(){return rP.StreamingLoader},"get")});Object.defineProperty(ur,"createStreamingSource",{enumerable:!0,get:a(function(){return rP.createStreamingSource},"get")})});var iP=w(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExoQLError=fr.ExoQL=fr.ExoQLBudgetExceededError=fr.ExoQLCycleError=fr.ExoQLEvalDisabledError=fr.ExoQLForbiddenKeywordError=fr.DEFAULT_EVAL_CONFIG=fr.validateExoQLAllowlist=fr.evaluateWithExoEval=void 0;var PH=yl(),FH=_l(),DH=Ul(),jE=fE(),LH=Ge(),NH=qm();Object.defineProperty(fr,"evaluateWithExoEval",{enumerable:!0,get:a(function(){return NH.evaluateWithExoEval},"get")});var kH=i1();Object.defineProperty(fr,"validateExoQLAllowlist",{enumerable:!0,get:a(function(){return kH.validateExoQLAllowlist},"get")});var MH=s1();Object.defineProperty(fr,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:a(function(){return MH.DEFAULT_EVAL_CONFIG},"get")});var ty=Uf();Object.defineProperty(fr,"ExoQLForbiddenKeywordError",{enumerable:!0,get:a(function(){return ty.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(fr,"ExoQLEvalDisabledError",{enumerable:!0,get:a(function(){return ty.ExoQLEvalDisabledError},"get")});Object.defineProperty(fr,"ExoQLCycleError",{enumerable:!0,get:a(function(){return ty.ExoQLCycleError},"get")});Object.defineProperty(fr,"ExoQLBudgetExceededError",{enumerable:!0,get:a(function(){return ty.ExoQLBudgetExceededError},"get")});var $E=class n{static{a(this,"ExoQL")}static async query(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);return s.executeAll(i)}static async ask(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isAskQuery(i))throw new cd("ExoQL.ask() requires an ASK query");return s.executeAsk(i)}static async construct(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isConstructQuery(i))throw new cd("ExoQL.construct() requires a CONSTRUCT query");return s.executeConstruct(i)}static async queryOwn(e,t,r,i){let s=await n.query(e,t,i);if(s.length===0)return[];let o=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new jE.SourceAnnotator(t).annotate(s,o,c,l)).filter(d=>{let h=d.get(jE.SOURCE_VARIABLE);return h instanceof LH.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new jE.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new PH.ExoQLParser,s=new FH.ExoQLAlgebraTranslator,o=i.parse(e),c=s.translate(o),l=new DH.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};fr.ExoQL=$E;var cd=class extends Error{static{a(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};fr.ExoQLError=cd});var ry=w(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});UE.normalizeRef=$H;var jH=no();function $H(n){if(typeof n!="string")return null;let e=jH.WikiLinkHelpers.normalize(n);return e.length>0?e:null}a($H,"normalizeRef")});var oP=w(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.LAYOUT_CLASS_UID=Xi.LAYOUT_CLASS_IRI=void 0;Xi.createLayoutFromFrontmatter=WH;Xi.isLayout=HH;Xi.isLayoutFrontmatter=KH;var UH=no(),BH=ry();Xi.LAYOUT_CLASS_IRI="exo__Layout";Xi.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function sP(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(sP,"toStringArray");function VH(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(VH,"basenameFromPath");function qH(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(qH,"parseBoolean");function GH(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);if(Number.isFinite(e))return e}return 0}a(GH,"parsePriority");function WH(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`Layout: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`Layout: exo__Asset_uid missing at ${r}`),null;let o=(0,BH.normalizeRef)(n.exo__Layout_targetClass);if(o===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=sP(n.exo__Layout_blocks),l=[];for(let p of c){let g=UH.WikiLinkHelpers.normalize(p);g.length>0&&l.push(g)}if(l.length===0)return t(`Layout ${s}: exo__Layout_blocks must contain at least one block (${r})`),null;let u=n.exo__Asset_label,f=typeof u=="string"&&u.trim().length>0?u.trim():VH(r),d=GH(n.exo__Layout_priority),h=qH(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:o,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}a(WH,"createLayoutFromFrontmatter");function HH(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||typeof e.targetClass!="string"||e.targetClass.length===0||!Array.isArray(e.blocks)||e.blocks.length===0||e.blocks.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.coexistsWithDefault!="boolean"||typeof e.sourcePath!="string")}a(HH,"isLayout");function zH(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(zH,"extractClassIdentifiers");function KH(n){if(!n)return!1;let e=sP(n.exo__Instance_class);for(let t of e)for(let r of zH(t))if(r===Xi.LAYOUT_CLASS_IRI||r===Xi.LAYOUT_CLASS_UID)return!0;return!1}a(KH,"isLayoutFrontmatter")});var lP=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Qt.PROPERTIES_BLOCK_CLASS_UID=Qt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Qt.createLayoutBlockFromFrontmatter=ez;Qt.isLayoutBlockFrontmatter=tz;Qt.isPropertiesBlock=rz;Qt.isBacklinksTableBlock=nz;var QH=no(),BE=ry();Qt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Qt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function aP(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(aP,"toStringArray");function YH(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(YH,"basenameFromPath");function cP(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(cP,"parseBoolean");function XH(n){if(typeof n=="number"&&Number.isFinite(n)&&Number.isInteger(n))return n;if(typeof n=="string"){let e=Number.parseInt(n,10);if(Number.isFinite(e))return e}return null}a(XH,"parseInteger");function JH(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(JH,"extractClassIdentifiers");function ny(n,e,t){let r=aP(n.exo__Instance_class);for(let i of r)for(let s of JH(i))if(s===e||s===t)return!0;return!1}a(ny,"classOf");function ZH(n,e){let t=e.warn??(()=>{}),r=n.exo__Asset_uid,i=typeof r=="string"?r.trim():"";if(i.length===0)return t(`LayoutBlock: exo__Asset_uid missing at ${e.sourcePath}`),null;let s=n.exo__LayoutBlock_title,o=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof o=="string"&&o.trim().length>0?o.trim():YH(e.sourcePath),l=cP(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}a(ZH,"extractBase");function ez(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=ZH(n,e);if(r===null)return null;if(ny(n,Qt.PROPERTIES_BLOCK_CLASS_IRI,Qt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(ny(n,Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let o=aP(n.exo__BacklinksTableBlock_columns),c=[];for(let p of o){let g=QH.WikiLinkHelpers.normalize(p);g.length>0&&c.push(g)}let l=(0,BE.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=XH(n.exo__BacklinksTableBlock_limit),h=cP(n.exo__BacklinksTableBlock_showArchived,!1);return{...r,kind:"backlinks-table",rowClass:i,referencingProperty:s,columns:c,sortBy:l,sortOrder:f,limit:d,showArchived:h}}return t(`LayoutBlock ${r.uid}: unknown block class at ${e.sourcePath} \u2014 expected exo__PropertiesBlock or exo__BacklinksTableBlock`),null}a(ez,"createLayoutBlockFromFrontmatter");function tz(n){return n?ny(n,Qt.PROPERTIES_BLOCK_CLASS_IRI,Qt.PROPERTIES_BLOCK_CLASS_UID)||ny(n,Qt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Qt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}a(tz,"isLayoutBlockFrontmatter");function rz(n){return n.kind==="properties"}a(rz,"isPropertiesBlock");function nz(n){return n.kind==="backlinks-table"}a(nz,"isBacklinksTableBlock")});var VE=w(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isPropertiesBlock=gt.isLayoutBlockFrontmatter=gt.isBacklinksTableBlock=gt.createLayoutBlockFromFrontmatter=gt.PROPERTIES_BLOCK_CLASS_UID=gt.PROPERTIES_BLOCK_CLASS_IRI=gt.BACKLINKS_TABLE_BLOCK_CLASS_UID=gt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=gt.isLayoutFrontmatter=gt.isLayout=gt.createLayoutFromFrontmatter=gt.LAYOUT_CLASS_UID=gt.LAYOUT_CLASS_IRI=gt.normalizeRef=void 0;var iz=ry();Object.defineProperty(gt,"normalizeRef",{enumerable:!0,get:a(function(){return iz.normalizeRef},"get")});var ld=oP();Object.defineProperty(gt,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return ld.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(gt,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return ld.LAYOUT_CLASS_UID},"get")});Object.defineProperty(gt,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return ld.createLayoutFromFrontmatter},"get")});Object.defineProperty(gt,"isLayout",{enumerable:!0,get:a(function(){return ld.isLayout},"get")});Object.defineProperty(gt,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return ld.isLayoutFrontmatter},"get")});var pa=lP();Object.defineProperty(gt,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return pa.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(gt,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return pa.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(gt,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return pa.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(gt,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return pa.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(gt,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return pa.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(gt,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return pa.isBacklinksTableBlock},"get")});Object.defineProperty(gt,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return pa.isLayoutBlockFrontmatter},"get")});Object.defineProperty(gt,"isPropertiesBlock",{enumerable:!0,get:a(function(){return pa.isPropertiesBlock},"get")})});var fP=w(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.LayoutSelector=void 0;ud.selectByPriority=uP;var sz=no(),qE=class{static{a(this,"LayoutSelector")}constructor(e){this.source=e}resolve(e){if(!Array.isArray(e)||e.length===0)return null;let t=this.source.all;if(t.length===0)return null;for(let r of e){if(typeof r!="string")continue;let i=sz.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(o=>o.targetClass===i);if(s.length!==0)return uP(s)}return null}};ud.LayoutSelector=qE;function uP(n){if(n.length===0)throw new Error("selectByPriority: expected at least one candidate");return n.length===1?n[0]:[...n].sort((t,r)=>t.priority!==r.priority?r.priority-t.priority:t.uid<r.uid?-1:t.uid>r.uid?1:0)[0]}a(uP,"selectByPriority")});var Cs=w(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.ErrorCode=void 0;var dP;(function(n){n[n.INVALID_INPUT=1e3]="INVALID_INPUT",n[n.INVALID_FORMAT=1001]="INVALID_FORMAT",n[n.MISSING_REQUIRED_FIELD=1002]="MISSING_REQUIRED_FIELD",n[n.INVALID_SCHEMA=1003]="INVALID_SCHEMA",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.REQUEST_TIMEOUT=2001]="REQUEST_TIMEOUT",n[n.CONNECTION_FAILED=2002]="CONNECTION_FAILED",n[n.FILE_READ_ERROR=2003]="FILE_READ_ERROR",n[n.FILE_WRITE_ERROR=2004]="FILE_WRITE_ERROR",n[n.INVALID_STATE=3e3]="INVALID_STATE",n[n.INVALID_TRANSITION=3001]="INVALID_TRANSITION",n[n.OPERATION_FAILED=3002]="OPERATION_FAILED",n[n.CONCURRENT_MODIFICATION=3003]="CONCURRENT_MODIFICATION",n[n.PERMISSION_DENIED=4e3]="PERMISSION_DENIED",n[n.UNAUTHORIZED=4001]="UNAUTHORIZED",n[n.FORBIDDEN=4003]="FORBIDDEN",n[n.NOT_FOUND=5e3]="NOT_FOUND",n[n.RESOURCE_EXHAUSTED=5001]="RESOURCE_EXHAUSTED",n[n.ALREADY_EXISTS=5002]="ALREADY_EXISTS",n[n.UNKNOWN_ERROR=9e3]="UNKNOWN_ERROR",n[n.INTERNAL_ERROR=9001]="INTERNAL_ERROR"})(dP||(iy.ErrorCode=dP={}))});var Os=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.ApplicationError=void 0;var GE=class extends Error{static{a(this,"ApplicationError")}constructor(e,t){super(e),this.name=this.constructor.name,this.context=t,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}format(){let e=`\u274C ${this.name}: ${this.message}`;if(this.guidance&&(e+=`
|
|
260
260
|
|
|
261
261
|
\u{1F4A1} ${this.guidance}`),this.context&&Object.keys(this.context).length>0){e+=`
|
|
262
262
|
|
|
@@ -299,7 +299,7 @@ To resolve:
|
|
|
299
299
|
\u2022 Review service logs for detailed error information
|
|
300
300
|
\u2022 Contact support if the issue persists`}};dy.ServiceError=XE});var SP=w(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.ServiceError=dr.ResourceExhaustedError=dr.NotFoundError=dr.PermissionError=dr.StateTransitionError=dr.NetworkError=dr.ValidationError=dr.ApplicationError=dr.ErrorCode=void 0;var Sz=Cs();Object.defineProperty(dr,"ErrorCode",{enumerable:!0,get:a(function(){return Sz.ErrorCode},"get")});var wz=Os();Object.defineProperty(dr,"ApplicationError",{enumerable:!0,get:a(function(){return wz.ApplicationError},"get")});var vz=hP();Object.defineProperty(dr,"ValidationError",{enumerable:!0,get:a(function(){return vz.ValidationError},"get")});var Ez=pP();Object.defineProperty(dr,"NetworkError",{enumerable:!0,get:a(function(){return Ez.NetworkError},"get")});var Tz=mP();Object.defineProperty(dr,"StateTransitionError",{enumerable:!0,get:a(function(){return Tz.StateTransitionError},"get")});var Az=gP();Object.defineProperty(dr,"PermissionError",{enumerable:!0,get:a(function(){return Az.PermissionError},"get")});var Iz=yP();Object.defineProperty(dr,"NotFoundError",{enumerable:!0,get:a(function(){return Iz.NotFoundError},"get")});var xz=bP();Object.defineProperty(dr,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return xz.ResourceExhaustedError},"get")});var Rz=_P();Object.defineProperty(dr,"ServiceError",{enumerable:!0,get:a(function(){return Rz.ServiceError},"get")})});var ZE=w(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.ShapeRegistry=void 0;var JE=class{static{a(this,"ShapeRegistry")}constructor(){this.shapes=new Map}get(e){return this.shapes.get(e)}register(e){this.shapes.set(e.propertyIRI,e)}getAll(){return Array.from(this.shapes.values())}get size(){return this.shapes.size}};hy.ShapeRegistry=JE});var wP=w(Ps=>{"use strict";var Cz=Ps&&Ps.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Oz=Ps&&Ps.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),eT=Ps&&Ps.__importStar||(function(){var n=a(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"&&Cz(t,e,r[i]);return Oz(t,e),t}})();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.ShapeLoader=void 0;var tT=ZE(),ma=Oe(),ou=Ge(),Cr=zt(),py="http://www.w3.org/ns/shacl#",Pz="http://www.w3.org/2001/XMLSchema#",c0e=[["exo__",Cr.Namespace.EXO],["ems__",Cr.Namespace.EMS],["exocmd__",Cr.Namespace.EXOCMD],["ims__",Cr.Namespace.IMS],["ztlk__",Cr.Namespace.ZTLK],["ptms__",Cr.Namespace.PTMS],["lit__",Cr.Namespace.LIT],["inbox__",Cr.Namespace.INBOX],["pmbok__",Cr.Namespace.PMBOK]],au=class n{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:r}=await Promise.resolve().then(()=>eT(require("fs/promises"))),i=await Promise.resolve().then(()=>eT(require("path"))),s=new tT.ShapeRegistry;return await n.scanDir(e,s,{readdir:t,readFile:r,path:i}),s}static async loadFromRDFGraph(e){let t=new tT.ShapeRegistry,r=Cr.Namespace.EXO,i=Cr.Namespace.RDFS,s=Cr.Namespace.RDF,o=await n.buildUidClassIndex(e),[c,l]=await Promise.all([e.match(void 0,s.term("type"),r.term("ObjectProperty")),e.match(void 0,s.term("type"),r.term("Property"))]),u=new Set;for(let f of[...c,...l])f.subject instanceof ma.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new ma.IRI(f)}catch{continue}let[h,p,g,y,b,S,v,I,A]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,r.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,r.term("Property_range"),void 0),e.match(d,r.term("Property_cardinality"),void 0),e.match(d,r.term("Property_severity"),void 0),e.match(d,r.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,r.term("Property_minCount"),void 0)]),T=[...v,...I],R=[...h,...p],B=[...g,...y];if(R.length===0)continue;let L=null;for(let k of T)if(k.object instanceof ou.Literal&&(L=n.labelToIRI(k.object.value),L))break;if(!L)continue;let P=await Promise.all(R.map(async k=>k.object instanceof ma.IRI?await n.resolveClassIRI(k.object.value,e,o):null)),M=Array.from(new Set(P.filter(k=>k!==null))),O=await Promise.all(B.map(async k=>{if(k.object instanceof ma.IRI)return await n.resolveClassIRI(k.object.value,e,o);if(k.object instanceof ou.Literal){let G=k.object.value;if(G.startsWith("http://")||G.startsWith("https://"))return G}return null})),Y=Array.from(new Set(O.filter(k=>k!==null))),oe=n.cardinalityFromIRI(b[0]?.object instanceof ma.IRI?b[0].object.value:void 0),Q=n.severityFromValue(S[0]?.object instanceof ou.Literal||S[0]?.object instanceof ma.IRI?S[0].object.value:void 0),be=A[0]?.object,le=be instanceof ou.Literal?parseInt(be.value,10):NaN,ue=isNaN(le)?void 0:le;t.register({propertyIRI:L,domain:M,range:Y.length>0?Y:void 0,cardinality:oe,severity:Q,minCount:ue})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>eT(require("fs/promises"))),r=await t(e,"utf-8"),i=JSON.parse(r),s=new tT.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=n.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=Cr.Namespace.RDFS,r=Cr.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,r.term("Asset_label"),void 0)]),o=new Map;for(let c of[...i,...s]){if(!(c.subject instanceof ma.IRI)||!(c.object instanceof ou.Literal))continue;let l=n.extractUidFromFileIRI(c.subject.value);if(!l||o.has(l))continue;let u=c.object.value.trim();if(/\s/.test(u))continue;let f=n.labelToIRI(u);f&&o.set(l,f)}return o}static async resolveClassIRI(e,t,r){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new ma.IRI(e)}catch{return null}let s=Cr.Namespace.RDFS,o=Cr.Namespace.EXO,[c,l]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...c,...l])if(u.object instanceof ou.Literal){let f=n.labelToIRI(u.object.value);if(f)return f}if(r){let u=n.extractUidFromFileIRI(e);if(u){let f=r.get(u);if(f)return f}}return e}static async scanDir(e,t,r){let i;try{i=await r.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=r.path.join(e,s.name);if(s.isDirectory())await n.scanDir(o,t,r);else if(s.isFile()&&s.name.endsWith(".md"))try{await n.processFile(o,t,r.readFile,r.path)}catch{}}}static async processFile(e,t,r,i){let s;try{s=await r(e,"utf-8")}catch{return}let o=n.parseFrontmatter(s);if(!o)return;let c="38277bfa-d7f9-4a75-b856-b23276ab0db3",l="9a1cf31c-9d41-4ef3-9023-584a8d087d16";if(!n.asArray(o.exo__Instance_class).some(P=>{let M=n.extractWikilinkRef(P);return M==="exo__Property"||M==="exo__ObjectProperty"||M===c||M===l||M?.includes("|exo__Property")||M?.includes("|exo__ObjectProperty")}))return;let d=null,h=o.exo__Asset_label;if(typeof h=="string"&&h.trim().length>0)d=h.trim();else if(i){let P=i.basename(e,".md");Cr.Namespace.fromPropertyKey(P)&&(d=P)}if(!d)return;let p=n.labelToIRI(d);if(!p)return;let g=o.exo__Property_domain,y=o.exo__Property_range,b=o.exo__Property_cardinality,S=o.exo__Property_severity,v=o.exo__Property_minCount,I=n.asArray(g).map(P=>n.wikilinkToIRI(P)).filter(P=>P!==null);if(I.length===0)return;let A=n.asArray(y).map(P=>n.wikilinkToIRI(P)).filter(P=>P!==null),T=n.cardinalityFromLabel(typeof b=="string"?b:void 0),R=n.severityFromValue(typeof S=="string"?S:void 0),B=typeof v=="string"?parseInt(v,10):void 0,L=B!==void 0&&!isNaN(B)?B:void 0;t.register({propertyIRI:p,domain:I,range:A.length>0?A:void 0,cardinality:T,severity:R,minCount:L})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let r=t[1],i={},s=r.split(/\r?\n/),o=null,c=null;for(let l of s){let u=/^ {2}- (.*)$/.exec(l);if(u){o&&c&&c.push(u[1].trim());continue}o&&c&&(i[o]=c,o=null,c=null);let f=/^([^:]+):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),h=f[2].trim();h===""?(o=d,c=[]):i[d]=h}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Cr.Namespace.fromPropertyKey(e);if(!t)return null;try{return t.namespace.term(t.localName).value}catch{return null}}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),r=/\[\[([^\]]+)\]\]/.exec(t);return r?r[1]:t}static wikilinkToIRI(e){let t=n.extractWikilinkRef(e);if(!t)return null;let r=t.split("|"),i=r.length>1?[r[1],r[0]]:[r[0]];for(let s of i){let o=n.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?py+t.substring(3):t.startsWith("xsd:")?Pz+t.substring(4):null}static asArray(e){return Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[]}static cardinalityFromIRI(e){if(e){if(e.endsWith("PropertyCardinalitySingle"))return"Single";if(e.endsWith("PropertyCardinalityMultiple"))return"Multiple";if(e.includes(n.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=n.extractWikilinkRef(e)??e,r=t.split("|").pop()??t;if(r.includes("Single"))return"Single";if(r.includes("Multiple"))return"Multiple";if(t.includes(n.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===py+"Violation"?"sh:Violation":e.includes("Warning")||e===py+"Warning"?"sh:Warning":e.includes("Info")||e===py+"Info"?"sh:Info":"sh:Violation"}};Ps.ShapeLoader=au;au.FILE_IRI_UID_RE=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;au.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";au.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var iT=w(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.ShapeRegistry=void 0;cu.extractUidFromIRI=nT;cu.validate=jz;var rT=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(r=>[r.propertyIRI,r])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};cu.ShapeRegistry=rT;var Fz="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Dz=["http://www.w3.org/2001/XMLSchema#","http://www.w3.org/1999/02/22-rdf-syntax-ns#","http://www.w3.org/2000/01/rdf-schema#","http://www.w3.org/2002/07/owl#","http://www.w3.org/2004/02/skos/core#","http://purl.org/dc/elements/1.1/","http://purl.org/dc/terms/","http://xmlns.com/foaf/0.1/","https://schema.org/","https://exocortex.my/ontology/xsd#","https://exocortex.my/ontology/rdf#","https://exocortex.my/ontology/rdfs#","https://exocortex.my/ontology/owl#","https://exocortex.my/ontology/skos#"];function Lz(n){return Dz.some(e=>n.startsWith(e))}a(Lz,"isExternalOntologyIRI");var Nz=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function kz(n){return Nz.some(e=>n.startsWith(e))}a(kz,"isXSDDatatypeIRI");var Mz=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function nT(n){let e=Mz.exec(n);return e?e[1].toLowerCase():null}a(nT,"extractUidFromIRI");function jz(n,e,t,r){let i=new Map,s=new Map;for(let l of n){let{subject:u,predicate:f,object:d}=l;if(u.type!=="iri"||f.type!=="iri"||d.type!=="iri"&&d.type!=="literal")continue;let h=u.value,p=f.value,g=d;if(p===e.typePredicateIRI||p===Fz){if(g.type==="iri"){let b=i.get(h)??[];b.push(g.value),i.set(h,b);let S=nT(h);if(S){let v=`uid:${S}`,I=i.get(v)??[];I.push(g.value),i.set(v,I)}}}else{let b=s.get(h);b||(b=new Map,s.set(h,b));let S=b.get(p)??[];S.push(g),b.set(p,S)}}let o=[],c=new Set([...i.keys(),...s.keys()]);for(let l of c){if(l.startsWith("uid:"))continue;let u=i.get(l)??[],f=s.get(l)??new Map;for(let d of e.getAllShapes()){if(!(d.domain.length===0||d.domain.some(g=>u.some(y=>y===g||t.isSubClassOf(y,g)))))continue;let p=f.get(d.propertyIRI)??[];if(d.minCount!==void 0&&d.minCount>0&&p.length<d.minCount){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"minCount",message:d.message??`sh:minCount violation: expected at least ${d.minCount} value(s) for <${d.propertyIRI}>`});continue}if(p.length!==0){if(d.cardinality==="Single"&&p.length>1){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"maxCount",message:d.message??`sh:maxCount violation: expected at most 1 value for <${d.propertyIRI}>, got ${p.length}`});continue}if(d.range&&d.range.length>0){for(let g of p)if(g.type==="iri"){if(Lz(g.value))continue;let y=i.get(g.value)??[];if(y.length===0){let S=nT(g.value);S&&(y=i.get(`uid:${S}`)??[])}if(!d.range.some(S=>y.some(v=>v===S||t.isSubClassOf(v,S)))){let S=y.length===0;o.push({focusNode:l,propertyPath:d.propertyIRI,severity:S?"sh:Warning":d.severity,constraint:"class",message:S?`sh:class unresolvable-ref: <${g.value}> has no resolvable type in this vault (cross-vault, symbolic, or external reference); not validated against ${d.range.join(" | ")}`:d.message??`sh:class violation: <${g.value}> does not conform to expected class ${d.range.join(" | ")}`,actualValue:g.value,expectedRange:d.range.join(" | ")})}}else if(g.type==="literal"){let y=d.range.filter(v=>kz(v));if(y.length===0)continue;let b=g.datatype??"http://www.w3.org/2001/XMLSchema#string";y.some(v=>v===b)||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"datatype",message:d.message??`sh:datatype violation: literal "${g.value}" has datatype <${b}>, expected ${y.join(" | ")}`,actualValue:g.value,expectedRange:y.join(" | ")})}}}}}if(r?.closedWorldMode)for(let l of c){let u=s.get(l)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:l,propertyPath:f,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((l,u)=>{let f=l.focusNode.localeCompare(u.focusNode);return f!==0?f:l.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(l=>l.severity==="sh:Violation"),violations:o}}a(jz,"validate")});var vP=w(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.ApplicationErrorHandler=void 0;var sT=Os(),$z=Cs(),Uz=fc(),oT=class{static{a(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 o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof sT.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends sT.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 sT.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=$z.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(`
|
|
301
301
|
`)}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){Uz.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};my.ApplicationErrorHandler=oT});var EP=w(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});gy.ApplicationErrorHandler=void 0;var Bz=vP();Object.defineProperty(gy,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return Bz.ApplicationErrorHandler},"get")})});var TP=w(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.ClassHierarchy=void 0;var Vz="http://www.w3.org/2000/01/rdf-schema#subClassOf",aT=class{static{a(this,"ClassHierarchy")}constructor(e){this.adjacency=new Map;for(let t of e){if(t.predicate.type!=="iri"||t.predicate.value!==Vz||t.subject.type!=="iri"||t.object.type!=="iri")continue;let r=t.subject.value,i=t.object.value,s=this.adjacency.get(r);s||(s=new Set,this.adjacency.set(r,s)),s.add(i)}}isSubClassOf(e,t){if(e===t)return!0;let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o){if(c===t)return!0;r.has(c)||i.push(c)}}return!1}getAncestors(e){let t=new Set,r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o)t.add(c),r.has(c)||i.push(c)}return t}};yy.ClassHierarchy=aT});var cT=w(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.parseTarball=xP;by.parseTarballGzip=Kz;var qz={0:"file",1:"hardLink",2:"symbolicLink",3:"characterDevice",4:"blockDevice",5:"directory",6:"fifo",7:"contiguousFile",g:"globalExtendedHeader",x:"extendedHeader",D:"gnuDirectory",I:"gnuInodeMetadata",K:"gnuLongLinkName",L:"gnuLongFileName",N:"gnuOldLongFileName",M:"gnuMultiVolume",S:"gnuSparseFile",E:"gnuExtendedSparse"},Gz=new Set(["extendedHeader","globalExtendedHeader","gnuLongFileName","gnuOldLongFileName","gnuLongLinkName"]),AP;function IP(){return AP??(AP=new TextDecoder)}a(IP,"getDecoder");function fd(n,e,t){let r=n.subarray(e,e+t),i=r.indexOf(0);return IP().decode(i===-1?r:r.subarray(0,i))}a(fd,"readString");function Wz(n,e,t){let r="";for(let s=0;s<t;s++)r+=String.fromCodePoint(n[e+s]);let i=Number.parseInt(r,8);return Number.isNaN(i)?0:i}a(Wz,"readNumber");function Hz(n){let e=IP().decode(n),t={};for(let r of e.split(`
|
|
302
|
-
`)){let i=r.indexOf("=");if(i===-1)continue;let s=r.slice(r.indexOf(" ")+1,i),o=r.slice(i+1);s&&(t[s]=o)}return t}a(Hz,"parseExtendedHeaders");function zz(n){let e=n.replace(/\\/g,"/");e=e.replace(/^[a-zA-Z]:\//,""),e=e.replace(/^\/+/,"");let t=e.startsWith("./"),r=e.split("/"),i=[];for(let o of r)o===".."?i.pop():o!=="."&&o!==""&&i.push(o);let s=i.join("/");return t&&!s.startsWith("./")&&(s="./"+s),n.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}a(zz,"sanitizePath");function xP(n){let e=n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n:n.slice(),t=[],r=0,i,s;for(;r+512<=e.byteLength;){let o=fd(e,r,100);if(o.length===0)break;let c=!1;if(i){let p=i.path??i.linkpath;p&&(o=p,c=!0)}let l=Wz(e,r+124,12),u=512+512*Math.trunc(l/512)+(l%512?512:0),f=fd(e,r+156,1)||"0",d=qz[f]??f;if(d==="extendedHeader"||d==="globalExtendedHeader"){let p=Hz(e.subarray(r+512,r+512+l));d==="extendedHeader"?i=p:(i=void 0,s={...s,...p}),r+=u;continue}if(Gz.has(d)){i={path:fd(e,r+512,l)},r+=u;continue}if(!c&&fd(e,r+257,6).startsWith("ustar")){let g=fd(e,r+345,155);g.length>0&&(o=`${g}/${o}`)}o=zz(o);let h=l===0?void 0:e.subarray(r+512,r+512+l);t.push({name:o,type:d,size:l,data:h}),i=void 0,r+=u}return t}a(xP,"parseTarball");async function Kz(n){let e=new Uint8Array(n instanceof Uint8Array?n:new Uint8Array(n)),t=new DecompressionStream("gzip"),r=t.writable.getWriter(),[,i]=await Promise.all([r.write(e).then(()=>r.close()),new Response(t.readable).arrayBuffer()]);return xP(new Uint8Array(i))}a(Kz,"parseTarballGzip")});var Sy=w(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.isBinaryPayload=uT;_y.restCreateCommit=Yz;function uT(n){return typeof n!="string"}a(uT,"isBinaryPayload");var Qz="https://api.github.com";function RP(n){if(n!==null&&typeof n=="object"&&"object"in n){let e=n.object;if(e!==null&&typeof e=="object"&&"sha"in e){let t=e.sha;return typeof t=="string"?t:void 0}}}a(RP,"readObjectSha");function lT(n){if(n!==null&&typeof n=="object"&&"sha"in n){let e=n.sha;return typeof e=="string"?e:void 0}}a(lT,"readSha");async function Yz(n,e){let{owner:t,repo:r,branch:i,files:s,message:o}=e,c=e.deletions??[],l=(e.baseURL??Qz).replace(/\/$/,""),u=e.redact??(L=>L);if(typeof t!="string"||t.length===0)throw new Error("restCreateCommit: owner is required");if(typeof r!="string"||r.length===0)throw new Error("restCreateCommit: repo is required");if(typeof i!="string"||i.length===0)throw new Error("GitHub createCommit: branch is required");if(!(s instanceof Map)||s.size===0&&c.length===0)throw new Error("GitHub createCommit: files map must be non-empty (unless deletions are provided)");let f=new Set;for(let L of c){if(typeof L!="string"||L.length===0)throw new Error("GitHub createCommit: deletion path must be a non-empty string");if(s.has(L))throw new Error(u(`GitHub createCommit: path ${L} is both written and deleted \u2014 ambiguous`));f.add(L)}if(typeof o!="string"||o.length===0)throw new Error("GitHub createCommit: message is required");let d=encodeURIComponent(t),h=encodeURIComponent(r),p=encodeURIComponent(i),g=await n({method:"GET",url:`${l}/repos/${d}/${h}/git/refs/heads/${p}`}),y=RP(g?.json);if(typeof y!="string"||y.length===0)throw new Error(u(`GitHub createCommit: missing object.sha for ref heads/${i}`));if(e.expectedHeadSha!==void 0&&y!==e.expectedHeadSha)throw new Error(u(`GitHub createCommit: head heads/${i} moved since the caller's check (expected ${e.expectedHeadSha}, found ${y}) \u2014 refusing to avoid overwriting a concurrent change`));let b=new Map;for(let[L,P]of s){if(!uT(P))continue;let M=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/blobs`,contentType:"application/json",body:JSON.stringify({content:P.base64,encoding:"base64"})}),O=lT(M?.json);if(typeof O!="string"||O.length===0)throw new Error(u(`GitHub createCommit: blob create returned no sha for ${L}`));b.set(L,O)}let S=Array.from(s.entries()).map(([L,P])=>uT(P)?{path:L,mode:"100644",type:"blob",sha:b.get(L)}:{path:L,mode:"100644",type:"blob",content:P});for(let L of f)S.push({path:L,mode:"100644",type:"blob",sha:null});let v=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/trees`,contentType:"application/json",body:JSON.stringify({base_tree:y,tree:S})}),I=lT(v?.json);if(typeof I!="string"||I.length===0)throw new Error(u("GitHub createCommit: tree create returned no sha"));let A=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/commits`,contentType:"application/json",body:JSON.stringify({message:o,tree:I,parents:[y]})}),T=lT(A?.json);if(typeof T!="string"||T.length===0)throw new Error(u("GitHub createCommit: commit create returned no sha"));let R=await n({method:"PATCH",url:`${l}/repos/${d}/${h}/git/refs/heads/${p}`,contentType:"application/json",body:JSON.stringify({sha:T,force:!1})}),B=RP(R?.json);if(B!==T)throw new Error(u(`GitHub createCommit: ref update mismatch (expected ${T}, got ${B})`));return T}a(Yz,"restCreateCommit")});var PP=w(
|
|
302
|
+
`)){let i=r.indexOf("=");if(i===-1)continue;let s=r.slice(r.indexOf(" ")+1,i),o=r.slice(i+1);s&&(t[s]=o)}return t}a(Hz,"parseExtendedHeaders");function zz(n){let e=n.replace(/\\/g,"/");e=e.replace(/^[a-zA-Z]:\//,""),e=e.replace(/^\/+/,"");let t=e.startsWith("./"),r=e.split("/"),i=[];for(let o of r)o===".."?i.pop():o!=="."&&o!==""&&i.push(o);let s=i.join("/");return t&&!s.startsWith("./")&&(s="./"+s),n.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}a(zz,"sanitizePath");function xP(n){let e=n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n:n.slice(),t=[],r=0,i,s;for(;r+512<=e.byteLength;){let o=fd(e,r,100);if(o.length===0)break;let c=!1;if(i){let p=i.path??i.linkpath;p&&(o=p,c=!0)}let l=Wz(e,r+124,12),u=512+512*Math.trunc(l/512)+(l%512?512:0),f=fd(e,r+156,1)||"0",d=qz[f]??f;if(d==="extendedHeader"||d==="globalExtendedHeader"){let p=Hz(e.subarray(r+512,r+512+l));d==="extendedHeader"?i=p:(i=void 0,s={...s,...p}),r+=u;continue}if(Gz.has(d)){i={path:fd(e,r+512,l)},r+=u;continue}if(!c&&fd(e,r+257,6).startsWith("ustar")){let g=fd(e,r+345,155);g.length>0&&(o=`${g}/${o}`)}o=zz(o);let h=l===0?void 0:e.subarray(r+512,r+512+l);t.push({name:o,type:d,size:l,data:h}),i=void 0,r+=u}return t}a(xP,"parseTarball");async function Kz(n){let e=new Uint8Array(n instanceof Uint8Array?n:new Uint8Array(n)),t=new DecompressionStream("gzip"),r=t.writable.getWriter(),[,i]=await Promise.all([r.write(e).then(()=>r.close()),new Response(t.readable).arrayBuffer()]);return xP(new Uint8Array(i))}a(Kz,"parseTarballGzip")});var Sy=w(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.isBinaryPayload=uT;_y.restCreateCommit=Yz;function uT(n){return typeof n!="string"}a(uT,"isBinaryPayload");var Qz="https://api.github.com";function RP(n){if(n!==null&&typeof n=="object"&&"object"in n){let e=n.object;if(e!==null&&typeof e=="object"&&"sha"in e){let t=e.sha;return typeof t=="string"?t:void 0}}}a(RP,"readObjectSha");function lT(n){if(n!==null&&typeof n=="object"&&"sha"in n){let e=n.sha;return typeof e=="string"?e:void 0}}a(lT,"readSha");async function Yz(n,e){let{owner:t,repo:r,branch:i,files:s,message:o}=e,c=e.deletions??[],l=(e.baseURL??Qz).replace(/\/$/,""),u=e.redact??(L=>L);if(typeof t!="string"||t.length===0)throw new Error("restCreateCommit: owner is required");if(typeof r!="string"||r.length===0)throw new Error("restCreateCommit: repo is required");if(typeof i!="string"||i.length===0)throw new Error("GitHub createCommit: branch is required");if(!(s instanceof Map)||s.size===0&&c.length===0)throw new Error("GitHub createCommit: files map must be non-empty (unless deletions are provided)");let f=new Set;for(let L of c){if(typeof L!="string"||L.length===0)throw new Error("GitHub createCommit: deletion path must be a non-empty string");if(s.has(L))throw new Error(u(`GitHub createCommit: path ${L} is both written and deleted \u2014 ambiguous`));f.add(L)}if(typeof o!="string"||o.length===0)throw new Error("GitHub createCommit: message is required");let d=encodeURIComponent(t),h=encodeURIComponent(r),p=encodeURIComponent(i),g=await n({method:"GET",url:`${l}/repos/${d}/${h}/git/refs/heads/${p}`}),y=RP(g?.json);if(typeof y!="string"||y.length===0)throw new Error(u(`GitHub createCommit: missing object.sha for ref heads/${i}`));if(e.expectedHeadSha!==void 0&&y!==e.expectedHeadSha)throw new Error(u(`GitHub createCommit: head heads/${i} moved since the caller's check (expected ${e.expectedHeadSha}, found ${y}) \u2014 refusing to avoid overwriting a concurrent change`));let b=new Map;for(let[L,P]of s){if(!uT(P))continue;let M=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/blobs`,contentType:"application/json",body:JSON.stringify({content:P.base64,encoding:"base64"})}),O=lT(M?.json);if(typeof O!="string"||O.length===0)throw new Error(u(`GitHub createCommit: blob create returned no sha for ${L}`));b.set(L,O)}let S=Array.from(s.entries()).map(([L,P])=>uT(P)?{path:L,mode:"100644",type:"blob",sha:b.get(L)}:{path:L,mode:"100644",type:"blob",content:P});for(let L of f)S.push({path:L,mode:"100644",type:"blob",sha:null});let v=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/trees`,contentType:"application/json",body:JSON.stringify({base_tree:y,tree:S})}),I=lT(v?.json);if(typeof I!="string"||I.length===0)throw new Error(u("GitHub createCommit: tree create returned no sha"));let A=await n({method:"POST",url:`${l}/repos/${d}/${h}/git/commits`,contentType:"application/json",body:JSON.stringify({message:o,tree:I,parents:[y]})}),T=lT(A?.json);if(typeof T!="string"||T.length===0)throw new Error(u("GitHub createCommit: commit create returned no sha"));let R=await n({method:"PATCH",url:`${l}/repos/${d}/${h}/git/refs/heads/${p}`,contentType:"application/json",body:JSON.stringify({sha:T,force:!1})}),B=RP(R?.json);if(B!==T)throw new Error(u(`GitHub createCommit: ref update mismatch (expected ${T}, got ${B})`));return T}a(Yz,"restCreateCommit")});var PP=w(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.MATERIALIZE_PROGRESS_MIN_FILES=qn.MATERIALIZE_PROGRESS_INTERVAL=void 0;qn.discoverWrapperDir=CP;qn.extractShaFromWrapper=OP;qn.mountAssetSpaceFiles=Zz;qn.escapeGitmodulesRegex=dT;qn.appendGitmodulesEntry=eK;qn.stripGitmodulesEntry=tK;var Xz=cT(),fT=new Set(["globalExtendedHeader","extendedHeader"]);function wy(n){let e=n.replace(/\\/g,"/").replace(/\/+/g,"/");for(;e.startsWith("./");)e=e.slice(2);return e}a(wy,"normalizeEntryPath");function CP(n){let e=n.find(s=>!fT.has(s.type)&&wy(s.name).includes("/"));if(e===void 0)throw new Error("discoverWrapperDir: no wrapper-bearing entry in tarball");let t=wy(e.name),r=t.slice(0,t.indexOf("/"));if(r.length===0)throw new Error(`discoverWrapperDir: empty wrapper segment in entry "${e.name}"`);let i=r+"/";for(let s of n){if(fT.has(s.type))continue;let o=wy(s.name);if(!(o===r||o===i)&&!o.startsWith(i))throw new Error(`discoverWrapperDir: entry "${s.name}" not under wrapper "${r}"`)}return r}a(CP,"discoverWrapperDir");function OP(n){let e=n.match(/-([0-9a-fA-F]{7,40})$/);if(e===null)throw new Error(`extractShaFromWrapper: wrapper "${n}" does not match expected GitHub pattern <owner>-<repo>-<sha>`);return e[1].toLowerCase()}a(OP,"extractShaFromWrapper");function Jz(n,e){let t=e+"/",r=[];for(let i of n){if(i.type==="symbolicLink"||i.type==="hardLink")throw new Error(`${i.type} entry "${i.name}" rejected for security`);if(fT.has(i.type)||i.type==="directory")continue;let s=wy(i.name);if(s===e||s===t)continue;if(!s.startsWith(t))throw new Error(`entry "${i.name}" not under wrapper "${e}"`);let o=s.slice(t.length);if(o.length!==0){if(o.split("/").some(c=>c===".."))throw new Error(`path traversal detected for entry "${i.name}"`);i.data!==void 0&&r.push({relPath:o,content:i.data})}}return r}a(Jz,"buildMountFiles");qn.MATERIALIZE_PROGRESS_INTERVAL=200;qn.MATERIALIZE_PROGRESS_MIN_FILES=500;async function Zz(n){let{http:e,fs:t,owner:r,repo:i,ref:s,targetPath:o}=n,c=a((b,S)=>{if(n.onProgress!==void 0)try{n.onProgress(b,S)}catch{}},"emit");c("fetch");let l=await e.fetchTarball(r,i,s);c("extract");let u=await(0,Xz.parseTarballGzip)(l);if(u.length===0)throw new Error(`tarball empty for ${r}/${i}@${s}`);let f=CP(u),d=OP(f),h=Jz(u,f);c("materialize");let p=h.length,g=n.onProgress!==void 0&&p>qn.MATERIALIZE_PROGRESS_MIN_FILES,y=await t.materialize(o,h,g?b=>{b%qn.MATERIALIZE_PROGRESS_INTERVAL===0&&b<p&&c("materialize",{processed:b,total:p})}:void 0);return{sha:d,fileCount:y}}a(Zz,"mountAssetSpaceFiles");function dT(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(dT,"escapeGitmodulesRegex");function eK(n,e,t){let r=new RegExp(`^\\s*\\[submodule\\s+"${dT(e)}"\\]`,"m");if(n.length>0&&r.test(n))return{content:n,added:!1};let i=n.length===0||n.endsWith(`
|
|
303
303
|
`)?"":`
|
|
304
304
|
`,s=`[submodule "${e}"]
|
|
305
305
|
path = ${e}
|
|
@@ -321,7 +321,7 @@ ${b}---
|
|
|
321
321
|
${g.body}`,warnings:y}}splitDoc(e){let t=MK.exec(e);if(!t)return{frontmatter:{},body:e};let r=e.slice(t[0].length);try{let i=this.codec.parse(t[1]);return i==null?{frontmatter:{},body:r}:typeof i!="object"||Array.isArray(i)?null:{frontmatter:i,body:r}}catch{return null}}};Sd.StructuredMerger=LT});var ZP=w(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.MergeShaclGate=void 0;var NT=iT(),GK="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function WK(n,e){let t=new Set;for(let r of n){if(r.subject.type!=="iri"||!("type"in r.predicate)||r.predicate.type!=="iri"||r.object.type!=="iri"||r.predicate.value!==e&&r.predicate.value!==GK)continue;t.add(r.subject.value);let i=(0,NT.extractUidFromIRI)(r.subject.value);i&&t.add(`uid:${i}`)}return t}a(WK,"typedSubjects");var kT=class{static{a(this,"MergeShaclGate")}constructor(e){this.deps=e}async checkMergedAsset(e,t){let r=await this.deps.triplesFor(e,t),i=this.deps.contextTriples??[],s=[...r,...i],o=(0,NT.validate)(s,this.deps.registry,this.deps.hierarchy),c=new Set;for(let h of r)h.subject.type==="iri"&&c.add(h.subject.value);let l=WK(s,this.deps.registry.typePredicateIRI),u=this.deps.isMountedRef??(h=>{if(l.has(h))return!0;let p=(0,NT.extractUidFromIRI)(h);return p!==null&&l.has(`uid:${p}`)}),f=[],d=0;for(let h of o.violations)if(c.has(h.focusNode)){if(h.constraint==="class"){if(h.actualValue!==void 0&&!u(h.actualValue)){d++;continue}f.push(h);continue}h.severity==="sh:Violation"&&f.push(h)}return{ok:f.length===0,violations:f,skippedOpenWorld:d}}};Ly.MergeShaclGate=kT});var eF=w(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});Ny.GatedStructuredMerger=void 0;var MT=class{static{a(this,"GatedStructuredMerger")}constructor(e,t){this.merger=e,this.gate=t}async resolve(e){let t=this.merger.mergeAsset(e);if(t.status==="conflict")return{action:"quarantine",reason:t.reason};if(this.gate!==void 0){let r=await this.gate.checkMergedAsset(e.path,t.content);if(!r.ok)return{action:"quarantine",reason:`merged result is SHACL-invalid: ${r.violations.slice(0,3).map(s=>s.message).join("; ")}`}}return{action:"use-merged",content:t.content,warnings:t.warnings}}};Ny.GatedStructuredMerger=MT});var tF=w(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.FileWatermarkStore=fu.WATERMARK_STORE_FILENAME=void 0;fu.WATERMARK_STORE_FILENAME="exosync-watermarks.local.json";function HK(n){if(n===null||typeof n!="object")return!1;let e=n;return typeof e.lastSyncedSha=="string"&&typeof e.rootTreeSha=="string"&&Array.isArray(e.files)}a(HK,"isWatermarkRecord");var jT=class{static{a(this,"FileWatermarkStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let r=(await this.readRepos())[e];return HK(r)?r:null}async set(e,t){let r=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s,null,2))});return this.writeChain=r.catch(()=>{}),r}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let r=t.repos;return r===null||typeof r!="object"?{}:{...r}}catch{return{}}}};fu.FileWatermarkStore=jT});var rF=w(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.FileMountBaseStore=du.MOUNT_BASE_STORE_FILENAME=void 0;du.MOUNT_BASE_STORE_FILENAME="exosync-mountbase.local.json";var $T=class{static{a(this,"FileMountBaseStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let r=(await this.readRepos())[e];return typeof r=="string"&&r.length>0?r:null}async set(e,t){let r=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s,null,2))});return this.writeChain=r.catch(()=>{}),r}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let r=t.repos;if(r===null||typeof r!="object")return{};let i={};for(let[s,o]of Object.entries(r))typeof o=="string"&&(i[s]=o);return i}catch{return{}}}};du.FileMountBaseStore=$T});var nF=w(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.LocalConflictCacheStore=hu.CONFLICT_CACHE_STORE_FILENAME=void 0;var zK=al();hu.CONFLICT_CACHE_STORE_FILENAME="exosync-conflicts.local.json";function UT(n,e){return`${n}\0${e}`}a(UT,"cacheKey");function BT(n){if(n===null||typeof n!="object")return!1;let e=n;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.reason=="string"&&typeof e.quarantinedAt=="string"}a(BT,"isRecord");var VT=class{static{a(this,"LocalConflictCacheStore")}constructor(e){this.writeChain=Promise.resolve(),this.io=e.io,this.now=e.now??(()=>new Date().toISOString())}async quarantine(e){await this.quarantineAll([e])}async quarantineAll(e){e.length!==0&&await this.mutate(t=>{for(let r of e){let i=UT(r.repoKey,r.path),s=t.entries[i],o=s!==void 0&&BT(s)?s.quarantinedAt:this.now();t.entries[i]={version:1,repoKey:r.repoKey,path:r.path,...r.uid!==void 0?{uid:r.uid}:{},reason:r.reason,quarantinedAt:o,...r.baseContent!==void 0?{baseContent:r.baseContent}:{},...r.localContent!==void 0?{localContent:r.localContent}:{},...r.remoteContent!==void 0?{remoteContent:r.remoteContent}:{},...r.localContentBytes!==void 0?{localContentBytesBase64:(0,zK.bytesToBase64)(r.localContentBytes)}:{}}}})}async markResolved(e,t){let r=UT(e,t);await this.mutate(i=>{delete i.entries[r]})}async list(){let e=await this.read();return Object.values(e.entries).filter(BT)}async get(e,t){let i=(await this.read()).entries[UT(e,t)];return i!==void 0&&BT(i)?i:null}async mutate(e){let t=this.writeChain.then(async()=>{let r=await this.read();e(r),await this.io.writeAtomic(JSON.stringify(r,null,2))});return this.writeChain=t.catch(()=>{}),t}async read(){try{let e=await this.io.read();if(e===null)return{version:1,entries:{}};let t=JSON.parse(e);if(t===null||typeof t!="object")return{version:1,entries:{}};let r=t.entries;return r===null||typeof r!="object"?{version:1,entries:{}}:{version:1,entries:{...r}}}catch{return{version:1,entries:{}}}}};hu.LocalConflictCacheStore=VT});var uF=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SpaceSpecAccumulator=tn.SYNC_BRANCH=tn.ASSET_SPACE_CLASS_UID=void 0;tn.isAssetSpaceFrontmatter=oF;tn.isFileSpaceFrontmatter=aF;tn.readSpaceSource=cF;tn.parseStrictGitHubRepoURL=lF;tn.classifySpaceDeclaration=XK;var KK=Mg(),QK=kg();tn.ASSET_SPACE_CLASS_UID="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb";tn.SYNC_BRANCH="main";var iF=/\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]/gi;function sF(n,e){let t=n.exo__Instance_class,r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;iF.lastIndex=0;let s;for(;(s=iF.exec(i))!==null;)if(s[1].toLowerCase()===e)return!0}return!1}a(sF,"instanceClassHasUid");function oF(n){return sF(n,tn.ASSET_SPACE_CLASS_UID)}a(oF,"isAssetSpaceFrontmatter");function aF(n){return sF(n,KK.FILE_SPACE_CLASS_UID)}a(aF,"isFileSpaceFrontmatter");function cF(n){let e=n.exo__AssetSpace_source;if(typeof e=="string"&&e.length>0)return e;let t=n.exo__AssetSpace_git;return typeof t=="string"&&t.length>0?t:null}a(cF,"readSpaceSource");var YK=/^https:\/\/github\.com\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/;function lF(n){if(typeof n!="string"||n.length===0||n.length>256||!YK.test(n))return null;let e=n.slice(19),[t,r,...i]=e.split("/");if(i.length>0||t===".."||r===".."||r.startsWith("."))return null;let s=r.replace(/\.git$/,"");return s.length===0?null:{owner:t,repo:s}}a(lF,"parseStrictGitHubRepoURL");function XK(n,e){let t=oF(n),r=aF(n);if(!t&&!r)return{kind:"not-space"};let i;t&&r&&(i=`declaration at ${e} carries BOTH exo__AssetSpace and exo__FileSpace classes (disjoint) \u2014 treating as AssetSpace (conservative)`);let s=t?"asset":"file",o=cF(n);if(o===null)return s==="file"?{kind:"skip",warning:`skipped FileSpace at ${e}: no exo__AssetSpace_source/_git \u2014 mount path underivable`}:{kind:"skip"};let c=o.replace(/\.git$/i,""),l=lF(c);if(l===null)return{kind:"skip",warning:`skipped AssetSpace at ${e}: source is not a plain https://github.com/<owner>/<repo> URL`};let u=(0,QK.derivePath)(c);if(u===null)return{kind:"skip",warning:`skipped AssetSpace at ${e}: cannot derive mount path from source`};let f=`${l.owner}/${l.repo}#${tn.SYNC_BRANCH}`,d=n.exo__Asset_uid,h=typeof d=="string"&&d.trim().length>0?d.trim():void 0;return{kind:"candidate",candidate:{spec:{owner:l.owner,repo:l.repo,branch:tn.SYNC_BRANCH,repoKey:f,localPath:u,...s==="file"?{spaceKind:s}:{}},spaceKind:s,...h!==void 0?{asUid:h}:{}},...i!==void 0?{warning:i}:{}}}a(XK,"classifySpaceDeclaration");var qT=class{static{a(this,"SpaceSpecAccumulator")}constructor(){this.specs=[],this.warnings=[],this.asUidByRepoKey=new Map,this.seen=new Set,this.kindByRepoKey=new Map}offer(e){let{spec:t,spaceKind:r}=e;if(this.seen.has(t.repoKey)){let i=this.kindByRepoKey.get(t.repoKey);if(i!==void 0&&i!==r&&(this.warnings.push(`repo ${t.repoKey} is declared as BOTH AssetSpace and FileSpace by different assets \u2014 treating as AssetSpace (deterministic, conservative); fix the vault (disjoint subtypes)`),i==="file")){this.kindByRepoKey.set(t.repoKey,"asset");let s=this.specs.find(o=>o.repoKey===t.repoKey);s!==void 0&&delete s.spaceKind}return null}return this.seen.add(t.repoKey),this.kindByRepoKey.set(t.repoKey,r),t}commit(e){this.specs.push(e.spec),e.asUid!==void 0&&this.asUidByRepoKey.set(e.spec.repoKey,e.asUid)}};tn.SpaceSpecAccumulator=qT});var GT=w(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.isFormatOnlyDrift=JK;My.compareAssetSemantics=eQ;function JK(n){return n.frontmatterEqual&&n.bodyEqual}a(JK,"isFormatOnlyDrift");var ZK=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/;function fF(n){let e=ZK.exec(n);return e?{fm:e[1],body:n.slice(e[0].length)}:{fm:null,body:n}}a(fF,"splitDoc");function ky(n){if(Array.isArray(n))return`[${n.map(ky).sort().join(",")}]`;if(n!==null&&typeof n=="object"){let e=n;return`{${Object.keys(e).sort().map(r=>`${JSON.stringify(r)}:${ky(e[r])}`).join(",")}}`}return JSON.stringify(n)??"undefined"}a(ky,"canonicalise");function dF(n){return n.replace(/\r\n/g,`
|
|
322
322
|
`).replace(/\s+$/,"")}a(dF,"normaliseBody");function eQ(n,e,t){let r=fF(n),i=fF(e),s;if(r.fm===null&&i.fm===null)s=!0;else if(r.fm===null||i.fm===null)s=!1;else try{s=ky(t.parse(r.fm))===ky(t.parse(i.fm))}catch{s=!1}return{frontmatterEqual:s,bodyEqual:dF(r.body)===dF(i.body)}}a(eQ,"compareAssetSemantics")});var gF=w(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.ParityValidator=void 0;vd.summarizeParityRound=aQ;var wd=hd(),hF=lu(),tQ=Iy(),rQ=Cy(),pu=Oy(),pF=GT(),nQ=50,iQ=200,mF=new Set(["pending-local-edit","pending-remote-add","pending-remote-edit","pending-remote-delete","deferred-local-delete","pending-conflict","unverified-divergence"]),sQ=new Set(["quarantine-pinned","format-only-drift"]);function _a(n){return n instanceof Error?n.message:String(n)}a(_a,"errMsg");function oQ(n){return/HTTP 404/.test(_a(n))}a(oQ,"isNotFoundError");var WT=class{static{a(this,"ParityValidator")}constructor(e){this.deps=e,this.transport=(0,rQ.withRateLimitBackoff)(e.transport,e.backoff)}async captureSnapshot(e){let t=new Map,r=[],i=this.deps.redact??(s=>s);for(let s of e)try{let o=await this.deps.watermarks.get(s.repoKey);if(o===null)continue;let c=new Map(o.files.map(f=>[f.path,f.blobSha])),l=await this.readLocalSnapshot(s,s.spaceKind==="file"),u=new Map;for(let[f,d]of l.shas)c.get(f)!==d&&u.set(f,d);u.size>0&&t.set(s.repoKey,u)}catch(o){r.push(`${s.repoKey}: conservation snapshot failed (${i(_a(o))}) \u2014 no coverage this round`)}return{dirtyByRepo:t,warnings:r}}async runRound(e,t){let r=this.deps.now??(()=>new Date().toISOString()),i=this.deps.maxSemanticFetchesPerRun??iQ,s=[];for(let u of e){let f=await this.checkRepo(u,t,{take:a(d=>i<d?!1:(i-=d,!0),"take")});s.push(f)}t.previousRound!=null&&t.trigger==="post-sync"&&this.escalatePersistentDivergence(s,t.previousRound,t.syncResults);let o=s.filter(u=>u.status==="checked").length,c=s.reduce((u,f)=>u+f.m1Violations.length,0),l=s.reduce((u,f)=>u+(f.status==="checked"?f.m2SemanticDiffs:0),0);return{version:1,ts:r(),trigger:t.trigger,repos:s,checkedRepos:o,m1Total:c,m2Total:l,ok:c===0&&l===0&&o>0,vacuous:o===0}}async checkRepo(e,t,r){let i=[],s=this.deps.redact??(l=>l),o=a((l,u={})=>({repoKey:e.repoKey,status:l,filesChecked:0,inParity:0,discrepancies:[],m2SemanticDiffs:0,accountedCount:0,m1Violations:[],warnings:i,...u}),"report"),c=t.syncResults?.find(l=>l.repoKey===e.repoKey);if(c?.warnings.some(l=>l.startsWith("race-window")))return o("inconclusive",{detail:"sync hit its race window (watermark not advanced) \u2014 parity deferred to the next round"});if(c?.status==="skipped-not-materialized")return o("inconclusive",{detail:"repo not fully materialized (D19) \u2014 local absence is not divergence; parity deferred to the next round"});try{let l=e.spaceKind==="file",u=await(0,wd.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=await(0,wd.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL),d=await(0,wd.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL),h=this.deps.maxFileBytes??pu.DEFAULT_MAX_FILE_BYTES,p=l?pu.isFileSpaceSyncablePath:pu.isSyncablePath,g=new Map;for(let O of d)if(p(O.path)){if(O.size!==void 0&&O.size>h){i.push(`remote ${O.path} exceeds the ${h}-byte cap \u2014 excluded symmetrically`);continue}g.set(O.path,O)}let y=await this.readLocalSnapshot(e,l);i.push(...y.warnings);let b=await this.deps.watermarks.get(e.repoKey);if(b===null){let O=0;for(let[oe,Q]of y.shas)g.get(oe)?.blobSha===Q&&O++;let Y=new Set([...y.shas.keys(),...g.keys()]);return o("no-watermark",{filesChecked:Y.size,inParity:O,headSha:u,detail:`repo has no sync watermark on this device (${Y.size-O} raw diff(s)) \u2014 run a sync first; not counted toward M1/M2`})}let S=new Map(b.files.map(O=>[O.path,O.blobSha])),v=new Set(b.pinnedPaths??[]),{discrepancies:I,inParity:A,filesChecked:T}=await this.classifyAll(e,y,g,S,v,l,{warnings:i,runBudget:r}),R=await(0,wd.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL);if(R!==u)return o("inconclusive",{headSha:u,detail:`remote head moved during the check (${u.slice(0,7)} \u2192 ${R.slice(0,7)}) \u2014 parity deferred to the next round`});let B=this.checkConservation(e,t,y,g,v,c),L=I.filter(O=>!sQ.has(O.cls)).length,P=I.length-L,M;if(l){let O=[...y.shas.values()].sort().join(`
|
|
323
323
|
`),Y=[...g.values()].map(oe=>oe.blobSha).sort().join(`
|
|
324
|
-
`);M=O===Y}return o("checked",{filesChecked:T,inParity:A,discrepancies:I,m2SemanticDiffs:L,accountedCount:P,m1Violations:B,headSha:u,...M!==void 0?{attachmentHashSetIdentical:M}:{}})}catch(l){return(0,tQ.isAuthError)(l)?o("auth-required",{detail:s(`authentication failed: ${_a(l)} \u2014 the PAT is expired, revoked or under-scoped; update it (R8)`)}):oQ(l)?(i.push("repo unreachable (HTTP 404): dead AssetSpace pointer, or the fine-grained PAT does not allowlist this repo \u2014 skipped"),o("error",{detail:s(_a(l))})):(i.push(`parity check failed: ${s(_a(l))}`),o("error",{detail:s(_a(l))}))}}async readLocalSnapshot(e,t){let r=this.deps.localFilesFor(e),i=t?pu.isFileSpaceSyncablePath:pu.isSyncablePath,s=this.deps.maxFileBytes??pu.DEFAULT_MAX_FILE_BYTES,o=new Map,c=new Map,l=[];if(t&&r.readBinary===void 0)throw new Error("file-mode repo requires a LocalFilesPort with readBinary \u2014 refusing to hash through the text-only port (binary would corrupt)");let u=new TextEncoder;for(let f of await r.list())if(i(f))try{if(t){let d=await r.readBinary(f);if(d.byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}o.set(f,await(0,hF.gitBlobSha)(d,this.deps.sha1))}else{let d=await r.read(f);if(u.encode(d).byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}c.set(f,d),o.set(f,await(0,hF.gitBlobSha)(d,this.deps.sha1))}}catch(d){let h=this.deps.redact??(p=>p);l.push(`local ${f} unreadable (${h(_a(d))}) \u2014 skipped`)}return{shas:o,texts:c,warnings:l}}async classifyAll(e,t,r,i,s,o,c){let l=[],u=0,f=this.deps.maxSemanticFetchesPerRepo??nQ,d=new Set([...t.shas.keys(),...r.keys()]);for(let h of[...d].sort()){let p=t.shas.get(h),y=r.get(h)?.blobSha,b=i.get(h);if(p!==void 0&&y!==void 0){if(p===y){u++;continue}l.push(await this.classifyContentDiff(e,h,p,y,b,s,o,t,{...c,takeRepoFetch:a(()=>f-- >0,"takeRepoFetch")}));continue}if(p!==void 0){let S;s.has(h)?S={path:h,presence:"local-only",cls:"quarantine-pinned",localSha:p}:b===void 0?S={path:h,presence:"local-only",cls:"pending-local-add",localSha:p}:b===p?S={path:h,presence:"local-only",cls:"pending-remote-delete",localSha:p,detail:"remote deleted it; the local copy is unchanged"}:S={path:h,presence:"local-only",cls:"pending-conflict",localSha:p,detail:"remote deleted it AND the local copy was edited"},l.push(S);continue}if(y!==void 0){let S;s.has(h)?S={path:h,presence:"remote-only",cls:"quarantine-pinned",remoteSha:y}:b===void 0?S={path:h,presence:"remote-only",cls:"pending-remote-add",remoteSha:y}:b===y?S={path:h,presence:"remote-only",cls:"deferred-local-delete",remoteSha:y,detail:"locally deleted; the delete propagates on the next sync (#3476) \u2014 escalates if it survives a converged round"}:S={path:h,presence:"remote-only",cls:"pending-conflict",remoteSha:y,detail:"locally deleted AND the remote copy was edited"},l.push(S)}}return{discrepancies:l,inParity:u,filesChecked:d.size}}async classifyContentDiff(e,t,r,i,s,o,c,l,u){let f={localSha:r,remoteSha:i};if(o.has(t))return{path:t,presence:"both",cls:"quarantine-pinned",...f};if(s!==void 0&&s===r)return{path:t,presence:"both",cls:"pending-remote-edit",...f};if(s!==void 0&&s===i)return{path:t,presence:"both",cls:"pending-local-edit",...f};if(c)return{path:t,presence:"both",cls:"pending-conflict",...f,detail:"binary content differs on both sides"};if(!u.takeRepoFetch()||!u.runBudget.take(1))return u.warnings.push(`semantic-fetch cap reached \u2014 ${t} left unverified (counted into M2)`),{path:t,presence:"both",cls:"unverified-divergence",...f};let d=l.texts.get(t),h;try{h=await(0,wd.getBlobText)(this.transport,e.owner,e.repo,i,this.deps.baseURL)}catch(g){let y=this.deps.redact??(b=>b);return u.warnings.push(`blob fetch for ${t} failed (${y(_a(g))}) \u2014 left unverified`),{path:t,presence:"both",cls:"unverified-divergence",...f}}let p=(0,pF.compareAssetSemantics)(d??"",h,this.deps.yaml);return(0,pF.isFormatOnlyDrift)(p)?{path:t,presence:"both",cls:"format-only-drift",...f,frontmatterEqual:!0,bodyEqual:!0}:{path:t,presence:"both",cls:"pending-conflict",...f,frontmatterEqual:p.frontmatterEqual,bodyEqual:p.bodyEqual,detail:`semantic divergence (frontmatter ${p.frontmatterEqual?"equal":"differs"}, body ${p.bodyEqual?"equal":"differs"})`}}checkConservation(e,t,r,i,s,o){let c=t.snapshot?.dirtyByRepo.get(e.repoKey);if(c===void 0||c.size===0)return[];let l=new Set(o?.mergedPaths??[]),u=new Set(o?.quarantinedPaths??[]),f=[];for(let[d,h]of c)r.shas.get(d)!==h&&i.get(d)?.blobSha!==h&&(l.has(d)||u.has(d)||s.has(d)||f.push({repoKey:e.repoKey,path:d,kind:"conservation",detail:`pre-sync dirty content ${h.slice(0,7)} survived NOWHERE: disk now ${r.shas.get(d)?.slice(0,7)??"absent"}, not in head tree, not merged/quarantined/pinned \u2014 possible lost edit`}));return f}escalatePersistentDivergence(e,t,r){for(let i of e){if(i.status!=="checked")continue;let s=r?.find(u=>u.repoKey===i.repoKey);if(s!==void 0&&s.status!=="synced")continue;let o=new Set(s?.deferredDeletes??[]),c=t.repos.find(u=>u.repoKey===i.repoKey&&u.status==="checked");if(c===void 0)continue;let l=new Map(c.discrepancies.filter(u=>mF.has(u.cls)).map(u=>[u.path,u]));for(let u of i.discrepancies){if(!mF.has(u.cls)||u.cls==="deferred-local-delete"&&o.has(u.path))continue;let f=l.get(u.path);f!==void 0&&f.localSha===u.localSha&&f.remoteSha===u.remoteSha&&i.m1Violations.push({repoKey:i.repoKey,path:u.path,kind:"persistent-divergence",detail:`identical divergence (local ${u.localSha?.slice(0,7)??"absent"}, remote ${u.remoteSha?.slice(0,7)??"absent"}) survived a sync round unchanged (${f.cls} \u2192 ${u.cls}) \u2014 the engine failed to converge it`})}}}};vd.ParityValidator=WT;function aQ(n){if(n.vacuous)return`ExoSync parity: VACUOUS \u2014 0 of ${n.repos.length} repo(s) checked (errors / never synced)`;let e=n.repos.length-n.checkedRepos,t=e>0?`, ${e} skipped`:"";return n.ok?`ExoSync parity: M1=0, M2=\u2205 (${n.checkedRepos} repo(s) checked${t})`:`ExoSync parity: M1=${n.m1Total}, M2=${n.m2Total} diff(s) (${n.checkedRepos} repo(s) checked${t}) \u2014 see log`}a(aQ,"summarizeParityRound")});var bF=w(yF=>{"use strict";Object.defineProperty(yF,"__esModule",{value:!0})});var Ed=w(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=Or.KNOWN_CHECK_IDS=Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS=Or.CHECK_ID_UID_UNIQUENESS=Or.CHECK_ID_CO_LOCATION=Or.CHECK_ID_SHACL=void 0;Or.CHECK_ID_SHACL="f83ffedd-1f05-4ab5-839d-58873c69c4ba";Or.CHECK_ID_CO_LOCATION="61f95c82-f6fc-4b20-b06d-19f3dc1b1f12";Or.CHECK_ID_UID_UNIQUENESS="ac10db25-231c-4677-8cac-647d3cf15c64";Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS="a57f4a6b-a462-4c8d-b958-0dbee4674727";Or.KNOWN_CHECK_IDS=new Set([Or.CHECK_ID_SHACL,Or.CHECK_ID_CO_LOCATION,Or.CHECK_ID_UID_UNIQUENESS,Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS]);Or.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=new Set(["b04e7a3e-6b49-4984-9f8d-b74e9f36818b","2b754a16-cccf-49ee-af69-a18c6d1e3b63"])});var jy=w(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.readUid=cQ;Td.readIsDefinedByRef=lQ;Td.readInstanceClassRefs=uQ;var _F=ed();function cQ(n){let e=n.exo__Asset_uid;if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}a(cQ,"readUid");function lQ(n){return(0,_F.extractAssetReference)(n.exo__Asset_isDefinedBy)}a(lQ,"readIsDefinedByRef");function uQ(n){let e=n.exo__Instance_class,t=Array.isArray(e)?e:e==null?[]:[e],r=[];for(let i of t){let s=(0,_F.extractAssetReference)(i);s&&r.push(s)}return r}a(uQ,"readInstanceClassRefs")});var zT=w(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});HT.uidUniquenessCheck=dQ;var SF=jy(),fQ=Ed();function dQ(n){let e=new Map;for(let r of n.assets){let i=(0,SF.readUid)(r.frontmatter);if(!i||(0,SF.readInstanceClassRefs)(r.frontmatter).some(c=>fQ.UID_UNIQUENESS_WHITELIST_CLASS_UIDS.has(c)))continue;let o=e.get(i);o?o.push(r.path):e.set(i,[r.path])}let t=[];for(let[r,i]of e){if(i.length<2)continue;let s=[...i].sort();for(let o of s)t.push({path:o,message:`duplicate exo__Asset_uid "${r}" \u2014 also at ${s.filter(c=>c!==o).join(", ")}`})}return t}a(dQ,"uidUniquenessCheck")});var QT=w(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});KT.coLocationCheck=gQ;var wF=jy(),hQ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vF(n){let e=n.lastIndexOf("/");return e<0?"":n.slice(0,e)}a(vF,"dirOf");function pQ(n){let e=n.slice(n.lastIndexOf("/")+1);return e.endsWith(".md")?e.slice(0,-3):e}a(pQ,"baseNameNoExt");function mQ(n){return n.split("/").some(e=>e.toLowerCase()==="templates")}a(mQ,"isTemplatesPath");function gQ(n){let e=new Map,t=new Map;for(let s of n.assets){let o=(0,wF.readUid)(s.frontmatter);o&&!e.has(o)&&e.set(o,s.path);let c=pQ(s.path);t.has(c)||t.set(c,s.path)}let r=a(s=>hQ.test(s)?e.get(s)??t.get(s):t.get(s)??e.get(s),"resolve"),i=[];for(let s of n.assets){if(s.path.split("/").includes("node_modules")||mQ(s.path))continue;let o=(0,wF.readIsDefinedByRef)(s.frontmatter);if(!o||o.startsWith("!"))continue;let c=r(o);if(!c)continue;let l=vF(c),u=vF(s.path);l!==u&&i.push({path:s.path,message:`co-location: isDefinedBy=${o} expects folder "${l}/" but asset is in "${u}/"`})}return i}a(gQ,"coLocationCheck")});var XT=w(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});YT.shaclCheck=yQ;async function yQ(n){if(!n.runShacl)throw new Error("SHACL check is enabled but this context provides no triple-store (runShacl). Wire a warm getTripleStore()/runShapesValidation reader, or disable the check.");return(await n.runShacl()).map(t=>({path:t.focusNode??t.path,message:`SHACL: ${t.message}${t.path?` (path ${t.path})`:""}`}))}a(yQ,"shaclCheck")});var ZT=w(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});JT.dagOntologyImportsCheck=bQ;async function bQ(n){if(!n.runDag)throw new Error("DAG ontology-imports check is enabled but this context provides no graph derivation (runDag). Wire a reader that supplies it, or disable the check.");return[...await n.runDag()]}a(bQ,"dagOntologyImportsCheck")});var e2=w(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.CheckRegistry=void 0;Ad.createDefaultCheckRegistry=EQ;var $y=Ed(),_Q=zT(),SQ=QT(),wQ=XT(),vQ=ZT(),Uy=class{static{a(this,"CheckRegistry")}constructor(){this.entries=new Map}register(e){return this.entries.set(e.id,e),this}get(e){return this.entries.get(e)}has(e){return this.entries.has(e)}ids(){return[...this.entries.keys()]}};Ad.CheckRegistry=Uy;function EQ(){return new Uy().register({id:$y.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",run:_Q.uidUniquenessCheck}).register({id:$y.CHECK_ID_CO_LOCATION,label:"co-location",run:SQ.coLocationCheck}).register({id:$y.CHECK_ID_SHACL,label:"shacl",run:wQ.shaclCheck}).register({id:$y.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",run:vQ.dagOntologyImportsCheck})}a(EQ,"createDefaultCheckRegistry")});var EF=w(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.VaultCheckRunner=void 0;var TQ=e2(),t2=class{static{a(this,"VaultCheckRunner")}constructor(e=new TQ.CheckRegistry){this.registry=e}async run(e,t){let r=await e.read();return this.runWithContext(r,t)}async runWithContext(e,t){let r=[];for(let i of t){let s=this.registry.get(i);if(!s){r.push({checkId:i,label:i,status:"error",findings:[],errorMessage:`fail-loud: enabled check-id "${i}" has no registered runner`});continue}try{let o=await s.run(e);r.push({checkId:i,label:s.label,status:o.length>0?"fail":"pass",findings:o})}catch(o){r.push({checkId:i,label:s.label,status:"error",findings:[],errorMessage:`fail-loud: check "${s.label}" threw \u2014 ${o instanceof Error?o.message:String(o)}`})}}return{totalAssets:e.assets.length,results:r,ok:r.every(i=>i.status==="pass")}}};By.VaultCheckRunner=t2});var TF=w(r2=>{"use strict";Object.defineProperty(r2,"__esModule",{value:!0});r2.readEnabledCheckIds=xQ;var AQ=Ed(),IQ=ed();function xQ(n){let e=new Set;for(let t of n){let r=(0,IQ.extractAssetReference)(t.frontmatter.setting__Setting_key);if(!r||!AQ.KNOWN_CHECK_IDS.has(r))continue;let i=t.frontmatter.setting__Setting_value;(i===!0||i==="true")&&e.add(r)}return[...e]}a(xQ,"readEnabledCheckIds")});var xF=w(yt=>{"use strict";var RQ=yt&&yt.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),AF=yt&&yt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RQ(e,n,t)};Object.defineProperty(yt,"__esModule",{value:!0});yt.readInstanceClassRefs=yt.readIsDefinedByRef=yt.readUid=yt.dagOntologyImportsCheck=yt.shaclCheck=yt.coLocationCheck=yt.uidUniquenessCheck=yt.readEnabledCheckIds=yt.VaultCheckRunner=yt.createDefaultCheckRegistry=yt.CheckRegistry=void 0;AF(bF(),yt);AF(Ed(),yt);var IF=e2();Object.defineProperty(yt,"CheckRegistry",{enumerable:!0,get:a(function(){return IF.CheckRegistry},"get")});Object.defineProperty(yt,"createDefaultCheckRegistry",{enumerable:!0,get:a(function(){return IF.createDefaultCheckRegistry},"get")});var CQ=EF();Object.defineProperty(yt,"VaultCheckRunner",{enumerable:!0,get:a(function(){return CQ.VaultCheckRunner},"get")});var OQ=TF();Object.defineProperty(yt,"readEnabledCheckIds",{enumerable:!0,get:a(function(){return OQ.readEnabledCheckIds},"get")});var PQ=zT();Object.defineProperty(yt,"uidUniquenessCheck",{enumerable:!0,get:a(function(){return PQ.uidUniquenessCheck},"get")});var FQ=QT();Object.defineProperty(yt,"coLocationCheck",{enumerable:!0,get:a(function(){return FQ.coLocationCheck},"get")});var DQ=XT();Object.defineProperty(yt,"shaclCheck",{enumerable:!0,get:a(function(){return DQ.shaclCheck},"get")});var LQ=ZT();Object.defineProperty(yt,"dagOntologyImportsCheck",{enumerable:!0,get:a(function(){return LQ.dagOntologyImportsCheck},"get")});var n2=jy();Object.defineProperty(yt,"readUid",{enumerable:!0,get:a(function(){return n2.readUid},"get")});Object.defineProperty(yt,"readIsDefinedByRef",{enumerable:!0,get:a(function(){return n2.readIsDefinedByRef},"get")});Object.defineProperty(yt,"readInstanceClassRefs",{enumerable:!0,get:a(function(){return n2.readInstanceClassRefs},"get")})});var et=w(m=>{"use strict";var NQ=m&&m.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ri=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&NQ(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.createVaultFrontmatterClassLabelResolver=m.ServiceRegistry=m.GroundingExecutor=m.registerDefaultHostFunctions=m.hasUidFilename=m.hasNonUidFilename=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=m.transitiveDependsOnClosure=m.isTsFloorMountPath=m.isTsFloorAssetSpace=m.assertTsFloorReconciled=m.assertTsFloor=m.TsFloorViolationError=m.CATALOG_KEEP_NAMESPACES=m.PLUGIN_UI_FLOOR=m.SDK_FLOOR=m.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=m.SDK_FLOOR_ASSETSPACE_UIDS=m.TS_FLOOR_AS_UID_SHARED_IDENTITIES=m.TS_FLOOR_AS_UID_EXOCMD=m.TS_FLOOR_AS_UID_EXO=m.parseGroundingDefinitionFromFrontmatter=m.isCommandBindingFrontmatter=m.isGroundingFrontmatter=m.isPreconditionFrontmatter=m.isCommandFrontmatter=m.isStyleSource=m.isLabelClass=m.isCommandVariant=m.STYLE_SOURCE_VALUES=m.LABEL_CLASS_VALUES=m.COMMAND_VARIANT_VALUES=m.CommandBindingStyleProperty=m.CommandBindingProperty=m.GroundingProperty=m.PreconditionProperty=m.CommandProperty=m.resolveGroundingTypeFromWikilinkLiteral=m.resolveGroundingTypeFromIRI=m.GROUNDING_TYPE_IRI_TO_ENUM=m.GROUNDING_TYPE_UID_TO_ENUM=m.GROUNDING_TYPE_UIDS=m.GroundingType=m.EFFORT_STATUS_OPTIONS=void 0;m.GraphQueryService=m.FixMissingLabelService=m.ArchiveAssetService=m.GenericAssetCreationService=m.URIConstructionService=m.SessionEventService=m.AssetConversionService=m.EnumValueResolver=m.ClassHierarchyResolver=m.PropertySchemaResolver=m.PlanningService=m.AlgorithmExtractor=m.orderProperties=m.loadDefaultSpec=m.clearOrderSpecLoader=m.registerOrderSpecLoader=m.DynamicFrontmatterGenerator=m.SupervisionCreationService=m.StatusTimestampService=m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.extractAssetReference=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.stripTemplateFrontmatter=m.resolveTemplateBody=m.getRegisteredResolverIds=m.clearResolvers=m.registerResolver=m.getResolver=m.installDefaultResolvers=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.createTripleStoreRequiredPropertyResolver=m.CommandExecutionFlow=m.stripFrontmatter=m.extractSparqlBlock=m.iriToObsidianName=m.NamedQueryRunner=m.createVaultFrontmatterRefToFolderResolver=void 0;m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.isPathExcluded=m.normaliseExcludedFolders=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.MAX_LAZY_DEPTH=m.LazyAssetGraphLoader=m.FILE_SPACE_CLASS_UID=m.frontmatterDeclaresFileSpace=m.discoverFileSpaceExclusions=m.deriveLegacyFlatPath=m.derivePath=m.IRICanonicalizer=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=m.DomainTriple=m.DomainBlankNode=m.DomainLiteral=m.DomainIRI=m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=m.iriToVaultPath=m.vaultPathToIRI=m.NullLogger=m.RDFSerializer=m.FilenameValidator=m.EffortSortingHelpers=m.MetadataExtractor=m.MetadataHelpers=m.WikiLinkHelpers=m.DateFormatter=m.FrontmatterService=m.CriticalityZoneUUIDs=m.CriticalityZoneService=m.SPARQL_PREFIXES=m.TypeRegistry=void 0;m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.seededUidGenerator=m.liveUidGenerator=m.frozenClock=m.liveClock=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=m.CaseWhenTransformer=m.ResultSerializer=m.createIncrementalIndexer=m.IncrementalIndexer=m.createSPARQLResultCache=m.SPARQLResultCache=m.QueryPlanCache=m.createDoubleLiteral=m.createDecimalLiteral=m.getNumericValue=m.createPercentileAggregate=m.modeAggregate=m.stddevAggregate=m.varianceAggregate=m.medianAggregate=m.EXO_AGGREGATE_NS=m.BUILT_IN_AGGREGATES=m.CustomAggregateError=m.CustomAggregateRegistry=m.AggregateFunctions=m.BuiltInFunctions=m.SolutionMapping=m.UpdateExecutorError=m.UpdateExecutor=m.QueryExecutor=m.ExoQLQueryExecutor=m.DescribeExecutor=m.ConstructExecutor=m.UnionExecutor=m.OptionalExecutor=m.FilterExecutor=void 0;m.gitBlobSha=m.extractAssetUid=m.detectChanges=m.MATERIALIZE_PROGRESS_MIN_FILES=m.MATERIALIZE_PROGRESS_INTERVAL=m.escapeGitmodulesRegex=m.stripGitmodulesEntry=m.appendGitmodulesEntry=m.extractAssetSpaceSha=m.discoverAssetSpaceWrapperDir=m.mountAssetSpaceFiles=m.isBinaryPayload=m.restCreateCommit=m.parseTarballGzip=m.parseTarball=m.TripleClassHierarchy=m.ShaclShapeRegistry=m.shaclValidate=m.Namespace=m.ShapeRegistry=m.ShapeLoader=m.selectByPriority=m.LayoutSelector=m.isPropertiesBlock=m.isLayoutBlockFrontmatter=m.isBacklinksTableBlock=m.createLayoutBlockFromFrontmatter=m.PROPERTIES_BLOCK_CLASS_UID=m.PROPERTIES_BLOCK_CLASS_IRI=m.BACKLINKS_TABLE_BLOCK_CLASS_UID=m.BACKLINKS_TABLE_BLOCK_CLASS_IRI=m.isLayoutFrontmatter=m.isLayout=m.createLayoutFromFrontmatter=m.LAYOUT_CLASS_UID=m.LAYOUT_CLASS_IRI=m.ExoQLError=m.ExoQL=m.createStreamingSource=m.StreamingLoader=m.resetGlobalPool=m.getGlobalPool=m.MemoryPool=m.CompactGraphStore=m.StringTable=m.DEFAULT_COLORS=m.NODE_FLAGS=m.container=m.resetContainer=m.getContainer=void 0;m.ASSET_SPACE_CLASS_UID=m.OUTBOX_REMOTE_ABSENT=m.OUTBOX_STORE_FILENAME=m.LocalOutboxStore=m.CONFLICT_CACHE_STORE_FILENAME=m.LocalConflictCacheStore=m.scanForSecrets=m.redactSecrets=m.withRateLimitBackoff=m.isRateLimitError=m.isAuthError=m.MOUNT_BASE_STORE_FILENAME=m.FileMountBaseStore=m.WATERMARK_STORE_FILENAME=m.FileWatermarkStore=m.GatedStructuredMerger=m.MergeShaclGate=m.splitSections=m.StructuredMerger=m.diff3=m.LOCAL_MANIFEST_STORE_FILENAME=m.FileLocalManifestStore=m.isSyncablePath=m.isFileSpaceSyncablePath=m.contentEquals=m.InMemoryQuarantineStore=m.DEFAULT_MAX_FILE_BYTES=m.backupPathFor=m.QuarantineResolver=m.formatRepoTimings=m.formatTimingsLine=m.fmtMs=m.dominantPhase=m.totalMs=m.aggregateTimings=m.addTimings=m.emptyTimings=m.classifyRestPhase=m.SYNC_PHASES=m.SyncPhaseTimer=m.orderChildrenFirst=m.isNonFastForwardError=m.SyncEngine=m.DEFAULT_LOCAL_MANIFEST_REHASH_MS=m.DEFAULT_MAX_PUSH_RETRIES=m.getTree=m.getHeadSha=m.getCommitInfo=m.getBlobText=m.getBlobBytes=void 0;m.isFormatOnlyDrift=m.compareAssetSemantics=m.summarizeParityRound=m.ParityValidator=m.readSpaceSource=m.parseStrictGitHubRepoURL=m.isFileSpaceFrontmatter=m.isAssetSpaceFrontmatter=m.classifySpaceDeclaration=m.SpaceSpecAccumulator=m.SYNC_BRANCH=void 0;ri(tl(),m);ri(rl(),m);var kQ=d_();Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return kQ.EFFORT_STATUS_OPTIONS},"get")});var MQ=Ko();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:a(function(){return MQ.GroundingType},"get")});var Id=hf();Object.defineProperty(m,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(m,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(m,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(m,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(m,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromWikilinkLiteral},"get")});var xd=h_();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:a(function(){return xd.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:a(function(){return xd.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:a(function(){return xd.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:a(function(){return xd.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return xd.CommandBindingStyleProperty},"get")});var mu=p_();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return mu.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return mu.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return mu.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:a(function(){return mu.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:a(function(){return mu.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:a(function(){return mu.isStyleSource},"get")});var Vy=yx();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return Vy.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return Vy.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return Vy.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return Vy.isCommandBindingFrontmatter},"get")});var jQ=bx();Object.defineProperty(m,"parseGroundingDefinitionFromFrontmatter",{enumerable:!0,get:a(function(){return jQ.parseGroundingDefinitionFromFrontmatter},"get")});ri(_x(),m);ri(Sx(),m);ri(y_(),m);ri(b_(),m);ri(vx(),m);ri(Ax(),m);ri(Z_(),m);ri(iR(),m);var ni=sR();Object.defineProperty(m,"TS_FLOOR_AS_UID_EXO",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_EXO},"get")});Object.defineProperty(m,"TS_FLOOR_AS_UID_EXOCMD",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_EXOCMD},"get")});Object.defineProperty(m,"TS_FLOOR_AS_UID_SHARED_IDENTITIES",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_SHARED_IDENTITIES},"get")});Object.defineProperty(m,"SDK_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ni.SDK_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(m,"PLUGIN_UI_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ni.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(m,"SDK_FLOOR",{enumerable:!0,get:a(function(){return ni.SDK_FLOOR},"get")});Object.defineProperty(m,"PLUGIN_UI_FLOOR",{enumerable:!0,get:a(function(){return ni.PLUGIN_UI_FLOOR},"get")});Object.defineProperty(m,"CATALOG_KEEP_NAMESPACES",{enumerable:!0,get:a(function(){return ni.CATALOG_KEEP_NAMESPACES},"get")});Object.defineProperty(m,"TsFloorViolationError",{enumerable:!0,get:a(function(){return ni.TsFloorViolationError},"get")});Object.defineProperty(m,"assertTsFloor",{enumerable:!0,get:a(function(){return ni.assertTsFloor},"get")});Object.defineProperty(m,"assertTsFloorReconciled",{enumerable:!0,get:a(function(){return ni.assertTsFloorReconciled},"get")});Object.defineProperty(m,"isTsFloorAssetSpace",{enumerable:!0,get:a(function(){return ni.isTsFloorAssetSpace},"get")});Object.defineProperty(m,"isTsFloorMountPath",{enumerable:!0,get:a(function(){return ni.isTsFloorMountPath},"get")});var $Q=oR();Object.defineProperty(m,"transitiveDependsOnClosure",{enumerable:!0,get:a(function(){return $Q.transitiveDependsOnClosure},"get")});var RF=_p();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:a(function(){return RF.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:a(function(){return RF.rangeToFieldType},"get")});var i2=nS();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:a(function(){return i2.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:a(function(){return i2.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:a(function(){return i2.extractPropertyLabel},"get")});var UQ=zC();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:a(function(){return UQ.CommandResolver},"get")});var BQ=QC();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return BQ.PreconditionEvaluator},"get")});var s2=YC();Object.defineProperty(m,"hasNonUidFilename",{enumerable:!0,get:a(function(){return s2.hasNonUidFilename},"get")});Object.defineProperty(m,"hasUidFilename",{enumerable:!0,get:a(function(){return s2.hasUidFilename},"get")});Object.defineProperty(m,"registerDefaultHostFunctions",{enumerable:!0,get:a(function(){return s2.registerDefaultHostFunctions},"get")});var CF=rO();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:a(function(){return CF.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:a(function(){return CF.ServiceRegistry},"get")});var VQ=nO();Object.defineProperty(m,"createVaultFrontmatterClassLabelResolver",{enumerable:!0,get:a(function(){return VQ.createVaultFrontmatterClassLabelResolver},"get")});var qQ=iO();Object.defineProperty(m,"createVaultFrontmatterRefToFolderResolver",{enumerable:!0,get:a(function(){return qQ.createVaultFrontmatterRefToFolderResolver},"get")});var GQ=oO();Object.defineProperty(m,"NamedQueryRunner",{enumerable:!0,get:a(function(){return GQ.NamedQueryRunner},"get")});var WQ=jp();Object.defineProperty(m,"iriToObsidianName",{enumerable:!0,get:a(function(){return WQ.iriToObsidianName},"get")});var OF=aO();Object.defineProperty(m,"extractSparqlBlock",{enumerable:!0,get:a(function(){return OF.extractSparqlBlock},"get")});Object.defineProperty(m,"stripFrontmatter",{enumerable:!0,get:a(function(){return OF.stripFrontmatter},"get")});var HQ=lO();Object.defineProperty(m,"CommandExecutionFlow",{enumerable:!0,get:a(function(){return HQ.CommandExecutionFlow},"get")});var zQ=dO();Object.defineProperty(m,"createTripleStoreRequiredPropertyResolver",{enumerable:!0,get:a(function(){return zQ.createTripleStoreRequiredPropertyResolver},"get")});var KQ=N1();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:a(function(){return KQ.TaskStatusService},"get")});var QQ=$1();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:a(function(){return QQ.AreaCreationService},"get")});var YQ=B1();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return YQ.AreaHierarchyBuilder},"get")});var XQ=z1();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:a(function(){return XQ.ClassCreationService},"get")});var JQ=Q1();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:a(function(){return JQ.ConceptCreationService},"get")});var ZQ=pg();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return ZQ.EffortStatusWorkflow},"get")});var eY=Jf();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:a(function(){return eY.WorkflowEngine},"get")});var tY=E1();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:a(function(){return tY.WorkflowResolver},"get")});var Rd=Qm();Object.defineProperty(m,"installDefaultResolvers",{enumerable:!0,get:a(function(){return Rd.installDefaultResolvers},"get")});Object.defineProperty(m,"getResolver",{enumerable:!0,get:a(function(){return Rd.getResolver},"get")});Object.defineProperty(m,"registerResolver",{enumerable:!0,get:a(function(){return Rd.registerResolver},"get")});Object.defineProperty(m,"clearResolvers",{enumerable:!0,get:a(function(){return Rd.clearResolvers},"get")});Object.defineProperty(m,"getRegisteredResolverIds",{enumerable:!0,get:a(function(){return Rd.getRegisteredResolverIds},"get")});var PF=u1();Object.defineProperty(m,"resolveTemplateBody",{enumerable:!0,get:a(function(){return PF.resolveTemplateBody},"get")});Object.defineProperty(m,"stripTemplateFrontmatter",{enumerable:!0,get:a(function(){return PF.stripTemplateFrontmatter},"get")});var rY=CO();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return rY.InstantiationRuleResolver},"get")});var nY=OO();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:a(function(){return nY.VisibilityGenerator},"get")});var iY=PO();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return iY.WorkflowCommandAdapter},"get")});var sY=rv();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:a(function(){return sY.EffortVotingService},"get")});var oY=_g();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:a(function(){return oY.FolderRepairService},"get")});var aY=ed();Object.defineProperty(m,"extractAssetReference",{enumerable:!0,get:a(function(){return aY.extractAssetReference},"get")});var cY=fc();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:a(function(){return cY.LoggingService},"get")});var lY=sv();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:a(function(){return lY.PropertyCleanupService},"get")});var uY=av();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:a(function(){return uY.RenameToUidService},"get")});var fY=gg();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:a(function(){return fY.StatusTimestampService},"get")});var dY=uv();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:a(function(){return dY.SupervisionCreationService},"get")});var hY=dv();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return hY.DynamicFrontmatterGenerator},"get")});var qy=Hf();Object.defineProperty(m,"registerOrderSpecLoader",{enumerable:!0,get:a(function(){return qy.registerOrderSpecLoader},"get")});Object.defineProperty(m,"clearOrderSpecLoader",{enumerable:!0,get:a(function(){return qy.clearOrderSpecLoader},"get")});Object.defineProperty(m,"loadDefaultSpec",{enumerable:!0,get:a(function(){return qy.loadDefaultSpec},"get")});Object.defineProperty(m,"orderProperties",{enumerable:!0,get:a(function(){return qy.orderProperties},"get")});var pY=pv();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return pY.AlgorithmExtractor},"get")});var mY=gv();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:a(function(){return mY.PlanningService},"get")});var gY=BO();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return gY.PropertySchemaResolver},"get")});var yY=VO();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return yY.ClassHierarchyResolver},"get")});var bY=qO();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:a(function(){return bY.EnumValueResolver},"get")});var _Y=wv();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:a(function(){return _Y.AssetConversionService},"get")});var SY=Tv();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:a(function(){return SY.SessionEventService},"get")});var wY=xv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:a(function(){return wY.URIConstructionService},"get")});var vY=Cv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return vY.GenericAssetCreationService},"get")});var EY=ZO();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:a(function(){return EY.ArchiveAssetService},"get")});var TY=t3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:a(function(){return TY.FixMissingLabelService},"get")});var AY=r3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:a(function(){return AY.GraphQueryService},"get")});var IY=i3();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:a(function(){return IY.TypeRegistry},"get")});var xY=s3();Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return xY.SPARQL_PREFIXES},"get")});var FF=Nv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:a(function(){return FF.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return FF.CriticalityZoneUUIDs},"get")});var RY=Es();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:a(function(){return RY.FrontmatterService},"get")});var CY=jn();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:a(function(){return CY.DateFormatter},"get")});var OY=no();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return OY.WikiLinkHelpers},"get")});var PY=go();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:a(function(){return PY.MetadataHelpers},"get")});var FY=M1();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:a(function(){return FY.MetadataExtractor},"get")});var DY=a3();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return DY.EffortSortingHelpers},"get")});var LY=c3();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:a(function(){return LY.FilenameValidator},"get")});var NY=m3();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:a(function(){return NY.RDFSerializer},"get")});var kY=sl();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:a(function(){return kY.NullLogger},"get")});var o2=zv();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:a(function(){return o2.vaultPathToIRI},"get")});Object.defineProperty(m,"iriToVaultPath",{enumerable:!0,get:a(function(){return o2.iriToVaultPath},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return o2.OBSIDIAN_VAULT_SCHEME},"get")});var MY=P1();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return MY.InMemoryTripleStore},"get")});var jY=Oe();Object.defineProperty(m,"DomainIRI",{enumerable:!0,get:a(function(){return jY.IRI},"get")});var $Y=Ge();Object.defineProperty(m,"DomainLiteral",{enumerable:!0,get:a(function(){return $Y.Literal},"get")});var UY=jt();Object.defineProperty(m,"DomainBlankNode",{enumerable:!0,get:a(function(){return UY.BlankNode},"get")});var BY=Qn();Object.defineProperty(m,"DomainTriple",{enumerable:!0,get:a(function(){return BY.Triple},"get")});var VY=Qv();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return VY.RDFVocabularyMapper},"get")});var qY=y3();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return qY.RDFSInferenceEngine},"get")});var GY=Zv();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return GY.NonInheritablePropertyRegistry},"get")});var WY=rE();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return WY.PropertyCardinalityRegistry},"get")});var DF=sE();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return DF.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return DF.INFERRED_GRAPH},"get")});var HY=T3();Object.defineProperty(m,"IRICanonicalizer",{enumerable:!0,get:a(function(){return HY.IRICanonicalizer},"get")});var LF=kg();Object.defineProperty(m,"derivePath",{enumerable:!0,get:a(function(){return LF.derivePath},"get")});Object.defineProperty(m,"deriveLegacyFlatPath",{enumerable:!0,get:a(function(){return LF.deriveLegacyFlatPath},"get")});var a2=Mg();Object.defineProperty(m,"discoverFileSpaceExclusions",{enumerable:!0,get:a(function(){return a2.discoverFileSpaceExclusions},"get")});Object.defineProperty(m,"frontmatterDeclaresFileSpace",{enumerable:!0,get:a(function(){return a2.frontmatterDeclaresFileSpace},"get")});Object.defineProperty(m,"FILE_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return a2.FILE_SPACE_CLASS_UID},"get")});var NF=P3();Object.defineProperty(m,"LazyAssetGraphLoader",{enumerable:!0,get:a(function(){return NF.LazyAssetGraphLoader},"get")});Object.defineProperty(m,"MAX_LAZY_DEPTH",{enumerable:!0,get:a(function(){return NF.MAX_LAZY_DEPTH},"get")});var kF=fE();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:a(function(){return kF.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return kF.SOURCE_VARIABLE},"get")});var c2=mE();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return c2.NoteToRDFConverter},"get")});Object.defineProperty(m,"normaliseExcludedFolders",{enumerable:!0,get:a(function(){return c2.normaliseExcludedFolders},"get")});Object.defineProperty(m,"isPathExcluded",{enumerable:!0,get:a(function(){return c2.isPathExcluded},"get")});var l2=yl();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:a(function(){return l2.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:a(function(){return l2.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:a(function(){return l2.SPARQLParseError},"get")});var MF=rw();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return MF.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return MF.DescribeOptionsTransformerError},"get")});var jF=_l();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return jF.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:a(function(){return jF.AlgebraTranslator},"get")});var zY=j3();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return zY.AlgebraOptimizer},"get")});var KY=$3();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:a(function(){return KY.AlgebraSerializer},"get")});var QY=Sw();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:a(function(){return QY.BGPExecutor},"get")});var YY=Rm();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:a(function(){return YY.FilterExecutor},"get")});var XY=$w();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:a(function(){return XY.OptionalExecutor},"get")});var JY=Bw();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:a(function(){return JY.UnionExecutor},"get")});var ZY=Xw();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:a(function(){return ZY.ConstructExecutor},"get")});var eX=B3();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:a(function(){return eX.DescribeExecutor},"get")});var $F=Ul();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return $F.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:a(function(){return $F.QueryExecutor},"get")});var UF=q3();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:a(function(){return UF.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:a(function(){return UF.UpdateExecutorError},"get")});var tX=_s();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:a(function(){return tX.SolutionMapping},"get")});var rX=xm();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:a(function(){return rX.BuiltInFunctions},"get")});var nX=W3();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:a(function(){return nX.AggregateFunctions},"get")});var BF=Gw();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return BF.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:a(function(){return BF.CustomAggregateError},"get")});var Ns=Ww();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return Ns.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return Ns.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:a(function(){return Ns.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:a(function(){return Ns.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:a(function(){return Ns.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:a(function(){return Ns.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:a(function(){return Ns.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:a(function(){return Ns.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:a(function(){return Ns.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:a(function(){return Ns.createDoubleLiteral},"get")});var iX=H3();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:a(function(){return iX.QueryPlanCache},"get")});var VF=z3();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:a(function(){return VF.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return VF.createSPARQLResultCache},"get")});var qF=K3();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:a(function(){return qF.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return qF.createIncrementalIndexer},"get")});var sX=Q3();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:a(function(){return sX.ResultSerializer},"get")});var GF=ZS();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return GF.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return GF.CaseWhenTransformerError},"get")});var oX=ow();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return oX.VaultPrefixTransformer},"get")});var aX=yE();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return aX.FilterContainsOptimizer},"get")});var WF=Y3();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:a(function(){return WF.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return WF.FileAlreadyExistsError},"get")});var u2=x1();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return u2.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:a(function(){return u2.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:a(function(){return u2.TransactionError},"get")});var HF=qf();Object.defineProperty(m,"liveClock",{enumerable:!0,get:a(function(){return HF.liveClock},"get")});Object.defineProperty(m,"frozenClock",{enumerable:!0,get:a(function(){return HF.frozenClock},"get")});var zF=Hm();Object.defineProperty(m,"liveUidGenerator",{enumerable:!0,get:a(function(){return zF.liveUidGenerator},"get")});Object.defineProperty(m,"seededUidGenerator",{enumerable:!0,get:a(function(){return zF.seededUidGenerator},"get")});var Gy=OE();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:a(function(){return Gy.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return Gy.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return Gy.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return Gy.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var cX=Bt();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:a(function(){return cX.DI_TOKENS},"get")});var Cd=X3();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:a(function(){return Cd.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:a(function(){return Cd.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:a(function(){return Cd.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:a(function(){return Cd.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:a(function(){return Cd.container},"get")});var Po=nP();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:a(function(){return Po.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return Po.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:a(function(){return Po.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:a(function(){return Po.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:a(function(){return Po.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:a(function(){return Po.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:a(function(){return Po.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:a(function(){return Po.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:a(function(){return Po.createStreamingSource},"get")});var KF=iP();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:a(function(){return KF.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:a(function(){return KF.ExoQLError},"get")});var Od=VE();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Od.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Od.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Od.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:a(function(){return Od.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Od.isLayoutFrontmatter},"get")});var Sa=VE();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Sa.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Sa.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Sa.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Sa.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Sa.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Sa.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Sa.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Sa.isPropertiesBlock},"get")});var QF=fP();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:a(function(){return QF.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:a(function(){return QF.selectByPriority},"get")});ri(SP(),m);var lX=wP();Object.defineProperty(m,"ShapeLoader",{enumerable:!0,get:a(function(){return lX.ShapeLoader},"get")});var uX=ZE();Object.defineProperty(m,"ShapeRegistry",{enumerable:!0,get:a(function(){return uX.ShapeRegistry},"get")});var fX=zt();Object.defineProperty(m,"Namespace",{enumerable:!0,get:a(function(){return fX.Namespace},"get")});var YF=iT();Object.defineProperty(m,"shaclValidate",{enumerable:!0,get:a(function(){return YF.validate},"get")});Object.defineProperty(m,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return YF.ShapeRegistry},"get")});ri(EP(),m);var dX=TP();Object.defineProperty(m,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return dX.ClassHierarchy},"get")});var XF=cT();Object.defineProperty(m,"parseTarball",{enumerable:!0,get:a(function(){return XF.parseTarball},"get")});Object.defineProperty(m,"parseTarballGzip",{enumerable:!0,get:a(function(){return XF.parseTarballGzip},"get")});var JF=Sy();Object.defineProperty(m,"restCreateCommit",{enumerable:!0,get:a(function(){return JF.restCreateCommit},"get")});Object.defineProperty(m,"isBinaryPayload",{enumerable:!0,get:a(function(){return JF.isBinaryPayload},"get")});var wa=PP();Object.defineProperty(m,"mountAssetSpaceFiles",{enumerable:!0,get:a(function(){return wa.mountAssetSpaceFiles},"get")});Object.defineProperty(m,"discoverAssetSpaceWrapperDir",{enumerable:!0,get:a(function(){return wa.discoverWrapperDir},"get")});Object.defineProperty(m,"extractAssetSpaceSha",{enumerable:!0,get:a(function(){return wa.extractShaFromWrapper},"get")});Object.defineProperty(m,"appendGitmodulesEntry",{enumerable:!0,get:a(function(){return wa.appendGitmodulesEntry},"get")});Object.defineProperty(m,"stripGitmodulesEntry",{enumerable:!0,get:a(function(){return wa.stripGitmodulesEntry},"get")});Object.defineProperty(m,"escapeGitmodulesRegex",{enumerable:!0,get:a(function(){return wa.escapeGitmodulesRegex},"get")});Object.defineProperty(m,"MATERIALIZE_PROGRESS_INTERVAL",{enumerable:!0,get:a(function(){return wa.MATERIALIZE_PROGRESS_INTERVAL},"get")});Object.defineProperty(m,"MATERIALIZE_PROGRESS_MIN_FILES",{enumerable:!0,get:a(function(){return wa.MATERIALIZE_PROGRESS_MIN_FILES},"get")});var ZF=Ey();Object.defineProperty(m,"detectChanges",{enumerable:!0,get:a(function(){return ZF.detectChanges},"get")});Object.defineProperty(m,"extractAssetUid",{enumerable:!0,get:a(function(){return ZF.extractAssetUid},"get")});var hX=lu();Object.defineProperty(m,"gitBlobSha",{enumerable:!0,get:a(function(){return hX.gitBlobSha},"get")});var Pd=hd();Object.defineProperty(m,"getBlobBytes",{enumerable:!0,get:a(function(){return Pd.getBlobBytes},"get")});Object.defineProperty(m,"getBlobText",{enumerable:!0,get:a(function(){return Pd.getBlobText},"get")});Object.defineProperty(m,"getCommitInfo",{enumerable:!0,get:a(function(){return Pd.getCommitInfo},"get")});Object.defineProperty(m,"getHeadSha",{enumerable:!0,get:a(function(){return Pd.getHeadSha},"get")});Object.defineProperty(m,"getTree",{enumerable:!0,get:a(function(){return Pd.getTree},"get")});var Fd=HP();Object.defineProperty(m,"DEFAULT_MAX_PUSH_RETRIES",{enumerable:!0,get:a(function(){return Fd.DEFAULT_MAX_PUSH_RETRIES},"get")});Object.defineProperty(m,"DEFAULT_LOCAL_MANIFEST_REHASH_MS",{enumerable:!0,get:a(function(){return Fd.DEFAULT_LOCAL_MANIFEST_REHASH_MS},"get")});Object.defineProperty(m,"SyncEngine",{enumerable:!0,get:a(function(){return Fd.SyncEngine},"get")});Object.defineProperty(m,"isNonFastForwardError",{enumerable:!0,get:a(function(){return Fd.isNonFastForwardError},"get")});Object.defineProperty(m,"orderChildrenFirst",{enumerable:!0,get:a(function(){return Fd.orderChildrenFirst},"get")});var Ji=gT();Object.defineProperty(m,"SyncPhaseTimer",{enumerable:!0,get:a(function(){return Ji.SyncPhaseTimer},"get")});Object.defineProperty(m,"SYNC_PHASES",{enumerable:!0,get:a(function(){return Ji.SYNC_PHASES},"get")});Object.defineProperty(m,"classifyRestPhase",{enumerable:!0,get:a(function(){return Ji.classifyRestPhase},"get")});Object.defineProperty(m,"emptyTimings",{enumerable:!0,get:a(function(){return Ji.emptyTimings},"get")});Object.defineProperty(m,"addTimings",{enumerable:!0,get:a(function(){return Ji.addTimings},"get")});Object.defineProperty(m,"aggregateTimings",{enumerable:!0,get:a(function(){return Ji.aggregateTimings},"get")});Object.defineProperty(m,"totalMs",{enumerable:!0,get:a(function(){return Ji.totalMs},"get")});Object.defineProperty(m,"dominantPhase",{enumerable:!0,get:a(function(){return Ji.dominantPhase},"get")});Object.defineProperty(m,"fmtMs",{enumerable:!0,get:a(function(){return Ji.fmtMs},"get")});Object.defineProperty(m,"formatTimingsLine",{enumerable:!0,get:a(function(){return Ji.formatTimingsLine},"get")});Object.defineProperty(m,"formatRepoTimings",{enumerable:!0,get:a(function(){return Ji.formatRepoTimings},"get")});var eD=KP();Object.defineProperty(m,"QuarantineResolver",{enumerable:!0,get:a(function(){return eD.QuarantineResolver},"get")});Object.defineProperty(m,"backupPathFor",{enumerable:!0,get:a(function(){return eD.backupPathFor},"get")});var Dd=Oy();Object.defineProperty(m,"DEFAULT_MAX_FILE_BYTES",{enumerable:!0,get:a(function(){return Dd.DEFAULT_MAX_FILE_BYTES},"get")});Object.defineProperty(m,"InMemoryQuarantineStore",{enumerable:!0,get:a(function(){return Dd.InMemoryQuarantineStore},"get")});Object.defineProperty(m,"contentEquals",{enumerable:!0,get:a(function(){return Dd.contentEquals},"get")});Object.defineProperty(m,"isFileSpaceSyncablePath",{enumerable:!0,get:a(function(){return Dd.isFileSpaceSyncablePath},"get")});Object.defineProperty(m,"isSyncablePath",{enumerable:!0,get:a(function(){return Dd.isSyncablePath},"get")});var tD=QP();Object.defineProperty(m,"FileLocalManifestStore",{enumerable:!0,get:a(function(){return tD.FileLocalManifestStore},"get")});Object.defineProperty(m,"LOCAL_MANIFEST_STORE_FILENAME",{enumerable:!0,get:a(function(){return tD.LOCAL_MANIFEST_STORE_FILENAME},"get")});var pX=OT();Object.defineProperty(m,"diff3",{enumerable:!0,get:a(function(){return pX.diff3},"get")});var rD=JP();Object.defineProperty(m,"StructuredMerger",{enumerable:!0,get:a(function(){return rD.StructuredMerger},"get")});Object.defineProperty(m,"splitSections",{enumerable:!0,get:a(function(){return rD.splitSections},"get")});var mX=ZP();Object.defineProperty(m,"MergeShaclGate",{enumerable:!0,get:a(function(){return mX.MergeShaclGate},"get")});var gX=eF();Object.defineProperty(m,"GatedStructuredMerger",{enumerable:!0,get:a(function(){return gX.GatedStructuredMerger},"get")});var nD=tF();Object.defineProperty(m,"FileWatermarkStore",{enumerable:!0,get:a(function(){return nD.FileWatermarkStore},"get")});Object.defineProperty(m,"WATERMARK_STORE_FILENAME",{enumerable:!0,get:a(function(){return nD.WATERMARK_STORE_FILENAME},"get")});var iD=rF();Object.defineProperty(m,"FileMountBaseStore",{enumerable:!0,get:a(function(){return iD.FileMountBaseStore},"get")});Object.defineProperty(m,"MOUNT_BASE_STORE_FILENAME",{enumerable:!0,get:a(function(){return iD.MOUNT_BASE_STORE_FILENAME},"get")});var yX=Iy();Object.defineProperty(m,"isAuthError",{enumerable:!0,get:a(function(){return yX.isAuthError},"get")});var sD=Cy();Object.defineProperty(m,"isRateLimitError",{enumerable:!0,get:a(function(){return sD.isRateLimitError},"get")});Object.defineProperty(m,"withRateLimitBackoff",{enumerable:!0,get:a(function(){return sD.withRateLimitBackoff},"get")});var oD=ST();Object.defineProperty(m,"redactSecrets",{enumerable:!0,get:a(function(){return oD.redactSecrets},"get")});Object.defineProperty(m,"scanForSecrets",{enumerable:!0,get:a(function(){return oD.scanForSecrets},"get")});var aD=nF();Object.defineProperty(m,"LocalConflictCacheStore",{enumerable:!0,get:a(function(){return aD.LocalConflictCacheStore},"get")});Object.defineProperty(m,"CONFLICT_CACHE_STORE_FILENAME",{enumerable:!0,get:a(function(){return aD.CONFLICT_CACHE_STORE_FILENAME},"get")});var f2=Ay();Object.defineProperty(m,"LocalOutboxStore",{enumerable:!0,get:a(function(){return f2.LocalOutboxStore},"get")});Object.defineProperty(m,"OUTBOX_STORE_FILENAME",{enumerable:!0,get:a(function(){return f2.OUTBOX_STORE_FILENAME},"get")});Object.defineProperty(m,"OUTBOX_REMOTE_ABSENT",{enumerable:!0,get:a(function(){return f2.OUTBOX_REMOTE_ABSENT},"get")});var va=uF();Object.defineProperty(m,"ASSET_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return va.ASSET_SPACE_CLASS_UID},"get")});Object.defineProperty(m,"SYNC_BRANCH",{enumerable:!0,get:a(function(){return va.SYNC_BRANCH},"get")});Object.defineProperty(m,"SpaceSpecAccumulator",{enumerable:!0,get:a(function(){return va.SpaceSpecAccumulator},"get")});Object.defineProperty(m,"classifySpaceDeclaration",{enumerable:!0,get:a(function(){return va.classifySpaceDeclaration},"get")});Object.defineProperty(m,"isAssetSpaceFrontmatter",{enumerable:!0,get:a(function(){return va.isAssetSpaceFrontmatter},"get")});Object.defineProperty(m,"isFileSpaceFrontmatter",{enumerable:!0,get:a(function(){return va.isFileSpaceFrontmatter},"get")});Object.defineProperty(m,"parseStrictGitHubRepoURL",{enumerable:!0,get:a(function(){return va.parseStrictGitHubRepoURL},"get")});Object.defineProperty(m,"readSpaceSource",{enumerable:!0,get:a(function(){return va.readSpaceSource},"get")});var cD=gF();Object.defineProperty(m,"ParityValidator",{enumerable:!0,get:a(function(){return cD.ParityValidator},"get")});Object.defineProperty(m,"summarizeParityRound",{enumerable:!0,get:a(function(){return cD.summarizeParityRound},"get")});var lD=GT();Object.defineProperty(m,"compareAssetSemantics",{enumerable:!0,get:a(function(){return lD.compareAssetSemantics},"get")});Object.defineProperty(m,"isFormatOnlyDrift",{enumerable:!0,get:a(function(){return lD.isFormatOnlyDrift},"get")});ri(xF(),m)});var Pr=w(d2=>{"use strict";d2.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})};d2.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 fD=w((Ube,uD)=>{var Ea=require("constants"),bX=process.cwd,Wy=null,_X=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Wy||(Wy=bX.call(process)),Wy};try{process.cwd()}catch{}typeof process.chdir=="function"&&(h2=process.chdir,process.chdir=function(n){Wy=null,h2.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,h2));var h2;uD.exports=SX;function SX(n){Ea.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=o(n.chownSync),n.fchownSync=o(n.fchownSync),n.lchownSync=o(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,d,h){h&&process.nextTick(h)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,d,h,p){p&&process.nextTick(p)},n.lchownSync=function(){}),_X==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,g){var y=Date.now(),b=0;f(h,p,a(function S(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){n.stat(p,function(I,A){I&&I.code==="ENOENT"?f(h,p,S):g(v)})},b),b<100&&(b+=10);return}g&&g(v)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function d(h,p,g,y,b,S){var v;if(S&&typeof S=="function"){var I=0;v=a(function(A,T,R){if(A&&A.code==="EAGAIN"&&I<10)return I++,f.call(n,h,p,g,y,b,v);S.apply(this,arguments)},"callback")}return f.call(n,h,p,g,y,b,v)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(d,h,p,g,y){for(var b=0;;)try{return f.call(n,d,h,p,g,y)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Ea.O_WRONLY|Ea.O_SYMLINK,h,function(g,y){if(g){p&&p(g);return}f.fchmod(y,h,function(b){f.close(y,function(S){p&&p(b||S)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Ea.O_WRONLY|Ea.O_SYMLINK,h),g=!0,y;try{y=f.fchmodSync(p,h),g=!1}finally{if(g)try{f.closeSync(p)}catch{}else f.closeSync(p)}return y}}a(e,"patchLchmod");function t(f){Ea.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,g){f.open(d,Ea.O_SYMLINK,function(y,b){if(y){g&&g(y);return}f.futimes(b,h,p,function(S){f.close(b,function(v){g&&g(S||v)})})})},f.lutimesSync=function(d,h,p){var g=f.openSync(d,Ea.O_SYMLINK),y,b=!0;try{y=f.futimesSync(g,h,p),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}):f.futimes&&(f.lutimes=function(d,h,p,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}a(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(g){u(g)&&(g=null),p&&p.apply(this,arguments)})}}a(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}a(i,"chmodFixSync");function s(f){return f&&function(d,h,p,g){return f.call(n,d,h,p,function(y){u(y)&&(y=null),g&&g.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(g){if(!u(g))throw g}}}a(o,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function g(y,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),p&&p.apply(this,arguments)}return a(g,"callback"),h?f.call(n,d,h,g):f.call(n,d,g)}}a(c,"statFix");function l(f){return f&&function(d,h){var p=h?f.call(n,d,h):f.call(n,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(SX,"patch")});var pD=w((Vbe,hD)=>{var dD=require("stream").Stream;hD.exports=wX;function wX(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);dD.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 o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[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,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(r,i){if(!(this instanceof t))return new t(r,i);dD.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),o=0,c=s.length;o<c;o++){var l=s[o];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())}}a(wX,"legacy")});var gD=w((Gbe,mD)=>{"use strict";mD.exports=EX;var vX=Object.getPrototypeOf||function(n){return n.__proto__};function EX(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:vX(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}a(EX,"clone")});var yu=w((Hbe,g2)=>{var qt=require("fs"),TX=fD(),AX=pD(),IX=gD(),Hy=require("util"),Hr,Ky;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Hr=Symbol.for("graceful-fs.queue"),Ky=Symbol.for("graceful-fs.previous")):(Hr="___graceful-fs.queue",Ky="___graceful-fs.previous");function xX(){}a(xX,"noop");function _D(n,e){Object.defineProperty(n,Hr,{get:a(function(){return e},"get")})}a(_D,"publishQueue");var Rc=xX;Hy.debuglog?Rc=Hy.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Rc=a(function(){var n=Hy.format.apply(Hy,arguments);n="GFS4: "+n.split(/\n/).join(`
|
|
324
|
+
`);M=O===Y}return o("checked",{filesChecked:T,inParity:A,discrepancies:I,m2SemanticDiffs:L,accountedCount:P,m1Violations:B,headSha:u,...M!==void 0?{attachmentHashSetIdentical:M}:{}})}catch(l){return(0,tQ.isAuthError)(l)?o("auth-required",{detail:s(`authentication failed: ${_a(l)} \u2014 the PAT is expired, revoked or under-scoped; update it (R8)`)}):oQ(l)?(i.push("repo unreachable (HTTP 404): dead AssetSpace pointer, or the fine-grained PAT does not allowlist this repo \u2014 skipped"),o("error",{detail:s(_a(l))})):(i.push(`parity check failed: ${s(_a(l))}`),o("error",{detail:s(_a(l))}))}}async readLocalSnapshot(e,t){let r=this.deps.localFilesFor(e),i=t?pu.isFileSpaceSyncablePath:pu.isSyncablePath,s=this.deps.maxFileBytes??pu.DEFAULT_MAX_FILE_BYTES,o=new Map,c=new Map,l=[];if(t&&r.readBinary===void 0)throw new Error("file-mode repo requires a LocalFilesPort with readBinary \u2014 refusing to hash through the text-only port (binary would corrupt)");let u=new TextEncoder;for(let f of await r.list())if(i(f))try{if(t){let d=await r.readBinary(f);if(d.byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}o.set(f,await(0,hF.gitBlobSha)(d,this.deps.sha1))}else{let d=await r.read(f);if(u.encode(d).byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}c.set(f,d),o.set(f,await(0,hF.gitBlobSha)(d,this.deps.sha1))}}catch(d){let h=this.deps.redact??(p=>p);l.push(`local ${f} unreadable (${h(_a(d))}) \u2014 skipped`)}return{shas:o,texts:c,warnings:l}}async classifyAll(e,t,r,i,s,o,c){let l=[],u=0,f=this.deps.maxSemanticFetchesPerRepo??nQ,d=new Set([...t.shas.keys(),...r.keys()]);for(let h of[...d].sort()){let p=t.shas.get(h),y=r.get(h)?.blobSha,b=i.get(h);if(p!==void 0&&y!==void 0){if(p===y){u++;continue}l.push(await this.classifyContentDiff(e,h,p,y,b,s,o,t,{...c,takeRepoFetch:a(()=>f-- >0,"takeRepoFetch")}));continue}if(p!==void 0){let S;s.has(h)?S={path:h,presence:"local-only",cls:"quarantine-pinned",localSha:p}:b===void 0?S={path:h,presence:"local-only",cls:"pending-local-add",localSha:p}:b===p?S={path:h,presence:"local-only",cls:"pending-remote-delete",localSha:p,detail:"remote deleted it; the local copy is unchanged"}:S={path:h,presence:"local-only",cls:"pending-conflict",localSha:p,detail:"remote deleted it AND the local copy was edited"},l.push(S);continue}if(y!==void 0){let S;s.has(h)?S={path:h,presence:"remote-only",cls:"quarantine-pinned",remoteSha:y}:b===void 0?S={path:h,presence:"remote-only",cls:"pending-remote-add",remoteSha:y}:b===y?S={path:h,presence:"remote-only",cls:"deferred-local-delete",remoteSha:y,detail:"locally deleted; the delete propagates on the next sync (#3476) \u2014 escalates if it survives a converged round"}:S={path:h,presence:"remote-only",cls:"pending-conflict",remoteSha:y,detail:"locally deleted AND the remote copy was edited"},l.push(S)}}return{discrepancies:l,inParity:u,filesChecked:d.size}}async classifyContentDiff(e,t,r,i,s,o,c,l,u){let f={localSha:r,remoteSha:i};if(o.has(t))return{path:t,presence:"both",cls:"quarantine-pinned",...f};if(s!==void 0&&s===r)return{path:t,presence:"both",cls:"pending-remote-edit",...f};if(s!==void 0&&s===i)return{path:t,presence:"both",cls:"pending-local-edit",...f};if(c)return{path:t,presence:"both",cls:"pending-conflict",...f,detail:"binary content differs on both sides"};if(!u.takeRepoFetch()||!u.runBudget.take(1))return u.warnings.push(`semantic-fetch cap reached \u2014 ${t} left unverified (counted into M2)`),{path:t,presence:"both",cls:"unverified-divergence",...f};let d=l.texts.get(t),h;try{h=await(0,wd.getBlobText)(this.transport,e.owner,e.repo,i,this.deps.baseURL)}catch(g){let y=this.deps.redact??(b=>b);return u.warnings.push(`blob fetch for ${t} failed (${y(_a(g))}) \u2014 left unverified`),{path:t,presence:"both",cls:"unverified-divergence",...f}}let p=(0,pF.compareAssetSemantics)(d??"",h,this.deps.yaml);return(0,pF.isFormatOnlyDrift)(p)?{path:t,presence:"both",cls:"format-only-drift",...f,frontmatterEqual:!0,bodyEqual:!0}:{path:t,presence:"both",cls:"pending-conflict",...f,frontmatterEqual:p.frontmatterEqual,bodyEqual:p.bodyEqual,detail:`semantic divergence (frontmatter ${p.frontmatterEqual?"equal":"differs"}, body ${p.bodyEqual?"equal":"differs"})`}}checkConservation(e,t,r,i,s,o){let c=t.snapshot?.dirtyByRepo.get(e.repoKey);if(c===void 0||c.size===0)return[];let l=new Set(o?.mergedPaths??[]),u=new Set(o?.quarantinedPaths??[]),f=[];for(let[d,h]of c)r.shas.get(d)!==h&&i.get(d)?.blobSha!==h&&(l.has(d)||u.has(d)||s.has(d)||f.push({repoKey:e.repoKey,path:d,kind:"conservation",detail:`pre-sync dirty content ${h.slice(0,7)} survived NOWHERE: disk now ${r.shas.get(d)?.slice(0,7)??"absent"}, not in head tree, not merged/quarantined/pinned \u2014 possible lost edit`}));return f}escalatePersistentDivergence(e,t,r){for(let i of e){if(i.status!=="checked")continue;let s=r?.find(u=>u.repoKey===i.repoKey);if(s!==void 0&&s.status!=="synced")continue;let o=new Set(s?.deferredDeletes??[]),c=t.repos.find(u=>u.repoKey===i.repoKey&&u.status==="checked");if(c===void 0)continue;let l=new Map(c.discrepancies.filter(u=>mF.has(u.cls)).map(u=>[u.path,u]));for(let u of i.discrepancies){if(!mF.has(u.cls)||u.cls==="deferred-local-delete"&&o.has(u.path))continue;let f=l.get(u.path);f!==void 0&&f.localSha===u.localSha&&f.remoteSha===u.remoteSha&&i.m1Violations.push({repoKey:i.repoKey,path:u.path,kind:"persistent-divergence",detail:`identical divergence (local ${u.localSha?.slice(0,7)??"absent"}, remote ${u.remoteSha?.slice(0,7)??"absent"}) survived a sync round unchanged (${f.cls} \u2192 ${u.cls}) \u2014 the engine failed to converge it`})}}}};vd.ParityValidator=WT;function aQ(n){if(n.vacuous)return`ExoSync parity: VACUOUS \u2014 0 of ${n.repos.length} repo(s) checked (errors / never synced)`;let e=n.repos.length-n.checkedRepos,t=e>0?`, ${e} skipped`:"";return n.ok?`ExoSync parity: M1=0, M2=\u2205 (${n.checkedRepos} repo(s) checked${t})`:`ExoSync parity: M1=${n.m1Total}, M2=${n.m2Total} diff(s) (${n.checkedRepos} repo(s) checked${t}) \u2014 see log`}a(aQ,"summarizeParityRound")});var bF=w(yF=>{"use strict";Object.defineProperty(yF,"__esModule",{value:!0})});var Ed=w(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=Or.KNOWN_CHECK_IDS=Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS=Or.CHECK_ID_UID_UNIQUENESS=Or.CHECK_ID_CO_LOCATION=Or.CHECK_ID_SHACL=void 0;Or.CHECK_ID_SHACL="f83ffedd-1f05-4ab5-839d-58873c69c4ba";Or.CHECK_ID_CO_LOCATION="61f95c82-f6fc-4b20-b06d-19f3dc1b1f12";Or.CHECK_ID_UID_UNIQUENESS="ac10db25-231c-4677-8cac-647d3cf15c64";Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS="a57f4a6b-a462-4c8d-b958-0dbee4674727";Or.KNOWN_CHECK_IDS=new Set([Or.CHECK_ID_SHACL,Or.CHECK_ID_CO_LOCATION,Or.CHECK_ID_UID_UNIQUENESS,Or.CHECK_ID_DAG_ONTOLOGY_IMPORTS]);Or.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=new Set(["b04e7a3e-6b49-4984-9f8d-b74e9f36818b","2b754a16-cccf-49ee-af69-a18c6d1e3b63"])});var jy=w(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.readUid=cQ;Td.readIsDefinedByRef=lQ;Td.readInstanceClassRefs=uQ;var _F=ed();function cQ(n){let e=n.exo__Asset_uid;if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}a(cQ,"readUid");function lQ(n){return(0,_F.extractAssetReference)(n.exo__Asset_isDefinedBy)}a(lQ,"readIsDefinedByRef");function uQ(n){let e=n.exo__Instance_class,t=Array.isArray(e)?e:e==null?[]:[e],r=[];for(let i of t){let s=(0,_F.extractAssetReference)(i);s&&r.push(s)}return r}a(uQ,"readInstanceClassRefs")});var zT=w(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});HT.uidUniquenessCheck=dQ;var SF=jy(),fQ=Ed();function dQ(n){let e=new Map;for(let r of n.assets){let i=(0,SF.readUid)(r.frontmatter);if(!i||(0,SF.readInstanceClassRefs)(r.frontmatter).some(c=>fQ.UID_UNIQUENESS_WHITELIST_CLASS_UIDS.has(c)))continue;let o=e.get(i);o?o.push(r.path):e.set(i,[r.path])}let t=[];for(let[r,i]of e){if(i.length<2)continue;let s=[...i].sort();for(let o of s)t.push({path:o,message:`duplicate exo__Asset_uid "${r}" \u2014 also at ${s.filter(c=>c!==o).join(", ")}`})}return t}a(dQ,"uidUniquenessCheck")});var QT=w(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});KT.coLocationCheck=gQ;var wF=jy(),hQ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vF(n){let e=n.lastIndexOf("/");return e<0?"":n.slice(0,e)}a(vF,"dirOf");function pQ(n){let e=n.slice(n.lastIndexOf("/")+1);return e.endsWith(".md")?e.slice(0,-3):e}a(pQ,"baseNameNoExt");function mQ(n){return n.split("/").some(e=>e.toLowerCase()==="templates")}a(mQ,"isTemplatesPath");function gQ(n){let e=new Map,t=new Map;for(let s of n.assets){let o=(0,wF.readUid)(s.frontmatter);o&&!e.has(o)&&e.set(o,s.path);let c=pQ(s.path);t.has(c)||t.set(c,s.path)}let r=a(s=>hQ.test(s)?e.get(s)??t.get(s):t.get(s)??e.get(s),"resolve"),i=[];for(let s of n.assets){if(s.path.split("/").includes("node_modules")||mQ(s.path))continue;let o=(0,wF.readIsDefinedByRef)(s.frontmatter);if(!o||o.startsWith("!"))continue;let c=r(o);if(!c)continue;let l=vF(c),u=vF(s.path);l!==u&&i.push({path:s.path,message:`co-location: isDefinedBy=${o} expects folder "${l}/" but asset is in "${u}/"`})}return i}a(gQ,"coLocationCheck")});var XT=w(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});YT.shaclCheck=yQ;async function yQ(n){if(!n.runShacl)throw new Error("SHACL check is enabled but this context provides no triple-store (runShacl). Wire a warm getTripleStore()/runShapesValidation reader, or disable the check.");return(await n.runShacl()).map(t=>({path:t.focusNode??t.path,message:`SHACL: ${t.message}${t.path?` (path ${t.path})`:""}`}))}a(yQ,"shaclCheck")});var ZT=w(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});JT.dagOntologyImportsCheck=bQ;async function bQ(n){if(!n.runDag)throw new Error("DAG ontology-imports check is enabled but this context provides no graph derivation (runDag). Wire a reader that supplies it, or disable the check.");return[...await n.runDag()]}a(bQ,"dagOntologyImportsCheck")});var e2=w(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.CheckRegistry=void 0;Ad.createDefaultCheckRegistry=EQ;var $y=Ed(),_Q=zT(),SQ=QT(),wQ=XT(),vQ=ZT(),Uy=class{static{a(this,"CheckRegistry")}constructor(){this.entries=new Map}register(e){return this.entries.set(e.id,e),this}get(e){return this.entries.get(e)}has(e){return this.entries.has(e)}ids(){return[...this.entries.keys()]}};Ad.CheckRegistry=Uy;function EQ(){return new Uy().register({id:$y.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",run:_Q.uidUniquenessCheck}).register({id:$y.CHECK_ID_CO_LOCATION,label:"co-location",run:SQ.coLocationCheck}).register({id:$y.CHECK_ID_SHACL,label:"shacl",run:wQ.shaclCheck}).register({id:$y.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",run:vQ.dagOntologyImportsCheck})}a(EQ,"createDefaultCheckRegistry")});var EF=w(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.VaultCheckRunner=void 0;var TQ=e2(),t2=class{static{a(this,"VaultCheckRunner")}constructor(e=new TQ.CheckRegistry){this.registry=e}async run(e,t){let r=await e.read();return this.runWithContext(r,t)}async runWithContext(e,t){let r=[];for(let i of t){let s=this.registry.get(i);if(!s){r.push({checkId:i,label:i,status:"error",findings:[],errorMessage:`fail-loud: enabled check-id "${i}" has no registered runner`});continue}try{let o=await s.run(e);r.push({checkId:i,label:s.label,status:o.length>0?"fail":"pass",findings:o})}catch(o){r.push({checkId:i,label:s.label,status:"error",findings:[],errorMessage:`fail-loud: check "${s.label}" threw \u2014 ${o instanceof Error?o.message:String(o)}`})}}return{totalAssets:e.assets.length,results:r,ok:r.every(i=>i.status==="pass")}}};By.VaultCheckRunner=t2});var TF=w(r2=>{"use strict";Object.defineProperty(r2,"__esModule",{value:!0});r2.readEnabledCheckIds=xQ;var AQ=Ed(),IQ=ed();function xQ(n){let e=new Set;for(let t of n){let r=(0,IQ.extractAssetReference)(t.frontmatter.setting__Setting_key);if(!r||!AQ.KNOWN_CHECK_IDS.has(r))continue;let i=t.frontmatter.setting__Setting_value;(i===!0||i==="true")&&e.add(r)}return[...e]}a(xQ,"readEnabledCheckIds")});var xF=w(yt=>{"use strict";var RQ=yt&&yt.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),AF=yt&&yt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RQ(e,n,t)};Object.defineProperty(yt,"__esModule",{value:!0});yt.readInstanceClassRefs=yt.readIsDefinedByRef=yt.readUid=yt.dagOntologyImportsCheck=yt.shaclCheck=yt.coLocationCheck=yt.uidUniquenessCheck=yt.readEnabledCheckIds=yt.VaultCheckRunner=yt.createDefaultCheckRegistry=yt.CheckRegistry=void 0;AF(bF(),yt);AF(Ed(),yt);var IF=e2();Object.defineProperty(yt,"CheckRegistry",{enumerable:!0,get:a(function(){return IF.CheckRegistry},"get")});Object.defineProperty(yt,"createDefaultCheckRegistry",{enumerable:!0,get:a(function(){return IF.createDefaultCheckRegistry},"get")});var CQ=EF();Object.defineProperty(yt,"VaultCheckRunner",{enumerable:!0,get:a(function(){return CQ.VaultCheckRunner},"get")});var OQ=TF();Object.defineProperty(yt,"readEnabledCheckIds",{enumerable:!0,get:a(function(){return OQ.readEnabledCheckIds},"get")});var PQ=zT();Object.defineProperty(yt,"uidUniquenessCheck",{enumerable:!0,get:a(function(){return PQ.uidUniquenessCheck},"get")});var FQ=QT();Object.defineProperty(yt,"coLocationCheck",{enumerable:!0,get:a(function(){return FQ.coLocationCheck},"get")});var DQ=XT();Object.defineProperty(yt,"shaclCheck",{enumerable:!0,get:a(function(){return DQ.shaclCheck},"get")});var LQ=ZT();Object.defineProperty(yt,"dagOntologyImportsCheck",{enumerable:!0,get:a(function(){return LQ.dagOntologyImportsCheck},"get")});var n2=jy();Object.defineProperty(yt,"readUid",{enumerable:!0,get:a(function(){return n2.readUid},"get")});Object.defineProperty(yt,"readIsDefinedByRef",{enumerable:!0,get:a(function(){return n2.readIsDefinedByRef},"get")});Object.defineProperty(yt,"readInstanceClassRefs",{enumerable:!0,get:a(function(){return n2.readInstanceClassRefs},"get")})});var et=w(m=>{"use strict";var NQ=m&&m.__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:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ri=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&NQ(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.createVaultFrontmatterClassLabelResolver=m.ServiceRegistry=m.GroundingExecutor=m.registerDefaultHostFunctions=m.hasUidFilename=m.hasNonUidFilename=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=m.transitiveDependsOnClosure=m.isTsFloorMountPath=m.isTsFloorAssetSpace=m.assertTsFloorReconciled=m.assertTsFloor=m.TsFloorViolationError=m.CATALOG_KEEP_NAMESPACES=m.PLUGIN_UI_FLOOR=m.SDK_FLOOR=m.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=m.SDK_FLOOR_ASSETSPACE_UIDS=m.TS_FLOOR_AS_UID_SHARED_IDENTITIES=m.TS_FLOOR_AS_UID_EXOCMD=m.TS_FLOOR_AS_UID_EXO=m.parseGroundingDefinitionFromFrontmatter=m.isCommandBindingFrontmatter=m.isGroundingFrontmatter=m.isPreconditionFrontmatter=m.isCommandFrontmatter=m.isStyleSource=m.isLabelClass=m.isCommandVariant=m.STYLE_SOURCE_VALUES=m.LABEL_CLASS_VALUES=m.COMMAND_VARIANT_VALUES=m.CommandBindingStyleProperty=m.CommandBindingProperty=m.GroundingProperty=m.PreconditionProperty=m.CommandProperty=m.resolveGroundingTypeFromWikilinkLiteral=m.resolveGroundingTypeFromIRI=m.GROUNDING_TYPE_IRI_TO_ENUM=m.GROUNDING_TYPE_UID_TO_ENUM=m.GROUNDING_TYPE_UIDS=m.GroundingType=m.EFFORT_STATUS_OPTIONS=void 0;m.GraphQueryService=m.FixMissingLabelService=m.ArchiveAssetService=m.GenericAssetCreationService=m.URIConstructionService=m.SessionEventService=m.AssetConversionService=m.EnumValueResolver=m.ClassHierarchyResolver=m.PropertySchemaResolver=m.PlanningService=m.AlgorithmExtractor=m.orderProperties=m.loadDefaultSpec=m.clearOrderSpecLoader=m.registerOrderSpecLoader=m.DynamicFrontmatterGenerator=m.SupervisionCreationService=m.StatusTimestampService=m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.extractAssetReference=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.stripTemplateFrontmatter=m.resolveTemplateBody=m.getRegisteredResolverIds=m.clearResolvers=m.registerResolver=m.getResolver=m.installDefaultResolvers=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.createTripleStoreRequiredPropertyResolver=m.CommandExecutionFlow=m.stripFrontmatter=m.extractSparqlBlock=m.iriToObsidianName=m.NamedQueryRunner=m.createVaultFrontmatterRefToFolderResolver=void 0;m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.isPathExcluded=m.normaliseExcludedFolders=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.MAX_LAZY_DEPTH=m.LazyAssetGraphLoader=m.FILE_SPACE_CLASS_UID=m.frontmatterDeclaresFileSpace=m.discoverFileSpaceExclusions=m.deriveLegacyFlatPath=m.derivePath=m.IRICanonicalizer=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=m.DomainTriple=m.DomainBlankNode=m.DomainLiteral=m.DomainIRI=m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=m.iriToVaultPath=m.vaultPathToIRI=m.NullLogger=m.RDFSerializer=m.FilenameValidator=m.EffortSortingHelpers=m.MetadataExtractor=m.MetadataHelpers=m.WikiLinkHelpers=m.DateFormatter=m.FrontmatterService=m.CriticalityZoneUUIDs=m.CriticalityZoneService=m.SPARQL_PREFIXES=m.TypeRegistry=void 0;m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.seededUidGenerator=m.liveUidGenerator=m.frozenClock=m.liveClock=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=m.CaseWhenTransformer=m.ResultSerializer=m.createIncrementalIndexer=m.IncrementalIndexer=m.createSPARQLResultCache=m.SPARQLResultCache=m.QueryPlanCache=m.createDoubleLiteral=m.createDecimalLiteral=m.getNumericValue=m.createPercentileAggregate=m.modeAggregate=m.stddevAggregate=m.varianceAggregate=m.medianAggregate=m.EXO_AGGREGATE_NS=m.BUILT_IN_AGGREGATES=m.CustomAggregateError=m.CustomAggregateRegistry=m.AggregateFunctions=m.BuiltInFunctions=m.SolutionMapping=m.UpdateExecutorError=m.UpdateExecutor=m.QueryExecutor=m.ExoQLQueryExecutor=m.DescribeExecutor=m.ConstructExecutor=m.UnionExecutor=m.OptionalExecutor=m.FilterExecutor=void 0;m.gitBlobSha=m.extractAssetUid=m.detectChanges=m.MATERIALIZE_PROGRESS_MIN_FILES=m.MATERIALIZE_PROGRESS_INTERVAL=m.escapeGitmodulesRegex=m.stripGitmodulesEntry=m.appendGitmodulesEntry=m.extractAssetSpaceSha=m.discoverAssetSpaceWrapperDir=m.mountAssetSpaceFiles=m.isBinaryPayload=m.restCreateCommit=m.parseTarballGzip=m.parseTarball=m.TripleClassHierarchy=m.ShaclShapeRegistry=m.shaclValidate=m.Namespace=m.ShapeRegistry=m.ShapeLoader=m.selectByPriority=m.LayoutSelector=m.isPropertiesBlock=m.isLayoutBlockFrontmatter=m.isBacklinksTableBlock=m.createLayoutBlockFromFrontmatter=m.PROPERTIES_BLOCK_CLASS_UID=m.PROPERTIES_BLOCK_CLASS_IRI=m.BACKLINKS_TABLE_BLOCK_CLASS_UID=m.BACKLINKS_TABLE_BLOCK_CLASS_IRI=m.isLayoutFrontmatter=m.isLayout=m.createLayoutFromFrontmatter=m.LAYOUT_CLASS_UID=m.LAYOUT_CLASS_IRI=m.ExoQLError=m.ExoQL=m.createStreamingSource=m.StreamingLoader=m.resetGlobalPool=m.getGlobalPool=m.MemoryPool=m.CompactGraphStore=m.StringTable=m.DEFAULT_COLORS=m.NODE_FLAGS=m.container=m.resetContainer=m.getContainer=void 0;m.ASSET_SPACE_CLASS_UID=m.OUTBOX_REMOTE_ABSENT=m.OUTBOX_STORE_FILENAME=m.LocalOutboxStore=m.CONFLICT_CACHE_STORE_FILENAME=m.LocalConflictCacheStore=m.scanForSecrets=m.redactSecrets=m.withRateLimitBackoff=m.isRateLimitError=m.isAuthError=m.MOUNT_BASE_STORE_FILENAME=m.FileMountBaseStore=m.WATERMARK_STORE_FILENAME=m.FileWatermarkStore=m.GatedStructuredMerger=m.MergeShaclGate=m.splitSections=m.StructuredMerger=m.diff3=m.LOCAL_MANIFEST_STORE_FILENAME=m.FileLocalManifestStore=m.isSyncablePath=m.isFileSpaceSyncablePath=m.contentEquals=m.InMemoryQuarantineStore=m.DEFAULT_MAX_FILE_BYTES=m.backupPathFor=m.QuarantineResolver=m.formatRepoTimings=m.formatTimingsLine=m.fmtMs=m.dominantPhase=m.totalMs=m.aggregateTimings=m.addTimings=m.emptyTimings=m.classifyRestPhase=m.SYNC_PHASES=m.SyncPhaseTimer=m.orderChildrenFirst=m.isNonFastForwardError=m.SyncEngine=m.DEFAULT_LOCAL_MANIFEST_REHASH_MS=m.DEFAULT_MAX_PUSH_RETRIES=m.getTree=m.getHeadSha=m.getCommitInfo=m.getBlobText=m.getBlobBytes=void 0;m.isFormatOnlyDrift=m.compareAssetSemantics=m.summarizeParityRound=m.ParityValidator=m.readSpaceSource=m.parseStrictGitHubRepoURL=m.isFileSpaceFrontmatter=m.isAssetSpaceFrontmatter=m.classifySpaceDeclaration=m.SpaceSpecAccumulator=m.SYNC_BRANCH=void 0;ri(tl(),m);ri(rl(),m);var kQ=d_();Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return kQ.EFFORT_STATUS_OPTIONS},"get")});var MQ=Ko();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:a(function(){return MQ.GroundingType},"get")});var Id=hf();Object.defineProperty(m,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(m,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(m,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(m,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(m,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromWikilinkLiteral},"get")});var xd=h_();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:a(function(){return xd.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:a(function(){return xd.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:a(function(){return xd.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:a(function(){return xd.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return xd.CommandBindingStyleProperty},"get")});var mu=p_();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return mu.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return mu.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return mu.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:a(function(){return mu.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:a(function(){return mu.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:a(function(){return mu.isStyleSource},"get")});var Vy=yx();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return Vy.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return Vy.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return Vy.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return Vy.isCommandBindingFrontmatter},"get")});var jQ=bx();Object.defineProperty(m,"parseGroundingDefinitionFromFrontmatter",{enumerable:!0,get:a(function(){return jQ.parseGroundingDefinitionFromFrontmatter},"get")});ri(_x(),m);ri(Sx(),m);ri(y_(),m);ri(b_(),m);ri(vx(),m);ri(Ax(),m);ri(Z_(),m);ri(iR(),m);var ni=sR();Object.defineProperty(m,"TS_FLOOR_AS_UID_EXO",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_EXO},"get")});Object.defineProperty(m,"TS_FLOOR_AS_UID_EXOCMD",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_EXOCMD},"get")});Object.defineProperty(m,"TS_FLOOR_AS_UID_SHARED_IDENTITIES",{enumerable:!0,get:a(function(){return ni.TS_FLOOR_AS_UID_SHARED_IDENTITIES},"get")});Object.defineProperty(m,"SDK_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ni.SDK_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(m,"PLUGIN_UI_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ni.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(m,"SDK_FLOOR",{enumerable:!0,get:a(function(){return ni.SDK_FLOOR},"get")});Object.defineProperty(m,"PLUGIN_UI_FLOOR",{enumerable:!0,get:a(function(){return ni.PLUGIN_UI_FLOOR},"get")});Object.defineProperty(m,"CATALOG_KEEP_NAMESPACES",{enumerable:!0,get:a(function(){return ni.CATALOG_KEEP_NAMESPACES},"get")});Object.defineProperty(m,"TsFloorViolationError",{enumerable:!0,get:a(function(){return ni.TsFloorViolationError},"get")});Object.defineProperty(m,"assertTsFloor",{enumerable:!0,get:a(function(){return ni.assertTsFloor},"get")});Object.defineProperty(m,"assertTsFloorReconciled",{enumerable:!0,get:a(function(){return ni.assertTsFloorReconciled},"get")});Object.defineProperty(m,"isTsFloorAssetSpace",{enumerable:!0,get:a(function(){return ni.isTsFloorAssetSpace},"get")});Object.defineProperty(m,"isTsFloorMountPath",{enumerable:!0,get:a(function(){return ni.isTsFloorMountPath},"get")});var $Q=oR();Object.defineProperty(m,"transitiveDependsOnClosure",{enumerable:!0,get:a(function(){return $Q.transitiveDependsOnClosure},"get")});var RF=_p();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:a(function(){return RF.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:a(function(){return RF.rangeToFieldType},"get")});var i2=nS();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:a(function(){return i2.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:a(function(){return i2.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:a(function(){return i2.extractPropertyLabel},"get")});var UQ=zC();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:a(function(){return UQ.CommandResolver},"get")});var BQ=QC();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return BQ.PreconditionEvaluator},"get")});var s2=YC();Object.defineProperty(m,"hasNonUidFilename",{enumerable:!0,get:a(function(){return s2.hasNonUidFilename},"get")});Object.defineProperty(m,"hasUidFilename",{enumerable:!0,get:a(function(){return s2.hasUidFilename},"get")});Object.defineProperty(m,"registerDefaultHostFunctions",{enumerable:!0,get:a(function(){return s2.registerDefaultHostFunctions},"get")});var CF=rO();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:a(function(){return CF.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:a(function(){return CF.ServiceRegistry},"get")});var VQ=nO();Object.defineProperty(m,"createVaultFrontmatterClassLabelResolver",{enumerable:!0,get:a(function(){return VQ.createVaultFrontmatterClassLabelResolver},"get")});var qQ=iO();Object.defineProperty(m,"createVaultFrontmatterRefToFolderResolver",{enumerable:!0,get:a(function(){return qQ.createVaultFrontmatterRefToFolderResolver},"get")});var GQ=oO();Object.defineProperty(m,"NamedQueryRunner",{enumerable:!0,get:a(function(){return GQ.NamedQueryRunner},"get")});var WQ=jp();Object.defineProperty(m,"iriToObsidianName",{enumerable:!0,get:a(function(){return WQ.iriToObsidianName},"get")});var OF=aO();Object.defineProperty(m,"extractSparqlBlock",{enumerable:!0,get:a(function(){return OF.extractSparqlBlock},"get")});Object.defineProperty(m,"stripFrontmatter",{enumerable:!0,get:a(function(){return OF.stripFrontmatter},"get")});var HQ=lO();Object.defineProperty(m,"CommandExecutionFlow",{enumerable:!0,get:a(function(){return HQ.CommandExecutionFlow},"get")});var zQ=dO();Object.defineProperty(m,"createTripleStoreRequiredPropertyResolver",{enumerable:!0,get:a(function(){return zQ.createTripleStoreRequiredPropertyResolver},"get")});var KQ=N1();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:a(function(){return KQ.TaskStatusService},"get")});var QQ=$1();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:a(function(){return QQ.AreaCreationService},"get")});var YQ=B1();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return YQ.AreaHierarchyBuilder},"get")});var XQ=z1();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:a(function(){return XQ.ClassCreationService},"get")});var JQ=Q1();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:a(function(){return JQ.ConceptCreationService},"get")});var ZQ=pg();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return ZQ.EffortStatusWorkflow},"get")});var eY=Jf();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:a(function(){return eY.WorkflowEngine},"get")});var tY=E1();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:a(function(){return tY.WorkflowResolver},"get")});var Rd=Qm();Object.defineProperty(m,"installDefaultResolvers",{enumerable:!0,get:a(function(){return Rd.installDefaultResolvers},"get")});Object.defineProperty(m,"getResolver",{enumerable:!0,get:a(function(){return Rd.getResolver},"get")});Object.defineProperty(m,"registerResolver",{enumerable:!0,get:a(function(){return Rd.registerResolver},"get")});Object.defineProperty(m,"clearResolvers",{enumerable:!0,get:a(function(){return Rd.clearResolvers},"get")});Object.defineProperty(m,"getRegisteredResolverIds",{enumerable:!0,get:a(function(){return Rd.getRegisteredResolverIds},"get")});var PF=u1();Object.defineProperty(m,"resolveTemplateBody",{enumerable:!0,get:a(function(){return PF.resolveTemplateBody},"get")});Object.defineProperty(m,"stripTemplateFrontmatter",{enumerable:!0,get:a(function(){return PF.stripTemplateFrontmatter},"get")});var rY=CO();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return rY.InstantiationRuleResolver},"get")});var nY=OO();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:a(function(){return nY.VisibilityGenerator},"get")});var iY=PO();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return iY.WorkflowCommandAdapter},"get")});var sY=rv();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:a(function(){return sY.EffortVotingService},"get")});var oY=_g();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:a(function(){return oY.FolderRepairService},"get")});var aY=ed();Object.defineProperty(m,"extractAssetReference",{enumerable:!0,get:a(function(){return aY.extractAssetReference},"get")});var cY=fc();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:a(function(){return cY.LoggingService},"get")});var lY=sv();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:a(function(){return lY.PropertyCleanupService},"get")});var uY=av();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:a(function(){return uY.RenameToUidService},"get")});var fY=gg();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:a(function(){return fY.StatusTimestampService},"get")});var dY=uv();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:a(function(){return dY.SupervisionCreationService},"get")});var hY=dv();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return hY.DynamicFrontmatterGenerator},"get")});var qy=Hf();Object.defineProperty(m,"registerOrderSpecLoader",{enumerable:!0,get:a(function(){return qy.registerOrderSpecLoader},"get")});Object.defineProperty(m,"clearOrderSpecLoader",{enumerable:!0,get:a(function(){return qy.clearOrderSpecLoader},"get")});Object.defineProperty(m,"loadDefaultSpec",{enumerable:!0,get:a(function(){return qy.loadDefaultSpec},"get")});Object.defineProperty(m,"orderProperties",{enumerable:!0,get:a(function(){return qy.orderProperties},"get")});var pY=pv();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return pY.AlgorithmExtractor},"get")});var mY=gv();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:a(function(){return mY.PlanningService},"get")});var gY=BO();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return gY.PropertySchemaResolver},"get")});var yY=VO();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return yY.ClassHierarchyResolver},"get")});var bY=qO();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:a(function(){return bY.EnumValueResolver},"get")});var _Y=wv();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:a(function(){return _Y.AssetConversionService},"get")});var SY=Tv();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:a(function(){return SY.SessionEventService},"get")});var wY=xv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:a(function(){return wY.URIConstructionService},"get")});var vY=Cv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return vY.GenericAssetCreationService},"get")});var EY=ZO();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:a(function(){return EY.ArchiveAssetService},"get")});var TY=t3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:a(function(){return TY.FixMissingLabelService},"get")});var AY=r3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:a(function(){return AY.GraphQueryService},"get")});var IY=i3();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:a(function(){return IY.TypeRegistry},"get")});var xY=s3();Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return xY.SPARQL_PREFIXES},"get")});var FF=Nv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:a(function(){return FF.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return FF.CriticalityZoneUUIDs},"get")});var RY=Es();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:a(function(){return RY.FrontmatterService},"get")});var CY=jn();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:a(function(){return CY.DateFormatter},"get")});var OY=no();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return OY.WikiLinkHelpers},"get")});var PY=go();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:a(function(){return PY.MetadataHelpers},"get")});var FY=M1();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:a(function(){return FY.MetadataExtractor},"get")});var DY=a3();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return DY.EffortSortingHelpers},"get")});var LY=c3();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:a(function(){return LY.FilenameValidator},"get")});var NY=m3();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:a(function(){return NY.RDFSerializer},"get")});var kY=sl();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:a(function(){return kY.NullLogger},"get")});var o2=zv();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:a(function(){return o2.vaultPathToIRI},"get")});Object.defineProperty(m,"iriToVaultPath",{enumerable:!0,get:a(function(){return o2.iriToVaultPath},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return o2.OBSIDIAN_VAULT_SCHEME},"get")});var MY=P1();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return MY.InMemoryTripleStore},"get")});var jY=Oe();Object.defineProperty(m,"DomainIRI",{enumerable:!0,get:a(function(){return jY.IRI},"get")});var $Y=Ge();Object.defineProperty(m,"DomainLiteral",{enumerable:!0,get:a(function(){return $Y.Literal},"get")});var UY=jt();Object.defineProperty(m,"DomainBlankNode",{enumerable:!0,get:a(function(){return UY.BlankNode},"get")});var BY=Yn();Object.defineProperty(m,"DomainTriple",{enumerable:!0,get:a(function(){return BY.Triple},"get")});var VY=Qv();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return VY.RDFVocabularyMapper},"get")});var qY=y3();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return qY.RDFSInferenceEngine},"get")});var GY=Zv();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return GY.NonInheritablePropertyRegistry},"get")});var WY=rE();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return WY.PropertyCardinalityRegistry},"get")});var DF=sE();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return DF.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return DF.INFERRED_GRAPH},"get")});var HY=T3();Object.defineProperty(m,"IRICanonicalizer",{enumerable:!0,get:a(function(){return HY.IRICanonicalizer},"get")});var LF=kg();Object.defineProperty(m,"derivePath",{enumerable:!0,get:a(function(){return LF.derivePath},"get")});Object.defineProperty(m,"deriveLegacyFlatPath",{enumerable:!0,get:a(function(){return LF.deriveLegacyFlatPath},"get")});var a2=Mg();Object.defineProperty(m,"discoverFileSpaceExclusions",{enumerable:!0,get:a(function(){return a2.discoverFileSpaceExclusions},"get")});Object.defineProperty(m,"frontmatterDeclaresFileSpace",{enumerable:!0,get:a(function(){return a2.frontmatterDeclaresFileSpace},"get")});Object.defineProperty(m,"FILE_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return a2.FILE_SPACE_CLASS_UID},"get")});var NF=P3();Object.defineProperty(m,"LazyAssetGraphLoader",{enumerable:!0,get:a(function(){return NF.LazyAssetGraphLoader},"get")});Object.defineProperty(m,"MAX_LAZY_DEPTH",{enumerable:!0,get:a(function(){return NF.MAX_LAZY_DEPTH},"get")});var kF=fE();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:a(function(){return kF.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return kF.SOURCE_VARIABLE},"get")});var c2=mE();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return c2.NoteToRDFConverter},"get")});Object.defineProperty(m,"normaliseExcludedFolders",{enumerable:!0,get:a(function(){return c2.normaliseExcludedFolders},"get")});Object.defineProperty(m,"isPathExcluded",{enumerable:!0,get:a(function(){return c2.isPathExcluded},"get")});var l2=yl();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:a(function(){return l2.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:a(function(){return l2.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:a(function(){return l2.SPARQLParseError},"get")});var MF=rw();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return MF.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return MF.DescribeOptionsTransformerError},"get")});var jF=_l();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return jF.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:a(function(){return jF.AlgebraTranslator},"get")});var zY=j3();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return zY.AlgebraOptimizer},"get")});var KY=$3();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:a(function(){return KY.AlgebraSerializer},"get")});var QY=Sw();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:a(function(){return QY.BGPExecutor},"get")});var YY=Rm();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:a(function(){return YY.FilterExecutor},"get")});var XY=$w();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:a(function(){return XY.OptionalExecutor},"get")});var JY=Bw();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:a(function(){return JY.UnionExecutor},"get")});var ZY=Xw();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:a(function(){return ZY.ConstructExecutor},"get")});var eX=B3();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:a(function(){return eX.DescribeExecutor},"get")});var $F=Ul();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return $F.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:a(function(){return $F.QueryExecutor},"get")});var UF=q3();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:a(function(){return UF.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:a(function(){return UF.UpdateExecutorError},"get")});var tX=_s();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:a(function(){return tX.SolutionMapping},"get")});var rX=xm();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:a(function(){return rX.BuiltInFunctions},"get")});var nX=W3();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:a(function(){return nX.AggregateFunctions},"get")});var BF=Gw();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return BF.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:a(function(){return BF.CustomAggregateError},"get")});var Ns=Ww();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return Ns.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return Ns.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:a(function(){return Ns.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:a(function(){return Ns.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:a(function(){return Ns.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:a(function(){return Ns.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:a(function(){return Ns.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:a(function(){return Ns.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:a(function(){return Ns.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:a(function(){return Ns.createDoubleLiteral},"get")});var iX=H3();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:a(function(){return iX.QueryPlanCache},"get")});var VF=z3();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:a(function(){return VF.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return VF.createSPARQLResultCache},"get")});var qF=K3();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:a(function(){return qF.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return qF.createIncrementalIndexer},"get")});var sX=Q3();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:a(function(){return sX.ResultSerializer},"get")});var GF=ZS();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return GF.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return GF.CaseWhenTransformerError},"get")});var oX=ow();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return oX.VaultPrefixTransformer},"get")});var aX=yE();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return aX.FilterContainsOptimizer},"get")});var WF=Y3();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:a(function(){return WF.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return WF.FileAlreadyExistsError},"get")});var u2=x1();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return u2.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:a(function(){return u2.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:a(function(){return u2.TransactionError},"get")});var HF=qf();Object.defineProperty(m,"liveClock",{enumerable:!0,get:a(function(){return HF.liveClock},"get")});Object.defineProperty(m,"frozenClock",{enumerable:!0,get:a(function(){return HF.frozenClock},"get")});var zF=Hm();Object.defineProperty(m,"liveUidGenerator",{enumerable:!0,get:a(function(){return zF.liveUidGenerator},"get")});Object.defineProperty(m,"seededUidGenerator",{enumerable:!0,get:a(function(){return zF.seededUidGenerator},"get")});var Gy=OE();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:a(function(){return Gy.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return Gy.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return Gy.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return Gy.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var cX=Bt();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:a(function(){return cX.DI_TOKENS},"get")});var Cd=X3();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:a(function(){return Cd.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:a(function(){return Cd.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:a(function(){return Cd.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:a(function(){return Cd.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:a(function(){return Cd.container},"get")});var Po=nP();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:a(function(){return Po.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return Po.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:a(function(){return Po.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:a(function(){return Po.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:a(function(){return Po.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:a(function(){return Po.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:a(function(){return Po.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:a(function(){return Po.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:a(function(){return Po.createStreamingSource},"get")});var KF=iP();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:a(function(){return KF.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:a(function(){return KF.ExoQLError},"get")});var Od=VE();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Od.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Od.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Od.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:a(function(){return Od.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Od.isLayoutFrontmatter},"get")});var Sa=VE();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Sa.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Sa.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Sa.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Sa.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Sa.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Sa.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Sa.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Sa.isPropertiesBlock},"get")});var QF=fP();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:a(function(){return QF.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:a(function(){return QF.selectByPriority},"get")});ri(SP(),m);var lX=wP();Object.defineProperty(m,"ShapeLoader",{enumerable:!0,get:a(function(){return lX.ShapeLoader},"get")});var uX=ZE();Object.defineProperty(m,"ShapeRegistry",{enumerable:!0,get:a(function(){return uX.ShapeRegistry},"get")});var fX=zt();Object.defineProperty(m,"Namespace",{enumerable:!0,get:a(function(){return fX.Namespace},"get")});var YF=iT();Object.defineProperty(m,"shaclValidate",{enumerable:!0,get:a(function(){return YF.validate},"get")});Object.defineProperty(m,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return YF.ShapeRegistry},"get")});ri(EP(),m);var dX=TP();Object.defineProperty(m,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return dX.ClassHierarchy},"get")});var XF=cT();Object.defineProperty(m,"parseTarball",{enumerable:!0,get:a(function(){return XF.parseTarball},"get")});Object.defineProperty(m,"parseTarballGzip",{enumerable:!0,get:a(function(){return XF.parseTarballGzip},"get")});var JF=Sy();Object.defineProperty(m,"restCreateCommit",{enumerable:!0,get:a(function(){return JF.restCreateCommit},"get")});Object.defineProperty(m,"isBinaryPayload",{enumerable:!0,get:a(function(){return JF.isBinaryPayload},"get")});var wa=PP();Object.defineProperty(m,"mountAssetSpaceFiles",{enumerable:!0,get:a(function(){return wa.mountAssetSpaceFiles},"get")});Object.defineProperty(m,"discoverAssetSpaceWrapperDir",{enumerable:!0,get:a(function(){return wa.discoverWrapperDir},"get")});Object.defineProperty(m,"extractAssetSpaceSha",{enumerable:!0,get:a(function(){return wa.extractShaFromWrapper},"get")});Object.defineProperty(m,"appendGitmodulesEntry",{enumerable:!0,get:a(function(){return wa.appendGitmodulesEntry},"get")});Object.defineProperty(m,"stripGitmodulesEntry",{enumerable:!0,get:a(function(){return wa.stripGitmodulesEntry},"get")});Object.defineProperty(m,"escapeGitmodulesRegex",{enumerable:!0,get:a(function(){return wa.escapeGitmodulesRegex},"get")});Object.defineProperty(m,"MATERIALIZE_PROGRESS_INTERVAL",{enumerable:!0,get:a(function(){return wa.MATERIALIZE_PROGRESS_INTERVAL},"get")});Object.defineProperty(m,"MATERIALIZE_PROGRESS_MIN_FILES",{enumerable:!0,get:a(function(){return wa.MATERIALIZE_PROGRESS_MIN_FILES},"get")});var ZF=Ey();Object.defineProperty(m,"detectChanges",{enumerable:!0,get:a(function(){return ZF.detectChanges},"get")});Object.defineProperty(m,"extractAssetUid",{enumerable:!0,get:a(function(){return ZF.extractAssetUid},"get")});var hX=lu();Object.defineProperty(m,"gitBlobSha",{enumerable:!0,get:a(function(){return hX.gitBlobSha},"get")});var Pd=hd();Object.defineProperty(m,"getBlobBytes",{enumerable:!0,get:a(function(){return Pd.getBlobBytes},"get")});Object.defineProperty(m,"getBlobText",{enumerable:!0,get:a(function(){return Pd.getBlobText},"get")});Object.defineProperty(m,"getCommitInfo",{enumerable:!0,get:a(function(){return Pd.getCommitInfo},"get")});Object.defineProperty(m,"getHeadSha",{enumerable:!0,get:a(function(){return Pd.getHeadSha},"get")});Object.defineProperty(m,"getTree",{enumerable:!0,get:a(function(){return Pd.getTree},"get")});var Fd=HP();Object.defineProperty(m,"DEFAULT_MAX_PUSH_RETRIES",{enumerable:!0,get:a(function(){return Fd.DEFAULT_MAX_PUSH_RETRIES},"get")});Object.defineProperty(m,"DEFAULT_LOCAL_MANIFEST_REHASH_MS",{enumerable:!0,get:a(function(){return Fd.DEFAULT_LOCAL_MANIFEST_REHASH_MS},"get")});Object.defineProperty(m,"SyncEngine",{enumerable:!0,get:a(function(){return Fd.SyncEngine},"get")});Object.defineProperty(m,"isNonFastForwardError",{enumerable:!0,get:a(function(){return Fd.isNonFastForwardError},"get")});Object.defineProperty(m,"orderChildrenFirst",{enumerable:!0,get:a(function(){return Fd.orderChildrenFirst},"get")});var Ji=gT();Object.defineProperty(m,"SyncPhaseTimer",{enumerable:!0,get:a(function(){return Ji.SyncPhaseTimer},"get")});Object.defineProperty(m,"SYNC_PHASES",{enumerable:!0,get:a(function(){return Ji.SYNC_PHASES},"get")});Object.defineProperty(m,"classifyRestPhase",{enumerable:!0,get:a(function(){return Ji.classifyRestPhase},"get")});Object.defineProperty(m,"emptyTimings",{enumerable:!0,get:a(function(){return Ji.emptyTimings},"get")});Object.defineProperty(m,"addTimings",{enumerable:!0,get:a(function(){return Ji.addTimings},"get")});Object.defineProperty(m,"aggregateTimings",{enumerable:!0,get:a(function(){return Ji.aggregateTimings},"get")});Object.defineProperty(m,"totalMs",{enumerable:!0,get:a(function(){return Ji.totalMs},"get")});Object.defineProperty(m,"dominantPhase",{enumerable:!0,get:a(function(){return Ji.dominantPhase},"get")});Object.defineProperty(m,"fmtMs",{enumerable:!0,get:a(function(){return Ji.fmtMs},"get")});Object.defineProperty(m,"formatTimingsLine",{enumerable:!0,get:a(function(){return Ji.formatTimingsLine},"get")});Object.defineProperty(m,"formatRepoTimings",{enumerable:!0,get:a(function(){return Ji.formatRepoTimings},"get")});var eD=KP();Object.defineProperty(m,"QuarantineResolver",{enumerable:!0,get:a(function(){return eD.QuarantineResolver},"get")});Object.defineProperty(m,"backupPathFor",{enumerable:!0,get:a(function(){return eD.backupPathFor},"get")});var Dd=Oy();Object.defineProperty(m,"DEFAULT_MAX_FILE_BYTES",{enumerable:!0,get:a(function(){return Dd.DEFAULT_MAX_FILE_BYTES},"get")});Object.defineProperty(m,"InMemoryQuarantineStore",{enumerable:!0,get:a(function(){return Dd.InMemoryQuarantineStore},"get")});Object.defineProperty(m,"contentEquals",{enumerable:!0,get:a(function(){return Dd.contentEquals},"get")});Object.defineProperty(m,"isFileSpaceSyncablePath",{enumerable:!0,get:a(function(){return Dd.isFileSpaceSyncablePath},"get")});Object.defineProperty(m,"isSyncablePath",{enumerable:!0,get:a(function(){return Dd.isSyncablePath},"get")});var tD=QP();Object.defineProperty(m,"FileLocalManifestStore",{enumerable:!0,get:a(function(){return tD.FileLocalManifestStore},"get")});Object.defineProperty(m,"LOCAL_MANIFEST_STORE_FILENAME",{enumerable:!0,get:a(function(){return tD.LOCAL_MANIFEST_STORE_FILENAME},"get")});var pX=OT();Object.defineProperty(m,"diff3",{enumerable:!0,get:a(function(){return pX.diff3},"get")});var rD=JP();Object.defineProperty(m,"StructuredMerger",{enumerable:!0,get:a(function(){return rD.StructuredMerger},"get")});Object.defineProperty(m,"splitSections",{enumerable:!0,get:a(function(){return rD.splitSections},"get")});var mX=ZP();Object.defineProperty(m,"MergeShaclGate",{enumerable:!0,get:a(function(){return mX.MergeShaclGate},"get")});var gX=eF();Object.defineProperty(m,"GatedStructuredMerger",{enumerable:!0,get:a(function(){return gX.GatedStructuredMerger},"get")});var nD=tF();Object.defineProperty(m,"FileWatermarkStore",{enumerable:!0,get:a(function(){return nD.FileWatermarkStore},"get")});Object.defineProperty(m,"WATERMARK_STORE_FILENAME",{enumerable:!0,get:a(function(){return nD.WATERMARK_STORE_FILENAME},"get")});var iD=rF();Object.defineProperty(m,"FileMountBaseStore",{enumerable:!0,get:a(function(){return iD.FileMountBaseStore},"get")});Object.defineProperty(m,"MOUNT_BASE_STORE_FILENAME",{enumerable:!0,get:a(function(){return iD.MOUNT_BASE_STORE_FILENAME},"get")});var yX=Iy();Object.defineProperty(m,"isAuthError",{enumerable:!0,get:a(function(){return yX.isAuthError},"get")});var sD=Cy();Object.defineProperty(m,"isRateLimitError",{enumerable:!0,get:a(function(){return sD.isRateLimitError},"get")});Object.defineProperty(m,"withRateLimitBackoff",{enumerable:!0,get:a(function(){return sD.withRateLimitBackoff},"get")});var oD=ST();Object.defineProperty(m,"redactSecrets",{enumerable:!0,get:a(function(){return oD.redactSecrets},"get")});Object.defineProperty(m,"scanForSecrets",{enumerable:!0,get:a(function(){return oD.scanForSecrets},"get")});var aD=nF();Object.defineProperty(m,"LocalConflictCacheStore",{enumerable:!0,get:a(function(){return aD.LocalConflictCacheStore},"get")});Object.defineProperty(m,"CONFLICT_CACHE_STORE_FILENAME",{enumerable:!0,get:a(function(){return aD.CONFLICT_CACHE_STORE_FILENAME},"get")});var f2=Ay();Object.defineProperty(m,"LocalOutboxStore",{enumerable:!0,get:a(function(){return f2.LocalOutboxStore},"get")});Object.defineProperty(m,"OUTBOX_STORE_FILENAME",{enumerable:!0,get:a(function(){return f2.OUTBOX_STORE_FILENAME},"get")});Object.defineProperty(m,"OUTBOX_REMOTE_ABSENT",{enumerable:!0,get:a(function(){return f2.OUTBOX_REMOTE_ABSENT},"get")});var va=uF();Object.defineProperty(m,"ASSET_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return va.ASSET_SPACE_CLASS_UID},"get")});Object.defineProperty(m,"SYNC_BRANCH",{enumerable:!0,get:a(function(){return va.SYNC_BRANCH},"get")});Object.defineProperty(m,"SpaceSpecAccumulator",{enumerable:!0,get:a(function(){return va.SpaceSpecAccumulator},"get")});Object.defineProperty(m,"classifySpaceDeclaration",{enumerable:!0,get:a(function(){return va.classifySpaceDeclaration},"get")});Object.defineProperty(m,"isAssetSpaceFrontmatter",{enumerable:!0,get:a(function(){return va.isAssetSpaceFrontmatter},"get")});Object.defineProperty(m,"isFileSpaceFrontmatter",{enumerable:!0,get:a(function(){return va.isFileSpaceFrontmatter},"get")});Object.defineProperty(m,"parseStrictGitHubRepoURL",{enumerable:!0,get:a(function(){return va.parseStrictGitHubRepoURL},"get")});Object.defineProperty(m,"readSpaceSource",{enumerable:!0,get:a(function(){return va.readSpaceSource},"get")});var cD=gF();Object.defineProperty(m,"ParityValidator",{enumerable:!0,get:a(function(){return cD.ParityValidator},"get")});Object.defineProperty(m,"summarizeParityRound",{enumerable:!0,get:a(function(){return cD.summarizeParityRound},"get")});var lD=GT();Object.defineProperty(m,"compareAssetSemantics",{enumerable:!0,get:a(function(){return lD.compareAssetSemantics},"get")});Object.defineProperty(m,"isFormatOnlyDrift",{enumerable:!0,get:a(function(){return lD.isFormatOnlyDrift},"get")});ri(xF(),m)});var Pr=w(d2=>{"use strict";d2.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})};d2.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 fD=w((Ube,uD)=>{var Ea=require("constants"),bX=process.cwd,Wy=null,_X=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Wy||(Wy=bX.call(process)),Wy};try{process.cwd()}catch{}typeof process.chdir=="function"&&(h2=process.chdir,process.chdir=function(n){Wy=null,h2.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,h2));var h2;uD.exports=SX;function SX(n){Ea.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=o(n.chownSync),n.fchownSync=o(n.fchownSync),n.lchownSync=o(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,d,h){h&&process.nextTick(h)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,d,h,p){p&&process.nextTick(p)},n.lchownSync=function(){}),_X==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,g){var y=Date.now(),b=0;f(h,p,a(function S(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){n.stat(p,function(I,A){I&&I.code==="ENOENT"?f(h,p,S):g(v)})},b),b<100&&(b+=10);return}g&&g(v)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function d(h,p,g,y,b,S){var v;if(S&&typeof S=="function"){var I=0;v=a(function(A,T,R){if(A&&A.code==="EAGAIN"&&I<10)return I++,f.call(n,h,p,g,y,b,v);S.apply(this,arguments)},"callback")}return f.call(n,h,p,g,y,b,v)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(d,h,p,g,y){for(var b=0;;)try{return f.call(n,d,h,p,g,y)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Ea.O_WRONLY|Ea.O_SYMLINK,h,function(g,y){if(g){p&&p(g);return}f.fchmod(y,h,function(b){f.close(y,function(S){p&&p(b||S)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Ea.O_WRONLY|Ea.O_SYMLINK,h),g=!0,y;try{y=f.fchmodSync(p,h),g=!1}finally{if(g)try{f.closeSync(p)}catch{}else f.closeSync(p)}return y}}a(e,"patchLchmod");function t(f){Ea.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,g){f.open(d,Ea.O_SYMLINK,function(y,b){if(y){g&&g(y);return}f.futimes(b,h,p,function(S){f.close(b,function(v){g&&g(S||v)})})})},f.lutimesSync=function(d,h,p){var g=f.openSync(d,Ea.O_SYMLINK),y,b=!0;try{y=f.futimesSync(g,h,p),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}):f.futimes&&(f.lutimes=function(d,h,p,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}a(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(g){u(g)&&(g=null),p&&p.apply(this,arguments)})}}a(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}a(i,"chmodFixSync");function s(f){return f&&function(d,h,p,g){return f.call(n,d,h,p,function(y){u(y)&&(y=null),g&&g.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(g){if(!u(g))throw g}}}a(o,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function g(y,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),p&&p.apply(this,arguments)}return a(g,"callback"),h?f.call(n,d,h,g):f.call(n,d,g)}}a(c,"statFix");function l(f){return f&&function(d,h){var p=h?f.call(n,d,h):f.call(n,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(SX,"patch")});var pD=w((Vbe,hD)=>{var dD=require("stream").Stream;hD.exports=wX;function wX(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);dD.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 o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[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,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(r,i){if(!(this instanceof t))return new t(r,i);dD.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),o=0,c=s.length;o<c;o++){var l=s[o];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())}}a(wX,"legacy")});var gD=w((Gbe,mD)=>{"use strict";mD.exports=EX;var vX=Object.getPrototypeOf||function(n){return n.__proto__};function EX(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:vX(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}a(EX,"clone")});var yu=w((Hbe,g2)=>{var qt=require("fs"),TX=fD(),AX=pD(),IX=gD(),Hy=require("util"),Hr,Ky;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Hr=Symbol.for("graceful-fs.queue"),Ky=Symbol.for("graceful-fs.previous")):(Hr="___graceful-fs.queue",Ky="___graceful-fs.previous");function xX(){}a(xX,"noop");function _D(n,e){Object.defineProperty(n,Hr,{get:a(function(){return e},"get")})}a(_D,"publishQueue");var Rc=xX;Hy.debuglog?Rc=Hy.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Rc=a(function(){var n=Hy.format.apply(Hy,arguments);n="GFS4: "+n.split(/\n/).join(`
|
|
325
325
|
GFS4: `),console.error(n)},"debug"));qt[Hr]||(yD=global[Hr]||[],_D(qt,yD),qt.close=(function(n){function e(t,r){return n.call(qt,t,function(i){i||bD(),typeof r=="function"&&r.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,Ky,{value:n}),e})(qt.close),qt.closeSync=(function(n){function e(t){n.apply(qt,arguments),bD()}return a(e,"closeSync"),Object.defineProperty(e,Ky,{value:n}),e})(qt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Rc(qt[Hr]),require("assert").equal(qt[Hr].length,0)}));var yD;global[Hr]||_D(global,qt[Hr]);g2.exports=p2(IX(qt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!qt.__patched&&(g2.exports=p2(qt),qt.__patched=!0);function p2(n){TX(n),n.gracefulify=p2,n.createReadStream=T,n.createWriteStream=R;var e=n.readFile;n.readFile=t;function t(P,M,O){return typeof M=="function"&&(O=M,M=null),Y(P,M,O);function Y(oe,Q,be,le){return e(oe,Q,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?gu([Y,[oe,Q,be],ue,le||Date.now(),Date.now()]):typeof be=="function"&&be.apply(this,arguments)})}a(Y,"go$readFile")}a(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(P,M,O,Y){return typeof O=="function"&&(Y=O,O=null),oe(P,M,O,Y);function oe(Q,be,le,ue,k){return r(Q,be,le,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?gu([oe,[Q,be,le,ue],G,k||Date.now(),Date.now()]):typeof ue=="function"&&ue.apply(this,arguments)})}a(oe,"go$writeFile")}a(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=o);function o(P,M,O,Y){return typeof O=="function"&&(Y=O,O=null),oe(P,M,O,Y);function oe(Q,be,le,ue,k){return s(Q,be,le,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?gu([oe,[Q,be,le,ue],G,k||Date.now(),Date.now()]):typeof ue=="function"&&ue.apply(this,arguments)})}a(oe,"go$appendFile")}a(o,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(P,M,O,Y){return typeof O=="function"&&(Y=O,O=0),oe(P,M,O,Y);function oe(Q,be,le,ue,k){return c(Q,be,le,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?gu([oe,[Q,be,le,ue],G,k||Date.now(),Date.now()]):typeof ue=="function"&&ue.apply(this,arguments)})}a(oe,"go$copyFile")}a(l,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(P,M,O){typeof M=="function"&&(O=M,M=null);var Y=f.test(process.version)?a(function(be,le,ue,k){return u(be,oe(be,le,ue,k))},"go$readdir"):a(function(be,le,ue,k){return u(be,le,oe(be,le,ue,k))},"go$readdir");return Y(P,M,O);function oe(Q,be,le,ue){return function(k,G){k&&(k.code==="EMFILE"||k.code==="ENFILE")?gu([Y,[Q,be,le],k,ue||Date.now(),Date.now()]):(G&&G.sort&&G.sort(),typeof le=="function"&&le.call(this,k,G))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var h=AX(n);S=h.ReadStream,I=h.WriteStream}var p=n.ReadStream;p&&(S.prototype=Object.create(p.prototype),S.prototype.open=v);var g=n.WriteStream;g&&(I.prototype=Object.create(g.prototype),I.prototype.open=A),Object.defineProperty(n,"ReadStream",{get:a(function(){return S},"get"),set:a(function(P){S=P},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:a(function(){return I},"get"),set:a(function(P){I=P},"set"),enumerable:!0,configurable:!0});var y=S;Object.defineProperty(n,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(P){y=P},"set"),enumerable:!0,configurable:!0});var b=I;Object.defineProperty(n,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(P){b=P},"set"),enumerable:!0,configurable:!0});function S(P,M){return this instanceof S?(p.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"ReadStream");function v(){var P=this;L(P.path,P.flags,P.mode,function(M,O){M?(P.autoClose&&P.destroy(),P.emit("error",M)):(P.fd=O,P.emit("open",O),P.read())})}a(v,"ReadStream$open");function I(P,M){return this instanceof I?(g.apply(this,arguments),this):I.apply(Object.create(I.prototype),arguments)}a(I,"WriteStream");function A(){var P=this;L(P.path,P.flags,P.mode,function(M,O){M?(P.destroy(),P.emit("error",M)):(P.fd=O,P.emit("open",O))})}a(A,"WriteStream$open");function T(P,M){return new n.ReadStream(P,M)}a(T,"createReadStream");function R(P,M){return new n.WriteStream(P,M)}a(R,"createWriteStream");var B=n.open;n.open=L;function L(P,M,O,Y){return typeof O=="function"&&(Y=O,O=null),oe(P,M,O,Y);function oe(Q,be,le,ue,k){return B(Q,be,le,function(G,je){G&&(G.code==="EMFILE"||G.code==="ENFILE")?gu([oe,[Q,be,le,ue],G,k||Date.now(),Date.now()]):typeof ue=="function"&&ue.apply(this,arguments)})}a(oe,"go$open")}return a(L,"open"),n}a(p2,"patch");function gu(n){Rc("ENQUEUE",n[0].name,n[1]),qt[Hr].push(n),m2()}a(gu,"enqueue");var zy;function bD(){for(var n=Date.now(),e=0;e<qt[Hr].length;++e)qt[Hr][e].length>2&&(qt[Hr][e][3]=n,qt[Hr][e][4]=n);m2()}a(bD,"resetQueue");function m2(){if(clearTimeout(zy),zy=void 0,qt[Hr].length!==0){var n=qt[Hr].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Rc("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Rc("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Rc("RETRY",e.name,t),e.apply(null,t.concat([i]))):qt[Hr].push(n)}zy===void 0&&(zy=setTimeout(m2,0))}}a(m2,"retry")});var Sn=w(Fo=>{"use strict";var SD=Pr().fromCallback,_n=yu(),RX=["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 _n[n]=="function");Object.assign(Fo,_n);RX.forEach(n=>{Fo[n]=SD(_n[n])});Fo.exists=function(n,e){return typeof e=="function"?_n.exists(n,e):new Promise(t=>_n.exists(n,t))};Fo.read=function(n,e,t,r,i,s){return typeof s=="function"?_n.read(n,e,t,r,i,s):new Promise((o,c)=>{_n.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};Fo.write=function(n,e,...t){return typeof t[t.length-1]=="function"?_n.write(n,e,...t):new Promise((r,i)=>{_n.write(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffer:c})})})};Fo.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?_n.readv(n,e,...t):new Promise((r,i)=>{_n.readv(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesRead:o,buffers:c})})})};Fo.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?_n.writev(n,e,...t):new Promise((r,i)=>{_n.writev(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffers:c})})})};typeof _n.realpath.native=="function"?Fo.realpath.native=SD(_n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var vD=w((Qbe,wD)=>{"use strict";var CX=require("path");wD.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(CX.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var ID=w((Xbe,y2)=>{"use strict";var ED=Sn(),{checkPath:TD}=vD(),AD=a(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");y2.exports.makeDir=async(n,e)=>(TD(n),ED.mkdir(n,{mode:AD(e),recursive:!0}));y2.exports.makeDirSync=(n,e)=>(TD(n),ED.mkdirSync(n,{mode:AD(e),recursive:!0}))});var Zi=w((Zbe,xD)=>{"use strict";var OX=Pr().fromPromise,{makeDir:PX,makeDirSync:b2}=ID(),_2=OX(PX);xD.exports={mkdirs:_2,mkdirsSync:b2,mkdirp:_2,mkdirpSync:b2,ensureDir:_2,ensureDirSync:b2}});var Ta=w((e_e,CD)=>{"use strict";var FX=Pr().fromPromise,RD=Sn();function DX(n){return RD.access(n).then(()=>!0).catch(()=>!1)}a(DX,"pathExists");CD.exports={pathExists:FX(DX),pathExistsSync:RD.existsSync}});var S2=w((r_e,OD)=>{"use strict";var bu=Sn(),LX=Pr().fromPromise;async function NX(n,e,t){let r=await bu.open(n,"r+"),i=null;try{await bu.futimes(r,e,t)}finally{try{await bu.close(r)}catch(s){i=s}}if(i)throw i}a(NX,"utimesMillis");function kX(n,e,t){let r=bu.openSync(n,"r+");return bu.futimesSync(r,e,t),bu.closeSync(r)}a(kX,"utimesMillisSync");OD.exports={utimesMillis:LX(NX),utimesMillisSync:kX}});var Cc=w((i_e,LD)=>{"use strict";var _u=Sn(),Fr=require("path"),PD=Pr().fromPromise;function MX(n,e,t){let r=t.dereference?i=>_u.stat(i,{bigint:!0}):i=>_u.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}))}a(MX,"getStats");function jX(n,e,t){let r,i=t.dereference?o=>_u.statSync(o,{bigint:!0}):o=>_u.lstatSync(o,{bigint:!0}),s=i(n);try{r=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:r}}a(jX,"getStatsSync");async function $X(n,e,t,r){let{srcStat:i,destStat:s}=await MX(n,e,r);if(s){if(Ld(i,s)){let o=Fr.basename(n),c=Fr.basename(e);if(t==="move"&&o!==c&&o.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()&&w2(n,e))throw new Error(Qy(n,e,t));return{srcStat:i,destStat:s}}a($X,"checkPaths");function UX(n,e,t,r){let{srcStat:i,destStat:s}=jX(n,e,r);if(s){if(Ld(i,s)){let o=Fr.basename(n),c=Fr.basename(e);if(t==="move"&&o!==c&&o.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()&&w2(n,e))throw new Error(Qy(n,e,t));return{srcStat:i,destStat:s}}a(UX,"checkPathsSync");async function FD(n,e,t,r){let i=Fr.resolve(Fr.dirname(n)),s=Fr.resolve(Fr.dirname(t));if(s===i||s===Fr.parse(s).root)return;let o;try{o=await _u.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Ld(e,o))throw new Error(Qy(n,t,r));return FD(n,e,s,r)}a(FD,"checkParentPaths");function DD(n,e,t,r){let i=Fr.resolve(Fr.dirname(n)),s=Fr.resolve(Fr.dirname(t));if(s===i||s===Fr.parse(s).root)return;let o;try{o=_u.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Ld(e,o))throw new Error(Qy(n,t,r));return DD(n,e,s,r)}a(DD,"checkParentPathsSync");function Ld(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}a(Ld,"areIdentical");function w2(n,e){let t=Fr.resolve(n).split(Fr.sep).filter(i=>i),r=Fr.resolve(e).split(Fr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}a(w2,"isSrcSubdir");function Qy(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}a(Qy,"errMsg");LD.exports={checkPaths:PD($X),checkPathsSync:UX,checkParentPaths:PD(FD),checkParentPathsSync:DD,isSrcSubdir:w2,areIdentical:Ld}});var kD=w((o_e,ND)=>{"use strict";async function BX(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})))}a(BX,"asyncIteratorConcurrentProcess");ND.exports={asyncIteratorConcurrentProcess:BX}});var BD=w((c_e,UD)=>{"use strict";var rn=Sn(),Nd=require("path"),{mkdirs:VX}=Zi(),{pathExists:qX}=Ta(),{utimesMillis:GX}=S2(),kd=Cc(),{asyncIteratorConcurrentProcess:WX}=kD();async function HX(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;
|
|
326
326
|
|
|
327
327
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await kd.checkPaths(n,e,"copy",t);if(await kd.checkParentPaths(n,r,e,"copy"),!await jD(n,e,t))return;let o=Nd.dirname(e);await qX(o)||await VX(o),await $D(i,n,e,t)}a(HX,"copy");async function jD(n,e,t){return t.filter?t.filter(n,e):!0}a(jD,"runFilter");async function $D(n,e,t,r){let s=await(r.dereference?rn.stat:rn.lstat)(e);if(s.isDirectory())return YX(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return zX(s,n,e,t,r);if(s.isSymbolicLink())return XX(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}`)}a($D,"getStatsAndPerformCopy");async function zX(n,e,t,r,i){if(!e)return MD(n,t,r,i);if(i.overwrite)return await rn.unlink(r),MD(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}a(zX,"onFile");async function MD(n,e,t,r){if(await rn.copyFile(e,t),r.preserveTimestamps){KX(n.mode)&&await QX(t,n.mode);let i=await rn.stat(e);await GX(t,i.atime,i.mtime)}return rn.chmod(t,n.mode)}a(MD,"copyFile");function KX(n){return(n&128)===0}a(KX,"fileIsNotWritable");function QX(n,e){return rn.chmod(n,e|128)}a(QX,"makeFileWritable");async function YX(n,e,t,r,i){e||await rn.mkdir(r),await WX(await rn.opendir(t),async s=>{let o=Nd.join(t,s.name),c=Nd.join(r,s.name);if(await jD(o,c,i)){let{destStat:u}=await kd.checkPaths(o,c,"copy",i);await $D(u,o,c,i)}}),e||await rn.chmod(r,n.mode)}a(YX,"onDir");async function XX(n,e,t,r){let i=await rn.readlink(e);if(r.dereference&&(i=Nd.resolve(process.cwd(),i)),!n)return rn.symlink(i,t);let s=null;try{s=await rn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return rn.symlink(i,t);throw o}if(r.dereference&&(s=Nd.resolve(process.cwd(),s)),kd.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(kd.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await rn.unlink(t),rn.symlink(i,t)}a(XX,"onLink");UD.exports=HX});var HD=w((u_e,WD)=>{"use strict";var wn=yu(),Md=require("path"),JX=Zi().mkdirsSync,ZX=S2().utimesMillisSync,jd=Cc();function eJ(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;
|
|
@@ -340,15 +340,15 @@ GFS4: `),console.error(n)},"debug"));qt[Hr]||(yD=global[Hr]||[],_D(qt,yD),qt.clo
|
|
|
340
340
|
`,c+=Sr.repeat("-",e.indent+f+3+u.pos)+`^
|
|
341
341
|
`,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=I2(n.buffer,r[o+l],i[o+l],n.position-(r[o]-r[o+l]),d),c+=Sr.repeat(" ",e.indent)+x2((n.line+l+1).toString(),f)+" | "+u.str+`
|
|
342
342
|
`;return c.replace(/\n$/,"")}a(PZ,"makeSnippet");var FZ=PZ,DZ=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],LZ=["scalar","sequence","mapping"];function NZ(n){var e={};return n!==null&&Object.keys(n).forEach(function(t){n[t].forEach(function(r){e[String(r)]=t})}),e}a(NZ,"compileStyleAliases");function kZ(n,e){if(e=e||{},Object.keys(e).forEach(function(t){if(DZ.indexOf(t)===-1)throw new En('Unknown option "'+t+'" is met in definition of "'+n+'" YAML type.')}),this.options=e,this.tag=n,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=NZ(e.styleAliases||null),LZ.indexOf(this.kind)===-1)throw new En('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}a(kZ,"Type$1");var zr=kZ;function sN(n,e){var t=[];return n[e].forEach(function(r){var i=t.length;t.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),t[i]=r}),t}a(sN,"compileList");function MZ(){var n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function r(i){i.multi?(n.multi[i.kind].push(i),n.multi.fallback.push(i)):n[i.kind][i.tag]=n.fallback[i.tag]=i}for(a(r,"collectType"),e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}a(MZ,"compileMap");function C2(n){return this.extend(n)}a(C2,"Schema$1");C2.prototype.extend=a(function(e){var t=[],r=[];if(e instanceof zr)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new En("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof zr))throw new En("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new En("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new En("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof zr))throw new En("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(C2.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=sN(i,"implicit"),i.compiledExplicit=sN(i,"explicit"),i.compiledTypeMap=MZ(i.compiledImplicit,i.compiledExplicit),i},"extend");var vN=C2,EN=new zr("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(n){return n!==null?n:""},"construct")}),TN=new zr("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(n){return n!==null?n:[]},"construct")}),AN=new zr("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(n){return n!==null?n:{}},"construct")}),IN=new vN({explicit:[EN,TN,AN]});function jZ(n){if(n===null)return!0;var e=n.length;return e===1&&n==="~"||e===4&&(n==="null"||n==="Null"||n==="NULL")}a(jZ,"resolveYamlNull");function $Z(){return null}a($Z,"constructYamlNull");function UZ(n){return n===null}a(UZ,"isNull");var xN=new zr("tag:yaml.org,2002:null",{kind:"scalar",resolve:jZ,construct:$Z,predicate:UZ,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"});function BZ(n){if(n===null)return!1;var e=n.length;return e===4&&(n==="true"||n==="True"||n==="TRUE")||e===5&&(n==="false"||n==="False"||n==="FALSE")}a(BZ,"resolveYamlBoolean");function VZ(n){return n==="true"||n==="True"||n==="TRUE"}a(VZ,"constructYamlBoolean");function qZ(n){return Object.prototype.toString.call(n)==="[object Boolean]"}a(qZ,"isBoolean");var RN=new zr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:BZ,construct:VZ,predicate:qZ,represent:{lowercase:a(function(n){return n?"true":"false"},"lowercase"),uppercase:a(function(n){return n?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(n){return n?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function GZ(n){return 48<=n&&n<=57||65<=n&&n<=70||97<=n&&n<=102}a(GZ,"isHexCode");function WZ(n){return 48<=n&&n<=55}a(WZ,"isOctCode");function HZ(n){return 48<=n&&n<=57}a(HZ,"isDecCode");function zZ(n){if(n===null)return!1;var e=n.length,t=0,r=!1,i;if(!e)return!1;if(i=n[t],(i==="-"||i==="+")&&(i=n[++t]),i==="0"){if(t+1===e)return!0;if(i=n[++t],i==="b"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!GZ(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!WZ(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=n[t],i!=="_"){if(!HZ(n.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}a(zZ,"resolveYamlInteger");function KZ(n){var e=n,t=1,r;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),r=e[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),e=e.slice(1),r=e[0]),e==="0")return 0;if(r==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}a(KZ,"constructYamlInteger");function QZ(n){return Object.prototype.toString.call(n)==="[object Number]"&&n%1===0&&!Sr.isNegativeZero(n)}a(QZ,"isInteger");var CN=new zr("tag:yaml.org,2002:int",{kind:"scalar",resolve:zZ,construct:KZ,predicate:QZ,represent:{binary:a(function(n){return n>=0?"0b"+n.toString(2):"-0b"+n.toString(2).slice(1)},"binary"),octal:a(function(n){return n>=0?"0o"+n.toString(8):"-0o"+n.toString(8).slice(1)},"octal"),decimal:a(function(n){return n.toString(10)},"decimal"),hexadecimal:a(function(n){return n>=0?"0x"+n.toString(16).toUpperCase():"-0x"+n.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YZ=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function XZ(n){return!(n===null||!YZ.test(n)||n[n.length-1]==="_")}a(XZ,"resolveYamlFloat");function JZ(n){var e,t;return e=n.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}a(JZ,"constructYamlFloat");var ZZ=/^[-+]?[0-9]+e/;function eee(n,e){var t;if(isNaN(n))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===n)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===n)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Sr.isNegativeZero(n))return"-0.0";return t=n.toString(10),ZZ.test(t)?t.replace("e",".e"):t}a(eee,"representYamlFloat");function tee(n){return Object.prototype.toString.call(n)==="[object Number]"&&(n%1!==0||Sr.isNegativeZero(n))}a(tee,"isFloat");var ON=new zr("tag:yaml.org,2002:float",{kind:"scalar",resolve:XZ,construct:JZ,predicate:tee,represent:eee,defaultStyle:"lowercase"}),PN=IN.extend({implicit:[xN,RN,CN,ON]}),FN=PN,DN=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),LN=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ree(n){return n===null?!1:DN.exec(n)!==null||LN.exec(n)!==null}a(ree,"resolveYamlTimestamp");function nee(n){var e,t,r,i,s,o,c,l=0,u=null,f,d,h;if(e=DN.exec(n),e===null&&(e=LN.exec(n)),e===null)throw new Error("Date resolve error");if(t=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,r,i));if(s=+e[4],o=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(f=+e[10],d=+(e[11]||0),u=(f*60+d)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(t,r,i,s,o,c,l)),u&&h.setTime(h.getTime()-u),h}a(nee,"constructYamlTimestamp");function iee(n){return n.toISOString()}a(iee,"representYamlTimestamp");var NN=new zr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ree,construct:nee,instanceOf:Date,represent:iee});function see(n){return n==="<<"||n===null}a(see,"resolveYamlMerge");var kN=new zr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:see}),L2=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
343
|
-
\r`;function oee(n){if(n===null)return!1;var e,t,r=0,i=n.length,s=L2;for(t=0;t<i;t++)if(e=s.indexOf(n.charAt(t)),!(e>64)){if(e<0)return!1;r+=6}return r%8===0}a(oee,"resolveYamlBinary");function aee(n){var e,t,r=n.replace(/[\r\n=]/g,""),i=r.length,s=L2,o=0,c=[];for(e=0;e<i;e++)e%4===0&&e&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return t=i%4*6,t===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):t===18?(c.push(o>>10&255),c.push(o>>2&255)):t===12&&c.push(o>>4&255),new Uint8Array(c)}a(aee,"constructYamlBinary");function cee(n){var e="",t=0,r,i,s=n.length,o=L2;for(r=0;r<s;r++)r%3===0&&r&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+n[r];return i=s%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}a(cee,"representYamlBinary");function lee(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}a(lee,"isBinary");var MN=new zr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:oee,construct:aee,predicate:lee,represent:cee}),uee=Object.prototype.hasOwnProperty,fee=Object.prototype.toString;function dee(n){if(n===null)return!0;var e=[],t,r,i,s,o,c=n;for(t=0,r=c.length;t<r;t+=1){if(i=c[t],o=!1,fee.call(i)!=="[object Object]")return!1;for(s in i)if(uee.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}a(dee,"resolveYamlOmap");function hee(n){return n!==null?n:[]}a(hee,"constructYamlOmap");var jN=new zr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dee,construct:hee}),pee=Object.prototype.toString;function mee(n){if(n===null)return!0;var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(r=o[e],pee.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}a(mee,"resolveYamlPairs");function gee(n){if(n===null)return[];var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)r=o[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}a(gee,"constructYamlPairs");var $N=new zr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:mee,construct:gee}),yee=Object.prototype.hasOwnProperty;function bee(n){if(n===null)return!0;var e,t=n;for(e in t)if(yee.call(t,e)&&t[e]!==null)return!1;return!0}a(bee,"resolveYamlSet");function _ee(n){return n!==null?n:{}}a(_ee,"constructYamlSet");var UN=new zr("tag:yaml.org,2002:set",{kind:"mapping",resolve:bee,construct:_ee}),N2=FN.extend({implicit:[NN,kN],explicit:[MN,jN,$N,UN]}),Ra=Object.prototype.hasOwnProperty,t0=1,BN=2,VN=3,r0=4,R2=1,See=2,oN=3,wee=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vee=/[\x85\u2028\u2029]/,Eee=/[,\[\]\{\}]/,qN=/^(?:!|!!|![a-z\-]+!)$/i,GN=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function aN(n){return Object.prototype.toString.call(n)}a(aN,"_class");function Ms(n){return n===10||n===13}a(Ms,"is_EOL");function Pc(n){return n===9||n===32}a(Pc,"is_WHITE_SPACE");function
|
|
344
|
-
`:n===118?"\v":n===102?"\f":n===114?"\r":n===101?"\x1B":n===32?" ":n===34?'"':n===47?"/":n===92?"\\":n===78?"\x85":n===95?"\xA0":n===76?"\u2028":n===80?"\u2029":""}a(cN,"simpleEscapeSequence");function xee(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}a(xee,"charFromCodepoint");function WN(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}a(WN,"setProperty");var HN=new Array(256),zN=new Array(256);for(Oc=0;Oc<256;Oc++)HN[Oc]=cN(Oc)?1:0,zN[Oc]=cN(Oc);var Oc;function Ree(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||N2,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=n.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(Ree,"State$1");function KN(n,e){var t={name:n.filename,buffer:n.input.slice(0,-1),position:n.position,line:n.line,column:n.position-n.lineStart};return t.snippet=FZ(t),new En(e,t)}a(KN,"generateError");function ve(n,e){throw KN(n,e)}a(ve,"throwError");function n0(n,e){n.onWarning&&n.onWarning.call(null,KN(n,e))}a(n0,"throwWarning");var lN={YAML:a(function(e,t,r){var i,s,o;e.version!==null&&ve(e,"duplication of %YAML directive"),r.length!==1&&ve(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&ve(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&ve(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&n0(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,t,r){var i,s;r.length!==2&&ve(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],qN.test(i)||ve(e,"ill-formed tag handle (first argument) of the TAG directive"),Ra.call(e.tagMap,i)&&ve(e,'there is a previously declared suffix for "'+i+'" tag handle'),GN.test(s)||ve(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{ve(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function xa(n,e,t,r){var i,s,o,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||ve(n,"expected valid JSON character");else wee.test(c)&&ve(n,"the stream contains non-printable characters");n.result+=c}}a(xa,"captureSegment");function uN(n,e,t,r){var i,s,o,c;for(Sr.isObject(t)||ve(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,c=i.length;o<c;o+=1)s=i[o],Ra.call(e,s)||(WN(e,s,t[s]),r[s]=!0)}a(uN,"mergeMappings");function Eu(n,e,t,r,i,s,o,c,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&ve(n,"nested arrays are not supported inside keys"),typeof i=="object"&&aN(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&aN(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)uN(n,e,s[u],t);else uN(n,e,s,t);else!n.json&&!Ra.call(t,i)&&Ra.call(e,i)&&(n.line=o||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,ve(n,"duplicated mapping key")),WN(e,i,s),delete t[i];return e}a(Eu,"storeMappingPair");function k2(n){var e;e=n.input.charCodeAt(n.position),e===10?n.position++:e===13?(n.position++,n.input.charCodeAt(n.position)===10&&n.position++):ve(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}a(k2,"readLineBreak");function hr(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;Pc(i);)i===9&&n.firstTabInLine===-1&&(n.firstTabInLine=n.position),i=n.input.charCodeAt(++n.position);if(e&&i===35)do i=n.input.charCodeAt(++n.position);while(i!==10&&i!==13&&i!==0);if(Ms(i))for(k2(n),i=n.input.charCodeAt(n.position),r++,n.lineIndent=0;i===32;)n.lineIndent++,i=n.input.charCodeAt(++n.position);else break}return t!==-1&&r!==0&&n.lineIndent<t&&n0(n,"deficient indentation"),r}a(hr,"skipSeparationSpace");function o0(n){var e=n.position,t;return t=n.input.charCodeAt(e),!!((t===45||t===46)&&t===n.input.charCodeAt(e+1)&&t===n.input.charCodeAt(e+2)&&(e+=3,t=n.input.charCodeAt(e),t===0||
|
|
345
|
-
`,e-1))}a(M2,"writeFoldedLines");function Cee(n,e,t){var r,i,s,o,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),
|
|
343
|
+
\r`;function oee(n){if(n===null)return!1;var e,t,r=0,i=n.length,s=L2;for(t=0;t<i;t++)if(e=s.indexOf(n.charAt(t)),!(e>64)){if(e<0)return!1;r+=6}return r%8===0}a(oee,"resolveYamlBinary");function aee(n){var e,t,r=n.replace(/[\r\n=]/g,""),i=r.length,s=L2,o=0,c=[];for(e=0;e<i;e++)e%4===0&&e&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return t=i%4*6,t===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):t===18?(c.push(o>>10&255),c.push(o>>2&255)):t===12&&c.push(o>>4&255),new Uint8Array(c)}a(aee,"constructYamlBinary");function cee(n){var e="",t=0,r,i,s=n.length,o=L2;for(r=0;r<s;r++)r%3===0&&r&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+n[r];return i=s%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}a(cee,"representYamlBinary");function lee(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}a(lee,"isBinary");var MN=new zr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:oee,construct:aee,predicate:lee,represent:cee}),uee=Object.prototype.hasOwnProperty,fee=Object.prototype.toString;function dee(n){if(n===null)return!0;var e=[],t,r,i,s,o,c=n;for(t=0,r=c.length;t<r;t+=1){if(i=c[t],o=!1,fee.call(i)!=="[object Object]")return!1;for(s in i)if(uee.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}a(dee,"resolveYamlOmap");function hee(n){return n!==null?n:[]}a(hee,"constructYamlOmap");var jN=new zr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dee,construct:hee}),pee=Object.prototype.toString;function mee(n){if(n===null)return!0;var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(r=o[e],pee.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}a(mee,"resolveYamlPairs");function gee(n){if(n===null)return[];var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)r=o[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}a(gee,"constructYamlPairs");var $N=new zr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:mee,construct:gee}),yee=Object.prototype.hasOwnProperty;function bee(n){if(n===null)return!0;var e,t=n;for(e in t)if(yee.call(t,e)&&t[e]!==null)return!1;return!0}a(bee,"resolveYamlSet");function _ee(n){return n!==null?n:{}}a(_ee,"constructYamlSet");var UN=new zr("tag:yaml.org,2002:set",{kind:"mapping",resolve:bee,construct:_ee}),N2=FN.extend({implicit:[NN,kN],explicit:[MN,jN,$N,UN]}),Ra=Object.prototype.hasOwnProperty,t0=1,BN=2,VN=3,r0=4,R2=1,See=2,oN=3,wee=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vee=/[\x85\u2028\u2029]/,Eee=/[,\[\]\{\}]/,qN=/^(?:!|!!|![a-z\-]+!)$/i,GN=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function aN(n){return Object.prototype.toString.call(n)}a(aN,"_class");function Ms(n){return n===10||n===13}a(Ms,"is_EOL");function Pc(n){return n===9||n===32}a(Pc,"is_WHITE_SPACE");function Gn(n){return n===9||n===32||n===10||n===13}a(Gn,"is_WS_OR_EOL");function vu(n){return n===44||n===91||n===93||n===123||n===125}a(vu,"is_FLOW_INDICATOR");function Tee(n){var e;return 48<=n&&n<=57?n-48:(e=n|32,97<=e&&e<=102?e-97+10:-1)}a(Tee,"fromHexCode");function Aee(n){return n===120?2:n===117?4:n===85?8:0}a(Aee,"escapedHexLen");function Iee(n){return 48<=n&&n<=57?n-48:-1}a(Iee,"fromDecimalCode");function cN(n){return n===48?"\0":n===97?"\x07":n===98?"\b":n===116||n===9?" ":n===110?`
|
|
344
|
+
`:n===118?"\v":n===102?"\f":n===114?"\r":n===101?"\x1B":n===32?" ":n===34?'"':n===47?"/":n===92?"\\":n===78?"\x85":n===95?"\xA0":n===76?"\u2028":n===80?"\u2029":""}a(cN,"simpleEscapeSequence");function xee(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}a(xee,"charFromCodepoint");function WN(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}a(WN,"setProperty");var HN=new Array(256),zN=new Array(256);for(Oc=0;Oc<256;Oc++)HN[Oc]=cN(Oc)?1:0,zN[Oc]=cN(Oc);var Oc;function Ree(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||N2,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=n.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(Ree,"State$1");function KN(n,e){var t={name:n.filename,buffer:n.input.slice(0,-1),position:n.position,line:n.line,column:n.position-n.lineStart};return t.snippet=FZ(t),new En(e,t)}a(KN,"generateError");function ve(n,e){throw KN(n,e)}a(ve,"throwError");function n0(n,e){n.onWarning&&n.onWarning.call(null,KN(n,e))}a(n0,"throwWarning");var lN={YAML:a(function(e,t,r){var i,s,o;e.version!==null&&ve(e,"duplication of %YAML directive"),r.length!==1&&ve(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&ve(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&ve(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&n0(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,t,r){var i,s;r.length!==2&&ve(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],qN.test(i)||ve(e,"ill-formed tag handle (first argument) of the TAG directive"),Ra.call(e.tagMap,i)&&ve(e,'there is a previously declared suffix for "'+i+'" tag handle'),GN.test(s)||ve(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{ve(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function xa(n,e,t,r){var i,s,o,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||ve(n,"expected valid JSON character");else wee.test(c)&&ve(n,"the stream contains non-printable characters");n.result+=c}}a(xa,"captureSegment");function uN(n,e,t,r){var i,s,o,c;for(Sr.isObject(t)||ve(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,c=i.length;o<c;o+=1)s=i[o],Ra.call(e,s)||(WN(e,s,t[s]),r[s]=!0)}a(uN,"mergeMappings");function Eu(n,e,t,r,i,s,o,c,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&ve(n,"nested arrays are not supported inside keys"),typeof i=="object"&&aN(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&aN(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)uN(n,e,s[u],t);else uN(n,e,s,t);else!n.json&&!Ra.call(t,i)&&Ra.call(e,i)&&(n.line=o||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,ve(n,"duplicated mapping key")),WN(e,i,s),delete t[i];return e}a(Eu,"storeMappingPair");function k2(n){var e;e=n.input.charCodeAt(n.position),e===10?n.position++:e===13?(n.position++,n.input.charCodeAt(n.position)===10&&n.position++):ve(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}a(k2,"readLineBreak");function hr(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;Pc(i);)i===9&&n.firstTabInLine===-1&&(n.firstTabInLine=n.position),i=n.input.charCodeAt(++n.position);if(e&&i===35)do i=n.input.charCodeAt(++n.position);while(i!==10&&i!==13&&i!==0);if(Ms(i))for(k2(n),i=n.input.charCodeAt(n.position),r++,n.lineIndent=0;i===32;)n.lineIndent++,i=n.input.charCodeAt(++n.position);else break}return t!==-1&&r!==0&&n.lineIndent<t&&n0(n,"deficient indentation"),r}a(hr,"skipSeparationSpace");function o0(n){var e=n.position,t;return t=n.input.charCodeAt(e),!!((t===45||t===46)&&t===n.input.charCodeAt(e+1)&&t===n.input.charCodeAt(e+2)&&(e+=3,t=n.input.charCodeAt(e),t===0||Gn(t)))}a(o0,"testDocumentSeparator");function M2(n,e){e===1?n.result+=" ":e>1&&(n.result+=Sr.repeat(`
|
|
345
|
+
`,e-1))}a(M2,"writeFoldedLines");function Cee(n,e,t){var r,i,s,o,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),Gn(p)||vu(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=n.input.charCodeAt(n.position+1),Gn(i)||t&&vu(i)))return!1;for(n.kind="scalar",n.result="",s=o=n.position,c=!1;p!==0;){if(p===58){if(i=n.input.charCodeAt(n.position+1),Gn(i)||t&&vu(i))break}else if(p===35){if(r=n.input.charCodeAt(n.position-1),Gn(r))break}else{if(n.position===n.lineStart&&o0(n)||t&&vu(p))break;if(Ms(p))if(l=n.line,u=n.lineStart,f=n.lineIndent,hr(n,!1,-1),n.lineIndent>=e){c=!0,p=n.input.charCodeAt(n.position);continue}else{n.position=o,n.line=l,n.lineStart=u,n.lineIndent=f;break}}c&&(xa(n,s,o,!1),M2(n,n.line-l),s=o=n.position,c=!1),Pc(p)||(o=n.position+1),p=n.input.charCodeAt(++n.position)}return xa(n,s,o,!1),n.result?!0:(n.kind=d,n.result=h,!1)}a(Cee,"readPlainScalar");function Oee(n,e){var t,r,i;if(t=n.input.charCodeAt(n.position),t!==39)return!1;for(n.kind="scalar",n.result="",n.position++,r=i=n.position;(t=n.input.charCodeAt(n.position))!==0;)if(t===39)if(xa(n,r,n.position,!0),t=n.input.charCodeAt(++n.position),t===39)r=n.position,n.position++,i=n.position;else return!0;else Ms(t)?(xa(n,r,i,!0),M2(n,hr(n,!1,e)),r=i=n.position):n.position===n.lineStart&&o0(n)?ve(n,"unexpected end of the document within a single quoted scalar"):(n.position++,i=n.position);ve(n,"unexpected end of the stream within a single quoted scalar")}a(Oee,"readSingleQuotedScalar");function Pee(n,e){var t,r,i,s,o,c;if(c=n.input.charCodeAt(n.position),c!==34)return!1;for(n.kind="scalar",n.result="",n.position++,t=r=n.position;(c=n.input.charCodeAt(n.position))!==0;){if(c===34)return xa(n,t,n.position,!0),n.position++,!0;if(c===92){if(xa(n,t,n.position,!0),c=n.input.charCodeAt(++n.position),Ms(c))hr(n,!1,e);else if(c<256&&HN[c])n.result+=zN[c],n.position++;else if((o=Aee(c))>0){for(i=o,s=0;i>0;i--)c=n.input.charCodeAt(++n.position),(o=Tee(c))>=0?s=(s<<4)+o:ve(n,"expected hexadecimal character");n.result+=xee(s),n.position++}else ve(n,"unknown escape sequence");t=r=n.position}else Ms(c)?(xa(n,t,r,!0),M2(n,hr(n,!1,e)),t=r=n.position):n.position===n.lineStart&&o0(n)?ve(n,"unexpected end of the document within a double quoted scalar"):(n.position++,r=n.position)}ve(n,"unexpected end of the stream within a double quoted scalar")}a(Pee,"readDoubleQuotedScalar");function Fee(n,e){var t=!0,r,i,s,o=n.tag,c,l=n.anchor,u,f,d,h,p,g=Object.create(null),y,b,S,v;if(v=n.input.charCodeAt(n.position),v===91)f=93,p=!1,c=[];else if(v===123)f=125,p=!0,c={};else return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=c),v=n.input.charCodeAt(++n.position);v!==0;){if(hr(n,!0,e),v=n.input.charCodeAt(n.position),v===f)return n.position++,n.tag=o,n.anchor=l,n.kind=p?"mapping":"sequence",n.result=c,!0;t?v===44&&ve(n,"expected the node content, but found ','"):ve(n,"missed comma between flow collection entries"),b=y=S=null,d=h=!1,v===63&&(u=n.input.charCodeAt(n.position+1),Gn(u)&&(d=h=!0,n.position++,hr(n,!0,e))),r=n.line,i=n.lineStart,s=n.position,Tu(n,e,t0,!1,!0),b=n.tag,y=n.result,hr(n,!0,e),v=n.input.charCodeAt(n.position),(h||n.line===r)&&v===58&&(d=!0,v=n.input.charCodeAt(++n.position),hr(n,!0,e),Tu(n,e,t0,!1,!0),S=n.result),p?Eu(n,c,g,b,y,S,r,i,s):d?c.push(Eu(n,null,g,b,y,S,r,i,s)):c.push(y),hr(n,!0,e),v=n.input.charCodeAt(n.position),v===44?(t=!0,v=n.input.charCodeAt(++n.position)):t=!1}ve(n,"unexpected end of the stream within a flow collection")}a(Fee,"readFlowCollection");function Dee(n,e){var t,r,i=R2,s=!1,o=!1,c=e,l=0,u=!1,f,d;if(d=n.input.charCodeAt(n.position),d===124)r=!1;else if(d===62)r=!0;else return!1;for(n.kind="scalar",n.result="";d!==0;)if(d=n.input.charCodeAt(++n.position),d===43||d===45)R2===i?i=d===43?oN:See:ve(n,"repeat of a chomping mode identifier");else if((f=Iee(d))>=0)f===0?ve(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?ve(n,"repeat of an indentation width identifier"):(c=e+f-1,o=!0);else break;if(Pc(d)){do d=n.input.charCodeAt(++n.position);while(Pc(d));if(d===35)do d=n.input.charCodeAt(++n.position);while(!Ms(d)&&d!==0)}for(;d!==0;){for(k2(n),n.lineIndent=0,d=n.input.charCodeAt(n.position);(!o||n.lineIndent<c)&&d===32;)n.lineIndent++,d=n.input.charCodeAt(++n.position);if(!o&&n.lineIndent>c&&(c=n.lineIndent),Ms(d)){l++;continue}if(n.lineIndent<c){i===oN?n.result+=Sr.repeat(`
|
|
346
346
|
`,s?1+l:l):i===R2&&s&&(n.result+=`
|
|
347
347
|
`);break}for(r?Pc(d)?(u=!0,n.result+=Sr.repeat(`
|
|
348
348
|
`,s?1+l:l)):u?(u=!1,n.result+=Sr.repeat(`
|
|
349
349
|
`,l+1)):l===0?s&&(n.result+=" "):n.result+=Sr.repeat(`
|
|
350
350
|
`,l):n.result+=Sr.repeat(`
|
|
351
|
-
`,s?1+l:l),s=!0,o=!0,l=0,t=n.position;!Ms(d)&&d!==0;)d=n.input.charCodeAt(++n.position);xa(n,t,n.position,!1)}return!0}a(Dee,"readBlockScalar");function fN(n,e){var t,r=n.tag,i=n.anchor,s=[],o,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,ve(n,"tab characters must not be used in indentation")),!(l!==45||(o=n.input.charCodeAt(n.position+1),!
|
|
351
|
+
`,s?1+l:l),s=!0,o=!0,l=0,t=n.position;!Ms(d)&&d!==0;)d=n.input.charCodeAt(++n.position);xa(n,t,n.position,!1)}return!0}a(Dee,"readBlockScalar");function fN(n,e){var t,r=n.tag,i=n.anchor,s=[],o,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,ve(n,"tab characters must not be used in indentation")),!(l!==45||(o=n.input.charCodeAt(n.position+1),!Gn(o))));){if(c=!0,n.position++,hr(n,!0,-1)&&n.lineIndent<=e){s.push(null),l=n.input.charCodeAt(n.position);continue}if(t=n.line,Tu(n,e,VN,!1,!0),s.push(n.result),hr(n,!0,-1),l=n.input.charCodeAt(n.position),(n.line===t||n.lineIndent>e)&&l!==0)ve(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}a(fN,"readBlockSequence");function Lee(n,e,t){var r,i,s,o,c,l,u=n.tag,f=n.anchor,d={},h=Object.create(null),p=null,g=null,y=null,b=!1,S=!1,v;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=d),v=n.input.charCodeAt(n.position);v!==0;){if(!b&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,ve(n,"tab characters must not be used in indentation")),r=n.input.charCodeAt(n.position+1),s=n.line,(v===63||v===58)&&Gn(r))v===63?(b&&(Eu(n,d,h,p,g,null,o,c,l),p=g=y=null),S=!0,b=!0,i=!0):b?(b=!1,i=!0):ve(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,v=r;else{if(o=n.line,c=n.lineStart,l=n.position,!Tu(n,t,BN,!1,!0))break;if(n.line===s){for(v=n.input.charCodeAt(n.position);Pc(v);)v=n.input.charCodeAt(++n.position);if(v===58)v=n.input.charCodeAt(++n.position),Gn(v)||ve(n,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Eu(n,d,h,p,g,null,o,c,l),p=g=y=null),S=!0,b=!1,i=!1,p=n.tag,g=n.result;else if(S)ve(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=u,n.anchor=f,!0}else if(S)ve(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)&&(b&&(o=n.line,c=n.lineStart,l=n.position),Tu(n,e,r0,!0,i)&&(b?g=n.result:y=n.result),b||(Eu(n,d,h,p,g,y,o,c,l),p=g=y=null),hr(n,!0,-1),v=n.input.charCodeAt(n.position)),(n.line===s||n.lineIndent>e)&&v!==0)ve(n,"bad indentation of a mapping entry");else if(n.lineIndent<e)break}return b&&Eu(n,d,h,p,g,null,o,c,l),S&&(n.tag=u,n.anchor=f,n.kind="mapping",n.result=d),S}a(Lee,"readBlockMapping");function Nee(n){var e,t=!1,r=!1,i,s,o;if(o=n.input.charCodeAt(n.position),o!==33)return!1;if(n.tag!==null&&ve(n,"duplication of a tag property"),o=n.input.charCodeAt(++n.position),o===60?(t=!0,o=n.input.charCodeAt(++n.position)):o===33?(r=!0,i="!!",o=n.input.charCodeAt(++n.position)):i="!",e=n.position,t){do o=n.input.charCodeAt(++n.position);while(o!==0&&o!==62);n.position<n.length?(s=n.input.slice(e,n.position),o=n.input.charCodeAt(++n.position)):ve(n,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Gn(o);)o===33&&(r?ve(n,"tag suffix cannot contain exclamation marks"):(i=n.input.slice(e-1,n.position+1),qN.test(i)||ve(n,"named tag handle cannot contain such characters"),r=!0,e=n.position+1)),o=n.input.charCodeAt(++n.position);s=n.input.slice(e,n.position),Eee.test(s)&&ve(n,"tag suffix cannot contain flow indicator characters")}s&&!GN.test(s)&&ve(n,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{ve(n,"tag name is malformed: "+s)}return t?n.tag=s:Ra.call(n.tagMap,i)?n.tag=n.tagMap[i]+s:i==="!"?n.tag="!"+s:i==="!!"?n.tag="tag:yaml.org,2002:"+s:ve(n,'undeclared tag handle "'+i+'"'),!0}a(Nee,"readTagProperty");function kee(n){var e,t;if(t=n.input.charCodeAt(n.position),t!==38)return!1;for(n.anchor!==null&&ve(n,"duplication of an anchor property"),t=n.input.charCodeAt(++n.position),e=n.position;t!==0&&!Gn(t)&&!vu(t);)t=n.input.charCodeAt(++n.position);return n.position===e&&ve(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(e,n.position),!0}a(kee,"readAnchorProperty");function Mee(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&&!Gn(r)&&!vu(r);)r=n.input.charCodeAt(++n.position);return n.position===e&&ve(n,"name of an alias node must contain at least one character"),t=n.input.slice(e,n.position),Ra.call(n.anchorMap,t)||ve(n,'unidentified alias "'+t+'"'),n.result=n.anchorMap[t],hr(n,!0,-1),!0}a(Mee,"readAlias");function Tu(n,e,t,r,i){var s,o,c,l=1,u=!1,f=!1,d,h,p,g,y,b;if(n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null,s=o=c=r0===t||VN===t,r&&hr(n,!0,-1)&&(u=!0,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)),l===1)for(;Nee(n)||kee(n);)hr(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||r0===t)&&(t0===t||BN===t?y=e:y=e+1,b=n.position-n.lineStart,l===1?c&&(fN(n,b)||Lee(n,b,y))||Fee(n,y)?f=!0:(o&&Dee(n,y)||Oee(n,y)||Pee(n,y)?f=!0:Mee(n)?(f=!0,(n.tag!==null||n.anchor!==null)&&ve(n,"alias node should not have any properties")):Cee(n,y,t0===t)&&(f=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):l===0&&(f=c&&fN(n,b))),n.tag===null)n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);else if(n.tag==="?"){for(n.result!==null&&n.kind!=="scalar"&&ve(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"'),d=0,h=n.implicitTypes.length;d<h;d+=1)if(g=n.implicitTypes[d],g.resolve(n.result)){n.result=g.construct(n.result),n.tag=g.tag,n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);break}}else if(n.tag!=="!"){if(Ra.call(n.typeMap[n.kind||"fallback"],n.tag))g=n.typeMap[n.kind||"fallback"][n.tag];else for(g=null,p=n.typeMap.multi[n.kind||"fallback"],d=0,h=p.length;d<h;d+=1)if(n.tag.slice(0,p[d].tag.length)===p[d].tag){g=p[d];break}g||ve(n,"unknown tag !<"+n.tag+">"),n.result!==null&&g.kind!==n.kind&&ve(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+g.kind+'", not "'+n.kind+'"'),g.resolve(n.result,n.tag)?(n.result=g.construct(n.result,n.tag),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):ve(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}a(Tu,"composeNode");function jee(n){var e=n.position,t,r,i,s=!1,o;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(o=n.input.charCodeAt(n.position))!==0&&(hr(n,!0,-1),o=n.input.charCodeAt(n.position),!(n.lineIndent>0||o!==37));){for(s=!0,o=n.input.charCodeAt(++n.position),t=n.position;o!==0&&!Gn(o);)o=n.input.charCodeAt(++n.position);for(r=n.input.slice(t,n.position),i=[],r.length<1&&ve(n,"directive name must not be less than one character in length");o!==0;){for(;Pc(o);)o=n.input.charCodeAt(++n.position);if(o===35){do o=n.input.charCodeAt(++n.position);while(o!==0&&!Ms(o));break}if(Ms(o))break;for(t=n.position;o!==0&&!Gn(o);)o=n.input.charCodeAt(++n.position);i.push(n.input.slice(t,n.position))}o!==0&&k2(n),Ra.call(lN,r)?lN[r](n,r,i):n0(n,'unknown document directive "'+r+'"')}if(hr(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,hr(n,!0,-1)):s&&ve(n,"directives end mark is expected"),Tu(n,n.lineIndent-1,r0,!1,!0),hr(n,!0,-1),n.checkLineBreaks&&vee.test(n.input.slice(e,n.position))&&n0(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&o0(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,hr(n,!0,-1));return}if(n.position<n.length-1)ve(n,"end of the stream or a document separator is expected");else return}a(jee,"readDocument");function QN(n,e){n=String(n),e=e||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
|
|
352
352
|
`),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new Ree(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,ve(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;)jee(t);return t.documents}a(QN,"loadDocuments");function $ee(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=QN(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}a($ee,"loadAll$1");function Uee(n,e){var t=QN(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new En("expected a single document in the stream, but found more")}}a(Uee,"load$1");var Bee=$ee,Vee=Uee,YN={loadAll:Bee,load:Vee},XN=Object.prototype.toString,JN=Object.prototype.hasOwnProperty,j2=65279,qee=9,qd=10,Gee=13,Wee=32,Hee=33,zee=34,O2=35,Kee=37,Qee=38,Yee=39,Xee=42,ZN=44,Jee=45,i0=58,Zee=61,ete=62,tte=63,rte=64,ek=91,tk=93,nte=96,rk=123,ite=124,nk=125,nn={};nn[0]="\\0";nn[7]="\\a";nn[8]="\\b";nn[9]="\\t";nn[10]="\\n";nn[11]="\\v";nn[12]="\\f";nn[13]="\\r";nn[27]="\\e";nn[34]='\\"';nn[92]="\\\\";nn[133]="\\N";nn[160]="\\_";nn[8232]="\\L";nn[8233]="\\P";var ste=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ote=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ate(n,e){var t,r,i,s,o,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)o=r[i],c=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=n.compiledTypeMap.fallback[o],l&&JN.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[o]=c;return t}a(ate,"compileStyleMap");function cte(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 En("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+Sr.repeat("0",r-e.length)+e}a(cte,"encodeHex");var lte=1,Gd=2;function ute(n){this.schema=n.schema||N2,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=Sr.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=ate(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==='"'?Gd:lte,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}a(ute,"State");function dN(n,e){for(var t=Sr.repeat(" ",e),r=0,i=-1,s="",o,c=n.length;r<c;)i=n.indexOf(`
|
|
353
353
|
`,r),i===-1?(o=n.slice(r),r=c):(o=n.slice(r,i+1),r=i+1),o.length&&o!==`
|
|
354
354
|
`&&(s+=t),s+=o;return s}a(dN,"indentString");function P2(n,e){return`
|
|
@@ -364,7 +364,7 @@ GFS4: `),console.error(n)},"debug"));qt[Hr]||(yD=global[Hr]||[],_D(qt,yD),qt.clo
|
|
|
364
364
|
`+n.slice(i,s),i=s+1),o=c;return l+=`
|
|
365
365
|
`,n.length-i>e&&o>i?l+=n.slice(i,o)+`
|
|
366
366
|
`+n.slice(o+1):l+=n.slice(i),l.slice(1)}a(yN,"foldLine");function yte(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=Bd(n,i),r=nn[t],!r&&Wd(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||cte(t);return e}a(yte,"escapeString");function bte(n,e,t){var r="",i=n.tag,s,o,c;for(s=0,o=t.length;s<o;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(No(n,e,c,!1,!1)||typeof c>"u"&&No(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}a(bte,"writeFlowSequence");function bN(n,e,t,r){var i="",s=n.tag,o,c,l;for(o=0,c=t.length;o<c;o+=1)l=t[o],n.replacer&&(l=n.replacer.call(t,String(o),l)),(No(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&No(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=P2(n,e)),n.dump&&qd===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}a(bN,"writeBlockSequence");function _te(n,e,t){var r="",i=n.tag,s=Object.keys(t),o,c,l,u,f;for(o=0,c=s.length;o<c;o+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[o],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),No(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),No(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}a(_te,"writeFlowMapping");function Ste(n,e,t,r){var i="",s=n.tag,o=Object.keys(t),c,l,u,f,d,h;if(n.sortKeys===!0)o.sort();else if(typeof n.sortKeys=="function")o.sort(n.sortKeys);else if(n.sortKeys)throw new En("sortKeys must be a boolean or a function");for(c=0,l=o.length;c<l;c+=1)h="",(!r||i!=="")&&(h+=P2(n,e)),u=o[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),No(n,e+1,u,!0,!0,!0)&&(d=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,d&&(n.dump&&qd===n.dump.charCodeAt(0)?h+="?":h+="? "),h+=n.dump,d&&(h+=P2(n,e)),No(n,e+1,f,!0,d)&&(n.dump&&qd===n.dump.charCodeAt(0)?h+=":":h+=": ",h+=n.dump,i+=h));n.tag=s,n.dump=i||"{}"}a(Ste,"writeBlockMapping");function _N(n,e,t){var r,i,s,o,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,o=i.length;s<o;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,XN.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(JN.call(c.represent,l))r=c.represent[l](e,l);else throw new En("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}a(_N,"detectType");function No(n,e,t,r,i,s,o){n.tag=null,n.dump=t,_N(n,t,!1)||_N(n,t,!0);var c=XN.call(n.dump),l=r,u;r&&(r=n.flowLevel<0||n.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",d,h;if(f&&(d=n.duplicates.indexOf(t),h=d!==-1),(n.tag!==null&&n.tag!=="?"||h||n.indent!==2&&e>0)&&(i=!1),h&&n.usedDuplicates[d])n.dump="*ref_"+d;else{if(f&&h&&!n.usedDuplicates[d]&&(n.usedDuplicates[d]=!0),c==="[object Object]")r&&Object.keys(n.dump).length!==0?(Ste(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(_te(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!o&&e>0?bN(n,e-1,n.dump,i):bN(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(bte(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&mte(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new En("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}a(No,"writeNode");function wte(n,e){var t=[],r=[],i,s;for(D2(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}a(wte,"getDuplicateReferences");function D2(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)D2(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)D2(n[r[i]],e,t)}a(D2,"inspectNode");function vte(n,e){e=e||{};var t=new ute(e);t.noRefs||wte(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),No(t,0,r,!0,!0)?t.dump+`
|
|
367
|
-
`:""}a(vte,"dump$1");var Ete=vte,Tte={dump:Ete};function $2(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.")}}a($2,"renamed");var Ate=zr,Ite=vN,xte=IN,Rte=PN,Cte=FN,Ote=N2,Pte=YN.load,Fte=YN.loadAll,Dte=Tte.dump,Lte=En,Nte={binary:MN,float:ON,map:AN,null:xN,pairs:$N,set:UN,timestamp:NN,bool:RN,int:CN,merge:kN,omap:jN,seq:TN,str:EN},kte=$2("safeLoad","load"),Mte=$2("safeLoadAll","loadAll"),jte=$2("safeDump","dump"),Dt={Type:Ate,Schema:Ite,FAILSAFE_SCHEMA:xte,JSON_SCHEMA:Rte,CORE_SCHEMA:Cte,DEFAULT_SCHEMA:Ote,load:Pte,loadAll:Fte,dump:Dte,YAMLException:Lte,types:Nte,safeLoad:kte,safeLoadAll:Mte,safeDump:jte};var aA=se(Lo()),Nc=se(require("path"));var Ck=se(Sk(),1);var zd=a(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Hte={"[: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]},Kd=a(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),zte=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),wk=a(n=>n.join(""),"rangesToString"),vk=a((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){u=!0,s++;continue}if(y==="]"&&o&&!l){f=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[b,[S,v,I]]of Object.entries(Hte))if(n.startsWith(b,s)){if(d)return["$.",!1,n.length-t,!0];s+=b.length,I?i.push(S):r.push(S),c=c||v;continue e}}if(l=!1,d){y>d?r.push(Kd(d)+"-"+Kd(y)):y===d&&r.push(Kd(y)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Kd(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=y,s+=2;continue}r.push(Kd(y)),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 y=r[0].length===2?r[0].slice(-1):r[0];return[zte(y),!1,f-t,!1]}let h="["+(u?"^":"")+wk(r)+"]",p="["+(u?"":"^")+wk(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var es=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Gn,Kte=new Set(["!","?","+","*","@"]),V2=a(n=>Kte.has(n),"isExtglobType"),Ek=a(n=>V2(n.type),"isExtglobAST"),Qte=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Yte=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Xte=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Tk=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Jte="(?!(?:^|/)\\.\\.?(?:$|/))",a0="(?!\\.)",Zte=new Set(["[","."]),ere=new Set(["..","."]),tre=new Set("().*{}+?[]^$\\!"),rre=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),q2="[^/]",Ak=q2+"*?",Ik=q2+"+?",Fc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#b;#i;#u=!1;#s;#l;#o=!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.#b=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.#b+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 Gn&&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.#b===0)return!0;let e=this.#c;for(let t=0;t<this.#b;t++){let r=e.#t[t];if(!(r instanceof Gn&&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.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Gn(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let y=r,b="";for(;y<e.length;){let S=e.charAt(y++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){y===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(y===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=y,f=!1,b+=S;continue}if(!i.noext&&V2(S)&&e.charAt(y)==="("&&s<=o){t.push(b),b="";let I=new Gn(S,t);y=Gn.#g(e,I,y,i,s+1),t.push(I);continue}b+=S}return t.push(b),y}let d=r+1,h=new Gn(null,t),p=[],g="";for(;d<e.length;){let y=e.charAt(d++);if(c||y==="\\"){c=!c,g+=y;continue}if(l){d===u+1?(y==="^"||y==="!")&&(f=!0):y==="]"&&!(d===u+2&&f)&&(l=!1),g+=y;continue}else if(y==="["){l=!0,u=d,f=!1,g+=y;continue}if(V2(y)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(y))){let S=t&&t.#y(y)?0:1;h.push(g),g="";let v=new Gn(y,h);h.push(v),d=Gn.#g(e,v,d,i,s+S);continue}if(y==="|"){h.push(g),g="",p.push(h),h=new Gn(null,t);continue}if(y===")")return g===""&&t.#t.length===0&&(t.#o=!0),h.push(g),g="",t.push(...p,h),d;g+=y}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,Yte)}#m(e,t=Qte){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=Xte){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Gn(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!!Tk.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)}#v(e){let t=Tk.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.#o=!1}#S(){if(Ek(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.#d(i)?(t=!1,this.#f(i,r)):this.#_(i)&&(t=!1,this.#v(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 Gn(null,void 0,t);return Gn.#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()),!Ek(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[g,y,b,S]=typeof p=="string"?Gn.#I(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||b,this.#r=this.#r||S,g}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ere.has(this.#t[0]))){let g=Zte,y=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=y?Jte:b?a0:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,es(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(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,es(this.toString()),!1,!1]}let o=!r||e||t||!a0?"":this.#w(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?a0:"")+Ik;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?a0:"")+Ak+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,es(s),this.#n=!!this.#n,this.#r]}#w(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#I(e,t,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(tre.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=vk(e,l);if(h){s+=f,o=o||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?Ik:Ak,t=!0;continue}else c=!1;if(u==="?"){s+=q2,t=!0;continue}s+=rre(u)}return[s,es(e),!!t,o]}};Gn=Fc;var Au=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Tn=a((n,e,t={})=>(zd(e),!t.nocomment&&e.charAt(0)==="#"?!1:new ii(e,t).match(n)),"minimatch"),nre=/^\*+([^+@!?\*\[\(]*)$/,ire=a(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),sre=a(n=>e=>e.endsWith(n),"starDotExtTestDot"),ore=a(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),are=a(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),cre=/^\*+\.\*+$/,lre=a(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),ure=a(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),fre=/^\.\*+$/,dre=a(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),hre=/^\*+$/,pre=a(n=>n.length!==0&&!n.startsWith("."),"starTest"),mre=a(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),gre=/^\?+([^+@!?\*\[\(]*)?$/,yre=a(([n,e=""])=>{let t=Ok([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),bre=a(([n,e=""])=>{let t=Pk([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),_re=a(([n,e=""])=>{let t=Pk([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),Sre=a(([n,e=""])=>{let t=Ok([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),Ok=a(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Pk=a(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),Fk=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xk={win32:{sep:"\\"},posix:{sep:"/"}},wre=Fk==="win32"?xk.win32.sep:xk.posix.sep;Tn.sep=wre;var er=Symbol("globstar **");Tn.GLOBSTAR=er;var vre="[^/]",Ere=vre+"*?",Tre="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Are="(?:(?!(?:\\/|^)\\.).)*?",Ire=a((n,e={})=>t=>Tn(t,n,e),"filter");Tn.filter=Ire;var pi=a((n,e={})=>Object.assign({},n,e),"ext"),xre=a(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Tn;let e=Tn;return Object.assign(a((r,i,s={})=>e(r,i,pi(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,pi(n,s))}static defaults(i){return e.defaults(pi(n,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,pi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,pi(n,s))}},unescape:a((r,i={})=>e.unescape(r,pi(n,i)),"unescape"),escape:a((r,i={})=>e.escape(r,pi(n,i)),"escape"),filter:a((r,i={})=>e.filter(r,pi(n,i)),"filter"),defaults:a(r=>e.defaults(pi(n,r)),"defaults"),makeRe:a((r,i={})=>e.makeRe(r,pi(n,i)),"makeRe"),braceExpand:a((r,i={})=>e.braceExpand(r,pi(n,i)),"braceExpand"),match:a((r,i,s={})=>e.match(r,i,pi(n,s)),"match"),sep:e.sep,GLOBSTAR:er})},"defaults");Tn.defaults=xre;var Dk=a((n,e={})=>(zd(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,Ck.default)(n)),"braceExpand");Tn.braceExpand=Dk;var Rre=a((n,e={})=>new ii(n,e).makeRe(),"makeRe");Tn.makeRe=Rre;var Cre=a((n,e,t={})=>{let r=new ii(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");Tn.match=Cre;var Rk=/[?*]|[+@!]\(.*?\)|\[|\]/,Ore=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),ii=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){zd(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Fk,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,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Rk.test(s[2]))&&!Rk.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 o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[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 o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-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 o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){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,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.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",o.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",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}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]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,g]=[e[d],t[h]];p.toLowerCase()===g.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(er)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let o=t.indexOf(er,s),c=t.lastIndexOf(er),[l,u,f]=r?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let v=e.slice(i,i+l.length);if(!this.#r(v,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,r,v,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(v--,!this.#r(e,f,r,v,0)))return!1;d=f.length+1}}if(!u.length){let v=!!d;for(let I=i;I<e.length-d;I++){let A=String(e[I]);if(v=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return r||v}let h=[[[],0]],p=h[0],g=0,y=[0];for(let v of u)v===er?(y.push(g),p=[[],0],h.push(p)):(p[0].push(v),g++);let b=h.length-1,S=e.length-d;for(let v of h)v[1]=S-(y[b--]+v[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,o,c){let l=t[i];if(!l){for(let d=r;d<e.length;d++){c=!0;let h=e[d];if(h==="."||h===".."||!this.options.dot&&h.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)&&o<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,o+1,c);if(p!==!1)return p}let h=e[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===er)return!1;let h;if(typeof f=="string"?(h=d===f,this.debug("string match",f,d,h)):(h=f.test(d),this.debug("pattern match",f,d,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Dk(this.pattern,this.options)}parse(e){zd(e);let t=this.options;if(e==="**")return er;if(e==="")return"";let r,i=null;(r=e.match(hre))?i=t.dot?mre:pre:(r=e.match(nre))?i=(t.nocase?t.dot?are:ore:t.dot?sre:ire)(r[1]):(r=e.match(gre))?i=(t.nocase?t.dot?bre:yre:t.dot?_re:Sre)(r):(r=e.match(cre))?i=t.dot?ure:lre:(r=e.match(fre))&&(i=dre);let s=Fc.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?Ere:t.dot?Tre:Are,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?Ore(f):f===er?er:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==er||p===er||(p===void 0?h!==void 0&&h!==er?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==er&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=er))}),u.filter(f=>f!==er).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+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 o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Tn.defaults(e).Minimatch}};Tn.AST=Fc;Tn.Minimatch=ii;Tn.escape=Au;Tn.unescape=es;var nM=require("node:url");var Iu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nk=new Set,G2=typeof process=="object"&&process?process:{},kk=a((n,e,t,r)=>{typeof G2.emitWarning=="function"?G2.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),c0=globalThis.AbortController,Lk=globalThis.AbortSignal;if(typeof c0>"u"){Lk=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},c0=class{static{a(this,"AbortController")}constructor(){e()}signal=new Lk;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=G2.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{n&&(n=!1,kk("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 Pre=a(n=>!Nk.has(n),"shouldWarn");var Ca=a(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),Mk=a(n=>Ca(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?xu:null:null,"getUintArray"),xu=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},W2=class n{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Mk(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]}},Qd=class n{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#b;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;#E;#T;#_;#v;#S;#w;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:a(t=>e.#U(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#C(t),"rindexes"),isStale:a(t=>e.#A(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.#b}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:y,fetchMethod:b,memoMethod:S,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:T,ignoreFetchAbort:R}=e;if(t!==0&&!Ca(t))throw new TypeError("max option must be a nonnegative integer");let B=t?Mk(t):Array;if(!B)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=g||this.#n,this.sizeCalculation=y,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#b=S,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=b,this.#S=!!b,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#p=new B(t),this.#g=new B(t),this.#d=0,this.#m=0,this.#y=W2.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.#v=!!this.#r,this.#w=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#n!==0&&!Ca(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ca(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Ca(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ca(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}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 L="LRU_CACHE_UNBOUNDED";Pre(L)&&(Nk.add(L),kk("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#I(){let e=new xu(this.#e),t=new xu(this.#e);this.#_=e,this.#T=t,this.#F=(s,o,c=Iu.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#P(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#x=s=>{t[s]=e[s]!==0?Iu.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];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=a(()=>{let s=Iu.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(r||i())-o>c}}#x=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#F=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#O(){let e=new xu(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#N=(t,r,i,s)=>{if(this.#h(r))return 0;if(!Ca(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Ca(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.#L=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=a(e=>{},"#removeItemSize");#L=a((e,t,r)=>{},"#addItemSize");#N=a((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#C({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#p[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#C())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#C()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#C())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#R()){let i=this.#o[r],s=this.#h(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.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#C()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#C({allowStale:!0}))this.#A(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#o[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#T){let o=this.#_[t],c=this.#T[t];if(o&&c){let l=o-(Iu.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.#R({allowStale:!0})){let r=this.#l[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#T){o.ttl=this.#_[t];let c=Iu.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Iu.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:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#N(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#L(d,f,l),l&&(l.set="add"),u=!1;else{this.#U(d);let h=this.#o[d];if(t!==h){if(this.#S&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!o&&(this.#v&&this.#r?.(p,e,"set"),this.#w&&this.#f?.push([p,e,"set"]))}else o||(this.#v&&this.#r?.(h,e,"set"),this.#w&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#L(d,f,l),this.#o[d]=t,l){l.set="replace";let p=h&&this.#h(h)?h.__staleWhileFetching:h;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#_&&this.#I(),this.#_&&(u||this.#F(d,i,s),l&&this.#a(l,d)),!o&&this.#w&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#w&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,r=this.#l[t],i=this.#o[t];return this.#S&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#w)&&(this.#v&&this.#r?.(i,r,"evict"),this.#w&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=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 o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return r&&this.#x(s),i&&(i.has="hit",this.#a(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.#A(i))return;let s=this.#o[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new c0,{signal:c}=r;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:i},u=a((y,b=!1)=>{let{aborted:S}=o.signal,v=r.ignoreFetchAbort&&y!==void 0;if(r.status&&(S&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!v&&!b)return d(o.signal.reason);let I=p;return this.#o[t]===p&&(y===void 0?I.__staleWhileFetching?this.#o[t]=I.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),f=a(y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),d(y)),"eb"),d=a(y=>{let{aborted:b}=o.signal,S=b&&r.allowStaleOnFetchAbort,v=S||r.allowStaleOnFetchRejection,I=v||r.noDeleteOnFetchRejection,A=p;if(this.#o[t]===p&&(!I||A.__staleWhileFetching===void 0?this.#P(e,"fetch"):S||(this.#o[t]=A.__staleWhileFetching)),v)return r.status&&A.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw y},"fetchFail"),h=a((y,b)=>{let S=this.#c?.(e,s,l);S&&S instanceof Promise&&S.then(v=>y(v===void 0?void 0:v),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(void 0),r.allowStaleOnFetchAbort&&(y=a(v=>u(v,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),g=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,g,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=g,g}#h(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof c0}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:y,forceRefresh:b=!1,status:S,signal:v}=t;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let I={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:v},A=this.#s.get(e);if(A===void 0){S&&(S.fetch="miss");let T=this.#j(e,A,I,y);return T.__returned=T}else{let T=this.#o[A];if(this.#h(T)){let M=r&&T.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",M&&(S.returnedStale=!0)),M?T.__staleWhileFetching:T.__returned=T}let R=this.#A(A);if(!b&&!R)return S&&(S.fetch="hit"),this.#U(A),i&&this.#x(A),S&&this.#a(S,A),T;let B=this.#j(e,A,I,y),P=B.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?B.__staleWhileFetching:B.__returned=B}}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.#b;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=r(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#h(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#U(c),i&&this.#x(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#U(e){e!==this.#m&&(e===this.#d?this.#d=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#P(e,"delete")}#P(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.#B(t);else{this.#D(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#w)&&(this.#v&&this.#r?.(s,e,t),this.#w&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let o=this.#g[i];this.#p[o]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#w&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#C({allowStale:!0})){let r=this.#o[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#v&&this.#r?.(r,i,e),this.#w&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#o.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.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#w&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Ou=require("node:path"),zk=require("node:url"),Us=require("fs"),Bre=se(require("node:fs"),1),Fa=require("node:fs/promises");var m0=require("node:events"),J2=se(require("node:stream"),1),Vk=require("node:string_decoder");var jk=typeof process=="object"&&process?process:{stdout:null,stderr:null},Fre=a(n=>!!n&&typeof n=="object"&&(n instanceof Pa||n instanceof J2.default||Dre(n)||Lre(n)),"isStream"),Dre=a(n=>!!n&&typeof n=="object"&&n instanceof m0.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==J2.default.Writable.prototype.pipe,"isReadable"),Lre=a(n=>!!n&&typeof n=="object"&&n instanceof m0.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),ko=Symbol("EOF"),Mo=Symbol("maybeEmitEnd"),Oa=Symbol("emittedEnd"),l0=Symbol("emittingEnd"),Yd=Symbol("emittedError"),u0=Symbol("closed"),$k=Symbol("read"),f0=Symbol("flush"),Uk=Symbol("flushChunk"),ts=Symbol("encoding"),Ru=Symbol("decoder"),Dr=Symbol("flowing"),Xd=Symbol("paused"),Cu=Symbol("resume"),Lr=Symbol("buffer"),An=Symbol("pipes"),Nr=Symbol("bufferLength"),H2=Symbol("bufferPush"),d0=Symbol("bufferShift"),sn=Symbol("objectMode"),tr=Symbol("destroyed"),z2=Symbol("error"),K2=Symbol("emitData"),Bk=Symbol("emitEnd"),Q2=Symbol("emitEnd2"),js=Symbol("async"),Y2=Symbol("abort"),h0=Symbol("aborted"),Jd=Symbol("signal"),Dc=Symbol("dataListeners"),si=Symbol("discarded"),Zd=a(n=>Promise.resolve().then(n),"defer"),Nre=a(n=>n(),"nodefer"),kre=a(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),Mre=a(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),jre=a(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),p0=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Cu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},X2=class extends p0{static{a(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)}},$re=a(n=>!!n.objectMode,"isObjectModeOptions"),Ure=a(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Pa=class extends m0.EventEmitter{static{a(this,"Minipass")}[Dr]=!1;[Xd]=!1;[An]=[];[Lr]=[];[sn];[ts];[js];[Ru];[ko]=!1;[Oa]=!1;[l0]=!1;[u0]=!1;[Yd]=null;[Nr]=0;[tr]=!1;[Jd];[h0]=!1;[Dc]=0;[si]=!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");$re(t)?(this[sn]=!0,this[ts]=null):Ure(t)?(this[ts]=t.encoding,this[sn]=!1):(this[sn]=!1,this[ts]=null),this[js]=!!t.async,this[Ru]=this[ts]?new Vk.StringDecoder(this[ts]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Lr],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[An],"get")});let{signal:r}=t;r&&(this[Jd]=r,r.aborted?this[Y2]():r.addEventListener("abort",()=>this[Y2]()))}get bufferLength(){return this[Nr]}get encoding(){return this[ts]}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[sn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[js]}set async(e){this[js]=this[js]||!!e}[Y2](){this[h0]=!0,this.emit("abort",this[Jd]?.reason),this.destroy(this[Jd]?.reason)}get aborted(){return this[h0]}set aborted(e){}write(e,t,r){if(this[h0])return!1;if(this[ko])throw new Error("write after end");if(this[tr])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[js]?Zd:Nre;if(!this[sn]&&!Buffer.isBuffer(e)){if(jre(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Mre(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[sn]?(this[Dr]&&this[Nr]!==0&&this[f0](!0),this[Dr]?this.emit("data",e):this[H2](e),this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr]):e.length?(typeof e=="string"&&!(t===this[ts]&&!this[Ru]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ts]&&(e=this[Ru].write(e)),this[Dr]&&this[Nr]!==0&&this[f0](!0),this[Dr]?this.emit("data",e):this[H2](e),this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr]):(this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr])}read(e){if(this[tr])return null;if(this[si]=!1,this[Nr]===0||e===0||e&&e>this[Nr])return this[Mo](),null;this[sn]&&(e=null),this[Lr].length>1&&!this[sn]&&(this[Lr]=[this[ts]?this[Lr].join(""):Buffer.concat(this[Lr],this[Nr])]);let t=this[$k](e||null,this[Lr][0]);return this[Mo](),t}[$k](e,t){if(this[sn])this[d0]();else{let r=t;e===r.length||e===null?this[d0]():typeof r=="string"?(this[Lr][0]=r.slice(e),t=r.slice(0,e),this[Nr]-=e):(this[Lr][0]=r.subarray(e),t=r.subarray(0,e),this[Nr]-=e)}return this.emit("data",t),!this[Lr].length&&!this[ko]&&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[ko]=!0,this.writable=!1,(this[Dr]||!this[Xd])&&this[Mo](),this}[Cu](){this[tr]||(!this[Dc]&&!this[An].length&&(this[si]=!0),this[Xd]=!1,this[Dr]=!0,this.emit("resume"),this[Lr].length?this[f0]():this[ko]?this[Mo]():this.emit("drain"))}resume(){return this[Cu]()}pause(){this[Dr]=!1,this[Xd]=!0,this[si]=!1}get destroyed(){return this[tr]}get flowing(){return this[Dr]}get paused(){return this[Xd]}[H2](e){this[sn]?this[Nr]+=1:this[Nr]+=e.length,this[Lr].push(e)}[d0](){return this[sn]?this[Nr]-=1:this[Nr]-=this[Lr][0].length,this[Lr].shift()}[f0](e=!1){do;while(this[Uk](this[d0]())&&this[Lr].length);!e&&!this[Lr].length&&!this[ko]&&this.emit("drain")}[Uk](e){return this.emit("data",e),this[Dr]}pipe(e,t){if(this[tr])return e;this[si]=!1;let r=this[Oa];return t=t||{},e===jk.stdout||e===jk.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[An].push(t.proxyErrors?new X2(this,e,t):new p0(this,e,t)),this[js]?Zd(()=>this[Cu]()):this[Cu]()),e}unpipe(e){let t=this[An].find(r=>r.dest===e);t&&(this[An].length===1?(this[Dr]&&this[Dc]===0&&(this[Dr]=!1),this[An]=[]):this[An].splice(this[An].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[si]=!1,this[Dc]++,!this[An].length&&!this[Dr]&&this[Cu]();else if(e==="readable"&&this[Nr]!==0)super.emit("readable");else if(kre(e)&&this[Oa])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Yd]){let i=t;this[js]?Zd(()=>i.call(this,this[Yd])):i.call(this,this[Yd])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Dc]=this.listeners("data").length,this[Dc]===0&&!this[si]&&!this[An].length&&(this[Dr]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Dc]=0,!this[si]&&!this[An].length&&(this[Dr]=!1)),t}get emittedEnd(){return this[Oa]}[Mo](){!this[l0]&&!this[Oa]&&!this[tr]&&this[Lr].length===0&&this[ko]&&(this[l0]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[u0]&&this.emit("close"),this[l0]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==tr&&this[tr])return!1;if(e==="data")return!this[sn]&&!r?!1:this[js]?(Zd(()=>this[K2](r)),!0):this[K2](r);if(e==="end")return this[Bk]();if(e==="close"){if(this[u0]=!0,!this[Oa]&&!this[tr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Yd]=r,super.emit(z2,r);let s=!this[Jd]||this.listeners("error").length?super.emit("error",r):!1;return this[Mo](),s}else if(e==="resume"){let s=super.emit("resume");return this[Mo](),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[Mo](),i}[K2](e){for(let r of this[An])r.dest.write(e)===!1&&this.pause();let t=this[si]?!1:super.emit("data",e);return this[Mo](),t}[Bk](){return this[Oa]?!1:(this[Oa]=!0,this.readable=!1,this[js]?(Zd(()=>this[Q2]()),!0):this[Q2]())}[Q2](){if(this[Ru]){let t=this[Ru].end();if(t){for(let r of this[An])r.dest.write(t);this[si]||super.emit("data",t)}}for(let t of this[An])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[sn]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[sn]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[sn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ts]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(tr,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[si]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ko])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(tr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(tr,f),this.pause(),s({value:d,done:!!this[ko]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(tr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{o=h,s=d,this.once(tr,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[si]=!1;let e=!1,t=a(()=>(this.pause(),this.off(z2,t),this.off(tr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(z2,t),this.once(tr,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[tr])return e?this.emit("error",e):this.emit(tr),this;this[tr]=!0,this[si]=!0,this[Lr].length=0,this[Nr]=0;let t=this;return typeof t.close=="function"&&!this[u0]&&t.close(),e?this.emit("error",e):this.emit(tr),this}static get isStream(){return Fre}};var Vre=Us.realpathSync.native,th={lstatSync:Us.lstatSync,readdir:Us.readdir,readdirSync:Us.readdirSync,readlinkSync:Us.readlinkSync,realpathSync:Vre,promises:{lstat:Fa.lstat,readdir:Fa.readdir,readlink:Fa.readlink,realpath:Fa.realpath}},Kk=a(n=>!n||n===th||n===Bre?th:{...th,...n,promises:{...th.promises,...n.promises||{}}},"fsFromOption"),Qk=/^\\\\\?\\([a-z]:)\\?$/i,qre=a(n=>n.replace(/\//g,"\\").replace(Qk,"$1\\"),"uncToDrive"),Gre=/[\\\/]/,gi=0,Yk=1,Xk=2,$s=4,Jk=6,Zk=8,Lc=10,eM=12,mi=15,eh=~mi,Z2=16,qk=32,rh=64,rs=128,g0=256,b0=512,Gk=rh|rs|b0,Wre=1023,eA=a(n=>n.isFile()?Zk:n.isDirectory()?$s:n.isSymbolicLink()?Lc:n.isCharacterDevice()?Xk:n.isBlockDevice()?Jk:n.isSocket()?eM:n.isFIFO()?Yk:gi,"entToType"),Wk=new Map,nh=a(n=>{let e=Wk.get(n);if(e)return e;let t=n.normalize("NFKD");return Wk.set(n,t),t},"normalize"),Hk=new Map,y0=a(n=>{let e=Hk.get(n);if(e)return e;let t=nh(n.toLowerCase());return Hk.set(n,t),t},"normalizeNocase"),_0=class extends Qd{static{a(this,"ResolveCache")}constructor(){super({max:256})}},tA=class extends Qd{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},tM=Symbol("PathScurry setAsCwd"),on=class{static{a(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}#b;get gid(){return this.#b}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#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}#_;#v;#S;#w;#I;#x;#a;#F;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=gi,r,i,s,o,c){this.name=e,this.#_=s?y0(e):nh(e),this.#a=t&Wre,this.nocase=s,this.roots=i,this.root=r||this,this.#F=o,this.#S=c.fullpath,this.#I=c.relative,this.#x=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Kk(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=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.#a&=~Z2,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?y0(e):nh(e);for(let l of r)if(l.#_===i)return l;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,c=this.newChild(e,gi,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=rs),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=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.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=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.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#w=`//?/${i}`:this.#w=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#w=r}isUnknown(){return(this.#a&mi)===gi}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.#a&mi)===Zk}isDirectory(){return(this.#a&mi)===$s}isCharacterDevice(){return(this.#a&mi)===Xk}isBlockDevice(){return(this.#a&mi)===Jk}isFIFO(){return(this.#a&mi)===Yk}isSocket(){return(this.#a&mi)===eM}isSymbolicLink(){return(this.#a&Lc)===Lc}lstatCached(){return this.#a&qk?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&mi;return!(e!==gi&&e!==Lc||this.#a&g0||this.#a&rs)}calledReaddir(){return!!(this.#a&Z2)}isENOENT(){return!!(this.#a&rs)}isNamed(e){return this.nocase?this.#_===y0(e):this.#_===nh(e)}async readlink(){let e=this.#A;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.#A=r}catch(t){this.#h(t.code);return}}readlinkSync(){let e=this.#A;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.#A=r}catch(t){this.#h(t.code);return}}#L(e){this.#a|=Z2;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#N()}}#N(){this.#a&rs||(this.#a=(this.#a|rs)&eh,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#N()}#C(){this.#a|=b0,this.#k()}#k(){if(this.#a&rh)return;let e=this.#a;(e&mi)===$s&&(e&=eh),this.#a=e|rh,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#N():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#N()}#h(e=""){let t=this.#a;t|=g0,e==="ENOENT"&&(t|=rs),(e==="EINVAL"||e==="UNKNOWN")&&(t&=eh),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#P(e,t)||this.#U(e,t)}#U(e,t){let r=eA(e),i=this.newChild(e.name,r,{parent:this}),s=i.#a&mi;return s!==$s&&s!==Lc&&s!==gi&&(i.#a|=rh),t.unshift(i),t.provisional++,i}#P(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?y0(e.name):nh(e.name))===i.#_)return this.#B(e,i,r,t)}}#B(e,t,r,i){let s=t.name;return t.#a=t.#a&eh|eA(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.#a&rs)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&rs)===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:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:g,mtimeMs:y,nlink:b,rdev:S,size:v,uid:I}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#E=l,this.#d=u,this.#n=f,this.#b=d,this.#s=h,this.#r=p,this.#f=g,this.#g=y,this.#t=b,this.#i=S,this.#l=v,this.#c=I;let A=eA(e);this.#a=this.#a&eh|A|qk,A!==gi&&A!==$s&&A!==Lc&&(this.#a|=rh)}#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,o)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of o)this.#$(c,r);this.#L(r)}this.#H(r.slice(0,r.provisional))})}#V;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.#V)await this.#V;else{let r=a(()=>{},"resolve");this.#V=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=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.#L(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&Gk)return!1;let e=mi&this.#a;return e===gi||e===$s||e===Lc}shouldWalk(e,t){return(this.#a&$s)===$s&&!(this.#a&Gk)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((b0|g0|rs)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#O)return this.#O;if(!((b0|g0|rs)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}[tM](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.#I=r.join(this.sep),i.#x=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#I=void 0,i.#x=void 0,i=i.parent}},S0=class n extends on{static{a(this,"PathWin32")}sep="\\";splitSep=Gre;constructor(e,t=gi,r,i,s,o,c){super(e,t,r,i,s,o,c)}newChild(e,t=gi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Ou.win32.parse(e).root}getRoot(e){if(e=qre(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 Pu(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Qk,"$1\\"),e===t}},w0=class n extends on{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=gi,r,i,s,o,c){super(e,t,r,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=gi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},v0=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=th}={}){this.#t=Kk(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,zk.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new _0,this.#n=new _0,this.#r=new tA(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,d=t.sep,h=this.rootPath,p=!1;for(let g of l){let y=f--;u=u.child(g,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).fill("..").join("/"),fullpath:h+=(p?"":d)+g}),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 o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))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 o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))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 on||(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 on||(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 on||(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 on||(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 on||(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 on||(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 on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=a((d,h)=>{l.add(d),d.readdirCB((p,g)=>{if(p)return h(p);let y=g.length;if(!y)return h();let b=a(()=>{--y===0&&h()},"next");for(let S of g)(!s||s(S))&&c.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(l,o)?u(v,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,h)=>{u(f,p=>{if(p)return h(p);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=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 d of f){(!s||s(d))&&c.push(r?d:d.fullpath());let h=d;if(d.isSymbolicLink()){if(!(i&&(h=d.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,o)&&l.add(h)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(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 on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=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 d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Pa({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let g=a((b,S,v=!1)=>{if(b)return c.emit("error",b);if(i&&!v){let I=[];for(let A of S)A.isSymbolicLink()&&I.push(A.realpath().then(T=>T?.isUnknown()?T.lstat():T));if(I.length){Promise.all(I).then(()=>g(null,S,!0));return}}for(let I of S)I&&(!s||s(I))&&(c.write(r?I:I.fullpath())||(h=!0));f--;for(let I of S){let A=I.realpathCached()||I;A.shouldWalk(l,o)&&u.push(A)}h&&!c.flowing?c.once("drain",d):y||d()},"onReaddir"),y=!0;p.readdirCB(g,!0),y=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Pa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let g=p.readdirSync();for(let y of g)(!s||s(y))&&(c.write(r?y:y.fullpath())||(h=!0));f--;for(let y of g){let b=y;if(y.isSymbolicLink()){if(!(i&&(b=y.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}h&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[tM](t)}},Pu=class extends v0{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Ou.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Ou.win32.parse(e).root.toUpperCase()}newRoot(e){return new S0(this.rootPath,$s,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Fu=class extends v0{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Ou.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new w0(this.rootPath,$s,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ih=class extends Fu{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},CSe=process.platform==="win32"?S0:w0,rM=process.platform==="win32"?Pu:process.platform==="darwin"?ih:Fu;var Hre=a(n=>n.length>=1,"isPatternList"),zre=a(n=>n.length>=1,"isGlobList"),Du=class n{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#b;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!Hre(e))throw new TypeError("empty pattern list");if(!zre(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,o,c,l,...u]=this.#e,[f,d,h,p,...g]=this.#n;u[0]===""&&(u.shift(),g.shift());let y=[s,o,c,l,""].join("/"),b=[f,d,h,p,""].join("/");this.#e=[y,...u],this.#n=[b,...g],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],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]===er}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(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 Kre=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Lu=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:o=Kre}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new ii(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 o=new Du(i,s,0,this.platform),c=new ii(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.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 o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.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 rA=class n{static{a(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()]))}},nA=class{static{a(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)])}},iA=class{static{a(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())}},sh=class n{static{a(this,"Processor")}hasWalkedCache;matches=new nA;subwalks=new iA;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new rA}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 o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;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 d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===er){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),h=u?.rest();if(!u||(d===""||d===".")&&!h)this.matches.add(i,c,d===""||d===".");else if(d===".."){let p=i.parent||i;h?this.hasWalkedCache.hasWalked(p,h)||this.subwalks.add(p,h):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 o of r){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===er?i.testGlobstar(s,o,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 o=e.parent||e;this.subwalks.add(o,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 Qre=a((n,e)=>typeof n=="string"?new Lu([n],e):Array.isArray(n)?new Lu(n,e):n,"makeIgnore"),E0=class{static{a(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=Qre(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 o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.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 o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.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(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+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 sh(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,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));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,o):c.readdirCB((u,f)=>this.walkCB3(c,f,r,o),!0)}o()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new sh(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,o=a(()=>{--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,o)}o()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--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(),o);o()}},oh=class extends E0{static{a(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}},ah=class extends E0{static{a(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Pa({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 Yre=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ns=class{static{a(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,nM.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||Yre,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"?Pu:t.platform==="darwin"?ih:t.platform?Fu:rM;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 ii(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Du(l,f,0,this.platform)})}async walk(){return[...await new oh(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 oh(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 ah(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 ah(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 sA=a((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new ii(t,e).hasMagic())return!0;return!1},"hasMagic");function T0(n,e={}){return new ns(n,e).streamSync()}a(T0,"globStreamSync");function sM(n,e={}){return new ns(n,e).stream()}a(sM,"globStream");function oM(n,e={}){return new ns(n,e).walkSync()}a(oM,"globSync");async function iM(n,e={}){return new ns(n,e).walk()}a(iM,"glob_");function A0(n,e={}){return new ns(n,e).iterateSync()}a(A0,"globIterateSync");function aM(n,e={}){return new ns(n,e).iterate()}a(aM,"globIterate");var Xre=T0,Jre=Object.assign(sM,{sync:T0}),Zre=A0,ene=Object.assign(aM,{sync:A0}),tne=Object.assign(oM,{stream:T0,iterate:A0}),Da=Object.assign(iM,{glob:iM,globSync:oM,sync:tne,globStream:sM,stream:Jre,globStreamSync:T0,streamSync:Xre,globIterate:aM,iterate:ene,globIterateSync:A0,iterateSync:Zre,Glob:ns,hasMagic:sA,escape:Au,unescape:es});Da.glob=Da;async function cM(n,e,t,r={}){let{dryRun:i=!1,excludeRelPath:s}=r,o=Nc.default.join(n,"**/*.md"),c=await Da(o,{nodir:!0,ignore:[Nc.default.join(n,".obsidian/**"),Nc.default.join(n,".trash/**"),Nc.default.join(n,"**/.obsidian/**"),Nc.default.join(n,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=Nc.default.relative(n,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await aA.default.readFile(u,"utf-8")}catch{continue}let{updated:h,replacements:p}=rne(d,e,t);p>0&&(l.filesModified+=1,l.replacements+=p,l.modifiedFiles.push(f),i||await aA.default.writeFile(u,h,"utf-8"))}return l}a(cM,"rewriteInboundWikilinks");function rne(n,e,t){let r=n.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=r[s],c=nne(o,e,t);i+=c.replacements,r[s]=c.updated}return{updated:r.join(""),replacements:i}}a(rne,"rewriteContent");function nne(n,e,t){let r=n.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=ine(r[s],e,t);i+=o.replacements,r[s]=o.updated}return{updated:r.join(""),replacements:i}}a(nne,"rewriteProseSegment");function ine(n,e,t){let r=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:n.replace(r,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}a(ine,"replaceWikilinks");var sne=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Xt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await pr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return pr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await pr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await pr.default.ensureDir(rr.default.dirname(r)),await pr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await pr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await pr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await pr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await pr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return pr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=pr.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=rr.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=pr.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),o=this.replaceFrontmatter(r,s);await this.modify(e,o)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await pr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await pr.default.ensureDir(rr.default.dirname(i)),await pr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await pr.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(sne.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let u=r.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=rr.default.dirname(this.resolvePath(t)),s;if(rr.default.isAbsolute(r)?s=this.resolvePath(r):s=rr.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),pr.default.existsSync(s)){let u=rr.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=r.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=rr.default.relative(this.rootPath,e),r=rr.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=pr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=rr.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=rr.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){let i=rr.default.basename(t,".md");await cM(this.rootPath,r,i,{excludeRelPath:e})}resolvePath(e){return rr.default.isAbsolute(e)?e:rr.default.join(this.rootPath,e)}createFileObject(e){let t=rr.default.basename(e),r=rr.default.basename(e,rr.default.extname(e)),i=rr.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:rr.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=Dt.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=Dt.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
|
|
367
|
+
`:""}a(vte,"dump$1");var Ete=vte,Tte={dump:Ete};function $2(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.")}}a($2,"renamed");var Ate=zr,Ite=vN,xte=IN,Rte=PN,Cte=FN,Ote=N2,Pte=YN.load,Fte=YN.loadAll,Dte=Tte.dump,Lte=En,Nte={binary:MN,float:ON,map:AN,null:xN,pairs:$N,set:UN,timestamp:NN,bool:RN,int:CN,merge:kN,omap:jN,seq:TN,str:EN},kte=$2("safeLoad","load"),Mte=$2("safeLoadAll","loadAll"),jte=$2("safeDump","dump"),Dt={Type:Ate,Schema:Ite,FAILSAFE_SCHEMA:xte,JSON_SCHEMA:Rte,CORE_SCHEMA:Cte,DEFAULT_SCHEMA:Ote,load:Pte,loadAll:Fte,dump:Dte,YAMLException:Lte,types:Nte,safeLoad:kte,safeLoadAll:Mte,safeDump:jte};var aA=se(Lo()),Nc=se(require("path"));var Ck=se(Sk(),1);var zd=a(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Hte={"[: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]},Kd=a(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),zte=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),wk=a(n=>n.join(""),"rangesToString"),vk=a((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){u=!0,s++;continue}if(y==="]"&&o&&!l){f=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[b,[S,v,I]]of Object.entries(Hte))if(n.startsWith(b,s)){if(d)return["$.",!1,n.length-t,!0];s+=b.length,I?i.push(S):r.push(S),c=c||v;continue e}}if(l=!1,d){y>d?r.push(Kd(d)+"-"+Kd(y)):y===d&&r.push(Kd(y)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Kd(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=y,s+=2;continue}r.push(Kd(y)),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 y=r[0].length===2?r[0].slice(-1):r[0];return[zte(y),!1,f-t,!1]}let h="["+(u?"^":"")+wk(r)+"]",p="["+(u?"":"^")+wk(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var es=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Wn,Kte=new Set(["!","?","+","*","@"]),V2=a(n=>Kte.has(n),"isExtglobType"),Ek=a(n=>V2(n.type),"isExtglobAST"),Qte=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Yte=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Xte=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Tk=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Jte="(?!(?:^|/)\\.\\.?(?:$|/))",a0="(?!\\.)",Zte=new Set(["[","."]),ere=new Set(["..","."]),tre=new Set("().*{}+?[]^$\\!"),rre=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),q2="[^/]",Ak=q2+"*?",Ik=q2+"+?",Fc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#b;#i;#u=!1;#s;#l;#o=!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.#b=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.#b+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 Wn&&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.#b===0)return!0;let e=this.#c;for(let t=0;t<this.#b;t++){let r=e.#t[t];if(!(r instanceof Wn&&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.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Wn(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let y=r,b="";for(;y<e.length;){let S=e.charAt(y++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){y===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(y===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=y,f=!1,b+=S;continue}if(!i.noext&&V2(S)&&e.charAt(y)==="("&&s<=o){t.push(b),b="";let I=new Wn(S,t);y=Wn.#g(e,I,y,i,s+1),t.push(I);continue}b+=S}return t.push(b),y}let d=r+1,h=new Wn(null,t),p=[],g="";for(;d<e.length;){let y=e.charAt(d++);if(c||y==="\\"){c=!c,g+=y;continue}if(l){d===u+1?(y==="^"||y==="!")&&(f=!0):y==="]"&&!(d===u+2&&f)&&(l=!1),g+=y;continue}else if(y==="["){l=!0,u=d,f=!1,g+=y;continue}if(V2(y)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(y))){let S=t&&t.#y(y)?0:1;h.push(g),g="";let v=new Wn(y,h);h.push(v),d=Wn.#g(e,v,d,i,s+S);continue}if(y==="|"){h.push(g),g="",p.push(h),h=new Wn(null,t);continue}if(y===")")return g===""&&t.#t.length===0&&(t.#o=!0),h.push(g),g="",t.push(...p,h),d;g+=y}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,Yte)}#m(e,t=Qte){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=Xte){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Wn(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!!Tk.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)}#v(e){let t=Tk.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.#o=!1}#S(){if(Ek(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.#d(i)?(t=!1,this.#f(i,r)):this.#_(i)&&(t=!1,this.#v(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 Wn(null,void 0,t);return Wn.#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()),!Ek(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[g,y,b,S]=typeof p=="string"?Wn.#I(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||b,this.#r=this.#r||S,g}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ere.has(this.#t[0]))){let g=Zte,y=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=y?Jte:b?a0:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,es(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(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,es(this.toString()),!1,!1]}let o=!r||e||t||!a0?"":this.#w(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?a0:"")+Ik;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?a0:"")+Ak+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,es(s),this.#n=!!this.#n,this.#r]}#w(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#I(e,t,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(tre.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=vk(e,l);if(h){s+=f,o=o||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?Ik:Ak,t=!0;continue}else c=!1;if(u==="?"){s+=q2,t=!0;continue}s+=rre(u)}return[s,es(e),!!t,o]}};Wn=Fc;var Au=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Tn=a((n,e,t={})=>(zd(e),!t.nocomment&&e.charAt(0)==="#"?!1:new ii(e,t).match(n)),"minimatch"),nre=/^\*+([^+@!?\*\[\(]*)$/,ire=a(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),sre=a(n=>e=>e.endsWith(n),"starDotExtTestDot"),ore=a(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),are=a(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),cre=/^\*+\.\*+$/,lre=a(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),ure=a(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),fre=/^\.\*+$/,dre=a(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),hre=/^\*+$/,pre=a(n=>n.length!==0&&!n.startsWith("."),"starTest"),mre=a(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),gre=/^\?+([^+@!?\*\[\(]*)?$/,yre=a(([n,e=""])=>{let t=Ok([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),bre=a(([n,e=""])=>{let t=Pk([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),_re=a(([n,e=""])=>{let t=Pk([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),Sre=a(([n,e=""])=>{let t=Ok([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),Ok=a(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Pk=a(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),Fk=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xk={win32:{sep:"\\"},posix:{sep:"/"}},wre=Fk==="win32"?xk.win32.sep:xk.posix.sep;Tn.sep=wre;var er=Symbol("globstar **");Tn.GLOBSTAR=er;var vre="[^/]",Ere=vre+"*?",Tre="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Are="(?:(?!(?:\\/|^)\\.).)*?",Ire=a((n,e={})=>t=>Tn(t,n,e),"filter");Tn.filter=Ire;var pi=a((n,e={})=>Object.assign({},n,e),"ext"),xre=a(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Tn;let e=Tn;return Object.assign(a((r,i,s={})=>e(r,i,pi(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,pi(n,s))}static defaults(i){return e.defaults(pi(n,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,pi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,pi(n,s))}},unescape:a((r,i={})=>e.unescape(r,pi(n,i)),"unescape"),escape:a((r,i={})=>e.escape(r,pi(n,i)),"escape"),filter:a((r,i={})=>e.filter(r,pi(n,i)),"filter"),defaults:a(r=>e.defaults(pi(n,r)),"defaults"),makeRe:a((r,i={})=>e.makeRe(r,pi(n,i)),"makeRe"),braceExpand:a((r,i={})=>e.braceExpand(r,pi(n,i)),"braceExpand"),match:a((r,i,s={})=>e.match(r,i,pi(n,s)),"match"),sep:e.sep,GLOBSTAR:er})},"defaults");Tn.defaults=xre;var Dk=a((n,e={})=>(zd(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,Ck.default)(n)),"braceExpand");Tn.braceExpand=Dk;var Rre=a((n,e={})=>new ii(n,e).makeRe(),"makeRe");Tn.makeRe=Rre;var Cre=a((n,e,t={})=>{let r=new ii(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");Tn.match=Cre;var Rk=/[?*]|[+@!]\(.*?\)|\[|\]/,Ore=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),ii=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){zd(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Fk,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,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Rk.test(s[2]))&&!Rk.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 o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[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 o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-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 o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){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,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.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",o.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",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}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]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,g]=[e[d],t[h]];p.toLowerCase()===g.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(er)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let o=t.indexOf(er,s),c=t.lastIndexOf(er),[l,u,f]=r?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let v=e.slice(i,i+l.length);if(!this.#r(v,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,r,v,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(v--,!this.#r(e,f,r,v,0)))return!1;d=f.length+1}}if(!u.length){let v=!!d;for(let I=i;I<e.length-d;I++){let A=String(e[I]);if(v=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return r||v}let h=[[[],0]],p=h[0],g=0,y=[0];for(let v of u)v===er?(y.push(g),p=[[],0],h.push(p)):(p[0].push(v),g++);let b=h.length-1,S=e.length-d;for(let v of h)v[1]=S-(y[b--]+v[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,o,c){let l=t[i];if(!l){for(let d=r;d<e.length;d++){c=!0;let h=e[d];if(h==="."||h===".."||!this.options.dot&&h.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)&&o<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,o+1,c);if(p!==!1)return p}let h=e[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===er)return!1;let h;if(typeof f=="string"?(h=d===f,this.debug("string match",f,d,h)):(h=f.test(d),this.debug("pattern match",f,d,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Dk(this.pattern,this.options)}parse(e){zd(e);let t=this.options;if(e==="**")return er;if(e==="")return"";let r,i=null;(r=e.match(hre))?i=t.dot?mre:pre:(r=e.match(nre))?i=(t.nocase?t.dot?are:ore:t.dot?sre:ire)(r[1]):(r=e.match(gre))?i=(t.nocase?t.dot?bre:yre:t.dot?_re:Sre)(r):(r=e.match(cre))?i=t.dot?ure:lre:(r=e.match(fre))&&(i=dre);let s=Fc.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?Ere:t.dot?Tre:Are,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?Ore(f):f===er?er:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==er||p===er||(p===void 0?h!==void 0&&h!==er?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==er&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=er))}),u.filter(f=>f!==er).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+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 o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Tn.defaults(e).Minimatch}};Tn.AST=Fc;Tn.Minimatch=ii;Tn.escape=Au;Tn.unescape=es;var nM=require("node:url");var Iu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nk=new Set,G2=typeof process=="object"&&process?process:{},kk=a((n,e,t,r)=>{typeof G2.emitWarning=="function"?G2.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),c0=globalThis.AbortController,Lk=globalThis.AbortSignal;if(typeof c0>"u"){Lk=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},c0=class{static{a(this,"AbortController")}constructor(){e()}signal=new Lk;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=G2.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{n&&(n=!1,kk("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 Pre=a(n=>!Nk.has(n),"shouldWarn");var Ca=a(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),Mk=a(n=>Ca(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?xu:null:null,"getUintArray"),xu=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},W2=class n{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Mk(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]}},Qd=class n{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#b;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;#E;#T;#_;#v;#S;#w;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:a(t=>e.#U(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#C(t),"rindexes"),isStale:a(t=>e.#A(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.#b}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:y,fetchMethod:b,memoMethod:S,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:T,ignoreFetchAbort:R}=e;if(t!==0&&!Ca(t))throw new TypeError("max option must be a nonnegative integer");let B=t?Mk(t):Array;if(!B)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=g||this.#n,this.sizeCalculation=y,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#b=S,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=b,this.#S=!!b,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#p=new B(t),this.#g=new B(t),this.#d=0,this.#m=0,this.#y=W2.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.#v=!!this.#r,this.#w=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#n!==0&&!Ca(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ca(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Ca(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ca(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}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 L="LRU_CACHE_UNBOUNDED";Pre(L)&&(Nk.add(L),kk("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#I(){let e=new xu(this.#e),t=new xu(this.#e);this.#_=e,this.#T=t,this.#F=(s,o,c=Iu.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#P(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#x=s=>{t[s]=e[s]!==0?Iu.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];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=a(()=>{let s=Iu.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(r||i())-o>c}}#x=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#F=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#O(){let e=new xu(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#N=(t,r,i,s)=>{if(this.#h(r))return 0;if(!Ca(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Ca(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.#L=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=a(e=>{},"#removeItemSize");#L=a((e,t,r)=>{},"#addItemSize");#N=a((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#C({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#p[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#C())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#C()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#C())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#R()){let i=this.#o[r],s=this.#h(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.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#C()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#C({allowStale:!0}))this.#A(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#o[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#T){let o=this.#_[t],c=this.#T[t];if(o&&c){let l=o-(Iu.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.#R({allowStale:!0})){let r=this.#l[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#T){o.ttl=this.#_[t];let c=Iu.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Iu.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:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#N(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#L(d,f,l),l&&(l.set="add"),u=!1;else{this.#U(d);let h=this.#o[d];if(t!==h){if(this.#S&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!o&&(this.#v&&this.#r?.(p,e,"set"),this.#w&&this.#f?.push([p,e,"set"]))}else o||(this.#v&&this.#r?.(h,e,"set"),this.#w&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#L(d,f,l),this.#o[d]=t,l){l.set="replace";let p=h&&this.#h(h)?h.__staleWhileFetching:h;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#_&&this.#I(),this.#_&&(u||this.#F(d,i,s),l&&this.#a(l,d)),!o&&this.#w&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#w&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,r=this.#l[t],i=this.#o[t];return this.#S&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#w)&&(this.#v&&this.#r?.(i,r,"evict"),this.#w&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=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 o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return r&&this.#x(s),i&&(i.has="hit",this.#a(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.#A(i))return;let s=this.#o[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new c0,{signal:c}=r;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:i},u=a((y,b=!1)=>{let{aborted:S}=o.signal,v=r.ignoreFetchAbort&&y!==void 0;if(r.status&&(S&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!v&&!b)return d(o.signal.reason);let I=p;return this.#o[t]===p&&(y===void 0?I.__staleWhileFetching?this.#o[t]=I.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),f=a(y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),d(y)),"eb"),d=a(y=>{let{aborted:b}=o.signal,S=b&&r.allowStaleOnFetchAbort,v=S||r.allowStaleOnFetchRejection,I=v||r.noDeleteOnFetchRejection,A=p;if(this.#o[t]===p&&(!I||A.__staleWhileFetching===void 0?this.#P(e,"fetch"):S||(this.#o[t]=A.__staleWhileFetching)),v)return r.status&&A.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw y},"fetchFail"),h=a((y,b)=>{let S=this.#c?.(e,s,l);S&&S instanceof Promise&&S.then(v=>y(v===void 0?void 0:v),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(void 0),r.allowStaleOnFetchAbort&&(y=a(v=>u(v,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),g=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,g,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=g,g}#h(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof c0}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:y,forceRefresh:b=!1,status:S,signal:v}=t;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let I={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:v},A=this.#s.get(e);if(A===void 0){S&&(S.fetch="miss");let T=this.#j(e,A,I,y);return T.__returned=T}else{let T=this.#o[A];if(this.#h(T)){let M=r&&T.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",M&&(S.returnedStale=!0)),M?T.__staleWhileFetching:T.__returned=T}let R=this.#A(A);if(!b&&!R)return S&&(S.fetch="hit"),this.#U(A),i&&this.#x(A),S&&this.#a(S,A),T;let B=this.#j(e,A,I,y),P=B.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?B.__staleWhileFetching:B.__returned=B}}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.#b;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=r(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#h(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#U(c),i&&this.#x(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#U(e){e!==this.#m&&(e===this.#d?this.#d=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#P(e,"delete")}#P(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.#B(t);else{this.#D(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#w)&&(this.#v&&this.#r?.(s,e,t),this.#w&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let o=this.#g[i];this.#p[o]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#w&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#C({allowStale:!0})){let r=this.#o[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#v&&this.#r?.(r,i,e),this.#w&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#o.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.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#w&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Ou=require("node:path"),zk=require("node:url"),Us=require("fs"),Bre=se(require("node:fs"),1),Fa=require("node:fs/promises");var m0=require("node:events"),J2=se(require("node:stream"),1),Vk=require("node:string_decoder");var jk=typeof process=="object"&&process?process:{stdout:null,stderr:null},Fre=a(n=>!!n&&typeof n=="object"&&(n instanceof Pa||n instanceof J2.default||Dre(n)||Lre(n)),"isStream"),Dre=a(n=>!!n&&typeof n=="object"&&n instanceof m0.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==J2.default.Writable.prototype.pipe,"isReadable"),Lre=a(n=>!!n&&typeof n=="object"&&n instanceof m0.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),ko=Symbol("EOF"),Mo=Symbol("maybeEmitEnd"),Oa=Symbol("emittedEnd"),l0=Symbol("emittingEnd"),Yd=Symbol("emittedError"),u0=Symbol("closed"),$k=Symbol("read"),f0=Symbol("flush"),Uk=Symbol("flushChunk"),ts=Symbol("encoding"),Ru=Symbol("decoder"),Dr=Symbol("flowing"),Xd=Symbol("paused"),Cu=Symbol("resume"),Lr=Symbol("buffer"),An=Symbol("pipes"),Nr=Symbol("bufferLength"),H2=Symbol("bufferPush"),d0=Symbol("bufferShift"),sn=Symbol("objectMode"),tr=Symbol("destroyed"),z2=Symbol("error"),K2=Symbol("emitData"),Bk=Symbol("emitEnd"),Q2=Symbol("emitEnd2"),js=Symbol("async"),Y2=Symbol("abort"),h0=Symbol("aborted"),Jd=Symbol("signal"),Dc=Symbol("dataListeners"),si=Symbol("discarded"),Zd=a(n=>Promise.resolve().then(n),"defer"),Nre=a(n=>n(),"nodefer"),kre=a(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),Mre=a(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),jre=a(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),p0=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Cu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},X2=class extends p0{static{a(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)}},$re=a(n=>!!n.objectMode,"isObjectModeOptions"),Ure=a(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Pa=class extends m0.EventEmitter{static{a(this,"Minipass")}[Dr]=!1;[Xd]=!1;[An]=[];[Lr]=[];[sn];[ts];[js];[Ru];[ko]=!1;[Oa]=!1;[l0]=!1;[u0]=!1;[Yd]=null;[Nr]=0;[tr]=!1;[Jd];[h0]=!1;[Dc]=0;[si]=!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");$re(t)?(this[sn]=!0,this[ts]=null):Ure(t)?(this[ts]=t.encoding,this[sn]=!1):(this[sn]=!1,this[ts]=null),this[js]=!!t.async,this[Ru]=this[ts]?new Vk.StringDecoder(this[ts]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Lr],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[An],"get")});let{signal:r}=t;r&&(this[Jd]=r,r.aborted?this[Y2]():r.addEventListener("abort",()=>this[Y2]()))}get bufferLength(){return this[Nr]}get encoding(){return this[ts]}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[sn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[js]}set async(e){this[js]=this[js]||!!e}[Y2](){this[h0]=!0,this.emit("abort",this[Jd]?.reason),this.destroy(this[Jd]?.reason)}get aborted(){return this[h0]}set aborted(e){}write(e,t,r){if(this[h0])return!1;if(this[ko])throw new Error("write after end");if(this[tr])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[js]?Zd:Nre;if(!this[sn]&&!Buffer.isBuffer(e)){if(jre(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Mre(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[sn]?(this[Dr]&&this[Nr]!==0&&this[f0](!0),this[Dr]?this.emit("data",e):this[H2](e),this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr]):e.length?(typeof e=="string"&&!(t===this[ts]&&!this[Ru]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ts]&&(e=this[Ru].write(e)),this[Dr]&&this[Nr]!==0&&this[f0](!0),this[Dr]?this.emit("data",e):this[H2](e),this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr]):(this[Nr]!==0&&this.emit("readable"),r&&i(r),this[Dr])}read(e){if(this[tr])return null;if(this[si]=!1,this[Nr]===0||e===0||e&&e>this[Nr])return this[Mo](),null;this[sn]&&(e=null),this[Lr].length>1&&!this[sn]&&(this[Lr]=[this[ts]?this[Lr].join(""):Buffer.concat(this[Lr],this[Nr])]);let t=this[$k](e||null,this[Lr][0]);return this[Mo](),t}[$k](e,t){if(this[sn])this[d0]();else{let r=t;e===r.length||e===null?this[d0]():typeof r=="string"?(this[Lr][0]=r.slice(e),t=r.slice(0,e),this[Nr]-=e):(this[Lr][0]=r.subarray(e),t=r.subarray(0,e),this[Nr]-=e)}return this.emit("data",t),!this[Lr].length&&!this[ko]&&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[ko]=!0,this.writable=!1,(this[Dr]||!this[Xd])&&this[Mo](),this}[Cu](){this[tr]||(!this[Dc]&&!this[An].length&&(this[si]=!0),this[Xd]=!1,this[Dr]=!0,this.emit("resume"),this[Lr].length?this[f0]():this[ko]?this[Mo]():this.emit("drain"))}resume(){return this[Cu]()}pause(){this[Dr]=!1,this[Xd]=!0,this[si]=!1}get destroyed(){return this[tr]}get flowing(){return this[Dr]}get paused(){return this[Xd]}[H2](e){this[sn]?this[Nr]+=1:this[Nr]+=e.length,this[Lr].push(e)}[d0](){return this[sn]?this[Nr]-=1:this[Nr]-=this[Lr][0].length,this[Lr].shift()}[f0](e=!1){do;while(this[Uk](this[d0]())&&this[Lr].length);!e&&!this[Lr].length&&!this[ko]&&this.emit("drain")}[Uk](e){return this.emit("data",e),this[Dr]}pipe(e,t){if(this[tr])return e;this[si]=!1;let r=this[Oa];return t=t||{},e===jk.stdout||e===jk.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[An].push(t.proxyErrors?new X2(this,e,t):new p0(this,e,t)),this[js]?Zd(()=>this[Cu]()):this[Cu]()),e}unpipe(e){let t=this[An].find(r=>r.dest===e);t&&(this[An].length===1?(this[Dr]&&this[Dc]===0&&(this[Dr]=!1),this[An]=[]):this[An].splice(this[An].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[si]=!1,this[Dc]++,!this[An].length&&!this[Dr]&&this[Cu]();else if(e==="readable"&&this[Nr]!==0)super.emit("readable");else if(kre(e)&&this[Oa])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Yd]){let i=t;this[js]?Zd(()=>i.call(this,this[Yd])):i.call(this,this[Yd])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Dc]=this.listeners("data").length,this[Dc]===0&&!this[si]&&!this[An].length&&(this[Dr]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Dc]=0,!this[si]&&!this[An].length&&(this[Dr]=!1)),t}get emittedEnd(){return this[Oa]}[Mo](){!this[l0]&&!this[Oa]&&!this[tr]&&this[Lr].length===0&&this[ko]&&(this[l0]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[u0]&&this.emit("close"),this[l0]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==tr&&this[tr])return!1;if(e==="data")return!this[sn]&&!r?!1:this[js]?(Zd(()=>this[K2](r)),!0):this[K2](r);if(e==="end")return this[Bk]();if(e==="close"){if(this[u0]=!0,!this[Oa]&&!this[tr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Yd]=r,super.emit(z2,r);let s=!this[Jd]||this.listeners("error").length?super.emit("error",r):!1;return this[Mo](),s}else if(e==="resume"){let s=super.emit("resume");return this[Mo](),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[Mo](),i}[K2](e){for(let r of this[An])r.dest.write(e)===!1&&this.pause();let t=this[si]?!1:super.emit("data",e);return this[Mo](),t}[Bk](){return this[Oa]?!1:(this[Oa]=!0,this.readable=!1,this[js]?(Zd(()=>this[Q2]()),!0):this[Q2]())}[Q2](){if(this[Ru]){let t=this[Ru].end();if(t){for(let r of this[An])r.dest.write(t);this[si]||super.emit("data",t)}}for(let t of this[An])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[sn]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[sn]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[sn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ts]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(tr,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[si]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ko])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(tr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(tr,f),this.pause(),s({value:d,done:!!this[ko]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(tr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{o=h,s=d,this.once(tr,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[si]=!1;let e=!1,t=a(()=>(this.pause(),this.off(z2,t),this.off(tr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(z2,t),this.once(tr,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[tr])return e?this.emit("error",e):this.emit(tr),this;this[tr]=!0,this[si]=!0,this[Lr].length=0,this[Nr]=0;let t=this;return typeof t.close=="function"&&!this[u0]&&t.close(),e?this.emit("error",e):this.emit(tr),this}static get isStream(){return Fre}};var Vre=Us.realpathSync.native,th={lstatSync:Us.lstatSync,readdir:Us.readdir,readdirSync:Us.readdirSync,readlinkSync:Us.readlinkSync,realpathSync:Vre,promises:{lstat:Fa.lstat,readdir:Fa.readdir,readlink:Fa.readlink,realpath:Fa.realpath}},Kk=a(n=>!n||n===th||n===Bre?th:{...th,...n,promises:{...th.promises,...n.promises||{}}},"fsFromOption"),Qk=/^\\\\\?\\([a-z]:)\\?$/i,qre=a(n=>n.replace(/\//g,"\\").replace(Qk,"$1\\"),"uncToDrive"),Gre=/[\\\/]/,gi=0,Yk=1,Xk=2,$s=4,Jk=6,Zk=8,Lc=10,eM=12,mi=15,eh=~mi,Z2=16,qk=32,rh=64,rs=128,g0=256,b0=512,Gk=rh|rs|b0,Wre=1023,eA=a(n=>n.isFile()?Zk:n.isDirectory()?$s:n.isSymbolicLink()?Lc:n.isCharacterDevice()?Xk:n.isBlockDevice()?Jk:n.isSocket()?eM:n.isFIFO()?Yk:gi,"entToType"),Wk=new Map,nh=a(n=>{let e=Wk.get(n);if(e)return e;let t=n.normalize("NFKD");return Wk.set(n,t),t},"normalize"),Hk=new Map,y0=a(n=>{let e=Hk.get(n);if(e)return e;let t=nh(n.toLowerCase());return Hk.set(n,t),t},"normalizeNocase"),_0=class extends Qd{static{a(this,"ResolveCache")}constructor(){super({max:256})}},tA=class extends Qd{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},tM=Symbol("PathScurry setAsCwd"),on=class{static{a(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}#b;get gid(){return this.#b}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#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}#_;#v;#S;#w;#I;#x;#a;#F;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=gi,r,i,s,o,c){this.name=e,this.#_=s?y0(e):nh(e),this.#a=t&Wre,this.nocase=s,this.roots=i,this.root=r||this,this.#F=o,this.#S=c.fullpath,this.#I=c.relative,this.#x=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Kk(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=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.#a&=~Z2,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?y0(e):nh(e);for(let l of r)if(l.#_===i)return l;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,c=this.newChild(e,gi,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=rs),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=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.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=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.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#w=`//?/${i}`:this.#w=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#w=r}isUnknown(){return(this.#a&mi)===gi}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.#a&mi)===Zk}isDirectory(){return(this.#a&mi)===$s}isCharacterDevice(){return(this.#a&mi)===Xk}isBlockDevice(){return(this.#a&mi)===Jk}isFIFO(){return(this.#a&mi)===Yk}isSocket(){return(this.#a&mi)===eM}isSymbolicLink(){return(this.#a&Lc)===Lc}lstatCached(){return this.#a&qk?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&mi;return!(e!==gi&&e!==Lc||this.#a&g0||this.#a&rs)}calledReaddir(){return!!(this.#a&Z2)}isENOENT(){return!!(this.#a&rs)}isNamed(e){return this.nocase?this.#_===y0(e):this.#_===nh(e)}async readlink(){let e=this.#A;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.#A=r}catch(t){this.#h(t.code);return}}readlinkSync(){let e=this.#A;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.#A=r}catch(t){this.#h(t.code);return}}#L(e){this.#a|=Z2;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#N()}}#N(){this.#a&rs||(this.#a=(this.#a|rs)&eh,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#N()}#C(){this.#a|=b0,this.#k()}#k(){if(this.#a&rh)return;let e=this.#a;(e&mi)===$s&&(e&=eh),this.#a=e|rh,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#N():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#N()}#h(e=""){let t=this.#a;t|=g0,e==="ENOENT"&&(t|=rs),(e==="EINVAL"||e==="UNKNOWN")&&(t&=eh),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#P(e,t)||this.#U(e,t)}#U(e,t){let r=eA(e),i=this.newChild(e.name,r,{parent:this}),s=i.#a&mi;return s!==$s&&s!==Lc&&s!==gi&&(i.#a|=rh),t.unshift(i),t.provisional++,i}#P(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?y0(e.name):nh(e.name))===i.#_)return this.#B(e,i,r,t)}}#B(e,t,r,i){let s=t.name;return t.#a=t.#a&eh|eA(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.#a&rs)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&rs)===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:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:g,mtimeMs:y,nlink:b,rdev:S,size:v,uid:I}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#E=l,this.#d=u,this.#n=f,this.#b=d,this.#s=h,this.#r=p,this.#f=g,this.#g=y,this.#t=b,this.#i=S,this.#l=v,this.#c=I;let A=eA(e);this.#a=this.#a&eh|A|qk,A!==gi&&A!==$s&&A!==Lc&&(this.#a|=rh)}#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,o)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of o)this.#$(c,r);this.#L(r)}this.#H(r.slice(0,r.provisional))})}#V;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.#V)await this.#V;else{let r=a(()=>{},"resolve");this.#V=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=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.#L(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&Gk)return!1;let e=mi&this.#a;return e===gi||e===$s||e===Lc}shouldWalk(e,t){return(this.#a&$s)===$s&&!(this.#a&Gk)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((b0|g0|rs)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#O)return this.#O;if(!((b0|g0|rs)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}[tM](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.#I=r.join(this.sep),i.#x=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#I=void 0,i.#x=void 0,i=i.parent}},S0=class n extends on{static{a(this,"PathWin32")}sep="\\";splitSep=Gre;constructor(e,t=gi,r,i,s,o,c){super(e,t,r,i,s,o,c)}newChild(e,t=gi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Ou.win32.parse(e).root}getRoot(e){if(e=qre(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 Pu(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Qk,"$1\\"),e===t}},w0=class n extends on{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=gi,r,i,s,o,c){super(e,t,r,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=gi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},v0=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=th}={}){this.#t=Kk(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,zk.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new _0,this.#n=new _0,this.#r=new tA(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,d=t.sep,h=this.rootPath,p=!1;for(let g of l){let y=f--;u=u.child(g,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).fill("..").join("/"),fullpath:h+=(p?"":d)+g}),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 o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))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 o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))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 on||(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 on||(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 on||(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 on||(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 on||(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 on||(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 on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=a((d,h)=>{l.add(d),d.readdirCB((p,g)=>{if(p)return h(p);let y=g.length;if(!y)return h();let b=a(()=>{--y===0&&h()},"next");for(let S of g)(!s||s(S))&&c.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(l,o)?u(v,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,h)=>{u(f,p=>{if(p)return h(p);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=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 d of f){(!s||s(d))&&c.push(r?d:d.fullpath());let h=d;if(d.isSymbolicLink()){if(!(i&&(h=d.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,o)&&l.add(h)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(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 on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=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 d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Pa({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let g=a((b,S,v=!1)=>{if(b)return c.emit("error",b);if(i&&!v){let I=[];for(let A of S)A.isSymbolicLink()&&I.push(A.realpath().then(T=>T?.isUnknown()?T.lstat():T));if(I.length){Promise.all(I).then(()=>g(null,S,!0));return}}for(let I of S)I&&(!s||s(I))&&(c.write(r?I:I.fullpath())||(h=!0));f--;for(let I of S){let A=I.realpathCached()||I;A.shouldWalk(l,o)&&u.push(A)}h&&!c.flowing?c.once("drain",d):y||d()},"onReaddir"),y=!0;p.readdirCB(g,!0),y=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof on||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Pa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let g=p.readdirSync();for(let y of g)(!s||s(y))&&(c.write(r?y:y.fullpath())||(h=!0));f--;for(let y of g){let b=y;if(y.isSymbolicLink()){if(!(i&&(b=y.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}h&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[tM](t)}},Pu=class extends v0{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Ou.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Ou.win32.parse(e).root.toUpperCase()}newRoot(e){return new S0(this.rootPath,$s,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Fu=class extends v0{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Ou.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new w0(this.rootPath,$s,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ih=class extends Fu{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},CSe=process.platform==="win32"?S0:w0,rM=process.platform==="win32"?Pu:process.platform==="darwin"?ih:Fu;var Hre=a(n=>n.length>=1,"isPatternList"),zre=a(n=>n.length>=1,"isGlobList"),Du=class n{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#b;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!Hre(e))throw new TypeError("empty pattern list");if(!zre(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,o,c,l,...u]=this.#e,[f,d,h,p,...g]=this.#n;u[0]===""&&(u.shift(),g.shift());let y=[s,o,c,l,""].join("/"),b=[f,d,h,p,""].join("/");this.#e=[y,...u],this.#n=[b,...g],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],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]===er}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(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 Kre=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Lu=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:o=Kre}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new ii(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 o=new Du(i,s,0,this.platform),c=new ii(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.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 o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.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 rA=class n{static{a(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()]))}},nA=class{static{a(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)])}},iA=class{static{a(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())}},sh=class n{static{a(this,"Processor")}hasWalkedCache;matches=new nA;subwalks=new iA;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new rA}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 o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;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 d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===er){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),h=u?.rest();if(!u||(d===""||d===".")&&!h)this.matches.add(i,c,d===""||d===".");else if(d===".."){let p=i.parent||i;h?this.hasWalkedCache.hasWalked(p,h)||this.subwalks.add(p,h):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 o of r){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===er?i.testGlobstar(s,o,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 o=e.parent||e;this.subwalks.add(o,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 Qre=a((n,e)=>typeof n=="string"?new Lu([n],e):Array.isArray(n)?new Lu(n,e):n,"makeIgnore"),E0=class{static{a(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=Qre(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 o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.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 o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.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(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+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 sh(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,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));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,o):c.readdirCB((u,f)=>this.walkCB3(c,f,r,o),!0)}o()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new sh(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,o=a(()=>{--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,o)}o()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--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(),o);o()}},oh=class extends E0{static{a(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}},ah=class extends E0{static{a(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Pa({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 Yre=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ns=class{static{a(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,nM.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||Yre,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"?Pu:t.platform==="darwin"?ih:t.platform?Fu:rM;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 ii(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Du(l,f,0,this.platform)})}async walk(){return[...await new oh(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 oh(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 ah(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 ah(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 sA=a((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new ii(t,e).hasMagic())return!0;return!1},"hasMagic");function T0(n,e={}){return new ns(n,e).streamSync()}a(T0,"globStreamSync");function sM(n,e={}){return new ns(n,e).stream()}a(sM,"globStream");function oM(n,e={}){return new ns(n,e).walkSync()}a(oM,"globSync");async function iM(n,e={}){return new ns(n,e).walk()}a(iM,"glob_");function A0(n,e={}){return new ns(n,e).iterateSync()}a(A0,"globIterateSync");function aM(n,e={}){return new ns(n,e).iterate()}a(aM,"globIterate");var Xre=T0,Jre=Object.assign(sM,{sync:T0}),Zre=A0,ene=Object.assign(aM,{sync:A0}),tne=Object.assign(oM,{stream:T0,iterate:A0}),Da=Object.assign(iM,{glob:iM,globSync:oM,sync:tne,globStream:sM,stream:Jre,globStreamSync:T0,streamSync:Xre,globIterate:aM,iterate:ene,globIterateSync:A0,iterateSync:Zre,Glob:ns,hasMagic:sA,escape:Au,unescape:es});Da.glob=Da;async function cM(n,e,t,r={}){let{dryRun:i=!1,excludeRelPath:s}=r,o=Nc.default.join(n,"**/*.md"),c=await Da(o,{nodir:!0,ignore:[Nc.default.join(n,".obsidian/**"),Nc.default.join(n,".trash/**"),Nc.default.join(n,"**/.obsidian/**"),Nc.default.join(n,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=Nc.default.relative(n,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await aA.default.readFile(u,"utf-8")}catch{continue}let{updated:h,replacements:p}=rne(d,e,t);p>0&&(l.filesModified+=1,l.replacements+=p,l.modifiedFiles.push(f),i||await aA.default.writeFile(u,h,"utf-8"))}return l}a(cM,"rewriteInboundWikilinks");function rne(n,e,t){let r=n.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=r[s],c=nne(o,e,t);i+=c.replacements,r[s]=c.updated}return{updated:r.join(""),replacements:i}}a(rne,"rewriteContent");function nne(n,e,t){let r=n.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=ine(r[s],e,t);i+=o.replacements,r[s]=o.updated}return{updated:r.join(""),replacements:i}}a(nne,"rewriteProseSegment");function ine(n,e,t){let r=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:n.replace(r,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}a(ine,"replaceWikilinks");var sne=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Xt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await pr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return pr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await pr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await pr.default.ensureDir(rr.default.dirname(r)),await pr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await pr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await pr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await pr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await pr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return pr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=pr.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=rr.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=pr.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),o=this.replaceFrontmatter(r,s);await this.modify(e,o)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await pr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await pr.default.ensureDir(rr.default.dirname(i)),await pr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await pr.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(sne.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let u=r.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=rr.default.dirname(this.resolvePath(t)),s;if(rr.default.isAbsolute(r)?s=this.resolvePath(r):s=rr.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),pr.default.existsSync(s)){let u=rr.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=r.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=rr.default.relative(this.rootPath,e),r=rr.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=pr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=rr.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=rr.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){let i=rr.default.basename(t,".md");await cM(this.rootPath,r,i,{excludeRelPath:e})}resolvePath(e){return rr.default.isAbsolute(e)?e:rr.default.join(this.rootPath,e)}createFileObject(e){let t=rr.default.basename(e),r=rr.default.basename(e,rr.default.extname(e)),i=rr.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:rr.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=Dt.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=Dt.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
|
|
368
368
|
${r.trim()}
|
|
369
369
|
---`):`---
|
|
370
370
|
${r.trim()}
|
|
@@ -593,11 +593,11 @@ setting__Setting_value: ${i}
|
|
|
593
593
|
|
|
594
594
|
Homoiconic validation-check setting (RFC f402002b, M1.5). \`Exocortex: Validate vault\` reads this instance's \`setting__Setting_value\` to decide whether to run the **${r}** check (key \`[[${t}]]\`). Scaffolded default \u2014 edit \`setting__Setting_value\` to toggle.
|
|
595
595
|
`}a(aoe,"settingAsset");function _j(){return new Se("scaffold").description("Scaffold homoiconic configuration assets").addCommand(coe())}a(_j,"scaffoldCommand");function coe(){return new Se("validation-settings").description("Scaffold the 4 validation-check setting__Setting instances (uid-uniqueness=true, rest=false) co-located in the chosen ontology").requiredOption("--vault <path>","Vault root directory").requiredOption("--ontology <uid>","UID of the ontology whose folder the check settings are co-located in").option("--output <type>","Response format: text|json","text").action(async n=>{let e=n.output??"text";ce.setFormat(e);try{let t=(0,Uc.resolve)(n.vault);if(!(0,fb.existsSync)(t)||!(0,fb.statSync)(t).isDirectory())throw new qe(t);let s=(await new _i(t).indexedAssets()).find(u=>(0,Gs.readUid)(u.metadata)===n.ontology);if(!s)throw new Error(`Ontology UID "${n.ontology}" not found in vault ${t} (its folder is where the check settings co-locate).`);let o=(0,Uc.join)(t,(0,Uc.dirname)(s.path)),c=new Date().toISOString().slice(0,19),l=[];for(let u of ooe){let f=(0,bj.randomUUID)(),d=(0,Uc.join)(o,`${f}.md`);await(0,yj.writeFile)(d,aoe(f,n.ontology,u.checkId,u.label,u.value,c),"utf-8"),l.push(d)}if(e==="json")console.log(JSON.stringify({vaultPath:t,ontology:n.ontology,targetDir:o,created:l},null,2));else{console.log(`OK: scaffolded ${l.length} validation-check setting(s) in ${o}`);for(let u of l)console.log(` ${u}`);console.log(`
|
|
596
|
-
Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){ce.handle(t)}})}a(coe,"scaffoldValidationCommand");var Lj=require("fs"),Nj=require("path");var db=se(Lo()),hb=se(require("path"));var Ku=se(et()),mb=se(et());var loe=Ku.SDK_FLOOR_ASSETSPACE_UIDS,vh="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",eI="3de846cd-1f0e-4f98-8613-b8587aa15174",uoe=5,pb=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[hb.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??uoe,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,Ku.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of loe)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,r,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)r.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,r,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,r=new Map;for(let i of this.vaultPaths){if(!await db.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=Bo(o.frontmatter.exo__Instance_class);if(c.some(l=>l===vh)){let l=doe(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,Ku.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=Bo(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&r.set(o.uid,f)}if(c.some(l=>l===eI)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:Bo(o.frontmatter.exo__Profile_includes),extends:Bo(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:r}}async walkVault(e){let t=[],r=[e];for(;r.length>0;){let i=r.pop(),s;try{s=await db.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=hb.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;r.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await db.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let r=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(r===null)return null;try{let i=Dt.load(r[1]);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function Bo(n){if(n==null)return[];let e=Array.isArray(n)?n:[n],t=[];for(let r of e){if(typeof r!="string")continue;let i=foe(r);i!==null&&t.push(i)}return t}a(Bo,"parseWikilinkArray");function foe(n){let e=n.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(foe,"extractUidFromWikilink");function doe(n,e){let t=hb.default.relative(e,n).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let r=t.slice(12),i=r.indexOf("/");return i<0?"":`assetspaces/${r.slice(0,i)}`}a(doe,"parentFolderRelative");var Bc=require("node:fs"),Qu=require("node:path");var vi=se(et());var Ct=require("node:fs"),wj=require("node:fs/promises"),vj=require("node:os"),ln=require("node:path"),Vo=se(et());var hoe=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,Sj=50*1024*1024,Hn=class n{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(n.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(hoe);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=n.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,r){let{owner:i,repo:s}=n.parseGitHubURL(e);if((0,Ct.existsSync)(r)&&(0,Ct.readdirSync)(r).length>0)throw new Error(`pullAssetSpace: target ${r} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,Vo.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:r});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${Vo.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,r=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(r(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),h=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||h!=null){let p=h!=null?new Date(Number(h)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${p}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(r(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(r(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>Sj)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${Sj})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,Ct.existsSync)(e)},async read(e){return(0,Ct.readFileSync)(e,"utf8")},async write(e,t){(0,Ct.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,Ct.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,r){let i=await(0,wj.mkdtemp)((0,ln.join)((0,vj.tmpdir)(),`exo-bootstrap-${(0,ln.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,ln.resolve)(i,c);if(l!==i&&!l.startsWith(i+ln.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,Ct.mkdirSync)((0,ln.dirname)(l),{recursive:!0}),(0,Ct.writeFileSync)(l,o.content),s++,r?.(s)}(0,Ct.mkdirSync)((0,ln.dirname)(e),{recursive:!0});try{(0,Ct.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,Ct.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,Ct.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,r){let i=(0,ln.join)(e,".gitmodules"),s="";try{s=(0,Ct.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,Vo.appendGitmodulesEntry)(s,t,r);return c?((0,Ct.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let r=(0,ln.join)(e,".gitmodules"),i;try{i=(0,Ct.readFileSync)(r,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,Vo.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,Ct.writeFileSync)(r,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,Vo.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let r=t.split("/");if(t.length===0||!t.startsWith("assetspaces/")||r.some(o=>o.length===0||o==="."||o===".."))throw new Error(`unmountAssetSpace: refusing unsafe submodulePath "${t}"`);let i=(0,ln.resolve)(e),s=(0,ln.resolve)(i,t);if(s===i||!s.startsWith(i+ln.sep))throw new Error(`unmountAssetSpace: target "${s}" escapes vault root "${i}"`);this.removeGitmodulesEntry(e,t),(0,Ct.existsSync)(s)&&(0,Ct.rmSync)(s,{recursive:!0,force:!0})}};function poe(n){let e=(0,vi.derivePath)(n);return e===null?n:`https://github.com/${e.slice(12)}`}a(poe,"toHttpsGitHubUrl");var moe=new Set(["node_modules",".obsidian",".exocortex",".git"]),Yu=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new Hn,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,r=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,Bc.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Qu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||moe.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=Bo(u.exo__Instance_class);if(d.includes(vh)){if(r.has(f))continue;let p=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(p.length===0)continue;let g=(0,vi.derivePath)(p);if(g===null)continue;let y=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",b=y||yoe(g)||f.slice(0,8);r.add(f),e.push({uid:f,git:p,folderName:g,label:b,namespace:y})}if(d.includes(eI)){let h=u.exo__Asset_label;typeof h=="string"&&h.length>0&&t.set(f,h)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,vi.assertTsFloorReconciled)(e,t,vi.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:r,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let v of c)l.set(v.uid,v);let u=new Set(l.keys()),f=new Set,d=new Set;for(let v of o.declaredOntologies)if(u.has(v)){f.add(v);let I=l.get(v)?.namespace;I!==void 0&&I.length>0&&d.add(I)}this.assertTsFloor(f,d);let h=new Set([...o.effective,...f]),p=new Set;for(let v of c)(0,Bc.existsSync)((0,Qu.join)(this.vaultPath,v.folderName))&&p.add(v.uid);for(let v of c)vi.CATALOG_KEEP_NAMESPACES.has(v.namespace)&&p.has(v.uid)&&h.add(v.uid);let g=[];for(let v of c)p.has(v.uid)&&(h.has(v.uid)||g.push({asUid:v.uid,folderName:v.folderName,label:v.label,files:this.enumerateFilesUnder(v.folderName)}));let y=[];for(let v of h){if(p.has(v))continue;let I=l.get(v);I!==void 0&&y.push({asUid:I.uid,folderName:I.folderName,httpsUrl:poe(I.git),label:I.label})}let b=new Map;for(let v of g)b.set(v.asUid,v.files);let S={targetProfileUid:t,targetProfileLabel:r,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:b,assetSpacesBeingTornDown:g.map(v=>({asUid:v.asUid,asLabel:v.label,fileCount:v.files.length})),assetSpacesBeingMaterialized:y.map(v=>({asUid:v.asUid,asLabel:v.label}))};return{toDestroy:g,toMaterialize:y,plan:S}}async execute(e){let t=[],r=[];for(let i of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,i.folderName),t.push(i.asUid);for(let i of e.toMaterialize){let s=(0,Qu.join)(this.vaultPath,i.folderName);await this.mount.pullAssetSpace(i.httpsUrl,this.ref,s),this.mount.ensureGitmodulesEntry(this.vaultPath,i.folderName,i.httpsUrl),r.push(i.asUid)}return{destroyed:t,materialized:r}}enumerateFilesUnder(e){let t=[],i=[(0,Qu.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,Bc.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Qu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(goe(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,Bc.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let r=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(r===null)return null;try{let i=Dt.load(r[1]);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function goe(n,e){let t=e.endsWith("/")?e:e+"/";return(n.startsWith(t)?n.slice(t.length):n).split("\\").join("/")}a(goe,"relativeVaultPath");function yoe(n){let e=n.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(yoe,"lastSegment");var vr=require("node:fs"),Oj=require("node:crypto"),Pj=require("node:child_process"),Fj=require("node:util"),Er=se(require("node:path"));var nt=se(et());var qo=require("node:fs"),Aj=require("node:crypto"),Ei=se(require("node:path"));var Ti=se(et());var Ej=require("node:child_process"),Tj=se(et());var boe=6e4,Ws=class n{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,Ej.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),r;try{r=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(n.PAT_REGEX,"***REDACTED***"))}let i=r.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(n.PAT_REGEX,"***REDACTED***")}async push(e,t,r,i,s){return(0,Tj.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:r,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,r=a(i=>this.redact(i),"redact");return async i=>{let s={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(boe)})}catch(u){throw new Error(r(`GitHub request failed: ${_oe(u)}`))}let c=await o.text().catch(()=>"");if(o.status<200||o.status>=300)throw new Error(Soe(r(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${c}`),512));let l;try{l=c.length>0?JSON.parse(c):void 0}catch{l=void 0}return{status:o.status,json:l,text:c}}}};function _oe(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}a(_oe,"errMsg");function Soe(n,e){return n.length>e?n.slice(0,e)+"...":n}a(Soe,"truncate");var woe=a(async n=>{let e=await Aj.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),voe={parse:a(n=>Dt.load(n,{schema:Dt.CORE_SCHEMA}),"parse"),stringify:a(n=>Dt.dump(n,{schema:Dt.CORE_SCHEMA,lineWidth:-1}),"stringify")};function Eoe(n,e){if(n.tokenFromGh===!0)return Ws.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(Eoe,"resolveToken");function Toe(n){let e=a(r=>Ei.join(n,r),"abs"),t=a(async(r,i)=>{let s;try{s=await qo.promises.readdir(r,{withFileTypes:!0})}catch{return}for(let o of s){let c=Ei.join(r,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Ei.relative(n,c).split(Ei.sep).join("/"))}},"walk");return{async list(){let r=[];return(0,qo.existsSync)(n)&&await t(n,r),r},read:a(r=>qo.promises.readFile(e(r),"utf-8"),"read"),async readBinary(r){return new Uint8Array(await qo.promises.readFile(e(r)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(Toe,"nodeLocalFilesPort");function Xu(n){let e=new Xt(n),t=new Ti.SpaceSpecAccumulator;for(let r of e.getAllFiles()){let i=e.getFrontmatter(r);if(!i)continue;let s=(0,Ti.classifySpaceDeclaration)(i,r.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,qo.existsSync)(Ei.join(n,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(Xu,"collectVaultSpecs");function Aoe(n,e){for(let t of n.repos){let r=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${r}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,Ti.summarizeParityRound)(n))}a(Aoe,"printHumanReport");async function Ioe(n,e={}){let t=e.out??(g=>console.log(g)),r=Ei.resolve(n.vault);if(!(0,qo.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let i=Eoe(n,e),s=new Ws({token:i,...n.apiBase!==void 0?{apiBase:n.apiBase}:{}}),o=e.transportFactory?.(i,n.apiBase)??s.transport(),{specs:c,warnings:l}=Xu(r);for(let g of l)t(`warn: ${g}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=n.configDir??".obsidian",f=Ei.join(r,u,"plugins","exocortex",Ti.WATERMARK_STORE_FILENAME),d=new Ti.FileWatermarkStore({read:a(async()=>{try{return await qo.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),h=new Ti.ParityValidator({transport:o,sha1:woe,localFilesFor:a(g=>Toe(Ei.join(r,g.localPath)),"localFilesFor"),watermarks:{get:a(g=>d.get(g),"get")},yaml:voe,redact:a(g=>s.redact(g),"redact"),...n.apiBase!==void 0?{baseURL:n.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${r}`);let p=await h.runRound(c,{trigger:"standalone"});return n.json===!0?t(JSON.stringify(p,null,2)):Aoe(p,t),p.vacuous?2:p.ok?0:1}a(Ioe,"runExosyncParity");function Ij(){return new Se("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async n=>{try{process.exitCode=await Ioe(n)}catch(e){ce.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(Ij,"exosyncParityCommand");var zn=require("node:fs"),rI=require("node:crypto"),Rn=se(require("node:path")),Cn=se(et());var xoe="exosync-watermarks.local.json";function Rj(n,e,t){let r=sI(e,t),i=new Ws({token:r,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(r,e.apiBase)??i.transport(),{specs:o,warnings:c}=Xu(n),l=e.configDir??".obsidian",u=Rn.join(n,l,"plugins","exocortex",xoe),f=Rn.join(n,l,"plugins","exocortex",Cn.CONFLICT_CACHE_STORE_FILENAME),d=new Cn.LocalConflictCacheStore({io:Go(f)}),h=Rn.join(n,l,"plugins","exocortex",Cn.OUTBOX_STORE_FILENAME),p=new Cn.LocalOutboxStore({io:Go(h)});return{resolver:new Cn.QuarantineResolver({transport:s,watermarkStore:new Cn.FileWatermarkStore(Go(u)),localFilesFor:a(y=>gb(Rn.join(n,y.localPath)),"localFilesFor"),sha1:iI,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(y=>i.redact(y),"redact"),conflictCache:d,outbox:p}),specs:o,warnings:c}}a(Rj,"buildResolver");async function Roe(n,e={}){let t=e.out??(l=>console.log(l)),r=Rn.resolve(n.vault);if(!(0,zn.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let{resolver:i,specs:s,warnings:o}=Rj(r,n,e);for(let l of o)t(`warn: ${l}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let c=await i.listOpenConflicts(s);if(n.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),0;t(`${c.length} open conflict(s):`);for(let l of c){let u=`${l.hasLocal?"local":"(no local)"} vs ${l.hasRemote?"remote":"(no remote)"}`;t(` ${l.repoKey} ${l.path} [${u}]${l.uid?` uid=${l.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file <path> --vault <vault>"),0}a(Roe,"runQuarantineList");async function Coe(n,e,t={}){let r=t.out??(b=>console.log(b)),i=Rn.resolve(e.vault);if(!(0,zn.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await zn.promises.readFile(Rn.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=Rj(i,e,t);for(let b of u)r(`warn: ${b}`);let d=(await c.listOpenConflicts(l)).filter(b=>b.path===n&&(e.repo===void 0||b.repoKey===e.repo));if(d.length===0)return r(`No open conflict for "${n}"${e.repo?` in ${e.repo}`:""} \u2014 run \`exosync quarantine list\` to see the current set.`),1;if(d.length>1){r(`"${n}" conflicts in ${d.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let b of d)r(` --repo ${b.repoKey}`);return 1}let h=d[0],p=l.find(b=>b.repoKey===h.repoKey),g=await c.resolve(p,h.path,o),y=g.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":g.pushedSha!==void 0?` \u2014 pushed @${g.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return r(`Resolved ${h.path} (${g.resolvedTo}) in ${h.repoKey}${y}.`),g.discardedLocalBackupPath!==void 0&&r(` \u21B3 your discarded local version is preserved at ${p.localPath}/${g.discardedLocalBackupPath}`),0}a(Coe,"runQuarantineResolve");function xj(n,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(n);if(t===null)return n;let r=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return r===t[2]?n:n.slice(0,t.index)+t[1]+r+t[3]+n.slice(t.index+t[0].length)}a(xj,"rewriteUid");function nI(n){return n.replace(/\r\n?/g,`
|
|
597
|
-
`).replace(/\n+$/,"")}a(nI,"normalizeForCompare");function Ooe(n,e,t){let r=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of r){let c=nI(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:n}):s.push({action:"reuuid",path:o.path,fromUid:n,toUid:t()})}return s}a(Ooe,"planDedupGroup");async function Poe(n,e={}){let t=e.out??(f=>console.log(f)),r=Rn.resolve(n.vault);if(!(0,zn.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let{specs:i,warnings:s}=Xu(r);for(let f of s)t(`warn: ${f}`);let o=new Map;for(let f of i){let d=Rn.join(r,f.localPath);if(!(0,zn.existsSync)(d))continue;let h=gb(d);for(let p of await h.list()){if(!p.endsWith(".md"))continue;let g;try{g=await h.read(p)}catch{continue}let y=(0,Cn.extractAssetUid)(g);if(y===void 0)continue;let b=Rn.join(d,p),S=o.get(y)??[];S.push(b),o.set(y,S)}}let c=[...o.entries()].filter(([,f])=>f.length>1).sort(([f],[d])=>f.localeCompare(d));if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>Rn.relative(r,f),"rel");if(n.auto===!0){let f=[];for(let[b,S]of c){let v=[],I=new Map;for(let A of S){let T=await zn.promises.readFile(A,"utf-8");v.push({path:A,content:T}),I.set(A,T)}f.push({uid:b,decisions:Ooe(b,v,rI.randomUUID),snap:I})}let d=0,h=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:b,decisions:S}of f){t(` ${b}:`);for(let v of S)v.action==="keep"?t(` KEEP ${l(v.path)} (keeps uid ${b})`):v.action==="reuuid"?(h++,t(` RE-UUID ${l(v.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(v.path)} (identical content \u2192 ${l(v.identicalTo)}; zero-loss)`))}if(n.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${h} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let p=0,g=0,y=0;for(let{decisions:b,snap:S}of f){for(let v of b){if(v.action!=="delete")continue;let I;try{I=await zn.promises.readFile(v.path,"utf-8")}catch{continue}if(nI(I)!==nI(S.get(v.path)??"")){t(` ! skipped delete ${l(v.path)} (changed since scan \u2014 re-run dedup-uids)`),y++;continue}await zn.promises.rm(v.path,{force:!0}),t(` deleted ${l(v.path)} (identical to ${l(v.identicalTo)})`),p++}for(let v of b){if(v.action!=="reuuid")continue;let I;try{I=await zn.promises.readFile(v.path,"utf-8")}catch{continue}if((0,Cn.extractAssetUid)(I)!==v.fromUid){t(` ! skipped re-uuid ${l(v.path)} (uid changed since scan \u2014 re-run dedup-uids)`),y++;continue}let A=xj(I,v.toUid);A!==I&&(await zn.promises.writeFile(v.path,A,"utf-8"),t(` re-uuid ${l(v.path)} \u2192 uid=${v.toUid} (content differs from kept copy)`),g++)}}return t(`Resolved: deleted ${p} identical copy(ies), re-uuid ${g} differing variant(s).${y>0?` ${y} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),y>0?1:0}n.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let h of d)t(` ${l(h)}`)}if(n.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let[,f]of c){let d=[...f].sort((h,p)=>h.localeCompare(p));for(let h of d.slice(1)){let p=await zn.promises.readFile(h,"utf-8"),g=(0,rI.randomUUID)(),y=xj(p,g);y!==p&&(await zn.promises.writeFile(h,y,"utf-8"),t(` fixed ${Rn.relative(r,h)} \u2192 uid=${g}`),u++)}}return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(Poe,"runDedupUids");function tI(n){return n.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(tI,"withQuarantineOptions");function Cj(n){let e=new Se("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");tI(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await Roe(t)}catch(r){ce.handle(r,{command:"exosync quarantine list"}),process.exitCode=1}}),tI(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,r)=>{try{process.exitCode=await Coe(t,r)}catch(i){ce.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),n.addCommand(e),tI(n.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await Poe(t)}catch(r){ce.handle(r,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(Cj,"registerQuarantineCommands");var iI=a(async n=>{let e=await Oj.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),Foe={parse:a(n=>Dt.load(n,{schema:Dt.CORE_SCHEMA}),"parse"),stringify:a(n=>Dt.dump(n,{schema:Dt.CORE_SCHEMA,lineWidth:-1}),"stringify")};function sI(n,e){if(n.tokenFromGh===!0)return Ws.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(sI,"resolveToken");function gb(n){let e=a(i=>Er.join(n,i),"abs"),t=a(async(i,s)=>{let o;try{o=await vr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Er.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Er.relative(n,l).split(Er.sep).join("/"))}},"walk"),r=a(async(i,s)=>{let o=Er.dirname(i);await vr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await vr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,vr.existsSync)(n)&&await t(n,i),i},read:a(i=>vr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await r(e(i),o=>vr.promises.writeFile(o,s,"utf-8"))},async delete(i){await vr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await vr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await r(e(i),c=>vr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await vr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(gb,"nodeLocalFilesPort");function Go(n){return{async read(){try{return await vr.promises.readFile(n,"utf-8")}catch{return null}},async writeAtomic(e){await vr.promises.mkdir(Er.dirname(n),{recursive:!0});let t=`${n}.local.tmp`;await vr.promises.writeFile(t,e,"utf-8"),await vr.promises.rename(t,n)}}}a(Go,"nodeWatermarkFileIO");function Vc(n,e=".obsidian"){let t=Er.join(n,e,"plugins","exocortex",nt.MOUNT_BASE_STORE_FILENAME);return new nt.FileMountBaseStore(Go(t))}a(Vc,"nodeMountBaseStore");var Doe=(0,Fj.promisify)(Pj.execFile);function Loe(n){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await Doe("git",["-C",n,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304}),r=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return r?r[1]:null}catch{return null}}}a(Loe,"nodeLocalBaseShaProvider");function Noe(n){return{async check(e){let t=Er.join(n,e.localPath);if(!(0,vr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let r=0;try{r=(await vr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return r===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(Noe,"nodeMaterializationCheck");function koe(n,e){let t=n.pushedSha!==void 0?` \u2192@${n.pushedSha.slice(0,7)}`:"",r=(n.outboxPushedCount??0)>0?`, pushed ${n.outboxPushedCount} resolved`:"",i=(n.outboxReconflictedCount??0)>0?`, ${n.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${n.repoKey}${t}: ${n.status} \u2014 pulled ${n.pulledCount}, pushed ${n.pushedCount}, merged ${n.mergedCount}, quarantined ${n.quarantinedCount}${(n.pushedDeletes?.length??0)>0?`, deleted ${n.pushedDeletes.length}`:""}${r}${i}`),n.detail!==void 0&&e(` ${n.detail}`);for(let s of n.warnings)e(` warn: ${s}`);(n.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${n.quarantinedPaths.join(", ")}`),(n.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${n.deferredPaths.join(", ")}`),(n.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${n.deferredDeletes.join(", ")}`),n.timings!==void 0&&(0,nt.totalMs)(n.timings)>0&&e(` ${(0,nt.formatRepoTimings)(n.repoKey,n.timings)}`)}a(koe,"printRepoResult");function Moe(n){return n==="conflict"||n==="full-conflict"||n==="retry-exhausted"||n==="busy"||n==="auth-required"||n==="error"}a(Moe,"isFailureStatus");async function joe(n,e,t={}){let r=t.out??(T=>console.log(T)),i=Er.resolve(e.vault);if(!(0,vr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=sI(e,t),o=new Ws({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Xu(i);for(let T of u)r(`warn: ${T}`);if(l.length===0)return r("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let f=e.configDir??".obsidian",d=Er.join(i,f,"plugins","exocortex",nt.WATERMARK_STORE_FILENAME),h=Er.join(i,f,"plugins","exocortex",nt.LOCAL_MANIFEST_STORE_FILENAME),p=Er.join(i,f,"plugins","exocortex",nt.CONFLICT_CACHE_STORE_FILENAME),g=new nt.LocalConflictCacheStore({io:Go(p)}),y=Er.join(i,f,"plugins","exocortex",nt.OUTBOX_STORE_FILENAME),b=new nt.LocalOutboxStore({io:Go(y)}),S=g,v=new nt.SyncEngine({transport:c,watermarkStore:new nt.FileWatermarkStore(Go(d)),localManifestStore:new nt.FileLocalManifestStore(Go(h)),mountBaseStore:Vc(i,f),localBaseShaProvider:Loe(i),materializationCheck:Noe(i),localFilesFor:a(T=>gb(Er.join(i,T.localPath)),"localFilesFor"),sha1:iI,redact:a(T=>o.redact(T),"redact"),commitMessage:a((T,R,B=0)=>`exosync: ${R} change(s)${B>0?`, ${B} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new nt.GatedStructuredMerger(new nt.StructuredMerger(Foe)),quarantine:S,outbox:b,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});r(`ExoSync ${n}: ${l.length} repo(s), vault ${i}`);let I=(0,nt.orderChildrenFirst)(l),A=await v.syncAll(I,n);if(e.json===!0)r(JSON.stringify(A,null,2));else{for(let B of A)koe(B,r);let T=A.reduce((B,L)=>({pulled:B.pulled+L.pulledCount,pushed:B.pushed+L.pushedCount,merged:B.merged+L.mergedCount,quarantined:B.quarantined+L.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0});r(`Summary: ${A.length} repo(s) \u2014 pulled ${T.pulled}, pushed ${T.pushed}, merged ${T.merged}, quarantined ${T.quarantined}`);let R=(0,nt.aggregateTimings)(A);(0,nt.totalMs)(R)>0&&r((0,nt.formatTimingsLine)(R))}return A.some(T=>Moe(T.status))?1:0}a(joe,"runExosyncSync");function oI(n){return n.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)")}a(oI,"withSyncOptions");function aI(n){return async e=>{try{process.exitCode=await joe(n,e)}catch(t){ce.handle(t,{command:`exosync ${n}`}),process.exitCode=1}}}a(aI,"makeDirectionAction");function Dj(){let n=new Se("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return oI(n.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(aI("sync")),oI(n.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(aI("pull")),oI(n.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(aI("push")),Cj(n),n}a(Dj,"exosyncCommand");var $oe=a(n=>{process.stderr.write(`${n}
|
|
596
|
+
Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){ce.handle(t)}})}a(coe,"scaffoldValidationCommand");var Lj=require("fs"),Nj=require("path");var db=se(Lo()),hb=se(require("path"));var Ku=se(et()),mb=se(et());var loe=Ku.SDK_FLOOR_ASSETSPACE_UIDS,vh="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",eI="3de846cd-1f0e-4f98-8613-b8587aa15174",uoe=5,pb=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[hb.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??uoe,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,Ku.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of loe)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,r,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)r.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,r,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,r=new Map;for(let i of this.vaultPaths){if(!await db.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=Bo(o.frontmatter.exo__Instance_class);if(c.some(l=>l===vh)){let l=doe(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,Ku.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=Bo(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&r.set(o.uid,f)}if(c.some(l=>l===eI)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:Bo(o.frontmatter.exo__Profile_includes),extends:Bo(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:r}}async walkVault(e){let t=[],r=[e];for(;r.length>0;){let i=r.pop(),s;try{s=await db.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=hb.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;r.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await db.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let r=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(r===null)return null;try{let i=Dt.load(r[1]);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function Bo(n){if(n==null)return[];let e=Array.isArray(n)?n:[n],t=[];for(let r of e){if(typeof r!="string")continue;let i=foe(r);i!==null&&t.push(i)}return t}a(Bo,"parseWikilinkArray");function foe(n){let e=n.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(foe,"extractUidFromWikilink");function doe(n,e){let t=hb.default.relative(e,n).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let r=t.slice(12),i=r.indexOf("/");return i<0?"":`assetspaces/${r.slice(0,i)}`}a(doe,"parentFolderRelative");var Bc=require("node:fs"),Qu=require("node:path");var vi=se(et());var Ct=require("node:fs"),wj=require("node:fs/promises"),vj=require("node:os"),ln=require("node:path"),Vo=se(et());var hoe=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,Sj=50*1024*1024,zn=class n{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(n.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(hoe);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=n.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,r){let{owner:i,repo:s}=n.parseGitHubURL(e);if((0,Ct.existsSync)(r)&&(0,Ct.readdirSync)(r).length>0)throw new Error(`pullAssetSpace: target ${r} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,Vo.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:r});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${Vo.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,r=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(r(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),h=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||h!=null){let p=h!=null?new Date(Number(h)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${p}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(r(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(r(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>Sj)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${Sj})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,Ct.existsSync)(e)},async read(e){return(0,Ct.readFileSync)(e,"utf8")},async write(e,t){(0,Ct.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,Ct.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,r){let i=await(0,wj.mkdtemp)((0,ln.join)((0,vj.tmpdir)(),`exo-bootstrap-${(0,ln.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,ln.resolve)(i,c);if(l!==i&&!l.startsWith(i+ln.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,Ct.mkdirSync)((0,ln.dirname)(l),{recursive:!0}),(0,Ct.writeFileSync)(l,o.content),s++,r?.(s)}(0,Ct.mkdirSync)((0,ln.dirname)(e),{recursive:!0});try{(0,Ct.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,Ct.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,Ct.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,r){let i=(0,ln.join)(e,".gitmodules"),s="";try{s=(0,Ct.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,Vo.appendGitmodulesEntry)(s,t,r);return c?((0,Ct.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let r=(0,ln.join)(e,".gitmodules"),i;try{i=(0,Ct.readFileSync)(r,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,Vo.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,Ct.writeFileSync)(r,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,Vo.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let r=t.split("/");if(t.length===0||!t.startsWith("assetspaces/")||r.some(o=>o.length===0||o==="."||o===".."))throw new Error(`unmountAssetSpace: refusing unsafe submodulePath "${t}"`);let i=(0,ln.resolve)(e),s=(0,ln.resolve)(i,t);if(s===i||!s.startsWith(i+ln.sep))throw new Error(`unmountAssetSpace: target "${s}" escapes vault root "${i}"`);this.removeGitmodulesEntry(e,t),(0,Ct.existsSync)(s)&&(0,Ct.rmSync)(s,{recursive:!0,force:!0})}};function poe(n){let e=(0,vi.derivePath)(n);return e===null?n:`https://github.com/${e.slice(12)}`}a(poe,"toHttpsGitHubUrl");var moe=new Set(["node_modules",".obsidian",".exocortex",".git"]),Yu=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new zn,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,r=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,Bc.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Qu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||moe.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=Bo(u.exo__Instance_class);if(d.includes(vh)){if(r.has(f))continue;let p=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(p.length===0)continue;let g=(0,vi.derivePath)(p);if(g===null)continue;let y=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",b=y||yoe(g)||f.slice(0,8);r.add(f),e.push({uid:f,git:p,folderName:g,label:b,namespace:y})}if(d.includes(eI)){let h=u.exo__Asset_label;typeof h=="string"&&h.length>0&&t.set(f,h)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,vi.assertTsFloorReconciled)(e,t,vi.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:r,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let v of c)l.set(v.uid,v);let u=new Set(l.keys()),f=new Set,d=new Set;for(let v of o.declaredOntologies)if(u.has(v)){f.add(v);let I=l.get(v)?.namespace;I!==void 0&&I.length>0&&d.add(I)}this.assertTsFloor(f,d);let h=new Set([...o.effective,...f]),p=new Set;for(let v of c)(0,Bc.existsSync)((0,Qu.join)(this.vaultPath,v.folderName))&&p.add(v.uid);for(let v of c)vi.CATALOG_KEEP_NAMESPACES.has(v.namespace)&&p.has(v.uid)&&h.add(v.uid);let g=[];for(let v of c)p.has(v.uid)&&(h.has(v.uid)||g.push({asUid:v.uid,folderName:v.folderName,label:v.label,files:this.enumerateFilesUnder(v.folderName)}));let y=[];for(let v of h){if(p.has(v))continue;let I=l.get(v);I!==void 0&&y.push({asUid:I.uid,folderName:I.folderName,httpsUrl:poe(I.git),label:I.label})}let b=new Map;for(let v of g)b.set(v.asUid,v.files);let S={targetProfileUid:t,targetProfileLabel:r,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:b,assetSpacesBeingTornDown:g.map(v=>({asUid:v.asUid,asLabel:v.label,fileCount:v.files.length})),assetSpacesBeingMaterialized:y.map(v=>({asUid:v.asUid,asLabel:v.label}))};return{toDestroy:g,toMaterialize:y,plan:S}}async execute(e){let t=[],r=[];for(let i of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,i.folderName),t.push(i.asUid);for(let i of e.toMaterialize){let s=(0,Qu.join)(this.vaultPath,i.folderName);await this.mount.pullAssetSpace(i.httpsUrl,this.ref,s),this.mount.ensureGitmodulesEntry(this.vaultPath,i.folderName,i.httpsUrl),r.push(i.asUid)}return{destroyed:t,materialized:r}}enumerateFilesUnder(e){let t=[],i=[(0,Qu.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,Bc.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Qu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(goe(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,Bc.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let r=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(r===null)return null;try{let i=Dt.load(r[1]);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function goe(n,e){let t=e.endsWith("/")?e:e+"/";return(n.startsWith(t)?n.slice(t.length):n).split("\\").join("/")}a(goe,"relativeVaultPath");function yoe(n){let e=n.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(yoe,"lastSegment");var vr=require("node:fs"),Oj=require("node:crypto"),Pj=require("node:child_process"),Fj=require("node:util"),Er=se(require("node:path"));var nt=se(et());var qo=require("node:fs"),Aj=require("node:crypto"),Ei=se(require("node:path"));var Ti=se(et());var Ej=require("node:child_process"),Tj=se(et());var boe=6e4,Ws=class n{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,Ej.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),r;try{r=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(n.PAT_REGEX,"***REDACTED***"))}let i=r.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(n.PAT_REGEX,"***REDACTED***")}async push(e,t,r,i,s){return(0,Tj.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:r,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,r=a(i=>this.redact(i),"redact");return async i=>{let s={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(boe)})}catch(u){throw new Error(r(`GitHub request failed: ${_oe(u)}`))}let c=await o.text().catch(()=>"");if(o.status<200||o.status>=300)throw new Error(Soe(r(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${c}`),512));let l;try{l=c.length>0?JSON.parse(c):void 0}catch{l=void 0}return{status:o.status,json:l,text:c}}}};function _oe(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}a(_oe,"errMsg");function Soe(n,e){return n.length>e?n.slice(0,e)+"...":n}a(Soe,"truncate");var woe=a(async n=>{let e=await Aj.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),voe={parse:a(n=>Dt.load(n,{schema:Dt.CORE_SCHEMA}),"parse"),stringify:a(n=>Dt.dump(n,{schema:Dt.CORE_SCHEMA,lineWidth:-1}),"stringify")};function Eoe(n,e){if(n.tokenFromGh===!0)return Ws.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(Eoe,"resolveToken");function Toe(n){let e=a(r=>Ei.join(n,r),"abs"),t=a(async(r,i)=>{let s;try{s=await qo.promises.readdir(r,{withFileTypes:!0})}catch{return}for(let o of s){let c=Ei.join(r,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Ei.relative(n,c).split(Ei.sep).join("/"))}},"walk");return{async list(){let r=[];return(0,qo.existsSync)(n)&&await t(n,r),r},read:a(r=>qo.promises.readFile(e(r),"utf-8"),"read"),async readBinary(r){return new Uint8Array(await qo.promises.readFile(e(r)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(Toe,"nodeLocalFilesPort");function Xu(n){let e=new Xt(n),t=new Ti.SpaceSpecAccumulator;for(let r of e.getAllFiles()){let i=e.getFrontmatter(r);if(!i)continue;let s=(0,Ti.classifySpaceDeclaration)(i,r.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,qo.existsSync)(Ei.join(n,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(Xu,"collectVaultSpecs");function Aoe(n,e){for(let t of n.repos){let r=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${r}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,Ti.summarizeParityRound)(n))}a(Aoe,"printHumanReport");async function Ioe(n,e={}){let t=e.out??(g=>console.log(g)),r=Ei.resolve(n.vault);if(!(0,qo.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let i=Eoe(n,e),s=new Ws({token:i,...n.apiBase!==void 0?{apiBase:n.apiBase}:{}}),o=e.transportFactory?.(i,n.apiBase)??s.transport(),{specs:c,warnings:l}=Xu(r);for(let g of l)t(`warn: ${g}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=n.configDir??".obsidian",f=Ei.join(r,u,"plugins","exocortex",Ti.WATERMARK_STORE_FILENAME),d=new Ti.FileWatermarkStore({read:a(async()=>{try{return await qo.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),h=new Ti.ParityValidator({transport:o,sha1:woe,localFilesFor:a(g=>Toe(Ei.join(r,g.localPath)),"localFilesFor"),watermarks:{get:a(g=>d.get(g),"get")},yaml:voe,redact:a(g=>s.redact(g),"redact"),...n.apiBase!==void 0?{baseURL:n.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${r}`);let p=await h.runRound(c,{trigger:"standalone"});return n.json===!0?t(JSON.stringify(p,null,2)):Aoe(p,t),p.vacuous?2:p.ok?0:1}a(Ioe,"runExosyncParity");function Ij(){return new Se("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async n=>{try{process.exitCode=await Ioe(n)}catch(e){ce.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(Ij,"exosyncParityCommand");var Kn=require("node:fs"),rI=require("node:crypto"),Rn=se(require("node:path")),Cn=se(et());var xoe="exosync-watermarks.local.json";function Rj(n,e,t){let r=sI(e,t),i=new Ws({token:r,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(r,e.apiBase)??i.transport(),{specs:o,warnings:c}=Xu(n),l=e.configDir??".obsidian",u=Rn.join(n,l,"plugins","exocortex",xoe),f=Rn.join(n,l,"plugins","exocortex",Cn.CONFLICT_CACHE_STORE_FILENAME),d=new Cn.LocalConflictCacheStore({io:Go(f)}),h=Rn.join(n,l,"plugins","exocortex",Cn.OUTBOX_STORE_FILENAME),p=new Cn.LocalOutboxStore({io:Go(h)});return{resolver:new Cn.QuarantineResolver({transport:s,watermarkStore:new Cn.FileWatermarkStore(Go(u)),localFilesFor:a(y=>gb(Rn.join(n,y.localPath)),"localFilesFor"),sha1:iI,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(y=>i.redact(y),"redact"),conflictCache:d,outbox:p}),specs:o,warnings:c}}a(Rj,"buildResolver");async function Roe(n,e={}){let t=e.out??(l=>console.log(l)),r=Rn.resolve(n.vault);if(!(0,Kn.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let{resolver:i,specs:s,warnings:o}=Rj(r,n,e);for(let l of o)t(`warn: ${l}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let c=await i.listOpenConflicts(s);if(n.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),0;t(`${c.length} open conflict(s):`);for(let l of c){let u=`${l.hasLocal?"local":"(no local)"} vs ${l.hasRemote?"remote":"(no remote)"}`;t(` ${l.repoKey} ${l.path} [${u}]${l.uid?` uid=${l.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file <path> --vault <vault>"),0}a(Roe,"runQuarantineList");async function Coe(n,e,t={}){let r=t.out??(b=>console.log(b)),i=Rn.resolve(e.vault);if(!(0,Kn.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await Kn.promises.readFile(Rn.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=Rj(i,e,t);for(let b of u)r(`warn: ${b}`);let d=(await c.listOpenConflicts(l)).filter(b=>b.path===n&&(e.repo===void 0||b.repoKey===e.repo));if(d.length===0)return r(`No open conflict for "${n}"${e.repo?` in ${e.repo}`:""} \u2014 run \`exosync quarantine list\` to see the current set.`),1;if(d.length>1){r(`"${n}" conflicts in ${d.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let b of d)r(` --repo ${b.repoKey}`);return 1}let h=d[0],p=l.find(b=>b.repoKey===h.repoKey),g=await c.resolve(p,h.path,o),y=g.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":g.pushedSha!==void 0?` \u2014 pushed @${g.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return r(`Resolved ${h.path} (${g.resolvedTo}) in ${h.repoKey}${y}.`),g.discardedLocalBackupPath!==void 0&&r(` \u21B3 your discarded local version is preserved at ${p.localPath}/${g.discardedLocalBackupPath}`),0}a(Coe,"runQuarantineResolve");function xj(n,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(n);if(t===null)return n;let r=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return r===t[2]?n:n.slice(0,t.index)+t[1]+r+t[3]+n.slice(t.index+t[0].length)}a(xj,"rewriteUid");function nI(n){return n.replace(/\r\n?/g,`
|
|
597
|
+
`).replace(/\n+$/,"")}a(nI,"normalizeForCompare");function Ooe(n,e,t){let r=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of r){let c=nI(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:n}):s.push({action:"reuuid",path:o.path,fromUid:n,toUid:t()})}return s}a(Ooe,"planDedupGroup");async function Poe(n,e={}){let t=e.out??(f=>console.log(f)),r=Rn.resolve(n.vault);if(!(0,Kn.existsSync)(r))throw new Error(`Vault path does not exist: ${r}`);let{specs:i,warnings:s}=Xu(r);for(let f of s)t(`warn: ${f}`);let o=new Map;for(let f of i){let d=Rn.join(r,f.localPath);if(!(0,Kn.existsSync)(d))continue;let h=gb(d);for(let p of await h.list()){if(!p.endsWith(".md"))continue;let g;try{g=await h.read(p)}catch{continue}let y=(0,Cn.extractAssetUid)(g);if(y===void 0)continue;let b=Rn.join(d,p),S=o.get(y)??[];S.push(b),o.set(y,S)}}let c=[...o.entries()].filter(([,f])=>f.length>1).sort(([f],[d])=>f.localeCompare(d));if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>Rn.relative(r,f),"rel");if(n.auto===!0){let f=[];for(let[b,S]of c){let v=[],I=new Map;for(let A of S){let T=await Kn.promises.readFile(A,"utf-8");v.push({path:A,content:T}),I.set(A,T)}f.push({uid:b,decisions:Ooe(b,v,rI.randomUUID),snap:I})}let d=0,h=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:b,decisions:S}of f){t(` ${b}:`);for(let v of S)v.action==="keep"?t(` KEEP ${l(v.path)} (keeps uid ${b})`):v.action==="reuuid"?(h++,t(` RE-UUID ${l(v.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(v.path)} (identical content \u2192 ${l(v.identicalTo)}; zero-loss)`))}if(n.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${h} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let p=0,g=0,y=0;for(let{decisions:b,snap:S}of f){for(let v of b){if(v.action!=="delete")continue;let I;try{I=await Kn.promises.readFile(v.path,"utf-8")}catch{continue}if(nI(I)!==nI(S.get(v.path)??"")){t(` ! skipped delete ${l(v.path)} (changed since scan \u2014 re-run dedup-uids)`),y++;continue}await Kn.promises.rm(v.path,{force:!0}),t(` deleted ${l(v.path)} (identical to ${l(v.identicalTo)})`),p++}for(let v of b){if(v.action!=="reuuid")continue;let I;try{I=await Kn.promises.readFile(v.path,"utf-8")}catch{continue}if((0,Cn.extractAssetUid)(I)!==v.fromUid){t(` ! skipped re-uuid ${l(v.path)} (uid changed since scan \u2014 re-run dedup-uids)`),y++;continue}let A=xj(I,v.toUid);A!==I&&(await Kn.promises.writeFile(v.path,A,"utf-8"),t(` re-uuid ${l(v.path)} \u2192 uid=${v.toUid} (content differs from kept copy)`),g++)}}return t(`Resolved: deleted ${p} identical copy(ies), re-uuid ${g} differing variant(s).${y>0?` ${y} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),y>0?1:0}n.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let h of d)t(` ${l(h)}`)}if(n.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let[,f]of c){let d=[...f].sort((h,p)=>h.localeCompare(p));for(let h of d.slice(1)){let p=await Kn.promises.readFile(h,"utf-8"),g=(0,rI.randomUUID)(),y=xj(p,g);y!==p&&(await Kn.promises.writeFile(h,y,"utf-8"),t(` fixed ${Rn.relative(r,h)} \u2192 uid=${g}`),u++)}}return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(Poe,"runDedupUids");function tI(n){return n.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(tI,"withQuarantineOptions");function Cj(n){let e=new Se("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");tI(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await Roe(t)}catch(r){ce.handle(r,{command:"exosync quarantine list"}),process.exitCode=1}}),tI(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,r)=>{try{process.exitCode=await Coe(t,r)}catch(i){ce.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),n.addCommand(e),tI(n.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await Poe(t)}catch(r){ce.handle(r,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(Cj,"registerQuarantineCommands");var iI=a(async n=>{let e=await Oj.webcrypto.subtle.digest("SHA-1",n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),Foe={parse:a(n=>Dt.load(n,{schema:Dt.CORE_SCHEMA}),"parse"),stringify:a(n=>Dt.dump(n,{schema:Dt.CORE_SCHEMA,lineWidth:-1}),"stringify")};function sI(n,e){if(n.tokenFromGh===!0)return Ws.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,r=n.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(r.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return r}a(sI,"resolveToken");function gb(n){let e=a(i=>Er.join(n,i),"abs"),t=a(async(i,s)=>{let o;try{o=await vr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Er.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Er.relative(n,l).split(Er.sep).join("/"))}},"walk"),r=a(async(i,s)=>{let o=Er.dirname(i);await vr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await vr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,vr.existsSync)(n)&&await t(n,i),i},read:a(i=>vr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await r(e(i),o=>vr.promises.writeFile(o,s,"utf-8"))},async delete(i){await vr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await vr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await r(e(i),c=>vr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await vr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(gb,"nodeLocalFilesPort");function Go(n){return{async read(){try{return await vr.promises.readFile(n,"utf-8")}catch{return null}},async writeAtomic(e){await vr.promises.mkdir(Er.dirname(n),{recursive:!0});let t=`${n}.local.tmp`;await vr.promises.writeFile(t,e,"utf-8"),await vr.promises.rename(t,n)}}}a(Go,"nodeWatermarkFileIO");function Vc(n,e=".obsidian"){let t=Er.join(n,e,"plugins","exocortex",nt.MOUNT_BASE_STORE_FILENAME);return new nt.FileMountBaseStore(Go(t))}a(Vc,"nodeMountBaseStore");var Doe=(0,Fj.promisify)(Pj.execFile);function Loe(n){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await Doe("git",["-C",n,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304}),r=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return r?r[1]:null}catch{return null}}}a(Loe,"nodeLocalBaseShaProvider");function Noe(n){return{async check(e){let t=Er.join(n,e.localPath);if(!(0,vr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let r=0;try{r=(await vr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return r===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(Noe,"nodeMaterializationCheck");function koe(n,e){let t=n.pushedSha!==void 0?` \u2192@${n.pushedSha.slice(0,7)}`:"",r=(n.outboxPushedCount??0)>0?`, pushed ${n.outboxPushedCount} resolved`:"",i=(n.outboxReconflictedCount??0)>0?`, ${n.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${n.repoKey}${t}: ${n.status} \u2014 pulled ${n.pulledCount}, pushed ${n.pushedCount}, merged ${n.mergedCount}, quarantined ${n.quarantinedCount}${(n.pushedDeletes?.length??0)>0?`, deleted ${n.pushedDeletes.length}`:""}${r}${i}`),n.detail!==void 0&&e(` ${n.detail}`);for(let s of n.warnings)e(` warn: ${s}`);(n.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${n.quarantinedPaths.join(", ")}`),(n.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${n.deferredPaths.join(", ")}`),(n.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${n.deferredDeletes.join(", ")}`),n.timings!==void 0&&(0,nt.totalMs)(n.timings)>0&&e(` ${(0,nt.formatRepoTimings)(n.repoKey,n.timings)}`)}a(koe,"printRepoResult");function Moe(n){return n==="conflict"||n==="full-conflict"||n==="retry-exhausted"||n==="busy"||n==="auth-required"||n==="error"}a(Moe,"isFailureStatus");async function joe(n,e,t={}){let r=t.out??(T=>console.log(T)),i=Er.resolve(e.vault);if(!(0,vr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=sI(e,t),o=new Ws({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Xu(i);for(let T of u)r(`warn: ${T}`);if(l.length===0)return r("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let f=e.configDir??".obsidian",d=Er.join(i,f,"plugins","exocortex",nt.WATERMARK_STORE_FILENAME),h=Er.join(i,f,"plugins","exocortex",nt.LOCAL_MANIFEST_STORE_FILENAME),p=Er.join(i,f,"plugins","exocortex",nt.CONFLICT_CACHE_STORE_FILENAME),g=new nt.LocalConflictCacheStore({io:Go(p)}),y=Er.join(i,f,"plugins","exocortex",nt.OUTBOX_STORE_FILENAME),b=new nt.LocalOutboxStore({io:Go(y)}),S=g,v=new nt.SyncEngine({transport:c,watermarkStore:new nt.FileWatermarkStore(Go(d)),localManifestStore:new nt.FileLocalManifestStore(Go(h)),mountBaseStore:Vc(i,f),localBaseShaProvider:Loe(i),materializationCheck:Noe(i),localFilesFor:a(T=>gb(Er.join(i,T.localPath)),"localFilesFor"),sha1:iI,redact:a(T=>o.redact(T),"redact"),commitMessage:a((T,R,B=0)=>`exosync: ${R} change(s)${B>0?`, ${B} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new nt.GatedStructuredMerger(new nt.StructuredMerger(Foe)),quarantine:S,outbox:b,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});r(`ExoSync ${n}: ${l.length} repo(s), vault ${i}`);let I=(0,nt.orderChildrenFirst)(l),A=await v.syncAll(I,n);if(e.json===!0)r(JSON.stringify(A,null,2));else{for(let B of A)koe(B,r);let T=A.reduce((B,L)=>({pulled:B.pulled+L.pulledCount,pushed:B.pushed+L.pushedCount,merged:B.merged+L.mergedCount,quarantined:B.quarantined+L.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0});r(`Summary: ${A.length} repo(s) \u2014 pulled ${T.pulled}, pushed ${T.pushed}, merged ${T.merged}, quarantined ${T.quarantined}`);let R=(0,nt.aggregateTimings)(A);(0,nt.totalMs)(R)>0&&r((0,nt.formatTimingsLine)(R))}return A.some(T=>Moe(T.status))?1:0}a(joe,"runExosyncSync");function oI(n){return n.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)")}a(oI,"withSyncOptions");function aI(n){return async e=>{try{process.exitCode=await joe(n,e)}catch(t){ce.handle(t,{command:`exosync ${n}`}),process.exitCode=1}}}a(aI,"makeDirectionAction");function Dj(){let n=new Se("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return oI(n.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(aI("sync")),oI(n.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(aI("pull")),oI(n.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(aI("push")),Cj(n),n}a(Dj,"exosyncCommand");var $oe=a(n=>{process.stderr.write(`${n}
|
|
598
598
|
`)},"DEFAULT_LOG"),yb=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??$oe}async confirmApply(e){if(this.verbose){let t=Array.from(e.filesToDestroy.values()).reduce((r,i)=>r+i.length,0);this.log(`[apply-profile] Target: ${e.targetProfileLabel} (${e.targetProfileUid})`),this.log(`[apply-profile] Source: ${e.sourceProfileLabel}`),this.log(`[apply-profile] ${t} files to remove, ${e.assetSpacesBeingTornDown.length} AS to tear down, ${e.assetSpacesBeingMaterialized.length} AS to materialize`)}return this.yes?!0:(this.log("[apply-profile] Refused: --yes flag required for headless mode (Decision #2 safety)."),!1)}};async function Uoe(n,e,t={}){let r=[],i=[],s=t.out??(R=>process.stdout.write(`${R}
|
|
599
599
|
`)),o=t.err??(R=>process.stderr.write(`${R}
|
|
600
|
-
`)),c=a(R=>{r.push(R),s(R)},"out"),l=a(R=>{i.push(R),o(R)},"err");if(!e.vault)throw new tt("--vault is required");let u=(0,Nj.resolve)(e.vault);if(!(0,Lj.existsSync)(u))throw new qe(u);if(!n||n.length===0)throw new tt("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new pb({vaultPath:u,warn:a(R=>l(R),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new tt(`Profile not found: ${n}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:r,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:r,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:r,stderr:i};let h=d.result,p=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,g=t.applyServiceFactory?.(e,u)??new Yu({vaultPath:u,ref:e.ref??"main",mount:new
|
|
600
|
+
`)),c=a(R=>{r.push(R),s(R)},"out"),l=a(R=>{i.push(R),o(R)},"err");if(!e.vault)throw new tt("--vault is required");let u=(0,Nj.resolve)(e.vault);if(!(0,Lj.existsSync)(u))throw new qe(u);if(!n||n.length===0)throw new tt("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new pb({vaultPath:u,warn:a(R=>l(R),"warn")})).resolveFilter(n);if(d.outcome==="missing-profile")throw new tt(`Profile not found: ${n}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:r,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:r,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:r,stderr:i};let h=d.result,p=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,g=t.applyServiceFactory?.(e,u)??new Yu({vaultPath:u,ref:e.ref??"main",mount:new zn({token:p,mountBaseStore:Vc(u)})}),{infos:y,profileLabels:b}=g.scanVault(),S=b.get(n)??n,v;try{v=g.buildDiff({targetProfileUid:n,targetProfileLabel:S,sourceProfileUid:null,sourceProfileLabel:"<unknown>",result:h,infos:y})}catch(R){if(R instanceof vi.TsFloorViolationError)return l(`[apply-profile] Refused: ${R.message}`),{exitCode:5,stdout:r,stderr:i};throw R}if(!await(t.confirmGate??new yb({yes:e.yes??!1,verbose:e.verbose??!1,log:a(R=>l(R),"log")})).confirmApply(v.plan))return{exitCode:0,stdout:r,stderr:i};if(v.toDestroy.length===0&&v.toMaterialize.length===0)return c(`[apply-profile] Already in target mount-state for ${S} \u2014 no-op.`),{exitCode:0,stdout:r,stderr:i};let T;try{T=await g.execute(v)}catch(R){return l(`[apply-profile] Execution failed: ${R instanceof Error?R.message:String(R)}`),{exitCode:5,stdout:r,stderr:i}}return c(`[apply-profile] Switched to ${S}: ${T.destroyed.length} AssetSpace(s) torn down, ${T.materialized.length} materialized.`),{exitCode:0,stdout:r,stderr:i}}a(Uoe,"runApplyProfile");function kj(){return new Se("apply-profile").description("Apply the specified Profile (mount-state filesystem mutation). Requires --yes for headless mode.").argument("<profile-uid>","Target Profile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm apply (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).option("--ref <branch>","Git ref to pull when materialising AssetSpaces","main").option("--token <pat>","GitHub PAT for private-repo materialisation (or env GITHUB_TOKEN / GH_TOKEN)").action(async(e,t)=>{try{let r=await Uoe(e,t);process.exit(r.exitCode)}catch(r){ce.handle(r)}})}a(kj,"applyProfileCommand");var Ju=require("node:path"),qc=require("node:fs"),Mj=se(et());function jj(){return new Se("bootstrap").description("Bootstrap a vault with the SDK floor AssetSpace (exo). Pulls a tarball from a public GitHub repo, extracts \u043A assetspaces/, writes .gitmodules. Only --exo is required \u2014 bootstrap installs only the SDK platform. exocmd (the optional UI-command library) and any other AssetSpace are added afterwards via `exocortex assetspace add`. Example URL: https://github.com/kitelev/exoas-exo.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--exo <url>","Public GitHub URL \u0434\u043B\u044F exo TBox AssetSpace (e.g. https://github.com/kitelev/exoas-exo)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async n=>{try{if(!n.vault)throw new tt("--vault is required");let e=(0,Ju.resolve)(n.vault);(0,qc.mkdirSync)(e,{recursive:!0});let t=(0,Ju.join)(e,".gitmodules"),r=(0,Ju.join)(e,"assetspaces");if((0,qc.existsSync)(t))throw new tt(`Vault ${e} already has .gitmodules \u2014 refusing \u043A re-bootstrap. Use \`assetspace add\` \u0434\u043B\u044F individual AS.`);if((0,qc.existsSync)(r)&&(0,qc.readdirSync)(r).length>0)throw new tt(`Vault ${e}/assetspaces/ already has content \u2014 refusing \u043A re-bootstrap.`);let i=n.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,s=new zn({token:i,mountBaseStore:Vc(e)}),o=n.ref??"main",c=[],l=(0,Mj.derivePath)(n.exo)??"assetspaces/exo",u=(0,Ju.join)(e,l);process.stderr.write(`[bootstrap] Pulling ${n.exo}@${o} \u2192 ${l}/...
|
|
601
601
|
`);let f=await s.pullAssetSpace(n.exo,o,u);if(s.ensureGitmodulesEntry(e,l,n.exo),c.push({folder:l,url:n.exo,sha:f.sha,fileCount:f.fileCount}),n.json)process.stdout.write(JSON.stringify({vault:e,materialized:c},null,2)+`
|
|
602
602
|
`);else{process.stdout.write(`
|
|
603
603
|
\u2713 Bootstrap complete
|
|
@@ -609,7 +609,7 @@ Next steps:
|
|
|
609
609
|
`),process.stdout.write(` 2. git add . && git commit -m "feat: bootstrap vault"
|
|
610
610
|
`),process.stdout.write(` 3. (optional) Add the exocmd UI-command library: \`exocortex assetspace add --vault ${e} --url https://github.com/kitelev/exoas-exocmd\`
|
|
611
611
|
`),process.stdout.write(` 4. Add additional AssetSpaces via \`exocortex assetspace add --vault ${e} --url <github-url>\`
|
|
612
|
-
`)}process.exit(0)}catch(e){ce.handle(e)}})}a(jj,"bootstrapCommand");var bb=require("node:path"),$j=require("node:fs"),Uj=se(et());function Boe(n,e){return e!==void 0&&e.length>0?`assetspaces/${e}`:(0,Uj.derivePath)(n)??`assetspaces/${
|
|
612
|
+
`)}process.exit(0)}catch(e){ce.handle(e)}})}a(jj,"bootstrapCommand");var bb=require("node:path"),$j=require("node:fs"),Uj=se(et());function Boe(n,e){return e!==void 0&&e.length>0?`assetspaces/${e}`:(0,Uj.derivePath)(n)??`assetspaces/${zn.deriveFolderName(n)}`}a(Boe,"resolveAddAssetSpacePath");function Bj(){return new Se("assetspace-add").description("Phase 6.3: add single AssetSpace \u043A existing vault by public GitHub URL. Pulls tarball, extracts \u043A assetspaces/<folder>/, updates .gitmodules.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--url <url>","Public GitHub URL \u0434\u043B\u044F the AssetSpace (e.g. https://github.com/kitelev/exoas-pmbok-ontology)").option("--folder <name>","Local folder name \u043F\u043E\u0434 assetspaces/. Defaults \u043A URL-derived (strips exoas- prefix)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async n=>{try{if(!n.vault)throw new tt("--vault is required");if(!n.url)throw new tt("--url is required");let e=(0,bb.resolve)(n.vault);if(!(0,$j.existsSync)(e))throw new qe(e);let t=n.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,r=new zn({token:t,mountBaseStore:Vc(e)}),i=n.ref??"main",s=Boe(n.url,n.folder),o=(0,bb.join)(e,s);process.stderr.write(`[assetspace-add] Pulling ${n.url}@${i} \u2192 ${s}/...
|
|
613
613
|
`);let c=await r.pullAssetSpace(n.url,i,o),l=r.ensureGitmodulesEntry(e,s,n.url);n.json?process.stdout.write(JSON.stringify({vault:e,folder:s,url:n.url,sha:c.sha,fileCount:c.fileCount,gitmodulesEntryAdded:l.added},null,2)+`
|
|
614
614
|
`):(process.stdout.write(`
|
|
615
615
|
\u2713 AssetSpace added
|
|
@@ -617,9 +617,9 @@ Next steps:
|
|
|
617
617
|
`),process.stdout.write(` URL: ${n.url}
|
|
618
618
|
`),process.stdout.write(` SHA: ${c.sha} (${c.fileCount} files)
|
|
619
619
|
`),process.stdout.write(` .gitmodules: ${l.added?"entry added":"entry already present"}
|
|
620
|
-
`)),process.exit(0)}catch(e){ce.handle(e)}})}a(Bj,"assetSpaceAddCommand");var _b=require("node:path"),cI=require("node:fs"),Zu=se(et());function Voe(n){if(n.folder!==void 0&&n.folder.length>0)return n.folder.startsWith("assetspaces/")?n.folder:`assetspaces/${n.folder}`;if(n.url!==void 0&&n.url.length>0)return(0,Zu.derivePath)(n.url)??`assetspaces/${
|
|
620
|
+
`)),process.exit(0)}catch(e){ce.handle(e)}})}a(Bj,"assetSpaceAddCommand");var _b=require("node:path"),cI=require("node:fs"),Zu=se(et());function Voe(n){if(n.folder!==void 0&&n.folder.length>0)return n.folder.startsWith("assetspaces/")?n.folder:`assetspaces/${n.folder}`;if(n.url!==void 0&&n.url.length>0)return(0,Zu.derivePath)(n.url)??`assetspaces/${zn.deriveFolderName(n.url)}`;throw new tt("either --folder or --url is required","exocortex assetspace-remove --vault <path> (--folder <mount-path> | --url <url>)")}a(Voe,"resolveRemoveAssetSpacePath");async function qoe(n,e={}){let t=[],r=[],i=a(p=>{t.push(p),(e.out??(g=>process.stdout.write(`${g}
|
|
621
621
|
`)))(p)},"out"),s=a(p=>{r.push(p),(e.err??(g=>process.stderr.write(`${g}
|
|
622
|
-
`)))(p)},"err");if(!n.vault)throw new tt("--vault is required");let o=(0,_b.resolve)(n.vault);if(!(0,cI.existsSync)(o))throw new qe(o);let c=Voe(n),u=(e.scanInfos?.(o)??new Yu({vaultPath:o}).scanVault().infos).find(p=>p.folderName===c);if(u!==void 0&&(0,Zu.isTsFloorAssetSpace)(u.uid,u.namespace)||(0,Zu.isTsFloorMountPath)(c)){let p=u?.label??c,g=u?`${u.namespace||u.uid}`:"path resolves to a floor namespace";return s(`[assetspace-remove] Refused: \xAB${p}\xBB (${g}) is a TS-floor AssetSpace \u2014 unmounting it would self-brick the runtime (R24). Aborted, no changes made.`),{exitCode:5,stdout:t,stderr:r,removed:!1,folder:c}}let d=(0,cI.existsSync)((0,_b.join)(o,c)),h=e.unmount??((p,g)=>new
|
|
622
|
+
`)))(p)},"err");if(!n.vault)throw new tt("--vault is required");let o=(0,_b.resolve)(n.vault);if(!(0,cI.existsSync)(o))throw new qe(o);let c=Voe(n),u=(e.scanInfos?.(o)??new Yu({vaultPath:o}).scanVault().infos).find(p=>p.folderName===c);if(u!==void 0&&(0,Zu.isTsFloorAssetSpace)(u.uid,u.namespace)||(0,Zu.isTsFloorMountPath)(c)){let p=u?.label??c,g=u?`${u.namespace||u.uid}`:"path resolves to a floor namespace";return s(`[assetspace-remove] Refused: \xAB${p}\xBB (${g}) is a TS-floor AssetSpace \u2014 unmounting it would self-brick the runtime (R24). Aborted, no changes made.`),{exitCode:5,stdout:t,stderr:r,removed:!1,folder:c}}let d=(0,cI.existsSync)((0,_b.join)(o,c)),h=e.unmount??((p,g)=>new zn().unmountAssetSpace(p,g));try{h(o,c)}catch(p){return s(`[assetspace-remove] Unmount failed: ${p instanceof Error?p.message:String(p)}`),{exitCode:5,stdout:t,stderr:r,removed:!1,folder:c}}return n.json?i(JSON.stringify({vault:o,folder:c,existedBefore:d,unmounted:!0},null,2)):d?(i(`
|
|
623
623
|
\u2713 AssetSpace unmounted`),i(` Folder: ${c} (removed from vault + .gitmodules)`)):(i(`
|
|
624
624
|
\u2713 AssetSpace already absent \u2014 .gitmodules stanza stripped (no-op)`),i(` Folder: ${c}`)),{exitCode:0,stdout:t,stderr:r,removed:!0,folder:c}}a(qoe,"runAssetSpaceRemove");function Vj(){return new Se("assetspace-remove").description("Unmount a single AssetSpace (inverse of assetspace-add). Strips its .gitmodules stanza and deletes the mount folder. TS-floor AssetSpaces ({exo}) are refused.").requiredOption("--vault <path>","Path to target vault").option("--folder <path>","Vault-relative mount path to unmount (e.g. assetspaces/kitelev/exoas-pmbok-ontology). Takes precedence over --url.").option("--url <url>","Public GitHub URL of the AssetSpace \u2014 derives the canonical mount path (parity with assetspace-add).").option("--json","Emit result as JSON",!1).action(async n=>{try{let e=await qoe(n);process.exit(e.exitCode)}catch(e){ce.handle(e)}})}a(Vj,"assetSpaceRemoveCommand");var Gj=require("node:path"),Wj=require("node:fs");var Sb=se(Lo()),lI=se(require("path"));var vb=se(et());var wb=class{static{a(this,"RegistryDependencyResolver")}constructor(e={}){this.warn=e.warn??(()=>{})}async resolve(e,t){let r=await this.scanRegistry(e),i=this.matchSelf(r,t);if(i===null)return{outcome:"self-not-found",selfIdentifier:t,descriptorCount:r.size};let s=new Map;for(let y of r.values())y.dependsOn.length>0&&s.set(y.uid,y.dependsOn);let o=(0,vb.transitiveDependsOnClosure)([i.uid],s);o.delete(i.uid);let c=[],l=new Set,u=new Set([i.uid]),f=[...i.dependsOn];for(;f.length>0;){let y=f.shift();if(y===void 0||u.has(y))continue;u.add(y),o.has(y)&&!l.has(y)&&(c.push(y),l.add(y));let b=r.get(y);if(b!==void 0)for(let S of b.dependsOn)u.has(S)||f.push(S)}for(let y of o)l.has(y)||(c.push(y),l.add(y));let d=[],h=[];for(let y of c){let b=r.get(y);b===void 0?h.push(y):d.push(b)}let p=d.filter(y=>y.source===null||y.source.length===0),g=d.filter(y=>y.source!==null&&y.source.length>0&&!Goe(y.source));return{outcome:"resolved",self:i,dependencies:d,missingDescriptors:h,sourceless:p,unsafeSources:g}}matchSelf(e,t){let r=qj(t);if(r!==null)for(let i of e.values()){if(i.source===null)continue;let s=qj(i.source);if(s!==null&&s===r)return i}for(let i of e.values())if(i.namespace!==null&&i.namespace===t)return i;return null}async scanRegistry(e){let t=new Map,r=lI.default.resolve(e);if(!await Sb.default.pathExists(r))return this.warn(`[RegistryDependencyResolver] registry path does not exist: ${r}`),t;let i=[r];for(;i.length>0;){let s=i.pop(),o;try{o=await Sb.default.readdir(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=lI.default.join(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||c.name==="node_modules"||c.name===".obsidian"||c.name===".exocortex")continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=await this.tryReadFrontmatter(l);if(u===null||!Bo(u.exo__Instance_class).some(y=>y===vh))continue;let d=u.exo__Asset_uid;if(typeof d!="string"||d.length===0)continue;let h=typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:null,p=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:null,g=Bo(u.exo__AssetSpace_dependsOn);t.has(d)&&this.warn(`[RegistryDependencyResolver] duplicate AssetSpace descriptor for uid=${d} \u2014 last wins (${l})`),t.set(d,{uid:d,namespace:p,source:h,dependsOn:g})}}return t}async tryReadFrontmatter(e){let t;try{t=await Sb.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let r=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(r===null)return null;try{let i=Dt.load(r[1]);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function qj(n){let e=n.trim();if(e.length===0)return null;let t=(0,vb.derivePath)(e);if(t!==null)return t.replace(/^assetspaces\//,"").toLowerCase();if(!e.includes("://")&&!e.includes("@")){let i=e.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").filter(s=>s.length>0);if(i.length===2)return`${i[0]}/${i[1]}`.toLowerCase()}return null}a(qj,"ownerRepoSlug");function Goe(n){return typeof n!="string"||n.length===0||/[\s\x00-\x1f]/.test(n)||n.startsWith("-")||/^(ext|file|fd|ftp|ftps)::/i.test(n)?!1:!!(/^https?:\/\/[^\s]+$/i.test(n)||/^ssh:\/\/[^\s]+$/i.test(n)||/^git:\/\/[^\s]+$/i.test(n)||/^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+:[^\s]+$/.test(n))}a(Goe,"isSafeCloneUrl");async function Woe(n,e={}){let t=e.out??(l=>process.stdout.write(`${l}
|
|
625
625
|
`)),r=e.err??(l=>process.stderr.write(`${l}
|
|
@@ -635,7 +635,7 @@ Duplicate bindings (${n.duplicates.length}) \u2014 uid claimed by >1 test (warni
|
|
|
635
635
|
Skipped floor check for ${n.unknownPriority} requirement(s) with unparseable priority (fail-open).`),n.clean?e==="hard"&&!n.rampReady?console.error(`
|
|
636
636
|
FAIL (hard gate): ramp not ready \u2014 ${n.p0Orphans} P0 requirement(s) unbound`+(n.p0Total===0?" (no P0 requirements found)":"")+"."):console.log(`
|
|
637
637
|
OK: no hard findings (dangling tags + binding-class floor are clean).`):console.error(`
|
|
638
|
-
FAIL: ${n.dangling.length} dangling + ${n.floorViolations.length} floor violation(s) + ${n.activeViolations.length} active-requirement invariant violation(s) + ${n.danglingEvidence.length} dangling evidence link(s).`)}a(cae,"renderText");function lae(n,e,t){return!n.clean||t&&n.orphans.length>0||e==="hard"&&!n.rampReady}a(lae,"isHardFail");function Yj(){return new Se("audit").description("Audit requirement\u2194test traceability: orphans, dangling @req tags, duplicate bindings, binding-class floor, coverage, P0 ramp-readiness").requiredOption("--reqs <path>","Directory tree containing req__Requirement assets (a vault or a reqs assetspace clone)").option("--tests <path>","Test-corpus root scanned for @req:<uid> tags",".").option("--output <type>","Response format: text|json","text").option("--strict","Also exit 1 on orphan requirements",!1).option("--gate <mode>","Gate mode: soft (warn only on hard findings) | hard (also block when the P0 checklist is not ramp-ready)","soft").action(async n=>{let e=n.output??"text";ce.setFormat(e);let t=n.gate==="hard"?"hard":"soft";try{let r=(0,Ma.resolve)(n.reqs);if(!(0,ja.existsSync)(r)||!(0,ja.statSync)(r).isDirectory())throw new qe(r);let i=(0,Ma.resolve)(n.tests??".");if(!(0,ja.existsSync)(i)||!(0,ja.statSync)(i).isDirectory())throw new qe(i);let[s,o]=await Promise.all([nae(r),sae(i)]),c=oae(s,o);e==="json"?console.log(JSON.stringify({...c,gate:t},null,2)):cae(c,t),lae(c,t,n.strict===!0)&&(process.exitCode=1)}catch(r){ce.handle(r)}})}a(Yj,"requirementsAuditCommand");function Xj(){let n=new Se("requirements").description("Requirements-management tooling (RFC 0003): traceability checker");return n.addCommand(Yj()),n}a(Xj,"requirementsCommand");function Ab(n){let e=new Se;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.156.
|
|
638
|
+
FAIL: ${n.dangling.length} dangling + ${n.floorViolations.length} floor violation(s) + ${n.activeViolations.length} active-requirement invariant violation(s) + ${n.danglingEvidence.length} dangling evidence link(s).`)}a(cae,"renderText");function lae(n,e,t){return!n.clean||t&&n.orphans.length>0||e==="hard"&&!n.rampReady}a(lae,"isHardFail");function Yj(){return new Se("audit").description("Audit requirement\u2194test traceability: orphans, dangling @req tags, duplicate bindings, binding-class floor, coverage, P0 ramp-readiness").requiredOption("--reqs <path>","Directory tree containing req__Requirement assets (a vault or a reqs assetspace clone)").option("--tests <path>","Test-corpus root scanned for @req:<uid> tags",".").option("--output <type>","Response format: text|json","text").option("--strict","Also exit 1 on orphan requirements",!1).option("--gate <mode>","Gate mode: soft (warn only on hard findings) | hard (also block when the P0 checklist is not ramp-ready)","soft").action(async n=>{let e=n.output??"text";ce.setFormat(e);let t=n.gate==="hard"?"hard":"soft";try{let r=(0,Ma.resolve)(n.reqs);if(!(0,ja.existsSync)(r)||!(0,ja.statSync)(r).isDirectory())throw new qe(r);let i=(0,Ma.resolve)(n.tests??".");if(!(0,ja.existsSync)(i)||!(0,ja.statSync)(i).isDirectory())throw new qe(i);let[s,o]=await Promise.all([nae(r),sae(i)]),c=oae(s,o);e==="json"?console.log(JSON.stringify({...c,gate:t},null,2)):cae(c,t),lae(c,t,n.strict===!0)&&(process.exitCode=1)}catch(r){ce.handle(r)}})}a(Yj,"requirementsAuditCommand");function Xj(){let n=new Se("requirements").description("Requirements-management tooling (RFC 0003): traceability checker");return n.addCommand(Yj()),n}a(Xj,"requirementsCommand");function Ab(n){let e=new Se;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"16.156.2"),e.addCommand(G4()),e.addCommand(ej()),e.addCommand(BM()),e.addCommand(WM()),e.addCommand(h4()),e.addCommand(HM()),e.addCommand(g4()),e.addCommand(A4()),e.addCommand(x4()),e.addCommand(B4()),e.addCommand(gj()),e.addCommand(_j()),e.addCommand(kj()),e.addCommand(jj()),e.addCommand(Bj()),e.addCommand(Vj()),e.addCommand(Hj()),e.addCommand(Ij()),e.addCommand(Dj()),e.addCommand(Xj()),e}a(Ab,"createProgram");Ab().parse();0&&(module.exports={createProgram});
|
|
639
639
|
/*! Bundled license information:
|
|
640
640
|
|
|
641
641
|
reflect-metadata/Reflect.js:
|