@inkeep/open-knowledge 0.4.0-beta.31 → 0.4.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/config-schema.json +0 -13
- package/dist/config.project.schema.json +0 -13
- package/dist/constants-BVG2ymMz.mjs +2 -0
- package/dist/{dist-DOIb_FW2.mjs → dist-Bfw3oOGm.mjs} +12 -12
- package/dist/{dist-YAZrJ15a.mjs → dist-BjlSvO5w.mjs} +1 -1
- package/dist/{dist-D3xMMmYf.mjs → dist-k62w-4-v.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-CcjfJ0-a.mjs +1 -0
- package/dist/{init-3-63uZzL.mjs → init-DsLc7vc7.mjs} +3 -3
- package/dist/loader-BLwabAxT.mjs +1 -0
- package/dist/{loader-BohnSRzb.mjs → loader-DmKx1Dxe.mjs} +3 -3
- package/dist/{preview-KUL_V2fF.mjs → preview-CuLb6srO.mjs} +2 -2
- package/dist/preview-GtCa8ObI.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DbLaeHZ0.js → ActivityModeContent-PLMlj69Z.js} +1 -1
- package/dist/public/assets/{DocumentContext-BoqbPYlX.js → DocumentContext-DyDoN3zw.js} +1 -1
- package/dist/public/assets/{GraphPanel-D3k9jF0Q.js → GraphPanel-CSCNVbH4.js} +1 -1
- package/dist/public/assets/{SettingsDialog-UrpLReCS.js → SettingsDialog-BZIR95bl.js} +3 -3
- package/dist/public/assets/{SourceEditor-HTGqnC5W.js → SourceEditor-BSNx4vgo.js} +1 -1
- package/dist/public/assets/{config-validation-events--Lmna0va.js → config-validation-events-CQdOhgu4.js} +1 -1
- package/dist/public/assets/doc-hash-D_cCMufM.js +422 -0
- package/dist/public/assets/{index-CwEThoQY.js → index-DplFbAir.js} +4 -4
- package/dist/public/assets/{target-navigation-intent-7etGAyzg.js → target-navigation-intent-D3oiWq7j.js} +1 -1
- package/dist/public/assets/{toggle-group-MmUCNd9k.js → toggle-group-CnwuxlqO.js} +1 -1
- package/dist/public/assets/{tooltip-D8vJ720z.js → tooltip-DZMJlHWf.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CvAtpmP1.js → typing-burst-detector-2N-LtlIn.js} +1 -1
- package/dist/public/index.html +8 -8
- package/dist/schemas/v0/config.project.schema.json +0 -13
- package/dist/{src-DWeGFSri.mjs → src-CPSJr8lr.mjs} +2 -2
- package/dist/start-BoXsjqPU.mjs +1 -0
- package/dist/{start-BIWsMLqV.mjs → start-DUBJCx0O.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-BHNW8Zq_.mjs +0 -2
- package/dist/init-6drSK50y.mjs +0 -1
- package/dist/loader-DY3uDuFe.mjs +0 -1
- package/dist/preview-BIFV91lQ.mjs +0 -1
- package/dist/public/assets/doc-hash-B4Tnobw5.js +0 -422
- package/dist/start-Cfbbhayh.mjs +0 -1
|
@@ -150,7 +150,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
150
150
|
|
|
151
151
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=vt,s=!rt.jitless,c=s&&yt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Ur([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Kr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Pt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Lt(e,r,it())))}),t)}const qr=O(`$ZodUnion`,(e,t)=>{rr.init(e,t),ft(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ft(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ft(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ft(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>lt(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Kr(t,i,e,a)):Kr(s,i,e,a)}}),Jr=O(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,qr.init(e,t);let n=e._zod.parse;ft(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=st(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!vt(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Yr=O(`$ZodIntersection`,(e,t)=>{rr.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Zr(e,t,n)):Zr(e,i,a)}});function Xr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(bt(e)&&bt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Xr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Xr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Pt(e))return e;let o=Xr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Qr=O(`$ZodRecord`,(e,t)=>{rr.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!bt(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Ft(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Ft(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Nn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Lt(e,r,it())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Ft(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Ft(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),$r=O(`$ZodEnum`,(e,t)=>{rr.init(e,t);let n=at(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>St.has(typeof e)).map(e=>typeof e==`string`?Ct(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ei=O(`$ZodLiteral`,(e,t)=>{if(rr.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ct(e):e?Ct(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ti=O(`$ZodTransform`,(e,t)=>{rr.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new tt;return n.value=i,n}});function ni(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ri=O(`$ZodOptional`,(e,t)=>{rr.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ft(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${lt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>ni(t,e.value)):ni(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ii=O(`$ZodExactOptional`,(e,t)=>{ri.init(e,t),ft(e._zod,`values`,()=>t.innerType._zod.values),ft(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ai=O(`$ZodNullable`,(e,t)=>{rr.init(e,t),ft(e._zod,`optin`,()=>t.innerType._zod.optin),ft(e._zod,`optout`,()=>t.innerType._zod.optout),ft(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${lt(e.source)}|null)$`):void 0}),ft(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),oi=O(`$ZodDefault`,(e,t)=>{rr.init(e,t),e._zod.optin=`optional`,ft(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>si(e,t)):si(r,t)}});function si(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ci=O(`$ZodPrefault`,(e,t)=>{rr.init(e,t),e._zod.optin=`optional`,ft(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),li=O(`$ZodNonOptional`,(e,t)=>{rr.init(e,t),ft(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ui(t,e)):ui(i,e)}});function ui(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const di=O(`$ZodCatch`,(e,t)=>{rr.init(e,t),ft(e._zod,`optin`,()=>t.innerType._zod.optin),ft(e._zod,`optout`,()=>t.innerType._zod.optout),ft(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Lt(e,n,it()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Lt(e,n,it()))},input:e.value}),e.issues=[]),e)}}),fi=O(`$ZodPipe`,(e,t)=>{rr.init(e,t),ft(e._zod,`values`,()=>t.in._zod.values),ft(e._zod,`optin`,()=>t.in._zod.optin),ft(e._zod,`optout`,()=>t.out._zod.optout),ft(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>pi(e,t.in,n)):pi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pi(e,t.out,n)):pi(r,t.out,n)}});function pi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const mi=O(`$ZodReadonly`,(e,t)=>{rr.init(e,t),ft(e._zod,`propValues`,()=>t.innerType._zod.propValues),ft(e._zod,`values`,()=>t.innerType._zod.values),ft(e._zod,`optin`,()=>t.innerType?._zod?.optin),ft(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hi):hi(r)}});function hi(e){return e.value=Object.freeze(e.value),e}const gi=O(`$ZodCustom`,(e,t)=>{Rn.init(e,t),rr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>_i(t,n,r,e));_i(i,n,r,e)}});function _i(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(zt(e))}}var vi,yi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bi(){return new yi}(vi=globalThis).__zod_globalRegistry??(vi.__zod_globalRegistry=bi());const xi=globalThis.__zod_globalRegistry;function Si(e,t){return new e({type:`string`,...k(t)})}function Ci(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...k(t)})}function wi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...k(t)})}function Ti(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...k(t)})}function Ei(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...k(t)})}function Di(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...k(t)})}function Oi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...k(t)})}function ki(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...k(t)})}function Ai(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...k(t)})}function ji(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...k(t)})}function Mi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...k(t)})}function Ni(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...k(t)})}function Pi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...k(t)})}function Fi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...k(t)})}function Ii(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...k(t)})}function Li(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...k(t)})}function Ri(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...k(t)})}function zi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...k(t)})}function Bi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...k(t)})}function Vi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...k(t)})}function Hi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...k(t)})}function Ui(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...k(t)})}function Wi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...k(t)})}function Gi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...k(t)})}function Ki(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...k(t)})}function qi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...k(t)})}function Ji(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...k(t)})}function Yi(e,t){return new e({type:`number`,checks:[],...k(t)})}function Xi(e,t){return new e({type:`number`,coerce:!0,checks:[],...k(t)})}function Zi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...k(t)})}function Qi(e,t){return new e({type:`boolean`,...k(t)})}function $i(e,t){return new e({type:`null`,...k(t)})}function ea(e){return new e({type:`any`})}function ta(e){return new e({type:`unknown`})}function na(e,t){return new e({type:`never`,...k(t)})}function ra(e,t){return new Bn({check:`less_than`,...k(t),value:e,inclusive:!1})}function ia(e,t){return new Bn({check:`less_than`,...k(t),value:e,inclusive:!0})}function aa(e,t){return new Vn({check:`greater_than`,...k(t),value:e,inclusive:!1})}function oa(e,t){return new Vn({check:`greater_than`,...k(t),value:e,inclusive:!0})}function sa(e,t){return new Hn({check:`multiple_of`,...k(t),value:e})}function ca(e,t){return new Wn({check:`max_length`,...k(t),maximum:e})}function la(e,t){return new Gn({check:`min_length`,...k(t),minimum:e})}function ua(e,t){return new Kn({check:`length_equals`,...k(t),length:e})}function da(e,t){return new Jn({check:`string_format`,format:`regex`,...k(t),pattern:e})}function fa(e){return new Yn({check:`string_format`,format:`lowercase`,...k(e)})}function pa(e){return new Xn({check:`string_format`,format:`uppercase`,...k(e)})}function ma(e,t){return new Zn({check:`string_format`,format:`includes`,...k(t),includes:e})}function ha(e,t){return new Qn({check:`string_format`,format:`starts_with`,...k(t),prefix:e})}function ga(e,t){return new $n({check:`string_format`,format:`ends_with`,...k(t),suffix:e})}function _a(e){return new er({check:`overwrite`,tx:e})}function va(e){return _a(t=>t.normalize(e))}function ya(){return _a(e=>e.trim())}function ba(){return _a(e=>e.toLowerCase())}function xa(){return _a(e=>e.toUpperCase())}function Sa(){return _a(e=>gt(e))}function Ca(e,t,n){return new e({type:`array`,element:t,...k(n)})}function wa(e,t,n){let r=k(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Ta(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...k(n)})}function Ea(e){let t=Da(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(zt(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(zt(r))}},e(n.value,n)));return t}function Da(e,t){let n=new Rn({check:`custom`,...k(t)});return n._zod.check=e,n}function Oa(e){let t=new Rn({check:`describe`});return t._zod.onattach=[t=>{let n=xi.get(t)??{};xi.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function ka(e){let t=new Rn({check:`meta`});return t._zod.onattach=[t=>{let n=xi.get(t)??{};xi.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Aa(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??xi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ja(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ja(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Pa(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ma(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
152
152
|
|
|
153
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Na(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Ia(t,`input`,e.processors),output:Ia(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Pa(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Pa(r.element,n);if(r.type===`set`)return Pa(r.valueType,n);if(r.type===`lazy`)return Pa(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Pa(r.innerType,n);if(r.type===`intersection`)return Pa(r.left,n)||Pa(r.right,n);if(r.type===`record`||r.type===`map`)return Pa(r.keyType,n)||Pa(r.valueType,n);if(r.type===`pipe`)return Pa(r.in,n)||Pa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Pa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Pa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Pa(e,n))return!0;return!!(r.rest&&Pa(r.rest,n))}return!1}const Fa=(e,t={})=>n=>{let r=Aa({...n,processors:t});return ja(e,r),Ma(r,e),Na(r,e)},Ia=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Aa({...i??{},target:a,io:t,processors:n});return ja(e,o),Ma(o,e),Na(o,e)},La={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=La[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Ha=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Ua=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Wa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{n.not={}},qa=(e,t,n,r)=>{},Ja=(e,t,n,r)=>{},Ya=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Xa=(e,t,n,r)=>{let i=e._zod.def,a=at(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Za=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Qa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},$a=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},eo=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},to=(e,t,n,r)=>{n.type=`boolean`},no=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},io=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ao=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},oo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},so=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ja(a.element,t,{...r,path:[...r.path,`items`]})},co=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ja(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ja(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},lo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ja(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},uo=(e,t,n,r)=>{let i=e._zod.def,a=ja(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ja(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},fo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>ja(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?ja(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},po=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ja(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ja(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ja(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},mo=(e,t,n,r)=>{let i=e._zod.def,a=ja(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ho=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},go=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_o=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},vo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},yo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;ja(a,t,r);let o=t.seen.get(e);o.ref=a},bo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},So=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Co={string:Ra,number:za,boolean:Ba,bigint:Va,symbol:Ha,null:Ua,undefined:Wa,void:Ga,never:Ka,any:qa,unknown:Ja,date:Ya,enum:Xa,literal:Za,nan:Qa,template_literal:$a,file:eo,success:to,custom:no,function:ro,transform:io,map:ao,set:oo,array:so,object:co,union:lo,intersection:uo,tuple:fo,record:po,nullable:mo,nonoptional:ho,default:go,prefault:_o,catch:vo,pipe:yo,readonly:bo,promise:xo,optional:So,lazy:(e,t,n,r)=>{let i=e._zod.innerType;ja(i,t,r);let a=t.seen.get(e);a.ref=i}};function wo(e,t){if(`_idmap`in e){let n=e,r=Aa({...t,processors:Co}),i={};for(let e of n._idmap.entries()){let[t,n]=e;ja(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ma(r,n),a[t]=Na(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Aa({...t,processors:Co});return ja(e,n),Ma(n,e),Na(n,e)}const To=O(`ZodISODateTime`,(e,t)=>{_r.init(e,t),Xo.init(e,t)});function Eo(e){return Gi(To,e)}const Do=O(`ZodISODate`,(e,t)=>{vr.init(e,t),Xo.init(e,t)});function Oo(e){return Ki(Do,e)}const ko=O(`ZodISOTime`,(e,t)=>{yr.init(e,t),Xo.init(e,t)});function Ao(e){return qi(ko,e)}const jo=O(`ZodISODuration`,(e,t)=>{br.init(e,t),Xo.init(e,t)});function Mo(e){return Ji(jo,e)}const No=(e,t)=>{Vt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Wt(e,t)},flatten:{value:t=>Ut(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ot,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ot,2)}},isEmpty:{get(){return e.issues.length===0}}})};O(`ZodError`,No);const Po=O(`ZodError`,No,{Parent:Error}),Fo=Gt(Po),Io=qt(Po),Lo=Yt(Po),Ro=Zt(Po),zo=$t(Po),Bo=en(Po),Vo=tn(Po),Ho=nn(Po),Uo=rn(Po),Wo=an(Po),Go=on(Po),Ko=sn(Po),qo=O(`ZodType`,(e,t)=>(rr.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ia(e,`input`),output:Ia(e,`output`)}}),e.toJSONSchema=Fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(mt(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>wt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Fo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Lo(e,t,n),e.parseAsync=async(t,n)=>Io(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ro(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zo(e,t,n),e.decode=(t,n)=>Bo(e,t,n),e.encodeAsync=async(t,n)=>Vo(e,t,n),e.decodeAsync=async(t,n)=>Ho(e,t,n),e.safeEncode=(t,n)=>Uo(e,t,n),e.safeDecode=(t,n)=>Wo(e,t,n),e.safeEncodeAsync=async(t,n)=>Go(e,t,n),e.safeDecodeAsync=async(t,n)=>Ko(e,t,n),e.refine=(t,n)=>e.check(mc(t,n)),e.superRefine=t=>e.check(hc(t)),e.overwrite=t=>e.check(_a(t)),e.optional=()=>Ys(e),e.exactOptional=()=>Zs(e),e.nullable=()=>$s(e),e.nullish=()=>Ys($s(e)),e.nonoptional=t=>ac(e,t),e.array=()=>M(e),e.or=t=>Fs([e,t]),e.and=t=>zs(e,t),e.transform=t=>lc(e,qs(t)),e.default=t=>tc(e,t),e.prefault=t=>rc(e,t),e.catch=t=>sc(e,t),e.pipe=t=>lc(e,t),e.readonly=()=>dc(e),e.describe=t=>{let n=e.clone();return xi.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return xi.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return xi.get(e);let n=e.clone();return xi.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Jo=O(`_ZodString`,(e,t)=>{ir.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(da(...t)),e.includes=(...t)=>e.check(ma(...t)),e.startsWith=(...t)=>e.check(ha(...t)),e.endsWith=(...t)=>e.check(ga(...t)),e.min=(...t)=>e.check(la(...t)),e.max=(...t)=>e.check(ca(...t)),e.length=(...t)=>e.check(ua(...t)),e.nonempty=(...t)=>e.check(la(1,...t)),e.lowercase=t=>e.check(fa(t)),e.uppercase=t=>e.check(pa(t)),e.trim=()=>e.check(ya()),e.normalize=(...t)=>e.check(va(...t)),e.toLowerCase=()=>e.check(ba()),e.toUpperCase=()=>e.check(xa()),e.slugify=()=>e.check(Sa())}),Yo=O(`ZodString`,(e,t)=>{ir.init(e,t),Jo.init(e,t),e.email=t=>e.check(Ci(Zo,t)),e.url=t=>e.check(ki(es,t)),e.jwt=t=>e.check(Wi(_s,t)),e.emoji=t=>e.check(Ai(ns,t)),e.guid=t=>e.check(wi(Qo,t)),e.uuid=t=>e.check(Ti($o,t)),e.uuidv4=t=>e.check(Ei($o,t)),e.uuidv6=t=>e.check(Di($o,t)),e.uuidv7=t=>e.check(Oi($o,t)),e.nanoid=t=>e.check(ji(rs,t)),e.guid=t=>e.check(wi(Qo,t)),e.cuid=t=>e.check(Mi(is,t)),e.cuid2=t=>e.check(Ni(as,t)),e.ulid=t=>e.check(Pi(ss,t)),e.base64=t=>e.check(Vi(ms,t)),e.base64url=t=>e.check(Hi(hs,t)),e.xid=t=>e.check(Fi(cs,t)),e.ksuid=t=>e.check(Ii(ls,t)),e.ipv4=t=>e.check(Li(us,t)),e.ipv6=t=>e.check(Ri(ds,t)),e.cidrv4=t=>e.check(zi(fs,t)),e.cidrv6=t=>e.check(Bi(ps,t)),e.e164=t=>e.check(Ui(gs,t)),e.datetime=t=>e.check(Eo(t)),e.date=t=>e.check(Oo(t)),e.time=t=>e.check(Ao(t)),e.duration=t=>e.check(Mo(t))});function A(e){return Si(Yo,e)}const Xo=O(`ZodStringFormat`,(e,t)=>{ar.init(e,t),Jo.init(e,t)}),Zo=O(`ZodEmail`,(e,t)=>{cr.init(e,t),Xo.init(e,t)}),Qo=O(`ZodGUID`,(e,t)=>{or.init(e,t),Xo.init(e,t)}),$o=O(`ZodUUID`,(e,t)=>{sr.init(e,t),Xo.init(e,t)}),es=O(`ZodURL`,(e,t)=>{lr.init(e,t),Xo.init(e,t)});function ts(e){return ki(es,e)}const ns=O(`ZodEmoji`,(e,t)=>{ur.init(e,t),Xo.init(e,t)}),rs=O(`ZodNanoID`,(e,t)=>{dr.init(e,t),Xo.init(e,t)}),is=O(`ZodCUID`,(e,t)=>{fr.init(e,t),Xo.init(e,t)}),as=O(`ZodCUID2`,(e,t)=>{pr.init(e,t),Xo.init(e,t)}),ss=O(`ZodULID`,(e,t)=>{mr.init(e,t),Xo.init(e,t)}),cs=O(`ZodXID`,(e,t)=>{hr.init(e,t),Xo.init(e,t)}),ls=O(`ZodKSUID`,(e,t)=>{gr.init(e,t),Xo.init(e,t)}),us=O(`ZodIPv4`,(e,t)=>{xr.init(e,t),Xo.init(e,t)}),ds=O(`ZodIPv6`,(e,t)=>{Sr.init(e,t),Xo.init(e,t)}),fs=O(`ZodCIDRv4`,(e,t)=>{Cr.init(e,t),Xo.init(e,t)}),ps=O(`ZodCIDRv6`,(e,t)=>{wr.init(e,t),Xo.init(e,t)}),ms=O(`ZodBase64`,(e,t)=>{Er.init(e,t),Xo.init(e,t)}),hs=O(`ZodBase64URL`,(e,t)=>{Or.init(e,t),Xo.init(e,t)}),gs=O(`ZodE164`,(e,t)=>{kr.init(e,t),Xo.init(e,t)}),_s=O(`ZodJWT`,(e,t)=>{jr.init(e,t),Xo.init(e,t)}),vs=O(`ZodNumber`,(e,t)=>{Mr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.gt=(t,n)=>e.check(aa(t,n)),e.gte=(t,n)=>e.check(oa(t,n)),e.min=(t,n)=>e.check(oa(t,n)),e.lt=(t,n)=>e.check(ra(t,n)),e.lte=(t,n)=>e.check(ia(t,n)),e.max=(t,n)=>e.check(ia(t,n)),e.int=t=>e.check(bs(t)),e.safe=t=>e.check(bs(t)),e.positive=t=>e.check(aa(0,t)),e.nonnegative=t=>e.check(oa(0,t)),e.negative=t=>e.check(ra(0,t)),e.nonpositive=t=>e.check(ia(0,t)),e.multipleOf=(t,n)=>e.check(sa(t,n)),e.step=(t,n)=>e.check(sa(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function j(e){return Yi(vs,e)}const ys=O(`ZodNumberFormat`,(e,t)=>{Nr.init(e,t),vs.init(e,t)});function bs(e){return Zi(ys,e)}const xs=O(`ZodBoolean`,(e,t)=>{Pr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function Ss(e){return Qi(xs,e)}const Cs=O(`ZodNull`,(e,t)=>{Fr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r)});function ws(e){return $i(Cs,e)}const Ts=O(`ZodAny`,(e,t)=>{Ir.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Es(){return ea(Ts)}const Ds=O(`ZodUnknown`,(e,t)=>{Lr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Os(){return ta(Ds)}const ks=O(`ZodNever`,(e,t)=>{Rr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function As(e){return na(ks,e)}const js=O(`ZodArray`,(e,t)=>{Br.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(la(t,n)),e.nonempty=t=>e.check(la(1,t)),e.max=(t,n)=>e.check(ca(t,n)),e.length=(t,n)=>e.check(ua(t,n)),e.unwrap=()=>e.element});function M(e,t){return Ca(js,e,t)}const Ms=O(`ZodObject`,(e,t)=>{Gr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),ft(e,`shape`,()=>t.shape),e.keyof=()=>Us(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Os()}),e.loose=()=>e.clone({...e._zod.def,catchall:Os()}),e.strict=()=>e.clone({...e._zod.def,catchall:As()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>kt(e,t),e.safeExtend=t=>At(e,t),e.merge=t=>jt(e,t),e.pick=t=>Dt(e,t),e.omit=t=>Ot(e,t),e.partial=(...t)=>Mt(Js,e,t[0]),e.required=(...t)=>Nt(ic,e,t[0])});function N(e,t){return new Ms({type:`object`,shape:e??{},...k(t)})}function Ns(e,t){return new Ms({type:`object`,shape:e,catchall:Os(),...k(t)})}const Ps=O(`ZodUnion`,(e,t)=>{qr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.options=t.options});function Fs(e,t){return new Ps({type:`union`,options:e,...k(t)})}const Is=O(`ZodDiscriminatedUnion`,(e,t)=>{Ps.init(e,t),Jr.init(e,t)});function Ls(e,t,n){return new Is({type:`union`,options:t,discriminator:e,...k(n)})}const Rs=O(`ZodIntersection`,(e,t)=>{Yr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r)});function zs(e,t){return new Rs({type:`intersection`,left:e,right:t})}const Bs=O(`ZodRecord`,(e,t)=>{Qr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Vs(e,t,n){return new Bs({type:`record`,keyType:e,valueType:t,...k(n)})}const Hs=O(`ZodEnum`,(e,t)=>{$r.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Hs({...t,checks:[],...k(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Hs({...t,checks:[],...k(r),entries:i})}});function Us(e,t){return new Hs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...k(t)})}const Ws=O(`ZodLiteral`,(e,t)=>{ei.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Gs(e,t){return new Ws({type:`literal`,values:Array.isArray(e)?e:[e],...k(t)})}const Ks=O(`ZodTransform`,(e,t)=>{ti.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(zt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(zt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function qs(e){return new Ks({type:`transform`,transform:e})}const Js=O(`ZodOptional`,(e,t)=>{ri.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new Js({type:`optional`,innerType:e})}const Xs=O(`ZodExactOptional`,(e,t)=>{ii.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zs(e){return new Xs({type:`optional`,innerType:e})}const Qs=O(`ZodNullable`,(e,t)=>{ai.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`nullable`,innerType:e})}const ec=O(`ZodDefault`,(e,t)=>{oi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tc(e,t){return new ec({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():xt(t)}})}const nc=O(`ZodPrefault`,(e,t)=>{ci.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rc(e,t){return new nc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():xt(t)}})}const ic=O(`ZodNonOptional`,(e,t)=>{li.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e,t){return new ic({type:`nonoptional`,innerType:e,...k(t)})}const oc=O(`ZodCatch`,(e,t)=>{di.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sc(e,t){return new oc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const cc=O(`ZodPipe`,(e,t)=>{fi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.in=t.in,e.out=t.out});function lc(e,t){return new cc({type:`pipe`,in:e,out:t})}const uc=O(`ZodReadonly`,(e,t)=>{mi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dc(e){return new uc({type:`readonly`,innerType:e})}const fc=O(`ZodCustom`,(e,t)=>{gi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r)});function pc(e,t){return wa(fc,e??(()=>!0),t)}function mc(e,t={}){return Ta(fc,e,t)}function hc(e){return Ea(e)}function gc(e,t){return lc(qs(e),t)}var _c=$e();a();const vc=Symbol.for(`@inkeep/open-knowledge/field-registry`),yc=globalThis;yc[vc]===void 0&&(yc[vc]=bi());const bc=yc[vc];function xc(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Sc(t)?bc.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Sc(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}const Cc=Ns({title:A().optional(),description:A().optional(),tags:M(A()).optional()});Ns({match:A().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:Cc});const wc=Ns({content:Ns({dir:A().register(bc,{scope:`project`,agentSettable:!1,defaultScope:`project`}).default(`.`)}).default({dir:`.`}),preview:Ns({baseUrl:ts().register(bc,{scope:`project`,agentSettable:!1}).optional()}).default({}),appearance:Ns({theme:Us([`light`,`dark`,`system`]).register(bc,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional()}).default({}),autoSync:Ns({enabled:Ss().register(bc,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`}).nullable().default(null)}).default({enabled:null})}),Tc=`open-knowledge-config`;async function Ec(e,t,n){let r=o.getTracer(Tc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,async e=>{try{return await n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Dc(e,t,n){let r=o.getTracer(Tc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Oc(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function kc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Ac(e,t){let n=e;for(let e of t){n=kc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function jc(e,t){let n=Ac(e,t);if(n!==void 0)return xc(n)}function Mc(e,t){return e===`either`?!0:e===t}function Nc(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=jc(wc,i);a?.scope!==void 0&&(Mc(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function Pc(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,_c.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function Fc(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){Pc(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}Pc(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Ic(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}const Lc=`v0`;function Rc(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,_c.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,_c.isNode)(r))return r}return e.contents??null}function zc(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Bc(e,t,n,r,i){let a=e.split(`
|
|
153
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Na(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Ia(t,`input`,e.processors),output:Ia(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Pa(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Pa(r.element,n);if(r.type===`set`)return Pa(r.valueType,n);if(r.type===`lazy`)return Pa(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Pa(r.innerType,n);if(r.type===`intersection`)return Pa(r.left,n)||Pa(r.right,n);if(r.type===`record`||r.type===`map`)return Pa(r.keyType,n)||Pa(r.valueType,n);if(r.type===`pipe`)return Pa(r.in,n)||Pa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Pa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Pa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Pa(e,n))return!0;return!!(r.rest&&Pa(r.rest,n))}return!1}const Fa=(e,t={})=>n=>{let r=Aa({...n,processors:t});return ja(e,r),Ma(r,e),Na(r,e)},Ia=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Aa({...i??{},target:a,io:t,processors:n});return ja(e,o),Ma(o,e),Na(o,e)},La={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=La[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Ha=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Ua=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Wa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{n.not={}},qa=(e,t,n,r)=>{},Ja=(e,t,n,r)=>{},Ya=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Xa=(e,t,n,r)=>{let i=e._zod.def,a=at(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Za=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Qa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},$a=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},eo=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},to=(e,t,n,r)=>{n.type=`boolean`},no=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},io=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ao=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},oo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},so=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ja(a.element,t,{...r,path:[...r.path,`items`]})},co=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ja(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ja(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},lo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ja(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},uo=(e,t,n,r)=>{let i=e._zod.def,a=ja(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ja(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},fo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>ja(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?ja(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},po=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ja(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ja(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ja(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},mo=(e,t,n,r)=>{let i=e._zod.def,a=ja(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ho=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},go=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_o=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},vo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},yo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;ja(a,t,r);let o=t.seen.get(e);o.ref=a},bo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xo=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},So=(e,t,n,r)=>{let i=e._zod.def;ja(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Co={string:Ra,number:za,boolean:Ba,bigint:Va,symbol:Ha,null:Ua,undefined:Wa,void:Ga,never:Ka,any:qa,unknown:Ja,date:Ya,enum:Xa,literal:Za,nan:Qa,template_literal:$a,file:eo,success:to,custom:no,function:ro,transform:io,map:ao,set:oo,array:so,object:co,union:lo,intersection:uo,tuple:fo,record:po,nullable:mo,nonoptional:ho,default:go,prefault:_o,catch:vo,pipe:yo,readonly:bo,promise:xo,optional:So,lazy:(e,t,n,r)=>{let i=e._zod.innerType;ja(i,t,r);let a=t.seen.get(e);a.ref=i}};function wo(e,t){if(`_idmap`in e){let n=e,r=Aa({...t,processors:Co}),i={};for(let e of n._idmap.entries()){let[t,n]=e;ja(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ma(r,n),a[t]=Na(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Aa({...t,processors:Co});return ja(e,n),Ma(n,e),Na(n,e)}const To=O(`ZodISODateTime`,(e,t)=>{_r.init(e,t),Xo.init(e,t)});function Eo(e){return Gi(To,e)}const Do=O(`ZodISODate`,(e,t)=>{vr.init(e,t),Xo.init(e,t)});function Oo(e){return Ki(Do,e)}const ko=O(`ZodISOTime`,(e,t)=>{yr.init(e,t),Xo.init(e,t)});function Ao(e){return qi(ko,e)}const jo=O(`ZodISODuration`,(e,t)=>{br.init(e,t),Xo.init(e,t)});function Mo(e){return Ji(jo,e)}const No=(e,t)=>{Vt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Wt(e,t)},flatten:{value:t=>Ut(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ot,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ot,2)}},isEmpty:{get(){return e.issues.length===0}}})};O(`ZodError`,No);const Po=O(`ZodError`,No,{Parent:Error}),Fo=Gt(Po),Io=qt(Po),Lo=Yt(Po),Ro=Zt(Po),zo=$t(Po),Bo=en(Po),Vo=tn(Po),Ho=nn(Po),Uo=rn(Po),Wo=an(Po),Go=on(Po),Ko=sn(Po),qo=O(`ZodType`,(e,t)=>(rr.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ia(e,`input`),output:Ia(e,`output`)}}),e.toJSONSchema=Fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(mt(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>wt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Fo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Lo(e,t,n),e.parseAsync=async(t,n)=>Io(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ro(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zo(e,t,n),e.decode=(t,n)=>Bo(e,t,n),e.encodeAsync=async(t,n)=>Vo(e,t,n),e.decodeAsync=async(t,n)=>Ho(e,t,n),e.safeEncode=(t,n)=>Uo(e,t,n),e.safeDecode=(t,n)=>Wo(e,t,n),e.safeEncodeAsync=async(t,n)=>Go(e,t,n),e.safeDecodeAsync=async(t,n)=>Ko(e,t,n),e.refine=(t,n)=>e.check(mc(t,n)),e.superRefine=t=>e.check(hc(t)),e.overwrite=t=>e.check(_a(t)),e.optional=()=>Ys(e),e.exactOptional=()=>Zs(e),e.nullable=()=>$s(e),e.nullish=()=>Ys($s(e)),e.nonoptional=t=>ac(e,t),e.array=()=>M(e),e.or=t=>Fs([e,t]),e.and=t=>zs(e,t),e.transform=t=>lc(e,qs(t)),e.default=t=>tc(e,t),e.prefault=t=>rc(e,t),e.catch=t=>sc(e,t),e.pipe=t=>lc(e,t),e.readonly=()=>dc(e),e.describe=t=>{let n=e.clone();return xi.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return xi.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return xi.get(e);let n=e.clone();return xi.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Jo=O(`_ZodString`,(e,t)=>{ir.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(da(...t)),e.includes=(...t)=>e.check(ma(...t)),e.startsWith=(...t)=>e.check(ha(...t)),e.endsWith=(...t)=>e.check(ga(...t)),e.min=(...t)=>e.check(la(...t)),e.max=(...t)=>e.check(ca(...t)),e.length=(...t)=>e.check(ua(...t)),e.nonempty=(...t)=>e.check(la(1,...t)),e.lowercase=t=>e.check(fa(t)),e.uppercase=t=>e.check(pa(t)),e.trim=()=>e.check(ya()),e.normalize=(...t)=>e.check(va(...t)),e.toLowerCase=()=>e.check(ba()),e.toUpperCase=()=>e.check(xa()),e.slugify=()=>e.check(Sa())}),Yo=O(`ZodString`,(e,t)=>{ir.init(e,t),Jo.init(e,t),e.email=t=>e.check(Ci(Zo,t)),e.url=t=>e.check(ki(es,t)),e.jwt=t=>e.check(Wi(_s,t)),e.emoji=t=>e.check(Ai(ns,t)),e.guid=t=>e.check(wi(Qo,t)),e.uuid=t=>e.check(Ti($o,t)),e.uuidv4=t=>e.check(Ei($o,t)),e.uuidv6=t=>e.check(Di($o,t)),e.uuidv7=t=>e.check(Oi($o,t)),e.nanoid=t=>e.check(ji(rs,t)),e.guid=t=>e.check(wi(Qo,t)),e.cuid=t=>e.check(Mi(is,t)),e.cuid2=t=>e.check(Ni(as,t)),e.ulid=t=>e.check(Pi(ss,t)),e.base64=t=>e.check(Vi(ms,t)),e.base64url=t=>e.check(Hi(hs,t)),e.xid=t=>e.check(Fi(cs,t)),e.ksuid=t=>e.check(Ii(ls,t)),e.ipv4=t=>e.check(Li(us,t)),e.ipv6=t=>e.check(Ri(ds,t)),e.cidrv4=t=>e.check(zi(fs,t)),e.cidrv6=t=>e.check(Bi(ps,t)),e.e164=t=>e.check(Ui(gs,t)),e.datetime=t=>e.check(Eo(t)),e.date=t=>e.check(Oo(t)),e.time=t=>e.check(Ao(t)),e.duration=t=>e.check(Mo(t))});function A(e){return Si(Yo,e)}const Xo=O(`ZodStringFormat`,(e,t)=>{ar.init(e,t),Jo.init(e,t)}),Zo=O(`ZodEmail`,(e,t)=>{cr.init(e,t),Xo.init(e,t)}),Qo=O(`ZodGUID`,(e,t)=>{or.init(e,t),Xo.init(e,t)}),$o=O(`ZodUUID`,(e,t)=>{sr.init(e,t),Xo.init(e,t)}),es=O(`ZodURL`,(e,t)=>{lr.init(e,t),Xo.init(e,t)});function ts(e){return ki(es,e)}const ns=O(`ZodEmoji`,(e,t)=>{ur.init(e,t),Xo.init(e,t)}),rs=O(`ZodNanoID`,(e,t)=>{dr.init(e,t),Xo.init(e,t)}),is=O(`ZodCUID`,(e,t)=>{fr.init(e,t),Xo.init(e,t)}),as=O(`ZodCUID2`,(e,t)=>{pr.init(e,t),Xo.init(e,t)}),ss=O(`ZodULID`,(e,t)=>{mr.init(e,t),Xo.init(e,t)}),cs=O(`ZodXID`,(e,t)=>{hr.init(e,t),Xo.init(e,t)}),ls=O(`ZodKSUID`,(e,t)=>{gr.init(e,t),Xo.init(e,t)}),us=O(`ZodIPv4`,(e,t)=>{xr.init(e,t),Xo.init(e,t)}),ds=O(`ZodIPv6`,(e,t)=>{Sr.init(e,t),Xo.init(e,t)}),fs=O(`ZodCIDRv4`,(e,t)=>{Cr.init(e,t),Xo.init(e,t)}),ps=O(`ZodCIDRv6`,(e,t)=>{wr.init(e,t),Xo.init(e,t)}),ms=O(`ZodBase64`,(e,t)=>{Er.init(e,t),Xo.init(e,t)}),hs=O(`ZodBase64URL`,(e,t)=>{Or.init(e,t),Xo.init(e,t)}),gs=O(`ZodE164`,(e,t)=>{kr.init(e,t),Xo.init(e,t)}),_s=O(`ZodJWT`,(e,t)=>{jr.init(e,t),Xo.init(e,t)}),vs=O(`ZodNumber`,(e,t)=>{Mr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.gt=(t,n)=>e.check(aa(t,n)),e.gte=(t,n)=>e.check(oa(t,n)),e.min=(t,n)=>e.check(oa(t,n)),e.lt=(t,n)=>e.check(ra(t,n)),e.lte=(t,n)=>e.check(ia(t,n)),e.max=(t,n)=>e.check(ia(t,n)),e.int=t=>e.check(bs(t)),e.safe=t=>e.check(bs(t)),e.positive=t=>e.check(aa(0,t)),e.nonnegative=t=>e.check(oa(0,t)),e.negative=t=>e.check(ra(0,t)),e.nonpositive=t=>e.check(ia(0,t)),e.multipleOf=(t,n)=>e.check(sa(t,n)),e.step=(t,n)=>e.check(sa(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function j(e){return Yi(vs,e)}const ys=O(`ZodNumberFormat`,(e,t)=>{Nr.init(e,t),vs.init(e,t)});function bs(e){return Zi(ys,e)}const xs=O(`ZodBoolean`,(e,t)=>{Pr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function Ss(e){return Qi(xs,e)}const Cs=O(`ZodNull`,(e,t)=>{Fr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r)});function ws(e){return $i(Cs,e)}const Ts=O(`ZodAny`,(e,t)=>{Ir.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Es(){return ea(Ts)}const Ds=O(`ZodUnknown`,(e,t)=>{Lr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Os(){return ta(Ds)}const ks=O(`ZodNever`,(e,t)=>{Rr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function As(e){return na(ks,e)}const js=O(`ZodArray`,(e,t)=>{Br.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(la(t,n)),e.nonempty=t=>e.check(la(1,t)),e.max=(t,n)=>e.check(ca(t,n)),e.length=(t,n)=>e.check(ua(t,n)),e.unwrap=()=>e.element});function M(e,t){return Ca(js,e,t)}const Ms=O(`ZodObject`,(e,t)=>{Gr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),ft(e,`shape`,()=>t.shape),e.keyof=()=>Us(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Os()}),e.loose=()=>e.clone({...e._zod.def,catchall:Os()}),e.strict=()=>e.clone({...e._zod.def,catchall:As()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>kt(e,t),e.safeExtend=t=>At(e,t),e.merge=t=>jt(e,t),e.pick=t=>Dt(e,t),e.omit=t=>Ot(e,t),e.partial=(...t)=>Mt(Js,e,t[0]),e.required=(...t)=>Nt(ic,e,t[0])});function N(e,t){return new Ms({type:`object`,shape:e??{},...k(t)})}function Ns(e,t){return new Ms({type:`object`,shape:e,catchall:Os(),...k(t)})}const Ps=O(`ZodUnion`,(e,t)=>{qr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.options=t.options});function Fs(e,t){return new Ps({type:`union`,options:e,...k(t)})}const Is=O(`ZodDiscriminatedUnion`,(e,t)=>{Ps.init(e,t),Jr.init(e,t)});function Ls(e,t,n){return new Is({type:`union`,options:t,discriminator:e,...k(n)})}const Rs=O(`ZodIntersection`,(e,t)=>{Yr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r)});function zs(e,t){return new Rs({type:`intersection`,left:e,right:t})}const Bs=O(`ZodRecord`,(e,t)=>{Qr.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Vs(e,t,n){return new Bs({type:`record`,keyType:e,valueType:t,...k(n)})}const Hs=O(`ZodEnum`,(e,t)=>{$r.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Hs({...t,checks:[],...k(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Hs({...t,checks:[],...k(r),entries:i})}});function Us(e,t){return new Hs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...k(t)})}const Ws=O(`ZodLiteral`,(e,t)=>{ei.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Gs(e,t){return new Ws({type:`literal`,values:Array.isArray(e)?e:[e],...k(t)})}const Ks=O(`ZodTransform`,(e,t)=>{ti.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(zt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(zt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function qs(e){return new Ks({type:`transform`,transform:e})}const Js=O(`ZodOptional`,(e,t)=>{ri.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new Js({type:`optional`,innerType:e})}const Xs=O(`ZodExactOptional`,(e,t)=>{ii.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zs(e){return new Xs({type:`optional`,innerType:e})}const Qs=O(`ZodNullable`,(e,t)=>{ai.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`nullable`,innerType:e})}const ec=O(`ZodDefault`,(e,t)=>{oi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tc(e,t){return new ec({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():xt(t)}})}const nc=O(`ZodPrefault`,(e,t)=>{ci.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rc(e,t){return new nc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():xt(t)}})}const ic=O(`ZodNonOptional`,(e,t)=>{li.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e,t){return new ic({type:`nonoptional`,innerType:e,...k(t)})}const oc=O(`ZodCatch`,(e,t)=>{di.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sc(e,t){return new oc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const cc=O(`ZodPipe`,(e,t)=>{fi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.in=t.in,e.out=t.out});function lc(e,t){return new cc({type:`pipe`,in:e,out:t})}const uc=O(`ZodReadonly`,(e,t)=>{mi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dc(e){return new uc({type:`readonly`,innerType:e})}const fc=O(`ZodCustom`,(e,t)=>{gi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r)});function pc(e,t){return wa(fc,e??(()=>!0),t)}function mc(e,t={}){return Ta(fc,e,t)}function hc(e){return Ea(e)}function gc(e,t){return lc(qs(e),t)}var _c=$e();a();const vc=Symbol.for(`@inkeep/open-knowledge/field-registry`),yc=globalThis;yc[vc]===void 0&&(yc[vc]=bi());const bc=yc[vc];function xc(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Sc(t)?bc.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Sc(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}const Cc=Ns({title:A().optional(),description:A().optional(),tags:M(A()).optional()});Ns({match:A().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:Cc});const wc=Ns({content:Ns({dir:A().register(bc,{scope:`project`,agentSettable:!1,defaultScope:`project`}).default(`.`)}).default({dir:`.`}),appearance:Ns({theme:Us([`light`,`dark`,`system`]).register(bc,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional()}).default({}),autoSync:Ns({enabled:Ss().register(bc,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`}).nullable().default(null)}).default({enabled:null})}),Tc=`open-knowledge-config`;async function Ec(e,t,n){let r=o.getTracer(Tc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,async e=>{try{return await n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Dc(e,t,n){let r=o.getTracer(Tc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Oc(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function kc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Ac(e,t){let n=e;for(let e of t){n=kc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function jc(e,t){let n=Ac(e,t);if(n!==void 0)return xc(n)}function Mc(e,t){return e===`either`?!0:e===t}function Nc(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=jc(wc,i);a?.scope!==void 0&&(Mc(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function Pc(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,_c.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function Fc(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){Pc(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}Pc(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Ic(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}const Lc=`v0`;function Rc(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,_c.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,_c.isNode)(r))return r}return e.contents??null}function zc(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Bc(e,t,n,r,i){let a=e.split(`
|
|
154
154
|
`),o=r-1;if(o<0||o>=a.length)return``;let s=a[o]??``,c=t-(i-1)+s.length,l=Math.max(1,Math.min(n,c)-t),u=[],d=String(o+2).length;for(let e=Math.max(0,o-1);e<=Math.min(a.length-1,o+1);e++){let t=e===o,n=t?`>`:` `,r=String(e+1).padStart(d,` `);if(u.push(`${n} ${r} | ${a[e]??``}`),t){let e=` `.repeat(2+d+3+i-1);u.push(`${e}${`^`.repeat(l)}`)}}return u.join(`
|
|
155
155
|
`)}function Vc(e){let t=Rc(e.doc,e.path);if(!t)return;let n=t.range;if(!n)return;let[r,,i=r]=n,{line:a,column:o}=zc(e.source,r),s=(0,_c.isCollection)(t)?Bc(e.source,r,r+1,a,o):Bc(e.source,r,i,a,o);return{file:e.file,line:a,column:o,snippet:s.length>0?s:void 0}}const Hc=`local`;function Uc(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gc(e.position):`start`in e||`end`in e?Gc(e):`line`in e||`column`in e?Wc(e):``}function Wc(e){return Kc(e&&e.line)+`:`+Kc(e&&e.column)}function Gc(e){return Wc(e&&e.start)+`-`+Wc(e&&e.end)}function Kc(e){return e&&typeof e==`number`?e:1}var qc=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Uc(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};qc.prototype.file=``,qc.prototype.name=``,qc.prototype.reason=``,qc.prototype.message=``,qc.prototype.stack=``,qc.prototype.column=void 0,qc.prototype.line=void 0,qc.prototype.ancestors=void 0,qc.prototype.cause=void 0,qc.prototype.fatal=void 0,qc.prototype.place=void 0,qc.prototype.ruleId=void 0,qc.prototype.source=void 0;var Jc=r(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,te=E-ee;E<o&&te<s&&e.charAt(o-E-1)==t.charAt(s-te-1);)E++,te++;if(f[T]=E,E>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
|
|
156
156
|
`,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&`).replace(o,`<`).replace(s,`>`).replace(c,`¶<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
|
|
@@ -357,4 +357,4 @@ $2`).split(`
|
|
|
357
357
|
`:`
|
|
358
358
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}return`|${n.join(`|`)}|`},h=Array.from({length:f},()=>null);if(a.length===0)return m(p,h);let g=[];g.push(m(a[0],o[0]??[])),g.push(m(p,h));for(let e=1;e<a.length;e++)g.push(m(a[e],o[e]??[]));return g.join(`
|
|
359
359
|
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=IY(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=IY(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function IY(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function LY(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function RY(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function zY(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function BY(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return zY(i)}function VY(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var HY=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=ey(e.extensions),this.handlers=QY(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=$Y(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=EY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=DY({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:FY})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return OY(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?kY(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?oq(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return AY(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};const UY=YK();function WY(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function GY(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function KY(e){return e.attrs.sourceDirty||GY(e)}function qY(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function JY(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function YY(e,t){if(e.length===0)return JY({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return JY({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[YY(n.children,t)]}}return JY({type:`inlineCode`,value:XY(e)},t)}function XY(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=XY(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const ZY=qW;function QY(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=dL(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=dL(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=PY(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[],l=0;for(let t of s){if(t.offset>l){let r=n.slice(l,t.offset).replaceAll(`\xA0`,` `);r&&c.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);i&&(t.kind===`escape`?c.push(e.text(i,[r.escapeMark.create()])):r.sourceLiteral?c.push(e.text(i,[r.sourceLiteral.create({sourceRaw:t.raw})])):c.push(e.text(i))),l=t.offset+t.length}}if(l<n.length){let t=n.slice(l).replaceAll(`\xA0`,` `);t&&c.push(e.text(t))}return c.length===1?c[0]:c}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1})]));let a=r.strike??r.delete;if(a&&(i.delete=fL(a)),r.highlight&&(i.mark=fL(r.highlight)),r.comment&&(i.comment=fL(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=dL(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=fL(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=fL(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=dL(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=dL(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=dL(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=UY.getOrWildcard(o),c=WY(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=PY(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=nK(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&ZY.has(l)&&n.jsxComponent&&UY.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&JW.has(l)&&n.jsxComponent&&UY.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&YW.has(l)&&n.jsxComponent&&UY.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&XW.has(l)&&n.jsxComponent&&UY.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:VY(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(tG.has(l)&&r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")});let s=t=>{let r=t.value??t.type;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},c=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=s,i.inlineMath||=c,n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=c,n.footnoteDefinition&&(i.footnoteDefinition=dL(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}})),i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function $Y(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=_L(`paragraph`)),r.blockquote&&(t.blockquote=_L(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=_L(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=_L(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&qY(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c=Array.isArray(s)&&s.length>0?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=_L(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=_L(`tableCell`,a)),r.tableHeader&&(t.tableHeader=_L(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!KY(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:UY.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:UY,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=vL(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=vL(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return YY(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=vL(`delete`)}return i.highlight&&(n.highlight=vL(`mark`)),i.comment&&(n.comment=vL(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=_L(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=_L(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return WG(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}const eX=/\p{M}+/gu,tX=/[^\p{L}\p{N}]+/gu,nX=/^-+|-+$/g;function rX(e){return e.trim().normalize(`NFKD`).replace(eX,``).toLowerCase().replace(tX,`-`).replace(nX,``)}function iX(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function aX(e,t){let n=rX(e);return n?iX(n,t):``}const oX=N({docName:lK,summary:dK,content:A().optional(),...uK}).loose(),sX=N({docName:lK,summary:dK,markdown:A().min(1),position:Us([`append`,`prepend`,`replace`]).optional(),...uK}).loose(),cX=N({docName:lK,summary:dK,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...uK}).loose(),lX=N({docName:lK,connectionId:A().min(1),scope:Us([`last`,`session`,`file`]).optional(),...uK}).loose(),uX=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),dX=N({type:Gs(`orphan`),parentCandidates:M(A()),message:A()}).loose(),fX=N({timestamp:A().min(1),summary:uX.optional()}).loose(),pX=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(dX).optional(),summary:uX.optional()}).loose(),mX=N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:uX.optional()}).loose(),hX=N({docName:A().min(1),scope:Us([`last`,`session`]),undone:Ss()}).loose(),gX=N({docName:A().min(1),content:A()}).loose(),_X=N({documents:M(N({kind:Us([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ss().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Us([`image`,`video`]).nullable().optional(),referencedBy:M(A().min(1)).optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),vX=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),yX=N({docName:A().min(1),backlinks:M(vX)}).loose(),bX=N({counts:Vs(A().min(1),j().int().nonnegative())}).loose(),xX=Ls(`kind`,[N({kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:Gs(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),SX=N({docName:A().min(1),forwardLinks:M(xX)}).loose(),CX=Ls(`kind`,[N({id:A().min(1),kind:Gs(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:Gs(`external`),url:A().min(1),label:A()}).loose()]),wX=N({source:A().min(1),target:A().min(1)}).loose(),TX=N({nodes:M(CX),links:M(wX)}).loose(),EX=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),DX=N({name:A().optional(),email:A().optional()}).loose(),OX=N({message:A().optional(),writers:M(EX).optional(),principal:DX.optional(),...uK}).loose(),kX=N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose(),AX=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose(),jX=N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Us([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(AX),checkpoint:Os().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ss().optional()}).loose(),MX=N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),NX=N({lines:M(N({type:Us([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose(),PX=N({contentDir:A().min(1),pathSeparator:Us([`/`,`\\`]),symlinkResolved:Ss()}).loose(),FX=M(Ls(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:Gs(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:Gs(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),IX=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),LX=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),RX=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),zX=N({deadLinks:M(N({target:A().min(1),sources:M(RX)}).loose())}).loose(),BX=N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ss()}).loose(),VX=N({dir:A().min(1)}).loose(),HX=N({port:j().int().positive()}).loose(),UX=N({host:A().min(1).optional()}).loose(),WX=N({pat:A().min(1),host:A().min(1).optional()}).loose(),GX=N({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),KX=N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),qX=N({authenticated:Ss()}).loose(),JX=N({type:Gs(`complete`).optional(),login:A().min(1).optional()}).loose(),YX=N({}).loose(),XX=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),ZX=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(XX)}).loose(),QX=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),$X=N({sessionAlive:Ss(),agent:QX.nullable(),files:M(ZX)}).loose(),eZ=N({diff:A(),generatedAt:j().int().min(0)}).loose(),tZ=N({}).loose(),nZ=N({}).loose(),rZ=N({}).loose(),iZ=N({}).loose(),aZ=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Us([`idle`,`writing`]),ts:j().int().min(0)}).loose(),oZ=N({presence:Vs(A().min(1),aZ)}).loose(),sZ=Vs(A().min(1),Ss()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});N({path:A().min(1,`path must be non-empty`)}).loose();const cZ=N({}).loose(),lZ=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),uZ=N({}).loose(),dZ=N({path:A().min(1),...uK,summary:dK}).loose(),fZ=N({docName:A().min(1)}).loose(),pZ=N({path:A().min(1),...uK,summary:dK}).loose(),mZ=N({path:A().min(1)}).loose(),hZ=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),gZ=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),_Z=N({docName:A().min(1),headings:M(gZ)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:dK,...uK}).loose();const vZ=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(lZ),rewrittenDocs:M(vZ),summary:uX.optional()}).loose();const yZ=N({kind:Us([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...uK,summary:dK}).loose(),bZ=N({renamed:M(lZ),rewrittenDocs:M(vZ).optional(),summary:uX.optional()}).loose(),xZ=N({kind:Us([`file`,`folder`]),path:A().min(1),...uK}).loose(),SZ=N({deletedDocNames:M(A().min(1))}).loose(),CZ=N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),versionTag:A().optional(),summary:dK,...uK}).loose(),wZ=N({restoredFrom:A().min(1),timestamp:A().min(1),summary:uX.optional()}).loose(),TZ=N({state:Us([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:Ss(),syncEnabled:Ss(),identityUnresolved:Ss(),error:A().optional(),pausedReason:A().optional()}).loose(),EZ=N({op:Us([`sync`,`push`,`pull`]).optional()}).loose(),DZ=N({op:Us([`sync`,`push`,`pull`])}).loose(),OZ=N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),kZ=N({file:A().min(1),strategy:Us([`mine`,`theirs`,`content`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),AZ=N({}).loose(),jZ=N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),MZ=N({}).loose(),NZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),PZ=N({plan:pc(e=>e!==void 0,{message:`plan is required`})}).loose(),FZ=N({result:pc(e=>e!==void 0,{message:`result is required`})}).loose(),IZ=N({path:A().min(1),summary:A().min(1)}).loose(),LZ=N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(IZ)}).loose())}).loose(),RZ=N({noOpen:Ss().optional(),out:A().min(1).optional()}).loose(),zZ=N({reason:Us([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),BZ=Ls(`status`,[N({status:Gs(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:Gs(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:zZ.optional()}).loose(),N({status:Gs(`failed`),buildError:A()}).loose(),N({status:Gs(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),VZ=N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ss()}).loose())}).loose(),HZ=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose(),UZ=N({name:A().min(1),docs:M(HZ)}).loose(),WZ=N({folder:Os(),frontmatter_local:Vs(A(),Os()).nullable()}).loose(),GZ=N({path:A(),frontmatter:Vs(A(),Os()).optional()}).loose(),KZ=N({applied:Os()}).loose(),qZ=Vs(A(),Os()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),JZ=N({template:N({name:A().min(1),folder:A(),scope:Us([`local`,`inherited`,`user`]),path:A().min(1),frontmatter:qZ,body:A()}).loose()}).loose(),YZ=N({folder:A(),name:A(),body:A().optional(),frontmatter:qZ.optional()}).loose(),XZ=N({path:A().min(1),created:Ss(),warnings:M(A())}).loose(),ZZ=N({existed:Ss(),path:A().min(1)}).loose(),QZ=N({query:A().optional(),intent:Us([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Us([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose(),$Z=N({kind:Us([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Vs(A(),Os()),snippet:A().optional()}).loose(),eQ=N({query:A(),intent:Us([`autocomplete`,`full_text`,`omnibar`]),results:M($Z),elapsedMs:j().nonnegative()}).loose(),tQ=N({version:A().min(1),recordedAt:A().min(1)}).loose(),nQ=N({currentVersion:A().min(1),targets:Vs(A(),tQ.nullable())}).loose(),rQ=`server-info`,iQ=`branch-switched`,aQ=`disk-ack`,oQ=`config-validation-rejected`,sQ=`config-ignore-nested-error`,cQ=Us([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),lQ=N({v:Gs(1),ch:Gs(rQ),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),uQ=N({v:Gs(1),ch:Gs(iQ),seq:j(),branch:A().min(1)}).loose(),dQ=N({v:Gs(1),ch:cQ,seq:j()}).loose(),fQ=N({v:Gs(1),ch:Gs(aQ),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),pQ=N({v:Gs(1),ch:Gs(oQ),seq:j(),docName:A().min(1),error:DW}).loose(),mQ=N({v:Gs(1),ch:Gs(sQ),seq:j(),path:A().min(1),error:A().min(1)}).loose(),hQ={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},gQ=new WeakMap;function _Q(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function vQ(e){return e.trim().toLowerCase()}function yQ(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function bQ(e){return e.split(`/`).filter(Boolean).join(` `)}function xQ(e){let t=yQ(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:bQ(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function SQ(e){let t=XH({schema:hQ});return e.length>0&&sU(t,e),t}function CQ(e){let t={documents:e};return gQ.set(t,SQ(e)),t}function wQ(e){let t=gQ.get(e);if(t)return t;let n=SQ(e.documents);return gQ.set(e,n),n}function TQ(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function EQ(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function DQ(e,t){let n=vQ(t);if(!n)return 0;let r=vQ(e.title),i=vQ(e.name),a=vQ(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function OQ(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function kQ(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function AQ(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function jQ(e,t){return vQ(t).length<4?0:e===`full_text`?1:0}function MQ(e,t,n={}){let r=n.intent??`omnibar`,i=_Q(n.limit),a=new Set(n.scopes??TQ(r)),o=e.documents.filter(e=>EQ(e,a)),s=vQ(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=LU(wQ(e),{term:s,properties:kQ(r),boost:AQ(r),tolerance:jQ(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>EQ(e.document,a)).map(e=>[e.document.id,e.score])),u=OQ(o),d=new Map;for(let e of o)DQ(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)EQ(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,DQ(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}const NQ=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),PQ=globalThis;PQ[NQ]===void 0&&(PQ[NQ]=bi());const FQ=PQ[NQ],IQ=[`.ok`,`skill-state.yml`],LQ=[`claude-cowork`,`cli-hosts`],RQ=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`],zQ=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,BQ=Ns({version:A().regex(zQ,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(FQ,{description:`Recorded skill version for this target.`}),recordedAt:Eo().register(FQ,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Us(RQ).register(FQ,{description:`Install-source surface that recorded this entry.`}).optional()}),VQ=Ns({schema:Gs(1).register(FQ,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ns({"claude-cowork":BQ.optional(),"cli-hosts":BQ.optional()}).register(FQ,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});function HQ(){return{schema:1,targets:{}}}function UQ(){let e=!1,t=``,n=0;return r=>{let i=WQ(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function WQ(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}const GQ=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],KQ={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function qQ(e,t=GQ){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const JQ={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function YQ(e){return e?JQ[e]??`bot`:`bot`}function XQ(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}const ZQ=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function QQ(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function $Q(e){let t=e.trim();return ZQ.test(t)||t.startsWith(`//`)}function e$(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=XQ(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if($Q(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=QQ(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function t$(e,t){let n=e.trim();if(!n)return null;if($Q(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=QQ(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function n$(e,t){let n=e.trim();if(!n||ZQ.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function r$(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function i$(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function a$(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function o$(e){return e.split(`/`).filter(e=>e!==``)}function s$(e,t){let n=a$(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function c$(e,t){let n=a$(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:o$(r).length}function l$(e,t){let n=o$(e),r=o$(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function u$(){let e=new Map;function t(t){let n=r$(t);if(n===``)return;let r=i$(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=r$(t),r=i$(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=a$(r$(n)),o=[],s=[];for(let e of i)s$(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=c$(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=c$(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=l$(a,a$(t));for(let r=1;r<e.length;r++){let i=e[r],o=l$(a,a$(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function d$(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function f$(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}export{KZ as $,rX as $n,jZ as $t,IW as A,HQ as An,Vs as Ar,bZ as At,zW as B,VW as Bn,Wr as Br,QZ as Bt,lQ as C,u$ as Cn,zs as Cr,BW as Ct,aQ as D,xQ as Dn,N as Dr,mK as Dt,oQ as E,CQ as En,j as Er,hZ as Et,pZ as F,eq as Fn,Eo as Fr,LQ as Ft,NX as G,aW as Gn,Qt as Gr,NZ as Gt,zX as H,uW as Hn,Kt as Hr,PZ as Ht,mZ as I,eK as In,wo as Ir,zQ as It,RW as J,MQ as Jn,k as Jr,VQ as Jt,_X as K,n$ as Kn,wt as Kr,pK as Kt,dZ as L,kW as Ln,Xi as Lr,AW as Lt,MW as M,cK as Mn,Fs as Mr,CZ as Mt,PW as N,oW as Nn,Os as Nr,wZ as Nt,rQ as O,bW as On,Ys as Or,_K as Ot,NW as P,aX as Pn,ts as Pr,IQ as Pt,GZ as Q,sW as Qn,MZ as Qt,fZ as R,YQ as Rn,Oa as Rr,OX as Rt,fQ as S,qQ as Sn,Ls as Sr,rZ as St,sQ as T,UJ as Tn,Ns as Tr,_Z as Tt,xZ as U,vW as Un,Jt as Ur,FZ as Ut,HW as V,sG as Vn,rr as Vr,eQ as Vt,SZ as W,$U as Wn,Xt as Wr,LZ as Wt,uZ as X,QU as Xn,et as Xr,xK as Xt,ZW as Y,iK as Yn,O as Yr,cZ as Yt,WZ as Z,f$ as Zn,$e as Zr,BX as Zt,pW as _,KU as _n,ws as _r,VX as _t,eZ as a,DZ as an,wc as ar,RZ as at,pQ as b,e$ as bn,Ss as br,oZ as bt,lX as c,ZZ as cn,Fc as cr,TX as ct,pX as d,XZ as dn,Nc as dr,KX as dt,OZ as en,eW as er,SX as et,oX as f,nZ as fn,Ec as fr,WX as ft,cW as g,PX as gn,Us as gr,bK as gt,yX as h,vK as hn,Js as hr,qX as ht,$X as i,EZ as in,Lc as ir,$W as it,FW as j,d$ as jn,A as jr,FX as jt,jW as k,yW as kn,gc as kr,yZ as kt,hX as l,JZ as ln,Vc as lr,YX as lt,bX as m,yK as mn,vs as mr,GX as mt,LW as n,AZ as nn,Ud as nr,MX as nt,cX as o,UZ as on,Hc as or,BZ as ot,fX as p,tZ as pn,Dc as pr,JX as pt,gX as q,XQ as qn,ft as qr,nQ as qt,QW as r,TZ as rn,P as rr,LX as rt,mX as s,VZ as sn,Oc as sr,sZ as st,KQ as t,kZ as tn,ey as tr,jX as tt,sX as u,YZ as un,Ic as ur,UX as ut,uQ as v,GU as vn,Es as vr,HX as vt,iQ as w,UQ as wn,Gs as wr,IX as wt,dQ as x,t$ as xn,pc as xr,iZ as xt,mQ as y,gK as yn,M as yr,HY as yt,eG as z,OW as zn,ka as zr,kX as zt};
|
|
360
|
-
//# sourceMappingURL=dist-
|
|
360
|
+
//# sourceMappingURL=dist-k62w-4-v.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,i as r,l as i,m as a,p as o,t as s,u as c}from"./init-
|
|
1
|
+
import{c as e,d as t,f as n,i as r,l as i,m as a,p as o,t as s,u as c}from"./init-DsLc7vc7.mjs";import{n as l}from"./loader-DmKx1Dxe.mjs";import{n as u}from"./preview-CuLb6srO.mjs";import{t as d}from"./src-CPSJr8lr.mjs";export{c as ALL_EDITOR_IDS,t as EDITOR_LABELS,n as EDITOR_TARGETS,s as detectInstalledEditors,a as initContent,l as loadConfig,u as previewContent,r as readExistingMcpEntry,o as resolveProjectRoot,e as writeEditorMcpConfig,d as writeProjectAiIntegrations,i as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./init-DsLc7vc7.mjs";export{e as runInit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{r,t as i}from"./esm-CEs3LWY3.mjs";import{J as a,ir as o,n as s,or as c}from"./dist-D3xMMmYf.mjs";import{D as l,F as u,It as d,Pt as f,Wn as p,in as m}from"./dist-DOIb_FW2.mjs";import{n as h,t as g}from"./constants-BHNW8Zq_.mjs";import{t as _}from"./is-object-C-4FJ0rP.mjs";import{i as v,o as y,r as b,s as x,t as S}from"./colors-BtKMHmBX.mjs";import{t as ee}from"./preview-KUL_V2fF.mjs";import{execFileSync as te}from"node:child_process";import ne,{basename as re,dirname as C,isAbsolute as ie,join as w,posix as ae,relative as T,resolve as E,sep as D,win32 as oe}from"node:path";import{cpSync as se,existsSync as O,lstatSync as ce,mkdirSync as k,readFileSync as A,realpathSync as le,rmSync as ue,writeFileSync as j}from"node:fs";import M from"node:process";import{homedir as N}from"node:os";import{AsyncLocalStorage as de,AsyncResource as fe}from"node:async_hooks";import{stripVTControlCharacters as pe,styleText as P}from"node:util";import*as me from"node:readline";function he(){return M.platform.startsWith(`win`)?!!M.env.CI||!!M.env.WT_SESSION||!!M.env.TERMINUS_SUBLIME||M.env.ConEmuTask===`{cmd::Cmder}`||M.env.TERM_PROGRAM===`Terminus-Sublime`||M.env.TERM_PROGRAM===`vscode`||M.env.TERM===`xterm-256color`||M.env.TERM===`alacritty`||M.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:M.env.TERM!==`linux`}const ge={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},_e={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ve={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ye={...ge,..._e},be={...ge,...ve},F=he()?ye:be;Object.entries(_e);var xe=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Se=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ce=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,we=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Te=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ee=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,De=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Oe=/\t{1,1000}/y,ke=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ae=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,je=/\p{M}+/gu,Me={limit:1/0,ellipsis:``},Ne=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Ne(i,Me,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ae,l],[Te,0],[Ee,o],[Oe,s],[ke,c],[De,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(je,``)){let t=e.codePointAt(0)||0;if(S=Ce(t)?2:we(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===De?Se(e.slice(p,n.lastIndex)):n===ke?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pe={limit:1/0,ellipsis:``,ellipsisWidth:0},I=(e,t={})=>Ne(e,Pe,t).width,Fe=`]8;;`,Ie=RegExp(`(?:\\[(?<code>\\d+)m|\\${Fe}(?<uri>.*))`,`y`),Le=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Re=e=>`[${e}m`,ze=e=>`${Fe}${e}`,Be=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:I(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=I(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Fe,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ve=e=>{let t=e.split(` `),n=t.length;for(;n&&!I(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},He=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=I(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=I(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Be(s,r,t),c=I(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Be(s,r,t),c=I(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Be(s,r,t),c=I(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ve(e)));let l=s.join(`
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{r,t as i}from"./esm-CEs3LWY3.mjs";import{J as a,ir as o,n as s,or as c}from"./dist-k62w-4-v.mjs";import{D as l,F as u,It as d,Pt as f,Wn as p,in as m}from"./dist-Bfw3oOGm.mjs";import{n as h,t as g}from"./constants-BVG2ymMz.mjs";import{t as _}from"./is-object-C-4FJ0rP.mjs";import{i as v,o as y,r as b,s as x,t as S}from"./colors-BtKMHmBX.mjs";import{t as ee}from"./preview-CuLb6srO.mjs";import{execFileSync as te}from"node:child_process";import ne,{basename as re,dirname as C,isAbsolute as ie,join as w,posix as ae,relative as T,resolve as E,sep as D,win32 as oe}from"node:path";import{cpSync as se,existsSync as O,lstatSync as ce,mkdirSync as k,readFileSync as A,realpathSync as le,rmSync as ue,writeFileSync as j}from"node:fs";import M from"node:process";import{homedir as N}from"node:os";import{AsyncLocalStorage as de,AsyncResource as fe}from"node:async_hooks";import{stripVTControlCharacters as pe,styleText as P}from"node:util";import*as me from"node:readline";function he(){return M.platform.startsWith(`win`)?!!M.env.CI||!!M.env.WT_SESSION||!!M.env.TERMINUS_SUBLIME||M.env.ConEmuTask===`{cmd::Cmder}`||M.env.TERM_PROGRAM===`Terminus-Sublime`||M.env.TERM_PROGRAM===`vscode`||M.env.TERM===`xterm-256color`||M.env.TERM===`alacritty`||M.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:M.env.TERM!==`linux`}const ge={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},_e={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ve={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ye={...ge,..._e},be={...ge,...ve},F=he()?ye:be;Object.entries(_e);var xe=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Se=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ce=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,we=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Te=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ee=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,De=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Oe=/\t{1,1000}/y,ke=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ae=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,je=/\p{M}+/gu,Me={limit:1/0,ellipsis:``},Ne=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Ne(i,Me,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ae,l],[Te,0],[Ee,o],[Oe,s],[ke,c],[De,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(je,``)){let t=e.codePointAt(0)||0;if(S=Ce(t)?2:we(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===De?Se(e.slice(p,n.lastIndex)):n===ke?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pe={limit:1/0,ellipsis:``,ellipsisWidth:0},I=(e,t={})=>Ne(e,Pe,t).width,Fe=`]8;;`,Ie=RegExp(`(?:\\[(?<code>\\d+)m|\\${Fe}(?<uri>.*))`,`y`),Le=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Re=e=>`[${e}m`,ze=e=>`${Fe}${e}`,Be=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:I(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=I(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Fe,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ve=e=>{let t=e.split(` `),n=t.length;for(;n&&!I(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},He=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=I(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=I(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Be(s,r,t),c=I(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Be(s,r,t),c=I(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Be(s,r,t),c=I(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ve(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){Ie.lastIndex=e+1;let t=Ie.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=ze(``));let e=i?Le(i):void 0;i&&e&&(r+=Re(e))}else t===`
|
|
4
4
|
`&&(i&&Le(i)&&(r+=Re(i)),a&&(r+=ze(a)))}return r},Ue=/\r?\n/;function We(e,t,n){return String(e).normalize().split(Ue).map(e=>He(e,t,n)).join(`
|
|
@@ -404,5 +404,5 @@ last-spawn-error.log
|
|
|
404
404
|
`)?n:`${n}\n`,`utf-8`)}function ur(e,t){let n;try{n=le(t)}catch{n=E(t)}let r;try{r=ce(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(r?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run \`ok init\`, or pass \`--no-mcp\` to skip MCP config writes.`);let i=C(e);for(;i.length>1&&i!==D;){let t;try{t=le(i)}catch(e){if(e.code===`ENOENT`){i=C(i);continue}throw e}let r=T(n,t);if(r===``||!r.startsWith(`..`)&&!ie(r))return;throw Error(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run, or pass \`--no-mcp\`.`)}}const dr=e=>e!==`project`,fr=e=>e!==`user`;async function pr(){let e=await rn({message:`Where should the MCP server be configured?
|
|
405
405
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function mr(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??pr)():`both`}const hr=`0.0.1`,gr=`open-knowledge-ui`;function _r(e,t={}){let n=w(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:gr,runtimeExecutable:`node`,runtimeArgs:[Yn(),`ui`],port:3e3}:{name:gr,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(ur(n,e),!O(n))return k(C(n),{recursive:!0}),j(n,`${JSON.stringify({version:hr,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=A(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!_(i))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let a=Array.isArray(i.configurations)?i.configurations:[],o=a.findIndex(e=>_(e)&&e.name===gr);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??hr,configurations:a};return j(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function vr(e,t,n){try{return O(e.detectPath?.(t,n)??C(e.configPath(t,n)))}catch{return!1}}function $(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}if(!i&&!n.skipAvailabilityCheck&&!vr(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{ur(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}let s;try{s=e.format===`toml`?sr(o):or(o)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let c=s[e.topLevelKey]??{},l=c[a],u;try{u=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let d={...s,[e.topLevelKey]:{...c,[a]:u}};try{e.format===`toml`?lr(o,d):cr(o,d)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:l===void 0?`written`:`overwritten`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function yr(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=p(),i=C(n);ur(i,t);let a=O(n)?`overwritten`:`written`;return ue(i,{recursive:!0,force:!0}),k(C(i),{recursive:!0}),se(r,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function br(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!O(n)))return{editorId:e.id,label:e.label,path:n}}async function xr(e){let t=ar(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>$(t,``,n,e.home))}function Sr(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?sr(r):or(r)}catch{return null}let a=i[e.topLevelKey];if(!_(a))return null;let o=a[e.serverName(t)];return _(o)?o:null}async function Cr(e={}){let t=Kn(E(e.cwd??process.cwd()),{homeDir:e.home}),n=t.projectRoot,r=!O(w(n,`.ok`));t.ancestorPromoted?console.log(`[ok] Opened existing project at ${n}`):t.gitRootPromoted&&r&&console.log(`[ok] Initialized OK at ${n} (scoped to ${t.defaultContentDir}/)`);let i={mode:e.devMcp?`dev`:`published`},a=await d(n),o;try{o=Un(n,{contentDir:t.defaultContentDir})}catch(t){let r=Q.claude.configPath(n,e.home);return{projectRoot:n,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:a.didInit,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:r,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`}}let s=await mr({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),c=e.editors??Tr(n,e.home),l=e.editors??J.filter(e=>Q[e].projectConfigPath!==void 0),u=ar(c),p=ar(l),h=e.mcp===!1||s===null,g=Array.from(new Map([...u,...h?[]:p].map(e=>[e.id,e])).values()),_=u.filter(t=>vr(t,n,e.home)),v=[],y=[],b=new Set;for(let t of g){if(h){let r=``;try{r=t.configPath(n,e.home)}catch{}v.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:r,serverName:t.serverName(n)});continue}if(dr(s)&&u.includes(t)&&v.push($(t,n,i,e.home)),fr(s)&&p.includes(t)&&t.projectConfigPath){let r=t.projectConfigPath(n),a=$(t,n,i,e.home,r);v.push(a),(a.action===`written`||a.action===`overwritten`)&&(b.add(r),y.push(yr(t,n)))}}let x=!h&&s!==null&&fr(s)?p.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,S=h?[]:_.map(e=>br(e,n)).filter(e=>e!==void 0).filter(e=>!b.has(e.path)),ee=_.some(e=>e.id===`claude`)&&!h?_r(n,i):void 0,te=await(e.installUserSkill??m)({home:e.home}),ne=f({home:e.home}),re=h?`skipped-flag`:`skipped-missing`,C=v.find(e=>e.editorId===`claude`)??v[0]??{action:re,configPath:Q.claude.configPath(n,e.home)};return{projectRoot:n,contentCreated:o.created,contentUpdated:o.updated,contentSkipped:o.skipped,editors:v,projectSkills:y,legacyProjectConfigs:S,launchJson:ee,skillInstall:te,didGitInit:a.didInit,claudeDesktopDetected:ne,mcpAction:C.action,mcpPath:C.configPath,mcpError:`error`in C?C.error:void 0,projectScopeUnsupportedLabels:x}}function wr(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?T(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`);let c=w(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(S(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(S(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(S(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(S(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(S(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?T(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${y(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${y(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${b(`FAILED`)}: ${r.error}`);break;case`skipped-flag`:break}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(S(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?T(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${y(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${y(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${b(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${T(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(S(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${y(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${y(`already installed at current version`)}`);break;case`failed`:n.push(` ${x(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${x(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(n.push(``),n.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${S(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(ee(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${y(`✓`)} ${S(`Next steps:`)}`),n.push(` 1. Open your editor (${v(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${v(`ok seed`)}`),n.push(` 4. Use the three MCP workflow tools as you build the wiki:`),n.push(` - ${v(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${v(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${v(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
406
406
|
`)}function Tr(e,t){let n=[];for(let r of J)vr(Q[r],e,t)&&n.push(r);return n}function Er(){return new i(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).addOption(new r(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).action(async e=>{let t=process.cwd(),n;try{n=await Cr({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope})}catch(e){if(e instanceof u){process.stderr.write(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.
|
|
407
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-
|
|
408
|
-
//# sourceMappingURL=init-
|
|
407
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-GtCa8ObI.mjs`),{loadConfig:t}=await import(`./loader-BLwabAxT.mjs`),{resolveContentDir:r}=await import(`./dist-BjlSvO5w.mjs`),{config:i}=t(n.projectRoot),a=r(i,n.projectRoot);n.preview=e({projectDir:n.projectRoot,contentDir:a})}catch(e){n.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${wr(n,n.projectRoot)}\n`),(n.editors.some(e=>e.action===`failed`)||n.mcpAction===`failed`)&&(process.exitCode=1)})}export{We as C,Ge as S,F as T,at as _,mr as a,ut as b,$ as c,Y as d,Q as f,it as g,st as h,Sr as i,xr as l,Un as m,wr as n,Cr as o,Kn as p,Er as r,_r as s,Tr as t,J as u,ct as v,xe as w,tt as x,ot as y};
|
|
408
|
+
//# sourceMappingURL=init-DsLc7vc7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DmKx1Dxe.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ln as e,Zr as t,lr as n}from"./dist-
|
|
1
|
+
import{Ln as e,Zr as t,lr as n}from"./dist-k62w-4-v.mjs";import{Kr as r,f as i}from"./dist-Bfw3oOGm.mjs";import{t as a}from"./constants-BVG2ymMz.mjs";import{t as o}from"./is-object-C-4FJ0rP.mjs";import{resolve as s}from"node:path";import{existsSync as c,readFileSync as l}from"node:fs";import{homedir as u}from"node:os";import{realpath as d}from"node:fs/promises";async function f(e){let t=s(e);try{return await d(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}var p=t();function m(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];o(a)&&o(i)?n[r]=m(i,a):a!==void 0&&(n[r]=a)}return n}function h(e){if(!c(e))return{value:null,path:e,source:null,doc:null};let t;try{t=l(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,p.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return o(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}const g=[`include`,`exclude`];function _(e){let t="Run `ok config migrate` to strip the obsolete key from config.yml automatically, or remove it by hand.";return e===`exclude`?[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,t].join(` `):[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,t].join(` `)}function v(e){let t=e.value;if(!o(t))return[];let r=t.content;if(!o(r))return[];let i=[];for(let t of g)if(t in r){let r=[`content`,t],a;e.doc!==null&&e.source!==null&&(a=n({file:e.path,source:e.source,doc:e.doc,path:r})),i.push({code:`REMOVED_KEY`,path:r,redirect:_(t),...a===void 0?{}:{source:a}})}return i}function y(e,t){return e.map(e=>{let r=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=n({file:t.path,source:t.source,doc:t.doc,path:r});if(e!==void 0)return{...i,source:e}}return i})}function b(t){let n=t??process.cwd(),o=[],c=s(u(),`.ok`,a),l=r({absPath:c}),d={};l.valid&&l.source!==void 0?(d=m(d,l.value),o.push(c)):l.valid;let f=s(n,`.ok`,a),p=h(f);if(p.value!==null){let t=v(p);if(t.length>0)throw Error(t.map(e).join(`
|
|
2
2
|
|
|
3
|
-
`));d=m(d,p.value),o.push(f)}x(d,[`upload`,`maxBytes`],`streaming uploads have no user-facing cap`),x(d,[`github`,`oauthAppClientId`],`use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID env var instead`),x(d,[`server`,`host`],`use the --host flag or HOST env var instead`),x(d,[`server`,`openOnAgentEdit`]),x(d,[`mcp`,`autoStart`],`to disable auto-start, set OK_MCP_AUTOSTART=0`),x(d,[`mcp`,`tools`,`read_document`,`historyDepth`]),x(d,[`mcp`,`tools`,`grep`,`maxResults`]),x(d,[`mcp`,`tools`,`search`,`maxResults`]);let g=i.safeParse(d);if(!g.success){let t={code:`SCHEMA_INVALID`,issues:y(g.error.issues,p)};throw Error(e(t))}return{config:g.data,sources:o}}function x(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){if(!o(r))return;r=r[t[e]]}if(!o(r))return;let i=t[t.length-1];if(r[i]===void 0)return;let a=t.join(`.`);console.warn(`[config] ${a} is no longer user-configurable; ${n??`the value is hardcoded in @inkeep/open-knowledge-core`}. Remove the key to silence this warning.`)}function S(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=f(e.startupCwd);return async o=>{let s=await f(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,S as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
3
|
+
`));d=m(d,p.value),o.push(f)}x(d,[`upload`,`maxBytes`],`streaming uploads have no user-facing cap`),x(d,[`github`,`oauthAppClientId`],`use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID env var instead`),x(d,[`server`,`host`],`use the --host flag or HOST env var instead`),x(d,[`server`,`openOnAgentEdit`]),x(d,[`mcp`,`autoStart`],`to disable auto-start, set OK_MCP_AUTOSTART=0`),x(d,[`mcp`,`tools`,`read_document`,`historyDepth`]),x(d,[`mcp`,`tools`,`grep`,`maxResults`]),x(d,[`mcp`,`tools`,`search`,`maxResults`]),x(d,[`preview`,`baseUrl`],"preview URLs now resolve only to the running UI process — start one with `ok ui`");let g=i.safeParse(d);if(!g.success){let t={code:`SCHEMA_INVALID`,issues:y(g.error.issues,p)};throw Error(e(t))}return{config:g.data,sources:o}}function x(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){if(!o(r))return;r=r[t[e]]}if(!o(r))return;let i=t[t.length-1];if(r[i]===void 0)return;let a=t.join(`.`);console.warn(`[config] ${a} is no longer user-configurable; ${n??`the value is hardcoded in @inkeep/open-knowledge-core`}. Remove the key to silence this warning.`)}function S(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=f(e.startupCwd);return async o=>{let s=await f(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,S as t};
|
|
4
|
+
//# sourceMappingURL=loader-DmKx1Dxe.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Ct as e}from"./dist-
|
|
1
|
+
import{Ct as e}from"./dist-Bfw3oOGm.mjs";import"./constants-BVG2ymMz.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-CuLb6srO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-CuLb6srO.mjs";export{t as formatPreviewBlock,e as previewContent};
|