@directive-run/core 1.23.0 → 1.24.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 (39) hide show
  1. package/dist/{chunk-WVP3GOY2.js → chunk-C3FW27S5.js} +2 -2
  2. package/dist/chunk-C3FW27S5.js.map +1 -0
  3. package/dist/{chunk-PJIIBQTK.js → chunk-QR2756CJ.js} +2 -2
  4. package/dist/{chunk-PJIIBQTK.js.map → chunk-QR2756CJ.js.map} +1 -1
  5. package/dist/{chunk-AFPLATPV.js → chunk-SERVIHA3.js} +3 -3
  6. package/dist/{chunk-AFPLATPV.js.map → chunk-SERVIHA3.js.map} +1 -1
  7. package/dist/{chunk-FCCJUQB2.cjs → chunk-UDSP7U54.cjs} +3 -3
  8. package/dist/{chunk-FCCJUQB2.cjs.map → chunk-UDSP7U54.cjs.map} +1 -1
  9. package/dist/{chunk-WKGNK4QK.cjs → chunk-UQZ2SMGS.cjs} +2 -2
  10. package/dist/{chunk-WKGNK4QK.cjs.map → chunk-UQZ2SMGS.cjs.map} +1 -1
  11. package/dist/{chunk-XKXTRVJF.cjs → chunk-WU4AXN3P.cjs} +2 -2
  12. package/dist/chunk-WU4AXN3P.cjs.map +1 -0
  13. package/dist/{index-n8oQmdOZ.d.ts → index-Bz6DOdDN.d.ts} +3 -3
  14. package/dist/{index-DpvgHVHR.d.cts → index-Cpgj4byM.d.cts} +3 -3
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +3 -3
  18. package/dist/index.d.ts +3 -3
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/internals.cjs +1 -1
  22. package/dist/internals.js +1 -1
  23. package/dist/plugins/index.cjs +2 -2
  24. package/dist/plugins/index.d.cts +1 -1
  25. package/dist/plugins/index.d.ts +1 -1
  26. package/dist/plugins/index.js +1 -1
  27. package/dist/system-T6EZ6EYN.js +2 -0
  28. package/dist/{system-HOP37Z4V.js.map → system-T6EZ6EYN.js.map} +1 -1
  29. package/dist/system-V7B4YUIR.cjs +2 -0
  30. package/dist/{system-VZUHL56W.cjs.map → system-V7B4YUIR.cjs.map} +1 -1
  31. package/dist/testing.cjs +1 -1
  32. package/dist/testing.js +1 -1
  33. package/dist/worker.cjs +1 -1
  34. package/dist/worker.js +1 -1
  35. package/package.json +2 -2
  36. package/dist/chunk-WVP3GOY2.js.map +0 -1
  37. package/dist/chunk-XKXTRVJF.cjs.map +0 -1
  38. package/dist/system-HOP37Z4V.js +0 -2
  39. package/dist/system-VZUHL56W.cjs +0 -2
@@ -1,2 +1,2 @@
1
- import {i}from'./chunk-LN5H74CU.js';import {f,i as i$1}from'./chunk-IZNOPHPL.js';function B(e){let n=e&&typeof e=="object"&&!Array.isArray(e)&&"constraints"in e?e.constraints:e;if(Array.isArray(n)){let r={};for(let s of n){if(!s||typeof s!="object"||!("id"in s))throw new Error("[Directive] diffRules: array entries must be `{ id, whenSpec }` objects");let o=s;if(typeof o.id!="string")throw new Error("[Directive] diffRules: constraint `id` must be a string");r[o.id]=o.whenSpec;}return r}if(n&&typeof n=="object")return n;throw new Error("[Directive] diffRules: expected a `{ id: whenSpec }` map, an array of `{ id, whenSpec }`, or `{ constraints: ... }`")}var Z=new Set(["$eq","$ne","$in","$nin","$exists","$gt","$gte","$lt","$lte","$between","$matches","$startsWith","$endsWith","$contains","$changed"]),ee=new Set(["$all","$any","$not"]);function M(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ne(e){if(!M(e))return false;let n=Object.keys(e);if(n.length===0)return false;let r=false;for(let s of n){if(!s.startsWith("$"))return false;Z.has(s)&&(r=true);}return r}function b(e,n="",r=[]){if(e===null||typeof e!="object")return r;if(Array.isArray(e)){for(let s of e)if(s&&typeof s=="object"&&"fact"in s&&"op"in s){let o=s;r.push({path:n?`${n}.${String(o.fact)}`:String(o.fact),op:String(o.op),value:o.value});}return r}if("$all"in e&&Array.isArray(e.$all))return e.$all.forEach((o,u)=>{b(o,`${n}$all[${u}]`,r);}),r;if("$any"in e&&Array.isArray(e.$any))return e.$any.forEach((o,u)=>{b(o,`${n}$any[${u}]`,r);}),r;if("$not"in e)return b(e.$not,`${n}$not`,r),r;for(let[s,o]of Object.entries(e)){let u=n?`${n}.${s}`:s;if(ne(o))for(let[i,a]of Object.entries(o))r.push({path:u,op:i,value:a});else M(o)&&!ee.has(s)?b(o,u,r):r.push({path:u,op:"$eq",value:o});}return r}function E(e){return typeof e=="number"&&Number.isFinite(e)}function te(e,n,r){switch(e){case "$gte":case "$gt":if(E(n)&&E(r)){if(r<n)return "relaxed";if(r>n)return "tightened"}return null;case "$lte":case "$lt":if(E(n)&&E(r)){if(r>n)return "relaxed";if(r<n)return "tightened"}return null;case "$between":{if(Array.isArray(n)&&Array.isArray(r)&&n.length===2&&r.length===2&&E(n[0])&&E(n[1])&&E(r[0])&&E(r[1])){let s=n[1]-n[0],o=r[1]-r[0];if(o>s)return "relaxed";if(o<s)return "tightened"}return null}case "$in":case "$nin":{if(Array.isArray(n)&&Array.isArray(r))if(e==="$in"){if(r.length>n.length)return "relaxed";if(r.length<n.length)return "tightened"}else {if(r.length>n.length)return "tightened";if(r.length<n.length)return "relaxed"}return null}case "$contains":{if(Array.isArray(n)&&Array.isArray(r)){if(r.length>n.length)return "relaxed";if(r.length<n.length)return "tightened"}return null}default:return null}}function ae(e){let n=B(e.before),r=B(e.after),o=[...new Set([...Object.keys(n),...Object.keys(r)])].sort(),u=[],i={added:0,removed:0,changed:0,unchanged:0,totalClauseChanges:0};for(let a of o){let c=n[a],d=r[a],f=a in n,p=a in r;if(f&&!p){let m=b(c),w=m.length===0?[{path:"(function-form predicate)",kind:"removed"}]:m.map(y=>({path:y.path,kind:"removed",before:{op:y.op,value:y.value}}));q(w),u.push({id:a,status:"removed",changes:w}),i.removed++,i.totalClauseChanges+=w.length;continue}if(!f&&p){let m=b(d),w=m.length===0?[{path:"(function-form predicate)",kind:"added"}]:m.map(y=>({path:y.path,kind:"added",after:{op:y.op,value:y.value}}));q(w),u.push({id:a,status:"added",changes:w}),i.added++,i.totalClauseChanges+=w.length;continue}let g=re(c,d);g.length===0?(u.push({id:a,status:"unchanged",changes:[]}),i.unchanged++):(u.push({id:a,status:"changed",changes:g}),i.changed++,i.totalClauseChanges+=g.length);}return {constraints:u,summary:i}}function re(e,n){if(e!==void 0&&n!==void 0&&(e===null||n===null||typeof e!="object"||typeof n!="object"))return f(e)===f(n)?[]:[{path:"",kind:"changed",before:{op:"$eq",value:e},after:{op:"$eq",value:n}}];let r=e===void 0?[]:b(e),s=n===void 0?[]:b(n),o=d=>`${d.path}::${d.op}`,u=new Map(r.map(d=>[o(d),d])),i=new Map(s.map(d=>[o(d),d])),a=new Set([...u.keys(),...i.keys()]),c=[];for(let d of a){let f$1=u.get(d),p=i.get(d);if(f$1&&!p){c.push({path:f$1.path,kind:"removed",before:{op:f$1.op,value:f$1.value}});continue}if(!f$1&&p){c.push({path:p.path,kind:"added",after:{op:p.op,value:p.value}});continue}if(f$1&&p){if(f(f$1.value)===f(p.value))continue;let g=te(f$1.op,f$1.value,p.value);c.push({path:f$1.path,kind:g??"changed",before:{op:f$1.op,value:f$1.value},after:{op:p.op,value:p.value}});}}return q(c),c}function q(e){e.sort((n,r)=>{let s=n.path.localeCompare(r.path);if(s!==0)return s;let o=n.before?.op??n.after?.op??"",u=r.before?.op??r.after?.op??"";return o.localeCompare(u)});}var H=new Set(["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin"]);function j(e,n){if(e===n)return 0;if(typeof e=="number"&&typeof n=="number"||typeof e=="bigint"&&typeof n=="bigint")return e<n?-1:e>n?1:0;if(e instanceof Date&&n instanceof Date){let r=e.getTime(),s=n.getTime();return r<s?-1:r>s?1:0}return typeof e=="string"&&typeof n=="string"?e<n?-1:e>n?1:0:Number.NaN}function O(e,n){if(e===n)return true;if(typeof e!=typeof n||e===null||n===null||typeof e!="object"||Array.isArray(e)!==Array.isArray(n))return false;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return false;for(let o=0;o<e.length;o++)if(!O(e[o],n[o]))return false;return true}let r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return false;for(let o of r)if(!O(e[o],n[o]))return false;return true}function ie(e,n){if(!H.has(e.op)||!H.has(n.op))return {type:"overlap",reason:`Both rules touch "${e.path}".`};if(e.op==="$eq"&&n.op==="$eq")return O(e.value,n.value)?{type:"subset",reason:`Both rules require ${e.path} = ${JSON.stringify(e.value)} \u2014 candidate is redundant.`}:{type:"direct",reason:`Candidate requires ${e.path} = ${JSON.stringify(e.value)} but an existing rule requires ${e.path} = ${JSON.stringify(n.value)} \u2014 they cannot both fire.`};if(e.op==="$eq"&&n.op==="$ne")return O(e.value,n.value)?{type:"direct",reason:`Candidate requires ${e.path} = ${JSON.stringify(e.value)} but an existing rule excludes that value.`}:null;if(e.op==="$ne"&&n.op==="$eq")return O(e.value,n.value)?{type:"direct",reason:`Candidate excludes ${e.path} = ${JSON.stringify(e.value)} but an existing rule requires that exact value.`}:null;if(e.op==="$in"&&n.op==="$in"){let i=new Set(Array.isArray(e.value)?e.value:[]),a=new Set(Array.isArray(n.value)?n.value:[]),c=[...i].filter(d=>a.has(d));return c.length===0?{type:"direct",reason:`Candidate $in set for ${e.path} (${JSON.stringify([...i])}) and existing $in set (${JSON.stringify([...a])}) have no values in common \u2014 the candidate can never fire while the existing rule holds.`}:c.length===i.size&&c.length<a.size?{type:"subset",reason:`Candidate $in set for ${e.path} is a strict subset of the existing rule's $in set.`}:null}let r=e.op==="$gt"||e.op==="$gte"?e.value:void 0,s=e.op==="$lt"||e.op==="$lte"?e.value:void 0,o=n.op==="$gt"||n.op==="$gte"?n.value:void 0,u=n.op==="$lt"||n.op==="$lte"?n.value:void 0;if(r!==void 0&&u!==void 0){let i=j(r,u);if(!Number.isNaN(i)&&(i>0||i===0&&(e.op==="$gt"||n.op==="$lt")))return {type:"direct",reason:`Candidate requires ${e.path} ${e.op==="$gt"?">":"\u2265"} ${JSON.stringify(r)} but an existing rule caps it at ${n.op==="$lt"?"<":"\u2264"} ${JSON.stringify(u)}.`}}if(o!==void 0&&s!==void 0){let i=j(o,s);if(!Number.isNaN(i)&&(i>0||i===0&&(n.op==="$gt"||e.op==="$lt")))return {type:"direct",reason:`Candidate caps ${e.path} at ${e.op==="$lt"?"<":"\u2264"} ${JSON.stringify(s)} but an existing rule requires it ${n.op==="$gt"?">":"\u2265"} ${JSON.stringify(o)}.`}}if(r!==void 0&&o!==void 0){let i=j(r,o);if(!Number.isNaN(i)&&i>0)return {type:"subset",reason:`Candidate's lower bound on ${e.path} (${JSON.stringify(r)}) is stricter than the existing rule's lower bound (${JSON.stringify(o)}) \u2014 candidate is a subset.`}}if(s!==void 0&&u!==void 0){let i=j(s,u);if(!Number.isNaN(i)&&i<0)return {type:"subset",reason:`Candidate's upper bound on ${e.path} (${JSON.stringify(s)}) is stricter than the existing rule's upper bound (${JSON.stringify(u)}) \u2014 candidate is a subset.`}}return {type:"overlap",reason:`Both rules constrain "${e.path}".`}}function P(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}var ce={checkAgainst(e,n){let r=Array.isArray(n)?n:"constraints"in n&&Array.isArray(n.constraints)?n.constraints:[],s=b(e);if(s.length===0)return {contradictions:[],warnings:[]};let o=new Map;for(let a of s){let c=o.get(a.path)??[];c.push(a),o.set(a.path,c);}let u=[],i=[];for(let a of r){if(!P(a)||a.whenSpec===void 0)continue;let c=b(a.whenSpec);for(let d of c){let f=o.get(d.path);if(f)for(let p of f){let g=ie(p,d);if(!g)continue;let m={constraintId:a.id,type:g.type,reason:g.reason,candidatePath:p.path,candidate:{op:p.op,value:p.value},existing:{op:d.op,value:d.value}};g.type==="overlap"||g.type==="subset"?i.push(m):u.push(m);}}}return {contradictions:u,warnings:i}},checkAbortOn(e,n){let r=Array.isArray(n)?n:"constraints"in n&&Array.isArray(n.constraints)?n.constraints:[],s=b(e);if(s.length===0)return {warnings:[]};let o=new Set(s.map(i=>i.path)),u=[];for(let i of r){if(!P(i))continue;let a=Array.isArray(i.abortOn)?i.abortOn:[],c=Array.isArray(i.bind)?i.bind:[];for(let d of a)o.has(d)&&u.push({constraintId:i.id,candidatePath:d,source:"abortOn",reason:`Constraint "${i.id}" aborts on "${d}" \u2014 candidate would race or shadow its writes.`,severity:"warning"});for(let d of c)o.has(d)&&u.push({constraintId:i.id,candidatePath:d,source:"bind",reason:`Constraint "${i.id}" binds "${d}" \u2014 candidate would write to a bound field.`,severity:"warning"});}return {warnings:u}}};function T(e){if(e instanceof Date)return e.getTime();if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("[Directive] audit-ledger: changedBetween bound must be a finite number, ISO string, or Date.");return e}if(typeof e=="string"){let n=Date.parse(e);if(!Number.isFinite(n))throw new Error(`[Directive] audit-ledger: changedBetween bound "${e}" is not a parseable ISO date string.`);return n}throw new Error("[Directive] audit-ledger: changedBetween bound must be a number, ISO string, or Date.")}function J(e,n){if(n.kind&&!(Array.isArray(n.kind)?n.kind:[n.kind]).includes(e.kind))return false;if(n.factPath!==void 0)if(e.kind==="fact.change"){if(e.key!==n.factPath)return false}else if(e.kind==="resolver.write.rejected"){if(e.fact!==n.factPath)return false}else return false;if(n.constraintId!==void 0&&(e.kind!=="constraint.evaluate"||e.constraintId!==n.constraintId))return false;if(n.changedBetween){let[r,s]=n.changedBetween,o=T(r),u=T(s);if(e.ts<o||e.ts>u)return false}return true}function L(e={}){let n=e.capacity??1e4,r=[],s=null;return {write(u){if(r.length>=n){let i=r[0];s?.(i.seq,1),r.shift();}for(r.push(u);r.length>n;)r.shift();},query(u){let i=u.limit??1e3,a=[];for(let c=r.length-1;c>=0;c--){let d=r[c];if(J(d,u)&&(a.push(d),a.length>=i))break}return a},recent(u){let i=Math.max(0,r.length-u);return r.slice(i)},forFact(u,i={}){return this.query({factPath:u,limit:i.limit})},forConstraint(u,i={}){return this.query({constraintId:u,limit:i.limit})},toJSON(){return {entries:r.slice(),capturedAt:Date.now()}},clear(){r=[];},destroy(){r=[],s=null;},erase(u,i){let a=0;for(let c=0;c<r.length;c++){let d=r[c];J(d,u)&&(r[c]=i(d),a++);}return a},onTruncate(u){s=u;}}}var N=Symbol("directive.audit-ledger.internal");function _(e){for(let n of Object.keys(e)){let r=e[n];if(r!==null&&typeof r=="object"){if(Array.isArray(r)&&n==="whenExplain")for(let s of r)s!==null&&typeof s=="object"&&Object.freeze(s);Object.freeze(r);}}return Object.freeze(e),e}function se(e){return i$1(e)}function R(e){if(e.hashAlgo==="djb2-1")return se(e);throw new Error(`[Directive] audit-ledger: unknown hashAlgo "${String(e.hashAlgo)}" on entry seq=${e.seq}. Cannot verify chain integrity. Known algorithms: "djb2-1".`)}function V(e,n,r){if(e===null||typeof e!="object")return;let s=[];for(let i of n.split(".")){if(!i)continue;let a=i.match(/^\[(\d+)\](.*)$/);if(a){s.push(Number(a[1])),a[2]&&s.push(a[2].replace(/^\./,""));continue}let c=i.match(/^([^[]+)\[(\d+)\](.*)$/);if(c){s.push(c[1]),s.push(Number(c[2])),c[3]&&s.push(c[3].replace(/^\./,""));continue}s.push(i);}let o=e;for(let i=0;i<s.length-1;i++){let a=s[i];if(o===null||typeof o!="object")return;o=o[a];}if(o===null||typeof o!="object")return;let u=s[s.length-1];u!==void 0&&(o[u]=r);}function K(e,n,r){if(n||r.size===0||e===null||typeof e!="object")return e;let s;try{s=JSON.parse(JSON.stringify(e));}catch{return e}return i(s,{operator(o,u,i,a){r.has(o)&&V(s,a,"[redacted]");},literal(o){r.has(o)&&V(s,o,"[redacted]");}}),s}var z="djb2-1";function Q(e,n){if(n?.strong===true)throw new Error("[Directive] verify({ strong: true }) is reserved for v2 \u2014 v1 ships sync djb2 chain only. Use verify() (sync) for tamper detection.");let{entries:r}=e.toJSON();if(r.length===0)return {valid:true,entryCount:0};let s=new Set,o=null;for(let i=0;i<r.length;i++){let a=r[i];if(a.prevHash!==o){let c=i>0?r[i-1]:null,d=a.kind==="system.entry-erased",f=c?.kind==="system.entry-erased";if(d||f){let p=[];d&&p.push(a),f&&c!==null&&p.push(c);let g=p.find(w=>w.__internal!==N);if(g)return {valid:false,brokenAt:i,expectedHash:o??"<genesis>",actualHash:a.prevHash??"<genesis>",entry:g,reason:"tombstone forgery detected \u2014 missing internal sentinel. A 'system.entry-erased' entry was written via sink.write() rather than ledger.erase(); rejected as tamper."};let m=d?a:c;s.add(m.seq),o=R(a);continue}return {valid:false,brokenAt:i,expectedHash:o??"<genesis>",actualHash:a.prevHash??"<genesis>",entry:a}}o=R(a);}let u={valid:true,entryCount:r.length};return s.size>0&&(u.erasedSeqs=[...s].sort((i,a)=>i-a)),u}function Ce(e={}){let n=e.sink??L(),r=e.capturePII??false,s=e.redact,o=0,u=null,i=null,a=null,c=new Map,d=new Map,f=new Set;function p(){if(c.clear(),d.clear(),!!i)try{let t=i.inspect;if(typeof t!="function")return;let h=t()?.constraints??[],k=i.$internal?.mergedConstraints;for(let A of h)if(A.whenSpec!==void 0)c.set(A.id,K(A.whenSpec,r,f));else {let v=k?.[A.id],C=v&&typeof v.when=="function"?v.when:void 0;C?d.set(A.id,i$1(String(C))):A.when!==void 0&&typeof A.when=="function"?d.set(A.id,i$1(String(A.when))):d.set(A.id,i$1("[function]"));}}catch{}}function g(){if(f.clear(),!(r||!i))try{let t=i.meta;if(!t||typeof t.byTag!="function")return;let l=t.byTag("pii")??[];for(let h of l)f.add(h.id);}catch{}}function m(t,l){return r?l:f.has(t)?"[redacted]":l}function w(t){if(!t||r||f.size===0)return t;let l=false,h=t.map(k=>{if(f.has(k.path))return l=true,{...k,actual:"[redacted]"};if(k.children){let A=w(k.children);if(A!==k.children)return l=true,{...k,children:A}}return k});return l?h:t}function y(t){let l={...t,seq:o++,ts:Date.now(),prevHash:u,hashAlgo:z,schemaVersion:1},h=s?s(l):l;return _(h),n.write(h),u=R(h),h}function W(t){switch(t.type){case "constraint.evaluate":{let l=c.get(t.id),h=d.get(t.id),k={kind:"constraint.evaluate",constraintId:t.id,active:t.active,whenExplain:w(t.whenExplain)};l!==void 0?k.whenSpec=l:h!==void 0&&(k.whenSource={kind:"function",sourceHash:h}),y(k);break}case "fact.change":y({kind:"fact.change",key:t.key,prior:m(t.key,t.prev),next:m(t.key,t.next)});break;case "resolver.write.rejected":t.kind==="summary"?y({kind:"resolver.write.rejected",rejection:"summary",resolverId:t.resolver,requirementId:t.requirementId,reason:t.reason,dropped:t.dropped}):y({kind:"resolver.write.rejected",rejection:"rejection",resolverId:t.resolver,requirementId:t.requirementId,reason:t.reason,fact:t.fact,expected:m(t.fact,t.expected),actual:m(t.fact,t.actual)});break;case "resolver.clobber.loop.detected":y({kind:"resolver.clobber.loop.detected",systemId:t.systemId,fact:t.fact,participants:t.participants,windowMs:t.windowMs,count:t.count,severity:t.severity,rejectionSeqs:t.rejectionSeqs,...t.predicateOverlap?{overlapVerdict:t.predicateOverlap.verdict}:{}});break;case "resolver.clobber.loop.resolved":y({kind:"resolver.clobber.loop.resolved",systemId:t.systemId,fact:t.fact,participants:t.participants,durationMs:t.durationMs,resolution:t.resolution});break;case "resolver.complete":y({kind:"resolver.complete",resolverId:t.resolver,requirementId:t.requirementId,duration:t.duration});break;case "resolver.error":y({kind:"resolver.error",resolverId:t.resolver,requirementId:t.requirementId,error:String(t.error)});break;case "system.init":case "system.start":case "system.stop":case "system.destroy":y({kind:t.type});break;case "source.attach":case "source.detach":y({kind:t.type,sourceId:t.id,moduleId:t.moduleId});break;case "source.error":y({kind:"source.error",sourceId:t.id,moduleId:t.moduleId,phase:t.phase,error:t.error instanceof Error?t.error.message:String(t.error)});break;}}let x=false;function G(t){i=t,g(),p(),a=t.observe(W),n.onTruncate?.((l,h)=>{if(!x){x=true;try{y({kind:"system.truncated",droppedSeq:l,droppedCount:h});}finally{x=false;}}});}function F(){a&&(a(),a=null),i=null,c.clear(),d.clear(),f.clear();}let Y={name:"audit-ledger",onInit(t){G(t);},onStop(){a&&(a(),a=null);},onDestroy(){F();},onDefinitionRegister(t,l){t==="constraint"&&p(),(t==="constraint"||t==="resolver"||t==="effect")&&g();},onDefinitionAssign(t,l){t==="constraint"&&p();},onDefinitionUnregister(t,l){t==="constraint"&&p();},onSnapshot(t){y({kind:"system.snapshot",snapshotId:t.id,trigger:t.trigger});},onHistoryNavigate(t,l){y({kind:"system.history.navigate",from:t,to:l});}};function X(t){if(t.__internal===void 0)return t;let l={...t};return l.__internal=void 0,l}function S(t){let l=false;for(let h of t)if(h.__internal!==void 0){l=true;break}return l?t.map(X):t}return {plugin:Y,query:(t={})=>S(n.query(t)),recent:t=>S(n.recent(t)),forFact:(t,l)=>S(n.forFact(t,l)),forConstraint:(t,l)=>S(n.forConstraint(t,l)),toJSON:()=>{let t=n.toJSON();return {entries:S(t.entries),capturedAt:t.capturedAt}},verify(t){return Q(n,t)},erase(t){let l=Date.now(),h=0;if(typeof n.erase=="function"&&(h=n.erase(t,v=>{let C={seq:v.seq,ts:v.ts,kind:"system.entry-erased",prevHash:v.prevHash,hashAlgo:v.hashAlgo,schemaVersion:v.schemaVersion??1,originalKind:v.kind,erasedAt:l,__internal:N};return _(C),C})),h===0)return {erased:0,markerEntry:null};let k={factPath:t.factPath!==void 0,constraintId:t.constraintId!==void 0,kind:t.kind,changedBetween:t.changedBetween!==void 0?"[range]":void 0},A=y({kind:"system.subject-erased",filterHash:i$1(t),filterShape:k,erased:h});return {erased:h,markerEntry:A}},clear(){n.clear(),o=0,u=null;},destroy(){F(),n.destroy();}}}export{B as a,b,ae as c,re as d,ie as e,ce as f,K as g,L as h,Ce as i};//# sourceMappingURL=chunk-PJIIBQTK.js.map
2
- //# sourceMappingURL=chunk-PJIIBQTK.js.map
1
+ import {i}from'./chunk-LN5H74CU.js';import {f,i as i$1}from'./chunk-IZNOPHPL.js';function B(e){let n=e&&typeof e=="object"&&!Array.isArray(e)&&"constraints"in e?e.constraints:e;if(Array.isArray(n)){let r={};for(let s of n){if(!s||typeof s!="object"||!("id"in s))throw new Error("[Directive] diffRules: array entries must be `{ id, whenSpec }` objects");let o=s;if(typeof o.id!="string")throw new Error("[Directive] diffRules: constraint `id` must be a string");r[o.id]=o.whenSpec;}return r}if(n&&typeof n=="object")return n;throw new Error("[Directive] diffRules: expected a `{ id: whenSpec }` map, an array of `{ id, whenSpec }`, or `{ constraints: ... }`")}var Z=new Set(["$eq","$ne","$in","$nin","$exists","$gt","$gte","$lt","$lte","$between","$matches","$startsWith","$endsWith","$contains","$changed"]),ee=new Set(["$all","$any","$not"]);function M(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ne(e){if(!M(e))return false;let n=Object.keys(e);if(n.length===0)return false;let r=false;for(let s of n){if(!s.startsWith("$"))return false;Z.has(s)&&(r=true);}return r}function b(e,n="",r=[]){if(e===null||typeof e!="object")return r;if(Array.isArray(e)){for(let s of e)if(s&&typeof s=="object"&&"fact"in s&&"op"in s){let o=s;r.push({path:n?`${n}.${String(o.fact)}`:String(o.fact),op:String(o.op),value:o.value});}return r}if("$all"in e&&Array.isArray(e.$all))return e.$all.forEach((o,u)=>{b(o,`${n}$all[${u}]`,r);}),r;if("$any"in e&&Array.isArray(e.$any))return e.$any.forEach((o,u)=>{b(o,`${n}$any[${u}]`,r);}),r;if("$not"in e)return b(e.$not,`${n}$not`,r),r;for(let[s,o]of Object.entries(e)){let u=n?`${n}.${s}`:s;if(ne(o))for(let[i,a]of Object.entries(o))r.push({path:u,op:i,value:a});else M(o)&&!ee.has(s)?b(o,u,r):r.push({path:u,op:"$eq",value:o});}return r}function E(e){return typeof e=="number"&&Number.isFinite(e)}function te(e,n,r){switch(e){case "$gte":case "$gt":if(E(n)&&E(r)){if(r<n)return "relaxed";if(r>n)return "tightened"}return null;case "$lte":case "$lt":if(E(n)&&E(r)){if(r>n)return "relaxed";if(r<n)return "tightened"}return null;case "$between":{if(Array.isArray(n)&&Array.isArray(r)&&n.length===2&&r.length===2&&E(n[0])&&E(n[1])&&E(r[0])&&E(r[1])){let s=n[1]-n[0],o=r[1]-r[0];if(o>s)return "relaxed";if(o<s)return "tightened"}return null}case "$in":case "$nin":{if(Array.isArray(n)&&Array.isArray(r))if(e==="$in"){if(r.length>n.length)return "relaxed";if(r.length<n.length)return "tightened"}else {if(r.length>n.length)return "tightened";if(r.length<n.length)return "relaxed"}return null}case "$contains":{if(Array.isArray(n)&&Array.isArray(r)){if(r.length>n.length)return "relaxed";if(r.length<n.length)return "tightened"}return null}default:return null}}function ae(e){let n=B(e.before),r=B(e.after),o=[...new Set([...Object.keys(n),...Object.keys(r)])].sort(),u=[],i={added:0,removed:0,changed:0,unchanged:0,totalClauseChanges:0};for(let a of o){let c=n[a],d=r[a],f=a in n,p=a in r;if(f&&!p){let m=b(c),w=m.length===0?[{path:"(function-form predicate)",kind:"removed"}]:m.map(y=>({path:y.path,kind:"removed",before:{op:y.op,value:y.value}}));q(w),u.push({id:a,status:"removed",changes:w}),i.removed++,i.totalClauseChanges+=w.length;continue}if(!f&&p){let m=b(d),w=m.length===0?[{path:"(function-form predicate)",kind:"added"}]:m.map(y=>({path:y.path,kind:"added",after:{op:y.op,value:y.value}}));q(w),u.push({id:a,status:"added",changes:w}),i.added++,i.totalClauseChanges+=w.length;continue}let g=re(c,d);g.length===0?(u.push({id:a,status:"unchanged",changes:[]}),i.unchanged++):(u.push({id:a,status:"changed",changes:g}),i.changed++,i.totalClauseChanges+=g.length);}return {constraints:u,summary:i}}function re(e,n){if(e!==void 0&&n!==void 0&&(e===null||n===null||typeof e!="object"||typeof n!="object"))return f(e)===f(n)?[]:[{path:"",kind:"changed",before:{op:"$eq",value:e},after:{op:"$eq",value:n}}];let r=e===void 0?[]:b(e),s=n===void 0?[]:b(n),o=d=>`${d.path}::${d.op}`,u=new Map(r.map(d=>[o(d),d])),i=new Map(s.map(d=>[o(d),d])),a=new Set([...u.keys(),...i.keys()]),c=[];for(let d of a){let f$1=u.get(d),p=i.get(d);if(f$1&&!p){c.push({path:f$1.path,kind:"removed",before:{op:f$1.op,value:f$1.value}});continue}if(!f$1&&p){c.push({path:p.path,kind:"added",after:{op:p.op,value:p.value}});continue}if(f$1&&p){if(f(f$1.value)===f(p.value))continue;let g=te(f$1.op,f$1.value,p.value);c.push({path:f$1.path,kind:g??"changed",before:{op:f$1.op,value:f$1.value},after:{op:p.op,value:p.value}});}}return q(c),c}function q(e){e.sort((n,r)=>{let s=n.path.localeCompare(r.path);if(s!==0)return s;let o=n.before?.op??n.after?.op??"",u=r.before?.op??r.after?.op??"";return o.localeCompare(u)});}var H=new Set(["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin"]);function j(e,n){if(e===n)return 0;if(typeof e=="number"&&typeof n=="number"||typeof e=="bigint"&&typeof n=="bigint")return e<n?-1:e>n?1:0;if(e instanceof Date&&n instanceof Date){let r=e.getTime(),s=n.getTime();return r<s?-1:r>s?1:0}return typeof e=="string"&&typeof n=="string"?e<n?-1:e>n?1:0:Number.NaN}function O(e,n){if(e===n)return true;if(typeof e!=typeof n||e===null||n===null||typeof e!="object"||Array.isArray(e)!==Array.isArray(n))return false;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return false;for(let o=0;o<e.length;o++)if(!O(e[o],n[o]))return false;return true}let r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return false;for(let o of r)if(!O(e[o],n[o]))return false;return true}function ie(e,n){if(!H.has(e.op)||!H.has(n.op))return {type:"overlap",reason:`Both rules touch "${e.path}".`};if(e.op==="$eq"&&n.op==="$eq")return O(e.value,n.value)?{type:"subset",reason:`Both rules require ${e.path} = ${JSON.stringify(e.value)} \u2014 candidate is redundant.`}:{type:"direct",reason:`Candidate requires ${e.path} = ${JSON.stringify(e.value)} but an existing rule requires ${e.path} = ${JSON.stringify(n.value)} \u2014 they cannot both fire.`};if(e.op==="$eq"&&n.op==="$ne")return O(e.value,n.value)?{type:"direct",reason:`Candidate requires ${e.path} = ${JSON.stringify(e.value)} but an existing rule excludes that value.`}:null;if(e.op==="$ne"&&n.op==="$eq")return O(e.value,n.value)?{type:"direct",reason:`Candidate excludes ${e.path} = ${JSON.stringify(e.value)} but an existing rule requires that exact value.`}:null;if(e.op==="$in"&&n.op==="$in"){let i=new Set(Array.isArray(e.value)?e.value:[]),a=new Set(Array.isArray(n.value)?n.value:[]),c=[...i].filter(d=>a.has(d));return c.length===0?{type:"direct",reason:`Candidate $in set for ${e.path} (${JSON.stringify([...i])}) and existing $in set (${JSON.stringify([...a])}) have no values in common \u2014 the candidate can never fire while the existing rule holds.`}:c.length===i.size&&c.length<a.size?{type:"subset",reason:`Candidate $in set for ${e.path} is a strict subset of the existing rule's $in set.`}:null}let r=e.op==="$gt"||e.op==="$gte"?e.value:void 0,s=e.op==="$lt"||e.op==="$lte"?e.value:void 0,o=n.op==="$gt"||n.op==="$gte"?n.value:void 0,u=n.op==="$lt"||n.op==="$lte"?n.value:void 0;if(r!==void 0&&u!==void 0){let i=j(r,u);if(!Number.isNaN(i)&&(i>0||i===0&&(e.op==="$gt"||n.op==="$lt")))return {type:"direct",reason:`Candidate requires ${e.path} ${e.op==="$gt"?">":"\u2265"} ${JSON.stringify(r)} but an existing rule caps it at ${n.op==="$lt"?"<":"\u2264"} ${JSON.stringify(u)}.`}}if(o!==void 0&&s!==void 0){let i=j(o,s);if(!Number.isNaN(i)&&(i>0||i===0&&(n.op==="$gt"||e.op==="$lt")))return {type:"direct",reason:`Candidate caps ${e.path} at ${e.op==="$lt"?"<":"\u2264"} ${JSON.stringify(s)} but an existing rule requires it ${n.op==="$gt"?">":"\u2265"} ${JSON.stringify(o)}.`}}if(r!==void 0&&o!==void 0){let i=j(r,o);if(!Number.isNaN(i)&&i>0)return {type:"subset",reason:`Candidate's lower bound on ${e.path} (${JSON.stringify(r)}) is stricter than the existing rule's lower bound (${JSON.stringify(o)}) \u2014 candidate is a subset.`}}if(s!==void 0&&u!==void 0){let i=j(s,u);if(!Number.isNaN(i)&&i<0)return {type:"subset",reason:`Candidate's upper bound on ${e.path} (${JSON.stringify(s)}) is stricter than the existing rule's upper bound (${JSON.stringify(u)}) \u2014 candidate is a subset.`}}return {type:"overlap",reason:`Both rules constrain "${e.path}".`}}function P(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}var ce={checkAgainst(e,n){let r=Array.isArray(n)?n:"constraints"in n&&Array.isArray(n.constraints)?n.constraints:[],s=b(e);if(s.length===0)return {contradictions:[],warnings:[]};let o=new Map;for(let a of s){let c=o.get(a.path)??[];c.push(a),o.set(a.path,c);}let u=[],i=[];for(let a of r){if(!P(a)||a.whenSpec===void 0)continue;let c=b(a.whenSpec);for(let d of c){let f=o.get(d.path);if(f)for(let p of f){let g=ie(p,d);if(!g)continue;let m={constraintId:a.id,type:g.type,reason:g.reason,candidatePath:p.path,candidate:{op:p.op,value:p.value},existing:{op:d.op,value:d.value}};g.type==="overlap"||g.type==="subset"?i.push(m):u.push(m);}}}return {contradictions:u,warnings:i}},checkAbortOn(e,n){let r=Array.isArray(n)?n:"constraints"in n&&Array.isArray(n.constraints)?n.constraints:[],s=b(e);if(s.length===0)return {warnings:[]};let o=new Set(s.map(i=>i.path)),u=[];for(let i of r){if(!P(i))continue;let a=Array.isArray(i.abortOn)?i.abortOn:[],c=Array.isArray(i.bind)?i.bind:[];for(let d of a)o.has(d)&&u.push({constraintId:i.id,candidatePath:d,source:"abortOn",reason:`Constraint "${i.id}" aborts on "${d}" \u2014 candidate would race or shadow its writes.`,severity:"warning"});for(let d of c)o.has(d)&&u.push({constraintId:i.id,candidatePath:d,source:"bind",reason:`Constraint "${i.id}" binds "${d}" \u2014 candidate would write to a bound field.`,severity:"warning"});}return {warnings:u}}};function T(e){if(e instanceof Date)return e.getTime();if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("[Directive] audit-ledger: changedBetween bound must be a finite number, ISO string, or Date.");return e}if(typeof e=="string"){let n=Date.parse(e);if(!Number.isFinite(n))throw new Error(`[Directive] audit-ledger: changedBetween bound "${e}" is not a parseable ISO date string.`);return n}throw new Error("[Directive] audit-ledger: changedBetween bound must be a number, ISO string, or Date.")}function J(e,n){if(n.kind&&!(Array.isArray(n.kind)?n.kind:[n.kind]).includes(e.kind))return false;if(n.factPath!==void 0)if(e.kind==="fact.change"){if(e.key!==n.factPath)return false}else if(e.kind==="resolver.write.rejected"){if(e.fact!==n.factPath)return false}else return false;if(n.constraintId!==void 0&&(e.kind!=="constraint.evaluate"||e.constraintId!==n.constraintId))return false;if(n.changedBetween){let[r,s]=n.changedBetween,o=T(r),u=T(s);if(e.ts<o||e.ts>u)return false}return true}function L(e={}){let n=e.capacity??1e4,r=[],s=null;return {write(u){if(r.length>=n){let i=r[0];s?.(i.seq,1),r.shift();}for(r.push(u);r.length>n;)r.shift();},query(u){let i=u.limit??1e3,a=[];for(let c=r.length-1;c>=0;c--){let d=r[c];if(J(d,u)&&(a.push(d),a.length>=i))break}return a},recent(u){let i=Math.max(0,r.length-u);return r.slice(i)},forFact(u,i={}){return this.query({factPath:u,limit:i.limit})},forConstraint(u,i={}){return this.query({constraintId:u,limit:i.limit})},toJSON(){return {entries:r.slice(),capturedAt:Date.now()}},clear(){r=[];},destroy(){r=[],s=null;},erase(u,i){let a=0;for(let c=0;c<r.length;c++){let d=r[c];J(d,u)&&(r[c]=i(d),a++);}return a},onTruncate(u){s=u;}}}var N=Symbol("directive.audit-ledger.internal");function _(e){for(let n of Object.keys(e)){let r=e[n];if(r!==null&&typeof r=="object"){if(Array.isArray(r)&&n==="whenExplain")for(let s of r)s!==null&&typeof s=="object"&&Object.freeze(s);Object.freeze(r);}}return Object.freeze(e),e}function se(e){return i$1(e)}function R(e){if(e.hashAlgo==="djb2-1")return se(e);throw new Error(`[Directive] audit-ledger: unknown hashAlgo "${String(e.hashAlgo)}" on entry seq=${e.seq}. Cannot verify chain integrity. Known algorithms: "djb2-1".`)}function V(e,n,r){if(e===null||typeof e!="object")return;let s=[];for(let i of n.split(".")){if(!i)continue;let a=i.match(/^\[(\d+)\](.*)$/);if(a){s.push(Number(a[1])),a[2]&&s.push(a[2].replace(/^\./,""));continue}let c=i.match(/^([^[]+)\[(\d+)\](.*)$/);if(c){s.push(c[1]),s.push(Number(c[2])),c[3]&&s.push(c[3].replace(/^\./,""));continue}s.push(i);}let o=e;for(let i=0;i<s.length-1;i++){let a=s[i];if(o===null||typeof o!="object")return;o=o[a];}if(o===null||typeof o!="object")return;let u=s[s.length-1];u!==void 0&&(o[u]=r);}function K(e,n,r){if(n||r.size===0||e===null||typeof e!="object")return e;let s;try{s=JSON.parse(JSON.stringify(e));}catch{return e}return i(s,{operator(o,u,i,a){r.has(o)&&V(s,a,"[redacted]");},literal(o){r.has(o)&&V(s,o,"[redacted]");}}),s}var z="djb2-1";function Q(e,n){if(n?.strong===true)throw new Error("[Directive] verify({ strong: true }) is reserved for v2 \u2014 v1 ships sync djb2 chain only. Use verify() (sync) for tamper detection.");let{entries:r}=e.toJSON();if(r.length===0)return {valid:true,entryCount:0};let s=new Set,o=null;for(let i=0;i<r.length;i++){let a=r[i];if(a.prevHash!==o){let c=i>0?r[i-1]:null,d=a.kind==="system.entry-erased",f=c?.kind==="system.entry-erased";if(d||f){let p=[];d&&p.push(a),f&&c!==null&&p.push(c);let g=p.find(w=>w.__internal!==N);if(g)return {valid:false,brokenAt:i,expectedHash:o??"<genesis>",actualHash:a.prevHash??"<genesis>",entry:g,reason:"tombstone forgery detected \u2014 missing internal sentinel. A 'system.entry-erased' entry was written via sink.write() rather than ledger.erase(); rejected as tamper."};let m=d?a:c;s.add(m.seq),o=R(a);continue}return {valid:false,brokenAt:i,expectedHash:o??"<genesis>",actualHash:a.prevHash??"<genesis>",entry:a}}o=R(a);}let u={valid:true,entryCount:r.length};return s.size>0&&(u.erasedSeqs=[...s].sort((i,a)=>i-a)),u}function Ce(e={}){let n=e.sink??L(),r=e.capturePII??false,s=e.redact,o=0,u=null,i=null,a=null,c=new Map,d=new Map,f=new Set;function p(){if(c.clear(),d.clear(),!!i)try{let t=i.inspect;if(typeof t!="function")return;let h=t()?.constraints??[],k=i.$internal?.mergedConstraints;for(let A of h)if(A.whenSpec!==void 0)c.set(A.id,K(A.whenSpec,r,f));else {let v=k?.[A.id],C=v&&typeof v.when=="function"?v.when:void 0;C?d.set(A.id,i$1(String(C))):A.when!==void 0&&typeof A.when=="function"?d.set(A.id,i$1(String(A.when))):d.set(A.id,i$1("[function]"));}}catch{}}function g(){if(f.clear(),!(r||!i))try{let t=i.meta;if(!t||typeof t.byTag!="function")return;let l=t.byTag("pii")??[];for(let h of l)f.add(h.id);}catch{}}function m(t,l){return r?l:f.has(t)?"[redacted]":l}function w(t){if(!t||r||f.size===0)return t;let l=false,h=t.map(k=>{if(f.has(k.path))return l=true,{...k,actual:"[redacted]"};if(k.children){let A=w(k.children);if(A!==k.children)return l=true,{...k,children:A}}return k});return l?h:t}function y(t){let l={...t,seq:o++,ts:Date.now(),prevHash:u,hashAlgo:z,schemaVersion:1},h=s?s(l):l;return _(h),n.write(h),u=R(h),h}function W(t){switch(t.type){case "constraint.evaluate":{let l=c.get(t.id),h=d.get(t.id),k={kind:"constraint.evaluate",constraintId:t.id,active:t.active,whenExplain:w(t.whenExplain)};l!==void 0?k.whenSpec=l:h!==void 0&&(k.whenSource={kind:"function",sourceHash:h}),y(k);break}case "fact.change":y({kind:"fact.change",key:t.key,prior:m(t.key,t.prev),next:m(t.key,t.next)});break;case "resolver.write.rejected":t.kind==="summary"?y({kind:"resolver.write.rejected",rejection:"summary",resolverId:t.resolver,requirementId:t.requirementId,reason:t.reason,dropped:t.dropped}):y({kind:"resolver.write.rejected",rejection:"rejection",resolverId:t.resolver,requirementId:t.requirementId,reason:t.reason,fact:t.fact,expected:m(t.fact,t.expected),actual:m(t.fact,t.actual)});break;case "resolver.clobber.loop.detected":y({kind:"resolver.clobber.loop.detected",systemId:t.systemId,fact:t.fact,participants:t.participants,windowMs:t.windowMs,count:t.count,severity:t.severity,rejectionSeqs:t.rejectionSeqs,...t.predicateOverlap?{overlapVerdict:t.predicateOverlap.verdict}:{}});break;case "resolver.clobber.loop.resolved":y({kind:"resolver.clobber.loop.resolved",systemId:t.systemId,fact:t.fact,participants:t.participants,durationMs:t.durationMs,resolution:t.resolution});break;case "resolver.complete":y({kind:"resolver.complete",resolverId:t.resolver,requirementId:t.requirementId,duration:t.duration});break;case "resolver.error":y({kind:"resolver.error",resolverId:t.resolver,requirementId:t.requirementId,error:String(t.error)});break;case "system.init":case "system.start":case "system.stop":case "system.destroy":y({kind:t.type});break;case "source.attach":case "source.detach":y({kind:t.type,sourceId:t.id,moduleId:t.moduleId});break;case "source.error":y({kind:"source.error",sourceId:t.id,moduleId:t.moduleId,phase:t.phase,error:t.error instanceof Error?t.error.message:String(t.error)});break;}}let x=false;function G(t){i=t,g(),p(),a=t.observe(W),n.onTruncate?.((l,h)=>{if(!x){x=true;try{y({kind:"system.truncated",droppedSeq:l,droppedCount:h});}finally{x=false;}}});}function F(){a&&(a(),a=null),i=null,c.clear(),d.clear(),f.clear();}let Y={name:"audit-ledger",onInit(t){G(t);},onStop(){a&&(a(),a=null);},onDestroy(){F();},onDefinitionRegister(t,l){t==="constraint"&&p(),(t==="constraint"||t==="resolver"||t==="effect")&&g();},onDefinitionAssign(t,l){t==="constraint"&&p();},onDefinitionUnregister(t,l){t==="constraint"&&p();},onSnapshot(t){y({kind:"system.snapshot",snapshotId:t.id,trigger:t.trigger});},onHistoryNavigate(t,l){y({kind:"system.history.navigate",from:t,to:l});}};function X(t){if(t.__internal===void 0)return t;let l={...t};return l.__internal=void 0,l}function S(t){let l=false;for(let h of t)if(h.__internal!==void 0){l=true;break}return l?t.map(X):t}return {plugin:Y,query:(t={})=>S(n.query(t)),recent:t=>S(n.recent(t)),forFact:(t,l)=>S(n.forFact(t,l)),forConstraint:(t,l)=>S(n.forConstraint(t,l)),toJSON:()=>{let t=n.toJSON();return {entries:S(t.entries),capturedAt:t.capturedAt}},verify(t){return Q(n,t)},erase(t){let l=Date.now(),h=0;if(typeof n.erase=="function"&&(h=n.erase(t,v=>{let C={seq:v.seq,ts:v.ts,kind:"system.entry-erased",prevHash:v.prevHash,hashAlgo:v.hashAlgo,schemaVersion:v.schemaVersion??1,originalKind:v.kind,erasedAt:l,__internal:N};return _(C),C})),h===0)return {erased:0,markerEntry:null};let k={factPath:t.factPath!==void 0,constraintId:t.constraintId!==void 0,kind:t.kind,changedBetween:t.changedBetween!==void 0?"[range]":void 0},A=y({kind:"system.subject-erased",filterHash:i$1(t),filterShape:k,erased:h});return {erased:h,markerEntry:A}},clear(){n.clear(),o=0,u=null;},destroy(){F(),n.destroy();}}}export{B as a,b,ae as c,re as d,ie as e,ce as f,K as g,L as h,Ce as i};//# sourceMappingURL=chunk-QR2756CJ.js.map
2
+ //# sourceMappingURL=chunk-QR2756CJ.js.map