@kitelev/exocortex-cli 15.146.5 → 15.147.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +26 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @kitelev/exocortex-cli v15.146.5
2
+ // @kitelev/exocortex-cli v15.147.0
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -30,7 +30,7 @@ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
30
30
  Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let a;typeof t=="function"?a=t({error:s.error,command:s.command}):a=t,a&&s.write(`${a}
31
31
  `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function T2(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}o(T2,"incrementNodeInspectorPort");function Qy(){if(it.env.NO_COLOR||it.env.FORCE_COLOR==="0"||it.env.FORCE_COLOR==="false")return!1;if(it.env.FORCE_COLOR||it.env.CLICOLOR_FORCE!==void 0)return!0}o(Qy,"useColor");Yy.Command=Hy;Yy.useColor=Qy});var R2=S(qn=>{var{Argument:x2}=qd(),{Command:Ky}=A2(),{CommanderError:gN,InvalidArgumentError:C2}=Eu(),{Help:yN}=By(),{Option:I2}=Wy();qn.program=new Ky;qn.createCommand=n=>new Ky(n);qn.createOption=(n,e)=>new I2(n,e);qn.createArgument=(n,e)=>new x2(n,e);qn.Command=Ky;qn.Option=I2;qn.Argument=x2;qn.Help=yN;qn.CommanderError=gN;qn.InvalidArgumentError=C2;qn.InvalidOptionArgumentError=C2});var Tu=S(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.AssetClass=void 0;var O2;(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"})(O2||(Gd.AssetClass=O2={}))});var _c=S(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.EffortStatus=void 0;var F2;(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"})(F2||(zd.EffortStatus=F2={}))});var Xy=S(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.EFFORT_STATUS_OPTIONS=Wt.STATUS_NAME_TO_WIKILINK=Wt.STATUS_NAME_TO_ENUM=Wt.EFFORT_STATUS_CONFIG=void 0;Wt.normalizeEffortStatus=_N;Wt.isDoneStatus=SN;Wt.isTrashedStatus=vN;Wt.getEffortStatusLabel=bN;var rs=_c();Wt.EFFORT_STATUS_CONFIG=[{name:"Draft",status:rs.EffortStatus.DRAFT,wikilink:"[[ems__EffortStatusDraft]]"},{name:"Backlog",status:rs.EffortStatus.BACKLOG,wikilink:"[[ems__EffortStatusBacklog]]"},{name:"Analysis",status:rs.EffortStatus.ANALYSIS,wikilink:"[[ems__EffortStatusAnalysis]]"},{name:"To Do",status:rs.EffortStatus.TODO,wikilink:"[[ems__EffortStatusToDo]]"},{name:"Doing",status:rs.EffortStatus.DOING,wikilink:"[[ems__EffortStatusDoing]]"},{name:"Done",status:rs.EffortStatus.DONE,wikilink:"[[ems__EffortStatusDone]]"},{name:"Trashed",status:rs.EffortStatus.TRASHED,wikilink:"[[ems__EffortStatusTrashed]]"}];Wt.STATUS_NAME_TO_ENUM=Object.fromEntries(Wt.EFFORT_STATUS_CONFIG.map(n=>[n.name,n.status]));Wt.STATUS_NAME_TO_WIKILINK=Object.fromEntries(Wt.EFFORT_STATUS_CONFIG.map(n=>[n.name,n.wikilink]));Wt.EFFORT_STATUS_OPTIONS=Wt.EFFORT_STATUS_CONFIG.map(n=>({value:n.wikilink,label:n.name}));function _N(n,e=rs.EffortStatus.DRAFT){if(n.startsWith("ems__")){let r=Wt.EFFORT_STATUS_CONFIG.find(i=>i.status===n);return r?r.status:e}return Wt.STATUS_NAME_TO_ENUM[n]??e}o(_N,"normalizeEffortStatus");function SN(n){return n===rs.EffortStatus.DONE}o(SN,"isDoneStatus");function vN(n){return n===rs.EffortStatus.TRASHED}o(vN,"isTrashedStatus");function bN(n){if(!n)return"-";let e=String(n);if(e==="")return"-";for(let r of Wt.EFFORT_STATUS_CONFIG)if(r.wikilink===e||`[[${e}]]`===r.wikilink||r.status===e||r.name===e)return r.name;let t=e.toLowerCase();for(let r of Wt.EFFORT_STATUS_CONFIG)if(r.name.toLowerCase()===t)return r.name;return e}o(bN,"getEffortStatusLabel")});var Sc=S(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.GroundingType=void 0;var D2;(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"})(D2||(Hd.GroundingType=D2={}))});var Jy=S(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CommandBindingStyleProperty=Wn.CommandBindingProperty=Wn.GroundingProperty=Wn.PreconditionProperty=Wn.CommandProperty=void 0;Wn.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"};Wn.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};Wn.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",TARGET_VALUE:"exocmd__Grounding_targetValue",STEPS:"exocmd__Grounding_steps"};Wn.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"};Wn.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 Zy=S(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.STYLE_SOURCE_VALUES=bn.LABEL_CLASS_VALUES=bn.COMMAND_VARIANT_VALUES=void 0;bn.isCommandVariant=wN;bn.isLabelClass=EN;bn.isStyleSource=TN;bn.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);bn.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);bn.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function wN(n){return typeof n=="string"&&bn.COMMAND_VARIANT_VALUES.includes(n)}o(wN,"isCommandVariant");function EN(n){return typeof n=="string"&&bn.LABEL_CLASS_VALUES.includes(n)}o(EN,"isLabelClass");function TN(n){return typeof n=="string"&&bn.STYLE_SOURCE_VALUES.includes(n)}o(TN,"isStyleSource")});var N2=S(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.isCommandFrontmatter=AN;vc.isPreconditionFrontmatter=xN;vc.isGroundingFrontmatter=CN;vc.isCommandBindingFrontmatter=IN;function AN(n){return Qd(n,"exocmd__Command")}o(AN,"isCommandFrontmatter");function xN(n){return Qd(n,"exocmd__Precondition")}o(xN,"isPreconditionFrontmatter");function CN(n){return Qd(n,"exocmd__Grounding")}o(CN,"isGroundingFrontmatter");function IN(n){return Qd(n,"exocmd__CommandBinding")}o(IN,"isCommandBindingFrontmatter");function Qd(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}o(Qd,"hasInstanceClass")});var L2=S(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.hasPosition=RN;Yd.isFixed=PN;function RN(n){return typeof n.x=="number"&&typeof n.y=="number"}o(RN,"hasPosition");function PN(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}o(PN,"isFixed")});var k2=S(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.createEmptyGraphData=ON;Kd.mergeGraphData=FN;function ON(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}o(ON,"createEmptyGraphData");function FN(n,e){let t=new Map,r=new Set,i=[];for(let s of n.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of n.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}for(let s of e.edges){let a=`${s.source}->${s.target}:${s.type}`;r.has(a)||(r.add(a),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}o(FN,"mergeGraphData")});var e0=S(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.createEdgeId=DN;Xd.edgesEqual=NN;function DN(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}o(DN,"createEdgeId");function NN(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}o(NN,"edgesEqual")});var t0=S($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.BUILT_IN_EDGE_STYLES=$t.BUILT_IN_NODE_STYLES=$t.DEFAULT_EDGE_STYLE=$t.DEFAULT_NODE_STYLE=$t.RDF_TYPE_PREDICATES=void 0;$t.mergeNodeStyles=LN;$t.mergeEdgeStyles=kN;$t.extractLocalName=MN;$t.isClassType=jN;$t.isTypePredicate=$N;$t.isSubClassPredicate=BN;$t.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"};$t.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};$t.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};$t.BUILT_IN_NODE_STYLES={"http://www.w3.org/2000/01/rdf-schema#Class":{color:"#f59e0b",shape:"diamond",size:40},"http://www.w3.org/2002/07/owl#Class":{color:"#f59e0b",shape:"diamond",size:40},ems__Task:{color:"#22c55e",shape:"circle"},ems__Project:{color:"#3b82f6",shape:"square"},ems__Area:{color:"#8b5cf6",shape:"hexagon",size:40},ems__Meeting:{color:"#ec4899",shape:"circle"},exo__Class:{color:"#f59e0b",shape:"diamond"},ims__Person:{color:"#06b6d4",shape:"circle"}};$t.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 LN(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(LN,"mergeNodeStyles");function kN(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}o(kN,"mergeEdgeStyles");function MN(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}o(MN,"extractLocalName");function jN(n){return n===$t.RDF_TYPE_PREDICATES.RDFS_CLASS||n===$t.RDF_TYPE_PREDICATES.OWL_CLASS}o(jN,"isClassType");function $N(n){return n===$t.RDF_TYPE_PREDICATES.RDF_TYPE}o($N,"isTypePredicate");function BN(n){return n===$t.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}o(BN,"isSubClassPredicate")});var j2=S(M2=>{"use strict";Object.defineProperty(M2,"__esModule",{value:!0})});var Ce=S(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.IRI=void 0;var r0=class n{static{o(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!n.isValidIRI(t))throw new Error("Invalid IRI format");this._value=t}get value(){return this._value}equals(e){return this._value===e._value}toString(){return this._value}static isValidIRI(e){if(!e||e.trim().length===0||/\s/.test(e)||!/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=["http","https","ftp","ftps","file","mailto","tel","data","ws","wss","urn","obsidian"],i=e.match(/^([a-z][a-z0-9+.-]*?):/i);if(i){let s=i[1].toLowerCase();if(!r.includes(s))return!1}try{return new URL(e),!0}catch{return/^urn:[a-z0-9][a-z0-9-]{0,31}:[^\s]+$/i.test(e)}}};Jd.IRI=r0});var je=S(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Literal=void 0;ho.parseLanguageTag=$2;ho.createDirectionalLiteral=UN;ho.createLiteralFromLanguageTag=qN;var VN="http://www.w3.org/2001/XMLSchema#string",Au=class{static{o(this,"Literal")}constructor(e,t,r,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&r)throw new Error("Literal cannot have both datatype and language tag");if(i&&!r)throw new Error("Literal cannot have direction without language tag");if(i&&i!=="ltr"&&i!=="rtl")throw new Error('Direction must be "ltr" or "rtl"');this._value=e,this._datatype=t,this._language=r?r.toLowerCase():void 0,this._direction=i}get value(){return this._value}get datatype(){return this._datatype}get language(){return this._language}get direction(){return this._direction}hasDirection(){return this._direction!==void 0}equals(e){if(this._value!==e._value||this._language!==e._language||this._direction!==e._direction)return!1;let t=this.normalizedDatatype(),r=e.normalizedDatatype();return t===r}normalizedDatatype(){return!this._datatype||this._datatype.value===VN?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}};ho.Literal=Au;function $2(n){let t=n.lastIndexOf("--");if(t===-1)return{language:n.toLowerCase()};let r=n.substring(t+2),i=n.substring(0,t);return r==="ltr"||r==="rtl"?{language:i.toLowerCase(),direction:r}:{language:n.toLowerCase()}}o($2,"parseLanguageTag");function UN(n,e,t){return new Au(n,void 0,e,t)}o(UN,"createDirectionalLiteral");function qN(n,e){let{language:t,direction:r}=$2(e);return new Au(n,void 0,t,r)}o(qN,"createLiteralFromLanguageTag")});var Gt=S(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.BlankNode=void 0;var Zd=class n{static{o(this,"BlankNode")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("BlankNode id cannot be empty");this._id=t}get id(){return this._id}equals(e){return this._id===e._id}toString(){return`_:${this._id}`}static generateId(){return`b${++n.counter}`}static create(){return new n(n.generateId())}};eh.BlankNode=Zd;Zd.counter=0});var Rr=S(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.Namespace=void 0;var B2=Ce(),ft=class{static{o(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new B2.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new B2.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)}};th.Namespace=ft;ft.RDF=new ft("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");ft.RDFS=new ft("rdfs","http://www.w3.org/2000/01/rdf-schema#");ft.OWL=new ft("owl","http://www.w3.org/2002/07/owl#");ft.XSD=new ft("xsd","http://www.w3.org/2001/XMLSchema#");ft.EXO=new ft("exo","https://exocortex.my/ontology/exo#");ft.EMS=new ft("ems","https://exocortex.my/ontology/ems#");ft.EXOCMD=new ft("exocmd","https://exocortex.my/ontology/exocmd#");ft.IMS=new ft("ims","https://exocortex.my/ontology/ims#");ft.ZTLK=new ft("ztlk","https://exocortex.my/ontology/ztlk#");ft.PTMS=new ft("ptms","https://exocortex.my/ontology/ptms#");ft.LIT=new ft("lit","https://exocortex.my/ontology/lit#");ft.INBOX=new ft("inbox","https://exocortex.my/ontology/inbox#");ft.PMBOK=new ft("pmbok","https://exocortex.my/ontology/pmbok#")});var oi=S(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.Triple=void 0;var n0=Ce(),i0=je(),s0=Gt(),a0=class{static{o(this,"Triple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof n0.IRI&&t instanceof n0.IRI||e instanceof s0.BlankNode&&t instanceof s0.BlankNode||e instanceof i0.Literal&&t instanceof i0.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 n0.IRI?`<${e.value}>`:e instanceof s0.BlankNode||e instanceof i0.Literal||this.isQuotedTriple(e)?e.toString():""}};rh.Triple=a0});var xu=S(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.QuotedTriple=void 0;var o0=Ce(),c0=je(),l0=Gt(),u0=class n{static{o(this,"QuotedTriple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof o0.IRI&&t instanceof o0.IRI||e instanceof l0.BlankNode&&t instanceof l0.BlankNode||e instanceof c0.Literal&&t instanceof c0.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 o0.IRI?`<${e.value}>`:e instanceof l0.BlankNode||e instanceof c0.Literal||e instanceof n?e.toString():""}};nh.QuotedTriple=u0});var V2=S(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.QuotedTriple=Xt.Triple=Xt.Namespace=Xt.BlankNode=Xt.createLiteralFromLanguageTag=Xt.createDirectionalLiteral=Xt.parseLanguageTag=Xt.Literal=Xt.IRI=void 0;var WN=Ce();Object.defineProperty(Xt,"IRI",{enumerable:!0,get:o(function(){return WN.IRI},"get")});var ih=je();Object.defineProperty(Xt,"Literal",{enumerable:!0,get:o(function(){return ih.Literal},"get")});Object.defineProperty(Xt,"parseLanguageTag",{enumerable:!0,get:o(function(){return ih.parseLanguageTag},"get")});Object.defineProperty(Xt,"createDirectionalLiteral",{enumerable:!0,get:o(function(){return ih.createDirectionalLiteral},"get")});Object.defineProperty(Xt,"createLiteralFromLanguageTag",{enumerable:!0,get:o(function(){return ih.createLiteralFromLanguageTag},"get")});var GN=Gt();Object.defineProperty(Xt,"BlankNode",{enumerable:!0,get:o(function(){return GN.BlankNode},"get")});var zN=Rr();Object.defineProperty(Xt,"Namespace",{enumerable:!0,get:o(function(){return zN.Namespace},"get")});var HN=oi();Object.defineProperty(Xt,"Triple",{enumerable:!0,get:o(function(){return HN.Triple},"get")});var QN=xu();Object.defineProperty(Xt,"QuotedTriple",{enumerable:!0,get:o(function(){return QN.QuotedTriple},"get")})});var sh=S(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.UUID_URL_NAMESPACE=zn.DEFAULT_LANGUAGE_TAG=zn.REQUIRED_PROPERTIES=zn.ALLOWED_PROPERTIES=zn.Exo003MetadataType=void 0;var Gn;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(Gn||(zn.Exo003MetadataType=Gn={}));zn.ALLOWED_PROPERTIES={[Gn.Namespace]:["metadata","uri","aliases"],[Gn.Anchor]:["metadata","uri","aliases"],[Gn.BlankNode]:["metadata","uri","aliases"],[Gn.Statement]:["metadata","subject","predicate","object","aliases"],[Gn.Body]:["metadata","subject","predicate","aliases"]};zn.REQUIRED_PROPERTIES={[Gn.Namespace]:["metadata","uri"],[Gn.Anchor]:["metadata","uri"],[Gn.BlankNode]:["metadata","uri"],[Gn.Statement]:["metadata","subject","predicate","object"],[Gn.Body]:["metadata","subject","predicate"]};zn.DEFAULT_LANGUAGE_TAG="ru";zn.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var U2=S(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var q2=S(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.default="00000000-0000-0000-0000-000000000000"});var W2=S(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.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 Cu=S(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var YN=W2();function KN(n){return typeof n=="string"&&YN.default.test(n)}o(KN,"validate");p0.default=KN});var Iu=S(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var XN=Cu();function JN(n){if(!(0,XN.default)(n))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(n.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(n.slice(9,13),16))>>>8,e&255,(e=parseInt(n.slice(14,18),16))>>>8,e&255,(e=parseInt(n.slice(19,23),16))>>>8,e&255,(e=parseInt(n.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}o(JN,"parse");m0.default=JN});var ks=S(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.unsafeStringify=void 0;var ZN=Cu(),Pr=[];for(let n=0;n<256;++n)Pr.push((n+256).toString(16).slice(1));function G2(n,e=0){return(Pr[n[e+0]]+Pr[n[e+1]]+Pr[n[e+2]]+Pr[n[e+3]]+"-"+Pr[n[e+4]]+Pr[n[e+5]]+"-"+Pr[n[e+6]]+Pr[n[e+7]]+"-"+Pr[n[e+8]]+Pr[n[e+9]]+"-"+Pr[n[e+10]]+Pr[n[e+11]]+Pr[n[e+12]]+Pr[n[e+13]]+Pr[n[e+14]]+Pr[n[e+15]]).toLowerCase()}o(G2,"unsafeStringify");Ru.unsafeStringify=G2;function eL(n,e=0){let t=G2(n,e);if(!(0,ZN.default)(t))throw TypeError("Stringified UUID is invalid");return t}o(eL,"stringify");Ru.default=eL});var ch=S(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var tL=require("crypto"),oh=new Uint8Array(256),ah=oh.length;function rL(){return ah>oh.length-16&&((0,tL.randomFillSync)(oh),ah=0),oh.slice(ah,ah+=16)}o(rL,"rng");g0.default=rL});var y0=S(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.updateV1State=void 0;var z2=ch(),nL=ks(),Pu={};function iL(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=H2(n.random??n.rng?.()??(0,z2.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),a=(0,z2.default)();Q2(Pu,s,a),r=H2(a,Pu.msecs,Pu.nsecs,i?void 0:Pu.clockseq,i?void 0:Pu.node,e,t)}return e??(0,nL.unsafeStringify)(r)}o(iL,"v1");function Q2(n,e,t){return n.msecs??=-1/0,n.nsecs??=0,e===n.msecs?(n.nsecs++,n.nsecs>=1e4&&(n.node=void 0,n.nsecs=0)):e>n.msecs?n.nsecs=0:e<n.msecs&&(n.node=void 0),n.node||(n.node=t.slice(10,16),n.node[0]|=1,n.clockseq=(t[8]<<8|t[9])&16383),n.msecs=e,n}o(Q2,"updateV1State");Ou.updateV1State=Q2;function H2(n,e,t,r,i,s,a=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),a=0;else if(a<0||a+16>s.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);e??=Date.now(),t??=0,r??=(n[8]<<8|n[9])&16383,i??=n.slice(10,16),e+=122192928e5;let c=((e&268435455)*1e4+t)%4294967296;s[a++]=c>>>24&255,s[a++]=c>>>16&255,s[a++]=c>>>8&255,s[a++]=c&255;let l=e/4294967296*1e4&268435455;s[a++]=l>>>8&255,s[a++]=l&255,s[a++]=l>>>24&15|16,s[a++]=l>>>16&255,s[a++]=r>>>8|128,s[a++]=r&255;for(let u=0;u<6;++u)s[a++]=i[u];return s}o(H2,"v1Bytes");Ou.default=iL});var S0=S(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var sL=Iu(),aL=ks();function oL(n){let e=typeof n=="string"?(0,sL.default)(n):n,t=cL(e);return typeof n=="string"?(0,aL.unsafeStringify)(t):t}o(oL,"v1ToV6");_0.default=oL;function cL(n){return Uint8Array.of((n[6]&15)<<4|n[7]>>4&15,(n[7]&15)<<4|(n[4]&240)>>4,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,(n[1]&15)<<4|(n[2]&240)>>4,96|n[2]&15,n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(cL,"_v1ToV6")});var Y2=S(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var lL=require("crypto");function uL(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,lL.createHash)("md5").update(n).digest()}o(uL,"md5");v0.default=uL});var Fu=S(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.URL=Ms.DNS=Ms.stringToBytes=void 0;var K2=Iu(),fL=ks();function X2(n){n=unescape(encodeURIComponent(n));let e=new Uint8Array(n.length);for(let t=0;t<n.length;++t)e[t]=n.charCodeAt(t);return e}o(X2,"stringToBytes");Ms.stringToBytes=X2;Ms.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ms.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function dL(n,e,t,r,i,s){let a=typeof t=="string"?X2(t):t,c=typeof r=="string"?(0,K2.default)(r):r;if(typeof r=="string"&&(r=(0,K2.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+a.length);if(l.set(c),l.set(a,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){s=s||0;for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,fL.unsafeStringify)(l)}o(dL,"v35");Ms.default=dL});var Z2=S(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.URL=po.DNS=void 0;var hL=Y2(),b0=Fu(),J2=Fu();Object.defineProperty(po,"DNS",{enumerable:!0,get:o(function(){return J2.DNS},"get")});Object.defineProperty(po,"URL",{enumerable:!0,get:o(function(){return J2.URL},"get")});function w0(n,e,t,r){return(0,b0.default)(48,hL.default,n,e,t,r)}o(w0,"v3");w0.DNS=b0.DNS;w0.URL=b0.URL;po.default=w0});var eT=S(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var pL=require("crypto");E0.default={randomUUID:pL.randomUUID}});var rT=S(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var tT=eT(),mL=ch(),gL=ks();function yL(n,e,t){if(tT.default.randomUUID&&!e&&!n)return tT.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,mL.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,gL.unsafeStringify)(r)}o(yL,"v4");T0.default=yL});var nT=S(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var _L=require("crypto");function SL(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,_L.createHash)("sha1").update(n).digest()}o(SL,"sha1");A0.default=SL});var sT=S(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.URL=mo.DNS=void 0;var vL=nT(),x0=Fu(),iT=Fu();Object.defineProperty(mo,"DNS",{enumerable:!0,get:o(function(){return iT.DNS},"get")});Object.defineProperty(mo,"URL",{enumerable:!0,get:o(function(){return iT.URL},"get")});function C0(n,e,t,r){return(0,x0.default)(80,vL.default,n,e,t,r)}o(C0,"v5");C0.DNS=x0.DNS;C0.URL=x0.URL;mo.default=C0});var aT=S(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var bL=ks(),wL=y0(),EL=S0();function TL(n,e,t){n??={},t??=0;let r=(0,wL.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,EL.default)(r),e){for(let i=0;i<16;i++)e[t+i]=r[i];return e}return(0,bL.unsafeStringify)(r)}o(TL,"v6");I0.default=TL});var oT=S(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var AL=Iu(),xL=ks();function CL(n){let e=typeof n=="string"?(0,AL.default)(n):n,t=IL(e);return typeof n=="string"?(0,xL.unsafeStringify)(t):t}o(CL,"v6ToV1");R0.default=CL;function IL(n){return Uint8Array.of((n[3]&15)<<4|n[4]>>4&15,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|n[6]&15,n[7],(n[1]&15)<<4|(n[2]&240)>>4,(n[2]&15)<<4|(n[3]&240)>>4,16|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}o(IL,"_v6ToV1")});var fT=S(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.updateV7State=void 0;var cT=ch(),RL=ks(),P0={};function PL(n,e,t){let r;if(n)r=lT(n.random??n.rng?.()??(0,cT.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,cT.default)();uT(P0,i,s),r=lT(s,P0.msecs,P0.seq,e,t)}return e??(0,RL.unsafeStringify)(r)}o(PL,"v7");function uT(n,e,t){return n.msecs??=-1/0,n.seq??=0,e>n.msecs?(n.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],n.msecs=e):(n.seq=n.seq+1|0,n.seq===0&&n.msecs++),n}o(uT,"updateV7State");Du.updateV7State=uT;function lT(n,e,t,r,i=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=n[6]*127<<24|n[7]<<16|n[8]<<8|n[9],r[i++]=e/1099511627776&255,r[i++]=e/4294967296&255,r[i++]=e/16777216&255,r[i++]=e/65536&255,r[i++]=e/256&255,r[i++]=e&255,r[i++]=112|t>>>28&15,r[i++]=t>>>20&255,r[i++]=128|t>>>14&63,r[i++]=t>>>6&255,r[i++]=t<<2&255|n[10]&3,r[i++]=n[11],r[i++]=n[12],r[i++]=n[13],r[i++]=n[14],r[i++]=n[15],r}o(lT,"v7Bytes");Du.default=PL});var dT=S(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var OL=Cu();function FL(n){if(!(0,OL.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}o(FL,"version");O0.default=FL});var wn=S(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.version=ot.validate=ot.v7=ot.v6ToV1=ot.v6=ot.v5=ot.v4=ot.v3=ot.v1ToV6=ot.v1=ot.stringify=ot.parse=ot.NIL=ot.MAX=void 0;var DL=U2();Object.defineProperty(ot,"MAX",{enumerable:!0,get:o(function(){return DL.default},"get")});var NL=q2();Object.defineProperty(ot,"NIL",{enumerable:!0,get:o(function(){return NL.default},"get")});var LL=Iu();Object.defineProperty(ot,"parse",{enumerable:!0,get:o(function(){return LL.default},"get")});var kL=ks();Object.defineProperty(ot,"stringify",{enumerable:!0,get:o(function(){return kL.default},"get")});var ML=y0();Object.defineProperty(ot,"v1",{enumerable:!0,get:o(function(){return ML.default},"get")});var jL=S0();Object.defineProperty(ot,"v1ToV6",{enumerable:!0,get:o(function(){return jL.default},"get")});var $L=Z2();Object.defineProperty(ot,"v3",{enumerable:!0,get:o(function(){return $L.default},"get")});var BL=rT();Object.defineProperty(ot,"v4",{enumerable:!0,get:o(function(){return BL.default},"get")});var VL=sT();Object.defineProperty(ot,"v5",{enumerable:!0,get:o(function(){return VL.default},"get")});var UL=aT();Object.defineProperty(ot,"v6",{enumerable:!0,get:o(function(){return UL.default},"get")});var qL=oT();Object.defineProperty(ot,"v6ToV1",{enumerable:!0,get:o(function(){return qL.default},"get")});var WL=fT();Object.defineProperty(ot,"v7",{enumerable:!0,get:o(function(){return WL.default},"get")});var GL=Cu();Object.defineProperty(ot,"validate",{enumerable:!0,get:o(function(){return GL.default},"get")});var zL=dT();Object.defineProperty(ot,"version",{enumerable:!0,get:o(function(){return zL.default},"get")})});var N0=S(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.Exo003UUIDGenerator=void 0;var F0=wn(),hT=sh(),D0=class{static{o(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,F0.v5)(e,hT.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,F0.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,F0.v5)(e,hT.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)}};lh.Exo003UUIDGenerator=D0});var mT=S(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.Exo003Parser=void 0;var mt=sh(),Nu=N0(),_a=Ce(),uh=je(),pT=Gt(),HL=oi(),L0=class{static{o(this,"Exo003Parser")}static parse(e,t){let r=this.validate(e);if(!r.valid)return{success:!1,errors:r.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===mt.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(mt.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(mt.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:r};let s=i,a=mt.ALLOWED_PROPERTIES[s],c=mt.REQUIRED_PROPERTIES[s];for(let l of c)(e[l]===void 0||e[l]===null)&&t.push(`Missing required property: ${l}`);for(let l of Object.keys(e))a.includes(l)||t.push(`Forbidden property for ${s}: ${l}`);switch(s){case mt.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case mt.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case mt.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case mt.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case mt.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 mt.Exo003MetadataType.Namespace:return{...r,metadata:mt.Exo003MetadataType.Namespace,uri:e.uri};case mt.Exo003MetadataType.Anchor:return{...r,metadata:mt.Exo003MetadataType.Anchor,uri:e.uri};case mt.Exo003MetadataType.BlankNode:return{...r,metadata:mt.Exo003MetadataType.BlankNode,uri:e.uri};case mt.Exo003MetadataType.Statement:return{...r,metadata:mt.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case mt.Exo003MetadataType.Body:return{...r,metadata:mt.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 _a.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 _a.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 _a.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,a=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of a)l&&typeof l!="string"&&t.push(`${c} must be a string`)}static validateBodyMetadata(e,t,r){let i=e.subject,s=e.predicate;i&&typeof i!="string"&&t.push("subject must be a string"),s&&typeof s!="string"&&t.push("predicate must be a string")}static toTriple(e,t,r){let i=t(e.subject),s;if(i.type==="iri")s=new _a.IRI(i.value);else if(i.type==="blank")s=new pT.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let a=t(e.predicate);if(a.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new _a.IRI(a.value),l=t(e.object),u;if(l.type==="iri")u=new _a.IRI(l.value);else if(l.type==="blank")u=new pT.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new uh.Literal(f,new _a.IRI(l.datatype));else{let d=l.language||mt.DEFAULT_LANGUAGE_TAG;u=(0,uh.createDirectionalLiteral)(f,d,l.direction)}}return new HL.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new uh.Literal(t,new _a.IRI(r.datatype));let i=r?.language||mt.DEFAULT_LANGUAGE_TAG;return(0,uh.createDirectionalLiteral)(t,i,r?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(mt.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case mt.Exo003MetadataType.Namespace:return Nu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case mt.Exo003MetadataType.Anchor:return Nu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case mt.Exo003MetadataType.BlankNode:return Nu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case mt.Exo003MetadataType.Statement:{let r=e;return Nu.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case mt.Exo003MetadataType.Body:{let r=e;return Nu.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};fh.Exo003Parser=L0});var k0=S(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.Exo003Parser=Vr.Exo003UUIDGenerator=Vr.UUID_URL_NAMESPACE=Vr.DEFAULT_LANGUAGE_TAG=Vr.REQUIRED_PROPERTIES=Vr.ALLOWED_PROPERTIES=Vr.Exo003MetadataType=void 0;var Lu=sh();Object.defineProperty(Vr,"Exo003MetadataType",{enumerable:!0,get:o(function(){return Lu.Exo003MetadataType},"get")});Object.defineProperty(Vr,"ALLOWED_PROPERTIES",{enumerable:!0,get:o(function(){return Lu.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Vr,"REQUIRED_PROPERTIES",{enumerable:!0,get:o(function(){return Lu.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Vr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:o(function(){return Lu.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Vr,"UUID_URL_NAMESPACE",{enumerable:!0,get:o(function(){return Lu.UUID_URL_NAMESPACE},"get")});var QL=N0();Object.defineProperty(Vr,"Exo003UUIDGenerator",{enumerable:!0,get:o(function(){return QL.Exo003UUIDGenerator},"get")});var YL=mT();Object.defineProperty(Vr,"Exo003Parser",{enumerable:!0,get:o(function(){return YL.Exo003Parser},"get")})});var js=S(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.WikiLinkHelpers=void 0;var ku=class{static{o(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)}};dh.WikiLinkHelpers=ku;ku.WIKI_LINK_PATTERN=/\[\[|\]\]/g;ku.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var Nn=S(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.CommandBindingProperty=et.GroundingProperty=et.PreconditionProperty=et.CommandProperty=et.GroundingType=et.getEffortStatusLabel=et.isTrashedStatus=et.isDoneStatus=et.normalizeEffortStatus=et.EFFORT_STATUS_OPTIONS=et.STATUS_NAME_TO_WIKILINK=et.STATUS_NAME_TO_ENUM=et.EFFORT_STATUS_CONFIG=et.EffortStatus=et.AssetClass=void 0;var KL=Tu();Object.defineProperty(et,"AssetClass",{enumerable:!0,get:o(function(){return KL.AssetClass},"get")});var XL=_c();Object.defineProperty(et,"EffortStatus",{enumerable:!0,get:o(function(){return XL.EffortStatus},"get")});var Sa=Xy();Object.defineProperty(et,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:o(function(){return Sa.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(et,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:o(function(){return Sa.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(et,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:o(function(){return Sa.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(et,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:o(function(){return Sa.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(et,"normalizeEffortStatus",{enumerable:!0,get:o(function(){return Sa.normalizeEffortStatus},"get")});Object.defineProperty(et,"isDoneStatus",{enumerable:!0,get:o(function(){return Sa.isDoneStatus},"get")});Object.defineProperty(et,"isTrashedStatus",{enumerable:!0,get:o(function(){return Sa.isTrashedStatus},"get")});Object.defineProperty(et,"getEffortStatusLabel",{enumerable:!0,get:o(function(){return Sa.getEffortStatusLabel},"get")});var JL=Sc();Object.defineProperty(et,"GroundingType",{enumerable:!0,get:o(function(){return JL.GroundingType},"get")});var hh=Jy();Object.defineProperty(et,"CommandProperty",{enumerable:!0,get:o(function(){return hh.CommandProperty},"get")});Object.defineProperty(et,"PreconditionProperty",{enumerable:!0,get:o(function(){return hh.PreconditionProperty},"get")});Object.defineProperty(et,"GroundingProperty",{enumerable:!0,get:o(function(){return hh.GroundingProperty},"get")});Object.defineProperty(et,"CommandBindingProperty",{enumerable:!0,get:o(function(){return hh.CommandBindingProperty},"get")})});var _o=S(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.hasClass=yo;Ur.isAreaOrProject=ZL;Ur.isEffort=ek;Ur.hasStatus=tk;Ur.isAssetArchived=rk;Ur.hasEmptyProperties=nk;Ur.needsFolderRepair=ik;Ur.getTodayDateString=M0;Ur.isPlannedForToday=sk;Ur.hasPlannedStartTimestamp=ak;Ur.extractDailyNoteDate=ok;Ur.isCurrentDateGteDay=ck;Ur.inheritsFromPrototype=_T;Ur.isPrototypeClass=uk;var yT=js(),go=Nn();function yo(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>yT.WikiLinkHelpers.normalize(r)===e):!1}o(yo,"hasClass");function ZL(n){return yo(n,go.AssetClass.AREA)||yo(n,go.AssetClass.PROJECT)}o(ZL,"isAreaOrProject");function ek(n){return yo(n,go.AssetClass.TASK)||yo(n,go.AssetClass.PROJECT)||yo(n,go.AssetClass.MEETING)}o(ek,"isEffort");function tk(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?yT.WikiLinkHelpers.normalize(t)===e:!1}o(tk,"hasStatus");function rk(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}o(rk,"isAssetArchived");function nk(n){return!n||Object.keys(n).length===0?!1:Object.values(n).some(e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0))}o(nk,"hasEmptyProperties");function ik(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}o(ik,"needsFolderRepair");function M0(){let n=new Date,e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}o(M0,"getTodayDateString");function sk(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=M0();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}o(sk,"isPlannedForToday");function ak(n){let e=n.ems__Effort_plannedStartTimestamp;return e?typeof e=="string"?e.trim().length>0:Array.isArray(e)&&e.length>0?String(e[0]).trim().length>0:!1:!1}o(ak,"hasPlannedStartTimestamp");function ok(n){let e=n.pn__DailyNote_day;if(!e)return null;if(typeof e=="string"){let t=e.match(/\[\[([^\[\]]+)\]\]/);return t?t[1]:e}if(Array.isArray(e)&&e.length>0){let t=String(e[0]),r=t.match(/\[\[([^\[\]]+)\]\]/);return r?r[1]:t}return null}o(ok,"extractDailyNoteDate");function ck(n){return M0()>=n}o(ck,"isCurrentDateGteDay");function gT(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}o(gT,"normalizeWithQuotes");var lk=10;function _T(n,e=lk){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let a of s){let c=gT(a);c&&i.push({className:c,depth:0})}for(;i.length>0;){let a=i.shift();if(!a)continue;let{className:c,depth:l}=a;if(l>e)continue;if(c===go.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=gT(h);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}o(_T,"inheritsFromPrototype");function uk(n,e){return yo(n,go.AssetClass.CLASS)?_T(e):!1}o(uk,"isPrototypeClass")});var ST=S(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.canCreateTask=fk;wc.canCreateRelatedTask=dk;wc.canConvertTaskToProject=hk;wc.canSetCriticalityZone=pk;var bc=_o(),j0=Nn();function fk(n){return(0,bc.isAreaOrProject)(n.instanceClass)}o(fk,"canCreateTask");function dk(n){return!(!(0,bc.hasClass)(n.instanceClass,j0.AssetClass.TASK)||(0,bc.isAssetArchived)(n.isArchived))}o(dk,"canCreateRelatedTask");function hk(n){return(0,bc.hasClass)(n.instanceClass,j0.AssetClass.TASK)}o(hk,"canConvertTaskToProject");function pk(n){return!(!(0,bc.hasClass)(n.instanceClass,j0.AssetClass.TASK)||(0,bc.isAssetArchived)(n.isArchived))}o(pk,"canSetCriticalityZone")});var vT=S(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.canCreateProject=mk;Ec.canMoveToAnalysis=gk;Ec.canMoveToToDo=yk;Ec.canConvertProjectToTask=_k;var va=_o(),ba=Nn();function mk(n){return(0,va.hasClass)(n.instanceClass,ba.AssetClass.AREA)||(0,va.hasClass)(n.instanceClass,ba.AssetClass.INITIATIVE)||(0,va.hasClass)(n.instanceClass,ba.AssetClass.PROJECT)}o(mk,"canCreateProject");function gk(n){return(0,va.hasClass)(n.instanceClass,ba.AssetClass.PROJECT)?(0,va.hasStatus)(n.currentStatus,ba.EffortStatus.BACKLOG):!1}o(gk,"canMoveToAnalysis");function yk(n){return(0,va.hasClass)(n.instanceClass,ba.AssetClass.PROJECT)?(0,va.hasStatus)(n.currentStatus,ba.EffortStatus.ANALYSIS):!1}o(yk,"canMoveToToDo");function _k(n){return(0,va.hasClass)(n.instanceClass,ba.AssetClass.PROJECT)}o(_k,"canConvertProjectToTask")});var ET=S(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.canCreateChildArea=Sk;ph.canSetActiveFocus=vk;var bT=_o(),wT=Nn();function Sk(n){return(0,bT.hasClass)(n.instanceClass,wT.AssetClass.AREA)}o(Sk,"canCreateChildArea");function vk(n){return(0,bT.hasClass)(n.instanceClass,wT.AssetClass.AREA)}o(vk,"canSetActiveFocus")});var AT=S(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.canPlanOnToday=bk;on.canPlanForEvening=wk;on.canShiftDayBackward=Ek;on.canShiftDayForward=Tk;on.canSetDraftStatus=Ak;on.canMoveToBacklog=xk;on.canStartEffort=Ck;on.canMarkDone=Ik;on.canTrashEffort=Rk;on.canVoteOnEffort=Pk;on.canRollbackStatus=Ok;on.canArchiveTask=Fk;on.canMarkReviewed=Dk;var TT=js(),dt=_o(),an=Nn();function bk(n){return!(!(0,dt.isEffort)(n.instanceClass)||(0,dt.isPlannedForToday)(n.metadata))}o(bk,"canPlanOnToday");function wk(n){return!(0,dt.hasClass)(n.instanceClass,an.AssetClass.TASK)&&!(0,dt.hasClass)(n.instanceClass,an.AssetClass.MEETING)?!1:(0,dt.hasStatus)(n.currentStatus,an.EffortStatus.BACKLOG)}o(wk,"canPlanForEvening");function Ek(n){return(0,dt.isEffort)(n.instanceClass)?(0,dt.hasPlannedStartTimestamp)(n.metadata):!1}o(Ek,"canShiftDayBackward");function Tk(n){return(0,dt.isEffort)(n.instanceClass)?(0,dt.hasPlannedStartTimestamp)(n.metadata):!1}o(Tk,"canShiftDayForward");function Ak(n){return(0,dt.isEffort)(n.instanceClass)?!n.currentStatus:!1}o(Ak,"canSetDraftStatus");function xk(n){return(0,dt.isEffort)(n.instanceClass)?(0,dt.hasStatus)(n.currentStatus,an.EffortStatus.DRAFT):!1}o(xk,"canMoveToBacklog");function Ck(n){return(0,dt.isEffort)(n.instanceClass)?(0,dt.hasClass)(n.instanceClass,an.AssetClass.TASK)||(0,dt.hasClass)(n.instanceClass,an.AssetClass.MEETING)?(0,dt.hasStatus)(n.currentStatus,an.EffortStatus.BACKLOG):(0,dt.hasClass)(n.instanceClass,an.AssetClass.PROJECT)?(0,dt.hasStatus)(n.currentStatus,an.EffortStatus.TODO):!1:!1}o(Ck,"canStartEffort");function Ik(n){return(0,dt.isEffort)(n.instanceClass)?(0,dt.hasStatus)(n.currentStatus,an.EffortStatus.DOING):!1}o(Ik,"canMarkDone");function Rk(n){return(0,dt.isEffort)(n.instanceClass)?n.currentStatus?!(Array.isArray(n.currentStatus)?n.currentStatus:[n.currentStatus]).some(r=>{let i=TT.WikiLinkHelpers.normalize(r);return i===an.EffortStatus.TRASHED||i===an.EffortStatus.DONE}):!0:!1}o(Rk,"canTrashEffort");function Pk(n){return!(!(0,dt.isEffort)(n.instanceClass)||(0,dt.isAssetArchived)(n.isArchived))}o(Pk,"canVoteOnEffort");function Ok(n){if(!(0,dt.isEffort)(n.instanceClass)||(0,dt.isAssetArchived)(n.isArchived)||!n.currentStatus)return!1;let e=Array.isArray(n.currentStatus)?n.currentStatus[0]:n.currentStatus;return!(!e||TT.WikiLinkHelpers.normalize(e)===an.EffortStatus.TRASHED)}o(Ok,"canRollbackStatus");function Fk(n){return!(0,dt.isAssetArchived)(n.isArchived)}o(Fk,"canArchiveTask");function Dk(n){return!(!(0,dt.hasClass)(n.instanceClass,an.AssetClass.TASK)&&!(0,dt.hasClass)(n.instanceClass,an.AssetClass.PROJECT)||(0,dt.isAssetArchived)(n.isArchived))}o(Dk,"canMarkReviewed")});var xT=S(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.canCreateEvent=kk;Hn.canCreateInstance=Mk;Hn.canCleanProperties=jk;Hn.canRepairFolder=$k;Hn.canRenameToUid=Bk;Hn.canCopyLabelToAliases=Vk;Hn.canCreateNarrowerConcept=Uk;Hn.canCreateSubclass=qk;Hn.canCreateTaskForDailyNote=Wk;Hn.canCopyFleetingNoteLabel=Gk;var qr=_o(),$s=Nn(),Nk="75302770-279e-4a59-ba85-09df29725713",Lk="fca0a931-a01f-48e4-b72a-4af206c94bc7";function kk(n){return(0,qr.isAreaOrProject)(n.instanceClass)}o(kk,"canCreateEvent");function Mk(n){return(0,qr.hasClass)(n.instanceClass,$s.AssetClass.TASK_PROTOTYPE)||(0,qr.hasClass)(n.instanceClass,Nk)||(0,qr.hasClass)(n.instanceClass,$s.AssetClass.MEETING_PROTOTYPE)||(0,qr.hasClass)(n.instanceClass,$s.AssetClass.EVENT_PROTOTYPE)||(0,qr.hasClass)(n.instanceClass,$s.AssetClass.PROJECT_PROTOTYPE)||(0,qr.hasClass)(n.instanceClass,$s.AssetClass.PROTOTYPE)||n.classIsPrototype?!0:(0,qr.isPrototypeClass)(n.instanceClass,n.metadata)}o(Mk,"canCreateInstance");function jk(n){return(0,qr.hasEmptyProperties)(n.metadata)}o(jk,"canCleanProperties");function $k(n){return(0,qr.needsFolderRepair)(n.currentFolder,n.expectedFolder)}o($k,"canRepairFolder");function Bk(n,e){let t=n.metadata.exo__Asset_uid;return t?e!==t:!1}o(Bk,"canRenameToUid");function Vk(n){let e=n.metadata.exo__Asset_label;if(!e||typeof e!="string"||e.trim()==="")return!1;let t=e.trim(),r=n.metadata.aliases;return!r||!Array.isArray(r)||r.length===0?!0:!r.some(i=>typeof i!="string"?!1:i.trim()===t)}o(Vk,"canCopyLabelToAliases");function Uk(n){return(0,qr.hasClass)(n.instanceClass,$s.AssetClass.CONCEPT)}o(Uk,"canCreateNarrowerConcept");function qk(n){return(0,qr.hasClass)(n.instanceClass,$s.AssetClass.CLASS)}o(qk,"canCreateSubclass");function Wk(n){return!(!(0,qr.hasClass)(n.instanceClass,$s.AssetClass.DAILY_NOTE)||n.isArchived||!(0,qr.extractDailyNoteDate)(n.metadata))}o(Wk,"canCreateTaskForDailyNote");function Gk(n){return(0,qr.hasClass)(n.instanceClass,$s.AssetClass.FLEETING_NOTE)||(0,qr.hasClass)(n.instanceClass,Lk)}o(Gk,"canCopyFleetingNoteLabel")});var IT=S(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.canCopyFleetingNoteLabel=L.canCreateTaskForDailyNote=L.canCreateSubclass=L.canCreateNarrowerConcept=L.canCopyLabelToAliases=L.canRenameToUid=L.canRepairFolder=L.canCleanProperties=L.canCreateInstance=L.canCreateEvent=L.canMarkReviewed=L.canArchiveTask=L.canRollbackStatus=L.canVoteOnEffort=L.canTrashEffort=L.canMarkDone=L.canStartEffort=L.canMoveToBacklog=L.canSetDraftStatus=L.canShiftDayForward=L.canShiftDayBackward=L.canPlanForEvening=L.canPlanOnToday=L.canSetActiveFocus=L.canCreateChildArea=L.canConvertProjectToTask=L.canMoveToToDo=L.canMoveToAnalysis=L.canCreateProject=L.canSetCriticalityZone=L.canConvertTaskToProject=L.canCreateRelatedTask=L.canCreateTask=L.isPrototypeClass=L.inheritsFromPrototype=L.isCurrentDateGteDay=L.extractDailyNoteDate=L.hasPlannedStartTimestamp=L.isPlannedForToday=L.getTodayDateString=L.needsFolderRepair=L.hasEmptyProperties=L.isAssetArchived=L.hasStatus=L.isEffort=L.isAreaOrProject=L.hasClass=void 0;var En=_o();Object.defineProperty(L,"hasClass",{enumerable:!0,get:o(function(){return En.hasClass},"get")});Object.defineProperty(L,"isAreaOrProject",{enumerable:!0,get:o(function(){return En.isAreaOrProject},"get")});Object.defineProperty(L,"isEffort",{enumerable:!0,get:o(function(){return En.isEffort},"get")});Object.defineProperty(L,"hasStatus",{enumerable:!0,get:o(function(){return En.hasStatus},"get")});Object.defineProperty(L,"isAssetArchived",{enumerable:!0,get:o(function(){return En.isAssetArchived},"get")});Object.defineProperty(L,"hasEmptyProperties",{enumerable:!0,get:o(function(){return En.hasEmptyProperties},"get")});Object.defineProperty(L,"needsFolderRepair",{enumerable:!0,get:o(function(){return En.needsFolderRepair},"get")});Object.defineProperty(L,"getTodayDateString",{enumerable:!0,get:o(function(){return En.getTodayDateString},"get")});Object.defineProperty(L,"isPlannedForToday",{enumerable:!0,get:o(function(){return En.isPlannedForToday},"get")});Object.defineProperty(L,"hasPlannedStartTimestamp",{enumerable:!0,get:o(function(){return En.hasPlannedStartTimestamp},"get")});Object.defineProperty(L,"extractDailyNoteDate",{enumerable:!0,get:o(function(){return En.extractDailyNoteDate},"get")});Object.defineProperty(L,"isCurrentDateGteDay",{enumerable:!0,get:o(function(){return En.isCurrentDateGteDay},"get")});Object.defineProperty(L,"inheritsFromPrototype",{enumerable:!0,get:o(function(){return En.inheritsFromPrototype},"get")});Object.defineProperty(L,"isPrototypeClass",{enumerable:!0,get:o(function(){return En.isPrototypeClass},"get")});var mh=ST();Object.defineProperty(L,"canCreateTask",{enumerable:!0,get:o(function(){return mh.canCreateTask},"get")});Object.defineProperty(L,"canCreateRelatedTask",{enumerable:!0,get:o(function(){return mh.canCreateRelatedTask},"get")});Object.defineProperty(L,"canConvertTaskToProject",{enumerable:!0,get:o(function(){return mh.canConvertTaskToProject},"get")});Object.defineProperty(L,"canSetCriticalityZone",{enumerable:!0,get:o(function(){return mh.canSetCriticalityZone},"get")});var gh=vT();Object.defineProperty(L,"canCreateProject",{enumerable:!0,get:o(function(){return gh.canCreateProject},"get")});Object.defineProperty(L,"canMoveToAnalysis",{enumerable:!0,get:o(function(){return gh.canMoveToAnalysis},"get")});Object.defineProperty(L,"canMoveToToDo",{enumerable:!0,get:o(function(){return gh.canMoveToToDo},"get")});Object.defineProperty(L,"canConvertProjectToTask",{enumerable:!0,get:o(function(){return gh.canConvertProjectToTask},"get")});var CT=ET();Object.defineProperty(L,"canCreateChildArea",{enumerable:!0,get:o(function(){return CT.canCreateChildArea},"get")});Object.defineProperty(L,"canSetActiveFocus",{enumerable:!0,get:o(function(){return CT.canSetActiveFocus},"get")});var Ln=AT();Object.defineProperty(L,"canPlanOnToday",{enumerable:!0,get:o(function(){return Ln.canPlanOnToday},"get")});Object.defineProperty(L,"canPlanForEvening",{enumerable:!0,get:o(function(){return Ln.canPlanForEvening},"get")});Object.defineProperty(L,"canShiftDayBackward",{enumerable:!0,get:o(function(){return Ln.canShiftDayBackward},"get")});Object.defineProperty(L,"canShiftDayForward",{enumerable:!0,get:o(function(){return Ln.canShiftDayForward},"get")});Object.defineProperty(L,"canSetDraftStatus",{enumerable:!0,get:o(function(){return Ln.canSetDraftStatus},"get")});Object.defineProperty(L,"canMoveToBacklog",{enumerable:!0,get:o(function(){return Ln.canMoveToBacklog},"get")});Object.defineProperty(L,"canStartEffort",{enumerable:!0,get:o(function(){return Ln.canStartEffort},"get")});Object.defineProperty(L,"canMarkDone",{enumerable:!0,get:o(function(){return Ln.canMarkDone},"get")});Object.defineProperty(L,"canTrashEffort",{enumerable:!0,get:o(function(){return Ln.canTrashEffort},"get")});Object.defineProperty(L,"canVoteOnEffort",{enumerable:!0,get:o(function(){return Ln.canVoteOnEffort},"get")});Object.defineProperty(L,"canRollbackStatus",{enumerable:!0,get:o(function(){return Ln.canRollbackStatus},"get")});Object.defineProperty(L,"canArchiveTask",{enumerable:!0,get:o(function(){return Ln.canArchiveTask},"get")});Object.defineProperty(L,"canMarkReviewed",{enumerable:!0,get:o(function(){return Ln.canMarkReviewed},"get")});var ns=xT();Object.defineProperty(L,"canCreateEvent",{enumerable:!0,get:o(function(){return ns.canCreateEvent},"get")});Object.defineProperty(L,"canCreateInstance",{enumerable:!0,get:o(function(){return ns.canCreateInstance},"get")});Object.defineProperty(L,"canCleanProperties",{enumerable:!0,get:o(function(){return ns.canCleanProperties},"get")});Object.defineProperty(L,"canRepairFolder",{enumerable:!0,get:o(function(){return ns.canRepairFolder},"get")});Object.defineProperty(L,"canRenameToUid",{enumerable:!0,get:o(function(){return ns.canRenameToUid},"get")});Object.defineProperty(L,"canCopyLabelToAliases",{enumerable:!0,get:o(function(){return ns.canCopyLabelToAliases},"get")});Object.defineProperty(L,"canCreateNarrowerConcept",{enumerable:!0,get:o(function(){return ns.canCreateNarrowerConcept},"get")});Object.defineProperty(L,"canCreateSubclass",{enumerable:!0,get:o(function(){return ns.canCreateSubclass},"get")});Object.defineProperty(L,"canCreateTaskForDailyNote",{enumerable:!0,get:o(function(){return ns.canCreateTaskForDailyNote},"get")});Object.defineProperty(L,"canCopyFleetingNoteLabel",{enumerable:!0,get:o(function(){return ns.canCopyFleetingNoteLabel},"get")})});var RT=S(So=>{"use strict";var zk=So&&So.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Hk=So&&So.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&zk(e,n,t)};Object.defineProperty(So,"__esModule",{value:!0});Hk(IT(),So)});var yh=S(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.PropertyFieldType=void 0;Mu.rangeToFieldType=Kk;var Or;(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"})(Or||(Mu.PropertyFieldType=Or={}));var PT="http://www.w3.org/2001/XMLSchema#",Qk="https://exocortex.my/ontology/exo#",Yk="https://exocortex.my/ontology/ems#";function Kk(n){if(!n)return Or.Unknown;let e=n.trim();if(!e)return Or.Unknown;if(e.startsWith(PT)){let t=e.substring(PT.length);return $0(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return $0(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return $0(r)}return e.startsWith(Yk)||e.startsWith("ems:")?Xk(e):e.startsWith(Qk)||e.startsWith("exo:")||Jk(e)?Or.Reference:Or.Text}o(Kk,"rangeToFieldType");function $0(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return Or.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 Or.Number;case"date":return Or.Date;case"datetime":case"datetimestamp":return Or.DateTime;case"boolean":return Or.Boolean;case"time":return Or.Timestamp;default:return Or.Text}}o($0,"xsdTypeToFieldType");function Xk(n){let e=n.toLowerCase();return e.includes("effortstatus")?Or.StatusSelect:e.includes("tasksize")?Or.SizeSelect:Or.Reference}o(Xk,"emsTypeToFieldType");function Jk(n){let e=n.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(r=>e.includes(r))}o(Jk,"isClassReference")});var B0=S(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.propertyNameToUri=Zk;ju.uriToPropertyName=OT;ju.extractPropertyLabel=e4;function Zk(n){return n.replace(/^([a-z]+)__/,"$1:")}o(Zk,"propertyNameToUri");function OT(n){if(n.startsWith("http://")||n.startsWith("https://")){let e=n.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=n.lastIndexOf("#"),r=n.lastIndexOf("/"),i=Math.max(t,r);return i>=0?n.substring(i+1):n}return n.replace(/^([a-z]+):/,"$1__")}o(OT,"uriToPropertyName");function e4(n){let r=(n.includes(":")?OT(n):n).replace(/^[a-z]+__/,"").split("_");return(r.length>1?r.slice(1).join(" "):r[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}o(e4,"extractPropertyLabel")});var _h={};Dy(_h,{__assign:()=>U0,__asyncDelegator:()=>h4,__asyncGenerator:()=>d4,__asyncValues:()=>p4,__await:()=>$u,__awaiter:()=>a4,__classPrivateFieldGet:()=>_4,__classPrivateFieldSet:()=>S4,__createBinding:()=>c4,__decorate:()=>n4,__exportStar:()=>l4,__extends:()=>t4,__generator:()=>o4,__importDefault:()=>y4,__importStar:()=>g4,__makeTemplateObject:()=>m4,__metadata:()=>s4,__param:()=>i4,__read:()=>FT,__rest:()=>r4,__spread:()=>u4,__spreadArrays:()=>f4,__values:()=>q0});function t4(n,e){V0(n,e);function t(){this.constructor=n}o(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function r4(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 n4(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function i4(n,e){return function(t,r){e(t,r,n)}}function s4(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function a4(n,e,t,r){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,a){function c(f){try{u(r.next(f))}catch(d){a(d)}}o(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(d){a(d)}}o(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}o(u,"step"),u((r=r.apply(n,e||[])).next())})}function o4(n,e){var t={label:0,sent:o(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function c4(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function l4(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function q0(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:o(function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function FT(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return s}function u4(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(FT(arguments[e]));return n}function f4(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],a=0,c=s.length;a<c;a++,i++)r[i]=s[a];return r}function $u(n){return this instanceof $u?(this.v=n,this):new $u(n)}function d4(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(h){r[h]&&(i[h]=function(p){return new Promise(function(_,v){s.push([h,p,_,v])>1||c(h,p)})})}function c(h,p){try{l(r[h](p))}catch(_){d(s[0][3],_)}}function l(h){h.value instanceof $u?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 h4(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(a){return(t=!t)?{value:$u(n[i](a)),done:i==="return"}:s?s(a):a}:s}}function p4(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 q0=="function"?q0(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(a){return new Promise(function(c,l){a=n[s](a),i(c,l,a.done,a.value)})}}function i(s,a,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},a)}}function m4(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function g4(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 y4(n){return n&&n.__esModule?n:{default:n}}function _4(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function S4(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 V0,U0,Sh=rN(()=>{V0=o(function(n,e){return V0=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])},V0(n,e)},"extendStatics");o(t4,"__extends");U0=o(function(){return U0=Object.assign||o(function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),U0.apply(this,arguments)},"__assign");o(r4,"__rest");o(n4,"__decorate");o(i4,"__param");o(s4,"__metadata");o(a4,"__awaiter");o(o4,"__generator");o(c4,"__createBinding");o(l4,"__exportStar");o(q0,"__values");o(FT,"__read");o(u4,"__spread");o(f4,"__spreadArrays");o($u,"__await");o(d4,"__asyncGenerator");o(h4,"__asyncDelegator");o(p4,"__asyncValues");o(m4,"__makeTemplateObject");o(g4,"__importStar");o(y4,"__importDefault");o(_4,"__classPrivateFieldGet");o(S4,"__classPrivateFieldSet")});var z0=S(G0=>{"use strict";Object.defineProperty(G0,"__esModule",{value:!0});var W0;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})(W0||(W0={}));G0.default=W0});var DT=S(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});var v4=z0();Object.defineProperty(H0,"Lifecycle",{enumerable:!0,get:o(function(){return v4.default},"get")})});var vo=S(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.defineInjectionTokenMetadata=ci.getParamInfo=ci.INJECTION_TOKEN_METADATA_KEY=void 0;ci.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function b4(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(ci.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}o(b4,"getParamInfo");ci.getParamInfo=b4;function w4(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(ci.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(ci.INJECTION_TOKEN_METADATA_KEY,s,t)}}o(w4,"defineInjectionTokenMetadata");ci.defineInjectionTokenMetadata=w4});var Q0=S(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.isClassProvider=void 0;function E4(n){return!!n.useClass}o(E4,"isClassProvider");vh.isClassProvider=E4});var Y0=S(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.isFactoryProvider=void 0;function T4(n){return!!n.useFactory}o(T4,"isFactoryProvider");bh.isFactoryProvider=T4});var Eh=S(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.delay=Tc.DelayedConstructor=void 0;var wh=class{static{o(this,"DelayedConstructor")}constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},r=!1,i,s=o(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=o(i=>{t[i]=(...s)=>{s[0]=e();let a=Reflect[i];return a(...s)}},"install");return this.reflectMethods.forEach(r),t}};Tc.DelayedConstructor=wh;function A4(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new wh(n)}o(A4,"delay");Tc.delay=A4});var Th=S(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.isConstructorToken=is.isTransformDescriptor=is.isTokenDescriptor=is.isNormalToken=void 0;var x4=Eh();function C4(n){return typeof n=="string"||typeof n=="symbol"}o(C4,"isNormalToken");is.isNormalToken=C4;function I4(n){return typeof n=="object"&&"token"in n&&"multiple"in n}o(I4,"isTokenDescriptor");is.isTokenDescriptor=I4;function R4(n){return typeof n=="object"&&"token"in n&&"transform"in n}o(R4,"isTransformDescriptor");is.isTransformDescriptor=R4;function P4(n){return typeof n=="function"||n instanceof x4.DelayedConstructor}o(P4,"isConstructorToken");is.isConstructorToken=P4});var K0=S(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.isTokenProvider=void 0;function O4(n){return!!n.useToken}o(O4,"isTokenProvider");Ah.isTokenProvider=O4});var X0=S(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.isValueProvider=void 0;function F4(n){return n.useValue!=null}o(F4,"isValueProvider");xh.isValueProvider=F4});var J0=S(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});var D4=Q0();Object.defineProperty(bo,"isClassProvider",{enumerable:!0,get:o(function(){return D4.isClassProvider},"get")});var N4=Y0();Object.defineProperty(bo,"isFactoryProvider",{enumerable:!0,get:o(function(){return N4.isFactoryProvider},"get")});var L4=Th();Object.defineProperty(bo,"isNormalToken",{enumerable:!0,get:o(function(){return L4.isNormalToken},"get")});var k4=K0();Object.defineProperty(bo,"isTokenProvider",{enumerable:!0,get:o(function(){return k4.isTokenProvider},"get")});var M4=X0();Object.defineProperty(bo,"isValueProvider",{enumerable:!0,get:o(function(){return M4.isValueProvider},"get")})});var NT=S(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.isProvider=void 0;var j4=Q0(),$4=X0(),B4=K0(),V4=Y0();function U4(n){return j4.isClassProvider(n)||$4.isValueProvider(n)||B4.isTokenProvider(n)||V4.isFactoryProvider(n)}o(U4,"isProvider");Ch.isProvider=U4});var t_=S(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});var Z0=class{static{o(this,"RegistryBase")}constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};e_.default=Z0});var LT=S(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});var q4=t_(),r_=class extends q4.default{static{o(this,"Registry")}};n_.default=r_});var kT=S(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});var i_=class{static{o(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};s_.default=i_});var a_=S(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.formatErrorCtor=void 0;function W4(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}o(W4,"formatDependency");function G4(n,e,t=" "){return[n,...e.message.split(`
32
32
  `).map(r=>t+r)].join(`
33
- `)}o(G4,"composeErrorMessage");function z4(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=W4(r,e);return G4(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}o(z4,"formatErrorCtor");Ih.formatErrorCtor=z4});var MT=S(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.isDisposable=void 0;function H4(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}o(H4,"isDisposable");Rh.isDisposable=H4});var $T=S(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PostResolutionInterceptors=wo.PreResolutionInterceptors=void 0;var jT=t_(),Ph=class extends jT.default{static{o(this,"PreResolutionInterceptors")}};wo.PreResolutionInterceptors=Ph;var Oh=class extends jT.default{static{o(this,"PostResolutionInterceptors")}};wo.PostResolutionInterceptors=Oh;var o_=class{static{o(this,"Interceptors")}constructor(){this.preResolution=new Ph,this.postResolution=new Oh}};wo.default=o_});var wa=S(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.instance=Bs.typeInfo=void 0;var Q4=(Sh(),Bd(_h)),cn=J0(),Y4=NT(),Fh=Th(),K4=LT(),Tn=z0(),Dh=kT(),X4=a_(),J4=Eh(),Z4=MT(),eM=$T();Bs.typeInfo=new Map;var c_=class n{static{o(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new K4.default,this.interceptors=new eM.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Tn.default.Transient}){this.ensureNotDisposed();let i;if(Y4.isProvider(t)?i=t:i={useClass:t},cn.isTokenProvider(i)){let s=[e],a=i;for(;a!=null;){let c=a.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&cn.isTokenProvider(l.provider)?a=l.provider:a=null}}if((r.lifecycle===Tn.default.Singleton||r.lifecycle==Tn.default.ContainerScoped||r.lifecycle==Tn.default.ResolutionScoped)&&(cn.isValueProvider(i)||cn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Tn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),cn.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(),cn.isNormalToken(e)){if(cn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Tn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Tn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!cn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Tn.default.Singleton})}resolve(e,t=new Dh.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&cn.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(Fh.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===Tn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Tn.default.Singleton,i=e.options.lifecycle===Tn.default.ContainerScoped,s=r||i,a;return cn.isValueProvider(e.provider)?a=e.provider.useValue:cn.isTokenProvider(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):cn.isClassProvider(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):cn.isFactoryProvider(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===Tn.default.ResolutionScoped&&t.scopedResolutions.set(e,a),a}resolveAll(e,t=new Dh.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&cn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let a=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,a,"All"),a}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!cn.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===Tn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Tn.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 Q4.__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 J4.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Bs.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 Z4.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Fh.isTokenDescriptor(r)?Fh.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new Dh.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 Dh.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Fh.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(X4.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Bs.instance=new c_;Bs.default=Bs.instance});var BT=S(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var tM=vo(),Vs=wa(),l_=Th(),rM=a_();function nM(){return function(n){let e=tM.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return l_.isTokenDescriptor(r)?l_.isTransformDescriptor(r)?r.multiple?Vs.instance.resolve(r.transform).transform(Vs.instance.resolveAll(r.token),...r.transformArgs):Vs.instance.resolve(r.transform).transform(Vs.instance.resolve(r.token),...r.transformArgs):r.multiple?Vs.instance.resolveAll(r.token):Vs.instance.resolve(r.token):l_.isTransformDescriptor(r)?Vs.instance.resolve(r.transform).transform(Vs.instance.resolve(r.token),...r.transformArgs):Vs.instance.resolve(r)}catch(s){let a=i+t.length;throw new Error(rM.formatErrorCtor(n,a,s))}})))}}}}o(nM,"autoInjectable");u_.default=nM});var VT=S(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var iM=vo();function sM(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return iM.defineInjectionTokenMetadata(t)}o(sM,"inject");f_.default=sM});var Nh=S(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var aM=vo(),oM=wa(),UT=wa();function cM(n){return function(e){oM.typeInfo.set(e,aM.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{UT.instance.register(t,e)}):UT.instance.register(n.token,e))}}o(cM,"injectable");d_.default=cM});var qT=S(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var lM=(Sh(),Bd(_h)),uM=wa();function fM(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=lM.__rest(t,["token","options"]);return uM.instance.register(r,s,i)}),e}}o(fM,"registry");h_.default=fM});var WT=S(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var dM=Nh(),hM=wa();function pM(){return function(n){dM.default()(n),hM.instance.registerSingleton(n)}}o(pM,"singleton");p_.default=pM});var GT=S(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var mM=vo();function gM(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return mM.defineInjectionTokenMetadata(t)}o(gM,"injectAll");m_.default=gM});var zT=S(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var yM=vo();function _M(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return yM.defineInjectionTokenMetadata(r)}o(_M,"injectAllWithTransform");g_.default=_M});var HT=S(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var SM=vo();function vM(n,e,...t){return SM.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}o(vM,"injectWithTransform");y_.default=vM});var QT=S(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var bM=Nh(),wM=wa();function EM(n,e){return function(t){bM.default()(t),wM.instance.register(e||t,t,{lifecycle:n})}}o(EM,"scoped");__.default=EM});var YT=S(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var TM=BT();Object.defineProperty(li,"autoInjectable",{enumerable:!0,get:o(function(){return TM.default},"get")});var AM=VT();Object.defineProperty(li,"inject",{enumerable:!0,get:o(function(){return AM.default},"get")});var xM=Nh();Object.defineProperty(li,"injectable",{enumerable:!0,get:o(function(){return xM.default},"get")});var CM=qT();Object.defineProperty(li,"registry",{enumerable:!0,get:o(function(){return CM.default},"get")});var IM=WT();Object.defineProperty(li,"singleton",{enumerable:!0,get:o(function(){return IM.default},"get")});var RM=GT();Object.defineProperty(li,"injectAll",{enumerable:!0,get:o(function(){return RM.default},"get")});var PM=zT();Object.defineProperty(li,"injectAllWithTransform",{enumerable:!0,get:o(function(){return PM.default},"get")});var OM=HT();Object.defineProperty(li,"injectWithTransform",{enumerable:!0,get:o(function(){return OM.default},"get")});var FM=QT();Object.defineProperty(li,"scoped",{enumerable:!0,get:o(function(){return FM.default},"get")})});var KT=S(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});function DM(n){let e;return t=>(e==null&&(e=n(t)),e)}o(DM,"instanceCachingFactory");S_.default=DM});var XT=S(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});function NM(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}o(NM,"instancePerContainerCachingFactory");v_.default=NM});var JT=S(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});function LM(n,e,t,r=!0){let i,s;return a=>{let c=n(a);return(!r||s!==c)&&((s=c)?i=a.resolve(e):i=a.resolve(t)),i}}o(LM,"predicateAwareClassFactory");b_.default=LM});var ZT=S(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});var kM=KT();Object.defineProperty(Bu,"instanceCachingFactory",{enumerable:!0,get:o(function(){return kM.default},"get")});var MM=XT();Object.defineProperty(Bu,"instancePerContainerCachingFactory",{enumerable:!0,get:o(function(){return MM.default},"get")});var jM=JT();Object.defineProperty(Bu,"predicateAwareClassFactory",{enumerable:!0,get:o(function(){return jM.default},"get")})});var le=S(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var w_=(Sh(),Bd(_h));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 $M=DT();Object.defineProperty(Ea,"Lifecycle",{enumerable:!0,get:o(function(){return $M.Lifecycle},"get")});w_.__exportStar(YT(),Ea);w_.__exportStar(ZT(),Ea);w_.__exportStar(J0(),Ea);var BM=Eh();Object.defineProperty(Ea,"delay",{enumerable:!0,get:o(function(){return BM.delay},"get")});var VM=wa();Object.defineProperty(Ea,"container",{enumerable:!0,get:o(function(){return VM.instance},"get")})});var Ac=S(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.NullLogger=void 0;Lh.NullLogger={debug(){},info(){},warn(){},error(){}}});var E_=S((oee,eA)=>{var xc=class{static{o(this,"Wildcard")}constructor(){return UM||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(xc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(xc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var UM=new xc;eA.exports.Wildcard=xc});var rA=S((lee,tA)=>{var qM=(function(){var n=o(function(I,C,P,N){for(P=P||{},N=I.length;N--;P[I[N]]=C);return P},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],a=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],_=[123,126],v=[1,67],E=[39,45,87],b=[13,16,45,197,224,308],A=[1,87],R=[2,281],B=[1,86],W=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],we=[6,28,29,53,63,70,73,81,83,85],z=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],G=[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],F=[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],j=[13,16,308],te=[112,132,327,334],Ye=[13,16,112,132,308],st=[1,111],Rt=[1,117],at=[112,132,327,328,334],ct=[13,16,112,132,308,328],Ke=[28,29,45,53,87],ie=[1,138],V=[1,151],lt=[1,128],pt=[1,127],H=[1,129],Re=[1,140],Ue=[1,141],re=[1,142],qe=[1,143],We=[1,144],$e=[1,145],Ge=[1,147],Ae=[1,148],Be=[2,457],Pe=[1,158],Ve=[1,159],ze=[1,160],ue=[1,152],pe=[1,153],me=[1,156],fe=[1,171],de=[1,172],he=[1,173],ce=[1,174],ge=[1,175],ye=[1,176],_e=[1,167],Se=[1,168],ae=[1,169],ve=[1,170],Ze=[1,157],He=[1,166],Me=[1,161],w=[1,162],T=[1,163],x=[1,164],O=[1,165],Z=[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],_t=[1,195],At=[6,31,73,81,83,85],De=[2,285],U=[1,199],q=[1,201],Q=[6,31,70,73,81,83,85],K=[2,283],Ie=[1,207],tt=[1,218],rt=[1,223],xr=[1,219],Sn=[1,225],Dn=[1,226],tn=[1,224],IE=[6,63,70,73,81,83,85],RE=[1,236],PE=[2,334],OE=[1,243],FE=[1,241],Cr=[6,193],_d=[2,349],DE=[2,339],ma=[28,128],NE=[47,48,193,272],Sd=[47,48,193,242,272],oc=[47,48,193,242,246,272],cc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],hr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],LE=[1,271],kE=[1,270],Yt=[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],ME=[1,281],jE=[1,280],rn=[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],du=[45,89],vd=[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],bd=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],wd=[31,89],Ed=[48,87],ro=[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],Ki=[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],$E=[1,313],lc=[6,85],dy=[6,31,81,83,85],BE=[2,361],Cs=[2,353],no=[1,343],hu=[31,112,335],Is=[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],hy=[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],VE=[6,109,193],io=[31,112],Kt=[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],py=[1,390],my=[1,391],ga=[13,16,87,197,308,314],UE=[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],Td=[1,417],Ad=[1,418],qE=[13,16,48,197,229,308],ya=[6,31,85],WE=[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],gy=[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],so=[29,31,85,112,159,160,161,163,164],xd=[1,443],Cd=[1,444],GE=[1,449],ao=[31,112,193,232,318,335],Id=[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],zE=[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],yy=[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],pu=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],mu=[31,45],HE=[1,507],QE=[1,508],YE=[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],Rd=[29,31,85,112,159,160,161,163,164,335],oo=[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],KE=[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],XE=[2,352],_y=[13,16,197,308,314],JE=[1,565],uc=[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],ZE=[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],Rs=[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],e2=[13,16,87,308],Ps=[2,364],fc=[29,31,85,112,159,160,161,163,164,193,232,318,335],Pd=[31,112,193,232,272,318,335],Os=[2,359],t2=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Od=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],r2=[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],n2=[2,347],Sy={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:o(function(C,P,N,ne,Oe,g,sn){var y=g.length-1;switch(Oe){case 1:if(g[y-1]=g[y-1]||{},Le.base&&(g[y-1].base=Le.base),Le.base="",g[y-1].prefixes=Le.prefixes,Le.prefixes=null,Le.pathOnly){if(g[y-1].type==="path"||"termType"in g[y-1])return g[y-1];throw new Error("Received full SPARQL query in path only mode")}else if(g[y-1].type==="path"||"termType"in g[y-1])throw new Error("Received only path in full SPARQL mode");if(g[y-1].type==="update"){let St={};for(let Nt of g[y-1].updates)if(Nt.updateType==="insert"){let nt={};for(let ut of Nt.insert)if(ut.type==="bgp"||ut.type==="graph")for(let vn of ut.triples)vn.subject.termType==="BlankNode"&&(nt[vn.subject.value]=!0),vn.predicate.termType==="BlankNode"&&(nt[vn.predicate.value]=!0),vn.object.termType==="BlankNode"&&(nt[vn.object.value]=!0);for(let ut of Object.keys(nt)){if(St[ut])throw new Error("Detected reuse blank node across different INSERT DATA clauses");St[ut]=!0}}}return g[y-1];case 2:this.$={...g[y-1],...g[y],type:"query"};break;case 4:Le.base=gu(g[y]);break;case 5:Le.prefixes||(Le.prefixes={}),g[y-1]=g[y-1].substr(0,g[y-1].length-1),g[y]=gu(g[y]),Le.prefixes[g[y-1]]=g[y];break;case 6:this.$={...g[y-3],...uo(g[y-2]),...g[y-1],...g[y]};break;case 7:if(!Le.skipValidation&&(Cy(g[y-3].variables.map(Nt=>xy(Nt.expression))).some(Nt=>Nt.aggregation==="count"&&!(Nt.expression instanceof Fd))||g[y].group)){for(let Nt of g[y-3].variables)if(Nt.termType==="Variable"){if(!g[y].group||!g[y].group.map(nt=>mc(nt)).includes(mc(Nt)))throw Error("Projection of ungrouped variable (?"+mc(Nt)+")")}else if(xy(Nt.expression).length===0){let nt=QD(Nt.expression);for(let ut of nt)if(!g[y].group||!g[y].group.map||!g[y].group.map(vn=>mc(vn)).includes(mc(ut)))throw Error("Use of ungrouped variable in projection of operation (?"+mc(ut)+")")}}let es=g[y-1].where.filter(St=>St.type==="query");if(es.length>0){let St=g[y-3].variables.filter(nt=>nt.variable&&nt.variable.value).map(nt=>nt.variable.value),Nt=Cy(es.map(nt=>nt.variables)).map(nt=>nt.value||nt.variable.value);for(let nt of St)if(Nt.indexOf(nt)>=0)throw Error("Target id of 'AS' (?"+nt+") already used in subquery")}this.$=qt(g[y-3],uo(g[y-2]),g[y-1],g[y]);break;case 8:this.$=qt({queryType:"CONSTRUCT",template:g[y-3]},uo(g[y-2]),g[y-1],g[y]);break;case 9:this.$=qt({queryType:"CONSTRUCT",template:g[y-2]=g[y-2]?g[y-2].triples:[]},uo(g[y-5]),{where:[{type:"bgp",triples:lo([],g[y-2])}]},g[y]);break;case 10:this.$=qt({queryType:"DESCRIBE",variables:g[y-3]==="*"?[new Fd]:g[y-3]},uo(g[y-2]),g[y-1],g[y]);break;case 11:this.$=qt({queryType:"ASK"},uo(g[y-2]),g[y-1],g[y]);break;case 12:this.$=qt(g[y-1],{variables:[new Fd]});break;case 13:let bu=g[y].map(St=>St.value||St.variable.value),gc=YD(bu);if(gc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+gc[0]+")");this.$=qt(g[y-1],{variables:g[y]});break;case 14:this.$=qt({queryType:"SELECT"},g[y]&&(g[y-1]=nn(g[y]),g[y]={},g[y][g[y-1]]=!0,g[y]));break;case 16:case 27:this.$=dc(g[y-3],{variable:g[y-1]});break;case 17:case 18:this.$=qt(g[y-3],g[y-2],g[y-1],g[y],{type:"query"});break;case 19:case 58:this.$={iri:g[y],named:!!g[y-1]};break;case 20:this.$={where:g[y].patterns};break;case 21:this.$=qt(g[y-1],g[y]);break;case 22:this.$=qt(g[y-2],g[y-1],g[y]);break;case 23:this.$={group:g[y]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=dc(g[y]);break;case 26:this.$=dc(g[y-1]);break;case 29:this.$={having:g[y]};break;case 30:this.$={order:g[y]};break;case 32:this.$=dc(g[y],{descending:!0});break;case 35:this.$={limit:pc(g[y])};break;case 36:this.$={offset:pc(g[y])};break;case 37:this.$={limit:pc(g[y-2]),offset:pc(g[y])};break;case 38:this.$={limit:pc(g[y]),offset:pc(g[y-2])};break;case 39:case 43:this.$={type:"values",values:g[y]};break;case 40:case 84:this.$=g[y-1].map(St=>({[g[y-3]]:St}));break;case 41:case 85:this.$=g[y-1].map(()=>({}));break;case 42:case 86:var Zi=g[y-4].length;g[y-4]=g[y-4].map(vy),this.$=g[y-1].map(function(St){if(St.length!==Zi)throw Error("Inconsistent VALUES length");for(var Nt={},nt=0;nt<Zi;nt++)Nt["?"+g[y-4][nt].value]=St[nt];return Nt});break;case 44:case 65:case 100:case 126:case 175:this.$=g[y-1];break;case 45:this.$={type:"update",updates:Fs(g[y-2],g[y-1])};break;case 46:this.$=qt({type:"load",silent:!!g[y-2],source:g[y-1]},g[y]&&{destination:g[y]});break;case 47:this.$={type:nn(g[y-2]),silent:!!g[y-1],graph:g[y]};break;case 48:this.$={type:nn(g[y-4]),silent:!!g[y-3],source:g[y-2],destination:g[y]};break;case 49:this.$={type:"create",silent:!!g[y-2],graph:{type:"graph",name:g[y]}};break;case 50:this.$={updateType:"insert",insert:p2(g[y])};break;case 51:this.$={updateType:"delete",delete:Py(p2(g[y]))};break;case 52:this.$={updateType:"deletewhere",delete:Py(g[y])};break;case 53:this.$={updateType:"insertdelete",...g[y-4],...g[y-3],...uo(g[y-2],"using"),where:g[y].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=g[y];break;case 55:this.$={delete:Py(g[y-1]),insert:g[y]||[]};break;case 56:this.$={delete:[],insert:g[y]};break;case 59:this.$={graph:g[y]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:g[y]};break;case 64:this.$={[nn(g[y])]:!0};break;case 66:this.$=g[y-1]?Xi(g[y],[g[y-1]]):Xi(g[y]);break;case 67:var Su=qt(g[y-3]||{triples:[]},{type:"graph",name:g[y-5]});this.$=g[y]?[Su,g[y]]:[Su];break;case 68:case 73:this.$={type:"bgp",triples:Xi(g[y-2],[g[y-1]])};break;case 69:this.$={type:"group",patterns:[g[y-1]]};break;case 70:for(let St of g[y-1].filter(Nt=>Nt.type==="bind")){let Nt=g[y-1].indexOf(St),nt=new Set;for(let ut of g[y-1].slice(0,Nt))(ut.type==="group"||ut.type==="bgp")&&d2(ut).forEach(vn=>nt.add(vn));if(nt.has(St.variable.value))throw Error("Variable used to bind is already bound (?"+St.variable.value+")")}this.$={type:"group",patterns:g[y-1]};break;case 71:this.$=g[y-1]?Xi([g[y-1]],g[y]):Xi(g[y]);break;case 72:this.$=g[y]?[g[y-2],g[y]]:g[y-2];break;case 75:this.$=qt(g[y],{type:"optional"});break;case 76:this.$=qt(g[y],{type:"minus"});break;case 77:this.$=qt(g[y],{type:"graph",name:g[y-1]});break;case 78:this.$=qt(g[y],{type:"service",name:g[y-1],silent:!!g[y-2]});break;case 79:this.$={type:"filter",expression:g[y]};break;case 80:this.$={type:"bind",variable:g[y-1],expression:g[y-3]};break;case 89:this.$=_u(g[y]);break;case 90:this.$=void 0;break;case 91:this.$=g[y-1].length?{type:"union",patterns:Xi(g[y-1].map(wy),[wy(g[y])])}:g[y];break;case 95:this.$={...g[y],function:g[y-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Fs(g[y-2],g[y-1]),distinct:!!g[y-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.$=Fs(g[y-2],g[y-1]);break;case 101:this.$=Xi(g[y-2],[g[y-1]]);break;case 102:case 112:this.$=Ry(g[y].map(St=>qt(Ds(g[y-1]),St)));break;case 103:this.$=Ry(lo(g[y].map(St=>qt(Ds(g[y-1].entity),St)),g[y-1].triples));break;case 105:this.$=Xi([g[y-1]],g[y]);break;case 106:this.$=Xi(g[y]);break;case 107:this.$=Ay(g[y-1],g[y]);break;case 109:case 237:this.$=Le.factory.namedNode(jD);break;case 110:case 118:this.$=Fs(g[y-1],g[y]);break;case 111:this.$=g[y]?{annotation:g[y],object:g[y-1]}:g[y-1];break;case 113:this.$=g[y]?Ry(lo(g[y].map(St=>qt(Ds(g[y-1].entity),St)),g[y-1].triples)):g[y-1].triples;break;case 114:this.$=Ay(...g[y-1],g[y]);break;case 116:this.$=Ay(...g[y]);break;case 117:case 159:case 163:this.$=[g[y-1],g[y]];break;case 119:this.$=g[y]?{object:g[y-1],annotation:g[y]}:g[y-1];break;case 120:this.$=g[y-1].length?hc("|",Fs(g[y-1],g[y])):g[y];break;case 121:this.$=g[y-1].length?hc("/",Fs(g[y-1],g[y])):g[y];break;case 122:this.$=g[y]?hc(g[y],[g[y-1]]):g[y-1];break;case 123:this.$=g[y-1]?hc(g[y-1],[g[y]]):g[y];break;case 125:case 131:this.$=hc(g[y-1],[g[y]]);break;case 129:this.$=hc("|",Fs(g[y-2],g[y-1]));break;case 132:case 134:this.$=zD(g[y-1]);break;case 133:case 135:this.$=HD(g[y-1]);break;case 140:this.$={entity:g[y],triples:[]};break;case 145:this.$=vy(g[y]);break;case 149:this.$=Le.factory.namedNode(i2);break;case 151:case 153:case 158:case 162:this.$=by(g[y-1],g[y]);break;case 152:this.$=["||",g[y]];break;case 154:this.$=["&&",g[y]];break;case 156:this.$=Ir(g[y-1],[g[y-2],g[y]]);break;case 157:this.$=Ir(g[y-2]?"notin":"in",[g[y-3],g[y]]);break;case 160:this.$=["+",by(g[y-1],g[y])];break;case 161:var Ld=Ji(g[y-1].value.replace("-",""),g[y-1].datatype);this.$=["-",by(Ld,g[y])];break;case 164:this.$=Ir("UPLUS",[g[y]]);break;case 165:this.$=Ir(g[y-1],[g[y]]);break;case 166:this.$=Ir("UMINUS",[g[y]]);break;case 177:this.$=Ir(nn(g[y-1]));break;case 178:this.$=Ir(nn(g[y-3]),[g[y-1]]);break;case 179:this.$=_u(Ir(nn(g[y-3]),[g[y-1]]));break;case 180:this.$=Ir(nn(g[y-5]),[g[y-3],g[y-1]]);break;case 181:this.$=Ir(nn(g[y-7]),[g[y-5],g[y-3],g[y-1]]);break;case 182:this.$=_u(Ir(nn(g[y-7]),[g[y-5],g[y-3],g[y-1]]));break;case 183:this.$=Ir(nn(g[y-1]),g[y]);break;case 184:this.$=Ir("bound",[vy(g[y-1])]);break;case 185:this.$=Ir(g[y-1],[]);break;case 186:this.$=Ir(g[y-3],[g[y-1]]);break;case 187:this.$=Ir(g[y-2]?"notexists":"exists",[wy(g[y])]);break;case 188:case 189:this.$=dc(g[y-1],{type:"aggregate",aggregation:nn(g[y-4]),distinct:!!g[y-2]});break;case 190:this.$=dc(g[y-2],{type:"aggregate",aggregation:nn(g[y-5]),distinct:!!g[y-3],separator:typeof g[y-1]=="string"?g[y-1]:" "});break;case 192:this.$=Ji(g[y]);break;case 193:this.$=UD(g[y-1],nn(g[y].substr(1)));break;case 194:this.$=Ji(g[y-2],g[y]);break;case 195:case 204:this.$=Ji(g[y],s2);break;case 196:case 205:this.$=Ji(g[y],a2);break;case 197:case 206:this.$=Ji(nn(g[y]),o2);break;case 200:this.$=Ji(g[y].toLowerCase(),VD);break;case 201:this.$=Ji(g[y].substr(1),s2);break;case 202:this.$=Ji(g[y].substr(1),a2);break;case 203:this.$=Ji(g[y].substr(1).toLowerCase(),o2);break;case 207:case 208:this.$=f2(g[y],1);break;case 209:case 210:this.$=f2(g[y],3);break;case 211:this.$=Le.factory.namedNode(gu(g[y]));break;case 213:var kd=g[y].indexOf(":"),vu=g[y].substr(0,kd),Md=Le.prefixes[vu];if(!Md)throw new Error("Unknown prefix: "+vu);var jt=gu(Md+g[y].substr(kd+1));this.$=Le.factory.namedNode(jt);break;case 214:if(g[y]=g[y].substr(0,g[y].length-1),!(g[y]in Le.prefixes))throw new Error("Unknown prefix: "+g[y]);var jt=gu(Le.prefixes[g[y]]);this.$=Le.factory.namedNode(jt);break;case 215:this.$=yu(g[y].replace(/^(_:)/,""));break;case 216:this.$=yu();break;case 217:case 218:case 232:this.$=_u(Ey(g[y-3],g[y-2],g[y-1]));break;case 230:case 231:this.$=_u(g[y-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:g[y-1].push(g[y]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[g[y]];break;case 308:g[y-3].push(g[y-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:g[y-2].push(g[y-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:a},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16: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(_,[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:v,87:h},n(E,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(b,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:A,29:R,52:84,53:B,56:85},{19:88,28:A,29:R,52:89,53:B,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:B},n(W,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(we,[2,263],{34:96}),n(we,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(we,[2,262]),n(z,[2,259]),n(G,[2,143]),n(G,[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(F,[2,211]),n(F,[2,212]),n(F,[2,213]),n(F,[2,214]),{19:98,28:A,29:R,52:99,53:B,56:85},{6:[2,309],99:100,193:[1,101]},n(j,[2,311],{101:102,328:[1,103]}),n(te,[2,317],{104:104,328:[1,105]}),n(Ye,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:st,114:110},{29:st,114:112},{29:st,114:113},{118:114,123:[1,115],125:116,126:Rt},n(at,[2,315]),n(at,[2,316]),n(ct,[2,319]),n(ct,[2,320]),n(ct,[2,321]),n(_,[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:v,87:h}),n(Ke,[2,269]),n(Ke,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(E,[2,14]),n(E,[2,274]),n(E,[2,271]),n(E,[2,272]),n(e,[2,4]),{13:[1,177]},n(Z,[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:_t,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(b,[2,419]),n(At,De,{20:196,59:197,69:198,70:U}),n(l,[2,250]),{29:q,57:200},n(j,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(Q,K,{23:204,58:205,62:206,63:Ie}),n(l,[2,252]),{19:208,28:A,29:R,52:209,53:B,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,145:212,172:221,185:213,187:214,231:xr,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(IE,[2,265],{56:85,35:227,52:228,19:229,28:A,29:R,53:B}),n(z,[2,260]),n(Q,K,{58:205,62:206,23:230,63:Ie}),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(j,[2,312]),{105:233,112:RE,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(te,[2,318]),n(j,PE,{108:240,133:242,112:OE,132:FE}),n(Ye,[2,323]),{112:[1,244]},{112:[2,325]},n(Cr,[2,50]),n(W,_d,{135:245,136:246,143:247,144:248,31:DE,112:DE}),n(Cr,[2,51]),n(Cr,[2,52]),n(ma,[2,328],{119:249}),{29:st,114:250},n(ma,[2,56]),{29:st,114:251},n(_,[2,59]),n(Ke,[2,270]),{47:[1,252]},n(NE,[2,150]),n(Sd,[2,428],{240:253}),n(oc,[2,430],{244:254}),n(oc,[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(cc,[2,440],{252:264}),n(hr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(hr,[2,167]),n(hr,[2,168]),n(hr,[2,169]),n(hr,[2,170],{176:269,45:LE,89:kE}),n(hr,[2,171]),n(hr,[2,172]),n(hr,[2,173]),n(hr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:ME,89:jE,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(rn,[2,192],{292:[1,286],293:[1,287]}),n(rn,[2,195]),n(rn,[2,196]),n(rn,[2,197]),n(rn,[2,198]),n(rn,[2,199]),n(rn,[2,200]),{13:f,16:d,44:39,55:40,82:V,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(du,[2,452]),n(du,[2,453]),n(du,[2,454]),n(du,[2,455]),n(du,[2,456]),{279:[2,458]},n(vd,[2,207]),n(vd,[2,208]),n(vd,[2,209]),n(vd,[2,210]),n(rn,[2,201]),n(rn,[2,202]),n(rn,[2,203]),n(rn,[2,204]),n(rn,[2,205]),n(rn,[2,206]),n(e,[2,5]),n(bd,[2,297],{88:295}),n(wd,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Ed,[2,301]),n(Z,[2,43]),n(Z,[2,82]),n(Z,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n(ro,[2,123]),n(ro,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(Ki,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:_t,223:312,225:308,226:309,229:$E,307:43,308:p},n(c,i,{215:10,214:314}),n(Ki,[2,236]),n(Ki,[2,237]),n(lc,[2,6]),n(dy,[2,287],{60:315,72:316,73:[1,317]}),n(At,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n([6,31,63,70,73,81,83,85],[2,20]),n(W,BE,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Cs,31:Cs,85:Cs,112:Cs,159:Cs,160:Cs,161:Cs,163:Cs,164:Cs,41:s}),{13:f,16:d,55:331,307:43,308:p},n(j,[2,280]),n(lc,[2,7]),n(At,De,{59:197,69:198,20:332,70:U}),n(Q,[2,284]),{64:[1,333]},n(Q,K,{58:205,62:206,23:334,63:Ie}),n(l,[2,254]),n(W,_d,{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:no,307:43,308:p},n(hu,[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:no,308:p}),n(Is,[2,227]),n(Is,[2,228]),n(Is,[2,229]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,172:221,185:351,187:350,200:348,230:347,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:no,307:43,308:p},n(Is,[2,146]),n(Is,[2,147]),n(Is,[2,148]),n(Is,[2,149]),{13:f,16:d,44:354,55:355,82:V,87:h,172:357,237:356,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:358,312:tn,313:353},n(hy,[2,215]),n(hy,[2,216]),n(Q,K,{58:205,62:206,23:359,63:Ie}),n(we,[2,264]),n(IE,[2,266]),n(lc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Cr,[2,313],{102:360,120:361,121:[1,362]}),n(Cr,[2,47]),n(Cr,[2,63]),n(Cr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(Cr,[2,336]),n(Cr,[2,337]),n(Cr,[2,338]),{109:[1,364]},n(VE,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(j,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(io,[2,341],{137:368}),n(io,[2,340]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,145:369,172:221,185:213,187:214,231:xr,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},{28:[1,370],127:371,128:[1,372]},n(ma,[2,330],{124:373,125:374,126:Rt}),n(ma,[2,57]),{44:375,87:h},n(NE,[2,151],{241:376,242:[1,377]}),n(Sd,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,247:380,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{250:[1,381]},n(Kt,[2,432]),n(Kt,[2,433]),n(Kt,[2,434]),n(Kt,[2,435]),n(Kt,[2,436]),n(Kt,[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:fe,298:de,299:he,300:ce,301:ge,302:ye}),n(cc,[2,162],{261:388,262:389,39:py,338:my}),n(hr,[2,164]),n(hr,[2,165]),n(hr,[2,166]),n(Yt,[2,95]),n(Yt,[2,96]),n(Kt,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Yt,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,183]),n(Yt,[2,98]),n(Kt,[2,381],{180:400}),{87:[1,401]},n(Yt,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{29:q,57:403},n(rn,[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:no,307:43,308:p},n(ga,[2,233]),n(ga,[2,234]),n(ga,[2,235]),n(UE,[2,459],{281:406,325:[1,407]}),n(Kt,[2,463],{284:408,325:[1,409]}),n(Kt,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:V,171:413,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,419],89:[1,420]},{29:[1,421]},n(Ed,[2,302]),n(bd,[2,367],{167:422}),n(wd,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Ed,[2,371]),n(ro,[2,122]),n(ro,[2,417]),n(ro,[2,413]),n(ro,[2,414]),n(ro,[2,415]),n(Ki,[2,125]),n(Ki,[2,127]),n(Ki,[2,128]),n(qE,[2,420],{227:426}),n(Ki,[2,130]),{13:f,16:d,55:194,197:_t,223:427,307:43,308:p},{48:[1,428]},n(ya,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(dy,[2,288]),{64:[1,433]},n(At,[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:ie,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(WE,[2,293]),n(gy,[2,92]),n(gy,[2,93]),n(gy,[2,94]),{45:LE,89:kE,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:A,29:R,56:85},{19:438,28:A,29:R,56:85},n(so,[2,355],{149:439}),n(so,[2,354]),{13:f,16:d,44:215,45:xd,55:220,82:V,87:h,89:rt,156:440,172:221,185:441,203:442,231:Cd,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(we,[2,19]),n(ya,[2,21]),{13:f,16:d,44:450,45:GE,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n(lc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(W,[2,386],{31:[2,388]}),n(hu,[2,102]),n(ao,[2,391],{191:452}),n(W,[2,395],{196:453,198:454}),n(W,[2,108]),n(W,[2,109]),n(hu,[2,103]),n(hu,[2,104]),n(hu,[2,390]),{13:f,16:d,44:215,45:tt,48:[1,455],55:220,82:V,87:h,89:rt,172:221,185:351,187:350,200:456,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Id,[2,424]),n(zE,[2,136]),n(zE,[2,137]),n(yy,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:no,307:43,308:p},n(ga,[2,219]),n(ga,[2,220]),n(ga,[2,221]),n(ga,[2,222]),n(ga,[2,223]),n(lc,[2,10]),n(Cr,[2,46]),n(Cr,[2,314]),{112:RE,122:459},n(Cr,[2,62]),n(j,PE,{133:242,108:460,112:OE,132:FE}),n(VE,[2,61]),n(Cr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(io,[2,351],{146:463,335:[1,464]}),{29:q,57:465},n(ma,[2,329]),n(j,[2,332],{129:466,327:[1,467]}),n(ma,[2,55]),n(ma,[2,331]),{48:[1,468]},n(Sd,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oc,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,243:470,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oc,[2,156]),{45:ME,89:jE,179:471},n(cc,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,251:472,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(hr,[2,444],{256:473}),n(hr,[2,446],{258:474}),n(Kt,[2,442]),n(Kt,[2,443]),n(hr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,255:154,257:155,259:475,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,450]),n(Kt,[2,451]),n(Kt,[2,379],{178:476}),n(Kt,[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:ie,46:482,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{48:[1,483]},{48:[1,484]},n(Yt,[2,187]),n(rn,[2,194]),{13:f,16:d,44:39,55:40,82:V,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,282:486,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(UE,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,466]),n(Z,[2,40]),n(bd,[2,298]),n(pu,[2,87]),n(pu,[2,88]),n(pu,[2,89]),n(pu,[2,90]),{13:f,16:d,55:492,82:V,172:493,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,311:494,312:tn,315:491},n(Z,[2,41]),n(wd,[2,300]),n(mu,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:V,171:497,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,498],89:[1,499]},{29:[1,500]},n(Ed,[2,372]),{13:f,16:d,48:[2,422],55:194,197:_t,223:312,226:502,228:501,229:$E,307:43,308:p},n(Ki,[2,131]),n(Ki,[2,126]),n(ya,[2,22]),n(ya,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:HE,77:320,78:QE,79:509,87:h,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n(WE,[2,294]),n(YE,[2,69]),n(YE,[2,70]),n(At,De,{59:197,69:198,20:511,70:U}),n(Q,K,{58:205,62:206,23:512,63:Ie}),{29:[2,375],31:[2,71],84:522,85:a,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(so,[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(Rd,[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:xd,55:220,82:V,87:h,89:rt,172:221,185:351,203:536,212:534,231:Cd,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(Q,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:GE,87:h,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(oo,[2,291]),n(oo,[2,24]),n(oo,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oo,[2,28]),n(Q,K,{58:205,62:206,23:540,63:Ie}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(ao,[2,107]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,172:221,185:351,187:350,199:543,200:544,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(KE,[2,132]),n(Id,[2,425]),n(KE,[2,133]),{13:f,16:d,44:354,55:355,82:V,87:h,172:357,237:356,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:358,312:tn,313:545},n(Cr,[2,54]),n(Cr,[2,48]),n(io,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(io,[2,68]),n(W,[2,350],{31:XE,112:XE}),n(Cr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(j,[2,333]),n(Ke,[2,16]),n(Sd,[2,152]),n(oc,[2,154]),n(oc,[2,157]),n(cc,[2,159]),n(cc,[2,160],{262:389,261:548,39:py,338:my}),n(cc,[2,161],{262:389,261:549,39:py,338:my}),n(hr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,178]),n(Yt,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{48:[1,554],272:[1,555]},n(Yt,[2,184]),n(Yt,[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:_t,223:562,307:43,308:p},n(_y,[2,224]),n(_y,[2,225]),n(_y,[2,226]),{31:[1,563],45:JE,94:564},n(Z,[2,84]),n(bd,[2,368]),n(Z,[2,85]),n(wd,[2,370]),n(mu,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ya,[2,35],{83:[1,569]}),n(ya,[2,36],{81:[1,570]}),n(dy,[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:ie,76:HE,78:QE,87:h,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(uc,[2,295]),{45:ie,77:572},{45:ie,77:573},n(uc,[2,33]),n(uc,[2,34]),{31:[2,275],50:574,84:575,85:a},{31:[2,277],51:576,84:577,85:a},n(so,[2,356]),n(ZE,[2,357],{152:578,335:[1,579]}),n(Rs,[2,74]),{29:q,57:580},{29:q,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(e2,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},{45:[1,586]},n(Rs,[2,81]),{29:q,57:587},n(so,[2,73]),n(W,[2,362],{29:Ps,31:Ps,85:Ps,112:Ps,159:Ps,160:Ps,161:Ps,163:Ps,164:Ps}),n(Rd,[2,112]),n(fc,[2,401],{206:588}),n(W,[2,405],{209:589,210:590}),n(W,[2,403]),n(W,[2,404]),n(Rd,[2,113]),n(Rd,[2,400]),{13:f,16:d,44:215,45:xd,48:[1,591],55:220,82:V,87:h,89:rt,172:221,185:351,203:536,212:592,231:Cd,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Id,[2,426]),n(yy,[2,138]),n(yy,[2,139]),{232:[1,593]},n(oo,[2,292]),{47:[1,595],48:[1,594]},n(lc,[2,9]),n(ao,[2,392]),n(ao,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:no,308:p}),n(ao,[2,110],{272:[1,598]}),n(Pd,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(ma,[2,58]),n(hr,[2,445]),n(hr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Yt,[2,99]),n(Kt,[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(Yt,[2,188]),n(Yt,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:V,172:493,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,311:494,312:tn,315:611},n(Z,[2,42]),n(mu,[2,304]),{13:f,16:d,55:414,82:V,95:612,171:613,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,614],45:JE,94:615},n(Ki,[2,129]),n(qE,[2,421]),{82:[1,616]},{82:[1,617]},n(uc,[2,296]),n(uc,[2,31]),n(uc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(W,BE,{155:330,153:618,154:619,29:Os,31:Os,85:Os,112:Os,159:Os,160:Os,161:Os,163:Os,164:Os}),n(ZE,[2,358]),n(Rs,[2,75]),n(Rs,[2,76]),{29:q,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(e2,[2,366]),n(Rs,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Rs,[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(fc,[2,117]),{13:f,16:d,44:215,45:xd,55:220,82:V,87:h,89:rt,172:221,185:351,203:536,211:626,212:627,231:Cd,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Is,[2,134]),n(Id,[2,427]),n(Is,[2,135]),n(oo,[2,26]),{44:628,87:h},n(ao,[2,106]),n(ao,[2,394]),n(W,[2,396]),n(Pd,[2,111]),n(Pd,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:no,307:43,308:p},n(hy,[2,217]),n(W,_d,{144:248,140:630,143:631,31:[2,343]}),n(Yt,[2,97]),n(Kt,[2,380]),n(Yt,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:V,171:637,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},n(t2,[2,305]),n(Z,[2,86]),n(mu,[2,374]),n(ya,[2,37]),n(ya,[2,38]),n(so,[2,72]),n(so,[2,360]),n(Rs,[2,77]),{29:q,57:638},{47:[1,639]},{29:[2,376]},n(fc,[2,402]),n(fc,[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(fc,[2,118],{272:[1,641]}),n(Od,[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:_e,304:Se,305:ae,306:ve},n(pu,[2,218]),n(mu,[2,44]),n(t2,[2,306]),n(Rs,[2,78]),{44:651,87:h},n(fc,[2,116]),n(W,[2,406]),n(Od,[2,119]),n(Od,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(oo,[2,27]),n(Pd,[2,230]),n(r2,[2,345],{141:653,335:[1,654]}),n(Yt,[2,181]),n(Yt,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(W,_d,{144:248,142:657,143:658,31:n2,112:n2}),n(r2,[2,346]),n(Rs,[2,80]),n(Od,[2,231]),n(io,[2,67]),n(io,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:o(function(C,P){if(P.recoverable)this.trace(C);else{var N=new Error(C);throw N.hash=P,N}},"parseError"),parse:o(function(C){var P=this,N=[0],ne=[],Oe=[null],g=[],sn=this.table,y="",Zi=0,Su=0,Ld=0,kd=2,vu=1,Md=g.slice.call(arguments,1),jt=Object.create(this.lexer),es={yy:{}};for(var bu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bu)&&(es.yy[bu]=this.yy[bu]);jt.setInput(C,es.yy),es.yy.lexer=jt,es.yy.parser=this,typeof jt.yylloc>"u"&&(jt.yylloc={});var gc=jt.yylloc;g.push(gc);var St=jt.options&&jt.options.ranges;typeof es.yy.parseError=="function"?this.parseError=es.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nt(ts){N.length=N.length-2*ts,Oe.length=Oe.length-ts,g.length=g.length-ts}o(Nt,"popStack");for(var nt=o(function(){var ts;return ts=jt.lex()||vu,typeof ts!="number"&&(ts=P.symbols_[ts]||ts),ts},"lex"),ut,vn,fo,Un,TK,Oy,yc={},jd,Ns,m2,$d;;){if(fo=N[N.length-1],this.defaultActions[fo]?Un=this.defaultActions[fo]:((ut===null||typeof ut>"u")&&(ut=nt()),Un=sn[fo]&&sn[fo][ut]),typeof Un>"u"||!Un.length||!Un[0]){var Fy="";$d=[];for(jd in sn[fo])this.terminals_[jd]&&jd>kd&&$d.push("'"+this.terminals_[jd]+"'");jt.showPosition?Fy="Parse error on line "+(Zi+1)+`:
33
+ `)}o(G4,"composeErrorMessage");function z4(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=W4(r,e);return G4(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}o(z4,"formatErrorCtor");Ih.formatErrorCtor=z4});var MT=S(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.isDisposable=void 0;function H4(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}o(H4,"isDisposable");Rh.isDisposable=H4});var $T=S(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PostResolutionInterceptors=wo.PreResolutionInterceptors=void 0;var jT=t_(),Ph=class extends jT.default{static{o(this,"PreResolutionInterceptors")}};wo.PreResolutionInterceptors=Ph;var Oh=class extends jT.default{static{o(this,"PostResolutionInterceptors")}};wo.PostResolutionInterceptors=Oh;var o_=class{static{o(this,"Interceptors")}constructor(){this.preResolution=new Ph,this.postResolution=new Oh}};wo.default=o_});var wa=S(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.instance=Bs.typeInfo=void 0;var Q4=(Sh(),Bd(_h)),cn=J0(),Y4=NT(),Fh=Th(),K4=LT(),Tn=z0(),Dh=kT(),X4=a_(),J4=Eh(),Z4=MT(),eM=$T();Bs.typeInfo=new Map;var c_=class n{static{o(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new K4.default,this.interceptors=new eM.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Tn.default.Transient}){this.ensureNotDisposed();let i;if(Y4.isProvider(t)?i=t:i={useClass:t},cn.isTokenProvider(i)){let s=[e],a=i;for(;a!=null;){let c=a.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&cn.isTokenProvider(l.provider)?a=l.provider:a=null}}if((r.lifecycle===Tn.default.Singleton||r.lifecycle==Tn.default.ContainerScoped||r.lifecycle==Tn.default.ResolutionScoped)&&(cn.isValueProvider(i)||cn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Tn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),cn.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(),cn.isNormalToken(e)){if(cn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Tn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Tn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!cn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Tn.default.Singleton})}resolve(e,t=new Dh.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&cn.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(Fh.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===Tn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Tn.default.Singleton,i=e.options.lifecycle===Tn.default.ContainerScoped,s=r||i,a;return cn.isValueProvider(e.provider)?a=e.provider.useValue:cn.isTokenProvider(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):cn.isClassProvider(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):cn.isFactoryProvider(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===Tn.default.ResolutionScoped&&t.scopedResolutions.set(e,a),a}resolveAll(e,t=new Dh.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&cn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let a=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,a,"All"),a}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!cn.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===Tn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Tn.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 Q4.__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 J4.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Bs.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 Z4.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Fh.isTokenDescriptor(r)?Fh.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new Dh.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 Dh.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Fh.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(X4.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Bs.instance=new c_;Bs.default=Bs.instance});var BT=S(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var tM=vo(),Vs=wa(),l_=Th(),rM=a_();function nM(){return function(n){let e=tM.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return l_.isTokenDescriptor(r)?l_.isTransformDescriptor(r)?r.multiple?Vs.instance.resolve(r.transform).transform(Vs.instance.resolveAll(r.token),...r.transformArgs):Vs.instance.resolve(r.transform).transform(Vs.instance.resolve(r.token),...r.transformArgs):r.multiple?Vs.instance.resolveAll(r.token):Vs.instance.resolve(r.token):l_.isTransformDescriptor(r)?Vs.instance.resolve(r.transform).transform(Vs.instance.resolve(r.token),...r.transformArgs):Vs.instance.resolve(r)}catch(s){let a=i+t.length;throw new Error(rM.formatErrorCtor(n,a,s))}})))}}}}o(nM,"autoInjectable");u_.default=nM});var VT=S(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var iM=vo();function sM(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return iM.defineInjectionTokenMetadata(t)}o(sM,"inject");f_.default=sM});var Nh=S(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var aM=vo(),oM=wa(),UT=wa();function cM(n){return function(e){oM.typeInfo.set(e,aM.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{UT.instance.register(t,e)}):UT.instance.register(n.token,e))}}o(cM,"injectable");d_.default=cM});var qT=S(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var lM=(Sh(),Bd(_h)),uM=wa();function fM(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=lM.__rest(t,["token","options"]);return uM.instance.register(r,s,i)}),e}}o(fM,"registry");h_.default=fM});var WT=S(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var dM=Nh(),hM=wa();function pM(){return function(n){dM.default()(n),hM.instance.registerSingleton(n)}}o(pM,"singleton");p_.default=pM});var GT=S(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var mM=vo();function gM(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return mM.defineInjectionTokenMetadata(t)}o(gM,"injectAll");m_.default=gM});var zT=S(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var yM=vo();function _M(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return yM.defineInjectionTokenMetadata(r)}o(_M,"injectAllWithTransform");g_.default=_M});var HT=S(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var SM=vo();function vM(n,e,...t){return SM.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}o(vM,"injectWithTransform");y_.default=vM});var QT=S(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var bM=Nh(),wM=wa();function EM(n,e){return function(t){bM.default()(t),wM.instance.register(e||t,t,{lifecycle:n})}}o(EM,"scoped");__.default=EM});var YT=S(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var TM=BT();Object.defineProperty(li,"autoInjectable",{enumerable:!0,get:o(function(){return TM.default},"get")});var AM=VT();Object.defineProperty(li,"inject",{enumerable:!0,get:o(function(){return AM.default},"get")});var xM=Nh();Object.defineProperty(li,"injectable",{enumerable:!0,get:o(function(){return xM.default},"get")});var CM=qT();Object.defineProperty(li,"registry",{enumerable:!0,get:o(function(){return CM.default},"get")});var IM=WT();Object.defineProperty(li,"singleton",{enumerable:!0,get:o(function(){return IM.default},"get")});var RM=GT();Object.defineProperty(li,"injectAll",{enumerable:!0,get:o(function(){return RM.default},"get")});var PM=zT();Object.defineProperty(li,"injectAllWithTransform",{enumerable:!0,get:o(function(){return PM.default},"get")});var OM=HT();Object.defineProperty(li,"injectWithTransform",{enumerable:!0,get:o(function(){return OM.default},"get")});var FM=QT();Object.defineProperty(li,"scoped",{enumerable:!0,get:o(function(){return FM.default},"get")})});var KT=S(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});function DM(n){let e;return t=>(e==null&&(e=n(t)),e)}o(DM,"instanceCachingFactory");S_.default=DM});var XT=S(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});function NM(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}o(NM,"instancePerContainerCachingFactory");v_.default=NM});var JT=S(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});function LM(n,e,t,r=!0){let i,s;return a=>{let c=n(a);return(!r||s!==c)&&((s=c)?i=a.resolve(e):i=a.resolve(t)),i}}o(LM,"predicateAwareClassFactory");b_.default=LM});var ZT=S(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});var kM=KT();Object.defineProperty(Bu,"instanceCachingFactory",{enumerable:!0,get:o(function(){return kM.default},"get")});var MM=XT();Object.defineProperty(Bu,"instancePerContainerCachingFactory",{enumerable:!0,get:o(function(){return MM.default},"get")});var jM=JT();Object.defineProperty(Bu,"predicateAwareClassFactory",{enumerable:!0,get:o(function(){return jM.default},"get")})});var le=S(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var w_=(Sh(),Bd(_h));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 $M=DT();Object.defineProperty(Ea,"Lifecycle",{enumerable:!0,get:o(function(){return $M.Lifecycle},"get")});w_.__exportStar(YT(),Ea);w_.__exportStar(ZT(),Ea);w_.__exportStar(J0(),Ea);var BM=Eh();Object.defineProperty(Ea,"delay",{enumerable:!0,get:o(function(){return BM.delay},"get")});var VM=wa();Object.defineProperty(Ea,"container",{enumerable:!0,get:o(function(){return VM.instance},"get")})});var Ac=S(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.NullLogger=void 0;Lh.NullLogger={debug(){},info(){},warn(){},error(){}}});var E_=S((oee,eA)=>{var xc=class{static{o(this,"Wildcard")}constructor(){return UM||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(xc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(xc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var UM=new xc;eA.exports.Wildcard=xc});var rA=S((lee,tA)=>{var qM=(function(){var n=o(function(I,C,P,N){for(P=P||{},N=I.length;N--;P[I[N]]=C);return P},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],a=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],_=[123,126],v=[1,67],E=[39,45,87],b=[13,16,45,197,224,308],A=[1,87],R=[2,281],B=[1,86],W=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],we=[6,28,29,53,63,70,73,81,83,85],z=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],G=[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],F=[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],j=[13,16,308],te=[112,132,327,334],Ye=[13,16,112,132,308],st=[1,111],Rt=[1,117],at=[112,132,327,328,334],ct=[13,16,112,132,308,328],Ke=[28,29,45,53,87],ie=[1,138],V=[1,151],lt=[1,128],pt=[1,127],H=[1,129],Re=[1,140],Ue=[1,141],re=[1,142],qe=[1,143],We=[1,144],$e=[1,145],Ge=[1,147],Ae=[1,148],Be=[2,457],Pe=[1,158],Ve=[1,159],ze=[1,160],ue=[1,152],pe=[1,153],me=[1,156],fe=[1,171],de=[1,172],he=[1,173],ce=[1,174],ge=[1,175],ye=[1,176],_e=[1,167],Se=[1,168],ae=[1,169],ve=[1,170],Ze=[1,157],He=[1,166],Me=[1,161],w=[1,162],T=[1,163],x=[1,164],O=[1,165],Z=[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],_t=[1,195],At=[6,31,73,81,83,85],De=[2,285],U=[1,199],q=[1,201],Q=[6,31,70,73,81,83,85],K=[2,283],Ie=[1,207],tt=[1,218],rt=[1,223],xr=[1,219],Sn=[1,225],Dn=[1,226],tn=[1,224],IE=[6,63,70,73,81,83,85],RE=[1,236],PE=[2,334],OE=[1,243],FE=[1,241],Cr=[6,193],_d=[2,349],DE=[2,339],ma=[28,128],NE=[47,48,193,272],Sd=[47,48,193,242,272],oc=[47,48,193,242,246,272],cc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],pr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],LE=[1,271],kE=[1,270],Yt=[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],ME=[1,281],jE=[1,280],rn=[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],du=[45,89],vd=[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],bd=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],wd=[31,89],Ed=[48,87],ro=[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],Ki=[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],$E=[1,313],lc=[6,85],dy=[6,31,81,83,85],BE=[2,361],Cs=[2,353],no=[1,343],hu=[31,112,335],Is=[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],hy=[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],VE=[6,109,193],io=[31,112],Kt=[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],py=[1,390],my=[1,391],ga=[13,16,87,197,308,314],UE=[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],Td=[1,417],Ad=[1,418],qE=[13,16,48,197,229,308],ya=[6,31,85],WE=[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],gy=[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],so=[29,31,85,112,159,160,161,163,164],xd=[1,443],Cd=[1,444],GE=[1,449],ao=[31,112,193,232,318,335],Id=[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],zE=[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],yy=[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],pu=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],mu=[31,45],HE=[1,507],QE=[1,508],YE=[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],Rd=[29,31,85,112,159,160,161,163,164,335],oo=[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],KE=[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],XE=[2,352],_y=[13,16,197,308,314],JE=[1,565],uc=[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],ZE=[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],Rs=[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],e2=[13,16,87,308],Ps=[2,364],fc=[29,31,85,112,159,160,161,163,164,193,232,318,335],Pd=[31,112,193,232,272,318,335],Os=[2,359],t2=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Od=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],r2=[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],n2=[2,347],Sy={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:o(function(C,P,N,ne,Oe,g,sn){var y=g.length-1;switch(Oe){case 1:if(g[y-1]=g[y-1]||{},Le.base&&(g[y-1].base=Le.base),Le.base="",g[y-1].prefixes=Le.prefixes,Le.prefixes=null,Le.pathOnly){if(g[y-1].type==="path"||"termType"in g[y-1])return g[y-1];throw new Error("Received full SPARQL query in path only mode")}else if(g[y-1].type==="path"||"termType"in g[y-1])throw new Error("Received only path in full SPARQL mode");if(g[y-1].type==="update"){let St={};for(let Nt of g[y-1].updates)if(Nt.updateType==="insert"){let nt={};for(let ut of Nt.insert)if(ut.type==="bgp"||ut.type==="graph")for(let vn of ut.triples)vn.subject.termType==="BlankNode"&&(nt[vn.subject.value]=!0),vn.predicate.termType==="BlankNode"&&(nt[vn.predicate.value]=!0),vn.object.termType==="BlankNode"&&(nt[vn.object.value]=!0);for(let ut of Object.keys(nt)){if(St[ut])throw new Error("Detected reuse blank node across different INSERT DATA clauses");St[ut]=!0}}}return g[y-1];case 2:this.$={...g[y-1],...g[y],type:"query"};break;case 4:Le.base=gu(g[y]);break;case 5:Le.prefixes||(Le.prefixes={}),g[y-1]=g[y-1].substr(0,g[y-1].length-1),g[y]=gu(g[y]),Le.prefixes[g[y-1]]=g[y];break;case 6:this.$={...g[y-3],...uo(g[y-2]),...g[y-1],...g[y]};break;case 7:if(!Le.skipValidation&&(Cy(g[y-3].variables.map(Nt=>xy(Nt.expression))).some(Nt=>Nt.aggregation==="count"&&!(Nt.expression instanceof Fd))||g[y].group)){for(let Nt of g[y-3].variables)if(Nt.termType==="Variable"){if(!g[y].group||!g[y].group.map(nt=>mc(nt)).includes(mc(Nt)))throw Error("Projection of ungrouped variable (?"+mc(Nt)+")")}else if(xy(Nt.expression).length===0){let nt=QD(Nt.expression);for(let ut of nt)if(!g[y].group||!g[y].group.map||!g[y].group.map(vn=>mc(vn)).includes(mc(ut)))throw Error("Use of ungrouped variable in projection of operation (?"+mc(ut)+")")}}let es=g[y-1].where.filter(St=>St.type==="query");if(es.length>0){let St=g[y-3].variables.filter(nt=>nt.variable&&nt.variable.value).map(nt=>nt.variable.value),Nt=Cy(es.map(nt=>nt.variables)).map(nt=>nt.value||nt.variable.value);for(let nt of St)if(Nt.indexOf(nt)>=0)throw Error("Target id of 'AS' (?"+nt+") already used in subquery")}this.$=qt(g[y-3],uo(g[y-2]),g[y-1],g[y]);break;case 8:this.$=qt({queryType:"CONSTRUCT",template:g[y-3]},uo(g[y-2]),g[y-1],g[y]);break;case 9:this.$=qt({queryType:"CONSTRUCT",template:g[y-2]=g[y-2]?g[y-2].triples:[]},uo(g[y-5]),{where:[{type:"bgp",triples:lo([],g[y-2])}]},g[y]);break;case 10:this.$=qt({queryType:"DESCRIBE",variables:g[y-3]==="*"?[new Fd]:g[y-3]},uo(g[y-2]),g[y-1],g[y]);break;case 11:this.$=qt({queryType:"ASK"},uo(g[y-2]),g[y-1],g[y]);break;case 12:this.$=qt(g[y-1],{variables:[new Fd]});break;case 13:let bu=g[y].map(St=>St.value||St.variable.value),gc=YD(bu);if(gc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+gc[0]+")");this.$=qt(g[y-1],{variables:g[y]});break;case 14:this.$=qt({queryType:"SELECT"},g[y]&&(g[y-1]=nn(g[y]),g[y]={},g[y][g[y-1]]=!0,g[y]));break;case 16:case 27:this.$=dc(g[y-3],{variable:g[y-1]});break;case 17:case 18:this.$=qt(g[y-3],g[y-2],g[y-1],g[y],{type:"query"});break;case 19:case 58:this.$={iri:g[y],named:!!g[y-1]};break;case 20:this.$={where:g[y].patterns};break;case 21:this.$=qt(g[y-1],g[y]);break;case 22:this.$=qt(g[y-2],g[y-1],g[y]);break;case 23:this.$={group:g[y]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=dc(g[y]);break;case 26:this.$=dc(g[y-1]);break;case 29:this.$={having:g[y]};break;case 30:this.$={order:g[y]};break;case 32:this.$=dc(g[y],{descending:!0});break;case 35:this.$={limit:pc(g[y])};break;case 36:this.$={offset:pc(g[y])};break;case 37:this.$={limit:pc(g[y-2]),offset:pc(g[y])};break;case 38:this.$={limit:pc(g[y]),offset:pc(g[y-2])};break;case 39:case 43:this.$={type:"values",values:g[y]};break;case 40:case 84:this.$=g[y-1].map(St=>({[g[y-3]]:St}));break;case 41:case 85:this.$=g[y-1].map(()=>({}));break;case 42:case 86:var Zi=g[y-4].length;g[y-4]=g[y-4].map(vy),this.$=g[y-1].map(function(St){if(St.length!==Zi)throw Error("Inconsistent VALUES length");for(var Nt={},nt=0;nt<Zi;nt++)Nt["?"+g[y-4][nt].value]=St[nt];return Nt});break;case 44:case 65:case 100:case 126:case 175:this.$=g[y-1];break;case 45:this.$={type:"update",updates:Fs(g[y-2],g[y-1])};break;case 46:this.$=qt({type:"load",silent:!!g[y-2],source:g[y-1]},g[y]&&{destination:g[y]});break;case 47:this.$={type:nn(g[y-2]),silent:!!g[y-1],graph:g[y]};break;case 48:this.$={type:nn(g[y-4]),silent:!!g[y-3],source:g[y-2],destination:g[y]};break;case 49:this.$={type:"create",silent:!!g[y-2],graph:{type:"graph",name:g[y]}};break;case 50:this.$={updateType:"insert",insert:p2(g[y])};break;case 51:this.$={updateType:"delete",delete:Py(p2(g[y]))};break;case 52:this.$={updateType:"deletewhere",delete:Py(g[y])};break;case 53:this.$={updateType:"insertdelete",...g[y-4],...g[y-3],...uo(g[y-2],"using"),where:g[y].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=g[y];break;case 55:this.$={delete:Py(g[y-1]),insert:g[y]||[]};break;case 56:this.$={delete:[],insert:g[y]};break;case 59:this.$={graph:g[y]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:g[y]};break;case 64:this.$={[nn(g[y])]:!0};break;case 66:this.$=g[y-1]?Xi(g[y],[g[y-1]]):Xi(g[y]);break;case 67:var Su=qt(g[y-3]||{triples:[]},{type:"graph",name:g[y-5]});this.$=g[y]?[Su,g[y]]:[Su];break;case 68:case 73:this.$={type:"bgp",triples:Xi(g[y-2],[g[y-1]])};break;case 69:this.$={type:"group",patterns:[g[y-1]]};break;case 70:for(let St of g[y-1].filter(Nt=>Nt.type==="bind")){let Nt=g[y-1].indexOf(St),nt=new Set;for(let ut of g[y-1].slice(0,Nt))(ut.type==="group"||ut.type==="bgp")&&d2(ut).forEach(vn=>nt.add(vn));if(nt.has(St.variable.value))throw Error("Variable used to bind is already bound (?"+St.variable.value+")")}this.$={type:"group",patterns:g[y-1]};break;case 71:this.$=g[y-1]?Xi([g[y-1]],g[y]):Xi(g[y]);break;case 72:this.$=g[y]?[g[y-2],g[y]]:g[y-2];break;case 75:this.$=qt(g[y],{type:"optional"});break;case 76:this.$=qt(g[y],{type:"minus"});break;case 77:this.$=qt(g[y],{type:"graph",name:g[y-1]});break;case 78:this.$=qt(g[y],{type:"service",name:g[y-1],silent:!!g[y-2]});break;case 79:this.$={type:"filter",expression:g[y]};break;case 80:this.$={type:"bind",variable:g[y-1],expression:g[y-3]};break;case 89:this.$=_u(g[y]);break;case 90:this.$=void 0;break;case 91:this.$=g[y-1].length?{type:"union",patterns:Xi(g[y-1].map(wy),[wy(g[y])])}:g[y];break;case 95:this.$={...g[y],function:g[y-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Fs(g[y-2],g[y-1]),distinct:!!g[y-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.$=Fs(g[y-2],g[y-1]);break;case 101:this.$=Xi(g[y-2],[g[y-1]]);break;case 102:case 112:this.$=Ry(g[y].map(St=>qt(Ds(g[y-1]),St)));break;case 103:this.$=Ry(lo(g[y].map(St=>qt(Ds(g[y-1].entity),St)),g[y-1].triples));break;case 105:this.$=Xi([g[y-1]],g[y]);break;case 106:this.$=Xi(g[y]);break;case 107:this.$=Ay(g[y-1],g[y]);break;case 109:case 237:this.$=Le.factory.namedNode(jD);break;case 110:case 118:this.$=Fs(g[y-1],g[y]);break;case 111:this.$=g[y]?{annotation:g[y],object:g[y-1]}:g[y-1];break;case 113:this.$=g[y]?Ry(lo(g[y].map(St=>qt(Ds(g[y-1].entity),St)),g[y-1].triples)):g[y-1].triples;break;case 114:this.$=Ay(...g[y-1],g[y]);break;case 116:this.$=Ay(...g[y]);break;case 117:case 159:case 163:this.$=[g[y-1],g[y]];break;case 119:this.$=g[y]?{object:g[y-1],annotation:g[y]}:g[y-1];break;case 120:this.$=g[y-1].length?hc("|",Fs(g[y-1],g[y])):g[y];break;case 121:this.$=g[y-1].length?hc("/",Fs(g[y-1],g[y])):g[y];break;case 122:this.$=g[y]?hc(g[y],[g[y-1]]):g[y-1];break;case 123:this.$=g[y-1]?hc(g[y-1],[g[y]]):g[y];break;case 125:case 131:this.$=hc(g[y-1],[g[y]]);break;case 129:this.$=hc("|",Fs(g[y-2],g[y-1]));break;case 132:case 134:this.$=zD(g[y-1]);break;case 133:case 135:this.$=HD(g[y-1]);break;case 140:this.$={entity:g[y],triples:[]};break;case 145:this.$=vy(g[y]);break;case 149:this.$=Le.factory.namedNode(i2);break;case 151:case 153:case 158:case 162:this.$=by(g[y-1],g[y]);break;case 152:this.$=["||",g[y]];break;case 154:this.$=["&&",g[y]];break;case 156:this.$=Ir(g[y-1],[g[y-2],g[y]]);break;case 157:this.$=Ir(g[y-2]?"notin":"in",[g[y-3],g[y]]);break;case 160:this.$=["+",by(g[y-1],g[y])];break;case 161:var Ld=Ji(g[y-1].value.replace("-",""),g[y-1].datatype);this.$=["-",by(Ld,g[y])];break;case 164:this.$=Ir("UPLUS",[g[y]]);break;case 165:this.$=Ir(g[y-1],[g[y]]);break;case 166:this.$=Ir("UMINUS",[g[y]]);break;case 177:this.$=Ir(nn(g[y-1]));break;case 178:this.$=Ir(nn(g[y-3]),[g[y-1]]);break;case 179:this.$=_u(Ir(nn(g[y-3]),[g[y-1]]));break;case 180:this.$=Ir(nn(g[y-5]),[g[y-3],g[y-1]]);break;case 181:this.$=Ir(nn(g[y-7]),[g[y-5],g[y-3],g[y-1]]);break;case 182:this.$=_u(Ir(nn(g[y-7]),[g[y-5],g[y-3],g[y-1]]));break;case 183:this.$=Ir(nn(g[y-1]),g[y]);break;case 184:this.$=Ir("bound",[vy(g[y-1])]);break;case 185:this.$=Ir(g[y-1],[]);break;case 186:this.$=Ir(g[y-3],[g[y-1]]);break;case 187:this.$=Ir(g[y-2]?"notexists":"exists",[wy(g[y])]);break;case 188:case 189:this.$=dc(g[y-1],{type:"aggregate",aggregation:nn(g[y-4]),distinct:!!g[y-2]});break;case 190:this.$=dc(g[y-2],{type:"aggregate",aggregation:nn(g[y-5]),distinct:!!g[y-3],separator:typeof g[y-1]=="string"?g[y-1]:" "});break;case 192:this.$=Ji(g[y]);break;case 193:this.$=UD(g[y-1],nn(g[y].substr(1)));break;case 194:this.$=Ji(g[y-2],g[y]);break;case 195:case 204:this.$=Ji(g[y],s2);break;case 196:case 205:this.$=Ji(g[y],a2);break;case 197:case 206:this.$=Ji(nn(g[y]),o2);break;case 200:this.$=Ji(g[y].toLowerCase(),VD);break;case 201:this.$=Ji(g[y].substr(1),s2);break;case 202:this.$=Ji(g[y].substr(1),a2);break;case 203:this.$=Ji(g[y].substr(1).toLowerCase(),o2);break;case 207:case 208:this.$=f2(g[y],1);break;case 209:case 210:this.$=f2(g[y],3);break;case 211:this.$=Le.factory.namedNode(gu(g[y]));break;case 213:var kd=g[y].indexOf(":"),vu=g[y].substr(0,kd),Md=Le.prefixes[vu];if(!Md)throw new Error("Unknown prefix: "+vu);var jt=gu(Md+g[y].substr(kd+1));this.$=Le.factory.namedNode(jt);break;case 214:if(g[y]=g[y].substr(0,g[y].length-1),!(g[y]in Le.prefixes))throw new Error("Unknown prefix: "+g[y]);var jt=gu(Le.prefixes[g[y]]);this.$=Le.factory.namedNode(jt);break;case 215:this.$=yu(g[y].replace(/^(_:)/,""));break;case 216:this.$=yu();break;case 217:case 218:case 232:this.$=_u(Ey(g[y-3],g[y-2],g[y-1]));break;case 230:case 231:this.$=_u(g[y-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:g[y-1].push(g[y]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[g[y]];break;case 308:g[y-3].push(g[y-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:g[y-2].push(g[y-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:a},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16: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(_,[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:v,87:h},n(E,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(b,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:A,29:R,52:84,53:B,56:85},{19:88,28:A,29:R,52:89,53:B,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:B},n(W,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(we,[2,263],{34:96}),n(we,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(we,[2,262]),n(z,[2,259]),n(G,[2,143]),n(G,[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(F,[2,211]),n(F,[2,212]),n(F,[2,213]),n(F,[2,214]),{19:98,28:A,29:R,52:99,53:B,56:85},{6:[2,309],99:100,193:[1,101]},n(j,[2,311],{101:102,328:[1,103]}),n(te,[2,317],{104:104,328:[1,105]}),n(Ye,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:st,114:110},{29:st,114:112},{29:st,114:113},{118:114,123:[1,115],125:116,126:Rt},n(at,[2,315]),n(at,[2,316]),n(ct,[2,319]),n(ct,[2,320]),n(ct,[2,321]),n(_,[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:v,87:h}),n(Ke,[2,269]),n(Ke,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(E,[2,14]),n(E,[2,274]),n(E,[2,271]),n(E,[2,272]),n(e,[2,4]),{13:[1,177]},n(Z,[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:_t,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(b,[2,419]),n(At,De,{20:196,59:197,69:198,70:U}),n(l,[2,250]),{29:q,57:200},n(j,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(Q,K,{23:204,58:205,62:206,63:Ie}),n(l,[2,252]),{19:208,28:A,29:R,52:209,53:B,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,145:212,172:221,185:213,187:214,231:xr,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(IE,[2,265],{56:85,35:227,52:228,19:229,28:A,29:R,53:B}),n(z,[2,260]),n(Q,K,{58:205,62:206,23:230,63:Ie}),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(j,[2,312]),{105:233,112:RE,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(te,[2,318]),n(j,PE,{108:240,133:242,112:OE,132:FE}),n(Ye,[2,323]),{112:[1,244]},{112:[2,325]},n(Cr,[2,50]),n(W,_d,{135:245,136:246,143:247,144:248,31:DE,112:DE}),n(Cr,[2,51]),n(Cr,[2,52]),n(ma,[2,328],{119:249}),{29:st,114:250},n(ma,[2,56]),{29:st,114:251},n(_,[2,59]),n(Ke,[2,270]),{47:[1,252]},n(NE,[2,150]),n(Sd,[2,428],{240:253}),n(oc,[2,430],{244:254}),n(oc,[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(cc,[2,440],{252:264}),n(pr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(pr,[2,167]),n(pr,[2,168]),n(pr,[2,169]),n(pr,[2,170],{176:269,45:LE,89:kE}),n(pr,[2,171]),n(pr,[2,172]),n(pr,[2,173]),n(pr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:ME,89:jE,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(rn,[2,192],{292:[1,286],293:[1,287]}),n(rn,[2,195]),n(rn,[2,196]),n(rn,[2,197]),n(rn,[2,198]),n(rn,[2,199]),n(rn,[2,200]),{13:f,16:d,44:39,55:40,82:V,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(du,[2,452]),n(du,[2,453]),n(du,[2,454]),n(du,[2,455]),n(du,[2,456]),{279:[2,458]},n(vd,[2,207]),n(vd,[2,208]),n(vd,[2,209]),n(vd,[2,210]),n(rn,[2,201]),n(rn,[2,202]),n(rn,[2,203]),n(rn,[2,204]),n(rn,[2,205]),n(rn,[2,206]),n(e,[2,5]),n(bd,[2,297],{88:295}),n(wd,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Ed,[2,301]),n(Z,[2,43]),n(Z,[2,82]),n(Z,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n(ro,[2,123]),n(ro,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(Ki,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:_t,223:312,225:308,226:309,229:$E,307:43,308:p},n(c,i,{215:10,214:314}),n(Ki,[2,236]),n(Ki,[2,237]),n(lc,[2,6]),n(dy,[2,287],{60:315,72:316,73:[1,317]}),n(At,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n([6,31,63,70,73,81,83,85],[2,20]),n(W,BE,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Cs,31:Cs,85:Cs,112:Cs,159:Cs,160:Cs,161:Cs,163:Cs,164:Cs,41:s}),{13:f,16:d,55:331,307:43,308:p},n(j,[2,280]),n(lc,[2,7]),n(At,De,{59:197,69:198,20:332,70:U}),n(Q,[2,284]),{64:[1,333]},n(Q,K,{58:205,62:206,23:334,63:Ie}),n(l,[2,254]),n(W,_d,{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:no,307:43,308:p},n(hu,[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:no,308:p}),n(Is,[2,227]),n(Is,[2,228]),n(Is,[2,229]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,172:221,185:351,187:350,200:348,230:347,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:no,307:43,308:p},n(Is,[2,146]),n(Is,[2,147]),n(Is,[2,148]),n(Is,[2,149]),{13:f,16:d,44:354,55:355,82:V,87:h,172:357,237:356,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:358,312:tn,313:353},n(hy,[2,215]),n(hy,[2,216]),n(Q,K,{58:205,62:206,23:359,63:Ie}),n(we,[2,264]),n(IE,[2,266]),n(lc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Cr,[2,313],{102:360,120:361,121:[1,362]}),n(Cr,[2,47]),n(Cr,[2,63]),n(Cr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(Cr,[2,336]),n(Cr,[2,337]),n(Cr,[2,338]),{109:[1,364]},n(VE,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(j,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(io,[2,341],{137:368}),n(io,[2,340]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,145:369,172:221,185:213,187:214,231:xr,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},{28:[1,370],127:371,128:[1,372]},n(ma,[2,330],{124:373,125:374,126:Rt}),n(ma,[2,57]),{44:375,87:h},n(NE,[2,151],{241:376,242:[1,377]}),n(Sd,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,247:380,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{250:[1,381]},n(Kt,[2,432]),n(Kt,[2,433]),n(Kt,[2,434]),n(Kt,[2,435]),n(Kt,[2,436]),n(Kt,[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:fe,298:de,299:he,300:ce,301:ge,302:ye}),n(cc,[2,162],{261:388,262:389,39:py,338:my}),n(pr,[2,164]),n(pr,[2,165]),n(pr,[2,166]),n(Yt,[2,95]),n(Yt,[2,96]),n(Kt,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Yt,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,183]),n(Yt,[2,98]),n(Kt,[2,381],{180:400}),{87:[1,401]},n(Yt,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{29:q,57:403},n(rn,[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:no,307:43,308:p},n(ga,[2,233]),n(ga,[2,234]),n(ga,[2,235]),n(UE,[2,459],{281:406,325:[1,407]}),n(Kt,[2,463],{284:408,325:[1,409]}),n(Kt,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:V,171:413,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,419],89:[1,420]},{29:[1,421]},n(Ed,[2,302]),n(bd,[2,367],{167:422}),n(wd,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Ed,[2,371]),n(ro,[2,122]),n(ro,[2,417]),n(ro,[2,413]),n(ro,[2,414]),n(ro,[2,415]),n(Ki,[2,125]),n(Ki,[2,127]),n(Ki,[2,128]),n(qE,[2,420],{227:426}),n(Ki,[2,130]),{13:f,16:d,55:194,197:_t,223:427,307:43,308:p},{48:[1,428]},n(ya,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(dy,[2,288]),{64:[1,433]},n(At,[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:ie,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(WE,[2,293]),n(gy,[2,92]),n(gy,[2,93]),n(gy,[2,94]),{45:LE,89:kE,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:A,29:R,56:85},{19:438,28:A,29:R,56:85},n(so,[2,355],{149:439}),n(so,[2,354]),{13:f,16:d,44:215,45:xd,55:220,82:V,87:h,89:rt,156:440,172:221,185:441,203:442,231:Cd,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(we,[2,19]),n(ya,[2,21]),{13:f,16:d,44:450,45:GE,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n(lc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(W,[2,386],{31:[2,388]}),n(hu,[2,102]),n(ao,[2,391],{191:452}),n(W,[2,395],{196:453,198:454}),n(W,[2,108]),n(W,[2,109]),n(hu,[2,103]),n(hu,[2,104]),n(hu,[2,390]),{13:f,16:d,44:215,45:tt,48:[1,455],55:220,82:V,87:h,89:rt,172:221,185:351,187:350,200:456,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Id,[2,424]),n(zE,[2,136]),n(zE,[2,137]),n(yy,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:no,307:43,308:p},n(ga,[2,219]),n(ga,[2,220]),n(ga,[2,221]),n(ga,[2,222]),n(ga,[2,223]),n(lc,[2,10]),n(Cr,[2,46]),n(Cr,[2,314]),{112:RE,122:459},n(Cr,[2,62]),n(j,PE,{133:242,108:460,112:OE,132:FE}),n(VE,[2,61]),n(Cr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(io,[2,351],{146:463,335:[1,464]}),{29:q,57:465},n(ma,[2,329]),n(j,[2,332],{129:466,327:[1,467]}),n(ma,[2,55]),n(ma,[2,331]),{48:[1,468]},n(Sd,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oc,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,243:470,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oc,[2,156]),{45:ME,89:jE,179:471},n(cc,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,251:472,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(pr,[2,444],{256:473}),n(pr,[2,446],{258:474}),n(Kt,[2,442]),n(Kt,[2,443]),n(pr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,255:154,257:155,259:475,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,450]),n(Kt,[2,451]),n(Kt,[2,379],{178:476}),n(Kt,[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:ie,46:482,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{48:[1,483]},{48:[1,484]},n(Yt,[2,187]),n(rn,[2,194]),{13:f,16:d,44:39,55:40,82:V,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,282:486,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(UE,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Kt,[2,466]),n(Z,[2,40]),n(bd,[2,298]),n(pu,[2,87]),n(pu,[2,88]),n(pu,[2,89]),n(pu,[2,90]),{13:f,16:d,55:492,82:V,172:493,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,311:494,312:tn,315:491},n(Z,[2,41]),n(wd,[2,300]),n(mu,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:V,171:497,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,498],89:[1,499]},{29:[1,500]},n(Ed,[2,372]),{13:f,16:d,48:[2,422],55:194,197:_t,223:312,226:502,228:501,229:$E,307:43,308:p},n(Ki,[2,131]),n(Ki,[2,126]),n(ya,[2,22]),n(ya,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:HE,77:320,78:QE,79:509,87:h,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},n(WE,[2,294]),n(YE,[2,69]),n(YE,[2,70]),n(At,De,{59:197,69:198,20:511,70:U}),n(Q,K,{58:205,62:206,23:512,63:Ie}),{29:[2,375],31:[2,71],84:522,85:a,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(so,[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(Rd,[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:xd,55:220,82:V,87:h,89:rt,172:221,185:351,203:536,212:534,231:Cd,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(Q,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:GE,87:h,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(oo,[2,291]),n(oo,[2,24]),n(oo,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(oo,[2,28]),n(Q,K,{58:205,62:206,23:540,63:Ie}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(ao,[2,107]),{13:f,16:d,44:215,45:tt,55:220,82:V,87:h,89:rt,172:221,185:351,187:350,199:543,200:544,231:xr,234:349,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(KE,[2,132]),n(Id,[2,425]),n(KE,[2,133]),{13:f,16:d,44:354,55:355,82:V,87:h,172:357,237:356,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:358,312:tn,313:545},n(Cr,[2,54]),n(Cr,[2,48]),n(io,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(io,[2,68]),n(W,[2,350],{31:XE,112:XE}),n(Cr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(j,[2,333]),n(Ke,[2,16]),n(Sd,[2,152]),n(oc,[2,154]),n(oc,[2,157]),n(cc,[2,159]),n(cc,[2,160],{262:389,261:548,39:py,338:my}),n(cc,[2,161],{262:389,261:549,39:py,338:my}),n(pr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,178]),n(Yt,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{48:[1,554],272:[1,555]},n(Yt,[2,184]),n(Yt,[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:_t,223:562,307:43,308:p},n(_y,[2,224]),n(_y,[2,225]),n(_y,[2,226]),{31:[1,563],45:JE,94:564},n(Z,[2,84]),n(bd,[2,368]),n(Z,[2,85]),n(wd,[2,370]),n(mu,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ya,[2,35],{83:[1,569]}),n(ya,[2,36],{81:[1,570]}),n(dy,[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:ie,76:HE,78:QE,87:h,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,276:Ge,277:Ae,279:Be,280:Pe,283:Ve,285:ze,308:p,346:He,347:Me,348:w,349:T,350:x,351:O}),n(uc,[2,295]),{45:ie,77:572},{45:ie,77:573},n(uc,[2,33]),n(uc,[2,34]),{31:[2,275],50:574,84:575,85:a},{31:[2,277],51:576,84:577,85:a},n(so,[2,356]),n(ZE,[2,357],{152:578,335:[1,579]}),n(Rs,[2,74]),{29:q,57:580},{29:q,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(e2,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,307:43,308:p,346:He,347:Me,348:w,349:T,350:x,351:O},{45:[1,586]},n(Rs,[2,81]),{29:q,57:587},n(so,[2,73]),n(W,[2,362],{29:Ps,31:Ps,85:Ps,112:Ps,159:Ps,160:Ps,161:Ps,163:Ps,164:Ps}),n(Rd,[2,112]),n(fc,[2,401],{206:588}),n(W,[2,405],{209:589,210:590}),n(W,[2,403]),n(W,[2,404]),n(Rd,[2,113]),n(Rd,[2,400]),{13:f,16:d,44:215,45:xd,48:[1,591],55:220,82:V,87:h,89:rt,172:221,185:351,203:536,212:592,231:Cd,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Id,[2,426]),n(yy,[2,138]),n(yy,[2,139]),{232:[1,593]},n(oo,[2,292]),{47:[1,595],48:[1,594]},n(lc,[2,9]),n(ao,[2,392]),n(ao,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:no,308:p}),n(ao,[2,110],{272:[1,598]}),n(Pd,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(ma,[2,58]),n(pr,[2,445]),n(pr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Yt,[2,99]),n(Kt,[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(Yt,[2,188]),n(Yt,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:V,172:493,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,311:494,312:tn,315:611},n(Z,[2,42]),n(mu,[2,304]),{13:f,16:d,55:414,82:V,95:612,171:613,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},{31:[1,614],45:JE,94:615},n(Ki,[2,129]),n(qE,[2,421]),{82:[1,616]},{82:[1,617]},n(uc,[2,296]),n(uc,[2,31]),n(uc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(W,BE,{155:330,153:618,154:619,29:Os,31:Os,85:Os,112:Os,159:Os,160:Os,161:Os,163:Os,164:Os}),n(ZE,[2,358]),n(Rs,[2,75]),n(Rs,[2,76]),{29:q,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(e2,[2,366]),n(Rs,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Rs,[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(fc,[2,117]),{13:f,16:d,44:215,45:xd,55:220,82:V,87:h,89:rt,172:221,185:351,203:536,211:626,212:627,231:Cd,234:535,236:216,237:222,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,309:Sn,310:Dn,311:217,312:tn},n(Is,[2,134]),n(Id,[2,427]),n(Is,[2,135]),n(oo,[2,26]),{44:628,87:h},n(ao,[2,106]),n(ao,[2,394]),n(W,[2,396]),n(Pd,[2,111]),n(Pd,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:no,307:43,308:p},n(hy,[2,217]),n(W,_d,{144:248,140:630,143:631,31:[2,343]}),n(Yt,[2,97]),n(Kt,[2,380]),n(Yt,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:V,87:h,172:135,224:lt,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:pt,264:130,265:H,266:137,267:139,268:Re,269:Ue,270:re,271:qe,273:We,274:$e,275:146,276:Ge,277:Ae,278:149,279:Be,280:Pe,283:Ve,285:ze,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ze,346:He,347:Me,348:w,349:T,350:x,351:O},n(Yt,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:V,171:637,172:415,173:416,174:Td,255:154,257:155,291:150,294:ue,295:pe,296:me,297:fe,298:de,299:he,300:ce,301:ge,302:ye,303:_e,304:Se,305:ae,306:ve,307:43,308:p,312:Ad},n(t2,[2,305]),n(Z,[2,86]),n(mu,[2,374]),n(ya,[2,37]),n(ya,[2,38]),n(so,[2,72]),n(so,[2,360]),n(Rs,[2,77]),{29:q,57:638},{47:[1,639]},{29:[2,376]},n(fc,[2,402]),n(fc,[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(fc,[2,118],{272:[1,641]}),n(Od,[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:_e,304:Se,305:ae,306:ve},n(pu,[2,218]),n(mu,[2,44]),n(t2,[2,306]),n(Rs,[2,78]),{44:651,87:h},n(fc,[2,116]),n(W,[2,406]),n(Od,[2,119]),n(Od,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(oo,[2,27]),n(Pd,[2,230]),n(r2,[2,345],{141:653,335:[1,654]}),n(Yt,[2,181]),n(Yt,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(W,_d,{144:248,142:657,143:658,31:n2,112:n2}),n(r2,[2,346]),n(Rs,[2,80]),n(Od,[2,231]),n(io,[2,67]),n(io,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:o(function(C,P){if(P.recoverable)this.trace(C);else{var N=new Error(C);throw N.hash=P,N}},"parseError"),parse:o(function(C){var P=this,N=[0],ne=[],Oe=[null],g=[],sn=this.table,y="",Zi=0,Su=0,Ld=0,kd=2,vu=1,Md=g.slice.call(arguments,1),jt=Object.create(this.lexer),es={yy:{}};for(var bu in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bu)&&(es.yy[bu]=this.yy[bu]);jt.setInput(C,es.yy),es.yy.lexer=jt,es.yy.parser=this,typeof jt.yylloc>"u"&&(jt.yylloc={});var gc=jt.yylloc;g.push(gc);var St=jt.options&&jt.options.ranges;typeof es.yy.parseError=="function"?this.parseError=es.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nt(ts){N.length=N.length-2*ts,Oe.length=Oe.length-ts,g.length=g.length-ts}o(Nt,"popStack");for(var nt=o(function(){var ts;return ts=jt.lex()||vu,typeof ts!="number"&&(ts=P.symbols_[ts]||ts),ts},"lex"),ut,vn,fo,Un,TK,Oy,yc={},jd,Ns,m2,$d;;){if(fo=N[N.length-1],this.defaultActions[fo]?Un=this.defaultActions[fo]:((ut===null||typeof ut>"u")&&(ut=nt()),Un=sn[fo]&&sn[fo][ut]),typeof Un>"u"||!Un.length||!Un[0]){var Fy="";$d=[];for(jd in sn[fo])this.terminals_[jd]&&jd>kd&&$d.push("'"+this.terminals_[jd]+"'");jt.showPosition?Fy="Parse error on line "+(Zi+1)+`:
34
34
  `+jt.showPosition()+`
35
35
  Expecting `+$d.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":Fy="Parse error on line "+(Zi+1)+": Unexpected "+(ut==vu?"end of input":"'"+(this.terminals_[ut]||ut)+"'"),this.parseError(Fy,{text:jt.match,token:this.terminals_[ut]||ut,line:jt.yylineno,loc:gc,expected:$d})}if(Un[0]instanceof Array&&Un.length>1)throw new Error("Parse Error: multiple actions possible at state: "+fo+", token: "+ut);switch(Un[0]){case 1:N.push(ut),Oe.push(jt.yytext),g.push(jt.yylloc),N.push(Un[1]),ut=null,vn?(ut=vn,vn=null):(Su=jt.yyleng,y=jt.yytext,Zi=jt.yylineno,gc=jt.yylloc,Ld>0&&Ld--);break;case 2:if(Ns=this.productions_[Un[1]][1],yc.$=Oe[Oe.length-Ns],yc._$={first_line:g[g.length-(Ns||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(Ns||1)].first_column,last_column:g[g.length-1].last_column},St&&(yc._$.range=[g[g.length-(Ns||1)].range[0],g[g.length-1].range[1]]),Oy=this.performAction.apply(yc,[y,Su,Zi,es.yy,Un[1],Oe,g].concat(Md)),typeof Oy<"u")return Oy;Ns&&(N=N.slice(0,-1*Ns*2),Oe=Oe.slice(0,-1*Ns),g=g.slice(0,-1*Ns)),N.push(this.productions_[Un[1]][0]),Oe.push(yc.$),g.push(yc._$),m2=sn[N[N.length-2]][N[N.length-1]],N.push(m2);break;case 3:return!0}}return!0},"parse")},Fd=E_().Wildcard,Dd="http://www.w3.org/1999/02/22-rdf-syntax-ns#",jD=Dd+"type",$D=Dd+"first",BD=Dd+"rest",i2=Dd+"nil",Nd="http://www.w3.org/2001/XMLSchema#",s2=Nd+"integer",a2=Nd+"decimal",o2=Nd+"double",VD=Nd+"boolean",co="",c2="",l2="";function nn(I){return I.toLowerCase()}o(nn,"lowercase");function Fs(I,C){return I.push(C),I}o(Fs,"appendTo");function lo(I,C){return I.push.apply(I,C),I}o(lo,"appendAllTo");function qt(I){I||(I={});for(var C=1,P=arguments.length,N;C<P&&(N=arguments[C]||{});C++)for(var ne in N)I[ne]=N[ne];return I}o(qt,"extend");function Xi(){for(var I=[],C=0,P=arguments.length;C<P;C++)I=I.concat.apply(I,arguments[C]);return I}o(Xi,"unionAll");function gu(I){if(I[0]==="<"&&(I=I.substring(1,I.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(I))return I;if(!Le.base)throw new Error("Cannot resolve relative IRI "+I+" because no base IRI was set.");switch(co!==Le.base&&(co=Le.base,c2=co.replace(/[^\/:]*$/,""),l2=co.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),I[0]){case void 0:return co;case"#":return co+I;case"?":return co.replace(/(?:\?.*)?$/,I);case"/":return l2+I;default:return c2+I}}o(gu,"resolveIRI");function vy(I){if(I){var C=I[0];if(C==="?"||C==="$")return Le.factory.variable(I.substr(1))}return I}o(vy,"toVar");function Ir(I,C){return{type:"operation",operator:I,args:C||[]}}o(Ir,"operation");function dc(I,C){var P={expression:I==="*"?new Fd:I};if(C)for(var N in C)P[N]=C[N];return P}o(dc,"expression");function hc(I,C){return{type:"path",pathType:I,items:C}}o(hc,"path");function by(I,C){for(var P=0,N=C.length,ne;P<N&&(ne=C[P]);P++)I=Ir(ne[0],[I,ne[1]]);return I}o(by,"createOperationTree");function uo(I,C){var P=[],N=[],ne=I.length,Oe,g={};if(!ne)return null;for(var sn=0;sn<ne&&(Oe=I[sn]);sn++)(Oe.named?N:P).push(Oe.iri);return g[C||"from"]={default:P,named:N},g}o(uo,"groupDatasets");function pc(I){return parseInt(I,10)}o(pc,"toInt");function wy(I){return I.type==="group"&&I.patterns.length===1?I.patterns[0]:I}o(wy,"degroupSingle");function Ji(I,C){return C&&C.termType!=="NamedNode"&&(C=Le.factory.namedNode(C)),Le.factory.literal(I,C)}o(Ji,"createTypedLiteral");function UD(I,C){return Le.factory.literal(I,C)}o(UD,"createLangLiteral");function Ey(I,C,P){if(!("termType"in C))throw new Error("Nested triples cannot contain paths");return Le.factory.quad(I,C,P)}o(Ey,"nestedTriple");function Ds(I,C,P,N){var ne={};return I!=null&&(ne.subject=I),C!=null&&(ne.predicate=C),P!=null&&(ne.object=P),N!=null&&(ne.annotations=N),ne}o(Ds,"triple");function yu(I){return typeof I=="string"?I.startsWith("e_")?Le.factory.blankNode(I):Le.factory.blankNode("e_"+I):Le.factory.blankNode("g_"+u2++)}o(yu,"blank");var u2=0;Le._resetBlanks=function(){u2=0};var qD=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,WD={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
36
36
  `,r:"\r",f:"\f"},GD=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Ty=String.fromCharCode;function f2(I,C){I=I.substring(C,I.length-C);try{I=I.replace(qD,function(P,N,ne,Oe){var g;if(N){if(g=parseInt(N,16),isNaN(g))throw new Error;return Ty(g)}else if(ne){if(g=parseInt(ne,16),isNaN(g))throw new Error;return g<65535?Ty(g):Ty(55296+((g-=65536)>>10),56320+(g&1023))}else{var sn=WD[Oe];if(!sn)throw new Error;return sn}})}catch{return""}if(GD.exec(I))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+I);return I}o(f2,"unescapeString");function zD(I){var C=yu(),P=C,N=[],ne,Oe=[];I.forEach(function(Zi){N.push(Zi.entity),lo(Oe,Zi.triples)});for(var g=0,sn=0,y=N.length,ne=Array(y*2);g<y;)ne[sn++]=Ds(P,Le.factory.namedNode($D),N[g]),ne[sn++]=Ds(P,Le.factory.namedNode(BD),P=++g<y?yu():Le.factory.namedNode(i2));return{entity:C,triples:lo(ne,Oe)}}o(zD,"createList");function HD(I){var C=yu();return{entity:C,triples:I.map(function(P){return qt(Ds(C),P)})}}o(HD,"createAnonymousObject");function Ay(I,C,P){var N=[],ne=[];return C.forEach(function(Oe){let g=null;Oe.annotation&&(g=Oe.annotation,Oe=Oe.object),N.push(Ds(null,I,Oe.entity,g)),lo(ne,Oe.triples)}),Xi(N,P||[],ne)}o(Ay,"objectListToTriples");function wK(I){for(var C=[],P,N=0,ne;ne=I[N];N++)switch(ne.type){case"bgp":ne.triples.length&&(P?lo(P.triples,ne.triples):Fs(C,P=ne));break;default:(!ne.patterns||ne.patterns.length>0)&&(Fs(C,ne),P=null)}return C}o(wK,"mergeAdjacentBGPs");function mc(I){return I.variable?I.variable.value:I.value||I.expression.value}o(mc,"getExpressionId");function xy(I){if(!I)return[];if(I.type==="aggregate")return[I];if(I.type==="operation"){let C=[];for(let P of I.args)C.push(...xy(P));return C}return[]}o(xy,"getAggregatesOfExpression");function QD(I){let C=new Set,P=o(function(N){N&&(N.termType==="Variable"?C.add(N):N.type==="operation"&&N.args.forEach(P))},"visitExpression");return P(I),C}o(QD,"getVariablesFromExpression");function Cy(I,C=1,P=[]){for(let N of I)C>0&&N instanceof Array?Cy(N,C-1,P):P.push(N);return P}o(Cy,"flatten");function Iy(I){return I.termType==="Variable"}o(Iy,"isVariable");function d2(I){if(I.triples){let C=[];for(let P of I.triples)Iy(P.subject)&&C.push(P.subject.value),Iy(P.predicate)&&C.push(P.predicate.value),Iy(P.object)&&C.push(P.object.value);return C}else if(I.patterns){let C=[];for(let P of I.patterns)C.push(...d2(P));return C}return[]}o(d2,"getBoundVarsFromGroupGraphPattern");function YD(I){let C=I.slice().sort(),P=[];for(let N=0;N<C.length-1;N++)C[N+1]==C[N]&&P.push(C[N]);return P}o(YD,"getDuplicatesInArray");function _u(I){if(!Le.sparqlStar)throw new Error("SPARQL-star support is not enabled");return I}o(_u,"ensureSparqlStar");function h2(I,C,P){for(let N of C){let ne=Ds("subject"in N?N.subject:I,N.predicate,N.object);P.push(ne),N.annotations&&h2(Ey(I,N.predicate,N.object),N.annotations,P)}}o(h2,"_applyAnnotations");function Ry(I){if(Le.sparqlStar){let C=[];return I.forEach(P=>{let N=Ds(P.subject,P.predicate,P.object);C.push(N),P.annotations&&h2(Ey(P.subject,P.predicate,P.object),P.annotations,C)}),C}return I}o(Ry,"applyAnnotations");function EK(I){if(!Le.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return I}o(EK,"ensureSparqlStarNestedQuads");function p2(I){for(let C of I){if(C.type==="graph"&&C.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(C.type==="bgp"||C.type==="graph"){for(let P of C.triples)if(P.subject.termType==="Variable"||P.predicate.termType==="Variable"||P.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return I}o(p2,"ensureNoVariables");function Py(I){for(let C of I)if(C.type==="bgp"){for(let P of C.triples)if(P.subject.termType==="BlankNode"||P.predicate.termType==="BlankNode"||P.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return I}o(Py,"ensureNoBnodes");var KD=(function(){var I={EOF:1,parseError:o(function(P,N){if(this.yy.parser)this.yy.parser.parseError(P,N);else throw new Error(P)},"parseError"),setInput:o(function(C,P){return this.yy=P||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var P=C.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:o(function(C){var P=C.length,N=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var ne=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),N.length-1&&(this.yylineno-=N.length-1);var Oe=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:N?(N.length===ne.length?this.yylloc.first_column:0)+ne[ne.length-N.length].length-N[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[Oe[0],Oe[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
@@ -45,7 +45,7 @@ Expecting `+$d.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":Fy="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 a=i;for(;i<e.length&&e[i]!==">";)i++;if(e[i]===">"){let c=e.substring(a,i);i++;let l=this.findDeclarationEnd(e,i);t.push({uri:c,startPos:s,endPos:l}),i=l;continue}else throw new Rc(`Unclosed IRI in PREFIX* declaration at position ${a}`)}else throw new Rc(`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,"")}};xa.PrefixStarTransformer=M_;var Rc=class extends Error{static{o(this,"PrefixStarTransformerError")}constructor(e){super(`PREFIX* transformation error: ${e}`),this.name="PrefixStarTransformerError"}};xa.PrefixStarTransformerError=Rc});var j_=S(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.DescribeOptionsTransformer=Oc.DescribeOptionsTransformerError=void 0;var Hh=class extends Error{static{o(this,"DescribeOptionsTransformerError")}constructor(e){super(e),this.name="DescribeOptionsTransformerError"}};Oc.DescribeOptionsTransformerError=Hh;var Pc=class n{static{o(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 a=parseInt(s[1],10);if(a<0)throw new Hh(`DESCRIBE DEPTH must be a non-negative integer, got: ${a}`);r.depth=a,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}};Oc.DescribeOptionsTransformer=Pc;Pc.DEPTH_PATTERN=/\bDEPTH\s+(\d+)/gi;Pc.SYMMETRIC_PATTERN=/\bSYMMETRIC\b/gi;Pc.DESCRIBE_QUERY_PATTERN=/\bDESCRIBE\b/i});var pA=S(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.DirectionalLangTagTransformerError=Fc.DirectionalLangTagTransformer=void 0;var Qh=class n{static{o(this,"DirectionalLangTagTransformer")}constructor(){this.directionMappings=new Map}transform(e){return this.directionMappings.clear(),e.replace(n.DIRECTIONAL_TAG_REGEX,(t,r,i,s,a)=>{let c=s.toLowerCase();return this.directionMappings.set(c,a),`${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()}};Fc.DirectionalLangTagTransformer=Qh;Qh.DIRECTIONAL_TAG_REGEX=/(["'])((?:[^\\]|\\.)*?)\1@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)--(ltr|rtl)/g;var $_=class extends Error{static{o(this,"DirectionalLangTagTransformerError")}constructor(e){super(`Directional language tag transformation error: ${e}`),this.name="DirectionalLangTagTransformerError"}};Fc.DirectionalLangTagTransformerError=$_});var mA=S(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.TripleTermTransformerError=Nc.TripleTermTransformer=void 0;var B_=class{static{o(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 Dc("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],a=this.extractTripleTerm(r,s);if(a){let c=this.convertToStandardSyntax(a.content);r=r.substring(0,s)+c+r.substring(s+a.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 a=e.substring(t,s+2);return{content:a,length:a.length}}r=s+2;continue}r++;continue}r++}if(i>0)throw new Dc(`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 Dc(`Invalid triple term syntax: ${e.substring(0,50)}...`);return`<< ${t[1]} >>`}};Nc.TripleTermTransformer=B_;var Dc=class extends Error{static{o(this,"TripleTermTransformerError")}constructor(e){super(`Triple term transformation error: ${e}`),this.name="TripleTermTransformerError"}};Nc.TripleTermTransformerError=Dc});var U_=S(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.VaultPrefixTransformer=void 0;var sj=/PREFIX\s+(\w+)\s*:/gi,aj=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"]),V_=class{static{o(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[a,c]of this.vaultPrefixes)!t.has(a.toLowerCase())&&!aj.has(a.toLowerCase())&&r.push({prefix:a,baseIRI:c});if(r.length===0)return e;let i="",s=0;for(;s<e.length;){let a=e[s];if(a==='"'||a==="'"){let l=this.skipLiteral(e,s);i+=e.substring(s,l),s=l;continue}if(a==="<"){let l=e.indexOf(">",s);l!==-1?(i+=e.substring(s,l+1),s=l+1):(i+=a,s++);continue}if(a==="#"){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+=a,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 a=t+i.length+1,c=a;for(;c<e.length&&/[a-zA-Z0-9_.%-]/.test(e[c]);)c++;if(c===a)continue;let l=e.substring(a,c);return{iri:`<${s}${l}.md>`,endIndex:c}}return null}findDeclaredPrefixes(e){let t=new Set,r=new RegExp(sj.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}};Yh.VaultPrefixTransformer=V_});var Lc=S(An=>{"use strict";var oj=An&&An.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),cj=An&&An.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),lj=An&&An.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&oj(t,e,r[i]);return cj(t,e),t}})();Object.defineProperty(An,"__esModule",{value:!0});An.SPARQLParser=An.ExoQLParser=An.SPARQLParseError=void 0;var gA=lj(dA()),q_=L_(),W_=k_(),yA=hA(),G_=j_(),uj=pA(),z_=mA(),fj=U_(),ir=class extends Error{static{o(this,"SPARQLParseError")}constructor(e,t,r,i){super(e,i?{cause:i}:void 0),this.name="SPARQLParseError",this.line=t,this.column=r}};An.SPARQLParseError=ir;var Kh=class{static{o(this,"ExoQLParser")}constructor(e){this.lastDirectionMappings=new Map,this.parser=new gA.Parser({sparqlStar:!0}),this.generator=new gA.Generator({sparqlStar:!0}),this.caseWhenTransformer=new q_.CaseWhenTransformer,this.lateralTransformer=new W_.LateralTransformer,this.prefixStarTransformer=new yA.PrefixStarTransformer(e?.vocabularyResolver),this.describeOptionsTransformer=new G_.DescribeOptionsTransformer,this.directionalLangTagTransformer=new uj.DirectionalLangTagTransformer,this.tripleTermTransformer=new z_.TripleTermTransformer,this.vaultPrefixTransformer=new fj.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 G_.DescribeOptionsTransformerError)throw new ir(t.message);if(t instanceof W_.LateralTransformerError)throw new ir(t.message);if(t instanceof q_.CaseWhenTransformerError)throw new ir(t.message);if(t instanceof z_.TripleTermTransformerError)throw new ir(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 ir(`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 G_.DescribeOptionsTransformerError)throw new ir(t.message);if(t instanceof yA.PrefixStarTransformerError)throw new ir(t.message);if(t instanceof W_.LateralTransformerError)throw new ir(t.message);if(t instanceof q_.CaseWhenTransformerError)throw new ir(t.message);if(t instanceof z_.TripleTermTransformerError)throw new ir(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 ir(`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 ir(`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 ir("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 ir("Invalid query: not an object");if(e.type!=="query"&&e.type!=="update")throw new ir(`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 ir(`Invalid query type: expected one of ${t.join(", ")}, got "${e.queryType}"`)}}};An.ExoQLParser=Kh;An.SPARQLParser=Kh});var Ao=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.AlgebraTranslatorError=void 0;var H_=class extends Error{static{o(this,"AlgebraTranslatorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AlgebraTranslatorError"}};Xh.AlgebraTranslatorError=H_});var Jh=S(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.isVariableExpression=dj;ss.isVariableTerm=hj;ss.isNamedNode=pj;ss.isLiteral=mj;ss.isPropertyPath=gj;ss.isAggregateExpression=yj;ss.isOperationExpression=_j;ss.isFunctionCallExpression=Sj;function dj(n){return typeof n=="object"&&n!==null&&"expression"in n&&"variable"in n}o(dj,"isVariableExpression");function hj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Variable"}o(hj,"isVariableTerm");function pj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="NamedNode"}o(pj,"isNamedNode");function mj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Literal"}o(mj,"isLiteral");function gj(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="path"}o(gj,"isPropertyPath");function yj(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="aggregate"}o(yj,"isAggregateExpression");function _j(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="operation"}o(_j,"isOperationExpression");function Sj(n){return typeof n=="object"&&n!==null&&"type"in n&&(n.type==="functionCall"||n.type==="functioncall")}o(Sj,"isFunctionCallExpression")});var _A=S(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.TripleTranslator=void 0;var ln=Ao(),Q_=class{static{o(this,"TripleTranslator")}constructor(){this.directionMappings=new Map}setDirectionMappings(e){this.directionMappings=e}translateBGP(e){if(!("triples"in e)||!Array.isArray(e.triples))throw new ln.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 ln.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 ln.AlgebraTranslatorError("Property path must have pathType");if(!("items"in e)||!Array.isArray(e.items))throw new ln.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 ln.AlgebraTranslatorError("Inverse path must have exactly one item");return{type:"path",pathType:"^",items:[t[0]]};case"+":if(t.length!==1)throw new ln.AlgebraTranslatorError("OneOrMore path must have exactly one item");return{type:"path",pathType:"+",items:[t[0]]};case"*":if(t.length!==1)throw new ln.AlgebraTranslatorError("ZeroOrMore path must have exactly one item");return{type:"path",pathType:"*",items:[t[0]]};case"?":if(t.length!==1)throw new ln.AlgebraTranslatorError("ZeroOrOne path must have exactly one item");return{type:"path",pathType:"?",items:[t[0]]};default:throw new ln.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 ln.AlgebraTranslatorError(`Unsupported path item type: ${String(t)}`)}translateTripleElement(e){if(!e||!("termType"in e))throw new ln.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 ln.AlgebraTranslatorError(`Unsupported term type: ${e.termType}`)}}translateQuotedTriple(e){if(!e.subject||!e.predicate||!e.object)throw new ln.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 ln.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 ln.AlgebraTranslatorError(`Quoted triple predicate must be IRI or Variable, got: ${e.termType}`)}}};Zh.TripleTranslator=Q_});var SA=S(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.ExpressionTranslator=void 0;var kc=Ao(),Y_=class{static{o(this,"ExpressionTranslator")}constructor(e){this.translateWhereFn=e.translateWhere,this.translateBGPFn=e.translateBGP,this.translatePatternFn=e.translatePattern}translateExpression(e){if(!e)throw new kc.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 kc.AlgebraTranslatorError(`Unsupported expression structure: ${JSON.stringify(e)}`)}translateFilter(e){if(!e.expression)throw new kc.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(a=>!("patterns"in a)||"termType"in a);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(a=>this.translateExpression(a))}: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(a=>this.translateExpression(a))}}translateExistsExpression(e){if(!e.args||e.args.length!==1)throw new kc.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 kc.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 kc.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"}}};ep.ExpressionTranslator=Y_});var wA=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.PatternTranslator=void 0;var vA=k_(),Fr=Ao(),bA=Jh(),K_=class{static{o(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 Fr.AlgebraTranslatorError("Empty WHERE clause");let t=e.filter(a=>a.type==="filter"),r=e.filter(a=>a.type==="bind"),i=e.filter(a=>a.type!=="filter"&&a.type!=="bind"),s;if(i.length===0)s={type:"bgp",triples:[]};else if(i.length===1)if(i[0].type==="optional"){let a=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:a?this.translateExpressionFn(a):void 0}}else s=this.translatePattern(i[0]);else{if(i[0].type==="optional"){let a=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:a?this.translateExpressionFn(a):void 0}}else s=this.translatePattern(i[0]);for(let a=1;a<i.length;a++){let c=i[a];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 a of r)s=this.translateBind(a,s);for(let a of t)s={type:"filter",expression:this.translateExpressionFn(a.expression),input:s};return s}translatePattern(e){if(!e||!e.type)throw new Fr.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 Fr.AlgebraTranslatorError(`Unsupported pattern type: ${e.type}`)}}translateFilter(e){if(!e.expression)throw new Fr.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 Fr.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 Fr.AlgebraTranslatorError("UNION pattern must have at least 2 patterns");let t=o(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 Fr.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 Fr.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 a=s.startsWith("?")?s.slice(1):s;t.add(a)}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,a=i;if(a)if(a.termType==="NamedNode")t[s]={type:"iri",value:a.value};else if(a.termType==="Literal"){let c=a,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 Fr.AlgebraTranslatorError(`Unsupported VALUES term type: ${a.termType}`)}return t}translateBind(e,t){if(!e.variable||!e.expression)throw new Fr.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 Fr.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 Fr.AlgebraTranslatorError("SERVICE pattern must have a NamedNode endpoint");if(!e.patterns||!Array.isArray(e.patterns))throw new Fr.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 Fr.AlgebraTranslatorError("GRAPH pattern must have a name (IRI or variable)");if(!e.patterns||!Array.isArray(e.patterns))throw new Fr.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 Fr.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 Fr.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,bA.isVariableTerm)(i)&&i.value===vA.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,bA.isVariableTerm)(i)&&i.value===vA.LateralTransformer.LATERAL_MARKER))}}};tp.PatternTranslator=K_});var TA=S(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.AggregateTranslator=void 0;var EA=Ao(),vj=Jh(),X_=class{static{o(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,vj.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)),a=["=","!=","<",">","<=",">="],c=["&&","||","!"],l=["+","-","*","/"];return a.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=o(()=>{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,a=i;if(a.termType==="NamedNode"&&typeof a.value=="string")s=a.value;else if("value"in a)s=String(a.value);else throw new EA.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 EA.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)}}}};rp.AggregateTranslator=X_});var Mc=S(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.AlgebraTranslator=Ca.ExoQLAlgebraTranslator=Ca.AlgebraTranslatorError=void 0;var np=Ao(),ip=Jh(),bj=_A(),wj=SA(),Ej=wA(),Tj=TA(),Aj=Ao();Object.defineProperty(Ca,"AlgebraTranslatorError",{enumerable:!0,get:o(function(){return Aj.AlgebraTranslatorError},"get")});var sp=class{static{o(this,"ExoQLAlgebraTranslator")}constructor(){this.tripleTranslator=new bj.TripleTranslator,this.expressionTranslator=new wj.ExpressionTranslator({translateWhere:o(e=>this.patternTranslator.translateWhere(e),"translateWhere"),translateBGP:o(e=>this.tripleTranslator.translateBGP(e),"translateBGP"),translatePattern:o(e=>this.patternTranslator.translatePattern(e),"translatePattern")}),this.patternTranslator=new Ej.PatternTranslator({translateExpression:o(e=>this.expressionTranslator.translateExpression(e),"translateExpression"),translateSelect:o(e=>this.translateSelect(e),"translateSelect"),translateBGP:o(e=>this.tripleTranslator.translateBGP(e),"translateBGP")}),this.aggregateTranslator=new Tj.AggregateTranslator({translateExpression:o(e=>this.expressionTranslator.translateExpression(e),"translateExpression")})}setDirectionMappings(e){this.tripleTranslator.setDirectionMappings(e),this.patternTranslator.setDirectionMappings(e)}translate(e){if(e.type!=="query")throw new np.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 np.AlgebraTranslatorError(`Query type ${String(e.queryType)} not yet supported`)}translateSelect(e){if(!e.where||e.where.length===0)throw new np.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),a=this.aggregateTranslator.extractGroupVariables(e.group),c=this.aggregateTranslator.extractHavingExpressions(e.having,s,r);if((s.length>0||a.length>0||c.length>0)&&(t={type:"group",variables:a,aggregates:s,having:c.length>0?c:void 0,input:t}),i.length>0){for(let u of i)if((0,ip.isVariableExpression)(u)){if("type"in u.expression&&u.expression.type==="aggregate")continue;let f=this.aggregateTranslator.transformExpressionWithAggregateVars(u.expression,r);t={type:"extend",variable:u.variable.value,expression:f,input:t}}let l=i.filter(u=>(0,ip.isVariableTerm)(u)||(0,ip.isVariableExpression)(u)).map(u=>(0,ip.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.order&&e.order.length>0&&(t={type:"orderby",comparators:e.order.map(l=>this.aggregateTranslator.translateOrderComparator(l)),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 np.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 a of s)a.termType==="Wildcard"||a.value==="*"||(a.termType==="Variable"?t.push({type:"variable",value:a.value}):a.termType==="NamedNode"&&t.push({type:"iri",value:a.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}}};Ca.ExoQLAlgebraTranslator=sp;Ca.AlgebraTranslator=sp});var as=S(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.SolutionMapping=void 0;var AA=je(),xA=Ce(),CA=Gt(),J_=class n{static{o(this,"SolutionMapping")}constructor(e){this.bindings=e?new Map(e):new Map}get(e){return this.bindings.get(e)}set(e,t){this.bindings.set(e,t)}has(e){return this.bindings.has(e)}variables(){return Array.from(this.bindings.keys())}getBindings(){return new Map(this.bindings)}isCompatibleWith(e){for(let[t,r]of this.bindings.entries()){let i=e.get(t);if(i!==void 0&&!this.areEqual(r,i))return!1}return!0}merge(e){if(!this.isCompatibleWith(e))return null;let t=new n(this.bindings);for(let[r,i]of e.getBindings().entries())t.set(r,i);return t}clone(){return new n(this.bindings)}areEqual(e,t){return e instanceof AA.Literal&&t instanceof AA.Literal?e.equals(t):e instanceof xA.IRI&&t instanceof xA.IRI?e.value===t.value:e instanceof CA.BlankNode&&t instanceof CA.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}};ap.SolutionMapping=J_});var RA=S(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.PropertyPathExecutor=jc.PropertyPathExecutorError=void 0;var xj=as(),op=Ce(),IA=Gt(),Cj=je(),Wu=class extends Error{static{o(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};jc.PropertyPathExecutorError=Wu;var Z_=class{static{o(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){if(this.isLiteralElement(e)||this.isLiteralElement(r)){let a=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;console.warn(`[PropertyPathExecutor] literal-safety guard fired: literal in ${a} position \u2014 yielding 0 solutions. value="${u}"`);return}let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let a of i){let c=await this.evaluatePath(a,t,s);for(let l of c){let u=new xj.SolutionMapping;this.isVariable(e)&&u.set(e.value,a),this.isVariable(r)&&u.set(r.value,l),yield u}}}async*executeWithBindings(e,t){if(!this.isPropertyPath(e.predicate))throw new Wu("Predicate is not a property path");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.object,t);for await(let s of this.execute(r,e.predicate,i)){let a=t.merge(s);a!==null&&(yield a)}}async evaluatePath(e,t,r){switch(t.pathType){case"/":return this.evaluateSequencePath(e,t.items,r);case"|":return this.evaluateAlternativePath(e,t.items,r);case"^":return this.evaluateInversePath(e,t.items[0],r);case"+":return this.evaluateOneOrMorePath(e,t.items[0],r);case"*":return this.evaluateZeroOrMorePath(e,t.items[0],r);case"?":return this.evaluateZeroOrOnePath(e,t.items[0],r)}}async evaluateSequencePath(e,t,r){let i=new Set([e]);for(let s=0;s<t.length;s++){let a=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,a,c?r:null);for(let 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 a=await this.evaluatePathItem(e,s,r);for(let c of a)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new op.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&a.add(c.subject);return a}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,a=[{node:e,depth:0}];for(;a.length>0;){let c=a.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),a.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 a of s)i.add(a);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new op.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&a.add(c.object);return a}else return this.evaluatePath(e,t,r)}invertPath(e){switch(e.pathType){case"^":return e.items[0];case"/":return{type:"path",pathType:"/",items:[...e.items].reverse().map(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 op.IRI(e.value));break;case"blank":t.add(new IA.BlankNode(e.value));break;default:throw new Wu(`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 op.IRI)return{type:"iri",value:r.value};if(r instanceof IA.BlankNode)return{type:"blank",value:r.id};if(r instanceof Cj.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}};jc.PropertyPathExecutor=Z_});var r1=S($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.BGPExecutor=$c.BGPExecutorError=void 0;var cp=as(),Ia=Ce(),e1=je(),lp=Gt(),up=xu(),Ij=RA(),Wr=class extends Error{static{o(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};$c.BGPExecutorError=Wr;var t1=class{static{o(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new Ij.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new cp.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 cp.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 Wr("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),a=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new Wr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,a,t);for(let l of c){let u=new cp.SolutionMapping;this.isVariable(e.subject)&&u.set(e.subject.value,l.subject),this.isVariable(r)&&u.set(r.value,l.predicate),this.isVariable(e.object)&&u.set(e.object.value,l.object),yield u}}async*joinWithPatternInGraph(e,t,r){let i=[];for await(let s of e)i.push(s);for(let s of i){let a=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(a,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){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),a=await this.tripleStore.match(r,i,s);for(let c of a){let l=new cp.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 up.QuotedTriple))return null;let r=new Map;if(this.isVariable(e.subject))r.set(e.subject.value,t.subject);else if(this.isQuotedTriple(e.subject)){let i=this.matchQuotedTriplePattern(e.subject,t.subject);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.subject,t.subject))return null;if(e.predicate.type==="variable")r.set(e.predicate.value,t.predicate);else if(e.predicate.value!==t.predicate.value)return null;if(this.isVariable(e.object))r.set(e.object.value,t.object);else if(this.isQuotedTriple(e.object)){let i=this.matchQuotedTriplePattern(e.object,t.object);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof Ia.IRI&&e.value===t.value;case"literal":return!(!(t instanceof e1.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof lp.BlankNode&&e.value===t.id;case"quoted":return t instanceof up.QuotedTriple?this.toRDFQuotedTriple(e).equals(t):!1;default:return!1}}isPropertyPath(e){return e.type==="path"}async*joinWithPattern(e,t){let r=[];for await(let i of e)r.push(i);for(let i of r){let s=this.instantiatePattern(t,i);for await(let a of this.matchTriplePattern(s)){let c=i.merge(a);c!==null&&(yield c)}}}instantiatePattern(e,t){let r=this.isPropertyPath(e.predicate)?e.predicate:this.instantiateElement(e.predicate,t);return{subject:this.instantiateElement(e.subject,t),predicate:r,object:this.instantiateElement(e.object,t)}}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r)return this.toAlgebraElement(r)}return this.isQuotedTriple(e)?this.instantiateQuotedTriple(e,t):e}instantiateQuotedTriple(e,t){let r=this.instantiateElement(e.subject,t),i=e.predicate.type==="variable"?this.instantiatePredicateVariable(e.predicate,t):e.predicate,s=this.instantiateElement(e.object,t);return{type:"quoted",subject:r,predicate:i,object:s}}instantiatePredicateVariable(e,t){let r=t.get(e.value);return r&&r instanceof 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;console.warn(`[BGPExecutor] literal-safety guard fired in ${e}: literal in ${t} position \u2014 yielding 0 solutions. value="${s}"`)}toRDFTermAsSubject(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"blank":return new lp.BlankNode(e.value);case"literal":throw new Wr("Literals cannot appear in subject position");case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new Wr(`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 Wr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new up.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"literal":throw new Wr("Literals cannot appear in predicate position");case"blank":throw new Wr("Blank nodes cannot appear in predicate position");case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new Wr(`Unknown element type: ${String(e)}`)}}toRDFTerm(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"literal":return new e1.Literal(e.value,e.datatype?new Ia.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new lp.BlankNode(e.value);case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new Wr(`Unknown element type: ${String(e)}`)}}toAlgebraElement(e){if(e instanceof Ia.IRI)return{type:"iri",value:e.value};if(e instanceof e1.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof lp.BlankNode)return{type:"blank",value:e.id};if(e instanceof up.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new Wr(`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)}}};$c.BGPExecutor=t1});var PA=S(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.StringFunctions=void 0;var Bc=Ce(),Ra=je(),n1=Gt(),Gu=class n{static{o(this,"StringFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof Bc.IRI||e instanceof Ra.Literal?e.value:e instanceof n1.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof Ra.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof Ra.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=n.parseDirectionalLangTag(e),[s,a]=n.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":a&&i!==a?!1:c===l?!0:c.startsWith(l+"-")}static parseDirectionalLangTag(e){let t=e.indexOf("--");if(t===-1)return[e,void 0];let r=e.substring(0,t),i=e.substring(t+2).toLowerCase();return[r,i]}static 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",a=s.includes("u")?s:s+"u",c=new RegExp(t,a);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static 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 Ra.Literal)r=e.value;else if(e instanceof Bc.IRI)r=e.value;else if(e instanceof n1.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 Ra.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof Bc.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 Ra.Literal(s,new Bc.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 Ra.Literal)t=e.value;else if(e instanceof Bc.IRI)t=e.value;else if(e instanceof n1.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 Ra.Literal(r,new Bc.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}};fp.StringFunctions=Gu;Gu.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];Gu.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 OA=S(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.MathFunctions=void 0;var i1=class{static{o(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()}};dp.MathFunctions=i1});var pp=S(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DateTimeParsing=void 0;var Rj=Ce(),Pj=je(),s1=class n{static{o(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"),a="",c="";if(s===-1?a=r:(a=r.substring(0,s),c=r.substring(s+1)),a){let l=a.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(a!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${a}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let 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 a=Math.floor(r/(60*1e3));r=r%(60*1e3);let c=r/1e3,l=t?"-P":"P";return i>0&&(l+=`${i}D`),(s>0||a>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),a>0&&(l+=`${a}M`),(c>0||s===0&&a===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return n.parseDayTimeDuration(e),new Pj.Literal(e,new Rj.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDDate(e){let t=/^(-?\d{4})-(\d{2})-(\d{2})(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r){let u=new Date(e);return isNaN(u.getTime())?null:new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()))}let i=parseInt(r[1],10),s=parseInt(r[2],10)-1,a=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,a));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,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),a=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||a<0||a>59||i===24&&(s!==0||a!==0))return null;let u=0;if(c){let d=c.padEnd(3,"0").slice(0,3);u=parseInt(d,10)}let f=i*60*60*1e3+s*60*1e3+a*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),_=parseInt(d[3],10),v=h*(p*60+_)*60*1e3;f-=v}}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),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+a;return i?-c:c}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,a=t?"-P":"P";return i>0&&(a+=`${i}Y`),(s>0||i===0)&&(a+=`${s}M`),a}static parseYearMonthDurationComponents(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDurationComponents: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:a,negative:i}}static parseDurationComponents(e){if(!e)throw new Error("parseDurationComponents: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDurationComponents: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=0,a=0,c=0,l=r.indexOf("T"),u="",f="";if(l===-1?u=r:(u=r.substring(0,l),f=r.substring(l+1)),u){let 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&&(a=parseFloat(p[1]),d=d.substring(p[0].length));let _=d.match(/^(\d+(?:\.\d+)?)S$/);if(_&&(c=parseFloat(_[1]),d=d.substring(_[0].length)),d!=="")throw new Error(`parseDurationComponents: invalid time component: '${d}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:a,seconds:c}}};hp.DateTimeParsing=s1});var FA=S(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.DateTimeArithmetic=void 0;var un=Ce(),Te=je(),Xe=pp(),a1=class{static{o(this,"DateTimeArithmetic")}static dateTimeDiff(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r),a=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(a.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-a.getTime(),l=Xe.DateTimeParsing.formatDayTimeDuration(c);return new Te.Literal(l,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c);return new Te.Literal(l.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c);return new Te.Literal(l.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+a,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 Te.Literal(h,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-a,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 Te.Literal(h,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateTimeAddYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0),new Te.Literal(s.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0),new Te.Literal(s.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),d=`${l}-${u}-${f}`;return new Te.Literal(d,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),d=`${l}-${u}-${f}`;return new Te.Literal(d,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseDayTimeDuration(r),a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=Xe.DateTimeParsing.formatDayTimeDuration(s+a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseDayTimeDuration(r),a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=Xe.DateTimeParsing.formatDayTimeDuration(s-a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof Te.Literal?e.value:e,i=Xe.DateTimeParsing.parseDayTimeDuration(r),s=Xe.DateTimeParsing.formatDayTimeDuration(i*t);return new Te.Literal(s,new un.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 Te.Literal?e.value:e,i=Xe.DateTimeParsing.parseDayTimeDuration(r),s=Xe.DateTimeParsing.formatDayTimeDuration(i/t);return new Te.Literal(s,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static yearMonthDurationAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseYearMonthDuration(r),a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=Xe.DateTimeParsing.formatYearMonthDuration(s+a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseYearMonthDuration(r),a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=Xe.DateTimeParsing.formatYearMonthDuration(s-a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static durationToDays(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/1e3}};mp.DateTimeArithmetic=a1});var DA=S(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.DateTimeAccessors=void 0;var zu=Ce(),Lt=je(),Tt=pp(),o1=class{static{o(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 Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static durationYears(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.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),a=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);a===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${a}M`}else{let s=-t.getTimezoneOffset(),a=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${a}H`:r=`${l}PT${a}H${c}M`}}return new Lt.Literal(r,new zu.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 Lt.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let we=i.getUTCFullYear(),z=String(i.getUTCMonth()+1).padStart(2,"0"),G=String(i.getUTCDate()).padStart(2,"0"),F=String(i.getUTCHours()).padStart(2,"0"),j=String(i.getUTCMinutes()).padStart(2,"0"),te=String(i.getUTCSeconds()).padStart(2,"0"),Ye=i.getUTCMilliseconds(),st=`${we}-${z}-${G}T${F}:${j}:${te}`;return Ye>0&&(st+=`.${String(Ye).padStart(3,"0")}`),new Lt.Literal(st,new zu.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof Lt.Literal?t.value:t,a=Tt.DateTimeParsing.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(a)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+a),f=u.getUTCFullYear(),d=String(u.getUTCMonth()+1).padStart(2,"0"),h=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),_=String(u.getUTCMinutes()).padStart(2,"0"),v=String(u.getUTCSeconds()).padStart(2,"0"),E=u.getUTCMilliseconds(),b=a>=0?"+":"-",A=Math.floor(Math.abs(a)/(3600*1e3)),R=Math.floor(Math.abs(a)%(3600*1e3)/(60*1e3)),B=`${b}${String(A).padStart(2,"0")}:${String(R).padStart(2,"0")}`,W=`${f}-${d}-${h}T${p}:${_}:${v}`;return E>0&&(W+=`.${String(E).padStart(3,"0")}`),W+=B,new Lt.Literal(W,new zu.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static now(){return new Date().toISOString()}static dateBefore(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t);return r<i}static dateAfter(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t);return r>i}static dateInRange(e,t,r){let i=Tt.DateTimeParsing.parseDate(e),s=Tt.DateTimeParsing.parseDate(t),a=Tt.DateTimeParsing.parseDate(r);return i>=s&&i<=a}static compareDurations(e,t,r){let i=e instanceof Lt.Literal?e.value:e,s=t instanceof Lt.Literal?t.value:t,a=Tt.DateTimeParsing.parseDayTimeDuration(i),c=Tt.DateTimeParsing.parseDayTimeDuration(s);switch(r){case"=":return a===c;case"!=":return a!==c;case"<":return a<c;case">":return a>c;case"<=":return a<=c;case">=":return a>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static dateDiffMinutes(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.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 Lt.Literal?e.value:e,i=t instanceof Lt.Literal?t.value:t,s=Tt.DateTimeParsing.parseXSDTime(r),a=Tt.DateTimeParsing.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(a===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-a,l=Tt.DateTimeParsing.formatDayTimeDuration(c);return new Lt.Literal(l,new zu.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static isDayTimeDuration(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static isYearMonthDuration(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static isTime(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static dateDiff(e,t){let r=e instanceof Lt.Literal?e.value:e,i=t instanceof Lt.Literal?t.value:t,s=Tt.DateTimeParsing.parseXSDDate(r),a=Tt.DateTimeParsing.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(a===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-a.getTime(),l=Math.round(c/(1440*60*1e3)),u=Tt.DateTimeParsing.formatDateDuration(l);return new Lt.Literal(u,new zu.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}};gp.DateTimeAccessors=o1});var _p=S(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.DateTimeFunctions=void 0;var Vc=pp(),sr=FA(),gt=DA(),c1=class{static{o(this,"DateTimeFunctions")}static parseDate(e){return Vc.DateTimeParsing.parseDate(e)}static parseDayTimeDuration(e){return Vc.DateTimeParsing.parseDayTimeDuration(e)}static formatDayTimeDuration(e){return Vc.DateTimeParsing.formatDayTimeDuration(e)}static xsdDayTimeDuration(e){return Vc.DateTimeParsing.xsdDayTimeDuration(e)}static parseYearMonthDuration(e){return Vc.DateTimeParsing.parseYearMonthDuration(e)}static formatYearMonthDuration(e){return Vc.DateTimeParsing.formatYearMonthDuration(e)}static year(e){return gt.DateTimeAccessors.year(e)}static month(e){return gt.DateTimeAccessors.month(e)}static day(e){return gt.DateTimeAccessors.day(e)}static hours(e){return gt.DateTimeAccessors.hours(e)}static minutes(e){return gt.DateTimeAccessors.minutes(e)}static seconds(e){return gt.DateTimeAccessors.seconds(e)}static durationDays(e){return gt.DateTimeAccessors.durationDays(e)}static durationHours(e){return gt.DateTimeAccessors.durationHours(e)}static durationMinutes(e){return gt.DateTimeAccessors.durationMinutes(e)}static durationSeconds(e){return gt.DateTimeAccessors.durationSeconds(e)}static durationYears(e){return gt.DateTimeAccessors.durationYears(e)}static durationMonths(e){return gt.DateTimeAccessors.durationMonths(e)}static timezone(e){return gt.DateTimeAccessors.timezone(e)}static tz(e){return gt.DateTimeAccessors.tz(e)}static adjust(e,t){return gt.DateTimeAccessors.adjust(e,t)}static now(){return gt.DateTimeAccessors.now()}static dateBefore(e,t){return gt.DateTimeAccessors.dateBefore(e,t)}static dateAfter(e,t){return gt.DateTimeAccessors.dateAfter(e,t)}static dateInRange(e,t,r){return gt.DateTimeAccessors.dateInRange(e,t,r)}static compareDurations(e,t,r){return gt.DateTimeAccessors.compareDurations(e,t,r)}static dateDiffMinutes(e,t){return gt.DateTimeAccessors.dateDiffMinutes(e,t)}static dateDiffHours(e,t){return gt.DateTimeAccessors.dateDiffHours(e,t)}static timeDiff(e,t){return gt.DateTimeAccessors.timeDiff(e,t)}static dateDiff(e,t){return gt.DateTimeAccessors.dateDiff(e,t)}static isDayTimeDuration(e){return gt.DateTimeAccessors.isDayTimeDuration(e)}static isDate(e){return gt.DateTimeAccessors.isDate(e)}static isYearMonthDuration(e){return gt.DateTimeAccessors.isYearMonthDuration(e)}static isTime(e){return gt.DateTimeAccessors.isTime(e)}static dateTimeDiff(e,t){return sr.DateTimeArithmetic.dateTimeDiff(e,t)}static dateTimeAdd(e,t){return sr.DateTimeArithmetic.dateTimeAdd(e,t)}static dateTimeSubtract(e,t){return sr.DateTimeArithmetic.dateTimeSubtract(e,t)}static dateAdd(e,t){return sr.DateTimeArithmetic.dateAdd(e,t)}static dateSubtract(e,t){return sr.DateTimeArithmetic.dateSubtract(e,t)}static dateTimeAddYearMonth(e,t){return sr.DateTimeArithmetic.dateTimeAddYearMonth(e,t)}static dateTimeSubtractYearMonth(e,t){return sr.DateTimeArithmetic.dateTimeSubtractYearMonth(e,t)}static dateAddYearMonth(e,t){return sr.DateTimeArithmetic.dateAddYearMonth(e,t)}static dateSubtractYearMonth(e,t){return sr.DateTimeArithmetic.dateSubtractYearMonth(e,t)}static durationAdd(e,t){return sr.DateTimeArithmetic.durationAdd(e,t)}static durationSubtract(e,t){return sr.DateTimeArithmetic.durationSubtract(e,t)}static durationMultiply(e,t){return sr.DateTimeArithmetic.durationMultiply(e,t)}static durationDivide(e,t){return sr.DateTimeArithmetic.durationDivide(e,t)}static yearMonthDurationAdd(e,t){return sr.DateTimeArithmetic.yearMonthDurationAdd(e,t)}static yearMonthDurationSubtract(e,t){return sr.DateTimeArithmetic.yearMonthDurationSubtract(e,t)}static durationToDays(e){return sr.DateTimeArithmetic.durationToDays(e)}static durationToHours(e){return sr.DateTimeArithmetic.durationToHours(e)}static durationToMinutes(e){return sr.DateTimeArithmetic.durationToMinutes(e)}static durationToSeconds(e){return sr.DateTimeArithmetic.durationToSeconds(e)}};yp.DateTimeFunctions=c1});var NA=S(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.LogicalFunctions=void 0;var Oj=Ce(),Uc=je(),Fj=Gt(),Sp=_p(),l1=class n{static{o(this,"LogicalFunctions")}static compare(e,t,r){if(n.isDayTimeDurationValue(e)&&n.isDayTimeDurationValue(t))return Sp.DateTimeFunctions.compareDurations(e instanceof Uc.Literal?e:String(e),t instanceof Uc.Literal?t:String(t),r);if(n.isDayTimeDurationValue(e)&&typeof t=="string"&&/^-?P/.test(t))return Sp.DateTimeFunctions.compareDurations(e instanceof Uc.Literal?e:String(e),t,r);if(typeof e=="string"&&/^-?P/.test(e)&&n.isDayTimeDurationValue(t))return Sp.DateTimeFunctions.compareDurations(e,t instanceof Uc.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 Uc.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 Uc.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 Sp.DateTimeFunctions.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof Oj.IRI?e.value:e instanceof Fj.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}};vp.LogicalFunctions=l1});var LA=S(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.RDFTermFunctions=void 0;var Dr=Ce(),vt=je(),ui=Gt(),qc=xu(),u1=wn(),f1=class n{static{o(this,"RDFTermFunctions")}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof vt.Literal)return e.datatype?e.datatype:e.language?new Dr.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Dr.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 Dr.IRI}static isBlank(e){return e===void 0?!1:e instanceof ui.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof vt.Literal}static isTriple(e){return e===void 0?!1:e instanceof qc.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof vt.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof vt.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 vt.Literal(t.toISOString(),new Dr.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 vt.Literal(String(t),new Dr.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 vt.Literal(String(t),new Dr.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 Dr.IRI&&t instanceof Dr.IRI)return e.value===t.value;if(e instanceof ui.BlankNode&&t instanceof ui.BlankNode)return e.id===t.id;if(e instanceof vt.Literal&&t instanceof vt.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 Dr.IRI)return e;if(e instanceof vt.Literal)return new Dr.IRI(e.value);throw e instanceof ui.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,u1.v4)().replace(/-/g,"").substring(0,12)}`;return new ui.BlankNode(t)}if(e instanceof vt.Literal)return new ui.BlankNode(e.value);if(e instanceof ui.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 vt.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 Dr.IRI)i=t;else if(t instanceof vt.Literal)i=new Dr.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new vt.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 vt.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 vt.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 vt.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 vt.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 vt.Literal)s=t.value;else if(typeof t=="string")s=t;else throw new Error("STRLANGDIR: language tag must be a string literal");if(s==="")throw new Error("STRLANGDIR: language tag cannot be empty");let a;if(r instanceof vt.Literal)a=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(a!=="ltr"&&a!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${a}'. Must be 'ltr' or 'rtl'`);return new vt.Literal(i,void 0,s,a)}static uuid(){let e=(0,u1.v4)();return new Dr.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,u1.v4)();return new vt.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 vt.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Dr.IRI)){let c=t instanceof vt.Literal?"Literal":t instanceof ui.BlankNode?"BlankNode":t instanceof qc.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,a=r;return new qc.QuotedTriple(i,s,a)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.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 qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.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 qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};bp.RDFTermFunctions=f1});var kA=S(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.HashFunctions=void 0;var d1=class{static{o(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")}};wp.HashFunctions=d1});var Tp=S(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.BuiltInFunctions=void 0;var ar=PA(),Pa=OA(),oe=_p(),Wc=NA(),Pt=LA(),Hu=kA(),h1=class{static{o(this,"BuiltInFunctions")}static str(...e){return ar.StringFunctions.str(...e)}static lang(...e){return ar.StringFunctions.lang(...e)}static langdir(...e){return ar.StringFunctions.langdir(...e)}static langMatches(...e){return ar.StringFunctions.langMatches(...e)}static regex(...e){return ar.StringFunctions.regex(...e)}static contains(...e){return ar.StringFunctions.contains(...e)}static strStarts(...e){return ar.StringFunctions.strStarts(...e)}static strEnds(...e){return ar.StringFunctions.strEnds(...e)}static strlen(...e){return ar.StringFunctions.strlen(...e)}static ucase(...e){return ar.StringFunctions.ucase(...e)}static lcase(...e){return ar.StringFunctions.lcase(...e)}static substr(...e){return ar.StringFunctions.substr(...e)}static strBefore(...e){return ar.StringFunctions.strBefore(...e)}static strAfter(...e){return ar.StringFunctions.strAfter(...e)}static concat(...e){return ar.StringFunctions.concat(...e)}static replace(...e){return ar.StringFunctions.replace(...e)}static encodeForUri(...e){return ar.StringFunctions.encodeForUri(...e)}static normalize(...e){return ar.StringFunctions.normalize(...e)}static fold(...e){return ar.StringFunctions.fold(...e)}static abs(...e){return Pa.MathFunctions.abs(...e)}static round(...e){return Pa.MathFunctions.round(...e)}static ceil(...e){return Pa.MathFunctions.ceil(...e)}static floor(...e){return Pa.MathFunctions.floor(...e)}static rand(){return Pa.MathFunctions.rand()}static msToMinutes(...e){return Pa.MathFunctions.msToMinutes(...e)}static msToHours(...e){return Pa.MathFunctions.msToHours(...e)}static msToSeconds(...e){return Pa.MathFunctions.msToSeconds(...e)}static parseDate(...e){return oe.DateTimeFunctions.parseDate(...e)}static dateBefore(...e){return oe.DateTimeFunctions.dateBefore(...e)}static dateAfter(...e){return oe.DateTimeFunctions.dateAfter(...e)}static dateInRange(...e){return oe.DateTimeFunctions.dateInRange(...e)}static dateDiffMinutes(...e){return oe.DateTimeFunctions.dateDiffMinutes(...e)}static dateDiffHours(...e){return oe.DateTimeFunctions.dateDiffHours(...e)}static year(...e){return oe.DateTimeFunctions.year(...e)}static month(...e){return oe.DateTimeFunctions.month(...e)}static day(...e){return oe.DateTimeFunctions.day(...e)}static hours(...e){return oe.DateTimeFunctions.hours(...e)}static minutes(...e){return oe.DateTimeFunctions.minutes(...e)}static seconds(...e){return oe.DateTimeFunctions.seconds(...e)}static timezone(...e){return oe.DateTimeFunctions.timezone(...e)}static tz(...e){return oe.DateTimeFunctions.tz(...e)}static now(){return oe.DateTimeFunctions.now()}static parseDayTimeDuration(...e){return oe.DateTimeFunctions.parseDayTimeDuration(...e)}static formatDayTimeDuration(...e){return oe.DateTimeFunctions.formatDayTimeDuration(...e)}static xsdDayTimeDuration(...e){return oe.DateTimeFunctions.xsdDayTimeDuration(...e)}static compareDurations(...e){return oe.DateTimeFunctions.compareDurations(...e)}static isDayTimeDuration(...e){return oe.DateTimeFunctions.isDayTimeDuration(...e)}static isDate(...e){return oe.DateTimeFunctions.isDate(...e)}static dateDiff(...e){return oe.DateTimeFunctions.dateDiff(...e)}static dateTimeDiff(...e){return oe.DateTimeFunctions.dateTimeDiff(...e)}static dateTimeAdd(...e){return oe.DateTimeFunctions.dateTimeAdd(...e)}static dateTimeSubtract(...e){return oe.DateTimeFunctions.dateTimeSubtract(...e)}static dateAdd(...e){return oe.DateTimeFunctions.dateAdd(...e)}static dateSubtract(...e){return oe.DateTimeFunctions.dateSubtract(...e)}static parseYearMonthDuration(...e){return oe.DateTimeFunctions.parseYearMonthDuration(...e)}static isYearMonthDuration(...e){return oe.DateTimeFunctions.isYearMonthDuration(...e)}static dateTimeAddYearMonth(...e){return oe.DateTimeFunctions.dateTimeAddYearMonth(...e)}static dateTimeSubtractYearMonth(...e){return oe.DateTimeFunctions.dateTimeSubtractYearMonth(...e)}static dateAddYearMonth(...e){return oe.DateTimeFunctions.dateAddYearMonth(...e)}static dateSubtractYearMonth(...e){return oe.DateTimeFunctions.dateSubtractYearMonth(...e)}static durationAdd(...e){return oe.DateTimeFunctions.durationAdd(...e)}static durationSubtract(...e){return oe.DateTimeFunctions.durationSubtract(...e)}static durationMultiply(...e){return oe.DateTimeFunctions.durationMultiply(...e)}static durationDivide(...e){return oe.DateTimeFunctions.durationDivide(...e)}static formatYearMonthDuration(...e){return oe.DateTimeFunctions.formatYearMonthDuration(...e)}static yearMonthDurationAdd(...e){return oe.DateTimeFunctions.yearMonthDurationAdd(...e)}static yearMonthDurationSubtract(...e){return oe.DateTimeFunctions.yearMonthDurationSubtract(...e)}static durationYears(...e){return oe.DateTimeFunctions.durationYears(...e)}static durationMonths(...e){return oe.DateTimeFunctions.durationMonths(...e)}static durationToDays(...e){return oe.DateTimeFunctions.durationToDays(...e)}static durationToHours(...e){return oe.DateTimeFunctions.durationToHours(...e)}static durationToMinutes(...e){return oe.DateTimeFunctions.durationToMinutes(...e)}static durationToSeconds(...e){return oe.DateTimeFunctions.durationToSeconds(...e)}static durationDays(...e){return oe.DateTimeFunctions.durationDays(...e)}static durationHours(...e){return oe.DateTimeFunctions.durationHours(...e)}static durationMinutes(...e){return oe.DateTimeFunctions.durationMinutes(...e)}static durationSeconds(...e){return oe.DateTimeFunctions.durationSeconds(...e)}static adjust(...e){return oe.DateTimeFunctions.adjust(...e)}static isTime(...e){return oe.DateTimeFunctions.isTime(...e)}static timeDiff(...e){return oe.DateTimeFunctions.timeDiff(...e)}static compare(...e){return Wc.LogicalFunctions.compare(...e)}static logicalAnd(...e){return Wc.LogicalFunctions.logicalAnd(...e)}static logicalOr(...e){return Wc.LogicalFunctions.logicalOr(...e)}static logicalNot(...e){return Wc.LogicalFunctions.logicalNot(...e)}static coalesce(...e){return Wc.LogicalFunctions.coalesce(...e)}static if(...e){return Wc.LogicalFunctions.if(...e)}static datatype(...e){return Pt.RDFTermFunctions.datatype(...e)}static bound(...e){return Pt.RDFTermFunctions.bound(...e)}static isIRI(...e){return Pt.RDFTermFunctions.isIRI(...e)}static isBlank(...e){return Pt.RDFTermFunctions.isBlank(...e)}static isLiteral(...e){return Pt.RDFTermFunctions.isLiteral(...e)}static isTriple(...e){return Pt.RDFTermFunctions.isTriple(...e)}static isNumeric(...e){return Pt.RDFTermFunctions.isNumeric(...e)}static hasLangdir(...e){return Pt.RDFTermFunctions.hasLangdir(...e)}static sameTerm(...e){return Pt.RDFTermFunctions.sameTerm(...e)}static iri(...e){return Pt.RDFTermFunctions.iri(...e)}static uri(...e){return Pt.RDFTermFunctions.uri(...e)}static bnode(...e){return Pt.RDFTermFunctions.bnode(...e)}static strdt(...e){return Pt.RDFTermFunctions.strdt(...e)}static strlang(...e){return Pt.RDFTermFunctions.strlang(...e)}static strlangdir(...e){return Pt.RDFTermFunctions.strlangdir(...e)}static uuid(){return Pt.RDFTermFunctions.uuid()}static struuid(){return Pt.RDFTermFunctions.struuid()}static xsdDateTime(...e){return Pt.RDFTermFunctions.xsdDateTime(...e)}static xsdInteger(...e){return Pt.RDFTermFunctions.xsdInteger(...e)}static xsdDecimal(...e){return Pt.RDFTermFunctions.xsdDecimal(...e)}static triple(...e){return Pt.RDFTermFunctions.triple(...e)}static subject(...e){return Pt.RDFTermFunctions.subject(...e)}static predicate(...e){return Pt.RDFTermFunctions.predicate(...e)}static object(...e){return Pt.RDFTermFunctions.object(...e)}static md5(...e){return Hu.HashFunctions.md5(...e)}static sha1(...e){return Hu.HashFunctions.sha1(...e)}static sha256(...e){return Hu.HashFunctions.sha256(...e)}static sha384(...e){return Hu.HashFunctions.sha384(...e)}static sha512(...e){return Hu.HashFunctions.sha512(...e)}};Ep.BuiltInFunctions=h1});var Qu=S(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ExoQLBudgetExceededError=os.ExoQLCycleError=os.ExoQLEvalDisabledError=os.ExoQLForbiddenKeywordError=void 0;var p1=class extends Error{static{o(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}};os.ExoQLForbiddenKeywordError=p1;var m1=class extends Error{static{o(this,"ExoQLEvalDisabledError")}constructor(e){super(e??"ExoQLEvalDisabledError: exoql.eval.enabled is false (default). Flip the feature flag to opt in."),this.name="ExoQLEvalDisabledError"}};os.ExoQLEvalDisabledError=m1;var g1=class extends Error{static{o(this,"ExoQLCycleError")}constructor(e,t){super(t??`ExoQLCycleError: cycle detected in nested exo:eval invocations: ${e.join(" \u2192 ")}`),this.name="ExoQLCycleError",this.path=e}};os.ExoQLCycleError=g1;var y1=class extends Error{static{o(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}};os.ExoQLBudgetExceededError=y1});var GA=S(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.functionHandlers=void 0;var k=Tp();M.functionHandlers=new Map;M.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.str(t)});M.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.lang(t)});M.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 k.BuiltInFunctions.langMatches(t,r)});M.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 k.BuiltInFunctions.contains(t,r)});M.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 k.BuiltInFunctions.strStarts(t,r)});M.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 k.BuiltInFunctions.strEnds(t,r)});M.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.strlen(t)});M.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.ucase(t)});M.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.lcase(t)});M.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 k.BuiltInFunctions.substr(t,r,i)}return k.BuiltInFunctions.substr(t,r)});M.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 k.BuiltInFunctions.strBefore(t,r)});M.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 k.BuiltInFunctions.strAfter(t,r)});M.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return k.BuiltInFunctions.concat(...t)});M.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 k.BuiltInFunctions.replace(t,r,i,s)});M.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 k.BuiltInFunctions.regex(t,r,i)});M.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.encodeForUri(t)});M.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.datatype(t).value});M.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return k.BuiltInFunctions.bound(r)}return!0});var MA=o((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isIRI(t)},"isIriHandler");M.functionHandlers.set("isiri",MA);M.functionHandlers.set("isuri",MA);M.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isBlank(t)});M.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isLiteral(t)});M.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isNumeric(t)});M.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.hasLangdir(t)});M.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isTriple(t)});M.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return k.BuiltInFunctions.sameTerm(t,r)});M.functionHandlers.set("abs",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.abs(t)});M.functionHandlers.set("round",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.round(t)});M.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.ceil(t)});M.functionHandlers.set("floor",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.floor(t)});M.functionHandlers.set("rand",()=>k.BuiltInFunctions.rand());M.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.parseDate(t)});M.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 k.BuiltInFunctions.dateBefore(t,r)});M.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 k.BuiltInFunctions.dateAfter(t,r)});M.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 k.BuiltInFunctions.dateInRange(t,r,i)});M.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 k.BuiltInFunctions.dateDiffMinutes(t,r)});M.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 k.BuiltInFunctions.dateDiffHours(t,r)});var Gc=o((n,e,t)=>(r,i)=>{let s=i.evaluateExpression(r[0],i.solution);return e&&i.isYearMonthDurationValue(s)?e(s):t&&i.isDayTimeDurationValue(s)?t(s):n(i.getStringValue(s))},"createDateTimeAccessor"),jA=Gc(k.BuiltInFunctions.year.bind(k.BuiltInFunctions),k.BuiltInFunctions.durationYears.bind(k.BuiltInFunctions),null);M.functionHandlers.set("year",jA);M.functionHandlers.set("years",jA);var $A=Gc(k.BuiltInFunctions.month.bind(k.BuiltInFunctions),k.BuiltInFunctions.durationMonths.bind(k.BuiltInFunctions),null);M.functionHandlers.set("month",$A);M.functionHandlers.set("months",$A);var BA=Gc(k.BuiltInFunctions.day.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationDays.bind(k.BuiltInFunctions));M.functionHandlers.set("day",BA);M.functionHandlers.set("days",BA);M.functionHandlers.set("hours",Gc(k.BuiltInFunctions.hours.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationHours.bind(k.BuiltInFunctions)));M.functionHandlers.set("minutes",Gc(k.BuiltInFunctions.minutes.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationMinutes.bind(k.BuiltInFunctions)));M.functionHandlers.set("seconds",Gc(k.BuiltInFunctions.seconds.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationSeconds.bind(k.BuiltInFunctions)));M.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.timezone(t)});M.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.tz(t)});M.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 k.BuiltInFunctions.adjust(t,r)});M.functionHandlers.set("now",()=>k.BuiltInFunctions.now());var VA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");M.functionHandlers.set("datetime",VA);M.functionHandlers.set("xsd:datetime",VA);var UA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");M.functionHandlers.set("integer",UA);M.functionHandlers.set("xsd:integer",UA);var qA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");M.functionHandlers.set("decimal",qA);M.functionHandlers.set("xsd:decimal",qA);var WA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");M.functionHandlers.set("daytimeduration",WA);M.functionHandlers.set("xsd:daytimeduration",WA);M.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToDays(t)});M.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToHours(t)});M.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToMinutes(t)});M.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToSeconds(t)});M.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationDays(t)});M.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationHours(t)});M.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationMinutes(t)});M.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationSeconds(t)});M.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationYears(t)});M.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationMonths(t)});M.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeDiff(t,r)});M.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeAdd(t,r)});M.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeSubtract(t,r)});M.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToMinutes(t)});M.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToHours(t)});M.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToSeconds(t)});M.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.md5(t)});M.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha1(t)});M.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha256(t)});M.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha384(t)});M.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha512(t)});M.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.subject(t)});M.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.predicate(t)});M.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.object(t)});M.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 k.BuiltInFunctions.triple(t,r,i)});M.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))});M.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))});M.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)});M.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))});M.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)});M.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"))});M.functionHandlers.set("exo:eval",()=>{let{ExoQLEvalDisabledError:n}=Qu();throw new n})});var Ap=S(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.FilterExecutor=zc.FilterExecutorError=void 0;var yt=Tp(),Dj=GA(),Nj=Ce(),Oa=je(),pr=class extends Error{static{o(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};zc.FilterExecutorError=pr;var _1=class{static{o(this,"FilterExecutor")}constructor(){this.existsEvaluator=null,this.tripleStore=null,this.uuidCache=new Map}setExistsEvaluator(e){this.existsEvaluator=e}setTripleStore(e){this.tripleStore=e,this.uuidCache.clear()}async*execute(e,t){let r=this.expressionContainsExists(e.expression);for await(let i of t)try{let s;r?s=await this.evaluateExpressionAsync(e.expression,i):s=this.evaluateExpression(e.expression,i),s===!0&&(yield i)}catch{continue}}expressionContainsExists(e){if(!e||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}o(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":return r.value;case"NamedNode":return r.value;default:throw new pr(`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":return e.value;case"in":return this.evaluateIn(e,t);case"exists":throw new pr("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new pr(`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 yt.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 pr("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 yt.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 yt.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return yt.BuiltInFunctions.logicalOr(r);throw new pr(`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 a=await this.evaluateExpressionAsync(s,t);if(yt.BuiltInFunctions.compare(r,a,"=")){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 pr("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 a=[];for(let l of s){let u=await this.evaluateExpressionAsync(l,t);a.push(this.wrapAsLiteralExpression(u))}let c={...r,args:a};return this.evaluateFunction(c,t)}wrapAsLiteralExpression(e){return e==null?{type:"literal",value:""}:e!==null&&typeof e=="object"&&"termType"in e?e:e instanceof Nj.IRI||e instanceof Oa.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 yt.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return yt.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return yt.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return yt.BuiltInFunctions.logicalOr(r);throw new pr(`Unknown logical operator: ${String(e.operator)}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let a=this.evaluateExpression(s,t);return yt.BuiltInFunctions.compare(r,a,"=")});return e.negated?!i:i}evaluateArithmetic(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);if(e.operator==="-"&&this.isDateValue(r)&&this.isDateValue(i))return yt.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return yt.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return yt.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return yt.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return yt.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new pr("Division by zero");return yt.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),a=this.toNumericValue(i);switch(e.operator){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":if(a===0)throw new pr("Division by zero");return s/a;default:throw new pr(`Unknown arithmetic operator: ${String(e.operator)}`)}}isDayTimeDurationValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof Oa.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 pr(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof Oa.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 Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}evaluateFunction(e,t){let r=e,i=this.extractFunctionName(r.function),s=this.evaluateSpecialFunction(i,r.args,t);if(s!==void 0)return s.value;let a=Dj.functionHandlers.get(i);if(!a)throw new pr(`Unknown function: ${i}`);let c={evaluateExpression:o((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:o((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:o(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:o(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:o(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return a(r.args,c)}extractFunctionName(e){if(typeof e=="string")return e.toLowerCase();if(e&&typeof e=="object"&&"value"in e){let t=e.value;return((t.includes("#")?t.split("#").pop():t.split("/").pop())||t).toLowerCase()}throw new pr(`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 pr("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 Oa.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 pr("exo:byUUID requires exactly 1 argument (UUID string)");let r=this.evaluateExpression(e.args[0],t),i=this.getStringValue(r);if(!i)return;let s=i.toLowerCase();if(this.uuidCache.has(s))return this.uuidCache.get(s)??void 0;if(!this.tripleStore){this.uuidCache.set(s,null);return}if(this.tripleStore.findSubjectsByUUIDSync){let a=this.tripleStore.findSubjectsByUUIDSync(s);if(a.length===0){this.uuidCache.set(s,null);return}let c=a[0];return this.uuidCache.set(s,c),c}this.uuidCache.set(s,null)}cacheUUIDResult(e,t){let r=e.toLowerCase();this.uuidCache.set(r,t)}getCachedUUID(e){let t=e.toLowerCase();if(this.uuidCache.has(t))return this.uuidCache.get(t)}};zc.FilterExecutor=_1});var v1=S(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.OptionalExecutor=void 0;var S1=class{static{o(this,"OptionalExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);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 a="\0",c=new Map;for(let l of t){let u=this.computeHashKey(l,s,a),f=c.get(u);f||(f=[],c.set(u,f)),f.push(l)}for(let l of e){let u=this.computeHashKey(l,s,a),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 a=e.get(s);i.push(a!==void 0?a.toString():"UNBOUND")}return i.join(r)}*nestedLoopJoin(e,t){for(let r of e){let i=!1;for(let s of t){let a=r.merge(s);a!==null&&(yield a,i=!0)}i||(yield r)}}};xp.OptionalExecutor=S1});var w1=S(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.UnionExecutor=void 0;var b1=class{static{o(this,"UnionExecutor")}async*execute(e,t){let r=new Set;for await(let i of e){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}for await(let i of t){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Cp.UnionExecutor=b1});var zA=S(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.MinusExecutor=void 0;var E1=class{static{o(this,"MinusExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i)if(this.areCompatible(s,c)){a=!0;break}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(a=>i.has(a));if(s.length===0)return!1;for(let a of s){let c=e.get(a),l=t.get(a);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Ip.MinusExecutor=E1});var QA=S(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ValuesExecutor=Hc.ValuesExecutorError=void 0;var Lj=as(),HA=Ce(),kj=je(),Rp=class extends Error{static{o(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Hc.ValuesExecutorError=Rp;var T1=class{static{o(this,"ValuesExecutor")}async*execute(e){if(e.bindings.length!==0)for(let t of e.bindings)yield this.createSolutionMapping(t)}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}createSolutionMapping(e){let t=new Lj.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 HA.IRI(e.value);if(e.type==="literal")return new kj.Literal(e.value,e.datatype?new HA.IRI(e.datatype):void 0,e.language,e.direction);throw new Rp(`Unknown term type: ${e.type}`)}};Hc.ValuesExecutor=T1});var A1=S(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.CustomAggregateRegistry=Yc.CustomAggregateError=void 0;var Qc=class extends Error{static{o(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Yc.CustomAggregateError=Qc;var Pp=class n{static{o(this,"CustomAggregateRegistry")}constructor(){this.aggregates=new Map}static getInstance(){return n.instance||(n.instance=new n),n.instance}static resetInstance(){n.instance&&n.instance.clear(),n.instance=null}register(e,t){if(!e||typeof e!="string")throw new Qc("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Qc("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Qc(`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}};Yc.CustomAggregateRegistry=Pp;Pp.instance=null});var x1=S(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.BUILT_IN_AGGREGATES=Je.modeAggregate=Je.stddevAggregate=Je.varianceAggregate=Je.medianAggregate=Je.EXO_AGGREGATE_NS=void 0;Je.getNumericValue=Op;Je.createDecimalLiteral=fi;Je.createDoubleLiteral=$j;Je.createPercentileAggregate=xo;var Co=je(),Kc=Ce(),Mj=new Kc.IRI("http://www.w3.org/2001/XMLSchema#decimal"),jj=new Kc.IRI("http://www.w3.org/2001/XMLSchema#double");Je.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Op(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof Co.Literal?parseFloat(n.value):n instanceof Kc.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}o(Op,"getNumericValue");function fi(n){return new Co.Literal(String(n),Mj)}o(fi,"createDecimalLiteral");function $j(n){return new Co.Literal(String(n),jj)}o($j,"createDoubleLiteral");Je.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Op(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=[...t].sort((a,c)=>a-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return fi(s)}};Je.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Op(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return fi(i)}};Je.stddevAggregate={init(){return{values:[]}},step(n,e){Je.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return fi(Math.sqrt(i))}};Je.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof Co.Literal||e instanceof Kc.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 Co.Literal(" ",new Kc.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[a,c]of e.counts)c>r&&(r=c,t=a);let i=e.values.get(t);if(i instanceof Co.Literal)return i;let s=parseFloat(t);return isNaN(s)?new Co.Literal(t,new Kc.IRI("http://www.w3.org/2001/XMLSchema#string")):fi(s)}};function xo(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Op(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return fi(0);let s=[...i].sort((d,h)=>d-h),a=r.percentile*(s.length-1),c=Math.floor(a),l=Math.ceil(a);if(c===l)return fi(s[c]);let u=a-c,f=s[c]*(1-u)+s[l]*u;return fi(f)}}}o(xo,"createPercentileAggregate");Je.BUILT_IN_AGGREGATES={[`${Je.EXO_AGGREGATE_NS}median`]:Je.medianAggregate,[`${Je.EXO_AGGREGATE_NS}variance`]:Je.varianceAggregate,[`${Je.EXO_AGGREGATE_NS}stddev`]:Je.stddevAggregate,[`${Je.EXO_AGGREGATE_NS}mode`]:Je.modeAggregate,[`${Je.EXO_AGGREGATE_NS}percentile25`]:xo(25),[`${Je.EXO_AGGREGATE_NS}percentile50`]:xo(50),[`${Je.EXO_AGGREGATE_NS}percentile75`]:xo(75),[`${Je.EXO_AGGREGATE_NS}percentile90`]:xo(90),[`${Je.EXO_AGGREGATE_NS}percentile95`]:xo(95),[`${Je.EXO_AGGREGATE_NS}percentile99`]:xo(99)}});var XA=S(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.AggregateExecutor=Xc.AggregateExecutorError=void 0;var or=je(),I1=Ce(),Bj=Ap(),Vj=A1(),Uj=x1(),YA=new I1.IRI("http://www.w3.org/2001/XMLSchema#integer"),Io=new I1.IRI("http://www.w3.org/2001/XMLSchema#decimal"),cs=new I1.IRI("http://www.w3.org/2001/XMLSchema#string");function KA(n){return typeof n=="object"&&n.type==="custom"}o(KA,"isCustomAggregation");var Yu=class extends Error{static{o(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Xc.AggregateExecutorError=Yu;var C1=class{static{o(this,"AggregateExecutor")}constructor(){this.filterExecutor=new Bj.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,a]of r.entries()){let c=new Map;for(let f of e.variables)if(a.length>0){let d=a[0].get(f);d&&c.set(f,d)}for(let f of e.aggregates){let d=this.computeAggregate(f.expression,a);c.set(f.variable,d)}let{SolutionMapping:l}=as(),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),a=r.get(s);a?a.push(i):r.set(s,[i])}return r}computeGroupKey(e,t){return t.map(r=>{let i=e.get(r);return i?this.termToString(i):""}).join("|")}termToString(e){if(e&&typeof e=="object"){if("value"in e)return String(e.value);if("id"in e)return String(e.id)}return String(e)}computeAggregate(e,t){if(KA(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 or.Literal(String(s),YA)}case"sum":{let s=this.computeSum(r);return new or.Literal(String(s),Io)}case"avg":{let s=this.computeAvg(r);return new or.Literal(String(s),Io)}case"min":{let s=this.computeMin(r);return s===void 0?new or.Literal("",cs):typeof s=="number"?new or.Literal(String(s),Io):new or.Literal(String(s),cs)}case"max":{let s=this.computeMax(r);return s===void 0?new or.Literal("",cs):typeof s=="number"?new or.Literal(String(s),Io):new or.Literal(String(s),cs)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new or.Literal(s||" ",cs)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new or.Literal(" ",cs):typeof s=="number"?new or.Literal(String(s),Io):new or.Literal(String(s),cs)}default:{let s=i;throw new Yu(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,a=Vj.CustomAggregateRegistry.getInstance().get(i);if(a||(a=Uj.BUILT_IN_AGGREGATES[i]),!a)throw new Yu(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=a.init();for(let l of t){let u=null;if(e.expression){let f=this.evaluateExpression(e.expression,l);f!==void 0&&(u=f)}else u=1;a.step(c,u)}return a.finalize(c)}extractValues(e,t){if(!e.expression)return t.map(()=>1);let r=[];for(let i of t){let s=this.evaluateExpression(e.expression,i);s!=null&&r.push(s)}return r}evaluateExpression(e,t){if(e.type==="variable"){let r=t.get(e.name);return r==null?void 0:typeof r=="number"||typeof r=="string"||typeof r=="boolean"?r:typeof r=="object"&&"value"in r?r.value:r}if(e.type==="literal")return e.value;try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}computeCount(e,t){return t?new Set(e.map(r=>String(r))).size:e.length}computeSum(e){return e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r)).reduce((r,i)=>r+i,0)}computeAvg(e){let t=e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r));return t.length===0?0:t.reduce((r,i)=>r+i,0)/t.length}computeMin(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.min(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s<i?s:i,r[0])}computeMax(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.max(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s>i?s:i,r[0])}computeGroupConcat(e,t,r){let i=e.map(s=>String(s));return r&&(i=[...new Set(i)]),i.join(t)}computeSample(e,t){if(e.length===0)return;if(t){let s=[...new Set(e.map(l=>String(l)))];if(s.length===0)return;let a=s[0],c=parseFloat(a);return isNaN(c)?a:c}let r=e[0];if(typeof r=="number")return r;let i=parseFloat(String(r));return isNaN(i)?String(r):i}createEmptyAggregateResult(e){let{SolutionMapping:t}=as(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(KA(s)){r.set(i.variable,new or.Literal("0",Io));continue}switch(s){case"count":r.set(i.variable,new or.Literal("0",YA));break;case"sum":case"avg":r.set(i.variable,new or.Literal("0",Io));break;case"group_concat":r.set(i.variable,new or.Literal(" ",cs));break;case"min":case"max":case"sample":r.set(i.variable,new or.Literal("",cs));break;default:r.set(i.variable,new or.Literal("",cs))}}return r}};Xc.AggregateExecutor=C1});var F1=S(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ConstructExecutor=void 0;var qj=oi(),Ro=Ce(),R1=je(),P1=Gt(),Wj=xu(),O1=class{static{o(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let a of e)try{let c=this.instantiateTriple(a,s),l=`${c.subject.toString()}|${c.predicate.toString()}|${c.object.toString()}`;i.has(l)||(i.add(l),r.push(c))}catch{continue}return r}instantiateTriple(e,t){if(this.isPropertyPath(e.predicate))throw new Error("Property paths are not supported in CONSTRUCT templates");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.predicate,t),s=this.instantiateElement(e.object,t);return new qj.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 Ro.IRI(e.value);if(e.type==="literal")return new R1.Literal(e.value,e.datatype?new Ro.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new P1.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 Wj.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 R1.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new Ro.IRI(e.value);if(e.type==="blank")return new P1.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 Ro.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new Ro.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 Ro.IRI(e.value);if(e.type==="blank")return new P1.BlankNode(e.value);if(e.type==="literal")return new R1.Literal(e.value,e.datatype?new Ro.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}`)}};Fp.ConstructExecutor=O1});var ZA=S(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ServiceExecutor=Jc.ServiceExecutorError=void 0;var Gj=as(),JA=Ce(),zj=je(),Hj=Gt(),Po=class extends Error{static{o(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Jc.ServiceExecutorError=Po;var D1=class{static{o(this,"ServiceExecutor")}constructor(e={}){this.timeout=e.timeout??3e4,this.httpClient=e.httpClient??((t,r)=>fetch(t,r)),this.maxRetries=e.maxRetries??2,this.retryDelay=e.retryDelay??1e3}async*execute(e,t){try{let r=t(e.pattern),i=await this.executeRemoteQuery(e.endpoint,r);for(let s of i)yield s}catch(r){if(e.silent)return;throw r}}async executeRemoteQuery(e,t){let r;for(let i=0;i<=this.maxRetries;i++)try{let s=new AbortController,a=setTimeout(()=>s.abort(),this.timeout);try{let c=await this.httpClient(e,{method:"POST",headers:{"Content-Type":"application/sparql-query",Accept:"application/sparql-results+json"},body:t,signal:s.signal});if(!c.ok)throw new Po(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(a)}}catch(s){if(r=s instanceof Error?s:new Error(String(s)),this.isRetryableError(r)&&i<this.maxRetries){await this.delay(this.retryDelay);continue}throw new Po(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new Po(`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 Gj.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 JA.IRI(e.value);case"literal":{let t=e.datatype?new JA.IRI(e.datatype):void 0;return new zj.Literal(e.value,t,e["xml:lang"])}case"bnode":return new Hj.BlankNode(e.value);default:throw new Po(`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))}};Jc.ServiceExecutor=D1});var t3=S(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.GraphExecutor=Zc.GraphExecutorError=void 0;var e3=Ce(),Dp=class extends Error{static{o(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};Zc.GraphExecutorError=Dp;var N1=class{static{o(this,"GraphExecutor")}constructor(e){this.tripleStore=e}async*execute(e,t,r){let i=e.name;if(i.type==="iri")yield*this.executeWithGraph(e.pattern,i,t);else if(i.type==="variable")yield*this.executeWithGraphVariable(e,i,t,r);else throw new Dp(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new e3.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let a=i.get(t.value);if(a&&a instanceof e3.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:a.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let a of s)for await(let c of r(e.pattern,a)){let l=c.clone();l.set(t.value,a),yield l}}};Zc.GraphExecutor=N1});var r3=S(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.SPARQLGenerator=tl.SPARQLGeneratorError=void 0;var el=class extends Error{static{o(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};tl.SPARQLGeneratorError=el;var L1=class{static{o(this,"SPARQLGenerator")}collectVariables(e){let t=new Set;return this.collectVariablesFromOperation(e,t),t}generateSelect(e){let t=this.collectVariables(e),r=t.size>0?Array.from(t).map(s=>`?${s}`).join(" "):"*",i=this.generateWhereClause(e);return`SELECT ${r} WHERE {
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+=a,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 a=t+i.length+1,c=a;for(;c<e.length&&/[a-zA-Z0-9_.%-]/.test(e[c]);)c++;if(c===a)continue;let l=e.substring(a,c);return{iri:`<${s}${l}.md>`,endIndex:c}}return null}findDeclaredPrefixes(e){let t=new Set,r=new RegExp(sj.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}};Yh.VaultPrefixTransformer=V_});var Lc=S(An=>{"use strict";var oj=An&&An.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),cj=An&&An.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),lj=An&&An.__importStar||(function(){var n=o(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&oj(t,e,r[i]);return cj(t,e),t}})();Object.defineProperty(An,"__esModule",{value:!0});An.SPARQLParser=An.ExoQLParser=An.SPARQLParseError=void 0;var gA=lj(dA()),q_=L_(),W_=k_(),yA=hA(),G_=j_(),uj=pA(),z_=mA(),fj=U_(),ar=class extends Error{static{o(this,"SPARQLParseError")}constructor(e,t,r,i){super(e,i?{cause:i}:void 0),this.name="SPARQLParseError",this.line=t,this.column=r}};An.SPARQLParseError=ar;var Kh=class{static{o(this,"ExoQLParser")}constructor(e){this.lastDirectionMappings=new Map,this.parser=new gA.Parser({sparqlStar:!0}),this.generator=new gA.Generator({sparqlStar:!0}),this.caseWhenTransformer=new q_.CaseWhenTransformer,this.lateralTransformer=new W_.LateralTransformer,this.prefixStarTransformer=new yA.PrefixStarTransformer(e?.vocabularyResolver),this.describeOptionsTransformer=new G_.DescribeOptionsTransformer,this.directionalLangTagTransformer=new uj.DirectionalLangTagTransformer,this.tripleTermTransformer=new z_.TripleTermTransformer,this.vaultPrefixTransformer=new fj.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 G_.DescribeOptionsTransformerError)throw new ar(t.message);if(t instanceof W_.LateralTransformerError)throw new ar(t.message);if(t instanceof q_.CaseWhenTransformerError)throw new ar(t.message);if(t instanceof z_.TripleTermTransformerError)throw new ar(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 ar(`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 G_.DescribeOptionsTransformerError)throw new ar(t.message);if(t instanceof yA.PrefixStarTransformerError)throw new ar(t.message);if(t instanceof W_.LateralTransformerError)throw new ar(t.message);if(t instanceof q_.CaseWhenTransformerError)throw new ar(t.message);if(t instanceof z_.TripleTermTransformerError)throw new ar(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 ar(`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 ar(`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 ar("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 ar("Invalid query: not an object");if(e.type!=="query"&&e.type!=="update")throw new ar(`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 ar(`Invalid query type: expected one of ${t.join(", ")}, got "${e.queryType}"`)}}};An.ExoQLParser=Kh;An.SPARQLParser=Kh});var Ao=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.AlgebraTranslatorError=void 0;var H_=class extends Error{static{o(this,"AlgebraTranslatorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AlgebraTranslatorError"}};Xh.AlgebraTranslatorError=H_});var Jh=S(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.isVariableExpression=dj;ss.isVariableTerm=hj;ss.isNamedNode=pj;ss.isLiteral=mj;ss.isPropertyPath=gj;ss.isAggregateExpression=yj;ss.isOperationExpression=_j;ss.isFunctionCallExpression=Sj;function dj(n){return typeof n=="object"&&n!==null&&"expression"in n&&"variable"in n}o(dj,"isVariableExpression");function hj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Variable"}o(hj,"isVariableTerm");function pj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="NamedNode"}o(pj,"isNamedNode");function mj(n){return typeof n=="object"&&n!==null&&"termType"in n&&n.termType==="Literal"}o(mj,"isLiteral");function gj(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="path"}o(gj,"isPropertyPath");function yj(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="aggregate"}o(yj,"isAggregateExpression");function _j(n){return typeof n=="object"&&n!==null&&"type"in n&&n.type==="operation"}o(_j,"isOperationExpression");function Sj(n){return typeof n=="object"&&n!==null&&"type"in n&&(n.type==="functionCall"||n.type==="functioncall")}o(Sj,"isFunctionCallExpression")});var _A=S(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.TripleTranslator=void 0;var ln=Ao(),Q_=class{static{o(this,"TripleTranslator")}constructor(){this.directionMappings=new Map}setDirectionMappings(e){this.directionMappings=e}translateBGP(e){if(!("triples"in e)||!Array.isArray(e.triples))throw new ln.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 ln.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 ln.AlgebraTranslatorError("Property path must have pathType");if(!("items"in e)||!Array.isArray(e.items))throw new ln.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 ln.AlgebraTranslatorError("Inverse path must have exactly one item");return{type:"path",pathType:"^",items:[t[0]]};case"+":if(t.length!==1)throw new ln.AlgebraTranslatorError("OneOrMore path must have exactly one item");return{type:"path",pathType:"+",items:[t[0]]};case"*":if(t.length!==1)throw new ln.AlgebraTranslatorError("ZeroOrMore path must have exactly one item");return{type:"path",pathType:"*",items:[t[0]]};case"?":if(t.length!==1)throw new ln.AlgebraTranslatorError("ZeroOrOne path must have exactly one item");return{type:"path",pathType:"?",items:[t[0]]};default:throw new ln.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 ln.AlgebraTranslatorError(`Unsupported path item type: ${String(t)}`)}translateTripleElement(e){if(!e||!("termType"in e))throw new ln.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 ln.AlgebraTranslatorError(`Unsupported term type: ${e.termType}`)}}translateQuotedTriple(e){if(!e.subject||!e.predicate||!e.object)throw new ln.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 ln.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 ln.AlgebraTranslatorError(`Quoted triple predicate must be IRI or Variable, got: ${e.termType}`)}}};Zh.TripleTranslator=Q_});var SA=S(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.ExpressionTranslator=void 0;var kc=Ao(),Y_=class{static{o(this,"ExpressionTranslator")}constructor(e){this.translateWhereFn=e.translateWhere,this.translateBGPFn=e.translateBGP,this.translatePatternFn=e.translatePattern}translateExpression(e){if(!e)throw new kc.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 kc.AlgebraTranslatorError(`Unsupported expression structure: ${JSON.stringify(e)}`)}translateFilter(e){if(!e.expression)throw new kc.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(a=>!("patterns"in a)||"termType"in a);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(a=>this.translateExpression(a))}: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(a=>this.translateExpression(a))}}translateExistsExpression(e){if(!e.args||e.args.length!==1)throw new kc.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 kc.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 kc.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"}}};ep.ExpressionTranslator=Y_});var wA=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.PatternTranslator=void 0;var vA=k_(),Fr=Ao(),bA=Jh(),K_=class{static{o(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 Fr.AlgebraTranslatorError("Empty WHERE clause");let t=e.filter(a=>a.type==="filter"),r=e.filter(a=>a.type==="bind"),i=e.filter(a=>a.type!=="filter"&&a.type!=="bind"),s;if(i.length===0)s={type:"bgp",triples:[]};else if(i.length===1)if(i[0].type==="optional"){let a=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:a?this.translateExpressionFn(a):void 0}}else s=this.translatePattern(i[0]);else{if(i[0].type==="optional"){let a=i[0].expression;s={type:"leftjoin",left:{type:"bgp",triples:[]},right:this.translateWhere(i[0].patterns),expression:a?this.translateExpressionFn(a):void 0}}else s=this.translatePattern(i[0]);for(let a=1;a<i.length;a++){let c=i[a];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 a of r)s=this.translateBind(a,s);for(let a of t)s={type:"filter",expression:this.translateExpressionFn(a.expression),input:s};return s}translatePattern(e){if(!e||!e.type)throw new Fr.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 Fr.AlgebraTranslatorError(`Unsupported pattern type: ${e.type}`)}}translateFilter(e){if(!e.expression)throw new Fr.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 Fr.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 Fr.AlgebraTranslatorError("UNION pattern must have at least 2 patterns");let t=o(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 Fr.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 Fr.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 a=s.startsWith("?")?s.slice(1):s;t.add(a)}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,a=i;if(a)if(a.termType==="NamedNode")t[s]={type:"iri",value:a.value};else if(a.termType==="Literal"){let c=a,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 Fr.AlgebraTranslatorError(`Unsupported VALUES term type: ${a.termType}`)}return t}translateBind(e,t){if(!e.variable||!e.expression)throw new Fr.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 Fr.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 Fr.AlgebraTranslatorError("SERVICE pattern must have a NamedNode endpoint");if(!e.patterns||!Array.isArray(e.patterns))throw new Fr.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 Fr.AlgebraTranslatorError("GRAPH pattern must have a name (IRI or variable)");if(!e.patterns||!Array.isArray(e.patterns))throw new Fr.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 Fr.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 Fr.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,bA.isVariableTerm)(i)&&i.value===vA.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,bA.isVariableTerm)(i)&&i.value===vA.LateralTransformer.LATERAL_MARKER))}}};tp.PatternTranslator=K_});var TA=S(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.AggregateTranslator=void 0;var EA=Ao(),vj=Jh(),X_=class{static{o(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,vj.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)),a=["=","!=","<",">","<=",">="],c=["&&","||","!"],l=["+","-","*","/"];return a.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=o(()=>{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,a=i;if(a.termType==="NamedNode"&&typeof a.value=="string")s=a.value;else if("value"in a)s=String(a.value);else throw new EA.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 EA.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)}}}};rp.AggregateTranslator=X_});var Mc=S(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.AlgebraTranslator=Ca.ExoQLAlgebraTranslator=Ca.AlgebraTranslatorError=void 0;var np=Ao(),ip=Jh(),bj=_A(),wj=SA(),Ej=wA(),Tj=TA(),Aj=Ao();Object.defineProperty(Ca,"AlgebraTranslatorError",{enumerable:!0,get:o(function(){return Aj.AlgebraTranslatorError},"get")});var sp=class{static{o(this,"ExoQLAlgebraTranslator")}constructor(){this.tripleTranslator=new bj.TripleTranslator,this.expressionTranslator=new wj.ExpressionTranslator({translateWhere:o(e=>this.patternTranslator.translateWhere(e),"translateWhere"),translateBGP:o(e=>this.tripleTranslator.translateBGP(e),"translateBGP"),translatePattern:o(e=>this.patternTranslator.translatePattern(e),"translatePattern")}),this.patternTranslator=new Ej.PatternTranslator({translateExpression:o(e=>this.expressionTranslator.translateExpression(e),"translateExpression"),translateSelect:o(e=>this.translateSelect(e),"translateSelect"),translateBGP:o(e=>this.tripleTranslator.translateBGP(e),"translateBGP")}),this.aggregateTranslator=new Tj.AggregateTranslator({translateExpression:o(e=>this.expressionTranslator.translateExpression(e),"translateExpression")})}setDirectionMappings(e){this.tripleTranslator.setDirectionMappings(e),this.patternTranslator.setDirectionMappings(e)}translate(e){if(e.type!=="query")throw new np.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 np.AlgebraTranslatorError(`Query type ${String(e.queryType)} not yet supported`)}translateSelect(e){if(!e.where||e.where.length===0)throw new np.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),a=this.aggregateTranslator.extractGroupVariables(e.group),c=this.aggregateTranslator.extractHavingExpressions(e.having,s,r);if((s.length>0||a.length>0||c.length>0)&&(t={type:"group",variables:a,aggregates:s,having:c.length>0?c:void 0,input:t}),i.length>0){for(let u of i)if((0,ip.isVariableExpression)(u)){if("type"in u.expression&&u.expression.type==="aggregate")continue;let f=this.aggregateTranslator.transformExpressionWithAggregateVars(u.expression,r);t={type:"extend",variable:u.variable.value,expression:f,input:t}}let l=i.filter(u=>(0,ip.isVariableTerm)(u)||(0,ip.isVariableExpression)(u)).map(u=>(0,ip.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.order&&e.order.length>0&&(t={type:"orderby",comparators:e.order.map(l=>this.aggregateTranslator.translateOrderComparator(l)),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 np.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 a of s)a.termType==="Wildcard"||a.value==="*"||(a.termType==="Variable"?t.push({type:"variable",value:a.value}):a.termType==="NamedNode"&&t.push({type:"iri",value:a.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}}};Ca.ExoQLAlgebraTranslator=sp;Ca.AlgebraTranslator=sp});var as=S(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.SolutionMapping=void 0;var AA=je(),xA=Ce(),CA=Gt(),J_=class n{static{o(this,"SolutionMapping")}constructor(e){this.bindings=e?new Map(e):new Map}get(e){return this.bindings.get(e)}set(e,t){this.bindings.set(e,t)}has(e){return this.bindings.has(e)}variables(){return Array.from(this.bindings.keys())}getBindings(){return new Map(this.bindings)}isCompatibleWith(e){for(let[t,r]of this.bindings.entries()){let i=e.get(t);if(i!==void 0&&!this.areEqual(r,i))return!1}return!0}merge(e){if(!this.isCompatibleWith(e))return null;let t=new n(this.bindings);for(let[r,i]of e.getBindings().entries())t.set(r,i);return t}clone(){return new n(this.bindings)}areEqual(e,t){return e instanceof AA.Literal&&t instanceof AA.Literal?e.equals(t):e instanceof xA.IRI&&t instanceof xA.IRI?e.value===t.value:e instanceof CA.BlankNode&&t instanceof CA.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}};ap.SolutionMapping=J_});var RA=S(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.PropertyPathExecutor=jc.PropertyPathExecutorError=void 0;var xj=as(),op=Ce(),IA=Gt(),Cj=je(),Wu=class extends Error{static{o(this,"PropertyPathExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="PropertyPathExecutorError"}};jc.PropertyPathExecutorError=Wu;var Z_=class{static{o(this,"PropertyPathExecutor")}constructor(e){this.tripleStore=e,this.MAX_DEPTH=100}async*execute(e,t,r){if(this.isLiteralElement(e)||this.isLiteralElement(r)){let a=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;console.warn(`[PropertyPathExecutor] literal-safety guard fired: literal in ${a} position \u2014 yielding 0 solutions. value="${u}"`);return}let i=await this.resolveElement(e),s=this.isVariable(r)?null:await this.resolveElement(r);for(let a of i){let c=await this.evaluatePath(a,t,s);for(let l of c){let u=new xj.SolutionMapping;this.isVariable(e)&&u.set(e.value,a),this.isVariable(r)&&u.set(r.value,l),yield u}}}async*executeWithBindings(e,t){if(!this.isPropertyPath(e.predicate))throw new Wu("Predicate is not a property path");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.object,t);for await(let s of this.execute(r,e.predicate,i)){let a=t.merge(s);a!==null&&(yield a)}}async evaluatePath(e,t,r){switch(t.pathType){case"/":return this.evaluateSequencePath(e,t.items,r);case"|":return this.evaluateAlternativePath(e,t.items,r);case"^":return this.evaluateInversePath(e,t.items[0],r);case"+":return this.evaluateOneOrMorePath(e,t.items[0],r);case"*":return this.evaluateZeroOrMorePath(e,t.items[0],r);case"?":return this.evaluateZeroOrOnePath(e,t.items[0],r)}}async evaluateSequencePath(e,t,r){let i=new Set([e]);for(let s=0;s<t.length;s++){let a=t[s],c=s===t.length-1,l=new Set;for(let u of i){let f=await this.evaluatePathItem(u,a,c?r:null);for(let 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 a=await this.evaluatePathItem(e,s,r);for(let c of a)i.add(c)}return i}async evaluateInversePath(e,t,r){if(t.type==="iri"){let i=new op.IRI(t.value),s=await this.tripleStore.match(void 0,i,e),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.subject,r))&&a.add(c.subject);return a}else return this.evaluatePath(e,this.invertPath(t),r)}async evaluateOneOrMorePath(e,t,r){let i=new Set,s=new Set,a=[{node:e,depth:0}];for(;a.length>0;){let c=a.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),a.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 a of s)i.add(a);return i}async evaluatePathItem(e,t,r){if(t.type==="iri"){let i=new op.IRI(t.value),s=await this.tripleStore.match(e,i,void 0),a=new Set;for(let c of s)(r===null||this.nodeInSet(c.object,r))&&a.add(c.object);return a}else return this.evaluatePath(e,t,r)}invertPath(e){switch(e.pathType){case"^":return e.items[0];case"/":return{type:"path",pathType:"/",items:[...e.items].reverse().map(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 op.IRI(e.value));break;case"blank":t.add(new IA.BlankNode(e.value));break;default:throw new Wu(`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 op.IRI)return{type:"iri",value:r.value};if(r instanceof IA.BlankNode)return{type:"blank",value:r.id};if(r instanceof Cj.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}};jc.PropertyPathExecutor=Z_});var r1=S($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.BGPExecutor=$c.BGPExecutorError=void 0;var cp=as(),Ia=Ce(),e1=je(),lp=Gt(),up=xu(),Ij=RA(),Wr=class extends Error{static{o(this,"BGPExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="BGPExecutorError"}};$c.BGPExecutorError=Wr;var t1=class{static{o(this,"BGPExecutor")}constructor(e){this.tripleStore=e,this.propertyPathExecutor=new Ij.PropertyPathExecutor(e)}async*execute(e){if(e.triples.length===0){yield new cp.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 cp.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 Wr("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),a=this.isVariable(e.object)?void 0:this.toRDFTerm(e.object);if(!this.tripleStore.matchInGraph)throw new Wr("Triple store does not support named graph operations");let c=await this.tripleStore.matchInGraph(i,s,a,t);for(let l of c){let u=new cp.SolutionMapping;this.isVariable(e.subject)&&u.set(e.subject.value,l.subject),this.isVariable(r)&&u.set(r.value,l.predicate),this.isVariable(e.object)&&u.set(e.object.value,l.object),yield u}}async*joinWithPatternInGraph(e,t,r){let i=[];for await(let s of e)i.push(s);for(let s of i){let a=this.instantiatePattern(t,s);for await(let c of this.matchTriplePatternInGraph(a,r)){let l=s.merge(c);l!==null&&(yield l)}}}async*matchTriplePattern(e){if(this.isPropertyPath(e.predicate)){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),a=await this.tripleStore.match(r,i,s);for(let c of a){let l=new cp.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 up.QuotedTriple))return null;let r=new Map;if(this.isVariable(e.subject))r.set(e.subject.value,t.subject);else if(this.isQuotedTriple(e.subject)){let i=this.matchQuotedTriplePattern(e.subject,t.subject);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.subject,t.subject))return null;if(e.predicate.type==="variable")r.set(e.predicate.value,t.predicate);else if(e.predicate.value!==t.predicate.value)return null;if(this.isVariable(e.object))r.set(e.object.value,t.object);else if(this.isQuotedTriple(e.object)){let i=this.matchQuotedTriplePattern(e.object,t.object);if(i===null)return null;for(let[s,a]of i)r.set(s,a)}else if(!this.elementsMatch(e.object,t.object))return null;return r}elementsMatch(e,t){switch(e.type){case"iri":return t instanceof Ia.IRI&&e.value===t.value;case"literal":return!(!(t instanceof e1.Literal)||e.value!==t.value||e.datatype!==t.datatype?.value||e.language!==t.language||e.direction!==t.direction);case"blank":return t instanceof lp.BlankNode&&e.value===t.id;case"quoted":return t instanceof up.QuotedTriple?this.toRDFQuotedTriple(e).equals(t):!1;default:return!1}}isPropertyPath(e){return e.type==="path"}async*joinWithPattern(e,t){let r=[];for await(let i of e)r.push(i);for(let i of r){let s=this.instantiatePattern(t,i);for await(let a of this.matchTriplePattern(s)){let c=i.merge(a);c!==null&&(yield c)}}}instantiatePattern(e,t){let r=this.isPropertyPath(e.predicate)?e.predicate:this.instantiateElement(e.predicate,t);return{subject:this.instantiateElement(e.subject,t),predicate:r,object:this.instantiateElement(e.object,t)}}instantiateElement(e,t){if(this.isVariable(e)){let r=t.get(e.value);if(r)return this.toAlgebraElement(r)}return this.isQuotedTriple(e)?this.instantiateQuotedTriple(e,t):e}instantiateQuotedTriple(e,t){let r=this.instantiateElement(e.subject,t),i=e.predicate.type==="variable"?this.instantiatePredicateVariable(e.predicate,t):e.predicate,s=this.instantiateElement(e.object,t);return{type:"quoted",subject:r,predicate:i,object:s}}instantiatePredicateVariable(e,t){let r=t.get(e.value);return r&&r instanceof 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;console.warn(`[BGPExecutor] literal-safety guard fired in ${e}: literal in ${t} position \u2014 yielding 0 solutions. value="${s}"`)}toRDFTermAsSubject(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"blank":return new lp.BlankNode(e.value);case"literal":throw new Wr("Literals cannot appear in subject position");case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new Wr(`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 Wr("Quoted triple predicate must be IRI")})(),i=this.toRDFTerm(e.object);return new up.QuotedTriple(t,r,i)}toRDFTermAsPredicate(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"literal":throw new Wr("Literals cannot appear in predicate position");case"blank":throw new Wr("Blank nodes cannot appear in predicate position");case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);default:throw new Wr(`Unknown element type: ${String(e)}`)}}toRDFTerm(e){switch(e.type){case"iri":return new Ia.IRI(e.value);case"literal":return new e1.Literal(e.value,e.datatype?new Ia.IRI(e.datatype):void 0,e.language,e.direction);case"blank":return new lp.BlankNode(e.value);case"variable":throw new Wr(`Cannot convert variable to RDF term: ${e.value}`);case"quoted":return this.toRDFQuotedTriple(e);default:throw new Wr(`Unknown element type: ${String(e)}`)}}toAlgebraElement(e){if(e instanceof Ia.IRI)return{type:"iri",value:e.value};if(e instanceof e1.Literal)return{type:"literal",value:e.value,datatype:e.datatype?.value,language:e.language,direction:e.direction};if(e instanceof lp.BlankNode)return{type:"blank",value:e.id};if(e instanceof up.QuotedTriple)return this.toAlgebraQuotedTriple(e);throw new Wr(`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)}}};$c.BGPExecutor=t1});var PA=S(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.StringFunctions=void 0;var Bc=Ce(),Ra=je(),n1=Gt(),Gu=class n{static{o(this,"StringFunctions")}static str(e){if(e===void 0)throw new Error("STR: argument is undefined");return e instanceof Bc.IRI||e instanceof Ra.Literal?e.value:e instanceof n1.BlankNode?e.id:String(e)}static lang(e){if(e===void 0)throw new Error("LANG: argument is undefined");return e instanceof Ra.Literal&&e.language?e.language:""}static langdir(e){if(e===void 0)throw new Error("LANGDIR: argument is undefined");return!(e instanceof Ra.Literal)||!e.language?"":e.direction?`${e.language}--${e.direction}`:e.language}static langMatches(e,t){let[r,i]=n.parseDirectionalLangTag(e),[s,a]=n.parseDirectionalLangTag(t),c=r.toLowerCase(),l=s.toLowerCase();return l==="*"?c!=="":c===""?l==="":a&&i!==a?!1:c===l?!0:c.startsWith(l+"-")}static parseDirectionalLangTag(e){let t=e.indexOf("--");if(t===-1)return[e,void 0];let r=e.substring(0,t),i=e.substring(t+2).toLowerCase();return[r,i]}static 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",a=s.includes("u")?s:s+"u",c=new RegExp(t,a);return e.replace(c,r)}catch(s){throw new Error(`REPLACE: invalid pattern '${t}': ${s.message}`)}}static 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 Ra.Literal)r=e.value;else if(e instanceof Bc.IRI)r=e.value;else if(e instanceof n1.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 Ra.Literal)i=t.value.toUpperCase();else if(typeof t=="string")i=t.toUpperCase();else if(t instanceof Bc.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 Ra.Literal(s,new Bc.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 Ra.Literal)t=e.value;else if(e instanceof Bc.IRI)t=e.value;else if(e instanceof n1.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 Ra.Literal(r,new Bc.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}};fp.StringFunctions=Gu;Gu.VALID_NORMALIZATION_FORMS=["NFC","NFD","NFKC","NFKD"];Gu.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 OA=S(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.MathFunctions=void 0;var i1=class{static{o(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()}};dp.MathFunctions=i1});var pp=S(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DateTimeParsing=void 0;var Rj=Ce(),Pj=je(),s1=class n{static{o(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"),a="",c="";if(s===-1?a=r:(a=r.substring(0,s),c=r.substring(s+1)),a){let l=a.match(/^(\d+(?:\.\d+)?)D$/);if(l){let u=parseFloat(l[1]);i+=u*24*60*60*1e3}else if(a!=="")throw new Error(`parseDayTimeDuration: invalid day component: '${a}' in '${e}'`)}if(c){let l=c,u=l.match(/^(\d+(?:\.\d+)?)H/);if(u){let 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 a=Math.floor(r/(60*1e3));r=r%(60*1e3);let c=r/1e3,l=t?"-P":"P";return i>0&&(l+=`${i}D`),(s>0||a>0||c>0||i===0)&&(l+="T",s>0&&(l+=`${s}H`),a>0&&(l+=`${a}M`),(c>0||s===0&&a===0)&&(Number.isInteger(c)?l+=`${c}S`:l+=`${parseFloat(c.toFixed(3))}S`)),l}static xsdDayTimeDuration(e){return n.parseDayTimeDuration(e),new Pj.Literal(e,new Rj.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static parseXSDDate(e){let t=/^(-?\d{4})-(\d{2})-(\d{2})(Z|[+-]\d{2}:\d{2})?$/,r=e.match(t);if(!r){let u=new Date(e);return isNaN(u.getTime())?null:new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()))}let i=parseInt(r[1],10),s=parseInt(r[2],10)-1,a=parseInt(r[3],10),c=r[4],l=new Date(Date.UTC(i,s,a));if(c&&c!=="Z"){let u=c.match(/([+-])(\d{2}):(\d{2})/);if(u){let f=u[1]==="+"?1:-1,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),a=parseInt(r[3],10),c=r[4],l=r[5];if(i<0||i>24||s<0||s>59||a<0||a>59||i===24&&(s!==0||a!==0))return null;let u=0;if(c){let d=c.padEnd(3,"0").slice(0,3);u=parseInt(d,10)}let f=i*60*60*1e3+s*60*1e3+a*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),_=parseInt(d[3],10),v=h*(p*60+_)*60*1e3;f-=v}}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),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDuration: invalid format (no duration components): '${e}'`);let c=s*12+a;return i?-c:c}static formatYearMonthDuration(e){let t=e<0,r=Math.abs(e),i=Math.floor(r/12),s=r%12,a=t?"-P":"P";return i>0&&(a+=`${i}Y`),(s>0||i===0)&&(a+=`${s}M`),a}static parseYearMonthDurationComponents(e){let t=/^(-)?P(?:(\d+)Y)?(?:(\d+)M)?$/,r=e.match(t);if(!r)throw new Error(`parseYearMonthDurationComponents: invalid format: '${e}'`);let i=r[1]==="-",s=parseInt(r[2]||"0",10),a=parseInt(r[3]||"0",10);if(!r[2]&&!r[3])throw new Error(`parseYearMonthDurationComponents: invalid format (no duration components): '${e}'`);return{years:s,months:a,negative:i}}static parseDurationComponents(e){if(!e)throw new Error("parseDurationComponents: duration string is empty");let t=!1,r=e.trim();if(r.startsWith("-")&&(t=!0,r=r.substring(1)),!r.startsWith("P"))throw new Error(`parseDurationComponents: invalid format, must start with 'P': '${e}'`);r=r.substring(1);let i=0,s=0,a=0,c=0,l=r.indexOf("T"),u="",f="";if(l===-1?u=r:(u=r.substring(0,l),f=r.substring(l+1)),u){let 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&&(a=parseFloat(p[1]),d=d.substring(p[0].length));let _=d.match(/^(\d+(?:\.\d+)?)S$/);if(_&&(c=parseFloat(_[1]),d=d.substring(_[0].length)),d!=="")throw new Error(`parseDurationComponents: invalid time component: '${d}' in '${e}'`)}return{negative:t,days:i,hours:s,minutes:a,seconds:c}}};hp.DateTimeParsing=s1});var FA=S(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.DateTimeArithmetic=void 0;var un=Ce(),Te=je(),Xe=pp(),a1=class{static{o(this,"DateTimeArithmetic")}static dateTimeDiff(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r),a=new Date(i);if(isNaN(s.getTime()))throw new Error(`dateTimeDiff: invalid first dateTime: '${r}'`);if(isNaN(a.getTime()))throw new Error(`dateTimeDiff: invalid second dateTime: '${i}'`);let c=s.getTime()-a.getTime(),l=Xe.DateTimeParsing.formatDayTimeDuration(c);return new Te.Literal(l,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static dateTimeAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAdd: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+a,l=new Date(c);return new Te.Literal(l.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtract: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-a,l=new Date(c);return new Te.Literal(l.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAdd: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()+a,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 Te.Literal(h,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtract: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=s.getTime()-a,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 Te.Literal(h,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateTimeAddYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeAddYearMonth: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0),new Te.Literal(s.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateTimeSubtractYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=new Date(r);if(isNaN(s.getTime()))throw new Error(`dateTimeSubtractYearMonth: invalid dateTime: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();return s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0),new Te.Literal(s.toISOString(),new un.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static dateAddYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateAddYearMonth: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()+a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),d=`${l}-${u}-${f}`;return new Te.Literal(d,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static dateSubtractYearMonth(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseXSDDate(r);if(s===null)throw new Error(`dateSubtractYearMonth: invalid date: '${r}'`);let a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=s.getUTCDate();s.setUTCMonth(s.getUTCMonth()-a),s.getUTCDate()!==c&&s.setUTCDate(0);let l=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),f=String(s.getUTCDate()).padStart(2,"0"),d=`${l}-${u}-${f}`;return new Te.Literal(d,new un.IRI("http://www.w3.org/2001/XMLSchema#date"))}static durationAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseDayTimeDuration(r),a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=Xe.DateTimeParsing.formatDayTimeDuration(s+a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseDayTimeDuration(r),a=Xe.DateTimeParsing.parseDayTimeDuration(i),c=Xe.DateTimeParsing.formatDayTimeDuration(s-a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static durationMultiply(e,t){let r=e instanceof Te.Literal?e.value:e,i=Xe.DateTimeParsing.parseDayTimeDuration(r),s=Xe.DateTimeParsing.formatDayTimeDuration(i*t);return new Te.Literal(s,new un.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 Te.Literal?e.value:e,i=Xe.DateTimeParsing.parseDayTimeDuration(r),s=Xe.DateTimeParsing.formatDayTimeDuration(i/t);return new Te.Literal(s,new un.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static yearMonthDurationAdd(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseYearMonthDuration(r),a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=Xe.DateTimeParsing.formatYearMonthDuration(s+a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static yearMonthDurationSubtract(e,t){let r=e instanceof Te.Literal?e.value:e,i=t instanceof Te.Literal?t.value:t,s=Xe.DateTimeParsing.parseYearMonthDuration(r),a=Xe.DateTimeParsing.parseYearMonthDuration(i),c=Xe.DateTimeParsing.formatYearMonthDuration(s-a);return new Te.Literal(c,new un.IRI("http://www.w3.org/2001/XMLSchema#yearMonthDuration"))}static durationToDays(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(1440*60*1e3)}static durationToHours(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(3600*1e3)}static durationToMinutes(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/(60*1e3)}static durationToSeconds(e){let t=e instanceof Te.Literal?e.value:e;return Xe.DateTimeParsing.parseDayTimeDuration(t)/1e3}};mp.DateTimeArithmetic=a1});var DA=S(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.DateTimeAccessors=void 0;var zu=Ce(),Lt=je(),Tt=pp(),o1=class{static{o(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 Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.days);return r.negative?-i:i}static durationHours(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.hours);return r.negative?-i:i}static durationMinutes(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t),i=Math.floor(r.minutes);return r.negative?-i:i}static durationSeconds(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseDurationComponents(t);return r.negative?-r.seconds:r.seconds}static durationYears(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.DateTimeParsing.parseYearMonthDurationComponents(t);return r.negative?-r.years:r.years}static durationMonths(e){let t=e instanceof Lt.Literal?e.value:e,r=Tt.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),a=parseInt(i[2],10),c=s>=0?"":"-",l=Math.abs(s);a===0?r=`${c}PT${l}H`:r=`${c}PT${l}H${a}M`}else{let s=-t.getTimezoneOffset(),a=Math.floor(Math.abs(s)/60),c=Math.abs(s)%60,l=s>=0?"":"-";c===0?r=`${l}PT${a}H`:r=`${l}PT${a}H${c}M`}}return new Lt.Literal(r,new zu.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 Lt.Literal?e.value:e,i=new Date(r);if(isNaN(i.getTime()))throw new Error(`ADJUST: invalid dateTime: '${r}'`);if(t==null){let we=i.getUTCFullYear(),z=String(i.getUTCMonth()+1).padStart(2,"0"),G=String(i.getUTCDate()).padStart(2,"0"),F=String(i.getUTCHours()).padStart(2,"0"),j=String(i.getUTCMinutes()).padStart(2,"0"),te=String(i.getUTCSeconds()).padStart(2,"0"),Ye=i.getUTCMilliseconds(),st=`${we}-${z}-${G}T${F}:${j}:${te}`;return Ye>0&&(st+=`.${String(Ye).padStart(3,"0")}`),new Lt.Literal(st,new zu.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}let s=t instanceof Lt.Literal?t.value:t,a=Tt.DateTimeParsing.parseDayTimeDuration(s),c=840*60*1e3;if(Math.abs(a)>c)throw new Error(`ADJUST: timezone offset out of range: '${s}'`);let l=i.getTime(),u=new Date(l+a),f=u.getUTCFullYear(),d=String(u.getUTCMonth()+1).padStart(2,"0"),h=String(u.getUTCDate()).padStart(2,"0"),p=String(u.getUTCHours()).padStart(2,"0"),_=String(u.getUTCMinutes()).padStart(2,"0"),v=String(u.getUTCSeconds()).padStart(2,"0"),E=u.getUTCMilliseconds(),b=a>=0?"+":"-",A=Math.floor(Math.abs(a)/(3600*1e3)),R=Math.floor(Math.abs(a)%(3600*1e3)/(60*1e3)),B=`${b}${String(A).padStart(2,"0")}:${String(R).padStart(2,"0")}`,W=`${f}-${d}-${h}T${p}:${_}:${v}`;return E>0&&(W+=`.${String(E).padStart(3,"0")}`),W+=B,new Lt.Literal(W,new zu.IRI("http://www.w3.org/2001/XMLSchema#dateTime"))}static now(){return new Date().toISOString()}static dateBefore(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t);return r<i}static dateAfter(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t);return r>i}static dateInRange(e,t,r){let i=Tt.DateTimeParsing.parseDate(e),s=Tt.DateTimeParsing.parseDate(t),a=Tt.DateTimeParsing.parseDate(r);return i>=s&&i<=a}static compareDurations(e,t,r){let i=e instanceof Lt.Literal?e.value:e,s=t instanceof Lt.Literal?t.value:t,a=Tt.DateTimeParsing.parseDayTimeDuration(i),c=Tt.DateTimeParsing.parseDayTimeDuration(s);switch(r){case"=":return a===c;case"!=":return a!==c;case"<":return a<c;case">":return a>c;case"<=":return a<=c;case">=":return a>=c;default:throw new Error(`compareDurations: unknown operator: ${r}`)}}static dateDiffMinutes(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.DateTimeParsing.parseDate(t),s=Math.abs(i-r);return Math.round(s/(1e3*60))}static dateDiffHours(e,t){let r=Tt.DateTimeParsing.parseDate(e),i=Tt.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 Lt.Literal?e.value:e,i=t instanceof Lt.Literal?t.value:t,s=Tt.DateTimeParsing.parseXSDTime(r),a=Tt.DateTimeParsing.parseXSDTime(i);if(s===null)throw new Error(`timeDiff: invalid first time: '${r}'`);if(a===null)throw new Error(`timeDiff: invalid second time: '${i}'`);let c=s-a,l=Tt.DateTimeParsing.formatDayTimeDuration(c);return new Lt.Literal(l,new zu.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}static isDayTimeDuration(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}static isDate(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}static isYearMonthDuration(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}static isTime(e){return e instanceof Lt.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}static dateDiff(e,t){let r=e instanceof Lt.Literal?e.value:e,i=t instanceof Lt.Literal?t.value:t,s=Tt.DateTimeParsing.parseXSDDate(r),a=Tt.DateTimeParsing.parseXSDDate(i);if(s===null)throw new Error(`dateDiff: invalid first date: '${r}'`);if(a===null)throw new Error(`dateDiff: invalid second date: '${i}'`);let c=s.getTime()-a.getTime(),l=Math.round(c/(1440*60*1e3)),u=Tt.DateTimeParsing.formatDateDuration(l);return new Lt.Literal(u,new zu.IRI("http://www.w3.org/2001/XMLSchema#dayTimeDuration"))}};gp.DateTimeAccessors=o1});var _p=S(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.DateTimeFunctions=void 0;var Vc=pp(),or=FA(),gt=DA(),c1=class{static{o(this,"DateTimeFunctions")}static parseDate(e){return Vc.DateTimeParsing.parseDate(e)}static parseDayTimeDuration(e){return Vc.DateTimeParsing.parseDayTimeDuration(e)}static formatDayTimeDuration(e){return Vc.DateTimeParsing.formatDayTimeDuration(e)}static xsdDayTimeDuration(e){return Vc.DateTimeParsing.xsdDayTimeDuration(e)}static parseYearMonthDuration(e){return Vc.DateTimeParsing.parseYearMonthDuration(e)}static formatYearMonthDuration(e){return Vc.DateTimeParsing.formatYearMonthDuration(e)}static year(e){return gt.DateTimeAccessors.year(e)}static month(e){return gt.DateTimeAccessors.month(e)}static day(e){return gt.DateTimeAccessors.day(e)}static hours(e){return gt.DateTimeAccessors.hours(e)}static minutes(e){return gt.DateTimeAccessors.minutes(e)}static seconds(e){return gt.DateTimeAccessors.seconds(e)}static durationDays(e){return gt.DateTimeAccessors.durationDays(e)}static durationHours(e){return gt.DateTimeAccessors.durationHours(e)}static durationMinutes(e){return gt.DateTimeAccessors.durationMinutes(e)}static durationSeconds(e){return gt.DateTimeAccessors.durationSeconds(e)}static durationYears(e){return gt.DateTimeAccessors.durationYears(e)}static durationMonths(e){return gt.DateTimeAccessors.durationMonths(e)}static timezone(e){return gt.DateTimeAccessors.timezone(e)}static tz(e){return gt.DateTimeAccessors.tz(e)}static adjust(e,t){return gt.DateTimeAccessors.adjust(e,t)}static now(){return gt.DateTimeAccessors.now()}static dateBefore(e,t){return gt.DateTimeAccessors.dateBefore(e,t)}static dateAfter(e,t){return gt.DateTimeAccessors.dateAfter(e,t)}static dateInRange(e,t,r){return gt.DateTimeAccessors.dateInRange(e,t,r)}static compareDurations(e,t,r){return gt.DateTimeAccessors.compareDurations(e,t,r)}static dateDiffMinutes(e,t){return gt.DateTimeAccessors.dateDiffMinutes(e,t)}static dateDiffHours(e,t){return gt.DateTimeAccessors.dateDiffHours(e,t)}static timeDiff(e,t){return gt.DateTimeAccessors.timeDiff(e,t)}static dateDiff(e,t){return gt.DateTimeAccessors.dateDiff(e,t)}static isDayTimeDuration(e){return gt.DateTimeAccessors.isDayTimeDuration(e)}static isDate(e){return gt.DateTimeAccessors.isDate(e)}static isYearMonthDuration(e){return gt.DateTimeAccessors.isYearMonthDuration(e)}static isTime(e){return gt.DateTimeAccessors.isTime(e)}static dateTimeDiff(e,t){return or.DateTimeArithmetic.dateTimeDiff(e,t)}static dateTimeAdd(e,t){return or.DateTimeArithmetic.dateTimeAdd(e,t)}static dateTimeSubtract(e,t){return or.DateTimeArithmetic.dateTimeSubtract(e,t)}static dateAdd(e,t){return or.DateTimeArithmetic.dateAdd(e,t)}static dateSubtract(e,t){return or.DateTimeArithmetic.dateSubtract(e,t)}static dateTimeAddYearMonth(e,t){return or.DateTimeArithmetic.dateTimeAddYearMonth(e,t)}static dateTimeSubtractYearMonth(e,t){return or.DateTimeArithmetic.dateTimeSubtractYearMonth(e,t)}static dateAddYearMonth(e,t){return or.DateTimeArithmetic.dateAddYearMonth(e,t)}static dateSubtractYearMonth(e,t){return or.DateTimeArithmetic.dateSubtractYearMonth(e,t)}static durationAdd(e,t){return or.DateTimeArithmetic.durationAdd(e,t)}static durationSubtract(e,t){return or.DateTimeArithmetic.durationSubtract(e,t)}static durationMultiply(e,t){return or.DateTimeArithmetic.durationMultiply(e,t)}static durationDivide(e,t){return or.DateTimeArithmetic.durationDivide(e,t)}static yearMonthDurationAdd(e,t){return or.DateTimeArithmetic.yearMonthDurationAdd(e,t)}static yearMonthDurationSubtract(e,t){return or.DateTimeArithmetic.yearMonthDurationSubtract(e,t)}static durationToDays(e){return or.DateTimeArithmetic.durationToDays(e)}static durationToHours(e){return or.DateTimeArithmetic.durationToHours(e)}static durationToMinutes(e){return or.DateTimeArithmetic.durationToMinutes(e)}static durationToSeconds(e){return or.DateTimeArithmetic.durationToSeconds(e)}};yp.DateTimeFunctions=c1});var NA=S(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.LogicalFunctions=void 0;var Oj=Ce(),Uc=je(),Fj=Gt(),Sp=_p(),l1=class n{static{o(this,"LogicalFunctions")}static compare(e,t,r){if(n.isDayTimeDurationValue(e)&&n.isDayTimeDurationValue(t))return Sp.DateTimeFunctions.compareDurations(e instanceof Uc.Literal?e:String(e),t instanceof Uc.Literal?t:String(t),r);if(n.isDayTimeDurationValue(e)&&typeof t=="string"&&/^-?P/.test(t))return Sp.DateTimeFunctions.compareDurations(e instanceof Uc.Literal?e:String(e),t,r);if(typeof e=="string"&&/^-?P/.test(e)&&n.isDayTimeDurationValue(t))return Sp.DateTimeFunctions.compareDurations(e,t instanceof Uc.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 Uc.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 Uc.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 Sp.DateTimeFunctions.parseDayTimeDuration(e.value)}catch{return e.value}return e.value}return e instanceof Oj.IRI?e.value:e instanceof Fj.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}};vp.LogicalFunctions=l1});var LA=S(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.RDFTermFunctions=void 0;var Dr=Ce(),vt=je(),ui=Gt(),qc=xu(),u1=wn(),f1=class n{static{o(this,"RDFTermFunctions")}static datatype(e){if(e===void 0)throw new Error("DATATYPE: argument is undefined");if(e instanceof vt.Literal)return e.datatype?e.datatype:e.language?new Dr.IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"):new Dr.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 Dr.IRI}static isBlank(e){return e===void 0?!1:e instanceof ui.BlankNode}static isLiteral(e){return e===void 0?!1:e instanceof vt.Literal}static isTriple(e){return e===void 0?!1:e instanceof qc.QuotedTriple}static hasLangdir(e){return e===void 0||!(e instanceof vt.Literal)?!1:!!e.language&&!!e.direction}static isNumeric(e){if(e===void 0||!(e instanceof vt.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 vt.Literal(t.toISOString(),new Dr.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 vt.Literal(String(t),new Dr.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 vt.Literal(String(t),new Dr.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 Dr.IRI&&t instanceof Dr.IRI)return e.value===t.value;if(e instanceof ui.BlankNode&&t instanceof ui.BlankNode)return e.id===t.id;if(e instanceof vt.Literal&&t instanceof vt.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 Dr.IRI)return e;if(e instanceof vt.Literal)return new Dr.IRI(e.value);throw e instanceof ui.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,u1.v4)().replace(/-/g,"").substring(0,12)}`;return new ui.BlankNode(t)}if(e instanceof vt.Literal)return new ui.BlankNode(e.value);if(e instanceof ui.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 vt.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 Dr.IRI)i=t;else if(t instanceof vt.Literal)i=new Dr.IRI(t.value);else throw new Error("STRDT: datatype must be an IRI");return new vt.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 vt.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 vt.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 vt.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 vt.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 vt.Literal)s=t.value;else if(typeof t=="string")s=t;else throw new Error("STRLANGDIR: language tag must be a string literal");if(s==="")throw new Error("STRLANGDIR: language tag cannot be empty");let a;if(r instanceof vt.Literal)a=r.value.toLowerCase();else throw new Error("STRLANGDIR: direction must be a string literal");if(a!=="ltr"&&a!=="rtl")throw new Error(`STRLANGDIR: invalid direction '${a}'. Must be 'ltr' or 'rtl'`);return new vt.Literal(i,void 0,s,a)}static uuid(){let e=(0,u1.v4)();return new Dr.IRI(`urn:uuid:${e}`)}static struuid(){let e=(0,u1.v4)();return new vt.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 vt.Literal)throw new Error("TRIPLE: subject must be IRI, BlankNode, or QuotedTriple, got Literal");if(!(t instanceof Dr.IRI)){let c=t instanceof vt.Literal?"Literal":t instanceof ui.BlankNode?"BlankNode":t instanceof qc.QuotedTriple?"QuotedTriple":typeof t;throw new Error(`TRIPLE: predicate must be IRI, got ${c}`)}let i=e,s=t,a=r;return new qc.QuotedTriple(i,s,a)}static subject(e){if(e===void 0)throw new Error("SUBJECT: argument is undefined");if(!(e instanceof qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.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 qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.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 qc.QuotedTriple)){let t=e instanceof Dr.IRI?"IRI":e instanceof vt.Literal?"Literal":e instanceof ui.BlankNode?"BlankNode":typeof e;throw new Error(`OBJECT: argument must be QuotedTriple, got ${t}`)}return e.object}};bp.RDFTermFunctions=f1});var kA=S(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.HashFunctions=void 0;var d1=class{static{o(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")}};wp.HashFunctions=d1});var Tp=S(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.BuiltInFunctions=void 0;var cr=PA(),Pa=OA(),oe=_p(),Wc=NA(),Pt=LA(),Hu=kA(),h1=class{static{o(this,"BuiltInFunctions")}static str(...e){return cr.StringFunctions.str(...e)}static lang(...e){return cr.StringFunctions.lang(...e)}static langdir(...e){return cr.StringFunctions.langdir(...e)}static langMatches(...e){return cr.StringFunctions.langMatches(...e)}static regex(...e){return cr.StringFunctions.regex(...e)}static contains(...e){return cr.StringFunctions.contains(...e)}static strStarts(...e){return cr.StringFunctions.strStarts(...e)}static strEnds(...e){return cr.StringFunctions.strEnds(...e)}static strlen(...e){return cr.StringFunctions.strlen(...e)}static ucase(...e){return cr.StringFunctions.ucase(...e)}static lcase(...e){return cr.StringFunctions.lcase(...e)}static substr(...e){return cr.StringFunctions.substr(...e)}static strBefore(...e){return cr.StringFunctions.strBefore(...e)}static strAfter(...e){return cr.StringFunctions.strAfter(...e)}static concat(...e){return cr.StringFunctions.concat(...e)}static replace(...e){return cr.StringFunctions.replace(...e)}static encodeForUri(...e){return cr.StringFunctions.encodeForUri(...e)}static normalize(...e){return cr.StringFunctions.normalize(...e)}static fold(...e){return cr.StringFunctions.fold(...e)}static abs(...e){return Pa.MathFunctions.abs(...e)}static round(...e){return Pa.MathFunctions.round(...e)}static ceil(...e){return Pa.MathFunctions.ceil(...e)}static floor(...e){return Pa.MathFunctions.floor(...e)}static rand(){return Pa.MathFunctions.rand()}static msToMinutes(...e){return Pa.MathFunctions.msToMinutes(...e)}static msToHours(...e){return Pa.MathFunctions.msToHours(...e)}static msToSeconds(...e){return Pa.MathFunctions.msToSeconds(...e)}static parseDate(...e){return oe.DateTimeFunctions.parseDate(...e)}static dateBefore(...e){return oe.DateTimeFunctions.dateBefore(...e)}static dateAfter(...e){return oe.DateTimeFunctions.dateAfter(...e)}static dateInRange(...e){return oe.DateTimeFunctions.dateInRange(...e)}static dateDiffMinutes(...e){return oe.DateTimeFunctions.dateDiffMinutes(...e)}static dateDiffHours(...e){return oe.DateTimeFunctions.dateDiffHours(...e)}static year(...e){return oe.DateTimeFunctions.year(...e)}static month(...e){return oe.DateTimeFunctions.month(...e)}static day(...e){return oe.DateTimeFunctions.day(...e)}static hours(...e){return oe.DateTimeFunctions.hours(...e)}static minutes(...e){return oe.DateTimeFunctions.minutes(...e)}static seconds(...e){return oe.DateTimeFunctions.seconds(...e)}static timezone(...e){return oe.DateTimeFunctions.timezone(...e)}static tz(...e){return oe.DateTimeFunctions.tz(...e)}static now(){return oe.DateTimeFunctions.now()}static parseDayTimeDuration(...e){return oe.DateTimeFunctions.parseDayTimeDuration(...e)}static formatDayTimeDuration(...e){return oe.DateTimeFunctions.formatDayTimeDuration(...e)}static xsdDayTimeDuration(...e){return oe.DateTimeFunctions.xsdDayTimeDuration(...e)}static compareDurations(...e){return oe.DateTimeFunctions.compareDurations(...e)}static isDayTimeDuration(...e){return oe.DateTimeFunctions.isDayTimeDuration(...e)}static isDate(...e){return oe.DateTimeFunctions.isDate(...e)}static dateDiff(...e){return oe.DateTimeFunctions.dateDiff(...e)}static dateTimeDiff(...e){return oe.DateTimeFunctions.dateTimeDiff(...e)}static dateTimeAdd(...e){return oe.DateTimeFunctions.dateTimeAdd(...e)}static dateTimeSubtract(...e){return oe.DateTimeFunctions.dateTimeSubtract(...e)}static dateAdd(...e){return oe.DateTimeFunctions.dateAdd(...e)}static dateSubtract(...e){return oe.DateTimeFunctions.dateSubtract(...e)}static parseYearMonthDuration(...e){return oe.DateTimeFunctions.parseYearMonthDuration(...e)}static isYearMonthDuration(...e){return oe.DateTimeFunctions.isYearMonthDuration(...e)}static dateTimeAddYearMonth(...e){return oe.DateTimeFunctions.dateTimeAddYearMonth(...e)}static dateTimeSubtractYearMonth(...e){return oe.DateTimeFunctions.dateTimeSubtractYearMonth(...e)}static dateAddYearMonth(...e){return oe.DateTimeFunctions.dateAddYearMonth(...e)}static dateSubtractYearMonth(...e){return oe.DateTimeFunctions.dateSubtractYearMonth(...e)}static durationAdd(...e){return oe.DateTimeFunctions.durationAdd(...e)}static durationSubtract(...e){return oe.DateTimeFunctions.durationSubtract(...e)}static durationMultiply(...e){return oe.DateTimeFunctions.durationMultiply(...e)}static durationDivide(...e){return oe.DateTimeFunctions.durationDivide(...e)}static formatYearMonthDuration(...e){return oe.DateTimeFunctions.formatYearMonthDuration(...e)}static yearMonthDurationAdd(...e){return oe.DateTimeFunctions.yearMonthDurationAdd(...e)}static yearMonthDurationSubtract(...e){return oe.DateTimeFunctions.yearMonthDurationSubtract(...e)}static durationYears(...e){return oe.DateTimeFunctions.durationYears(...e)}static durationMonths(...e){return oe.DateTimeFunctions.durationMonths(...e)}static durationToDays(...e){return oe.DateTimeFunctions.durationToDays(...e)}static durationToHours(...e){return oe.DateTimeFunctions.durationToHours(...e)}static durationToMinutes(...e){return oe.DateTimeFunctions.durationToMinutes(...e)}static durationToSeconds(...e){return oe.DateTimeFunctions.durationToSeconds(...e)}static durationDays(...e){return oe.DateTimeFunctions.durationDays(...e)}static durationHours(...e){return oe.DateTimeFunctions.durationHours(...e)}static durationMinutes(...e){return oe.DateTimeFunctions.durationMinutes(...e)}static durationSeconds(...e){return oe.DateTimeFunctions.durationSeconds(...e)}static adjust(...e){return oe.DateTimeFunctions.adjust(...e)}static isTime(...e){return oe.DateTimeFunctions.isTime(...e)}static timeDiff(...e){return oe.DateTimeFunctions.timeDiff(...e)}static compare(...e){return Wc.LogicalFunctions.compare(...e)}static logicalAnd(...e){return Wc.LogicalFunctions.logicalAnd(...e)}static logicalOr(...e){return Wc.LogicalFunctions.logicalOr(...e)}static logicalNot(...e){return Wc.LogicalFunctions.logicalNot(...e)}static coalesce(...e){return Wc.LogicalFunctions.coalesce(...e)}static if(...e){return Wc.LogicalFunctions.if(...e)}static datatype(...e){return Pt.RDFTermFunctions.datatype(...e)}static bound(...e){return Pt.RDFTermFunctions.bound(...e)}static isIRI(...e){return Pt.RDFTermFunctions.isIRI(...e)}static isBlank(...e){return Pt.RDFTermFunctions.isBlank(...e)}static isLiteral(...e){return Pt.RDFTermFunctions.isLiteral(...e)}static isTriple(...e){return Pt.RDFTermFunctions.isTriple(...e)}static isNumeric(...e){return Pt.RDFTermFunctions.isNumeric(...e)}static hasLangdir(...e){return Pt.RDFTermFunctions.hasLangdir(...e)}static sameTerm(...e){return Pt.RDFTermFunctions.sameTerm(...e)}static iri(...e){return Pt.RDFTermFunctions.iri(...e)}static uri(...e){return Pt.RDFTermFunctions.uri(...e)}static bnode(...e){return Pt.RDFTermFunctions.bnode(...e)}static strdt(...e){return Pt.RDFTermFunctions.strdt(...e)}static strlang(...e){return Pt.RDFTermFunctions.strlang(...e)}static strlangdir(...e){return Pt.RDFTermFunctions.strlangdir(...e)}static uuid(){return Pt.RDFTermFunctions.uuid()}static struuid(){return Pt.RDFTermFunctions.struuid()}static xsdDateTime(...e){return Pt.RDFTermFunctions.xsdDateTime(...e)}static xsdInteger(...e){return Pt.RDFTermFunctions.xsdInteger(...e)}static xsdDecimal(...e){return Pt.RDFTermFunctions.xsdDecimal(...e)}static triple(...e){return Pt.RDFTermFunctions.triple(...e)}static subject(...e){return Pt.RDFTermFunctions.subject(...e)}static predicate(...e){return Pt.RDFTermFunctions.predicate(...e)}static object(...e){return Pt.RDFTermFunctions.object(...e)}static md5(...e){return Hu.HashFunctions.md5(...e)}static sha1(...e){return Hu.HashFunctions.sha1(...e)}static sha256(...e){return Hu.HashFunctions.sha256(...e)}static sha384(...e){return Hu.HashFunctions.sha384(...e)}static sha512(...e){return Hu.HashFunctions.sha512(...e)}};Ep.BuiltInFunctions=h1});var Qu=S(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ExoQLBudgetExceededError=os.ExoQLCycleError=os.ExoQLEvalDisabledError=os.ExoQLForbiddenKeywordError=void 0;var p1=class extends Error{static{o(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}};os.ExoQLForbiddenKeywordError=p1;var m1=class extends Error{static{o(this,"ExoQLEvalDisabledError")}constructor(e){super(e??"ExoQLEvalDisabledError: exoql.eval.enabled is false (default). Flip the feature flag to opt in."),this.name="ExoQLEvalDisabledError"}};os.ExoQLEvalDisabledError=m1;var g1=class extends Error{static{o(this,"ExoQLCycleError")}constructor(e,t){super(t??`ExoQLCycleError: cycle detected in nested exo:eval invocations: ${e.join(" \u2192 ")}`),this.name="ExoQLCycleError",this.path=e}};os.ExoQLCycleError=g1;var y1=class extends Error{static{o(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}};os.ExoQLBudgetExceededError=y1});var GA=S(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.functionHandlers=void 0;var k=Tp();M.functionHandlers=new Map;M.functionHandlers.set("str",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.str(t)});M.functionHandlers.set("lang",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.lang(t)});M.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 k.BuiltInFunctions.langMatches(t,r)});M.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 k.BuiltInFunctions.contains(t,r)});M.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 k.BuiltInFunctions.strStarts(t,r)});M.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 k.BuiltInFunctions.strEnds(t,r)});M.functionHandlers.set("strlen",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.strlen(t)});M.functionHandlers.set("ucase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.ucase(t)});M.functionHandlers.set("lcase",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.lcase(t)});M.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 k.BuiltInFunctions.substr(t,r,i)}return k.BuiltInFunctions.substr(t,r)});M.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 k.BuiltInFunctions.strBefore(t,r)});M.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 k.BuiltInFunctions.strAfter(t,r)});M.functionHandlers.set("concat",(n,e)=>{let t=n.map(r=>e.getStringValue(e.evaluateExpression(r,e.solution)));return k.BuiltInFunctions.concat(...t)});M.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 k.BuiltInFunctions.replace(t,r,i,s)});M.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 k.BuiltInFunctions.regex(t,r,i)});M.functionHandlers.set("encode_for_uri",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.encodeForUri(t)});M.functionHandlers.set("datatype",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.datatype(t).value});M.functionHandlers.set("bound",(n,e)=>{let t=n[0];if(t.type==="variable"&&t.name){let r=e.solution.get(t.name);return k.BuiltInFunctions.bound(r)}return!0});var MA=o((n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isIRI(t)},"isIriHandler");M.functionHandlers.set("isiri",MA);M.functionHandlers.set("isuri",MA);M.functionHandlers.set("isblank",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isBlank(t)});M.functionHandlers.set("isliteral",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isLiteral(t)});M.functionHandlers.set("isnumeric",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isNumeric(t)});M.functionHandlers.set("haslangdir",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.hasLangdir(t)});M.functionHandlers.set("istriple",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.isTriple(t)});M.functionHandlers.set("sameterm",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution),r=e.getTermFromExpression(n[1],e.solution);return k.BuiltInFunctions.sameTerm(t,r)});M.functionHandlers.set("abs",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.abs(t)});M.functionHandlers.set("round",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.round(t)});M.functionHandlers.set("ceil",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.ceil(t)});M.functionHandlers.set("floor",(n,e)=>{let t=Number(e.getStringValue(e.evaluateExpression(n[0],e.solution)));return k.BuiltInFunctions.floor(t)});M.functionHandlers.set("rand",()=>k.BuiltInFunctions.rand());M.functionHandlers.set("parsedate",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.parseDate(t)});M.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 k.BuiltInFunctions.dateBefore(t,r)});M.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 k.BuiltInFunctions.dateAfter(t,r)});M.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 k.BuiltInFunctions.dateInRange(t,r,i)});M.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 k.BuiltInFunctions.dateDiffMinutes(t,r)});M.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 k.BuiltInFunctions.dateDiffHours(t,r)});var Gc=o((n,e,t)=>(r,i)=>{let s=i.evaluateExpression(r[0],i.solution);return e&&i.isYearMonthDurationValue(s)?e(s):t&&i.isDayTimeDurationValue(s)?t(s):n(i.getStringValue(s))},"createDateTimeAccessor"),jA=Gc(k.BuiltInFunctions.year.bind(k.BuiltInFunctions),k.BuiltInFunctions.durationYears.bind(k.BuiltInFunctions),null);M.functionHandlers.set("year",jA);M.functionHandlers.set("years",jA);var $A=Gc(k.BuiltInFunctions.month.bind(k.BuiltInFunctions),k.BuiltInFunctions.durationMonths.bind(k.BuiltInFunctions),null);M.functionHandlers.set("month",$A);M.functionHandlers.set("months",$A);var BA=Gc(k.BuiltInFunctions.day.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationDays.bind(k.BuiltInFunctions));M.functionHandlers.set("day",BA);M.functionHandlers.set("days",BA);M.functionHandlers.set("hours",Gc(k.BuiltInFunctions.hours.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationHours.bind(k.BuiltInFunctions)));M.functionHandlers.set("minutes",Gc(k.BuiltInFunctions.minutes.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationMinutes.bind(k.BuiltInFunctions)));M.functionHandlers.set("seconds",Gc(k.BuiltInFunctions.seconds.bind(k.BuiltInFunctions),null,k.BuiltInFunctions.durationSeconds.bind(k.BuiltInFunctions)));M.functionHandlers.set("timezone",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.timezone(t)});M.functionHandlers.set("tz",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.tz(t)});M.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 k.BuiltInFunctions.adjust(t,r)});M.functionHandlers.set("now",()=>k.BuiltInFunctions.now());var VA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDateTime(e.getStringValue(t))},"dateTimeHandler");M.functionHandlers.set("datetime",VA);M.functionHandlers.set("xsd:datetime",VA);var UA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdInteger(e.getStringValue(t))},"integerHandler");M.functionHandlers.set("integer",UA);M.functionHandlers.set("xsd:integer",UA);var qA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDecimal(e.getStringValue(t))},"decimalHandler");M.functionHandlers.set("decimal",qA);M.functionHandlers.set("xsd:decimal",qA);var WA=o((n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.xsdDayTimeDuration(e.getStringValue(t))},"dayTimeDurationHandler");M.functionHandlers.set("daytimeduration",WA);M.functionHandlers.set("xsd:daytimeduration",WA);M.functionHandlers.set("durationtodays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToDays(t)});M.functionHandlers.set("durationtohours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToHours(t)});M.functionHandlers.set("durationtominutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToMinutes(t)});M.functionHandlers.set("durationtoseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationToSeconds(t)});M.functionHandlers.set("durationdays",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationDays(t)});M.functionHandlers.set("durationhours",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationHours(t)});M.functionHandlers.set("durationminutes",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationMinutes(t)});M.functionHandlers.set("durationseconds",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationSeconds(t)});M.functionHandlers.set("durationyears",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationYears(t)});M.functionHandlers.set("durationmonths",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution);return k.BuiltInFunctions.durationMonths(t)});M.functionHandlers.set("datetimediff",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeDiff(t,r)});M.functionHandlers.set("datetimeadd",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeAdd(t,r)});M.functionHandlers.set("datetimesubtract",(n,e)=>{let t=e.evaluateExpression(n[0],e.solution),r=e.evaluateExpression(n[1],e.solution);return k.BuiltInFunctions.dateTimeSubtract(t,r)});M.functionHandlers.set("mstominutes",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToMinutes(t)});M.functionHandlers.set("mstohours",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToHours(t)});M.functionHandlers.set("mstoseconds",(n,e)=>{let t=Number(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.msToSeconds(t)});M.functionHandlers.set("md5",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.md5(t)});M.functionHandlers.set("sha1",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha1(t)});M.functionHandlers.set("sha256",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha256(t)});M.functionHandlers.set("sha384",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha384(t)});M.functionHandlers.set("sha512",(n,e)=>{let t=e.getStringValue(e.evaluateExpression(n[0],e.solution));return k.BuiltInFunctions.sha512(t)});M.functionHandlers.set("subject",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.subject(t)});M.functionHandlers.set("predicate",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.predicate(t)});M.functionHandlers.set("object",(n,e)=>{let t=e.getTermFromExpression(n[0],e.solution);return k.BuiltInFunctions.object(t)});M.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 k.BuiltInFunctions.triple(t,r,i)});M.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))});M.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))});M.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)});M.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))});M.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)});M.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"))});M.functionHandlers.set("exo:eval",()=>{let{ExoQLEvalDisabledError:n}=Qu();throw new n})});var Ap=S(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.FilterExecutor=zc.FilterExecutorError=void 0;var yt=Tp(),Dj=GA(),Nj=Ce(),Oa=je(),mr=class extends Error{static{o(this,"FilterExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="FilterExecutorError"}};zc.FilterExecutorError=mr;var _1=class{static{o(this,"FilterExecutor")}constructor(){this.existsEvaluator=null,this.tripleStore=null,this.uuidCache=new Map}setExistsEvaluator(e){this.existsEvaluator=e}setTripleStore(e){this.tripleStore=e,this.uuidCache.clear()}async*execute(e,t){let r=this.expressionContainsExists(e.expression);for await(let i of t)try{let s;r?s=await this.evaluateExpressionAsync(e.expression,i):s=this.evaluateExpression(e.expression,i),s===!0&&(yield i)}catch{continue}}expressionContainsExists(e){if(!e||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}o(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":return r.value;case"NamedNode":return r.value;default:throw new mr(`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":return e.value;case"in":return this.evaluateIn(e,t);case"exists":throw new mr("EXISTS expressions require async evaluation. Use evaluateExpressionAsync instead.");default:throw new mr(`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 yt.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 mr("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 yt.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 yt.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return yt.BuiltInFunctions.logicalOr(r);throw new mr(`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 a=await this.evaluateExpressionAsync(s,t);if(yt.BuiltInFunctions.compare(r,a,"=")){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 mr("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 a=[];for(let l of s){let u=await this.evaluateExpressionAsync(l,t);a.push(this.wrapAsLiteralExpression(u))}let c={...r,args:a};return this.evaluateFunction(c,t)}wrapAsLiteralExpression(e){return e==null?{type:"literal",value:""}:e!==null&&typeof e=="object"&&"termType"in e?e:e instanceof Nj.IRI||e instanceof Oa.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 yt.BuiltInFunctions.compare(r,i,e.operator)}evaluateLogical(e,t){if(e.operator==="!"){let i=this.evaluateExpression(e.operands[0],t);return yt.BuiltInFunctions.logicalNot(i)}let r=e.operands.map(i=>this.evaluateExpression(i,t));if(e.operator==="&&")return yt.BuiltInFunctions.logicalAnd(r);if(e.operator==="||")return yt.BuiltInFunctions.logicalOr(r);throw new mr(`Unknown logical operator: ${String(e.operator)}`)}evaluateIn(e,t){let r=this.evaluateExpression(e.expression,t),i=e.list.some(s=>{let a=this.evaluateExpression(s,t);return yt.BuiltInFunctions.compare(r,a,"=")});return e.negated?!i:i}evaluateArithmetic(e,t){let r=this.evaluateExpression(e.left,t),i=this.evaluateExpression(e.right,t);if(e.operator==="-"&&this.isDateValue(r)&&this.isDateValue(i))return yt.BuiltInFunctions.dateDiff(r,i);if(e.operator==="-"&&this.isTimeValue(r)&&this.isTimeValue(i))return yt.BuiltInFunctions.timeDiff(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDateTimeValue(i))return yt.BuiltInFunctions.dateTimeDiff(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateAdd(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateSubtract(r,i);if(e.operator==="+"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateAddYearMonth(r,i);if(e.operator==="-"&&this.isDateValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateTimeAdd(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.dateTimeSubtract(r,i);if(e.operator==="+"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateTimeAddYearMonth(r,i);if(e.operator==="-"&&this.isDateTimeValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.dateTimeSubtractYearMonth(r,i);if(e.operator==="+"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.durationAdd(r,i);if(e.operator==="-"&&this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i))return yt.BuiltInFunctions.durationSubtract(r,i);if(e.operator==="*"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);return yt.BuiltInFunctions.durationMultiply(r,c)}if(e.operator==="*"&&!this.isDayTimeDurationValue(r)&&this.isDayTimeDurationValue(i)){let c=this.toNumericValue(r);return yt.BuiltInFunctions.durationMultiply(i,c)}if(e.operator==="/"&&this.isDayTimeDurationValue(r)&&!this.isDayTimeDurationValue(i)){let c=this.toNumericValue(i);if(c===0)throw new mr("Division by zero");return yt.BuiltInFunctions.durationDivide(r,c)}if(e.operator==="+"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.yearMonthDurationAdd(r,i);if(e.operator==="-"&&this.isYearMonthDurationValue(r)&&this.isYearMonthDurationValue(i))return yt.BuiltInFunctions.yearMonthDurationSubtract(r,i);let s=this.toNumericValue(r),a=this.toNumericValue(i);switch(e.operator){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":if(a===0)throw new mr("Division by zero");return s/a;default:throw new mr(`Unknown arithmetic operator: ${String(e.operator)}`)}}isDayTimeDurationValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#dayTimeDuration":!1}isYearMonthDurationValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#yearMonthDuration":!1}toNumericValue(e){if(typeof e=="number")return e;if(e instanceof Oa.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 mr(`Cannot convert to number: ${e}`)}isDateTimeValue(e){if(e instanceof Oa.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 Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#date":!1}isTimeValue(e){return e instanceof Oa.Literal?(e.datatype?.value||"")==="http://www.w3.org/2001/XMLSchema#time":!1}evaluateFunction(e,t){let r=e,i=this.extractFunctionName(r.function),s=this.evaluateSpecialFunction(i,r.args,t);if(s!==void 0)return s.value;let a=Dj.functionHandlers.get(i);if(!a)throw new mr(`Unknown function: ${i}`);let c={evaluateExpression:o((l,u)=>this.evaluateExpression(l,u),"evaluateExpression"),getTermFromExpression:o((l,u)=>this.getTermFromExpression(l,u),"getTermFromExpression"),getStringValue:o(l=>this.getStringValue(l),"getStringValue"),solution:t,isYearMonthDurationValue:o(l=>this.isYearMonthDurationValue(l),"isYearMonthDurationValue"),isDayTimeDurationValue:o(l=>this.isDayTimeDurationValue(l),"isDayTimeDurationValue")};return a(r.args,c)}extractFunctionName(e){if(typeof e=="string")return e.toLowerCase();if(e&&typeof e=="object"&&"value"in e){let t=e.value;return((t.includes("#")?t.split("#").pop():t.split("/").pop())||t).toLowerCase()}throw new mr(`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 mr("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 Oa.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 mr("exo:byUUID requires exactly 1 argument (UUID string)");let r=this.evaluateExpression(e.args[0],t),i=this.getStringValue(r);if(!i)return;let s=i.toLowerCase();if(this.uuidCache.has(s))return this.uuidCache.get(s)??void 0;if(!this.tripleStore){this.uuidCache.set(s,null);return}if(this.tripleStore.findSubjectsByUUIDSync){let a=this.tripleStore.findSubjectsByUUIDSync(s);if(a.length===0){this.uuidCache.set(s,null);return}let c=a[0];return this.uuidCache.set(s,c),c}this.uuidCache.set(s,null)}cacheUUIDResult(e,t){let r=e.toLowerCase();this.uuidCache.set(r,t)}getCachedUUID(e){let t=e.toLowerCase();if(this.uuidCache.has(t))return this.uuidCache.get(t)}};zc.FilterExecutor=_1});var v1=S(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.OptionalExecutor=void 0;var S1=class{static{o(this,"OptionalExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);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 a="\0",c=new Map;for(let l of t){let u=this.computeHashKey(l,s,a),f=c.get(u);f||(f=[],c.set(u,f)),f.push(l)}for(let l of e){let u=this.computeHashKey(l,s,a),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 a=e.get(s);i.push(a!==void 0?a.toString():"UNBOUND")}return i.join(r)}*nestedLoopJoin(e,t){for(let r of e){let i=!1;for(let s of t){let a=r.merge(s);a!==null&&(yield a,i=!0)}i||(yield r)}}};xp.OptionalExecutor=S1});var w1=S(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.UnionExecutor=void 0;var b1=class{static{o(this,"UnionExecutor")}async*execute(e,t){let r=new Set;for await(let i of e){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}for await(let i of t){let s=this.getSolutionKey(i);r.has(s)||(r.add(s),yield i)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}};Cp.UnionExecutor=b1});var zA=S(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.MinusExecutor=void 0;var E1=class{static{o(this,"MinusExecutor")}async*execute(e,t){let r=[];for await(let s of e)r.push(s);let i=[];for await(let s of t)i.push(s);for(let s of r){let a=!1;for(let c of i)if(this.areCompatible(s,c)){a=!0;break}a||(yield s)}}async executeAll(e,t){let r=[];async function*i(){for(let a of e)yield a}o(i,"generateLeft");async function*s(){for(let a of t)yield a}o(s,"generateRight");for await(let a of this.execute(i(),s()))r.push(a);return r}areCompatible(e,t){let r=e.variables(),i=new Set(t.variables()),s=r.filter(a=>i.has(a));if(s.length===0)return!1;for(let a of s){let c=e.get(a),l=t.get(a);if(c===void 0||l===void 0||c.toString()!==l.toString())return!1}return!0}};Ip.MinusExecutor=E1});var QA=S(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ValuesExecutor=Hc.ValuesExecutorError=void 0;var Lj=as(),HA=Ce(),kj=je(),Rp=class extends Error{static{o(this,"ValuesExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ValuesExecutorError"}};Hc.ValuesExecutorError=Rp;var T1=class{static{o(this,"ValuesExecutor")}async*execute(e){if(e.bindings.length!==0)for(let t of e.bindings)yield this.createSolutionMapping(t)}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);return t}createSolutionMapping(e){let t=new Lj.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 HA.IRI(e.value);if(e.type==="literal")return new kj.Literal(e.value,e.datatype?new HA.IRI(e.datatype):void 0,e.language,e.direction);throw new Rp(`Unknown term type: ${e.type}`)}};Hc.ValuesExecutor=T1});var A1=S(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.CustomAggregateRegistry=Yc.CustomAggregateError=void 0;var Qc=class extends Error{static{o(this,"CustomAggregateError")}constructor(e,t){super(e),this.iri=t,this.name="CustomAggregateError"}};Yc.CustomAggregateError=Qc;var Pp=class n{static{o(this,"CustomAggregateRegistry")}constructor(){this.aggregates=new Map}static getInstance(){return n.instance||(n.instance=new n),n.instance}static resetInstance(){n.instance&&n.instance.clear(),n.instance=null}register(e,t){if(!e||typeof e!="string")throw new Qc("Aggregate IRI must be a non-empty string");if(!t||typeof t.init!="function"||typeof t.step!="function"||typeof t.finalize!="function")throw new Qc("Aggregate must implement init(), step(), and finalize() methods",e);if(this.aggregates.has(e))throw new Qc(`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}};Yc.CustomAggregateRegistry=Pp;Pp.instance=null});var x1=S(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.BUILT_IN_AGGREGATES=Je.modeAggregate=Je.stddevAggregate=Je.varianceAggregate=Je.medianAggregate=Je.EXO_AGGREGATE_NS=void 0;Je.getNumericValue=Op;Je.createDecimalLiteral=fi;Je.createDoubleLiteral=$j;Je.createPercentileAggregate=xo;var Co=je(),Kc=Ce(),Mj=new Kc.IRI("http://www.w3.org/2001/XMLSchema#decimal"),jj=new Kc.IRI("http://www.w3.org/2001/XMLSchema#double");Je.EXO_AGGREGATE_NS="https://exocortex.my/ontology/agg#";function Op(n){return n==null?NaN:typeof n=="number"?n:typeof n=="string"?parseFloat(n):n instanceof Co.Literal?parseFloat(n.value):n instanceof Kc.IRI?NaN:typeof n=="boolean"?n?1:0:NaN}o(Op,"getNumericValue");function fi(n){return new Co.Literal(String(n),Mj)}o(fi,"createDecimalLiteral");function $j(n){return new Co.Literal(String(n),jj)}o($j,"createDoubleLiteral");Je.medianAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Op(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=[...t].sort((a,c)=>a-c),i=Math.floor(r.length/2),s=r.length%2!==0?r[i]:(r[i-1]+r[i])/2;return fi(s)}};Je.varianceAggregate={init(){return{values:[]}},step(n,e){let t=n,r=Op(e);isNaN(r)||t.values.push(r)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return fi(i)}};Je.stddevAggregate={init(){return{values:[]}},step(n,e){Je.varianceAggregate.step(n,e)},finalize(n){let e=n,{values:t}=e;if(t.length===0)return fi(0);let r=t.reduce((s,a)=>s+a,0)/t.length,i=t.reduce((s,a)=>s+Math.pow(a-r,2),0)/t.length;return fi(Math.sqrt(i))}};Je.modeAggregate={init(){return{counts:new Map,values:new Map}},step(n,e){if(e==null)return;let t=n,r=String(e instanceof Co.Literal||e instanceof Kc.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 Co.Literal(" ",new Kc.IRI("http://www.w3.org/2001/XMLSchema#string"));let t="",r=0;for(let[a,c]of e.counts)c>r&&(r=c,t=a);let i=e.values.get(t);if(i instanceof Co.Literal)return i;let s=parseFloat(t);return isNaN(s)?new Co.Literal(t,new Kc.IRI("http://www.w3.org/2001/XMLSchema#string")):fi(s)}};function xo(n){let e=Math.max(0,Math.min(100,n))/100;return{init(){return{values:[],percentile:e}},step(t,r){let i=t,s=Op(r);isNaN(s)||i.values.push(s)},finalize(t){let r=t,{values:i}=r;if(i.length===0)return fi(0);let s=[...i].sort((d,h)=>d-h),a=r.percentile*(s.length-1),c=Math.floor(a),l=Math.ceil(a);if(c===l)return fi(s[c]);let u=a-c,f=s[c]*(1-u)+s[l]*u;return fi(f)}}}o(xo,"createPercentileAggregate");Je.BUILT_IN_AGGREGATES={[`${Je.EXO_AGGREGATE_NS}median`]:Je.medianAggregate,[`${Je.EXO_AGGREGATE_NS}variance`]:Je.varianceAggregate,[`${Je.EXO_AGGREGATE_NS}stddev`]:Je.stddevAggregate,[`${Je.EXO_AGGREGATE_NS}mode`]:Je.modeAggregate,[`${Je.EXO_AGGREGATE_NS}percentile25`]:xo(25),[`${Je.EXO_AGGREGATE_NS}percentile50`]:xo(50),[`${Je.EXO_AGGREGATE_NS}percentile75`]:xo(75),[`${Je.EXO_AGGREGATE_NS}percentile90`]:xo(90),[`${Je.EXO_AGGREGATE_NS}percentile95`]:xo(95),[`${Je.EXO_AGGREGATE_NS}percentile99`]:xo(99)}});var XA=S(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.AggregateExecutor=Xc.AggregateExecutorError=void 0;var lr=je(),I1=Ce(),Bj=Ap(),Vj=A1(),Uj=x1(),YA=new I1.IRI("http://www.w3.org/2001/XMLSchema#integer"),Io=new I1.IRI("http://www.w3.org/2001/XMLSchema#decimal"),cs=new I1.IRI("http://www.w3.org/2001/XMLSchema#string");function KA(n){return typeof n=="object"&&n.type==="custom"}o(KA,"isCustomAggregation");var Yu=class extends Error{static{o(this,"AggregateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="AggregateExecutorError"}};Xc.AggregateExecutorError=Yu;var C1=class{static{o(this,"AggregateExecutor")}constructor(){this.filterExecutor=new Bj.FilterExecutor}execute(e,t){let r=this.groupSolutions(t,e.variables),i=[];for(let[s,a]of r.entries()){let c=new Map;for(let f of e.variables)if(a.length>0){let d=a[0].get(f);d&&c.set(f,d)}for(let f of e.aggregates){let d=this.computeAggregate(f.expression,a);c.set(f.variable,d)}let{SolutionMapping:l}=as(),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),a=r.get(s);a?a.push(i):r.set(s,[i])}return r}computeGroupKey(e,t){return t.map(r=>{let i=e.get(r);return i?this.termToString(i):""}).join("|")}termToString(e){if(e&&typeof e=="object"){if("value"in e)return String(e.value);if("id"in e)return String(e.id)}return String(e)}computeAggregate(e,t){if(KA(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 lr.Literal(String(s),YA)}case"sum":{let s=this.computeSum(r);return new lr.Literal(String(s),Io)}case"avg":{let s=this.computeAvg(r);return new lr.Literal(String(s),Io)}case"min":{let s=this.computeMin(r);return s===void 0?new lr.Literal("",cs):typeof s=="number"?new lr.Literal(String(s),Io):new lr.Literal(String(s),cs)}case"max":{let s=this.computeMax(r);return s===void 0?new lr.Literal("",cs):typeof s=="number"?new lr.Literal(String(s),Io):new lr.Literal(String(s),cs)}case"group_concat":{let s=this.computeGroupConcat(r,e.separator||" ",e.distinct);return new lr.Literal(s||" ",cs)}case"sample":{let s=this.computeSample(r,e.distinct);return s===void 0?new lr.Literal(" ",cs):typeof s=="number"?new lr.Literal(String(s),Io):new lr.Literal(String(s),cs)}default:{let s=i;throw new Yu(`Unknown aggregation function: ${s}`)}}}computeCustomAggregate(e,t){let i=e.aggregation.iri,a=Vj.CustomAggregateRegistry.getInstance().get(i);if(a||(a=Uj.BUILT_IN_AGGREGATES[i]),!a)throw new Yu(`Unknown custom aggregate function: ${i}. Register it with CustomAggregateRegistry.getInstance().register() or use a built-in aggregate.`);let c=a.init();for(let l of t){let u=null;if(e.expression){let f=this.evaluateExpression(e.expression,l);f!==void 0&&(u=f)}else u=1;a.step(c,u)}return a.finalize(c)}extractValues(e,t){if(!e.expression)return t.map(()=>1);let r=[];for(let i of t){let s=this.evaluateExpression(e.expression,i);s!=null&&r.push(s)}return r}evaluateExpression(e,t){if(e.type==="variable"){let r=t.get(e.name);return r==null?void 0:typeof r=="number"||typeof r=="string"||typeof r=="boolean"?r:typeof r=="object"&&"value"in r?r.value:r}if(e.type==="literal")return e.value;try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}computeCount(e,t){return t?new Set(e.map(r=>String(r))).size:e.length}computeSum(e){return e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r)).reduce((r,i)=>r+i,0)}computeAvg(e){let t=e.map(r=>parseFloat(String(r))).filter(r=>!isNaN(r));return t.length===0?0:t.reduce((r,i)=>r+i,0)/t.length}computeMin(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.min(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s<i?s:i,r[0])}computeMax(e){if(e.length===0)return;let t=e.map(i=>parseFloat(String(i))).filter(i=>!isNaN(i));if(t.length>0)return Math.max(...t);let r=e.map(i=>String(i));return r.reduce((i,s)=>s>i?s:i,r[0])}computeGroupConcat(e,t,r){let i=e.map(s=>String(s));return r&&(i=[...new Set(i)]),i.join(t)}computeSample(e,t){if(e.length===0)return;if(t){let s=[...new Set(e.map(l=>String(l)))];if(s.length===0)return;let a=s[0],c=parseFloat(a);return isNaN(c)?a:c}let r=e[0];if(typeof r=="number")return r;let i=parseFloat(String(r));return isNaN(i)?String(r):i}createEmptyAggregateResult(e){let{SolutionMapping:t}=as(),r=new t;for(let i of e.aggregates){let s=i.expression.aggregation;if(KA(s)){r.set(i.variable,new lr.Literal("0",Io));continue}switch(s){case"count":r.set(i.variable,new lr.Literal("0",YA));break;case"sum":case"avg":r.set(i.variable,new lr.Literal("0",Io));break;case"group_concat":r.set(i.variable,new lr.Literal(" ",cs));break;case"min":case"max":case"sample":r.set(i.variable,new lr.Literal("",cs));break;default:r.set(i.variable,new lr.Literal("",cs))}}return r}};Xc.AggregateExecutor=C1});var F1=S(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ConstructExecutor=void 0;var qj=oi(),Ro=Ce(),R1=je(),P1=Gt(),Wj=xu(),O1=class{static{o(this,"ConstructExecutor")}async execute(e,t){let r=[],i=new Set;for(let s of t)for(let a of e)try{let c=this.instantiateTriple(a,s),l=`${c.subject.toString()}|${c.predicate.toString()}|${c.object.toString()}`;i.has(l)||(i.add(l),r.push(c))}catch{continue}return r}instantiateTriple(e,t){if(this.isPropertyPath(e.predicate))throw new Error("Property paths are not supported in CONSTRUCT templates");let r=this.instantiateElement(e.subject,t),i=this.instantiateElement(e.predicate,t),s=this.instantiateElement(e.object,t);return new qj.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 Ro.IRI(e.value);if(e.type==="literal")return new R1.Literal(e.value,e.datatype?new Ro.IRI(e.datatype):void 0,e.language);if(e.type==="blank")return new P1.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 Wj.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 R1.Literal)throw new Error("Literals cannot appear in quoted triple subject position");return r}if(e.type==="iri")return new Ro.IRI(e.value);if(e.type==="blank")return new P1.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 Ro.IRI))throw new Error("Quoted triple predicate must be an IRI");return r}return new Ro.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 Ro.IRI(e.value);if(e.type==="blank")return new P1.BlankNode(e.value);if(e.type==="literal")return new R1.Literal(e.value,e.datatype?new Ro.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}`)}};Fp.ConstructExecutor=O1});var ZA=S(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ServiceExecutor=Jc.ServiceExecutorError=void 0;var Gj=as(),JA=Ce(),zj=je(),Hj=Gt(),Po=class extends Error{static{o(this,"ServiceExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="ServiceExecutorError"}};Jc.ServiceExecutorError=Po;var D1=class{static{o(this,"ServiceExecutor")}constructor(e={}){this.timeout=e.timeout??3e4,this.httpClient=e.httpClient??((t,r)=>fetch(t,r)),this.maxRetries=e.maxRetries??2,this.retryDelay=e.retryDelay??1e3}async*execute(e,t){try{let r=t(e.pattern),i=await this.executeRemoteQuery(e.endpoint,r);for(let s of i)yield s}catch(r){if(e.silent)return;throw r}}async executeRemoteQuery(e,t){let r;for(let i=0;i<=this.maxRetries;i++)try{let s=new AbortController,a=setTimeout(()=>s.abort(),this.timeout);try{let c=await this.httpClient(e,{method:"POST",headers:{"Content-Type":"application/sparql-query",Accept:"application/sparql-results+json"},body:t,signal:s.signal});if(!c.ok)throw new Po(`Remote SPARQL endpoint returned ${c.status}: ${c.statusText}`);let l=await c.json();return this.parseJsonResults(l)}finally{clearTimeout(a)}}catch(s){if(r=s instanceof Error?s:new Error(String(s)),this.isRetryableError(r)&&i<this.maxRetries){await this.delay(this.retryDelay);continue}throw new Po(`Failed to query remote SPARQL endpoint ${e}: ${r.message}`,r)}throw new Po(`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 Gj.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 JA.IRI(e.value);case"literal":{let t=e.datatype?new JA.IRI(e.datatype):void 0;return new zj.Literal(e.value,t,e["xml:lang"])}case"bnode":return new Hj.BlankNode(e.value);default:throw new Po(`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))}};Jc.ServiceExecutor=D1});var t3=S(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.GraphExecutor=Zc.GraphExecutorError=void 0;var e3=Ce(),Dp=class extends Error{static{o(this,"GraphExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="GraphExecutorError"}};Zc.GraphExecutorError=Dp;var N1=class{static{o(this,"GraphExecutor")}constructor(e){this.tripleStore=e}async*execute(e,t,r){let i=e.name;if(i.type==="iri")yield*this.executeWithGraph(e.pattern,i,t);else if(i.type==="variable")yield*this.executeWithGraphVariable(e,i,t,r);else throw new Dp(`Invalid graph name type: ${i.type}`)}async*executeWithGraph(e,t,r){let i=new e3.IRI(t.value);this.tripleStore.hasGraph&&!await this.tripleStore.hasGraph(i)||(yield*r(e,i))}async*executeWithGraphVariable(e,t,r,i){if(i){let a=i.get(t.value);if(a&&a instanceof e3.IRI){yield*this.executeWithGraph(e.pattern,{type:"iri",value:a.value},r);return}}if(!this.tripleStore.getNamedGraphs)return;let s=await this.tripleStore.getNamedGraphs();for(let a of s)for await(let c of r(e.pattern,a)){let l=c.clone();l.set(t.value,a),yield l}}};Zc.GraphExecutor=N1});var r3=S(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.SPARQLGenerator=tl.SPARQLGeneratorError=void 0;var el=class extends Error{static{o(this,"SPARQLGeneratorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="SPARQLGeneratorError"}};tl.SPARQLGeneratorError=el;var L1=class{static{o(this,"SPARQLGenerator")}collectVariables(e){let t=new Set;return this.collectVariablesFromOperation(e,t),t}generateSelect(e){let t=this.collectVariables(e),r=t.size>0?Array.from(t).map(s=>`?${s}`).join(" "):"*",i=this.generateWhereClause(e);return`SELECT ${r} WHERE {
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)}
@@ -374,7 +374,7 @@ LIMIT ${this.config.defaultLimit}`,s="\u041D\u0435 \u0443\u0434\u0430\u043B\u043
374
374
  `,i=this.composePrefixes(t),s=this.serializePrefixes(i,r),a=this.nTriplesSerializer.serialize(e,{newline:r}).trimEnd();return s?a?`${s}${r}${r}${a}${r}`:`${s}${r}`:a?`${a}${r}`:""}serializePrefixes(e,t){let r=Object.entries(e);return r.length===0?"":r.map(([i,s])=>`@prefix ${i}: <${s}> .`).join(t)}composePrefixes(e){return e.includeDefaultPrefixes??!0?{...h8,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};sm.TurtleSerializer=bv});var mx=S(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.JSONLDSerializer=void 0;var hx=Ce(),px=Gt(),p8=je(),ul=Rr(),m8={rdf:ul.Namespace.RDF.iri.value,rdfs:ul.Namespace.RDFS.iri.value,owl:ul.Namespace.OWL.iri.value,xsd:ul.Namespace.XSD.iri.value,exo:ul.Namespace.EXO.iri.value,ems:ul.Namespace.EMS.iri.value},wv=class{static{o(this,"JSONLDSerializer")}toDocument(e,t={}){let r={...m8,...t.context??{}},i=new Map;for(let s of e){let a=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,r),l=this.objectToJSONLD(s.object,r),u=i.get(a)??{"@id":a},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(a,u)}return{"@context":r,"@graph":Array.from(i.values())}}serialize(e,t={}){let r=this.toDocument(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}subjectToId(e){return e instanceof hx.IRI?e.value:e instanceof px.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 hx.IRI)return{"@id":e.value};if(e instanceof px.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof p8.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}};am.JSONLDSerializer=wv});var Av=S(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.NTriplesParser=void 0;var g8=oi(),gx=Ce(),Ev=je(),y8=Gt(),fl=Rr(),_8={rdf:fl.Namespace.RDF.iri.value,rdfs:fl.Namespace.RDFS.iri.value,owl:fl.Namespace.OWL.iri.value,xsd:fl.Namespace.XSD.iri.value,exo:fl.Namespace.EXO.iri.value,ems:fl.Namespace.EMS.iri.value},Tv=class{static{o(this,"NTriplesParser")}parse(e,t={}){let r={prefixes:{..._8,...t.prefixes??{}},strict:t.strict??!1},i=[];return e.split(/\r?\n/).forEach((a,c)=>{let l=a.trim();!l||l.startsWith("#")||i.push(this.parseLine(l,c+1,r))}),i}parseLine(e,t,r){if(!e.endsWith("."))throw new Error(`Invalid RDF statement at line ${t}: missing '.' terminator`);let s=e.slice(0,-1).trim(),a=this.parseSubject(s,t,r);s=a.rest.trim();let c=this.parsePredicate(s,t,r);s=c.rest.trim();let l=this.parseObject(s,t,r);if(s=l.rest.trim(),s.length>0)throw new Error(`Unexpected tokens after object at line ${t}`);return new g8.Triple(a.node,c.node,l.node)}parseSubject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):this.consumePrefixedName(e,t,r)}parsePredicate(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):this.consumePrefixedName(e,t,r)}parseObject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):e.startsWith('"')?this.consumeLiteral(e,t,r):this.consumePrefixedName(e,t,r)}consumePrefixedName(e,t,r){let i=e.match(/^([a-zA-Z_][\w-]*):([^\s]+)(?:\s+(.*))?$/);if(!i)throw new Error(`Invalid token at line ${t}: ${e}`);let[,s,a,c]=i,l=r.prefixes[s];if(!l)throw new Error(`Unknown prefix "${s}" at line ${t}`);return{node:new gx.IRI(`${l}${a}`),rest:(c??"").trimStart()}}consumeIRI(e,t,r){let i=this.findClosingBracket(e,"<",">");if(i===-1)throw new Error(`Invalid IRI at line ${t}`);let s=e.slice(1,i),a=new gx.IRI(s),c=e.slice(i+1).trimStart();return{node:a,rest:c}}consumeBlankNode(e,t){let r=e.match(/^_:(\w+)(?:\s+(.*))?$/);if(!r)throw new Error(`Invalid blank node identifier at line ${t}`);let[,i,s]=r;return{node:new y8.BlankNode(i),rest:(s??"").trimStart()}}consumeLiteral(e,t,r){let{value:i,rest:s}=this.consumeQuotedString(e,t),a=s.trimStart();if(a.startsWith("^^")){a=a.slice(2).trimStart();let c=a.startsWith("<")?this.consumeIRI(a,t,r):this.consumePrefixedName(a,t,r);return{node:new Ev.Literal(i,c.node),rest:c.rest}}if(a.startsWith("@")){let c=a.match(/^@([a-zA-Z-]+)(?:\s+(.*))?$/);if(!c)throw new Error(`Invalid language tag at line ${t}`);let[,l,u]=c;return{node:new Ev.Literal(i,void 0,l),rest:(u??"").trimStart()}}return{node:new Ev.Literal(i),rest:a}}consumeQuotedString(e,t){if(!e.startsWith('"'))throw new Error(`Expected quoted string at line ${t}`);let r="";for(let i=1;i<e.length;i++){let s=e[i];if(s==="\\"){if(i+1>=e.length)throw new Error(`Invalid escape sequence at line ${t}`);let a=e[i+1];switch(a){case"t":r+=" ",i+=1;break;case"b":r+="\b",i+=1;break;case"n":r+=`
375
375
  `,i+=1;break;case"r":r+="\r",i+=1;break;case"f":r+="\f",i+=1;break;case'"':r+='"',i+=1;break;case"\\":r+="\\",i+=1;break;case"u":{let c=e.slice(i+2,i+6);if(c.length!==4||!/^[0-9a-fA-F]{4}$/.test(c))throw new Error(`Invalid \\u escape at line ${t}`);r+=String.fromCharCode(parseInt(c,16)),i+=5;break}case"U":{let c=e.slice(i+2,i+10);if(c.length!==8||!/^[0-9a-fA-F]{8}$/.test(c))throw new Error(`Invalid \\U escape at line ${t}`);r+=String.fromCodePoint(parseInt(c,16)),i+=9;break}default:throw new Error(`Unknown escape sequence \\${a} at line ${t}`)}continue}if(s==='"'){let a=e.slice(i+1);return{value:r,rest:a}}r+=s}throw new Error(`Unterminated string literal at line ${t}`)}findClosingBracket(e,t,r){let i=0;for(let s=0;s<e.length;s++){let a=e[s];if(a===t){i++;continue}if(a===r&&(i--,i===0))return s}return-1}};om.NTriplesParser=Tv});var yx=S(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.TurtleParser=void 0;var dl=Rr(),S8=Av(),v8={rdf:dl.Namespace.RDF.iri.value,rdfs:dl.Namespace.RDFS.iri.value,owl:dl.Namespace.OWL.iri.value,xsd:dl.Namespace.XSD.iri.value,exo:dl.Namespace.EXO.iri.value,ems:dl.Namespace.EMS.iri.value},b8=/^@prefix\s+([a-zA-Z_][\w-]*):\s*<([^>]+)>\s*\.$/,xv=class{static{o(this,"TurtleParser")}constructor(){this.nTriplesParser=new S8.NTriplesParser}parse(e,t={}){let r={...v8,...t.prefixes??{}},i=this.collectStatements(e),s=[];return i.forEach(({statement:a,lineNumber:c})=>{if(this.isPrefixStatement(a)){let u=a.match(b8);if(!u)throw new Error(`Invalid prefix declaration at line ${c}`);let[,f,d]=u;r[f]=d;return}if(a.includes(";")||a.includes(","))throw new Error(`Complex Turtle statements with ';' or ',' are not supported (line ${c})`);let l=this.normalizeShortcuts(a);s.push(this.nTriplesParser.parseLine(l,c,{prefixes:r,strict:!1}))}),s}collectStatements(e){let t=e.split(/\r?\n/),r=[],i="",s=0;if(t.forEach((a,c)=>{let l=a.trim();!l||l.startsWith("#")||(i||(s=c+1),i=i?`${i} ${l}`:l,l.endsWith(".")&&(r.push({statement:i,lineNumber:s}),i=""))}),i)throw new Error(`Unterminated Turtle statement near line ${s}`);return r}isPrefixStatement(e){return e.startsWith("@prefix")}normalizeShortcuts(e){return e.includes(" a ")?e.replace(/\sa\s/g," rdf:type "):e}};cm.TurtleParser=xv});var _x=S(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.RDFSerializer=void 0;var hl=oi(),$o=Ce(),Bo=je(),Cv=Gt(),ps=Rr(),w8=dx(),E8=vv(),T8=mx(),A8=yx(),x8=Av(),C8=1024,I8=`
376
376
  `,R8={rdf:ps.Namespace.RDF.iri.value,rdfs:ps.Namespace.RDFS.iri.value,owl:ps.Namespace.OWL.iri.value,xsd:ps.Namespace.XSD.iri.value,exo:ps.Namespace.EXO.iri.value,ems:ps.Namespace.EMS.iri.value},Iv=class{static{o(this,"RDFSerializer")}constructor(e){this.store=e,this.turtleSerializer=new w8.TurtleSerializer,this.nTriplesSerializer=new E8.NTriplesSerializer,this.jsonldSerializer=new T8.JSONLDSerializer,this.turtleParser=new A8.TurtleParser,this.nTriplesParser=new x8.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??I8,i=t.batchSize??C8,s=t.includeDefaultPrefixes,a=t.prefixes,c=this,l=!1,u=[],f=[],d=0,h=o(async()=>{if(!l){if(f=await c.store.match(),e==="json-ld"){let _=c.jsonldSerializer.toDocument(f,{context:a,pretty:!1});u.push(...c.buildJsonLdChunks(_))}else if(e==="turtle"){let _=c.turtleSerializer.serializePrefixes(c.composePrefixes(a,s),r);_&&u.push(`${_}${r}${r}`)}l=!0}},"ensureInitialized");return{async next(){if(await 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 _=f.slice(d,d+i);d+=_.length;let v="";if(e==="turtle"){let E=c.turtleSerializer.serializeTriplesOnly(_,r);E&&(v=`${E}${r}`)}else e==="n-triples"&&(v=c.nTriplesSerializer.serializeChunk(_,r));return v?{value:v,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?{...R8,...e??{}}:{...e??{}}}parseJsonLd(e,t){let r;try{r=JSON.parse(e)}catch(u){throw new Error(`Invalid JSON-LD document: ${u.message}`)}let i=this.composePrefixes(t.prefixes,!0),s=this.extractContext(r),a={...i,...s},c=this.extractGraph(r),l=[];return c.forEach((u,f)=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error(`Invalid JSON-LD node at index ${f}`);let d=this.parseSubjectFromNode(u,a,f),h=Object.entries(u);for(let[p,_]of h){if(p==="@id"||p==="@context")continue;if(p==="@type"){this.collectTypeTriples(d,_,l,a);continue}let v=this.expandTerm(p,a),E=new $o.IRI(v);this.collectTriplesForValue(d,E,_,l,a)}}),l}extractContext(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let t=e["@context"];if(!t||typeof t!="object"||Array.isArray(t))return{};let r={};return Object.entries(t).forEach(([i,s])=>{typeof s=="string"&&(r[i]=s)}),r}extractGraph(e){if(Array.isArray(e))return e;if(!e||typeof e!="object")return[];let t=e["@graph"];return Array.isArray(t)?t:[e]}parseSubjectFromNode(e,t,r){let i=e["@id"];if(typeof i=="string"){if(i.startsWith("_:"))return new Cv.BlankNode(i.slice(2));if(this.isAbsoluteIri(i))return new $o.IRI(i);let s=this.expandTerm(i,t);return new $o.IRI(s)}return new Cv.BlankNode(`jsonld_${r}`)}collectTypeTriples(e,t,r,i){let s=ps.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 hl.Triple(e,s,new $o.IRI(l)))})}collectTriplesForValue(e,t,r,i,s){if(r!=null){if(Array.isArray(r)){r.forEach(a=>this.collectTriplesForValue(e,t,a,i,s));return}if(typeof r=="object"){let a=r;if(typeof a["@id"]=="string"){let c=this.parseIdNode(a["@id"],s);i.push(new hl.Triple(e,t,c));return}if(a["@value"]!==void 0){let c=this.parseLiteralObject(a,s);i.push(new hl.Triple(e,t,c));return}}if(typeof r=="string"){i.push(new hl.Triple(e,t,new Bo.Literal(r)));return}if(typeof r=="number"){let a=Number.isInteger(r)?ps.Namespace.XSD.term("integer"):ps.Namespace.XSD.term("decimal");i.push(new hl.Triple(e,t,new Bo.Literal(r.toString(),a)));return}if(typeof r=="boolean"){let a=ps.Namespace.XSD.term("boolean");i.push(new hl.Triple(e,t,new Bo.Literal(r.toString(),a)));return}throw new Error("Unsupported JSON-LD value encountered")}}parseIdNode(e,t){if(e.startsWith("_:"))return new Cv.BlankNode(e.slice(2));if(this.isAbsoluteIri(e))return new $o.IRI(e);let r=this.expandTerm(e,t);return new $o.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 Bo.Literal(r,void 0,e["@language"],i):new Bo.Literal(r,void 0,e["@language"])}if(typeof e["@type"]=="string"){let i=this.expandTerm(e["@type"],t);return new Bo.Literal(r,new $o.IRI(i))}return new Bo.Literal(r)}expandTerm(e,t){if(this.isAbsoluteIri(e))return e;let r=e.indexOf(":");if(r>0){let s=e.slice(0,r),a=e.slice(r+1),c=t[s];if(!c)throw new Error(`Unknown prefix "${s}" in JSON-LD document`);return`${c}${a}`}let i=t["@vocab"];if(i)return`${i}${e}`;throw new Error(`Unable to expand JSON-LD term "${e}"`)}isAbsoluteIri(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)}buildJsonLdChunks(e){let t=[],r=JSON.stringify(e["@context"]);return t.push(`{"@context":${r},"@graph":[`),e["@graph"].forEach((i,s)=>{let a=JSON.stringify(i);s>0?t.push(`,${a}`):t.push(a)}),t.push(`]}
377
- `),t}};lm.RDFSerializer=Iv});var Rv=S(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.OBSIDIAN_VAULT_SCHEME=void 0;pl.vaultPathToIRI=P8;pl.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function P8(n){let e=n.startsWith("./")?n.slice(2):n;return`${pl.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}o(P8,"vaultPathToIRI")});var Ov=S(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.RDFVocabularyMapper=void 0;var Jt=oi(),Sx=Ce(),X=Rr(),Pv=class{static{o(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",X.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",X.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",X.Namespace.RDFS.term("subClassOf")],["exo__Property_range",X.Namespace.RDFS.term("range")],["exo__Property_domain",X.Namespace.RDFS.term("domain")],["exo__Property_superProperty",X.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new Jt.Triple(X.Namespace.EXO.term("Asset"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDFS.term("Resource"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Class"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDFS.term("Class"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDF.term("Property"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Task"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Project"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Area"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Workflow"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("WorkflowState"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("WorkflowTransition"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Command"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Precondition"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Grounding"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("CommandBinding"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new Jt.Triple(X.Namespace.EXO.term("Instance_class"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDF.term("type"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Asset_isDefinedBy"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("isDefinedBy"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Class_superClass"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("subClassOf"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_range"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("range"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_domain"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("domain"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_superProperty"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof Sx.IRI)s=r;else{let a=r.match(/^(ems|exo|exocmd)__(.+)$/);if(a){let[,c,l]=a;s=(c==="ems"?X.Namespace.EMS:c==="exocmd"?X.Namespace.EXOCMD:X.Namespace.EXO).term(l)}else s=new Sx.IRI(r)}return new Jt.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};um.RDFVocabularyMapper=Pv});var vx=S(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.RDFSInferenceEngine=void 0;var O8=oi(),fm=Ce(),Fv=class{static{o(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 a=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof fm.IRI){let h=a.get(d.object.value);if(h)for(let p of h)u.push(new O8.Triple(d.subject,i,new fm.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 fm.IRI&&s.object instanceof fm.IRI){let a=s.subject.value,c=s.object.value;i.has(a)||i.set(a,new Set),i.get(a).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=[],a=t.get(e);if(a)for(let c of a)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}};dm.RDFSInferenceEngine=Fv});var Lv=S(Vo=>{"use strict";var F8=Vo&&Vo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.NonInheritablePropertyRegistry=void 0;var D8=le(),bx=Ce(),wx=je(),Dv=Rr(),Nv=class{static{o(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 a=t.find(c=>c.value.includes("Asset_label"));if(!a){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,a,void 0);for(let u of l)if(u.object instanceof wx.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(a=>a.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new wx.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof bx.IRI)return i[0].subject;let s=t.find(a=>a.value.includes("Instance_class"));if(s){let a=await e.match(void 0,s,void 0);for(let c of a)if(c.object instanceof bx.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?Dv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?Dv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?Dv.Namespace.EXOCMD.term(e.substring(8)).value:null}};Vo.NonInheritablePropertyRegistry=Nv;Vo.NonInheritablePropertyRegistry=Nv=F8([(0,D8.injectable)()],Nv)});var jv=S(Uo=>{"use strict";var N8=Uo&&Uo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.PropertyCardinalityRegistry=void 0;var L8=le(),Ex=Ce(),Tx=je(),kv=Rr(),Mv=class{static{o(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 a=t.find(c=>c.value.includes("Asset_label"));if(!a){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,a,void 0);for(let u of l)if(u.object instanceof Tx.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(a=>a.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new Tx.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof Ex.IRI)return i[0].subject;let s=t.find(a=>a.value.includes("Instance_class"));if(s){let a=await e.match(void 0,s,void 0);for(let c of a)if(c.object instanceof Ex.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?kv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?kv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?kv.Namespace.EXOCMD.term(e.substring(8)).value:null}};Uo.PropertyCardinalityRegistry=Mv;Uo.PropertyCardinalityRegistry=Mv=N8([(0,L8.injectable)()],Mv)});var Vv=S(mr=>{"use strict";var k8=mr&&mr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},M8=mr&&mr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(mr,"__esModule",{value:!0});mr.PrototypeChainMaterializer=mr.MAX_PROTOTYPE_DEPTH=mr.INFERRED_GRAPH=void 0;mr.inferredGraphForDepth=$v;var j8=le(),Ax=oi(),ka=Ce(),$8=Lv(),B8=jv();mr.INFERRED_GRAPH=new ka.IRI("https://exocortex.my/ontology/exo#inferred");var V8="https://exocortex.my/ontology/exo#inferred/";function $v(n){return new ka.IRI(`${V8}${n}`)}o($v,"inferredGraphForDepth");mr.MAX_PROTOTYPE_DEPTH=10;var Bv=class{static{o(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 ka.IRI&&c.object instanceof ka.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let a=0;for(let[c]of s){let l=new ka.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 _=p.object instanceof ka.IRI?p.object.value:String(p.object),v=h.get(p.predicate.value);v||(v=new Set,h.set(p.predicate.value,v)),v.add(_)}for(let p=0;p<u.length;p++){let _=u[p],v=p+1,E=new ka.IRI(_),b=await e.match(E,void 0,void 0),A=new Set;if(e.matchInGraph){let R=await e.matchInGraph(E,void 0,void 0,mr.INFERRED_GRAPH);for(let B of R)A.add(B.predicate.value)}for(let R of b){let B=R.predicate.value;if(this.registry.isNonInheritable(B)||A.has(B))continue;if(d.has(B)&&this.isMultiValued(B)){let we=R.object instanceof ka.IRI?R.object.value:String(R.object);if(h.get(B)?.has(we))continue;let G=h.get(B);G||(G=new Set,h.set(B,G)),G.add(we);let F=new Ax.Triple(l,R.predicate,R.object);await e.add(F),e.addToGraph&&(await e.addToGraph(F,mr.INFERRED_GRAPH),await e.addToGraph(F,$v(v))),a++;continue}if(d.has(B))continue;let W=new Ax.Triple(l,R.predicate,R.object);await e.add(W),e.addToGraph&&(await e.addToGraph(W,mr.INFERRED_GRAPH),await e.addToGraph(W,$v(v))),d.add(B),a++}}}return a}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],a=t.get(e);for(a&&s.push(a.value);s.length>0&&r.length<mr.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}};mr.PrototypeChainMaterializer=Bv;mr.PrototypeChainMaterializer=Bv=k8([(0,j8.injectable)(),M8("design:paramtypes",[$8.NonInheritablePropertyRegistry,B8.PropertyCardinalityRegistry])],Bv)});var qv=S(cr=>{"use strict";var U8=cr&&cr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},q8=cr&&cr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(cr,"__esModule",{value:!0});cr.SourceAnnotator=cr.DEPTH_VARIABLE=cr.SOURCE_VARIABLE=void 0;var W8=le(),ml=je(),G8=Ce(),hm=Vv();cr.SOURCE_VARIABLE="_source";cr.DEPTH_VARIABLE="_depth";var Uv=class{static{o(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(a=>{let c=a.clone();return c.set(cr.SOURCE_VARIABLE,new ml.Literal("own")),c});let s=[];for(let a of e){let c=a.get(t),l=a.get(r),u=a.get(i),f=a.clone();if(!c||!l||!u)f.set(cr.SOURCE_VARIABLE,new ml.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(cr.SOURCE_VARIABLE,new ml.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,hm.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=hm.MAX_PROTOTYPE_DEPTH;i++){let s=(0,hm.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 a=s.clone();return a.set(cr.SOURCE_VARIABLE,new ml.Literal("own")),a});let r=[],i=new Map;for(let s of e){let a=s.get(t),c=s.clone();if(!a||!(a instanceof G8.IRI))c.set(cr.SOURCE_VARIABLE,new ml.Literal("own"));else{let l=a.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(a,void 0,void 0,hm.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(cr.SOURCE_VARIABLE,new ml.Literal(u))}r.push(c)}return r}};cr.SourceAnnotator=Uv;cr.SourceAnnotator=Uv=U8([(0,W8.injectable)(),q8("design:paramtypes",[Object])],Uv)});var Gv=S(ki=>{"use strict";var z8=ki&&ki.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},H8=ki&&ki.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},xx=ki&&ki.__param||function(n,e){return function(t,r){e(t,r,n)}},gl;Object.defineProperty(ki,"__esModule",{value:!0});ki.NoteToRDFConverter=void 0;var Wv=le(),dn=oi(),qo=Ce(),Cn=je(),Cx=Gt(),zt=Rr(),Ix=wt(),Q8=Ov(),Y8=Ac(),Rx=Rv(),In=k0(),Wo=gl=class{static{o(this,"NoteToRDFConverter")}constructor(e,t=Y8.NullLogger){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.vocabularyMapper=new Q8.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?In.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){let r=[],i=this.notePathToIRI(e.path),s=zt.Namespace.EXO.term("Asset_fileName");r.push(new dn.Triple(i,s,new Cn.Literal(e.basename)));for(let[c,l]of Object.entries(t)){if(!this.isExocortexProperty(c))continue;let u=this.propertyKeyToIRI(c),f=Array.isArray(l)?l:[l];for(let d of f)if(c==="exo__Instance_class"){let h=this.valueToClassURI(d);r.push(new dn.Triple(i,u,h))}else{let h=await this.valueToRDFObject(d,e);for(let p of h)if(r.push(new dn.Triple(i,u,p)),this.vocabularyMapper.hasMappingFor(c)&&p instanceof qo.IRI){let _=this.vocabularyMapper.generateMappedTriple(i,c,p);_&&r.push(_)}}if(c==="exo__Instance_class")for(let d of f){let h=this.valueToClassURI(d);if(h instanceof qo.IRI){let p=zt.Namespace.RDF.term("type");r.push(new dn.Triple(i,p,h))}}if(c==="exo__Asset_label"){let d=zt.Namespace.RDFS.term("label");for(let h of f)typeof h=="string"&&h.length>0&&r.push(new dn.Triple(i,d,new Cn.Literal(h)))}}let a=await this.convertBodyWikilinks(e,i);return r.push(...a),r}async convertExo003Note(e,t){let r=In.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case In.Exo003MetadataType.Namespace:break;case In.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case In.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case In.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case In.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new qo.IRI(t.uri);return[new dn.Triple(r,zt.Namespace.OWL.term("sameAs"),i),new dn.Triple(i,zt.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 dn.Triple(r,zt.Namespace.OWL.term("sameAs"),new Cx.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=In.Exo003Parser.toTriple(t,i);r.push(s);let a=this.notePathToIRI(e.path);r.push(new dn.Triple(a,zt.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.createExo003ReferenceResolver(e),c=a(t.subject),l=a(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new qo.IRI(c.value):new Cx.BlankNode(c.value),f=new qo.IRI(l.value),d=In.Exo003Parser.toLiteral(t,s.trim());r.push(new dn.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new dn.Triple(h,zt.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let a=this.vault.getFrontmatter(s);if(a&&In.Exo003Parser.isExo003Format(a)){let c=In.Exo003Parser.parse(a);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===In.Exo003MetadataType.Anchor||l.metadata===In.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===In.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let a of t)try{let c=this.vault.getFrontmatter(a),l=c?this.validateExocortexAsset(c):null;if(l){if(s)throw new Error(`Invariant violation in "${a.path}": ${l.message}`);i.push({path:a.path,reason:`Invariant violation: ${l.message}`}),this.logger.warn(`Skipping file with invariant violation: ${a.path}`,{code:l.code,property:l.property,reason:l.message});continue}let u=await this.convertNote(a);r.push(...u)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${a.path}": ${l}`);i.push({path:a.path,reason:`Invalid IRI: ${l}`}),this.logger.warn(`Skipping file with invalid IRI: ${a.path}`,{reason:l})}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}validateExocortexAsset(e){let t=o(l=>l==null?!0:typeof l=="string"?l.trim()==="":Array.isArray(l)?l.length===0||l.every(t):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let i=["exo__Asset_uid","exo__Asset_isDefinedBy","exo__Asset_label","exo__Instance_class"];for(let l of i){if(!(l in e))return{code:"MISSING_PROPERTY",property:l,message:`Required property "${l}" is missing`};if(t(e[l]))return{code:"EMPTY_PROPERTY",property:l,message:`Required property "${l}" is empty`}}let s=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let l of s)if(l in e&&t(e[l]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:l,message:`Optional property "${l}" is present but empty`};let a=e.exo__Instance_class,c=Array.isArray(a)?a:[a];for(let l of c){if(typeof l!="string")continue;let u=this.removeQuotes(l),d=(this.extractWikilink(u)??u).trim();if(/^[a-z][a-zA-Z0-9]*__/.test(d)&&/[\s()]/.test(d))return{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${l}"`}}return null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,Rx.vaultPathToIRI)(r.path);qo.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 qo.IRI((0,Rx.vaultPathToIRI)(e))}isExocortexProperty(e){return gl.NAMESPACE_MAP.some(([t])=>e.startsWith(t))}propertyKeyToIRI(e){for(let[t,r]of gl.NAMESPACE_MAP)if(e.startsWith(t))return r.term(e.substring(t.length));throw new Error(`Invalid property key: ${e}`)}async valueToRDFObject(e,t){if(typeof e=="string"){let r=this.removeQuotes(e),i=this.extractWikilink(r);if(i){let s=this.vault.getFirstLinkpathDest(i,t.path);if(s){let a=this.notePathToIRI(s.path),c=i.includes("|")?i.split("|")[0]:i;if(this.isUUID(c)){let u=new Cn.Literal(c),f=this.expandClassValue(s.basename);if(f)return[f];let d=this.vault.getFrontmatter(s);if(d){let h=d.exo__Asset_label;if(typeof h=="string"){let p=this.expandClassValue(h);if(p)return[p]}}return[a,u]}let l=this.expandClassValue(s.basename);return l?[l]:[a]}if(this.isClassReference(i)){let a=this.expandClassValue(i);if(a)return[a]}return[new Cn.Literal(r)]}if(this.isClassReference(r)){let s=this.expandClassValue(r);if(s)return[s]}return this.isISO8601DateTime(r)?[new Cn.Literal(r,zt.Namespace.XSD.term("dateTime"))]:[new Cn.Literal(r)]}return typeof e=="boolean"?[new Cn.Literal(e.toString())]:typeof e=="number"?[new Cn.Literal(e.toString(),zt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new Cn.Literal(e.toISOString(),zt.Namespace.XSD.term("dateTime"))]:[new Cn.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 Cn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let a=this.extractWikilinkAlias(t);if(a){let c=this.expandClassValue(a);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 new Cn.Literal(t)}isClassReference(e){return gl.NAMESPACE_MAP.some(([t])=>e.startsWith(t))&&!/\s/.test(e)}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e);for(let[r,i]of gl.NAMESPACE_MAP)if(t.startsWith(r))return i.term(t.substring(r.length));return null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.extractBodyWikilinks(s),c=zt.Namespace.EXO.term("Asset_bodyLink");for(let l of a){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new dn.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new dn.Triple(t,c,f)):r.push(new dn.Triple(t,c,new Cn.Literal(l)))}else r.push(new dn.Triple(t,c,new Cn.Literal(l)))}}catch{}return r}};ki.NoteToRDFConverter=Wo;Wo.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};Wo.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};Wo.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};Wo.NAMESPACE_MAP=[["exo__",zt.Namespace.EXO],["ems__",zt.Namespace.EMS],["exocmd__",zt.Namespace.EXOCMD],["ims__",zt.Namespace.IMS],["ztlk__",zt.Namespace.ZTLK],["ptms__",zt.Namespace.PTMS],["lit__",zt.Namespace.LIT],["inbox__",zt.Namespace.INBOX],["pmbok__",zt.Namespace.PMBOK]];ki.NoteToRDFConverter=Wo=gl=z8([(0,Wv.injectable)(),xx(0,(0,Wv.inject)(Ix.DI_TOKENS.IVaultAdapter)),xx(1,(0,Wv.inject)(Ix.DI_TOKENS.ILogger)),H8("design:paramtypes",[Object,Object])],Wo)});var Hv=S(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.FilterContainsOptimizer=void 0;var K8=Ce(),X8=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,zv=class{static{o(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(X8);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 K8.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(a=>a.subject.type==="variable"&&a.subject.value===t?{...a,subject:{type:"iri",value:r}}:a);if(i.some((a,c)=>a.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(a=>({[t.variable]:{type:"iri",value:a}}))},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)}};pm.FilterContainsOptimizer=zv});var Px=S(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.AlgebraOptimizer=void 0;var J8=Hv(),Qv=class{static{o(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new J8.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),a=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return a&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!a?{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)}};mm.AlgebraOptimizer=Qv});var Ox=S(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.AlgebraSerializer=void 0;var Yv=class{static{o(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
377
+ `),t}};lm.RDFSerializer=Iv});var Rv=S(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.OBSIDIAN_VAULT_SCHEME=void 0;pl.vaultPathToIRI=P8;pl.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function P8(n){let e=n.startsWith("./")?n.slice(2):n;return`${pl.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}o(P8,"vaultPathToIRI")});var Ov=S(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.RDFVocabularyMapper=void 0;var Jt=oi(),Sx=Ce(),X=Rr(),Pv=class{static{o(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",X.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",X.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",X.Namespace.RDFS.term("subClassOf")],["exo__Property_range",X.Namespace.RDFS.term("range")],["exo__Property_domain",X.Namespace.RDFS.term("domain")],["exo__Property_superProperty",X.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new Jt.Triple(X.Namespace.EXO.term("Asset"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDFS.term("Resource"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Class"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDFS.term("Class"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.RDF.term("Property"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Task"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Project"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Area"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("Workflow"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("WorkflowState"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EMS.term("WorkflowTransition"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Command"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Precondition"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("Grounding"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e.push(new Jt.Triple(X.Namespace.EXOCMD.term("CommandBinding"),X.Namespace.RDFS.term("subClassOf"),X.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new Jt.Triple(X.Namespace.EXO.term("Instance_class"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDF.term("type"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Asset_isDefinedBy"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("isDefinedBy"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Class_superClass"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("subClassOf"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_range"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("range"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_domain"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("domain"))),e.push(new Jt.Triple(X.Namespace.EXO.term("Property_superProperty"),X.Namespace.RDFS.term("subPropertyOf"),X.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof Sx.IRI)s=r;else{let a=r.match(/^(ems|exo|exocmd)__(.+)$/);if(a){let[,c,l]=a;s=(c==="ems"?X.Namespace.EMS:c==="exocmd"?X.Namespace.EXOCMD:X.Namespace.EXO).term(l)}else s=new Sx.IRI(r)}return new Jt.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};um.RDFVocabularyMapper=Pv});var vx=S(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.RDFSInferenceEngine=void 0;var O8=oi(),fm=Ce(),Fv=class{static{o(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 a=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof fm.IRI){let h=a.get(d.object.value);if(h)for(let p of h)u.push(new O8.Triple(d.subject,i,new fm.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 fm.IRI&&s.object instanceof fm.IRI){let a=s.subject.value,c=s.object.value;i.has(a)||i.set(a,new Set),i.get(a).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=[],a=t.get(e);if(a)for(let c of a)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}};dm.RDFSInferenceEngine=Fv});var Lv=S(Vo=>{"use strict";var F8=Vo&&Vo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.NonInheritablePropertyRegistry=void 0;var D8=le(),bx=Ce(),wx=je(),Dv=Rr(),Nv=class{static{o(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 a=t.find(c=>c.value.includes("Asset_label"));if(!a){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,a,void 0);for(let u of l)if(u.object instanceof wx.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(a=>a.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new wx.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof bx.IRI)return i[0].subject;let s=t.find(a=>a.value.includes("Instance_class"));if(s){let a=await e.match(void 0,s,void 0);for(let c of a)if(c.object instanceof bx.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?Dv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?Dv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?Dv.Namespace.EXOCMD.term(e.substring(8)).value:null}};Vo.NonInheritablePropertyRegistry=Nv;Vo.NonInheritablePropertyRegistry=Nv=F8([(0,D8.injectable)()],Nv)});var jv=S(Uo=>{"use strict";var N8=Uo&&Uo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.PropertyCardinalityRegistry=void 0;var L8=le(),Ex=Ce(),Tx=je(),kv=Rr(),Mv=class{static{o(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 a=t.find(c=>c.value.includes("Asset_label"));if(!a){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,a,void 0);for(let u of l)if(u.object instanceof Tx.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(a=>a.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new Tx.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof Ex.IRI)return i[0].subject;let s=t.find(a=>a.value.includes("Instance_class"));if(s){let a=await e.match(void 0,s,void 0);for(let c of a)if(c.object instanceof Ex.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?kv.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?kv.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?kv.Namespace.EXOCMD.term(e.substring(8)).value:null}};Uo.PropertyCardinalityRegistry=Mv;Uo.PropertyCardinalityRegistry=Mv=N8([(0,L8.injectable)()],Mv)});var Vv=S(gr=>{"use strict";var k8=gr&&gr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},M8=gr&&gr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(gr,"__esModule",{value:!0});gr.PrototypeChainMaterializer=gr.MAX_PROTOTYPE_DEPTH=gr.INFERRED_GRAPH=void 0;gr.inferredGraphForDepth=$v;var j8=le(),Ax=oi(),ka=Ce(),$8=Lv(),B8=jv();gr.INFERRED_GRAPH=new ka.IRI("https://exocortex.my/ontology/exo#inferred");var V8="https://exocortex.my/ontology/exo#inferred/";function $v(n){return new ka.IRI(`${V8}${n}`)}o($v,"inferredGraphForDepth");gr.MAX_PROTOTYPE_DEPTH=10;var Bv=class{static{o(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 ka.IRI&&c.object instanceof ka.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let a=0;for(let[c]of s){let l=new ka.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 _=p.object instanceof ka.IRI?p.object.value:String(p.object),v=h.get(p.predicate.value);v||(v=new Set,h.set(p.predicate.value,v)),v.add(_)}for(let p=0;p<u.length;p++){let _=u[p],v=p+1,E=new ka.IRI(_),b=await e.match(E,void 0,void 0),A=new Set;if(e.matchInGraph){let R=await e.matchInGraph(E,void 0,void 0,gr.INFERRED_GRAPH);for(let B of R)A.add(B.predicate.value)}for(let R of b){let B=R.predicate.value;if(this.registry.isNonInheritable(B)||A.has(B))continue;if(d.has(B)&&this.isMultiValued(B)){let we=R.object instanceof ka.IRI?R.object.value:String(R.object);if(h.get(B)?.has(we))continue;let G=h.get(B);G||(G=new Set,h.set(B,G)),G.add(we);let F=new Ax.Triple(l,R.predicate,R.object);await e.add(F),e.addToGraph&&(await e.addToGraph(F,gr.INFERRED_GRAPH),await e.addToGraph(F,$v(v))),a++;continue}if(d.has(B))continue;let W=new Ax.Triple(l,R.predicate,R.object);await e.add(W),e.addToGraph&&(await e.addToGraph(W,gr.INFERRED_GRAPH),await e.addToGraph(W,$v(v))),d.add(B),a++}}}return a}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],a=t.get(e);for(a&&s.push(a.value);s.length>0&&r.length<gr.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}};gr.PrototypeChainMaterializer=Bv;gr.PrototypeChainMaterializer=Bv=k8([(0,j8.injectable)(),M8("design:paramtypes",[$8.NonInheritablePropertyRegistry,B8.PropertyCardinalityRegistry])],Bv)});var qv=S(ur=>{"use strict";var U8=ur&&ur.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},q8=ur&&ur.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(ur,"__esModule",{value:!0});ur.SourceAnnotator=ur.DEPTH_VARIABLE=ur.SOURCE_VARIABLE=void 0;var W8=le(),ml=je(),G8=Ce(),hm=Vv();ur.SOURCE_VARIABLE="_source";ur.DEPTH_VARIABLE="_depth";var Uv=class{static{o(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(a=>{let c=a.clone();return c.set(ur.SOURCE_VARIABLE,new ml.Literal("own")),c});let s=[];for(let a of e){let c=a.get(t),l=a.get(r),u=a.get(i),f=a.clone();if(!c||!l||!u)f.set(ur.SOURCE_VARIABLE,new ml.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(ur.SOURCE_VARIABLE,new ml.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,hm.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=hm.MAX_PROTOTYPE_DEPTH;i++){let s=(0,hm.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 a=s.clone();return a.set(ur.SOURCE_VARIABLE,new ml.Literal("own")),a});let r=[],i=new Map;for(let s of e){let a=s.get(t),c=s.clone();if(!a||!(a instanceof G8.IRI))c.set(ur.SOURCE_VARIABLE,new ml.Literal("own"));else{let l=a.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(a,void 0,void 0,hm.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(ur.SOURCE_VARIABLE,new ml.Literal(u))}r.push(c)}return r}};ur.SourceAnnotator=Uv;ur.SourceAnnotator=Uv=U8([(0,W8.injectable)(),q8("design:paramtypes",[Object])],Uv)});var Gv=S(ki=>{"use strict";var z8=ki&&ki.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},H8=ki&&ki.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},xx=ki&&ki.__param||function(n,e){return function(t,r){e(t,r,n)}},gl;Object.defineProperty(ki,"__esModule",{value:!0});ki.NoteToRDFConverter=void 0;var Wv=le(),dn=oi(),qo=Ce(),Cn=je(),Cx=Gt(),zt=Rr(),Ix=wt(),Q8=Ov(),Y8=Ac(),Rx=Rv(),In=k0(),Wo=gl=class{static{o(this,"NoteToRDFConverter")}constructor(e,t=Y8.NullLogger){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.vocabularyMapper=new Q8.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?In.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){let r=[],i=this.notePathToIRI(e.path),s=zt.Namespace.EXO.term("Asset_fileName");r.push(new dn.Triple(i,s,new Cn.Literal(e.basename)));for(let[c,l]of Object.entries(t)){if(!this.isExocortexProperty(c))continue;let u=this.propertyKeyToIRI(c),f=Array.isArray(l)?l:[l];for(let d of f)if(c==="exo__Instance_class"){let h=this.valueToClassURI(d);r.push(new dn.Triple(i,u,h))}else{let h=await this.valueToRDFObject(d,e);for(let p of h)if(r.push(new dn.Triple(i,u,p)),this.vocabularyMapper.hasMappingFor(c)&&p instanceof qo.IRI){let _=this.vocabularyMapper.generateMappedTriple(i,c,p);_&&r.push(_)}}if(c==="exo__Instance_class")for(let d of f){let h=this.valueToClassURI(d);if(h instanceof qo.IRI){let p=zt.Namespace.RDF.term("type");r.push(new dn.Triple(i,p,h))}}if(c==="exo__Asset_label"){let d=zt.Namespace.RDFS.term("label");for(let h of f)typeof h=="string"&&h.length>0&&r.push(new dn.Triple(i,d,new Cn.Literal(h)))}}let a=await this.convertBodyWikilinks(e,i);return r.push(...a),r}async convertExo003Note(e,t){let r=In.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case In.Exo003MetadataType.Namespace:break;case In.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case In.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case In.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case In.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new qo.IRI(t.uri);return[new dn.Triple(r,zt.Namespace.OWL.term("sameAs"),i),new dn.Triple(i,zt.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 dn.Triple(r,zt.Namespace.OWL.term("sameAs"),new Cx.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=In.Exo003Parser.toTriple(t,i);r.push(s);let a=this.notePathToIRI(e.path);r.push(new dn.Triple(a,zt.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.createExo003ReferenceResolver(e),c=a(t.subject),l=a(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new qo.IRI(c.value):new Cx.BlankNode(c.value),f=new qo.IRI(l.value),d=In.Exo003Parser.toLiteral(t,s.trim());r.push(new dn.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new dn.Triple(h,zt.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let a=this.vault.getFrontmatter(s);if(a&&In.Exo003Parser.isExo003Format(a)){let c=In.Exo003Parser.parse(a);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===In.Exo003MetadataType.Anchor||l.metadata===In.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===In.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let a of t)try{let c=this.vault.getFrontmatter(a),l=c?this.validateExocortexAsset(c):null;if(l){if(s)throw new Error(`Invariant violation in "${a.path}": ${l.message}`);i.push({path:a.path,reason:`Invariant violation: ${l.message}`}),this.logger.warn(`Skipping file with invariant violation: ${a.path}`,{code:l.code,property:l.property,reason:l.message});continue}let u=await this.convertNote(a);r.push(...u)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${a.path}": ${l}`);i.push({path:a.path,reason:`Invalid IRI: ${l}`}),this.logger.warn(`Skipping file with invalid IRI: ${a.path}`,{reason:l})}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}validateExocortexAsset(e){let t=o(l=>l==null?!0:typeof l=="string"?l.trim()==="":Array.isArray(l)?l.length===0||l.every(t):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let i=["exo__Asset_uid","exo__Asset_isDefinedBy","exo__Asset_label","exo__Instance_class"];for(let l of i){if(!(l in e))return{code:"MISSING_PROPERTY",property:l,message:`Required property "${l}" is missing`};if(t(e[l]))return{code:"EMPTY_PROPERTY",property:l,message:`Required property "${l}" is empty`}}let s=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let l of s)if(l in e&&t(e[l]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:l,message:`Optional property "${l}" is present but empty`};let a=e.exo__Instance_class,c=Array.isArray(a)?a:[a];for(let l of c){if(typeof l!="string")continue;let u=this.removeQuotes(l),d=(this.extractWikilink(u)??u).trim();if(/^[a-z][a-zA-Z0-9]*__/.test(d)&&/[\s()]/.test(d))return{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${l}"`}}return null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,Rx.vaultPathToIRI)(r.path);qo.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 qo.IRI((0,Rx.vaultPathToIRI)(e))}isExocortexProperty(e){return gl.NAMESPACE_MAP.some(([t])=>e.startsWith(t))}propertyKeyToIRI(e){for(let[t,r]of gl.NAMESPACE_MAP)if(e.startsWith(t))return r.term(e.substring(t.length));throw new Error(`Invalid property key: ${e}`)}async valueToRDFObject(e,t){if(typeof e=="string"){let r=this.removeQuotes(e),i=this.extractWikilink(r);if(i){let s=this.vault.getFirstLinkpathDest(i,t.path);if(s){let a=this.notePathToIRI(s.path),c=i.includes("|")?i.split("|")[0]:i;if(this.isUUID(c)){let u=new Cn.Literal(c),f=this.expandClassValue(s.basename);if(f)return[f];let d=this.vault.getFrontmatter(s);if(d){let h=d.exo__Asset_label;if(typeof h=="string"){let p=this.expandClassValue(h);if(p)return[p]}}return[a,u]}let l=this.expandClassValue(s.basename);return l?[l]:[a]}if(this.isClassReference(i)){let a=this.expandClassValue(i);if(a)return[a]}return[new Cn.Literal(r)]}if(this.isClassReference(r)){let s=this.expandClassValue(r);if(s)return[s]}return this.isISO8601DateTime(r)?[new Cn.Literal(r,zt.Namespace.XSD.term("dateTime"))]:[new Cn.Literal(r)]}return typeof e=="boolean"?[new Cn.Literal(e.toString())]:typeof e=="number"?[new Cn.Literal(e.toString(),zt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new Cn.Literal(e.toISOString(),zt.Namespace.XSD.term("dateTime"))]:[new Cn.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 Cn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let a=this.extractWikilinkAlias(t);if(a){let c=this.expandClassValue(a);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 new Cn.Literal(t)}isClassReference(e){return gl.NAMESPACE_MAP.some(([t])=>e.startsWith(t))&&!/\s/.test(e)}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e);for(let[r,i]of gl.NAMESPACE_MAP)if(t.startsWith(r))return i.term(t.substring(r.length));return null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),a=this.extractBodyWikilinks(s),c=zt.Namespace.EXO.term("Asset_bodyLink");for(let l of a){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new dn.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new dn.Triple(t,c,f)):r.push(new dn.Triple(t,c,new Cn.Literal(l)))}else r.push(new dn.Triple(t,c,new Cn.Literal(l)))}}catch{}return r}};ki.NoteToRDFConverter=Wo;Wo.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};Wo.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};Wo.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};Wo.NAMESPACE_MAP=[["exo__",zt.Namespace.EXO],["ems__",zt.Namespace.EMS],["exocmd__",zt.Namespace.EXOCMD],["ims__",zt.Namespace.IMS],["ztlk__",zt.Namespace.ZTLK],["ptms__",zt.Namespace.PTMS],["lit__",zt.Namespace.LIT],["inbox__",zt.Namespace.INBOX],["pmbok__",zt.Namespace.PMBOK]];ki.NoteToRDFConverter=Wo=gl=z8([(0,Wv.injectable)(),xx(0,(0,Wv.inject)(Ix.DI_TOKENS.IVaultAdapter)),xx(1,(0,Wv.inject)(Ix.DI_TOKENS.ILogger)),H8("design:paramtypes",[Object,Object])],Wo)});var Hv=S(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.FilterContainsOptimizer=void 0;var K8=Ce(),X8=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,zv=class{static{o(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(X8);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 K8.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(a=>a.subject.type==="variable"&&a.subject.value===t?{...a,subject:{type:"iri",value:r}}:a);if(i.some((a,c)=>a.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(a=>({[t.variable]:{type:"iri",value:a}}))},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)}};pm.FilterContainsOptimizer=zv});var Px=S(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.AlgebraOptimizer=void 0;var J8=Hv(),Qv=class{static{o(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new J8.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),a=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return a&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!a?{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)}};mm.AlgebraOptimizer=Qv});var Ox=S(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.AlgebraSerializer=void 0;var Yv=class{static{o(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
378
378
  ${e.triples.map(u=>`${r} ${this.tripleToString(u)}`).join(`
379
379
  `)}
380
380
  ${r}]`;case"filter":return`${r}Filter(
@@ -410,7 +410,7 @@ ${r})`;default:return`${r}Unknown(${e.type})`}}tripleToString(e){return`${this.e
410
410
  `)}termToXML(e){return e instanceof Em.IRI?`<uri>${this.escapeXML(e.value)}</uri>`:e instanceof Tm.BlankNode?`<bnode>${this.escapeXML(e.id)}</bnode>`:e instanceof wm.Literal?this.literalToXML(e):`<literal>${this.escapeXML(String(e))}</literal>`}literalToXML(e){let t=this.escapeXML(e.value);if(e.datatype)return`<literal datatype="${this.escapeXML(e.datatype.value)}">${t}</literal>`;if(e.language){let r=`xml:lang="${this.escapeXML(e.language)}"`;return e.hasDirection()&&e.direction&&(r+=` direction="${e.direction}"`),`<literal ${r}>${t}</literal>`}return`<literal>${t}</literal>`}serializeCSV(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(i.map(a=>this.escapeCSV(a)).join(","));for(let a of e){let c=i.map(l=>{let u=a.get(l);return u===void 0?"":this.escapeCSV(this.termToCSV(u))});s.push(c.join(","))}return s.join(`
411
411
  `)}termToCSV(e){return e instanceof Em.IRI?e.value:e instanceof Tm.BlankNode?`_:${e.id}`:e instanceof wm.Literal?this.literalToCSV(e):String(e)}literalToCSV(e){if(e.datatype)return`${e.value}^^<${e.datatype.value}>`;if(e.language){let t=e.language;return e.hasDirection()&&e.direction&&(t+=`--${e.direction}`),`${e.value}@${t}`}return e.value}serializeTurtle(e,t={}){let r=new Set;for(let a of e)for(let c of a.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(`# SPARQL Results - ${e.length} solution(s)`),s.push(`# Variables: ${i.join(", ")}`),s.push("");for(let a=0;a<e.length;a++){let c=e[a];s.push(`# Solution ${a+1}`);for(let l of i){let u=c.get(l);u!==void 0&&s.push(`?${l} = ${this.termToTurtle(u)}`)}s.push("")}return s.join(`
412
412
  `).trimEnd()}termToTurtle(e){return e instanceof Em.IRI?`<${e.value}>`:e instanceof Tm.BlankNode?`_:${e.id}`:e instanceof wm.Literal?e.toString():`"${String(e)}"`}escapeXML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}escapeCSV(e){return e.includes(",")||e.includes('"')||e.includes(`
413
- `)?`"${e.replace(/"/g,'""')}"`:e}};Am.ResultSerializer=rb});var Ux=S(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.FileAlreadyExistsError=Sl.FileNotFoundError=void 0;var nb=class extends Error{static{o(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};Sl.FileNotFoundError=nb;var ib=class extends Error{static{o(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};Sl.FileAlreadyExistsError=ib});var ab=S(gr=>{"use strict";var o$=gr&&gr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},c$=gr&&gr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(gr,"__esModule",{value:!0});gr.VaultSettings=gr.DEFAULT_FLEETING_NOTE_CLASS_UID=gr.DEFAULT_INBOX_FOLDER=gr.DEFAULT_OWNER_IDENTITY=void 0;var l$=le();gr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';gr.DEFAULT_INBOX_FOLDER="01 Inbox";gr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var sb=class{static{o(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??gr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??gr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??gr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};gr.VaultSettings=sb;gr.VaultSettings=sb=o$([(0,l$.injectable)(),c$("design:paramtypes",[Object])],sb)});var qx=S(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.container=void 0;Ma.registerCoreServices=N$;Ma.createChildContainer=L$;Ma.getContainer=k$;Ma.resetContainer=M$;Vd();var uf=le();Object.defineProperty(Ma,"container",{enumerable:!0,get:o(function(){return uf.container},"get")});var Ct=wt(),u$=US(),f$=WS(),d$=FS(),h$=dS(),p$=cS(),m$=Yp(),g$=Xp(),y$=CS(),_$=RS(),S$=NS(),v$=AS(),b$=zS(),w$=ev(),E$=XS(),T$=gS(),A$=_S(),x$=BS(),C$=MS(),I$=Gv(),R$=pS(),P$=nv(),O$=sv(),F$=yv(),D$=ab();function N$(n){let e=n||uf.container;e.registerSingleton(Ct.DI_TOKENS.DynamicFrontmatterGenerator,u$.DynamicFrontmatterGenerator),e.registerSingleton(Ct.DI_TOKENS.AlgorithmExtractor,f$.AlgorithmExtractor),e.isRegistered(Ct.DI_TOKENS.IVaultSettings)||e.register(Ct.DI_TOKENS.IVaultSettings,{useValue:new D$.VaultSettings}),e.registerSingleton(Ct.DI_TOKENS.EffortStatusWorkflow,m$.EffortStatusWorkflow),e.registerSingleton(Ct.DI_TOKENS.StatusTimestampService,g$.StatusTimestampService),e.registerSingleton(Ct.DI_TOKENS.TaskStatusService,p$.TaskStatusService),e.registerSingleton(Ct.DI_TOKENS.AreaCreationService,h$.AreaCreationService),e.registerSingleton(Ct.DI_TOKENS.ClassCreationService,T$.ClassCreationService),e.registerSingleton(Ct.DI_TOKENS.ConceptCreationService,A$.ConceptCreationService),e.registerSingleton(Ct.DI_TOKENS.FleetingNoteCreationService,x$.FleetingNoteCreationService),e.registerSingleton(Ct.DI_TOKENS.SupervisionCreationService,C$.SupervisionCreationService),e.registerSingleton(Ct.DI_TOKENS.GenericAssetCreationService,O$.GenericAssetCreationService),e.registerSingleton(Ct.DI_TOKENS.PropertyCleanupService,d$.PropertyCleanupService),e.registerSingleton(Ct.DI_TOKENS.FolderRepairService,y$.FolderRepairService),e.registerSingleton(Ct.DI_TOKENS.LabelToAliasService,_$.LabelToAliasService),e.registerSingleton(Ct.DI_TOKENS.RenameToUidService,S$.RenameToUidService),e.registerSingleton(Ct.DI_TOKENS.PlanningService,b$.PlanningService),e.registerSingleton(Ct.DI_TOKENS.EffortVotingService,v$.EffortVotingService),e.registerSingleton(Ct.DI_TOKENS.SessionEventService,w$.SessionEventService),e.registerSingleton(Ct.DI_TOKENS.AssetConversionService,E$.AssetConversionService),e.registerSingleton(Ct.DI_TOKENS.NoteToRDFConverter,I$.NoteToRDFConverter),e.registerSingleton(Ct.DI_TOKENS.AreaHierarchyBuilder,R$.AreaHierarchyBuilder),e.registerSingleton(Ct.DI_TOKENS.URIConstructionService,P$.URIConstructionService),e.registerSingleton(Ct.DI_TOKENS.CriticalityZoneService,F$.CriticalityZoneService)}o(N$,"registerCoreServices");function L$(){return uf.container.createChildContainer()}o(L$,"createChildContainer");function k$(){return uf.container}o(k$,"getContainer");function M$(){uf.container.reset()}o(M$,"resetContainer")});var ob=S(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.DEFAULT_COLORS=vl.NODE_FLAGS=void 0;vl.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};vl.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var lb=S(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.StringTable=void 0;var cb=class n{static{o(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}}};xm.StringTable=cb});var Wx=S(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.CompactGraphStore=void 0;var Cm=lb(),Rn=ob(),j$={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function ub(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}o(ub,"parseColor");var fb=class{static{o(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...j$,...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 Cm.StringTable,this.labelTable=new Cm.StringTable,this.typeTable=new Cm.StringTable,this.predicateTable=new Cm.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]=ub(e.color,Rn.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=Rn.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=Rn.NODE_FLAGS.PINNED),e.isArchived&&(s|=Rn.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]=ub(t.color,Rn.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|Rn.NODE_FLAGS.PINNED:i&~Rn.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|Rn.NODE_FLAGS.ARCHIVED:i&~Rn.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 a=this.edgeCount++;return this.edges.sourceIndices[a]=t,this.edges.targetIndices[a]=r,this.edges.widths[a]=e.width??1,this.edges.colors[a]=ub(e.color,Rn.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[a]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[a]=0,this.edgeIdToIndex.set(i,a),a}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(a=>a>=0).length,s=this.addEdges(e.edges).filter(a=>a>=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 a=s*2;i.x!==void 0&&(this.nodes.positions[a]=i.x),i.y!==void 0&&(this.nodes.positions[a+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,Rn.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,Rn.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~Rn.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&Rn.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}};Im.CompactGraphStore=fb});var Gx=S(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.MemoryPool=void 0;wl.getGlobalPool=B$;wl.resetGlobalPool=V$;var $$={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},Rm=class{static{o(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={...$$,...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 a=i.get(r);if(a)for(;a.length>0&&this.stats.pooledMemory>e;)a.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}};wl.MemoryPool=Rm;var bl=null;function B$(){return bl||(bl=new Rm),bl}o(B$,"getGlobalPool");function V$(){bl&&bl.clear(),bl=null}o(V$,"resetGlobalPool")});var zx=S(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.StreamingLoader=void 0;ff.createStreamingSource=q$;var U$={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},db=class{static{o(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={...U$,...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),a=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);a[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:a[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()}}};ff.StreamingLoader=db;async function*q$(n,e,t=1e3){let r=0,i=0,s;for(;;){let a=await e(n,r,t);if(a.totalCount!==void 0&&s===void 0&&(s=Math.ceil(a.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:a.nodes,edges:a.edges,isLast:!a.hasMore},!a.hasMore)break;r+=t,i++}}o(q$,"createStreamingSource")});var Yx=S(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createStreamingSource=Zt.StreamingLoader=Zt.resetGlobalPool=Zt.getGlobalPool=Zt.MemoryPool=Zt.CompactGraphStore=Zt.StringTable=Zt.DEFAULT_COLORS=Zt.NODE_FLAGS=void 0;var Hx=ob();Object.defineProperty(Zt,"NODE_FLAGS",{enumerable:!0,get:o(function(){return Hx.NODE_FLAGS},"get")});Object.defineProperty(Zt,"DEFAULT_COLORS",{enumerable:!0,get:o(function(){return Hx.DEFAULT_COLORS},"get")});var W$=lb();Object.defineProperty(Zt,"StringTable",{enumerable:!0,get:o(function(){return W$.StringTable},"get")});var G$=Wx();Object.defineProperty(Zt,"CompactGraphStore",{enumerable:!0,get:o(function(){return G$.CompactGraphStore},"get")});var hb=Gx();Object.defineProperty(Zt,"MemoryPool",{enumerable:!0,get:o(function(){return hb.MemoryPool},"get")});Object.defineProperty(Zt,"getGlobalPool",{enumerable:!0,get:o(function(){return hb.getGlobalPool},"get")});Object.defineProperty(Zt,"resetGlobalPool",{enumerable:!0,get:o(function(){return hb.resetGlobalPool},"get")});var Qx=zx();Object.defineProperty(Zt,"StreamingLoader",{enumerable:!0,get:o(function(){return Qx.StreamingLoader},"get")});Object.defineProperty(Zt,"createStreamingSource",{enumerable:!0,get:o(function(){return Qx.createStreamingSource},"get")})});var Kx=S(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ExoQLError=er.ExoQL=er.ExoQLBudgetExceededError=er.ExoQLCycleError=er.ExoQLEvalDisabledError=er.ExoQLForbiddenKeywordError=er.DEFAULT_EVAL_CONFIG=er.validateExoQLAllowlist=er.evaluateWithExoEval=void 0;var z$=Lc(),H$=Mc(),Q$=nl(),pb=qv(),Y$=je(),K$=q1();Object.defineProperty(er,"evaluateWithExoEval",{enumerable:!0,get:o(function(){return K$.evaluateWithExoEval},"get")});var X$=B1();Object.defineProperty(er,"validateExoQLAllowlist",{enumerable:!0,get:o(function(){return X$.validateExoQLAllowlist},"get")});var J$=V1();Object.defineProperty(er,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:o(function(){return J$.DEFAULT_EVAL_CONFIG},"get")});var Pm=Qu();Object.defineProperty(er,"ExoQLForbiddenKeywordError",{enumerable:!0,get:o(function(){return Pm.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(er,"ExoQLEvalDisabledError",{enumerable:!0,get:o(function(){return Pm.ExoQLEvalDisabledError},"get")});Object.defineProperty(er,"ExoQLCycleError",{enumerable:!0,get:o(function(){return Pm.ExoQLCycleError},"get")});Object.defineProperty(er,"ExoQLBudgetExceededError",{enumerable:!0,get:o(function(){return Pm.ExoQLBudgetExceededError},"get")});var mb=class n{static{o(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 df("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 df("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 a=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new pb.SourceAnnotator(t).annotate(s,a,c,l)).filter(d=>{let h=d.get(pb.SOURCE_VARIABLE);return h instanceof Y$.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new pb.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new z$.ExoQLParser,s=new H$.ExoQLAlgebraTranslator,a=i.parse(e),c=s.translate(a),l=new Q$.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};er.ExoQL=mb;var df=class extends Error{static{o(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};er.ExoQLError=df});var hf=S(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.RELATION_COLUMN_SET_CLASS_UID=Xn.RELATION_COLUMN_SET_CLASS_IRI=void 0;Xn.normalizeRef=gb;Xn.createRelationColumnSetFromFrontmatter=eB;Xn.isRelationColumnSet=tB;Xn.isRelationColumnSetFrontmatter=nB;var Xx=js();function gb(n){if(typeof n!="string")return null;let e=Xx.WikiLinkHelpers.normalize(n);return e.length>0?e:null}o(gb,"normalizeRef");function yb(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(yb,"toStringArray");function Z$(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(Z$,"basenameFromPath");function eB(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`RelationColumnSet: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`RelationColumnSet: exo__Asset_uid missing at ${r}`),null;let a=yb(n.ui__RelationColumnSet_targetClass),c=[];for(let E of a){let b=gb(E);b!==null&&c.push(b)}let l=c.length>0?c:null,u=gb(n.ui__RelationColumnSet_referencingProperty);if(l===null&&u===null)return t(`RelationColumnSet ${s}: at least one of targetClass / referencingProperty required (${r})`),null;let f=yb(n.ui__RelationColumnSet_columns),d=[];for(let E of f){let b=Xx.WikiLinkHelpers.normalize(E);b.length>0&&d.push(b)}if(d.length===0)return t(`RelationColumnSet ${s}: columns array must contain at least one entry (${r})`),null;let h=n.ui__RelationColumnSet_label,p=typeof h=="string"&&h.trim().length>0?h.trim():Z$(r),_=n.ui__RelationColumnSet_priority,v=0;if(typeof _=="number"&&Number.isFinite(_))v=_;else if(typeof _=="string"){let E=Number.parseFloat(_);Number.isFinite(E)&&(v=E)}return{uid:s,label:p,targetClasses:l,referencingProperty:u,columns:d,priority:v,sourcePath:r}}o(eB,"createRelationColumnSetFromFrontmatter");function tB(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||e.targetClasses!==null&&(!Array.isArray(e.targetClasses)||e.targetClasses.some(t=>typeof t!="string"))||e.referencingProperty!==null&&typeof e.referencingProperty!="string"||!Array.isArray(e.columns)||e.columns.length===0||e.columns.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.sourcePath!="string")}o(tB,"isRelationColumnSet");Xn.RELATION_COLUMN_SET_CLASS_IRI="ui__RelationColumnSet";Xn.RELATION_COLUMN_SET_CLASS_UID="97fc9862-c886-4d86-9a60-e0cf9d778575";function rB(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(s=>s.trim()).filter(s=>s.length>0)}o(rB,"extractClassIdentifiers");function nB(n){if(!n)return!1;let e=n.exo__Instance_class,t=yb(e);for(let r of t)for(let i of rB(r))if(i===Xn.RELATION_COLUMN_SET_CLASS_IRI||i===Xn.RELATION_COLUMN_SET_CLASS_UID)return!0;return!1}o(nB,"isRelationColumnSetFrontmatter")});var Zx=S(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.LAYOUT_CLASS_UID=Mi.LAYOUT_CLASS_IRI=void 0;Mi.createLayoutFromFrontmatter=lB;Mi.isLayout=uB;Mi.isLayoutFrontmatter=dB;var iB=js(),sB=hf();Mi.LAYOUT_CLASS_IRI="exo__Layout";Mi.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function Jx(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(Jx,"toStringArray");function aB(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(aB,"basenameFromPath");function oB(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}o(oB,"parseBoolean");function cB(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}o(cB,"parsePriority");function lB(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 a=(0,sB.normalizeRef)(n.exo__Layout_targetClass);if(a===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=Jx(n.exo__Layout_blocks),l=[];for(let p of c){let _=iB.WikiLinkHelpers.normalize(p);_.length>0&&l.push(_)}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():aB(r),d=cB(n.exo__Layout_priority),h=oB(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:a,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}o(lB,"createLayoutFromFrontmatter");function uB(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")}o(uB,"isLayout");function fB(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)}o(fB,"extractClassIdentifiers");function dB(n){if(!n)return!1;let e=Jx(n.exo__Instance_class);for(let t of e)for(let r of fB(t))if(r===Mi.LAYOUT_CLASS_IRI||r===Mi.LAYOUT_CLASS_UID)return!0;return!1}o(dB,"isLayoutFrontmatter")});var rC=S(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Bt.PROPERTIES_BLOCK_CLASS_UID=Bt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Bt.createLayoutBlockFromFrontmatter=_B;Bt.isLayoutBlockFrontmatter=SB;Bt.isPropertiesBlock=vB;Bt.isBacklinksTableBlock=bB;var hB=js(),_b=hf();Bt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Bt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function eC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(eC,"toStringArray");function pB(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(pB,"basenameFromPath");function tC(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}o(tC,"parseBoolean");function mB(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}o(mB,"parseInteger");function gB(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)}o(gB,"extractClassIdentifiers");function Om(n,e,t){let r=eC(n.exo__Instance_class);for(let i of r)for(let s of gB(i))if(s===e||s===t)return!0;return!1}o(Om,"classOf");function yB(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,a=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof a=="string"&&a.trim().length>0?a.trim():pB(e.sourcePath),l=tC(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}o(yB,"extractBase");function _B(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=yB(n,e);if(r===null)return null;if(Om(n,Bt.PROPERTIES_BLOCK_CLASS_IRI,Bt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(Om(n,Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let a=eC(n.exo__BacklinksTableBlock_columns),c=[];for(let p of a){let _=hB.WikiLinkHelpers.normalize(p);_.length>0&&c.push(_)}let l=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=mB(n.exo__BacklinksTableBlock_limit),h=tC(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}o(_B,"createLayoutBlockFromFrontmatter");function SB(n){return n?Om(n,Bt.PROPERTIES_BLOCK_CLASS_IRI,Bt.PROPERTIES_BLOCK_CLASS_UID)||Om(n,Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}o(SB,"isLayoutBlockFrontmatter");function vB(n){return n.kind==="properties"}o(vB,"isPropertiesBlock");function bB(n){return n.kind==="backlinks-table"}o(bB,"isBacklinksTableBlock")});var Fm=S(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isPropertiesBlock=ke.isLayoutBlockFrontmatter=ke.isBacklinksTableBlock=ke.createLayoutBlockFromFrontmatter=ke.PROPERTIES_BLOCK_CLASS_UID=ke.PROPERTIES_BLOCK_CLASS_IRI=ke.BACKLINKS_TABLE_BLOCK_CLASS_UID=ke.BACKLINKS_TABLE_BLOCK_CLASS_IRI=ke.isLayoutFrontmatter=ke.isLayout=ke.createLayoutFromFrontmatter=ke.LAYOUT_CLASS_UID=ke.LAYOUT_CLASS_IRI=ke.normalizeRef=ke.isRelationColumnSetFrontmatter=ke.isRelationColumnSet=ke.createRelationColumnSetFromFrontmatter=ke.RELATION_COLUMN_SET_CLASS_UID=ke.RELATION_COLUMN_SET_CLASS_IRI=void 0;var El=hf();Object.defineProperty(ke,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:o(function(){return El.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(ke,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:o(function(){return El.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(ke,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:o(function(){return El.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(ke,"isRelationColumnSet",{enumerable:!0,get:o(function(){return El.isRelationColumnSet},"get")});Object.defineProperty(ke,"isRelationColumnSetFrontmatter",{enumerable:!0,get:o(function(){return El.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(ke,"normalizeRef",{enumerable:!0,get:o(function(){return El.normalizeRef},"get")});var pf=Zx();Object.defineProperty(ke,"LAYOUT_CLASS_IRI",{enumerable:!0,get:o(function(){return pf.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(ke,"LAYOUT_CLASS_UID",{enumerable:!0,get:o(function(){return pf.LAYOUT_CLASS_UID},"get")});Object.defineProperty(ke,"createLayoutFromFrontmatter",{enumerable:!0,get:o(function(){return pf.createLayoutFromFrontmatter},"get")});Object.defineProperty(ke,"isLayout",{enumerable:!0,get:o(function(){return pf.isLayout},"get")});Object.defineProperty(ke,"isLayoutFrontmatter",{enumerable:!0,get:o(function(){return pf.isLayoutFrontmatter},"get")});var ja=rC();Object.defineProperty(ke,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return ja.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(ke,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return ja.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(ke,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return ja.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(ke,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return ja.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(ke,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:o(function(){return ja.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(ke,"isBacklinksTableBlock",{enumerable:!0,get:o(function(){return ja.isBacklinksTableBlock},"get")});Object.defineProperty(ke,"isLayoutBlockFrontmatter",{enumerable:!0,get:o(function(){return ja.isLayoutBlockFrontmatter},"get")});Object.defineProperty(ke,"isPropertiesBlock",{enumerable:!0,get:o(function(){return ja.isPropertiesBlock},"get")})});var iC=S(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.RelationColumnSetResolver=void 0;var nC=hf(),wB={warn:o(()=>{},"warn")},Sb=class{static{o(this,"RelationColumnSetResolver")}constructor(e,t={}){this.provider=e,this.logger=t.logger??wB}resolve(e,t){if(!e||e.length===0)return null;let r=t!=null?(0,nC.normalizeRef)(t):null,i=this.provider();if(i.length===0)return null;for(let s of e){let a=(0,nC.normalizeRef)(s);if(a===null)continue;if(r!==null){let l=this.filterTier1(i,a,r);if(l.length>0)return this.tiebreak(l,1)}let c=this.filterTier2(i,a);if(c.length>0)return this.tiebreak(c,2);if(r!==null){let l=this.filterTier3(i,r);if(l.length>0)return this.tiebreak(l,3)}}return null}filterTier1(e,t,r){let i=[];for(let s of e)s.targetClasses!==null&&s.referencingProperty===r&&s.targetClasses.includes(t)&&i.push(s);return i}filterTier2(e,t){let r=[];for(let i of e)i.targetClasses!==null&&i.referencingProperty===null&&i.targetClasses.includes(t)&&r.push(i);return r}filterTier3(e,t){let r=[];for(let i of e)i.targetClasses===null&&i.referencingProperty===t&&r.push(i);return r}tiebreak(e,t){let r=e.slice().sort((s,a)=>{let c=a.priority-s.priority;return c!==0?c:s.uid.localeCompare(a.uid)}),i=r[0];if(r.length>1){let s=i.priority,a=r.filter(c=>c.priority===s);if(a.length>1){let c=a.slice(1).map(l=>l.uid).join(", ");this.logger.warn(`RelationColumnSetResolver: tier=${t} priority=${s} collision \u2014 selected ${i.uid}; tied losers: ${c}`)}}return i}};Dm.RelationColumnSetResolver=Sb});var sC=S(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.RelationColumnSetResolver=void 0;var EB=iC();Object.defineProperty(Nm,"RelationColumnSetResolver",{enumerable:!0,get:o(function(){return EB.RelationColumnSetResolver},"get")})});var oC=S(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.LayoutSelector=void 0;mf.selectByPriority=aC;var TB=js(),vb=class{static{o(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=TB.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(a=>a.targetClass===i);if(s.length!==0)return aC(s)}return null}};mf.LayoutSelector=vb;function aC(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]}o(aC,"selectByPriority")});var ms=S(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.ErrorCode=void 0;var cC;(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"})(cC||(Lm.ErrorCode=cC={}))});var gs=S(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.ApplicationError=void 0;var bb=class extends Error{static{o(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+=`
413
+ `)?`"${e.replace(/"/g,'""')}"`:e}};Am.ResultSerializer=rb});var Ux=S(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.FileAlreadyExistsError=Sl.FileNotFoundError=void 0;var nb=class extends Error{static{o(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};Sl.FileNotFoundError=nb;var ib=class extends Error{static{o(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};Sl.FileAlreadyExistsError=ib});var ab=S(yr=>{"use strict";var o$=yr&&yr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},c$=yr&&yr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(yr,"__esModule",{value:!0});yr.VaultSettings=yr.DEFAULT_FLEETING_NOTE_CLASS_UID=yr.DEFAULT_INBOX_FOLDER=yr.DEFAULT_OWNER_IDENTITY=void 0;var l$=le();yr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';yr.DEFAULT_INBOX_FOLDER="01 Inbox";yr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var sb=class{static{o(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??yr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??yr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??yr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};yr.VaultSettings=sb;yr.VaultSettings=sb=o$([(0,l$.injectable)(),c$("design:paramtypes",[Object])],sb)});var qx=S(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.container=void 0;Ma.registerCoreServices=N$;Ma.createChildContainer=L$;Ma.getContainer=k$;Ma.resetContainer=M$;Vd();var uf=le();Object.defineProperty(Ma,"container",{enumerable:!0,get:o(function(){return uf.container},"get")});var Ct=wt(),u$=US(),f$=WS(),d$=FS(),h$=dS(),p$=cS(),m$=Yp(),g$=Xp(),y$=CS(),_$=RS(),S$=NS(),v$=AS(),b$=zS(),w$=ev(),E$=XS(),T$=gS(),A$=_S(),x$=BS(),C$=MS(),I$=Gv(),R$=pS(),P$=nv(),O$=sv(),F$=yv(),D$=ab();function N$(n){let e=n||uf.container;e.registerSingleton(Ct.DI_TOKENS.DynamicFrontmatterGenerator,u$.DynamicFrontmatterGenerator),e.registerSingleton(Ct.DI_TOKENS.AlgorithmExtractor,f$.AlgorithmExtractor),e.isRegistered(Ct.DI_TOKENS.IVaultSettings)||e.register(Ct.DI_TOKENS.IVaultSettings,{useValue:new D$.VaultSettings}),e.registerSingleton(Ct.DI_TOKENS.EffortStatusWorkflow,m$.EffortStatusWorkflow),e.registerSingleton(Ct.DI_TOKENS.StatusTimestampService,g$.StatusTimestampService),e.registerSingleton(Ct.DI_TOKENS.TaskStatusService,p$.TaskStatusService),e.registerSingleton(Ct.DI_TOKENS.AreaCreationService,h$.AreaCreationService),e.registerSingleton(Ct.DI_TOKENS.ClassCreationService,T$.ClassCreationService),e.registerSingleton(Ct.DI_TOKENS.ConceptCreationService,A$.ConceptCreationService),e.registerSingleton(Ct.DI_TOKENS.FleetingNoteCreationService,x$.FleetingNoteCreationService),e.registerSingleton(Ct.DI_TOKENS.SupervisionCreationService,C$.SupervisionCreationService),e.registerSingleton(Ct.DI_TOKENS.GenericAssetCreationService,O$.GenericAssetCreationService),e.registerSingleton(Ct.DI_TOKENS.PropertyCleanupService,d$.PropertyCleanupService),e.registerSingleton(Ct.DI_TOKENS.FolderRepairService,y$.FolderRepairService),e.registerSingleton(Ct.DI_TOKENS.LabelToAliasService,_$.LabelToAliasService),e.registerSingleton(Ct.DI_TOKENS.RenameToUidService,S$.RenameToUidService),e.registerSingleton(Ct.DI_TOKENS.PlanningService,b$.PlanningService),e.registerSingleton(Ct.DI_TOKENS.EffortVotingService,v$.EffortVotingService),e.registerSingleton(Ct.DI_TOKENS.SessionEventService,w$.SessionEventService),e.registerSingleton(Ct.DI_TOKENS.AssetConversionService,E$.AssetConversionService),e.registerSingleton(Ct.DI_TOKENS.NoteToRDFConverter,I$.NoteToRDFConverter),e.registerSingleton(Ct.DI_TOKENS.AreaHierarchyBuilder,R$.AreaHierarchyBuilder),e.registerSingleton(Ct.DI_TOKENS.URIConstructionService,P$.URIConstructionService),e.registerSingleton(Ct.DI_TOKENS.CriticalityZoneService,F$.CriticalityZoneService)}o(N$,"registerCoreServices");function L$(){return uf.container.createChildContainer()}o(L$,"createChildContainer");function k$(){return uf.container}o(k$,"getContainer");function M$(){uf.container.reset()}o(M$,"resetContainer")});var ob=S(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.DEFAULT_COLORS=vl.NODE_FLAGS=void 0;vl.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};vl.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var lb=S(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.StringTable=void 0;var cb=class n{static{o(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}}};xm.StringTable=cb});var Wx=S(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.CompactGraphStore=void 0;var Cm=lb(),Rn=ob(),j$={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function ub(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}o(ub,"parseColor");var fb=class{static{o(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...j$,...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 Cm.StringTable,this.labelTable=new Cm.StringTable,this.typeTable=new Cm.StringTable,this.predicateTable=new Cm.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]=ub(e.color,Rn.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=Rn.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=Rn.NODE_FLAGS.PINNED),e.isArchived&&(s|=Rn.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]=ub(t.color,Rn.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|Rn.NODE_FLAGS.PINNED:i&~Rn.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|Rn.NODE_FLAGS.ARCHIVED:i&~Rn.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 a=this.edgeCount++;return this.edges.sourceIndices[a]=t,this.edges.targetIndices[a]=r,this.edges.widths[a]=e.width??1,this.edges.colors[a]=ub(e.color,Rn.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[a]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[a]=0,this.edgeIdToIndex.set(i,a),a}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(a=>a>=0).length,s=this.addEdges(e.edges).filter(a=>a>=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 a=s*2;i.x!==void 0&&(this.nodes.positions[a]=i.x),i.y!==void 0&&(this.nodes.positions[a+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,Rn.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,Rn.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~Rn.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&Rn.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}};Im.CompactGraphStore=fb});var Gx=S(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.MemoryPool=void 0;wl.getGlobalPool=B$;wl.resetGlobalPool=V$;var $$={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},Rm=class{static{o(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={...$$,...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 a=i.get(r);if(a)for(;a.length>0&&this.stats.pooledMemory>e;)a.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}};wl.MemoryPool=Rm;var bl=null;function B$(){return bl||(bl=new Rm),bl}o(B$,"getGlobalPool");function V$(){bl&&bl.clear(),bl=null}o(V$,"resetGlobalPool")});var zx=S(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.StreamingLoader=void 0;ff.createStreamingSource=q$;var U$={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},db=class{static{o(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={...U$,...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),a=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);a[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:a[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()}}};ff.StreamingLoader=db;async function*q$(n,e,t=1e3){let r=0,i=0,s;for(;;){let a=await e(n,r,t);if(a.totalCount!==void 0&&s===void 0&&(s=Math.ceil(a.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:a.nodes,edges:a.edges,isLast:!a.hasMore},!a.hasMore)break;r+=t,i++}}o(q$,"createStreamingSource")});var Yx=S(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createStreamingSource=Zt.StreamingLoader=Zt.resetGlobalPool=Zt.getGlobalPool=Zt.MemoryPool=Zt.CompactGraphStore=Zt.StringTable=Zt.DEFAULT_COLORS=Zt.NODE_FLAGS=void 0;var Hx=ob();Object.defineProperty(Zt,"NODE_FLAGS",{enumerable:!0,get:o(function(){return Hx.NODE_FLAGS},"get")});Object.defineProperty(Zt,"DEFAULT_COLORS",{enumerable:!0,get:o(function(){return Hx.DEFAULT_COLORS},"get")});var W$=lb();Object.defineProperty(Zt,"StringTable",{enumerable:!0,get:o(function(){return W$.StringTable},"get")});var G$=Wx();Object.defineProperty(Zt,"CompactGraphStore",{enumerable:!0,get:o(function(){return G$.CompactGraphStore},"get")});var hb=Gx();Object.defineProperty(Zt,"MemoryPool",{enumerable:!0,get:o(function(){return hb.MemoryPool},"get")});Object.defineProperty(Zt,"getGlobalPool",{enumerable:!0,get:o(function(){return hb.getGlobalPool},"get")});Object.defineProperty(Zt,"resetGlobalPool",{enumerable:!0,get:o(function(){return hb.resetGlobalPool},"get")});var Qx=zx();Object.defineProperty(Zt,"StreamingLoader",{enumerable:!0,get:o(function(){return Qx.StreamingLoader},"get")});Object.defineProperty(Zt,"createStreamingSource",{enumerable:!0,get:o(function(){return Qx.createStreamingSource},"get")})});var Kx=S(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ExoQLError=er.ExoQL=er.ExoQLBudgetExceededError=er.ExoQLCycleError=er.ExoQLEvalDisabledError=er.ExoQLForbiddenKeywordError=er.DEFAULT_EVAL_CONFIG=er.validateExoQLAllowlist=er.evaluateWithExoEval=void 0;var z$=Lc(),H$=Mc(),Q$=nl(),pb=qv(),Y$=je(),K$=q1();Object.defineProperty(er,"evaluateWithExoEval",{enumerable:!0,get:o(function(){return K$.evaluateWithExoEval},"get")});var X$=B1();Object.defineProperty(er,"validateExoQLAllowlist",{enumerable:!0,get:o(function(){return X$.validateExoQLAllowlist},"get")});var J$=V1();Object.defineProperty(er,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:o(function(){return J$.DEFAULT_EVAL_CONFIG},"get")});var Pm=Qu();Object.defineProperty(er,"ExoQLForbiddenKeywordError",{enumerable:!0,get:o(function(){return Pm.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(er,"ExoQLEvalDisabledError",{enumerable:!0,get:o(function(){return Pm.ExoQLEvalDisabledError},"get")});Object.defineProperty(er,"ExoQLCycleError",{enumerable:!0,get:o(function(){return Pm.ExoQLCycleError},"get")});Object.defineProperty(er,"ExoQLBudgetExceededError",{enumerable:!0,get:o(function(){return Pm.ExoQLBudgetExceededError},"get")});var mb=class n{static{o(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 df("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 df("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 a=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new pb.SourceAnnotator(t).annotate(s,a,c,l)).filter(d=>{let h=d.get(pb.SOURCE_VARIABLE);return h instanceof Y$.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new pb.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new z$.ExoQLParser,s=new H$.ExoQLAlgebraTranslator,a=i.parse(e),c=s.translate(a),l=new Q$.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};er.ExoQL=mb;var df=class extends Error{static{o(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};er.ExoQLError=df});var hf=S(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.RELATION_COLUMN_SET_CLASS_UID=Xn.RELATION_COLUMN_SET_CLASS_IRI=void 0;Xn.normalizeRef=gb;Xn.createRelationColumnSetFromFrontmatter=eB;Xn.isRelationColumnSet=tB;Xn.isRelationColumnSetFrontmatter=nB;var Xx=js();function gb(n){if(typeof n!="string")return null;let e=Xx.WikiLinkHelpers.normalize(n);return e.length>0?e:null}o(gb,"normalizeRef");function yb(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(yb,"toStringArray");function Z$(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(Z$,"basenameFromPath");function eB(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`RelationColumnSet: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`RelationColumnSet: exo__Asset_uid missing at ${r}`),null;let a=yb(n.ui__RelationColumnSet_targetClass),c=[];for(let E of a){let b=gb(E);b!==null&&c.push(b)}let l=c.length>0?c:null,u=gb(n.ui__RelationColumnSet_referencingProperty);if(l===null&&u===null)return t(`RelationColumnSet ${s}: at least one of targetClass / referencingProperty required (${r})`),null;let f=yb(n.ui__RelationColumnSet_columns),d=[];for(let E of f){let b=Xx.WikiLinkHelpers.normalize(E);b.length>0&&d.push(b)}if(d.length===0)return t(`RelationColumnSet ${s}: columns array must contain at least one entry (${r})`),null;let h=n.ui__RelationColumnSet_label,p=typeof h=="string"&&h.trim().length>0?h.trim():Z$(r),_=n.ui__RelationColumnSet_priority,v=0;if(typeof _=="number"&&Number.isFinite(_))v=_;else if(typeof _=="string"){let E=Number.parseFloat(_);Number.isFinite(E)&&(v=E)}return{uid:s,label:p,targetClasses:l,referencingProperty:u,columns:d,priority:v,sourcePath:r}}o(eB,"createRelationColumnSetFromFrontmatter");function tB(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||e.targetClasses!==null&&(!Array.isArray(e.targetClasses)||e.targetClasses.some(t=>typeof t!="string"))||e.referencingProperty!==null&&typeof e.referencingProperty!="string"||!Array.isArray(e.columns)||e.columns.length===0||e.columns.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.sourcePath!="string")}o(tB,"isRelationColumnSet");Xn.RELATION_COLUMN_SET_CLASS_IRI="ui__RelationColumnSet";Xn.RELATION_COLUMN_SET_CLASS_UID="97fc9862-c886-4d86-9a60-e0cf9d778575";function rB(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(s=>s.trim()).filter(s=>s.length>0)}o(rB,"extractClassIdentifiers");function nB(n){if(!n)return!1;let e=n.exo__Instance_class,t=yb(e);for(let r of t)for(let i of rB(r))if(i===Xn.RELATION_COLUMN_SET_CLASS_IRI||i===Xn.RELATION_COLUMN_SET_CLASS_UID)return!0;return!1}o(nB,"isRelationColumnSetFrontmatter")});var Zx=S(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.LAYOUT_CLASS_UID=Mi.LAYOUT_CLASS_IRI=void 0;Mi.createLayoutFromFrontmatter=lB;Mi.isLayout=uB;Mi.isLayoutFrontmatter=dB;var iB=js(),sB=hf();Mi.LAYOUT_CLASS_IRI="exo__Layout";Mi.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function Jx(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(Jx,"toStringArray");function aB(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(aB,"basenameFromPath");function oB(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}o(oB,"parseBoolean");function cB(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}o(cB,"parsePriority");function lB(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 a=(0,sB.normalizeRef)(n.exo__Layout_targetClass);if(a===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=Jx(n.exo__Layout_blocks),l=[];for(let p of c){let _=iB.WikiLinkHelpers.normalize(p);_.length>0&&l.push(_)}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():aB(r),d=cB(n.exo__Layout_priority),h=oB(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:a,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}o(lB,"createLayoutFromFrontmatter");function uB(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")}o(uB,"isLayout");function fB(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)}o(fB,"extractClassIdentifiers");function dB(n){if(!n)return!1;let e=Jx(n.exo__Instance_class);for(let t of e)for(let r of fB(t))if(r===Mi.LAYOUT_CLASS_IRI||r===Mi.LAYOUT_CLASS_UID)return!0;return!1}o(dB,"isLayoutFrontmatter")});var rC=S(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Bt.PROPERTIES_BLOCK_CLASS_UID=Bt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Bt.createLayoutBlockFromFrontmatter=_B;Bt.isLayoutBlockFrontmatter=SB;Bt.isPropertiesBlock=vB;Bt.isBacklinksTableBlock=bB;var hB=js(),_b=hf();Bt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Bt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function eC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}o(eC,"toStringArray");function pB(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}o(pB,"basenameFromPath");function tC(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}o(tC,"parseBoolean");function mB(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}o(mB,"parseInteger");function gB(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)}o(gB,"extractClassIdentifiers");function Om(n,e,t){let r=eC(n.exo__Instance_class);for(let i of r)for(let s of gB(i))if(s===e||s===t)return!0;return!1}o(Om,"classOf");function yB(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,a=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof a=="string"&&a.trim().length>0?a.trim():pB(e.sourcePath),l=tC(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}o(yB,"extractBase");function _B(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=yB(n,e);if(r===null)return null;if(Om(n,Bt.PROPERTIES_BLOCK_CLASS_IRI,Bt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(Om(n,Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let a=eC(n.exo__BacklinksTableBlock_columns),c=[];for(let p of a){let _=hB.WikiLinkHelpers.normalize(p);_.length>0&&c.push(_)}let l=(0,_b.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=mB(n.exo__BacklinksTableBlock_limit),h=tC(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}o(_B,"createLayoutBlockFromFrontmatter");function SB(n){return n?Om(n,Bt.PROPERTIES_BLOCK_CLASS_IRI,Bt.PROPERTIES_BLOCK_CLASS_UID)||Om(n,Bt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Bt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}o(SB,"isLayoutBlockFrontmatter");function vB(n){return n.kind==="properties"}o(vB,"isPropertiesBlock");function bB(n){return n.kind==="backlinks-table"}o(bB,"isBacklinksTableBlock")});var Fm=S(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isPropertiesBlock=ke.isLayoutBlockFrontmatter=ke.isBacklinksTableBlock=ke.createLayoutBlockFromFrontmatter=ke.PROPERTIES_BLOCK_CLASS_UID=ke.PROPERTIES_BLOCK_CLASS_IRI=ke.BACKLINKS_TABLE_BLOCK_CLASS_UID=ke.BACKLINKS_TABLE_BLOCK_CLASS_IRI=ke.isLayoutFrontmatter=ke.isLayout=ke.createLayoutFromFrontmatter=ke.LAYOUT_CLASS_UID=ke.LAYOUT_CLASS_IRI=ke.normalizeRef=ke.isRelationColumnSetFrontmatter=ke.isRelationColumnSet=ke.createRelationColumnSetFromFrontmatter=ke.RELATION_COLUMN_SET_CLASS_UID=ke.RELATION_COLUMN_SET_CLASS_IRI=void 0;var El=hf();Object.defineProperty(ke,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:o(function(){return El.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(ke,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:o(function(){return El.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(ke,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:o(function(){return El.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(ke,"isRelationColumnSet",{enumerable:!0,get:o(function(){return El.isRelationColumnSet},"get")});Object.defineProperty(ke,"isRelationColumnSetFrontmatter",{enumerable:!0,get:o(function(){return El.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(ke,"normalizeRef",{enumerable:!0,get:o(function(){return El.normalizeRef},"get")});var pf=Zx();Object.defineProperty(ke,"LAYOUT_CLASS_IRI",{enumerable:!0,get:o(function(){return pf.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(ke,"LAYOUT_CLASS_UID",{enumerable:!0,get:o(function(){return pf.LAYOUT_CLASS_UID},"get")});Object.defineProperty(ke,"createLayoutFromFrontmatter",{enumerable:!0,get:o(function(){return pf.createLayoutFromFrontmatter},"get")});Object.defineProperty(ke,"isLayout",{enumerable:!0,get:o(function(){return pf.isLayout},"get")});Object.defineProperty(ke,"isLayoutFrontmatter",{enumerable:!0,get:o(function(){return pf.isLayoutFrontmatter},"get")});var ja=rC();Object.defineProperty(ke,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return ja.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(ke,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return ja.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(ke,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return ja.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(ke,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return ja.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(ke,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:o(function(){return ja.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(ke,"isBacklinksTableBlock",{enumerable:!0,get:o(function(){return ja.isBacklinksTableBlock},"get")});Object.defineProperty(ke,"isLayoutBlockFrontmatter",{enumerable:!0,get:o(function(){return ja.isLayoutBlockFrontmatter},"get")});Object.defineProperty(ke,"isPropertiesBlock",{enumerable:!0,get:o(function(){return ja.isPropertiesBlock},"get")})});var iC=S(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.RelationColumnSetResolver=void 0;var nC=hf(),wB={warn:o(()=>{},"warn")},Sb=class{static{o(this,"RelationColumnSetResolver")}constructor(e,t={}){this.provider=e,this.logger=t.logger??wB}resolve(e,t){if(!e||e.length===0)return null;let r=t!=null?(0,nC.normalizeRef)(t):null,i=this.provider();if(i.length===0)return null;for(let s of e){let a=(0,nC.normalizeRef)(s);if(a===null)continue;if(r!==null){let l=this.filterTier1(i,a,r);if(l.length>0)return this.tiebreak(l,1)}let c=this.filterTier2(i,a);if(c.length>0)return this.tiebreak(c,2);if(r!==null){let l=this.filterTier3(i,r);if(l.length>0)return this.tiebreak(l,3)}}return null}filterTier1(e,t,r){let i=[];for(let s of e)s.targetClasses!==null&&s.referencingProperty===r&&s.targetClasses.includes(t)&&i.push(s);return i}filterTier2(e,t){let r=[];for(let i of e)i.targetClasses!==null&&i.referencingProperty===null&&i.targetClasses.includes(t)&&r.push(i);return r}filterTier3(e,t){let r=[];for(let i of e)i.targetClasses===null&&i.referencingProperty===t&&r.push(i);return r}tiebreak(e,t){let r=e.slice().sort((s,a)=>{let c=a.priority-s.priority;return c!==0?c:s.uid.localeCompare(a.uid)}),i=r[0];if(r.length>1){let s=i.priority,a=r.filter(c=>c.priority===s);if(a.length>1){let c=a.slice(1).map(l=>l.uid).join(", ");this.logger.warn(`RelationColumnSetResolver: tier=${t} priority=${s} collision \u2014 selected ${i.uid}; tied losers: ${c}`)}}return i}};Dm.RelationColumnSetResolver=Sb});var sC=S(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.RelationColumnSetResolver=void 0;var EB=iC();Object.defineProperty(Nm,"RelationColumnSetResolver",{enumerable:!0,get:o(function(){return EB.RelationColumnSetResolver},"get")})});var oC=S(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.LayoutSelector=void 0;mf.selectByPriority=aC;var TB=js(),vb=class{static{o(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=TB.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(a=>a.targetClass===i);if(s.length!==0)return aC(s)}return null}};mf.LayoutSelector=vb;function aC(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]}o(aC,"selectByPriority")});var ms=S(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.ErrorCode=void 0;var cC;(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"})(cC||(Lm.ErrorCode=cC={}))});var gs=S(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.ApplicationError=void 0;var bb=class extends Error{static{o(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+=`
414
414
 
415
415
  \u{1F4A1} ${this.guidance}`),this.context&&Object.keys(this.context).length>0){e+=`
416
416
 
@@ -452,32 +452,32 @@ To resolve:
452
452
  \u2022 Verify all required dependencies are available
453
453
  \u2022 Review service logs for detailed error information
454
454
  \u2022 Contact support if the issue persists`}};qm.ServiceError=Ib});var gC=S(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.ServiceError=tr.ResourceExhaustedError=tr.NotFoundError=tr.PermissionError=tr.StateTransitionError=tr.NetworkError=tr.ValidationError=tr.ApplicationError=tr.ErrorCode=void 0;var $B=ms();Object.defineProperty(tr,"ErrorCode",{enumerable:!0,get:o(function(){return $B.ErrorCode},"get")});var BB=gs();Object.defineProperty(tr,"ApplicationError",{enumerable:!0,get:o(function(){return BB.ApplicationError},"get")});var VB=lC();Object.defineProperty(tr,"ValidationError",{enumerable:!0,get:o(function(){return VB.ValidationError},"get")});var UB=uC();Object.defineProperty(tr,"NetworkError",{enumerable:!0,get:o(function(){return UB.NetworkError},"get")});var qB=fC();Object.defineProperty(tr,"StateTransitionError",{enumerable:!0,get:o(function(){return qB.StateTransitionError},"get")});var WB=dC();Object.defineProperty(tr,"PermissionError",{enumerable:!0,get:o(function(){return WB.PermissionError},"get")});var GB=hC();Object.defineProperty(tr,"NotFoundError",{enumerable:!0,get:o(function(){return GB.NotFoundError},"get")});var zB=pC();Object.defineProperty(tr,"ResourceExhaustedError",{enumerable:!0,get:o(function(){return zB.ResourceExhaustedError},"get")});var HB=mC();Object.defineProperty(tr,"ServiceError",{enumerable:!0,get:o(function(){return HB.ServiceError},"get")})});var yC=S(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.ApplicationErrorHandler=void 0;var Rb=gs(),QB=ms(),YB=Fa(),Pb=class{static{o(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let a=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,a),this.logger?.debug(`Retrying after ${a}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(a),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof Rb.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends Rb.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 Rb.ApplicationError{static{o(this,"UnknownError")}constructor(s,a){super(s,{originalError:a.name,...t}),this.code=QB.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(`
455
- `)}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){YB.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};Wm.ApplicationErrorHandler=Pb});var _C=S(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.ApplicationErrorHandler=void 0;var KB=yC();Object.defineProperty(Gm,"ApplicationErrorHandler",{enumerable:!0,get:o(function(){return KB.ApplicationErrorHandler},"get")})});var Vt=S(m=>{"use strict";var XB=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:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Jn=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&XB(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.LabelToAliasService=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.ServiceRegistry=m.GroundingExecutor=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=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.GroundingType=m.getEffortStatusLabel=m.isTrashedStatus=m.isDoneStatus=m.normalizeEffortStatus=m.EFFORT_STATUS_OPTIONS=m.STATUS_NAME_TO_WIKILINK=m.STATUS_NAME_TO_ENUM=m.EFFORT_STATUS_CONFIG=void 0;m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=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.DailyReviewService=m.DEFAULT_AUTOCOMPLETE_CONFIG=m.AutocompleteService=m.TrendDetectionService=m.AnalyticsService=m.getTemplateByName=m.validateParameters=m.fillTemplate=m.findMatchingTemplates=m.findClassByTerm=m.KNOWN_CLASSES=m.KNOWN_PROTOTYPES=m.EFFORT_STATUSES=m.ASSET_CLASSES=m.PREDICATES=m.SPARQL_PREFIXES=m.SPARQL_TEMPLATES=m.DEFAULT_NL_TO_SPARQL_CONFIG=m.NLToSPARQLService=m.TypeRegistry=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.DynamicFrontmatterGenerator=m.FleetingNoteCreationService=m.SupervisionCreationService=m.StatusTimestampService=void 0;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=m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=void 0;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.RelationColumnSetResolver=m.normalizeRelationColumnSetRef=m.isRelationColumnSetFrontmatter=m.isRelationColumnSet=m.createRelationColumnSetFromFrontmatter=m.RELATION_COLUMN_SET_CLASS_UID=m.RELATION_COLUMN_SET_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=m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=void 0;m.selectByPriority=void 0;Jn(Tu(),m);Jn(_c(),m);var $a=Xy();Object.defineProperty(m,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:o(function(){return $a.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(m,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:o(function(){return $a.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(m,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:o(function(){return $a.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:o(function(){return $a.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(m,"normalizeEffortStatus",{enumerable:!0,get:o(function(){return $a.normalizeEffortStatus},"get")});Object.defineProperty(m,"isDoneStatus",{enumerable:!0,get:o(function(){return $a.isDoneStatus},"get")});Object.defineProperty(m,"isTrashedStatus",{enumerable:!0,get:o(function(){return $a.isTrashedStatus},"get")});Object.defineProperty(m,"getEffortStatusLabel",{enumerable:!0,get:o(function(){return $a.getEffortStatusLabel},"get")});var JB=Sc();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:o(function(){return JB.GroundingType},"get")});var gf=Jy();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:o(function(){return gf.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:o(function(){return gf.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:o(function(){return gf.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:o(function(){return gf.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:o(function(){return gf.CommandBindingStyleProperty},"get")});var Tl=Zy();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:o(function(){return Tl.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:o(function(){return Tl.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:o(function(){return Tl.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:o(function(){return Tl.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:o(function(){return Tl.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:o(function(){return Tl.isStyleSource},"get")});var zm=N2();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:o(function(){return zm.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:o(function(){return zm.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:o(function(){return zm.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:o(function(){return zm.isCommandBindingFrontmatter},"get")});Jn(L2(),m);Jn(k2(),m);Jn(e0(),m);Jn(t0(),m);Jn(j2(),m);Jn(V2(),m);Jn(k0(),m);Jn(RT(),m);var SC=yh();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:o(function(){return SC.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:o(function(){return SC.rangeToFieldType},"get")});var Ob=B0();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:o(function(){return Ob.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:o(function(){return Ob.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:o(function(){return Ob.extractPropertyLabel},"get")});var ZB=i3();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:o(function(){return ZB.CommandResolver},"get")});var eV=a3();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:o(function(){return eV.PreconditionEvaluator},"get")});var vC=c3();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:o(function(){return vC.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:o(function(){return vC.ServiceRegistry},"get")});var tV=cS();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:o(function(){return tV.TaskStatusService},"get")});var rV=dS();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:o(function(){return rV.AreaCreationService},"get")});var nV=pS();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:o(function(){return nV.AreaHierarchyBuilder},"get")});var iV=gS();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:o(function(){return iV.ClassCreationService},"get")});var sV=_S();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:o(function(){return sV.ConceptCreationService},"get")});var aV=Yp();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:o(function(){return aV.EffortStatusWorkflow},"get")});var oV=ef();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:o(function(){return oV.WorkflowEngine},"get")});var cV=K1();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:o(function(){return cV.WorkflowResolver},"get")});var lV=w3();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:o(function(){return lV.InstantiationRuleResolver},"get")});var uV=E3();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:o(function(){return uV.VisibilityGenerator},"get")});var fV=T3();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:o(function(){return fV.WorkflowCommandAdapter},"get")});var dV=AS();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:o(function(){return dV.EffortVotingService},"get")});var hV=CS();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:o(function(){return hV.FolderRepairService},"get")});var pV=RS();Object.defineProperty(m,"LabelToAliasService",{enumerable:!0,get:o(function(){return pV.LabelToAliasService},"get")});var mV=Fa();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:o(function(){return mV.LoggingService},"get")});var gV=FS();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:o(function(){return gV.PropertyCleanupService},"get")});var yV=NS();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:o(function(){return yV.RenameToUidService},"get")});var _V=Xp();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:o(function(){return _V.StatusTimestampService},"get")});var SV=MS();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:o(function(){return SV.SupervisionCreationService},"get")});var vV=BS();Object.defineProperty(m,"FleetingNoteCreationService",{enumerable:!0,get:o(function(){return vV.FleetingNoteCreationService},"get")});var bV=US();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:o(function(){return bV.DynamicFrontmatterGenerator},"get")});var wV=WS();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:o(function(){return wV.AlgorithmExtractor},"get")});var EV=zS();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:o(function(){return EV.PlanningService},"get")});var TV=M3();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:o(function(){return TV.PropertySchemaResolver},"get")});var AV=j3();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:o(function(){return AV.ClassHierarchyResolver},"get")});var xV=$3();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:o(function(){return xV.EnumValueResolver},"get")});var CV=XS();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:o(function(){return CV.AssetConversionService},"get")});var IV=ev();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:o(function(){return IV.SessionEventService},"get")});var RV=nv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:o(function(){return RV.URIConstructionService},"get")});var PV=sv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:o(function(){return PV.GenericAssetCreationService},"get")});var OV=Y3();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:o(function(){return OV.ArchiveAssetService},"get")});var FV=X3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:o(function(){return FV.FixMissingLabelService},"get")});var DV=J3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:o(function(){return DV.GraphQueryService},"get")});var NV=ex();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:o(function(){return NV.TypeRegistry},"get")});var bC=tx();Object.defineProperty(m,"NLToSPARQLService",{enumerable:!0,get:o(function(){return bC.NLToSPARQLService},"get")});Object.defineProperty(m,"DEFAULT_NL_TO_SPARQL_CONFIG",{enumerable:!0,get:o(function(){return bC.DEFAULT_NL_TO_SPARQL_CONFIG},"get")});var Zn=uv();Object.defineProperty(m,"SPARQL_TEMPLATES",{enumerable:!0,get:o(function(){return Zn.SPARQL_TEMPLATES},"get")});Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:o(function(){return Zn.SPARQL_PREFIXES},"get")});Object.defineProperty(m,"PREDICATES",{enumerable:!0,get:o(function(){return Zn.PREDICATES},"get")});Object.defineProperty(m,"ASSET_CLASSES",{enumerable:!0,get:o(function(){return Zn.ASSET_CLASSES},"get")});Object.defineProperty(m,"EFFORT_STATUSES",{enumerable:!0,get:o(function(){return Zn.EFFORT_STATUSES},"get")});Object.defineProperty(m,"KNOWN_PROTOTYPES",{enumerable:!0,get:o(function(){return Zn.KNOWN_PROTOTYPES},"get")});Object.defineProperty(m,"KNOWN_CLASSES",{enumerable:!0,get:o(function(){return Zn.KNOWN_CLASSES},"get")});Object.defineProperty(m,"findClassByTerm",{enumerable:!0,get:o(function(){return Zn.findClassByTerm},"get")});Object.defineProperty(m,"findMatchingTemplates",{enumerable:!0,get:o(function(){return Zn.findMatchingTemplates},"get")});Object.defineProperty(m,"fillTemplate",{enumerable:!0,get:o(function(){return Zn.fillTemplate},"get")});Object.defineProperty(m,"validateParameters",{enumerable:!0,get:o(function(){return Zn.validateParameters},"get")});Object.defineProperty(m,"getTemplateByName",{enumerable:!0,get:o(function(){return Zn.getTemplateByName},"get")});var LV=nx();Object.defineProperty(m,"AnalyticsService",{enumerable:!0,get:o(function(){return LV.AnalyticsService},"get")});var kV=ix();Object.defineProperty(m,"TrendDetectionService",{enumerable:!0,get:o(function(){return kV.TrendDetectionService},"get")});var wC=ax();Object.defineProperty(m,"AutocompleteService",{enumerable:!0,get:o(function(){return wC.AutocompleteService},"get")});Object.defineProperty(m,"DEFAULT_AUTOCOMPLETE_CONFIG",{enumerable:!0,get:o(function(){return wC.DEFAULT_AUTOCOMPLETE_CONFIG},"get")});var MV=cx();Object.defineProperty(m,"DailyReviewService",{enumerable:!0,get:o(function(){return MV.DailyReviewService},"get")});var EC=yv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:o(function(){return EC.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:o(function(){return EC.CriticalityZoneUUIDs},"get")});var jV=Qn();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:o(function(){return jV.FrontmatterService},"get")});var $V=Gr();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:o(function(){return $V.DateFormatter},"get")});var BV=js();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:o(function(){return BV.WikiLinkHelpers},"get")});var VV=us();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:o(function(){return VV.MetadataHelpers},"get")});var UV=uS();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:o(function(){return UV.MetadataExtractor},"get")});var qV=ux();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:o(function(){return qV.EffortSortingHelpers},"get")});var WV=fx();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:o(function(){return WV.FilenameValidator},"get")});var GV=_x();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:o(function(){return GV.RDFSerializer},"get")});var zV=Ac();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:o(function(){return zV.NullLogger},"get")});var TC=Rv();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:o(function(){return TC.vaultPathToIRI},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:o(function(){return TC.OBSIDIAN_VAULT_SCHEME},"get")});var HV=iS();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:o(function(){return HV.InMemoryTripleStore},"get")});var QV=Ov();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:o(function(){return QV.RDFVocabularyMapper},"get")});var YV=vx();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:o(function(){return YV.RDFSInferenceEngine},"get")});var KV=Lv();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:o(function(){return KV.NonInheritablePropertyRegistry},"get")});var XV=jv();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:o(function(){return XV.PropertyCardinalityRegistry},"get")});var AC=Vv();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:o(function(){return AC.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:o(function(){return AC.INFERRED_GRAPH},"get")});var xC=qv();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:o(function(){return xC.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:o(function(){return xC.SOURCE_VARIABLE},"get")});var JV=Gv();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:o(function(){return JV.NoteToRDFConverter},"get")});var Fb=Lc();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:o(function(){return Fb.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:o(function(){return Fb.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:o(function(){return Fb.SPARQLParseError},"get")});var CC=j_();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:o(function(){return CC.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:o(function(){return CC.DescribeOptionsTransformerError},"get")});var IC=Mc();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:o(function(){return IC.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:o(function(){return IC.AlgebraTranslator},"get")});var ZV=Px();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:o(function(){return ZV.AlgebraOptimizer},"get")});var eU=Ox();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:o(function(){return eU.AlgebraSerializer},"get")});var tU=r1();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:o(function(){return tU.BGPExecutor},"get")});var rU=Ap();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:o(function(){return rU.FilterExecutor},"get")});var nU=v1();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:o(function(){return nU.OptionalExecutor},"get")});var iU=w1();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:o(function(){return iU.UnionExecutor},"get")});var sU=F1();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:o(function(){return sU.ConstructExecutor},"get")});var aU=Dx();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:o(function(){return aU.DescribeExecutor},"get")});var RC=nl();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:o(function(){return RC.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:o(function(){return RC.QueryExecutor},"get")});var PC=Lx();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:o(function(){return PC.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:o(function(){return PC.UpdateExecutorError},"get")});var oU=as();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:o(function(){return oU.SolutionMapping},"get")});var cU=Tp();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:o(function(){return cU.BuiltInFunctions},"get")});var lU=Mx();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:o(function(){return lU.AggregateFunctions},"get")});var OC=A1();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:o(function(){return OC.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:o(function(){return OC.CustomAggregateError},"get")});var ys=x1();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:o(function(){return ys.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:o(function(){return ys.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:o(function(){return ys.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:o(function(){return ys.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:o(function(){return ys.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:o(function(){return ys.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:o(function(){return ys.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:o(function(){return ys.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:o(function(){return ys.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:o(function(){return ys.createDoubleLiteral},"get")});var uU=jx();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:o(function(){return uU.QueryPlanCache},"get")});var FC=$x();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:o(function(){return FC.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:o(function(){return FC.createSPARQLResultCache},"get")});var DC=Bx();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:o(function(){return DC.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:o(function(){return DC.createIncrementalIndexer},"get")});var fU=Vx();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:o(function(){return fU.ResultSerializer},"get")});var NC=L_();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:o(function(){return NC.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:o(function(){return NC.CaseWhenTransformerError},"get")});var dU=U_();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:o(function(){return dU.VaultPrefixTransformer},"get")});var hU=Hv();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:o(function(){return hU.FilterContainsOptimizer},"get")});var LC=Ux();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:o(function(){return LC.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:o(function(){return LC.FileAlreadyExistsError},"get")});var Db=eS();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:o(function(){return Db.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:o(function(){return Db.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:o(function(){return Db.TransactionError},"get")});var Hm=ab();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:o(function(){return Hm.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:o(function(){return Hm.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:o(function(){return Hm.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:o(function(){return Hm.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var pU=wt();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:o(function(){return pU.DI_TOKENS},"get")});var yf=qx();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:o(function(){return yf.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:o(function(){return yf.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:o(function(){return yf.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:o(function(){return yf.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:o(function(){return yf.container},"get")});var ia=Yx();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:o(function(){return ia.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:o(function(){return ia.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:o(function(){return ia.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:o(function(){return ia.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:o(function(){return ia.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:o(function(){return ia.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:o(function(){return ia.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:o(function(){return ia.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:o(function(){return ia.createStreamingSource},"get")});var kC=Kx();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:o(function(){return kC.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:o(function(){return kC.ExoQLError},"get")});var Al=Fm();Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:o(function(){return Al.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:o(function(){return Al.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(m,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:o(function(){return Al.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(m,"isRelationColumnSet",{enumerable:!0,get:o(function(){return Al.isRelationColumnSet},"get")});Object.defineProperty(m,"isRelationColumnSetFrontmatter",{enumerable:!0,get:o(function(){return Al.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(m,"normalizeRelationColumnSetRef",{enumerable:!0,get:o(function(){return Al.normalizeRef},"get")});var mU=sC();Object.defineProperty(m,"RelationColumnSetResolver",{enumerable:!0,get:o(function(){return mU.RelationColumnSetResolver},"get")});var _f=Fm();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:o(function(){return _f.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:o(function(){return _f.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:o(function(){return _f.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:o(function(){return _f.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:o(function(){return _f.isLayoutFrontmatter},"get")});var Ba=Fm();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return Ba.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return Ba.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return Ba.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return Ba.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:o(function(){return Ba.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:o(function(){return Ba.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:o(function(){return Ba.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:o(function(){return Ba.isPropertiesBlock},"get")});var MC=oC();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:o(function(){return MC.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:o(function(){return MC.selectByPriority},"get")});Jn(gC(),m);Jn(_C(),m)});var yr=S(Nb=>{"use strict";Nb.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})};Nb.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 $C=S((poe,jC)=>{var Va=require("constants"),gU=process.cwd,Qm=null,yU=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Qm||(Qm=gU.call(process)),Qm};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Lb=process.chdir,process.chdir=function(n){Qm=null,Lb.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Lb));var Lb;jC.exports=_U;function _U(n){Va.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=a(n.chownSync),n.fchownSync=a(n.fchownSync),n.lchownSync=a(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=c(n.stat),n.fstat=c(n.fstat),n.lstat=c(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,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(){}),yU==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,_){var v=Date.now(),E=0;f(h,p,o(function b(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){n.stat(p,function(R,B){R&&R.code==="ENOENT"?f(h,p,b):_(A)})},E),E<100&&(E+=10);return}_&&_(A)},"CB"))}return o(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,_,v,E,b){var A;if(b&&typeof b=="function"){var R=0;A=o(function(B,W,we){if(B&&B.code==="EAGAIN"&&R<10)return R++,f.call(n,h,p,_,v,E,A);b.apply(this,arguments)},"callback")}return f.call(n,h,p,_,v,E,A)}return o(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,_,v){for(var E=0;;)try{return f.call(n,d,h,p,_,v)}catch(b){if(b.code==="EAGAIN"&&E<10){E++;continue}throw b}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Va.O_WRONLY|Va.O_SYMLINK,h,function(_,v){if(_){p&&p(_);return}f.fchmod(v,h,function(E){f.close(v,function(b){p&&p(E||b)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Va.O_WRONLY|Va.O_SYMLINK,h),_=!0,v;try{v=f.fchmodSync(p,h),_=!1}finally{if(_)try{f.closeSync(p)}catch{}else f.closeSync(p)}return v}}o(e,"patchLchmod");function t(f){Va.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,_){f.open(d,Va.O_SYMLINK,function(v,E){if(v){_&&_(v);return}f.futimes(E,h,p,function(b){f.close(E,function(A){_&&_(b||A)})})})},f.lutimesSync=function(d,h,p){var _=f.openSync(d,Va.O_SYMLINK),v,E=!0;try{v=f.futimesSync(_,h,p),E=!1}finally{if(E)try{f.closeSync(_)}catch{}else f.closeSync(_)}return v}):f.futimes&&(f.lutimes=function(d,h,p,_){_&&process.nextTick(_)},f.lutimesSync=function(){})}o(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(_){u(_)&&(_=null),p&&p.apply(this,arguments)})}}o(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}o(i,"chmodFixSync");function s(f){return f&&function(d,h,p,_){return f.call(n,d,h,p,function(v){u(v)&&(v=null),_&&_.apply(this,arguments)})}}o(s,"chownFix");function a(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(_){if(!u(_))throw _}}}o(a,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function _(v,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments)}return o(_,"callback"),h?f.call(n,d,h,_):f.call(n,d,_)}}o(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}}o(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"))}o(u,"chownErOk")}o(_U,"patch")});var UC=S((goe,VC)=>{var BC=require("stream").Stream;VC.exports=SU;function SU(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);BC.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),c=0,l=a.length;c<l;c++){var u=a[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}n.open(this.path,this.flags,this.mode,function(f,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);BC.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}o(SU,"legacy")});var WC=S((_oe,qC)=>{"use strict";qC.exports=bU;var vU=Object.getPrototypeOf||function(n){return n.__proto__};function bU(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:vU(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}o(bU,"clone")});var Cl=S((voe,jb)=>{var kt=require("fs"),wU=$C(),EU=UC(),TU=WC(),Ym=require("util"),Lr,Xm;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Lr=Symbol.for("graceful-fs.queue"),Xm=Symbol.for("graceful-fs.previous")):(Lr="___graceful-fs.queue",Xm="___graceful-fs.previous");function AU(){}o(AU,"noop");function HC(n,e){Object.defineProperty(n,Lr,{get:o(function(){return e},"get")})}o(HC,"publishQueue");var Go=AU;Ym.debuglog?Go=Ym.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Go=o(function(){var n=Ym.format.apply(Ym,arguments);n="GFS4: "+n.split(/\n/).join(`
456
- GFS4: `),console.error(n)},"debug"));kt[Lr]||(GC=global[Lr]||[],HC(kt,GC),kt.close=(function(n){function e(t,r){return n.call(kt,t,function(i){i||zC(),typeof r=="function"&&r.apply(this,arguments)})}return o(e,"close"),Object.defineProperty(e,Xm,{value:n}),e})(kt.close),kt.closeSync=(function(n){function e(t){n.apply(kt,arguments),zC()}return o(e,"closeSync"),Object.defineProperty(e,Xm,{value:n}),e})(kt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Go(kt[Lr]),require("assert").equal(kt[Lr].length,0)}));var GC;global[Lr]||HC(global,kt[Lr]);jb.exports=kb(TU(kt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!kt.__patched&&(jb.exports=kb(kt),kt.__patched=!0);function kb(n){wU(n),n.gracefulify=kb,n.createReadStream=W,n.createWriteStream=we;var e=n.readFile;n.readFile=t;function t(F,j,te){return typeof j=="function"&&(te=j,j=null),Ye(F,j,te);function Ye(st,Rt,at,ct){return e(st,Rt,function(Ke){Ke&&(Ke.code==="EMFILE"||Ke.code==="ENFILE")?xl([Ye,[st,Rt,at],Ke,ct||Date.now(),Date.now()]):typeof at=="function"&&at.apply(this,arguments)})}o(Ye,"go$readFile")}o(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return r(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$writeFile")}o(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=a);function a(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return s(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$appendFile")}o(a,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=0),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return c(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$copyFile")}o(l,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(F,j,te){typeof j=="function"&&(te=j,j=null);var Ye=f.test(process.version)?o(function(at,ct,Ke,ie){return u(at,st(at,ct,Ke,ie))},"go$readdir"):o(function(at,ct,Ke,ie){return u(at,ct,st(at,ct,Ke,ie))},"go$readdir");return Ye(F,j,te);function st(Rt,at,ct,Ke){return function(ie,V){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?xl([Ye,[Rt,at,ct],ie,Ke||Date.now(),Date.now()]):(V&&V.sort&&V.sort(),typeof ct=="function"&&ct.call(this,ie,V))}}}if(o(d,"readdir"),process.version.substr(0,4)==="v0.8"){var h=EU(n);b=h.ReadStream,R=h.WriteStream}var p=n.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=A);var _=n.WriteStream;_&&(R.prototype=Object.create(_.prototype),R.prototype.open=B),Object.defineProperty(n,"ReadStream",{get:o(function(){return b},"get"),set:o(function(F){b=F},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:o(function(){return R},"get"),set:o(function(F){R=F},"set"),enumerable:!0,configurable:!0});var v=b;Object.defineProperty(n,"FileReadStream",{get:o(function(){return v},"get"),set:o(function(F){v=F},"set"),enumerable:!0,configurable:!0});var E=R;Object.defineProperty(n,"FileWriteStream",{get:o(function(){return E},"get"),set:o(function(F){E=F},"set"),enumerable:!0,configurable:!0});function b(F,j){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}o(b,"ReadStream");function A(){var F=this;G(F.path,F.flags,F.mode,function(j,te){j?(F.autoClose&&F.destroy(),F.emit("error",j)):(F.fd=te,F.emit("open",te),F.read())})}o(A,"ReadStream$open");function R(F,j){return this instanceof R?(_.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}o(R,"WriteStream");function B(){var F=this;G(F.path,F.flags,F.mode,function(j,te){j?(F.destroy(),F.emit("error",j)):(F.fd=te,F.emit("open",te))})}o(B,"WriteStream$open");function W(F,j){return new n.ReadStream(F,j)}o(W,"createReadStream");function we(F,j){return new n.WriteStream(F,j)}o(we,"createWriteStream");var z=n.open;n.open=G;function G(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return z(Rt,at,ct,function(V,lt){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$open")}return o(G,"open"),n}o(kb,"patch");function xl(n){Go("ENQUEUE",n[0].name,n[1]),kt[Lr].push(n),Mb()}o(xl,"enqueue");var Km;function zC(){for(var n=Date.now(),e=0;e<kt[Lr].length;++e)kt[Lr][e].length>2&&(kt[Lr][e][3]=n,kt[Lr][e][4]=n);Mb()}o(zC,"resetQueue");function Mb(){if(clearTimeout(Km),Km=void 0,kt[Lr].length!==0){var n=kt[Lr].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Go("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Go("TIMEOUT",e.name,t);var a=t.pop();typeof a=="function"&&a.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Go("RETRY",e.name,t),e.apply(null,t.concat([i]))):kt[Lr].push(n)}Km===void 0&&(Km=setTimeout(Mb,0))}}o(Mb,"retry")});var pn=S(sa=>{"use strict";var QC=yr().fromCallback,hn=Cl(),xU=["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 hn[n]=="function");Object.assign(sa,hn);xU.forEach(n=>{sa[n]=QC(hn[n])});sa.exists=function(n,e){return typeof e=="function"?hn.exists(n,e):new Promise(t=>hn.exists(n,t))};sa.read=function(n,e,t,r,i,s){return typeof s=="function"?hn.read(n,e,t,r,i,s):new Promise((a,c)=>{hn.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);a({bytesRead:u,buffer:f})})})};sa.write=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.write(n,e,...t):new Promise((r,i)=>{hn.write(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffer:c})})})};sa.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.readv(n,e,...t):new Promise((r,i)=>{hn.readv(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesRead:a,buffers:c})})})};sa.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.writev(n,e,...t):new Promise((r,i)=>{hn.writev(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffers:c})})})};typeof hn.realpath.native=="function"?sa.realpath.native=QC(hn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var KC=S((Eoe,YC)=>{"use strict";var CU=require("path");YC.exports.checkPath=o(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(CU.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var eI=S((Aoe,$b)=>{"use strict";var XC=pn(),{checkPath:JC}=KC(),ZC=o(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");$b.exports.makeDir=async(n,e)=>(JC(n),XC.mkdir(n,{mode:ZC(e),recursive:!0}));$b.exports.makeDirSync=(n,e)=>(JC(n),XC.mkdirSync(n,{mode:ZC(e),recursive:!0}))});var ji=S((Coe,tI)=>{"use strict";var IU=yr().fromPromise,{makeDir:RU,makeDirSync:Bb}=eI(),Vb=IU(RU);tI.exports={mkdirs:Vb,mkdirsSync:Bb,mkdirp:Vb,mkdirpSync:Bb,ensureDir:Vb,ensureDirSync:Bb}});var Ua=S((Ioe,nI)=>{"use strict";var PU=yr().fromPromise,rI=pn();function OU(n){return rI.access(n).then(()=>!0).catch(()=>!1)}o(OU,"pathExists");nI.exports={pathExists:PU(OU),pathExistsSync:rI.existsSync}});var Ub=S((Poe,iI)=>{"use strict";var Il=pn(),FU=yr().fromPromise;async function DU(n,e,t){let r=await Il.open(n,"r+"),i=null;try{await Il.futimes(r,e,t)}finally{try{await Il.close(r)}catch(s){i=s}}if(i)throw i}o(DU,"utimesMillis");function NU(n,e,t){let r=Il.openSync(n,"r+");return Il.futimesSync(r,e,t),Il.closeSync(r)}o(NU,"utimesMillisSync");iI.exports={utimesMillis:FU(DU),utimesMillisSync:NU}});var zo=S((Foe,cI)=>{"use strict";var Rl=pn(),_r=require("path"),sI=yr().fromPromise;function LU(n,e,t){let r=t.dereference?i=>Rl.stat(i,{bigint:!0}):i=>Rl.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}o(LU,"getStats");function kU(n,e,t){let r,i=t.dereference?a=>Rl.statSync(a,{bigint:!0}):a=>Rl.lstatSync(a,{bigint:!0}),s=i(n);try{r=i(e)}catch(a){if(a.code==="ENOENT")return{srcStat:s,destStat:null};throw a}return{srcStat:s,destStat:r}}o(kU,"getStatsSync");async function MU(n,e,t,r){let{srcStat:i,destStat:s}=await LU(n,e,r);if(s){if(Sf(i,s)){let a=_r.basename(n),c=_r.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&qb(n,e))throw new Error(Jm(n,e,t));return{srcStat:i,destStat:s}}o(MU,"checkPaths");function jU(n,e,t,r){let{srcStat:i,destStat:s}=kU(n,e,r);if(s){if(Sf(i,s)){let a=_r.basename(n),c=_r.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&qb(n,e))throw new Error(Jm(n,e,t));return{srcStat:i,destStat:s}}o(jU,"checkPathsSync");async function aI(n,e,t,r){let i=_r.resolve(_r.dirname(n)),s=_r.resolve(_r.dirname(t));if(s===i||s===_r.parse(s).root)return;let a;try{a=await Rl.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Sf(e,a))throw new Error(Jm(n,t,r));return aI(n,e,s,r)}o(aI,"checkParentPaths");function oI(n,e,t,r){let i=_r.resolve(_r.dirname(n)),s=_r.resolve(_r.dirname(t));if(s===i||s===_r.parse(s).root)return;let a;try{a=Rl.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Sf(e,a))throw new Error(Jm(n,t,r));return oI(n,e,s,r)}o(oI,"checkParentPathsSync");function Sf(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}o(Sf,"areIdentical");function qb(n,e){let t=_r.resolve(n).split(_r.sep).filter(i=>i),r=_r.resolve(e).split(_r.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}o(qb,"isSrcSubdir");function Jm(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}o(Jm,"errMsg");cI.exports={checkPaths:sI(MU),checkPathsSync:jU,checkParentPaths:sI(aI),checkParentPathsSync:oI,isSrcSubdir:qb,areIdentical:Sf}});var uI=S((Noe,lI)=>{"use strict";async function $U(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}o($U,"asyncIteratorConcurrentProcess");lI.exports={asyncIteratorConcurrentProcess:$U}});var mI=S((koe,pI)=>{"use strict";var Yr=pn(),vf=require("path"),{mkdirs:BU}=ji(),{pathExists:VU}=Ua(),{utimesMillis:UU}=Ub(),bf=zo(),{asyncIteratorConcurrentProcess:qU}=uI();async function WU(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;
455
+ `)}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){YB.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};Wm.ApplicationErrorHandler=Pb});var _C=S(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.ApplicationErrorHandler=void 0;var KB=yC();Object.defineProperty(Gm,"ApplicationErrorHandler",{enumerable:!0,get:o(function(){return KB.ApplicationErrorHandler},"get")})});var Vt=S(m=>{"use strict";var XB=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:o(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Jn=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&XB(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.LabelToAliasService=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.ServiceRegistry=m.GroundingExecutor=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=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.GroundingType=m.getEffortStatusLabel=m.isTrashedStatus=m.isDoneStatus=m.normalizeEffortStatus=m.EFFORT_STATUS_OPTIONS=m.STATUS_NAME_TO_WIKILINK=m.STATUS_NAME_TO_ENUM=m.EFFORT_STATUS_CONFIG=void 0;m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=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.DailyReviewService=m.DEFAULT_AUTOCOMPLETE_CONFIG=m.AutocompleteService=m.TrendDetectionService=m.AnalyticsService=m.getTemplateByName=m.validateParameters=m.fillTemplate=m.findMatchingTemplates=m.findClassByTerm=m.KNOWN_CLASSES=m.KNOWN_PROTOTYPES=m.EFFORT_STATUSES=m.ASSET_CLASSES=m.PREDICATES=m.SPARQL_PREFIXES=m.SPARQL_TEMPLATES=m.DEFAULT_NL_TO_SPARQL_CONFIG=m.NLToSPARQLService=m.TypeRegistry=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.DynamicFrontmatterGenerator=m.FleetingNoteCreationService=m.SupervisionCreationService=m.StatusTimestampService=void 0;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=m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=void 0;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.RelationColumnSetResolver=m.normalizeRelationColumnSetRef=m.isRelationColumnSetFrontmatter=m.isRelationColumnSet=m.createRelationColumnSetFromFrontmatter=m.RELATION_COLUMN_SET_CLASS_UID=m.RELATION_COLUMN_SET_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=m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=void 0;m.selectByPriority=void 0;Jn(Tu(),m);Jn(_c(),m);var $a=Xy();Object.defineProperty(m,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:o(function(){return $a.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(m,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:o(function(){return $a.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(m,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:o(function(){return $a.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:o(function(){return $a.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(m,"normalizeEffortStatus",{enumerable:!0,get:o(function(){return $a.normalizeEffortStatus},"get")});Object.defineProperty(m,"isDoneStatus",{enumerable:!0,get:o(function(){return $a.isDoneStatus},"get")});Object.defineProperty(m,"isTrashedStatus",{enumerable:!0,get:o(function(){return $a.isTrashedStatus},"get")});Object.defineProperty(m,"getEffortStatusLabel",{enumerable:!0,get:o(function(){return $a.getEffortStatusLabel},"get")});var JB=Sc();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:o(function(){return JB.GroundingType},"get")});var gf=Jy();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:o(function(){return gf.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:o(function(){return gf.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:o(function(){return gf.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:o(function(){return gf.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:o(function(){return gf.CommandBindingStyleProperty},"get")});var Tl=Zy();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:o(function(){return Tl.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:o(function(){return Tl.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:o(function(){return Tl.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:o(function(){return Tl.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:o(function(){return Tl.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:o(function(){return Tl.isStyleSource},"get")});var zm=N2();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:o(function(){return zm.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:o(function(){return zm.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:o(function(){return zm.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:o(function(){return zm.isCommandBindingFrontmatter},"get")});Jn(L2(),m);Jn(k2(),m);Jn(e0(),m);Jn(t0(),m);Jn(j2(),m);Jn(V2(),m);Jn(k0(),m);Jn(RT(),m);var SC=yh();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:o(function(){return SC.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:o(function(){return SC.rangeToFieldType},"get")});var Ob=B0();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:o(function(){return Ob.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:o(function(){return Ob.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:o(function(){return Ob.extractPropertyLabel},"get")});var ZB=i3();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:o(function(){return ZB.CommandResolver},"get")});var eV=a3();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:o(function(){return eV.PreconditionEvaluator},"get")});var vC=c3();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:o(function(){return vC.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:o(function(){return vC.ServiceRegistry},"get")});var tV=cS();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:o(function(){return tV.TaskStatusService},"get")});var rV=dS();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:o(function(){return rV.AreaCreationService},"get")});var nV=pS();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:o(function(){return nV.AreaHierarchyBuilder},"get")});var iV=gS();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:o(function(){return iV.ClassCreationService},"get")});var sV=_S();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:o(function(){return sV.ConceptCreationService},"get")});var aV=Yp();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:o(function(){return aV.EffortStatusWorkflow},"get")});var oV=ef();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:o(function(){return oV.WorkflowEngine},"get")});var cV=K1();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:o(function(){return cV.WorkflowResolver},"get")});var lV=w3();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:o(function(){return lV.InstantiationRuleResolver},"get")});var uV=E3();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:o(function(){return uV.VisibilityGenerator},"get")});var fV=T3();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:o(function(){return fV.WorkflowCommandAdapter},"get")});var dV=AS();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:o(function(){return dV.EffortVotingService},"get")});var hV=CS();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:o(function(){return hV.FolderRepairService},"get")});var pV=RS();Object.defineProperty(m,"LabelToAliasService",{enumerable:!0,get:o(function(){return pV.LabelToAliasService},"get")});var mV=Fa();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:o(function(){return mV.LoggingService},"get")});var gV=FS();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:o(function(){return gV.PropertyCleanupService},"get")});var yV=NS();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:o(function(){return yV.RenameToUidService},"get")});var _V=Xp();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:o(function(){return _V.StatusTimestampService},"get")});var SV=MS();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:o(function(){return SV.SupervisionCreationService},"get")});var vV=BS();Object.defineProperty(m,"FleetingNoteCreationService",{enumerable:!0,get:o(function(){return vV.FleetingNoteCreationService},"get")});var bV=US();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:o(function(){return bV.DynamicFrontmatterGenerator},"get")});var wV=WS();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:o(function(){return wV.AlgorithmExtractor},"get")});var EV=zS();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:o(function(){return EV.PlanningService},"get")});var TV=M3();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:o(function(){return TV.PropertySchemaResolver},"get")});var AV=j3();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:o(function(){return AV.ClassHierarchyResolver},"get")});var xV=$3();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:o(function(){return xV.EnumValueResolver},"get")});var CV=XS();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:o(function(){return CV.AssetConversionService},"get")});var IV=ev();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:o(function(){return IV.SessionEventService},"get")});var RV=nv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:o(function(){return RV.URIConstructionService},"get")});var PV=sv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:o(function(){return PV.GenericAssetCreationService},"get")});var OV=Y3();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:o(function(){return OV.ArchiveAssetService},"get")});var FV=X3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:o(function(){return FV.FixMissingLabelService},"get")});var DV=J3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:o(function(){return DV.GraphQueryService},"get")});var NV=ex();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:o(function(){return NV.TypeRegistry},"get")});var bC=tx();Object.defineProperty(m,"NLToSPARQLService",{enumerable:!0,get:o(function(){return bC.NLToSPARQLService},"get")});Object.defineProperty(m,"DEFAULT_NL_TO_SPARQL_CONFIG",{enumerable:!0,get:o(function(){return bC.DEFAULT_NL_TO_SPARQL_CONFIG},"get")});var Zn=uv();Object.defineProperty(m,"SPARQL_TEMPLATES",{enumerable:!0,get:o(function(){return Zn.SPARQL_TEMPLATES},"get")});Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:o(function(){return Zn.SPARQL_PREFIXES},"get")});Object.defineProperty(m,"PREDICATES",{enumerable:!0,get:o(function(){return Zn.PREDICATES},"get")});Object.defineProperty(m,"ASSET_CLASSES",{enumerable:!0,get:o(function(){return Zn.ASSET_CLASSES},"get")});Object.defineProperty(m,"EFFORT_STATUSES",{enumerable:!0,get:o(function(){return Zn.EFFORT_STATUSES},"get")});Object.defineProperty(m,"KNOWN_PROTOTYPES",{enumerable:!0,get:o(function(){return Zn.KNOWN_PROTOTYPES},"get")});Object.defineProperty(m,"KNOWN_CLASSES",{enumerable:!0,get:o(function(){return Zn.KNOWN_CLASSES},"get")});Object.defineProperty(m,"findClassByTerm",{enumerable:!0,get:o(function(){return Zn.findClassByTerm},"get")});Object.defineProperty(m,"findMatchingTemplates",{enumerable:!0,get:o(function(){return Zn.findMatchingTemplates},"get")});Object.defineProperty(m,"fillTemplate",{enumerable:!0,get:o(function(){return Zn.fillTemplate},"get")});Object.defineProperty(m,"validateParameters",{enumerable:!0,get:o(function(){return Zn.validateParameters},"get")});Object.defineProperty(m,"getTemplateByName",{enumerable:!0,get:o(function(){return Zn.getTemplateByName},"get")});var LV=nx();Object.defineProperty(m,"AnalyticsService",{enumerable:!0,get:o(function(){return LV.AnalyticsService},"get")});var kV=ix();Object.defineProperty(m,"TrendDetectionService",{enumerable:!0,get:o(function(){return kV.TrendDetectionService},"get")});var wC=ax();Object.defineProperty(m,"AutocompleteService",{enumerable:!0,get:o(function(){return wC.AutocompleteService},"get")});Object.defineProperty(m,"DEFAULT_AUTOCOMPLETE_CONFIG",{enumerable:!0,get:o(function(){return wC.DEFAULT_AUTOCOMPLETE_CONFIG},"get")});var MV=cx();Object.defineProperty(m,"DailyReviewService",{enumerable:!0,get:o(function(){return MV.DailyReviewService},"get")});var EC=yv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:o(function(){return EC.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:o(function(){return EC.CriticalityZoneUUIDs},"get")});var jV=Qn();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:o(function(){return jV.FrontmatterService},"get")});var $V=Gr();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:o(function(){return $V.DateFormatter},"get")});var BV=js();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:o(function(){return BV.WikiLinkHelpers},"get")});var VV=us();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:o(function(){return VV.MetadataHelpers},"get")});var UV=uS();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:o(function(){return UV.MetadataExtractor},"get")});var qV=ux();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:o(function(){return qV.EffortSortingHelpers},"get")});var WV=fx();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:o(function(){return WV.FilenameValidator},"get")});var GV=_x();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:o(function(){return GV.RDFSerializer},"get")});var zV=Ac();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:o(function(){return zV.NullLogger},"get")});var TC=Rv();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:o(function(){return TC.vaultPathToIRI},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:o(function(){return TC.OBSIDIAN_VAULT_SCHEME},"get")});var HV=iS();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:o(function(){return HV.InMemoryTripleStore},"get")});var QV=Ov();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:o(function(){return QV.RDFVocabularyMapper},"get")});var YV=vx();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:o(function(){return YV.RDFSInferenceEngine},"get")});var KV=Lv();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:o(function(){return KV.NonInheritablePropertyRegistry},"get")});var XV=jv();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:o(function(){return XV.PropertyCardinalityRegistry},"get")});var AC=Vv();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:o(function(){return AC.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:o(function(){return AC.INFERRED_GRAPH},"get")});var xC=qv();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:o(function(){return xC.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:o(function(){return xC.SOURCE_VARIABLE},"get")});var JV=Gv();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:o(function(){return JV.NoteToRDFConverter},"get")});var Fb=Lc();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:o(function(){return Fb.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:o(function(){return Fb.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:o(function(){return Fb.SPARQLParseError},"get")});var CC=j_();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:o(function(){return CC.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:o(function(){return CC.DescribeOptionsTransformerError},"get")});var IC=Mc();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:o(function(){return IC.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:o(function(){return IC.AlgebraTranslator},"get")});var ZV=Px();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:o(function(){return ZV.AlgebraOptimizer},"get")});var eU=Ox();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:o(function(){return eU.AlgebraSerializer},"get")});var tU=r1();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:o(function(){return tU.BGPExecutor},"get")});var rU=Ap();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:o(function(){return rU.FilterExecutor},"get")});var nU=v1();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:o(function(){return nU.OptionalExecutor},"get")});var iU=w1();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:o(function(){return iU.UnionExecutor},"get")});var sU=F1();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:o(function(){return sU.ConstructExecutor},"get")});var aU=Dx();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:o(function(){return aU.DescribeExecutor},"get")});var RC=nl();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:o(function(){return RC.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:o(function(){return RC.QueryExecutor},"get")});var PC=Lx();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:o(function(){return PC.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:o(function(){return PC.UpdateExecutorError},"get")});var oU=as();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:o(function(){return oU.SolutionMapping},"get")});var cU=Tp();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:o(function(){return cU.BuiltInFunctions},"get")});var lU=Mx();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:o(function(){return lU.AggregateFunctions},"get")});var OC=A1();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:o(function(){return OC.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:o(function(){return OC.CustomAggregateError},"get")});var ys=x1();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:o(function(){return ys.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:o(function(){return ys.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:o(function(){return ys.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:o(function(){return ys.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:o(function(){return ys.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:o(function(){return ys.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:o(function(){return ys.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:o(function(){return ys.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:o(function(){return ys.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:o(function(){return ys.createDoubleLiteral},"get")});var uU=jx();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:o(function(){return uU.QueryPlanCache},"get")});var FC=$x();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:o(function(){return FC.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:o(function(){return FC.createSPARQLResultCache},"get")});var DC=Bx();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:o(function(){return DC.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:o(function(){return DC.createIncrementalIndexer},"get")});var fU=Vx();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:o(function(){return fU.ResultSerializer},"get")});var NC=L_();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:o(function(){return NC.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:o(function(){return NC.CaseWhenTransformerError},"get")});var dU=U_();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:o(function(){return dU.VaultPrefixTransformer},"get")});var hU=Hv();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:o(function(){return hU.FilterContainsOptimizer},"get")});var LC=Ux();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:o(function(){return LC.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:o(function(){return LC.FileAlreadyExistsError},"get")});var Db=eS();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:o(function(){return Db.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:o(function(){return Db.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:o(function(){return Db.TransactionError},"get")});var Hm=ab();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:o(function(){return Hm.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:o(function(){return Hm.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:o(function(){return Hm.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:o(function(){return Hm.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var pU=wt();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:o(function(){return pU.DI_TOKENS},"get")});var yf=qx();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:o(function(){return yf.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:o(function(){return yf.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:o(function(){return yf.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:o(function(){return yf.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:o(function(){return yf.container},"get")});var ia=Yx();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:o(function(){return ia.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:o(function(){return ia.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:o(function(){return ia.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:o(function(){return ia.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:o(function(){return ia.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:o(function(){return ia.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:o(function(){return ia.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:o(function(){return ia.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:o(function(){return ia.createStreamingSource},"get")});var kC=Kx();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:o(function(){return kC.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:o(function(){return kC.ExoQLError},"get")});var Al=Fm();Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:o(function(){return Al.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:o(function(){return Al.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(m,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:o(function(){return Al.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(m,"isRelationColumnSet",{enumerable:!0,get:o(function(){return Al.isRelationColumnSet},"get")});Object.defineProperty(m,"isRelationColumnSetFrontmatter",{enumerable:!0,get:o(function(){return Al.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(m,"normalizeRelationColumnSetRef",{enumerable:!0,get:o(function(){return Al.normalizeRef},"get")});var mU=sC();Object.defineProperty(m,"RelationColumnSetResolver",{enumerable:!0,get:o(function(){return mU.RelationColumnSetResolver},"get")});var _f=Fm();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:o(function(){return _f.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:o(function(){return _f.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:o(function(){return _f.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:o(function(){return _f.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:o(function(){return _f.isLayoutFrontmatter},"get")});var Ba=Fm();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return Ba.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return Ba.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:o(function(){return Ba.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:o(function(){return Ba.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:o(function(){return Ba.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:o(function(){return Ba.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:o(function(){return Ba.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:o(function(){return Ba.isPropertiesBlock},"get")});var MC=oC();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:o(function(){return MC.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:o(function(){return MC.selectByPriority},"get")});Jn(gC(),m);Jn(_C(),m)});var _r=S(Nb=>{"use strict";Nb.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})};Nb.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 $C=S((poe,jC)=>{var Va=require("constants"),gU=process.cwd,Qm=null,yU=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Qm||(Qm=gU.call(process)),Qm};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Lb=process.chdir,process.chdir=function(n){Qm=null,Lb.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Lb));var Lb;jC.exports=_U;function _U(n){Va.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=a(n.chownSync),n.fchownSync=a(n.fchownSync),n.lchownSync=a(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=c(n.stat),n.fstat=c(n.fstat),n.lstat=c(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,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(){}),yU==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,_){var v=Date.now(),E=0;f(h,p,o(function b(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){n.stat(p,function(R,B){R&&R.code==="ENOENT"?f(h,p,b):_(A)})},E),E<100&&(E+=10);return}_&&_(A)},"CB"))}return o(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,_,v,E,b){var A;if(b&&typeof b=="function"){var R=0;A=o(function(B,W,we){if(B&&B.code==="EAGAIN"&&R<10)return R++,f.call(n,h,p,_,v,E,A);b.apply(this,arguments)},"callback")}return f.call(n,h,p,_,v,E,A)}return o(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,_,v){for(var E=0;;)try{return f.call(n,d,h,p,_,v)}catch(b){if(b.code==="EAGAIN"&&E<10){E++;continue}throw b}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Va.O_WRONLY|Va.O_SYMLINK,h,function(_,v){if(_){p&&p(_);return}f.fchmod(v,h,function(E){f.close(v,function(b){p&&p(E||b)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Va.O_WRONLY|Va.O_SYMLINK,h),_=!0,v;try{v=f.fchmodSync(p,h),_=!1}finally{if(_)try{f.closeSync(p)}catch{}else f.closeSync(p)}return v}}o(e,"patchLchmod");function t(f){Va.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,_){f.open(d,Va.O_SYMLINK,function(v,E){if(v){_&&_(v);return}f.futimes(E,h,p,function(b){f.close(E,function(A){_&&_(b||A)})})})},f.lutimesSync=function(d,h,p){var _=f.openSync(d,Va.O_SYMLINK),v,E=!0;try{v=f.futimesSync(_,h,p),E=!1}finally{if(E)try{f.closeSync(_)}catch{}else f.closeSync(_)}return v}):f.futimes&&(f.lutimes=function(d,h,p,_){_&&process.nextTick(_)},f.lutimesSync=function(){})}o(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(_){u(_)&&(_=null),p&&p.apply(this,arguments)})}}o(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}o(i,"chmodFixSync");function s(f){return f&&function(d,h,p,_){return f.call(n,d,h,p,function(v){u(v)&&(v=null),_&&_.apply(this,arguments)})}}o(s,"chownFix");function a(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(_){if(!u(_))throw _}}}o(a,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function _(v,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),p&&p.apply(this,arguments)}return o(_,"callback"),h?f.call(n,d,h,_):f.call(n,d,_)}}o(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}}o(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"))}o(u,"chownErOk")}o(_U,"patch")});var UC=S((goe,VC)=>{var BC=require("stream").Stream;VC.exports=SU;function SU(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);BC.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),c=0,l=a.length;c<l;c++){var u=a[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}n.open(this.path,this.flags,this.mode,function(f,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);BC.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}o(SU,"legacy")});var WC=S((_oe,qC)=>{"use strict";qC.exports=bU;var vU=Object.getPrototypeOf||function(n){return n.__proto__};function bU(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:vU(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}o(bU,"clone")});var Cl=S((voe,jb)=>{var kt=require("fs"),wU=$C(),EU=UC(),TU=WC(),Ym=require("util"),Lr,Xm;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Lr=Symbol.for("graceful-fs.queue"),Xm=Symbol.for("graceful-fs.previous")):(Lr="___graceful-fs.queue",Xm="___graceful-fs.previous");function AU(){}o(AU,"noop");function HC(n,e){Object.defineProperty(n,Lr,{get:o(function(){return e},"get")})}o(HC,"publishQueue");var Go=AU;Ym.debuglog?Go=Ym.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Go=o(function(){var n=Ym.format.apply(Ym,arguments);n="GFS4: "+n.split(/\n/).join(`
456
+ GFS4: `),console.error(n)},"debug"));kt[Lr]||(GC=global[Lr]||[],HC(kt,GC),kt.close=(function(n){function e(t,r){return n.call(kt,t,function(i){i||zC(),typeof r=="function"&&r.apply(this,arguments)})}return o(e,"close"),Object.defineProperty(e,Xm,{value:n}),e})(kt.close),kt.closeSync=(function(n){function e(t){n.apply(kt,arguments),zC()}return o(e,"closeSync"),Object.defineProperty(e,Xm,{value:n}),e})(kt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Go(kt[Lr]),require("assert").equal(kt[Lr].length,0)}));var GC;global[Lr]||HC(global,kt[Lr]);jb.exports=kb(TU(kt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!kt.__patched&&(jb.exports=kb(kt),kt.__patched=!0);function kb(n){wU(n),n.gracefulify=kb,n.createReadStream=W,n.createWriteStream=we;var e=n.readFile;n.readFile=t;function t(F,j,te){return typeof j=="function"&&(te=j,j=null),Ye(F,j,te);function Ye(st,Rt,at,ct){return e(st,Rt,function(Ke){Ke&&(Ke.code==="EMFILE"||Ke.code==="ENFILE")?xl([Ye,[st,Rt,at],Ke,ct||Date.now(),Date.now()]):typeof at=="function"&&at.apply(this,arguments)})}o(Ye,"go$readFile")}o(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return r(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$writeFile")}o(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=a);function a(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return s(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$appendFile")}o(a,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=0),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return c(Rt,at,ct,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$copyFile")}o(l,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(F,j,te){typeof j=="function"&&(te=j,j=null);var Ye=f.test(process.version)?o(function(at,ct,Ke,ie){return u(at,st(at,ct,Ke,ie))},"go$readdir"):o(function(at,ct,Ke,ie){return u(at,ct,st(at,ct,Ke,ie))},"go$readdir");return Ye(F,j,te);function st(Rt,at,ct,Ke){return function(ie,V){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?xl([Ye,[Rt,at,ct],ie,Ke||Date.now(),Date.now()]):(V&&V.sort&&V.sort(),typeof ct=="function"&&ct.call(this,ie,V))}}}if(o(d,"readdir"),process.version.substr(0,4)==="v0.8"){var h=EU(n);b=h.ReadStream,R=h.WriteStream}var p=n.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=A);var _=n.WriteStream;_&&(R.prototype=Object.create(_.prototype),R.prototype.open=B),Object.defineProperty(n,"ReadStream",{get:o(function(){return b},"get"),set:o(function(F){b=F},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:o(function(){return R},"get"),set:o(function(F){R=F},"set"),enumerable:!0,configurable:!0});var v=b;Object.defineProperty(n,"FileReadStream",{get:o(function(){return v},"get"),set:o(function(F){v=F},"set"),enumerable:!0,configurable:!0});var E=R;Object.defineProperty(n,"FileWriteStream",{get:o(function(){return E},"get"),set:o(function(F){E=F},"set"),enumerable:!0,configurable:!0});function b(F,j){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}o(b,"ReadStream");function A(){var F=this;G(F.path,F.flags,F.mode,function(j,te){j?(F.autoClose&&F.destroy(),F.emit("error",j)):(F.fd=te,F.emit("open",te),F.read())})}o(A,"ReadStream$open");function R(F,j){return this instanceof R?(_.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}o(R,"WriteStream");function B(){var F=this;G(F.path,F.flags,F.mode,function(j,te){j?(F.destroy(),F.emit("error",j)):(F.fd=te,F.emit("open",te))})}o(B,"WriteStream$open");function W(F,j){return new n.ReadStream(F,j)}o(W,"createReadStream");function we(F,j){return new n.WriteStream(F,j)}o(we,"createWriteStream");var z=n.open;n.open=G;function G(F,j,te,Ye){return typeof te=="function"&&(Ye=te,te=null),st(F,j,te,Ye);function st(Rt,at,ct,Ke,ie){return z(Rt,at,ct,function(V,lt){V&&(V.code==="EMFILE"||V.code==="ENFILE")?xl([st,[Rt,at,ct,Ke],V,ie||Date.now(),Date.now()]):typeof Ke=="function"&&Ke.apply(this,arguments)})}o(st,"go$open")}return o(G,"open"),n}o(kb,"patch");function xl(n){Go("ENQUEUE",n[0].name,n[1]),kt[Lr].push(n),Mb()}o(xl,"enqueue");var Km;function zC(){for(var n=Date.now(),e=0;e<kt[Lr].length;++e)kt[Lr][e].length>2&&(kt[Lr][e][3]=n,kt[Lr][e][4]=n);Mb()}o(zC,"resetQueue");function Mb(){if(clearTimeout(Km),Km=void 0,kt[Lr].length!==0){var n=kt[Lr].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Go("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Go("TIMEOUT",e.name,t);var a=t.pop();typeof a=="function"&&a.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Go("RETRY",e.name,t),e.apply(null,t.concat([i]))):kt[Lr].push(n)}Km===void 0&&(Km=setTimeout(Mb,0))}}o(Mb,"retry")});var pn=S(sa=>{"use strict";var QC=_r().fromCallback,hn=Cl(),xU=["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 hn[n]=="function");Object.assign(sa,hn);xU.forEach(n=>{sa[n]=QC(hn[n])});sa.exists=function(n,e){return typeof e=="function"?hn.exists(n,e):new Promise(t=>hn.exists(n,t))};sa.read=function(n,e,t,r,i,s){return typeof s=="function"?hn.read(n,e,t,r,i,s):new Promise((a,c)=>{hn.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);a({bytesRead:u,buffer:f})})})};sa.write=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.write(n,e,...t):new Promise((r,i)=>{hn.write(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffer:c})})})};sa.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.readv(n,e,...t):new Promise((r,i)=>{hn.readv(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesRead:a,buffers:c})})})};sa.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?hn.writev(n,e,...t):new Promise((r,i)=>{hn.writev(n,e,...t,(s,a,c)=>{if(s)return i(s);r({bytesWritten:a,buffers:c})})})};typeof hn.realpath.native=="function"?sa.realpath.native=QC(hn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var KC=S((Eoe,YC)=>{"use strict";var CU=require("path");YC.exports.checkPath=o(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(CU.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var eI=S((Aoe,$b)=>{"use strict";var XC=pn(),{checkPath:JC}=KC(),ZC=o(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");$b.exports.makeDir=async(n,e)=>(JC(n),XC.mkdir(n,{mode:ZC(e),recursive:!0}));$b.exports.makeDirSync=(n,e)=>(JC(n),XC.mkdirSync(n,{mode:ZC(e),recursive:!0}))});var ji=S((Coe,tI)=>{"use strict";var IU=_r().fromPromise,{makeDir:RU,makeDirSync:Bb}=eI(),Vb=IU(RU);tI.exports={mkdirs:Vb,mkdirsSync:Bb,mkdirp:Vb,mkdirpSync:Bb,ensureDir:Vb,ensureDirSync:Bb}});var Ua=S((Ioe,nI)=>{"use strict";var PU=_r().fromPromise,rI=pn();function OU(n){return rI.access(n).then(()=>!0).catch(()=>!1)}o(OU,"pathExists");nI.exports={pathExists:PU(OU),pathExistsSync:rI.existsSync}});var Ub=S((Poe,iI)=>{"use strict";var Il=pn(),FU=_r().fromPromise;async function DU(n,e,t){let r=await Il.open(n,"r+"),i=null;try{await Il.futimes(r,e,t)}finally{try{await Il.close(r)}catch(s){i=s}}if(i)throw i}o(DU,"utimesMillis");function NU(n,e,t){let r=Il.openSync(n,"r+");return Il.futimesSync(r,e,t),Il.closeSync(r)}o(NU,"utimesMillisSync");iI.exports={utimesMillis:FU(DU),utimesMillisSync:NU}});var zo=S((Foe,cI)=>{"use strict";var Rl=pn(),Sr=require("path"),sI=_r().fromPromise;function LU(n,e,t){let r=t.dereference?i=>Rl.stat(i,{bigint:!0}):i=>Rl.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}o(LU,"getStats");function kU(n,e,t){let r,i=t.dereference?a=>Rl.statSync(a,{bigint:!0}):a=>Rl.lstatSync(a,{bigint:!0}),s=i(n);try{r=i(e)}catch(a){if(a.code==="ENOENT")return{srcStat:s,destStat:null};throw a}return{srcStat:s,destStat:r}}o(kU,"getStatsSync");async function MU(n,e,t,r){let{srcStat:i,destStat:s}=await LU(n,e,r);if(s){if(Sf(i,s)){let a=Sr.basename(n),c=Sr.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&qb(n,e))throw new Error(Jm(n,e,t));return{srcStat:i,destStat:s}}o(MU,"checkPaths");function jU(n,e,t,r){let{srcStat:i,destStat:s}=kU(n,e,r);if(s){if(Sf(i,s)){let a=Sr.basename(n),c=Sr.basename(e);if(t==="move"&&a!==c&&a.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&qb(n,e))throw new Error(Jm(n,e,t));return{srcStat:i,destStat:s}}o(jU,"checkPathsSync");async function aI(n,e,t,r){let i=Sr.resolve(Sr.dirname(n)),s=Sr.resolve(Sr.dirname(t));if(s===i||s===Sr.parse(s).root)return;let a;try{a=await Rl.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Sf(e,a))throw new Error(Jm(n,t,r));return aI(n,e,s,r)}o(aI,"checkParentPaths");function oI(n,e,t,r){let i=Sr.resolve(Sr.dirname(n)),s=Sr.resolve(Sr.dirname(t));if(s===i||s===Sr.parse(s).root)return;let a;try{a=Rl.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Sf(e,a))throw new Error(Jm(n,t,r));return oI(n,e,s,r)}o(oI,"checkParentPathsSync");function Sf(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}o(Sf,"areIdentical");function qb(n,e){let t=Sr.resolve(n).split(Sr.sep).filter(i=>i),r=Sr.resolve(e).split(Sr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}o(qb,"isSrcSubdir");function Jm(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}o(Jm,"errMsg");cI.exports={checkPaths:sI(MU),checkPathsSync:jU,checkParentPaths:sI(aI),checkParentPathsSync:oI,isSrcSubdir:qb,areIdentical:Sf}});var uI=S((Noe,lI)=>{"use strict";async function $U(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}o($U,"asyncIteratorConcurrentProcess");lI.exports={asyncIteratorConcurrentProcess:$U}});var mI=S((koe,pI)=>{"use strict";var Yr=pn(),vf=require("path"),{mkdirs:BU}=ji(),{pathExists:VU}=Ua(),{utimesMillis:UU}=Ub(),bf=zo(),{asyncIteratorConcurrentProcess:qU}=uI();async function WU(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;
457
457
 
458
458
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await bf.checkPaths(n,e,"copy",t);if(await bf.checkParentPaths(n,r,e,"copy"),!await dI(n,e,t))return;let a=vf.dirname(e);await VU(a)||await BU(a),await hI(i,n,e,t)}o(WU,"copy");async function dI(n,e,t){return t.filter?t.filter(n,e):!0}o(dI,"runFilter");async function hI(n,e,t,r){let s=await(r.dereference?Yr.stat:Yr.lstat)(e);if(s.isDirectory())return QU(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return GU(s,n,e,t,r);if(s.isSymbolicLink())return YU(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(hI,"getStatsAndPerformCopy");async function GU(n,e,t,r,i){if(!e)return fI(n,t,r,i);if(i.overwrite)return await Yr.unlink(r),fI(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}o(GU,"onFile");async function fI(n,e,t,r){if(await Yr.copyFile(e,t),r.preserveTimestamps){zU(n.mode)&&await HU(t,n.mode);let i=await Yr.stat(e);await UU(t,i.atime,i.mtime)}return Yr.chmod(t,n.mode)}o(fI,"copyFile");function zU(n){return(n&128)===0}o(zU,"fileIsNotWritable");function HU(n,e){return Yr.chmod(n,e|128)}o(HU,"makeFileWritable");async function QU(n,e,t,r,i){e||await Yr.mkdir(r),await qU(await Yr.opendir(t),async s=>{let a=vf.join(t,s.name),c=vf.join(r,s.name);if(await dI(a,c,i)){let{destStat:u}=await bf.checkPaths(a,c,"copy",i);await hI(u,a,c,i)}}),e||await Yr.chmod(r,n.mode)}o(QU,"onDir");async function YU(n,e,t,r){let i=await Yr.readlink(e);if(r.dereference&&(i=vf.resolve(process.cwd(),i)),!n)return Yr.symlink(i,t);let s=null;try{s=await Yr.readlink(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Yr.symlink(i,t);throw a}if(r.dereference&&(s=vf.resolve(process.cwd(),s)),bf.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(bf.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Yr.unlink(t),Yr.symlink(i,t)}o(YU,"onLink");pI.exports=WU});var vI=S((joe,SI)=>{"use strict";var mn=Cl(),wf=require("path"),KU=ji().mkdirsSync,XU=Ub().utimesMillisSync,Ef=zo();function JU(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;
459
459
 
460
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=Ef.checkPathsSync(n,e,"copy",t);if(Ef.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=wf.dirname(e);return mn.existsSync(s)||KU(s),gI(i,n,e,t)}o(JU,"copySync");function gI(n,e,t,r){let s=(r.dereference?mn.statSync:mn.lstatSync)(e);if(s.isDirectory())return sq(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return ZU(s,n,e,t,r);if(s.isSymbolicLink())return cq(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(gI,"getStats");function ZU(n,e,t,r,i){return e?eq(n,t,r,i):yI(n,t,r,i)}o(ZU,"onFile");function eq(n,e,t,r){if(r.overwrite)return mn.unlinkSync(t),yI(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}o(eq,"mayCopyFile");function yI(n,e,t,r){return mn.copyFileSync(e,t),r.preserveTimestamps&&tq(n.mode,e,t),Wb(t,n.mode)}o(yI,"copyFile");function tq(n,e,t){return rq(n)&&nq(t,n),iq(e,t)}o(tq,"handleTimestamps");function rq(n){return(n&128)===0}o(rq,"fileIsNotWritable");function nq(n,e){return Wb(n,e|128)}o(nq,"makeFileWritable");function Wb(n,e){return mn.chmodSync(n,e)}o(Wb,"setDestMode");function iq(n,e){let t=mn.statSync(n);return XU(e,t.atime,t.mtime)}o(iq,"setDestTimestamps");function sq(n,e,t,r,i){return e?_I(t,r,i):aq(n.mode,t,r,i)}o(sq,"onDir");function aq(n,e,t,r){return mn.mkdirSync(t),_I(e,t,r),Wb(t,n)}o(aq,"mkDirAndCopy");function _I(n,e,t){let r=mn.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)oq(i.name,n,e,t)}finally{r.closeSync()}}o(_I,"copyDir");function oq(n,e,t,r){let i=wf.join(e,n),s=wf.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:a}=Ef.checkPathsSync(i,s,"copy",r);return gI(a,i,s,r)}o(oq,"copyDirItem");function cq(n,e,t,r){let i=mn.readlinkSync(e);if(r.dereference&&(i=wf.resolve(process.cwd(),i)),n){let s;try{s=mn.readlinkSync(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return mn.symlinkSync(i,t);throw a}if(r.dereference&&(s=wf.resolve(process.cwd(),s)),Ef.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ef.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return lq(i,t)}else return mn.symlinkSync(i,t)}o(cq,"onLink");function lq(n,e){return mn.unlinkSync(e),mn.symlinkSync(n,e)}o(lq,"copyLink");SI.exports=JU});var Zm=S((Boe,bI)=>{"use strict";var uq=yr().fromPromise;bI.exports={copy:uq(mI()),copySync:vI()}});var Tf=S((Voe,EI)=>{"use strict";var wI=Cl(),fq=yr().fromCallback;function dq(n,e){wI.rm(n,{recursive:!0,force:!0},e)}o(dq,"remove");function hq(n){wI.rmSync(n,{recursive:!0,force:!0})}o(hq,"removeSync");EI.exports={remove:fq(dq),removeSync:hq}});var OI=S((qoe,PI)=>{"use strict";var pq=yr().fromPromise,xI=pn(),CI=require("path"),II=ji(),RI=Tf(),TI=pq(o(async function(e){let t;try{t=await xI.readdir(e)}catch{return II.mkdirs(e)}return Promise.all(t.map(r=>RI.remove(CI.join(e,r))))},"emptyDir"));function AI(n){let e;try{e=xI.readdirSync(n)}catch{return II.mkdirsSync(n)}e.forEach(t=>{t=CI.join(n,t),RI.removeSync(t)})}o(AI,"emptyDirSync");PI.exports={emptyDirSync:AI,emptydirSync:AI,emptyDir:TI,emptydir:TI}});var LI=S((Goe,NI)=>{"use strict";var mq=yr().fromPromise,FI=require("path"),aa=pn(),DI=ji();async function gq(n){let e;try{e=await aa.stat(n)}catch{}if(e&&e.isFile())return;let t=FI.dirname(n),r=null;try{r=await aa.stat(t)}catch(i){if(i.code==="ENOENT"){await DI.mkdirs(t),await aa.writeFile(n,"");return}else throw i}r.isDirectory()?await aa.writeFile(n,""):await aa.readdir(t)}o(gq,"createFile");function yq(n){let e;try{e=aa.statSync(n)}catch{}if(e&&e.isFile())return;let t=FI.dirname(n);try{aa.statSync(t).isDirectory()||aa.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")DI.mkdirsSync(t);else throw r}aa.writeFileSync(n,"")}o(yq,"createFileSync");NI.exports={createFile:mq(gq),createFileSync:yq}});var BI=S((Hoe,$I)=>{"use strict";var _q=yr().fromPromise,kI=require("path"),qa=pn(),MI=ji(),{pathExists:Sq}=Ua(),{areIdentical:jI}=zo();async function vq(n,e){let t;try{t=await qa.lstat(e)}catch{}let r;try{r=await qa.lstat(n)}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(t&&jI(r,t))return;let i=kI.dirname(e);await Sq(i)||await MI.mkdirs(i),await qa.link(n,e)}o(vq,"createLink");function bq(n,e){let t;try{t=qa.lstatSync(e)}catch{}try{let s=qa.lstatSync(n);if(t&&jI(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=kI.dirname(e);return qa.existsSync(r)||MI.mkdirsSync(r),qa.linkSync(n,e)}o(bq,"createLinkSync");$I.exports={createLink:_q(vq),createLinkSync:bq}});var UI=S((Yoe,VI)=>{"use strict";var Wa=require("path"),Af=pn(),{pathExists:wq}=Ua(),Eq=yr().fromPromise;async function Tq(n,e){if(Wa.isAbsolute(n)){try{await Af.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=Wa.dirname(e),r=Wa.join(t,n);if(await wq(r))return{toCwd:r,toDst:n};try{await Af.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:Wa.relative(t,n)}}o(Tq,"symlinkPaths");function Aq(n,e){if(Wa.isAbsolute(n)){if(!Af.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=Wa.dirname(e),r=Wa.join(t,n);if(Af.existsSync(r))return{toCwd:r,toDst:n};if(!Af.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:Wa.relative(t,n)}}o(Aq,"symlinkPathsSync");VI.exports={symlinkPaths:Eq(Tq),symlinkPathsSync:Aq}});var GI=S((Xoe,WI)=>{"use strict";var qI=pn(),xq=yr().fromPromise;async function Cq(n,e){if(e)return e;let t;try{t=await qI.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(Cq,"symlinkType");function Iq(n,e){if(e)return e;let t;try{t=qI.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(Iq,"symlinkTypeSync");WI.exports={symlinkType:xq(Cq),symlinkTypeSync:Iq}});var YI=S((Zoe,QI)=>{"use strict";var Rq=yr().fromPromise,zI=require("path"),_s=pn(),{mkdirs:Pq,mkdirsSync:Oq}=ji(),{symlinkPaths:Fq,symlinkPathsSync:Dq}=UI(),{symlinkType:Nq,symlinkTypeSync:Lq}=GI(),{pathExists:kq}=Ua(),{areIdentical:HI}=zo();async function Mq(n,e,t){let r;try{r=await _s.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([_s.stat(n),_s.stat(e)]);if(HI(c,l))return}let i=await Fq(n,e);n=i.toDst;let s=await Nq(i.toCwd,t),a=zI.dirname(e);return await kq(a)||await Pq(a),_s.symlink(n,e,s)}o(Mq,"createSymlink");function jq(n,e,t){let r;try{r=_s.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=_s.statSync(n),l=_s.statSync(e);if(HI(c,l))return}let i=Dq(n,e);n=i.toDst,t=Lq(i.toCwd,t);let s=zI.dirname(e);return _s.existsSync(s)||Oq(s),_s.symlinkSync(n,e,t)}o(jq,"createSymlinkSync");QI.exports={createSymlink:Rq(Mq),createSymlinkSync:jq}});var nR=S((tce,rR)=>{"use strict";var{createFile:KI,createFileSync:XI}=LI(),{createLink:JI,createLinkSync:ZI}=BI(),{createSymlink:eR,createSymlinkSync:tR}=YI();rR.exports={createFile:KI,createFileSync:XI,ensureFile:KI,ensureFileSync:XI,createLink:JI,createLinkSync:ZI,ensureLink:JI,ensureLinkSync:ZI,createSymlink:eR,createSymlinkSync:tR,ensureSymlink:eR,ensureSymlinkSync:tR}});var eg=S((rce,iR)=>{function $q(n,{EOL:e=`
461
- `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}o($q,"stringify");function Bq(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}o(Bq,"stripBom");iR.exports={stringify:$q,stripBom:Bq}});var cR=S((ice,oR)=>{var Pl;try{Pl=Cl()}catch{Pl=require("fs")}var tg=yr(),{stringify:sR,stripBom:aR}=eg();async function Vq(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Pl,r="throws"in e?e.throws:!0,i=await tg.fromCallback(t.readFile)(n,e);i=aR(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(a){if(r)throw a.message=`${n}: ${a.message}`,a;return null}return s}o(Vq,"_readFile");var Uq=tg.fromPromise(Vq);function qq(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Pl,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=aR(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}o(qq,"readFileSync");async function Wq(n,e,t={}){let r=t.fs||Pl,i=sR(e,t);await tg.fromCallback(r.writeFile)(n,i,t)}o(Wq,"_writeFile");var Gq=tg.fromPromise(Wq);function zq(n,e,t={}){let r=t.fs||Pl,i=sR(e,t);return r.writeFileSync(n,i,t)}o(zq,"writeFileSync");oR.exports={readFile:Uq,readFileSync:qq,writeFile:Gq,writeFileSync:zq}});var uR=S((ace,lR)=>{"use strict";var rg=cR();lR.exports={readJson:rg.readFile,readJsonSync:rg.readFileSync,writeJson:rg.writeFile,writeJsonSync:rg.writeFileSync}});var ng=S((oce,hR)=>{"use strict";var Hq=yr().fromPromise,Gb=pn(),fR=require("path"),dR=ji(),Qq=Ua().pathExists;async function Yq(n,e,t="utf-8"){let r=fR.dirname(n);return await Qq(r)||await dR.mkdirs(r),Gb.writeFile(n,e,t)}o(Yq,"outputFile");function Kq(n,...e){let t=fR.dirname(n);Gb.existsSync(t)||dR.mkdirsSync(t),Gb.writeFileSync(n,...e)}o(Kq,"outputFileSync");hR.exports={outputFile:Hq(Yq),outputFileSync:Kq}});var mR=S((lce,pR)=>{"use strict";var{stringify:Xq}=eg(),{outputFile:Jq}=ng();async function Zq(n,e,t={}){let r=Xq(e,t);await Jq(n,r,t)}o(Zq,"outputJson");pR.exports=Zq});var yR=S((fce,gR)=>{"use strict";var{stringify:eW}=eg(),{outputFileSync:tW}=ng();function rW(n,e,t){let r=eW(e,t);tW(n,r,t)}o(rW,"outputJsonSync");gR.exports=rW});var SR=S((hce,_R)=>{"use strict";var nW=yr().fromPromise,gn=uR();gn.outputJson=nW(mR());gn.outputJsonSync=yR();gn.outputJSON=gn.outputJson;gn.outputJSONSync=gn.outputJsonSync;gn.writeJSON=gn.writeJson;gn.writeJSONSync=gn.writeJsonSync;gn.readJSON=gn.readJson;gn.readJSONSync=gn.readJsonSync;_R.exports=gn});var TR=S((pce,ER)=>{"use strict";var iW=pn(),vR=require("path"),{copy:sW}=Zm(),{remove:wR}=Tf(),{mkdirp:aW}=ji(),{pathExists:oW}=Ua(),bR=zo();async function cW(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await bR.checkPaths(n,e,"move",t);await bR.checkParentPaths(n,i,e,"move");let a=vR.dirname(e);return vR.parse(a).root!==a&&await aW(a),lW(n,e,r,s)}o(cW,"move");async function lW(n,e,t,r){if(!r){if(t)await wR(e);else if(await oW(e))throw new Error("dest already exists.")}try{await iW.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await uW(n,e,t)}}o(lW,"doRename");async function uW(n,e,t){return await sW(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),wR(n)}o(uW,"moveAcrossDevice");ER.exports=cW});var RR=S((gce,IR)=>{"use strict";var xR=Cl(),Hb=require("path"),fW=Zm().copySync,CR=Tf().removeSync,dW=ji().mkdirpSync,AR=zo();function hW(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=AR.checkPathsSync(n,e,"move",t);return AR.checkParentPathsSync(n,i,e,"move"),pW(e)||dW(Hb.dirname(e)),mW(n,e,r,s)}o(hW,"moveSync");function pW(n){let e=Hb.dirname(n);return Hb.parse(e).root===e}o(pW,"isParentRoot");function mW(n,e,t,r){if(r)return zb(n,e,t);if(t)return CR(e),zb(n,e,t);if(xR.existsSync(e))throw new Error("dest already exists.");return zb(n,e,t)}o(mW,"doRename");function zb(n,e,t){try{xR.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return gW(n,e,t)}}o(zb,"rename");function gW(n,e,t){return fW(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),CR(n)}o(gW,"moveAcrossDevice");IR.exports=hW});var OR=S((_ce,PR)=>{"use strict";var yW=yr().fromPromise;PR.exports={move:yW(TR()),moveSync:RR()}});var Ga=S((Sce,FR)=>{"use strict";FR.exports={...pn(),...Zm(),...OI(),...nR(),...SR(),...ji(),...OR(),...ng(),...Ua(),...Tf()}});var TO=S((Xde,EO)=>{"use strict";EO.exports=bO;function bO(n,e,t){n instanceof RegExp&&(n=vO(n,t)),e instanceof RegExp&&(e=vO(e,t));var r=wO(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}o(bO,"balanced");function vO(n,e){var t=e.match(n);return t?t[0]:null}o(vO,"maybeMatch");bO.range=wO;function wO(n,e,t){var r,i,s,a,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,a=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,a])}return c}o(wO,"range")});var FO=S((Zde,OO)=>{var AO=TO();OO.exports=JH;var xO="\0SLASH"+Math.random()+"\0",CO="\0OPEN"+Math.random()+"\0",$w="\0CLOSE"+Math.random()+"\0",IO="\0COMMA"+Math.random()+"\0",RO="\0PERIOD"+Math.random()+"\0";function jw(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}o(jw,"numeric");function KH(n){return n.split("\\\\").join(xO).split("\\{").join(CO).split("\\}").join($w).split("\\,").join(IO).split("\\.").join(RO)}o(KH,"escapeBraces");function XH(n){return n.split(xO).join("\\").split(CO).join("{").split($w).join("}").split(IO).join(",").split(RO).join(".")}o(XH,"unescapeBraces");function PO(n){if(!n)return[""];var e=[],t=AO("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=PO(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(PO,"parseCommaParts");function JH(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),zf(KH(n),!0).map(XH)):[]}o(JH,"expandTop");function ZH(n){return"{"+n+"}"}o(ZH,"embrace");function eQ(n){return/^-?0\d/.test(n)}o(eQ,"isPadded");function tQ(n,e){return n<=e}o(tQ,"lte");function rQ(n,e){return n>=e}o(rQ,"gte");function zf(n,e){var t=[],r=AO("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?zf(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<s.length;a++){var c=i+"{"+r.body+"}"+s[a];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,d=r.body.indexOf(",")>=0;if(!f&&!d)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+$w+r.post,zf(n)):[n];var h;if(f)h=r.body.split(/\.\./);else if(h=PO(r.body),h.length===1&&(h=zf(h[0],!1).map(ZH),h.length===1))return s.map(function(j){return r.pre+h[0]+j});var p;if(f){var _=jw(h[0]),v=jw(h[1]),E=Math.max(h[0].length,h[1].length),b=h.length==3?Math.max(Math.abs(jw(h[2])),1):1,A=tQ,R=v<_;R&&(b*=-1,A=rQ);var B=h.some(eQ);p=[];for(var W=_;A(W,v);W+=b){var we;if(u)we=String.fromCharCode(W),we==="\\"&&(we="");else if(we=String(W),B){var z=E-we.length;if(z>0){var G=new Array(z+1).join("0");W<0?we="-"+G+we.slice(1):we=G+we}}p.push(we)}}else{p=[];for(var F=0;F<h.length;F++)p.push.apply(p,zf(h[F],!1))}for(var F=0;F<p.length;F++)for(var a=0;a<s.length;a++){var c=i+p[F]+s[a];(!e||f||c)&&t.push(c)}}return t}o(zf,"expand")});var bD=S(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.createPathBasedTargetResolver=ha;Yi.createCreateRelatedTaskService=YY;Yi.createCreateRelatedProjectService=KY;Yi.createArchiveAssetService=XY;Yi.createCleanPropertiesService=JY;Yi.createFixMissingLabelService=ZY;Yi.createRenameToUidService=eK;Yi.createRepairFolderService=tK;Yi.createPlanForEveningService=rK;function ha(n){return{resolveFile(e){let t=n.getAbstractFileByPath(`${e}.md`);if(!t||!("basename"in t))throw new Error(`Cannot resolve target file for IRI: ${e}`);return t}}}o(ha,"createPathBasedTargetResolver");function YY(n,e,t=ha(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedTask requires userInput.label");let a=t.resolveFile(r),c=n.getFrontmatter(a)??{},l=a.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&a.basename&&(u[f]=`"[[${a.basename}]]"`),await e.createAsset({className:"ems__Task",label:s,folderPath:l,propertyValues:u,parentFile:a,parentMetadata:c})}}}o(YY,"createCreateRelatedTaskService");function KY(n,e,t=ha(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedProject requires userInput.label");let a=t.resolveFile(r),c=n.getFrontmatter(a)??{},l=a.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&a.basename&&(u[f]=`"[[${a.basename}]]"`),await e.createAsset({className:"ems__Project",label:s,folderPath:l,propertyValues:u,parentFile:a,parentMetadata:c})}}}o(KY,"createCreateRelatedProjectService");function XY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.archiveAsset(i)}}}o(XY,"createArchiveAssetService");function JY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.cleanEmptyProperties(i)}}}o(JY,"createCleanPropertiesService");function ZY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.fixMissingLabel(i)}}}o(ZY,"createFixMissingLabelService");function eK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}o(eK,"createRenameToUidService");function tK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{},a=await e.getExpectedFolder(i,s);if(a===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(i.parent?.path??"")!==a&&await e.repairFolder(i,a)}}}o(tK,"createRepairFolderService");function rK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.planForEvening(i)}}}o(rK,"createPlanForEveningService")});var wD=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.createPathBasedTargetResolver=nr.createPlanForEveningService=nr.createRepairFolderService=nr.createRenameToUidService=nr.createFixMissingLabelService=nr.createCleanPropertiesService=nr.createArchiveAssetService=nr.createCreateRelatedProjectService=nr.createCreateRelatedTaskService=void 0;var pa=bD();Object.defineProperty(nr,"createCreateRelatedTaskService",{enumerable:!0,get:o(function(){return pa.createCreateRelatedTaskService},"get")});Object.defineProperty(nr,"createCreateRelatedProjectService",{enumerable:!0,get:o(function(){return pa.createCreateRelatedProjectService},"get")});Object.defineProperty(nr,"createArchiveAssetService",{enumerable:!0,get:o(function(){return pa.createArchiveAssetService},"get")});Object.defineProperty(nr,"createCleanPropertiesService",{enumerable:!0,get:o(function(){return pa.createCleanPropertiesService},"get")});Object.defineProperty(nr,"createFixMissingLabelService",{enumerable:!0,get:o(function(){return pa.createFixMissingLabelService},"get")});Object.defineProperty(nr,"createRenameToUidService",{enumerable:!0,get:o(function(){return pa.createRenameToUidService},"get")});Object.defineProperty(nr,"createRepairFolderService",{enumerable:!0,get:o(function(){return pa.createRepairFolderService},"get")});Object.defineProperty(nr,"createPlanForEveningService",{enumerable:!0,get:o(function(){return pa.createPlanForEveningService},"get")});Object.defineProperty(nr,"createPathBasedTargetResolver",{enumerable:!0,get:o(function(){return pa.createPathBasedTargetResolver},"get")})});var bK={};Dy(bK,{createProgram:()=>MD});module.exports=Bd(bK);var p_e=Y(Vd());var P2=Y(R2(),1),{program:UK,createCommand:qK,createArgument:WK,createOption:GK,CommanderError:zK,InvalidArgumentError:HK,InvalidOptionArgumentError:QK,Command:xe,Argument:YK,Option:KK,Help:XK}=P2.default;var Wl=require("fs"),Gf=require("path"),Ut=Y(Vt());var ur=Y(Ga()),Sr=Y(require("path"));function QR(n){return typeof n>"u"||n===null}o(QR,"isNothing");function _W(n){return typeof n=="object"&&n!==null}o(_W,"isObject");function SW(n){return Array.isArray(n)?n:QR(n)?[]:[n]}o(SW,"toArray");function vW(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}o(vW,"extend");function bW(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}o(bW,"repeat");function wW(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}o(wW,"isNegativeZero");var EW=QR,TW=_W,AW=SW,xW=bW,CW=wW,IW=vW,lr={isNothing:EW,isObject:TW,toArray:AW,repeat:xW,isNegativeZero:CW,extend:IW};function YR(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
460
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=Ef.checkPathsSync(n,e,"copy",t);if(Ef.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=wf.dirname(e);return mn.existsSync(s)||KU(s),gI(i,n,e,t)}o(JU,"copySync");function gI(n,e,t,r){let s=(r.dereference?mn.statSync:mn.lstatSync)(e);if(s.isDirectory())return sq(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return ZU(s,n,e,t,r);if(s.isSymbolicLink())return cq(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}o(gI,"getStats");function ZU(n,e,t,r,i){return e?eq(n,t,r,i):yI(n,t,r,i)}o(ZU,"onFile");function eq(n,e,t,r){if(r.overwrite)return mn.unlinkSync(t),yI(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}o(eq,"mayCopyFile");function yI(n,e,t,r){return mn.copyFileSync(e,t),r.preserveTimestamps&&tq(n.mode,e,t),Wb(t,n.mode)}o(yI,"copyFile");function tq(n,e,t){return rq(n)&&nq(t,n),iq(e,t)}o(tq,"handleTimestamps");function rq(n){return(n&128)===0}o(rq,"fileIsNotWritable");function nq(n,e){return Wb(n,e|128)}o(nq,"makeFileWritable");function Wb(n,e){return mn.chmodSync(n,e)}o(Wb,"setDestMode");function iq(n,e){let t=mn.statSync(n);return XU(e,t.atime,t.mtime)}o(iq,"setDestTimestamps");function sq(n,e,t,r,i){return e?_I(t,r,i):aq(n.mode,t,r,i)}o(sq,"onDir");function aq(n,e,t,r){return mn.mkdirSync(t),_I(e,t,r),Wb(t,n)}o(aq,"mkDirAndCopy");function _I(n,e,t){let r=mn.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)oq(i.name,n,e,t)}finally{r.closeSync()}}o(_I,"copyDir");function oq(n,e,t,r){let i=wf.join(e,n),s=wf.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:a}=Ef.checkPathsSync(i,s,"copy",r);return gI(a,i,s,r)}o(oq,"copyDirItem");function cq(n,e,t,r){let i=mn.readlinkSync(e);if(r.dereference&&(i=wf.resolve(process.cwd(),i)),n){let s;try{s=mn.readlinkSync(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return mn.symlinkSync(i,t);throw a}if(r.dereference&&(s=wf.resolve(process.cwd(),s)),Ef.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ef.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return lq(i,t)}else return mn.symlinkSync(i,t)}o(cq,"onLink");function lq(n,e){return mn.unlinkSync(e),mn.symlinkSync(n,e)}o(lq,"copyLink");SI.exports=JU});var Zm=S((Boe,bI)=>{"use strict";var uq=_r().fromPromise;bI.exports={copy:uq(mI()),copySync:vI()}});var Tf=S((Voe,EI)=>{"use strict";var wI=Cl(),fq=_r().fromCallback;function dq(n,e){wI.rm(n,{recursive:!0,force:!0},e)}o(dq,"remove");function hq(n){wI.rmSync(n,{recursive:!0,force:!0})}o(hq,"removeSync");EI.exports={remove:fq(dq),removeSync:hq}});var OI=S((qoe,PI)=>{"use strict";var pq=_r().fromPromise,xI=pn(),CI=require("path"),II=ji(),RI=Tf(),TI=pq(o(async function(e){let t;try{t=await xI.readdir(e)}catch{return II.mkdirs(e)}return Promise.all(t.map(r=>RI.remove(CI.join(e,r))))},"emptyDir"));function AI(n){let e;try{e=xI.readdirSync(n)}catch{return II.mkdirsSync(n)}e.forEach(t=>{t=CI.join(n,t),RI.removeSync(t)})}o(AI,"emptyDirSync");PI.exports={emptyDirSync:AI,emptydirSync:AI,emptyDir:TI,emptydir:TI}});var LI=S((Goe,NI)=>{"use strict";var mq=_r().fromPromise,FI=require("path"),aa=pn(),DI=ji();async function gq(n){let e;try{e=await aa.stat(n)}catch{}if(e&&e.isFile())return;let t=FI.dirname(n),r=null;try{r=await aa.stat(t)}catch(i){if(i.code==="ENOENT"){await DI.mkdirs(t),await aa.writeFile(n,"");return}else throw i}r.isDirectory()?await aa.writeFile(n,""):await aa.readdir(t)}o(gq,"createFile");function yq(n){let e;try{e=aa.statSync(n)}catch{}if(e&&e.isFile())return;let t=FI.dirname(n);try{aa.statSync(t).isDirectory()||aa.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")DI.mkdirsSync(t);else throw r}aa.writeFileSync(n,"")}o(yq,"createFileSync");NI.exports={createFile:mq(gq),createFileSync:yq}});var BI=S((Hoe,$I)=>{"use strict";var _q=_r().fromPromise,kI=require("path"),qa=pn(),MI=ji(),{pathExists:Sq}=Ua(),{areIdentical:jI}=zo();async function vq(n,e){let t;try{t=await qa.lstat(e)}catch{}let r;try{r=await qa.lstat(n)}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(t&&jI(r,t))return;let i=kI.dirname(e);await Sq(i)||await MI.mkdirs(i),await qa.link(n,e)}o(vq,"createLink");function bq(n,e){let t;try{t=qa.lstatSync(e)}catch{}try{let s=qa.lstatSync(n);if(t&&jI(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=kI.dirname(e);return qa.existsSync(r)||MI.mkdirsSync(r),qa.linkSync(n,e)}o(bq,"createLinkSync");$I.exports={createLink:_q(vq),createLinkSync:bq}});var UI=S((Yoe,VI)=>{"use strict";var Wa=require("path"),Af=pn(),{pathExists:wq}=Ua(),Eq=_r().fromPromise;async function Tq(n,e){if(Wa.isAbsolute(n)){try{await Af.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=Wa.dirname(e),r=Wa.join(t,n);if(await wq(r))return{toCwd:r,toDst:n};try{await Af.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:Wa.relative(t,n)}}o(Tq,"symlinkPaths");function Aq(n,e){if(Wa.isAbsolute(n)){if(!Af.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=Wa.dirname(e),r=Wa.join(t,n);if(Af.existsSync(r))return{toCwd:r,toDst:n};if(!Af.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:Wa.relative(t,n)}}o(Aq,"symlinkPathsSync");VI.exports={symlinkPaths:Eq(Tq),symlinkPathsSync:Aq}});var GI=S((Xoe,WI)=>{"use strict";var qI=pn(),xq=_r().fromPromise;async function Cq(n,e){if(e)return e;let t;try{t=await qI.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(Cq,"symlinkType");function Iq(n,e){if(e)return e;let t;try{t=qI.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}o(Iq,"symlinkTypeSync");WI.exports={symlinkType:xq(Cq),symlinkTypeSync:Iq}});var YI=S((Zoe,QI)=>{"use strict";var Rq=_r().fromPromise,zI=require("path"),_s=pn(),{mkdirs:Pq,mkdirsSync:Oq}=ji(),{symlinkPaths:Fq,symlinkPathsSync:Dq}=UI(),{symlinkType:Nq,symlinkTypeSync:Lq}=GI(),{pathExists:kq}=Ua(),{areIdentical:HI}=zo();async function Mq(n,e,t){let r;try{r=await _s.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([_s.stat(n),_s.stat(e)]);if(HI(c,l))return}let i=await Fq(n,e);n=i.toDst;let s=await Nq(i.toCwd,t),a=zI.dirname(e);return await kq(a)||await Pq(a),_s.symlink(n,e,s)}o(Mq,"createSymlink");function jq(n,e,t){let r;try{r=_s.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=_s.statSync(n),l=_s.statSync(e);if(HI(c,l))return}let i=Dq(n,e);n=i.toDst,t=Lq(i.toCwd,t);let s=zI.dirname(e);return _s.existsSync(s)||Oq(s),_s.symlinkSync(n,e,t)}o(jq,"createSymlinkSync");QI.exports={createSymlink:Rq(Mq),createSymlinkSync:jq}});var nR=S((tce,rR)=>{"use strict";var{createFile:KI,createFileSync:XI}=LI(),{createLink:JI,createLinkSync:ZI}=BI(),{createSymlink:eR,createSymlinkSync:tR}=YI();rR.exports={createFile:KI,createFileSync:XI,ensureFile:KI,ensureFileSync:XI,createLink:JI,createLinkSync:ZI,ensureLink:JI,ensureLinkSync:ZI,createSymlink:eR,createSymlinkSync:tR,ensureSymlink:eR,ensureSymlinkSync:tR}});var eg=S((rce,iR)=>{function $q(n,{EOL:e=`
461
+ `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}o($q,"stringify");function Bq(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}o(Bq,"stripBom");iR.exports={stringify:$q,stripBom:Bq}});var cR=S((ice,oR)=>{var Pl;try{Pl=Cl()}catch{Pl=require("fs")}var tg=_r(),{stringify:sR,stripBom:aR}=eg();async function Vq(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Pl,r="throws"in e?e.throws:!0,i=await tg.fromCallback(t.readFile)(n,e);i=aR(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(a){if(r)throw a.message=`${n}: ${a.message}`,a;return null}return s}o(Vq,"_readFile");var Uq=tg.fromPromise(Vq);function qq(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Pl,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=aR(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}o(qq,"readFileSync");async function Wq(n,e,t={}){let r=t.fs||Pl,i=sR(e,t);await tg.fromCallback(r.writeFile)(n,i,t)}o(Wq,"_writeFile");var Gq=tg.fromPromise(Wq);function zq(n,e,t={}){let r=t.fs||Pl,i=sR(e,t);return r.writeFileSync(n,i,t)}o(zq,"writeFileSync");oR.exports={readFile:Uq,readFileSync:qq,writeFile:Gq,writeFileSync:zq}});var uR=S((ace,lR)=>{"use strict";var rg=cR();lR.exports={readJson:rg.readFile,readJsonSync:rg.readFileSync,writeJson:rg.writeFile,writeJsonSync:rg.writeFileSync}});var ng=S((oce,hR)=>{"use strict";var Hq=_r().fromPromise,Gb=pn(),fR=require("path"),dR=ji(),Qq=Ua().pathExists;async function Yq(n,e,t="utf-8"){let r=fR.dirname(n);return await Qq(r)||await dR.mkdirs(r),Gb.writeFile(n,e,t)}o(Yq,"outputFile");function Kq(n,...e){let t=fR.dirname(n);Gb.existsSync(t)||dR.mkdirsSync(t),Gb.writeFileSync(n,...e)}o(Kq,"outputFileSync");hR.exports={outputFile:Hq(Yq),outputFileSync:Kq}});var mR=S((lce,pR)=>{"use strict";var{stringify:Xq}=eg(),{outputFile:Jq}=ng();async function Zq(n,e,t={}){let r=Xq(e,t);await Jq(n,r,t)}o(Zq,"outputJson");pR.exports=Zq});var yR=S((fce,gR)=>{"use strict";var{stringify:eW}=eg(),{outputFileSync:tW}=ng();function rW(n,e,t){let r=eW(e,t);tW(n,r,t)}o(rW,"outputJsonSync");gR.exports=rW});var SR=S((hce,_R)=>{"use strict";var nW=_r().fromPromise,gn=uR();gn.outputJson=nW(mR());gn.outputJsonSync=yR();gn.outputJSON=gn.outputJson;gn.outputJSONSync=gn.outputJsonSync;gn.writeJSON=gn.writeJson;gn.writeJSONSync=gn.writeJsonSync;gn.readJSON=gn.readJson;gn.readJSONSync=gn.readJsonSync;_R.exports=gn});var TR=S((pce,ER)=>{"use strict";var iW=pn(),vR=require("path"),{copy:sW}=Zm(),{remove:wR}=Tf(),{mkdirp:aW}=ji(),{pathExists:oW}=Ua(),bR=zo();async function cW(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await bR.checkPaths(n,e,"move",t);await bR.checkParentPaths(n,i,e,"move");let a=vR.dirname(e);return vR.parse(a).root!==a&&await aW(a),lW(n,e,r,s)}o(cW,"move");async function lW(n,e,t,r){if(!r){if(t)await wR(e);else if(await oW(e))throw new Error("dest already exists.")}try{await iW.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await uW(n,e,t)}}o(lW,"doRename");async function uW(n,e,t){return await sW(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),wR(n)}o(uW,"moveAcrossDevice");ER.exports=cW});var RR=S((gce,IR)=>{"use strict";var xR=Cl(),Hb=require("path"),fW=Zm().copySync,CR=Tf().removeSync,dW=ji().mkdirpSync,AR=zo();function hW(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=AR.checkPathsSync(n,e,"move",t);return AR.checkParentPathsSync(n,i,e,"move"),pW(e)||dW(Hb.dirname(e)),mW(n,e,r,s)}o(hW,"moveSync");function pW(n){let e=Hb.dirname(n);return Hb.parse(e).root===e}o(pW,"isParentRoot");function mW(n,e,t,r){if(r)return zb(n,e,t);if(t)return CR(e),zb(n,e,t);if(xR.existsSync(e))throw new Error("dest already exists.");return zb(n,e,t)}o(mW,"doRename");function zb(n,e,t){try{xR.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return gW(n,e,t)}}o(zb,"rename");function gW(n,e,t){return fW(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),CR(n)}o(gW,"moveAcrossDevice");IR.exports=hW});var OR=S((_ce,PR)=>{"use strict";var yW=_r().fromPromise;PR.exports={move:yW(TR()),moveSync:RR()}});var Ga=S((Sce,FR)=>{"use strict";FR.exports={...pn(),...Zm(),...OI(),...nR(),...SR(),...ji(),...OR(),...ng(),...Ua(),...Tf()}});var TO=S((Xde,EO)=>{"use strict";EO.exports=bO;function bO(n,e,t){n instanceof RegExp&&(n=vO(n,t)),e instanceof RegExp&&(e=vO(e,t));var r=wO(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}o(bO,"balanced");function vO(n,e){var t=e.match(n);return t?t[0]:null}o(vO,"maybeMatch");bO.range=wO;function wO(n,e,t){var r,i,s,a,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,a=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,a])}return c}o(wO,"range")});var FO=S((Zde,OO)=>{var AO=TO();OO.exports=JH;var xO="\0SLASH"+Math.random()+"\0",CO="\0OPEN"+Math.random()+"\0",$w="\0CLOSE"+Math.random()+"\0",IO="\0COMMA"+Math.random()+"\0",RO="\0PERIOD"+Math.random()+"\0";function jw(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}o(jw,"numeric");function KH(n){return n.split("\\\\").join(xO).split("\\{").join(CO).split("\\}").join($w).split("\\,").join(IO).split("\\.").join(RO)}o(KH,"escapeBraces");function XH(n){return n.split(xO).join("\\").split(CO).join("{").split($w).join("}").split(IO).join(",").split(RO).join(".")}o(XH,"unescapeBraces");function PO(n){if(!n)return[""];var e=[],t=AO("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,a=r.split(",");a[a.length-1]+="{"+i+"}";var c=PO(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(PO,"parseCommaParts");function JH(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),zf(KH(n),!0).map(XH)):[]}o(JH,"expandTop");function ZH(n){return"{"+n+"}"}o(ZH,"embrace");function eQ(n){return/^-?0\d/.test(n)}o(eQ,"isPadded");function tQ(n,e){return n<=e}o(tQ,"lte");function rQ(n,e){return n>=e}o(rQ,"gte");function zf(n,e){var t=[],r=AO("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?zf(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<s.length;a++){var c=i+"{"+r.body+"}"+s[a];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,d=r.body.indexOf(",")>=0;if(!f&&!d)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+$w+r.post,zf(n)):[n];var h;if(f)h=r.body.split(/\.\./);else if(h=PO(r.body),h.length===1&&(h=zf(h[0],!1).map(ZH),h.length===1))return s.map(function(j){return r.pre+h[0]+j});var p;if(f){var _=jw(h[0]),v=jw(h[1]),E=Math.max(h[0].length,h[1].length),b=h.length==3?Math.max(Math.abs(jw(h[2])),1):1,A=tQ,R=v<_;R&&(b*=-1,A=rQ);var B=h.some(eQ);p=[];for(var W=_;A(W,v);W+=b){var we;if(u)we=String.fromCharCode(W),we==="\\"&&(we="");else if(we=String(W),B){var z=E-we.length;if(z>0){var G=new Array(z+1).join("0");W<0?we="-"+G+we.slice(1):we=G+we}}p.push(we)}}else{p=[];for(var F=0;F<h.length;F++)p.push.apply(p,zf(h[F],!1))}for(var F=0;F<p.length;F++)for(var a=0;a<s.length;a++){var c=i+p[F]+s[a];(!e||f||c)&&t.push(c)}}return t}o(zf,"expand")});var bD=S(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.createPathBasedTargetResolver=ha;Yi.createCreateRelatedTaskService=YY;Yi.createCreateRelatedProjectService=KY;Yi.createArchiveAssetService=XY;Yi.createCleanPropertiesService=JY;Yi.createFixMissingLabelService=ZY;Yi.createRenameToUidService=eK;Yi.createRepairFolderService=tK;Yi.createPlanForEveningService=rK;function ha(n){return{resolveFile(e){let t=n.getAbstractFileByPath(`${e}.md`);if(!t||!("basename"in t))throw new Error(`Cannot resolve target file for IRI: ${e}`);return t}}}o(ha,"createPathBasedTargetResolver");function YY(n,e,t=ha(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedTask requires userInput.label");let a=t.resolveFile(r),c=n.getFrontmatter(a)??{},l=a.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&a.basename&&(u[f]=`"[[${a.basename}]]"`),await e.createAsset({className:"ems__Task",label:s,folderPath:l,propertyValues:u,parentFile:a,parentMetadata:c})}}}o(YY,"createCreateRelatedTaskService");function KY(n,e,t=ha(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedProject requires userInput.label");let a=t.resolveFile(r),c=n.getFrontmatter(a)??{},l=a.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&a.basename&&(u[f]=`"[[${a.basename}]]"`),await e.createAsset({className:"ems__Project",label:s,folderPath:l,propertyValues:u,parentFile:a,parentMetadata:c})}}}o(KY,"createCreateRelatedProjectService");function XY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.archiveAsset(i)}}}o(XY,"createArchiveAssetService");function JY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.cleanEmptyProperties(i)}}}o(JY,"createCleanPropertiesService");function ZY(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.fixMissingLabel(i)}}}o(ZY,"createFixMissingLabelService");function eK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}o(eK,"createRenameToUidService");function tK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{},a=await e.getExpectedFolder(i,s);if(a===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(i.parent?.path??"")!==a&&await e.repairFolder(i,a)}}}o(tK,"createRepairFolderService");function rK(n,e,t=ha(n)){return{async execute(r){let i=t.resolveFile(r);await e.planForEvening(i)}}}o(rK,"createPlanForEveningService")});var wD=S(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.createPathBasedTargetResolver=sr.createPlanForEveningService=sr.createRepairFolderService=sr.createRenameToUidService=sr.createFixMissingLabelService=sr.createCleanPropertiesService=sr.createArchiveAssetService=sr.createCreateRelatedProjectService=sr.createCreateRelatedTaskService=void 0;var pa=bD();Object.defineProperty(sr,"createCreateRelatedTaskService",{enumerable:!0,get:o(function(){return pa.createCreateRelatedTaskService},"get")});Object.defineProperty(sr,"createCreateRelatedProjectService",{enumerable:!0,get:o(function(){return pa.createCreateRelatedProjectService},"get")});Object.defineProperty(sr,"createArchiveAssetService",{enumerable:!0,get:o(function(){return pa.createArchiveAssetService},"get")});Object.defineProperty(sr,"createCleanPropertiesService",{enumerable:!0,get:o(function(){return pa.createCleanPropertiesService},"get")});Object.defineProperty(sr,"createFixMissingLabelService",{enumerable:!0,get:o(function(){return pa.createFixMissingLabelService},"get")});Object.defineProperty(sr,"createRenameToUidService",{enumerable:!0,get:o(function(){return pa.createRenameToUidService},"get")});Object.defineProperty(sr,"createRepairFolderService",{enumerable:!0,get:o(function(){return pa.createRepairFolderService},"get")});Object.defineProperty(sr,"createPlanForEveningService",{enumerable:!0,get:o(function(){return pa.createPlanForEveningService},"get")});Object.defineProperty(sr,"createPathBasedTargetResolver",{enumerable:!0,get:o(function(){return pa.createPathBasedTargetResolver},"get")})});var bK={};Dy(bK,{createProgram:()=>MD});module.exports=Bd(bK);var p_e=Y(Vd());var P2=Y(R2(),1),{program:UK,createCommand:qK,createArgument:WK,createOption:GK,CommanderError:zK,InvalidArgumentError:HK,InvalidOptionArgumentError:QK,Command:xe,Argument:YK,Option:KK,Help:XK}=P2.default;var Wl=require("fs"),Gf=require("path"),Ut=Y(Vt());var nr=Y(Ga()),ir=Y(require("path"));function QR(n){return typeof n>"u"||n===null}o(QR,"isNothing");function _W(n){return typeof n=="object"&&n!==null}o(_W,"isObject");function SW(n){return Array.isArray(n)?n:QR(n)?[]:[n]}o(SW,"toArray");function vW(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}o(vW,"extend");function bW(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}o(bW,"repeat");function wW(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}o(wW,"isNegativeZero");var EW=QR,TW=_W,AW=SW,xW=bW,CW=wW,IW=vW,fr={isNothing:EW,isObject:TW,toArray:AW,repeat:xW,isNegativeZero:CW,extend:IW};function YR(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
462
462
 
463
- `+n.mark.snippet),r+" "+t):r}o(YR,"formatError");function Cf(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=YR(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}o(Cf,"YAMLException$1");Cf.prototype=Object.create(Error.prototype);Cf.prototype.constructor=Cf;Cf.prototype.toString=o(function(e){return this.name+": "+YR(this,e)},"toString");var yn=Cf;function Qb(n,e,t,r,i){var s="",a="",c=Math.floor(i/2)-1;return r-e>c&&(s=" ... ",e=r-c+s.length),t-r>c&&(a=" ...",t=r+c-a.length),{str:s+n.slice(e,t).replace(/\t/g,"\u2192")+a,pos:r-e+s.length}}o(Qb,"getLine");function Yb(n,e){return lr.repeat(" ",e-n.length)+n}o(Yb,"padStart");function RW(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=t.exec(n.buffer);)i.push(s.index),r.push(s.index+s[0].length),n.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c="",l,u,f=Math.min(n.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=Qb(n.buffer,r[a-l],i[a-l],n.position-(r[a]-r[a-l]),d),c=lr.repeat(" ",e.indent)+Yb((n.line-l+1).toString(),f)+" | "+u.str+`
464
- `+c;for(u=Qb(n.buffer,r[a],i[a],n.position,d),c+=lr.repeat(" ",e.indent)+Yb((n.line+1).toString(),f)+" | "+u.str+`
465
- `,c+=lr.repeat("-",e.indent+f+3+u.pos)+`^
466
- `,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=Qb(n.buffer,r[a+l],i[a+l],n.position-(r[a]-r[a+l]),d),c+=lr.repeat(" ",e.indent)+Yb((n.line+l+1).toString(),f)+" | "+u.str+`
467
- `;return c.replace(/\n$/,"")}o(RW,"makeSnippet");var PW=RW,OW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],FW=["scalar","sequence","mapping"];function DW(n){var e={};return n!==null&&Object.keys(n).forEach(function(t){n[t].forEach(function(r){e[String(r)]=t})}),e}o(DW,"compileStyleAliases");function NW(n,e){if(e=e||{},Object.keys(e).forEach(function(t){if(OW.indexOf(t)===-1)throw new yn('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=DW(e.styleAliases||null),FW.indexOf(this.kind)===-1)throw new yn('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}o(NW,"Type$1");var kr=NW;function DR(n,e){var t=[];return n[e].forEach(function(r){var i=t.length;t.forEach(function(s,a){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=a)}),t[i]=r}),t}o(DR,"compileList");function LW(){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(o(r,"collectType"),e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}o(LW,"compileMap");function Xb(n){return this.extend(n)}o(Xb,"Schema$1");Xb.prototype.extend=o(function(e){var t=[],r=[];if(e instanceof kr)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 yn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof kr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new yn("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 yn("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 kr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Xb.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=DR(i,"implicit"),i.compiledExplicit=DR(i,"explicit"),i.compiledTypeMap=LW(i.compiledImplicit,i.compiledExplicit),i},"extend");var KR=Xb,XR=new kr("tag:yaml.org,2002:str",{kind:"scalar",construct:o(function(n){return n!==null?n:""},"construct")}),JR=new kr("tag:yaml.org,2002:seq",{kind:"sequence",construct:o(function(n){return n!==null?n:[]},"construct")}),ZR=new kr("tag:yaml.org,2002:map",{kind:"mapping",construct:o(function(n){return n!==null?n:{}},"construct")}),eP=new KR({explicit:[XR,JR,ZR]});function kW(n){if(n===null)return!0;var e=n.length;return e===1&&n==="~"||e===4&&(n==="null"||n==="Null"||n==="NULL")}o(kW,"resolveYamlNull");function MW(){return null}o(MW,"constructYamlNull");function jW(n){return n===null}o(jW,"isNull");var tP=new kr("tag:yaml.org,2002:null",{kind:"scalar",resolve:kW,construct:MW,predicate:jW,represent:{canonical:o(function(){return"~"},"canonical"),lowercase:o(function(){return"null"},"lowercase"),uppercase:o(function(){return"NULL"},"uppercase"),camelcase:o(function(){return"Null"},"camelcase"),empty:o(function(){return""},"empty")},defaultStyle:"lowercase"});function $W(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")}o($W,"resolveYamlBoolean");function BW(n){return n==="true"||n==="True"||n==="TRUE"}o(BW,"constructYamlBoolean");function VW(n){return Object.prototype.toString.call(n)==="[object Boolean]"}o(VW,"isBoolean");var rP=new kr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:$W,construct:BW,predicate:VW,represent:{lowercase:o(function(n){return n?"true":"false"},"lowercase"),uppercase:o(function(n){return n?"TRUE":"FALSE"},"uppercase"),camelcase:o(function(n){return n?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function UW(n){return 48<=n&&n<=57||65<=n&&n<=70||97<=n&&n<=102}o(UW,"isHexCode");function qW(n){return 48<=n&&n<=55}o(qW,"isOctCode");function WW(n){return 48<=n&&n<=57}o(WW,"isDecCode");function GW(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(!UW(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!qW(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=n[t],i!=="_"){if(!WW(n.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}o(GW,"resolveYamlInteger");function zW(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)}o(zW,"constructYamlInteger");function HW(n){return Object.prototype.toString.call(n)==="[object Number]"&&n%1===0&&!lr.isNegativeZero(n)}o(HW,"isInteger");var nP=new kr("tag:yaml.org,2002:int",{kind:"scalar",resolve:GW,construct:zW,predicate:HW,represent:{binary:o(function(n){return n>=0?"0b"+n.toString(2):"-0b"+n.toString(2).slice(1)},"binary"),octal:o(function(n){return n>=0?"0o"+n.toString(8):"-0o"+n.toString(8).slice(1)},"octal"),decimal:o(function(n){return n.toString(10)},"decimal"),hexadecimal:o(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"]}}),QW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function YW(n){return!(n===null||!QW.test(n)||n[n.length-1]==="_")}o(YW,"resolveYamlFloat");function KW(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)}o(KW,"constructYamlFloat");var XW=/^[-+]?[0-9]+e/;function JW(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(lr.isNegativeZero(n))return"-0.0";return t=n.toString(10),XW.test(t)?t.replace("e",".e"):t}o(JW,"representYamlFloat");function ZW(n){return Object.prototype.toString.call(n)==="[object Number]"&&(n%1!==0||lr.isNegativeZero(n))}o(ZW,"isFloat");var iP=new kr("tag:yaml.org,2002:float",{kind:"scalar",resolve:YW,construct:KW,predicate:ZW,represent:JW,defaultStyle:"lowercase"}),sP=eP.extend({implicit:[tP,rP,nP,iP]}),aP=sP,oP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cP=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 eG(n){return n===null?!1:oP.exec(n)!==null||cP.exec(n)!==null}o(eG,"resolveYamlTimestamp");function tG(n){var e,t,r,i,s,a,c,l=0,u=null,f,d,h;if(e=oP.exec(n),e===null&&(e=cP.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],a=+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,a,c,l)),u&&h.setTime(h.getTime()-u),h}o(tG,"constructYamlTimestamp");function rG(n){return n.toISOString()}o(rG,"representYamlTimestamp");var lP=new kr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:eG,construct:tG,instanceOf:Date,represent:rG});function nG(n){return n==="<<"||n===null}o(nG,"resolveYamlMerge");var uP=new kr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nG}),rw=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
463
+ `+n.mark.snippet),r+" "+t):r}o(YR,"formatError");function Cf(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=YR(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}o(Cf,"YAMLException$1");Cf.prototype=Object.create(Error.prototype);Cf.prototype.constructor=Cf;Cf.prototype.toString=o(function(e){return this.name+": "+YR(this,e)},"toString");var yn=Cf;function Qb(n,e,t,r,i){var s="",a="",c=Math.floor(i/2)-1;return r-e>c&&(s=" ... ",e=r-c+s.length),t-r>c&&(a=" ...",t=r+c-a.length),{str:s+n.slice(e,t).replace(/\t/g,"\u2192")+a,pos:r-e+s.length}}o(Qb,"getLine");function Yb(n,e){return fr.repeat(" ",e-n.length)+n}o(Yb,"padStart");function RW(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=t.exec(n.buffer);)i.push(s.index),r.push(s.index+s[0].length),n.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c="",l,u,f=Math.min(n.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=Qb(n.buffer,r[a-l],i[a-l],n.position-(r[a]-r[a-l]),d),c=fr.repeat(" ",e.indent)+Yb((n.line-l+1).toString(),f)+" | "+u.str+`
464
+ `+c;for(u=Qb(n.buffer,r[a],i[a],n.position,d),c+=fr.repeat(" ",e.indent)+Yb((n.line+1).toString(),f)+" | "+u.str+`
465
+ `,c+=fr.repeat("-",e.indent+f+3+u.pos)+`^
466
+ `,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=Qb(n.buffer,r[a+l],i[a+l],n.position-(r[a]-r[a+l]),d),c+=fr.repeat(" ",e.indent)+Yb((n.line+l+1).toString(),f)+" | "+u.str+`
467
+ `;return c.replace(/\n$/,"")}o(RW,"makeSnippet");var PW=RW,OW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],FW=["scalar","sequence","mapping"];function DW(n){var e={};return n!==null&&Object.keys(n).forEach(function(t){n[t].forEach(function(r){e[String(r)]=t})}),e}o(DW,"compileStyleAliases");function NW(n,e){if(e=e||{},Object.keys(e).forEach(function(t){if(OW.indexOf(t)===-1)throw new yn('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=DW(e.styleAliases||null),FW.indexOf(this.kind)===-1)throw new yn('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}o(NW,"Type$1");var kr=NW;function DR(n,e){var t=[];return n[e].forEach(function(r){var i=t.length;t.forEach(function(s,a){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=a)}),t[i]=r}),t}o(DR,"compileList");function LW(){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(o(r,"collectType"),e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}o(LW,"compileMap");function Xb(n){return this.extend(n)}o(Xb,"Schema$1");Xb.prototype.extend=o(function(e){var t=[],r=[];if(e instanceof kr)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 yn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof kr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new yn("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 yn("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 kr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Xb.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=DR(i,"implicit"),i.compiledExplicit=DR(i,"explicit"),i.compiledTypeMap=LW(i.compiledImplicit,i.compiledExplicit),i},"extend");var KR=Xb,XR=new kr("tag:yaml.org,2002:str",{kind:"scalar",construct:o(function(n){return n!==null?n:""},"construct")}),JR=new kr("tag:yaml.org,2002:seq",{kind:"sequence",construct:o(function(n){return n!==null?n:[]},"construct")}),ZR=new kr("tag:yaml.org,2002:map",{kind:"mapping",construct:o(function(n){return n!==null?n:{}},"construct")}),eP=new KR({explicit:[XR,JR,ZR]});function kW(n){if(n===null)return!0;var e=n.length;return e===1&&n==="~"||e===4&&(n==="null"||n==="Null"||n==="NULL")}o(kW,"resolveYamlNull");function MW(){return null}o(MW,"constructYamlNull");function jW(n){return n===null}o(jW,"isNull");var tP=new kr("tag:yaml.org,2002:null",{kind:"scalar",resolve:kW,construct:MW,predicate:jW,represent:{canonical:o(function(){return"~"},"canonical"),lowercase:o(function(){return"null"},"lowercase"),uppercase:o(function(){return"NULL"},"uppercase"),camelcase:o(function(){return"Null"},"camelcase"),empty:o(function(){return""},"empty")},defaultStyle:"lowercase"});function $W(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")}o($W,"resolveYamlBoolean");function BW(n){return n==="true"||n==="True"||n==="TRUE"}o(BW,"constructYamlBoolean");function VW(n){return Object.prototype.toString.call(n)==="[object Boolean]"}o(VW,"isBoolean");var rP=new kr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:$W,construct:BW,predicate:VW,represent:{lowercase:o(function(n){return n?"true":"false"},"lowercase"),uppercase:o(function(n){return n?"TRUE":"FALSE"},"uppercase"),camelcase:o(function(n){return n?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function UW(n){return 48<=n&&n<=57||65<=n&&n<=70||97<=n&&n<=102}o(UW,"isHexCode");function qW(n){return 48<=n&&n<=55}o(qW,"isOctCode");function WW(n){return 48<=n&&n<=57}o(WW,"isDecCode");function GW(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(!UW(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!qW(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=n[t],i!=="_"){if(!WW(n.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}o(GW,"resolveYamlInteger");function zW(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)}o(zW,"constructYamlInteger");function HW(n){return Object.prototype.toString.call(n)==="[object Number]"&&n%1===0&&!fr.isNegativeZero(n)}o(HW,"isInteger");var nP=new kr("tag:yaml.org,2002:int",{kind:"scalar",resolve:GW,construct:zW,predicate:HW,represent:{binary:o(function(n){return n>=0?"0b"+n.toString(2):"-0b"+n.toString(2).slice(1)},"binary"),octal:o(function(n){return n>=0?"0o"+n.toString(8):"-0o"+n.toString(8).slice(1)},"octal"),decimal:o(function(n){return n.toString(10)},"decimal"),hexadecimal:o(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"]}}),QW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function YW(n){return!(n===null||!QW.test(n)||n[n.length-1]==="_")}o(YW,"resolveYamlFloat");function KW(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)}o(KW,"constructYamlFloat");var XW=/^[-+]?[0-9]+e/;function JW(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(fr.isNegativeZero(n))return"-0.0";return t=n.toString(10),XW.test(t)?t.replace("e",".e"):t}o(JW,"representYamlFloat");function ZW(n){return Object.prototype.toString.call(n)==="[object Number]"&&(n%1!==0||fr.isNegativeZero(n))}o(ZW,"isFloat");var iP=new kr("tag:yaml.org,2002:float",{kind:"scalar",resolve:YW,construct:KW,predicate:ZW,represent:JW,defaultStyle:"lowercase"}),sP=eP.extend({implicit:[tP,rP,nP,iP]}),aP=sP,oP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cP=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 eG(n){return n===null?!1:oP.exec(n)!==null||cP.exec(n)!==null}o(eG,"resolveYamlTimestamp");function tG(n){var e,t,r,i,s,a,c,l=0,u=null,f,d,h;if(e=oP.exec(n),e===null&&(e=cP.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],a=+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,a,c,l)),u&&h.setTime(h.getTime()-u),h}o(tG,"constructYamlTimestamp");function rG(n){return n.toISOString()}o(rG,"representYamlTimestamp");var lP=new kr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:eG,construct:tG,instanceOf:Date,represent:rG});function nG(n){return n==="<<"||n===null}o(nG,"resolveYamlMerge");var uP=new kr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nG}),rw=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
468
468
  \r`;function iG(n){if(n===null)return!1;var e,t,r=0,i=n.length,s=rw;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}o(iG,"resolveYamlBinary");function sG(n){var e,t,r=n.replace(/[\r\n=]/g,""),i=r.length,s=rw,a=0,c=[];for(e=0;e<i;e++)e%4===0&&e&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(r.charAt(e));return t=i%4*6,t===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):t===18?(c.push(a>>10&255),c.push(a>>2&255)):t===12&&c.push(a>>4&255),new Uint8Array(c)}o(sG,"constructYamlBinary");function aG(n){var e="",t=0,r,i,s=n.length,a=rw;for(r=0;r<s;r++)r%3===0&&r&&(e+=a[t>>18&63],e+=a[t>>12&63],e+=a[t>>6&63],e+=a[t&63]),t=(t<<8)+n[r];return i=s%3,i===0?(e+=a[t>>18&63],e+=a[t>>12&63],e+=a[t>>6&63],e+=a[t&63]):i===2?(e+=a[t>>10&63],e+=a[t>>4&63],e+=a[t<<2&63],e+=a[64]):i===1&&(e+=a[t>>2&63],e+=a[t<<4&63],e+=a[64],e+=a[64]),e}o(aG,"representYamlBinary");function oG(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}o(oG,"isBinary");var fP=new kr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:iG,construct:sG,predicate:oG,represent:aG}),cG=Object.prototype.hasOwnProperty,lG=Object.prototype.toString;function uG(n){if(n===null)return!0;var e=[],t,r,i,s,a,c=n;for(t=0,r=c.length;t<r;t+=1){if(i=c[t],a=!1,lG.call(i)!=="[object Object]")return!1;for(s in i)if(cG.call(i,s))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}o(uG,"resolveYamlOmap");function fG(n){return n!==null?n:[]}o(fG,"constructYamlOmap");var dP=new kr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:uG,construct:fG}),dG=Object.prototype.toString;function hG(n){if(n===null)return!0;var e,t,r,i,s,a=n;for(s=new Array(a.length),e=0,t=a.length;e<t;e+=1){if(r=a[e],dG.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}o(hG,"resolveYamlPairs");function pG(n){if(n===null)return[];var e,t,r,i,s,a=n;for(s=new Array(a.length),e=0,t=a.length;e<t;e+=1)r=a[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}o(pG,"constructYamlPairs");var hP=new kr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:hG,construct:pG}),mG=Object.prototype.hasOwnProperty;function gG(n){if(n===null)return!0;var e,t=n;for(e in t)if(mG.call(t,e)&&t[e]!==null)return!1;return!0}o(gG,"resolveYamlSet");function yG(n){return n!==null?n:{}}o(yG,"constructYamlSet");var pP=new kr("tag:yaml.org,2002:set",{kind:"mapping",resolve:gG,construct:yG}),nw=aP.extend({implicit:[lP,uP],explicit:[fP,dP,hP,pP]}),Ha=Object.prototype.hasOwnProperty,ig=1,mP=2,gP=3,sg=4,Kb=1,_G=2,NR=3,SG=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vG=/[\x85\u2028\u2029]/,bG=/[,\[\]\{\}]/,yP=/^(?:!|!!|![a-z\-]+!)$/i,_P=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function LR(n){return Object.prototype.toString.call(n)}o(LR,"_class");function Ss(n){return n===10||n===13}o(Ss,"is_EOL");function Qo(n){return n===9||n===32}o(Qo,"is_WHITE_SPACE");function Pn(n){return n===9||n===32||n===10||n===13}o(Pn,"is_WS_OR_EOL");function Fl(n){return n===44||n===91||n===93||n===123||n===125}o(Fl,"is_FLOW_INDICATOR");function wG(n){var e;return 48<=n&&n<=57?n-48:(e=n|32,97<=e&&e<=102?e-97+10:-1)}o(wG,"fromHexCode");function EG(n){return n===120?2:n===117?4:n===85?8:0}o(EG,"escapedHexLen");function TG(n){return 48<=n&&n<=57?n-48:-1}o(TG,"fromDecimalCode");function kR(n){return n===48?"\0":n===97?"\x07":n===98?"\b":n===116||n===9?" ":n===110?`
469
- `: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":""}o(kR,"simpleEscapeSequence");function AG(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}o(AG,"charFromCodepoint");function SP(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}o(SP,"setProperty");var vP=new Array(256),bP=new Array(256);for(Ho=0;Ho<256;Ho++)vP[Ho]=kR(Ho)?1:0,bP[Ho]=kR(Ho);var Ho;function xG(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||nw,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=[]}o(xG,"State$1");function wP(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=PW(t),new yn(e,t)}o(wP,"generateError");function se(n,e){throw wP(n,e)}o(se,"throwError");function ag(n,e){n.onWarning&&n.onWarning.call(null,wP(n,e))}o(ag,"throwWarning");var MR={YAML:o(function(e,t,r){var i,s,a;e.version!==null&&se(e,"duplication of %YAML directive"),r.length!==1&&se(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&se(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&se(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&ag(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:o(function(e,t,r){var i,s;r.length!==2&&se(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],yP.test(i)||se(e,"ill-formed tag handle (first argument) of the TAG directive"),Ha.call(e.tagMap,i)&&se(e,'there is a previously declared suffix for "'+i+'" tag handle'),_P.test(s)||se(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{se(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function za(n,e,t,r){var i,s,a,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)a=c.charCodeAt(i),a===9||32<=a&&a<=1114111||se(n,"expected valid JSON character");else SG.test(c)&&se(n,"the stream contains non-printable characters");n.result+=c}}o(za,"captureSegment");function jR(n,e,t,r){var i,s,a,c;for(lr.isObject(t)||se(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,c=i.length;a<c;a+=1)s=i[a],Ha.call(e,s)||(SP(e,s,t[s]),r[s]=!0)}o(jR,"mergeMappings");function Dl(n,e,t,r,i,s,a,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])&&se(n,"nested arrays are not supported inside keys"),typeof i=="object"&&LR(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&LR(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)jR(n,e,s[u],t);else jR(n,e,s,t);else!n.json&&!Ha.call(t,i)&&Ha.call(e,i)&&(n.line=a||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,se(n,"duplicated mapping key")),SP(e,i,s),delete t[i];return e}o(Dl,"storeMappingPair");function iw(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++):se(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}o(iw,"readLineBreak");function rr(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;Qo(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(Ss(i))for(iw(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&&ag(n,"deficient indentation"),r}o(rr,"skipSeparationSpace");function lg(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||Pn(t)))}o(lg,"testDocumentSeparator");function sw(n,e){e===1?n.result+=" ":e>1&&(n.result+=lr.repeat(`
470
- `,e-1))}o(sw,"writeFoldedLines");function CG(n,e,t){var r,i,s,a,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),Pn(p)||Fl(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),Pn(i)||t&&Fl(i)))return!1;for(n.kind="scalar",n.result="",s=a=n.position,c=!1;p!==0;){if(p===58){if(i=n.input.charCodeAt(n.position+1),Pn(i)||t&&Fl(i))break}else if(p===35){if(r=n.input.charCodeAt(n.position-1),Pn(r))break}else{if(n.position===n.lineStart&&lg(n)||t&&Fl(p))break;if(Ss(p))if(l=n.line,u=n.lineStart,f=n.lineIndent,rr(n,!1,-1),n.lineIndent>=e){c=!0,p=n.input.charCodeAt(n.position);continue}else{n.position=a,n.line=l,n.lineStart=u,n.lineIndent=f;break}}c&&(za(n,s,a,!1),sw(n,n.line-l),s=a=n.position,c=!1),Qo(p)||(a=n.position+1),p=n.input.charCodeAt(++n.position)}return za(n,s,a,!1),n.result?!0:(n.kind=d,n.result=h,!1)}o(CG,"readPlainScalar");function IG(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(za(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 Ss(t)?(za(n,r,i,!0),sw(n,rr(n,!1,e)),r=i=n.position):n.position===n.lineStart&&lg(n)?se(n,"unexpected end of the document within a single quoted scalar"):(n.position++,i=n.position);se(n,"unexpected end of the stream within a single quoted scalar")}o(IG,"readSingleQuotedScalar");function RG(n,e){var t,r,i,s,a,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 za(n,t,n.position,!0),n.position++,!0;if(c===92){if(za(n,t,n.position,!0),c=n.input.charCodeAt(++n.position),Ss(c))rr(n,!1,e);else if(c<256&&vP[c])n.result+=bP[c],n.position++;else if((a=EG(c))>0){for(i=a,s=0;i>0;i--)c=n.input.charCodeAt(++n.position),(a=wG(c))>=0?s=(s<<4)+a:se(n,"expected hexadecimal character");n.result+=AG(s),n.position++}else se(n,"unknown escape sequence");t=r=n.position}else Ss(c)?(za(n,t,r,!0),sw(n,rr(n,!1,e)),t=r=n.position):n.position===n.lineStart&&lg(n)?se(n,"unexpected end of the document within a double quoted scalar"):(n.position++,r=n.position)}se(n,"unexpected end of the stream within a double quoted scalar")}o(RG,"readDoubleQuotedScalar");function PG(n,e){var t=!0,r,i,s,a=n.tag,c,l=n.anchor,u,f,d,h,p,_=Object.create(null),v,E,b,A;if(A=n.input.charCodeAt(n.position),A===91)f=93,p=!1,c=[];else if(A===123)f=125,p=!0,c={};else return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=c),A=n.input.charCodeAt(++n.position);A!==0;){if(rr(n,!0,e),A=n.input.charCodeAt(n.position),A===f)return n.position++,n.tag=a,n.anchor=l,n.kind=p?"mapping":"sequence",n.result=c,!0;t?A===44&&se(n,"expected the node content, but found ','"):se(n,"missed comma between flow collection entries"),E=v=b=null,d=h=!1,A===63&&(u=n.input.charCodeAt(n.position+1),Pn(u)&&(d=h=!0,n.position++,rr(n,!0,e))),r=n.line,i=n.lineStart,s=n.position,Nl(n,e,ig,!1,!0),E=n.tag,v=n.result,rr(n,!0,e),A=n.input.charCodeAt(n.position),(h||n.line===r)&&A===58&&(d=!0,A=n.input.charCodeAt(++n.position),rr(n,!0,e),Nl(n,e,ig,!1,!0),b=n.result),p?Dl(n,c,_,E,v,b,r,i,s):d?c.push(Dl(n,null,_,E,v,b,r,i,s)):c.push(v),rr(n,!0,e),A=n.input.charCodeAt(n.position),A===44?(t=!0,A=n.input.charCodeAt(++n.position)):t=!1}se(n,"unexpected end of the stream within a flow collection")}o(PG,"readFlowCollection");function OG(n,e){var t,r,i=Kb,s=!1,a=!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)Kb===i?i=d===43?NR:_G:se(n,"repeat of a chomping mode identifier");else if((f=TG(d))>=0)f===0?se(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?se(n,"repeat of an indentation width identifier"):(c=e+f-1,a=!0);else break;if(Qo(d)){do d=n.input.charCodeAt(++n.position);while(Qo(d));if(d===35)do d=n.input.charCodeAt(++n.position);while(!Ss(d)&&d!==0)}for(;d!==0;){for(iw(n),n.lineIndent=0,d=n.input.charCodeAt(n.position);(!a||n.lineIndent<c)&&d===32;)n.lineIndent++,d=n.input.charCodeAt(++n.position);if(!a&&n.lineIndent>c&&(c=n.lineIndent),Ss(d)){l++;continue}if(n.lineIndent<c){i===NR?n.result+=lr.repeat(`
469
+ `: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":""}o(kR,"simpleEscapeSequence");function AG(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}o(AG,"charFromCodepoint");function SP(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}o(SP,"setProperty");var vP=new Array(256),bP=new Array(256);for(Ho=0;Ho<256;Ho++)vP[Ho]=kR(Ho)?1:0,bP[Ho]=kR(Ho);var Ho;function xG(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||nw,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=[]}o(xG,"State$1");function wP(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=PW(t),new yn(e,t)}o(wP,"generateError");function se(n,e){throw wP(n,e)}o(se,"throwError");function ag(n,e){n.onWarning&&n.onWarning.call(null,wP(n,e))}o(ag,"throwWarning");var MR={YAML:o(function(e,t,r){var i,s,a;e.version!==null&&se(e,"duplication of %YAML directive"),r.length!==1&&se(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&se(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&se(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&ag(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:o(function(e,t,r){var i,s;r.length!==2&&se(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],yP.test(i)||se(e,"ill-formed tag handle (first argument) of the TAG directive"),Ha.call(e.tagMap,i)&&se(e,'there is a previously declared suffix for "'+i+'" tag handle'),_P.test(s)||se(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{se(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function za(n,e,t,r){var i,s,a,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)a=c.charCodeAt(i),a===9||32<=a&&a<=1114111||se(n,"expected valid JSON character");else SG.test(c)&&se(n,"the stream contains non-printable characters");n.result+=c}}o(za,"captureSegment");function jR(n,e,t,r){var i,s,a,c;for(fr.isObject(t)||se(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,c=i.length;a<c;a+=1)s=i[a],Ha.call(e,s)||(SP(e,s,t[s]),r[s]=!0)}o(jR,"mergeMappings");function Dl(n,e,t,r,i,s,a,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])&&se(n,"nested arrays are not supported inside keys"),typeof i=="object"&&LR(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&LR(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)jR(n,e,s[u],t);else jR(n,e,s,t);else!n.json&&!Ha.call(t,i)&&Ha.call(e,i)&&(n.line=a||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,se(n,"duplicated mapping key")),SP(e,i,s),delete t[i];return e}o(Dl,"storeMappingPair");function iw(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++):se(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}o(iw,"readLineBreak");function rr(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;Qo(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(Ss(i))for(iw(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&&ag(n,"deficient indentation"),r}o(rr,"skipSeparationSpace");function lg(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||Pn(t)))}o(lg,"testDocumentSeparator");function sw(n,e){e===1?n.result+=" ":e>1&&(n.result+=fr.repeat(`
470
+ `,e-1))}o(sw,"writeFoldedLines");function CG(n,e,t){var r,i,s,a,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),Pn(p)||Fl(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),Pn(i)||t&&Fl(i)))return!1;for(n.kind="scalar",n.result="",s=a=n.position,c=!1;p!==0;){if(p===58){if(i=n.input.charCodeAt(n.position+1),Pn(i)||t&&Fl(i))break}else if(p===35){if(r=n.input.charCodeAt(n.position-1),Pn(r))break}else{if(n.position===n.lineStart&&lg(n)||t&&Fl(p))break;if(Ss(p))if(l=n.line,u=n.lineStart,f=n.lineIndent,rr(n,!1,-1),n.lineIndent>=e){c=!0,p=n.input.charCodeAt(n.position);continue}else{n.position=a,n.line=l,n.lineStart=u,n.lineIndent=f;break}}c&&(za(n,s,a,!1),sw(n,n.line-l),s=a=n.position,c=!1),Qo(p)||(a=n.position+1),p=n.input.charCodeAt(++n.position)}return za(n,s,a,!1),n.result?!0:(n.kind=d,n.result=h,!1)}o(CG,"readPlainScalar");function IG(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(za(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 Ss(t)?(za(n,r,i,!0),sw(n,rr(n,!1,e)),r=i=n.position):n.position===n.lineStart&&lg(n)?se(n,"unexpected end of the document within a single quoted scalar"):(n.position++,i=n.position);se(n,"unexpected end of the stream within a single quoted scalar")}o(IG,"readSingleQuotedScalar");function RG(n,e){var t,r,i,s,a,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 za(n,t,n.position,!0),n.position++,!0;if(c===92){if(za(n,t,n.position,!0),c=n.input.charCodeAt(++n.position),Ss(c))rr(n,!1,e);else if(c<256&&vP[c])n.result+=bP[c],n.position++;else if((a=EG(c))>0){for(i=a,s=0;i>0;i--)c=n.input.charCodeAt(++n.position),(a=wG(c))>=0?s=(s<<4)+a:se(n,"expected hexadecimal character");n.result+=AG(s),n.position++}else se(n,"unknown escape sequence");t=r=n.position}else Ss(c)?(za(n,t,r,!0),sw(n,rr(n,!1,e)),t=r=n.position):n.position===n.lineStart&&lg(n)?se(n,"unexpected end of the document within a double quoted scalar"):(n.position++,r=n.position)}se(n,"unexpected end of the stream within a double quoted scalar")}o(RG,"readDoubleQuotedScalar");function PG(n,e){var t=!0,r,i,s,a=n.tag,c,l=n.anchor,u,f,d,h,p,_=Object.create(null),v,E,b,A;if(A=n.input.charCodeAt(n.position),A===91)f=93,p=!1,c=[];else if(A===123)f=125,p=!0,c={};else return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=c),A=n.input.charCodeAt(++n.position);A!==0;){if(rr(n,!0,e),A=n.input.charCodeAt(n.position),A===f)return n.position++,n.tag=a,n.anchor=l,n.kind=p?"mapping":"sequence",n.result=c,!0;t?A===44&&se(n,"expected the node content, but found ','"):se(n,"missed comma between flow collection entries"),E=v=b=null,d=h=!1,A===63&&(u=n.input.charCodeAt(n.position+1),Pn(u)&&(d=h=!0,n.position++,rr(n,!0,e))),r=n.line,i=n.lineStart,s=n.position,Nl(n,e,ig,!1,!0),E=n.tag,v=n.result,rr(n,!0,e),A=n.input.charCodeAt(n.position),(h||n.line===r)&&A===58&&(d=!0,A=n.input.charCodeAt(++n.position),rr(n,!0,e),Nl(n,e,ig,!1,!0),b=n.result),p?Dl(n,c,_,E,v,b,r,i,s):d?c.push(Dl(n,null,_,E,v,b,r,i,s)):c.push(v),rr(n,!0,e),A=n.input.charCodeAt(n.position),A===44?(t=!0,A=n.input.charCodeAt(++n.position)):t=!1}se(n,"unexpected end of the stream within a flow collection")}o(PG,"readFlowCollection");function OG(n,e){var t,r,i=Kb,s=!1,a=!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)Kb===i?i=d===43?NR:_G:se(n,"repeat of a chomping mode identifier");else if((f=TG(d))>=0)f===0?se(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?se(n,"repeat of an indentation width identifier"):(c=e+f-1,a=!0);else break;if(Qo(d)){do d=n.input.charCodeAt(++n.position);while(Qo(d));if(d===35)do d=n.input.charCodeAt(++n.position);while(!Ss(d)&&d!==0)}for(;d!==0;){for(iw(n),n.lineIndent=0,d=n.input.charCodeAt(n.position);(!a||n.lineIndent<c)&&d===32;)n.lineIndent++,d=n.input.charCodeAt(++n.position);if(!a&&n.lineIndent>c&&(c=n.lineIndent),Ss(d)){l++;continue}if(n.lineIndent<c){i===NR?n.result+=fr.repeat(`
471
471
  `,s?1+l:l):i===Kb&&s&&(n.result+=`
472
- `);break}for(r?Qo(d)?(u=!0,n.result+=lr.repeat(`
473
- `,s?1+l:l)):u?(u=!1,n.result+=lr.repeat(`
474
- `,l+1)):l===0?s&&(n.result+=" "):n.result+=lr.repeat(`
475
- `,l):n.result+=lr.repeat(`
472
+ `);break}for(r?Qo(d)?(u=!0,n.result+=fr.repeat(`
473
+ `,s?1+l:l)):u?(u=!1,n.result+=fr.repeat(`
474
+ `,l+1)):l===0?s&&(n.result+=" "):n.result+=fr.repeat(`
475
+ `,l):n.result+=fr.repeat(`
476
476
  `,s?1+l:l),s=!0,a=!0,l=0,t=n.position;!Ss(d)&&d!==0;)d=n.input.charCodeAt(++n.position);za(n,t,n.position,!1)}return!0}o(OG,"readBlockScalar");function $R(n,e){var t,r=n.tag,i=n.anchor,s=[],a,c=!1,l;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=s),l=n.input.charCodeAt(n.position);l!==0&&(n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,se(n,"tab characters must not be used in indentation")),!(l!==45||(a=n.input.charCodeAt(n.position+1),!Pn(a))));){if(c=!0,n.position++,rr(n,!0,-1)&&n.lineIndent<=e){s.push(null),l=n.input.charCodeAt(n.position);continue}if(t=n.line,Nl(n,e,gP,!1,!0),s.push(n.result),rr(n,!0,-1),l=n.input.charCodeAt(n.position),(n.line===t||n.lineIndent>e)&&l!==0)se(n,"bad indentation of a sequence entry");else if(n.lineIndent<e)break}return c?(n.tag=r,n.anchor=i,n.kind="sequence",n.result=s,!0):!1}o($R,"readBlockSequence");function FG(n,e,t){var r,i,s,a,c,l,u=n.tag,f=n.anchor,d={},h=Object.create(null),p=null,_=null,v=null,E=!1,b=!1,A;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=d),A=n.input.charCodeAt(n.position);A!==0;){if(!E&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,se(n,"tab characters must not be used in indentation")),r=n.input.charCodeAt(n.position+1),s=n.line,(A===63||A===58)&&Pn(r))A===63?(E&&(Dl(n,d,h,p,_,null,a,c,l),p=_=v=null),b=!0,E=!0,i=!0):E?(E=!1,i=!0):se(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,A=r;else{if(a=n.line,c=n.lineStart,l=n.position,!Nl(n,t,mP,!1,!0))break;if(n.line===s){for(A=n.input.charCodeAt(n.position);Qo(A);)A=n.input.charCodeAt(++n.position);if(A===58)A=n.input.charCodeAt(++n.position),Pn(A)||se(n,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Dl(n,d,h,p,_,null,a,c,l),p=_=v=null),b=!0,E=!1,i=!1,p=n.tag,_=n.result;else if(b)se(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=u,n.anchor=f,!0}else if(b)se(n,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.tag=u,n.anchor=f,!0}if((n.line===s||n.lineIndent>e)&&(E&&(a=n.line,c=n.lineStart,l=n.position),Nl(n,e,sg,!0,i)&&(E?_=n.result:v=n.result),E||(Dl(n,d,h,p,_,v,a,c,l),p=_=v=null),rr(n,!0,-1),A=n.input.charCodeAt(n.position)),(n.line===s||n.lineIndent>e)&&A!==0)se(n,"bad indentation of a mapping entry");else if(n.lineIndent<e)break}return E&&Dl(n,d,h,p,_,null,a,c,l),b&&(n.tag=u,n.anchor=f,n.kind="mapping",n.result=d),b}o(FG,"readBlockMapping");function DG(n){var e,t=!1,r=!1,i,s,a;if(a=n.input.charCodeAt(n.position),a!==33)return!1;if(n.tag!==null&&se(n,"duplication of a tag property"),a=n.input.charCodeAt(++n.position),a===60?(t=!0,a=n.input.charCodeAt(++n.position)):a===33?(r=!0,i="!!",a=n.input.charCodeAt(++n.position)):i="!",e=n.position,t){do a=n.input.charCodeAt(++n.position);while(a!==0&&a!==62);n.position<n.length?(s=n.input.slice(e,n.position),a=n.input.charCodeAt(++n.position)):se(n,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Pn(a);)a===33&&(r?se(n,"tag suffix cannot contain exclamation marks"):(i=n.input.slice(e-1,n.position+1),yP.test(i)||se(n,"named tag handle cannot contain such characters"),r=!0,e=n.position+1)),a=n.input.charCodeAt(++n.position);s=n.input.slice(e,n.position),bG.test(s)&&se(n,"tag suffix cannot contain flow indicator characters")}s&&!_P.test(s)&&se(n,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{se(n,"tag name is malformed: "+s)}return t?n.tag=s:Ha.call(n.tagMap,i)?n.tag=n.tagMap[i]+s:i==="!"?n.tag="!"+s:i==="!!"?n.tag="tag:yaml.org,2002:"+s:se(n,'undeclared tag handle "'+i+'"'),!0}o(DG,"readTagProperty");function NG(n){var e,t;if(t=n.input.charCodeAt(n.position),t!==38)return!1;for(n.anchor!==null&&se(n,"duplication of an anchor property"),t=n.input.charCodeAt(++n.position),e=n.position;t!==0&&!Pn(t)&&!Fl(t);)t=n.input.charCodeAt(++n.position);return n.position===e&&se(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(e,n.position),!0}o(NG,"readAnchorProperty");function LG(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&&!Pn(r)&&!Fl(r);)r=n.input.charCodeAt(++n.position);return n.position===e&&se(n,"name of an alias node must contain at least one character"),t=n.input.slice(e,n.position),Ha.call(n.anchorMap,t)||se(n,'unidentified alias "'+t+'"'),n.result=n.anchorMap[t],rr(n,!0,-1),!0}o(LG,"readAlias");function Nl(n,e,t,r,i){var s,a,c,l=1,u=!1,f=!1,d,h,p,_,v,E;if(n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null,s=a=c=sg===t||gP===t,r&&rr(n,!0,-1)&&(u=!0,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)),l===1)for(;DG(n)||NG(n);)rr(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||sg===t)&&(ig===t||mP===t?v=e:v=e+1,E=n.position-n.lineStart,l===1?c&&($R(n,E)||FG(n,E,v))||PG(n,v)?f=!0:(a&&OG(n,v)||IG(n,v)||RG(n,v)?f=!0:LG(n)?(f=!0,(n.tag!==null||n.anchor!==null)&&se(n,"alias node should not have any properties")):CG(n,v,ig===t)&&(f=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):l===0&&(f=c&&$R(n,E))),n.tag===null)n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);else if(n.tag==="?"){for(n.result!==null&&n.kind!=="scalar"&&se(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"'),d=0,h=n.implicitTypes.length;d<h;d+=1)if(_=n.implicitTypes[d],_.resolve(n.result)){n.result=_.construct(n.result),n.tag=_.tag,n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);break}}else if(n.tag!=="!"){if(Ha.call(n.typeMap[n.kind||"fallback"],n.tag))_=n.typeMap[n.kind||"fallback"][n.tag];else for(_=null,p=n.typeMap.multi[n.kind||"fallback"],d=0,h=p.length;d<h;d+=1)if(n.tag.slice(0,p[d].tag.length)===p[d].tag){_=p[d];break}_||se(n,"unknown tag !<"+n.tag+">"),n.result!==null&&_.kind!==n.kind&&se(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+_.kind+'", not "'+n.kind+'"'),_.resolve(n.result,n.tag)?(n.result=_.construct(n.result,n.tag),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):se(n,"cannot resolve a node with !<"+n.tag+"> explicit tag")}return n.listener!==null&&n.listener("close",n),n.tag!==null||n.anchor!==null||f}o(Nl,"composeNode");function kG(n){var e=n.position,t,r,i,s=!1,a;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(a=n.input.charCodeAt(n.position))!==0&&(rr(n,!0,-1),a=n.input.charCodeAt(n.position),!(n.lineIndent>0||a!==37));){for(s=!0,a=n.input.charCodeAt(++n.position),t=n.position;a!==0&&!Pn(a);)a=n.input.charCodeAt(++n.position);for(r=n.input.slice(t,n.position),i=[],r.length<1&&se(n,"directive name must not be less than one character in length");a!==0;){for(;Qo(a);)a=n.input.charCodeAt(++n.position);if(a===35){do a=n.input.charCodeAt(++n.position);while(a!==0&&!Ss(a));break}if(Ss(a))break;for(t=n.position;a!==0&&!Pn(a);)a=n.input.charCodeAt(++n.position);i.push(n.input.slice(t,n.position))}a!==0&&iw(n),Ha.call(MR,r)?MR[r](n,r,i):ag(n,'unknown document directive "'+r+'"')}if(rr(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,rr(n,!0,-1)):s&&se(n,"directives end mark is expected"),Nl(n,n.lineIndent-1,sg,!1,!0),rr(n,!0,-1),n.checkLineBreaks&&vG.test(n.input.slice(e,n.position))&&ag(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&lg(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,rr(n,!0,-1));return}if(n.position<n.length-1)se(n,"end of the stream or a document separator is expected");else return}o(kG,"readDocument");function EP(n,e){n=String(n),e=e||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
477
- `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new xG(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,se(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;)kG(t);return t.documents}o(EP,"loadDocuments");function MG(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=EP(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}o(MG,"loadAll$1");function jG(n,e){var t=EP(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new yn("expected a single document in the stream, but found more")}}o(jG,"load$1");var $G=MG,BG=jG,TP={loadAll:$G,load:BG},AP=Object.prototype.toString,xP=Object.prototype.hasOwnProperty,aw=65279,VG=9,If=10,UG=13,qG=32,WG=33,GG=34,Jb=35,zG=37,HG=38,QG=39,YG=42,CP=44,KG=45,og=58,XG=61,JG=62,ZG=63,ez=64,IP=91,RP=93,tz=96,PP=123,rz=124,OP=125,Kr={};Kr[0]="\\0";Kr[7]="\\a";Kr[8]="\\b";Kr[9]="\\t";Kr[10]="\\n";Kr[11]="\\v";Kr[12]="\\f";Kr[13]="\\r";Kr[27]="\\e";Kr[34]='\\"';Kr[92]="\\\\";Kr[133]="\\N";Kr[160]="\\_";Kr[8232]="\\L";Kr[8233]="\\P";var nz=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],iz=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function sz(n,e){var t,r,i,s,a,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)a=r[i],c=String(e[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=n.compiledTypeMap.fallback[a],l&&xP.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[a]=c;return t}o(sz,"compileStyleMap");function az(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 yn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+lr.repeat("0",r-e.length)+e}o(az,"encodeHex");var oz=1,Rf=2;function cz(n){this.schema=n.schema||nw,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=lr.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=sz(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==='"'?Rf:oz,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}o(cz,"State");function BR(n,e){for(var t=lr.repeat(" ",e),r=0,i=-1,s="",a,c=n.length;r<c;)i=n.indexOf(`
477
+ `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new xG(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,se(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;)kG(t);return t.documents}o(EP,"loadDocuments");function MG(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=EP(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}o(MG,"loadAll$1");function jG(n,e){var t=EP(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new yn("expected a single document in the stream, but found more")}}o(jG,"load$1");var $G=MG,BG=jG,TP={loadAll:$G,load:BG},AP=Object.prototype.toString,xP=Object.prototype.hasOwnProperty,aw=65279,VG=9,If=10,UG=13,qG=32,WG=33,GG=34,Jb=35,zG=37,HG=38,QG=39,YG=42,CP=44,KG=45,og=58,XG=61,JG=62,ZG=63,ez=64,IP=91,RP=93,tz=96,PP=123,rz=124,OP=125,Kr={};Kr[0]="\\0";Kr[7]="\\a";Kr[8]="\\b";Kr[9]="\\t";Kr[10]="\\n";Kr[11]="\\v";Kr[12]="\\f";Kr[13]="\\r";Kr[27]="\\e";Kr[34]='\\"';Kr[92]="\\\\";Kr[133]="\\N";Kr[160]="\\_";Kr[8232]="\\L";Kr[8233]="\\P";var nz=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],iz=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function sz(n,e){var t,r,i,s,a,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)a=r[i],c=String(e[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=n.compiledTypeMap.fallback[a],l&&xP.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[a]=c;return t}o(sz,"compileStyleMap");function az(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 yn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+fr.repeat("0",r-e.length)+e}o(az,"encodeHex");var oz=1,Rf=2;function cz(n){this.schema=n.schema||nw,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=fr.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=sz(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==='"'?Rf:oz,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}o(cz,"State");function BR(n,e){for(var t=fr.repeat(" ",e),r=0,i=-1,s="",a,c=n.length;r<c;)i=n.indexOf(`
478
478
  `,r),i===-1?(a=n.slice(r),r=c):(a=n.slice(r,i+1),r=i+1),a.length&&a!==`
479
479
  `&&(s+=t),s+=a;return s}o(BR,"indentString");function Zb(n,e){return`
480
- `+lr.repeat(" ",n.indent*e)}o(Zb,"generateNextLine");function lz(n,e){var t,r,i;for(t=0,r=n.implicitTypes.length;t<r;t+=1)if(i=n.implicitTypes[t],i.resolve(e))return!0;return!1}o(lz,"testImplicitResolving");function cg(n){return n===qG||n===VG}o(cg,"isWhitespace");function Pf(n){return 32<=n&&n<=126||161<=n&&n<=55295&&n!==8232&&n!==8233||57344<=n&&n<=65533&&n!==aw||65536<=n&&n<=1114111}o(Pf,"isPrintable");function VR(n){return Pf(n)&&n!==aw&&n!==UG&&n!==If}o(VR,"isNsCharOrWhitespace");function UR(n,e,t){var r=VR(n),i=r&&!cg(n);return(t?r:r&&n!==CP&&n!==IP&&n!==RP&&n!==PP&&n!==OP)&&n!==Jb&&!(e===og&&!i)||VR(e)&&!cg(e)&&n===Jb||e===og&&i}o(UR,"isPlainSafe");function uz(n){return Pf(n)&&n!==aw&&!cg(n)&&n!==KG&&n!==ZG&&n!==og&&n!==CP&&n!==IP&&n!==RP&&n!==PP&&n!==OP&&n!==Jb&&n!==HG&&n!==YG&&n!==WG&&n!==rz&&n!==XG&&n!==JG&&n!==QG&&n!==GG&&n!==zG&&n!==ez&&n!==tz}o(uz,"isPlainSafeFirst");function fz(n){return!cg(n)&&n!==og}o(fz,"isPlainSafeLast");function xf(n,e){var t=n.charCodeAt(e),r;return t>=55296&&t<=56319&&e+1<n.length&&(r=n.charCodeAt(e+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}o(xf,"codePointAt");function FP(n){var e=/^\n* /;return e.test(n)}o(FP,"needIndentIndicator");var DP=1,ew=2,NP=3,LP=4,Ol=5;function dz(n,e,t,r,i,s,a,c){var l,u=0,f=null,d=!1,h=!1,p=r!==-1,_=-1,v=uz(xf(n,0))&&fz(xf(n,n.length-1));if(e||a)for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=xf(n,l),!Pf(u))return Ol;v=v&&UR(u,f,c),f=u}else{for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=xf(n,l),u===If)d=!0,p&&(h=h||l-_-1>r&&n[_+1]!==" ",_=l);else if(!Pf(u))return Ol;v=v&&UR(u,f,c),f=u}h=h||p&&l-_-1>r&&n[_+1]!==" "}return!d&&!h?v&&!a&&!i(n)?DP:s===Rf?Ol:ew:t>9&&FP(n)?Ol:a?s===Rf?Ol:ew:h?LP:NP}o(dz,"chooseScalarStyle");function hz(n,e,t,r,i){n.dump=(function(){if(e.length===0)return n.quotingType===Rf?'""':"''";if(!n.noCompatMode&&(nz.indexOf(e)!==-1||iz.test(e)))return n.quotingType===Rf?'"'+e+'"':"'"+e+"'";var s=n.indent*Math.max(1,t),a=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-s),c=r||n.flowLevel>-1&&t>=n.flowLevel;function l(u){return lz(n,u)}switch(o(l,"testAmbiguity"),dz(e,c,n.indent,a,l,n.quotingType,n.forceQuotes&&!r,i)){case DP:return e;case ew:return"'"+e.replace(/'/g,"''")+"'";case NP:return"|"+qR(e,n.indent)+WR(BR(e,s));case LP:return">"+qR(e,n.indent)+WR(BR(pz(e,a),s));case Ol:return'"'+mz(e)+'"';default:throw new yn("impossible error: invalid scalar style")}})()}o(hz,"writeScalar");function qR(n,e){var t=FP(n)?String(e):"",r=n[n.length-1]===`
480
+ `+fr.repeat(" ",n.indent*e)}o(Zb,"generateNextLine");function lz(n,e){var t,r,i;for(t=0,r=n.implicitTypes.length;t<r;t+=1)if(i=n.implicitTypes[t],i.resolve(e))return!0;return!1}o(lz,"testImplicitResolving");function cg(n){return n===qG||n===VG}o(cg,"isWhitespace");function Pf(n){return 32<=n&&n<=126||161<=n&&n<=55295&&n!==8232&&n!==8233||57344<=n&&n<=65533&&n!==aw||65536<=n&&n<=1114111}o(Pf,"isPrintable");function VR(n){return Pf(n)&&n!==aw&&n!==UG&&n!==If}o(VR,"isNsCharOrWhitespace");function UR(n,e,t){var r=VR(n),i=r&&!cg(n);return(t?r:r&&n!==CP&&n!==IP&&n!==RP&&n!==PP&&n!==OP)&&n!==Jb&&!(e===og&&!i)||VR(e)&&!cg(e)&&n===Jb||e===og&&i}o(UR,"isPlainSafe");function uz(n){return Pf(n)&&n!==aw&&!cg(n)&&n!==KG&&n!==ZG&&n!==og&&n!==CP&&n!==IP&&n!==RP&&n!==PP&&n!==OP&&n!==Jb&&n!==HG&&n!==YG&&n!==WG&&n!==rz&&n!==XG&&n!==JG&&n!==QG&&n!==GG&&n!==zG&&n!==ez&&n!==tz}o(uz,"isPlainSafeFirst");function fz(n){return!cg(n)&&n!==og}o(fz,"isPlainSafeLast");function xf(n,e){var t=n.charCodeAt(e),r;return t>=55296&&t<=56319&&e+1<n.length&&(r=n.charCodeAt(e+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}o(xf,"codePointAt");function FP(n){var e=/^\n* /;return e.test(n)}o(FP,"needIndentIndicator");var DP=1,ew=2,NP=3,LP=4,Ol=5;function dz(n,e,t,r,i,s,a,c){var l,u=0,f=null,d=!1,h=!1,p=r!==-1,_=-1,v=uz(xf(n,0))&&fz(xf(n,n.length-1));if(e||a)for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=xf(n,l),!Pf(u))return Ol;v=v&&UR(u,f,c),f=u}else{for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=xf(n,l),u===If)d=!0,p&&(h=h||l-_-1>r&&n[_+1]!==" ",_=l);else if(!Pf(u))return Ol;v=v&&UR(u,f,c),f=u}h=h||p&&l-_-1>r&&n[_+1]!==" "}return!d&&!h?v&&!a&&!i(n)?DP:s===Rf?Ol:ew:t>9&&FP(n)?Ol:a?s===Rf?Ol:ew:h?LP:NP}o(dz,"chooseScalarStyle");function hz(n,e,t,r,i){n.dump=(function(){if(e.length===0)return n.quotingType===Rf?'""':"''";if(!n.noCompatMode&&(nz.indexOf(e)!==-1||iz.test(e)))return n.quotingType===Rf?'"'+e+'"':"'"+e+"'";var s=n.indent*Math.max(1,t),a=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-s),c=r||n.flowLevel>-1&&t>=n.flowLevel;function l(u){return lz(n,u)}switch(o(l,"testAmbiguity"),dz(e,c,n.indent,a,l,n.quotingType,n.forceQuotes&&!r,i)){case DP:return e;case ew:return"'"+e.replace(/'/g,"''")+"'";case NP:return"|"+qR(e,n.indent)+WR(BR(e,s));case LP:return">"+qR(e,n.indent)+WR(BR(pz(e,a),s));case Ol:return'"'+mz(e)+'"';default:throw new yn("impossible error: invalid scalar style")}})()}o(hz,"writeScalar");function qR(n,e){var t=FP(n)?String(e):"",r=n[n.length-1]===`
481
481
  `,i=r&&(n[n.length-2]===`
482
482
  `||n===`
483
483
  `),s=i?"+":r?"":"-";return t+s+`
@@ -489,12 +489,12 @@ GFS4: `),console.error(n)},"debug"));kt[Lr]||(GC=global[Lr]||[],HC(kt,GC),kt.clo
489
489
  `+n.slice(i,s),i=s+1),a=c;return l+=`
490
490
  `,n.length-i>e&&a>i?l+=n.slice(i,a)+`
491
491
  `+n.slice(a+1):l+=n.slice(i),l.slice(1)}o(GR,"foldLine");function mz(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=xf(n,i),r=Kr[t],!r&&Pf(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||az(t);return e}o(mz,"escapeString");function gz(n,e,t){var r="",i=n.tag,s,a,c;for(s=0,a=t.length;s<a;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(oa(n,e,c,!1,!1)||typeof c>"u"&&oa(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}o(gz,"writeFlowSequence");function zR(n,e,t,r){var i="",s=n.tag,a,c,l;for(a=0,c=t.length;a<c;a+=1)l=t[a],n.replacer&&(l=n.replacer.call(t,String(a),l)),(oa(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&oa(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Zb(n,e)),n.dump&&If===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}o(zR,"writeBlockSequence");function yz(n,e,t){var r="",i=n.tag,s=Object.keys(t),a,c,l,u,f;for(a=0,c=s.length;a<c;a+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[a],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),oa(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),oa(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}o(yz,"writeFlowMapping");function _z(n,e,t,r){var i="",s=n.tag,a=Object.keys(t),c,l,u,f,d,h;if(n.sortKeys===!0)a.sort();else if(typeof n.sortKeys=="function")a.sort(n.sortKeys);else if(n.sortKeys)throw new yn("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)h="",(!r||i!=="")&&(h+=Zb(n,e)),u=a[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),oa(n,e+1,u,!0,!0,!0)&&(d=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,d&&(n.dump&&If===n.dump.charCodeAt(0)?h+="?":h+="? "),h+=n.dump,d&&(h+=Zb(n,e)),oa(n,e+1,f,!0,d)&&(n.dump&&If===n.dump.charCodeAt(0)?h+=":":h+=": ",h+=n.dump,i+=h));n.tag=s,n.dump=i||"{}"}o(_z,"writeBlockMapping");function HR(n,e,t){var r,i,s,a,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,a=i.length;s<a;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof e=="object"&&e instanceof c.instanceOf)&&(!c.predicate||c.predicate(e))){if(t?c.multi&&c.representName?n.tag=c.representName(e):n.tag=c.tag:n.tag="?",c.represent){if(l=n.styleMap[c.tag]||c.defaultStyle,AP.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(xP.call(c.represent,l))r=c.represent[l](e,l);else throw new yn("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}o(HR,"detectType");function oa(n,e,t,r,i,s,a){n.tag=null,n.dump=t,HR(n,t,!1)||HR(n,t,!0);var c=AP.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?(_z(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(yz(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!a&&e>0?zR(n,e-1,n.dump,i):zR(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(gz(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&hz(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new yn("unacceptable kind of an object to dump "+c)}n.tag!==null&&n.tag!=="?"&&(u=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",n.dump=u+" "+n.dump)}return!0}o(oa,"writeNode");function Sz(n,e){var t=[],r=[],i,s;for(tw(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}o(Sz,"getDuplicateReferences");function tw(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)tw(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)tw(n[r[i]],e,t)}o(tw,"inspectNode");function vz(n,e){e=e||{};var t=new cz(e);t.noRefs||Sz(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),oa(t,0,r,!0,!0)?t.dump+`
492
- `:""}o(vz,"dump$1");var bz=vz,wz={dump:bz};function ow(n,e){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}o(ow,"renamed");var Ez=kr,Tz=KR,Az=eP,xz=sP,Cz=aP,Iz=nw,Rz=TP.load,Pz=TP.loadAll,Oz=wz.dump,Fz=yn,Dz={binary:fP,float:iP,map:ZR,null:tP,pairs:hP,set:pP,timestamp:lP,bool:rP,int:nP,merge:uP,omap:dP,seq:JR,str:XR},Nz=ow("safeLoad","load"),Lz=ow("safeLoadAll","loadAll"),kz=ow("safeDump","dump"),Mr={Type:Ez,Schema:Tz,FAILSAFE_SCHEMA:Az,JSON_SCHEMA:xz,CORE_SCHEMA:Cz,DEFAULT_SCHEMA:Iz,load:Rz,loadAll:Pz,dump:Oz,YAMLException:Fz,types:Dz,safeLoad:Nz,safeLoadAll:Lz,safeDump:kz};var Mz=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Mt=class{constructor(e){this.rootPath=e;this.uuidIndex=null}static{o(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await ur.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return ur.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await ur.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await ur.default.ensureDir(Sr.default.dirname(r)),await ur.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await ur.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await ur.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await ur.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await ur.default.remove(t)}async exists(e){let t=this.resolvePath(e);return ur.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=ur.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=Sr.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=ur.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),a=this.replaceFrontmatter(r,s);await this.modify(e,a)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await ur.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await ur.default.ensureDir(Sr.default.dirname(i)),await ur.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await ur.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(Mz.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let a=r.toLowerCase(),c=this.uuidIndex.get(a);return c?this.createFileObject(c):null}let i=Sr.default.dirname(this.resolvePath(t)),s;if(Sr.default.isAbsolute(r)?s=this.resolvePath(r):s=Sr.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),ur.default.existsSync(s)){let a=Sr.default.relative(this.rootPath,s);return this.createFileObject(a)}return null}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=Sr.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=Sr.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){return Promise.resolve()}resolvePath(e){return Sr.default.isAbsolute(e)?e:Sr.default.join(this.rootPath,e)}createFileObject(e){let t=Sr.default.basename(e),r=Sr.default.basename(e,Sr.default.extname(e)),i=Sr.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Sr.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=Mr.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=Mr.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
492
+ `:""}o(vz,"dump$1");var bz=vz,wz={dump:bz};function ow(n,e){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}o(ow,"renamed");var Ez=kr,Tz=KR,Az=eP,xz=sP,Cz=aP,Iz=nw,Rz=TP.load,Pz=TP.loadAll,Oz=wz.dump,Fz=yn,Dz={binary:fP,float:iP,map:ZR,null:tP,pairs:hP,set:pP,timestamp:lP,bool:rP,int:nP,merge:uP,omap:dP,seq:JR,str:XR},Nz=ow("safeLoad","load"),Lz=ow("safeLoadAll","loadAll"),kz=ow("safeDump","dump"),Mr={Type:Ez,Schema:Tz,FAILSAFE_SCHEMA:Az,JSON_SCHEMA:xz,CORE_SCHEMA:Cz,DEFAULT_SCHEMA:Iz,load:Rz,loadAll:Pz,dump:Oz,YAMLException:Fz,types:Dz,safeLoad:Nz,safeLoadAll:Lz,safeDump:kz};var Mz=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Mt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{o(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return nr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await nr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await nr.default.ensureDir(ir.default.dirname(r)),await nr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await nr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await nr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await nr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return nr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=nr.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=ir.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=nr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),a=this.replaceFrontmatter(r,s);await this.modify(e,a)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await nr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await nr.default.ensureDir(ir.default.dirname(i)),await nr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await nr.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(Mz.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let u=r.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=ir.default.dirname(this.resolvePath(t)),s;if(ir.default.isAbsolute(r)?s=this.resolvePath(r):s=ir.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),nr.default.existsSync(s)){let u=ir.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let a=r.toLowerCase(),c=this.basenameIndex.get(a);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(a);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=ir.default.relative(this.rootPath,e),r=ir.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=nr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let a=s.aliases,c=Array.isArray(a)?a:typeof a=="string"?[a]:[];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=ir.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=ir.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){return Promise.resolve()}resolvePath(e){return ir.default.isAbsolute(e)?e:ir.default.join(this.rootPath,e)}createFileObject(e){let t=ir.default.basename(e),r=ir.default.basename(e,ir.default.extname(e)),i=ir.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:ir.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=Mr.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=Mr.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
493
493
  ${r.trim()}
494
494
  ---`):`---
495
495
  ${r.trim()}
496
496
  ---
497
- ${e}`}shouldSkipDirectory(e){return e.startsWith(".")}walkDirectory(e,t){let r;try{r=ur.default.readdirSync(e,{withFileTypes:!0})}catch(i){let s=i;if(s.code==="EPERM"||s.code==="EACCES")return;throw i}for(let i of r){let s=Sr.default.join(e,i.name);if(i.isDirectory()){if(this.shouldSkipDirectory(i.name))continue;this.walkDirectory(s,t)}else i.isFile()&&t(s)}}};var Ll=class{static{o(this,"TableFormatter")}format(e){if(e.length===0)return"No results";let t=this.getAllVariables(e),r=e.map(i=>this.solutionToRow(i,t));return this.renderTable(t,r)}getAllVariables(e){let t=new Set;for(let r of e)for(let i of r.variables())t.add(i);return Array.from(t).sort()}solutionToRow(e,t){return t.map(r=>{let i=e.get(r);return i?this.formatValue(i.toString()):""})}formatValue(e){return e.length>50?e.substring(0,47)+"...":e}renderTable(e,t){let r=e.map((s,a)=>{let c=s.length+1,l=Math.max(...t.map(u=>u[a]?.length||0));return Math.max(c,l,10)}),i=[];i.push(this.renderSeparator(r,"top")),i.push(this.renderRow(e.map(s=>`?${s}`),r)),i.push(this.renderSeparator(r,"mid"));for(let s of t)i.push(this.renderRow(s,r));return i.push(this.renderSeparator(r,"bottom")),i.join(`
497
+ ${e}`}shouldSkipDirectory(e){return e.startsWith(".")}walkDirectory(e,t){let r;try{r=nr.default.readdirSync(e,{withFileTypes:!0})}catch(i){let s=i;if(s.code==="EPERM"||s.code==="EACCES")return;throw i}for(let i of r){let s=ir.default.join(e,i.name);if(i.isDirectory()){if(this.shouldSkipDirectory(i.name))continue;this.walkDirectory(s,t)}else i.isFile()&&t(s)}}};var Ll=class{static{o(this,"TableFormatter")}format(e){if(e.length===0)return"No results";let t=this.getAllVariables(e),r=e.map(i=>this.solutionToRow(i,t));return this.renderTable(t,r)}getAllVariables(e){let t=new Set;for(let r of e)for(let i of r.variables())t.add(i);return Array.from(t).sort()}solutionToRow(e,t){return t.map(r=>{let i=e.get(r);return i?this.formatValue(i.toString()):""})}formatValue(e){return e.length>50?e.substring(0,47)+"...":e}renderTable(e,t){let r=e.map((s,a)=>{let c=s.length+1,l=Math.max(...t.map(u=>u[a]?.length||0));return Math.max(c,l,10)}),i=[];i.push(this.renderSeparator(r,"top")),i.push(this.renderRow(e.map(s=>`?${s}`),r)),i.push(this.renderSeparator(r,"mid"));for(let s of t)i.push(this.renderRow(s,r));return i.push(this.renderSeparator(r,"bottom")),i.join(`
498
498
  `)}renderRow(e,t){return`\u2502 ${e.map((i,s)=>i.padEnd(t[s])).join(" \u2502 ")} \u2502`}renderSeparator(e,t){let r=t==="top"?"\u250C":t==="mid"?"\u251C":"\u2514",i=t==="top"?"\u2510":t==="mid"?"\u2524":"\u2518",a=t==="mid"?"\u2500\u253C\u2500":"\u2500"+(t==="mid"?"\u253C":"\u2500")+"\u2500",c=e.map(l=>"\u2500".repeat(l+2));return`${r}${c.join(a)}${i}`}};var kl=class{static{o(this,"JsonFormatter")}format(e){let t=e.map(r=>r.toJSON());return JSON.stringify(t,null,2)}};var ug=class{static{o(this,"CsvFormatter")}format(e){if(e.length===0)return"";let t=this.getAllVariables(e),r=[];r.push(t.join(","));for(let i of e){let s=t.map(a=>{let c=i.get(a);return c?this.escapeValue(c.toString()):""});r.push(s.join(","))}return r.join(`
499
499
  `)}getAllVariables(e){let t=new Set;for(let r of e)for(let i of r.variables())t.add(i);return Array.from(t).sort()}escapeValue(e){return e.includes(",")||e.includes('"')||e.includes(`
500
500
  `)||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}};var Ml=class{static{o(this,"TriplesFormatter")}formatNTriples(e){return e.map(t=>t.toString()).join(`
@@ -612,7 +612,7 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <
612
612
  \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${_}ms${d?" (from cache)":""}`),console.log(` Query execution: ${G}ms`),console.log(` Total time: ${F}ms`),console.log(` Triples scanned: ${f.length}`),console.log(` Results returned: ${z.length}`),e.useCache&&console.log(` Triple cache: ${d?"HIT":"MISS (rebuilt)"}`),c&&console.log(" Query result cache: MISS (cached for next run)"))}}catch(i){mO(i,r,t)}})}o(pO,"sparqlQueryCommand");function mO(n,e,t){let r=new wg;if(r.classifyError(n)!=="unknown"){let s=r.enhanceError(n,e);if(t==="json"){let a=J.error("VALIDATION_INVALID_FORMAT",s.message,2,{context:{errorType:s.type,suggestions:s.suggestions,line:s.line,column:s.column,queryContext:s.context?{startLine:s.context.startLine,endLine:s.context.endLine,errorLine:s.context.errorLine}:void 0},recovery:{message:s.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(a,null,2)),process.exit(2)}else console.error(r.formatForText(s)),process.exit(2)}D.handle(n)}o(mO,"handleSparqlError");function VH(n){if(n.includes("SELECT")||n.includes("CONSTRUCT")||n.includes("INSERT")||n.includes("DELETE"))return n;let e=(0,Gf.resolve)(n);return(0,Wl.existsSync)(e)?(0,Wl.readFileSync)(e,"utf-8"):n}o(VH,"loadQuery");async function UH(n,e,t){if(e.explain){let i=new vg,s=await i.analyze(n,{includeAlgebraPlan:!0,optimize:!e.noOptimize});if(t==="json"){let a=J.success(s);console.log(JSON.stringify(a,null,2))}else s.valid?(console.log(`\u2705 Query syntax is valid
613
613
  `),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let r=new Ut.ExoQLParser;try{let i=r.parse(n);if(i.type!=="update"){let a=new Ut.ExoQLAlgebraTranslator().translate(i);if(!e.noOptimize&&a.type!=="construct")a=new Ut.AlgebraOptimizer().optimize(a);else if(!e.noOptimize&&a.type==="construct"){let c=new Ut.AlgebraOptimizer,l=a;a={...l,where:c.optimize(l.where)}}}if(t==="json"){let s=J.success({valid:!0,queryType:hO(i),message:"Query syntax is valid"});console.log(JSON.stringify(s,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${hO(i)}`)}catch(i){mO(i,n,t)}}o(UH,"executeDryRun");function hO(n){return n.type==="update"?"UPDATE":"queryType"in n?n.queryType:"UNKNOWN"}o(hO,"getQueryType");function qH(n,e){switch(e){case"json":let t=new kl;console.log(t.format(n));break;case"csv":let r=new ug;console.log(r.format(n));break;case"table":default:let i=new Ll;console.log(i.format(n));break}}o(qH,"formatSelectResults");function WH(n,e){let t=new Ml;switch(e){case"json":console.log(t.formatJson(n));break;case"ntriples":console.log(t.formatNTriples(n));break;case"table":default:console.log(t.formatTable(n));break}}o(WH,"formatConstructResults");function GH(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"csv":if(n.length===0){console.log("");return}let t=Object.keys(n[0]);console.log(t.join(","));for(let i of n){let s=t.map(a=>{let c=i[a];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(n.length===0){console.log("No results.");return}let r=Object.keys(n[0]);console.log(r.join(" ")),console.log(r.map(()=>"---").join(" "));for(let i of n){let s=r.map(a=>String(i[a]??""));console.log(s.join(" "))}break}}o(GH,"formatCachedSelectResults");function zH(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"ntriples":for(let t of n)console.log(`<${t.subject}> <${t.predicate}> ${HH(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of n)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}o(zH,"formatCachedConstructResults");function HH(n){return Eg.formatObject(n)}o(HH,"formatNTriplesObject");function QH(n,e){for(let t of n){let r=[`${t.type.toUpperCase()}`];switch(t.inserted!==void 0&&r.push(`inserted: ${t.inserted}`),t.deleted!==void 0&&r.push(`deleted: ${t.deleted}`),r.push(t.success?"OK":"FAILED"),e){case"json":console.log(JSON.stringify(t,null,2));break;case"csv":n.indexOf(t)===0&&console.log("type,inserted,deleted,success"),console.log(`${t.type},${t.inserted??""},${t.deleted??""},${t.success}`);break;case"table":default:console.log(`\u2705 ${r.join(" | ")}`);break}}}o(QH,"formatUpdateResults");var gO=require("fs"),yO=require("path"),bs=Y(Vt());function _O(){return new xe("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").option("--no-inference","Disable RDFS subClassOf inference materialization").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,yO.resolve)(n.vault);if(!(0,gO.existsSync)(t))throw new Ee(t);let r=new ti(t),i=r.getCachePath();n.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await r.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),a=await r.buildCacheWithValidation({strict:n.strict??!1}),c=0;if(n.inference!==!1){let{triples:u}=await r.loadOrBuild(),f=new bs.InMemoryTripleStore;await f.addAll(u),c=await new bs.RDFSInferenceEngine().materialize(f);let h=new bs.NonInheritablePropertyRegistry;await h.initialize(f);let p=new bs.PropertyCardinalityRegistry;await p.initialize(f);let v=await new bs.PrototypeChainMaterializer(h,p).materialize(f);if(c+=v,c>0){let E=await f.match();await r.saveTriples(E),a.tripleCount+=c}e==="text"&&c>0&&console.log(`\u{1F9E0} Materialized ${c} inferred triples (RDFS + prototype chain)`)}let l=Date.now()-s;if(e==="json"){let u={action:"build",cachePath:i,tripleCount:a.tripleCount,durationMs:a.durationMs},f={summary:a.summary,skippedFiles:a.skippedFiles};if(n.stats){let d=await r.getCacheStats();if(d){let h={tripleCount:d.tripleCount,createdAt:d.createdAt.toISOString(),isValid:d.isValid,sizeBytes:d.sizeBytes,cachePath:i},p=J.success({cache:u,stats:h,validation:f},{durationMs:l});console.log(JSON.stringify(p,null,2))}}else{let d=J.success({cache:u,validation:f},{durationMs:l});console.log(JSON.stringify(d,null,2))}}else{if(a.skippedFiles.length>0){console.log(`
614
614
  \u26A0\uFE0F Files skipped due to IRI issues:`);for(let u of a.skippedFiles)console.log(` - ${u.path}`),console.log(` ${u.reason}`);console.log("")}if(console.log(`\u2705 Indexed ${a.summary.indexed} files, skipped ${a.summary.skipped} (total: ${a.summary.total})`),console.log(`\u{1F4CA} Created cache with ${a.tripleCount.toLocaleString()} triples at ${i}`),console.log(`\u23F1\uFE0F Build time: ${a.durationMs}ms`),n.stats){let u=await r.getCacheStats();u&&(console.log(`
615
- \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${YH(u.sizeBytes)}`))}}}catch(t){D.handle(t)}})}o(_O,"sparqlIndexCommand");function YH(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}o(YH,"formatBytes");function SO(){return new xe("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=new Ul,r=t.listTemplates();if(e==="json"){let i=J.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){D.handle(t)}})}o(SO,"sparqlTemplatesCommand");var xF=require("path");var dr=Y(Ga()),Ja=Y(require("path"));var VO=Y(FO(),1);var Hf=o(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var nQ={"[: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]},Qf=o(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),iQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),DO=o(n=>n.join(""),"rangesToString"),NO=o((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,a=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let v=n.charAt(s);if((v==="!"||v==="^")&&s===t+1){u=!0,s++;continue}if(v==="]"&&a&&!l){f=s+1;break}if(a=!0,v==="\\"&&!l){l=!0,s++;continue}if(v==="["&&!l){for(let[E,[b,A,R]]of Object.entries(nQ))if(n.startsWith(E,s)){if(d)return["$.",!1,n.length-t,!0];s+=E.length,R?i.push(b):r.push(b),c=c||A;continue e}}if(l=!1,d){v>d?r.push(Qf(d)+"-"+Qf(v)):v===d&&r.push(Qf(v)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Qf(v+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=v,s+=2;continue}r.push(Qf(v)),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 v=r[0].length===2?r[0].slice(-1):r[0];return[iQ(v),!1,f-t,!1]}let h="["+(u?"^":"")+DO(r)+"]",p="["+(u?"":"^")+DO(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var Vi=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var On,sQ=new Set(["!","?","+","*","@"]),Bw=o(n=>sQ.has(n),"isExtglobType"),LO=o(n=>Bw(n.type),"isExtglobAST"),aQ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),oQ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cQ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),kO=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),lQ="(?!(?:^|/)\\.\\.?(?:$|/))",Ag="(?!\\.)",uQ=new Set(["[","."]),fQ=new Set(["..","."]),dQ=new Set("().*{}+?[]^$\\!"),hQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Vw="[^/]",MO=Vw+"*?",jO=Vw+"+?",Jo=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#a=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=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.#_+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 On&&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.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let r=e.#t[t];if(!(r instanceof On&&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.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new On(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let a=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let v=r,E="";for(;v<e.length;){let b=e.charAt(v++);if(c||b==="\\"){c=!c,E+=b;continue}if(l){v===u+1?(b==="^"||b==="!")&&(f=!0):b==="]"&&!(v===u+2&&f)&&(l=!1),E+=b;continue}else if(b==="["){l=!0,u=v,f=!1,E+=b;continue}if(!i.noext&&Bw(b)&&e.charAt(v)==="("&&s<=a){t.push(E),E="";let R=new On(b,t);v=On.#g(e,R,v,i,s+1),t.push(R);continue}E+=b}return t.push(E),v}let d=r+1,h=new On(null,t),p=[],_="";for(;d<e.length;){let v=e.charAt(d++);if(c||v==="\\"){c=!c,_+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(f=!0):v==="]"&&!(d===u+2&&f)&&(l=!1),_+=v;continue}else if(v==="["){l=!0,u=d,f=!1,_+=v;continue}if(Bw(v)&&e.charAt(d)==="("&&(s<=a||t&&t.#y(v))){let b=t&&t.#y(v)?0:1;h.push(_),_="";let A=new On(v,h);h.push(A),d=On.#g(e,A,d,i,s+b);continue}if(v==="|"){h.push(_),_="",p.push(h),h=new On(null,t);continue}if(v===")")return _===""&&t.#t.length===0&&(t.#a=!0),h.push(_),_="",t.push(...p,h),d;_+=v}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,oQ)}#m(e,t=aQ){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=cQ){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new On(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!!kO.get(this.type)?.has(e)}#S(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=kO.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#a=!1}#v(){if(LO(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.#v(),this.#m(i)?(t=!1,this.#E(i,r)):this.#d(i)?(t=!1,this.#f(i,r)):this.#S(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#v();this.#l=void 0}static fromGlob(e,t={}){let r=new On(null,void 0,t);return On.#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.#v(),this.#p()),!LO(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[_,v,E,b]=typeof p=="string"?On.#x(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||E,this.#r=this.#r||b,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&fQ.has(this.#t[0]))){let _=uQ,v=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),E=!t&&!e&&_.has(u.charAt(0));f=v?lQ:E?Ag:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Vi(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,Vi(this.toString()),!1,!1]}let a=!r||e||t||!Ag?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let c="";if(this.type==="!"&&this.#a)c=(this.isStart()&&!t?Ag:"")+jO;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ag:"")+MO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+s+l}return[c,Vi(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=t.toRegExpSource(e);return this.#r=this.#r||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#x(e,t,r=!1){let i=!1,s="",a=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(dQ.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=NO(e,l);if(h){s+=f,a=a||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?jO:MO,t=!0;continue}else c=!1;if(u==="?"){s+=Vw,t=!0;continue}s+=hQ(u)}return[s,Vi(e),!!t,a]}};On=Jo;var Gl=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var jr=o((n,e,t={})=>(Hf(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Bn(e,t).match(n)),"minimatch"),pQ=/^\*+([^+@!?\*\[\(]*)$/,mQ=o(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),gQ=o(n=>e=>e.endsWith(n),"starDotExtTestDot"),yQ=o(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),_Q=o(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),SQ=/^\*+\.\*+$/,vQ=o(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),bQ=o(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),wQ=/^\.\*+$/,EQ=o(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),TQ=/^\*+$/,AQ=o(n=>n.length!==0&&!n.startsWith("."),"starTest"),xQ=o(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),CQ=/^\?+([^+@!?\*\[\(]*)?$/,IQ=o(([n,e=""])=>{let t=UO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),RQ=o(([n,e=""])=>{let t=qO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),PQ=o(([n,e=""])=>{let t=qO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),OQ=o(([n,e=""])=>{let t=UO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),UO=o(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),qO=o(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),WO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$O={win32:{sep:"\\"},posix:{sep:"/"}},FQ=WO==="win32"?$O.win32.sep:$O.posix.sep;jr.sep=FQ;var Ht=Symbol("globstar **");jr.GLOBSTAR=Ht;var DQ="[^/]",NQ=DQ+"*?",LQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",kQ="(?:(?!(?:\\/|^)\\.).)*?",MQ=o((n,e={})=>t=>jr(t,n,e),"filter");jr.filter=MQ;var ni=o((n,e={})=>Object.assign({},n,e),"ext"),jQ=o(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return jr;let e=jr;return Object.assign(o((r,i,s={})=>e(r,i,ni(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,ni(n,s))}static defaults(i){return e.defaults(ni(n,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,ni(n,a))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ni(n,s))}},unescape:o((r,i={})=>e.unescape(r,ni(n,i)),"unescape"),escape:o((r,i={})=>e.escape(r,ni(n,i)),"escape"),filter:o((r,i={})=>e.filter(r,ni(n,i)),"filter"),defaults:o(r=>e.defaults(ni(n,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,ni(n,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,ni(n,i)),"braceExpand"),match:o((r,i,s={})=>e.match(r,i,ni(n,s)),"match"),sep:e.sep,GLOBSTAR:Ht})},"defaults");jr.defaults=jQ;var GO=o((n,e={})=>(Hf(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,VO.default)(n)),"braceExpand");jr.braceExpand=GO;var $Q=o((n,e={})=>new Bn(n,e).makeRe(),"makeRe");jr.makeRe=$Q;var BQ=o((n,e,t={})=>{let r=new Bn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");jr.match=BQ;var BO=/[?*]|[+@!]\(.*?\)|\[|\]/,VQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Bn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Hf(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||WO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!BO.test(s[2]))&&!BO.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,a=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])a.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])a.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])a.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[s]),i++,s++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,_]=[e[d],t[h]];p.toLowerCase()===_.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Ht)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let a=t.indexOf(Ht,s),c=t.lastIndexOf(Ht),[l,u,f]=r?[t.slice(s,a),t.slice(a+1),[]]:[t.slice(s,a),t.slice(a+1,c),t.slice(c+1)];if(l.length){let A=e.slice(i,i+l.length);if(!this.#r(A,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let A=e.length-f.length;if(this.#r(e,f,r,A,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(A--,!this.#r(e,f,r,A,0)))return!1;d=f.length+1}}if(!u.length){let A=!!d;for(let R=i;R<e.length-d;R++){let B=String(e[R]);if(A=!0,B==="."||B===".."||!this.options.dot&&B.startsWith("."))return!1}return r||A}let h=[[[],0]],p=h[0],_=0,v=[0];for(let A of u)A===Ht?(v.push(_),p=[[],0],h.push(p)):(p[0].push(A),_++);let E=h.length-1,b=e.length-d;for(let A of h)A[1]=b-(v[E--]+A[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,a,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)&&a<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,a+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 a,c,l,u;for(a=i,c=s,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");let f=t[c],d=e[a];if(this.debug(t,f,d),f===!1||f===Ht)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(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return GO(this.pattern,this.options)}parse(e){Hf(e);let t=this.options;if(e==="**")return Ht;if(e==="")return"";let r,i=null;(r=e.match(TQ))?i=t.dot?xQ:AQ:(r=e.match(pQ))?i=(t.nocase?t.dot?_Q:yQ:t.dot?gQ:mQ)(r[1]):(r=e.match(CQ))?i=(t.nocase?t.dot?RQ:IQ:t.dot?PQ:OQ)(r):(r=e.match(SQ))?i=t.dot?bQ:vQ:(r=e.match(wQ))&&(i=EQ);let s=Jo.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?NQ:t.dot?LQ:kQ,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"?VQ(f):f===Ht?Ht:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==Ht||p===Ht||(p===void 0?h!==void 0&&h!==Ht?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==Ht&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=Ht))}),u.filter(f=>f!==Ht).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return jr.defaults(e).Minimatch}};jr.AST=Jo;jr.Minimatch=Bn;jr.escape=Gl;jr.unescape=Vi;var mF=require("node:url");var zl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,HO=new Set,Uw=typeof process=="object"&&process?process:{},QO=o((n,e,t,r)=>{typeof Uw.emitWarning=="function"?Uw.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),xg=globalThis.AbortController,zO=globalThis.AbortSignal;if(typeof xg>"u"){zO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},xg=class{static{o(this,"AbortController")}constructor(){e()}signal=new zO;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=Uw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{n&&(n=!1,QO("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 UQ=o(n=>!HO.has(n),"shouldWarn");var Qa=o(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),YO=o(n=>Qa(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Hl:null:null,"getUintArray"),Hl=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},qw=class n{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=YO(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]}},Yf=class n{static{o(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#a;#p;#g;#d;#m;#y;#f;#E;#T;#S;#w;#v;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#a,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:o(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:o(t=>e.#B(t),"moveToTail"),indexes:o(t=>e.#I(t),"indexes"),rindexes:o(t=>e.#R(t),"rindexes"),isStale:o(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.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:E,memoMethod:b,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:W,ignoreFetchAbort:we}=e;if(t!==0&&!Qa(t))throw new TypeError("max option must be a nonnegative integer");let z=t?YO(t):Array;if(!z)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=_||this.#n,this.sizeCalculation=v,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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=b,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=E,this.#v=!!E,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new z(t),this.#g=new z(t),this.#d=0,this.#m=0,this.#y=qw.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!B,this.allowStaleOnFetchAbort=!!W,this.ignoreFetchAbort=!!we,this.maxEntrySize!==0){if(this.#n!==0&&!Qa(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Qa(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Qa(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Qa(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}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 G="LRU_CACHE_UNBOUNDED";UQ(G)&&(HO.add(G),QO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#x(){let e=new Hl(this.#e),t=new Hl(this.#e);this.#S=e,this.#T=t,this.#F=(s,a,c=zl.now())=>{if(t[s]=a!==0?c:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#O(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?zl.now():0},this.#o=(s,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=o(()=>{let s=zl.now();if(this.ttlResolution>0){r=s;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return s},"getNow");this.getRemainingTTL=s=>{let a=this.#s.get(s);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let a=t[s],c=e[s];return!!c&&!!a&&(r||i())-a>c}}#C=o(()=>{},"#updateItemAge");#o=o(()=>{},"#statusTTL");#F=o(()=>{},"#setItemTTL");#A=o(()=>!1,"#isStale");#P(){let e=new Hl(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#h(r))return 0;if(!Qa(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Qa(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=o(e=>{},"#removeItemSize");#N=o((e,t,r)=>{},"#addItemSize");#L=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#R({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.#I())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*rentries(){for(let e of this.#R())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*keys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#h(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#a[e])&&(yield t)}}*values(){for(let e of this.#I())this.#a[e]!==void 0&&!this.#h(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#R())this.#a[e]!==void 0&&!this.#h(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#I()){let i=this.#a[r],s=this.#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.#I()){let i=this.#a[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.#R()){let i=this.#a[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.#R({allowStale:!0}))this.#A(t)&&(this.#O(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#a[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let a=this.#S[t],c=this.#T[t];if(a&&c){let l=a-(zl.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let r=this.#l[t],i=this.#a[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let a={value:s};if(this.#S&&this.#T){a.ttl=this.#S[t];let c=zl.now()-this.#T[t];a.start=Math.floor(Date.now()-c)}this.#E&&(a.size=this.#E[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=zl.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#O(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.#a[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#N(d,f,l),l&&(l.set="add"),u=!1;else{this.#B(d);let h=this.#a[d];if(t!==h){if(this.#v&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!a&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else a||(this.#w&&this.#r?.(h,e,"set"),this.#b&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#N(d,f,l),this.#a[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.#S&&this.#x(),this.#S&&(u||this.#F(d,i,s),l&&this.#o(l,d)),!a&&this.#b&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#a[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.#b&&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.#a[t];return this.#v&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#a[t]=void 0,this.#y.push(t)),this.#i===1?(this.#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 a=this.#a[s];if(this.#h(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#o(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#o(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#A(i))return;let s=this.#a[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#a[t];if(this.#h(s))return s;let a=new xg,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:r,context:i},u=o((v,E=!1)=>{let{aborted:b}=a.signal,A=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(b&&!E?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,A&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!A&&!E)return d(a.signal.reason);let R=p;return this.#a[t]===p&&(v===void 0?R.__staleWhileFetching?this.#a[t]=R.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},"cb"),f=o(v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),d(v)),"eb"),d=o(v=>{let{aborted:E}=a.signal,b=E&&r.allowStaleOnFetchAbort,A=b||r.allowStaleOnFetchRejection,R=A||r.noDeleteOnFetchRejection,B=p;if(this.#a[t]===p&&(!R||B.__staleWhileFetching===void 0?this.#O(e,"fetch"):b||(this.#a[t]=B.__staleWhileFetching)),A)return r.status&&B.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),B.__staleWhileFetching;if(B.__returned===B)throw v},"fetchFail"),h=o((v,E)=>{let b=this.#c?.(e,s,l);b&&b instanceof Promise&&b.then(A=>v(A===void 0?void 0:A),E),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=o(A=>u(A,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),_=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#a[t]=_,_}#h(e){if(!this.#v)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof xg}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=!1,status:b,signal:A}=t;if(!this.#v)return b&&(b.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:b});let R={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:b,signal:A},B=this.#s.get(e);if(B===void 0){b&&(b.fetch="miss");let W=this.#j(e,B,R,v);return W.__returned=W}else{let W=this.#a[B];if(this.#h(W)){let j=r&&W.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",j&&(b.returnedStale=!0)),j?W.__staleWhileFetching:W.__returned=W}let we=this.#A(B);if(!E&&!we)return b&&(b.fetch="hit"),this.#B(B),i&&this.#C(B),b&&this.#o(b,B),W;let z=this.#j(e,B,R,v),F=z.__staleWhileFetching!==void 0&&r;return b&&(b.fetch=we?"stale":"refresh",F&&we&&(b.returnedStale=!0)),F?z.__staleWhileFetching:z.__returned=z}}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.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...a}=t,c=this.get(e,a);if(!s&&c!==void 0)return c;let l=r(e,c,{options:a,context:i});return this.set(e,l,a),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#a[c],u=this.#h(l);return a&&this.#o(a,c),this.#A(c)?(a&&(a.get="stale"),u?(a&&r&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),a&&r&&(a.returnedStale=!0),r?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#B(c),i&&this.#C(c),l))}else a&&(a.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#B(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.#O(e,"delete")}#O(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.#V(t);else{this.#D(i);let s=this.#a[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#a[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let a=this.#g[i];this.#p[a]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#V("delete")}#V(e){for(let t of this.#R({allowStale:!0})){let r=this.#a[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#a.fill(void 0),this.#l.fill(void 0),this.#S&&this.#T&&(this.#S.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.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Kl=require("node:path"),sF=require("node:url"),Ts=require("fs"),JQ=Y(require("node:fs"),1),Xa=require("node:fs/promises");var Dg=require("node:events"),Kw=Y(require("node:stream"),1),eF=require("node:string_decoder");var KO=typeof process=="object"&&process?process:{stdout:null,stderr:null},qQ=o(n=>!!n&&typeof n=="object"&&(n instanceof Ka||n instanceof Kw.default||WQ(n)||GQ(n)),"isStream"),WQ=o(n=>!!n&&typeof n=="object"&&n instanceof Dg.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==Kw.default.Writable.prototype.pipe,"isReadable"),GQ=o(n=>!!n&&typeof n=="object"&&n instanceof Dg.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),ca=Symbol("EOF"),la=Symbol("maybeEmitEnd"),Ya=Symbol("emittedEnd"),Cg=Symbol("emittingEnd"),Kf=Symbol("emittedError"),Ig=Symbol("closed"),XO=Symbol("read"),Rg=Symbol("flush"),JO=Symbol("flushChunk"),Ui=Symbol("encoding"),Ql=Symbol("decoder"),wr=Symbol("flowing"),Xf=Symbol("paused"),Yl=Symbol("resume"),Er=Symbol("buffer"),_n=Symbol("pipes"),Tr=Symbol("bufferLength"),Ww=Symbol("bufferPush"),Pg=Symbol("bufferShift"),Jr=Symbol("objectMode"),Qt=Symbol("destroyed"),Gw=Symbol("error"),zw=Symbol("emitData"),ZO=Symbol("emitEnd"),Hw=Symbol("emitEnd2"),ws=Symbol("async"),Qw=Symbol("abort"),Og=Symbol("aborted"),Jf=Symbol("signal"),Zo=Symbol("dataListeners"),Vn=Symbol("discarded"),Zf=o(n=>Promise.resolve().then(n),"defer"),zQ=o(n=>n(),"nodefer"),HQ=o(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),QQ=o(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),YQ=o(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),Fg=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Yl](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Yw=class extends Fg{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},KQ=o(n=>!!n.objectMode,"isObjectModeOptions"),XQ=o(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Ka=class extends Dg.EventEmitter{static{o(this,"Minipass")}[wr]=!1;[Xf]=!1;[_n]=[];[Er]=[];[Jr];[Ui];[ws];[Ql];[ca]=!1;[Ya]=!1;[Cg]=!1;[Ig]=!1;[Kf]=null;[Tr]=0;[Qt]=!1;[Jf];[Og]=!1;[Zo]=0;[Vn]=!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");KQ(t)?(this[Jr]=!0,this[Ui]=null):XQ(t)?(this[Ui]=t.encoding,this[Jr]=!1):(this[Jr]=!1,this[Ui]=null),this[ws]=!!t.async,this[Ql]=this[Ui]?new eF.StringDecoder(this[Ui]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Er],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[_n],"get")});let{signal:r}=t;r&&(this[Jf]=r,r.aborted?this[Qw]():r.addEventListener("abort",()=>this[Qw]()))}get bufferLength(){return this[Tr]}get encoding(){return this[Ui]}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[Jr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ws]}set async(e){this[ws]=this[ws]||!!e}[Qw](){this[Og]=!0,this.emit("abort",this[Jf]?.reason),this.destroy(this[Jf]?.reason)}get aborted(){return this[Og]}set aborted(e){}write(e,t,r){if(this[Og])return!1;if(this[ca])throw new Error("write after end");if(this[Qt])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[ws]?Zf:zQ;if(!this[Jr]&&!Buffer.isBuffer(e)){if(YQ(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(QQ(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Jr]?(this[wr]&&this[Tr]!==0&&this[Rg](!0),this[wr]?this.emit("data",e):this[Ww](e),this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr]):e.length?(typeof e=="string"&&!(t===this[Ui]&&!this[Ql]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ui]&&(e=this[Ql].write(e)),this[wr]&&this[Tr]!==0&&this[Rg](!0),this[wr]?this.emit("data",e):this[Ww](e),this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr]):(this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr])}read(e){if(this[Qt])return null;if(this[Vn]=!1,this[Tr]===0||e===0||e&&e>this[Tr])return this[la](),null;this[Jr]&&(e=null),this[Er].length>1&&!this[Jr]&&(this[Er]=[this[Ui]?this[Er].join(""):Buffer.concat(this[Er],this[Tr])]);let t=this[XO](e||null,this[Er][0]);return this[la](),t}[XO](e,t){if(this[Jr])this[Pg]();else{let r=t;e===r.length||e===null?this[Pg]():typeof r=="string"?(this[Er][0]=r.slice(e),t=r.slice(0,e),this[Tr]-=e):(this[Er][0]=r.subarray(e),t=r.subarray(0,e),this[Tr]-=e)}return this.emit("data",t),!this[Er].length&&!this[ca]&&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[ca]=!0,this.writable=!1,(this[wr]||!this[Xf])&&this[la](),this}[Yl](){this[Qt]||(!this[Zo]&&!this[_n].length&&(this[Vn]=!0),this[Xf]=!1,this[wr]=!0,this.emit("resume"),this[Er].length?this[Rg]():this[ca]?this[la]():this.emit("drain"))}resume(){return this[Yl]()}pause(){this[wr]=!1,this[Xf]=!0,this[Vn]=!1}get destroyed(){return this[Qt]}get flowing(){return this[wr]}get paused(){return this[Xf]}[Ww](e){this[Jr]?this[Tr]+=1:this[Tr]+=e.length,this[Er].push(e)}[Pg](){return this[Jr]?this[Tr]-=1:this[Tr]-=this[Er][0].length,this[Er].shift()}[Rg](e=!1){do;while(this[JO](this[Pg]())&&this[Er].length);!e&&!this[Er].length&&!this[ca]&&this.emit("drain")}[JO](e){return this.emit("data",e),this[wr]}pipe(e,t){if(this[Qt])return e;this[Vn]=!1;let r=this[Ya];return t=t||{},e===KO.stdout||e===KO.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[_n].push(t.proxyErrors?new Yw(this,e,t):new Fg(this,e,t)),this[ws]?Zf(()=>this[Yl]()):this[Yl]()),e}unpipe(e){let t=this[_n].find(r=>r.dest===e);t&&(this[_n].length===1?(this[wr]&&this[Zo]===0&&(this[wr]=!1),this[_n]=[]):this[_n].splice(this[_n].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[Vn]=!1,this[Zo]++,!this[_n].length&&!this[wr]&&this[Yl]();else if(e==="readable"&&this[Tr]!==0)super.emit("readable");else if(HQ(e)&&this[Ya])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Kf]){let i=t;this[ws]?Zf(()=>i.call(this,this[Kf])):i.call(this,this[Kf])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Zo]=this.listeners("data").length,this[Zo]===0&&!this[Vn]&&!this[_n].length&&(this[wr]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Zo]=0,!this[Vn]&&!this[_n].length&&(this[wr]=!1)),t}get emittedEnd(){return this[Ya]}[la](){!this[Cg]&&!this[Ya]&&!this[Qt]&&this[Er].length===0&&this[ca]&&(this[Cg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ig]&&this.emit("close"),this[Cg]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==Qt&&this[Qt])return!1;if(e==="data")return!this[Jr]&&!r?!1:this[ws]?(Zf(()=>this[zw](r)),!0):this[zw](r);if(e==="end")return this[ZO]();if(e==="close"){if(this[Ig]=!0,!this[Ya]&&!this[Qt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Kf]=r,super.emit(Gw,r);let s=!this[Jf]||this.listeners("error").length?super.emit("error",r):!1;return this[la](),s}else if(e==="resume"){let s=super.emit("resume");return this[la](),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[la](),i}[zw](e){for(let r of this[_n])r.dest.write(e)===!1&&this.pause();let t=this[Vn]?!1:super.emit("data",e);return this[la](),t}[ZO](){return this[Ya]?!1:(this[Ya]=!0,this.readable=!1,this[ws]?(Zf(()=>this[Hw]()),!0):this[Hw]())}[Hw](){if(this[Ql]){let t=this[Ql].end();if(t){for(let r of this[_n])r.dest.write(t);this[Vn]||super.emit("data",t)}}for(let t of this[_n])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Jr]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Jr]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Jr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ui]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Qt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Vn]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ca])return t();let s,a,c=o(d=>{this.off("data",l),this.off("end",u),this.off(Qt,f),t(),a(d)},"onerr"),l=o(d=>{this.off("error",c),this.off("end",u),this.off(Qt,f),this.pause(),s({value:d,done:!!this[ca]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",l),this.off(Qt,f),t(),s({done:!0,value:void 0})},"onend"),f=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{a=h,s=d,this.once(Qt,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[Vn]=!1;let e=!1,t=o(()=>(this.pause(),this.off(Gw,t),this.off(Qt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Gw,t),this.once(Qt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Qt])return e?this.emit("error",e):this.emit(Qt),this;this[Qt]=!0,this[Vn]=!0,this[Er].length=0,this[Tr]=0;let t=this;return typeof t.close=="function"&&!this[Ig]&&t.close(),e?this.emit("error",e):this.emit(Qt),this}static get isStream(){return qQ}};var ZQ=Ts.realpathSync.native,td={lstatSync:Ts.lstatSync,readdir:Ts.readdir,readdirSync:Ts.readdirSync,readlinkSync:Ts.readlinkSync,realpathSync:ZQ,promises:{lstat:Xa.lstat,readdir:Xa.readdir,readlink:Xa.readlink,realpath:Xa.realpath}},aF=o(n=>!n||n===td||n===JQ?td:{...td,...n,promises:{...td.promises,...n.promises||{}}},"fsFromOption"),oF=/^\\\\\?\\([a-z]:)\\?$/i,eY=o(n=>n.replace(/\//g,"\\").replace(oF,"$1\\"),"uncToDrive"),tY=/[\\\/]/,si=0,cF=1,lF=2,Es=4,uF=6,fF=8,ec=10,dF=12,ii=15,ed=~ii,Xw=16,tF=32,rd=64,qi=128,Ng=256,kg=512,rF=rd|qi|kg,rY=1023,Jw=o(n=>n.isFile()?fF:n.isDirectory()?Es:n.isSymbolicLink()?ec:n.isCharacterDevice()?lF:n.isBlockDevice()?uF:n.isSocket()?dF:n.isFIFO()?cF:si,"entToType"),nF=new Map,nd=o(n=>{let e=nF.get(n);if(e)return e;let t=n.normalize("NFKD");return nF.set(n,t),t},"normalize"),iF=new Map,Lg=o(n=>{let e=iF.get(n);if(e)return e;let t=nd(n.toLowerCase());return iF.set(n,t),t},"normalizeNocase"),Mg=class extends Yf{static{o(this,"ResolveCache")}constructor(){super({max:256})}},Zw=class extends Yf{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}},hF=Symbol("PathScurry setAsCwd"),Zr=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#a;get blocks(){return this.#a}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#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}#S;#w;#v;#b;#x;#C;#o;#F;#A;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=si,r,i,s,a,c){this.name=e,this.#S=s?Lg(e):nd(e),this.#o=t&rY,this.nocase=s,this.roots=i,this.root=r||this,this.#F=a,this.#v=c.fullpath,this.#x=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=aF(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#o&=~Xw,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Lg(e):nd(e);for(let l of r)if(l.#S===i)return l;let s=this.parent?this.sep:"",a=this.#v?this.#v+s+e:void 0,c=this.newChild(e,si,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=qi),r.push(c),c}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.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#v=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&ii)===si}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&ii)===fF}isDirectory(){return(this.#o&ii)===Es}isCharacterDevice(){return(this.#o&ii)===lF}isBlockDevice(){return(this.#o&ii)===uF}isFIFO(){return(this.#o&ii)===cF}isSocket(){return(this.#o&ii)===dF}isSymbolicLink(){return(this.#o&ec)===ec}lstatCached(){return this.#o&tF?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#P}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.#o&ii;return!(e!==si&&e!==ec||this.#o&Ng||this.#o&qi)}calledReaddir(){return!!(this.#o&Xw)}isENOENT(){return!!(this.#o&qi)}isNamed(e){return this.nocase?this.#S===Lg(e):this.#S===nd(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}}#N(e){this.#o|=Xw;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#o&qi||(this.#o=(this.#o|qi)&ed,this.#I())}#I(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#R(){this.#o|=kg,this.#k()}#k(){if(this.#o&rd)return;let e=this.#o;(e&ii)===Es&&(e&=ed),this.#o=e|rd,this.#I()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#L()}#h(e=""){let t=this.#o;t|=Ng,e==="ENOENT"&&(t|=qi),(e==="EINVAL"||e==="UNKNOWN")&&(t&=ed),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#O(e,t)||this.#B(e,t)}#B(e,t){let r=Jw(e),i=this.newChild(e.name,r,{parent:this}),s=i.#o&ii;return s!==Es&&s!==ec&&s!==si&&(i.#o|=rd),t.unshift(i),t.provisional++,i}#O(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?Lg(e.name):nd(e.name))===i.#S)return this.#V(e,i,r,t)}}#V(e,t,r,i){let s=t.name;return t.#o=t.#o&ed|Jw(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&qi)===0)try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#o&qi)===0)try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:_,mtimeMs:v,nlink:E,rdev:b,size:A,uid:R}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=a,this.#a=c,this.#E=l,this.#d=u,this.#n=f,this.#_=d,this.#s=h,this.#r=p,this.#f=_,this.#g=v,this.#t=E,this.#i=b,this.#l=A,this.#c=R;let B=Jw(e);this.#o=this.#o&ed|B|tF,B!==si&&B!==Es&&B!==ec&&(this.#o|=rd)}#q=[];#W=!1;#z(e){this.#W=!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.#W)return;this.#W=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,a)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of a)this.#$(c,r);this.#N(r)}this.#z(r.slice(0,r.provisional))})}#U;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.#U)await this.#U;else{let r=o(()=>{},"resolve");this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#M(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&rF)return!1;let e=ii&this.#o;return e===si||e===Es||e===ec}shouldWalk(e,t){return(this.#o&Es)===Es&&!(this.#o&rF)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!((kg|Ng|qi)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#P)return this.#P;if(!((kg|Ng|qi)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#R()}}[hF](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.#x=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#x=void 0,i.#C=void 0,i=i.parent}},jg=class n extends Zr{static{o(this,"PathWin32")}sep="\\";splitSep=tY;constructor(e,t=si,r,i,s,a,c){super(e,t,r,i,s,a,c)}newChild(e,t=si,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Kl.win32.parse(e).root}getRoot(e){if(e=eY(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 Xl(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(oF,"$1\\"),e===t}},$g=class n extends Zr{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=si,r,i,s,a,c){super(e,t,r,i,s,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=si,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Bg=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:a=td}={}){this.#t=aF(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,sF.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Mg,this.#n=new Mg,this.#r=new Zw(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 _ of l){let v=f--;u=u.child(_,{relative:new Array(v).fill("..").join(d),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(p?"":d)+_}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=o((d,h)=>{l.add(d),d.readdirCB((p,_)=>{if(p)return h(p);let v=_.length;if(!v)return h();let E=o(()=>{--v===0&&h()},"next");for(let b of _)(!s||s(b))&&c.push(r?b:b.fullpath()),i&&b.isSymbolicLink()?b.realpath().then(A=>A?.isUnknown()?A.lstat():A).then(A=>A?.shouldWalk(l,a)?u(A,E):E()):b.shouldWalk(l,a)?u(b,E):E()},!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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let 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,a)&&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 Zr||(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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,a)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ka({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=o(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=o((E,b,A=!1)=>{if(E)return c.emit("error",E);if(i&&!A){let R=[];for(let B of b)B.isSymbolicLink()&&R.push(B.realpath().then(W=>W?.isUnknown()?W.lstat():W));if(R.length){Promise.all(R).then(()=>_(null,b,!0));return}}for(let R of b)R&&(!s||s(R))&&(c.write(r?R:R.fullpath())||(h=!0));f--;for(let R of b){let B=R.realpathCached()||R;B.shouldWalk(l,a)&&u.push(B)}h&&!c.flowing?c.once("drain",d):v||d()},"onReaddir"),v=!0;p.readdirCB(_,!0),v=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ka({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=o(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=p.readdirSync();for(let v of _)(!s||s(v))&&(c.write(r?v:v.fullpath())||(h=!0));f--;for(let v of _){let E=v;if(v.isSymbolicLink()){if(!(i&&(E=v.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(l,a)&&u.push(E)}}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[hF](t)}},Xl=class extends Bg{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Kl.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Kl.win32.parse(e).root.toUpperCase()}newRoot(e){return new jg(this.rootPath,Es,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Jl=class extends Bg{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Kl.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new $g(this.rootPath,Es,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},id=class extends Jl{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},Fhe=process.platform==="win32"?jg:$g,pF=process.platform==="win32"?Xl:process.platform==="darwin"?id:Jl;var nY=o(n=>n.length>=1,"isPatternList"),iY=o(n=>n.length>=1,"isGlobList"),Zl=class n{static{o(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!nY(e))throw new TypeError("empty pattern list");if(!iY(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,a,c,l,...u]=this.#e,[f,d,h,p,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let v=[s,a,c,l,""].join("/"),E=[f,d,h,p,""].join("/");this.#e=[v,...u],this.#n=[E,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[c,...l]=this.#n;a[0]===""&&(a.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...a],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ht}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(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 sY=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",eu=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:a=sY}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Bn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let a=new Zl(i,s,0,this.platform),c=new Bn(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(s))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var eE=class n{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},tE=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},rE=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},sd=class n{static{o(this,"Processor")}hasWalkedCache;matches=new tE;subwalks=new rE;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new eE}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let a=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let 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===Ht){(!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 a of r){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Ht?i.testGlobstar(s,a,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var aY=o((n,e)=>typeof n=="string"?new eu([n],e):Array.isArray(n)?new eu(n,e):n,"makeIgnore"),Vg=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=aY(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?a+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new sd(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,a):c.readdirCB((u,f)=>this.walkCB3(c,f,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new sd(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),a);a()}},ad=class extends Vg{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},od=class extends Vg{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Ka({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 oY=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Wi=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,mF.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||oY,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"?Xl:t.platform==="darwin"?id:t.platform?Jl:pF;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 Bn(l,i)),[a,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Zl(l,f,0,this.platform)})}async walk(){return[...await new ad(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 ad(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 od(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 od(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 nE=o((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Bn(t,e).hasMagic())return!0;return!1},"hasMagic");function qg(n,e={}){return new Wi(n,e).streamSync()}o(qg,"globStreamSync");function yF(n,e={}){return new Wi(n,e).stream()}o(yF,"globStream");function _F(n,e={}){return new Wi(n,e).walkSync()}o(_F,"globSync");async function gF(n,e={}){return new Wi(n,e).walk()}o(gF,"glob_");function Wg(n,e={}){return new Wi(n,e).iterateSync()}o(Wg,"globIterateSync");function SF(n,e={}){return new Wi(n,e).iterate()}o(SF,"globIterate");var cY=qg,lY=Object.assign(yF,{sync:qg}),uY=Wg,fY=Object.assign(SF,{sync:Wg}),dY=Object.assign(_F,{stream:qg,iterate:Wg}),Ug=Object.assign(gF,{glob:gF,globSync:_F,sync:dY,globStream:yF,stream:lY,globStreamSync:qg,streamSync:cY,globIterate:SF,iterate:fY,globIterateSync:Wg,iterateSync:uY,Glob:Wi,hasMagic:nE,escape:Gl,unescape:Vi});Ug.glob=Ug;var tc=Y(Vt());var It=class{constructor(e){this.rootPath=e}static{o(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await dr.default.pathExists(t))throw new tc.FileNotFoundError(e);return dr.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return dr.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await dr.default.pathExists(r))throw new tc.FileAlreadyExistsError(e);return await dr.default.ensureDir(Ja.default.dirname(r)),await dr.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await dr.default.pathExists(r))throw new tc.FileNotFoundError(e);await dr.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await dr.default.ensureDir(Ja.default.dirname(r)),await dr.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await dr.default.pathExists(t))throw new tc.FileNotFoundError(e);await dr.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await dr.default.pathExists(r))throw new tc.FileNotFoundError(e);await dr.default.ensureDir(Ja.default.dirname(i)),await dr.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await dr.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await dr.default.pathExists(t)?(await dr.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=Ja.default.join(t,"**/*.md");return(await Ug(r,{nodir:!0})).map(a=>Ja.default.relative(this.rootPath,a))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return Ja.default.isAbsolute(e)?e:Ja.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=Mr.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(a=>this.normalizeValue(a)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var cd=Y(require("path")),iE=Y(Ga());var tu=class{constructor(e){this.vaultRoot=e}static{o(this,"PathResolver")}resolve(e){if(!cd.default.isAbsolute(e))return cd.default.resolve(this.vaultRoot,e);let t=cd.default.resolve(e),r=cd.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Qe(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!iE.default.existsSync(e))throw new Of(e);if(!iE.default.statSync(e).isFile())throw new Qe(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Qe(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var AF=Y(Vt());var vF=Y(Vt());var Gi=class{static{o(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return vF.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
615
+ \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${YH(u.sizeBytes)}`))}}}catch(t){D.handle(t)}})}o(_O,"sparqlIndexCommand");function YH(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}o(YH,"formatBytes");function SO(){return new xe("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=new Ul,r=t.listTemplates();if(e==="json"){let i=J.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){D.handle(t)}})}o(SO,"sparqlTemplatesCommand");var xF=require("path");var hr=Y(Ga()),Ja=Y(require("path"));var VO=Y(FO(),1);var Hf=o(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var nQ={"[: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]},Qf=o(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),iQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),DO=o(n=>n.join(""),"rangesToString"),NO=o((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,a=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let v=n.charAt(s);if((v==="!"||v==="^")&&s===t+1){u=!0,s++;continue}if(v==="]"&&a&&!l){f=s+1;break}if(a=!0,v==="\\"&&!l){l=!0,s++;continue}if(v==="["&&!l){for(let[E,[b,A,R]]of Object.entries(nQ))if(n.startsWith(E,s)){if(d)return["$.",!1,n.length-t,!0];s+=E.length,R?i.push(b):r.push(b),c=c||A;continue e}}if(l=!1,d){v>d?r.push(Qf(d)+"-"+Qf(v)):v===d&&r.push(Qf(v)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Qf(v+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=v,s+=2;continue}r.push(Qf(v)),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 v=r[0].length===2?r[0].slice(-1):r[0];return[iQ(v),!1,f-t,!1]}let h="["+(u?"^":"")+DO(r)+"]",p="["+(u?"":"^")+DO(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var Vi=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var On,sQ=new Set(["!","?","+","*","@"]),Bw=o(n=>sQ.has(n),"isExtglobType"),LO=o(n=>Bw(n.type),"isExtglobAST"),aQ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),oQ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cQ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),kO=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),lQ="(?!(?:^|/)\\.\\.?(?:$|/))",Ag="(?!\\.)",uQ=new Set(["[","."]),fQ=new Set(["..","."]),dQ=new Set("().*{}+?[]^$\\!"),hQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Vw="[^/]",MO=Vw+"*?",jO=Vw+"+?",Jo=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#a=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=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.#_+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 On&&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.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let r=e.#t[t];if(!(r instanceof On&&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.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new On(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let a=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let v=r,E="";for(;v<e.length;){let b=e.charAt(v++);if(c||b==="\\"){c=!c,E+=b;continue}if(l){v===u+1?(b==="^"||b==="!")&&(f=!0):b==="]"&&!(v===u+2&&f)&&(l=!1),E+=b;continue}else if(b==="["){l=!0,u=v,f=!1,E+=b;continue}if(!i.noext&&Bw(b)&&e.charAt(v)==="("&&s<=a){t.push(E),E="";let R=new On(b,t);v=On.#g(e,R,v,i,s+1),t.push(R);continue}E+=b}return t.push(E),v}let d=r+1,h=new On(null,t),p=[],_="";for(;d<e.length;){let v=e.charAt(d++);if(c||v==="\\"){c=!c,_+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(f=!0):v==="]"&&!(d===u+2&&f)&&(l=!1),_+=v;continue}else if(v==="["){l=!0,u=d,f=!1,_+=v;continue}if(Bw(v)&&e.charAt(d)==="("&&(s<=a||t&&t.#y(v))){let b=t&&t.#y(v)?0:1;h.push(_),_="";let A=new On(v,h);h.push(A),d=On.#g(e,A,d,i,s+b);continue}if(v==="|"){h.push(_),_="",p.push(h),h=new On(null,t);continue}if(v===")")return _===""&&t.#t.length===0&&(t.#a=!0),h.push(_),_="",t.push(...p,h),d;_+=v}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,oQ)}#m(e,t=aQ){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=cQ){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new On(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!!kO.get(this.type)?.has(e)}#S(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=kO.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#a=!1}#v(){if(LO(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.#v(),this.#m(i)?(t=!1,this.#E(i,r)):this.#d(i)?(t=!1,this.#f(i,r)):this.#S(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#v();this.#l=void 0}static fromGlob(e,t={}){let r=new On(null,void 0,t);return On.#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.#v(),this.#p()),!LO(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[_,v,E,b]=typeof p=="string"?On.#x(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||E,this.#r=this.#r||b,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&fQ.has(this.#t[0]))){let _=uQ,v=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),E=!t&&!e&&_.has(u.charAt(0));f=v?lQ:E?Ag:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Vi(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,Vi(this.toString()),!1,!1]}let a=!r||e||t||!Ag?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let c="";if(this.type==="!"&&this.#a)c=(this.isStart()&&!t?Ag:"")+jO;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ag:"")+MO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+s+l}return[c,Vi(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=t.toRegExpSource(e);return this.#r=this.#r||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#x(e,t,r=!1){let i=!1,s="",a=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(dQ.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=NO(e,l);if(h){s+=f,a=a||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?jO:MO,t=!0;continue}else c=!1;if(u==="?"){s+=Vw,t=!0;continue}s+=hQ(u)}return[s,Vi(e),!!t,a]}};On=Jo;var Gl=o((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var jr=o((n,e,t={})=>(Hf(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Bn(e,t).match(n)),"minimatch"),pQ=/^\*+([^+@!?\*\[\(]*)$/,mQ=o(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),gQ=o(n=>e=>e.endsWith(n),"starDotExtTestDot"),yQ=o(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),_Q=o(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),SQ=/^\*+\.\*+$/,vQ=o(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),bQ=o(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),wQ=/^\.\*+$/,EQ=o(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),TQ=/^\*+$/,AQ=o(n=>n.length!==0&&!n.startsWith("."),"starTest"),xQ=o(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),CQ=/^\?+([^+@!?\*\[\(]*)?$/,IQ=o(([n,e=""])=>{let t=UO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),RQ=o(([n,e=""])=>{let t=qO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),PQ=o(([n,e=""])=>{let t=qO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),OQ=o(([n,e=""])=>{let t=UO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),UO=o(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),qO=o(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),WO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$O={win32:{sep:"\\"},posix:{sep:"/"}},FQ=WO==="win32"?$O.win32.sep:$O.posix.sep;jr.sep=FQ;var Ht=Symbol("globstar **");jr.GLOBSTAR=Ht;var DQ="[^/]",NQ=DQ+"*?",LQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",kQ="(?:(?!(?:\\/|^)\\.).)*?",MQ=o((n,e={})=>t=>jr(t,n,e),"filter");jr.filter=MQ;var ni=o((n,e={})=>Object.assign({},n,e),"ext"),jQ=o(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return jr;let e=jr;return Object.assign(o((r,i,s={})=>e(r,i,ni(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,ni(n,s))}static defaults(i){return e.defaults(ni(n,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,ni(n,a))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ni(n,s))}},unescape:o((r,i={})=>e.unescape(r,ni(n,i)),"unescape"),escape:o((r,i={})=>e.escape(r,ni(n,i)),"escape"),filter:o((r,i={})=>e.filter(r,ni(n,i)),"filter"),defaults:o(r=>e.defaults(ni(n,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,ni(n,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,ni(n,i)),"braceExpand"),match:o((r,i,s={})=>e.match(r,i,ni(n,s)),"match"),sep:e.sep,GLOBSTAR:Ht})},"defaults");jr.defaults=jQ;var GO=o((n,e={})=>(Hf(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,VO.default)(n)),"braceExpand");jr.braceExpand=GO;var $Q=o((n,e={})=>new Bn(n,e).makeRe(),"makeRe");jr.makeRe=$Q;var BQ=o((n,e,t={})=>{let r=new Bn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");jr.match=BQ;var BO=/[?*]|[+@!]\(.*?\)|\[|\]/,VQ=o(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Bn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Hf(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||WO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!BO.test(s[2]))&&!BO.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,a=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])a.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])a.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])a.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[s]),i++,s++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,_]=[e[d],t[h]];p.toLowerCase()===_.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Ht)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let a=t.indexOf(Ht,s),c=t.lastIndexOf(Ht),[l,u,f]=r?[t.slice(s,a),t.slice(a+1),[]]:[t.slice(s,a),t.slice(a+1,c),t.slice(c+1)];if(l.length){let A=e.slice(i,i+l.length);if(!this.#r(A,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let A=e.length-f.length;if(this.#r(e,f,r,A,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(A--,!this.#r(e,f,r,A,0)))return!1;d=f.length+1}}if(!u.length){let A=!!d;for(let R=i;R<e.length-d;R++){let B=String(e[R]);if(A=!0,B==="."||B===".."||!this.options.dot&&B.startsWith("."))return!1}return r||A}let h=[[[],0]],p=h[0],_=0,v=[0];for(let A of u)A===Ht?(v.push(_),p=[[],0],h.push(p)):(p[0].push(A),_++);let E=h.length-1,b=e.length-d;for(let A of h)A[1]=b-(v[E--]+A[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,a,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)&&a<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,a+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 a,c,l,u;for(a=i,c=s,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");let f=t[c],d=e[a];if(this.debug(t,f,d),f===!1||f===Ht)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(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return GO(this.pattern,this.options)}parse(e){Hf(e);let t=this.options;if(e==="**")return Ht;if(e==="")return"";let r,i=null;(r=e.match(TQ))?i=t.dot?xQ:AQ:(r=e.match(pQ))?i=(t.nocase?t.dot?_Q:yQ:t.dot?gQ:mQ)(r[1]):(r=e.match(CQ))?i=(t.nocase?t.dot?RQ:IQ:t.dot?PQ:OQ)(r):(r=e.match(SQ))?i=t.dot?bQ:vQ:(r=e.match(wQ))&&(i=EQ);let s=Jo.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?NQ:t.dot?LQ:kQ,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"?VQ(f):f===Ht?Ht:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==Ht||p===Ht||(p===void 0?h!==void 0&&h!==Ht?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==Ht&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=Ht))}),u.filter(f=>f!==Ht).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return jr.defaults(e).Minimatch}};jr.AST=Jo;jr.Minimatch=Bn;jr.escape=Gl;jr.unescape=Vi;var mF=require("node:url");var zl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,HO=new Set,Uw=typeof process=="object"&&process?process:{},QO=o((n,e,t,r)=>{typeof Uw.emitWarning=="function"?Uw.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),xg=globalThis.AbortController,zO=globalThis.AbortSignal;if(typeof xg>"u"){zO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},xg=class{static{o(this,"AbortController")}constructor(){e()}signal=new zO;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=Uw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{n&&(n=!1,QO("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 UQ=o(n=>!HO.has(n),"shouldWarn");var Qa=o(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),YO=o(n=>Qa(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Hl:null:null,"getUintArray"),Hl=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},qw=class n{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=YO(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]}},Yf=class n{static{o(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#a;#p;#g;#d;#m;#y;#f;#E;#T;#S;#w;#v;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#a,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:o(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:o(t=>e.#B(t),"moveToTail"),indexes:o(t=>e.#I(t),"indexes"),rindexes:o(t=>e.#R(t),"rindexes"),isStale:o(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.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:E,memoMethod:b,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:W,ignoreFetchAbort:we}=e;if(t!==0&&!Qa(t))throw new TypeError("max option must be a nonnegative integer");let z=t?YO(t):Array;if(!z)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=_||this.#n,this.sizeCalculation=v,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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=b,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=E,this.#v=!!E,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new z(t),this.#g=new z(t),this.#d=0,this.#m=0,this.#y=qw.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!B,this.allowStaleOnFetchAbort=!!W,this.ignoreFetchAbort=!!we,this.maxEntrySize!==0){if(this.#n!==0&&!Qa(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Qa(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Qa(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Qa(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}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 G="LRU_CACHE_UNBOUNDED";UQ(G)&&(HO.add(G),QO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#x(){let e=new Hl(this.#e),t=new Hl(this.#e);this.#S=e,this.#T=t,this.#F=(s,a,c=zl.now())=>{if(t[s]=a!==0?c:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#O(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?zl.now():0},this.#o=(s,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=o(()=>{let s=zl.now();if(this.ttlResolution>0){r=s;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return s},"getNow");this.getRemainingTTL=s=>{let a=this.#s.get(s);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let a=t[s],c=e[s];return!!c&&!!a&&(r||i())-a>c}}#C=o(()=>{},"#updateItemAge");#o=o(()=>{},"#statusTTL");#F=o(()=>{},"#setItemTTL");#A=o(()=>!1,"#isStale");#P(){let e=new Hl(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#h(r))return 0;if(!Qa(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!Qa(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=o(e=>{},"#removeItemSize");#N=o((e,t,r)=>{},"#addItemSize");#L=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#R({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.#I())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*rentries(){for(let e of this.#R())this.#a[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#a[e])&&(yield[this.#l[e],this.#a[e]])}*keys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#h(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#a[e])&&(yield t)}}*values(){for(let e of this.#I())this.#a[e]!==void 0&&!this.#h(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#R())this.#a[e]!==void 0&&!this.#h(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#I()){let i=this.#a[r],s=this.#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.#I()){let i=this.#a[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.#R()){let i=this.#a[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.#R({allowStale:!0}))this.#A(t)&&(this.#O(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#a[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let a=this.#S[t],c=this.#T[t];if(a&&c){let l=a-(zl.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let r=this.#l[t],i=this.#a[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let a={value:s};if(this.#S&&this.#T){a.ttl=this.#S[t];let c=zl.now()-this.#T[t];a.start=Math.floor(Date.now()-c)}this.#E&&(a.size=this.#E[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=zl.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#O(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.#a[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#N(d,f,l),l&&(l.set="add"),u=!1;else{this.#B(d);let h=this.#a[d];if(t!==h){if(this.#v&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!a&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else a||(this.#w&&this.#r?.(h,e,"set"),this.#b&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#N(d,f,l),this.#a[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.#S&&this.#x(),this.#S&&(u||this.#F(d,i,s),l&&this.#o(l,d)),!a&&this.#b&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#a[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.#b&&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.#a[t];return this.#v&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#a[t]=void 0,this.#y.push(t)),this.#i===1?(this.#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 a=this.#a[s];if(this.#h(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#o(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#o(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#A(i))return;let s=this.#a[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#a[t];if(this.#h(s))return s;let a=new xg,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:r,context:i},u=o((v,E=!1)=>{let{aborted:b}=a.signal,A=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(b&&!E?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,A&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!A&&!E)return d(a.signal.reason);let R=p;return this.#a[t]===p&&(v===void 0?R.__staleWhileFetching?this.#a[t]=R.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},"cb"),f=o(v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),d(v)),"eb"),d=o(v=>{let{aborted:E}=a.signal,b=E&&r.allowStaleOnFetchAbort,A=b||r.allowStaleOnFetchRejection,R=A||r.noDeleteOnFetchRejection,B=p;if(this.#a[t]===p&&(!R||B.__staleWhileFetching===void 0?this.#O(e,"fetch"):b||(this.#a[t]=B.__staleWhileFetching)),A)return r.status&&B.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),B.__staleWhileFetching;if(B.__returned===B)throw v},"fetchFail"),h=o((v,E)=>{let b=this.#c?.(e,s,l);b&&b instanceof Promise&&b.then(A=>v(A===void 0?void 0:A),E),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=o(A=>u(A,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),_=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#a[t]=_,_}#h(e){if(!this.#v)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof xg}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=!1,status:b,signal:A}=t;if(!this.#v)return b&&(b.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:b});let R={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:b,signal:A},B=this.#s.get(e);if(B===void 0){b&&(b.fetch="miss");let W=this.#j(e,B,R,v);return W.__returned=W}else{let W=this.#a[B];if(this.#h(W)){let j=r&&W.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",j&&(b.returnedStale=!0)),j?W.__staleWhileFetching:W.__returned=W}let we=this.#A(B);if(!E&&!we)return b&&(b.fetch="hit"),this.#B(B),i&&this.#C(B),b&&this.#o(b,B),W;let z=this.#j(e,B,R,v),F=z.__staleWhileFetching!==void 0&&r;return b&&(b.fetch=we?"stale":"refresh",F&&we&&(b.returnedStale=!0)),F?z.__staleWhileFetching:z.__returned=z}}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.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...a}=t,c=this.get(e,a);if(!s&&c!==void 0)return c;let l=r(e,c,{options:a,context:i});return this.set(e,l,a),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#a[c],u=this.#h(l);return a&&this.#o(a,c),this.#A(c)?(a&&(a.get="stale"),u?(a&&r&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),a&&r&&(a.returnedStale=!0),r?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#B(c),i&&this.#C(c),l))}else a&&(a.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#B(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.#O(e,"delete")}#O(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.#V(t);else{this.#D(i);let s=this.#a[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#a[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let a=this.#g[i];this.#p[a]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#V("delete")}#V(e){for(let t of this.#R({allowStale:!0})){let r=this.#a[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#a.fill(void 0),this.#l.fill(void 0),this.#S&&this.#T&&(this.#S.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.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Kl=require("node:path"),sF=require("node:url"),Ts=require("fs"),JQ=Y(require("node:fs"),1),Xa=require("node:fs/promises");var Dg=require("node:events"),Kw=Y(require("node:stream"),1),eF=require("node:string_decoder");var KO=typeof process=="object"&&process?process:{stdout:null,stderr:null},qQ=o(n=>!!n&&typeof n=="object"&&(n instanceof Ka||n instanceof Kw.default||WQ(n)||GQ(n)),"isStream"),WQ=o(n=>!!n&&typeof n=="object"&&n instanceof Dg.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==Kw.default.Writable.prototype.pipe,"isReadable"),GQ=o(n=>!!n&&typeof n=="object"&&n instanceof Dg.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),ca=Symbol("EOF"),la=Symbol("maybeEmitEnd"),Ya=Symbol("emittedEnd"),Cg=Symbol("emittingEnd"),Kf=Symbol("emittedError"),Ig=Symbol("closed"),XO=Symbol("read"),Rg=Symbol("flush"),JO=Symbol("flushChunk"),Ui=Symbol("encoding"),Ql=Symbol("decoder"),wr=Symbol("flowing"),Xf=Symbol("paused"),Yl=Symbol("resume"),Er=Symbol("buffer"),_n=Symbol("pipes"),Tr=Symbol("bufferLength"),Ww=Symbol("bufferPush"),Pg=Symbol("bufferShift"),Jr=Symbol("objectMode"),Qt=Symbol("destroyed"),Gw=Symbol("error"),zw=Symbol("emitData"),ZO=Symbol("emitEnd"),Hw=Symbol("emitEnd2"),ws=Symbol("async"),Qw=Symbol("abort"),Og=Symbol("aborted"),Jf=Symbol("signal"),Zo=Symbol("dataListeners"),Vn=Symbol("discarded"),Zf=o(n=>Promise.resolve().then(n),"defer"),zQ=o(n=>n(),"nodefer"),HQ=o(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),QQ=o(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),YQ=o(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),Fg=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Yl](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Yw=class extends Fg{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},KQ=o(n=>!!n.objectMode,"isObjectModeOptions"),XQ=o(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),Ka=class extends Dg.EventEmitter{static{o(this,"Minipass")}[wr]=!1;[Xf]=!1;[_n]=[];[Er]=[];[Jr];[Ui];[ws];[Ql];[ca]=!1;[Ya]=!1;[Cg]=!1;[Ig]=!1;[Kf]=null;[Tr]=0;[Qt]=!1;[Jf];[Og]=!1;[Zo]=0;[Vn]=!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");KQ(t)?(this[Jr]=!0,this[Ui]=null):XQ(t)?(this[Ui]=t.encoding,this[Jr]=!1):(this[Jr]=!1,this[Ui]=null),this[ws]=!!t.async,this[Ql]=this[Ui]?new eF.StringDecoder(this[Ui]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Er],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[_n],"get")});let{signal:r}=t;r&&(this[Jf]=r,r.aborted?this[Qw]():r.addEventListener("abort",()=>this[Qw]()))}get bufferLength(){return this[Tr]}get encoding(){return this[Ui]}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[Jr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ws]}set async(e){this[ws]=this[ws]||!!e}[Qw](){this[Og]=!0,this.emit("abort",this[Jf]?.reason),this.destroy(this[Jf]?.reason)}get aborted(){return this[Og]}set aborted(e){}write(e,t,r){if(this[Og])return!1;if(this[ca])throw new Error("write after end");if(this[Qt])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[ws]?Zf:zQ;if(!this[Jr]&&!Buffer.isBuffer(e)){if(YQ(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(QQ(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Jr]?(this[wr]&&this[Tr]!==0&&this[Rg](!0),this[wr]?this.emit("data",e):this[Ww](e),this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr]):e.length?(typeof e=="string"&&!(t===this[Ui]&&!this[Ql]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ui]&&(e=this[Ql].write(e)),this[wr]&&this[Tr]!==0&&this[Rg](!0),this[wr]?this.emit("data",e):this[Ww](e),this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr]):(this[Tr]!==0&&this.emit("readable"),r&&i(r),this[wr])}read(e){if(this[Qt])return null;if(this[Vn]=!1,this[Tr]===0||e===0||e&&e>this[Tr])return this[la](),null;this[Jr]&&(e=null),this[Er].length>1&&!this[Jr]&&(this[Er]=[this[Ui]?this[Er].join(""):Buffer.concat(this[Er],this[Tr])]);let t=this[XO](e||null,this[Er][0]);return this[la](),t}[XO](e,t){if(this[Jr])this[Pg]();else{let r=t;e===r.length||e===null?this[Pg]():typeof r=="string"?(this[Er][0]=r.slice(e),t=r.slice(0,e),this[Tr]-=e):(this[Er][0]=r.subarray(e),t=r.subarray(0,e),this[Tr]-=e)}return this.emit("data",t),!this[Er].length&&!this[ca]&&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[ca]=!0,this.writable=!1,(this[wr]||!this[Xf])&&this[la](),this}[Yl](){this[Qt]||(!this[Zo]&&!this[_n].length&&(this[Vn]=!0),this[Xf]=!1,this[wr]=!0,this.emit("resume"),this[Er].length?this[Rg]():this[ca]?this[la]():this.emit("drain"))}resume(){return this[Yl]()}pause(){this[wr]=!1,this[Xf]=!0,this[Vn]=!1}get destroyed(){return this[Qt]}get flowing(){return this[wr]}get paused(){return this[Xf]}[Ww](e){this[Jr]?this[Tr]+=1:this[Tr]+=e.length,this[Er].push(e)}[Pg](){return this[Jr]?this[Tr]-=1:this[Tr]-=this[Er][0].length,this[Er].shift()}[Rg](e=!1){do;while(this[JO](this[Pg]())&&this[Er].length);!e&&!this[Er].length&&!this[ca]&&this.emit("drain")}[JO](e){return this.emit("data",e),this[wr]}pipe(e,t){if(this[Qt])return e;this[Vn]=!1;let r=this[Ya];return t=t||{},e===KO.stdout||e===KO.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[_n].push(t.proxyErrors?new Yw(this,e,t):new Fg(this,e,t)),this[ws]?Zf(()=>this[Yl]()):this[Yl]()),e}unpipe(e){let t=this[_n].find(r=>r.dest===e);t&&(this[_n].length===1?(this[wr]&&this[Zo]===0&&(this[wr]=!1),this[_n]=[]):this[_n].splice(this[_n].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[Vn]=!1,this[Zo]++,!this[_n].length&&!this[wr]&&this[Yl]();else if(e==="readable"&&this[Tr]!==0)super.emit("readable");else if(HQ(e)&&this[Ya])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Kf]){let i=t;this[ws]?Zf(()=>i.call(this,this[Kf])):i.call(this,this[Kf])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Zo]=this.listeners("data").length,this[Zo]===0&&!this[Vn]&&!this[_n].length&&(this[wr]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Zo]=0,!this[Vn]&&!this[_n].length&&(this[wr]=!1)),t}get emittedEnd(){return this[Ya]}[la](){!this[Cg]&&!this[Ya]&&!this[Qt]&&this[Er].length===0&&this[ca]&&(this[Cg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ig]&&this.emit("close"),this[Cg]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==Qt&&this[Qt])return!1;if(e==="data")return!this[Jr]&&!r?!1:this[ws]?(Zf(()=>this[zw](r)),!0):this[zw](r);if(e==="end")return this[ZO]();if(e==="close"){if(this[Ig]=!0,!this[Ya]&&!this[Qt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Kf]=r,super.emit(Gw,r);let s=!this[Jf]||this.listeners("error").length?super.emit("error",r):!1;return this[la](),s}else if(e==="resume"){let s=super.emit("resume");return this[la](),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[la](),i}[zw](e){for(let r of this[_n])r.dest.write(e)===!1&&this.pause();let t=this[Vn]?!1:super.emit("data",e);return this[la](),t}[ZO](){return this[Ya]?!1:(this[Ya]=!0,this.readable=!1,this[ws]?(Zf(()=>this[Hw]()),!0):this[Hw]())}[Hw](){if(this[Ql]){let t=this[Ql].end();if(t){for(let r of this[_n])r.dest.write(t);this[Vn]||super.emit("data",t)}}for(let t of this[_n])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Jr]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Jr]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Jr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ui]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Qt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Vn]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ca])return t();let s,a,c=o(d=>{this.off("data",l),this.off("end",u),this.off(Qt,f),t(),a(d)},"onerr"),l=o(d=>{this.off("error",c),this.off("end",u),this.off(Qt,f),this.pause(),s({value:d,done:!!this[ca]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",l),this.off(Qt,f),t(),s({done:!0,value:void 0})},"onend"),f=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{a=h,s=d,this.once(Qt,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[Vn]=!1;let e=!1,t=o(()=>(this.pause(),this.off(Gw,t),this.off(Qt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Gw,t),this.once(Qt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Qt])return e?this.emit("error",e):this.emit(Qt),this;this[Qt]=!0,this[Vn]=!0,this[Er].length=0,this[Tr]=0;let t=this;return typeof t.close=="function"&&!this[Ig]&&t.close(),e?this.emit("error",e):this.emit(Qt),this}static get isStream(){return qQ}};var ZQ=Ts.realpathSync.native,td={lstatSync:Ts.lstatSync,readdir:Ts.readdir,readdirSync:Ts.readdirSync,readlinkSync:Ts.readlinkSync,realpathSync:ZQ,promises:{lstat:Xa.lstat,readdir:Xa.readdir,readlink:Xa.readlink,realpath:Xa.realpath}},aF=o(n=>!n||n===td||n===JQ?td:{...td,...n,promises:{...td.promises,...n.promises||{}}},"fsFromOption"),oF=/^\\\\\?\\([a-z]:)\\?$/i,eY=o(n=>n.replace(/\//g,"\\").replace(oF,"$1\\"),"uncToDrive"),tY=/[\\\/]/,si=0,cF=1,lF=2,Es=4,uF=6,fF=8,ec=10,dF=12,ii=15,ed=~ii,Xw=16,tF=32,rd=64,qi=128,Ng=256,kg=512,rF=rd|qi|kg,rY=1023,Jw=o(n=>n.isFile()?fF:n.isDirectory()?Es:n.isSymbolicLink()?ec:n.isCharacterDevice()?lF:n.isBlockDevice()?uF:n.isSocket()?dF:n.isFIFO()?cF:si,"entToType"),nF=new Map,nd=o(n=>{let e=nF.get(n);if(e)return e;let t=n.normalize("NFKD");return nF.set(n,t),t},"normalize"),iF=new Map,Lg=o(n=>{let e=iF.get(n);if(e)return e;let t=nd(n.toLowerCase());return iF.set(n,t),t},"normalizeNocase"),Mg=class extends Yf{static{o(this,"ResolveCache")}constructor(){super({max:256})}},Zw=class extends Yf{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}},hF=Symbol("PathScurry setAsCwd"),Zr=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#a;get blocks(){return this.#a}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#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}#S;#w;#v;#b;#x;#C;#o;#F;#A;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=si,r,i,s,a,c){this.name=e,this.#S=s?Lg(e):nd(e),this.#o=t&rY,this.nocase=s,this.roots=i,this.root=r||this,this.#F=a,this.#v=c.fullpath,this.#x=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=aF(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#o&=~Xw,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Lg(e):nd(e);for(let l of r)if(l.#S===i)return l;let s=this.parent?this.sep:"",a=this.#v?this.#v+s+e:void 0,c=this.newChild(e,si,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=qi),r.push(c),c}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.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#v=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&ii)===si}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&ii)===fF}isDirectory(){return(this.#o&ii)===Es}isCharacterDevice(){return(this.#o&ii)===lF}isBlockDevice(){return(this.#o&ii)===uF}isFIFO(){return(this.#o&ii)===cF}isSocket(){return(this.#o&ii)===dF}isSymbolicLink(){return(this.#o&ec)===ec}lstatCached(){return this.#o&tF?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#P}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.#o&ii;return!(e!==si&&e!==ec||this.#o&Ng||this.#o&qi)}calledReaddir(){return!!(this.#o&Xw)}isENOENT(){return!!(this.#o&qi)}isNamed(e){return this.nocase?this.#S===Lg(e):this.#S===nd(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}}#N(e){this.#o|=Xw;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#o&qi||(this.#o=(this.#o|qi)&ed,this.#I())}#I(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#R(){this.#o|=kg,this.#k()}#k(){if(this.#o&rd)return;let e=this.#o;(e&ii)===Es&&(e&=ed),this.#o=e|rd,this.#I()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#L()}#h(e=""){let t=this.#o;t|=Ng,e==="ENOENT"&&(t|=qi),(e==="EINVAL"||e==="UNKNOWN")&&(t&=ed),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#O(e,t)||this.#B(e,t)}#B(e,t){let r=Jw(e),i=this.newChild(e.name,r,{parent:this}),s=i.#o&ii;return s!==Es&&s!==ec&&s!==si&&(i.#o|=rd),t.unshift(i),t.provisional++,i}#O(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?Lg(e.name):nd(e.name))===i.#S)return this.#V(e,i,r,t)}}#V(e,t,r,i){let s=t.name;return t.#o=t.#o&ed|Jw(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&qi)===0)try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#o&qi)===0)try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:_,mtimeMs:v,nlink:E,rdev:b,size:A,uid:R}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=a,this.#a=c,this.#E=l,this.#d=u,this.#n=f,this.#_=d,this.#s=h,this.#r=p,this.#f=_,this.#g=v,this.#t=E,this.#i=b,this.#l=A,this.#c=R;let B=Jw(e);this.#o=this.#o&ed|B|tF,B!==si&&B!==Es&&B!==ec&&(this.#o|=rd)}#q=[];#W=!1;#z(e){this.#W=!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.#W)return;this.#W=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,a)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of a)this.#$(c,r);this.#N(r)}this.#z(r.slice(0,r.provisional))})}#U;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.#U)await this.#U;else{let r=o(()=>{},"resolve");this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#M(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&rF)return!1;let e=ii&this.#o;return e===si||e===Es||e===ec}shouldWalk(e,t){return(this.#o&Es)===Es&&!(this.#o&rF)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!((kg|Ng|qi)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#P)return this.#P;if(!((kg|Ng|qi)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#R()}}[hF](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.#x=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#x=void 0,i.#C=void 0,i=i.parent}},jg=class n extends Zr{static{o(this,"PathWin32")}sep="\\";splitSep=tY;constructor(e,t=si,r,i,s,a,c){super(e,t,r,i,s,a,c)}newChild(e,t=si,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Kl.win32.parse(e).root}getRoot(e){if(e=eY(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 Xl(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(oF,"$1\\"),e===t}},$g=class n extends Zr{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=si,r,i,s,a,c){super(e,t,r,i,s,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=si,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Bg=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:a=td}={}){this.#t=aF(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,sF.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Mg,this.#n=new Mg,this.#r=new Zw(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 _ of l){let v=f--;u=u.child(_,{relative:new Array(v).fill("..").join(d),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(p?"":d)+_}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=o((d,h)=>{l.add(d),d.readdirCB((p,_)=>{if(p)return h(p);let v=_.length;if(!v)return h();let E=o(()=>{--v===0&&h()},"next");for(let b of _)(!s||s(b))&&c.push(r?b:b.fullpath()),i&&b.isSymbolicLink()?b.realpath().then(A=>A?.isUnknown()?A.lstat():A).then(A=>A?.shouldWalk(l,a)?u(A,E):E()):b.shouldWalk(l,a)?u(b,E):E()},!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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let 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,a)&&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 Zr||(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 Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,a)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ka({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=o(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=o((E,b,A=!1)=>{if(E)return c.emit("error",E);if(i&&!A){let R=[];for(let B of b)B.isSymbolicLink()&&R.push(B.realpath().then(W=>W?.isUnknown()?W.lstat():W));if(R.length){Promise.all(R).then(()=>_(null,b,!0));return}}for(let R of b)R&&(!s||s(R))&&(c.write(r?R:R.fullpath())||(h=!0));f--;for(let R of b){let B=R.realpathCached()||R;B.shouldWalk(l,a)&&u.push(B)}h&&!c.flowing?c.once("drain",d):v||d()},"onReaddir"),v=!0;p.readdirCB(_,!0),v=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zr||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:a}=t,c=new Ka({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=o(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let _=p.readdirSync();for(let v of _)(!s||s(v))&&(c.write(r?v:v.fullpath())||(h=!0));f--;for(let v of _){let E=v;if(v.isSymbolicLink()){if(!(i&&(E=v.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(l,a)&&u.push(E)}}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[hF](t)}},Xl=class extends Bg{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Kl.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Kl.win32.parse(e).root.toUpperCase()}newRoot(e){return new jg(this.rootPath,Es,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Jl=class extends Bg{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Kl.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new $g(this.rootPath,Es,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},id=class extends Jl{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},Fhe=process.platform==="win32"?jg:$g,pF=process.platform==="win32"?Xl:process.platform==="darwin"?id:Jl;var nY=o(n=>n.length>=1,"isPatternList"),iY=o(n=>n.length>=1,"isGlobList"),Zl=class n{static{o(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!nY(e))throw new TypeError("empty pattern list");if(!iY(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,a,c,l,...u]=this.#e,[f,d,h,p,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let v=[s,a,c,l,""].join("/"),E=[f,d,h,p,""].join("/");this.#e=[v,...u],this.#n=[E,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[c,...l]=this.#n;a[0]===""&&(a.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...a],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ht}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(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 sY=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",eu=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:a=sY}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Bn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let a=new Zl(i,s,0,this.platform),c=new Bn(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(s))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var eE=class n{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},tE=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},rE=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},sd=class n{static{o(this,"Processor")}hasWalkedCache;matches=new tE;subwalks=new rE;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new eE}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let a=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let 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===Ht){(!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 a of r){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Ht?i.testGlobstar(s,a,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var aY=o((n,e)=>typeof n=="string"?new eu([n],e):Array.isArray(n)?new eu(n,e):n,"makeIgnore"),Vg=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=aY(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?a+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new sd(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,a):c.readdirCB((u,f)=>this.walkCB3(c,f,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>a()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new sd(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,a=o(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),a);a()}},ad=class extends Vg{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},od=class extends Vg{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Ka({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 oY=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Wi=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,mF.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||oY,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"?Xl:t.platform==="darwin"?id:t.platform?Jl:pF;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 Bn(l,i)),[a,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Zl(l,f,0,this.platform)})}async walk(){return[...await new ad(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 ad(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 od(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 od(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 nE=o((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Bn(t,e).hasMagic())return!0;return!1},"hasMagic");function qg(n,e={}){return new Wi(n,e).streamSync()}o(qg,"globStreamSync");function yF(n,e={}){return new Wi(n,e).stream()}o(yF,"globStream");function _F(n,e={}){return new Wi(n,e).walkSync()}o(_F,"globSync");async function gF(n,e={}){return new Wi(n,e).walk()}o(gF,"glob_");function Wg(n,e={}){return new Wi(n,e).iterateSync()}o(Wg,"globIterateSync");function SF(n,e={}){return new Wi(n,e).iterate()}o(SF,"globIterate");var cY=qg,lY=Object.assign(yF,{sync:qg}),uY=Wg,fY=Object.assign(SF,{sync:Wg}),dY=Object.assign(_F,{stream:qg,iterate:Wg}),Ug=Object.assign(gF,{glob:gF,globSync:_F,sync:dY,globStream:yF,stream:lY,globStreamSync:qg,streamSync:cY,globIterate:SF,iterate:fY,globIterateSync:Wg,iterateSync:uY,Glob:Wi,hasMagic:nE,escape:Gl,unescape:Vi});Ug.glob=Ug;var tc=Y(Vt());var It=class{constructor(e){this.rootPath=e}static{o(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await hr.default.pathExists(t))throw new tc.FileNotFoundError(e);return hr.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return hr.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await hr.default.pathExists(r))throw new tc.FileAlreadyExistsError(e);return await hr.default.ensureDir(Ja.default.dirname(r)),await hr.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await hr.default.pathExists(r))throw new tc.FileNotFoundError(e);await hr.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await hr.default.ensureDir(Ja.default.dirname(r)),await hr.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await hr.default.pathExists(t))throw new tc.FileNotFoundError(e);await hr.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await hr.default.pathExists(r))throw new tc.FileNotFoundError(e);await hr.default.ensureDir(Ja.default.dirname(i)),await hr.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await hr.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await hr.default.pathExists(t)?(await hr.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=Ja.default.join(t,"**/*.md");return(await Ug(r,{nodir:!0})).map(a=>Ja.default.relative(this.rootPath,a))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return Ja.default.isAbsolute(e)?e:Ja.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=Mr.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(a=>this.normalizeValue(a)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var cd=Y(require("path")),iE=Y(Ga());var tu=class{constructor(e){this.vaultRoot=e}static{o(this,"PathResolver")}resolve(e){if(!cd.default.isAbsolute(e))return cd.default.resolve(this.vaultRoot,e);let t=cd.default.resolve(e),r=cd.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Qe(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!iE.default.existsSync(e))throw new Of(e);if(!iE.default.statSync(e).isFile())throw new Qe(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Qe(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var AF=Y(Vt());var vF=Y(Vt());var Gi=class{static{o(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return vF.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
616
616
  `).filter(i=>i.trim()).map(i=>i.replace(/^\s*-\s*/,"").trim()):[]}};var ld=class extends Gi{static{o(this,"StatusCommandExecutor")}constructor(e){super(e)}async executeStart(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Started: ${e}`),console.log(" Status: Doing"),console.log(` Start time: ${i}`),process.exit(0)}catch(t){D.handle(t)}}async executeComplete(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Completed: ${e}`),console.log(" Status: Done"),console.log(` Completion time: ${i}`),process.exit(0)}catch(t){D.handle(t)}}async executeTrash(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Trashed: ${e}`),console.log(" Status: Trashed"),console.log(` Resolution time: ${i}`),process.exit(0)}catch(t){D.handle(t)}}async executeArchive(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.readFile(t),i=this.frontmatterService.updateProperty(r,"archived","true");i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(t,i),console.log(`\u2705 Archived: ${e}`),console.log(" Archived: true"),console.log(" Aliases removed"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToBacklog(e){try{await this.updateStatus(e,"ems__EffortStatusBacklog","Backlog"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToAnalysis(e){try{await this.updateStatus(e,"ems__EffortStatusAnalysis","Analysis"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToToDo(e){try{await this.updateStatus(e,"ems__EffortStatusToDo","ToDo"),process.exit(0)}catch(t){D.handle(t)}}async updateStatus(e,t,r){let{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),a=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${t}]]"`);await this.fsAdapter.updateFile(i,a),console.log(`\u2705 Moved to ${r}: ${e}`),console.log(` Status: ${r}`)}};var $r=[];for(let n=0;n<256;++n)$r.push((n+256).toString(16).slice(1));function bF(n,e=0){return($r[n[e+0]]+$r[n[e+1]]+$r[n[e+2]]+$r[n[e+3]]+"-"+$r[n[e+4]]+$r[n[e+5]]+"-"+$r[n[e+6]]+$r[n[e+7]]+"-"+$r[n[e+8]]+$r[n[e+9]]+"-"+$r[n[e+10]]+$r[n[e+11]]+$r[n[e+12]]+$r[n[e+13]]+$r[n[e+14]]+$r[n[e+15]]).toLowerCase()}o(bF,"unsafeStringify");var wF=require("node:crypto");var zg=new Uint8Array(256),Gg=zg.length;function sE(){return Gg>zg.length-16&&((0,wF.randomFillSync)(zg),Gg=0),zg.slice(Gg,Gg+=16)}o(sE,"rng");var EF=require("node:crypto"),aE={randomUUID:EF.randomUUID};function pY(n,e,t){n=n||{};let r=n.random??n.rng?.()??sE();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 bF(r)}o(pY,"_v4");function mY(n,e,t){return aE.randomUUID&&!e&&!n?aE.randomUUID():pY(n,e,t)}o(mY,"v4");var ud=mY;var ru=Y(Vt());var fd=class extends Gi{static{o(this,"AssetCreationExecutor")}constructor(e){super(e)}async executeCreateTask(e,t,r={}){try{await this.createAsset(e,t,"ems__Task",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateMeeting(e,t,r={}){try{await this.createAsset(e,t,"ems__Meeting",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateProject(e,t,r={}){try{await this.createAsset(e,t,"ems__Project",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateArea(e,t,r={}){try{await this.createAsset(e,t,"ems__Area",r),process.exit(0)}catch(i){D.handle(i)}}async createAsset(e,t,r,i={}){if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let s=t.trim(),{relativePath:a}=this.resolveAndValidate(e);if(await this.fsAdapter.fileExists(a))throw new ru.FileAlreadyExistsError(e);let l=ud(),u=this.buildAssetFrontmatter(r,l,s,i),f=ru.MetadataHelpers.buildFileContent(u);await this.fsAdapter.createFile(a,f),console.log(`\u2705 Created ${this.getAssetTypeName(r)}: ${e}`),console.log(` UID: ${l}`),console.log(` Label: ${s}`),console.log(` Class: ${r}`)}buildAssetFrontmatter(e,t,r,i={}){let s=ru.DateFormatter.toLocalTimestamp(new Date),a={exo__Asset_isDefinedBy:'"[[Ontology/EMS]]"',exo__Asset_uid:t,exo__Asset_label:r,exo__Asset_createdAt:s,exo__Instance_class:[`"[[${e}]]"`],aliases:[r]};return(e==="ems__Task"||e==="ems__Project"||e==="ems__Meeting")&&(a.ems__Effort_status='"[[ems__EffortStatusDraft]]"'),i.prototype&&(a.exo__Asset_prototype=`"[[${i.prototype}]]"`),i.area&&(a.ems__Effort_area=`"[[${i.area}]]"`),i.parent&&(a.ems__Effort_parent=`"[[${i.parent}]]"`),a}getAssetTypeName(e){return{ems__Task:"task",ems__Meeting:"meeting",ems__Project:"project",ems__Area:"area"}[e]||"asset"}};var oE=Y(require("path"));var TF=Y(Vt());var dd=class extends Gi{static{o(this,"PropertyCommandExecutor")}constructor(e){super(e)}async executeRenameToUid(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.getFileMetadata(t);if(!r.exo__Asset_uid)throw new Error("Asset missing exo__Asset_uid property");let i=oE.default.basename(t,".md"),s=r.exo__Asset_uid;if(i===s&&(console.log(`\u2705 Already renamed: ${e}`),console.log(` Current filename matches UID: ${s}.md`),process.exit(0)),!r.exo__Asset_label||r.exo__Asset_label.trim()===""){let l=await this.fsAdapter.readFile(t),u=this.frontmatterService.updateProperty(l,"exo__Asset_label",i),f=this.isAssetArchived(r),d=u;f||(d=this.frontmatterService.updateProperty(u,"aliases",`
617
617
  - ${i}`)),await this.fsAdapter.updateFile(t,d),console.log(` Updated label: "${i}"`)}let a=oE.default.dirname(t),c=a!=="."?`${a}/${s}.md`:`${s}.md`;await this.fsAdapter.renameFile(t,c),console.log("\u2705 Renamed to UID format"),console.log(` Old: ${t}`),console.log(` New: ${c}`),process.exit(0)}catch(t){D.handle(t)}}async executeUpdateLabel(e,t){try{if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let r=t.trim(),{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),a=this.frontmatterService.updateProperty(s,"exo__Asset_label",r),c=this.frontmatterService.parse(a),l=this.extractAliasesFromFrontmatter(c.content);if(l.includes(r)||(l.length===0?a=this.frontmatterService.updateProperty(a,"aliases",`
618
618
  - ${r}`):a=this.frontmatterService.updateProperty(a,"aliases",`${l.map(u=>`
@@ -793,7 +793,7 @@ exo__BacklinksTableBlock_columns:${f==="[]"?" []":f}
793
793
  --- END PREVIEW ---
794
794
  `)}o(_K,"printDryRunReport");function SK(n,e){let r=[`--- MIGRATION ${e.apply?"APPLY":"DRY RUN"} ---`,`Migrated pairs: ${n.pairs.length}`,`Skipped configs: ${n.skipped.length}`];e.apply&&(r.push(`Files written to: ${e.outDir}/ (relative to vault root)`),r.push(`Total files written: ${n.pairs.length*2} (${n.pairs.length} Layout + ${n.pairs.length} Block)`));for(let i of n.skipped)r.push(` SKIPPED: ${i.sourcePath} \u2014 ${i.reason}`);return r.push(`--- END SUMMARY ---
795
795
  `),r.join(`
796
- `)}o(SK,"formatSummary");function vK(n,e){return{mode:e.apply?"apply":"dry-run",outDir:e.outDir,pairsCount:n.pairs.length,skippedCount:n.skipped.length,pairs:n.pairs.map(t=>({sourceUid:t.sourceUid,sourcePath:t.sourcePath,layoutUid:t.layout.uid,blockUid:t.block.uid,warnings:t.warnings})),skipped:n.skipped}}o(vK,"summariseResult");function kD(n){n.addCommand(pO()),n.addCommand(_O()),n.addCommand(SO())}o(kD,"addQuerySubcommands");function MD(n){let e=new xe;e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"15.146.5");let t=e.command("exoql").description("ExoQL query execution and cache management");kD(t);let r=e.command("sparql").description("(deprecated) Use 'exoql' instead");return kD(r),r.hook("preAction",()=>{console.error('\u26A0\uFE0F "sparql" is deprecated. Use "exoql" instead.')}),e.addCommand(CF()),e.addCommand(PF()),e.addCommand(OF()),e.addCommand(DF()),e.addCommand(NF()),e.addCommand($F()),e.addCommand(qF()),e.addCommand(rD()),e.addCommand(sD()),e.addCommand(uD()),e.addCommand(hD()),e.addCommand(pD()),e.addCommand(gD()),e.addCommand(TD()),e.addCommand(ID()),e.addCommand(LD()),e}o(MD,"createProgram");MD().parse();0&&(module.exports={createProgram});
796
+ `)}o(SK,"formatSummary");function vK(n,e){return{mode:e.apply?"apply":"dry-run",outDir:e.outDir,pairsCount:n.pairs.length,skippedCount:n.skipped.length,pairs:n.pairs.map(t=>({sourceUid:t.sourceUid,sourcePath:t.sourcePath,layoutUid:t.layout.uid,blockUid:t.block.uid,warnings:t.warnings})),skipped:n.skipped}}o(vK,"summariseResult");function kD(n){n.addCommand(pO()),n.addCommand(_O()),n.addCommand(SO())}o(kD,"addQuerySubcommands");function MD(n){let e=new xe;e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"15.147.0");let t=e.command("exoql").description("ExoQL query execution and cache management");kD(t);let r=e.command("sparql").description("(deprecated) Use 'exoql' instead");return kD(r),r.hook("preAction",()=>{console.error('\u26A0\uFE0F "sparql" is deprecated. Use "exoql" instead.')}),e.addCommand(CF()),e.addCommand(PF()),e.addCommand(OF()),e.addCommand(DF()),e.addCommand(NF()),e.addCommand($F()),e.addCommand(qF()),e.addCommand(rD()),e.addCommand(sD()),e.addCommand(uD()),e.addCommand(hD()),e.addCommand(pD()),e.addCommand(gD()),e.addCommand(TD()),e.addCommand(ID()),e.addCommand(LD()),e}o(MD,"createProgram");MD().parse();0&&(module.exports={createProgram});
797
797
  /*! Bundled license information:
798
798
 
799
799
  reflect-metadata/Reflect.js: